import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; /******/ var __webpack_modules__ = ({ /***/ 3161: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var map = { "./de.js": [ 4576, 576 ], "./en.js": [ 9272 ], "./es.js": [ 9379, 379 ], "./fr.js": [ 9143, 143 ], "./it.js": [ 1766, 766 ], "./ja.js": [ 3694, 694 ], "./pt-br.js": [ 8944, 944 ], "./zh-cn.js": [ 699, 699 ], "./zh-tw.js": [ 9611, 611 ] }; function webpackAsyncContext(req) { if(!__nccwpck_require__.o(map, req)) { return Promise.resolve().then(() => { var e = new Error("Cannot find module '" + req + "'"); e.code = 'MODULE_NOT_FOUND'; throw e; }); } var ids = map[req], id = ids[0]; return Promise.all(ids.slice(1).map(__nccwpck_require__.e)).then(() => { return __nccwpck_require__(id); }); } webpackAsyncContext.keys = () => (Object.keys(map)); webpackAsyncContext.id = 3161; module.exports = webpackAsyncContext; /***/ }), /***/ 4914: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (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.prototype.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__(857)); const utils_1 = __nccwpck_require__(302); /** * 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 (0, utils_1.toCommandValue)(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A'); } function escapeProperty(s) { return (0, 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 /***/ }), /***/ 7484: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (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.prototype.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.platform = exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = exports.markdownSummary = exports.summary = exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; const command_1 = __nccwpck_require__(4914); const file_command_1 = __nccwpck_require__(4753); const utils_1 = __nccwpck_require__(302); const os = __importStar(__nccwpck_require__(857)); const path = __importStar(__nccwpck_require__(6928)); const oidc_utils_1 = __nccwpck_require__(5306); /** * 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 = 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 = (0, utils_1.toCommandValue)(val); process.env[name] = convertedVal; const filePath = process.env['GITHUB_ENV'] || ''; if (filePath) { return (0, file_command_1.issueFileCommand)('ENV', (0, file_command_1.prepareKeyValueMessage)(name, val)); } (0, 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) { (0, 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) { (0, file_command_1.issueFileCommand)('PATH', inputPath); } else { (0, command_1.issueCommand)('add-path', {}, inputPath); } process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; } exports.addPath = addPath; /** * Gets the value of an input. * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed. * Returns an empty string if the value is not defined. * * @param name name of the input to get * @param options optional. See InputOptions. * @returns string */ function getInput(name, options) { const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''; if (options && options.required && !val) { throw new Error(`Input required and not supplied: ${name}`); } if (options && options.trimWhitespace === false) { return val; } return val.trim(); } exports.getInput = getInput; /** * Gets the values of an multiline input. Each value is also trimmed. * * @param name name of the input to get * @param options optional. See InputOptions. * @returns string[] * */ function getMultilineInput(name, options) { const inputs = getInput(name, options) .split('\n') .filter(x => x !== ''); if (options && options.trimWhitespace === false) { return inputs; } return inputs.map(input => input.trim()); } exports.getMultilineInput = getMultilineInput; /** * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification. * Support boolean input list: `true | True | TRUE | false | False | FALSE` . * The return value is also in boolean type. * ref: https://yaml.org/spec/1.2/spec.html#id2804923 * * @param name name of the input to get * @param options optional. See InputOptions. * @returns boolean */ function getBooleanInput(name, options) { const trueValue = ['true', 'True', 'TRUE']; const falseValue = ['false', 'False', 'FALSE']; const val = getInput(name, options); if (trueValue.includes(val)) return true; if (falseValue.includes(val)) return false; throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` + `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } exports.getBooleanInput = getBooleanInput; /** * Sets the value of an output. * * @param name name of the output to set * @param value value to store. Non-string values will be converted to a string via JSON.stringify */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function setOutput(name, value) { const filePath = process.env['GITHUB_OUTPUT'] || ''; if (filePath) { return (0, file_command_1.issueFileCommand)('OUTPUT', (0, file_command_1.prepareKeyValueMessage)(name, value)); } process.stdout.write(os.EOL); (0, command_1.issueCommand)('set-output', { name }, (0, utils_1.toCommandValue)(value)); } exports.setOutput = setOutput; /** * Enables or disables the echoing of commands into stdout for the rest of the step. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. * */ function setCommandEcho(enabled) { (0, 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) { (0, 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 = {}) { (0, command_1.issueCommand)('error', (0, 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 = {}) { (0, command_1.issueCommand)('warning', (0, 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 = {}) { (0, command_1.issueCommand)('notice', (0, 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) { (0, command_1.issue)('group', name); } exports.startGroup = startGroup; /** * End an output group. */ function endGroup() { (0, command_1.issue)('endgroup'); } exports.endGroup = endGroup; /** * Wrap an asynchronous function call in a group. * * Returns the same type as the function itself. * * @param name The name of the group * @param fn The function to wrap in the group */ function group(name, fn) { return __awaiter(this, void 0, void 0, function* () { startGroup(name); let result; try { result = yield fn(); } finally { endGroup(); } return result; }); } exports.group = group; //----------------------------------------------------------------------- // Wrapper action state //----------------------------------------------------------------------- /** * Saves state for current action, the state can only be retrieved by this action's post job execution. * * @param name name of the state to store * @param value value to store. Non-string values will be converted to a string via JSON.stringify */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function saveState(name, value) { const filePath = process.env['GITHUB_STATE'] || ''; if (filePath) { return (0, file_command_1.issueFileCommand)('STATE', (0, file_command_1.prepareKeyValueMessage)(name, value)); } (0, command_1.issueCommand)('save-state', { name }, (0, utils_1.toCommandValue)(value)); } exports.saveState = saveState; /** * Gets the value of an state set by this action's main execution. * * @param name name of the state to get * @returns string */ function getState(name) { return process.env[`STATE_${name}`] || ''; } exports.getState = getState; function getIDToken(aud) { return __awaiter(this, void 0, void 0, function* () { return yield oidc_utils_1.OidcClient.getIDToken(aud); }); } exports.getIDToken = getIDToken; /** * Summary exports */ var summary_1 = __nccwpck_require__(1847); Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } })); /** * @deprecated use core.summary */ var summary_2 = __nccwpck_require__(1847); Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } })); /** * Path exports */ var path_utils_1 = __nccwpck_require__(1976); Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } })); Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } })); Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } })); /** * Platform utilities exports */ exports.platform = __importStar(__nccwpck_require__(8968)); //# sourceMappingURL=core.js.map /***/ }), /***/ 4753: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { // For internal use, subject to change. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (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.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ const crypto = __importStar(__nccwpck_require__(6982)); const fs = __importStar(__nccwpck_require__(9896)); const os = __importStar(__nccwpck_require__(857)); const utils_1 = __nccwpck_require__(302); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); } if (!fs.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } fs.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, { encoding: 'utf8' }); } exports.issueFileCommand = issueFileCommand; function prepareKeyValueMessage(key, value) { const delimiter = `ghadelimiter_${crypto.randomUUID()}`; const convertedValue = (0, utils_1.toCommandValue)(value); // These should realistically never happen, but just in case someone finds a // way to exploit uuid generation let's not allow keys or values that contain // the delimiter. if (key.includes(delimiter)) { throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } if (convertedValue.includes(delimiter)) { throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; } exports.prepareKeyValueMessage = prepareKeyValueMessage; //# sourceMappingURL=file-command.js.map /***/ }), /***/ 5306: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.OidcClient = void 0; const http_client_1 = __nccwpck_require__(4844); const auth_1 = __nccwpck_require__(4552); const core_1 = __nccwpck_require__(7484); class OidcClient { static createHttpClient(allowRetry = true, maxRetry = 10) { const requestOptions = { allowRetries: allowRetry, maxRetries: maxRetry }; return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions); } static getRequestToken() { const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN']; if (!token) { throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable'); } return token; } static getIDTokenUrl() { const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL']; if (!runtimeUrl) { throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable'); } return runtimeUrl; } static getCall(id_token_url) { var _a; return __awaiter(this, void 0, void 0, function* () { const httpclient = OidcClient.createHttpClient(); const res = yield httpclient .getJson(id_token_url) .catch(error => { throw new Error(`Failed to get ID Token. \n Error Code : ${error.statusCode}\n Error Message: ${error.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; if (!id_token) { throw new Error('Response json body do not have ID Token field'); } return id_token; }); } static getIDToken(audience) { return __awaiter(this, void 0, void 0, function* () { try { // New ID Token is requested from action service let id_token_url = OidcClient.getIDTokenUrl(); if (audience) { const encodedAudience = encodeURIComponent(audience); id_token_url = `${id_token_url}&audience=${encodedAudience}`; } (0, core_1.debug)(`ID token url is ${id_token_url}`); const id_token = yield OidcClient.getCall(id_token_url); (0, core_1.setSecret)(id_token); return id_token; } catch (error) { throw new Error(`Error message: ${error.message}`); } }); } } exports.OidcClient = OidcClient; //# sourceMappingURL=oidc-utils.js.map /***/ }), /***/ 1976: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (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.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; const path = __importStar(__nccwpck_require__(6928)); /** * toPosixPath converts the given path to the posix form. On Windows, \\ will be * replaced with /. * * @param pth. Path to transform. * @return string Posix path. */ function toPosixPath(pth) { return pth.replace(/[\\]/g, '/'); } exports.toPosixPath = toPosixPath; /** * toWin32Path converts the given path to the win32 form. On Linux, / will be * replaced with \\. * * @param pth. Path to transform. * @return string Win32 path. */ function toWin32Path(pth) { return pth.replace(/[/]/g, '\\'); } exports.toWin32Path = toWin32Path; /** * toPlatformPath converts the given path to a platform-specific path. It does * this by replacing instances of / and \ with the platform-specific path * separator. * * @param pth The path to platformize. * @return string The platform-specific path. */ function toPlatformPath(pth) { return pth.replace(/[/\\]/g, path.sep); } exports.toPlatformPath = toPlatformPath; //# sourceMappingURL=path-utils.js.map /***/ }), /***/ 8968: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (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.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getDetails = exports.isLinux = exports.isMacOS = exports.isWindows = exports.arch = exports.platform = void 0; const os_1 = __importDefault(__nccwpck_require__(857)); const exec = __importStar(__nccwpck_require__(5236)); const getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () { const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', undefined, { silent: true }); const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', undefined, { silent: true }); return { name: name.trim(), version: version.trim() }; }); const getMacOsInfo = () => __awaiter(void 0, void 0, void 0, function* () { var _a, _b, _c, _d; const { stdout } = yield exec.getExecOutput('sw_vers', undefined, { silent: true }); const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ''; const name = (_d = (_c = stdout.match(/ProductName:\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : ''; return { name, version }; }); const getLinuxInfo = () => __awaiter(void 0, void 0, void 0, function* () { const { stdout } = yield exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], { silent: true }); const [name, version] = stdout.trim().split('\n'); return { name, version }; }); exports.platform = os_1.default.platform(); exports.arch = os_1.default.arch(); exports.isWindows = exports.platform === 'win32'; exports.isMacOS = exports.platform === 'darwin'; exports.isLinux = exports.platform === 'linux'; function getDetails() { return __awaiter(this, void 0, void 0, function* () { return Object.assign(Object.assign({}, (yield (exports.isWindows ? getWindowsInfo() : exports.isMacOS ? getMacOsInfo() : getLinuxInfo()))), { platform: exports.platform, arch: exports.arch, isWindows: exports.isWindows, isMacOS: exports.isMacOS, isLinux: exports.isLinux }); }); } exports.getDetails = getDetails; //# sourceMappingURL=platform.js.map /***/ }), /***/ 1847: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0; const os_1 = __nccwpck_require__(857); const fs_1 = __nccwpck_require__(9896); const { access, appendFile, writeFile } = fs_1.promises; exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY'; exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary'; class Summary { constructor() { this._buffer = ''; } /** * Finds the summary file path from the environment, rejects if env var is not found or file does not exist * Also checks r/w permissions. * * @returns step summary file path */ filePath() { return __awaiter(this, void 0, void 0, function* () { if (this._filePath) { return this._filePath; } const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR]; if (!pathFromEnv) { throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); } try { yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); } catch (_a) { throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); } this._filePath = pathFromEnv; return this._filePath; }); } /** * Wraps content in an HTML tag, adding any HTML attributes * * @param {string} tag HTML tag to wrap * @param {string | null} content content within the tag * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add * * @returns {string} content wrapped in HTML element */ wrap(tag, content, attrs = {}) { const htmlAttrs = Object.entries(attrs) .map(([key, value]) => ` ${key}="${value}"`) .join(''); if (!content) { return `<${tag}${htmlAttrs}>`; } return `<${tag}${htmlAttrs}>${content}`; } /** * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. * * @param {SummaryWriteOptions} [options] (optional) options for write operation * * @returns {Promise} summary instance */ write(options) { return __awaiter(this, void 0, void 0, function* () { const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); const filePath = yield this.filePath(); const writeFunc = overwrite ? writeFile : appendFile; yield writeFunc(filePath, this._buffer, { encoding: 'utf8' }); return this.emptyBuffer(); }); } /** * Clears the summary buffer and wipes the summary file * * @returns {Summary} summary instance */ clear() { return __awaiter(this, void 0, void 0, function* () { return this.emptyBuffer().write({ overwrite: true }); }); } /** * Returns the current summary buffer as a string * * @returns {string} string of summary buffer */ stringify() { return this._buffer; } /** * If the summary buffer is empty * * @returns {boolen} true if the buffer is empty */ isEmptyBuffer() { return this._buffer.length === 0; } /** * Resets the summary buffer without writing to summary file * * @returns {Summary} summary instance */ emptyBuffer() { this._buffer = ''; return this; } /** * Adds raw text to the summary buffer * * @param {string} text content to add * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) * * @returns {Summary} summary instance */ addRaw(text, addEOL = false) { this._buffer += text; return addEOL ? this.addEOL() : this; } /** * Adds the operating system-specific end-of-line marker to the buffer * * @returns {Summary} summary instance */ addEOL() { return this.addRaw(os_1.EOL); } /** * Adds an HTML codeblock to the summary buffer * * @param {string} code content to render within fenced code block * @param {string} lang (optional) language to syntax highlight code * * @returns {Summary} summary instance */ addCodeBlock(code, lang) { const attrs = Object.assign({}, (lang && { lang })); const element = this.wrap('pre', this.wrap('code', code), attrs); return this.addRaw(element).addEOL(); } /** * Adds an HTML list to the summary buffer * * @param {string[]} items list of items to render * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) * * @returns {Summary} summary instance */ addList(items, ordered = false) { const tag = ordered ? 'ol' : 'ul'; const listItems = items.map(item => this.wrap('li', item)).join(''); const element = this.wrap(tag, listItems); return this.addRaw(element).addEOL(); } /** * Adds an HTML table to the summary buffer * * @param {SummaryTableCell[]} rows table rows * * @returns {Summary} summary instance */ addTable(rows) { const tableBody = rows .map(row => { const cells = row .map(cell => { if (typeof cell === 'string') { return this.wrap('td', cell); } const { header, data, colspan, rowspan } = cell; const tag = header ? 'th' : 'td'; const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan })); return this.wrap(tag, data, attrs); }) .join(''); return this.wrap('tr', cells); }) .join(''); const element = this.wrap('table', tableBody); return this.addRaw(element).addEOL(); } /** * Adds a collapsable HTML details element to the summary buffer * * @param {string} label text for the closed state * @param {string} content collapsable content * * @returns {Summary} summary instance */ addDetails(label, content) { const element = this.wrap('details', this.wrap('summary', label) + content); return this.addRaw(element).addEOL(); } /** * Adds an HTML image tag to the summary buffer * * @param {string} src path to the image you to embed * @param {string} alt text description of the image * @param {SummaryImageOptions} options (optional) addition image attributes * * @returns {Summary} summary instance */ addImage(src, alt, options) { const { width, height } = options || {}; const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height })); const element = this.wrap('img', null, Object.assign({ src, alt }, attrs)); return this.addRaw(element).addEOL(); } /** * Adds an HTML section heading element * * @param {string} text heading text * @param {number | string} [level=1] (optional) the heading level, default: 1 * * @returns {Summary} summary instance */ addHeading(text, level) { const tag = `h${level}`; const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag) ? tag : 'h1'; const element = this.wrap(allowedTag, text); return this.addRaw(element).addEOL(); } /** * Adds an HTML thematic break (
) to the summary buffer * * @returns {Summary} summary instance */ addSeparator() { const element = this.wrap('hr', null); return this.addRaw(element).addEOL(); } /** * Adds an HTML line break (
) to the summary buffer * * @returns {Summary} summary instance */ addBreak() { const element = this.wrap('br', null); return this.addRaw(element).addEOL(); } /** * Adds an HTML blockquote to the summary buffer * * @param {string} text quote text * @param {string} cite (optional) citation url * * @returns {Summary} summary instance */ addQuote(text, cite) { const attrs = Object.assign({}, (cite && { cite })); const element = this.wrap('blockquote', text, attrs); return this.addRaw(element).addEOL(); } /** * Adds an HTML anchor tag to the summary buffer * * @param {string} text link text/content * @param {string} href hyperlink * * @returns {Summary} summary instance */ addLink(text, href) { const element = this.wrap('a', text, { href }); return this.addRaw(element).addEOL(); } } const _summary = new Summary(); /** * @deprecated use `core.summary` */ exports.markdownSummary = _summary; exports.summary = _summary; //# sourceMappingURL=summary.js.map /***/ }), /***/ 302: /***/ ((__unused_webpack_module, exports) => { // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.toCommandProperties = exports.toCommandValue = void 0; /** * Sanitizes an input into a string so it can be passed into issueCommand safely * @param input input to sanitize into a string */ function toCommandValue(input) { if (input === null || input === undefined) { return ''; } else if (typeof input === 'string' || input instanceof String) { return input; } return JSON.stringify(input); } exports.toCommandValue = toCommandValue; /** * * @param annotationProperties * @returns The command properties to send with the actual annotation command * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646 */ function toCommandProperties(annotationProperties) { if (!Object.keys(annotationProperties).length) { return {}; } return { title: annotationProperties.title, file: annotationProperties.file, line: annotationProperties.startLine, endLine: annotationProperties.endLine, col: annotationProperties.startColumn, endColumn: annotationProperties.endColumn }; } exports.toCommandProperties = toCommandProperties; //# sourceMappingURL=utils.js.map /***/ }), /***/ 5236: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getExecOutput = exports.exec = void 0; const string_decoder_1 = __nccwpck_require__(3193); const tr = __importStar(__nccwpck_require__(6665)); /** * Exec a command. * Output will be streamed to the live console. * Returns promise with return code * * @param commandLine command to execute (can include additional args). Must be correctly escaped. * @param args optional arguments for tool. Escaping is handled by the lib. * @param options optional exec options. See ExecOptions * @returns Promise exit code */ function exec(commandLine, args, options) { return __awaiter(this, void 0, void 0, function* () { const commandArgs = tr.argStringToArray(commandLine); if (commandArgs.length === 0) { throw new Error(`Parameter 'commandLine' cannot be null or empty.`); } // Path to tool to execute should be first arg const toolPath = commandArgs[0]; args = commandArgs.slice(1).concat(args || []); const runner = new tr.ToolRunner(toolPath, args, options); return runner.exec(); }); } exports.exec = exec; /** * Exec a command and get the output. * Output will be streamed to the live console. * Returns promise with the exit code and collected stdout and stderr * * @param commandLine command to execute (can include additional args). Must be correctly escaped. * @param args optional arguments for tool. Escaping is handled by the lib. * @param options optional exec options. See ExecOptions * @returns Promise exit code, stdout, and stderr */ function getExecOutput(commandLine, args, options) { var _a, _b; return __awaiter(this, void 0, void 0, function* () { let stdout = ''; let stderr = ''; //Using string decoder covers the case where a mult-byte character is split const stdoutDecoder = new string_decoder_1.StringDecoder('utf8'); const stderrDecoder = new string_decoder_1.StringDecoder('utf8'); const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout; const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr; const stdErrListener = (data) => { stderr += stderrDecoder.write(data); if (originalStdErrListener) { originalStdErrListener(data); } }; const stdOutListener = (data) => { stdout += stdoutDecoder.write(data); if (originalStdoutListener) { originalStdoutListener(data); } }; const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); //flush any remaining characters stdout += stdoutDecoder.end(); stderr += stderrDecoder.end(); return { exitCode, stdout, stderr }; }); } exports.getExecOutput = getExecOutput; //# sourceMappingURL=exec.js.map /***/ }), /***/ 6665: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.argStringToArray = exports.ToolRunner = void 0; const os = __importStar(__nccwpck_require__(857)); const events = __importStar(__nccwpck_require__(4434)); const child = __importStar(__nccwpck_require__(5317)); const path = __importStar(__nccwpck_require__(6928)); const io = __importStar(__nccwpck_require__(4994)); const ioUtil = __importStar(__nccwpck_require__(5207)); const timers_1 = __nccwpck_require__(3557); /* eslint-disable @typescript-eslint/unbound-method */ const IS_WINDOWS = process.platform === 'win32'; /* * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. */ class ToolRunner extends events.EventEmitter { constructor(toolPath, args, options) { super(); if (!toolPath) { throw new Error("Parameter 'toolPath' cannot be null or empty."); } this.toolPath = toolPath; this.args = args || []; this.options = options || {}; } _debug(message) { if (this.options.listeners && this.options.listeners.debug) { this.options.listeners.debug(message); } } _getCommandString(options, noPrefix) { const toolPath = this._getSpawnFileName(); const args = this._getSpawnArgs(options); let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool if (IS_WINDOWS) { // Windows + cmd file if (this._isCmdFile()) { cmd += toolPath; for (const a of args) { cmd += ` ${a}`; } } // Windows + verbatim else if (options.windowsVerbatimArguments) { cmd += `"${toolPath}"`; for (const a of args) { cmd += ` ${a}`; } } // Windows (regular) else { cmd += this._windowsQuoteCmdArg(toolPath); for (const a of args) { cmd += ` ${this._windowsQuoteCmdArg(a)}`; } } } else { // OSX/Linux - this can likely be improved with some form of quoting. // creating processes on Unix is fundamentally different than Windows. // on Unix, execvp() takes an arg array. cmd += toolPath; for (const a of args) { cmd += ` ${a}`; } } return cmd; } _processLineBuffer(data, strBuffer, onLine) { try { let s = strBuffer + data.toString(); let n = s.indexOf(os.EOL); while (n > -1) { const line = s.substring(0, n); onLine(line); // the rest of the string ... s = s.substring(n + os.EOL.length); n = s.indexOf(os.EOL); } return s; } catch (err) { // streaming lines to console is best effort. Don't fail a build. this._debug(`error processing line. Failed with error ${err}`); return ''; } } _getSpawnFileName() { if (IS_WINDOWS) { if (this._isCmdFile()) { return process.env['COMSPEC'] || 'cmd.exe'; } } return this.toolPath; } _getSpawnArgs(options) { if (IS_WINDOWS) { if (this._isCmdFile()) { let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; for (const a of this.args) { argline += ' '; argline += options.windowsVerbatimArguments ? a : this._windowsQuoteCmdArg(a); } argline += '"'; return [argline]; } } return this.args; } _endsWith(str, end) { return str.endsWith(end); } _isCmdFile() { const upperToolPath = this.toolPath.toUpperCase(); return (this._endsWith(upperToolPath, '.CMD') || this._endsWith(upperToolPath, '.BAT')); } _windowsQuoteCmdArg(arg) { // for .exe, apply the normal quoting rules that libuv applies if (!this._isCmdFile()) { return this._uvQuoteCmdArg(arg); } // otherwise apply quoting rules specific to the cmd.exe command line parser. // the libuv rules are generic and are not designed specifically for cmd.exe // command line parser. // // for a detailed description of the cmd.exe command line parser, refer to // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 // need quotes for empty arg if (!arg) { return '""'; } // determine whether the arg needs to be quoted const cmdSpecialChars = [ ' ', '\t', '&', '(', ')', '[', ']', '{', '}', '^', '=', ';', '!', "'", '+', ',', '`', '~', '|', '<', '>', '"' ]; let needsQuotes = false; for (const char of arg) { if (cmdSpecialChars.some(x => x === char)) { needsQuotes = true; break; } } // short-circuit if quotes not needed if (!needsQuotes) { return arg; } // the following quoting rules are very similar to the rules that by libuv applies. // // 1) wrap the string in quotes // // 2) double-up quotes - i.e. " => "" // // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately // doesn't work well with a cmd.exe command line. // // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. // for example, the command line: // foo.exe "myarg:""my val""" // is parsed by a .NET console app into an arg array: // [ "myarg:\"my val\"" ] // which is the same end result when applying libuv quoting rules. although the actual // command line from libuv quoting rules would look like: // foo.exe "myarg:\"my val\"" // // 3) double-up slashes that precede a quote, // e.g. hello \world => "hello \world" // hello\"world => "hello\\""world" // hello\\"world => "hello\\\\""world" // hello world\ => "hello world\\" // // technically this is not required for a cmd.exe command line, or the batch argument parser. // the reasons for including this as a .cmd quoting rule are: // // a) this is optimized for the scenario where the argument is passed from the .cmd file to an // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. // // b) it's what we've been doing previously (by deferring to node default behavior) and we // haven't heard any complaints about that aspect. // // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be // escaped when used on the command line directly - even though within a .cmd file % can be escaped // by using %%. // // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. // // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args // to an external program. // // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. // % can be escaped within a .cmd file. let reverse = '"'; let quoteHit = true; for (let i = arg.length; i > 0; i--) { // walk the string in reverse reverse += arg[i - 1]; if (quoteHit && arg[i - 1] === '\\') { reverse += '\\'; // double the slash } else if (arg[i - 1] === '"') { quoteHit = true; reverse += '"'; // double the quote } else { quoteHit = false; } } reverse += '"'; return reverse .split('') .reverse() .join(''); } _uvQuoteCmdArg(arg) { // Tool runner wraps child_process.spawn() and needs to apply the same quoting as // Node in certain cases where the undocumented spawn option windowsVerbatimArguments // is used. // // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), // pasting copyright notice from Node within this function: // // Copyright Joyent, Inc. and other Node contributors. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. if (!arg) { // Need double quotation for empty argument return '""'; } if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) { // No quotation needed return arg; } if (!arg.includes('"') && !arg.includes('\\')) { // No embedded double quotes or backslashes, so I can just wrap // quote marks around the whole thing. return `"${arg}"`; } // Expected input/output: // input : hello"world // output: "hello\"world" // input : hello""world // output: "hello\"\"world" // input : hello\world // output: hello\world // input : hello\\world // output: hello\\world // input : hello\"world // output: "hello\\\"world" // input : hello\\"world // output: "hello\\\\\"world" // input : hello world\ // output: "hello world\\" - note the comment in libuv actually reads "hello world\" // but it appears the comment is wrong, it should be "hello world\\" let reverse = '"'; let quoteHit = true; for (let i = arg.length; i > 0; i--) { // walk the string in reverse reverse += arg[i - 1]; if (quoteHit && arg[i - 1] === '\\') { reverse += '\\'; } else if (arg[i - 1] === '"') { quoteHit = true; reverse += '\\'; } else { quoteHit = false; } } reverse += '"'; return reverse .split('') .reverse() .join(''); } _cloneExecOptions(options) { options = options || {}; const result = { cwd: options.cwd || process.cwd(), env: options.env || process.env, silent: options.silent || false, windowsVerbatimArguments: options.windowsVerbatimArguments || false, failOnStdErr: options.failOnStdErr || false, ignoreReturnCode: options.ignoreReturnCode || false, delay: options.delay || 10000 }; result.outStream = options.outStream || process.stdout; result.errStream = options.errStream || process.stderr; return result; } _getSpawnOptions(options, toolPath) { options = options || {}; const result = {}; result.cwd = options.cwd; result.env = options.env; result['windowsVerbatimArguments'] = options.windowsVerbatimArguments || this._isCmdFile(); if (options.windowsVerbatimArguments) { result.argv0 = `"${toolPath}"`; } return result; } /** * Exec a tool. * Output will be streamed to the live console. * Returns promise with return code * * @param tool path to tool to exec * @param options optional exec options. See ExecOptions * @returns number */ exec() { return __awaiter(this, void 0, void 0, function* () { // root the tool path if it is unrooted and contains relative pathing if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes('/') || (IS_WINDOWS && this.toolPath.includes('\\')))) { // prefer options.cwd if it is specified, however options.cwd may also need to be rooted this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } // if the tool is only a file name, then resolve it from the PATH // otherwise verify it exists (add extension on Windows if necessary) this.toolPath = yield io.which(this.toolPath, true); return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { this._debug(`exec tool: ${this.toolPath}`); this._debug('arguments:'); for (const arg of this.args) { this._debug(` ${arg}`); } const optionsNonNull = this._cloneExecOptions(this.options); if (!optionsNonNull.silent && optionsNonNull.outStream) { optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); } const state = new ExecState(optionsNonNull, this.toolPath); state.on('debug', (message) => { this._debug(message); }); if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) { return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`)); } const fileName = this._getSpawnFileName(); const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); let stdbuffer = ''; if (cp.stdout) { cp.stdout.on('data', (data) => { if (this.options.listeners && this.options.listeners.stdout) { this.options.listeners.stdout(data); } if (!optionsNonNull.silent && optionsNonNull.outStream) { optionsNonNull.outStream.write(data); } stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => { if (this.options.listeners && this.options.listeners.stdline) { this.options.listeners.stdline(line); } }); }); } let errbuffer = ''; if (cp.stderr) { cp.stderr.on('data', (data) => { state.processStderr = true; if (this.options.listeners && this.options.listeners.stderr) { this.options.listeners.stderr(data); } if (!optionsNonNull.silent && optionsNonNull.errStream && optionsNonNull.outStream) { const s = optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream; s.write(data); } errbuffer = this._processLineBuffer(data, errbuffer, (line) => { if (this.options.listeners && this.options.listeners.errline) { this.options.listeners.errline(line); } }); }); } cp.on('error', (err) => { state.processError = err.message; state.processExited = true; state.processClosed = true; state.CheckComplete(); }); cp.on('exit', (code) => { state.processExitCode = code; state.processExited = true; this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); state.CheckComplete(); }); cp.on('close', (code) => { state.processExitCode = code; state.processExited = true; state.processClosed = true; this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); state.CheckComplete(); }); state.on('done', (error, exitCode) => { if (stdbuffer.length > 0) { this.emit('stdline', stdbuffer); } if (errbuffer.length > 0) { this.emit('errline', errbuffer); } cp.removeAllListeners(); if (error) { reject(error); } else { resolve(exitCode); } }); if (this.options.input) { if (!cp.stdin) { throw new Error('child process missing stdin'); } cp.stdin.end(this.options.input); } })); }); } } exports.ToolRunner = ToolRunner; /** * Convert an arg string to an array of args. Handles escaping * * @param argString string of arguments * @returns string[] array of arguments */ function argStringToArray(argString) { const args = []; let inQuotes = false; let escaped = false; let arg = ''; function append(c) { // we only escape double quotes. if (escaped && c !== '"') { arg += '\\'; } arg += c; escaped = false; } for (let i = 0; i < argString.length; i++) { const c = argString.charAt(i); if (c === '"') { if (!escaped) { inQuotes = !inQuotes; } else { append(c); } continue; } if (c === '\\' && escaped) { append(c); continue; } if (c === '\\' && inQuotes) { escaped = true; continue; } if (c === ' ' && !inQuotes) { if (arg.length > 0) { args.push(arg); arg = ''; } continue; } append(c); } if (arg.length > 0) { args.push(arg.trim()); } return args; } exports.argStringToArray = argStringToArray; class ExecState extends events.EventEmitter { constructor(options, toolPath) { super(); this.processClosed = false; // tracks whether the process has exited and stdio is closed this.processError = ''; this.processExitCode = 0; this.processExited = false; // tracks whether the process has exited this.processStderr = false; // tracks whether stderr was written to this.delay = 10000; // 10 seconds this.done = false; this.timeout = null; if (!toolPath) { throw new Error('toolPath must not be empty'); } this.options = options; this.toolPath = toolPath; if (options.delay) { this.delay = options.delay; } } CheckComplete() { if (this.done) { return; } if (this.processClosed) { this._setResult(); } else if (this.processExited) { this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this); } } _debug(message) { this.emit('debug', message); } _setResult() { // determine whether there is an error let error; if (this.processExited) { if (this.processError) { error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); } else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); } else if (this.processStderr && this.options.failOnStdErr) { error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); } } // clear the timeout if (this.timeout) { clearTimeout(this.timeout); this.timeout = null; } this.done = true; this.emit('done', error, this.processExitCode); } static HandleTimeout(state) { if (state.done) { return; } if (!state.processClosed && state.processExited) { const message = `The STDIO streams did not close within ${state.delay / 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; state._debug(message); } state._setResult(); } } //# sourceMappingURL=toolrunner.js.map /***/ }), /***/ 4552: /***/ (function(__unused_webpack_module, exports) { var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0; class BasicCredentialHandler { constructor(username, password) { this.username = username; this.password = password; } prepareRequest(options) { if (!options.headers) { throw Error('The request has no headers'); } options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`; } // This handler cannot handle 401 canHandleAuthentication() { return false; } handleAuthentication() { return __awaiter(this, void 0, void 0, function* () { throw new Error('not implemented'); }); } } exports.BasicCredentialHandler = BasicCredentialHandler; class BearerCredentialHandler { constructor(token) { this.token = token; } // currently implements pre-authorization // TODO: support preAuth = false where it hooks on 401 prepareRequest(options) { if (!options.headers) { throw Error('The request has no headers'); } options.headers['Authorization'] = `Bearer ${this.token}`; } // This handler cannot handle 401 canHandleAuthentication() { return false; } handleAuthentication() { return __awaiter(this, void 0, void 0, function* () { throw new Error('not implemented'); }); } } exports.BearerCredentialHandler = BearerCredentialHandler; class PersonalAccessTokenCredentialHandler { constructor(token) { this.token = token; } // currently implements pre-authorization // TODO: support preAuth = false where it hooks on 401 prepareRequest(options) { if (!options.headers) { throw Error('The request has no headers'); } options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`; } // This handler cannot handle 401 canHandleAuthentication() { return false; } handleAuthentication() { return __awaiter(this, void 0, void 0, function* () { throw new Error('not implemented'); }); } } exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; //# sourceMappingURL=auth.js.map /***/ }), /***/ 4844: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { /* eslint-disable @typescript-eslint/no-explicit-any */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (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.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; const http = __importStar(__nccwpck_require__(8611)); const https = __importStar(__nccwpck_require__(5692)); const pm = __importStar(__nccwpck_require__(4988)); const tunnel = __importStar(__nccwpck_require__(770)); const undici_1 = __nccwpck_require__(6752); var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; })(HttpCodes || (exports.HttpCodes = HttpCodes = {})); var Headers; (function (Headers) { Headers["Accept"] = "accept"; Headers["ContentType"] = "content-type"; })(Headers || (exports.Headers = Headers = {})); var MediaTypes; (function (MediaTypes) { MediaTypes["ApplicationJson"] = "application/json"; })(MediaTypes || (exports.MediaTypes = MediaTypes = {})); /** * Returns the proxy URL, depending upon the supplied url and proxy environment variables. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com */ function getProxyUrl(serverUrl) { const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); return proxyUrl ? proxyUrl.href : ''; } exports.getProxyUrl = getProxyUrl; const HttpRedirectCodes = [ HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect ]; const HttpResponseRetryCodes = [ HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout ]; const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; const ExponentialBackoffCeiling = 10; const ExponentialBackoffTimeSlice = 5; class HttpClientError extends Error { constructor(message, statusCode) { super(message); this.name = 'HttpClientError'; this.statusCode = statusCode; Object.setPrototypeOf(this, HttpClientError.prototype); } } exports.HttpClientError = HttpClientError; class HttpClientResponse { constructor(message) { this.message = message; } readBody() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on('data', (chunk) => { output = Buffer.concat([output, chunk]); }); this.message.on('end', () => { resolve(output.toString()); }); })); }); } readBodyBuffer() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { const chunks = []; this.message.on('data', (chunk) => { chunks.push(chunk); }); this.message.on('end', () => { resolve(Buffer.concat(chunks)); }); })); }); } } exports.HttpClientResponse = HttpClientResponse; function isHttps(requestUrl) { const parsedUrl = new URL(requestUrl); return parsedUrl.protocol === 'https:'; } exports.isHttps = isHttps; class HttpClient { constructor(userAgent, handlers, requestOptions) { this._ignoreSslError = false; this._allowRedirects = true; this._allowRedirectDowngrade = false; this._maxRedirects = 50; this._allowRetries = false; this._maxRetries = 1; this._keepAlive = false; this._disposed = false; this.userAgent = userAgent; this.handlers = handlers || []; this.requestOptions = requestOptions; if (requestOptions) { if (requestOptions.ignoreSslError != null) { this._ignoreSslError = requestOptions.ignoreSslError; } this._socketTimeout = requestOptions.socketTimeout; if (requestOptions.allowRedirects != null) { this._allowRedirects = requestOptions.allowRedirects; } if (requestOptions.allowRedirectDowngrade != null) { this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; } if (requestOptions.maxRedirects != null) { this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); } if (requestOptions.keepAlive != null) { this._keepAlive = requestOptions.keepAlive; } if (requestOptions.allowRetries != null) { this._allowRetries = requestOptions.allowRetries; } if (requestOptions.maxRetries != null) { this._maxRetries = requestOptions.maxRetries; } } } options(requestUrl, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request('GET', requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request('DELETE', requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request('POST', requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request('PATCH', requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request('PUT', requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request('HEAD', requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream, additionalHeaders); }); } /** * Gets a typed object from an endpoint * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ getJson(requestUrl, additionalHeaders = {}) { return __awaiter(this, void 0, void 0, function* () { additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); const res = yield this.get(requestUrl, additionalHeaders); return this._processResponse(res, this.requestOptions); }); } postJson(requestUrl, obj, additionalHeaders = {}) { return __awaiter(this, void 0, void 0, function* () { const data = JSON.stringify(obj, null, 2); additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); const res = yield this.post(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); } putJson(requestUrl, obj, additionalHeaders = {}) { return __awaiter(this, void 0, void 0, function* () { const data = JSON.stringify(obj, null, 2); additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); const res = yield this.put(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); } patchJson(requestUrl, obj, additionalHeaders = {}) { return __awaiter(this, void 0, void 0, function* () { const data = JSON.stringify(obj, null, 2); additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); const res = yield this.patch(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); } /** * Makes a raw http request. * All other methods such as get, post, patch, and request ultimately call this. * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { return __awaiter(this, void 0, void 0, function* () { if (this._disposed) { throw new Error('Client has already been disposed.'); } const parsedUrl = new URL(requestUrl); let info = this._prepareRequest(verb, parsedUrl, headers); // Only perform retries on reads since writes may not be idempotent. const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1; let numTries = 0; let response; do { response = yield this.requestRaw(info, data); // Check if it's an authentication challenge if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { let authenticationHandler; for (const handler of this.handlers) { if (handler.canHandleAuthentication(response)) { authenticationHandler = handler; break; } } if (authenticationHandler) { return authenticationHandler.handleAuthentication(this, info, data); } else { // We have received an unauthorized response but have no handlers to handle it. // Let the response return to the caller. return response; } } let redirectsRemaining = this._maxRedirects; while (response.message.statusCode && HttpRedirectCodes.includes(response.message.statusCode) && this._allowRedirects && redirectsRemaining > 0) { const redirectUrl = response.message.headers['location']; if (!redirectUrl) { // if there's no location to redirect to, we won't break; } const parsedRedirectUrl = new URL(redirectUrl); if (parsedUrl.protocol === 'https:' && parsedUrl.protocol !== parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) { throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.'); } // we need to finish reading the response before reassigning response // which will leak the open socket. yield response.readBody(); // strip authorization header if redirected to a different hostname if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { for (const header in headers) { // header names are case insensitive if (header.toLowerCase() === 'authorization') { delete headers[header]; } } } // let's make the request with the new redirectUrl info = this._prepareRequest(verb, parsedRedirectUrl, headers); response = yield this.requestRaw(info, data); redirectsRemaining--; } if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { // If not a retry code, return immediately instead of retrying return response; } numTries += 1; if (numTries < maxTries) { yield response.readBody(); yield this._performExponentialBackoff(numTries); } } while (numTries < maxTries); return response; }); } /** * Needs to be called if keepAlive is set to true in request options. */ dispose() { if (this._agent) { this._agent.destroy(); } this._disposed = true; } /** * Raw request. * @param info * @param data */ requestRaw(info, data) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => { function callbackForResult(err, res) { if (err) { reject(err); } else if (!res) { // If `err` is not passed, then `res` must be passed. reject(new Error('Unknown error')); } else { resolve(res); } } this.requestRawWithCallback(info, data, callbackForResult); }); }); } /** * Raw request with callback. * @param info * @param data * @param onResult */ requestRawWithCallback(info, data, onResult) { if (typeof data === 'string') { if (!info.options.headers) { info.options.headers = {}; } info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); } let callbackCalled = false; function handleResult(err, res) { if (!callbackCalled) { callbackCalled = true; onResult(err, res); } } const req = info.httpModule.request(info.options, (msg) => { const res = new HttpClientResponse(msg); handleResult(undefined, res); }); let socket; req.on('socket', sock => { socket = sock; }); // If we ever get disconnected, we want the socket to timeout eventually req.setTimeout(this._socketTimeout || 3 * 60000, () => { if (socket) { socket.end(); } handleResult(new Error(`Request timeout: ${info.options.path}`)); }); req.on('error', function (err) { // err has statusCode property // res should have headers handleResult(err); }); if (data && typeof data === 'string') { req.write(data, 'utf8'); } if (data && typeof data !== 'string') { data.on('close', function () { req.end(); }); data.pipe(req); } else { req.end(); } } /** * Gets an http agent. This function is useful when you need an http agent that handles * routing through a proxy server - depending upon the url and proxy environment variables. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com */ getAgent(serverUrl) { const parsedUrl = new URL(serverUrl); return this._getAgent(parsedUrl); } getAgentDispatcher(serverUrl) { const parsedUrl = new URL(serverUrl); const proxyUrl = pm.getProxyUrl(parsedUrl); const useProxy = proxyUrl && proxyUrl.hostname; if (!useProxy) { return; } return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); } _prepareRequest(method, requestUrl, headers) { const info = {}; info.parsedUrl = requestUrl; const usingSsl = info.parsedUrl.protocol === 'https:'; info.httpModule = usingSsl ? https : http; const defaultPort = usingSsl ? 443 : 80; info.options = {}; info.options.host = info.parsedUrl.hostname; info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort; info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); info.options.method = method; info.options.headers = this._mergeHeaders(headers); if (this.userAgent != null) { info.options.headers['user-agent'] = this.userAgent; } info.options.agent = this._getAgent(info.parsedUrl); // gives handlers an opportunity to participate if (this.handlers) { for (const handler of this.handlers) { handler.prepareRequest(info.options); } } return info; } _mergeHeaders(headers) { if (this.requestOptions && this.requestOptions.headers) { return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); } return lowercaseKeys(headers || {}); } _getExistingOrDefaultHeader(additionalHeaders, header, _default) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; } return additionalHeaders[header] || clientHeader || _default; } _getAgent(parsedUrl) { let agent; const proxyUrl = pm.getProxyUrl(parsedUrl); const useProxy = proxyUrl && proxyUrl.hostname; if (this._keepAlive && useProxy) { agent = this._proxyAgent; } if (!useProxy) { agent = this._agent; } // if agent is already assigned use that agent. if (agent) { return agent; } const usingSsl = parsedUrl.protocol === 'https:'; let maxSockets = 100; if (this.requestOptions) { maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; } // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis. if (proxyUrl && proxyUrl.hostname) { const agentOptions = { maxSockets, keepAlive: this._keepAlive, proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && { proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` })), { host: proxyUrl.hostname, port: proxyUrl.port }) }; let tunnelAgent; const overHttps = proxyUrl.protocol === 'https:'; if (usingSsl) { tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; } else { tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; } agent = tunnelAgent(agentOptions); this._proxyAgent = agent; } // if tunneling agent isn't assigned create a new agent if (!agent) { const options = { keepAlive: this._keepAlive, maxSockets }; agent = usingSsl ? new https.Agent(options) : new http.Agent(options); this._agent = agent; } if (usingSsl && this._ignoreSslError) { // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options // we have to cast it to any and change it directly agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false }); } return agent; } _getProxyAgentDispatcher(parsedUrl, proxyUrl) { let proxyAgent; if (this._keepAlive) { proxyAgent = this._proxyAgentDispatcher; } // if agent is already assigned use that agent. if (proxyAgent) { return proxyAgent; } const usingSsl = parsedUrl.protocol === 'https:'; proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && { token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString('base64')}` }))); this._proxyAgentDispatcher = proxyAgent; if (usingSsl && this._ignoreSslError) { // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options // we have to cast it to any and change it directly proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, { rejectUnauthorized: false }); } return proxyAgent; } _performExponentialBackoff(retryNumber) { return __awaiter(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise(resolve => setTimeout(() => resolve(), ms)); }); } _processResponse(res, options) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, result: null, headers: {} }; // not found leads to null obj returned if (statusCode === HttpCodes.NotFound) { resolve(response); } // get the result from the body function dateTimeDeserializer(key, value) { if (typeof value === 'string') { const a = new Date(value); if (!isNaN(a.valueOf())) { return a; } } return value; } let obj; let contents; try { contents = yield res.readBody(); if (contents && contents.length > 0) { if (options && options.deserializeDates) { obj = JSON.parse(contents, dateTimeDeserializer); } else { obj = JSON.parse(contents); } response.result = obj; } response.headers = res.message.headers; } catch (err) { // Invalid resource (contents not json); leaving result obj null } // note that 3xx redirects are handled by the http layer. if (statusCode > 299) { let msg; // if exception/error in body, attempt to get better error if (obj && obj.message) { msg = obj.message; } else if (contents && contents.length > 0) { // it may be the case that the exception is in the body message as string msg = contents; } else { msg = `Failed request: (${statusCode})`; } const err = new HttpClientError(msg, statusCode); err.result = response.result; reject(err); } else { resolve(response); } })); }); } } exports.HttpClient = HttpClient; const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); //# sourceMappingURL=index.js.map /***/ }), /***/ 4988: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.checkBypass = exports.getProxyUrl = void 0; function getProxyUrl(reqUrl) { const usingSsl = reqUrl.protocol === 'https:'; if (checkBypass(reqUrl)) { return undefined; } const proxyVar = (() => { if (usingSsl) { return process.env['https_proxy'] || process.env['HTTPS_PROXY']; } else { return process.env['http_proxy'] || process.env['HTTP_PROXY']; } })(); if (proxyVar) { try { return new DecodedURL(proxyVar); } catch (_a) { if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) return new DecodedURL(`http://${proxyVar}`); } } else { return undefined; } } exports.getProxyUrl = getProxyUrl; function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; } const reqHost = reqUrl.hostname; if (isLoopbackAddress(reqHost)) { return true; } const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; if (!noProxy) { return false; } // Determine the request port let reqPort; if (reqUrl.port) { reqPort = Number(reqUrl.port); } else if (reqUrl.protocol === 'http:') { reqPort = 80; } else if (reqUrl.protocol === 'https:') { reqPort = 443; } // Format the request hostname and hostname with port const upperReqHosts = [reqUrl.hostname.toUpperCase()]; if (typeof reqPort === 'number') { upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } // Compare request host against noproxy for (const upperNoProxyItem of noProxy .split(',') .map(x => x.trim().toUpperCase()) .filter(x => x)) { if (upperNoProxyItem === '*' || upperReqHosts.some(x => x === upperNoProxyItem || x.endsWith(`.${upperNoProxyItem}`) || (upperNoProxyItem.startsWith('.') && x.endsWith(`${upperNoProxyItem}`)))) { return true; } } return false; } exports.checkBypass = checkBypass; function isLoopbackAddress(host) { const hostLower = host.toLowerCase(); return (hostLower === 'localhost' || hostLower.startsWith('127.') || hostLower.startsWith('[::1]') || hostLower.startsWith('[0:0:0:0:0:0:0:1]')); } class DecodedURL extends URL { constructor(url, base) { super(url, base); this._decodedUsername = decodeURIComponent(super.username); this._decodedPassword = decodeURIComponent(super.password); } get username() { return this._decodedUsername; } get password() { return this._decodedPassword; } } //# sourceMappingURL=proxy.js.map /***/ }), /***/ 5207: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; const fs = __importStar(__nccwpck_require__(9896)); const path = __importStar(__nccwpck_require__(6928)); _a = fs.promises // export const {open} = 'fs' , exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; // export const {open} = 'fs' exports.IS_WINDOWS = process.platform === 'win32'; // See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691 exports.UV_FS_O_EXLOCK = 0x10000000; exports.READONLY = fs.constants.O_RDONLY; function exists(fsPath) { return __awaiter(this, void 0, void 0, function* () { try { yield exports.stat(fsPath); } catch (err) { if (err.code === 'ENOENT') { return false; } throw err; } return true; }); } exports.exists = exists; function isDirectory(fsPath, useStat = false) { return __awaiter(this, void 0, void 0, function* () { const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath); return stats.isDirectory(); }); } exports.isDirectory = isDirectory; /** * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). */ function isRooted(p) { p = normalizeSeparators(p); if (!p) { throw new Error('isRooted() parameter "p" cannot be empty'); } if (exports.IS_WINDOWS) { return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello ); // e.g. C: or C:\hello } return p.startsWith('/'); } exports.isRooted = isRooted; /** * Best effort attempt to determine whether a file exists and is executable. * @param filePath file path to check * @param extensions additional file extensions to try * @return if file exists and is executable, returns the file path. otherwise empty string. */ function tryGetExecutablePath(filePath, extensions) { return __awaiter(this, void 0, void 0, function* () { let stats = undefined; try { // test file exists stats = yield exports.stat(filePath); } catch (err) { if (err.code !== 'ENOENT') { // eslint-disable-next-line no-console console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); } } if (stats && stats.isFile()) { if (exports.IS_WINDOWS) { // on Windows, test for valid extension const upperExt = path.extname(filePath).toUpperCase(); if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) { return filePath; } } else { if (isUnixExecutable(stats)) { return filePath; } } } // try each extension const originalFilePath = filePath; for (const extension of extensions) { filePath = originalFilePath + extension; stats = undefined; try { stats = yield exports.stat(filePath); } catch (err) { if (err.code !== 'ENOENT') { // eslint-disable-next-line no-console console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); } } if (stats && stats.isFile()) { if (exports.IS_WINDOWS) { // preserve the case of the actual file (since an extension was appended) try { const directory = path.dirname(filePath); const upperName = path.basename(filePath).toUpperCase(); for (const actualName of yield exports.readdir(directory)) { if (upperName === actualName.toUpperCase()) { filePath = path.join(directory, actualName); break; } } } catch (err) { // eslint-disable-next-line no-console console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); } return filePath; } else { if (isUnixExecutable(stats)) { return filePath; } } } } return ''; }); } exports.tryGetExecutablePath = tryGetExecutablePath; function normalizeSeparators(p) { p = p || ''; if (exports.IS_WINDOWS) { // convert slashes on Windows p = p.replace(/\//g, '\\'); // remove redundant slashes return p.replace(/\\\\+/g, '\\'); } // remove redundant slashes return p.replace(/\/\/+/g, '/'); } // on Mac/Linux, test the execute bit // R W X R W X R W X // 256 128 64 32 16 8 4 2 1 function isUnixExecutable(stats) { return ((stats.mode & 1) > 0 || ((stats.mode & 8) > 0 && stats.gid === process.getgid()) || ((stats.mode & 64) > 0 && stats.uid === process.getuid())); } // Get the path of cmd.exe in windows function getCmdPath() { var _a; return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`; } exports.getCmdPath = getCmdPath; //# sourceMappingURL=io-util.js.map /***/ }), /***/ 4994: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; const assert_1 = __nccwpck_require__(2613); const path = __importStar(__nccwpck_require__(6928)); const ioUtil = __importStar(__nccwpck_require__(5207)); /** * Copies a file or folder. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js * * @param source source path * @param dest destination path * @param options optional. See CopyOptions. */ function cp(source, dest, options = {}) { return __awaiter(this, void 0, void 0, function* () { const { force, recursive, copySourceDirectory } = readCopyOptions(options); const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; // Dest is an existing file, but not forcing if (destStat && destStat.isFile() && !force) { return; } // If dest is an existing directory, should copy inside. const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path.join(dest, path.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } const sourceStat = yield ioUtil.stat(source); if (sourceStat.isDirectory()) { if (!recursive) { throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); } else { yield cpDirRecursive(source, newDest, 0, force); } } else { if (path.relative(source, newDest) === '') { // a file cannot be copied to itself throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile(source, newDest, force); } }); } exports.cp = cp; /** * Moves a path. * * @param source source path * @param dest destination path * @param options optional. See MoveOptions. */ function mv(source, dest, options = {}) { return __awaiter(this, void 0, void 0, function* () { if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { // If dest is directory copy src into dest dest = path.join(dest, path.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { if (options.force == null || options.force) { yield rmRF(dest); } else { throw new Error('Destination already exists'); } } } yield mkdirP(path.dirname(dest)); yield ioUtil.rename(source, dest); }); } exports.mv = mv; /** * Remove a path recursively with force * * @param inputPath path to remove */ function rmRF(inputPath) { return __awaiter(this, void 0, void 0, function* () { if (ioUtil.IS_WINDOWS) { // Check for invalid characters // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file if (/[*"<>|]/.test(inputPath)) { throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); } } try { // note if path does not exist, error is silent yield ioUtil.rm(inputPath, { force: true, maxRetries: 3, recursive: true, retryDelay: 300 }); } catch (err) { throw new Error(`File was unable to be removed ${err}`); } }); } exports.rmRF = rmRF; /** * Make a directory. Creates the full path with folders in between * Will throw if it fails * * @param fsPath path to create * @returns Promise */ function mkdirP(fsPath) { return __awaiter(this, void 0, void 0, function* () { assert_1.ok(fsPath, 'a path argument must be provided'); yield ioUtil.mkdir(fsPath, { recursive: true }); }); } exports.mkdirP = mkdirP; /** * Returns path of a tool had the tool actually been invoked. Resolves via paths. * If you check and the tool does not exist, it will throw. * * @param tool name of the tool * @param check whether to check if tool exists * @returns Promise path to tool */ function which(tool, check) { return __awaiter(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } // recursive when check=true if (check) { const result = yield which(tool, false); if (!result) { if (ioUtil.IS_WINDOWS) { throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); } else { throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); } } return result; } const matches = yield findInPath(tool); if (matches && matches.length > 0) { return matches[0]; } return ''; }); } exports.which = which; /** * Returns a list of all occurrences of the given tool on the system path. * * @returns Promise the paths of the tool */ function findInPath(tool) { return __awaiter(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } // build the list of extensions to try const extensions = []; if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) { for (const extension of process.env['PATHEXT'].split(path.delimiter)) { if (extension) { extensions.push(extension); } } } // if it's rooted, return it if exists. otherwise return empty. if (ioUtil.isRooted(tool)) { const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); if (filePath) { return [filePath]; } return []; } // if any path separators, return empty if (tool.includes(path.sep)) { return []; } // build the list of directories // // Note, technically "where" checks the current directory on Windows. From a toolkit perspective, // it feels like we should not do this. Checking the current directory seems like more of a use // case of a shell, and the which() function exposed by the toolkit should strive for consistency // across platforms. const directories = []; if (process.env.PATH) { for (const p of process.env.PATH.split(path.delimiter)) { if (p) { directories.push(p); } } } // find all matches const matches = []; for (const directory of directories) { const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } } return matches; }); } exports.findInPath = findInPath; function readCopyOptions(options) { const force = options.force == null ? true : options.force; const recursive = Boolean(options.recursive); const copySourceDirectory = options.copySourceDirectory == null ? true : Boolean(options.copySourceDirectory); return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { return __awaiter(this, void 0, void 0, function* () { // Ensure there is not a run away recursive copy if (currentDepth >= 255) return; currentDepth++; yield mkdirP(destDir); const files = yield ioUtil.readdir(sourceDir); for (const fileName of files) { const srcFile = `${sourceDir}/${fileName}`; const destFile = `${destDir}/${fileName}`; const srcFileStat = yield ioUtil.lstat(srcFile); if (srcFileStat.isDirectory()) { // Recurse yield cpDirRecursive(srcFile, destFile, currentDepth, force); } else { yield copyFile(srcFile, destFile, force); } } // Change the mode for the newly created directory yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); }); } // Buffered file copy function copyFile(srcFile, destFile, force) { return __awaiter(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { // unlink/re-link it try { yield ioUtil.lstat(destFile); yield ioUtil.unlink(destFile); } catch (e) { // Try to override file permission if (e.code === 'EPERM') { yield ioUtil.chmod(destFile, '0666'); yield ioUtil.unlink(destFile); } // other errors = it doesn't exist, no work to do } // Copy over symlink const symlinkFull = yield ioUtil.readlink(srcFile); yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null); } else if (!(yield ioUtil.exists(destFile)) || force) { yield ioUtil.copyFile(srcFile, destFile); } }); } //# sourceMappingURL=io.js.map /***/ }), /***/ 2739: /***/ ((module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); const picomatch = __nccwpck_require__(4639); const normalizePath = __nccwpck_require__(6133); /** * @typedef {(testString: string) => boolean} AnymatchFn * @typedef {string|RegExp|AnymatchFn} AnymatchPattern * @typedef {AnymatchPattern|AnymatchPattern[]} AnymatchMatcher */ const BANG = '!'; const DEFAULT_OPTIONS = {returnIndex: false}; const arrify = (item) => Array.isArray(item) ? item : [item]; /** * @param {AnymatchPattern} matcher * @param {object} options * @returns {AnymatchFn} */ const createPattern = (matcher, options) => { if (typeof matcher === 'function') { return matcher; } if (typeof matcher === 'string') { const glob = picomatch(matcher, options); return (string) => matcher === string || glob(string); } if (matcher instanceof RegExp) { return (string) => matcher.test(string); } return (string) => false; }; /** * @param {Array} patterns * @param {Array} negPatterns * @param {String|Array} args * @param {Boolean} returnIndex * @returns {boolean|number} */ const matchPatterns = (patterns, negPatterns, args, returnIndex) => { const isList = Array.isArray(args); const _path = isList ? args[0] : args; if (!isList && typeof _path !== 'string') { throw new TypeError('anymatch: second argument must be a string: got ' + Object.prototype.toString.call(_path)) } const path = normalizePath(_path, false); for (let index = 0; index < negPatterns.length; index++) { const nglob = negPatterns[index]; if (nglob(path)) { return returnIndex ? -1 : false; } } const applied = isList && [path].concat(args.slice(1)); for (let index = 0; index < patterns.length; index++) { const pattern = patterns[index]; if (isList ? pattern(...applied) : pattern(path)) { return returnIndex ? index : true; } } return returnIndex ? -1 : false; }; /** * @param {AnymatchMatcher} matchers * @param {Array|string} testString * @param {object} options * @returns {boolean|number|Function} */ const anymatch = (matchers, testString, options = DEFAULT_OPTIONS) => { if (matchers == null) { throw new TypeError('anymatch: specify first argument'); } const opts = typeof options === 'boolean' ? {returnIndex: options} : options; const returnIndex = opts.returnIndex || false; // Early cache for matchers. const mtchers = arrify(matchers); const negatedGlobs = mtchers .filter(item => typeof item === 'string' && item.charAt(0) === BANG) .map(item => item.slice(1)) .map(item => picomatch(item, opts)); const patterns = mtchers .filter(item => typeof item !== 'string' || (typeof item === 'string' && item.charAt(0) !== BANG)) .map(matcher => createPattern(matcher, opts)); if (testString == null) { return (testString, ri = false) => { const returnIndex = typeof ri === 'boolean' ? ri : false; return matchPatterns(patterns, negatedGlobs, testString, returnIndex); } } return matchPatterns(patterns, negatedGlobs, testString, returnIndex); }; anymatch.default = anymatch; module.exports = anymatch; /***/ }), /***/ 4639: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = __nccwpck_require__(3053); /***/ }), /***/ 9314: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const path = __nccwpck_require__(6928); const WIN_SLASH = '\\\\/'; const WIN_NO_SLASH = `[^${WIN_SLASH}]`; /** * Posix glob regex */ const DOT_LITERAL = '\\.'; const PLUS_LITERAL = '\\+'; const QMARK_LITERAL = '\\?'; const SLASH_LITERAL = '\\/'; const ONE_CHAR = '(?=.)'; const QMARK = '[^/]'; const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; const NO_DOT = `(?!${DOT_LITERAL})`; const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; const STAR = `${QMARK}*?`; const POSIX_CHARS = { DOT_LITERAL, PLUS_LITERAL, QMARK_LITERAL, SLASH_LITERAL, ONE_CHAR, QMARK, END_ANCHOR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK_NO_DOT, STAR, START_ANCHOR }; /** * Windows glob regex */ const WINDOWS_CHARS = { ...POSIX_CHARS, SLASH_LITERAL: `[${WIN_SLASH}]`, QMARK: WIN_NO_SLASH, STAR: `${WIN_NO_SLASH}*?`, DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, NO_DOT: `(?!${DOT_LITERAL})`, NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, QMARK_NO_DOT: `[^.${WIN_SLASH}]`, START_ANCHOR: `(?:^|[${WIN_SLASH}])`, END_ANCHOR: `(?:[${WIN_SLASH}]|$)` }; /** * POSIX Bracket Regex */ const POSIX_REGEX_SOURCE = { alnum: 'a-zA-Z0-9', alpha: 'a-zA-Z', ascii: '\\x00-\\x7F', blank: ' \\t', cntrl: '\\x00-\\x1F\\x7F', digit: '0-9', graph: '\\x21-\\x7E', lower: 'a-z', print: '\\x20-\\x7E ', punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', space: ' \\t\\r\\n\\v\\f', upper: 'A-Z', word: 'A-Za-z0-9_', xdigit: 'A-Fa-f0-9' }; module.exports = { MAX_LENGTH: 1024 * 64, POSIX_REGEX_SOURCE, // regular expressions REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, // Replace globs with equivalent patterns to reduce parsing time. REPLACEMENTS: { '***': '*', '**/**': '**', '**/**/**': '**' }, // Digits CHAR_0: 48, /* 0 */ CHAR_9: 57, /* 9 */ // Alphabet chars. CHAR_UPPERCASE_A: 65, /* A */ CHAR_LOWERCASE_A: 97, /* a */ CHAR_UPPERCASE_Z: 90, /* Z */ CHAR_LOWERCASE_Z: 122, /* z */ CHAR_LEFT_PARENTHESES: 40, /* ( */ CHAR_RIGHT_PARENTHESES: 41, /* ) */ CHAR_ASTERISK: 42, /* * */ // Non-alphabetic chars. CHAR_AMPERSAND: 38, /* & */ CHAR_AT: 64, /* @ */ CHAR_BACKWARD_SLASH: 92, /* \ */ CHAR_CARRIAGE_RETURN: 13, /* \r */ CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ CHAR_COLON: 58, /* : */ CHAR_COMMA: 44, /* , */ CHAR_DOT: 46, /* . */ CHAR_DOUBLE_QUOTE: 34, /* " */ CHAR_EQUAL: 61, /* = */ CHAR_EXCLAMATION_MARK: 33, /* ! */ CHAR_FORM_FEED: 12, /* \f */ CHAR_FORWARD_SLASH: 47, /* / */ CHAR_GRAVE_ACCENT: 96, /* ` */ CHAR_HASH: 35, /* # */ CHAR_HYPHEN_MINUS: 45, /* - */ CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ CHAR_LEFT_CURLY_BRACE: 123, /* { */ CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ CHAR_LINE_FEED: 10, /* \n */ CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ CHAR_PERCENT: 37, /* % */ CHAR_PLUS: 43, /* + */ CHAR_QUESTION_MARK: 63, /* ? */ CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ CHAR_RIGHT_CURLY_BRACE: 125, /* } */ CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ CHAR_SEMICOLON: 59, /* ; */ CHAR_SINGLE_QUOTE: 39, /* ' */ CHAR_SPACE: 32, /* */ CHAR_TAB: 9, /* \t */ CHAR_UNDERSCORE: 95, /* _ */ CHAR_VERTICAL_LINE: 124, /* | */ CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ SEP: path.sep, /** * Create EXTGLOB_CHARS */ extglobChars(chars) { return { '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, '?': { type: 'qmark', open: '(?:', close: ')?' }, '+': { type: 'plus', open: '(?:', close: ')+' }, '*': { type: 'star', open: '(?:', close: ')*' }, '@': { type: 'at', open: '(?:', close: ')' } }; }, /** * Create GLOB_CHARS */ globChars(win32) { return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; } }; /***/ }), /***/ 1592: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const constants = __nccwpck_require__(9314); const utils = __nccwpck_require__(4842); /** * Constants */ const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants; /** * Helpers */ const expandRange = (args, options) => { if (typeof options.expandRange === 'function') { return options.expandRange(...args, options); } args.sort(); const value = `[${args.join('-')}]`; try { /* eslint-disable-next-line no-new */ new RegExp(value); } catch (ex) { return args.map(v => utils.escapeRegex(v)).join('..'); } return value; }; /** * Create the message for a syntax error */ const syntaxError = (type, char) => { return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; }; /** * Parse the given input string. * @param {String} input * @param {Object} options * @return {Object} */ const parse = (input, options) => { if (typeof input !== 'string') { throw new TypeError('Expected a string'); } input = REPLACEMENTS[input] || input; const opts = { ...options }; const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; let len = input.length; if (len > max) { throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); } const bos = { type: 'bos', value: '', output: opts.prepend || '' }; const tokens = [bos]; const capture = opts.capture ? '' : '?:'; const win32 = utils.isWindows(options); // create constants based on platform, for windows or posix const PLATFORM_CHARS = constants.globChars(win32); const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); const { DOT_LITERAL, PLUS_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK, QMARK_NO_DOT, STAR, START_ANCHOR } = PLATFORM_CHARS; const globstar = opts => { return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; }; const nodot = opts.dot ? '' : NO_DOT; const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; let star = opts.bash === true ? globstar(opts) : STAR; if (opts.capture) { star = `(${star})`; } // minimatch options support if (typeof opts.noext === 'boolean') { opts.noextglob = opts.noext; } const state = { input, index: -1, start: 0, dot: opts.dot === true, consumed: '', output: '', prefix: '', backtrack: false, negated: false, brackets: 0, braces: 0, parens: 0, quotes: 0, globstar: false, tokens }; input = utils.removePrefix(input, state); len = input.length; const extglobs = []; const braces = []; const stack = []; let prev = bos; let value; /** * Tokenizing helpers */ const eos = () => state.index === len - 1; const peek = state.peek = (n = 1) => input[state.index + n]; const advance = state.advance = () => input[++state.index] || ''; const remaining = () => input.slice(state.index + 1); const consume = (value = '', num = 0) => { state.consumed += value; state.index += num; }; const append = token => { state.output += token.output != null ? token.output : token.value; consume(token.value); }; const negate = () => { let count = 1; while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { advance(); state.start++; count++; } if (count % 2 === 0) { return false; } state.negated = true; state.start++; return true; }; const increment = type => { state[type]++; stack.push(type); }; const decrement = type => { state[type]--; stack.pop(); }; /** * Push tokens onto the tokens array. This helper speeds up * tokenizing by 1) helping us avoid backtracking as much as possible, * and 2) helping us avoid creating extra tokens when consecutive * characters are plain text. This improves performance and simplifies * lookbehinds. */ const push = tok => { if (prev.type === 'globstar') { const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { state.output = state.output.slice(0, -prev.output.length); prev.type = 'star'; prev.value = '*'; prev.output = star; state.output += prev.output; } } if (extglobs.length && tok.type !== 'paren') { extglobs[extglobs.length - 1].inner += tok.value; } if (tok.value || tok.output) append(tok); if (prev && prev.type === 'text' && tok.type === 'text') { prev.value += tok.value; prev.output = (prev.output || '') + tok.value; return; } tok.prev = prev; tokens.push(tok); prev = tok; }; const extglobOpen = (type, value) => { const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; token.prev = prev; token.parens = state.parens; token.output = state.output; const output = (opts.capture ? '(' : '') + token.open; increment('parens'); push({ type, value, output: state.output ? '' : ONE_CHAR }); push({ type: 'paren', extglob: true, value: advance(), output }); extglobs.push(token); }; const extglobClose = token => { let output = token.close + (opts.capture ? ')' : ''); let rest; if (token.type === 'negate') { let extglobStar = star; if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { extglobStar = globstar(opts); } if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { output = token.close = `)$))${extglobStar}`; } if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. // In this case, we need to parse the string and use it in the output of the original pattern. // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. // // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. const expression = parse(rest, { ...options, fastpaths: false }).output; output = token.close = `)${expression})${extglobStar})`; } if (token.prev.type === 'bos') { state.negatedExtglob = true; } } push({ type: 'paren', extglob: true, value, output }); decrement('parens'); }; /** * Fast paths */ if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { let backslashes = false; let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { if (first === '\\') { backslashes = true; return m; } if (first === '?') { if (esc) { return esc + first + (rest ? QMARK.repeat(rest.length) : ''); } if (index === 0) { return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); } return QMARK.repeat(chars.length); } if (first === '.') { return DOT_LITERAL.repeat(chars.length); } if (first === '*') { if (esc) { return esc + first + (rest ? star : ''); } return star; } return esc ? m : `\\${m}`; }); if (backslashes === true) { if (opts.unescape === true) { output = output.replace(/\\/g, ''); } else { output = output.replace(/\\+/g, m => { return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); }); } } if (output === input && opts.contains === true) { state.output = input; return state; } state.output = utils.wrapOutput(output, state, options); return state; } /** * Tokenize input until we reach end-of-string */ while (!eos()) { value = advance(); if (value === '\u0000') { continue; } /** * Escaped characters */ if (value === '\\') { const next = peek(); if (next === '/' && opts.bash !== true) { continue; } if (next === '.' || next === ';') { continue; } if (!next) { value += '\\'; push({ type: 'text', value }); continue; } // collapse slashes to reduce potential for exploits const match = /^\\+/.exec(remaining()); let slashes = 0; if (match && match[0].length > 2) { slashes = match[0].length; state.index += slashes; if (slashes % 2 !== 0) { value += '\\'; } } if (opts.unescape === true) { value = advance(); } else { value += advance(); } if (state.brackets === 0) { push({ type: 'text', value }); continue; } } /** * If we're inside a regex character class, continue * until we reach the closing bracket. */ if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { if (opts.posix !== false && value === ':') { const inner = prev.value.slice(1); if (inner.includes('[')) { prev.posix = true; if (inner.includes(':')) { const idx = prev.value.lastIndexOf('['); const pre = prev.value.slice(0, idx); const rest = prev.value.slice(idx + 2); const posix = POSIX_REGEX_SOURCE[rest]; if (posix) { prev.value = pre + posix; state.backtrack = true; advance(); if (!bos.output && tokens.indexOf(prev) === 1) { bos.output = ONE_CHAR; } continue; } } } } if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { value = `\\${value}`; } if (value === ']' && (prev.value === '[' || prev.value === '[^')) { value = `\\${value}`; } if (opts.posix === true && value === '!' && prev.value === '[') { value = '^'; } prev.value += value; append({ value }); continue; } /** * If we're inside a quoted string, continue * until we reach the closing double quote. */ if (state.quotes === 1 && value !== '"') { value = utils.escapeRegex(value); prev.value += value; append({ value }); continue; } /** * Double quotes */ if (value === '"') { state.quotes = state.quotes === 1 ? 0 : 1; if (opts.keepQuotes === true) { push({ type: 'text', value }); } continue; } /** * Parentheses */ if (value === '(') { increment('parens'); push({ type: 'paren', value }); continue; } if (value === ')') { if (state.parens === 0 && opts.strictBrackets === true) { throw new SyntaxError(syntaxError('opening', '(')); } const extglob = extglobs[extglobs.length - 1]; if (extglob && state.parens === extglob.parens + 1) { extglobClose(extglobs.pop()); continue; } push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); decrement('parens'); continue; } /** * Square brackets */ if (value === '[') { if (opts.nobracket === true || !remaining().includes(']')) { if (opts.nobracket !== true && opts.strictBrackets === true) { throw new SyntaxError(syntaxError('closing', ']')); } value = `\\${value}`; } else { increment('brackets'); } push({ type: 'bracket', value }); continue; } if (value === ']') { if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { push({ type: 'text', value, output: `\\${value}` }); continue; } if (state.brackets === 0) { if (opts.strictBrackets === true) { throw new SyntaxError(syntaxError('opening', '[')); } push({ type: 'text', value, output: `\\${value}` }); continue; } decrement('brackets'); const prevValue = prev.value.slice(1); if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { value = `/${value}`; } prev.value += value; append({ value }); // when literal brackets are explicitly disabled // assume we should match with a regex character class if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { continue; } const escaped = utils.escapeRegex(prev.value); state.output = state.output.slice(0, -prev.value.length); // when literal brackets are explicitly enabled // assume we should escape the brackets to match literal characters if (opts.literalBrackets === true) { state.output += escaped; prev.value = escaped; continue; } // when the user specifies nothing, try to match both prev.value = `(${capture}${escaped}|${prev.value})`; state.output += prev.value; continue; } /** * Braces */ if (value === '{' && opts.nobrace !== true) { increment('braces'); const open = { type: 'brace', value, output: '(', outputIndex: state.output.length, tokensIndex: state.tokens.length }; braces.push(open); push(open); continue; } if (value === '}') { const brace = braces[braces.length - 1]; if (opts.nobrace === true || !brace) { push({ type: 'text', value, output: value }); continue; } let output = ')'; if (brace.dots === true) { const arr = tokens.slice(); const range = []; for (let i = arr.length - 1; i >= 0; i--) { tokens.pop(); if (arr[i].type === 'brace') { break; } if (arr[i].type !== 'dots') { range.unshift(arr[i].value); } } output = expandRange(range, opts); state.backtrack = true; } if (brace.comma !== true && brace.dots !== true) { const out = state.output.slice(0, brace.outputIndex); const toks = state.tokens.slice(brace.tokensIndex); brace.value = brace.output = '\\{'; value = output = '\\}'; state.output = out; for (const t of toks) { state.output += (t.output || t.value); } } push({ type: 'brace', value, output }); decrement('braces'); braces.pop(); continue; } /** * Pipes */ if (value === '|') { if (extglobs.length > 0) { extglobs[extglobs.length - 1].conditions++; } push({ type: 'text', value }); continue; } /** * Commas */ if (value === ',') { let output = value; const brace = braces[braces.length - 1]; if (brace && stack[stack.length - 1] === 'braces') { brace.comma = true; output = '|'; } push({ type: 'comma', value, output }); continue; } /** * Slashes */ if (value === '/') { // if the beginning of the glob is "./", advance the start // to the current index, and don't add the "./" characters // to the state. This greatly simplifies lookbehinds when // checking for BOS characters like "!" and "." (not "./") if (prev.type === 'dot' && state.index === state.start + 1) { state.start = state.index + 1; state.consumed = ''; state.output = ''; tokens.pop(); prev = bos; // reset "prev" to the first token continue; } push({ type: 'slash', value, output: SLASH_LITERAL }); continue; } /** * Dots */ if (value === '.') { if (state.braces > 0 && prev.type === 'dot') { if (prev.value === '.') prev.output = DOT_LITERAL; const brace = braces[braces.length - 1]; prev.type = 'dots'; prev.output += value; prev.value += value; brace.dots = true; continue; } if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { push({ type: 'text', value, output: DOT_LITERAL }); continue; } push({ type: 'dot', value, output: DOT_LITERAL }); continue; } /** * Question marks */ if (value === '?') { const isGroup = prev && prev.value === '('; if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { extglobOpen('qmark', value); continue; } if (prev && prev.type === 'paren') { const next = peek(); let output = value; if (next === '<' && !utils.supportsLookbehinds()) { throw new Error('Node.js v10 or higher is required for regex lookbehinds'); } if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { output = `\\${value}`; } push({ type: 'text', value, output }); continue; } if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { push({ type: 'qmark', value, output: QMARK_NO_DOT }); continue; } push({ type: 'qmark', value, output: QMARK }); continue; } /** * Exclamation */ if (value === '!') { if (opts.noextglob !== true && peek() === '(') { if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { extglobOpen('negate', value); continue; } } if (opts.nonegate !== true && state.index === 0) { negate(); continue; } } /** * Plus */ if (value === '+') { if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { extglobOpen('plus', value); continue; } if ((prev && prev.value === '(') || opts.regex === false) { push({ type: 'plus', value, output: PLUS_LITERAL }); continue; } if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { push({ type: 'plus', value }); continue; } push({ type: 'plus', value: PLUS_LITERAL }); continue; } /** * Plain text */ if (value === '@') { if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { push({ type: 'at', extglob: true, value, output: '' }); continue; } push({ type: 'text', value }); continue; } /** * Plain text */ if (value !== '*') { if (value === '$' || value === '^') { value = `\\${value}`; } const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); if (match) { value += match[0]; state.index += match[0].length; } push({ type: 'text', value }); continue; } /** * Stars */ if (prev && (prev.type === 'globstar' || prev.star === true)) { prev.type = 'star'; prev.star = true; prev.value += value; prev.output = star; state.backtrack = true; state.globstar = true; consume(value); continue; } let rest = remaining(); if (opts.noextglob !== true && /^\([^?]/.test(rest)) { extglobOpen('star', value); continue; } if (prev.type === 'star') { if (opts.noglobstar === true) { consume(value); continue; } const prior = prev.prev; const before = prior.prev; const isStart = prior.type === 'slash' || prior.type === 'bos'; const afterStar = before && (before.type === 'star' || before.type === 'globstar'); if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { push({ type: 'star', value, output: '' }); continue; } const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { push({ type: 'star', value, output: '' }); continue; } // strip consecutive `/**/` while (rest.slice(0, 3) === '/**') { const after = input[state.index + 4]; if (after && after !== '/') { break; } rest = rest.slice(3); consume('/**', 3); } if (prior.type === 'bos' && eos()) { prev.type = 'globstar'; prev.value += value; prev.output = globstar(opts); state.output = prev.output; state.globstar = true; consume(value); continue; } if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { state.output = state.output.slice(0, -(prior.output + prev.output).length); prior.output = `(?:${prior.output}`; prev.type = 'globstar'; prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); prev.value += value; state.globstar = true; state.output += prior.output + prev.output; consume(value); continue; } if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { const end = rest[1] !== void 0 ? '|$' : ''; state.output = state.output.slice(0, -(prior.output + prev.output).length); prior.output = `(?:${prior.output}`; prev.type = 'globstar'; prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; prev.value += value; state.output += prior.output + prev.output; state.globstar = true; consume(value + advance()); push({ type: 'slash', value: '/', output: '' }); continue; } if (prior.type === 'bos' && rest[0] === '/') { prev.type = 'globstar'; prev.value += value; prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; state.output = prev.output; state.globstar = true; consume(value + advance()); push({ type: 'slash', value: '/', output: '' }); continue; } // remove single star from output state.output = state.output.slice(0, -prev.output.length); // reset previous token to globstar prev.type = 'globstar'; prev.output = globstar(opts); prev.value += value; // reset output with globstar state.output += prev.output; state.globstar = true; consume(value); continue; } const token = { type: 'star', value, output: star }; if (opts.bash === true) { token.output = '.*?'; if (prev.type === 'bos' || prev.type === 'slash') { token.output = nodot + token.output; } push(token); continue; } if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { token.output = value; push(token); continue; } if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { if (prev.type === 'dot') { state.output += NO_DOT_SLASH; prev.output += NO_DOT_SLASH; } else if (opts.dot === true) { state.output += NO_DOTS_SLASH; prev.output += NO_DOTS_SLASH; } else { state.output += nodot; prev.output += nodot; } if (peek() !== '*') { state.output += ONE_CHAR; prev.output += ONE_CHAR; } } push(token); } while (state.brackets > 0) { if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); state.output = utils.escapeLast(state.output, '['); decrement('brackets'); } while (state.parens > 0) { if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); state.output = utils.escapeLast(state.output, '('); decrement('parens'); } while (state.braces > 0) { if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); state.output = utils.escapeLast(state.output, '{'); decrement('braces'); } if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); } // rebuild the output if we had to backtrack at any point if (state.backtrack === true) { state.output = ''; for (const token of state.tokens) { state.output += token.output != null ? token.output : token.value; if (token.suffix) { state.output += token.suffix; } } } return state; }; /** * Fast paths for creating regular expressions for common glob patterns. * This can significantly speed up processing and has very little downside * impact when none of the fast paths match. */ parse.fastpaths = (input, options) => { const opts = { ...options }; const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; const len = input.length; if (len > max) { throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); } input = REPLACEMENTS[input] || input; const win32 = utils.isWindows(options); // create constants based on platform, for windows or posix const { DOT_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR } = constants.globChars(win32); const nodot = opts.dot ? NO_DOTS : NO_DOT; const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; const capture = opts.capture ? '' : '?:'; const state = { negated: false, prefix: '' }; let star = opts.bash === true ? '.*?' : STAR; if (opts.capture) { star = `(${star})`; } const globstar = opts => { if (opts.noglobstar === true) return star; return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; }; const create = str => { switch (str) { case '*': return `${nodot}${ONE_CHAR}${star}`; case '.*': return `${DOT_LITERAL}${ONE_CHAR}${star}`; case '*.*': return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; case '*/*': return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; case '**': return nodot + globstar(opts); case '**/*': return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; case '**/*.*': return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; case '**/.*': return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; default: { const match = /^(.*?)\.(\w+)$/.exec(str); if (!match) return; const source = create(match[1]); if (!source) return; return source + DOT_LITERAL + match[2]; } } }; const output = utils.removePrefix(input, state); let source = create(output); if (source && opts.strictSlashes !== true) { source += `${SLASH_LITERAL}?`; } return source; }; module.exports = parse; /***/ }), /***/ 3053: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const path = __nccwpck_require__(6928); const scan = __nccwpck_require__(7921); const parse = __nccwpck_require__(1592); const utils = __nccwpck_require__(4842); const constants = __nccwpck_require__(9314); const isObject = val => val && typeof val === 'object' && !Array.isArray(val); /** * Creates a matcher function from one or more glob patterns. The * returned function takes a string to match as its first argument, * and returns true if the string is a match. The returned matcher * function also takes a boolean as the second argument that, when true, * returns an object with additional information. * * ```js * const picomatch = require('picomatch'); * // picomatch(glob[, options]); * * const isMatch = picomatch('*.!(*a)'); * console.log(isMatch('a.a')); //=> false * console.log(isMatch('a.b')); //=> true * ``` * @name picomatch * @param {String|Array} `globs` One or more glob patterns. * @param {Object=} `options` * @return {Function=} Returns a matcher function. * @api public */ const picomatch = (glob, options, returnState = false) => { if (Array.isArray(glob)) { const fns = glob.map(input => picomatch(input, options, returnState)); const arrayMatcher = str => { for (const isMatch of fns) { const state = isMatch(str); if (state) return state; } return false; }; return arrayMatcher; } const isState = isObject(glob) && glob.tokens && glob.input; if (glob === '' || (typeof glob !== 'string' && !isState)) { throw new TypeError('Expected pattern to be a non-empty string'); } const opts = options || {}; const posix = utils.isWindows(options); const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true); const state = regex.state; delete regex.state; let isIgnored = () => false; if (opts.ignore) { const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); } const matcher = (input, returnObject = false) => { const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); const result = { glob, state, regex, posix, input, output, match, isMatch }; if (typeof opts.onResult === 'function') { opts.onResult(result); } if (isMatch === false) { result.isMatch = false; return returnObject ? result : false; } if (isIgnored(input)) { if (typeof opts.onIgnore === 'function') { opts.onIgnore(result); } result.isMatch = false; return returnObject ? result : false; } if (typeof opts.onMatch === 'function') { opts.onMatch(result); } return returnObject ? result : true; }; if (returnState) { matcher.state = state; } return matcher; }; /** * Test `input` with the given `regex`. This is used by the main * `picomatch()` function to test the input string. * * ```js * const picomatch = require('picomatch'); * // picomatch.test(input, regex[, options]); * * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } * ``` * @param {String} `input` String to test. * @param {RegExp} `regex` * @return {Object} Returns an object with matching info. * @api public */ picomatch.test = (input, regex, options, { glob, posix } = {}) => { if (typeof input !== 'string') { throw new TypeError('Expected input to be a string'); } if (input === '') { return { isMatch: false, output: '' }; } const opts = options || {}; const format = opts.format || (posix ? utils.toPosixSlashes : null); let match = input === glob; let output = (match && format) ? format(input) : input; if (match === false) { output = format ? format(input) : input; match = output === glob; } if (match === false || opts.capture === true) { if (opts.matchBase === true || opts.basename === true) { match = picomatch.matchBase(input, regex, options, posix); } else { match = regex.exec(output); } } return { isMatch: Boolean(match), match, output }; }; /** * Match the basename of a filepath. * * ```js * const picomatch = require('picomatch'); * // picomatch.matchBase(input, glob[, options]); * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true * ``` * @param {String} `input` String to test. * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). * @return {Boolean} * @api public */ picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); return regex.test(path.basename(input)); }; /** * Returns true if **any** of the given glob `patterns` match the specified `string`. * * ```js * const picomatch = require('picomatch'); * // picomatch.isMatch(string, patterns[, options]); * * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false * ``` * @param {String|Array} str The string to test. * @param {String|Array} patterns One or more glob patterns to use for matching. * @param {Object} [options] See available [options](#options). * @return {Boolean} Returns true if any patterns match `str` * @api public */ picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); /** * Parse a glob pattern to create the source string for a regular * expression. * * ```js * const picomatch = require('picomatch'); * const result = picomatch.parse(pattern[, options]); * ``` * @param {String} `pattern` * @param {Object} `options` * @return {Object} Returns an object with useful properties and output to be used as a regex source string. * @api public */ picomatch.parse = (pattern, options) => { if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); return parse(pattern, { ...options, fastpaths: false }); }; /** * Scan a glob pattern to separate the pattern into segments. * * ```js * const picomatch = require('picomatch'); * // picomatch.scan(input[, options]); * * const result = picomatch.scan('!./foo/*.js'); * console.log(result); * { prefix: '!./', * input: '!./foo/*.js', * start: 3, * base: 'foo', * glob: '*.js', * isBrace: false, * isBracket: false, * isGlob: true, * isExtglob: false, * isGlobstar: false, * negated: true } * ``` * @param {String} `input` Glob pattern to scan. * @param {Object} `options` * @return {Object} Returns an object with * @api public */ picomatch.scan = (input, options) => scan(input, options); /** * Compile a regular expression from the `state` object returned by the * [parse()](#parse) method. * * @param {Object} `state` * @param {Object} `options` * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. * @return {RegExp} * @api public */ picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { if (returnOutput === true) { return state.output; } const opts = options || {}; const prepend = opts.contains ? '' : '^'; const append = opts.contains ? '' : '$'; let source = `${prepend}(?:${state.output})${append}`; if (state && state.negated === true) { source = `^(?!${source}).*$`; } const regex = picomatch.toRegex(source, options); if (returnState === true) { regex.state = state; } return regex; }; /** * Create a regular expression from a parsed glob pattern. * * ```js * const picomatch = require('picomatch'); * const state = picomatch.parse('*.js'); * // picomatch.compileRe(state[, options]); * * console.log(picomatch.compileRe(state)); * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ * ``` * @param {String} `state` The object returned from the `.parse` method. * @param {Object} `options` * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. * @return {RegExp} Returns a regex created from the given pattern. * @api public */ picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { if (!input || typeof input !== 'string') { throw new TypeError('Expected a non-empty string'); } let parsed = { negated: false, fastpaths: true }; if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { parsed.output = parse.fastpaths(input, options); } if (!parsed.output) { parsed = parse(input, options); } return picomatch.compileRe(parsed, options, returnOutput, returnState); }; /** * Create a regular expression from the given regex source string. * * ```js * const picomatch = require('picomatch'); * // picomatch.toRegex(source[, options]); * * const { output } = picomatch.parse('*.js'); * console.log(picomatch.toRegex(output)); * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ * ``` * @param {String} `source` Regular expression source string. * @param {Object} `options` * @return {RegExp} * @api public */ picomatch.toRegex = (source, options) => { try { const opts = options || {}; return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); } catch (err) { if (options && options.debug === true) throw err; return /$^/; } }; /** * Picomatch constants. * @return {Object} */ picomatch.constants = constants; /** * Expose "picomatch" */ module.exports = picomatch; /***/ }), /***/ 7921: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const utils = __nccwpck_require__(4842); const { CHAR_ASTERISK, /* * */ CHAR_AT, /* @ */ CHAR_BACKWARD_SLASH, /* \ */ CHAR_COMMA, /* , */ CHAR_DOT, /* . */ CHAR_EXCLAMATION_MARK, /* ! */ CHAR_FORWARD_SLASH, /* / */ CHAR_LEFT_CURLY_BRACE, /* { */ CHAR_LEFT_PARENTHESES, /* ( */ CHAR_LEFT_SQUARE_BRACKET, /* [ */ CHAR_PLUS, /* + */ CHAR_QUESTION_MARK, /* ? */ CHAR_RIGHT_CURLY_BRACE, /* } */ CHAR_RIGHT_PARENTHESES, /* ) */ CHAR_RIGHT_SQUARE_BRACKET /* ] */ } = __nccwpck_require__(9314); const isPathSeparator = code => { return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; }; const depth = token => { if (token.isPrefix !== true) { token.depth = token.isGlobstar ? Infinity : 1; } }; /** * Quickly scans a glob pattern and returns an object with a handful of * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). * * ```js * const pm = require('picomatch'); * console.log(pm.scan('foo/bar/*.js')); * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } * ``` * @param {String} `str` * @param {Object} `options` * @return {Object} Returns an object with tokens and regex source string. * @api public */ const scan = (input, options) => { const opts = options || {}; const length = input.length - 1; const scanToEnd = opts.parts === true || opts.scanToEnd === true; const slashes = []; const tokens = []; const parts = []; let str = input; let index = -1; let start = 0; let lastIndex = 0; let isBrace = false; let isBracket = false; let isGlob = false; let isExtglob = false; let isGlobstar = false; let braceEscaped = false; let backslashes = false; let negated = false; let negatedExtglob = false; let finished = false; let braces = 0; let prev; let code; let token = { value: '', depth: 0, isGlob: false }; const eos = () => index >= length; const peek = () => str.charCodeAt(index + 1); const advance = () => { prev = code; return str.charCodeAt(++index); }; while (index < length) { code = advance(); let next; if (code === CHAR_BACKWARD_SLASH) { backslashes = token.backslashes = true; code = advance(); if (code === CHAR_LEFT_CURLY_BRACE) { braceEscaped = true; } continue; } if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { braces++; while (eos() !== true && (code = advance())) { if (code === CHAR_BACKWARD_SLASH) { backslashes = token.backslashes = true; advance(); continue; } if (code === CHAR_LEFT_CURLY_BRACE) { braces++; continue; } if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { isBrace = token.isBrace = true; isGlob = token.isGlob = true; finished = true; if (scanToEnd === true) { continue; } break; } if (braceEscaped !== true && code === CHAR_COMMA) { isBrace = token.isBrace = true; isGlob = token.isGlob = true; finished = true; if (scanToEnd === true) { continue; } break; } if (code === CHAR_RIGHT_CURLY_BRACE) { braces--; if (braces === 0) { braceEscaped = false; isBrace = token.isBrace = true; finished = true; break; } } } if (scanToEnd === true) { continue; } break; } if (code === CHAR_FORWARD_SLASH) { slashes.push(index); tokens.push(token); token = { value: '', depth: 0, isGlob: false }; if (finished === true) continue; if (prev === CHAR_DOT && index === (start + 1)) { start += 2; continue; } lastIndex = index + 1; continue; } if (opts.noext !== true) { const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK; if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { isGlob = token.isGlob = true; isExtglob = token.isExtglob = true; finished = true; if (code === CHAR_EXCLAMATION_MARK && index === start) { negatedExtglob = true; } if (scanToEnd === true) { while (eos() !== true && (code = advance())) { if (code === CHAR_BACKWARD_SLASH) { backslashes = token.backslashes = true; code = advance(); continue; } if (code === CHAR_RIGHT_PARENTHESES) { isGlob = token.isGlob = true; finished = true; break; } } continue; } break; } } if (code === CHAR_ASTERISK) { if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; isGlob = token.isGlob = true; finished = true; if (scanToEnd === true) { continue; } break; } if (code === CHAR_QUESTION_MARK) { isGlob = token.isGlob = true; finished = true; if (scanToEnd === true) { continue; } break; } if (code === CHAR_LEFT_SQUARE_BRACKET) { while (eos() !== true && (next = advance())) { if (next === CHAR_BACKWARD_SLASH) { backslashes = token.backslashes = true; advance(); continue; } if (next === CHAR_RIGHT_SQUARE_BRACKET) { isBracket = token.isBracket = true; isGlob = token.isGlob = true; finished = true; break; } } if (scanToEnd === true) { continue; } break; } if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { negated = token.negated = true; start++; continue; } if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { isGlob = token.isGlob = true; if (scanToEnd === true) { while (eos() !== true && (code = advance())) { if (code === CHAR_LEFT_PARENTHESES) { backslashes = token.backslashes = true; code = advance(); continue; } if (code === CHAR_RIGHT_PARENTHESES) { finished = true; break; } } continue; } break; } if (isGlob === true) { finished = true; if (scanToEnd === true) { continue; } break; } } if (opts.noext === true) { isExtglob = false; isGlob = false; } let base = str; let prefix = ''; let glob = ''; if (start > 0) { prefix = str.slice(0, start); str = str.slice(start); lastIndex -= start; } if (base && isGlob === true && lastIndex > 0) { base = str.slice(0, lastIndex); glob = str.slice(lastIndex); } else if (isGlob === true) { base = ''; glob = str; } else { base = str; } if (base && base !== '' && base !== '/' && base !== str) { if (isPathSeparator(base.charCodeAt(base.length - 1))) { base = base.slice(0, -1); } } if (opts.unescape === true) { if (glob) glob = utils.removeBackslashes(glob); if (base && backslashes === true) { base = utils.removeBackslashes(base); } } const state = { prefix, input, start, base, glob, isBrace, isBracket, isGlob, isExtglob, isGlobstar, negated, negatedExtglob }; if (opts.tokens === true) { state.maxDepth = 0; if (!isPathSeparator(code)) { tokens.push(token); } state.tokens = tokens; } if (opts.parts === true || opts.tokens === true) { let prevIndex; for (let idx = 0; idx < slashes.length; idx++) { const n = prevIndex ? prevIndex + 1 : start; const i = slashes[idx]; const value = input.slice(n, i); if (opts.tokens) { if (idx === 0 && start !== 0) { tokens[idx].isPrefix = true; tokens[idx].value = prefix; } else { tokens[idx].value = value; } depth(tokens[idx]); state.maxDepth += tokens[idx].depth; } if (idx !== 0 || value !== '') { parts.push(value); } prevIndex = i; } if (prevIndex && prevIndex + 1 < input.length) { const value = input.slice(prevIndex + 1); parts.push(value); if (opts.tokens) { tokens[tokens.length - 1].value = value; depth(tokens[tokens.length - 1]); state.maxDepth += tokens[tokens.length - 1].depth; } } state.slashes = slashes; state.parts = parts; } return state; }; module.exports = scan; /***/ }), /***/ 4842: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { const path = __nccwpck_require__(6928); const win32 = process.platform === 'win32'; const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = __nccwpck_require__(9314); exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); exports.removeBackslashes = str => { return str.replace(REGEX_REMOVE_BACKSLASH, match => { return match === '\\' ? '' : match; }); }; exports.supportsLookbehinds = () => { const segs = process.version.slice(1).split('.').map(Number); if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { return true; } return false; }; exports.isWindows = options => { if (options && typeof options.windows === 'boolean') { return options.windows; } return win32 === true || path.sep === '\\'; }; exports.escapeLast = (input, char, lastIdx) => { const idx = input.lastIndexOf(char, lastIdx); if (idx === -1) return input; if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); return `${input.slice(0, idx)}\\${input.slice(idx)}`; }; exports.removePrefix = (input, state = {}) => { let output = input; if (output.startsWith('./')) { output = output.slice(2); state.prefix = './'; } return output; }; exports.wrapOutput = (input, state = {}, options = {}) => { const prepend = options.contains ? '' : '^'; const append = options.contains ? '' : '$'; let output = `${prepend}(?:${input})${append}`; if (state.negated === true) { output = `(?:^(?!${output}).*$)`; } return output; }; /***/ }), /***/ 3242: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = __nccwpck_require__(6548); /***/ }), /***/ 896: /***/ ((module) => { module.exports = function(haystack, needle, comparator, low, high) { var mid, cmp; if(low === undefined) low = 0; else { low = low|0; if(low < 0 || low >= haystack.length) throw new RangeError("invalid lower bound"); } if(high === undefined) high = haystack.length - 1; else { high = high|0; if(high < low || high >= haystack.length) throw new RangeError("invalid upper bound"); } while(low <= high) { // The naive `low + high >>> 1` could fail for array lengths > 2**31 // because `>>>` converts its operands to int32. `low + (high - low >>> 1)` // works for array lengths <= 2**32-1 which is also Javascript's max array // length. mid = low + ((high - low) >>> 1); cmp = +comparator(haystack[mid], needle, mid, haystack); // Too low. if(cmp < 0.0) low = mid + 1; // Too high. else if(cmp > 0.0) high = mid - 1; // Key found. else return mid; } // Key not found. return ~low; } /***/ }), /***/ 794: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var DuplexStream = __nccwpck_require__(6141) , util = __nccwpck_require__(9023) , Buffer = (__nccwpck_require__(3058).Buffer) function BufferList (callback) { if (!(this instanceof BufferList)) return new BufferList(callback) this._bufs = [] this.length = 0 if (typeof callback == 'function') { this._callback = callback var piper = function piper (err) { if (this._callback) { this._callback(err) this._callback = null } }.bind(this) this.on('pipe', function onPipe (src) { src.on('error', piper) }) this.on('unpipe', function onUnpipe (src) { src.removeListener('error', piper) }) } else { this.append(callback) } DuplexStream.call(this) } util.inherits(BufferList, DuplexStream) BufferList.prototype._offset = function _offset (offset) { var tot = 0, i = 0, _t if (offset === 0) return [ 0, 0 ] for (; i < this._bufs.length; i++) { _t = tot + this._bufs[i].length if (offset < _t || i == this._bufs.length - 1) return [ i, offset - tot ] tot = _t } } BufferList.prototype.append = function append (buf) { var i = 0 if (Buffer.isBuffer(buf)) { this._appendBuffer(buf); } else if (Array.isArray(buf)) { for (; i < buf.length; i++) this.append(buf[i]) } else if (buf instanceof BufferList) { // unwrap argument into individual BufferLists for (; i < buf._bufs.length; i++) this.append(buf._bufs[i]) } else if (buf != null) { // coerce number arguments to strings, since Buffer(number) does // uninitialized memory allocation if (typeof buf == 'number') buf = buf.toString() this._appendBuffer(Buffer.from(buf)); } return this } BufferList.prototype._appendBuffer = function appendBuffer (buf) { this._bufs.push(buf) this.length += buf.length } BufferList.prototype._write = function _write (buf, encoding, callback) { this._appendBuffer(buf) if (typeof callback == 'function') callback() } BufferList.prototype._read = function _read (size) { if (!this.length) return this.push(null) size = Math.min(size, this.length) this.push(this.slice(0, size)) this.consume(size) } BufferList.prototype.end = function end (chunk) { DuplexStream.prototype.end.call(this, chunk) if (this._callback) { this._callback(null, this.slice()) this._callback = null } } BufferList.prototype.get = function get (index) { return this.slice(index, index + 1)[0] } BufferList.prototype.slice = function slice (start, end) { if (typeof start == 'number' && start < 0) start += this.length if (typeof end == 'number' && end < 0) end += this.length return this.copy(null, 0, start, end) } BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) { if (typeof srcStart != 'number' || srcStart < 0) srcStart = 0 if (typeof srcEnd != 'number' || srcEnd > this.length) srcEnd = this.length if (srcStart >= this.length) return dst || Buffer.alloc(0) if (srcEnd <= 0) return dst || Buffer.alloc(0) var copy = !!dst , off = this._offset(srcStart) , len = srcEnd - srcStart , bytes = len , bufoff = (copy && dstStart) || 0 , start = off[1] , l , i // copy/slice everything if (srcStart === 0 && srcEnd == this.length) { if (!copy) { // slice, but full concat if multiple buffers return this._bufs.length === 1 ? this._bufs[0] : Buffer.concat(this._bufs, this.length) } // copy, need to copy individual buffers for (i = 0; i < this._bufs.length; i++) { this._bufs[i].copy(dst, bufoff) bufoff += this._bufs[i].length } return dst } // easy, cheap case where it's a subset of one of the buffers if (bytes <= this._bufs[off[0]].length - start) { return copy ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) : this._bufs[off[0]].slice(start, start + bytes) } if (!copy) // a slice, we need something to copy in to dst = Buffer.allocUnsafe(len) for (i = off[0]; i < this._bufs.length; i++) { l = this._bufs[i].length - start if (bytes > l) { this._bufs[i].copy(dst, bufoff, start) bufoff += l } else { this._bufs[i].copy(dst, bufoff, start, start + bytes) bufoff += l break } bytes -= l if (start) start = 0 } // safeguard so that we don't return uninitialized memory if (dst.length > bufoff) return dst.slice(0, bufoff) return dst } BufferList.prototype.shallowSlice = function shallowSlice (start, end) { start = start || 0 end = end || this.length if (start < 0) start += this.length if (end < 0) end += this.length var startOffset = this._offset(start) , endOffset = this._offset(end) , buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1) if (endOffset[1] == 0) buffers.pop() else buffers[buffers.length-1] = buffers[buffers.length-1].slice(0, endOffset[1]) if (startOffset[1] != 0) buffers[0] = buffers[0].slice(startOffset[1]) return new BufferList(buffers) } BufferList.prototype.toString = function toString (encoding, start, end) { return this.slice(start, end).toString(encoding) } BufferList.prototype.consume = function consume (bytes) { // first, normalize the argument, in accordance with how Buffer does it bytes = Math.trunc(bytes) // do nothing if not a positive number if (Number.isNaN(bytes) || bytes <= 0) return this while (this._bufs.length) { if (bytes >= this._bufs[0].length) { bytes -= this._bufs[0].length this.length -= this._bufs[0].length this._bufs.shift() } else { this._bufs[0] = this._bufs[0].slice(bytes) this.length -= bytes break } } return this } BufferList.prototype.duplicate = function duplicate () { var i = 0 , copy = new BufferList() for (; i < this._bufs.length; i++) copy.append(this._bufs[i]) return copy } BufferList.prototype.destroy = function destroy () { this._bufs.length = 0 this.length = 0 this.push(null) } ;(function () { var methods = { 'readDoubleBE' : 8 , 'readDoubleLE' : 8 , 'readFloatBE' : 4 , 'readFloatLE' : 4 , 'readInt32BE' : 4 , 'readInt32LE' : 4 , 'readUInt32BE' : 4 , 'readUInt32LE' : 4 , 'readInt16BE' : 2 , 'readInt16LE' : 2 , 'readUInt16BE' : 2 , 'readUInt16LE' : 2 , 'readInt8' : 1 , 'readUInt8' : 1 } for (var m in methods) { (function (m) { BufferList.prototype[m] = function (offset) { return this.slice(offset, offset + methods[m])[m](0) } }(m)) } }()) module.exports = BufferList /***/ }), /***/ 748: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const stringify = __nccwpck_require__(3317); const compile = __nccwpck_require__(1113); const expand = __nccwpck_require__(5290); const parse = __nccwpck_require__(507); /** * Expand the given pattern or create a regex-compatible string. * * ```js * const braces = require('braces'); * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)'] * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c'] * ``` * @param {String} `str` * @param {Object} `options` * @return {String} * @api public */ const braces = (input, options = {}) => { let output = []; if (Array.isArray(input)) { for (const pattern of input) { const result = braces.create(pattern, options); if (Array.isArray(result)) { output.push(...result); } else { output.push(result); } } } else { output = [].concat(braces.create(input, options)); } if (options && options.expand === true && options.nodupes === true) { output = [...new Set(output)]; } return output; }; /** * Parse the given `str` with the given `options`. * * ```js * // braces.parse(pattern, [, options]); * const ast = braces.parse('a/{b,c}/d'); * console.log(ast); * ``` * @param {String} pattern Brace pattern to parse * @param {Object} options * @return {Object} Returns an AST * @api public */ braces.parse = (input, options = {}) => parse(input, options); /** * Creates a braces string from an AST, or an AST node. * * ```js * const braces = require('braces'); * let ast = braces.parse('foo/{a,b}/bar'); * console.log(stringify(ast.nodes[2])); //=> '{a,b}' * ``` * @param {String} `input` Brace pattern or AST. * @param {Object} `options` * @return {Array} Returns an array of expanded values. * @api public */ braces.stringify = (input, options = {}) => { if (typeof input === 'string') { return stringify(braces.parse(input, options), options); } return stringify(input, options); }; /** * Compiles a brace pattern into a regex-compatible, optimized string. * This method is called by the main [braces](#braces) function by default. * * ```js * const braces = require('braces'); * console.log(braces.compile('a/{b,c}/d')); * //=> ['a/(b|c)/d'] * ``` * @param {String} `input` Brace pattern or AST. * @param {Object} `options` * @return {Array} Returns an array of expanded values. * @api public */ braces.compile = (input, options = {}) => { if (typeof input === 'string') { input = braces.parse(input, options); } return compile(input, options); }; /** * Expands a brace pattern into an array. This method is called by the * main [braces](#braces) function when `options.expand` is true. Before * using this method it's recommended that you read the [performance notes](#performance)) * and advantages of using [.compile](#compile) instead. * * ```js * const braces = require('braces'); * console.log(braces.expand('a/{b,c}/d')); * //=> ['a/b/d', 'a/c/d']; * ``` * @param {String} `pattern` Brace pattern * @param {Object} `options` * @return {Array} Returns an array of expanded values. * @api public */ braces.expand = (input, options = {}) => { if (typeof input === 'string') { input = braces.parse(input, options); } let result = expand(input, options); // filter out empty strings if specified if (options.noempty === true) { result = result.filter(Boolean); } // filter out duplicates if specified if (options.nodupes === true) { result = [...new Set(result)]; } return result; }; /** * Processes a brace pattern and returns either an expanded array * (if `options.expand` is true), a highly optimized regex-compatible string. * This method is called by the main [braces](#braces) function. * * ```js * const braces = require('braces'); * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' * ``` * @param {String} `pattern` Brace pattern * @param {Object} `options` * @return {Array} Returns an array of expanded values. * @api public */ braces.create = (input, options = {}) => { if (input === '' || input.length < 3) { return [input]; } return options.expand !== true ? braces.compile(input, options) : braces.expand(input, options); }; /** * Expose "braces" */ module.exports = braces; /***/ }), /***/ 1113: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const fill = __nccwpck_require__(877); const utils = __nccwpck_require__(2257); const compile = (ast, options = {}) => { const walk = (node, parent = {}) => { const invalidBlock = utils.isInvalidBrace(parent); const invalidNode = node.invalid === true && options.escapeInvalid === true; const invalid = invalidBlock === true || invalidNode === true; const prefix = options.escapeInvalid === true ? '\\' : ''; let output = ''; if (node.isOpen === true) { return prefix + node.value; } if (node.isClose === true) { console.log('node.isClose', prefix, node.value); return prefix + node.value; } if (node.type === 'open') { return invalid ? prefix + node.value : '('; } if (node.type === 'close') { return invalid ? prefix + node.value : ')'; } if (node.type === 'comma') { return node.prev.type === 'comma' ? '' : invalid ? node.value : '|'; } if (node.value) { return node.value; } if (node.nodes && node.ranges > 0) { const args = utils.reduce(node.nodes); const range = fill(...args, { ...options, wrap: false, toRegex: true, strictZeros: true }); if (range.length !== 0) { return args.length > 1 && range.length > 1 ? `(${range})` : range; } } if (node.nodes) { for (const child of node.nodes) { output += walk(child, node); } } return output; }; return walk(ast); }; module.exports = compile; /***/ }), /***/ 2477: /***/ ((module) => { module.exports = { MAX_LENGTH: 10000, // Digits CHAR_0: '0', /* 0 */ CHAR_9: '9', /* 9 */ // Alphabet chars. CHAR_UPPERCASE_A: 'A', /* A */ CHAR_LOWERCASE_A: 'a', /* a */ CHAR_UPPERCASE_Z: 'Z', /* Z */ CHAR_LOWERCASE_Z: 'z', /* z */ CHAR_LEFT_PARENTHESES: '(', /* ( */ CHAR_RIGHT_PARENTHESES: ')', /* ) */ CHAR_ASTERISK: '*', /* * */ // Non-alphabetic chars. CHAR_AMPERSAND: '&', /* & */ CHAR_AT: '@', /* @ */ CHAR_BACKSLASH: '\\', /* \ */ CHAR_BACKTICK: '`', /* ` */ CHAR_CARRIAGE_RETURN: '\r', /* \r */ CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */ CHAR_COLON: ':', /* : */ CHAR_COMMA: ',', /* , */ CHAR_DOLLAR: '$', /* . */ CHAR_DOT: '.', /* . */ CHAR_DOUBLE_QUOTE: '"', /* " */ CHAR_EQUAL: '=', /* = */ CHAR_EXCLAMATION_MARK: '!', /* ! */ CHAR_FORM_FEED: '\f', /* \f */ CHAR_FORWARD_SLASH: '/', /* / */ CHAR_HASH: '#', /* # */ CHAR_HYPHEN_MINUS: '-', /* - */ CHAR_LEFT_ANGLE_BRACKET: '<', /* < */ CHAR_LEFT_CURLY_BRACE: '{', /* { */ CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */ CHAR_LINE_FEED: '\n', /* \n */ CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */ CHAR_PERCENT: '%', /* % */ CHAR_PLUS: '+', /* + */ CHAR_QUESTION_MARK: '?', /* ? */ CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */ CHAR_RIGHT_CURLY_BRACE: '}', /* } */ CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */ CHAR_SEMICOLON: ';', /* ; */ CHAR_SINGLE_QUOTE: '\'', /* ' */ CHAR_SPACE: ' ', /* */ CHAR_TAB: '\t', /* \t */ CHAR_UNDERSCORE: '_', /* _ */ CHAR_VERTICAL_LINE: '|', /* | */ CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */ }; /***/ }), /***/ 5290: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const fill = __nccwpck_require__(877); const stringify = __nccwpck_require__(3317); const utils = __nccwpck_require__(2257); const append = (queue = '', stash = '', enclose = false) => { const result = []; queue = [].concat(queue); stash = [].concat(stash); if (!stash.length) return queue; if (!queue.length) { return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash; } for (const item of queue) { if (Array.isArray(item)) { for (const value of item) { result.push(append(value, stash, enclose)); } } else { for (let ele of stash) { if (enclose === true && typeof ele === 'string') ele = `{${ele}}`; result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele); } } } return utils.flatten(result); }; const expand = (ast, options = {}) => { const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit; const walk = (node, parent = {}) => { node.queue = []; let p = parent; let q = parent.queue; while (p.type !== 'brace' && p.type !== 'root' && p.parent) { p = p.parent; q = p.queue; } if (node.invalid || node.dollar) { q.push(append(q.pop(), stringify(node, options))); return; } if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) { q.push(append(q.pop(), ['{}'])); return; } if (node.nodes && node.ranges > 0) { const args = utils.reduce(node.nodes); if (utils.exceedsLimit(...args, options.step, rangeLimit)) { throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); } let range = fill(...args, options); if (range.length === 0) { range = stringify(node, options); } q.push(append(q.pop(), range)); node.nodes = []; return; } const enclose = utils.encloseBrace(node); let queue = node.queue; let block = node; while (block.type !== 'brace' && block.type !== 'root' && block.parent) { block = block.parent; queue = block.queue; } for (let i = 0; i < node.nodes.length; i++) { const child = node.nodes[i]; if (child.type === 'comma' && node.type === 'brace') { if (i === 1) queue.push(''); queue.push(''); continue; } if (child.type === 'close') { q.push(append(q.pop(), queue, enclose)); continue; } if (child.value && child.type !== 'open') { queue.push(append(queue.pop(), child.value)); continue; } if (child.nodes) { walk(child, node); } } return queue; }; return utils.flatten(walk(ast)); }; module.exports = expand; /***/ }), /***/ 507: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const stringify = __nccwpck_require__(3317); /** * Constants */ const { MAX_LENGTH, CHAR_BACKSLASH, /* \ */ CHAR_BACKTICK, /* ` */ CHAR_COMMA, /* , */ CHAR_DOT, /* . */ CHAR_LEFT_PARENTHESES, /* ( */ CHAR_RIGHT_PARENTHESES, /* ) */ CHAR_LEFT_CURLY_BRACE, /* { */ CHAR_RIGHT_CURLY_BRACE, /* } */ CHAR_LEFT_SQUARE_BRACKET, /* [ */ CHAR_RIGHT_SQUARE_BRACKET, /* ] */ CHAR_DOUBLE_QUOTE, /* " */ CHAR_SINGLE_QUOTE, /* ' */ CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_NOBREAK_SPACE } = __nccwpck_require__(2477); /** * parse */ const parse = (input, options = {}) => { if (typeof input !== 'string') { throw new TypeError('Expected a string'); } const opts = options || {}; const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; if (input.length > max) { throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); } const ast = { type: 'root', input, nodes: [] }; const stack = [ast]; let block = ast; let prev = ast; let brackets = 0; const length = input.length; let index = 0; let depth = 0; let value; /** * Helpers */ const advance = () => input[index++]; const push = node => { if (node.type === 'text' && prev.type === 'dot') { prev.type = 'text'; } if (prev && prev.type === 'text' && node.type === 'text') { prev.value += node.value; return; } block.nodes.push(node); node.parent = block; node.prev = prev; prev = node; return node; }; push({ type: 'bos' }); while (index < length) { block = stack[stack.length - 1]; value = advance(); /** * Invalid chars */ if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { continue; } /** * Escaped chars */ if (value === CHAR_BACKSLASH) { push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() }); continue; } /** * Right square bracket (literal): ']' */ if (value === CHAR_RIGHT_SQUARE_BRACKET) { push({ type: 'text', value: '\\' + value }); continue; } /** * Left square bracket: '[' */ if (value === CHAR_LEFT_SQUARE_BRACKET) { brackets++; let next; while (index < length && (next = advance())) { value += next; if (next === CHAR_LEFT_SQUARE_BRACKET) { brackets++; continue; } if (next === CHAR_BACKSLASH) { value += advance(); continue; } if (next === CHAR_RIGHT_SQUARE_BRACKET) { brackets--; if (brackets === 0) { break; } } } push({ type: 'text', value }); continue; } /** * Parentheses */ if (value === CHAR_LEFT_PARENTHESES) { block = push({ type: 'paren', nodes: [] }); stack.push(block); push({ type: 'text', value }); continue; } if (value === CHAR_RIGHT_PARENTHESES) { if (block.type !== 'paren') { push({ type: 'text', value }); continue; } block = stack.pop(); push({ type: 'text', value }); block = stack[stack.length - 1]; continue; } /** * Quotes: '|"|` */ if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { const open = value; let next; if (options.keepQuotes !== true) { value = ''; } while (index < length && (next = advance())) { if (next === CHAR_BACKSLASH) { value += next + advance(); continue; } if (next === open) { if (options.keepQuotes === true) value += next; break; } value += next; } push({ type: 'text', value }); continue; } /** * Left curly brace: '{' */ if (value === CHAR_LEFT_CURLY_BRACE) { depth++; const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; const brace = { type: 'brace', open: true, close: false, dollar, depth, commas: 0, ranges: 0, nodes: [] }; block = push(brace); stack.push(block); push({ type: 'open', value }); continue; } /** * Right curly brace: '}' */ if (value === CHAR_RIGHT_CURLY_BRACE) { if (block.type !== 'brace') { push({ type: 'text', value }); continue; } const type = 'close'; block = stack.pop(); block.close = true; push({ type, value }); depth--; block = stack[stack.length - 1]; continue; } /** * Comma: ',' */ if (value === CHAR_COMMA && depth > 0) { if (block.ranges > 0) { block.ranges = 0; const open = block.nodes.shift(); block.nodes = [open, { type: 'text', value: stringify(block) }]; } push({ type: 'comma', value }); block.commas++; continue; } /** * Dot: '.' */ if (value === CHAR_DOT && depth > 0 && block.commas === 0) { const siblings = block.nodes; if (depth === 0 || siblings.length === 0) { push({ type: 'text', value }); continue; } if (prev.type === 'dot') { block.range = []; prev.value += value; prev.type = 'range'; if (block.nodes.length !== 3 && block.nodes.length !== 5) { block.invalid = true; block.ranges = 0; prev.type = 'text'; continue; } block.ranges++; block.args = []; continue; } if (prev.type === 'range') { siblings.pop(); const before = siblings[siblings.length - 1]; before.value += prev.value + value; prev = before; block.ranges--; continue; } push({ type: 'dot', value }); continue; } /** * Text */ push({ type: 'text', value }); } // Mark imbalanced braces and brackets as invalid do { block = stack.pop(); if (block.type !== 'root') { block.nodes.forEach(node => { if (!node.nodes) { if (node.type === 'open') node.isOpen = true; if (node.type === 'close') node.isClose = true; if (!node.nodes) node.type = 'text'; node.invalid = true; } }); // get the location of the block on parent.nodes (block's siblings) const parent = stack[stack.length - 1]; const index = parent.nodes.indexOf(block); // replace the (invalid) block with it's nodes parent.nodes.splice(index, 1, ...block.nodes); } } while (stack.length > 0); push({ type: 'eos' }); return ast; }; module.exports = parse; /***/ }), /***/ 3317: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const utils = __nccwpck_require__(2257); module.exports = (ast, options = {}) => { const stringify = (node, parent = {}) => { const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent); const invalidNode = node.invalid === true && options.escapeInvalid === true; let output = ''; if (node.value) { if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) { return '\\' + node.value; } return node.value; } if (node.value) { return node.value; } if (node.nodes) { for (const child of node.nodes) { output += stringify(child); } } return output; }; return stringify(ast); }; /***/ }), /***/ 2257: /***/ ((__unused_webpack_module, exports) => { exports.isInteger = num => { if (typeof num === 'number') { return Number.isInteger(num); } if (typeof num === 'string' && num.trim() !== '') { return Number.isInteger(Number(num)); } return false; }; /** * Find a node of the given type */ exports.find = (node, type) => node.nodes.find(node => node.type === type); /** * Find a node of the given type */ exports.exceedsLimit = (min, max, step = 1, limit) => { if (limit === false) return false; if (!exports.isInteger(min) || !exports.isInteger(max)) return false; return ((Number(max) - Number(min)) / Number(step)) >= limit; }; /** * Escape the given node with '\\' before node.value */ exports.escapeNode = (block, n = 0, type) => { const node = block.nodes[n]; if (!node) return; if ((type && node.type === type) || node.type === 'open' || node.type === 'close') { if (node.escaped !== true) { node.value = '\\' + node.value; node.escaped = true; } } }; /** * Returns true if the given brace node should be enclosed in literal braces */ exports.encloseBrace = node => { if (node.type !== 'brace') return false; if ((node.commas >> 0 + node.ranges >> 0) === 0) { node.invalid = true; return true; } return false; }; /** * Returns true if a brace node is invalid. */ exports.isInvalidBrace = block => { if (block.type !== 'brace') return false; if (block.invalid === true || block.dollar) return true; if ((block.commas >> 0 + block.ranges >> 0) === 0) { block.invalid = true; return true; } if (block.open !== true || block.close !== true) { block.invalid = true; return true; } return false; }; /** * Returns true if a node is an open or close node */ exports.isOpenOrClose = node => { if (node.type === 'open' || node.type === 'close') { return true; } return node.open === true || node.close === true; }; /** * Reduce an array of text nodes. */ exports.reduce = nodes => nodes.reduce((acc, node) => { if (node.type === 'text') acc.push(node.value); if (node.type === 'range') node.type = 'text'; return acc; }, []); /** * Flatten an array */ exports.flatten = (...args) => { const result = []; const flat = arr => { for (let i = 0; i < arr.length; i++) { const ele = arr[i]; if (Array.isArray(ele)) { flat(ele); continue; } if (ele !== undefined) { result.push(ele); } } return result; }; flat(args); return result; }; /***/ }), /***/ 3723: /***/ ((module) => { function allocUnsafe (size) { if (typeof size !== 'number') { throw new TypeError('"size" argument must be a number') } if (size < 0) { throw new RangeError('"size" argument must not be negative') } if (Buffer.allocUnsafe) { return Buffer.allocUnsafe(size) } else { return new Buffer(size) } } module.exports = allocUnsafe /***/ }), /***/ 8950: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var bufferFill = __nccwpck_require__(4764) var allocUnsafe = __nccwpck_require__(3723) module.exports = function alloc (size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('"size" argument must be a number') } if (size < 0) { throw new RangeError('"size" argument must not be negative') } if (Buffer.alloc) { return Buffer.alloc(size, fill, encoding) } var buffer = allocUnsafe(size) if (size === 0) { return buffer } if (fill === undefined) { return bufferFill(buffer, 0) } if (typeof encoding !== 'string') { encoding = undefined } return bufferFill(buffer, fill, encoding) } /***/ }), /***/ 9776: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var Buffer = (__nccwpck_require__(181).Buffer); var CRC_TABLE = [ 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d ]; if (typeof Int32Array !== 'undefined') { CRC_TABLE = new Int32Array(CRC_TABLE); } function ensureBuffer(input) { if (Buffer.isBuffer(input)) { return input; } var hasNewBufferAPI = typeof Buffer.alloc === "function" && typeof Buffer.from === "function"; if (typeof input === "number") { return hasNewBufferAPI ? Buffer.alloc(input) : new Buffer(input); } else if (typeof input === "string") { return hasNewBufferAPI ? Buffer.from(input) : new Buffer(input); } else { throw new Error("input must be buffer, number, or string, received " + typeof input); } } function bufferizeInt(num) { var tmp = ensureBuffer(4); tmp.writeInt32BE(num, 0); return tmp; } function _crc32(buf, previous) { buf = ensureBuffer(buf); if (Buffer.isBuffer(previous)) { previous = previous.readUInt32BE(0); } var crc = ~~previous ^ -1; for (var n = 0; n < buf.length; n++) { crc = CRC_TABLE[(crc ^ buf[n]) & 0xff] ^ (crc >>> 8); } return (crc ^ -1); } function crc32() { return bufferizeInt(_crc32.apply(null, arguments)); } crc32.signed = function () { return _crc32.apply(null, arguments); }; crc32.unsigned = function () { return _crc32.apply(null, arguments) >>> 0; }; module.exports = crc32; /***/ }), /***/ 4764: /***/ ((module) => { /* Node.js 6.4.0 and up has full support */ var hasFullSupport = (function () { try { if (!Buffer.isEncoding('latin1')) { return false } var buf = Buffer.alloc ? Buffer.alloc(4) : new Buffer(4) buf.fill('ab', 'ucs2') return (buf.toString('hex') === '61006200') } catch (_) { return false } }()) function isSingleByte (val) { return (val.length === 1 && val.charCodeAt(0) < 256) } function fillWithNumber (buffer, val, start, end) { if (start < 0 || end > buffer.length) { throw new RangeError('Out of range index') } start = start >>> 0 end = end === undefined ? buffer.length : end >>> 0 if (end > start) { buffer.fill(val, start, end) } return buffer } function fillWithBuffer (buffer, val, start, end) { if (start < 0 || end > buffer.length) { throw new RangeError('Out of range index') } if (end <= start) { return buffer } start = start >>> 0 end = end === undefined ? buffer.length : end >>> 0 var pos = start var len = val.length while (pos <= (end - len)) { val.copy(buffer, pos) pos += len } if (pos !== end) { val.copy(buffer, pos, 0, end - pos) } return buffer } function fill (buffer, val, start, end, encoding) { if (hasFullSupport) { return buffer.fill(val, start, end, encoding) } if (typeof val === 'number') { return fillWithNumber(buffer, val, start, end) } if (typeof val === 'string') { if (typeof start === 'string') { encoding = start start = 0 end = buffer.length } else if (typeof end === 'string') { encoding = end end = buffer.length } if (encoding !== undefined && typeof encoding !== 'string') { throw new TypeError('encoding must be a string') } if (encoding === 'latin1') { encoding = 'binary' } if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { throw new TypeError('Unknown encoding: ' + encoding) } if (val === '') { return fillWithNumber(buffer, 0, start, end) } if (isSingleByte(val)) { return fillWithNumber(buffer, val.charCodeAt(0), start, end) } val = new Buffer(val, encoding) } if (Buffer.isBuffer(val)) { return fillWithBuffer(buffer, val, start, end) } // Other values (e.g. undefined, boolean, object) results in zero-fill return fillWithNumber(buffer, 0, start, end) } module.exports = fill /***/ }), /***/ 2639: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var bind = __nccwpck_require__(7564); var $apply = __nccwpck_require__(3945); var $call = __nccwpck_require__(8093); var $reflectApply = __nccwpck_require__(1330); /** @type {import('./actualApply')} */ module.exports = $reflectApply || bind.call($call, $apply); /***/ }), /***/ 6002: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var bind = __nccwpck_require__(7564); var $apply = __nccwpck_require__(3945); var actualApply = __nccwpck_require__(2639); /** @type {import('./applyBind')} */ module.exports = function applyBind() { return actualApply(bind, $apply, arguments); }; /***/ }), /***/ 3945: /***/ ((module) => { /** @type {import('./functionApply')} */ module.exports = Function.prototype.apply; /***/ }), /***/ 8093: /***/ ((module) => { /** @type {import('./functionCall')} */ module.exports = Function.prototype.call; /***/ }), /***/ 8705: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var bind = __nccwpck_require__(7564); var $TypeError = __nccwpck_require__(3314); var $call = __nccwpck_require__(8093); var $actualApply = __nccwpck_require__(2639); /** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */ module.exports = function callBindBasic(args) { if (args.length < 1 || typeof args[0] !== 'function') { throw new $TypeError('a function is required'); } return $actualApply(bind, $call, args); }; /***/ }), /***/ 1330: /***/ ((module) => { /** @type {import('./reflectApply')} */ module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply; /***/ }), /***/ 3844: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var setFunctionLength = __nccwpck_require__(9346); var $defineProperty = __nccwpck_require__(9094); var callBindBasic = __nccwpck_require__(8705); var applyBind = __nccwpck_require__(6002); module.exports = function callBind(originalFunction) { var func = callBindBasic(arguments); var adjustedLength = originalFunction.length - (arguments.length - 1); return setFunctionLength( func, 1 + (adjustedLength > 0 ? adjustedLength : 0), true ); }; if ($defineProperty) { $defineProperty(module.exports, 'apply', { value: applyBind }); } else { module.exports.apply = applyBind; } /***/ }), /***/ 3105: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var GetIntrinsic = __nccwpck_require__(470); var callBindBasic = __nccwpck_require__(8705); /** @type {(thisArg: string, searchString: string, position?: number) => number} */ var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]); /** @type {import('.')} */ module.exports = function callBoundIntrinsic(name, allowMissing) { /* eslint no-extra-parens: 0 */ var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing)); if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { return callBindBasic(/** @type {const} */ ([intrinsic])); } return intrinsic; }; /***/ }), /***/ 5315: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { const { EventEmitter } = __nccwpck_require__(4434); const fs = __nccwpck_require__(9896); const sysPath = __nccwpck_require__(6928); const { promisify } = __nccwpck_require__(9023); const readdirp = __nccwpck_require__(7525); const anymatch = (__nccwpck_require__(2739)["default"]); const globParent = __nccwpck_require__(8505); const isGlob = __nccwpck_require__(1925); const braces = __nccwpck_require__(748); const normalizePath = __nccwpck_require__(6133); const NodeFsHandler = __nccwpck_require__(3897); const FsEventsHandler = __nccwpck_require__(8748); const { EV_ALL, EV_READY, EV_ADD, EV_CHANGE, EV_UNLINK, EV_ADD_DIR, EV_UNLINK_DIR, EV_RAW, EV_ERROR, STR_CLOSE, STR_END, BACK_SLASH_RE, DOUBLE_SLASH_RE, SLASH_OR_BACK_SLASH_RE, DOT_RE, REPLACER_RE, SLASH, SLASH_SLASH, BRACE_START, BANG, ONE_DOT, TWO_DOTS, GLOBSTAR, SLASH_GLOBSTAR, ANYMATCH_OPTS, STRING_TYPE, FUNCTION_TYPE, EMPTY_STR, EMPTY_FN, isWindows, isMacos, isIBMi } = __nccwpck_require__(6169); const stat = promisify(fs.stat); const readdir = promisify(fs.readdir); /** * @typedef {String} Path * @typedef {'all'|'add'|'addDir'|'change'|'unlink'|'unlinkDir'|'raw'|'error'|'ready'} EventName * @typedef {'readdir'|'watch'|'add'|'remove'|'change'} ThrottleType */ /** * * @typedef {Object} WatchHelpers * @property {Boolean} followSymlinks * @property {'stat'|'lstat'} statMethod * @property {Path} path * @property {Path} watchPath * @property {Function} entryPath * @property {Boolean} hasGlob * @property {Object} globFilter * @property {Function} filterPath * @property {Function} filterDir */ const arrify = (value = []) => Array.isArray(value) ? value : [value]; const flatten = (list, result = []) => { list.forEach(item => { if (Array.isArray(item)) { flatten(item, result); } else { result.push(item); } }); return result; }; const unifyPaths = (paths_) => { /** * @type {Array} */ const paths = flatten(arrify(paths_)); if (!paths.every(p => typeof p === STRING_TYPE)) { throw new TypeError(`Non-string provided as watch path: ${paths}`); } return paths.map(normalizePathToUnix); }; // If SLASH_SLASH occurs at the beginning of path, it is not replaced // because "//StoragePC/DrivePool/Movies" is a valid network path const toUnix = (string) => { let str = string.replace(BACK_SLASH_RE, SLASH); let prepend = false; if (str.startsWith(SLASH_SLASH)) { prepend = true; } while (str.match(DOUBLE_SLASH_RE)) { str = str.replace(DOUBLE_SLASH_RE, SLASH); } if (prepend) { str = SLASH + str; } return str; }; // Our version of upath.normalize // TODO: this is not equal to path-normalize module - investigate why const normalizePathToUnix = (path) => toUnix(sysPath.normalize(toUnix(path))); const normalizeIgnored = (cwd = EMPTY_STR) => (path) => { if (typeof path !== STRING_TYPE) return path; return normalizePathToUnix(sysPath.isAbsolute(path) ? path : sysPath.join(cwd, path)); }; const getAbsolutePath = (path, cwd) => { if (sysPath.isAbsolute(path)) { return path; } if (path.startsWith(BANG)) { return BANG + sysPath.join(cwd, path.slice(1)); } return sysPath.join(cwd, path); }; const undef = (opts, key) => opts[key] === undefined; /** * Directory entry. * @property {Path} path * @property {Set} items */ class DirEntry { /** * @param {Path} dir * @param {Function} removeWatcher */ constructor(dir, removeWatcher) { this.path = dir; this._removeWatcher = removeWatcher; /** @type {Set} */ this.items = new Set(); } add(item) { const {items} = this; if (!items) return; if (item !== ONE_DOT && item !== TWO_DOTS) items.add(item); } async remove(item) { const {items} = this; if (!items) return; items.delete(item); if (items.size > 0) return; const dir = this.path; try { await readdir(dir); } catch (err) { if (this._removeWatcher) { this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir)); } } } has(item) { const {items} = this; if (!items) return; return items.has(item); } /** * @returns {Array} */ getChildren() { const {items} = this; if (!items) return; return [...items.values()]; } dispose() { this.items.clear(); delete this.path; delete this._removeWatcher; delete this.items; Object.freeze(this); } } const STAT_METHOD_F = 'stat'; const STAT_METHOD_L = 'lstat'; class WatchHelper { constructor(path, watchPath, follow, fsw) { this.fsw = fsw; this.path = path = path.replace(REPLACER_RE, EMPTY_STR); this.watchPath = watchPath; this.fullWatchPath = sysPath.resolve(watchPath); this.hasGlob = watchPath !== path; /** @type {object|boolean} */ if (path === EMPTY_STR) this.hasGlob = false; this.globSymlink = this.hasGlob && follow ? undefined : false; this.globFilter = this.hasGlob ? anymatch(path, undefined, ANYMATCH_OPTS) : false; this.dirParts = this.getDirParts(path); this.dirParts.forEach((parts) => { if (parts.length > 1) parts.pop(); }); this.followSymlinks = follow; this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L; } checkGlobSymlink(entry) { // only need to resolve once // first entry should always have entry.parentDir === EMPTY_STR if (this.globSymlink === undefined) { this.globSymlink = entry.fullParentDir === this.fullWatchPath ? false : {realPath: entry.fullParentDir, linkPath: this.fullWatchPath}; } if (this.globSymlink) { return entry.fullPath.replace(this.globSymlink.realPath, this.globSymlink.linkPath); } return entry.fullPath; } entryPath(entry) { return sysPath.join(this.watchPath, sysPath.relative(this.watchPath, this.checkGlobSymlink(entry)) ); } filterPath(entry) { const {stats} = entry; if (stats && stats.isSymbolicLink()) return this.filterDir(entry); const resolvedPath = this.entryPath(entry); const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE ? this.globFilter(resolvedPath) : true; return matchesGlob && this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats); } getDirParts(path) { if (!this.hasGlob) return []; const parts = []; const expandedPath = path.includes(BRACE_START) ? braces.expand(path) : [path]; expandedPath.forEach((path) => { parts.push(sysPath.relative(this.watchPath, path).split(SLASH_OR_BACK_SLASH_RE)); }); return parts; } filterDir(entry) { if (this.hasGlob) { const entryParts = this.getDirParts(this.checkGlobSymlink(entry)); let globstar = false; this.unmatchedGlob = !this.dirParts.some((parts) => { return parts.every((part, i) => { if (part === GLOBSTAR) globstar = true; return globstar || !entryParts[0][i] || anymatch(part, entryParts[0][i], ANYMATCH_OPTS); }); }); } return !this.unmatchedGlob && this.fsw._isntIgnored(this.entryPath(entry), entry.stats); } } /** * Watches files & directories for changes. Emitted events: * `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `all`, `error` * * new FSWatcher() * .add(directories) * .on('add', path => log('File', path, 'was added')) */ class FSWatcher extends EventEmitter { // Not indenting methods for history sake; for now. constructor(_opts) { super(); const opts = {}; if (_opts) Object.assign(opts, _opts); // for frozen objects /** @type {Map} */ this._watched = new Map(); /** @type {Map} */ this._closers = new Map(); /** @type {Set} */ this._ignoredPaths = new Set(); /** @type {Map} */ this._throttled = new Map(); /** @type {Map} */ this._symlinkPaths = new Map(); this._streams = new Set(); this.closed = false; // Set up default options. if (undef(opts, 'persistent')) opts.persistent = true; if (undef(opts, 'ignoreInitial')) opts.ignoreInitial = false; if (undef(opts, 'ignorePermissionErrors')) opts.ignorePermissionErrors = false; if (undef(opts, 'interval')) opts.interval = 100; if (undef(opts, 'binaryInterval')) opts.binaryInterval = 300; if (undef(opts, 'disableGlobbing')) opts.disableGlobbing = false; opts.enableBinaryInterval = opts.binaryInterval !== opts.interval; // Enable fsevents on OS X when polling isn't explicitly enabled. if (undef(opts, 'useFsEvents')) opts.useFsEvents = !opts.usePolling; // If we can't use fsevents, ensure the options reflect it's disabled. const canUseFsEvents = FsEventsHandler.canUse(); if (!canUseFsEvents) opts.useFsEvents = false; // Use polling on Mac if not using fsevents. // Other platforms use non-polling fs_watch. if (undef(opts, 'usePolling') && !opts.useFsEvents) { opts.usePolling = isMacos; } // Always default to polling on IBM i because fs.watch() is not available on IBM i. if(isIBMi) { opts.usePolling = true; } // Global override (useful for end-developers that need to force polling for all // instances of chokidar, regardless of usage/dependency depth) const envPoll = process.env.CHOKIDAR_USEPOLLING; if (envPoll !== undefined) { const envLower = envPoll.toLowerCase(); if (envLower === 'false' || envLower === '0') { opts.usePolling = false; } else if (envLower === 'true' || envLower === '1') { opts.usePolling = true; } else { opts.usePolling = !!envLower; } } const envInterval = process.env.CHOKIDAR_INTERVAL; if (envInterval) { opts.interval = Number.parseInt(envInterval, 10); } // Editor atomic write normalization enabled by default with fs.watch if (undef(opts, 'atomic')) opts.atomic = !opts.usePolling && !opts.useFsEvents; if (opts.atomic) this._pendingUnlinks = new Map(); if (undef(opts, 'followSymlinks')) opts.followSymlinks = true; if (undef(opts, 'awaitWriteFinish')) opts.awaitWriteFinish = false; if (opts.awaitWriteFinish === true) opts.awaitWriteFinish = {}; const awf = opts.awaitWriteFinish; if (awf) { if (!awf.stabilityThreshold) awf.stabilityThreshold = 2000; if (!awf.pollInterval) awf.pollInterval = 100; this._pendingWrites = new Map(); } if (opts.ignored) opts.ignored = arrify(opts.ignored); let readyCalls = 0; this._emitReady = () => { readyCalls++; if (readyCalls >= this._readyCount) { this._emitReady = EMPTY_FN; this._readyEmitted = true; // use process.nextTick to allow time for listener to be bound process.nextTick(() => this.emit(EV_READY)); } }; this._emitRaw = (...args) => this.emit(EV_RAW, ...args); this._readyEmitted = false; this.options = opts; // Initialize with proper watcher. if (opts.useFsEvents) { this._fsEventsHandler = new FsEventsHandler(this); } else { this._nodeFsHandler = new NodeFsHandler(this); } // You’re frozen when your heart’s not open. Object.freeze(opts); } // Public methods /** * Adds paths to be watched on an existing FSWatcher instance * @param {Path|Array} paths_ * @param {String=} _origAdd private; for handling non-existent paths to be watched * @param {Boolean=} _internal private; indicates a non-user add * @returns {FSWatcher} for chaining */ add(paths_, _origAdd, _internal) { const {cwd, disableGlobbing} = this.options; this.closed = false; let paths = unifyPaths(paths_); if (cwd) { paths = paths.map((path) => { const absPath = getAbsolutePath(path, cwd); // Check `path` instead of `absPath` because the cwd portion can't be a glob if (disableGlobbing || !isGlob(path)) { return absPath; } return normalizePath(absPath); }); } // set aside negated glob strings paths = paths.filter((path) => { if (path.startsWith(BANG)) { this._ignoredPaths.add(path.slice(1)); return false; } // if a path is being added that was previously ignored, stop ignoring it this._ignoredPaths.delete(path); this._ignoredPaths.delete(path + SLASH_GLOBSTAR); // reset the cached userIgnored anymatch fn // to make ignoredPaths changes effective this._userIgnored = undefined; return true; }); if (this.options.useFsEvents && this._fsEventsHandler) { if (!this._readyCount) this._readyCount = paths.length; if (this.options.persistent) this._readyCount += paths.length; paths.forEach((path) => this._fsEventsHandler._addToFsEvents(path)); } else { if (!this._readyCount) this._readyCount = 0; this._readyCount += paths.length; Promise.all( paths.map(async path => { const res = await this._nodeFsHandler._addToNodeFs(path, !_internal, 0, 0, _origAdd); if (res) this._emitReady(); return res; }) ).then(results => { if (this.closed) return; results.filter(item => item).forEach(item => { this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item)); }); }); } return this; } /** * Close watchers or start ignoring events from specified paths. * @param {Path|Array} paths_ - string or array of strings, file/directory paths and/or globs * @returns {FSWatcher} for chaining */ unwatch(paths_) { if (this.closed) return this; const paths = unifyPaths(paths_); const {cwd} = this.options; paths.forEach((path) => { // convert to absolute path unless relative path already matches if (!sysPath.isAbsolute(path) && !this._closers.has(path)) { if (cwd) path = sysPath.join(cwd, path); path = sysPath.resolve(path); } this._closePath(path); this._ignoredPaths.add(path); if (this._watched.has(path)) { this._ignoredPaths.add(path + SLASH_GLOBSTAR); } // reset the cached userIgnored anymatch fn // to make ignoredPaths changes effective this._userIgnored = undefined; }); return this; } /** * Close watchers and remove all listeners from watched paths. * @returns {Promise}. */ close() { if (this.closed) return this._closePromise; this.closed = true; // Memory management. this.removeAllListeners(); const closers = []; this._closers.forEach(closerList => closerList.forEach(closer => { const promise = closer(); if (promise instanceof Promise) closers.push(promise); })); this._streams.forEach(stream => stream.destroy()); this._userIgnored = undefined; this._readyCount = 0; this._readyEmitted = false; this._watched.forEach(dirent => dirent.dispose()); ['closers', 'watched', 'streams', 'symlinkPaths', 'throttled'].forEach(key => { this[`_${key}`].clear(); }); this._closePromise = closers.length ? Promise.all(closers).then(() => undefined) : Promise.resolve(); return this._closePromise; } /** * Expose list of watched paths * @returns {Object} for chaining */ getWatched() { const watchList = {}; this._watched.forEach((entry, dir) => { const key = this.options.cwd ? sysPath.relative(this.options.cwd, dir) : dir; watchList[key || ONE_DOT] = entry.getChildren().sort(); }); return watchList; } emitWithAll(event, args) { this.emit(...args); if (event !== EV_ERROR) this.emit(EV_ALL, ...args); } // Common helpers // -------------- /** * Normalize and emit events. * Calling _emit DOES NOT MEAN emit() would be called! * @param {EventName} event Type of event * @param {Path} path File or directory path * @param {*=} val1 arguments to be passed with event * @param {*=} val2 * @param {*=} val3 * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag */ async _emit(event, path, val1, val2, val3) { if (this.closed) return; const opts = this.options; if (isWindows) path = sysPath.normalize(path); if (opts.cwd) path = sysPath.relative(opts.cwd, path); /** @type Array */ const args = [event, path]; if (val3 !== undefined) args.push(val1, val2, val3); else if (val2 !== undefined) args.push(val1, val2); else if (val1 !== undefined) args.push(val1); const awf = opts.awaitWriteFinish; let pw; if (awf && (pw = this._pendingWrites.get(path))) { pw.lastChange = new Date(); return this; } if (opts.atomic) { if (event === EV_UNLINK) { this._pendingUnlinks.set(path, args); setTimeout(() => { this._pendingUnlinks.forEach((entry, path) => { this.emit(...entry); this.emit(EV_ALL, ...entry); this._pendingUnlinks.delete(path); }); }, typeof opts.atomic === 'number' ? opts.atomic : 100); return this; } if (event === EV_ADD && this._pendingUnlinks.has(path)) { event = args[0] = EV_CHANGE; this._pendingUnlinks.delete(path); } } if (awf && (event === EV_ADD || event === EV_CHANGE) && this._readyEmitted) { const awfEmit = (err, stats) => { if (err) { event = args[0] = EV_ERROR; args[1] = err; this.emitWithAll(event, args); } else if (stats) { // if stats doesn't exist the file must have been deleted if (args.length > 2) { args[2] = stats; } else { args.push(stats); } this.emitWithAll(event, args); } }; this._awaitWriteFinish(path, awf.stabilityThreshold, event, awfEmit); return this; } if (event === EV_CHANGE) { const isThrottled = !this._throttle(EV_CHANGE, path, 50); if (isThrottled) return this; } if (opts.alwaysStat && val1 === undefined && (event === EV_ADD || event === EV_ADD_DIR || event === EV_CHANGE) ) { const fullPath = opts.cwd ? sysPath.join(opts.cwd, path) : path; let stats; try { stats = await stat(fullPath); } catch (err) {} // Suppress event when fs_stat fails, to avoid sending undefined 'stat' if (!stats || this.closed) return; args.push(stats); } this.emitWithAll(event, args); return this; } /** * Common handler for errors * @param {Error} error * @returns {Error|Boolean} The error if defined, otherwise the value of the FSWatcher instance's `closed` flag */ _handleError(error) { const code = error && error.code; if (error && code !== 'ENOENT' && code !== 'ENOTDIR' && (!this.options.ignorePermissionErrors || (code !== 'EPERM' && code !== 'EACCES')) ) { this.emit(EV_ERROR, error); } return error || this.closed; } /** * Helper utility for throttling * @param {ThrottleType} actionType type being throttled * @param {Path} path being acted upon * @param {Number} timeout duration of time to suppress duplicate actions * @returns {Object|false} tracking object or false if action should be suppressed */ _throttle(actionType, path, timeout) { if (!this._throttled.has(actionType)) { this._throttled.set(actionType, new Map()); } /** @type {Map} */ const action = this._throttled.get(actionType); /** @type {Object} */ const actionPath = action.get(path); if (actionPath) { actionPath.count++; return false; } let timeoutObject; const clear = () => { const item = action.get(path); const count = item ? item.count : 0; action.delete(path); clearTimeout(timeoutObject); if (item) clearTimeout(item.timeoutObject); return count; }; timeoutObject = setTimeout(clear, timeout); const thr = {timeoutObject, clear, count: 0}; action.set(path, thr); return thr; } _incrReadyCount() { return this._readyCount++; } /** * Awaits write operation to finish. * Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback. * @param {Path} path being acted upon * @param {Number} threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished * @param {EventName} event * @param {Function} awfEmit Callback to be called when ready for event to be emitted. */ _awaitWriteFinish(path, threshold, event, awfEmit) { let timeoutHandler; let fullPath = path; if (this.options.cwd && !sysPath.isAbsolute(path)) { fullPath = sysPath.join(this.options.cwd, path); } const now = new Date(); const awaitWriteFinish = (prevStat) => { fs.stat(fullPath, (err, curStat) => { if (err || !this._pendingWrites.has(path)) { if (err && err.code !== 'ENOENT') awfEmit(err); return; } const now = Number(new Date()); if (prevStat && curStat.size !== prevStat.size) { this._pendingWrites.get(path).lastChange = now; } const pw = this._pendingWrites.get(path); const df = now - pw.lastChange; if (df >= threshold) { this._pendingWrites.delete(path); awfEmit(undefined, curStat); } else { timeoutHandler = setTimeout( awaitWriteFinish, this.options.awaitWriteFinish.pollInterval, curStat ); } }); }; if (!this._pendingWrites.has(path)) { this._pendingWrites.set(path, { lastChange: now, cancelWait: () => { this._pendingWrites.delete(path); clearTimeout(timeoutHandler); return event; } }); timeoutHandler = setTimeout( awaitWriteFinish, this.options.awaitWriteFinish.pollInterval ); } } _getGlobIgnored() { return [...this._ignoredPaths.values()]; } /** * Determines whether user has asked to ignore this path. * @param {Path} path filepath or dir * @param {fs.Stats=} stats result of fs.stat * @returns {Boolean} */ _isIgnored(path, stats) { if (this.options.atomic && DOT_RE.test(path)) return true; if (!this._userIgnored) { const {cwd} = this.options; const ign = this.options.ignored; const ignored = ign && ign.map(normalizeIgnored(cwd)); const paths = arrify(ignored) .filter((path) => typeof path === STRING_TYPE && !isGlob(path)) .map((path) => path + SLASH_GLOBSTAR); const list = this._getGlobIgnored().map(normalizeIgnored(cwd)).concat(ignored, paths); this._userIgnored = anymatch(list, undefined, ANYMATCH_OPTS); } return this._userIgnored([path, stats]); } _isntIgnored(path, stat) { return !this._isIgnored(path, stat); } /** * Provides a set of common helpers and properties relating to symlink and glob handling. * @param {Path} path file, directory, or glob pattern being watched * @param {Number=} depth at any depth > 0, this isn't a glob * @returns {WatchHelper} object containing helpers for this path */ _getWatchHelpers(path, depth) { const watchPath = depth || this.options.disableGlobbing || !isGlob(path) ? path : globParent(path); const follow = this.options.followSymlinks; return new WatchHelper(path, watchPath, follow, this); } // Directory helpers // ----------------- /** * Provides directory tracking objects * @param {String} directory path of the directory * @returns {DirEntry} the directory's tracking object */ _getWatchedDir(directory) { if (!this._boundRemove) this._boundRemove = this._remove.bind(this); const dir = sysPath.resolve(directory); if (!this._watched.has(dir)) this._watched.set(dir, new DirEntry(dir, this._boundRemove)); return this._watched.get(dir); } // File helpers // ------------ /** * Check for read permissions. * Based on this answer on SO: https://stackoverflow.com/a/11781404/1358405 * @param {fs.Stats} stats - object, result of fs_stat * @returns {Boolean} indicates whether the file can be read */ _hasReadPermissions(stats) { if (this.options.ignorePermissionErrors) return true; // stats.mode may be bigint const md = stats && Number.parseInt(stats.mode, 10); const st = md & 0o777; const it = Number.parseInt(st.toString(8)[0], 10); return Boolean(4 & it); } /** * Handles emitting unlink events for * files and directories, and via recursion, for * files and directories within directories that are unlinked * @param {String} directory within which the following item is located * @param {String} item base path of item/directory * @returns {void} */ _remove(directory, item, isDirectory) { // if what is being deleted is a directory, get that directory's paths // for recursive deleting and cleaning of watched object // if it is not a directory, nestedDirectoryChildren will be empty array const path = sysPath.join(directory, item); const fullPath = sysPath.resolve(path); isDirectory = isDirectory != null ? isDirectory : this._watched.has(path) || this._watched.has(fullPath); // prevent duplicate handling in case of arriving here nearly simultaneously // via multiple paths (such as _handleFile and _handleDir) if (!this._throttle('remove', path, 100)) return; // if the only watched file is removed, watch for its return if (!isDirectory && !this.options.useFsEvents && this._watched.size === 1) { this.add(directory, item, true); } // This will create a new entry in the watched object in either case // so we got to do the directory check beforehand const wp = this._getWatchedDir(path); const nestedDirectoryChildren = wp.getChildren(); // Recursively remove children directories / files. nestedDirectoryChildren.forEach(nested => this._remove(path, nested)); // Check if item was on the watched list and remove it const parent = this._getWatchedDir(directory); const wasTracked = parent.has(item); parent.remove(item); // Fixes issue #1042 -> Relative paths were detected and added as symlinks // (https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L612), // but never removed from the map in case the path was deleted. // This leads to an incorrect state if the path was recreated: // https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L553 if (this._symlinkPaths.has(fullPath)) { this._symlinkPaths.delete(fullPath); } // If we wait for this file to be fully written, cancel the wait. let relPath = path; if (this.options.cwd) relPath = sysPath.relative(this.options.cwd, path); if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) { const event = this._pendingWrites.get(relPath).cancelWait(); if (event === EV_ADD) return; } // The Entry will either be a directory that just got removed // or a bogus entry to a file, in either case we have to remove it this._watched.delete(path); this._watched.delete(fullPath); const eventName = isDirectory ? EV_UNLINK_DIR : EV_UNLINK; if (wasTracked && !this._isIgnored(path)) this._emit(eventName, path); // Avoid conflicts if we later create another file with the same name if (!this.options.useFsEvents) { this._closePath(path); } } /** * Closes all watchers for a path * @param {Path} path */ _closePath(path) { this._closeFile(path) const dir = sysPath.dirname(path); this._getWatchedDir(dir).remove(sysPath.basename(path)); } /** * Closes only file-specific watchers * @param {Path} path */ _closeFile(path) { const closers = this._closers.get(path); if (!closers) return; closers.forEach(closer => closer()); this._closers.delete(path); } /** * * @param {Path} path * @param {Function} closer */ _addPathCloser(path, closer) { if (!closer) return; let list = this._closers.get(path); if (!list) { list = []; this._closers.set(path, list); } list.push(closer); } _readdirp(root, opts) { if (this.closed) return; const options = {type: EV_ALL, alwaysStat: true, lstat: true, ...opts}; let stream = readdirp(root, options); this._streams.add(stream); stream.once(STR_CLOSE, () => { stream = undefined; }); stream.once(STR_END, () => { if (stream) { this._streams.delete(stream); stream = undefined; } }); return stream; } } // Export FSWatcher class exports.FSWatcher = FSWatcher; /** * Instantiates watcher with paths to be tracked. * @param {String|Array} paths file/directory paths and/or globs * @param {Object=} options chokidar opts * @returns an instance of FSWatcher for chaining. */ const watch = (paths, options) => { const watcher = new FSWatcher(options); watcher.add(paths); return watcher; }; exports.watch = watch; /***/ }), /***/ 6169: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { const {sep} = __nccwpck_require__(6928); const {platform} = process; const os = __nccwpck_require__(857); exports.EV_ALL = 'all'; exports.EV_READY = 'ready'; exports.EV_ADD = 'add'; exports.EV_CHANGE = 'change'; exports.EV_ADD_DIR = 'addDir'; exports.EV_UNLINK = 'unlink'; exports.EV_UNLINK_DIR = 'unlinkDir'; exports.EV_RAW = 'raw'; exports.EV_ERROR = 'error'; exports.STR_DATA = 'data'; exports.STR_END = 'end'; exports.STR_CLOSE = 'close'; exports.FSEVENT_CREATED = 'created'; exports.FSEVENT_MODIFIED = 'modified'; exports.FSEVENT_DELETED = 'deleted'; exports.FSEVENT_MOVED = 'moved'; exports.FSEVENT_CLONED = 'cloned'; exports.FSEVENT_UNKNOWN = 'unknown'; exports.FSEVENT_FLAG_MUST_SCAN_SUBDIRS = 1; exports.FSEVENT_TYPE_FILE = 'file'; exports.FSEVENT_TYPE_DIRECTORY = 'directory'; exports.FSEVENT_TYPE_SYMLINK = 'symlink'; exports.KEY_LISTENERS = 'listeners'; exports.KEY_ERR = 'errHandlers'; exports.KEY_RAW = 'rawEmitters'; exports.HANDLER_KEYS = [exports.KEY_LISTENERS, exports.KEY_ERR, exports.KEY_RAW]; exports.DOT_SLASH = `.${sep}`; exports.BACK_SLASH_RE = /\\/g; exports.DOUBLE_SLASH_RE = /\/\//; exports.SLASH_OR_BACK_SLASH_RE = /[/\\]/; exports.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/; exports.REPLACER_RE = /^\.[/\\]/; exports.SLASH = '/'; exports.SLASH_SLASH = '//'; exports.BRACE_START = '{'; exports.BANG = '!'; exports.ONE_DOT = '.'; exports.TWO_DOTS = '..'; exports.STAR = '*'; exports.GLOBSTAR = '**'; exports.ROOT_GLOBSTAR = '/**/*'; exports.SLASH_GLOBSTAR = '/**'; exports.DIR_SUFFIX = 'Dir'; exports.ANYMATCH_OPTS = {dot: true}; exports.STRING_TYPE = 'string'; exports.FUNCTION_TYPE = 'function'; exports.EMPTY_STR = ''; exports.EMPTY_FN = () => {}; exports.IDENTITY_FN = val => val; exports.isWindows = platform === 'win32'; exports.isMacos = platform === 'darwin'; exports.isLinux = platform === 'linux'; exports.isIBMi = os.type() === 'OS400'; /***/ }), /***/ 8748: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const fs = __nccwpck_require__(9896); const sysPath = __nccwpck_require__(6928); const { promisify } = __nccwpck_require__(9023); let fsevents; try { fsevents = __nccwpck_require__(8383); } catch (error) { if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(error); } if (fsevents) { // TODO: real check const mtch = process.version.match(/v(\d+)\.(\d+)/); if (mtch && mtch[1] && mtch[2]) { const maj = Number.parseInt(mtch[1], 10); const min = Number.parseInt(mtch[2], 10); if (maj === 8 && min < 16) { fsevents = undefined; } } } const { EV_ADD, EV_CHANGE, EV_ADD_DIR, EV_UNLINK, EV_ERROR, STR_DATA, STR_END, FSEVENT_CREATED, FSEVENT_MODIFIED, FSEVENT_DELETED, FSEVENT_MOVED, // FSEVENT_CLONED, FSEVENT_UNKNOWN, FSEVENT_FLAG_MUST_SCAN_SUBDIRS, FSEVENT_TYPE_FILE, FSEVENT_TYPE_DIRECTORY, FSEVENT_TYPE_SYMLINK, ROOT_GLOBSTAR, DIR_SUFFIX, DOT_SLASH, FUNCTION_TYPE, EMPTY_FN, IDENTITY_FN } = __nccwpck_require__(6169); const Depth = (value) => isNaN(value) ? {} : {depth: value}; const stat = promisify(fs.stat); const lstat = promisify(fs.lstat); const realpath = promisify(fs.realpath); const statMethods = { stat, lstat }; /** * @typedef {String} Path */ /** * @typedef {Object} FsEventsWatchContainer * @property {Set} listeners * @property {Function} rawEmitter * @property {{stop: Function}} watcher */ // fsevents instance helper functions /** * Object to hold per-process fsevents instances (may be shared across chokidar FSWatcher instances) * @type {Map} */ const FSEventsWatchers = new Map(); // Threshold of duplicate path prefixes at which to start // consolidating going forward const consolidateThreshhold = 10; const wrongEventFlags = new Set([ 69888, 70400, 71424, 72704, 73472, 131328, 131840, 262912 ]); /** * Instantiates the fsevents interface * @param {Path} path path to be watched * @param {Function} callback called when fsevents is bound and ready * @returns {{stop: Function}} new fsevents instance */ const createFSEventsInstance = (path, callback) => { const stop = fsevents.watch(path, callback); return {stop}; }; /** * Instantiates the fsevents interface or binds listeners to an existing one covering * the same file tree. * @param {Path} path - to be watched * @param {Path} realPath - real path for symlinks * @param {Function} listener - called when fsevents emits events * @param {Function} rawEmitter - passes data to listeners of the 'raw' event * @returns {Function} closer */ function setFSEventsListener(path, realPath, listener, rawEmitter) { let watchPath = sysPath.extname(realPath) ? sysPath.dirname(realPath) : realPath; const parentPath = sysPath.dirname(watchPath); let cont = FSEventsWatchers.get(watchPath); // If we've accumulated a substantial number of paths that // could have been consolidated by watching one directory // above the current one, create a watcher on the parent // path instead, so that we do consolidate going forward. if (couldConsolidate(parentPath)) { watchPath = parentPath; } const resolvedPath = sysPath.resolve(path); const hasSymlink = resolvedPath !== realPath; const filteredListener = (fullPath, flags, info) => { if (hasSymlink) fullPath = fullPath.replace(realPath, resolvedPath); if ( fullPath === resolvedPath || !fullPath.indexOf(resolvedPath + sysPath.sep) ) listener(fullPath, flags, info); }; // check if there is already a watcher on a parent path // modifies `watchPath` to the parent path when it finds a match let watchedParent = false; for (const watchedPath of FSEventsWatchers.keys()) { if (realPath.indexOf(sysPath.resolve(watchedPath) + sysPath.sep) === 0) { watchPath = watchedPath; cont = FSEventsWatchers.get(watchPath); watchedParent = true; break; } } if (cont || watchedParent) { cont.listeners.add(filteredListener); } else { cont = { listeners: new Set([filteredListener]), rawEmitter, watcher: createFSEventsInstance(watchPath, (fullPath, flags) => { if (!cont.listeners.size) return; if (flags & FSEVENT_FLAG_MUST_SCAN_SUBDIRS) return; const info = fsevents.getInfo(fullPath, flags); cont.listeners.forEach(list => { list(fullPath, flags, info); }); cont.rawEmitter(info.event, fullPath, info); }) }; FSEventsWatchers.set(watchPath, cont); } // removes this instance's listeners and closes the underlying fsevents // instance if there are no more listeners left return () => { const lst = cont.listeners; lst.delete(filteredListener); if (!lst.size) { FSEventsWatchers.delete(watchPath); if (cont.watcher) return cont.watcher.stop().then(() => { cont.rawEmitter = cont.watcher = undefined; Object.freeze(cont); }); } }; } // Decide whether or not we should start a new higher-level // parent watcher const couldConsolidate = (path) => { let count = 0; for (const watchPath of FSEventsWatchers.keys()) { if (watchPath.indexOf(path) === 0) { count++; if (count >= consolidateThreshhold) { return true; } } } return false; }; // returns boolean indicating whether fsevents can be used const canUse = () => fsevents && FSEventsWatchers.size < 128; // determines subdirectory traversal levels from root to path const calcDepth = (path, root) => { let i = 0; while (!path.indexOf(root) && (path = sysPath.dirname(path)) !== root) i++; return i; }; // returns boolean indicating whether the fsevents' event info has the same type // as the one returned by fs.stat const sameTypes = (info, stats) => ( info.type === FSEVENT_TYPE_DIRECTORY && stats.isDirectory() || info.type === FSEVENT_TYPE_SYMLINK && stats.isSymbolicLink() || info.type === FSEVENT_TYPE_FILE && stats.isFile() ) /** * @mixin */ class FsEventsHandler { /** * @param {import('../index').FSWatcher} fsw */ constructor(fsw) { this.fsw = fsw; } checkIgnored(path, stats) { const ipaths = this.fsw._ignoredPaths; if (this.fsw._isIgnored(path, stats)) { ipaths.add(path); if (stats && stats.isDirectory()) { ipaths.add(path + ROOT_GLOBSTAR); } return true; } ipaths.delete(path); ipaths.delete(path + ROOT_GLOBSTAR); } addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts) { const event = watchedDir.has(item) ? EV_CHANGE : EV_ADD; this.handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts); } async checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts) { try { const stats = await stat(path) if (this.fsw.closed) return; if (sameTypes(info, stats)) { this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); } else { this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts); } } catch (error) { if (error.code === 'EACCES') { this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); } else { this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts); } } } handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts) { if (this.fsw.closed || this.checkIgnored(path)) return; if (event === EV_UNLINK) { const isDirectory = info.type === FSEVENT_TYPE_DIRECTORY // suppress unlink events on never before seen files if (isDirectory || watchedDir.has(item)) { this.fsw._remove(parent, item, isDirectory); } } else { if (event === EV_ADD) { // track new directories if (info.type === FSEVENT_TYPE_DIRECTORY) this.fsw._getWatchedDir(path); if (info.type === FSEVENT_TYPE_SYMLINK && opts.followSymlinks) { // push symlinks back to the top of the stack to get handled const curDepth = opts.depth === undefined ? undefined : calcDepth(fullPath, realPath) + 1; return this._addToFsEvents(path, false, true, curDepth); } // track new paths // (other than symlinks being followed, which will be tracked soon) this.fsw._getWatchedDir(parent).add(item); } /** * @type {'add'|'addDir'|'unlink'|'unlinkDir'} */ const eventName = info.type === FSEVENT_TYPE_DIRECTORY ? event + DIR_SUFFIX : event; this.fsw._emit(eventName, path); if (eventName === EV_ADD_DIR) this._addToFsEvents(path, false, true); } } /** * Handle symlinks encountered during directory scan * @param {String} watchPath - file/dir path to be watched with fsevents * @param {String} realPath - real path (in case of symlinks) * @param {Function} transform - path transformer * @param {Function} globFilter - path filter in case a glob pattern was provided * @returns {Function} closer for the watcher instance */ _watchWithFsEvents(watchPath, realPath, transform, globFilter) { if (this.fsw.closed || this.fsw._isIgnored(watchPath)) return; const opts = this.fsw.options; const watchCallback = async (fullPath, flags, info) => { if (this.fsw.closed) return; if ( opts.depth !== undefined && calcDepth(fullPath, realPath) > opts.depth ) return; const path = transform(sysPath.join( watchPath, sysPath.relative(watchPath, fullPath) )); if (globFilter && !globFilter(path)) return; // ensure directories are tracked const parent = sysPath.dirname(path); const item = sysPath.basename(path); const watchedDir = this.fsw._getWatchedDir( info.type === FSEVENT_TYPE_DIRECTORY ? path : parent ); // correct for wrong events emitted if (wrongEventFlags.has(flags) || info.event === FSEVENT_UNKNOWN) { if (typeof opts.ignored === FUNCTION_TYPE) { let stats; try { stats = await stat(path); } catch (error) {} if (this.fsw.closed) return; if (this.checkIgnored(path, stats)) return; if (sameTypes(info, stats)) { this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); } else { this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts); } } else { this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts); } } else { switch (info.event) { case FSEVENT_CREATED: case FSEVENT_MODIFIED: return this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); case FSEVENT_DELETED: case FSEVENT_MOVED: return this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts); } } }; const closer = setFSEventsListener( watchPath, realPath, watchCallback, this.fsw._emitRaw ); this.fsw._emitReady(); return closer; } /** * Handle symlinks encountered during directory scan * @param {String} linkPath path to symlink * @param {String} fullPath absolute path to the symlink * @param {Function} transform pre-existing path transformer * @param {Number} curDepth level of subdirectories traversed to where symlink is * @returns {Promise} */ async _handleFsEventsSymlink(linkPath, fullPath, transform, curDepth) { // don't follow the same symlink more than once if (this.fsw.closed || this.fsw._symlinkPaths.has(fullPath)) return; this.fsw._symlinkPaths.set(fullPath, true); this.fsw._incrReadyCount(); try { const linkTarget = await realpath(linkPath); if (this.fsw.closed) return; if (this.fsw._isIgnored(linkTarget)) { return this.fsw._emitReady(); } this.fsw._incrReadyCount(); // add the linkTarget for watching with a wrapper for transform // that causes emitted paths to incorporate the link's path this._addToFsEvents(linkTarget || linkPath, (path) => { let aliasedPath = linkPath; if (linkTarget && linkTarget !== DOT_SLASH) { aliasedPath = path.replace(linkTarget, linkPath); } else if (path !== DOT_SLASH) { aliasedPath = sysPath.join(linkPath, path); } return transform(aliasedPath); }, false, curDepth); } catch(error) { if (this.fsw._handleError(error)) { return this.fsw._emitReady(); } } } /** * * @param {Path} newPath * @param {fs.Stats} stats */ emitAdd(newPath, stats, processPath, opts, forceAdd) { const pp = processPath(newPath); const isDir = stats.isDirectory(); const dirObj = this.fsw._getWatchedDir(sysPath.dirname(pp)); const base = sysPath.basename(pp); // ensure empty dirs get tracked if (isDir) this.fsw._getWatchedDir(pp); if (dirObj.has(base)) return; dirObj.add(base); if (!opts.ignoreInitial || forceAdd === true) { this.fsw._emit(isDir ? EV_ADD_DIR : EV_ADD, pp, stats); } } initWatch(realPath, path, wh, processPath) { if (this.fsw.closed) return; const closer = this._watchWithFsEvents( wh.watchPath, sysPath.resolve(realPath || wh.watchPath), processPath, wh.globFilter ); this.fsw._addPathCloser(path, closer); } /** * Handle added path with fsevents * @param {String} path file/dir path or glob pattern * @param {Function|Boolean=} transform converts working path to what the user expects * @param {Boolean=} forceAdd ensure add is emitted * @param {Number=} priorDepth Level of subdirectories already traversed. * @returns {Promise} */ async _addToFsEvents(path, transform, forceAdd, priorDepth) { if (this.fsw.closed) { return; } const opts = this.fsw.options; const processPath = typeof transform === FUNCTION_TYPE ? transform : IDENTITY_FN; const wh = this.fsw._getWatchHelpers(path); // evaluate what is at the path we're being asked to watch try { const stats = await statMethods[wh.statMethod](wh.watchPath); if (this.fsw.closed) return; if (this.fsw._isIgnored(wh.watchPath, stats)) { throw null; } if (stats.isDirectory()) { // emit addDir unless this is a glob parent if (!wh.globFilter) this.emitAdd(processPath(path), stats, processPath, opts, forceAdd); // don't recurse further if it would exceed depth setting if (priorDepth && priorDepth > opts.depth) return; // scan the contents of the dir this.fsw._readdirp(wh.watchPath, { fileFilter: entry => wh.filterPath(entry), directoryFilter: entry => wh.filterDir(entry), ...Depth(opts.depth - (priorDepth || 0)) }).on(STR_DATA, (entry) => { // need to check filterPath on dirs b/c filterDir is less restrictive if (this.fsw.closed) { return; } if (entry.stats.isDirectory() && !wh.filterPath(entry)) return; const joinedPath = sysPath.join(wh.watchPath, entry.path); const {fullPath} = entry; if (wh.followSymlinks && entry.stats.isSymbolicLink()) { // preserve the current depth here since it can't be derived from // real paths past the symlink const curDepth = opts.depth === undefined ? undefined : calcDepth(joinedPath, sysPath.resolve(wh.watchPath)) + 1; this._handleFsEventsSymlink(joinedPath, fullPath, processPath, curDepth); } else { this.emitAdd(joinedPath, entry.stats, processPath, opts, forceAdd); } }).on(EV_ERROR, EMPTY_FN).on(STR_END, () => { this.fsw._emitReady(); }); } else { this.emitAdd(wh.watchPath, stats, processPath, opts, forceAdd); this.fsw._emitReady(); } } catch (error) { if (!error || this.fsw._handleError(error)) { // TODO: Strange thing: "should not choke on an ignored watch path" will be failed without 2 ready calls -__- this.fsw._emitReady(); this.fsw._emitReady(); } } if (opts.persistent && forceAdd !== true) { if (typeof transform === FUNCTION_TYPE) { // realpath has already been resolved this.initWatch(undefined, path, wh, processPath); } else { let realPath; try { realPath = await realpath(wh.watchPath); } catch (e) {} this.initWatch(realPath, path, wh, processPath); } } } } module.exports = FsEventsHandler; module.exports.canUse = canUse; /***/ }), /***/ 3897: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const fs = __nccwpck_require__(9896); const sysPath = __nccwpck_require__(6928); const { promisify } = __nccwpck_require__(9023); const isBinaryPath = __nccwpck_require__(3950); const { isWindows, isLinux, EMPTY_FN, EMPTY_STR, KEY_LISTENERS, KEY_ERR, KEY_RAW, HANDLER_KEYS, EV_CHANGE, EV_ADD, EV_ADD_DIR, EV_ERROR, STR_DATA, STR_END, BRACE_START, STAR } = __nccwpck_require__(6169); const THROTTLE_MODE_WATCH = 'watch'; const open = promisify(fs.open); const stat = promisify(fs.stat); const lstat = promisify(fs.lstat); const close = promisify(fs.close); const fsrealpath = promisify(fs.realpath); const statMethods = { lstat, stat }; // TODO: emit errors properly. Example: EMFILE on Macos. const foreach = (val, fn) => { if (val instanceof Set) { val.forEach(fn); } else { fn(val); } }; const addAndConvert = (main, prop, item) => { let container = main[prop]; if (!(container instanceof Set)) { main[prop] = container = new Set([container]); } container.add(item); }; const clearItem = cont => key => { const set = cont[key]; if (set instanceof Set) { set.clear(); } else { delete cont[key]; } }; const delFromSet = (main, prop, item) => { const container = main[prop]; if (container instanceof Set) { container.delete(item); } else if (container === item) { delete main[prop]; } }; const isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val; /** * @typedef {String} Path */ // fs_watch helpers // object to hold per-process fs_watch instances // (may be shared across chokidar FSWatcher instances) /** * @typedef {Object} FsWatchContainer * @property {Set} listeners * @property {Set} errHandlers * @property {Set} rawEmitters * @property {fs.FSWatcher=} watcher * @property {Boolean=} watcherUnusable */ /** * @type {Map} */ const FsWatchInstances = new Map(); /** * Instantiates the fs_watch interface * @param {String} path to be watched * @param {Object} options to be passed to fs_watch * @param {Function} listener main event handler * @param {Function} errHandler emits info about errors * @param {Function} emitRaw emits raw event data * @returns {fs.FSWatcher} new fsevents instance */ function createFsWatchInstance(path, options, listener, errHandler, emitRaw) { const handleEvent = (rawEvent, evPath) => { listener(path); emitRaw(rawEvent, evPath, {watchedPath: path}); // emit based on events occurring for files from a directory's watcher in // case the file's watcher misses it (and rely on throttling to de-dupe) if (evPath && path !== evPath) { fsWatchBroadcast( sysPath.resolve(path, evPath), KEY_LISTENERS, sysPath.join(path, evPath) ); } }; try { return fs.watch(path, options, handleEvent); } catch (error) { errHandler(error); } } /** * Helper for passing fs_watch event data to a collection of listeners * @param {Path} fullPath absolute path bound to fs_watch instance * @param {String} type listener type * @param {*=} val1 arguments to be passed to listeners * @param {*=} val2 * @param {*=} val3 */ const fsWatchBroadcast = (fullPath, type, val1, val2, val3) => { const cont = FsWatchInstances.get(fullPath); if (!cont) return; foreach(cont[type], (listener) => { listener(val1, val2, val3); }); }; /** * Instantiates the fs_watch interface or binds listeners * to an existing one covering the same file system entry * @param {String} path * @param {String} fullPath absolute path * @param {Object} options to be passed to fs_watch * @param {Object} handlers container for event listener functions */ const setFsWatchListener = (path, fullPath, options, handlers) => { const {listener, errHandler, rawEmitter} = handlers; let cont = FsWatchInstances.get(fullPath); /** @type {fs.FSWatcher=} */ let watcher; if (!options.persistent) { watcher = createFsWatchInstance( path, options, listener, errHandler, rawEmitter ); return watcher.close.bind(watcher); } if (cont) { addAndConvert(cont, KEY_LISTENERS, listener); addAndConvert(cont, KEY_ERR, errHandler); addAndConvert(cont, KEY_RAW, rawEmitter); } else { watcher = createFsWatchInstance( path, options, fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), errHandler, // no need to use broadcast here fsWatchBroadcast.bind(null, fullPath, KEY_RAW) ); if (!watcher) return; watcher.on(EV_ERROR, async (error) => { const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR); cont.watcherUnusable = true; // documented since Node 10.4.1 // Workaround for https://github.com/joyent/node/issues/4337 if (isWindows && error.code === 'EPERM') { try { const fd = await open(path, 'r'); await close(fd); broadcastErr(error); } catch (err) {} } else { broadcastErr(error); } }); cont = { listeners: listener, errHandlers: errHandler, rawEmitters: rawEmitter, watcher }; FsWatchInstances.set(fullPath, cont); } // const index = cont.listeners.indexOf(listener); // removes this instance's listeners and closes the underlying fs_watch // instance if there are no more listeners left return () => { delFromSet(cont, KEY_LISTENERS, listener); delFromSet(cont, KEY_ERR, errHandler); delFromSet(cont, KEY_RAW, rawEmitter); if (isEmptySet(cont.listeners)) { // Check to protect against issue gh-730. // if (cont.watcherUnusable) { cont.watcher.close(); // } FsWatchInstances.delete(fullPath); HANDLER_KEYS.forEach(clearItem(cont)); cont.watcher = undefined; Object.freeze(cont); } }; }; // fs_watchFile helpers // object to hold per-process fs_watchFile instances // (may be shared across chokidar FSWatcher instances) const FsWatchFileInstances = new Map(); /** * Instantiates the fs_watchFile interface or binds listeners * to an existing one covering the same file system entry * @param {String} path to be watched * @param {String} fullPath absolute path * @param {Object} options options to be passed to fs_watchFile * @param {Object} handlers container for event listener functions * @returns {Function} closer */ const setFsWatchFileListener = (path, fullPath, options, handlers) => { const {listener, rawEmitter} = handlers; let cont = FsWatchFileInstances.get(fullPath); /* eslint-disable no-unused-vars, prefer-destructuring */ let listeners = new Set(); let rawEmitters = new Set(); const copts = cont && cont.options; if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) { // "Upgrade" the watcher to persistence or a quicker interval. // This creates some unlikely edge case issues if the user mixes // settings in a very weird way, but solving for those cases // doesn't seem worthwhile for the added complexity. listeners = cont.listeners; rawEmitters = cont.rawEmitters; fs.unwatchFile(fullPath); cont = undefined; } /* eslint-enable no-unused-vars, prefer-destructuring */ if (cont) { addAndConvert(cont, KEY_LISTENERS, listener); addAndConvert(cont, KEY_RAW, rawEmitter); } else { // TODO // listeners.add(listener); // rawEmitters.add(rawEmitter); cont = { listeners: listener, rawEmitters: rawEmitter, options, watcher: fs.watchFile(fullPath, options, (curr, prev) => { foreach(cont.rawEmitters, (rawEmitter) => { rawEmitter(EV_CHANGE, fullPath, {curr, prev}); }); const currmtime = curr.mtimeMs; if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) { foreach(cont.listeners, (listener) => listener(path, curr)); } }) }; FsWatchFileInstances.set(fullPath, cont); } // const index = cont.listeners.indexOf(listener); // Removes this instance's listeners and closes the underlying fs_watchFile // instance if there are no more listeners left. return () => { delFromSet(cont, KEY_LISTENERS, listener); delFromSet(cont, KEY_RAW, rawEmitter); if (isEmptySet(cont.listeners)) { FsWatchFileInstances.delete(fullPath); fs.unwatchFile(fullPath); cont.options = cont.watcher = undefined; Object.freeze(cont); } }; }; /** * @mixin */ class NodeFsHandler { /** * @param {import("../index").FSWatcher} fsW */ constructor(fsW) { this.fsw = fsW; this._boundHandleError = (error) => fsW._handleError(error); } /** * Watch file for changes with fs_watchFile or fs_watch. * @param {String} path to file or dir * @param {Function} listener on fs change * @returns {Function} closer for the watcher instance */ _watchWithNodeFs(path, listener) { const opts = this.fsw.options; const directory = sysPath.dirname(path); const basename = sysPath.basename(path); const parent = this.fsw._getWatchedDir(directory); parent.add(basename); const absolutePath = sysPath.resolve(path); const options = {persistent: opts.persistent}; if (!listener) listener = EMPTY_FN; let closer; if (opts.usePolling) { options.interval = opts.enableBinaryInterval && isBinaryPath(basename) ? opts.binaryInterval : opts.interval; closer = setFsWatchFileListener(path, absolutePath, options, { listener, rawEmitter: this.fsw._emitRaw }); } else { closer = setFsWatchListener(path, absolutePath, options, { listener, errHandler: this._boundHandleError, rawEmitter: this.fsw._emitRaw }); } return closer; } /** * Watch a file and emit add event if warranted. * @param {Path} file Path * @param {fs.Stats} stats result of fs_stat * @param {Boolean} initialAdd was the file added at watch instantiation? * @returns {Function} closer for the watcher instance */ _handleFile(file, stats, initialAdd) { if (this.fsw.closed) { return; } const dirname = sysPath.dirname(file); const basename = sysPath.basename(file); const parent = this.fsw._getWatchedDir(dirname); // stats is always present let prevStats = stats; // if the file is already being watched, do nothing if (parent.has(basename)) return; const listener = async (path, newStats) => { if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return; if (!newStats || newStats.mtimeMs === 0) { try { const newStats = await stat(file); if (this.fsw.closed) return; // Check that change event was not fired because of changed only accessTime. const at = newStats.atimeMs; const mt = newStats.mtimeMs; if (!at || at <= mt || mt !== prevStats.mtimeMs) { this.fsw._emit(EV_CHANGE, file, newStats); } if (isLinux && prevStats.ino !== newStats.ino) { this.fsw._closeFile(path) prevStats = newStats; this.fsw._addPathCloser(path, this._watchWithNodeFs(file, listener)); } else { prevStats = newStats; } } catch (error) { // Fix issues where mtime is null but file is still present this.fsw._remove(dirname, basename); } // add is about to be emitted if file not already tracked in parent } else if (parent.has(basename)) { // Check that change event was not fired because of changed only accessTime. const at = newStats.atimeMs; const mt = newStats.mtimeMs; if (!at || at <= mt || mt !== prevStats.mtimeMs) { this.fsw._emit(EV_CHANGE, file, newStats); } prevStats = newStats; } } // kick off the watcher const closer = this._watchWithNodeFs(file, listener); // emit an add event if we're supposed to if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) { if (!this.fsw._throttle(EV_ADD, file, 0)) return; this.fsw._emit(EV_ADD, file, stats); } return closer; } /** * Handle symlinks encountered while reading a dir. * @param {Object} entry returned by readdirp * @param {String} directory path of dir being read * @param {String} path of this item * @param {String} item basename of this item * @returns {Promise} true if no more processing is needed for this entry. */ async _handleSymlink(entry, directory, path, item) { if (this.fsw.closed) { return; } const full = entry.fullPath; const dir = this.fsw._getWatchedDir(directory); if (!this.fsw.options.followSymlinks) { // watch symlink directly (don't follow) and detect changes this.fsw._incrReadyCount(); let linkPath; try { linkPath = await fsrealpath(path); } catch (e) { this.fsw._emitReady(); return true; } if (this.fsw.closed) return; if (dir.has(item)) { if (this.fsw._symlinkPaths.get(full) !== linkPath) { this.fsw._symlinkPaths.set(full, linkPath); this.fsw._emit(EV_CHANGE, path, entry.stats); } } else { dir.add(item); this.fsw._symlinkPaths.set(full, linkPath); this.fsw._emit(EV_ADD, path, entry.stats); } this.fsw._emitReady(); return true; } // don't follow the same symlink more than once if (this.fsw._symlinkPaths.has(full)) { return true; } this.fsw._symlinkPaths.set(full, true); } _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) { // Normalize the directory name on Windows directory = sysPath.join(directory, EMPTY_STR); if (!wh.hasGlob) { throttler = this.fsw._throttle('readdir', directory, 1000); if (!throttler) return; } const previous = this.fsw._getWatchedDir(wh.path); const current = new Set(); let stream = this.fsw._readdirp(directory, { fileFilter: entry => wh.filterPath(entry), directoryFilter: entry => wh.filterDir(entry), depth: 0 }).on(STR_DATA, async (entry) => { if (this.fsw.closed) { stream = undefined; return; } const item = entry.path; let path = sysPath.join(directory, item); current.add(item); if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path, item)) { return; } if (this.fsw.closed) { stream = undefined; return; } // Files that present in current directory snapshot // but absent in previous are added to watch list and // emit `add` event. if (item === target || !target && !previous.has(item)) { this.fsw._incrReadyCount(); // ensure relativeness of path is preserved in case of watcher reuse path = sysPath.join(dir, sysPath.relative(dir, path)); this._addToNodeFs(path, initialAdd, wh, depth + 1); } }).on(EV_ERROR, this._boundHandleError); return new Promise(resolve => stream.once(STR_END, () => { if (this.fsw.closed) { stream = undefined; return; } const wasThrottled = throttler ? throttler.clear() : false; resolve(); // Files that absent in current directory snapshot // but present in previous emit `remove` event // and are removed from @watched[directory]. previous.getChildren().filter((item) => { return item !== directory && !current.has(item) && // in case of intersecting globs; // a path may have been filtered out of this readdir, but // shouldn't be removed because it matches a different glob (!wh.hasGlob || wh.filterPath({ fullPath: sysPath.resolve(directory, item) })); }).forEach((item) => { this.fsw._remove(directory, item); }); stream = undefined; // one more time for any missed in case changes came in extremely quickly if (wasThrottled) this._handleRead(directory, false, wh, target, dir, depth, throttler); }) ); } /** * Read directory to add / remove files from `@watched` list and re-read it on change. * @param {String} dir fs path * @param {fs.Stats} stats * @param {Boolean} initialAdd * @param {Number} depth relative to user-supplied path * @param {String} target child path targeted for watch * @param {Object} wh Common watch helpers for this path * @param {String} realpath * @returns {Promise} closer for the watcher instance. */ async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) { const parentDir = this.fsw._getWatchedDir(sysPath.dirname(dir)); const tracked = parentDir.has(sysPath.basename(dir)); if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) { if (!wh.hasGlob || wh.globFilter(dir)) this.fsw._emit(EV_ADD_DIR, dir, stats); } // ensure dir is tracked (harmless if redundant) parentDir.add(sysPath.basename(dir)); this.fsw._getWatchedDir(dir); let throttler; let closer; const oDepth = this.fsw.options.depth; if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath)) { if (!target) { await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler); if (this.fsw.closed) return; } closer = this._watchWithNodeFs(dir, (dirPath, stats) => { // if current directory is removed, do nothing if (stats && stats.mtimeMs === 0) return; this._handleRead(dirPath, false, wh, target, dir, depth, throttler); }); } return closer; } /** * Handle added file, directory, or glob pattern. * Delegates call to _handleFile / _handleDir after checks. * @param {String} path to file or ir * @param {Boolean} initialAdd was the file added at watch instantiation? * @param {Object} priorWh depth relative to user-supplied path * @param {Number} depth Child path actually targeted for watch * @param {String=} target Child path actually targeted for watch * @returns {Promise} */ async _addToNodeFs(path, initialAdd, priorWh, depth, target) { const ready = this.fsw._emitReady; if (this.fsw._isIgnored(path) || this.fsw.closed) { ready(); return false; } const wh = this.fsw._getWatchHelpers(path, depth); if (!wh.hasGlob && priorWh) { wh.hasGlob = priorWh.hasGlob; wh.globFilter = priorWh.globFilter; wh.filterPath = entry => priorWh.filterPath(entry); wh.filterDir = entry => priorWh.filterDir(entry); } // evaluate what is at the path we're being asked to watch try { const stats = await statMethods[wh.statMethod](wh.watchPath); if (this.fsw.closed) return; if (this.fsw._isIgnored(wh.watchPath, stats)) { ready(); return false; } const follow = this.fsw.options.followSymlinks && !path.includes(STAR) && !path.includes(BRACE_START); let closer; if (stats.isDirectory()) { const absPath = sysPath.resolve(path); const targetPath = follow ? await fsrealpath(path) : path; if (this.fsw.closed) return; closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath); if (this.fsw.closed) return; // preserve this symlink's target path if (absPath !== targetPath && targetPath !== undefined) { this.fsw._symlinkPaths.set(absPath, targetPath); } } else if (stats.isSymbolicLink()) { const targetPath = follow ? await fsrealpath(path) : path; if (this.fsw.closed) return; const parent = sysPath.dirname(wh.watchPath); this.fsw._getWatchedDir(parent).add(wh.watchPath); this.fsw._emit(EV_ADD, wh.watchPath, stats); closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath); if (this.fsw.closed) return; // preserve this symlink's target path if (targetPath !== undefined) { this.fsw._symlinkPaths.set(sysPath.resolve(path), targetPath); } } else { closer = this._handleFile(wh.watchPath, stats, initialAdd); } ready(); this.fsw._addPathCloser(path, closer); return false; } catch (error) { if (this.fsw._handleError(error)) { ready(); return path; } } } } module.exports = NodeFsHandler; /***/ }), /***/ 5481: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { // Copyright Joyent, Inc. and other Node contributors. // // 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. // NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. function isArray(arg) { if (Array.isArray) { return Array.isArray(arg); } return objectToString(arg) === '[object Array]'; } exports.isArray = isArray; function isBoolean(arg) { return typeof arg === 'boolean'; } exports.isBoolean = isBoolean; function isNull(arg) { return arg === null; } exports.isNull = isNull; function isNullOrUndefined(arg) { return arg == null; } exports.isNullOrUndefined = isNullOrUndefined; function isNumber(arg) { return typeof arg === 'number'; } exports.isNumber = isNumber; function isString(arg) { return typeof arg === 'string'; } exports.isString = isString; function isSymbol(arg) { return typeof arg === 'symbol'; } exports.isSymbol = isSymbol; function isUndefined(arg) { return arg === void 0; } exports.isUndefined = isUndefined; function isRegExp(re) { return objectToString(re) === '[object RegExp]'; } exports.isRegExp = isRegExp; function isObject(arg) { return typeof arg === 'object' && arg !== null; } exports.isObject = isObject; function isDate(d) { return objectToString(d) === '[object Date]'; } exports.isDate = isDate; function isError(e) { return (objectToString(e) === '[object Error]' || e instanceof Error); } exports.isError = isError; function isFunction(arg) { return typeof arg === 'function'; } exports.isFunction = isFunction; function isPrimitive(arg) { return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || typeof arg === 'symbol' || // ES6 symbol typeof arg === 'undefined'; } exports.isPrimitive = isPrimitive; exports.isBuffer = __nccwpck_require__(181).Buffer.isBuffer; function objectToString(o) { return Object.prototype.toString.call(o); } /***/ }), /***/ 2657: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const fileType = __nccwpck_require__(8989); const isStream = __nccwpck_require__(6543); const tarStream = __nccwpck_require__(6118); module.exports = () => input => { if (!Buffer.isBuffer(input) && !isStream(input)) { return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof input}`)); } if (Buffer.isBuffer(input) && (!fileType(input) || fileType(input).ext !== 'tar')) { return Promise.resolve([]); } const extract = tarStream.extract(); const files = []; extract.on('entry', (header, stream, cb) => { const chunk = []; stream.on('data', data => chunk.push(data)); stream.on('end', () => { const file = { data: Buffer.concat(chunk), mode: header.mode, mtime: header.mtime, path: header.name, type: header.type }; if (header.type === 'symlink' || header.type === 'link') { file.linkname = header.linkname; } files.push(file); cb(); }); }); const promise = new Promise((resolve, reject) => { if (!Buffer.isBuffer(input)) { input.on('error', reject); } extract.on('finish', () => resolve(files)); extract.on('error', reject); }); extract.then = promise.then.bind(promise); extract.catch = promise.catch.bind(promise); if (Buffer.isBuffer(input)) { extract.end(input); } else { input.pipe(extract); } return extract; }; /***/ }), /***/ 2681: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const decompressTar = __nccwpck_require__(2657); const fileType = __nccwpck_require__(7818); const isStream = __nccwpck_require__(6543); const seekBzip = __nccwpck_require__(9634); const unbzip2Stream = __nccwpck_require__(8183); module.exports = () => input => { if (!Buffer.isBuffer(input) && !isStream(input)) { return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof input}`)); } if (Buffer.isBuffer(input) && (!fileType(input) || fileType(input).ext !== 'bz2')) { return Promise.resolve([]); } if (Buffer.isBuffer(input)) { return decompressTar()(seekBzip.decode(input)); } return decompressTar()(input.pipe(unbzip2Stream())); }; /***/ }), /***/ 7818: /***/ ((module) => { const toBytes = s => Array.from(s).map(c => c.charCodeAt(0)); const xpiZipFilename = toBytes('META-INF/mozilla.rsa'); const oxmlContentTypes = toBytes('[Content_Types].xml'); const oxmlRels = toBytes('_rels/.rels'); module.exports = input => { const buf = new Uint8Array(input); if (!(buf && buf.length > 1)) { return null; } const check = (header, opts) => { opts = Object.assign({ offset: 0 }, opts); for (let i = 0; i < header.length; i++) { // If a bitmask is set if (opts.mask) { // If header doesn't equal `buf` with bits masked off if (header[i] !== (opts.mask[i] & buf[i + opts.offset])) { return false; } } else if (header[i] !== buf[i + opts.offset]) { return false; } } return true; }; if (check([0xFF, 0xD8, 0xFF])) { return { ext: 'jpg', mime: 'image/jpeg' }; } if (check([0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A])) { return { ext: 'png', mime: 'image/png' }; } if (check([0x47, 0x49, 0x46])) { return { ext: 'gif', mime: 'image/gif' }; } if (check([0x57, 0x45, 0x42, 0x50], {offset: 8})) { return { ext: 'webp', mime: 'image/webp' }; } if (check([0x46, 0x4C, 0x49, 0x46])) { return { ext: 'flif', mime: 'image/flif' }; } // Needs to be before `tif` check if ( (check([0x49, 0x49, 0x2A, 0x0]) || check([0x4D, 0x4D, 0x0, 0x2A])) && check([0x43, 0x52], {offset: 8}) ) { return { ext: 'cr2', mime: 'image/x-canon-cr2' }; } if ( check([0x49, 0x49, 0x2A, 0x0]) || check([0x4D, 0x4D, 0x0, 0x2A]) ) { return { ext: 'tif', mime: 'image/tiff' }; } if (check([0x42, 0x4D])) { return { ext: 'bmp', mime: 'image/bmp' }; } if (check([0x49, 0x49, 0xBC])) { return { ext: 'jxr', mime: 'image/vnd.ms-photo' }; } if (check([0x38, 0x42, 0x50, 0x53])) { return { ext: 'psd', mime: 'image/vnd.adobe.photoshop' }; } // Zip-based file formats // Need to be before the `zip` check if (check([0x50, 0x4B, 0x3, 0x4])) { if ( check([0x6D, 0x69, 0x6D, 0x65, 0x74, 0x79, 0x70, 0x65, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x2F, 0x65, 0x70, 0x75, 0x62, 0x2B, 0x7A, 0x69, 0x70], {offset: 30}) ) { return { ext: 'epub', mime: 'application/epub+zip' }; } // Assumes signed `.xpi` from addons.mozilla.org if (check(xpiZipFilename, {offset: 30})) { return { ext: 'xpi', mime: 'application/x-xpinstall' }; } // https://github.com/file/file/blob/master/magic/Magdir/msooxml if (check(oxmlContentTypes, {offset: 30}) || check(oxmlRels, {offset: 30})) { const sliced = buf.subarray(4, 4 + 2000); const nextZipHeaderIndex = arr => arr.findIndex((el, i, arr) => arr[i] === 0x50 && arr[i + 1] === 0x4B && arr[i + 2] === 0x3 && arr[i + 3] === 0x4); const header2Pos = nextZipHeaderIndex(sliced); if (header2Pos !== -1) { const slicedAgain = buf.subarray(header2Pos + 8, header2Pos + 8 + 1000); const header3Pos = nextZipHeaderIndex(slicedAgain); if (header3Pos !== -1) { const offset = 8 + header2Pos + header3Pos + 30; if (check(toBytes('word/'), {offset})) { return { ext: 'docx', mime: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' }; } if (check(toBytes('ppt/'), {offset})) { return { ext: 'pptx', mime: 'application/vnd.openxmlformats-officedocument.presentationml.presentation' }; } if (check(toBytes('xl/'), {offset})) { return { ext: 'xlsx', mime: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }; } } } } } if ( check([0x50, 0x4B]) && (buf[2] === 0x3 || buf[2] === 0x5 || buf[2] === 0x7) && (buf[3] === 0x4 || buf[3] === 0x6 || buf[3] === 0x8) ) { return { ext: 'zip', mime: 'application/zip' }; } if (check([0x75, 0x73, 0x74, 0x61, 0x72], {offset: 257})) { return { ext: 'tar', mime: 'application/x-tar' }; } if ( check([0x52, 0x61, 0x72, 0x21, 0x1A, 0x7]) && (buf[6] === 0x0 || buf[6] === 0x1) ) { return { ext: 'rar', mime: 'application/x-rar-compressed' }; } if (check([0x1F, 0x8B, 0x8])) { return { ext: 'gz', mime: 'application/gzip' }; } if (check([0x42, 0x5A, 0x68])) { return { ext: 'bz2', mime: 'application/x-bzip2' }; } if (check([0x37, 0x7A, 0xBC, 0xAF, 0x27, 0x1C])) { return { ext: '7z', mime: 'application/x-7z-compressed' }; } if (check([0x78, 0x01])) { return { ext: 'dmg', mime: 'application/x-apple-diskimage' }; } if (check([0x33, 0x67, 0x70, 0x35]) || // 3gp5 ( check([0x0, 0x0, 0x0]) && check([0x66, 0x74, 0x79, 0x70], {offset: 4}) && ( check([0x6D, 0x70, 0x34, 0x31], {offset: 8}) || // MP41 check([0x6D, 0x70, 0x34, 0x32], {offset: 8}) || // MP42 check([0x69, 0x73, 0x6F, 0x6D], {offset: 8}) || // ISOM check([0x69, 0x73, 0x6F, 0x32], {offset: 8}) || // ISO2 check([0x6D, 0x6D, 0x70, 0x34], {offset: 8}) || // MMP4 check([0x4D, 0x34, 0x56], {offset: 8}) || // M4V check([0x64, 0x61, 0x73, 0x68], {offset: 8}) // DASH ) )) { return { ext: 'mp4', mime: 'video/mp4' }; } if (check([0x4D, 0x54, 0x68, 0x64])) { return { ext: 'mid', mime: 'audio/midi' }; } // https://github.com/threatstack/libmagic/blob/master/magic/Magdir/matroska if (check([0x1A, 0x45, 0xDF, 0xA3])) { const sliced = buf.subarray(4, 4 + 4096); const idPos = sliced.findIndex((el, i, arr) => arr[i] === 0x42 && arr[i + 1] === 0x82); if (idPos !== -1) { const docTypePos = idPos + 3; const findDocType = type => Array.from(type).every((c, i) => sliced[docTypePos + i] === c.charCodeAt(0)); if (findDocType('matroska')) { return { ext: 'mkv', mime: 'video/x-matroska' }; } if (findDocType('webm')) { return { ext: 'webm', mime: 'video/webm' }; } } } if (check([0x0, 0x0, 0x0, 0x14, 0x66, 0x74, 0x79, 0x70, 0x71, 0x74, 0x20, 0x20]) || check([0x66, 0x72, 0x65, 0x65], {offset: 4}) || check([0x66, 0x74, 0x79, 0x70, 0x71, 0x74, 0x20, 0x20], {offset: 4}) || check([0x6D, 0x64, 0x61, 0x74], {offset: 4}) || // MJPEG check([0x77, 0x69, 0x64, 0x65], {offset: 4})) { return { ext: 'mov', mime: 'video/quicktime' }; } if ( check([0x52, 0x49, 0x46, 0x46]) && check([0x41, 0x56, 0x49], {offset: 8}) ) { return { ext: 'avi', mime: 'video/x-msvideo' }; } if (check([0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9])) { return { ext: 'wmv', mime: 'video/x-ms-wmv' }; } if (check([0x0, 0x0, 0x1, 0xBA])) { return { ext: 'mpg', mime: 'video/mpeg' }; } // Check for MP3 header at different starting offsets for (let start = 0; start < 2 && start < (buf.length - 16); start++) { if ( check([0x49, 0x44, 0x33], {offset: start}) || // ID3 header check([0xFF, 0xE2], {offset: start, mask: [0xFF, 0xE2]}) // MPEG 1 or 2 Layer 3 header ) { return { ext: 'mp3', mime: 'audio/mpeg' }; } } if ( check([0x66, 0x74, 0x79, 0x70, 0x4D, 0x34, 0x41], {offset: 4}) || check([0x4D, 0x34, 0x41, 0x20]) ) { return { ext: 'm4a', mime: 'audio/m4a' }; } // Needs to be before `ogg` check if (check([0x4F, 0x70, 0x75, 0x73, 0x48, 0x65, 0x61, 0x64], {offset: 28})) { return { ext: 'opus', mime: 'audio/opus' }; } if (check([0x4F, 0x67, 0x67, 0x53])) { return { ext: 'ogg', mime: 'audio/ogg' }; } if (check([0x66, 0x4C, 0x61, 0x43])) { return { ext: 'flac', mime: 'audio/x-flac' }; } if ( check([0x52, 0x49, 0x46, 0x46]) && check([0x57, 0x41, 0x56, 0x45], {offset: 8}) ) { return { ext: 'wav', mime: 'audio/x-wav' }; } if (check([0x23, 0x21, 0x41, 0x4D, 0x52, 0x0A])) { return { ext: 'amr', mime: 'audio/amr' }; } if (check([0x25, 0x50, 0x44, 0x46])) { return { ext: 'pdf', mime: 'application/pdf' }; } if (check([0x4D, 0x5A])) { return { ext: 'exe', mime: 'application/x-msdownload' }; } if ( (buf[0] === 0x43 || buf[0] === 0x46) && check([0x57, 0x53], {offset: 1}) ) { return { ext: 'swf', mime: 'application/x-shockwave-flash' }; } if (check([0x7B, 0x5C, 0x72, 0x74, 0x66])) { return { ext: 'rtf', mime: 'application/rtf' }; } if (check([0x00, 0x61, 0x73, 0x6D])) { return { ext: 'wasm', mime: 'application/wasm' }; } if ( check([0x77, 0x4F, 0x46, 0x46]) && ( check([0x00, 0x01, 0x00, 0x00], {offset: 4}) || check([0x4F, 0x54, 0x54, 0x4F], {offset: 4}) ) ) { return { ext: 'woff', mime: 'font/woff' }; } if ( check([0x77, 0x4F, 0x46, 0x32]) && ( check([0x00, 0x01, 0x00, 0x00], {offset: 4}) || check([0x4F, 0x54, 0x54, 0x4F], {offset: 4}) ) ) { return { ext: 'woff2', mime: 'font/woff2' }; } if ( check([0x4C, 0x50], {offset: 34}) && ( check([0x00, 0x00, 0x01], {offset: 8}) || check([0x01, 0x00, 0x02], {offset: 8}) || check([0x02, 0x00, 0x02], {offset: 8}) ) ) { return { ext: 'eot', mime: 'application/octet-stream' }; } if (check([0x00, 0x01, 0x00, 0x00, 0x00])) { return { ext: 'ttf', mime: 'font/ttf' }; } if (check([0x4F, 0x54, 0x54, 0x4F, 0x00])) { return { ext: 'otf', mime: 'font/otf' }; } if (check([0x00, 0x00, 0x01, 0x00])) { return { ext: 'ico', mime: 'image/x-icon' }; } if (check([0x46, 0x4C, 0x56, 0x01])) { return { ext: 'flv', mime: 'video/x-flv' }; } if (check([0x25, 0x21])) { return { ext: 'ps', mime: 'application/postscript' }; } if (check([0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00])) { return { ext: 'xz', mime: 'application/x-xz' }; } if (check([0x53, 0x51, 0x4C, 0x69])) { return { ext: 'sqlite', mime: 'application/x-sqlite3' }; } if (check([0x4E, 0x45, 0x53, 0x1A])) { return { ext: 'nes', mime: 'application/x-nintendo-nes-rom' }; } if (check([0x43, 0x72, 0x32, 0x34])) { return { ext: 'crx', mime: 'application/x-google-chrome-extension' }; } if ( check([0x4D, 0x53, 0x43, 0x46]) || check([0x49, 0x53, 0x63, 0x28]) ) { return { ext: 'cab', mime: 'application/vnd.ms-cab-compressed' }; } // Needs to be before `ar` check if (check([0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E, 0x0A, 0x64, 0x65, 0x62, 0x69, 0x61, 0x6E, 0x2D, 0x62, 0x69, 0x6E, 0x61, 0x72, 0x79])) { return { ext: 'deb', mime: 'application/x-deb' }; } if (check([0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E])) { return { ext: 'ar', mime: 'application/x-unix-archive' }; } if (check([0xED, 0xAB, 0xEE, 0xDB])) { return { ext: 'rpm', mime: 'application/x-rpm' }; } if ( check([0x1F, 0xA0]) || check([0x1F, 0x9D]) ) { return { ext: 'Z', mime: 'application/x-compress' }; } if (check([0x4C, 0x5A, 0x49, 0x50])) { return { ext: 'lz', mime: 'application/x-lzip' }; } if (check([0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1])) { return { ext: 'msi', mime: 'application/x-msi' }; } if (check([0x06, 0x0E, 0x2B, 0x34, 0x02, 0x05, 0x01, 0x01, 0x0D, 0x01, 0x02, 0x01, 0x01, 0x02])) { return { ext: 'mxf', mime: 'application/mxf' }; } if (check([0x47], {offset: 4}) && (check([0x47], {offset: 192}) || check([0x47], {offset: 196}))) { return { ext: 'mts', mime: 'video/mp2t' }; } if (check([0x42, 0x4C, 0x45, 0x4E, 0x44, 0x45, 0x52])) { return { ext: 'blend', mime: 'application/x-blender' }; } if (check([0x42, 0x50, 0x47, 0xFB])) { return { ext: 'bpg', mime: 'image/bpg' }; } return null; }; /***/ }), /***/ 8848: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const zlib = __nccwpck_require__(3106); const decompressTar = __nccwpck_require__(2657); const fileType = __nccwpck_require__(8989); const isStream = __nccwpck_require__(6543); module.exports = () => input => { if (!Buffer.isBuffer(input) && !isStream(input)) { return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof input}`)); } if (Buffer.isBuffer(input) && (!fileType(input) || fileType(input).ext !== 'gz')) { return Promise.resolve([]); } const unzip = zlib.createGunzip(); const result = decompressTar()(unzip); if (Buffer.isBuffer(input)) { unzip.end(input); } else { input.pipe(unzip); } return result; }; /***/ }), /***/ 1296: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const fileType = __nccwpck_require__(3061); const getStream = __nccwpck_require__(6771); const pify = __nccwpck_require__(2946); const yauzl = __nccwpck_require__(663); const getType = (entry, mode) => { const IFMT = 61440; const IFDIR = 16384; const IFLNK = 40960; const madeBy = entry.versionMadeBy >> 8; if ((mode & IFMT) === IFLNK) { return 'symlink'; } if ((mode & IFMT) === IFDIR || (madeBy === 0 && entry.externalFileAttributes === 16)) { return 'directory'; } return 'file'; }; const extractEntry = (entry, zip) => { const file = { mode: (entry.externalFileAttributes >> 16) & 0xFFFF, mtime: entry.getLastModDate(), path: entry.fileName }; file.type = getType(entry, file.mode); if (file.mode === 0 && file.type === 'directory') { file.mode = 493; } if (file.mode === 0) { file.mode = 420; } return pify(zip.openReadStream.bind(zip))(entry) .then(getStream.buffer) .then(buf => { file.data = buf; if (file.type === 'symlink') { file.linkname = buf.toString(); } return file; }) .catch(err => { zip.close(); throw err; }); }; const extractFile = zip => new Promise((resolve, reject) => { const files = []; zip.readEntry(); zip.on('entry', entry => { extractEntry(entry, zip) .catch(reject) .then(file => { files.push(file); zip.readEntry(); }); }); zip.on('error', reject); zip.on('end', () => resolve(files)); }); module.exports = () => buf => { if (!Buffer.isBuffer(buf)) { return Promise.reject(new TypeError(`Expected a Buffer, got ${typeof buf}`)); } if (!fileType(buf) || fileType(buf).ext !== 'zip') { return Promise.resolve([]); } return pify(yauzl.fromBuffer)(buf, {lazyEntries: true}).then(extractFile); }; /***/ }), /***/ 3061: /***/ ((module) => { module.exports = function (buf) { if (!(buf && buf.length > 1)) { return null; } if (buf[0] === 0xFF && buf[1] === 0xD8 && buf[2] === 0xFF) { return { ext: 'jpg', mime: 'image/jpeg' }; } if (buf[0] === 0x89 && buf[1] === 0x50 && buf[2] === 0x4E && buf[3] === 0x47) { return { ext: 'png', mime: 'image/png' }; } if (buf[0] === 0x47 && buf[1] === 0x49 && buf[2] === 0x46) { return { ext: 'gif', mime: 'image/gif' }; } if (buf[8] === 0x57 && buf[9] === 0x45 && buf[10] === 0x42 && buf[11] === 0x50) { return { ext: 'webp', mime: 'image/webp' }; } if (buf[0] === 0x46 && buf[1] === 0x4C && buf[2] === 0x49 && buf[3] === 0x46) { return { ext: 'flif', mime: 'image/flif' }; } // needs to be before `tif` check if (((buf[0] === 0x49 && buf[1] === 0x49 && buf[2] === 0x2A && buf[3] === 0x0) || (buf[0] === 0x4D && buf[1] === 0x4D && buf[2] === 0x0 && buf[3] === 0x2A)) && buf[8] === 0x43 && buf[9] === 0x52) { return { ext: 'cr2', mime: 'image/x-canon-cr2' }; } if ((buf[0] === 0x49 && buf[1] === 0x49 && buf[2] === 0x2A && buf[3] === 0x0) || (buf[0] === 0x4D && buf[1] === 0x4D && buf[2] === 0x0 && buf[3] === 0x2A)) { return { ext: 'tif', mime: 'image/tiff' }; } if (buf[0] === 0x42 && buf[1] === 0x4D) { return { ext: 'bmp', mime: 'image/bmp' }; } if (buf[0] === 0x49 && buf[1] === 0x49 && buf[2] === 0xBC) { return { ext: 'jxr', mime: 'image/vnd.ms-photo' }; } if (buf[0] === 0x38 && buf[1] === 0x42 && buf[2] === 0x50 && buf[3] === 0x53) { return { ext: 'psd', mime: 'image/vnd.adobe.photoshop' }; } // needs to be before `zip` check if (buf[0] === 0x50 && buf[1] === 0x4B && buf[2] === 0x3 && buf[3] === 0x4 && buf[30] === 0x6D && buf[31] === 0x69 && buf[32] === 0x6D && buf[33] === 0x65 && buf[34] === 0x74 && buf[35] === 0x79 && buf[36] === 0x70 && buf[37] === 0x65 && buf[38] === 0x61 && buf[39] === 0x70 && buf[40] === 0x70 && buf[41] === 0x6C && buf[42] === 0x69 && buf[43] === 0x63 && buf[44] === 0x61 && buf[45] === 0x74 && buf[46] === 0x69 && buf[47] === 0x6F && buf[48] === 0x6E && buf[49] === 0x2F && buf[50] === 0x65 && buf[51] === 0x70 && buf[52] === 0x75 && buf[53] === 0x62 && buf[54] === 0x2B && buf[55] === 0x7A && buf[56] === 0x69 && buf[57] === 0x70) { return { ext: 'epub', mime: 'application/epub+zip' }; } // needs to be before `zip` check // assumes signed .xpi from addons.mozilla.org if (buf[0] === 0x50 && buf[1] === 0x4B && buf[2] === 0x3 && buf[3] === 0x4 && buf[30] === 0x4D && buf[31] === 0x45 && buf[32] === 0x54 && buf[33] === 0x41 && buf[34] === 0x2D && buf[35] === 0x49 && buf[36] === 0x4E && buf[37] === 0x46 && buf[38] === 0x2F && buf[39] === 0x6D && buf[40] === 0x6F && buf[41] === 0x7A && buf[42] === 0x69 && buf[43] === 0x6C && buf[44] === 0x6C && buf[45] === 0x61 && buf[46] === 0x2E && buf[47] === 0x72 && buf[48] === 0x73 && buf[49] === 0x61) { return { ext: 'xpi', mime: 'application/x-xpinstall' }; } if (buf[0] === 0x50 && buf[1] === 0x4B && (buf[2] === 0x3 || buf[2] === 0x5 || buf[2] === 0x7) && (buf[3] === 0x4 || buf[3] === 0x6 || buf[3] === 0x8)) { return { ext: 'zip', mime: 'application/zip' }; } if (buf[257] === 0x75 && buf[258] === 0x73 && buf[259] === 0x74 && buf[260] === 0x61 && buf[261] === 0x72) { return { ext: 'tar', mime: 'application/x-tar' }; } if (buf[0] === 0x52 && buf[1] === 0x61 && buf[2] === 0x72 && buf[3] === 0x21 && buf[4] === 0x1A && buf[5] === 0x7 && (buf[6] === 0x0 || buf[6] === 0x1)) { return { ext: 'rar', mime: 'application/x-rar-compressed' }; } if (buf[0] === 0x1F && buf[1] === 0x8B && buf[2] === 0x8) { return { ext: 'gz', mime: 'application/gzip' }; } if (buf[0] === 0x42 && buf[1] === 0x5A && buf[2] === 0x68) { return { ext: 'bz2', mime: 'application/x-bzip2' }; } if (buf[0] === 0x37 && buf[1] === 0x7A && buf[2] === 0xBC && buf[3] === 0xAF && buf[4] === 0x27 && buf[5] === 0x1C) { return { ext: '7z', mime: 'application/x-7z-compressed' }; } if (buf[0] === 0x78 && buf[1] === 0x01) { return { ext: 'dmg', mime: 'application/x-apple-diskimage' }; } if ( (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && (buf[3] === 0x18 || buf[3] === 0x20) && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70) || (buf[0] === 0x33 && buf[1] === 0x67 && buf[2] === 0x70 && buf[3] === 0x35) || (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1C && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x6D && buf[9] === 0x70 && buf[10] === 0x34 && buf[11] === 0x32 && buf[16] === 0x6D && buf[17] === 0x70 && buf[18] === 0x34 && buf[19] === 0x31 && buf[20] === 0x6D && buf[21] === 0x70 && buf[22] === 0x34 && buf[23] === 0x32 && buf[24] === 0x69 && buf[25] === 0x73 && buf[26] === 0x6F && buf[27] === 0x6D) || (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1C && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x69 && buf[9] === 0x73 && buf[10] === 0x6F && buf[11] === 0x6D) || (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1c && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x6D && buf[9] === 0x70 && buf[10] === 0x34 && buf[11] === 0x32 && buf[12] === 0x0 && buf[13] === 0x0 && buf[14] === 0x0 && buf[15] === 0x0) ) { return { ext: 'mp4', mime: 'video/mp4' }; } if ((buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1C && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x4D && buf[9] === 0x34 && buf[10] === 0x56)) { return { ext: 'm4v', mime: 'video/x-m4v' }; } if (buf[0] === 0x4D && buf[1] === 0x54 && buf[2] === 0x68 && buf[3] === 0x64) { return { ext: 'mid', mime: 'audio/midi' }; } // needs to be before the `webm` check if (buf[31] === 0x6D && buf[32] === 0x61 && buf[33] === 0x74 && buf[34] === 0x72 && buf[35] === 0x6f && buf[36] === 0x73 && buf[37] === 0x6B && buf[38] === 0x61) { return { ext: 'mkv', mime: 'video/x-matroska' }; } if (buf[0] === 0x1A && buf[1] === 0x45 && buf[2] === 0xDF && buf[3] === 0xA3) { return { ext: 'webm', mime: 'video/webm' }; } if (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x14 && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70) { return { ext: 'mov', mime: 'video/quicktime' }; } if (buf[0] === 0x52 && buf[1] === 0x49 && buf[2] === 0x46 && buf[3] === 0x46 && buf[8] === 0x41 && buf[9] === 0x56 && buf[10] === 0x49) { return { ext: 'avi', mime: 'video/x-msvideo' }; } if (buf[0] === 0x30 && buf[1] === 0x26 && buf[2] === 0xB2 && buf[3] === 0x75 && buf[4] === 0x8E && buf[5] === 0x66 && buf[6] === 0xCF && buf[7] === 0x11 && buf[8] === 0xA6 && buf[9] === 0xD9) { return { ext: 'wmv', mime: 'video/x-ms-wmv' }; } if (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x1 && buf[3].toString(16)[0] === 'b') { return { ext: 'mpg', mime: 'video/mpeg' }; } if ((buf[0] === 0x49 && buf[1] === 0x44 && buf[2] === 0x33) || (buf[0] === 0xFF && buf[1] === 0xfb)) { return { ext: 'mp3', mime: 'audio/mpeg' }; } if ((buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x4D && buf[9] === 0x34 && buf[10] === 0x41) || (buf[0] === 0x4D && buf[1] === 0x34 && buf[2] === 0x41 && buf[3] === 0x20)) { return { ext: 'm4a', mime: 'audio/m4a' }; } // needs to be before `ogg` check if (buf[28] === 0x4F && buf[29] === 0x70 && buf[30] === 0x75 && buf[31] === 0x73 && buf[32] === 0x48 && buf[33] === 0x65 && buf[34] === 0x61 && buf[35] === 0x64) { return { ext: 'opus', mime: 'audio/opus' }; } if (buf[0] === 0x4F && buf[1] === 0x67 && buf[2] === 0x67 && buf[3] === 0x53) { return { ext: 'ogg', mime: 'audio/ogg' }; } if (buf[0] === 0x66 && buf[1] === 0x4C && buf[2] === 0x61 && buf[3] === 0x43) { return { ext: 'flac', mime: 'audio/x-flac' }; } if (buf[0] === 0x52 && buf[1] === 0x49 && buf[2] === 0x46 && buf[3] === 0x46 && buf[8] === 0x57 && buf[9] === 0x41 && buf[10] === 0x56 && buf[11] === 0x45) { return { ext: 'wav', mime: 'audio/x-wav' }; } if (buf[0] === 0x23 && buf[1] === 0x21 && buf[2] === 0x41 && buf[3] === 0x4D && buf[4] === 0x52 && buf[5] === 0x0A) { return { ext: 'amr', mime: 'audio/amr' }; } if (buf[0] === 0x25 && buf[1] === 0x50 && buf[2] === 0x44 && buf[3] === 0x46) { return { ext: 'pdf', mime: 'application/pdf' }; } if (buf[0] === 0x4D && buf[1] === 0x5A) { return { ext: 'exe', mime: 'application/x-msdownload' }; } if ((buf[0] === 0x43 || buf[0] === 0x46) && buf[1] === 0x57 && buf[2] === 0x53) { return { ext: 'swf', mime: 'application/x-shockwave-flash' }; } if (buf[0] === 0x7B && buf[1] === 0x5C && buf[2] === 0x72 && buf[3] === 0x74 && buf[4] === 0x66) { return { ext: 'rtf', mime: 'application/rtf' }; } if ( (buf[0] === 0x77 && buf[1] === 0x4F && buf[2] === 0x46 && buf[3] === 0x46) && ( (buf[4] === 0x00 && buf[5] === 0x01 && buf[6] === 0x00 && buf[7] === 0x00) || (buf[4] === 0x4F && buf[5] === 0x54 && buf[6] === 0x54 && buf[7] === 0x4F) ) ) { return { ext: 'woff', mime: 'application/font-woff' }; } if ( (buf[0] === 0x77 && buf[1] === 0x4F && buf[2] === 0x46 && buf[3] === 0x32) && ( (buf[4] === 0x00 && buf[5] === 0x01 && buf[6] === 0x00 && buf[7] === 0x00) || (buf[4] === 0x4F && buf[5] === 0x54 && buf[6] === 0x54 && buf[7] === 0x4F) ) ) { return { ext: 'woff2', mime: 'application/font-woff' }; } if ( (buf[34] === 0x4C && buf[35] === 0x50) && ( (buf[8] === 0x00 && buf[9] === 0x00 && buf[10] === 0x01) || (buf[8] === 0x01 && buf[9] === 0x00 && buf[10] === 0x02) || (buf[8] === 0x02 && buf[9] === 0x00 && buf[10] === 0x02) ) ) { return { ext: 'eot', mime: 'application/octet-stream' }; } if (buf[0] === 0x00 && buf[1] === 0x01 && buf[2] === 0x00 && buf[3] === 0x00 && buf[4] === 0x00) { return { ext: 'ttf', mime: 'application/font-sfnt' }; } if (buf[0] === 0x4F && buf[1] === 0x54 && buf[2] === 0x54 && buf[3] === 0x4F && buf[4] === 0x00) { return { ext: 'otf', mime: 'application/font-sfnt' }; } if (buf[0] === 0x00 && buf[1] === 0x00 && buf[2] === 0x01 && buf[3] === 0x00) { return { ext: 'ico', mime: 'image/x-icon' }; } if (buf[0] === 0x46 && buf[1] === 0x4C && buf[2] === 0x56 && buf[3] === 0x01) { return { ext: 'flv', mime: 'video/x-flv' }; } if (buf[0] === 0x25 && buf[1] === 0x21) { return { ext: 'ps', mime: 'application/postscript' }; } if (buf[0] === 0xFD && buf[1] === 0x37 && buf[2] === 0x7A && buf[3] === 0x58 && buf[4] === 0x5A && buf[5] === 0x00) { return { ext: 'xz', mime: 'application/x-xz' }; } if (buf[0] === 0x53 && buf[1] === 0x51 && buf[2] === 0x4C && buf[3] === 0x69) { return { ext: 'sqlite', mime: 'application/x-sqlite3' }; } if (buf[0] === 0x4E && buf[1] === 0x45 && buf[2] === 0x53 && buf[3] === 0x1A) { return { ext: 'nes', mime: 'application/x-nintendo-nes-rom' }; } if (buf[0] === 0x43 && buf[1] === 0x72 && buf[2] === 0x32 && buf[3] === 0x34) { return { ext: 'crx', mime: 'application/x-google-chrome-extension' }; } if ( (buf[0] === 0x4D && buf[1] === 0x53 && buf[2] === 0x43 && buf[3] === 0x46) || (buf[0] === 0x49 && buf[1] === 0x53 && buf[2] === 0x63 && buf[3] === 0x28) ) { return { ext: 'cab', mime: 'application/vnd.ms-cab-compressed' }; } // needs to be before `ar` check if (buf[0] === 0x21 && buf[1] === 0x3C && buf[2] === 0x61 && buf[3] === 0x72 && buf[4] === 0x63 && buf[5] === 0x68 && buf[6] === 0x3E && buf[7] === 0x0A && buf[8] === 0x64 && buf[9] === 0x65 && buf[10] === 0x62 && buf[11] === 0x69 && buf[12] === 0x61 && buf[13] === 0x6E && buf[14] === 0x2D && buf[15] === 0x62 && buf[16] === 0x69 && buf[17] === 0x6E && buf[18] === 0x61 && buf[19] === 0x72 && buf[20] === 0x79) { return { ext: 'deb', mime: 'application/x-deb' }; } if (buf[0] === 0x21 && buf[1] === 0x3C && buf[2] === 0x61 && buf[3] === 0x72 && buf[4] === 0x63 && buf[5] === 0x68 && buf[6] === 0x3E) { return { ext: 'ar', mime: 'application/x-unix-archive' }; } if (buf[0] === 0xED && buf[1] === 0xAB && buf[2] === 0xEE && buf[3] === 0xDB) { return { ext: 'rpm', mime: 'application/x-rpm' }; } if ( (buf[0] === 0x1F && buf[1] === 0xA0) || (buf[0] === 0x1F && buf[1] === 0x9D) ) { return { ext: 'Z', mime: 'application/x-compress' }; } if (buf[0] === 0x4C && buf[1] === 0x5A && buf[2] === 0x49 && buf[3] === 0x50) { return { ext: 'lz', mime: 'application/x-lzip' }; } if (buf[0] === 0xD0 && buf[1] === 0xCF && buf[2] === 0x11 && buf[3] === 0xE0 && buf[4] === 0xA1 && buf[5] === 0xB1 && buf[6] === 0x1A && buf[7] === 0xE1) { return { ext: 'msi', mime: 'application/x-msi' }; } return null; }; /***/ }), /***/ 6591: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const path = __nccwpck_require__(6928); const fs = __nccwpck_require__(5744); const decompressTar = __nccwpck_require__(2657); const decompressTarbz2 = __nccwpck_require__(2681); const decompressTargz = __nccwpck_require__(8848); const decompressUnzip = __nccwpck_require__(1296); const makeDir = __nccwpck_require__(6512); const pify = __nccwpck_require__(2946); const stripDirs = __nccwpck_require__(5245); const fsP = pify(fs); const runPlugins = (input, opts) => { if (opts.plugins.length === 0) { return Promise.resolve([]); } return Promise.all(opts.plugins.map(x => x(input, opts))).then(files => files.reduce((a, b) => a.concat(b))); }; const safeMakeDir = (dir, realOutputPath) => { return fsP.realpath(dir) .catch(_ => { const parent = path.dirname(dir); return safeMakeDir(parent, realOutputPath); }) .then(realParentPath => { if (realParentPath.indexOf(realOutputPath) !== 0) { throw (new Error('Refusing to create a directory outside the output path.')); } return makeDir(dir).then(fsP.realpath); }); }; const preventWritingThroughSymlink = (destination, realOutputPath) => { return fsP.readlink(destination) .catch(_ => { // Either no file exists, or it's not a symlink. In either case, this is // not an escape we need to worry about in this phase. return null; }) .then(symlinkPointsTo => { if (symlinkPointsTo) { throw new Error('Refusing to write into a symlink'); } // No symlink exists at `destination`, so we can continue return realOutputPath; }); }; const extractFile = (input, output, opts) => runPlugins(input, opts).then(files => { if (opts.strip > 0) { files = files .map(x => { x.path = stripDirs(x.path, opts.strip); return x; }) .filter(x => x.path !== '.'); } if (typeof opts.filter === 'function') { files = files.filter(opts.filter); } if (typeof opts.map === 'function') { files = files.map(opts.map); } if (!output) { return files; } return Promise.all(files.map(x => { const dest = path.join(output, x.path); const mode = x.mode & ~process.umask(); const now = new Date(); if (x.type === 'directory') { return makeDir(output) .then(outputPath => fsP.realpath(outputPath)) .then(realOutputPath => safeMakeDir(dest, realOutputPath)) .then(() => fsP.utimes(dest, now, x.mtime)) .then(() => x); } return makeDir(output) .then(outputPath => fsP.realpath(outputPath)) .then(realOutputPath => { // Attempt to ensure parent directory exists (failing if it's outside the output dir) return safeMakeDir(path.dirname(dest), realOutputPath) .then(() => realOutputPath); }) .then(realOutputPath => { if (x.type === 'file') { return preventWritingThroughSymlink(dest, realOutputPath); } return realOutputPath; }) .then(realOutputPath => { return fsP.realpath(path.dirname(dest)) .then(realDestinationDir => { if (realDestinationDir.indexOf(realOutputPath) !== 0) { throw (new Error('Refusing to write outside output directory: ' + realDestinationDir)); } }); }) .then(() => { if (x.type === 'link') { return fsP.link(x.linkname, dest); } if (x.type === 'symlink' && process.platform === 'win32') { return fsP.link(x.linkname, dest); } if (x.type === 'symlink') { return fsP.symlink(x.linkname, dest); } return fsP.writeFile(dest, x.data, {mode}); }) .then(() => x.type === 'file' && fsP.utimes(dest, now, x.mtime)) .then(() => x); })); }); module.exports = (input, output, opts) => { if (typeof input !== 'string' && !Buffer.isBuffer(input)) { return Promise.reject(new TypeError('Input file required')); } if (typeof output === 'object') { opts = output; output = null; } opts = Object.assign({plugins: [ decompressTar(), decompressTarbz2(), decompressTargz(), decompressUnzip() ]}, opts); const read = typeof input === 'string' ? fsP.readFile(input) : Promise.resolve(input); return read.then(buf => extractFile(buf, output, opts)); }; /***/ }), /***/ 1316: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var $defineProperty = __nccwpck_require__(9094); var $SyntaxError = __nccwpck_require__(105); var $TypeError = __nccwpck_require__(3314); var gopd = __nccwpck_require__(3170); /** @type {import('.')} */ module.exports = function defineDataProperty( obj, property, value ) { if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { throw new $TypeError('`obj` must be an object or a function`'); } if (typeof property !== 'string' && typeof property !== 'symbol') { throw new $TypeError('`property` must be a string or a symbol`'); } if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) { throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null'); } if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) { throw new $TypeError('`nonWritable`, if provided, must be a boolean or null'); } if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) { throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null'); } if (arguments.length > 6 && typeof arguments[6] !== 'boolean') { throw new $TypeError('`loose`, if provided, must be a boolean'); } var nonEnumerable = arguments.length > 3 ? arguments[3] : null; var nonWritable = arguments.length > 4 ? arguments[4] : null; var nonConfigurable = arguments.length > 5 ? arguments[5] : null; var loose = arguments.length > 6 ? arguments[6] : false; /* @type {false | TypedPropertyDescriptor} */ var desc = !!gopd && gopd(obj, property); if ($defineProperty) { $defineProperty(obj, property, { configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable, enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable, value: value, writable: nonWritable === null && desc ? desc.writable : !nonWritable }); } else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) { // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable obj[property] = value; // eslint-disable-line no-param-reassign } else { throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.'); } }; /***/ }), /***/ 6669: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var callBind = __nccwpck_require__(8705); var gOPD = __nccwpck_require__(3170); var hasProtoAccessor; try { // eslint-disable-next-line no-extra-parens, no-proto hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype; } catch (e) { if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') { throw e; } } // eslint-disable-next-line no-extra-parens var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__')); var $Object = Object; var $getPrototypeOf = $Object.getPrototypeOf; /** @type {import('./get')} */ module.exports = desc && typeof desc.get === 'function' ? callBind([desc.get]) : typeof $getPrototypeOf === 'function' ? /** @type {import('./get')} */ function getDunder(value) { // eslint-disable-next-line eqeqeq return $getPrototypeOf(value == null ? value : $Object(value)); } : false; /***/ }), /***/ 1424: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var once = __nccwpck_require__(5560); var noop = function() {}; var qnt = global.Bare ? queueMicrotask : process.nextTick.bind(process); var isRequest = function(stream) { return stream.setHeader && typeof stream.abort === 'function'; }; var isChildProcess = function(stream) { return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 }; var eos = function(stream, opts, callback) { if (typeof opts === 'function') return eos(stream, null, opts); if (!opts) opts = {}; callback = once(callback || noop); var ws = stream._writableState; var rs = stream._readableState; var readable = opts.readable || (opts.readable !== false && stream.readable); var writable = opts.writable || (opts.writable !== false && stream.writable); var cancelled = false; var onlegacyfinish = function() { if (!stream.writable) onfinish(); }; var onfinish = function() { writable = false; if (!readable) callback.call(stream); }; var onend = function() { readable = false; if (!writable) callback.call(stream); }; var onexit = function(exitCode) { callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); }; var onerror = function(err) { callback.call(stream, err); }; var onclose = function() { qnt(onclosenexttick); }; var onclosenexttick = function() { if (cancelled) return; if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close')); if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close')); }; var onrequest = function() { stream.req.on('finish', onfinish); }; if (isRequest(stream)) { stream.on('complete', onfinish); stream.on('abort', onclose); if (stream.req) onrequest(); else stream.on('request', onrequest); } else if (writable && !ws) { // legacy streams stream.on('end', onlegacyfinish); stream.on('close', onlegacyfinish); } if (isChildProcess(stream)) stream.on('exit', onexit); stream.on('end', onend); stream.on('finish', onfinish); if (opts.error !== false) stream.on('error', onerror); stream.on('close', onclose); return function() { cancelled = true; stream.removeListener('complete', onfinish); stream.removeListener('abort', onclose); stream.removeListener('request', onrequest); if (stream.req) stream.req.removeListener('finish', onfinish); stream.removeListener('end', onlegacyfinish); stream.removeListener('close', onlegacyfinish); stream.removeListener('finish', onfinish); stream.removeListener('exit', onexit); stream.removeListener('end', onend); stream.removeListener('error', onerror); stream.removeListener('close', onclose); }; }; module.exports = eos; /***/ }), /***/ 9094: /***/ ((module) => { /** @type {import('.')} */ var $defineProperty = Object.defineProperty || false; if ($defineProperty) { try { $defineProperty({}, 'a', { value: 1 }); } catch (e) { // IE 8 has a broken defineProperty $defineProperty = false; } } module.exports = $defineProperty; /***/ }), /***/ 3056: /***/ ((module) => { /** @type {import('./eval')} */ module.exports = EvalError; /***/ }), /***/ 1620: /***/ ((module) => { /** @type {import('.')} */ module.exports = Error; /***/ }), /***/ 4585: /***/ ((module) => { /** @type {import('./range')} */ module.exports = RangeError; /***/ }), /***/ 6905: /***/ ((module) => { /** @type {import('./ref')} */ module.exports = ReferenceError; /***/ }), /***/ 105: /***/ ((module) => { /** @type {import('./syntax')} */ module.exports = SyntaxError; /***/ }), /***/ 3314: /***/ ((module) => { /** @type {import('./type')} */ module.exports = TypeError; /***/ }), /***/ 2578: /***/ ((module) => { /** @type {import('./uri')} */ module.exports = URIError; /***/ }), /***/ 5399: /***/ ((module) => { /** @type {import('.')} */ module.exports = Object; /***/ }), /***/ 3045: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { var fs = __nccwpck_require__(9896); var util = __nccwpck_require__(9023); var stream = __nccwpck_require__(2203); var Readable = stream.Readable; var Writable = stream.Writable; var PassThrough = stream.PassThrough; var Pend = __nccwpck_require__(3313); var EventEmitter = (__nccwpck_require__(4434).EventEmitter); exports.createFromBuffer = createFromBuffer; exports.createFromFd = createFromFd; exports.BufferSlicer = BufferSlicer; exports.FdSlicer = FdSlicer; util.inherits(FdSlicer, EventEmitter); function FdSlicer(fd, options) { options = options || {}; EventEmitter.call(this); this.fd = fd; this.pend = new Pend(); this.pend.max = 1; this.refCount = 0; this.autoClose = !!options.autoClose; } FdSlicer.prototype.read = function(buffer, offset, length, position, callback) { var self = this; self.pend.go(function(cb) { fs.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) { cb(); callback(err, bytesRead, buffer); }); }); }; FdSlicer.prototype.write = function(buffer, offset, length, position, callback) { var self = this; self.pend.go(function(cb) { fs.write(self.fd, buffer, offset, length, position, function(err, written, buffer) { cb(); callback(err, written, buffer); }); }); }; FdSlicer.prototype.createReadStream = function(options) { return new ReadStream(this, options); }; FdSlicer.prototype.createWriteStream = function(options) { return new WriteStream(this, options); }; FdSlicer.prototype.ref = function() { this.refCount += 1; }; FdSlicer.prototype.unref = function() { var self = this; self.refCount -= 1; if (self.refCount > 0) return; if (self.refCount < 0) throw new Error("invalid unref"); if (self.autoClose) { fs.close(self.fd, onCloseDone); } function onCloseDone(err) { if (err) { self.emit('error', err); } else { self.emit('close'); } } }; util.inherits(ReadStream, Readable); function ReadStream(context, options) { options = options || {}; Readable.call(this, options); this.context = context; this.context.ref(); this.start = options.start || 0; this.endOffset = options.end; this.pos = this.start; this.destroyed = false; } ReadStream.prototype._read = function(n) { var self = this; if (self.destroyed) return; var toRead = Math.min(self._readableState.highWaterMark, n); if (self.endOffset != null) { toRead = Math.min(toRead, self.endOffset - self.pos); } if (toRead <= 0) { self.destroyed = true; self.push(null); self.context.unref(); return; } self.context.pend.go(function(cb) { if (self.destroyed) return cb(); var buffer = new Buffer(toRead); fs.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) { if (err) { self.destroy(err); } else if (bytesRead === 0) { self.destroyed = true; self.push(null); self.context.unref(); } else { self.pos += bytesRead; self.push(buffer.slice(0, bytesRead)); } cb(); }); }); }; ReadStream.prototype.destroy = function(err) { if (this.destroyed) return; err = err || new Error("stream destroyed"); this.destroyed = true; this.emit('error', err); this.context.unref(); }; util.inherits(WriteStream, Writable); function WriteStream(context, options) { options = options || {}; Writable.call(this, options); this.context = context; this.context.ref(); this.start = options.start || 0; this.endOffset = (options.end == null) ? Infinity : +options.end; this.bytesWritten = 0; this.pos = this.start; this.destroyed = false; this.on('finish', this.destroy.bind(this)); } WriteStream.prototype._write = function(buffer, encoding, callback) { var self = this; if (self.destroyed) return; if (self.pos + buffer.length > self.endOffset) { var err = new Error("maximum file length exceeded"); err.code = 'ETOOBIG'; self.destroy(); callback(err); return; } self.context.pend.go(function(cb) { if (self.destroyed) return cb(); fs.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err, bytes) { if (err) { self.destroy(); cb(); callback(err); } else { self.bytesWritten += bytes; self.pos += bytes; self.emit('progress'); cb(); callback(); } }); }); }; WriteStream.prototype.destroy = function() { if (this.destroyed) return; this.destroyed = true; this.context.unref(); }; util.inherits(BufferSlicer, EventEmitter); function BufferSlicer(buffer, options) { EventEmitter.call(this); options = options || {}; this.refCount = 0; this.buffer = buffer; this.maxChunkSize = options.maxChunkSize || Number.MAX_SAFE_INTEGER; } BufferSlicer.prototype.read = function(buffer, offset, length, position, callback) { var end = position + length; var delta = end - this.buffer.length; var written = (delta > 0) ? delta : length; this.buffer.copy(buffer, offset, position, end); setImmediate(function() { callback(null, written); }); }; BufferSlicer.prototype.write = function(buffer, offset, length, position, callback) { buffer.copy(this.buffer, position, offset, offset + length); setImmediate(function() { callback(null, length, buffer); }); }; BufferSlicer.prototype.createReadStream = function(options) { options = options || {}; var readStream = new PassThrough(options); readStream.destroyed = false; readStream.start = options.start || 0; readStream.endOffset = options.end; // by the time this function returns, we'll be done. readStream.pos = readStream.endOffset || this.buffer.length; // respect the maxChunkSize option to slice up the chunk into smaller pieces. var entireSlice = this.buffer.slice(readStream.start, readStream.pos); var offset = 0; while (true) { var nextOffset = offset + this.maxChunkSize; if (nextOffset >= entireSlice.length) { // last chunk if (offset < entireSlice.length) { readStream.write(entireSlice.slice(offset, entireSlice.length)); } break; } readStream.write(entireSlice.slice(offset, nextOffset)); offset = nextOffset; } readStream.end(); readStream.destroy = function() { readStream.destroyed = true; }; return readStream; }; BufferSlicer.prototype.createWriteStream = function(options) { var bufferSlicer = this; options = options || {}; var writeStream = new Writable(options); writeStream.start = options.start || 0; writeStream.endOffset = (options.end == null) ? this.buffer.length : +options.end; writeStream.bytesWritten = 0; writeStream.pos = writeStream.start; writeStream.destroyed = false; writeStream._write = function(buffer, encoding, callback) { if (writeStream.destroyed) return; var end = writeStream.pos + buffer.length; if (end > writeStream.endOffset) { var err = new Error("maximum file length exceeded"); err.code = 'ETOOBIG'; writeStream.destroyed = true; callback(err); return; } buffer.copy(bufferSlicer.buffer, writeStream.pos, 0, buffer.length); writeStream.bytesWritten += buffer.length; writeStream.pos = end; writeStream.emit('progress'); callback(); }; writeStream.destroy = function() { writeStream.destroyed = true; }; return writeStream; }; BufferSlicer.prototype.ref = function() { this.refCount += 1; }; BufferSlicer.prototype.unref = function() { this.refCount -= 1; if (this.refCount < 0) { throw new Error("invalid unref"); } }; function createFromBuffer(buffer, options) { return new BufferSlicer(buffer, options); } function createFromFd(fd, options) { return new FdSlicer(fd, options); } /***/ }), /***/ 8989: /***/ ((module) => { module.exports = input => { const buf = new Uint8Array(input); if (!(buf && buf.length > 1)) { return null; } const check = (header, opts) => { opts = Object.assign({ offset: 0 }, opts); for (let i = 0; i < header.length; i++) { if (header[i] !== buf[i + opts.offset]) { return false; } } return true; }; if (check([0xFF, 0xD8, 0xFF])) { return { ext: 'jpg', mime: 'image/jpeg' }; } if (check([0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A])) { return { ext: 'png', mime: 'image/png' }; } if (check([0x47, 0x49, 0x46])) { return { ext: 'gif', mime: 'image/gif' }; } if (check([0x57, 0x45, 0x42, 0x50], {offset: 8})) { return { ext: 'webp', mime: 'image/webp' }; } if (check([0x46, 0x4C, 0x49, 0x46])) { return { ext: 'flif', mime: 'image/flif' }; } // Needs to be before `tif` check if ( (check([0x49, 0x49, 0x2A, 0x0]) || check([0x4D, 0x4D, 0x0, 0x2A])) && check([0x43, 0x52], {offset: 8}) ) { return { ext: 'cr2', mime: 'image/x-canon-cr2' }; } if ( check([0x49, 0x49, 0x2A, 0x0]) || check([0x4D, 0x4D, 0x0, 0x2A]) ) { return { ext: 'tif', mime: 'image/tiff' }; } if (check([0x42, 0x4D])) { return { ext: 'bmp', mime: 'image/bmp' }; } if (check([0x49, 0x49, 0xBC])) { return { ext: 'jxr', mime: 'image/vnd.ms-photo' }; } if (check([0x38, 0x42, 0x50, 0x53])) { return { ext: 'psd', mime: 'image/vnd.adobe.photoshop' }; } // Needs to be before the `zip` check if ( check([0x50, 0x4B, 0x3, 0x4]) && check([0x6D, 0x69, 0x6D, 0x65, 0x74, 0x79, 0x70, 0x65, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x2F, 0x65, 0x70, 0x75, 0x62, 0x2B, 0x7A, 0x69, 0x70], {offset: 30}) ) { return { ext: 'epub', mime: 'application/epub+zip' }; } // Needs to be before `zip` check // Assumes signed `.xpi` from addons.mozilla.org if ( check([0x50, 0x4B, 0x3, 0x4]) && check([0x4D, 0x45, 0x54, 0x41, 0x2D, 0x49, 0x4E, 0x46, 0x2F, 0x6D, 0x6F, 0x7A, 0x69, 0x6C, 0x6C, 0x61, 0x2E, 0x72, 0x73, 0x61], {offset: 30}) ) { return { ext: 'xpi', mime: 'application/x-xpinstall' }; } if ( check([0x50, 0x4B]) && (buf[2] === 0x3 || buf[2] === 0x5 || buf[2] === 0x7) && (buf[3] === 0x4 || buf[3] === 0x6 || buf[3] === 0x8) ) { return { ext: 'zip', mime: 'application/zip' }; } if (check([0x75, 0x73, 0x74, 0x61, 0x72], {offset: 257})) { return { ext: 'tar', mime: 'application/x-tar' }; } if ( check([0x52, 0x61, 0x72, 0x21, 0x1A, 0x7]) && (buf[6] === 0x0 || buf[6] === 0x1) ) { return { ext: 'rar', mime: 'application/x-rar-compressed' }; } if (check([0x1F, 0x8B, 0x8])) { return { ext: 'gz', mime: 'application/gzip' }; } if (check([0x42, 0x5A, 0x68])) { return { ext: 'bz2', mime: 'application/x-bzip2' }; } if (check([0x37, 0x7A, 0xBC, 0xAF, 0x27, 0x1C])) { return { ext: '7z', mime: 'application/x-7z-compressed' }; } if (check([0x78, 0x01])) { return { ext: 'dmg', mime: 'application/x-apple-diskimage' }; } if ( ( check([0x0, 0x0, 0x0]) && (buf[3] === 0x18 || buf[3] === 0x20) && check([0x66, 0x74, 0x79, 0x70], {offset: 4}) ) || check([0x33, 0x67, 0x70, 0x35]) || ( check([0x0, 0x0, 0x0, 0x1C, 0x66, 0x74, 0x79, 0x70, 0x6D, 0x70, 0x34, 0x32]) && check([0x6D, 0x70, 0x34, 0x31, 0x6D, 0x70, 0x34, 0x32, 0x69, 0x73, 0x6F, 0x6D], {offset: 16}) ) || check([0x0, 0x0, 0x0, 0x1C, 0x66, 0x74, 0x79, 0x70, 0x69, 0x73, 0x6F, 0x6D]) || check([0x0, 0x0, 0x0, 0x1C, 0x66, 0x74, 0x79, 0x70, 0x6D, 0x70, 0x34, 0x32, 0x0, 0x0, 0x0, 0x0]) ) { return { ext: 'mp4', mime: 'video/mp4' }; } if (check([0x0, 0x0, 0x0, 0x1C, 0x66, 0x74, 0x79, 0x70, 0x4D, 0x34, 0x56])) { return { ext: 'm4v', mime: 'video/x-m4v' }; } if (check([0x4D, 0x54, 0x68, 0x64])) { return { ext: 'mid', mime: 'audio/midi' }; } // https://github.com/threatstack/libmagic/blob/master/magic/Magdir/matroska if (check([0x1A, 0x45, 0xDF, 0xA3])) { const sliced = buf.subarray(4, 4 + 4096); const idPos = sliced.findIndex((el, i, arr) => arr[i] === 0x42 && arr[i + 1] === 0x82); if (idPos >= 0) { const docTypePos = idPos + 3; const findDocType = type => Array.from(type).every((c, i) => sliced[docTypePos + i] === c.charCodeAt(0)); if (findDocType('matroska')) { return { ext: 'mkv', mime: 'video/x-matroska' }; } if (findDocType('webm')) { return { ext: 'webm', mime: 'video/webm' }; } } } if (check([0x0, 0x0, 0x0, 0x14, 0x66, 0x74, 0x79, 0x70, 0x71, 0x74, 0x20, 0x20]) || check([0x66, 0x72, 0x65, 0x65], {offset: 4}) || check([0x66, 0x74, 0x79, 0x70, 0x71, 0x74, 0x20, 0x20], {offset: 4}) || check([0x6D, 0x64, 0x61, 0x74], {offset: 4}) || // MJPEG check([0x77, 0x69, 0x64, 0x65], {offset: 4})) { return { ext: 'mov', mime: 'video/quicktime' }; } if ( check([0x52, 0x49, 0x46, 0x46]) && check([0x41, 0x56, 0x49], {offset: 8}) ) { return { ext: 'avi', mime: 'video/x-msvideo' }; } if (check([0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9])) { return { ext: 'wmv', mime: 'video/x-ms-wmv' }; } if (check([0x0, 0x0, 0x1, 0xBA])) { return { ext: 'mpg', mime: 'video/mpeg' }; } if ( check([0x49, 0x44, 0x33]) || check([0xFF, 0xFB]) ) { return { ext: 'mp3', mime: 'audio/mpeg' }; } if ( check([0x66, 0x74, 0x79, 0x70, 0x4D, 0x34, 0x41], {offset: 4}) || check([0x4D, 0x34, 0x41, 0x20]) ) { return { ext: 'm4a', mime: 'audio/m4a' }; } // Needs to be before `ogg` check if (check([0x4F, 0x70, 0x75, 0x73, 0x48, 0x65, 0x61, 0x64], {offset: 28})) { return { ext: 'opus', mime: 'audio/opus' }; } if (check([0x4F, 0x67, 0x67, 0x53])) { return { ext: 'ogg', mime: 'audio/ogg' }; } if (check([0x66, 0x4C, 0x61, 0x43])) { return { ext: 'flac', mime: 'audio/x-flac' }; } if ( check([0x52, 0x49, 0x46, 0x46]) && check([0x57, 0x41, 0x56, 0x45], {offset: 8}) ) { return { ext: 'wav', mime: 'audio/x-wav' }; } if (check([0x23, 0x21, 0x41, 0x4D, 0x52, 0x0A])) { return { ext: 'amr', mime: 'audio/amr' }; } if (check([0x25, 0x50, 0x44, 0x46])) { return { ext: 'pdf', mime: 'application/pdf' }; } if (check([0x4D, 0x5A])) { return { ext: 'exe', mime: 'application/x-msdownload' }; } if ( (buf[0] === 0x43 || buf[0] === 0x46) && check([0x57, 0x53], {offset: 1}) ) { return { ext: 'swf', mime: 'application/x-shockwave-flash' }; } if (check([0x7B, 0x5C, 0x72, 0x74, 0x66])) { return { ext: 'rtf', mime: 'application/rtf' }; } if (check([0x00, 0x61, 0x73, 0x6D])) { return { ext: 'wasm', mime: 'application/wasm' }; } if ( check([0x77, 0x4F, 0x46, 0x46]) && ( check([0x00, 0x01, 0x00, 0x00], {offset: 4}) || check([0x4F, 0x54, 0x54, 0x4F], {offset: 4}) ) ) { return { ext: 'woff', mime: 'font/woff' }; } if ( check([0x77, 0x4F, 0x46, 0x32]) && ( check([0x00, 0x01, 0x00, 0x00], {offset: 4}) || check([0x4F, 0x54, 0x54, 0x4F], {offset: 4}) ) ) { return { ext: 'woff2', mime: 'font/woff2' }; } if ( check([0x4C, 0x50], {offset: 34}) && ( check([0x00, 0x00, 0x01], {offset: 8}) || check([0x01, 0x00, 0x02], {offset: 8}) || check([0x02, 0x00, 0x02], {offset: 8}) ) ) { return { ext: 'eot', mime: 'application/octet-stream' }; } if (check([0x00, 0x01, 0x00, 0x00, 0x00])) { return { ext: 'ttf', mime: 'font/ttf' }; } if (check([0x4F, 0x54, 0x54, 0x4F, 0x00])) { return { ext: 'otf', mime: 'font/otf' }; } if (check([0x00, 0x00, 0x01, 0x00])) { return { ext: 'ico', mime: 'image/x-icon' }; } if (check([0x46, 0x4C, 0x56, 0x01])) { return { ext: 'flv', mime: 'video/x-flv' }; } if (check([0x25, 0x21])) { return { ext: 'ps', mime: 'application/postscript' }; } if (check([0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00])) { return { ext: 'xz', mime: 'application/x-xz' }; } if (check([0x53, 0x51, 0x4C, 0x69])) { return { ext: 'sqlite', mime: 'application/x-sqlite3' }; } if (check([0x4E, 0x45, 0x53, 0x1A])) { return { ext: 'nes', mime: 'application/x-nintendo-nes-rom' }; } if (check([0x43, 0x72, 0x32, 0x34])) { return { ext: 'crx', mime: 'application/x-google-chrome-extension' }; } if ( check([0x4D, 0x53, 0x43, 0x46]) || check([0x49, 0x53, 0x63, 0x28]) ) { return { ext: 'cab', mime: 'application/vnd.ms-cab-compressed' }; } // Needs to be before `ar` check if (check([0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E, 0x0A, 0x64, 0x65, 0x62, 0x69, 0x61, 0x6E, 0x2D, 0x62, 0x69, 0x6E, 0x61, 0x72, 0x79])) { return { ext: 'deb', mime: 'application/x-deb' }; } if (check([0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E])) { return { ext: 'ar', mime: 'application/x-unix-archive' }; } if (check([0xED, 0xAB, 0xEE, 0xDB])) { return { ext: 'rpm', mime: 'application/x-rpm' }; } if ( check([0x1F, 0xA0]) || check([0x1F, 0x9D]) ) { return { ext: 'Z', mime: 'application/x-compress' }; } if (check([0x4C, 0x5A, 0x49, 0x50])) { return { ext: 'lz', mime: 'application/x-lzip' }; } if (check([0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1])) { return { ext: 'msi', mime: 'application/x-msi' }; } if (check([0x06, 0x0E, 0x2B, 0x34, 0x02, 0x05, 0x01, 0x01, 0x0D, 0x01, 0x02, 0x01, 0x01, 0x02])) { return { ext: 'mxf', mime: 'application/mxf' }; } if (check([0x47], {offset: 4}) && (check([0x47], {offset: 192}) || check([0x47], {offset: 196}))) { return { ext: 'mts', mime: 'video/mp2t' }; } if (check([0x42, 0x4C, 0x45, 0x4E, 0x44, 0x45, 0x52])) { return { ext: 'blend', mime: 'application/x-blender' }; } if (check([0x42, 0x50, 0x47, 0xFB])) { return { ext: 'bpg', mime: 'image/bpg' }; } return null; }; /***/ }), /***/ 877: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /*! * fill-range * * Copyright (c) 2014-present, Jon Schlinkert. * Licensed under the MIT License. */ const util = __nccwpck_require__(9023); const toRegexRange = __nccwpck_require__(7551); const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); const transform = toNumber => { return value => toNumber === true ? Number(value) : String(value); }; const isValidValue = value => { return typeof value === 'number' || (typeof value === 'string' && value !== ''); }; const isNumber = num => Number.isInteger(+num); const zeros = input => { let value = `${input}`; let index = -1; if (value[0] === '-') value = value.slice(1); if (value === '0') return false; while (value[++index] === '0'); return index > 0; }; const stringify = (start, end, options) => { if (typeof start === 'string' || typeof end === 'string') { return true; } return options.stringify === true; }; const pad = (input, maxLength, toNumber) => { if (maxLength > 0) { let dash = input[0] === '-' ? '-' : ''; if (dash) input = input.slice(1); input = (dash + input.padStart(dash ? maxLength - 1 : maxLength, '0')); } if (toNumber === false) { return String(input); } return input; }; const toMaxLen = (input, maxLength) => { let negative = input[0] === '-' ? '-' : ''; if (negative) { input = input.slice(1); maxLength--; } while (input.length < maxLength) input = '0' + input; return negative ? ('-' + input) : input; }; const toSequence = (parts, options, maxLen) => { parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); let prefix = options.capture ? '' : '?:'; let positives = ''; let negatives = ''; let result; if (parts.positives.length) { positives = parts.positives.map(v => toMaxLen(String(v), maxLen)).join('|'); } if (parts.negatives.length) { negatives = `-(${prefix}${parts.negatives.map(v => toMaxLen(String(v), maxLen)).join('|')})`; } if (positives && negatives) { result = `${positives}|${negatives}`; } else { result = positives || negatives; } if (options.wrap) { return `(${prefix}${result})`; } return result; }; const toRange = (a, b, isNumbers, options) => { if (isNumbers) { return toRegexRange(a, b, { wrap: false, ...options }); } let start = String.fromCharCode(a); if (a === b) return start; let stop = String.fromCharCode(b); return `[${start}-${stop}]`; }; const toRegex = (start, end, options) => { if (Array.isArray(start)) { let wrap = options.wrap === true; let prefix = options.capture ? '' : '?:'; return wrap ? `(${prefix}${start.join('|')})` : start.join('|'); } return toRegexRange(start, end, options); }; const rangeError = (...args) => { return new RangeError('Invalid range arguments: ' + util.inspect(...args)); }; const invalidRange = (start, end, options) => { if (options.strictRanges === true) throw rangeError([start, end]); return []; }; const invalidStep = (step, options) => { if (options.strictRanges === true) { throw new TypeError(`Expected step "${step}" to be a number`); } return []; }; const fillNumbers = (start, end, step = 1, options = {}) => { let a = Number(start); let b = Number(end); if (!Number.isInteger(a) || !Number.isInteger(b)) { if (options.strictRanges === true) throw rangeError([start, end]); return []; } // fix negative zero if (a === 0) a = 0; if (b === 0) b = 0; let descending = a > b; let startString = String(start); let endString = String(end); let stepString = String(step); step = Math.max(Math.abs(step), 1); let padded = zeros(startString) || zeros(endString) || zeros(stepString); let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; let toNumber = padded === false && stringify(start, end, options) === false; let format = options.transform || transform(toNumber); if (options.toRegex && step === 1) { return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); } let parts = { negatives: [], positives: [] }; let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num)); let range = []; let index = 0; while (descending ? a >= b : a <= b) { if (options.toRegex === true && step > 1) { push(a); } else { range.push(pad(format(a, index), maxLen, toNumber)); } a = descending ? a - step : a + step; index++; } if (options.toRegex === true) { return step > 1 ? toSequence(parts, options, maxLen) : toRegex(range, null, { wrap: false, ...options }); } return range; }; const fillLetters = (start, end, step = 1, options = {}) => { if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) { return invalidRange(start, end, options); } let format = options.transform || (val => String.fromCharCode(val)); let a = `${start}`.charCodeAt(0); let b = `${end}`.charCodeAt(0); let descending = a > b; let min = Math.min(a, b); let max = Math.max(a, b); if (options.toRegex && step === 1) { return toRange(min, max, false, options); } let range = []; let index = 0; while (descending ? a >= b : a <= b) { range.push(format(a, index)); a = descending ? a - step : a + step; index++; } if (options.toRegex === true) { return toRegex(range, null, { wrap: false, options }); } return range; }; const fill = (start, end, step, options = {}) => { if (end == null && isValidValue(start)) { return [start]; } if (!isValidValue(start) || !isValidValue(end)) { return invalidRange(start, end, options); } if (typeof step === 'function') { return fill(start, end, 1, { transform: step }); } if (isObject(step)) { return fill(start, end, 0, step); } let opts = { ...options }; if (opts.capture === true) opts.wrap = true; step = step || opts.step || 1; if (!isNumber(step)) { if (step != null && !isObject(step)) return invalidStep(step, opts); return fill(start, end, 1, step); } if (isNumber(start) && isNumber(end)) { return fillNumbers(start, end, step, opts); } return fillLetters(start, end, Math.max(Math.abs(step), 1), opts); }; module.exports = fill; /***/ }), /***/ 4778: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var debug; module.exports = function () { if (!debug) { try { /* eslint global-require: off */ debug = __nccwpck_require__(983)("follow-redirects"); } catch (error) { /* */ } if (typeof debug !== "function") { debug = function () { /* */ }; } } debug.apply(null, arguments); }; /***/ }), /***/ 1573: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var url = __nccwpck_require__(7016); var URL = url.URL; var http = __nccwpck_require__(8611); var https = __nccwpck_require__(5692); var Writable = (__nccwpck_require__(2203).Writable); var assert = __nccwpck_require__(2613); var debug = __nccwpck_require__(4778); // Preventive platform detection // istanbul ignore next (function detectUnsupportedEnvironment() { var looksLikeNode = typeof process !== "undefined"; var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined"; var looksLikeV8 = isFunction(Error.captureStackTrace); if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) { console.warn("The follow-redirects package should be excluded from browser builds."); } }()); // Whether to use the native URL object or the legacy url module var useNativeURL = false; try { assert(new URL("")); } catch (error) { useNativeURL = error.code === "ERR_INVALID_URL"; } // URL fields to preserve in copy operations var preservedUrlFields = [ "auth", "host", "hostname", "href", "path", "pathname", "port", "protocol", "query", "search", "hash", ]; // Create handlers that pass events from native requests var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; var eventHandlers = Object.create(null); events.forEach(function (event) { eventHandlers[event] = function (arg1, arg2, arg3) { this._redirectable.emit(event, arg1, arg2, arg3); }; }); // Error types with codes var InvalidUrlError = createErrorType( "ERR_INVALID_URL", "Invalid URL", TypeError ); var RedirectionError = createErrorType( "ERR_FR_REDIRECTION_FAILURE", "Redirected request failed" ); var TooManyRedirectsError = createErrorType( "ERR_FR_TOO_MANY_REDIRECTS", "Maximum number of redirects exceeded", RedirectionError ); var MaxBodyLengthExceededError = createErrorType( "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", "Request body larger than maxBodyLength limit" ); var WriteAfterEndError = createErrorType( "ERR_STREAM_WRITE_AFTER_END", "write after end" ); // istanbul ignore next var destroy = Writable.prototype.destroy || noop; // An HTTP(S) request that can be redirected function RedirectableRequest(options, responseCallback) { // Initialize the request Writable.call(this); this._sanitizeOptions(options); this._options = options; this._ended = false; this._ending = false; this._redirectCount = 0; this._redirects = []; this._requestBodyLength = 0; this._requestBodyBuffers = []; // Attach a callback if passed if (responseCallback) { this.on("response", responseCallback); } // React to responses of native requests var self = this; this._onNativeResponse = function (response) { try { self._processResponse(response); } catch (cause) { self.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause: cause })); } }; // Perform the first request this._performRequest(); } RedirectableRequest.prototype = Object.create(Writable.prototype); RedirectableRequest.prototype.abort = function () { destroyRequest(this._currentRequest); this._currentRequest.abort(); this.emit("abort"); }; RedirectableRequest.prototype.destroy = function (error) { destroyRequest(this._currentRequest, error); destroy.call(this, error); return this; }; // Writes buffered data to the current native request RedirectableRequest.prototype.write = function (data, encoding, callback) { // Writing is not allowed if end has been called if (this._ending) { throw new WriteAfterEndError(); } // Validate input and shift parameters if necessary if (!isString(data) && !isBuffer(data)) { throw new TypeError("data should be a string, Buffer or Uint8Array"); } if (isFunction(encoding)) { callback = encoding; encoding = null; } // Ignore empty buffers, since writing them doesn't invoke the callback // https://github.com/nodejs/node/issues/22066 if (data.length === 0) { if (callback) { callback(); } return; } // Only write when we don't exceed the maximum body length if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { this._requestBodyLength += data.length; this._requestBodyBuffers.push({ data: data, encoding: encoding }); this._currentRequest.write(data, encoding, callback); } // Error when we exceed the maximum body length else { this.emit("error", new MaxBodyLengthExceededError()); this.abort(); } }; // Ends the current native request RedirectableRequest.prototype.end = function (data, encoding, callback) { // Shift parameters if necessary if (isFunction(data)) { callback = data; data = encoding = null; } else if (isFunction(encoding)) { callback = encoding; encoding = null; } // Write data if needed and end if (!data) { this._ended = this._ending = true; this._currentRequest.end(null, null, callback); } else { var self = this; var currentRequest = this._currentRequest; this.write(data, encoding, function () { self._ended = true; currentRequest.end(null, null, callback); }); this._ending = true; } }; // Sets a header value on the current native request RedirectableRequest.prototype.setHeader = function (name, value) { this._options.headers[name] = value; this._currentRequest.setHeader(name, value); }; // Clears a header value on the current native request RedirectableRequest.prototype.removeHeader = function (name) { delete this._options.headers[name]; this._currentRequest.removeHeader(name); }; // Global timeout for all underlying requests RedirectableRequest.prototype.setTimeout = function (msecs, callback) { var self = this; // Destroys the socket on timeout function destroyOnTimeout(socket) { socket.setTimeout(msecs); socket.removeListener("timeout", socket.destroy); socket.addListener("timeout", socket.destroy); } // Sets up a timer to trigger a timeout event function startTimer(socket) { if (self._timeout) { clearTimeout(self._timeout); } self._timeout = setTimeout(function () { self.emit("timeout"); clearTimer(); }, msecs); destroyOnTimeout(socket); } // Stops a timeout from triggering function clearTimer() { // Clear the timeout if (self._timeout) { clearTimeout(self._timeout); self._timeout = null; } // Clean up all attached listeners self.removeListener("abort", clearTimer); self.removeListener("error", clearTimer); self.removeListener("response", clearTimer); self.removeListener("close", clearTimer); if (callback) { self.removeListener("timeout", callback); } if (!self.socket) { self._currentRequest.removeListener("socket", startTimer); } } // Attach callback if passed if (callback) { this.on("timeout", callback); } // Start the timer if or when the socket is opened if (this.socket) { startTimer(this.socket); } else { this._currentRequest.once("socket", startTimer); } // Clean up on events this.on("socket", destroyOnTimeout); this.on("abort", clearTimer); this.on("error", clearTimer); this.on("response", clearTimer); this.on("close", clearTimer); return this; }; // Proxy all other public ClientRequest methods [ "flushHeaders", "getHeader", "setNoDelay", "setSocketKeepAlive", ].forEach(function (method) { RedirectableRequest.prototype[method] = function (a, b) { return this._currentRequest[method](a, b); }; }); // Proxy all public ClientRequest properties ["aborted", "connection", "socket"].forEach(function (property) { Object.defineProperty(RedirectableRequest.prototype, property, { get: function () { return this._currentRequest[property]; }, }); }); RedirectableRequest.prototype._sanitizeOptions = function (options) { // Ensure headers are always present if (!options.headers) { options.headers = {}; } // Since http.request treats host as an alias of hostname, // but the url module interprets host as hostname plus port, // eliminate the host property to avoid confusion. if (options.host) { // Use hostname if set, because it has precedence if (!options.hostname) { options.hostname = options.host; } delete options.host; } // Complete the URL object when necessary if (!options.pathname && options.path) { var searchPos = options.path.indexOf("?"); if (searchPos < 0) { options.pathname = options.path; } else { options.pathname = options.path.substring(0, searchPos); options.search = options.path.substring(searchPos); } } }; // Executes the next native request (initial or redirect) RedirectableRequest.prototype._performRequest = function () { // Load the native protocol var protocol = this._options.protocol; var nativeProtocol = this._options.nativeProtocols[protocol]; if (!nativeProtocol) { throw new TypeError("Unsupported protocol " + protocol); } // If specified, use the agent corresponding to the protocol // (HTTP and HTTPS use different types of agents) if (this._options.agents) { var scheme = protocol.slice(0, -1); this._options.agent = this._options.agents[scheme]; } // Create the native request and set up its event handlers var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse); request._redirectable = this; for (var event of events) { request.on(event, eventHandlers[event]); } // RFC7230§5.3.1: When making a request directly to an origin server, […] // a client MUST send only the absolute path […] as the request-target. this._currentUrl = /^\//.test(this._options.path) ? url.format(this._options) : // When making a request to a proxy, […] // a client MUST send the target URI in absolute-form […]. this._options.path; // End a redirected request // (The first request must be ended explicitly with RedirectableRequest#end) if (this._isRedirect) { // Write the request entity and end var i = 0; var self = this; var buffers = this._requestBodyBuffers; (function writeNext(error) { // Only write if this request has not been redirected yet // istanbul ignore else if (request === self._currentRequest) { // Report any write errors // istanbul ignore if if (error) { self.emit("error", error); } // Write the next buffer if there are still left else if (i < buffers.length) { var buffer = buffers[i++]; // istanbul ignore else if (!request.finished) { request.write(buffer.data, buffer.encoding, writeNext); } } // End the request if `end` has been called on us else if (self._ended) { request.end(); } } }()); } }; // Processes a response from the current native request RedirectableRequest.prototype._processResponse = function (response) { // Store the redirected response var statusCode = response.statusCode; if (this._options.trackRedirects) { this._redirects.push({ url: this._currentUrl, headers: response.headers, statusCode: statusCode, }); } // RFC7231§6.4: The 3xx (Redirection) class of status code indicates // that further action needs to be taken by the user agent in order to // fulfill the request. If a Location header field is provided, // the user agent MAY automatically redirect its request to the URI // referenced by the Location field value, // even if the specific status code is not understood. // If the response is not a redirect; return it as-is var location = response.headers.location; if (!location || this._options.followRedirects === false || statusCode < 300 || statusCode >= 400) { response.responseUrl = this._currentUrl; response.redirects = this._redirects; this.emit("response", response); // Clean up this._requestBodyBuffers = []; return; } // The response is a redirect, so abort the current request destroyRequest(this._currentRequest); // Discard the remainder of the response to avoid waiting for data response.destroy(); // RFC7231§6.4: A client SHOULD detect and intervene // in cyclical redirections (i.e., "infinite" redirection loops). if (++this._redirectCount > this._options.maxRedirects) { throw new TooManyRedirectsError(); } // Store the request headers if applicable var requestHeaders; var beforeRedirect = this._options.beforeRedirect; if (beforeRedirect) { requestHeaders = Object.assign({ // The Host header was set by nativeProtocol.request Host: response.req.getHeader("host"), }, this._options.headers); } // RFC7231§6.4: Automatic redirection needs to done with // care for methods not known to be safe, […] // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change // the request method from POST to GET for the subsequent request. var method = this._options.method; if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || // RFC7231§6.4.4: The 303 (See Other) status code indicates that // the server is redirecting the user agent to a different resource […] // A user agent can perform a retrieval request targeting that URI // (a GET or HEAD request if using HTTP) […] (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) { this._options.method = "GET"; // Drop a possible entity and headers related to it this._requestBodyBuffers = []; removeMatchingHeaders(/^content-/i, this._options.headers); } // Drop the Host header, as the redirect might lead to a different host var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); // If the redirect is relative, carry over the host of the last request var currentUrlParts = parseUrl(this._currentUrl); var currentHost = currentHostHeader || currentUrlParts.host; var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url.format(Object.assign(currentUrlParts, { host: currentHost })); // Create the redirected request var redirectUrl = resolveUrl(location, currentUrl); debug("redirecting to", redirectUrl.href); this._isRedirect = true; spreadUrlObject(redirectUrl, this._options); // Drop confidential headers when redirecting to a less secure protocol // or to a different domain that is not a superdomain if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) { removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers); } // Evaluate the beforeRedirect callback if (isFunction(beforeRedirect)) { var responseDetails = { headers: response.headers, statusCode: statusCode, }; var requestDetails = { url: currentUrl, method: method, headers: requestHeaders, }; beforeRedirect(this._options, responseDetails, requestDetails); this._sanitizeOptions(this._options); } // Perform the redirected request this._performRequest(); }; // Wraps the key/value object of protocols with redirect functionality function wrap(protocols) { // Default settings var exports = { maxRedirects: 21, maxBodyLength: 10 * 1024 * 1024, }; // Wrap each protocol var nativeProtocols = {}; Object.keys(protocols).forEach(function (scheme) { var protocol = scheme + ":"; var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol); // Executes a request, following redirects function request(input, options, callback) { // Parse parameters, ensuring that input is an object if (isURL(input)) { input = spreadUrlObject(input); } else if (isString(input)) { input = spreadUrlObject(parseUrl(input)); } else { callback = options; options = validateUrl(input); input = { protocol: protocol }; } if (isFunction(options)) { callback = options; options = null; } // Set defaults options = Object.assign({ maxRedirects: exports.maxRedirects, maxBodyLength: exports.maxBodyLength, }, input, options); options.nativeProtocols = nativeProtocols; if (!isString(options.host) && !isString(options.hostname)) { options.hostname = "::1"; } assert.equal(options.protocol, protocol, "protocol mismatch"); debug("options", options); return new RedirectableRequest(options, callback); } // Executes a GET request, following redirects function get(input, options, callback) { var wrappedRequest = wrappedProtocol.request(input, options, callback); wrappedRequest.end(); return wrappedRequest; } // Expose the properties on the wrapped protocol Object.defineProperties(wrappedProtocol, { request: { value: request, configurable: true, enumerable: true, writable: true }, get: { value: get, configurable: true, enumerable: true, writable: true }, }); }); return exports; } function noop() { /* empty */ } function parseUrl(input) { var parsed; // istanbul ignore else if (useNativeURL) { parsed = new URL(input); } else { // Ensure the URL is valid and absolute parsed = validateUrl(url.parse(input)); if (!isString(parsed.protocol)) { throw new InvalidUrlError({ input }); } } return parsed; } function resolveUrl(relative, base) { // istanbul ignore next return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative)); } function validateUrl(input) { if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) { throw new InvalidUrlError({ input: input.href || input }); } if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) { throw new InvalidUrlError({ input: input.href || input }); } return input; } function spreadUrlObject(urlObject, target) { var spread = target || {}; for (var key of preservedUrlFields) { spread[key] = urlObject[key]; } // Fix IPv6 hostname if (spread.hostname.startsWith("[")) { spread.hostname = spread.hostname.slice(1, -1); } // Ensure port is a number if (spread.port !== "") { spread.port = Number(spread.port); } // Concatenate path spread.path = spread.search ? spread.pathname + spread.search : spread.pathname; return spread; } function removeMatchingHeaders(regex, headers) { var lastValue; for (var header in headers) { if (regex.test(header)) { lastValue = headers[header]; delete headers[header]; } } return (lastValue === null || typeof lastValue === "undefined") ? undefined : String(lastValue).trim(); } function createErrorType(code, message, baseClass) { // Create constructor function CustomError(properties) { // istanbul ignore else if (isFunction(Error.captureStackTrace)) { Error.captureStackTrace(this, this.constructor); } Object.assign(this, properties || {}); this.code = code; this.message = this.cause ? message + ": " + this.cause.message : message; } // Attach constructor and set default properties CustomError.prototype = new (baseClass || Error)(); Object.defineProperties(CustomError.prototype, { constructor: { value: CustomError, enumerable: false, }, name: { value: "Error [" + code + "]", enumerable: false, }, }); return CustomError; } function destroyRequest(request, error) { for (var event of events) { request.removeListener(event, eventHandlers[event]); } request.on("error", noop); request.destroy(error); } function isSubdomain(subdomain, domain) { assert(isString(subdomain) && isString(domain)); var dot = subdomain.length - domain.length - 1; return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); } function isString(value) { return typeof value === "string" || value instanceof String; } function isFunction(value) { return typeof value === "function"; } function isBuffer(value) { return typeof value === "object" && ("length" in value); } function isURL(value) { return URL && value instanceof URL; } // Exports module.exports = wrap({ http: http, https: https }); module.exports.wrap = wrap; /***/ }), /***/ 4963: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var isCallable = __nccwpck_require__(9203); var toStr = Object.prototype.toString; var hasOwnProperty = Object.prototype.hasOwnProperty; /** @type {(arr: A, iterator: (this: This | void, value: A[number], index: number, arr: A) => void, receiver: This | undefined) => void} */ var forEachArray = function forEachArray(array, iterator, receiver) { for (var i = 0, len = array.length; i < len; i++) { if (hasOwnProperty.call(array, i)) { if (receiver == null) { iterator(array[i], i, array); } else { iterator.call(receiver, array[i], i, array); } } } }; /** @type {(string: S, iterator: (this: This | void, value: S[number], index: number, string: S) => void, receiver: This | undefined) => void} */ var forEachString = function forEachString(string, iterator, receiver) { for (var i = 0, len = string.length; i < len; i++) { // no such thing as a sparse string. if (receiver == null) { iterator(string.charAt(i), i, string); } else { iterator.call(receiver, string.charAt(i), i, string); } } }; /** @type {(obj: O, iterator: (this: This | void, value: O[keyof O], index: keyof O, obj: O) => void, receiver: This | undefined) => void} */ var forEachObject = function forEachObject(object, iterator, receiver) { for (var k in object) { if (hasOwnProperty.call(object, k)) { if (receiver == null) { iterator(object[k], k, object); } else { iterator.call(receiver, object[k], k, object); } } } }; /** @type {(x: unknown) => x is readonly unknown[]} */ function isArray(x) { return toStr.call(x) === '[object Array]'; } /** @type {import('.')._internal} */ module.exports = function forEach(list, iterator, thisArg) { if (!isCallable(iterator)) { throw new TypeError('iterator must be a function'); } var receiver; if (arguments.length >= 3) { receiver = thisArg; } if (isArray(list)) { forEachArray(list, iterator, receiver); } else if (typeof list === 'string') { forEachString(list, iterator, receiver); } else { forEachObject(list, iterator, receiver); } }; /***/ }), /***/ 2147: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = (__nccwpck_require__(9896).constants) || __nccwpck_require__(9140) /***/ }), /***/ 9808: /***/ ((module) => { /* eslint no-invalid-this: 1 */ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; var toStr = Object.prototype.toString; var max = Math.max; var funcType = '[object Function]'; var concatty = function concatty(a, b) { var arr = []; for (var i = 0; i < a.length; i += 1) { arr[i] = a[i]; } for (var j = 0; j < b.length; j += 1) { arr[j + a.length] = b[j]; } return arr; }; var slicy = function slicy(arrLike, offset) { var arr = []; for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { arr[j] = arrLike[i]; } return arr; }; var joiny = function (arr, joiner) { var str = ''; for (var i = 0; i < arr.length; i += 1) { str += arr[i]; if (i + 1 < arr.length) { str += joiner; } } return str; }; module.exports = function bind(that) { var target = this; if (typeof target !== 'function' || toStr.apply(target) !== funcType) { throw new TypeError(ERROR_MESSAGE + target); } var args = slicy(arguments, 1); var bound; var binder = function () { if (this instanceof bound) { var result = target.apply( this, concatty(args, arguments) ); if (Object(result) === result) { return result; } return this; } return target.apply( that, concatty(args, arguments) ); }; var boundLength = max(0, target.length - args.length); var boundArgs = []; for (var i = 0; i < boundLength; i++) { boundArgs[i] = '$' + i; } bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder); if (target.prototype) { var Empty = function Empty() {}; Empty.prototype = target.prototype; bound.prototype = new Empty(); Empty.prototype = null; } return bound; }; /***/ }), /***/ 7564: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var implementation = __nccwpck_require__(9808); module.exports = Function.prototype.bind || implementation; /***/ }), /***/ 470: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var undefined; var $Object = __nccwpck_require__(5399); var $Error = __nccwpck_require__(1620); var $EvalError = __nccwpck_require__(3056); var $RangeError = __nccwpck_require__(4585); var $ReferenceError = __nccwpck_require__(6905); var $SyntaxError = __nccwpck_require__(105); var $TypeError = __nccwpck_require__(3314); var $URIError = __nccwpck_require__(2578); var abs = __nccwpck_require__(5641); var floor = __nccwpck_require__(6171); var max = __nccwpck_require__(7147); var min = __nccwpck_require__(1017); var pow = __nccwpck_require__(6947); var round = __nccwpck_require__(2621); var sign = __nccwpck_require__(156); var $Function = Function; // eslint-disable-next-line consistent-return var getEvalledConstructor = function (expressionSyntax) { try { return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); } catch (e) {} }; var $gOPD = __nccwpck_require__(3170); var $defineProperty = __nccwpck_require__(9094); var throwTypeError = function () { throw new $TypeError(); }; var ThrowTypeError = $gOPD ? (function () { try { // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties arguments.callee; // IE 8 does not throw here return throwTypeError; } catch (calleeThrows) { try { // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') return $gOPD(arguments, 'callee').get; } catch (gOPDthrows) { return throwTypeError; } } }()) : throwTypeError; var hasSymbols = __nccwpck_require__(3336)(); var getProto = __nccwpck_require__(1967); var $ObjectGPO = __nccwpck_require__(1311); var $ReflectGPO = __nccwpck_require__(8681); var $apply = __nccwpck_require__(3945); var $call = __nccwpck_require__(8093); var needsEval = {}; var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array); var INTRINSICS = { __proto__: null, '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, '%Array%': Array, '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined, '%AsyncFromSyncIteratorPrototype%': undefined, '%AsyncFunction%': needsEval, '%AsyncGenerator%': needsEval, '%AsyncGeneratorFunction%': needsEval, '%AsyncIteratorPrototype%': needsEval, '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array, '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array, '%Boolean%': Boolean, '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, '%Date%': Date, '%decodeURI%': decodeURI, '%decodeURIComponent%': decodeURIComponent, '%encodeURI%': encodeURI, '%encodeURIComponent%': encodeURIComponent, '%Error%': $Error, '%eval%': eval, // eslint-disable-line no-eval '%EvalError%': $EvalError, '%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array, '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, '%Function%': $Function, '%GeneratorFunction%': needsEval, '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, '%isFinite%': isFinite, '%isNaN%': isNaN, '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined, '%JSON%': typeof JSON === 'object' ? JSON : undefined, '%Map%': typeof Map === 'undefined' ? undefined : Map, '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()), '%Math%': Math, '%Number%': Number, '%Object%': $Object, '%Object.getOwnPropertyDescriptor%': $gOPD, '%parseFloat%': parseFloat, '%parseInt%': parseInt, '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, '%RangeError%': $RangeError, '%ReferenceError%': $ReferenceError, '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, '%RegExp%': RegExp, '%Set%': typeof Set === 'undefined' ? undefined : Set, '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()), '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, '%String%': String, '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined, '%Symbol%': hasSymbols ? Symbol : undefined, '%SyntaxError%': $SyntaxError, '%ThrowTypeError%': ThrowTypeError, '%TypedArray%': TypedArray, '%TypeError%': $TypeError, '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, '%URIError%': $URIError, '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, '%Function.prototype.call%': $call, '%Function.prototype.apply%': $apply, '%Object.defineProperty%': $defineProperty, '%Object.getPrototypeOf%': $ObjectGPO, '%Math.abs%': abs, '%Math.floor%': floor, '%Math.max%': max, '%Math.min%': min, '%Math.pow%': pow, '%Math.round%': round, '%Math.sign%': sign, '%Reflect.getPrototypeOf%': $ReflectGPO }; if (getProto) { try { null.error; // eslint-disable-line no-unused-expressions } catch (e) { // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229 var errorProto = getProto(getProto(e)); INTRINSICS['%Error.prototype%'] = errorProto; } } var doEval = function doEval(name) { var value; if (name === '%AsyncFunction%') { value = getEvalledConstructor('async function () {}'); } else if (name === '%GeneratorFunction%') { value = getEvalledConstructor('function* () {}'); } else if (name === '%AsyncGeneratorFunction%') { value = getEvalledConstructor('async function* () {}'); } else if (name === '%AsyncGenerator%') { var fn = doEval('%AsyncGeneratorFunction%'); if (fn) { value = fn.prototype; } } else if (name === '%AsyncIteratorPrototype%') { var gen = doEval('%AsyncGenerator%'); if (gen && getProto) { value = getProto(gen.prototype); } } INTRINSICS[name] = value; return value; }; var LEGACY_ALIASES = { __proto__: null, '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], '%ArrayPrototype%': ['Array', 'prototype'], '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], '%ArrayProto_values%': ['Array', 'prototype', 'values'], '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], '%BooleanPrototype%': ['Boolean', 'prototype'], '%DataViewPrototype%': ['DataView', 'prototype'], '%DatePrototype%': ['Date', 'prototype'], '%ErrorPrototype%': ['Error', 'prototype'], '%EvalErrorPrototype%': ['EvalError', 'prototype'], '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], '%FunctionPrototype%': ['Function', 'prototype'], '%Generator%': ['GeneratorFunction', 'prototype'], '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], '%JSONParse%': ['JSON', 'parse'], '%JSONStringify%': ['JSON', 'stringify'], '%MapPrototype%': ['Map', 'prototype'], '%NumberPrototype%': ['Number', 'prototype'], '%ObjectPrototype%': ['Object', 'prototype'], '%ObjProto_toString%': ['Object', 'prototype', 'toString'], '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], '%PromisePrototype%': ['Promise', 'prototype'], '%PromiseProto_then%': ['Promise', 'prototype', 'then'], '%Promise_all%': ['Promise', 'all'], '%Promise_reject%': ['Promise', 'reject'], '%Promise_resolve%': ['Promise', 'resolve'], '%RangeErrorPrototype%': ['RangeError', 'prototype'], '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], '%RegExpPrototype%': ['RegExp', 'prototype'], '%SetPrototype%': ['Set', 'prototype'], '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], '%StringPrototype%': ['String', 'prototype'], '%SymbolPrototype%': ['Symbol', 'prototype'], '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], '%TypedArrayPrototype%': ['TypedArray', 'prototype'], '%TypeErrorPrototype%': ['TypeError', 'prototype'], '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], '%URIErrorPrototype%': ['URIError', 'prototype'], '%WeakMapPrototype%': ['WeakMap', 'prototype'], '%WeakSetPrototype%': ['WeakSet', 'prototype'] }; var bind = __nccwpck_require__(7564); var hasOwn = __nccwpck_require__(4076); var $concat = bind.call($call, Array.prototype.concat); var $spliceApply = bind.call($apply, Array.prototype.splice); var $replace = bind.call($call, String.prototype.replace); var $strSlice = bind.call($call, String.prototype.slice); var $exec = bind.call($call, RegExp.prototype.exec); /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ var stringToPath = function stringToPath(string) { var first = $strSlice(string, 0, 1); var last = $strSlice(string, -1); if (first === '%' && last !== '%') { throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); } else if (last === '%' && first !== '%') { throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); } var result = []; $replace(string, rePropName, function (match, number, quote, subString) { result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; }); return result; }; /* end adaptation */ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { var intrinsicName = name; var alias; if (hasOwn(LEGACY_ALIASES, intrinsicName)) { alias = LEGACY_ALIASES[intrinsicName]; intrinsicName = '%' + alias[0] + '%'; } if (hasOwn(INTRINSICS, intrinsicName)) { var value = INTRINSICS[intrinsicName]; if (value === needsEval) { value = doEval(intrinsicName); } if (typeof value === 'undefined' && !allowMissing) { throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); } return { alias: alias, name: intrinsicName, value: value }; } throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); }; module.exports = function GetIntrinsic(name, allowMissing) { if (typeof name !== 'string' || name.length === 0) { throw new $TypeError('intrinsic name must be a non-empty string'); } if (arguments.length > 1 && typeof allowMissing !== 'boolean') { throw new $TypeError('"allowMissing" argument must be a boolean'); } if ($exec(/^%?[^%]*%?$/, name) === null) { throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); } var parts = stringToPath(name); var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); var intrinsicRealName = intrinsic.name; var value = intrinsic.value; var skipFurtherCaching = false; var alias = intrinsic.alias; if (alias) { intrinsicBaseName = alias[0]; $spliceApply(parts, $concat([0, 1], alias)); } for (var i = 1, isOwn = true; i < parts.length; i += 1) { var part = parts[i]; var first = $strSlice(part, 0, 1); var last = $strSlice(part, -1); if ( ( (first === '"' || first === "'" || first === '`') || (last === '"' || last === "'" || last === '`') ) && first !== last ) { throw new $SyntaxError('property names with quotes must have matching quotes'); } if (part === 'constructor' || !isOwn) { skipFurtherCaching = true; } intrinsicBaseName += '.' + part; intrinsicRealName = '%' + intrinsicBaseName + '%'; if (hasOwn(INTRINSICS, intrinsicRealName)) { value = INTRINSICS[intrinsicRealName]; } else if (value != null) { if (!(part in value)) { if (!allowMissing) { throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); } return void undefined; } if ($gOPD && (i + 1) >= parts.length) { var desc = $gOPD(value, part); isOwn = !!desc; // By convention, when a data property is converted to an accessor // property to emulate a data property that does not suffer from // the override mistake, that accessor's getter is marked with // an `originalValue` property. Here, when we detect this, we // uphold the illusion by pretending to see that original data // property, i.e., returning the value rather than the getter // itself. if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { value = desc.get; } else { value = value[part]; } } else { isOwn = hasOwn(value, part); value = value[part]; } if (isOwn && !skipFurtherCaching) { INTRINSICS[intrinsicRealName] = value; } } } return value; }; /***/ }), /***/ 1311: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var $Object = __nccwpck_require__(5399); /** @type {import('./Object.getPrototypeOf')} */ module.exports = $Object.getPrototypeOf || null; /***/ }), /***/ 8681: /***/ ((module) => { /** @type {import('./Reflect.getPrototypeOf')} */ module.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null; /***/ }), /***/ 1967: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var reflectGetProto = __nccwpck_require__(8681); var originalGetProto = __nccwpck_require__(1311); var getDunderProto = __nccwpck_require__(6669); /** @type {import('.')} */ module.exports = reflectGetProto ? function getProto(O) { // @ts-expect-error TS can't narrow inside a closure, for some reason return reflectGetProto(O); } : originalGetProto ? function getProto(O) { if (!O || (typeof O !== 'object' && typeof O !== 'function')) { throw new TypeError('getProto: not an object'); } // @ts-expect-error TS can't narrow inside a closure, for some reason return originalGetProto(O); } : getDunderProto ? function getProto(O) { // @ts-expect-error TS can't narrow inside a closure, for some reason return getDunderProto(O); } : null; /***/ }), /***/ 7070: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var PassThrough = (__nccwpck_require__(2203).PassThrough); var objectAssign = __nccwpck_require__(4615); module.exports = function (opts) { opts = objectAssign({}, opts); var array = opts.array; var encoding = opts.encoding; var buffer = encoding === 'buffer'; var objectMode = false; if (array) { objectMode = !(encoding || buffer); } else { encoding = encoding || 'utf8'; } if (buffer) { encoding = null; } var len = 0; var ret = []; var stream = new PassThrough({objectMode: objectMode}); if (encoding) { stream.setEncoding(encoding); } stream.on('data', function (chunk) { ret.push(chunk); if (objectMode) { len = ret.length; } else { len += chunk.length; } }); stream.getBufferedValue = function () { if (array) { return ret; } return buffer ? Buffer.concat(ret, len) : ret.join(''); }; stream.getBufferedLength = function () { return len; }; return stream; }; /***/ }), /***/ 6771: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var Promise = __nccwpck_require__(3590); var objectAssign = __nccwpck_require__(4615); var bufferStream = __nccwpck_require__(7070); function getStream(inputStream, opts) { if (!inputStream) { return Promise.reject(new Error('Expected a stream')); } opts = objectAssign({maxBuffer: Infinity}, opts); var maxBuffer = opts.maxBuffer; var stream; var clean; var p = new Promise(function (resolve, reject) { stream = bufferStream(opts); inputStream.once('error', error); inputStream.pipe(stream); stream.on('data', function () { if (stream.getBufferedLength() > maxBuffer) { reject(new Error('maxBuffer exceeded')); } }); stream.once('error', error); stream.on('end', resolve); clean = function () { // some streams doesn't implement the stream.Readable interface correctly if (inputStream.unpipe) { inputStream.unpipe(stream); } }; function error(err) { if (err) { // null check err.bufferedData = stream.getBufferedValue(); } reject(err); } }); p.then(clean, clean); return p.then(function () { return stream.getBufferedValue(); }); } module.exports = getStream; module.exports.buffer = function (stream, opts) { return getStream(stream, objectAssign({}, opts, {encoding: 'buffer'})); }; module.exports.array = function (stream, opts) { return getStream(stream, objectAssign({}, opts, {array: true})); }; /***/ }), /***/ 8505: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var isGlob = __nccwpck_require__(1925); var pathPosixDirname = (__nccwpck_require__(6928).posix).dirname; var isWin32 = (__nccwpck_require__(857).platform)() === 'win32'; var slash = '/'; var backslash = /\\/g; var enclosure = /[\{\[].*[\}\]]$/; var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; /** * @param {string} str * @param {Object} opts * @param {boolean} [opts.flipBackslashes=true] * @returns {string} */ module.exports = function globParent(str, opts) { var options = Object.assign({ flipBackslashes: true }, opts); // flip windows path separators if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { str = str.replace(backslash, slash); } // special case for strings ending in enclosure containing path separator if (enclosure.test(str)) { str += slash; } // preserves full path in case of trailing path separator str += 'a'; // remove path parts that are globby do { str = pathPosixDirname(str); } while (isGlob(str) || globby.test(str)); // remove escape chars and return result return str.replace(escaped, '$1'); }; /***/ }), /***/ 1174: /***/ ((module) => { /** @type {import('./gOPD')} */ module.exports = Object.getOwnPropertyDescriptor; /***/ }), /***/ 3170: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /** @type {import('.')} */ var $gOPD = __nccwpck_require__(1174); if ($gOPD) { try { $gOPD([], 'length'); } catch (e) { // IE 8 has a broken gOPD $gOPD = null; } } module.exports = $gOPD; /***/ }), /***/ 3964: /***/ ((module) => { module.exports = clone var getPrototypeOf = Object.getPrototypeOf || function (obj) { return obj.__proto__ } function clone (obj) { if (obj === null || typeof obj !== 'object') return obj if (obj instanceof Object) var copy = { __proto__: getPrototypeOf(obj) } else var copy = Object.create(null) Object.getOwnPropertyNames(obj).forEach(function (key) { Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) }) return copy } /***/ }), /***/ 5744: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var fs = __nccwpck_require__(9896) var polyfills = __nccwpck_require__(3501) var legacy = __nccwpck_require__(2270) var clone = __nccwpck_require__(3964) var util = __nccwpck_require__(9023) /* istanbul ignore next - node 0.x polyfill */ var gracefulQueue var previousSymbol /* istanbul ignore else - node 0.x polyfill */ if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { gracefulQueue = Symbol.for('graceful-fs.queue') // This is used in testing by future versions previousSymbol = Symbol.for('graceful-fs.previous') } else { gracefulQueue = '___graceful-fs.queue' previousSymbol = '___graceful-fs.previous' } function noop () {} function publishQueue(context, queue) { Object.defineProperty(context, gracefulQueue, { get: function() { return queue } }) } var debug = noop if (util.debuglog) debug = util.debuglog('gfs4') else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) debug = function() { var m = util.format.apply(util, arguments) m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') console.error(m) } // Once time initialization if (!fs[gracefulQueue]) { // This queue can be shared by multiple loaded instances var queue = global[gracefulQueue] || [] publishQueue(fs, queue) // Patch fs.close/closeSync to shared queue version, because we need // to retry() whenever a close happens *anywhere* in the program. // This is essential when multiple graceful-fs instances are // in play at the same time. fs.close = (function (fs$close) { function close (fd, cb) { return fs$close.call(fs, fd, function (err) { // This function uses the graceful-fs shared queue if (!err) { resetQueue() } if (typeof cb === 'function') cb.apply(this, arguments) }) } Object.defineProperty(close, previousSymbol, { value: fs$close }) return close })(fs.close) fs.closeSync = (function (fs$closeSync) { function closeSync (fd) { // This function uses the graceful-fs shared queue fs$closeSync.apply(fs, arguments) resetQueue() } Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync }) return closeSync })(fs.closeSync) if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { process.on('exit', function() { debug(fs[gracefulQueue]) __nccwpck_require__(2613).equal(fs[gracefulQueue].length, 0) }) } } if (!global[gracefulQueue]) { publishQueue(global, fs[gracefulQueue]); } module.exports = patch(clone(fs)) if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { module.exports = patch(fs) fs.__patched = true; } function patch (fs) { // Everything that references the open() function needs to be in here polyfills(fs) fs.gracefulify = patch fs.createReadStream = createReadStream fs.createWriteStream = createWriteStream var fs$readFile = fs.readFile fs.readFile = readFile function readFile (path, options, cb) { if (typeof options === 'function') cb = options, options = null return go$readFile(path, options, cb) function go$readFile (path, options, cb, startTime) { return fs$readFile(path, options, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } var fs$writeFile = fs.writeFile fs.writeFile = writeFile function writeFile (path, data, options, cb) { if (typeof options === 'function') cb = options, options = null return go$writeFile(path, data, options, cb) function go$writeFile (path, data, options, cb, startTime) { return fs$writeFile(path, data, options, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } var fs$appendFile = fs.appendFile if (fs$appendFile) fs.appendFile = appendFile function appendFile (path, data, options, cb) { if (typeof options === 'function') cb = options, options = null return go$appendFile(path, data, options, cb) function go$appendFile (path, data, options, cb, startTime) { return fs$appendFile(path, data, options, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } var fs$copyFile = fs.copyFile if (fs$copyFile) fs.copyFile = copyFile function copyFile (src, dest, flags, cb) { if (typeof flags === 'function') { cb = flags flags = 0 } return go$copyFile(src, dest, flags, cb) function go$copyFile (src, dest, flags, cb, startTime) { return fs$copyFile(src, dest, flags, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } var fs$readdir = fs.readdir fs.readdir = readdir var noReaddirOptionVersions = /^v[0-5]\./ function readdir (path, options, cb) { if (typeof options === 'function') cb = options, options = null var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir (path, options, cb, startTime) { return fs$readdir(path, fs$readdirCallback( path, options, cb, startTime )) } : function go$readdir (path, options, cb, startTime) { return fs$readdir(path, options, fs$readdirCallback( path, options, cb, startTime )) } return go$readdir(path, options, cb) function fs$readdirCallback (path, options, cb, startTime) { return function (err, files) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([ go$readdir, [path, options, cb], err, startTime || Date.now(), Date.now() ]) else { if (files && files.sort) files.sort() if (typeof cb === 'function') cb.call(this, err, files) } } } } if (process.version.substr(0, 4) === 'v0.8') { var legStreams = legacy(fs) ReadStream = legStreams.ReadStream WriteStream = legStreams.WriteStream } var fs$ReadStream = fs.ReadStream if (fs$ReadStream) { ReadStream.prototype = Object.create(fs$ReadStream.prototype) ReadStream.prototype.open = ReadStream$open } var fs$WriteStream = fs.WriteStream if (fs$WriteStream) { WriteStream.prototype = Object.create(fs$WriteStream.prototype) WriteStream.prototype.open = WriteStream$open } Object.defineProperty(fs, 'ReadStream', { get: function () { return ReadStream }, set: function (val) { ReadStream = val }, enumerable: true, configurable: true }) Object.defineProperty(fs, 'WriteStream', { get: function () { return WriteStream }, set: function (val) { WriteStream = val }, enumerable: true, configurable: true }) // legacy names var FileReadStream = ReadStream Object.defineProperty(fs, 'FileReadStream', { get: function () { return FileReadStream }, set: function (val) { FileReadStream = val }, enumerable: true, configurable: true }) var FileWriteStream = WriteStream Object.defineProperty(fs, 'FileWriteStream', { get: function () { return FileWriteStream }, set: function (val) { FileWriteStream = val }, enumerable: true, configurable: true }) function ReadStream (path, options) { if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this else return ReadStream.apply(Object.create(ReadStream.prototype), arguments) } function ReadStream$open () { var that = this open(that.path, that.flags, that.mode, function (err, fd) { if (err) { if (that.autoClose) that.destroy() that.emit('error', err) } else { that.fd = fd that.emit('open', fd) that.read() } }) } function WriteStream (path, options) { if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this else return WriteStream.apply(Object.create(WriteStream.prototype), arguments) } function WriteStream$open () { var that = this open(that.path, that.flags, that.mode, function (err, fd) { if (err) { that.destroy() that.emit('error', err) } else { that.fd = fd that.emit('open', fd) } }) } function createReadStream (path, options) { return new fs.ReadStream(path, options) } function createWriteStream (path, options) { return new fs.WriteStream(path, options) } var fs$open = fs.open fs.open = open function open (path, flags, mode, cb) { if (typeof mode === 'function') cb = mode, mode = null return go$open(path, flags, mode, cb) function go$open (path, flags, mode, cb, startTime) { return fs$open(path, flags, mode, function (err, fd) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } return fs } function enqueue (elem) { debug('ENQUEUE', elem[0].name, elem[1]) fs[gracefulQueue].push(elem) retry() } // keep track of the timeout between retry() calls var retryTimer // reset the startTime and lastTime to now // this resets the start of the 60 second overall timeout as well as the // delay between attempts so that we'll retry these jobs sooner function resetQueue () { var now = Date.now() for (var i = 0; i < fs[gracefulQueue].length; ++i) { // entries that are only a length of 2 are from an older version, don't // bother modifying those since they'll be retried anyway. if (fs[gracefulQueue][i].length > 2) { fs[gracefulQueue][i][3] = now // startTime fs[gracefulQueue][i][4] = now // lastTime } } // call retry to make sure we're actively processing the queue retry() } function retry () { // clear the timer and remove it to help prevent unintended concurrency clearTimeout(retryTimer) retryTimer = undefined if (fs[gracefulQueue].length === 0) return var elem = fs[gracefulQueue].shift() var fn = elem[0] var args = elem[1] // these items may be unset if they were added by an older graceful-fs var err = elem[2] var startTime = elem[3] var lastTime = elem[4] // if we don't have a startTime we have no way of knowing if we've waited // long enough, so go ahead and retry this item now if (startTime === undefined) { debug('RETRY', fn.name, args) fn.apply(null, args) } else if (Date.now() - startTime >= 60000) { // it's been more than 60 seconds total, bail now debug('TIMEOUT', fn.name, args) var cb = args.pop() if (typeof cb === 'function') cb.call(null, err) } else { // the amount of time between the last attempt and right now var sinceAttempt = Date.now() - lastTime // the amount of time between when we first tried, and when we last tried // rounded up to at least 1 var sinceStart = Math.max(lastTime - startTime, 1) // backoff. wait longer than the total time we've been retrying, but only // up to a maximum of 100ms var desiredDelay = Math.min(sinceStart * 1.2, 100) // it's been long enough since the last retry, do it again if (sinceAttempt >= desiredDelay) { debug('RETRY', fn.name, args) fn.apply(null, args.concat([startTime])) } else { // if we can't do this job yet, push it to the end of the queue // and let the next iteration check again fs[gracefulQueue].push(elem) } } // schedule our next run if one isn't already scheduled if (retryTimer === undefined) { retryTimer = setTimeout(retry, 0) } } /***/ }), /***/ 2270: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var Stream = (__nccwpck_require__(2203).Stream) module.exports = legacy function legacy (fs) { return { ReadStream: ReadStream, WriteStream: WriteStream } function ReadStream (path, options) { if (!(this instanceof ReadStream)) return new ReadStream(path, options); Stream.call(this); var self = this; this.path = path; this.fd = null; this.readable = true; this.paused = false; this.flags = 'r'; this.mode = 438; /*=0666*/ this.bufferSize = 64 * 1024; options = options || {}; // Mixin options into this var keys = Object.keys(options); for (var index = 0, length = keys.length; index < length; index++) { var key = keys[index]; this[key] = options[key]; } if (this.encoding) this.setEncoding(this.encoding); if (this.start !== undefined) { if ('number' !== typeof this.start) { throw TypeError('start must be a Number'); } if (this.end === undefined) { this.end = Infinity; } else if ('number' !== typeof this.end) { throw TypeError('end must be a Number'); } if (this.start > this.end) { throw new Error('start must be <= end'); } this.pos = this.start; } if (this.fd !== null) { process.nextTick(function() { self._read(); }); return; } fs.open(this.path, this.flags, this.mode, function (err, fd) { if (err) { self.emit('error', err); self.readable = false; return; } self.fd = fd; self.emit('open', fd); self._read(); }) } function WriteStream (path, options) { if (!(this instanceof WriteStream)) return new WriteStream(path, options); Stream.call(this); this.path = path; this.fd = null; this.writable = true; this.flags = 'w'; this.encoding = 'binary'; this.mode = 438; /*=0666*/ this.bytesWritten = 0; options = options || {}; // Mixin options into this var keys = Object.keys(options); for (var index = 0, length = keys.length; index < length; index++) { var key = keys[index]; this[key] = options[key]; } if (this.start !== undefined) { if ('number' !== typeof this.start) { throw TypeError('start must be a Number'); } if (this.start < 0) { throw new Error('start must be >= zero'); } this.pos = this.start; } this.busy = false; this._queue = []; if (this.fd === null) { this._open = fs.open; this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); this.flush(); } } } /***/ }), /***/ 3501: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var constants = __nccwpck_require__(9140) var origCwd = process.cwd var cwd = null var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform process.cwd = function() { if (!cwd) cwd = origCwd.call(process) return cwd } try { process.cwd() } catch (er) {} // This check is needed until node.js 12 is required if (typeof process.chdir === 'function') { var chdir = process.chdir process.chdir = function (d) { cwd = null chdir.call(process, d) } if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir) } module.exports = patch function patch (fs) { // (re-)implement some things that are known busted or missing. // lchmod, broken prior to 0.6.2 // back-port the fix here. if (constants.hasOwnProperty('O_SYMLINK') && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { patchLchmod(fs) } // lutimes implementation, or no-op if (!fs.lutimes) { patchLutimes(fs) } // https://github.com/isaacs/node-graceful-fs/issues/4 // Chown should not fail on einval or eperm if non-root. // It should not fail on enosys ever, as this just indicates // that a fs doesn't support the intended operation. fs.chown = chownFix(fs.chown) fs.fchown = chownFix(fs.fchown) fs.lchown = chownFix(fs.lchown) fs.chmod = chmodFix(fs.chmod) fs.fchmod = chmodFix(fs.fchmod) fs.lchmod = chmodFix(fs.lchmod) fs.chownSync = chownFixSync(fs.chownSync) fs.fchownSync = chownFixSync(fs.fchownSync) fs.lchownSync = chownFixSync(fs.lchownSync) fs.chmodSync = chmodFixSync(fs.chmodSync) fs.fchmodSync = chmodFixSync(fs.fchmodSync) fs.lchmodSync = chmodFixSync(fs.lchmodSync) fs.stat = statFix(fs.stat) fs.fstat = statFix(fs.fstat) fs.lstat = statFix(fs.lstat) fs.statSync = statFixSync(fs.statSync) fs.fstatSync = statFixSync(fs.fstatSync) fs.lstatSync = statFixSync(fs.lstatSync) // if lchmod/lchown do not exist, then make them no-ops if (fs.chmod && !fs.lchmod) { fs.lchmod = function (path, mode, cb) { if (cb) process.nextTick(cb) } fs.lchmodSync = function () {} } if (fs.chown && !fs.lchown) { fs.lchown = function (path, uid, gid, cb) { if (cb) process.nextTick(cb) } fs.lchownSync = function () {} } // on Windows, A/V software can lock the directory, causing this // to fail with an EACCES or EPERM if the directory contains newly // created files. Try again on failure, for up to 60 seconds. // Set the timeout this long because some Windows Anti-Virus, such as Parity // bit9, may lock files for up to a minute, causing npm package install // failures. Also, take care to yield the scheduler. Windows scheduling gives // CPU to a busy looping process, which can cause the program causing the lock // contention to be starved of CPU by node, so the contention doesn't resolve. if (platform === "win32") { fs.rename = typeof fs.rename !== 'function' ? fs.rename : (function (fs$rename) { function rename (from, to, cb) { var start = Date.now() var backoff = 0; fs$rename(from, to, function CB (er) { if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 60000) { setTimeout(function() { fs.stat(to, function (stater, st) { if (stater && stater.code === "ENOENT") fs$rename(from, to, CB); else cb(er) }) }, backoff) if (backoff < 100) backoff += 10; return; } if (cb) cb(er) }) } if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename) return rename })(fs.rename) } // if read() returns EAGAIN, then just try it again. fs.read = typeof fs.read !== 'function' ? fs.read : (function (fs$read) { function read (fd, buffer, offset, length, position, callback_) { var callback if (callback_ && typeof callback_ === 'function') { var eagCounter = 0 callback = function (er, _, __) { if (er && er.code === 'EAGAIN' && eagCounter < 10) { eagCounter ++ return fs$read.call(fs, fd, buffer, offset, length, position, callback) } callback_.apply(this, arguments) } } return fs$read.call(fs, fd, buffer, offset, length, position, callback) } // This ensures `util.promisify` works as it does for native `fs.read`. if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) return read })(fs.read) fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync : (function (fs$readSync) { return function (fd, buffer, offset, length, position) { var eagCounter = 0 while (true) { try { return fs$readSync.call(fs, fd, buffer, offset, length, position) } catch (er) { if (er.code === 'EAGAIN' && eagCounter < 10) { eagCounter ++ continue } throw er } } }})(fs.readSync) function patchLchmod (fs) { fs.lchmod = function (path, mode, callback) { fs.open( path , constants.O_WRONLY | constants.O_SYMLINK , mode , function (err, fd) { if (err) { if (callback) callback(err) return } // prefer to return the chmod error, if one occurs, // but still try to close, and report closing errors if they occur. fs.fchmod(fd, mode, function (err) { fs.close(fd, function(err2) { if (callback) callback(err || err2) }) }) }) } fs.lchmodSync = function (path, mode) { var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) // prefer to return the chmod error, if one occurs, // but still try to close, and report closing errors if they occur. var threw = true var ret try { ret = fs.fchmodSync(fd, mode) threw = false } finally { if (threw) { try { fs.closeSync(fd) } catch (er) {} } else { fs.closeSync(fd) } } return ret } } function patchLutimes (fs) { if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) { fs.lutimes = function (path, at, mt, cb) { fs.open(path, constants.O_SYMLINK, function (er, fd) { if (er) { if (cb) cb(er) return } fs.futimes(fd, at, mt, function (er) { fs.close(fd, function (er2) { if (cb) cb(er || er2) }) }) }) } fs.lutimesSync = function (path, at, mt) { var fd = fs.openSync(path, constants.O_SYMLINK) var ret var threw = true try { ret = fs.futimesSync(fd, at, mt) threw = false } finally { if (threw) { try { fs.closeSync(fd) } catch (er) {} } else { fs.closeSync(fd) } } return ret } } else if (fs.futimes) { fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } fs.lutimesSync = function () {} } } function chmodFix (orig) { if (!orig) return orig return function (target, mode, cb) { return orig.call(fs, target, mode, function (er) { if (chownErOk(er)) er = null if (cb) cb.apply(this, arguments) }) } } function chmodFixSync (orig) { if (!orig) return orig return function (target, mode) { try { return orig.call(fs, target, mode) } catch (er) { if (!chownErOk(er)) throw er } } } function chownFix (orig) { if (!orig) return orig return function (target, uid, gid, cb) { return orig.call(fs, target, uid, gid, function (er) { if (chownErOk(er)) er = null if (cb) cb.apply(this, arguments) }) } } function chownFixSync (orig) { if (!orig) return orig return function (target, uid, gid) { try { return orig.call(fs, target, uid, gid) } catch (er) { if (!chownErOk(er)) throw er } } } function statFix (orig) { if (!orig) return orig // Older versions of Node erroneously returned signed integers for // uid + gid. return function (target, options, cb) { if (typeof options === 'function') { cb = options options = null } function callback (er, stats) { if (stats) { if (stats.uid < 0) stats.uid += 0x100000000 if (stats.gid < 0) stats.gid += 0x100000000 } if (cb) cb.apply(this, arguments) } return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback) } } function statFixSync (orig) { if (!orig) return orig // Older versions of Node erroneously returned signed integers for // uid + gid. return function (target, options) { var stats = options ? orig.call(fs, target, options) : orig.call(fs, target) if (stats) { if (stats.uid < 0) stats.uid += 0x100000000 if (stats.gid < 0) stats.gid += 0x100000000 } return stats; } } // ENOSYS means that the fs doesn't support the op. Just ignore // that, because it doesn't matter. // // if there's no getuid, or if getuid() is something other // than 0, and the error is EINVAL or EPERM, then just ignore // it. // // This specific case is a silent failure in cp, install, tar, // and most other unix tools that manage permissions. // // When running as root, or if other types of errors are // encountered, then it's strict. function chownErOk (er) { if (!er) return true if (er.code === "ENOSYS") return true var nonroot = !process.getuid || process.getuid() !== 0 if (nonroot) { if (er.code === "EINVAL" || er.code === "EPERM") return true } return false } } /***/ }), /***/ 497: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var $defineProperty = __nccwpck_require__(9094); var hasPropertyDescriptors = function hasPropertyDescriptors() { return !!$defineProperty; }; hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { // node v0.6 has a bug where array lengths can be Set but not Defined if (!$defineProperty) { return null; } try { return $defineProperty([], 'length', { value: 1 }).length !== 1; } catch (e) { // In Firefox 4-22, defining length on an array throws an exception. return true; } }; module.exports = hasPropertyDescriptors; /***/ }), /***/ 3336: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var origSymbol = typeof Symbol !== 'undefined' && Symbol; var hasSymbolSham = __nccwpck_require__(1114); /** @type {import('.')} */ module.exports = function hasNativeSymbols() { if (typeof origSymbol !== 'function') { return false; } if (typeof Symbol !== 'function') { return false; } if (typeof origSymbol('foo') !== 'symbol') { return false; } if (typeof Symbol('bar') !== 'symbol') { return false; } return hasSymbolSham(); }; /***/ }), /***/ 1114: /***/ ((module) => { /** @type {import('./shams')} */ /* eslint complexity: [2, 18], max-statements: [2, 33] */ module.exports = function hasSymbols() { if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } if (typeof Symbol.iterator === 'symbol') { return true; } /** @type {{ [k in symbol]?: unknown }} */ var obj = {}; var sym = Symbol('test'); var symObj = Object(sym); if (typeof sym === 'string') { return false; } if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } // temp disabled per https://github.com/ljharb/object.assign/issues/17 // if (sym instanceof Symbol) { return false; } // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 // if (!(symObj instanceof Symbol)) { return false; } // if (typeof Symbol.prototype.toString !== 'function') { return false; } // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } var symVal = 42; obj[sym] = symVal; for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } var syms = Object.getOwnPropertySymbols(obj); if (syms.length !== 1 || syms[0] !== sym) { return false; } if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } if (typeof Object.getOwnPropertyDescriptor === 'function') { // eslint-disable-next-line no-extra-parens var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym)); if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } } return true; }; /***/ }), /***/ 5479: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var hasSymbols = __nccwpck_require__(1114); /** @type {import('.')} */ module.exports = function hasToStringTagShams() { return hasSymbols() && !!Symbol.toStringTag; }; /***/ }), /***/ 4076: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var call = Function.prototype.call; var $hasOwn = Object.prototype.hasOwnProperty; var bind = __nccwpck_require__(7564); /** @type {import('.')} */ module.exports = bind.call(call, $hasOwn); /***/ }), /***/ 9598: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { try { var util = __nccwpck_require__(9023); /* istanbul ignore next */ if (typeof util.inherits !== 'function') throw ''; module.exports = util.inherits; } catch (e) { /* istanbul ignore next */ module.exports = __nccwpck_require__(6589); } /***/ }), /***/ 6589: /***/ ((module) => { if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }) } }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor var TempCtor = function () {} TempCtor.prototype = superCtor.prototype ctor.prototype = new TempCtor() ctor.prototype.constructor = ctor } } } /***/ }), /***/ 3950: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const path = __nccwpck_require__(6928); const binaryExtensions = __nccwpck_require__(3242); const extensions = new Set(binaryExtensions); module.exports = filePath => extensions.has(path.extname(filePath).slice(1).toLowerCase()); /***/ }), /***/ 9203: /***/ ((module) => { var fnToStr = Function.prototype.toString; var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply; var badArrayLike; var isCallableMarker; if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') { try { badArrayLike = Object.defineProperty({}, 'length', { get: function () { throw isCallableMarker; } }); isCallableMarker = {}; // eslint-disable-next-line no-throw-literal reflectApply(function () { throw 42; }, null, badArrayLike); } catch (_) { if (_ !== isCallableMarker) { reflectApply = null; } } } else { reflectApply = null; } var constructorRegex = /^\s*class\b/; var isES6ClassFn = function isES6ClassFunction(value) { try { var fnStr = fnToStr.call(value); return constructorRegex.test(fnStr); } catch (e) { return false; // not a function } }; var tryFunctionObject = function tryFunctionToStr(value) { try { if (isES6ClassFn(value)) { return false; } fnToStr.call(value); return true; } catch (e) { return false; } }; var toStr = Object.prototype.toString; var objectClass = '[object Object]'; var fnClass = '[object Function]'; var genClass = '[object GeneratorFunction]'; var ddaClass = '[object HTMLAllCollection]'; // IE 11 var ddaClass2 = '[object HTML document.all class]'; var ddaClass3 = '[object HTMLCollection]'; // IE 9-10 var hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag` var isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing var isDDA = function isDocumentDotAll() { return false; }; if (typeof document === 'object') { // Firefox 3 canonicalizes DDA to undefined when it's not accessed directly var all = document.all; if (toStr.call(all) === toStr.call(document.all)) { isDDA = function isDocumentDotAll(value) { /* globals document: false */ // in IE 6-8, typeof document.all is "object" and it's truthy if ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) { try { var str = toStr.call(value); return ( str === ddaClass || str === ddaClass2 || str === ddaClass3 // opera 12.16 || str === objectClass // IE 6-8 ) && value('') == null; // eslint-disable-line eqeqeq } catch (e) { /**/ } } return false; }; } } module.exports = reflectApply ? function isCallable(value) { if (isDDA(value)) { return true; } if (!value) { return false; } if (typeof value !== 'function' && typeof value !== 'object') { return false; } try { reflectApply(value, null, badArrayLike); } catch (e) { if (e !== isCallableMarker) { return false; } } return !isES6ClassFn(value) && tryFunctionObject(value); } : function isCallable(value) { if (isDDA(value)) { return true; } if (!value) { return false; } if (typeof value !== 'function' && typeof value !== 'object') { return false; } if (hasToStringTag) { return tryFunctionObject(value); } if (isES6ClassFn(value)) { return false; } var strClass = toStr.call(value); if (strClass !== fnClass && strClass !== genClass && !(/^\[object HTML/).test(strClass)) { return false; } return tryFunctionObject(value); }; /***/ }), /***/ 5540: /***/ ((module) => { /*! * is-extglob * * Copyright (c) 2014-2016, Jon Schlinkert. * Licensed under the MIT License. */ module.exports = function isExtglob(str) { if (typeof str !== 'string' || str === '') { return false; } var match; while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { if (match[2]) return true; str = str.slice(match.index + match[0].length); } return false; }; /***/ }), /***/ 1925: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /*! * is-glob * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ var isExtglob = __nccwpck_require__(5540); var chars = { '{': '}', '(': ')', '[': ']'}; var strictCheck = function(str) { if (str[0] === '!') { return true; } var index = 0; var pipeIndex = -2; var closeSquareIndex = -2; var closeCurlyIndex = -2; var closeParenIndex = -2; var backSlashIndex = -2; while (index < str.length) { if (str[index] === '*') { return true; } if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) { return true; } if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') { if (closeSquareIndex < index) { closeSquareIndex = str.indexOf(']', index); } if (closeSquareIndex > index) { if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { return true; } backSlashIndex = str.indexOf('\\', index); if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { return true; } } } if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') { closeCurlyIndex = str.indexOf('}', index); if (closeCurlyIndex > index) { backSlashIndex = str.indexOf('\\', index); if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { return true; } } } if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') { closeParenIndex = str.indexOf(')', index); if (closeParenIndex > index) { backSlashIndex = str.indexOf('\\', index); if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { return true; } } } if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') { if (pipeIndex < index) { pipeIndex = str.indexOf('|', index); } if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') { closeParenIndex = str.indexOf(')', pipeIndex); if (closeParenIndex > pipeIndex) { backSlashIndex = str.indexOf('\\', pipeIndex); if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { return true; } } } } if (str[index] === '\\') { var open = str[index + 1]; index += 2; var close = chars[open]; if (close) { var n = str.indexOf(close, index); if (n !== -1) { index = n + 1; } } if (str[index] === '!') { return true; } } else { index++; } } return false; }; var relaxedCheck = function(str) { if (str[0] === '!') { return true; } var index = 0; while (index < str.length) { if (/[*?{}()[\]]/.test(str[index])) { return true; } if (str[index] === '\\') { var open = str[index + 1]; index += 2; var close = chars[open]; if (close) { var n = str.indexOf(close, index); if (n !== -1) { index = n + 1; } } if (str[index] === '!') { return true; } } else { index++; } } return false; }; module.exports = function isGlob(str, options) { if (typeof str !== 'string' || str === '') { return false; } if (isExtglob(str)) { return true; } var check = strictCheck; // optionally relax check if (options && options.strict === false) { check = relaxedCheck; } return check(str); }; /***/ }), /***/ 6834: /***/ ((module) => { /*! * is-natural-number.js | MIT (c) Shinnosuke Watanabe * https://github.com/shinnn/is-natural-number.js */ module.exports = function isNaturalNumber(val, option) { if (option) { if (typeof option !== 'object') { throw new TypeError( String(option) + ' is not an object. Expected an object that has boolean `includeZero` property.' ); } if ('includeZero' in option) { if (typeof option.includeZero !== 'boolean') { throw new TypeError( String(option.includeZero) + ' is neither true nor false. `includeZero` option must be a Boolean value.' ); } if (option.includeZero && val === 0) { return true; } } } return Number.isSafeInteger(val) && val >= 1; }; /***/ }), /***/ 721: /***/ ((module) => { /*! * is-number * * Copyright (c) 2014-present, Jon Schlinkert. * Released under the MIT License. */ module.exports = function(num) { if (typeof num === 'number') { return num - num === 0; } if (typeof num === 'string' && num.trim() !== '') { return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); } return false; }; /***/ }), /***/ 6543: /***/ ((module) => { var isStream = module.exports = function (stream) { return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function'; }; isStream.writable = function (stream) { return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object'; }; isStream.readable = function (stream) { return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object'; }; isStream.duplex = function (stream) { return isStream.writable(stream) && isStream.readable(stream); }; isStream.transform = function (stream) { return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object'; }; /***/ }), /***/ 6405: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var whichTypedArray = __nccwpck_require__(4768); /** @type {import('.')} */ module.exports = function isTypedArray(value) { return !!whichTypedArray(value); }; /***/ }), /***/ 2513: /***/ ((module) => { var toString = {}.toString; module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; /***/ }), /***/ 6512: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const fs = __nccwpck_require__(9896); const path = __nccwpck_require__(6928); const pify = __nccwpck_require__(3610); const defaults = { mode: 0o777 & (~process.umask()), fs }; // https://github.com/nodejs/node/issues/8987 // https://github.com/libuv/libuv/pull/1088 const checkPath = pth => { if (process.platform === 'win32') { const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')); if (pathHasInvalidWinCharacters) { const err = new Error(`Path contains invalid characters: ${pth}`); err.code = 'EINVAL'; throw err; } } }; module.exports = (input, opts) => Promise.resolve().then(() => { checkPath(input); opts = Object.assign({}, defaults, opts); const mkdir = pify(opts.fs.mkdir); const stat = pify(opts.fs.stat); const make = pth => { return mkdir(pth, opts.mode) .then(() => pth) .catch(err => { if (err.code === 'ENOENT') { if (err.message.includes('null bytes') || path.dirname(pth) === pth) { throw err; } return make(path.dirname(pth)).then(() => make(pth)); } return stat(pth) .then(stats => stats.isDirectory() ? pth : Promise.reject()) .catch(() => { throw err; }); }); }; return make(path.resolve(input)); }); module.exports.sync = (input, opts) => { checkPath(input); opts = Object.assign({}, defaults, opts); const make = pth => { try { opts.fs.mkdirSync(pth, opts.mode); } catch (err) { if (err.code === 'ENOENT') { if (err.message.includes('null bytes') || path.dirname(pth) === pth) { throw err; } make(path.dirname(pth)); return make(pth); } try { if (!opts.fs.statSync(pth).isDirectory()) { throw new Error('The path is not a directory'); } } catch (_) { throw err; } } return pth; }; return make(path.resolve(input)); }; /***/ }), /***/ 3610: /***/ ((module) => { const processFn = (fn, opts) => function () { const P = opts.promiseModule; const args = new Array(arguments.length); for (let i = 0; i < arguments.length; i++) { args[i] = arguments[i]; } return new P((resolve, reject) => { if (opts.errorFirst) { args.push(function (err, result) { if (opts.multiArgs) { const results = new Array(arguments.length - 1); for (let i = 1; i < arguments.length; i++) { results[i - 1] = arguments[i]; } if (err) { results.unshift(err); reject(results); } else { resolve(results); } } else if (err) { reject(err); } else { resolve(result); } }); } else { args.push(function (result) { if (opts.multiArgs) { const results = new Array(arguments.length - 1); for (let i = 0; i < arguments.length; i++) { results[i] = arguments[i]; } resolve(results); } else { resolve(result); } }); } fn.apply(this, args); }); }; module.exports = (obj, opts) => { opts = Object.assign({ exclude: [/.+(Sync|Stream)$/], errorFirst: true, promiseModule: Promise }, opts); const filter = key => { const match = pattern => typeof pattern === 'string' ? key === pattern : pattern.test(key); return opts.include ? opts.include.some(match) : !opts.exclude.some(match); }; let ret; if (typeof obj === 'function') { ret = function () { if (opts.excludeMain) { return obj.apply(this, arguments); } return processFn(obj, opts).apply(this, arguments); }; } else { ret = Object.create(Object.getPrototypeOf(obj)); } for (const key in obj) { // eslint-disable-line guard-for-in const x = obj[key]; ret[key] = typeof x === 'function' && filter(key) ? processFn(x, opts) : x; } return ret; }; /***/ }), /***/ 5641: /***/ ((module) => { /** @type {import('./abs')} */ module.exports = Math.abs; /***/ }), /***/ 6171: /***/ ((module) => { /** @type {import('./floor')} */ module.exports = Math.floor; /***/ }), /***/ 7044: /***/ ((module) => { /** @type {import('./isNaN')} */ module.exports = Number.isNaN || function isNaN(a) { return a !== a; }; /***/ }), /***/ 7147: /***/ ((module) => { /** @type {import('./max')} */ module.exports = Math.max; /***/ }), /***/ 1017: /***/ ((module) => { /** @type {import('./min')} */ module.exports = Math.min; /***/ }), /***/ 6947: /***/ ((module) => { /** @type {import('./pow')} */ module.exports = Math.pow; /***/ }), /***/ 2621: /***/ ((module) => { /** @type {import('./round')} */ module.exports = Math.round; /***/ }), /***/ 156: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var $isNaN = __nccwpck_require__(7044); /** @type {import('./sign')} */ module.exports = function sign(number) { if ($isNaN(number) || number === 0) { return number; } return number < 0 ? -1 : +1; }; /***/ }), /***/ 6133: /***/ ((module) => { /*! * normalize-path * * Copyright (c) 2014-2018, Jon Schlinkert. * Released under the MIT License. */ module.exports = function(path, stripTrailing) { if (typeof path !== 'string') { throw new TypeError('expected path to be a string'); } if (path === '\\' || path === '/') return '/'; var len = path.length; if (len <= 1) return path; // ensure that win32 namespaces has two leading slashes, so that the path is // handled properly by the win32 version of path.parse() after being normalized // https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces var prefix = ''; if (len > 4 && path[3] === '\\') { var ch = path[2]; if ((ch === '?' || ch === '.') && path.slice(0, 2) === '\\\\') { path = path.slice(2); prefix = '//'; } } var segs = path.split(/[/\\]+/); if (stripTrailing !== false && segs[segs.length - 1] === '') { segs.pop(); } return prefix + segs.join('/'); }; /***/ }), /***/ 4615: /***/ ((module) => { /* object-assign (c) Sindre Sorhus @license MIT */ /* eslint-disable no-unused-vars */ var getOwnPropertySymbols = Object.getOwnPropertySymbols; var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val === null || val === undefined) { throw new TypeError('Object.assign cannot be called with null or undefined'); } return Object(val); } function shouldUseNative() { try { if (!Object.assign) { return false; } // Detect buggy property enumeration order in older V8 versions. // https://bugs.chromium.org/p/v8/issues/detail?id=4118 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers test1[5] = 'de'; if (Object.getOwnPropertyNames(test1)[0] === '5') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test2 = {}; for (var i = 0; i < 10; i++) { test2['_' + String.fromCharCode(i)] = i; } var order2 = Object.getOwnPropertyNames(test2).map(function (n) { return test2[n]; }); if (order2.join('') !== '0123456789') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test3 = {}; 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { test3[letter] = letter; }); if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { return false; } return true; } catch (err) { // We don't expect any of the above to throw, but better to be safe. return false; } } module.exports = shouldUseNative() ? Object.assign : function (target, source) { var from; var to = toObject(target); var symbols; for (var s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) { if (propIsEnumerable.call(from, symbols[i])) { to[symbols[i]] = from[symbols[i]]; } } } } return to; }; /***/ }), /***/ 5560: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var wrappy = __nccwpck_require__(8264) module.exports = wrappy(once) module.exports.strict = wrappy(onceStrict) once.proto = once(function () { Object.defineProperty(Function.prototype, 'once', { value: function () { return once(this) }, configurable: true }) Object.defineProperty(Function.prototype, 'onceStrict', { value: function () { return onceStrict(this) }, configurable: true }) }) function once (fn) { var f = function () { if (f.called) return f.value f.called = true return f.value = fn.apply(this, arguments) } f.called = false return f } function onceStrict (fn) { var f = function () { if (f.called) throw new Error(f.onceError) f.called = true return f.value = fn.apply(this, arguments) } var name = fn.name || 'Function wrapped with `once`' f.onceError = name + " shouldn't be called more than once" f.called = false return f } /***/ }), /***/ 3313: /***/ ((module) => { module.exports = Pend; function Pend() { this.pending = 0; this.max = Infinity; this.listeners = []; this.waiting = []; this.error = null; } Pend.prototype.go = function(fn) { if (this.pending < this.max) { pendGo(this, fn); } else { this.waiting.push(fn); } }; Pend.prototype.wait = function(cb) { if (this.pending === 0) { cb(this.error); } else { this.listeners.push(cb); } }; Pend.prototype.hold = function() { return pendHold(this); }; function pendHold(self) { self.pending += 1; var called = false; return onCb; function onCb(err) { if (called) throw new Error("callback called twice"); called = true; self.error = self.error || err; self.pending -= 1; if (self.waiting.length > 0 && self.pending < self.max) { pendGo(self, self.waiting.shift()); } else if (self.pending === 0) { var listeners = self.listeners; self.listeners = []; listeners.forEach(cbListener); } } function cbListener(listener) { listener(self.error); } } function pendGo(self, fn) { fn(pendHold(self)); } /***/ }), /***/ 4006: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const pico = __nccwpck_require__(8016); const utils = __nccwpck_require__(4059); function picomatch(glob, options, returnState = false) { // default to os.platform() if (options && (options.windows === null || options.windows === undefined)) { // don't mutate the original options object options = { ...options, windows: utils.isWindows() }; } return pico(glob, options, returnState); } Object.assign(picomatch, pico); module.exports = picomatch; /***/ }), /***/ 5595: /***/ ((module) => { const WIN_SLASH = '\\\\/'; const WIN_NO_SLASH = `[^${WIN_SLASH}]`; /** * Posix glob regex */ const DOT_LITERAL = '\\.'; const PLUS_LITERAL = '\\+'; const QMARK_LITERAL = '\\?'; const SLASH_LITERAL = '\\/'; const ONE_CHAR = '(?=.)'; const QMARK = '[^/]'; const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; const NO_DOT = `(?!${DOT_LITERAL})`; const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; const STAR = `${QMARK}*?`; const SEP = '/'; const POSIX_CHARS = { DOT_LITERAL, PLUS_LITERAL, QMARK_LITERAL, SLASH_LITERAL, ONE_CHAR, QMARK, END_ANCHOR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK_NO_DOT, STAR, START_ANCHOR, SEP }; /** * Windows glob regex */ const WINDOWS_CHARS = { ...POSIX_CHARS, SLASH_LITERAL: `[${WIN_SLASH}]`, QMARK: WIN_NO_SLASH, STAR: `${WIN_NO_SLASH}*?`, DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, NO_DOT: `(?!${DOT_LITERAL})`, NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, QMARK_NO_DOT: `[^.${WIN_SLASH}]`, START_ANCHOR: `(?:^|[${WIN_SLASH}])`, END_ANCHOR: `(?:[${WIN_SLASH}]|$)`, SEP: '\\' }; /** * POSIX Bracket Regex */ const POSIX_REGEX_SOURCE = { alnum: 'a-zA-Z0-9', alpha: 'a-zA-Z', ascii: '\\x00-\\x7F', blank: ' \\t', cntrl: '\\x00-\\x1F\\x7F', digit: '0-9', graph: '\\x21-\\x7E', lower: 'a-z', print: '\\x20-\\x7E ', punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', space: ' \\t\\r\\n\\v\\f', upper: 'A-Z', word: 'A-Za-z0-9_', xdigit: 'A-Fa-f0-9' }; module.exports = { MAX_LENGTH: 1024 * 64, POSIX_REGEX_SOURCE, // regular expressions REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, // Replace globs with equivalent patterns to reduce parsing time. REPLACEMENTS: { __proto__: null, '***': '*', '**/**': '**', '**/**/**': '**' }, // Digits CHAR_0: 48, /* 0 */ CHAR_9: 57, /* 9 */ // Alphabet chars. CHAR_UPPERCASE_A: 65, /* A */ CHAR_LOWERCASE_A: 97, /* a */ CHAR_UPPERCASE_Z: 90, /* Z */ CHAR_LOWERCASE_Z: 122, /* z */ CHAR_LEFT_PARENTHESES: 40, /* ( */ CHAR_RIGHT_PARENTHESES: 41, /* ) */ CHAR_ASTERISK: 42, /* * */ // Non-alphabetic chars. CHAR_AMPERSAND: 38, /* & */ CHAR_AT: 64, /* @ */ CHAR_BACKWARD_SLASH: 92, /* \ */ CHAR_CARRIAGE_RETURN: 13, /* \r */ CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ CHAR_COLON: 58, /* : */ CHAR_COMMA: 44, /* , */ CHAR_DOT: 46, /* . */ CHAR_DOUBLE_QUOTE: 34, /* " */ CHAR_EQUAL: 61, /* = */ CHAR_EXCLAMATION_MARK: 33, /* ! */ CHAR_FORM_FEED: 12, /* \f */ CHAR_FORWARD_SLASH: 47, /* / */ CHAR_GRAVE_ACCENT: 96, /* ` */ CHAR_HASH: 35, /* # */ CHAR_HYPHEN_MINUS: 45, /* - */ CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ CHAR_LEFT_CURLY_BRACE: 123, /* { */ CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ CHAR_LINE_FEED: 10, /* \n */ CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ CHAR_PERCENT: 37, /* % */ CHAR_PLUS: 43, /* + */ CHAR_QUESTION_MARK: 63, /* ? */ CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ CHAR_RIGHT_CURLY_BRACE: 125, /* } */ CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ CHAR_SEMICOLON: 59, /* ; */ CHAR_SINGLE_QUOTE: 39, /* ' */ CHAR_SPACE: 32, /* */ CHAR_TAB: 9, /* \t */ CHAR_UNDERSCORE: 95, /* _ */ CHAR_VERTICAL_LINE: 124, /* | */ CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ /** * Create EXTGLOB_CHARS */ extglobChars(chars) { return { '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, '?': { type: 'qmark', open: '(?:', close: ')?' }, '+': { type: 'plus', open: '(?:', close: ')+' }, '*': { type: 'star', open: '(?:', close: ')*' }, '@': { type: 'at', open: '(?:', close: ')' } }; }, /** * Create GLOB_CHARS */ globChars(win32) { return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; } }; /***/ }), /***/ 8265: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const constants = __nccwpck_require__(5595); const utils = __nccwpck_require__(4059); /** * Constants */ const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants; /** * Helpers */ const expandRange = (args, options) => { if (typeof options.expandRange === 'function') { return options.expandRange(...args, options); } args.sort(); const value = `[${args.join('-')}]`; try { /* eslint-disable-next-line no-new */ new RegExp(value); } catch (ex) { return args.map(v => utils.escapeRegex(v)).join('..'); } return value; }; /** * Create the message for a syntax error */ const syntaxError = (type, char) => { return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; }; /** * Parse the given input string. * @param {String} input * @param {Object} options * @return {Object} */ const parse = (input, options) => { if (typeof input !== 'string') { throw new TypeError('Expected a string'); } input = REPLACEMENTS[input] || input; const opts = { ...options }; const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; let len = input.length; if (len > max) { throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); } const bos = { type: 'bos', value: '', output: opts.prepend || '' }; const tokens = [bos]; const capture = opts.capture ? '' : '?:'; // create constants based on platform, for windows or posix const PLATFORM_CHARS = constants.globChars(opts.windows); const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); const { DOT_LITERAL, PLUS_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK, QMARK_NO_DOT, STAR, START_ANCHOR } = PLATFORM_CHARS; const globstar = opts => { return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; }; const nodot = opts.dot ? '' : NO_DOT; const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; let star = opts.bash === true ? globstar(opts) : STAR; if (opts.capture) { star = `(${star})`; } // minimatch options support if (typeof opts.noext === 'boolean') { opts.noextglob = opts.noext; } const state = { input, index: -1, start: 0, dot: opts.dot === true, consumed: '', output: '', prefix: '', backtrack: false, negated: false, brackets: 0, braces: 0, parens: 0, quotes: 0, globstar: false, tokens }; input = utils.removePrefix(input, state); len = input.length; const extglobs = []; const braces = []; const stack = []; let prev = bos; let value; /** * Tokenizing helpers */ const eos = () => state.index === len - 1; const peek = state.peek = (n = 1) => input[state.index + n]; const advance = state.advance = () => input[++state.index] || ''; const remaining = () => input.slice(state.index + 1); const consume = (value = '', num = 0) => { state.consumed += value; state.index += num; }; const append = token => { state.output += token.output != null ? token.output : token.value; consume(token.value); }; const negate = () => { let count = 1; while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { advance(); state.start++; count++; } if (count % 2 === 0) { return false; } state.negated = true; state.start++; return true; }; const increment = type => { state[type]++; stack.push(type); }; const decrement = type => { state[type]--; stack.pop(); }; /** * Push tokens onto the tokens array. This helper speeds up * tokenizing by 1) helping us avoid backtracking as much as possible, * and 2) helping us avoid creating extra tokens when consecutive * characters are plain text. This improves performance and simplifies * lookbehinds. */ const push = tok => { if (prev.type === 'globstar') { const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { state.output = state.output.slice(0, -prev.output.length); prev.type = 'star'; prev.value = '*'; prev.output = star; state.output += prev.output; } } if (extglobs.length && tok.type !== 'paren') { extglobs[extglobs.length - 1].inner += tok.value; } if (tok.value || tok.output) append(tok); if (prev && prev.type === 'text' && tok.type === 'text') { prev.output = (prev.output || prev.value) + tok.value; prev.value += tok.value; return; } tok.prev = prev; tokens.push(tok); prev = tok; }; const extglobOpen = (type, value) => { const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; token.prev = prev; token.parens = state.parens; token.output = state.output; const output = (opts.capture ? '(' : '') + token.open; increment('parens'); push({ type, value, output: state.output ? '' : ONE_CHAR }); push({ type: 'paren', extglob: true, value: advance(), output }); extglobs.push(token); }; const extglobClose = token => { let output = token.close + (opts.capture ? ')' : ''); let rest; if (token.type === 'negate') { let extglobStar = star; if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { extglobStar = globstar(opts); } if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { output = token.close = `)$))${extglobStar}`; } if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. // In this case, we need to parse the string and use it in the output of the original pattern. // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. // // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. const expression = parse(rest, { ...options, fastpaths: false }).output; output = token.close = `)${expression})${extglobStar})`; } if (token.prev.type === 'bos') { state.negatedExtglob = true; } } push({ type: 'paren', extglob: true, value, output }); decrement('parens'); }; /** * Fast paths */ if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { let backslashes = false; let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { if (first === '\\') { backslashes = true; return m; } if (first === '?') { if (esc) { return esc + first + (rest ? QMARK.repeat(rest.length) : ''); } if (index === 0) { return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); } return QMARK.repeat(chars.length); } if (first === '.') { return DOT_LITERAL.repeat(chars.length); } if (first === '*') { if (esc) { return esc + first + (rest ? star : ''); } return star; } return esc ? m : `\\${m}`; }); if (backslashes === true) { if (opts.unescape === true) { output = output.replace(/\\/g, ''); } else { output = output.replace(/\\+/g, m => { return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); }); } } if (output === input && opts.contains === true) { state.output = input; return state; } state.output = utils.wrapOutput(output, state, options); return state; } /** * Tokenize input until we reach end-of-string */ while (!eos()) { value = advance(); if (value === '\u0000') { continue; } /** * Escaped characters */ if (value === '\\') { const next = peek(); if (next === '/' && opts.bash !== true) { continue; } if (next === '.' || next === ';') { continue; } if (!next) { value += '\\'; push({ type: 'text', value }); continue; } // collapse slashes to reduce potential for exploits const match = /^\\+/.exec(remaining()); let slashes = 0; if (match && match[0].length > 2) { slashes = match[0].length; state.index += slashes; if (slashes % 2 !== 0) { value += '\\'; } } if (opts.unescape === true) { value = advance(); } else { value += advance(); } if (state.brackets === 0) { push({ type: 'text', value }); continue; } } /** * If we're inside a regex character class, continue * until we reach the closing bracket. */ if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { if (opts.posix !== false && value === ':') { const inner = prev.value.slice(1); if (inner.includes('[')) { prev.posix = true; if (inner.includes(':')) { const idx = prev.value.lastIndexOf('['); const pre = prev.value.slice(0, idx); const rest = prev.value.slice(idx + 2); const posix = POSIX_REGEX_SOURCE[rest]; if (posix) { prev.value = pre + posix; state.backtrack = true; advance(); if (!bos.output && tokens.indexOf(prev) === 1) { bos.output = ONE_CHAR; } continue; } } } } if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { value = `\\${value}`; } if (value === ']' && (prev.value === '[' || prev.value === '[^')) { value = `\\${value}`; } if (opts.posix === true && value === '!' && prev.value === '[') { value = '^'; } prev.value += value; append({ value }); continue; } /** * If we're inside a quoted string, continue * until we reach the closing double quote. */ if (state.quotes === 1 && value !== '"') { value = utils.escapeRegex(value); prev.value += value; append({ value }); continue; } /** * Double quotes */ if (value === '"') { state.quotes = state.quotes === 1 ? 0 : 1; if (opts.keepQuotes === true) { push({ type: 'text', value }); } continue; } /** * Parentheses */ if (value === '(') { increment('parens'); push({ type: 'paren', value }); continue; } if (value === ')') { if (state.parens === 0 && opts.strictBrackets === true) { throw new SyntaxError(syntaxError('opening', '(')); } const extglob = extglobs[extglobs.length - 1]; if (extglob && state.parens === extglob.parens + 1) { extglobClose(extglobs.pop()); continue; } push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); decrement('parens'); continue; } /** * Square brackets */ if (value === '[') { if (opts.nobracket === true || !remaining().includes(']')) { if (opts.nobracket !== true && opts.strictBrackets === true) { throw new SyntaxError(syntaxError('closing', ']')); } value = `\\${value}`; } else { increment('brackets'); } push({ type: 'bracket', value }); continue; } if (value === ']') { if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { push({ type: 'text', value, output: `\\${value}` }); continue; } if (state.brackets === 0) { if (opts.strictBrackets === true) { throw new SyntaxError(syntaxError('opening', '[')); } push({ type: 'text', value, output: `\\${value}` }); continue; } decrement('brackets'); const prevValue = prev.value.slice(1); if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { value = `/${value}`; } prev.value += value; append({ value }); // when literal brackets are explicitly disabled // assume we should match with a regex character class if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { continue; } const escaped = utils.escapeRegex(prev.value); state.output = state.output.slice(0, -prev.value.length); // when literal brackets are explicitly enabled // assume we should escape the brackets to match literal characters if (opts.literalBrackets === true) { state.output += escaped; prev.value = escaped; continue; } // when the user specifies nothing, try to match both prev.value = `(${capture}${escaped}|${prev.value})`; state.output += prev.value; continue; } /** * Braces */ if (value === '{' && opts.nobrace !== true) { increment('braces'); const open = { type: 'brace', value, output: '(', outputIndex: state.output.length, tokensIndex: state.tokens.length }; braces.push(open); push(open); continue; } if (value === '}') { const brace = braces[braces.length - 1]; if (opts.nobrace === true || !brace) { push({ type: 'text', value, output: value }); continue; } let output = ')'; if (brace.dots === true) { const arr = tokens.slice(); const range = []; for (let i = arr.length - 1; i >= 0; i--) { tokens.pop(); if (arr[i].type === 'brace') { break; } if (arr[i].type !== 'dots') { range.unshift(arr[i].value); } } output = expandRange(range, opts); state.backtrack = true; } if (brace.comma !== true && brace.dots !== true) { const out = state.output.slice(0, brace.outputIndex); const toks = state.tokens.slice(brace.tokensIndex); brace.value = brace.output = '\\{'; value = output = '\\}'; state.output = out; for (const t of toks) { state.output += (t.output || t.value); } } push({ type: 'brace', value, output }); decrement('braces'); braces.pop(); continue; } /** * Pipes */ if (value === '|') { if (extglobs.length > 0) { extglobs[extglobs.length - 1].conditions++; } push({ type: 'text', value }); continue; } /** * Commas */ if (value === ',') { let output = value; const brace = braces[braces.length - 1]; if (brace && stack[stack.length - 1] === 'braces') { brace.comma = true; output = '|'; } push({ type: 'comma', value, output }); continue; } /** * Slashes */ if (value === '/') { // if the beginning of the glob is "./", advance the start // to the current index, and don't add the "./" characters // to the state. This greatly simplifies lookbehinds when // checking for BOS characters like "!" and "." (not "./") if (prev.type === 'dot' && state.index === state.start + 1) { state.start = state.index + 1; state.consumed = ''; state.output = ''; tokens.pop(); prev = bos; // reset "prev" to the first token continue; } push({ type: 'slash', value, output: SLASH_LITERAL }); continue; } /** * Dots */ if (value === '.') { if (state.braces > 0 && prev.type === 'dot') { if (prev.value === '.') prev.output = DOT_LITERAL; const brace = braces[braces.length - 1]; prev.type = 'dots'; prev.output += value; prev.value += value; brace.dots = true; continue; } if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { push({ type: 'text', value, output: DOT_LITERAL }); continue; } push({ type: 'dot', value, output: DOT_LITERAL }); continue; } /** * Question marks */ if (value === '?') { const isGroup = prev && prev.value === '('; if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { extglobOpen('qmark', value); continue; } if (prev && prev.type === 'paren') { const next = peek(); let output = value; if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { output = `\\${value}`; } push({ type: 'text', value, output }); continue; } if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { push({ type: 'qmark', value, output: QMARK_NO_DOT }); continue; } push({ type: 'qmark', value, output: QMARK }); continue; } /** * Exclamation */ if (value === '!') { if (opts.noextglob !== true && peek() === '(') { if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { extglobOpen('negate', value); continue; } } if (opts.nonegate !== true && state.index === 0) { negate(); continue; } } /** * Plus */ if (value === '+') { if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { extglobOpen('plus', value); continue; } if ((prev && prev.value === '(') || opts.regex === false) { push({ type: 'plus', value, output: PLUS_LITERAL }); continue; } if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { push({ type: 'plus', value }); continue; } push({ type: 'plus', value: PLUS_LITERAL }); continue; } /** * Plain text */ if (value === '@') { if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { push({ type: 'at', extglob: true, value, output: '' }); continue; } push({ type: 'text', value }); continue; } /** * Plain text */ if (value !== '*') { if (value === '$' || value === '^') { value = `\\${value}`; } const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); if (match) { value += match[0]; state.index += match[0].length; } push({ type: 'text', value }); continue; } /** * Stars */ if (prev && (prev.type === 'globstar' || prev.star === true)) { prev.type = 'star'; prev.star = true; prev.value += value; prev.output = star; state.backtrack = true; state.globstar = true; consume(value); continue; } let rest = remaining(); if (opts.noextglob !== true && /^\([^?]/.test(rest)) { extglobOpen('star', value); continue; } if (prev.type === 'star') { if (opts.noglobstar === true) { consume(value); continue; } const prior = prev.prev; const before = prior.prev; const isStart = prior.type === 'slash' || prior.type === 'bos'; const afterStar = before && (before.type === 'star' || before.type === 'globstar'); if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { push({ type: 'star', value, output: '' }); continue; } const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { push({ type: 'star', value, output: '' }); continue; } // strip consecutive `/**/` while (rest.slice(0, 3) === '/**') { const after = input[state.index + 4]; if (after && after !== '/') { break; } rest = rest.slice(3); consume('/**', 3); } if (prior.type === 'bos' && eos()) { prev.type = 'globstar'; prev.value += value; prev.output = globstar(opts); state.output = prev.output; state.globstar = true; consume(value); continue; } if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { state.output = state.output.slice(0, -(prior.output + prev.output).length); prior.output = `(?:${prior.output}`; prev.type = 'globstar'; prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); prev.value += value; state.globstar = true; state.output += prior.output + prev.output; consume(value); continue; } if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { const end = rest[1] !== void 0 ? '|$' : ''; state.output = state.output.slice(0, -(prior.output + prev.output).length); prior.output = `(?:${prior.output}`; prev.type = 'globstar'; prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; prev.value += value; state.output += prior.output + prev.output; state.globstar = true; consume(value + advance()); push({ type: 'slash', value: '/', output: '' }); continue; } if (prior.type === 'bos' && rest[0] === '/') { prev.type = 'globstar'; prev.value += value; prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; state.output = prev.output; state.globstar = true; consume(value + advance()); push({ type: 'slash', value: '/', output: '' }); continue; } // remove single star from output state.output = state.output.slice(0, -prev.output.length); // reset previous token to globstar prev.type = 'globstar'; prev.output = globstar(opts); prev.value += value; // reset output with globstar state.output += prev.output; state.globstar = true; consume(value); continue; } const token = { type: 'star', value, output: star }; if (opts.bash === true) { token.output = '.*?'; if (prev.type === 'bos' || prev.type === 'slash') { token.output = nodot + token.output; } push(token); continue; } if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { token.output = value; push(token); continue; } if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { if (prev.type === 'dot') { state.output += NO_DOT_SLASH; prev.output += NO_DOT_SLASH; } else if (opts.dot === true) { state.output += NO_DOTS_SLASH; prev.output += NO_DOTS_SLASH; } else { state.output += nodot; prev.output += nodot; } if (peek() !== '*') { state.output += ONE_CHAR; prev.output += ONE_CHAR; } } push(token); } while (state.brackets > 0) { if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); state.output = utils.escapeLast(state.output, '['); decrement('brackets'); } while (state.parens > 0) { if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); state.output = utils.escapeLast(state.output, '('); decrement('parens'); } while (state.braces > 0) { if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); state.output = utils.escapeLast(state.output, '{'); decrement('braces'); } if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); } // rebuild the output if we had to backtrack at any point if (state.backtrack === true) { state.output = ''; for (const token of state.tokens) { state.output += token.output != null ? token.output : token.value; if (token.suffix) { state.output += token.suffix; } } } return state; }; /** * Fast paths for creating regular expressions for common glob patterns. * This can significantly speed up processing and has very little downside * impact when none of the fast paths match. */ parse.fastpaths = (input, options) => { const opts = { ...options }; const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; const len = input.length; if (len > max) { throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); } input = REPLACEMENTS[input] || input; // create constants based on platform, for windows or posix const { DOT_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR } = constants.globChars(opts.windows); const nodot = opts.dot ? NO_DOTS : NO_DOT; const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; const capture = opts.capture ? '' : '?:'; const state = { negated: false, prefix: '' }; let star = opts.bash === true ? '.*?' : STAR; if (opts.capture) { star = `(${star})`; } const globstar = opts => { if (opts.noglobstar === true) return star; return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; }; const create = str => { switch (str) { case '*': return `${nodot}${ONE_CHAR}${star}`; case '.*': return `${DOT_LITERAL}${ONE_CHAR}${star}`; case '*.*': return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; case '*/*': return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; case '**': return nodot + globstar(opts); case '**/*': return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; case '**/*.*': return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; case '**/.*': return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; default: { const match = /^(.*?)\.(\w+)$/.exec(str); if (!match) return; const source = create(match[1]); if (!source) return; return source + DOT_LITERAL + match[2]; } } }; const output = utils.removePrefix(input, state); let source = create(output); if (source && opts.strictSlashes !== true) { source += `${SLASH_LITERAL}?`; } return source; }; module.exports = parse; /***/ }), /***/ 8016: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const scan = __nccwpck_require__(1781); const parse = __nccwpck_require__(8265); const utils = __nccwpck_require__(4059); const constants = __nccwpck_require__(5595); const isObject = val => val && typeof val === 'object' && !Array.isArray(val); /** * Creates a matcher function from one or more glob patterns. The * returned function takes a string to match as its first argument, * and returns true if the string is a match. The returned matcher * function also takes a boolean as the second argument that, when true, * returns an object with additional information. * * ```js * const picomatch = require('picomatch'); * // picomatch(glob[, options]); * * const isMatch = picomatch('*.!(*a)'); * console.log(isMatch('a.a')); //=> false * console.log(isMatch('a.b')); //=> true * ``` * @name picomatch * @param {String|Array} `globs` One or more glob patterns. * @param {Object=} `options` * @return {Function=} Returns a matcher function. * @api public */ const picomatch = (glob, options, returnState = false) => { if (Array.isArray(glob)) { const fns = glob.map(input => picomatch(input, options, returnState)); const arrayMatcher = str => { for (const isMatch of fns) { const state = isMatch(str); if (state) return state; } return false; }; return arrayMatcher; } const isState = isObject(glob) && glob.tokens && glob.input; if (glob === '' || (typeof glob !== 'string' && !isState)) { throw new TypeError('Expected pattern to be a non-empty string'); } const opts = options || {}; const posix = opts.windows; const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true); const state = regex.state; delete regex.state; let isIgnored = () => false; if (opts.ignore) { const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); } const matcher = (input, returnObject = false) => { const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); const result = { glob, state, regex, posix, input, output, match, isMatch }; if (typeof opts.onResult === 'function') { opts.onResult(result); } if (isMatch === false) { result.isMatch = false; return returnObject ? result : false; } if (isIgnored(input)) { if (typeof opts.onIgnore === 'function') { opts.onIgnore(result); } result.isMatch = false; return returnObject ? result : false; } if (typeof opts.onMatch === 'function') { opts.onMatch(result); } return returnObject ? result : true; }; if (returnState) { matcher.state = state; } return matcher; }; /** * Test `input` with the given `regex`. This is used by the main * `picomatch()` function to test the input string. * * ```js * const picomatch = require('picomatch'); * // picomatch.test(input, regex[, options]); * * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } * ``` * @param {String} `input` String to test. * @param {RegExp} `regex` * @return {Object} Returns an object with matching info. * @api public */ picomatch.test = (input, regex, options, { glob, posix } = {}) => { if (typeof input !== 'string') { throw new TypeError('Expected input to be a string'); } if (input === '') { return { isMatch: false, output: '' }; } const opts = options || {}; const format = opts.format || (posix ? utils.toPosixSlashes : null); let match = input === glob; let output = (match && format) ? format(input) : input; if (match === false) { output = format ? format(input) : input; match = output === glob; } if (match === false || opts.capture === true) { if (opts.matchBase === true || opts.basename === true) { match = picomatch.matchBase(input, regex, options, posix); } else { match = regex.exec(output); } } return { isMatch: Boolean(match), match, output }; }; /** * Match the basename of a filepath. * * ```js * const picomatch = require('picomatch'); * // picomatch.matchBase(input, glob[, options]); * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true * ``` * @param {String} `input` String to test. * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). * @return {Boolean} * @api public */ picomatch.matchBase = (input, glob, options) => { const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); return regex.test(utils.basename(input)); }; /** * Returns true if **any** of the given glob `patterns` match the specified `string`. * * ```js * const picomatch = require('picomatch'); * // picomatch.isMatch(string, patterns[, options]); * * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false * ``` * @param {String|Array} str The string to test. * @param {String|Array} patterns One or more glob patterns to use for matching. * @param {Object} [options] See available [options](#options). * @return {Boolean} Returns true if any patterns match `str` * @api public */ picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); /** * Parse a glob pattern to create the source string for a regular * expression. * * ```js * const picomatch = require('picomatch'); * const result = picomatch.parse(pattern[, options]); * ``` * @param {String} `pattern` * @param {Object} `options` * @return {Object} Returns an object with useful properties and output to be used as a regex source string. * @api public */ picomatch.parse = (pattern, options) => { if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); return parse(pattern, { ...options, fastpaths: false }); }; /** * Scan a glob pattern to separate the pattern into segments. * * ```js * const picomatch = require('picomatch'); * // picomatch.scan(input[, options]); * * const result = picomatch.scan('!./foo/*.js'); * console.log(result); * { prefix: '!./', * input: '!./foo/*.js', * start: 3, * base: 'foo', * glob: '*.js', * isBrace: false, * isBracket: false, * isGlob: true, * isExtglob: false, * isGlobstar: false, * negated: true } * ``` * @param {String} `input` Glob pattern to scan. * @param {Object} `options` * @return {Object} Returns an object with * @api public */ picomatch.scan = (input, options) => scan(input, options); /** * Compile a regular expression from the `state` object returned by the * [parse()](#parse) method. * * @param {Object} `state` * @param {Object} `options` * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. * @return {RegExp} * @api public */ picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { if (returnOutput === true) { return state.output; } const opts = options || {}; const prepend = opts.contains ? '' : '^'; const append = opts.contains ? '' : '$'; let source = `${prepend}(?:${state.output})${append}`; if (state && state.negated === true) { source = `^(?!${source}).*$`; } const regex = picomatch.toRegex(source, options); if (returnState === true) { regex.state = state; } return regex; }; /** * Create a regular expression from a parsed glob pattern. * * ```js * const picomatch = require('picomatch'); * const state = picomatch.parse('*.js'); * // picomatch.compileRe(state[, options]); * * console.log(picomatch.compileRe(state)); * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ * ``` * @param {String} `state` The object returned from the `.parse` method. * @param {Object} `options` * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. * @return {RegExp} Returns a regex created from the given pattern. * @api public */ picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { if (!input || typeof input !== 'string') { throw new TypeError('Expected a non-empty string'); } let parsed = { negated: false, fastpaths: true }; if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { parsed.output = parse.fastpaths(input, options); } if (!parsed.output) { parsed = parse(input, options); } return picomatch.compileRe(parsed, options, returnOutput, returnState); }; /** * Create a regular expression from the given regex source string. * * ```js * const picomatch = require('picomatch'); * // picomatch.toRegex(source[, options]); * * const { output } = picomatch.parse('*.js'); * console.log(picomatch.toRegex(output)); * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ * ``` * @param {String} `source` Regular expression source string. * @param {Object} `options` * @return {RegExp} * @api public */ picomatch.toRegex = (source, options) => { try { const opts = options || {}; return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); } catch (err) { if (options && options.debug === true) throw err; return /$^/; } }; /** * Picomatch constants. * @return {Object} */ picomatch.constants = constants; /** * Expose "picomatch" */ module.exports = picomatch; /***/ }), /***/ 1781: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const utils = __nccwpck_require__(4059); const { CHAR_ASTERISK, /* * */ CHAR_AT, /* @ */ CHAR_BACKWARD_SLASH, /* \ */ CHAR_COMMA, /* , */ CHAR_DOT, /* . */ CHAR_EXCLAMATION_MARK, /* ! */ CHAR_FORWARD_SLASH, /* / */ CHAR_LEFT_CURLY_BRACE, /* { */ CHAR_LEFT_PARENTHESES, /* ( */ CHAR_LEFT_SQUARE_BRACKET, /* [ */ CHAR_PLUS, /* + */ CHAR_QUESTION_MARK, /* ? */ CHAR_RIGHT_CURLY_BRACE, /* } */ CHAR_RIGHT_PARENTHESES, /* ) */ CHAR_RIGHT_SQUARE_BRACKET /* ] */ } = __nccwpck_require__(5595); const isPathSeparator = code => { return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; }; const depth = token => { if (token.isPrefix !== true) { token.depth = token.isGlobstar ? Infinity : 1; } }; /** * Quickly scans a glob pattern and returns an object with a handful of * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). * * ```js * const pm = require('picomatch'); * console.log(pm.scan('foo/bar/*.js')); * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } * ``` * @param {String} `str` * @param {Object} `options` * @return {Object} Returns an object with tokens and regex source string. * @api public */ const scan = (input, options) => { const opts = options || {}; const length = input.length - 1; const scanToEnd = opts.parts === true || opts.scanToEnd === true; const slashes = []; const tokens = []; const parts = []; let str = input; let index = -1; let start = 0; let lastIndex = 0; let isBrace = false; let isBracket = false; let isGlob = false; let isExtglob = false; let isGlobstar = false; let braceEscaped = false; let backslashes = false; let negated = false; let negatedExtglob = false; let finished = false; let braces = 0; let prev; let code; let token = { value: '', depth: 0, isGlob: false }; const eos = () => index >= length; const peek = () => str.charCodeAt(index + 1); const advance = () => { prev = code; return str.charCodeAt(++index); }; while (index < length) { code = advance(); let next; if (code === CHAR_BACKWARD_SLASH) { backslashes = token.backslashes = true; code = advance(); if (code === CHAR_LEFT_CURLY_BRACE) { braceEscaped = true; } continue; } if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { braces++; while (eos() !== true && (code = advance())) { if (code === CHAR_BACKWARD_SLASH) { backslashes = token.backslashes = true; advance(); continue; } if (code === CHAR_LEFT_CURLY_BRACE) { braces++; continue; } if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { isBrace = token.isBrace = true; isGlob = token.isGlob = true; finished = true; if (scanToEnd === true) { continue; } break; } if (braceEscaped !== true && code === CHAR_COMMA) { isBrace = token.isBrace = true; isGlob = token.isGlob = true; finished = true; if (scanToEnd === true) { continue; } break; } if (code === CHAR_RIGHT_CURLY_BRACE) { braces--; if (braces === 0) { braceEscaped = false; isBrace = token.isBrace = true; finished = true; break; } } } if (scanToEnd === true) { continue; } break; } if (code === CHAR_FORWARD_SLASH) { slashes.push(index); tokens.push(token); token = { value: '', depth: 0, isGlob: false }; if (finished === true) continue; if (prev === CHAR_DOT && index === (start + 1)) { start += 2; continue; } lastIndex = index + 1; continue; } if (opts.noext !== true) { const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK; if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { isGlob = token.isGlob = true; isExtglob = token.isExtglob = true; finished = true; if (code === CHAR_EXCLAMATION_MARK && index === start) { negatedExtglob = true; } if (scanToEnd === true) { while (eos() !== true && (code = advance())) { if (code === CHAR_BACKWARD_SLASH) { backslashes = token.backslashes = true; code = advance(); continue; } if (code === CHAR_RIGHT_PARENTHESES) { isGlob = token.isGlob = true; finished = true; break; } } continue; } break; } } if (code === CHAR_ASTERISK) { if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; isGlob = token.isGlob = true; finished = true; if (scanToEnd === true) { continue; } break; } if (code === CHAR_QUESTION_MARK) { isGlob = token.isGlob = true; finished = true; if (scanToEnd === true) { continue; } break; } if (code === CHAR_LEFT_SQUARE_BRACKET) { while (eos() !== true && (next = advance())) { if (next === CHAR_BACKWARD_SLASH) { backslashes = token.backslashes = true; advance(); continue; } if (next === CHAR_RIGHT_SQUARE_BRACKET) { isBracket = token.isBracket = true; isGlob = token.isGlob = true; finished = true; break; } } if (scanToEnd === true) { continue; } break; } if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { negated = token.negated = true; start++; continue; } if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { isGlob = token.isGlob = true; if (scanToEnd === true) { while (eos() !== true && (code = advance())) { if (code === CHAR_LEFT_PARENTHESES) { backslashes = token.backslashes = true; code = advance(); continue; } if (code === CHAR_RIGHT_PARENTHESES) { finished = true; break; } } continue; } break; } if (isGlob === true) { finished = true; if (scanToEnd === true) { continue; } break; } } if (opts.noext === true) { isExtglob = false; isGlob = false; } let base = str; let prefix = ''; let glob = ''; if (start > 0) { prefix = str.slice(0, start); str = str.slice(start); lastIndex -= start; } if (base && isGlob === true && lastIndex > 0) { base = str.slice(0, lastIndex); glob = str.slice(lastIndex); } else if (isGlob === true) { base = ''; glob = str; } else { base = str; } if (base && base !== '' && base !== '/' && base !== str) { if (isPathSeparator(base.charCodeAt(base.length - 1))) { base = base.slice(0, -1); } } if (opts.unescape === true) { if (glob) glob = utils.removeBackslashes(glob); if (base && backslashes === true) { base = utils.removeBackslashes(base); } } const state = { prefix, input, start, base, glob, isBrace, isBracket, isGlob, isExtglob, isGlobstar, negated, negatedExtglob }; if (opts.tokens === true) { state.maxDepth = 0; if (!isPathSeparator(code)) { tokens.push(token); } state.tokens = tokens; } if (opts.parts === true || opts.tokens === true) { let prevIndex; for (let idx = 0; idx < slashes.length; idx++) { const n = prevIndex ? prevIndex + 1 : start; const i = slashes[idx]; const value = input.slice(n, i); if (opts.tokens) { if (idx === 0 && start !== 0) { tokens[idx].isPrefix = true; tokens[idx].value = prefix; } else { tokens[idx].value = value; } depth(tokens[idx]); state.maxDepth += tokens[idx].depth; } if (idx !== 0 || value !== '') { parts.push(value); } prevIndex = i; } if (prevIndex && prevIndex + 1 < input.length) { const value = input.slice(prevIndex + 1); parts.push(value); if (opts.tokens) { tokens[tokens.length - 1].value = value; depth(tokens[tokens.length - 1]); state.maxDepth += tokens[tokens.length - 1].depth; } } state.slashes = slashes; state.parts = parts; } return state; }; module.exports = scan; /***/ }), /***/ 4059: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { /*global navigator*/ const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = __nccwpck_require__(5595); exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); exports.isWindows = () => { if (typeof navigator !== 'undefined' && navigator.platform) { const platform = navigator.platform.toLowerCase(); return platform === 'win32' || platform === 'windows'; } if (typeof process !== 'undefined' && process.platform) { return process.platform === 'win32'; } return false; }; exports.removeBackslashes = str => { return str.replace(REGEX_REMOVE_BACKSLASH, match => { return match === '\\' ? '' : match; }); }; exports.escapeLast = (input, char, lastIdx) => { const idx = input.lastIndexOf(char, lastIdx); if (idx === -1) return input; if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); return `${input.slice(0, idx)}\\${input.slice(idx)}`; }; exports.removePrefix = (input, state = {}) => { let output = input; if (output.startsWith('./')) { output = output.slice(2); state.prefix = './'; } return output; }; exports.wrapOutput = (input, state = {}, options = {}) => { const prepend = options.contains ? '' : '^'; const append = options.contains ? '' : '$'; let output = `${prepend}(?:${input})${append}`; if (state.negated === true) { output = `(?:^(?!${output}).*$)`; } return output; }; exports.basename = (path, { windows } = {}) => { const segs = path.split(windows ? /[\\/]/ : '/'); const last = segs[segs.length - 1]; if (last === '') { return segs[segs.length - 2]; } return last; }; /***/ }), /***/ 2946: /***/ ((module) => { var processFn = function (fn, P, opts) { return function () { var that = this; var args = new Array(arguments.length); for (var i = 0; i < arguments.length; i++) { args[i] = arguments[i]; } return new P(function (resolve, reject) { args.push(function (err, result) { if (err) { reject(err); } else if (opts.multiArgs) { var results = new Array(arguments.length - 1); for (var i = 1; i < arguments.length; i++) { results[i - 1] = arguments[i]; } resolve(results); } else { resolve(result); } }); fn.apply(that, args); }); }; }; var pify = module.exports = function (obj, P, opts) { if (typeof P !== 'function') { opts = P; P = Promise; } opts = opts || {}; opts.exclude = opts.exclude || [/.+Sync$/]; var filter = function (key) { var match = function (pattern) { return typeof pattern === 'string' ? key === pattern : pattern.test(key); }; return opts.include ? opts.include.some(match) : !opts.exclude.some(match); }; var ret = typeof obj === 'function' ? function () { if (opts.excludeMain) { return obj.apply(this, arguments); } return processFn(obj, P, opts).apply(this, arguments); } : {}; return Object.keys(obj).reduce(function (ret, key) { var x = obj[key]; ret[key] = typeof x === 'function' && filter(key) ? processFn(x, P, opts) : x; return ret; }, ret); }; pify.all = pify; /***/ }), /***/ 3590: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = typeof Promise === 'function' ? Promise : __nccwpck_require__(4206); /***/ }), /***/ 4206: /***/ ((module) => { var PENDING = 'pending'; var SETTLED = 'settled'; var FULFILLED = 'fulfilled'; var REJECTED = 'rejected'; var NOOP = function () {}; var isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function'; var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate; var asyncQueue = []; var asyncTimer; function asyncFlush() { // run promise callbacks for (var i = 0; i < asyncQueue.length; i++) { asyncQueue[i][0](asyncQueue[i][1]); } // reset async asyncQueue asyncQueue = []; asyncTimer = false; } function asyncCall(callback, arg) { asyncQueue.push([callback, arg]); if (!asyncTimer) { asyncTimer = true; asyncSetTimer(asyncFlush, 0); } } function invokeResolver(resolver, promise) { function resolvePromise(value) { resolve(promise, value); } function rejectPromise(reason) { reject(promise, reason); } try { resolver(resolvePromise, rejectPromise); } catch (e) { rejectPromise(e); } } function invokeCallback(subscriber) { var owner = subscriber.owner; var settled = owner._state; var value = owner._data; var callback = subscriber[settled]; var promise = subscriber.then; if (typeof callback === 'function') { settled = FULFILLED; try { value = callback(value); } catch (e) { reject(promise, e); } } if (!handleThenable(promise, value)) { if (settled === FULFILLED) { resolve(promise, value); } if (settled === REJECTED) { reject(promise, value); } } } function handleThenable(promise, value) { var resolved; try { if (promise === value) { throw new TypeError('A promises callback cannot return that same promise.'); } if (value && (typeof value === 'function' || typeof value === 'object')) { // then should be retrieved only once var then = value.then; if (typeof then === 'function') { then.call(value, function (val) { if (!resolved) { resolved = true; if (value === val) { fulfill(promise, val); } else { resolve(promise, val); } } }, function (reason) { if (!resolved) { resolved = true; reject(promise, reason); } }); return true; } } } catch (e) { if (!resolved) { reject(promise, e); } return true; } return false; } function resolve(promise, value) { if (promise === value || !handleThenable(promise, value)) { fulfill(promise, value); } } function fulfill(promise, value) { if (promise._state === PENDING) { promise._state = SETTLED; promise._data = value; asyncCall(publishFulfillment, promise); } } function reject(promise, reason) { if (promise._state === PENDING) { promise._state = SETTLED; promise._data = reason; asyncCall(publishRejection, promise); } } function publish(promise) { promise._then = promise._then.forEach(invokeCallback); } function publishFulfillment(promise) { promise._state = FULFILLED; publish(promise); } function publishRejection(promise) { promise._state = REJECTED; publish(promise); if (!promise._handled && isNode) { global.process.emit('unhandledRejection', promise._data, promise); } } function notifyRejectionHandled(promise) { global.process.emit('rejectionHandled', promise); } /** * @class */ function Promise(resolver) { if (typeof resolver !== 'function') { throw new TypeError('Promise resolver ' + resolver + ' is not a function'); } if (this instanceof Promise === false) { throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.'); } this._then = []; invokeResolver(resolver, this); } Promise.prototype = { constructor: Promise, _state: PENDING, _then: null, _data: undefined, _handled: false, then: function (onFulfillment, onRejection) { var subscriber = { owner: this, then: new this.constructor(NOOP), fulfilled: onFulfillment, rejected: onRejection }; if ((onRejection || onFulfillment) && !this._handled) { this._handled = true; if (this._state === REJECTED && isNode) { asyncCall(notifyRejectionHandled, this); } } if (this._state === FULFILLED || this._state === REJECTED) { // already resolved, call callback async asyncCall(invokeCallback, subscriber); } else { // subscribe this._then.push(subscriber); } return subscriber.then; }, catch: function (onRejection) { return this.then(null, onRejection); } }; Promise.all = function (promises) { if (!Array.isArray(promises)) { throw new TypeError('You must pass an array to Promise.all().'); } return new Promise(function (resolve, reject) { var results = []; var remaining = 0; function resolver(index) { remaining++; return function (value) { results[index] = value; if (!--remaining) { resolve(results); } }; } for (var i = 0, promise; i < promises.length; i++) { promise = promises[i]; if (promise && typeof promise.then === 'function') { promise.then(resolver(i), reject); } else { results[i] = promise; } } if (!remaining) { resolve(results); } }); }; Promise.race = function (promises) { if (!Array.isArray(promises)) { throw new TypeError('You must pass an array to Promise.race().'); } return new Promise(function (resolve, reject) { for (var i = 0, promise; i < promises.length; i++) { promise = promises[i]; if (promise && typeof promise.then === 'function') { promise.then(resolve, reject); } else { resolve(promise); } } }); }; Promise.resolve = function (value) { if (value && typeof value === 'object' && value.constructor === Promise) { return value; } return new Promise(function (resolve) { resolve(value); }); }; Promise.reject = function (reason) { return new Promise(function (resolve, reject) { reject(reason); }); }; module.exports = Promise; /***/ }), /***/ 8879: /***/ ((module) => { /** @type {import('.')} */ module.exports = [ 'Float16Array', 'Float32Array', 'Float64Array', 'Int8Array', 'Int16Array', 'Int32Array', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'BigInt64Array', 'BigUint64Array' ]; /***/ }), /***/ 1564: /***/ ((module) => { if (typeof process === 'undefined' || !process.version || process.version.indexOf('v0.') === 0 || process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { module.exports = { nextTick: nextTick }; } else { module.exports = process } function nextTick(fn, arg1, arg2, arg3) { if (typeof fn !== 'function') { throw new TypeError('"callback" argument must be a function'); } var len = arguments.length; var args, i; switch (len) { case 0: case 1: return process.nextTick(fn); case 2: return process.nextTick(function afterTickOne() { fn.call(null, arg1); }); case 3: return process.nextTick(function afterTickTwo() { fn.call(null, arg1, arg2); }); case 4: return process.nextTick(function afterTickThree() { fn.call(null, arg1, arg2, arg3); }); default: args = new Array(len - 1); i = 0; while (i < args.length) { args[i++] = arguments[i]; } return process.nextTick(function afterTick() { fn.apply(null, args); }); } } /***/ }), /***/ 8328: /***/ ((module) => { /** Highest positive signed 32-bit float value */ const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 /** Bootstring parameters */ const base = 36; const tMin = 1; const tMax = 26; const skew = 38; const damp = 700; const initialBias = 72; const initialN = 128; // 0x80 const delimiter = '-'; // '\x2D' /** Regular expressions */ const regexPunycode = /^xn--/; const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too. const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators /** Error messages */ const errors = { 'overflow': 'Overflow: input needs wider integers to process', 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', 'invalid-input': 'Invalid input' }; /** Convenience shortcuts */ const baseMinusTMin = base - tMin; const floor = Math.floor; const stringFromCharCode = String.fromCharCode; /*--------------------------------------------------------------------------*/ /** * A generic error utility function. * @private * @param {String} type The error type. * @returns {Error} Throws a `RangeError` with the applicable error message. */ function error(type) { throw new RangeError(errors[type]); } /** * A generic `Array#map` utility function. * @private * @param {Array} array The array to iterate over. * @param {Function} callback The function that gets called for every array * item. * @returns {Array} A new array of values returned by the callback function. */ function map(array, callback) { const result = []; let length = array.length; while (length--) { result[length] = callback(array[length]); } return result; } /** * A simple `Array#map`-like wrapper to work with domain name strings or email * addresses. * @private * @param {String} domain The domain name or email address. * @param {Function} callback The function that gets called for every * character. * @returns {String} A new string of characters returned by the callback * function. */ function mapDomain(domain, callback) { const parts = domain.split('@'); let result = ''; if (parts.length > 1) { // In email addresses, only the domain name should be punycoded. Leave // the local part (i.e. everything up to `@`) intact. result = parts[0] + '@'; domain = parts[1]; } // Avoid `split(regex)` for IE8 compatibility. See #17. domain = domain.replace(regexSeparators, '\x2E'); const labels = domain.split('.'); const encoded = map(labels, callback).join('.'); return result + encoded; } /** * Creates an array containing the numeric code points of each Unicode * character in the string. While JavaScript uses UCS-2 internally, * this function will convert a pair of surrogate halves (each of which * UCS-2 exposes as separate characters) into a single code point, * matching UTF-16. * @see `punycode.ucs2.encode` * @see * @memberOf punycode.ucs2 * @name decode * @param {String} string The Unicode input string (UCS-2). * @returns {Array} The new array of code points. */ function ucs2decode(string) { const output = []; let counter = 0; const length = string.length; while (counter < length) { const value = string.charCodeAt(counter++); if (value >= 0xD800 && value <= 0xDBFF && counter < length) { // It's a high surrogate, and there is a next character. const extra = string.charCodeAt(counter++); if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); } else { // It's an unmatched surrogate; only append this code unit, in case the // next code unit is the high surrogate of a surrogate pair. output.push(value); counter--; } } else { output.push(value); } } return output; } /** * Creates a string based on an array of numeric code points. * @see `punycode.ucs2.decode` * @memberOf punycode.ucs2 * @name encode * @param {Array} codePoints The array of numeric code points. * @returns {String} The new Unicode string (UCS-2). */ const ucs2encode = codePoints => String.fromCodePoint(...codePoints); /** * Converts a basic code point into a digit/integer. * @see `digitToBasic()` * @private * @param {Number} codePoint The basic numeric code point value. * @returns {Number} The numeric value of a basic code point (for use in * representing integers) in the range `0` to `base - 1`, or `base` if * the code point does not represent a value. */ const basicToDigit = function(codePoint) { if (codePoint >= 0x30 && codePoint < 0x3A) { return 26 + (codePoint - 0x30); } if (codePoint >= 0x41 && codePoint < 0x5B) { return codePoint - 0x41; } if (codePoint >= 0x61 && codePoint < 0x7B) { return codePoint - 0x61; } return base; }; /** * Converts a digit/integer into a basic code point. * @see `basicToDigit()` * @private * @param {Number} digit The numeric value of a basic code point. * @returns {Number} The basic code point whose value (when used for * representing integers) is `digit`, which needs to be in the range * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is * used; else, the lowercase form is used. The behavior is undefined * if `flag` is non-zero and `digit` has no uppercase form. */ const digitToBasic = function(digit, flag) { // 0..25 map to ASCII a..z or A..Z // 26..35 map to ASCII 0..9 return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); }; /** * Bias adaptation function as per section 3.4 of RFC 3492. * https://tools.ietf.org/html/rfc3492#section-3.4 * @private */ const adapt = function(delta, numPoints, firstTime) { let k = 0; delta = firstTime ? floor(delta / damp) : delta >> 1; delta += floor(delta / numPoints); for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { delta = floor(delta / baseMinusTMin); } return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); }; /** * Converts a Punycode string of ASCII-only symbols to a string of Unicode * symbols. * @memberOf punycode * @param {String} input The Punycode string of ASCII-only symbols. * @returns {String} The resulting string of Unicode symbols. */ const decode = function(input) { // Don't use UCS-2. const output = []; const inputLength = input.length; let i = 0; let n = initialN; let bias = initialBias; // Handle the basic code points: let `basic` be the number of input code // points before the last delimiter, or `0` if there is none, then copy // the first basic code points to the output. let basic = input.lastIndexOf(delimiter); if (basic < 0) { basic = 0; } for (let j = 0; j < basic; ++j) { // if it's not a basic code point if (input.charCodeAt(j) >= 0x80) { error('not-basic'); } output.push(input.charCodeAt(j)); } // Main decoding loop: start just after the last delimiter if any basic code // points were copied; start at the beginning otherwise. for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { // `index` is the index of the next character to be consumed. // Decode a generalized variable-length integer into `delta`, // which gets added to `i`. The overflow checking is easier // if we increase `i` as we go, then subtract off its starting // value at the end to obtain `delta`. const oldi = i; for (let w = 1, k = base; /* no condition */; k += base) { if (index >= inputLength) { error('invalid-input'); } const digit = basicToDigit(input.charCodeAt(index++)); if (digit >= base) { error('invalid-input'); } if (digit > floor((maxInt - i) / w)) { error('overflow'); } i += digit * w; const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); if (digit < t) { break; } const baseMinusT = base - t; if (w > floor(maxInt / baseMinusT)) { error('overflow'); } w *= baseMinusT; } const out = output.length + 1; bias = adapt(i - oldi, out, oldi == 0); // `i` was supposed to wrap around from `out` to `0`, // incrementing `n` each time, so we'll fix that now: if (floor(i / out) > maxInt - n) { error('overflow'); } n += floor(i / out); i %= out; // Insert `n` at position `i` of the output. output.splice(i++, 0, n); } return String.fromCodePoint(...output); }; /** * Converts a string of Unicode symbols (e.g. a domain name label) to a * Punycode string of ASCII-only symbols. * @memberOf punycode * @param {String} input The string of Unicode symbols. * @returns {String} The resulting Punycode string of ASCII-only symbols. */ const encode = function(input) { const output = []; // Convert the input in UCS-2 to an array of Unicode code points. input = ucs2decode(input); // Cache the length. const inputLength = input.length; // Initialize the state. let n = initialN; let delta = 0; let bias = initialBias; // Handle the basic code points. for (const currentValue of input) { if (currentValue < 0x80) { output.push(stringFromCharCode(currentValue)); } } const basicLength = output.length; let handledCPCount = basicLength; // `handledCPCount` is the number of code points that have been handled; // `basicLength` is the number of basic code points. // Finish the basic string with a delimiter unless it's empty. if (basicLength) { output.push(delimiter); } // Main encoding loop: while (handledCPCount < inputLength) { // All non-basic code points < n have been handled already. Find the next // larger one: let m = maxInt; for (const currentValue of input) { if (currentValue >= n && currentValue < m) { m = currentValue; } } // Increase `delta` enough to advance the decoder's state to , // but guard against overflow. const handledCPCountPlusOne = handledCPCount + 1; if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { error('overflow'); } delta += (m - n) * handledCPCountPlusOne; n = m; for (const currentValue of input) { if (currentValue < n && ++delta > maxInt) { error('overflow'); } if (currentValue === n) { // Represent delta as a generalized variable-length integer. let q = delta; for (let k = base; /* no condition */; k += base) { const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); if (q < t) { break; } const qMinusT = q - t; const baseMinusT = base - t; output.push( stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) ); q = floor(qMinusT / baseMinusT); } output.push(stringFromCharCode(digitToBasic(q, 0))); bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); delta = 0; ++handledCPCount; } } ++delta; ++n; } return output.join(''); }; /** * Converts a Punycode string representing a domain name or an email address * to Unicode. Only the Punycoded parts of the input will be converted, i.e. * it doesn't matter if you call it on a string that has already been * converted to Unicode. * @memberOf punycode * @param {String} input The Punycoded domain name or email address to * convert to Unicode. * @returns {String} The Unicode representation of the given Punycode * string. */ const toUnicode = function(input) { return mapDomain(input, function(string) { return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; }); }; /** * Converts a Unicode string representing a domain name or an email address to * Punycode. Only the non-ASCII parts of the domain name will be converted, * i.e. it doesn't matter if you call it with a domain that's already in * ASCII. * @memberOf punycode * @param {String} input The domain name or email address to convert, as a * Unicode string. * @returns {String} The Punycode representation of the given domain name or * email address. */ const toASCII = function(input) { return mapDomain(input, function(string) { return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; }); }; /*--------------------------------------------------------------------------*/ /** Define the public API */ const punycode = { /** * A string representing the current Punycode.js version number. * @memberOf punycode * @type String */ 'version': '2.3.1', /** * An object of methods to convert from JavaScript's internal character * representation (UCS-2) to Unicode code points, and back. * @see * @memberOf punycode * @type Object */ 'ucs2': { 'decode': ucs2decode, 'encode': ucs2encode }, 'decode': decode, 'encode': encode, 'toASCII': toASCII, 'toUnicode': toUnicode }; module.exports = punycode; /***/ }), /***/ 6141: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = __nccwpck_require__(6131).Duplex /***/ }), /***/ 2063: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // Copyright Joyent, Inc. and other Node contributors. // // 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. // a duplex stream is just a stream that is both readable and writable. // Since JS doesn't have multiple prototypal inheritance, this class // prototypally inherits from Readable, and then parasitically from // Writable. /**/ var pna = __nccwpck_require__(1564); /**/ /**/ var objectKeys = Object.keys || function (obj) { var keys = []; for (var key in obj) { keys.push(key); }return keys; }; /**/ module.exports = Duplex; /**/ var util = Object.create(__nccwpck_require__(5481)); util.inherits = __nccwpck_require__(9598); /**/ var Readable = __nccwpck_require__(6893); var Writable = __nccwpck_require__(8797); util.inherits(Duplex, Readable); { // avoid scope creep, the keys array can then be collected var keys = objectKeys(Writable.prototype); for (var v = 0; v < keys.length; v++) { var method = keys[v]; if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; } } function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); Readable.call(this, options); Writable.call(this, options); if (options && options.readable === false) this.readable = false; if (options && options.writable === false) this.writable = false; this.allowHalfOpen = true; if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; this.once('end', onend); } Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function () { return this._writableState.highWaterMark; } }); // the no-half-open enforcer function onend() { // if we allow half-open state, or if the writable side ended, // then we're ok. if (this.allowHalfOpen || this._writableState.ended) return; // no more data can be written. // But allow more writes to happen in this tick. pna.nextTick(onEndNT, this); } function onEndNT(self) { self.end(); } Object.defineProperty(Duplex.prototype, 'destroyed', { get: function () { if (this._readableState === undefined || this._writableState === undefined) { return false; } return this._readableState.destroyed && this._writableState.destroyed; }, set: function (value) { // we ignore the value if the stream // has not been initialized yet if (this._readableState === undefined || this._writableState === undefined) { return; } // backward compatibility, the user is explicitly // managing destroyed this._readableState.destroyed = value; this._writableState.destroyed = value; } }); Duplex.prototype._destroy = function (err, cb) { this.push(null); this.end(); pna.nextTick(cb, err); }; /***/ }), /***/ 5283: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // Copyright Joyent, Inc. and other Node contributors. // // 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. // a passthrough stream. // basically just the most minimal sort of Transform stream. // Every written chunk gets output as-is. module.exports = PassThrough; var Transform = __nccwpck_require__(2337); /**/ var util = Object.create(__nccwpck_require__(5481)); util.inherits = __nccwpck_require__(9598); /**/ util.inherits(PassThrough, Transform); function PassThrough(options) { if (!(this instanceof PassThrough)) return new PassThrough(options); Transform.call(this, options); } PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); }; /***/ }), /***/ 6893: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // Copyright Joyent, Inc. and other Node contributors. // // 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. /**/ var pna = __nccwpck_require__(1564); /**/ module.exports = Readable; /**/ var isArray = __nccwpck_require__(2513); /**/ /**/ var Duplex; /**/ Readable.ReadableState = ReadableState; /**/ var EE = (__nccwpck_require__(4434).EventEmitter); var EElistenerCount = function (emitter, type) { return emitter.listeners(type).length; }; /**/ /**/ var Stream = __nccwpck_require__(3283); /**/ /**/ var Buffer = (__nccwpck_require__(1475).Buffer); var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } /**/ /**/ var util = Object.create(__nccwpck_require__(5481)); util.inherits = __nccwpck_require__(9598); /**/ /**/ var debugUtil = __nccwpck_require__(9023); var debug = void 0; if (debugUtil && debugUtil.debuglog) { debug = debugUtil.debuglog('stream'); } else { debug = function () {}; } /**/ var BufferList = __nccwpck_require__(9381); var destroyImpl = __nccwpck_require__(5089); var StringDecoder; util.inherits(Readable, Stream); var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; function prependListener(emitter, event, fn) { // Sadly this is not cacheable as some libraries bundle their own // event emitter implementation with them. if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any // userland ones. NEVER DO THIS. This is here only because this code needs // to continue to work with older versions of Node.js that do not include // the prependListener() method. The goal is to eventually remove this hack. if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; } function ReadableState(options, stream) { Duplex = Duplex || __nccwpck_require__(2063); options = options || {}; // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream. // These options can be provided separately as readableXXX and writableXXX. var isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to // make all the buffer merging and length checks go away this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer // Note: 0 is a valid value, means "don't call _read preemptively ever" var hwm = options.highWaterMark; var readableHwm = options.readableHighWaterMark; var defaultHwm = this.objectMode ? 16 : 16 * 1024; if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; // cast to ints. this.highWaterMark = Math.floor(this.highWaterMark); // A linked list is used to store data chunks instead of an array because the // linked list can remove elements from the beginning faster than // array.shift() this.buffer = new BufferList(); this.length = 0; this.pipes = null; this.pipesCount = 0; this.flowing = null; this.ended = false; this.endEmitted = false; this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted // immediately, or on a later tick. We set this to true at first, because // any actions that shouldn't happen until "later" should generally also // not happen before the first read call. this.sync = true; // whenever we return null, then we set a flag to say // that we're awaiting a 'readable' event emission. this.needReadable = false; this.emittedReadable = false; this.readableListening = false; this.resumeScheduled = false; // has it been destroyed this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled this.readingMore = false; this.decoder = null; this.encoding = null; if (options.encoding) { if (!StringDecoder) StringDecoder = (__nccwpck_require__(634)/* .StringDecoder */ .I); this.decoder = new StringDecoder(options.encoding); this.encoding = options.encoding; } } function Readable(options) { Duplex = Duplex || __nccwpck_require__(2063); if (!(this instanceof Readable)) return new Readable(options); this._readableState = new ReadableState(options, this); // legacy this.readable = true; if (options) { if (typeof options.read === 'function') this._read = options.read; if (typeof options.destroy === 'function') this._destroy = options.destroy; } Stream.call(this); } Object.defineProperty(Readable.prototype, 'destroyed', { get: function () { if (this._readableState === undefined) { return false; } return this._readableState.destroyed; }, set: function (value) { // we ignore the value if the stream // has not been initialized yet if (!this._readableState) { return; } // backward compatibility, the user is explicitly // managing destroyed this._readableState.destroyed = value; } }); Readable.prototype.destroy = destroyImpl.destroy; Readable.prototype._undestroy = destroyImpl.undestroy; Readable.prototype._destroy = function (err, cb) { this.push(null); cb(err); }; // Manually shove something into the read() buffer. // This returns true if the highWaterMark has not been hit yet, // similar to how Writable.write() returns true if you should // write() some more. Readable.prototype.push = function (chunk, encoding) { var state = this._readableState; var skipChunkCheck; if (!state.objectMode) { if (typeof chunk === 'string') { encoding = encoding || state.defaultEncoding; if (encoding !== state.encoding) { chunk = Buffer.from(chunk, encoding); encoding = ''; } skipChunkCheck = true; } } else { skipChunkCheck = true; } return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); }; // Unshift should *always* be something directly out of read() Readable.prototype.unshift = function (chunk) { return readableAddChunk(this, chunk, null, true, false); }; function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { var state = stream._readableState; if (chunk === null) { state.reading = false; onEofChunk(stream, state); } else { var er; if (!skipChunkCheck) er = chunkInvalid(state, chunk); if (er) { stream.emit('error', er); } else if (state.objectMode || chunk && chunk.length > 0) { if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { chunk = _uint8ArrayToBuffer(chunk); } if (addToFront) { if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); } else if (state.ended) { stream.emit('error', new Error('stream.push() after EOF')); } else { state.reading = false; if (state.decoder && !encoding) { chunk = state.decoder.write(chunk); if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); } else { addChunk(stream, state, chunk, false); } } } else if (!addToFront) { state.reading = false; } } return needMoreData(state); } function addChunk(stream, state, chunk, addToFront) { if (state.flowing && state.length === 0 && !state.sync) { stream.emit('data', chunk); stream.read(0); } else { // update the buffer info. state.length += state.objectMode ? 1 : chunk.length; if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); if (state.needReadable) emitReadable(stream); } maybeReadMore(stream, state); } function chunkInvalid(state, chunk) { var er; if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { er = new TypeError('Invalid non-string/buffer chunk'); } return er; } // if it's past the high water mark, we can push in some more. // Also, if we have no data yet, we can stand some // more bytes. This is to work around cases where hwm=0, // such as the repl. Also, if the push() triggered a // readable event, and the user called read(largeNumber) such that // needReadable was set, then we ought to push more, so that another // 'readable' event will be triggered. function needMoreData(state) { return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); } Readable.prototype.isPaused = function () { return this._readableState.flowing === false; }; // backwards compatibility. Readable.prototype.setEncoding = function (enc) { if (!StringDecoder) StringDecoder = (__nccwpck_require__(634)/* .StringDecoder */ .I); this._readableState.decoder = new StringDecoder(enc); this._readableState.encoding = enc; return this; }; // Don't raise the hwm > 8MB var MAX_HWM = 0x800000; function computeNewHighWaterMark(n) { if (n >= MAX_HWM) { n = MAX_HWM; } else { // Get the next highest power of 2 to prevent increasing hwm excessively in // tiny amounts n--; n |= n >>> 1; n |= n >>> 2; n |= n >>> 4; n |= n >>> 8; n |= n >>> 16; n++; } return n; } // This function is designed to be inlinable, so please take care when making // changes to the function body. function howMuchToRead(n, state) { if (n <= 0 || state.length === 0 && state.ended) return 0; if (state.objectMode) return 1; if (n !== n) { // Only flow one buffer at a time if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; } // If we're asking for more than the current hwm, then raise the hwm. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); if (n <= state.length) return n; // Don't have enough if (!state.ended) { state.needReadable = true; return 0; } return state.length; } // you can override either this method, or the async _read(n) below. Readable.prototype.read = function (n) { debug('read', n); n = parseInt(n, 10); var state = this._readableState; var nOrig = n; if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we // already have a bunch of data in the buffer, then just trigger // the 'readable' event and move on. if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { debug('read: emitReadable', state.length, state.ended); if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); return null; } n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up. if (n === 0 && state.ended) { if (state.length === 0) endReadable(this); return null; } // All the actual chunk generation logic needs to be // *below* the call to _read. The reason is that in certain // synthetic stream cases, such as passthrough streams, _read // may be a completely synchronous operation which may change // the state of the read buffer, providing enough data when // before there was *not* enough. // // So, the steps are: // 1. Figure out what the state of things will be after we do // a read from the buffer. // // 2. If that resulting state will trigger a _read, then call _read. // Note that this may be asynchronous, or synchronous. Yes, it is // deeply ugly to write APIs this way, but that still doesn't mean // that the Readable class should behave improperly, as streams are // designed to be sync/async agnostic. // Take note if the _read call is sync or async (ie, if the read call // has returned yet), so that we know whether or not it's safe to emit // 'readable' etc. // // 3. Actually pull the requested chunks out of the buffer and return. // if we need a readable event, then we need to do some reading. var doRead = state.needReadable; debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some if (state.length === 0 || state.length - n < state.highWaterMark) { doRead = true; debug('length less than watermark', doRead); } // however, if we've ended, then there's no point, and if we're already // reading, then it's unnecessary. if (state.ended || state.reading) { doRead = false; debug('reading or ended', doRead); } else if (doRead) { debug('do read'); state.reading = true; state.sync = true; // if the length is currently zero, then we *need* a readable event. if (state.length === 0) state.needReadable = true; // call internal read method this._read(state.highWaterMark); state.sync = false; // If _read pushed data synchronously, then `reading` will be false, // and we need to re-evaluate how much data we can return to the user. if (!state.reading) n = howMuchToRead(nOrig, state); } var ret; if (n > 0) ret = fromList(n, state);else ret = null; if (ret === null) { state.needReadable = true; n = 0; } else { state.length -= n; } if (state.length === 0) { // If we have nothing in the buffer, then we want to know // as soon as we *do* get something into the buffer. if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. if (nOrig !== n && state.ended) endReadable(this); } if (ret !== null) this.emit('data', ret); return ret; }; function onEofChunk(stream, state) { if (state.ended) return; if (state.decoder) { var chunk = state.decoder.end(); if (chunk && chunk.length) { state.buffer.push(chunk); state.length += state.objectMode ? 1 : chunk.length; } } state.ended = true; // emit 'readable' now to make sure it gets picked up. emitReadable(stream); } // Don't emit readable right away in sync mode, because this can trigger // another read() call => stack overflow. This way, it might trigger // a nextTick recursion warning, but that's not so bad. function emitReadable(stream) { var state = stream._readableState; state.needReadable = false; if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); } } function emitReadable_(stream) { debug('emit readable'); stream.emit('readable'); flow(stream); } // at this point, the user has presumably seen the 'readable' event, // and called read() to consume some data. that may have triggered // in turn another _read(n) call, in which case reading = true if // it's in progress. // However, if we're not ended, or reading, and the length < hwm, // then go ahead and try to read some more preemptively. function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; pna.nextTick(maybeReadMore_, stream, state); } } function maybeReadMore_(stream, state) { var len = state.length; while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { debug('maybeReadMore read 0'); stream.read(0); if (len === state.length) // didn't get any data, stop spinning. break;else len = state.length; } state.readingMore = false; } // abstract method. to be overridden in specific implementation classes. // call cb(er, data) where data is <= n in length. // for virtual (non-string, non-buffer) streams, "length" is somewhat // arbitrary, and perhaps not very meaningful. Readable.prototype._read = function (n) { this.emit('error', new Error('_read() is not implemented')); }; Readable.prototype.pipe = function (dest, pipeOpts) { var src = this; var state = this._readableState; switch (state.pipesCount) { case 0: state.pipes = dest; break; case 1: state.pipes = [state.pipes, dest]; break; default: state.pipes.push(dest); break; } state.pipesCount += 1; debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; var endFn = doEnd ? onend : unpipe; if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); dest.on('unpipe', onunpipe); function onunpipe(readable, unpipeInfo) { debug('onunpipe'); if (readable === src) { if (unpipeInfo && unpipeInfo.hasUnpiped === false) { unpipeInfo.hasUnpiped = true; cleanup(); } } } function onend() { debug('onend'); dest.end(); } // when the dest drains, it reduces the awaitDrain counter // on the source. This would be more elegant with a .once() // handler in flow(), but adding and removing repeatedly is // too slow. var ondrain = pipeOnDrain(src); dest.on('drain', ondrain); var cleanedUp = false; function cleanup() { debug('cleanup'); // cleanup event handlers once the pipe is broken dest.removeListener('close', onclose); dest.removeListener('finish', onfinish); dest.removeListener('drain', ondrain); dest.removeListener('error', onerror); dest.removeListener('unpipe', onunpipe); src.removeListener('end', onend); src.removeListener('end', unpipe); src.removeListener('data', ondata); cleanedUp = true; // if the reader is waiting for a drain event from this // specific writer, then it would cause it to never start // flowing again. // So, if this is awaiting a drain, then we just call it now. // If we don't know, then assume that we are waiting for one. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } // If the user pushes more data while we're writing to dest then we'll end up // in ondata again. However, we only want to increase awaitDrain once because // dest will only emit one 'drain' event for the multiple writes. // => Introduce a guard on increasing awaitDrain. var increasedAwaitDrain = false; src.on('data', ondata); function ondata(chunk) { debug('ondata'); increasedAwaitDrain = false; var ret = dest.write(chunk); if (false === ret && !increasedAwaitDrain) { // If the user unpiped during `dest.write()`, it is possible // to get stuck in a permanently paused state if that write // also returned false. // => Check whether `dest` is still a piping destination. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { debug('false write response, pause', state.awaitDrain); state.awaitDrain++; increasedAwaitDrain = true; } src.pause(); } } // if the dest has an error, then stop piping into it. // however, don't suppress the throwing behavior for this. function onerror(er) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); } // Make sure our error handler is attached before userland ones. prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once. function onclose() { dest.removeListener('finish', onfinish); unpipe(); } dest.once('close', onclose); function onfinish() { debug('onfinish'); dest.removeListener('close', onclose); unpipe(); } dest.once('finish', onfinish); function unpipe() { debug('unpipe'); src.unpipe(dest); } // tell the dest that it's being piped to dest.emit('pipe', src); // start the flow if it hasn't been started already. if (!state.flowing) { debug('pipe resume'); src.resume(); } return dest; }; function pipeOnDrain(src) { return function () { var state = src._readableState; debug('pipeOnDrain', state.awaitDrain); if (state.awaitDrain) state.awaitDrain--; if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { state.flowing = true; flow(src); } }; } Readable.prototype.unpipe = function (dest) { var state = this._readableState; var unpipeInfo = { hasUnpiped: false }; // if we're not piping anywhere, then do nothing. if (state.pipesCount === 0) return this; // just one destination. most common case. if (state.pipesCount === 1) { // passed in one, but it's not the right one. if (dest && dest !== state.pipes) return this; if (!dest) dest = state.pipes; // got a match. state.pipes = null; state.pipesCount = 0; state.flowing = false; if (dest) dest.emit('unpipe', this, unpipeInfo); return this; } // slow case. multiple pipe destinations. if (!dest) { // remove all. var dests = state.pipes; var len = state.pipesCount; state.pipes = null; state.pipesCount = 0; state.flowing = false; for (var i = 0; i < len; i++) { dests[i].emit('unpipe', this, { hasUnpiped: false }); }return this; } // try to find the right one. var index = indexOf(state.pipes, dest); if (index === -1) return this; state.pipes.splice(index, 1); state.pipesCount -= 1; if (state.pipesCount === 1) state.pipes = state.pipes[0]; dest.emit('unpipe', this, unpipeInfo); return this; }; // set up data events if they are asked for // Ensure readable listeners eventually get something Readable.prototype.on = function (ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); if (ev === 'data') { // Start flowing on next tick if stream isn't explicitly paused if (this._readableState.flowing !== false) this.resume(); } else if (ev === 'readable') { var state = this._readableState; if (!state.endEmitted && !state.readableListening) { state.readableListening = state.needReadable = true; state.emittedReadable = false; if (!state.reading) { pna.nextTick(nReadingNextTick, this); } else if (state.length) { emitReadable(this); } } } return res; }; Readable.prototype.addListener = Readable.prototype.on; function nReadingNextTick(self) { debug('readable nexttick read 0'); self.read(0); } // pause() and resume() are remnants of the legacy readable stream API // If the user uses them, then switch into old mode. Readable.prototype.resume = function () { var state = this._readableState; if (!state.flowing) { debug('resume'); state.flowing = true; resume(this, state); } return this; }; function resume(stream, state) { if (!state.resumeScheduled) { state.resumeScheduled = true; pna.nextTick(resume_, stream, state); } } function resume_(stream, state) { if (!state.reading) { debug('resume read 0'); stream.read(0); } state.resumeScheduled = false; state.awaitDrain = 0; stream.emit('resume'); flow(stream); if (state.flowing && !state.reading) stream.read(0); } Readable.prototype.pause = function () { debug('call pause flowing=%j', this._readableState.flowing); if (false !== this._readableState.flowing) { debug('pause'); this._readableState.flowing = false; this.emit('pause'); } return this; }; function flow(stream) { var state = stream._readableState; debug('flow', state.flowing); while (state.flowing && stream.read() !== null) {} } // wrap an old-style stream as the async data source. // This is *not* part of the readable stream interface. // It is an ugly unfortunate mess of history. Readable.prototype.wrap = function (stream) { var _this = this; var state = this._readableState; var paused = false; stream.on('end', function () { debug('wrapped end'); if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) _this.push(chunk); } _this.push(null); }); stream.on('data', function (chunk) { debug('wrapped data'); if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; var ret = _this.push(chunk); if (!ret) { paused = true; stream.pause(); } }); // proxy all the other methods. // important when wrapping filters and duplexes. for (var i in stream) { if (this[i] === undefined && typeof stream[i] === 'function') { this[i] = function (method) { return function () { return stream[method].apply(stream, arguments); }; }(i); } } // proxy certain important events. for (var n = 0; n < kProxyEvents.length; n++) { stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); } // when we try to consume some more bytes, simply unpause the // underlying stream. this._read = function (n) { debug('wrapped _read', n); if (paused) { paused = false; stream.resume(); } }; return this; }; Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function () { return this._readableState.highWaterMark; } }); // exposed for testing purposes only. Readable._fromList = fromList; // Pluck off n bytes from an array of buffers. // Length is the combined lengths of all the buffers in the list. // This function is designed to be inlinable, so please take care when making // changes to the function body. function fromList(n, state) { // nothing buffered if (state.length === 0) return null; var ret; if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { // read it all, truncate the list if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); state.buffer.clear(); } else { // read part of list ret = fromListPartial(n, state.buffer, state.decoder); } return ret; } // Extracts only enough buffered data to satisfy the amount requested. // This function is designed to be inlinable, so please take care when making // changes to the function body. function fromListPartial(n, list, hasStrings) { var ret; if (n < list.head.data.length) { // slice is the same for buffers and strings ret = list.head.data.slice(0, n); list.head.data = list.head.data.slice(n); } else if (n === list.head.data.length) { // first chunk is a perfect match ret = list.shift(); } else { // result spans more than one buffer ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); } return ret; } // Copies a specified amount of characters from the list of buffered data // chunks. // This function is designed to be inlinable, so please take care when making // changes to the function body. function copyFromBufferString(n, list) { var p = list.head; var c = 1; var ret = p.data; n -= ret.length; while (p = p.next) { var str = p.data; var nb = n > str.length ? str.length : n; if (nb === str.length) ret += str;else ret += str.slice(0, n); n -= nb; if (n === 0) { if (nb === str.length) { ++c; if (p.next) list.head = p.next;else list.head = list.tail = null; } else { list.head = p; p.data = str.slice(nb); } break; } ++c; } list.length -= c; return ret; } // Copies a specified amount of bytes from the list of buffered data chunks. // This function is designed to be inlinable, so please take care when making // changes to the function body. function copyFromBuffer(n, list) { var ret = Buffer.allocUnsafe(n); var p = list.head; var c = 1; p.data.copy(ret); n -= p.data.length; while (p = p.next) { var buf = p.data; var nb = n > buf.length ? buf.length : n; buf.copy(ret, ret.length - n, 0, nb); n -= nb; if (n === 0) { if (nb === buf.length) { ++c; if (p.next) list.head = p.next;else list.head = list.tail = null; } else { list.head = p; p.data = buf.slice(nb); } break; } ++c; } list.length -= c; return ret; } function endReadable(stream) { var state = stream._readableState; // If we get here before consuming all the bytes, then that is a // bug in node. Should never happen. if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); if (!state.endEmitted) { state.ended = true; pna.nextTick(endReadableNT, state, stream); } } function endReadableNT(state, stream) { // Check that we didn't get one last unshift. if (!state.endEmitted && state.length === 0) { state.endEmitted = true; stream.readable = false; stream.emit('end'); } } function indexOf(xs, x) { for (var i = 0, l = xs.length; i < l; i++) { if (xs[i] === x) return i; } return -1; } /***/ }), /***/ 2337: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // Copyright Joyent, Inc. and other Node contributors. // // 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. // a transform stream is a readable/writable stream where you do // something with the data. Sometimes it's called a "filter", // but that's not a great name for it, since that implies a thing where // some bits pass through, and others are simply ignored. (That would // be a valid example of a transform, of course.) // // While the output is causally related to the input, it's not a // necessarily symmetric or synchronous transformation. For example, // a zlib stream might take multiple plain-text writes(), and then // emit a single compressed chunk some time in the future. // // Here's how this works: // // The Transform stream has all the aspects of the readable and writable // stream classes. When you write(chunk), that calls _write(chunk,cb) // internally, and returns false if there's a lot of pending writes // buffered up. When you call read(), that calls _read(n) until // there's enough pending readable data buffered up. // // In a transform stream, the written data is placed in a buffer. When // _read(n) is called, it transforms the queued up data, calling the // buffered _write cb's as it consumes chunks. If consuming a single // written chunk would result in multiple output chunks, then the first // outputted bit calls the readcb, and subsequent chunks just go into // the read buffer, and will cause it to emit 'readable' if necessary. // // This way, back-pressure is actually determined by the reading side, // since _read has to be called to start processing a new chunk. However, // a pathological inflate type of transform can cause excessive buffering // here. For example, imagine a stream where every byte of input is // interpreted as an integer from 0-255, and then results in that many // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in // 1kb of data being output. In this case, you could write a very small // amount of input, and end up with a very large amount of output. In // such a pathological inflating mechanism, there'd be no way to tell // the system to stop doing the transform. A single 4MB write could // cause the system to run out of memory. // // However, even in such a pathological case, only a single written chunk // would be consumed, and then the rest would wait (un-transformed) until // the results of the previous transformed chunk were consumed. module.exports = Transform; var Duplex = __nccwpck_require__(2063); /**/ var util = Object.create(__nccwpck_require__(5481)); util.inherits = __nccwpck_require__(9598); /**/ util.inherits(Transform, Duplex); function afterTransform(er, data) { var ts = this._transformState; ts.transforming = false; var cb = ts.writecb; if (!cb) { return this.emit('error', new Error('write callback called multiple times')); } ts.writechunk = null; ts.writecb = null; if (data != null) // single equals check for both `null` and `undefined` this.push(data); cb(er); var rs = this._readableState; rs.reading = false; if (rs.needReadable || rs.length < rs.highWaterMark) { this._read(rs.highWaterMark); } } function Transform(options) { if (!(this instanceof Transform)) return new Transform(options); Duplex.call(this, options); this._transformState = { afterTransform: afterTransform.bind(this), needTransform: false, transforming: false, writecb: null, writechunk: null, writeencoding: null }; // start out asking for a readable event once data is transformed. this._readableState.needReadable = true; // we have implemented the _read method, and done the other things // that Readable wants before the first _read call, so unset the // sync guard flag. this._readableState.sync = false; if (options) { if (typeof options.transform === 'function') this._transform = options.transform; if (typeof options.flush === 'function') this._flush = options.flush; } // When the writable side finishes, then flush out anything remaining. this.on('prefinish', prefinish); } function prefinish() { var _this = this; if (typeof this._flush === 'function') { this._flush(function (er, data) { done(_this, er, data); }); } else { done(this, null, null); } } Transform.prototype.push = function (chunk, encoding) { this._transformState.needTransform = false; return Duplex.prototype.push.call(this, chunk, encoding); }; // This is the part where you do stuff! // override this function in implementation classes. // 'chunk' is an input chunk. // // Call `push(newChunk)` to pass along transformed output // to the readable side. You may call 'push' zero or more times. // // Call `cb(err)` when you are done with this chunk. If you pass // an error, then that'll put the hurt on the whole operation. If you // never call cb(), then you'll never get another chunk. Transform.prototype._transform = function (chunk, encoding, cb) { throw new Error('_transform() is not implemented'); }; Transform.prototype._write = function (chunk, encoding, cb) { var ts = this._transformState; ts.writecb = cb; ts.writechunk = chunk; ts.writeencoding = encoding; if (!ts.transforming) { var rs = this._readableState; if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } }; // Doesn't matter what the args are here. // _transform does all the work. // That we got here means that the readable side wants more data. Transform.prototype._read = function (n) { var ts = this._transformState; if (ts.writechunk !== null && ts.writecb && !ts.transforming) { ts.transforming = true; this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); } else { // mark that we need a transform, so that any data that comes in // will get processed, now that we've asked for it. ts.needTransform = true; } }; Transform.prototype._destroy = function (err, cb) { var _this2 = this; Duplex.prototype._destroy.call(this, err, function (err2) { cb(err2); _this2.emit('close'); }); }; function done(stream, er, data) { if (er) return stream.emit('error', er); if (data != null) // single equals check for both `null` and `undefined` stream.push(data); // if there's nothing in the write buffer, then that means // that nothing more will ever be provided if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); return stream.push(null); } /***/ }), /***/ 8797: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // Copyright Joyent, Inc. and other Node contributors. // // 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. // A bit simpler than readable streams. // Implement an async ._write(chunk, encoding, cb), and it'll handle all // the drain event emission and buffering. /**/ var pna = __nccwpck_require__(1564); /**/ module.exports = Writable; /* */ function WriteReq(chunk, encoding, cb) { this.chunk = chunk; this.encoding = encoding; this.callback = cb; this.next = null; } // It seems a linked list but it is not // there will be only 2 of these for each stream function CorkedRequest(state) { var _this = this; this.next = null; this.entry = null; this.finish = function () { onCorkedFinish(_this, state); }; } /* */ /**/ var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; /**/ /**/ var Duplex; /**/ Writable.WritableState = WritableState; /**/ var util = Object.create(__nccwpck_require__(5481)); util.inherits = __nccwpck_require__(9598); /**/ /**/ var internalUtil = { deprecate: __nccwpck_require__(4488) }; /**/ /**/ var Stream = __nccwpck_require__(3283); /**/ /**/ var Buffer = (__nccwpck_require__(1475).Buffer); var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } /**/ var destroyImpl = __nccwpck_require__(5089); util.inherits(Writable, Stream); function nop() {} function WritableState(options, stream) { Duplex = Duplex || __nccwpck_require__(2063); options = options || {}; // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream. // These options can be provided separately as readableXXX and writableXXX. var isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream // contains buffers or objects. this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false // Note: 0 is a valid value, means that we always return false if // the entire buffer is not flushed immediately on write() var hwm = options.highWaterMark; var writableHwm = options.writableHighWaterMark; var defaultHwm = this.objectMode ? 16 : 16 * 1024; if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; // cast to ints. this.highWaterMark = Math.floor(this.highWaterMark); // if _final has been called this.finalCalled = false; // drain event flag. this.needDrain = false; // at the start of calling end() this.ending = false; // when end() has been called, and returned this.ended = false; // when 'finish' is emitted this.finished = false; // has it been destroyed this.destroyed = false; // should we decode strings into buffers before passing to _write? // this is here so that some node-core streams can optimize string // handling at a lower level. var noDecode = options.decodeStrings === false; this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement // of how much we're waiting to get pushed to some underlying // socket or file. this.length = 0; // a flag to see when we're in the middle of a write. this.writing = false; // when true all writes will be buffered until .uncork() call this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately, // or on a later tick. We set this to true at first, because any // actions that shouldn't happen until "later" should generally also // not happen before the first write call. this.sync = true; // a flag to know if we're processing previously buffered items, which // may call the _write() callback in the same tick, so that we don't // end up in an overlapped onwrite situation. this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) this.onwrite = function (er) { onwrite(stream, er); }; // the callback that the user supplies to write(chunk,encoding,cb) this.writecb = null; // the amount that is being written when _write is called. this.writelen = 0; this.bufferedRequest = null; this.lastBufferedRequest = null; // number of pending user-supplied write callbacks // this must be 0 before 'finish' can be emitted this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs // This is relevant for synchronous Transform streams this.prefinished = false; // True if the error was already emitted and should not be thrown again this.errorEmitted = false; // count buffered requests this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always // one allocated and free to use, and we maintain at most two this.corkedRequestsFree = new CorkedRequest(this); } WritableState.prototype.getBuffer = function getBuffer() { var current = this.bufferedRequest; var out = []; while (current) { out.push(current); current = current.next; } return out; }; (function () { try { Object.defineProperty(WritableState.prototype, 'buffer', { get: internalUtil.deprecate(function () { return this.getBuffer(); }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') }); } catch (_) {} })(); // Test _writableState for inheritance to account for Duplex streams, // whose prototype chain only points to Readable. var realHasInstance; if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { realHasInstance = Function.prototype[Symbol.hasInstance]; Object.defineProperty(Writable, Symbol.hasInstance, { value: function (object) { if (realHasInstance.call(this, object)) return true; if (this !== Writable) return false; return object && object._writableState instanceof WritableState; } }); } else { realHasInstance = function (object) { return object instanceof this; }; } function Writable(options) { Duplex = Duplex || __nccwpck_require__(2063); // Writable ctor is applied to Duplexes, too. // `realHasInstance` is necessary because using plain `instanceof` // would return false, as no `_writableState` property is attached. // Trying to use the custom `instanceof` for Writable here will also break the // Node.js LazyTransform implementation, which has a non-trivial getter for // `_writableState` that would lead to infinite recursion. if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { return new Writable(options); } this._writableState = new WritableState(options, this); // legacy. this.writable = true; if (options) { if (typeof options.write === 'function') this._write = options.write; if (typeof options.writev === 'function') this._writev = options.writev; if (typeof options.destroy === 'function') this._destroy = options.destroy; if (typeof options.final === 'function') this._final = options.final; } Stream.call(this); } // Otherwise people can pipe Writable streams, which is just wrong. Writable.prototype.pipe = function () { this.emit('error', new Error('Cannot pipe, not readable')); }; function writeAfterEnd(stream, cb) { var er = new Error('write after end'); // TODO: defer error events consistently everywhere, not just the cb stream.emit('error', er); pna.nextTick(cb, er); } // Checks that a user-supplied chunk is valid, especially for the particular // mode the stream is in. Currently this means that `null` is never accepted // and undefined/non-string values are only allowed in object mode. function validChunk(stream, state, chunk, cb) { var valid = true; var er = false; if (chunk === null) { er = new TypeError('May not write null values to stream'); } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { er = new TypeError('Invalid non-string/buffer chunk'); } if (er) { stream.emit('error', er); pna.nextTick(cb, er); valid = false; } return valid; } Writable.prototype.write = function (chunk, encoding, cb) { var state = this._writableState; var ret = false; var isBuf = !state.objectMode && _isUint8Array(chunk); if (isBuf && !Buffer.isBuffer(chunk)) { chunk = _uint8ArrayToBuffer(chunk); } if (typeof encoding === 'function') { cb = encoding; encoding = null; } if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; if (typeof cb !== 'function') cb = nop; if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { state.pendingcb++; ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); } return ret; }; Writable.prototype.cork = function () { var state = this._writableState; state.corked++; }; Writable.prototype.uncork = function () { var state = this._writableState; if (state.corked) { state.corked--; if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } }; Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { // node::ParseEncoding() requires lower case. if (typeof encoding === 'string') encoding = encoding.toLowerCase(); if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); this._writableState.defaultEncoding = encoding; return this; }; function decodeChunk(state, chunk, encoding) { if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { chunk = Buffer.from(chunk, encoding); } return chunk; } Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function () { return this._writableState.highWaterMark; } }); // if we're already writing something, then just put this // in the queue, and wait our turn. Otherwise, call _write // If we return false, then we need a drain event, so set that flag. function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = decodeChunk(state, chunk, encoding); if (chunk !== newChunk) { isBuf = true; encoding = 'buffer'; chunk = newChunk; } } var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. if (!ret) state.needDrain = true; if (state.writing || state.corked) { var last = state.lastBufferedRequest; state.lastBufferedRequest = { chunk: chunk, encoding: encoding, isBuf: isBuf, callback: cb, next: null }; if (last) { last.next = state.lastBufferedRequest; } else { state.bufferedRequest = state.lastBufferedRequest; } state.bufferedRequestCount += 1; } else { doWrite(stream, state, false, len, chunk, encoding, cb); } return ret; } function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len; state.writecb = cb; state.writing = true; state.sync = true; if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); state.sync = false; } function onwriteError(stream, state, sync, er, cb) { --state.pendingcb; if (sync) { // defer the callback if we are being called synchronously // to avoid piling up things on the stack pna.nextTick(cb, er); // this can emit finish, and it will always happen // after error pna.nextTick(finishMaybe, stream, state); stream._writableState.errorEmitted = true; stream.emit('error', er); } else { // the caller expect this to happen before if // it is async cb(er); stream._writableState.errorEmitted = true; stream.emit('error', er); // this can emit finish, but finish must // always follow error finishMaybe(stream, state); } } function onwriteStateUpdate(state) { state.writing = false; state.writecb = null; state.length -= state.writelen; state.writelen = 0; } function onwrite(stream, er) { var state = stream._writableState; var sync = state.sync; var cb = state.writecb; onwriteStateUpdate(state); if (er) onwriteError(stream, state, sync, er, cb);else { // Check if we're actually ready to finish, but don't emit yet var finished = needFinish(state); if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { clearBuffer(stream, state); } if (sync) { /**/ asyncWrite(afterWrite, stream, state, finished, cb); /**/ } else { afterWrite(stream, state, finished, cb); } } } function afterWrite(stream, state, finished, cb) { if (!finished) onwriteDrain(stream, state); state.pendingcb--; cb(); finishMaybe(stream, state); } // Must force callback to be called on nextTick, so that we don't // emit 'drain' before the write() consumer gets the 'false' return // value, and has a chance to attach a 'drain' listener. function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; stream.emit('drain'); } } // if there's something in the buffer waiting, then process it function clearBuffer(stream, state) { state.bufferProcessing = true; var entry = state.bufferedRequest; if (stream._writev && entry && entry.next) { // Fast case, write everything using _writev() var l = state.bufferedRequestCount; var buffer = new Array(l); var holder = state.corkedRequestsFree; holder.entry = entry; var count = 0; var allBuffers = true; while (entry) { buffer[count] = entry; if (!entry.isBuf) allBuffers = false; entry = entry.next; count += 1; } buffer.allBuffers = allBuffers; doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time // as the hot path ends with doWrite state.pendingcb++; state.lastBufferedRequest = null; if (holder.next) { state.corkedRequestsFree = holder.next; holder.next = null; } else { state.corkedRequestsFree = new CorkedRequest(state); } state.bufferedRequestCount = 0; } else { // Slow case, write chunks one-by-one while (entry) { var chunk = entry.chunk; var encoding = entry.encoding; var cb = entry.callback; var len = state.objectMode ? 1 : chunk.length; doWrite(stream, state, false, len, chunk, encoding, cb); entry = entry.next; state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then // it means that we need to wait until it does. // also, that means that the chunk and cb are currently // being processed, so move the buffer counter past them. if (state.writing) { break; } } if (entry === null) state.lastBufferedRequest = null; } state.bufferedRequest = entry; state.bufferProcessing = false; } Writable.prototype._write = function (chunk, encoding, cb) { cb(new Error('_write() is not implemented')); }; Writable.prototype._writev = null; Writable.prototype.end = function (chunk, encoding, cb) { var state = this._writableState; if (typeof chunk === 'function') { cb = chunk; chunk = null; encoding = null; } else if (typeof encoding === 'function') { cb = encoding; encoding = null; } if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks if (state.corked) { state.corked = 1; this.uncork(); } // ignore unnecessary end() calls. if (!state.ending) endWritable(this, state, cb); }; function needFinish(state) { return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; } function callFinal(stream, state) { stream._final(function (err) { state.pendingcb--; if (err) { stream.emit('error', err); } state.prefinished = true; stream.emit('prefinish'); finishMaybe(stream, state); }); } function prefinish(stream, state) { if (!state.prefinished && !state.finalCalled) { if (typeof stream._final === 'function') { state.pendingcb++; state.finalCalled = true; pna.nextTick(callFinal, stream, state); } else { state.prefinished = true; stream.emit('prefinish'); } } } function finishMaybe(stream, state) { var need = needFinish(state); if (need) { prefinish(stream, state); if (state.pendingcb === 0) { state.finished = true; stream.emit('finish'); } } return need; } function endWritable(stream, state, cb) { state.ending = true; finishMaybe(stream, state); if (cb) { if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); } state.ended = true; stream.writable = false; } function onCorkedFinish(corkReq, state, err) { var entry = corkReq.entry; corkReq.entry = null; while (entry) { var cb = entry.callback; state.pendingcb--; cb(err); entry = entry.next; } // reuse the free corkReq. state.corkedRequestsFree.next = corkReq; } Object.defineProperty(Writable.prototype, 'destroyed', { get: function () { if (this._writableState === undefined) { return false; } return this._writableState.destroyed; }, set: function (value) { // we ignore the value if the stream // has not been initialized yet if (!this._writableState) { return; } // backward compatibility, the user is explicitly // managing destroyed this._writableState.destroyed = value; } }); Writable.prototype.destroy = destroyImpl.destroy; Writable.prototype._undestroy = destroyImpl.undestroy; Writable.prototype._destroy = function (err, cb) { this.end(); cb(err); }; /***/ }), /***/ 9381: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Buffer = (__nccwpck_require__(1475).Buffer); var util = __nccwpck_require__(9023); function copyBuffer(src, target, offset) { src.copy(target, offset); } module.exports = function () { function BufferList() { _classCallCheck(this, BufferList); this.head = null; this.tail = null; this.length = 0; } BufferList.prototype.push = function push(v) { var entry = { data: v, next: null }; if (this.length > 0) this.tail.next = entry;else this.head = entry; this.tail = entry; ++this.length; }; BufferList.prototype.unshift = function unshift(v) { var entry = { data: v, next: this.head }; if (this.length === 0) this.tail = entry; this.head = entry; ++this.length; }; BufferList.prototype.shift = function shift() { if (this.length === 0) return; var ret = this.head.data; if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; --this.length; return ret; }; BufferList.prototype.clear = function clear() { this.head = this.tail = null; this.length = 0; }; BufferList.prototype.join = function join(s) { if (this.length === 0) return ''; var p = this.head; var ret = '' + p.data; while (p = p.next) { ret += s + p.data; }return ret; }; BufferList.prototype.concat = function concat(n) { if (this.length === 0) return Buffer.alloc(0); var ret = Buffer.allocUnsafe(n >>> 0); var p = this.head; var i = 0; while (p) { copyBuffer(p.data, ret, i); i += p.data.length; p = p.next; } return ret; }; return BufferList; }(); if (util && util.inspect && util.inspect.custom) { module.exports.prototype[util.inspect.custom] = function () { var obj = util.inspect({ length: this.length }); return this.constructor.name + ' ' + obj; }; } /***/ }), /***/ 5089: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /**/ var pna = __nccwpck_require__(1564); /**/ // undocumented cb() API, needed for core, not for public API function destroy(err, cb) { var _this = this; var readableDestroyed = this._readableState && this._readableState.destroyed; var writableDestroyed = this._writableState && this._writableState.destroyed; if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); } else if (err) { if (!this._writableState) { pna.nextTick(emitErrorNT, this, err); } else if (!this._writableState.errorEmitted) { this._writableState.errorEmitted = true; pna.nextTick(emitErrorNT, this, err); } } return this; } // we set destroyed to true before firing error callbacks in order // to make it re-entrance safe in case destroy() is called within callbacks if (this._readableState) { this._readableState.destroyed = true; } // if this is a duplex stream mark the writable part as destroyed as well if (this._writableState) { this._writableState.destroyed = true; } this._destroy(err || null, function (err) { if (!cb && err) { if (!_this._writableState) { pna.nextTick(emitErrorNT, _this, err); } else if (!_this._writableState.errorEmitted) { _this._writableState.errorEmitted = true; pna.nextTick(emitErrorNT, _this, err); } } else if (cb) { cb(err); } }); return this; } function undestroy() { if (this._readableState) { this._readableState.destroyed = false; this._readableState.reading = false; this._readableState.ended = false; this._readableState.endEmitted = false; } if (this._writableState) { this._writableState.destroyed = false; this._writableState.ended = false; this._writableState.ending = false; this._writableState.finalCalled = false; this._writableState.prefinished = false; this._writableState.finished = false; this._writableState.errorEmitted = false; } } function emitErrorNT(self, err) { self.emit('error', err); } module.exports = { destroy: destroy, undestroy: undestroy }; /***/ }), /***/ 3283: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = __nccwpck_require__(2203); /***/ }), /***/ 1475: /***/ ((module, exports, __nccwpck_require__) => { /* eslint-disable node/no-deprecated-api */ var buffer = __nccwpck_require__(181) var Buffer = buffer.Buffer // alternative to using Object.keys for old browsers function copyProps (src, dst) { for (var key in src) { dst[key] = src[key] } } if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { module.exports = buffer } else { // Copy properties from require('buffer') copyProps(buffer, exports) exports.Buffer = SafeBuffer } function SafeBuffer (arg, encodingOrOffset, length) { return Buffer(arg, encodingOrOffset, length) } // Copy static methods from Buffer copyProps(Buffer, SafeBuffer) SafeBuffer.from = function (arg, encodingOrOffset, length) { if (typeof arg === 'number') { throw new TypeError('Argument must not be a number') } return Buffer(arg, encodingOrOffset, length) } SafeBuffer.alloc = function (size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } var buf = Buffer(size) if (fill !== undefined) { if (typeof encoding === 'string') { buf.fill(fill, encoding) } else { buf.fill(fill) } } else { buf.fill(0) } return buf } SafeBuffer.allocUnsafe = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return Buffer(size) } SafeBuffer.allocUnsafeSlow = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return buffer.SlowBuffer(size) } /***/ }), /***/ 6131: /***/ ((module, exports, __nccwpck_require__) => { var Stream = __nccwpck_require__(2203); if (process.env.READABLE_STREAM === 'disable' && Stream) { module.exports = Stream; exports = module.exports = Stream.Readable; exports.Readable = Stream.Readable; exports.Writable = Stream.Writable; exports.Duplex = Stream.Duplex; exports.Transform = Stream.Transform; exports.PassThrough = Stream.PassThrough; exports.Stream = Stream; } else { exports = module.exports = __nccwpck_require__(6893); exports.Stream = Stream || exports; exports.Readable = exports; exports.Writable = __nccwpck_require__(8797); exports.Duplex = __nccwpck_require__(2063); exports.Transform = __nccwpck_require__(2337); exports.PassThrough = __nccwpck_require__(5283); } /***/ }), /***/ 7525: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const fs = __nccwpck_require__(9896); const { Readable } = __nccwpck_require__(2203); const sysPath = __nccwpck_require__(6928); const { promisify } = __nccwpck_require__(9023); const picomatch = __nccwpck_require__(3285); const readdir = promisify(fs.readdir); const stat = promisify(fs.stat); const lstat = promisify(fs.lstat); const realpath = promisify(fs.realpath); /** * @typedef {Object} EntryInfo * @property {String} path * @property {String} fullPath * @property {fs.Stats=} stats * @property {fs.Dirent=} dirent * @property {String} basename */ const BANG = '!'; const RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR'; const NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP', RECURSIVE_ERROR_CODE]); const FILE_TYPE = 'files'; const DIR_TYPE = 'directories'; const FILE_DIR_TYPE = 'files_directories'; const EVERYTHING_TYPE = 'all'; const ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE]; const isNormalFlowError = error => NORMAL_FLOW_ERRORS.has(error.code); const [maj, min] = process.versions.node.split('.').slice(0, 2).map(n => Number.parseInt(n, 10)); const wantBigintFsStats = process.platform === 'win32' && (maj > 10 || (maj === 10 && min >= 5)); const normalizeFilter = filter => { if (filter === undefined) return; if (typeof filter === 'function') return filter; if (typeof filter === 'string') { const glob = picomatch(filter.trim()); return entry => glob(entry.basename); } if (Array.isArray(filter)) { const positive = []; const negative = []; for (const item of filter) { const trimmed = item.trim(); if (trimmed.charAt(0) === BANG) { negative.push(picomatch(trimmed.slice(1))); } else { positive.push(picomatch(trimmed)); } } if (negative.length > 0) { if (positive.length > 0) { return entry => positive.some(f => f(entry.basename)) && !negative.some(f => f(entry.basename)); } return entry => !negative.some(f => f(entry.basename)); } return entry => positive.some(f => f(entry.basename)); } }; class ReaddirpStream extends Readable { static get defaultOptions() { return { root: '.', /* eslint-disable no-unused-vars */ fileFilter: (path) => true, directoryFilter: (path) => true, /* eslint-enable no-unused-vars */ type: FILE_TYPE, lstat: false, depth: 2147483648, alwaysStat: false }; } constructor(options = {}) { super({ objectMode: true, autoDestroy: true, highWaterMark: options.highWaterMark || 4096 }); const opts = { ...ReaddirpStream.defaultOptions, ...options }; const { root, type } = opts; this._fileFilter = normalizeFilter(opts.fileFilter); this._directoryFilter = normalizeFilter(opts.directoryFilter); const statMethod = opts.lstat ? lstat : stat; // Use bigint stats if it's windows and stat() supports options (node 10+). if (wantBigintFsStats) { this._stat = path => statMethod(path, { bigint: true }); } else { this._stat = statMethod; } this._maxDepth = opts.depth; this._wantsDir = [DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); this._wantsFile = [FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); this._wantsEverything = type === EVERYTHING_TYPE; this._root = sysPath.resolve(root); this._isDirent = ('Dirent' in fs) && !opts.alwaysStat; this._statsProp = this._isDirent ? 'dirent' : 'stats'; this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent }; // Launch stream with one parent, the root dir. this.parents = [this._exploreDir(root, 1)]; this.reading = false; this.parent = undefined; } async _read(batch) { if (this.reading) return; this.reading = true; try { while (!this.destroyed && batch > 0) { const { path, depth, files = [] } = this.parent || {}; if (files.length > 0) { const slice = files.splice(0, batch).map(dirent => this._formatEntry(dirent, path)); for (const entry of await Promise.all(slice)) { if (this.destroyed) return; const entryType = await this._getEntryType(entry); if (entryType === 'directory' && this._directoryFilter(entry)) { if (depth <= this._maxDepth) { this.parents.push(this._exploreDir(entry.fullPath, depth + 1)); } if (this._wantsDir) { this.push(entry); batch--; } } else if ((entryType === 'file' || this._includeAsFile(entry)) && this._fileFilter(entry)) { if (this._wantsFile) { this.push(entry); batch--; } } } } else { const parent = this.parents.pop(); if (!parent) { this.push(null); break; } this.parent = await parent; if (this.destroyed) return; } } } catch (error) { this.destroy(error); } finally { this.reading = false; } } async _exploreDir(path, depth) { let files; try { files = await readdir(path, this._rdOptions); } catch (error) { this._onError(error); } return { files, depth, path }; } async _formatEntry(dirent, path) { let entry; try { const basename = this._isDirent ? dirent.name : dirent; const fullPath = sysPath.resolve(sysPath.join(path, basename)); entry = { path: sysPath.relative(this._root, fullPath), fullPath, basename }; entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath); } catch (err) { this._onError(err); } return entry; } _onError(err) { if (isNormalFlowError(err) && !this.destroyed) { this.emit('warn', err); } else { this.destroy(err); } } async _getEntryType(entry) { // entry may be undefined, because a warning or an error were emitted // and the statsProp is undefined const stats = entry && entry[this._statsProp]; if (!stats) { return; } if (stats.isFile()) { return 'file'; } if (stats.isDirectory()) { return 'directory'; } if (stats && stats.isSymbolicLink()) { const full = entry.fullPath; try { const entryRealPath = await realpath(full); const entryRealPathStats = await lstat(entryRealPath); if (entryRealPathStats.isFile()) { return 'file'; } if (entryRealPathStats.isDirectory()) { const len = entryRealPath.length; if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) { const recursiveError = new Error( `Circular symlink detected: "${full}" points to "${entryRealPath}"` ); recursiveError.code = RECURSIVE_ERROR_CODE; return this._onError(recursiveError); } return 'directory'; } } catch (error) { this._onError(error); } } } _includeAsFile(entry) { const stats = entry && entry[this._statsProp]; return stats && this._wantsEverything && !stats.isDirectory(); } } /** * @typedef {Object} ReaddirpArguments * @property {Function=} fileFilter * @property {Function=} directoryFilter * @property {String=} type * @property {Number=} depth * @property {String=} root * @property {Boolean=} lstat * @property {Boolean=} bigint */ /** * Main function which ends up calling readdirRec and reads all files and directories in given root recursively. * @param {String} root Root directory * @param {ReaddirpArguments=} options Options to specify root (start directory), filters and recursion depth */ const readdirp = (root, options = {}) => { let type = options.entryType || options.type; if (type === 'both') type = FILE_DIR_TYPE; // backwards-compatibility if (type) options.type = type; if (!root) { throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)'); } else if (typeof root !== 'string') { throw new TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)'); } else if (type && !ALL_TYPES.includes(type)) { throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`); } options.root = root; return new ReaddirpStream(options); }; const readdirpPromise = (root, options = {}) => { return new Promise((resolve, reject) => { const files = []; readdirp(root, options) .on('data', entry => files.push(entry)) .on('end', () => resolve(files)) .on('error', error => reject(error)); }); }; readdirp.promise = readdirpPromise; readdirp.ReaddirpStream = ReaddirpStream; readdirp.default = readdirp; module.exports = readdirp; /***/ }), /***/ 3285: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = __nccwpck_require__(4019); /***/ }), /***/ 7892: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const path = __nccwpck_require__(6928); const WIN_SLASH = '\\\\/'; const WIN_NO_SLASH = `[^${WIN_SLASH}]`; /** * Posix glob regex */ const DOT_LITERAL = '\\.'; const PLUS_LITERAL = '\\+'; const QMARK_LITERAL = '\\?'; const SLASH_LITERAL = '\\/'; const ONE_CHAR = '(?=.)'; const QMARK = '[^/]'; const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; const NO_DOT = `(?!${DOT_LITERAL})`; const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; const STAR = `${QMARK}*?`; const POSIX_CHARS = { DOT_LITERAL, PLUS_LITERAL, QMARK_LITERAL, SLASH_LITERAL, ONE_CHAR, QMARK, END_ANCHOR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK_NO_DOT, STAR, START_ANCHOR }; /** * Windows glob regex */ const WINDOWS_CHARS = { ...POSIX_CHARS, SLASH_LITERAL: `[${WIN_SLASH}]`, QMARK: WIN_NO_SLASH, STAR: `${WIN_NO_SLASH}*?`, DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, NO_DOT: `(?!${DOT_LITERAL})`, NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, QMARK_NO_DOT: `[^.${WIN_SLASH}]`, START_ANCHOR: `(?:^|[${WIN_SLASH}])`, END_ANCHOR: `(?:[${WIN_SLASH}]|$)` }; /** * POSIX Bracket Regex */ const POSIX_REGEX_SOURCE = { alnum: 'a-zA-Z0-9', alpha: 'a-zA-Z', ascii: '\\x00-\\x7F', blank: ' \\t', cntrl: '\\x00-\\x1F\\x7F', digit: '0-9', graph: '\\x21-\\x7E', lower: 'a-z', print: '\\x20-\\x7E ', punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', space: ' \\t\\r\\n\\v\\f', upper: 'A-Z', word: 'A-Za-z0-9_', xdigit: 'A-Fa-f0-9' }; module.exports = { MAX_LENGTH: 1024 * 64, POSIX_REGEX_SOURCE, // regular expressions REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, // Replace globs with equivalent patterns to reduce parsing time. REPLACEMENTS: { '***': '*', '**/**': '**', '**/**/**': '**' }, // Digits CHAR_0: 48, /* 0 */ CHAR_9: 57, /* 9 */ // Alphabet chars. CHAR_UPPERCASE_A: 65, /* A */ CHAR_LOWERCASE_A: 97, /* a */ CHAR_UPPERCASE_Z: 90, /* Z */ CHAR_LOWERCASE_Z: 122, /* z */ CHAR_LEFT_PARENTHESES: 40, /* ( */ CHAR_RIGHT_PARENTHESES: 41, /* ) */ CHAR_ASTERISK: 42, /* * */ // Non-alphabetic chars. CHAR_AMPERSAND: 38, /* & */ CHAR_AT: 64, /* @ */ CHAR_BACKWARD_SLASH: 92, /* \ */ CHAR_CARRIAGE_RETURN: 13, /* \r */ CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ CHAR_COLON: 58, /* : */ CHAR_COMMA: 44, /* , */ CHAR_DOT: 46, /* . */ CHAR_DOUBLE_QUOTE: 34, /* " */ CHAR_EQUAL: 61, /* = */ CHAR_EXCLAMATION_MARK: 33, /* ! */ CHAR_FORM_FEED: 12, /* \f */ CHAR_FORWARD_SLASH: 47, /* / */ CHAR_GRAVE_ACCENT: 96, /* ` */ CHAR_HASH: 35, /* # */ CHAR_HYPHEN_MINUS: 45, /* - */ CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ CHAR_LEFT_CURLY_BRACE: 123, /* { */ CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ CHAR_LINE_FEED: 10, /* \n */ CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ CHAR_PERCENT: 37, /* % */ CHAR_PLUS: 43, /* + */ CHAR_QUESTION_MARK: 63, /* ? */ CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ CHAR_RIGHT_CURLY_BRACE: 125, /* } */ CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ CHAR_SEMICOLON: 59, /* ; */ CHAR_SINGLE_QUOTE: 39, /* ' */ CHAR_SPACE: 32, /* */ CHAR_TAB: 9, /* \t */ CHAR_UNDERSCORE: 95, /* _ */ CHAR_VERTICAL_LINE: 124, /* | */ CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ SEP: path.sep, /** * Create EXTGLOB_CHARS */ extglobChars(chars) { return { '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, '?': { type: 'qmark', open: '(?:', close: ')?' }, '+': { type: 'plus', open: '(?:', close: ')+' }, '*': { type: 'star', open: '(?:', close: ')*' }, '@': { type: 'at', open: '(?:', close: ')' } }; }, /** * Create GLOB_CHARS */ globChars(win32) { return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; } }; /***/ }), /***/ 9810: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const constants = __nccwpck_require__(7892); const utils = __nccwpck_require__(7432); /** * Constants */ const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants; /** * Helpers */ const expandRange = (args, options) => { if (typeof options.expandRange === 'function') { return options.expandRange(...args, options); } args.sort(); const value = `[${args.join('-')}]`; try { /* eslint-disable-next-line no-new */ new RegExp(value); } catch (ex) { return args.map(v => utils.escapeRegex(v)).join('..'); } return value; }; /** * Create the message for a syntax error */ const syntaxError = (type, char) => { return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; }; /** * Parse the given input string. * @param {String} input * @param {Object} options * @return {Object} */ const parse = (input, options) => { if (typeof input !== 'string') { throw new TypeError('Expected a string'); } input = REPLACEMENTS[input] || input; const opts = { ...options }; const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; let len = input.length; if (len > max) { throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); } const bos = { type: 'bos', value: '', output: opts.prepend || '' }; const tokens = [bos]; const capture = opts.capture ? '' : '?:'; const win32 = utils.isWindows(options); // create constants based on platform, for windows or posix const PLATFORM_CHARS = constants.globChars(win32); const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); const { DOT_LITERAL, PLUS_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK, QMARK_NO_DOT, STAR, START_ANCHOR } = PLATFORM_CHARS; const globstar = opts => { return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; }; const nodot = opts.dot ? '' : NO_DOT; const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; let star = opts.bash === true ? globstar(opts) : STAR; if (opts.capture) { star = `(${star})`; } // minimatch options support if (typeof opts.noext === 'boolean') { opts.noextglob = opts.noext; } const state = { input, index: -1, start: 0, dot: opts.dot === true, consumed: '', output: '', prefix: '', backtrack: false, negated: false, brackets: 0, braces: 0, parens: 0, quotes: 0, globstar: false, tokens }; input = utils.removePrefix(input, state); len = input.length; const extglobs = []; const braces = []; const stack = []; let prev = bos; let value; /** * Tokenizing helpers */ const eos = () => state.index === len - 1; const peek = state.peek = (n = 1) => input[state.index + n]; const advance = state.advance = () => input[++state.index] || ''; const remaining = () => input.slice(state.index + 1); const consume = (value = '', num = 0) => { state.consumed += value; state.index += num; }; const append = token => { state.output += token.output != null ? token.output : token.value; consume(token.value); }; const negate = () => { let count = 1; while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { advance(); state.start++; count++; } if (count % 2 === 0) { return false; } state.negated = true; state.start++; return true; }; const increment = type => { state[type]++; stack.push(type); }; const decrement = type => { state[type]--; stack.pop(); }; /** * Push tokens onto the tokens array. This helper speeds up * tokenizing by 1) helping us avoid backtracking as much as possible, * and 2) helping us avoid creating extra tokens when consecutive * characters are plain text. This improves performance and simplifies * lookbehinds. */ const push = tok => { if (prev.type === 'globstar') { const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { state.output = state.output.slice(0, -prev.output.length); prev.type = 'star'; prev.value = '*'; prev.output = star; state.output += prev.output; } } if (extglobs.length && tok.type !== 'paren') { extglobs[extglobs.length - 1].inner += tok.value; } if (tok.value || tok.output) append(tok); if (prev && prev.type === 'text' && tok.type === 'text') { prev.value += tok.value; prev.output = (prev.output || '') + tok.value; return; } tok.prev = prev; tokens.push(tok); prev = tok; }; const extglobOpen = (type, value) => { const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; token.prev = prev; token.parens = state.parens; token.output = state.output; const output = (opts.capture ? '(' : '') + token.open; increment('parens'); push({ type, value, output: state.output ? '' : ONE_CHAR }); push({ type: 'paren', extglob: true, value: advance(), output }); extglobs.push(token); }; const extglobClose = token => { let output = token.close + (opts.capture ? ')' : ''); let rest; if (token.type === 'negate') { let extglobStar = star; if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { extglobStar = globstar(opts); } if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { output = token.close = `)$))${extglobStar}`; } if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. // In this case, we need to parse the string and use it in the output of the original pattern. // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. // // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. const expression = parse(rest, { ...options, fastpaths: false }).output; output = token.close = `)${expression})${extglobStar})`; } if (token.prev.type === 'bos') { state.negatedExtglob = true; } } push({ type: 'paren', extglob: true, value, output }); decrement('parens'); }; /** * Fast paths */ if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { let backslashes = false; let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { if (first === '\\') { backslashes = true; return m; } if (first === '?') { if (esc) { return esc + first + (rest ? QMARK.repeat(rest.length) : ''); } if (index === 0) { return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); } return QMARK.repeat(chars.length); } if (first === '.') { return DOT_LITERAL.repeat(chars.length); } if (first === '*') { if (esc) { return esc + first + (rest ? star : ''); } return star; } return esc ? m : `\\${m}`; }); if (backslashes === true) { if (opts.unescape === true) { output = output.replace(/\\/g, ''); } else { output = output.replace(/\\+/g, m => { return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); }); } } if (output === input && opts.contains === true) { state.output = input; return state; } state.output = utils.wrapOutput(output, state, options); return state; } /** * Tokenize input until we reach end-of-string */ while (!eos()) { value = advance(); if (value === '\u0000') { continue; } /** * Escaped characters */ if (value === '\\') { const next = peek(); if (next === '/' && opts.bash !== true) { continue; } if (next === '.' || next === ';') { continue; } if (!next) { value += '\\'; push({ type: 'text', value }); continue; } // collapse slashes to reduce potential for exploits const match = /^\\+/.exec(remaining()); let slashes = 0; if (match && match[0].length > 2) { slashes = match[0].length; state.index += slashes; if (slashes % 2 !== 0) { value += '\\'; } } if (opts.unescape === true) { value = advance(); } else { value += advance(); } if (state.brackets === 0) { push({ type: 'text', value }); continue; } } /** * If we're inside a regex character class, continue * until we reach the closing bracket. */ if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { if (opts.posix !== false && value === ':') { const inner = prev.value.slice(1); if (inner.includes('[')) { prev.posix = true; if (inner.includes(':')) { const idx = prev.value.lastIndexOf('['); const pre = prev.value.slice(0, idx); const rest = prev.value.slice(idx + 2); const posix = POSIX_REGEX_SOURCE[rest]; if (posix) { prev.value = pre + posix; state.backtrack = true; advance(); if (!bos.output && tokens.indexOf(prev) === 1) { bos.output = ONE_CHAR; } continue; } } } } if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { value = `\\${value}`; } if (value === ']' && (prev.value === '[' || prev.value === '[^')) { value = `\\${value}`; } if (opts.posix === true && value === '!' && prev.value === '[') { value = '^'; } prev.value += value; append({ value }); continue; } /** * If we're inside a quoted string, continue * until we reach the closing double quote. */ if (state.quotes === 1 && value !== '"') { value = utils.escapeRegex(value); prev.value += value; append({ value }); continue; } /** * Double quotes */ if (value === '"') { state.quotes = state.quotes === 1 ? 0 : 1; if (opts.keepQuotes === true) { push({ type: 'text', value }); } continue; } /** * Parentheses */ if (value === '(') { increment('parens'); push({ type: 'paren', value }); continue; } if (value === ')') { if (state.parens === 0 && opts.strictBrackets === true) { throw new SyntaxError(syntaxError('opening', '(')); } const extglob = extglobs[extglobs.length - 1]; if (extglob && state.parens === extglob.parens + 1) { extglobClose(extglobs.pop()); continue; } push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); decrement('parens'); continue; } /** * Square brackets */ if (value === '[') { if (opts.nobracket === true || !remaining().includes(']')) { if (opts.nobracket !== true && opts.strictBrackets === true) { throw new SyntaxError(syntaxError('closing', ']')); } value = `\\${value}`; } else { increment('brackets'); } push({ type: 'bracket', value }); continue; } if (value === ']') { if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { push({ type: 'text', value, output: `\\${value}` }); continue; } if (state.brackets === 0) { if (opts.strictBrackets === true) { throw new SyntaxError(syntaxError('opening', '[')); } push({ type: 'text', value, output: `\\${value}` }); continue; } decrement('brackets'); const prevValue = prev.value.slice(1); if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { value = `/${value}`; } prev.value += value; append({ value }); // when literal brackets are explicitly disabled // assume we should match with a regex character class if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { continue; } const escaped = utils.escapeRegex(prev.value); state.output = state.output.slice(0, -prev.value.length); // when literal brackets are explicitly enabled // assume we should escape the brackets to match literal characters if (opts.literalBrackets === true) { state.output += escaped; prev.value = escaped; continue; } // when the user specifies nothing, try to match both prev.value = `(${capture}${escaped}|${prev.value})`; state.output += prev.value; continue; } /** * Braces */ if (value === '{' && opts.nobrace !== true) { increment('braces'); const open = { type: 'brace', value, output: '(', outputIndex: state.output.length, tokensIndex: state.tokens.length }; braces.push(open); push(open); continue; } if (value === '}') { const brace = braces[braces.length - 1]; if (opts.nobrace === true || !brace) { push({ type: 'text', value, output: value }); continue; } let output = ')'; if (brace.dots === true) { const arr = tokens.slice(); const range = []; for (let i = arr.length - 1; i >= 0; i--) { tokens.pop(); if (arr[i].type === 'brace') { break; } if (arr[i].type !== 'dots') { range.unshift(arr[i].value); } } output = expandRange(range, opts); state.backtrack = true; } if (brace.comma !== true && brace.dots !== true) { const out = state.output.slice(0, brace.outputIndex); const toks = state.tokens.slice(brace.tokensIndex); brace.value = brace.output = '\\{'; value = output = '\\}'; state.output = out; for (const t of toks) { state.output += (t.output || t.value); } } push({ type: 'brace', value, output }); decrement('braces'); braces.pop(); continue; } /** * Pipes */ if (value === '|') { if (extglobs.length > 0) { extglobs[extglobs.length - 1].conditions++; } push({ type: 'text', value }); continue; } /** * Commas */ if (value === ',') { let output = value; const brace = braces[braces.length - 1]; if (brace && stack[stack.length - 1] === 'braces') { brace.comma = true; output = '|'; } push({ type: 'comma', value, output }); continue; } /** * Slashes */ if (value === '/') { // if the beginning of the glob is "./", advance the start // to the current index, and don't add the "./" characters // to the state. This greatly simplifies lookbehinds when // checking for BOS characters like "!" and "." (not "./") if (prev.type === 'dot' && state.index === state.start + 1) { state.start = state.index + 1; state.consumed = ''; state.output = ''; tokens.pop(); prev = bos; // reset "prev" to the first token continue; } push({ type: 'slash', value, output: SLASH_LITERAL }); continue; } /** * Dots */ if (value === '.') { if (state.braces > 0 && prev.type === 'dot') { if (prev.value === '.') prev.output = DOT_LITERAL; const brace = braces[braces.length - 1]; prev.type = 'dots'; prev.output += value; prev.value += value; brace.dots = true; continue; } if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { push({ type: 'text', value, output: DOT_LITERAL }); continue; } push({ type: 'dot', value, output: DOT_LITERAL }); continue; } /** * Question marks */ if (value === '?') { const isGroup = prev && prev.value === '('; if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { extglobOpen('qmark', value); continue; } if (prev && prev.type === 'paren') { const next = peek(); let output = value; if (next === '<' && !utils.supportsLookbehinds()) { throw new Error('Node.js v10 or higher is required for regex lookbehinds'); } if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { output = `\\${value}`; } push({ type: 'text', value, output }); continue; } if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { push({ type: 'qmark', value, output: QMARK_NO_DOT }); continue; } push({ type: 'qmark', value, output: QMARK }); continue; } /** * Exclamation */ if (value === '!') { if (opts.noextglob !== true && peek() === '(') { if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { extglobOpen('negate', value); continue; } } if (opts.nonegate !== true && state.index === 0) { negate(); continue; } } /** * Plus */ if (value === '+') { if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { extglobOpen('plus', value); continue; } if ((prev && prev.value === '(') || opts.regex === false) { push({ type: 'plus', value, output: PLUS_LITERAL }); continue; } if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { push({ type: 'plus', value }); continue; } push({ type: 'plus', value: PLUS_LITERAL }); continue; } /** * Plain text */ if (value === '@') { if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { push({ type: 'at', extglob: true, value, output: '' }); continue; } push({ type: 'text', value }); continue; } /** * Plain text */ if (value !== '*') { if (value === '$' || value === '^') { value = `\\${value}`; } const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); if (match) { value += match[0]; state.index += match[0].length; } push({ type: 'text', value }); continue; } /** * Stars */ if (prev && (prev.type === 'globstar' || prev.star === true)) { prev.type = 'star'; prev.star = true; prev.value += value; prev.output = star; state.backtrack = true; state.globstar = true; consume(value); continue; } let rest = remaining(); if (opts.noextglob !== true && /^\([^?]/.test(rest)) { extglobOpen('star', value); continue; } if (prev.type === 'star') { if (opts.noglobstar === true) { consume(value); continue; } const prior = prev.prev; const before = prior.prev; const isStart = prior.type === 'slash' || prior.type === 'bos'; const afterStar = before && (before.type === 'star' || before.type === 'globstar'); if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { push({ type: 'star', value, output: '' }); continue; } const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { push({ type: 'star', value, output: '' }); continue; } // strip consecutive `/**/` while (rest.slice(0, 3) === '/**') { const after = input[state.index + 4]; if (after && after !== '/') { break; } rest = rest.slice(3); consume('/**', 3); } if (prior.type === 'bos' && eos()) { prev.type = 'globstar'; prev.value += value; prev.output = globstar(opts); state.output = prev.output; state.globstar = true; consume(value); continue; } if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { state.output = state.output.slice(0, -(prior.output + prev.output).length); prior.output = `(?:${prior.output}`; prev.type = 'globstar'; prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); prev.value += value; state.globstar = true; state.output += prior.output + prev.output; consume(value); continue; } if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { const end = rest[1] !== void 0 ? '|$' : ''; state.output = state.output.slice(0, -(prior.output + prev.output).length); prior.output = `(?:${prior.output}`; prev.type = 'globstar'; prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; prev.value += value; state.output += prior.output + prev.output; state.globstar = true; consume(value + advance()); push({ type: 'slash', value: '/', output: '' }); continue; } if (prior.type === 'bos' && rest[0] === '/') { prev.type = 'globstar'; prev.value += value; prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; state.output = prev.output; state.globstar = true; consume(value + advance()); push({ type: 'slash', value: '/', output: '' }); continue; } // remove single star from output state.output = state.output.slice(0, -prev.output.length); // reset previous token to globstar prev.type = 'globstar'; prev.output = globstar(opts); prev.value += value; // reset output with globstar state.output += prev.output; state.globstar = true; consume(value); continue; } const token = { type: 'star', value, output: star }; if (opts.bash === true) { token.output = '.*?'; if (prev.type === 'bos' || prev.type === 'slash') { token.output = nodot + token.output; } push(token); continue; } if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { token.output = value; push(token); continue; } if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { if (prev.type === 'dot') { state.output += NO_DOT_SLASH; prev.output += NO_DOT_SLASH; } else if (opts.dot === true) { state.output += NO_DOTS_SLASH; prev.output += NO_DOTS_SLASH; } else { state.output += nodot; prev.output += nodot; } if (peek() !== '*') { state.output += ONE_CHAR; prev.output += ONE_CHAR; } } push(token); } while (state.brackets > 0) { if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); state.output = utils.escapeLast(state.output, '['); decrement('brackets'); } while (state.parens > 0) { if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); state.output = utils.escapeLast(state.output, '('); decrement('parens'); } while (state.braces > 0) { if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); state.output = utils.escapeLast(state.output, '{'); decrement('braces'); } if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); } // rebuild the output if we had to backtrack at any point if (state.backtrack === true) { state.output = ''; for (const token of state.tokens) { state.output += token.output != null ? token.output : token.value; if (token.suffix) { state.output += token.suffix; } } } return state; }; /** * Fast paths for creating regular expressions for common glob patterns. * This can significantly speed up processing and has very little downside * impact when none of the fast paths match. */ parse.fastpaths = (input, options) => { const opts = { ...options }; const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; const len = input.length; if (len > max) { throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); } input = REPLACEMENTS[input] || input; const win32 = utils.isWindows(options); // create constants based on platform, for windows or posix const { DOT_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR } = constants.globChars(win32); const nodot = opts.dot ? NO_DOTS : NO_DOT; const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; const capture = opts.capture ? '' : '?:'; const state = { negated: false, prefix: '' }; let star = opts.bash === true ? '.*?' : STAR; if (opts.capture) { star = `(${star})`; } const globstar = opts => { if (opts.noglobstar === true) return star; return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; }; const create = str => { switch (str) { case '*': return `${nodot}${ONE_CHAR}${star}`; case '.*': return `${DOT_LITERAL}${ONE_CHAR}${star}`; case '*.*': return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; case '*/*': return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; case '**': return nodot + globstar(opts); case '**/*': return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; case '**/*.*': return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; case '**/.*': return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; default: { const match = /^(.*?)\.(\w+)$/.exec(str); if (!match) return; const source = create(match[1]); if (!source) return; return source + DOT_LITERAL + match[2]; } } }; const output = utils.removePrefix(input, state); let source = create(output); if (source && opts.strictSlashes !== true) { source += `${SLASH_LITERAL}?`; } return source; }; module.exports = parse; /***/ }), /***/ 4019: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const path = __nccwpck_require__(6928); const scan = __nccwpck_require__(1472); const parse = __nccwpck_require__(9810); const utils = __nccwpck_require__(7432); const constants = __nccwpck_require__(7892); const isObject = val => val && typeof val === 'object' && !Array.isArray(val); /** * Creates a matcher function from one or more glob patterns. The * returned function takes a string to match as its first argument, * and returns true if the string is a match. The returned matcher * function also takes a boolean as the second argument that, when true, * returns an object with additional information. * * ```js * const picomatch = require('picomatch'); * // picomatch(glob[, options]); * * const isMatch = picomatch('*.!(*a)'); * console.log(isMatch('a.a')); //=> false * console.log(isMatch('a.b')); //=> true * ``` * @name picomatch * @param {String|Array} `globs` One or more glob patterns. * @param {Object=} `options` * @return {Function=} Returns a matcher function. * @api public */ const picomatch = (glob, options, returnState = false) => { if (Array.isArray(glob)) { const fns = glob.map(input => picomatch(input, options, returnState)); const arrayMatcher = str => { for (const isMatch of fns) { const state = isMatch(str); if (state) return state; } return false; }; return arrayMatcher; } const isState = isObject(glob) && glob.tokens && glob.input; if (glob === '' || (typeof glob !== 'string' && !isState)) { throw new TypeError('Expected pattern to be a non-empty string'); } const opts = options || {}; const posix = utils.isWindows(options); const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true); const state = regex.state; delete regex.state; let isIgnored = () => false; if (opts.ignore) { const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); } const matcher = (input, returnObject = false) => { const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); const result = { glob, state, regex, posix, input, output, match, isMatch }; if (typeof opts.onResult === 'function') { opts.onResult(result); } if (isMatch === false) { result.isMatch = false; return returnObject ? result : false; } if (isIgnored(input)) { if (typeof opts.onIgnore === 'function') { opts.onIgnore(result); } result.isMatch = false; return returnObject ? result : false; } if (typeof opts.onMatch === 'function') { opts.onMatch(result); } return returnObject ? result : true; }; if (returnState) { matcher.state = state; } return matcher; }; /** * Test `input` with the given `regex`. This is used by the main * `picomatch()` function to test the input string. * * ```js * const picomatch = require('picomatch'); * // picomatch.test(input, regex[, options]); * * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } * ``` * @param {String} `input` String to test. * @param {RegExp} `regex` * @return {Object} Returns an object with matching info. * @api public */ picomatch.test = (input, regex, options, { glob, posix } = {}) => { if (typeof input !== 'string') { throw new TypeError('Expected input to be a string'); } if (input === '') { return { isMatch: false, output: '' }; } const opts = options || {}; const format = opts.format || (posix ? utils.toPosixSlashes : null); let match = input === glob; let output = (match && format) ? format(input) : input; if (match === false) { output = format ? format(input) : input; match = output === glob; } if (match === false || opts.capture === true) { if (opts.matchBase === true || opts.basename === true) { match = picomatch.matchBase(input, regex, options, posix); } else { match = regex.exec(output); } } return { isMatch: Boolean(match), match, output }; }; /** * Match the basename of a filepath. * * ```js * const picomatch = require('picomatch'); * // picomatch.matchBase(input, glob[, options]); * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true * ``` * @param {String} `input` String to test. * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). * @return {Boolean} * @api public */ picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); return regex.test(path.basename(input)); }; /** * Returns true if **any** of the given glob `patterns` match the specified `string`. * * ```js * const picomatch = require('picomatch'); * // picomatch.isMatch(string, patterns[, options]); * * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false * ``` * @param {String|Array} str The string to test. * @param {String|Array} patterns One or more glob patterns to use for matching. * @param {Object} [options] See available [options](#options). * @return {Boolean} Returns true if any patterns match `str` * @api public */ picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); /** * Parse a glob pattern to create the source string for a regular * expression. * * ```js * const picomatch = require('picomatch'); * const result = picomatch.parse(pattern[, options]); * ``` * @param {String} `pattern` * @param {Object} `options` * @return {Object} Returns an object with useful properties and output to be used as a regex source string. * @api public */ picomatch.parse = (pattern, options) => { if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); return parse(pattern, { ...options, fastpaths: false }); }; /** * Scan a glob pattern to separate the pattern into segments. * * ```js * const picomatch = require('picomatch'); * // picomatch.scan(input[, options]); * * const result = picomatch.scan('!./foo/*.js'); * console.log(result); * { prefix: '!./', * input: '!./foo/*.js', * start: 3, * base: 'foo', * glob: '*.js', * isBrace: false, * isBracket: false, * isGlob: true, * isExtglob: false, * isGlobstar: false, * negated: true } * ``` * @param {String} `input` Glob pattern to scan. * @param {Object} `options` * @return {Object} Returns an object with * @api public */ picomatch.scan = (input, options) => scan(input, options); /** * Compile a regular expression from the `state` object returned by the * [parse()](#parse) method. * * @param {Object} `state` * @param {Object} `options` * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. * @return {RegExp} * @api public */ picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { if (returnOutput === true) { return state.output; } const opts = options || {}; const prepend = opts.contains ? '' : '^'; const append = opts.contains ? '' : '$'; let source = `${prepend}(?:${state.output})${append}`; if (state && state.negated === true) { source = `^(?!${source}).*$`; } const regex = picomatch.toRegex(source, options); if (returnState === true) { regex.state = state; } return regex; }; /** * Create a regular expression from a parsed glob pattern. * * ```js * const picomatch = require('picomatch'); * const state = picomatch.parse('*.js'); * // picomatch.compileRe(state[, options]); * * console.log(picomatch.compileRe(state)); * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ * ``` * @param {String} `state` The object returned from the `.parse` method. * @param {Object} `options` * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. * @return {RegExp} Returns a regex created from the given pattern. * @api public */ picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { if (!input || typeof input !== 'string') { throw new TypeError('Expected a non-empty string'); } let parsed = { negated: false, fastpaths: true }; if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { parsed.output = parse.fastpaths(input, options); } if (!parsed.output) { parsed = parse(input, options); } return picomatch.compileRe(parsed, options, returnOutput, returnState); }; /** * Create a regular expression from the given regex source string. * * ```js * const picomatch = require('picomatch'); * // picomatch.toRegex(source[, options]); * * const { output } = picomatch.parse('*.js'); * console.log(picomatch.toRegex(output)); * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ * ``` * @param {String} `source` Regular expression source string. * @param {Object} `options` * @return {RegExp} * @api public */ picomatch.toRegex = (source, options) => { try { const opts = options || {}; return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); } catch (err) { if (options && options.debug === true) throw err; return /$^/; } }; /** * Picomatch constants. * @return {Object} */ picomatch.constants = constants; /** * Expose "picomatch" */ module.exports = picomatch; /***/ }), /***/ 1472: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const utils = __nccwpck_require__(7432); const { CHAR_ASTERISK, /* * */ CHAR_AT, /* @ */ CHAR_BACKWARD_SLASH, /* \ */ CHAR_COMMA, /* , */ CHAR_DOT, /* . */ CHAR_EXCLAMATION_MARK, /* ! */ CHAR_FORWARD_SLASH, /* / */ CHAR_LEFT_CURLY_BRACE, /* { */ CHAR_LEFT_PARENTHESES, /* ( */ CHAR_LEFT_SQUARE_BRACKET, /* [ */ CHAR_PLUS, /* + */ CHAR_QUESTION_MARK, /* ? */ CHAR_RIGHT_CURLY_BRACE, /* } */ CHAR_RIGHT_PARENTHESES, /* ) */ CHAR_RIGHT_SQUARE_BRACKET /* ] */ } = __nccwpck_require__(7892); const isPathSeparator = code => { return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; }; const depth = token => { if (token.isPrefix !== true) { token.depth = token.isGlobstar ? Infinity : 1; } }; /** * Quickly scans a glob pattern and returns an object with a handful of * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). * * ```js * const pm = require('picomatch'); * console.log(pm.scan('foo/bar/*.js')); * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } * ``` * @param {String} `str` * @param {Object} `options` * @return {Object} Returns an object with tokens and regex source string. * @api public */ const scan = (input, options) => { const opts = options || {}; const length = input.length - 1; const scanToEnd = opts.parts === true || opts.scanToEnd === true; const slashes = []; const tokens = []; const parts = []; let str = input; let index = -1; let start = 0; let lastIndex = 0; let isBrace = false; let isBracket = false; let isGlob = false; let isExtglob = false; let isGlobstar = false; let braceEscaped = false; let backslashes = false; let negated = false; let negatedExtglob = false; let finished = false; let braces = 0; let prev; let code; let token = { value: '', depth: 0, isGlob: false }; const eos = () => index >= length; const peek = () => str.charCodeAt(index + 1); const advance = () => { prev = code; return str.charCodeAt(++index); }; while (index < length) { code = advance(); let next; if (code === CHAR_BACKWARD_SLASH) { backslashes = token.backslashes = true; code = advance(); if (code === CHAR_LEFT_CURLY_BRACE) { braceEscaped = true; } continue; } if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { braces++; while (eos() !== true && (code = advance())) { if (code === CHAR_BACKWARD_SLASH) { backslashes = token.backslashes = true; advance(); continue; } if (code === CHAR_LEFT_CURLY_BRACE) { braces++; continue; } if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { isBrace = token.isBrace = true; isGlob = token.isGlob = true; finished = true; if (scanToEnd === true) { continue; } break; } if (braceEscaped !== true && code === CHAR_COMMA) { isBrace = token.isBrace = true; isGlob = token.isGlob = true; finished = true; if (scanToEnd === true) { continue; } break; } if (code === CHAR_RIGHT_CURLY_BRACE) { braces--; if (braces === 0) { braceEscaped = false; isBrace = token.isBrace = true; finished = true; break; } } } if (scanToEnd === true) { continue; } break; } if (code === CHAR_FORWARD_SLASH) { slashes.push(index); tokens.push(token); token = { value: '', depth: 0, isGlob: false }; if (finished === true) continue; if (prev === CHAR_DOT && index === (start + 1)) { start += 2; continue; } lastIndex = index + 1; continue; } if (opts.noext !== true) { const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK; if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { isGlob = token.isGlob = true; isExtglob = token.isExtglob = true; finished = true; if (code === CHAR_EXCLAMATION_MARK && index === start) { negatedExtglob = true; } if (scanToEnd === true) { while (eos() !== true && (code = advance())) { if (code === CHAR_BACKWARD_SLASH) { backslashes = token.backslashes = true; code = advance(); continue; } if (code === CHAR_RIGHT_PARENTHESES) { isGlob = token.isGlob = true; finished = true; break; } } continue; } break; } } if (code === CHAR_ASTERISK) { if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; isGlob = token.isGlob = true; finished = true; if (scanToEnd === true) { continue; } break; } if (code === CHAR_QUESTION_MARK) { isGlob = token.isGlob = true; finished = true; if (scanToEnd === true) { continue; } break; } if (code === CHAR_LEFT_SQUARE_BRACKET) { while (eos() !== true && (next = advance())) { if (next === CHAR_BACKWARD_SLASH) { backslashes = token.backslashes = true; advance(); continue; } if (next === CHAR_RIGHT_SQUARE_BRACKET) { isBracket = token.isBracket = true; isGlob = token.isGlob = true; finished = true; break; } } if (scanToEnd === true) { continue; } break; } if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { negated = token.negated = true; start++; continue; } if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { isGlob = token.isGlob = true; if (scanToEnd === true) { while (eos() !== true && (code = advance())) { if (code === CHAR_LEFT_PARENTHESES) { backslashes = token.backslashes = true; code = advance(); continue; } if (code === CHAR_RIGHT_PARENTHESES) { finished = true; break; } } continue; } break; } if (isGlob === true) { finished = true; if (scanToEnd === true) { continue; } break; } } if (opts.noext === true) { isExtglob = false; isGlob = false; } let base = str; let prefix = ''; let glob = ''; if (start > 0) { prefix = str.slice(0, start); str = str.slice(start); lastIndex -= start; } if (base && isGlob === true && lastIndex > 0) { base = str.slice(0, lastIndex); glob = str.slice(lastIndex); } else if (isGlob === true) { base = ''; glob = str; } else { base = str; } if (base && base !== '' && base !== '/' && base !== str) { if (isPathSeparator(base.charCodeAt(base.length - 1))) { base = base.slice(0, -1); } } if (opts.unescape === true) { if (glob) glob = utils.removeBackslashes(glob); if (base && backslashes === true) { base = utils.removeBackslashes(base); } } const state = { prefix, input, start, base, glob, isBrace, isBracket, isGlob, isExtglob, isGlobstar, negated, negatedExtglob }; if (opts.tokens === true) { state.maxDepth = 0; if (!isPathSeparator(code)) { tokens.push(token); } state.tokens = tokens; } if (opts.parts === true || opts.tokens === true) { let prevIndex; for (let idx = 0; idx < slashes.length; idx++) { const n = prevIndex ? prevIndex + 1 : start; const i = slashes[idx]; const value = input.slice(n, i); if (opts.tokens) { if (idx === 0 && start !== 0) { tokens[idx].isPrefix = true; tokens[idx].value = prefix; } else { tokens[idx].value = value; } depth(tokens[idx]); state.maxDepth += tokens[idx].depth; } if (idx !== 0 || value !== '') { parts.push(value); } prevIndex = i; } if (prevIndex && prevIndex + 1 < input.length) { const value = input.slice(prevIndex + 1); parts.push(value); if (opts.tokens) { tokens[tokens.length - 1].value = value; depth(tokens[tokens.length - 1]); state.maxDepth += tokens[tokens.length - 1].depth; } } state.slashes = slashes; state.parts = parts; } return state; }; module.exports = scan; /***/ }), /***/ 7432: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { const path = __nccwpck_require__(6928); const win32 = process.platform === 'win32'; const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = __nccwpck_require__(7892); exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); exports.removeBackslashes = str => { return str.replace(REGEX_REMOVE_BACKSLASH, match => { return match === '\\' ? '' : match; }); }; exports.supportsLookbehinds = () => { const segs = process.version.slice(1).split('.').map(Number); if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { return true; } return false; }; exports.isWindows = options => { if (options && typeof options.windows === 'boolean') { return options.windows; } return win32 === true || path.sep === '\\'; }; exports.escapeLast = (input, char, lastIdx) => { const idx = input.lastIndexOf(char, lastIdx); if (idx === -1) return input; if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); return `${input.slice(0, idx)}\\${input.slice(idx)}`; }; exports.removePrefix = (input, state = {}) => { let output = input; if (output.startsWith('./')) { output = output.slice(2); state.prefix = './'; } return output; }; exports.wrapOutput = (input, state = {}, options = {}) => { const prepend = options.contains ? '' : '^'; const append = options.contains ? '' : '$'; let output = `${prepend}(?:${input})${append}`; if (state.negated === true) { output = `(?:^(?!${output}).*$)`; } return output; }; /***/ }), /***/ 8825: /***/ ((module) => { module.exports = rfdc function copyBuffer (cur) { if (cur instanceof Buffer) { return Buffer.from(cur) } return new cur.constructor(cur.buffer.slice(), cur.byteOffset, cur.length) } function rfdc (opts) { opts = opts || {} if (opts.circles) return rfdcCircles(opts) const constructorHandlers = new Map() constructorHandlers.set(Date, (o) => new Date(o)) constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn))) constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn))) if (opts.constructorHandlers) { for (const handler of opts.constructorHandlers) { constructorHandlers.set(handler[0], handler[1]) } } let handler = null return opts.proto ? cloneProto : clone function cloneArray (a, fn) { const keys = Object.keys(a) const a2 = new Array(keys.length) for (let i = 0; i < keys.length; i++) { const k = keys[i] const cur = a[k] if (typeof cur !== 'object' || cur === null) { a2[k] = cur } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) { a2[k] = handler(cur, fn) } else if (ArrayBuffer.isView(cur)) { a2[k] = copyBuffer(cur) } else { a2[k] = fn(cur) } } return a2 } function clone (o) { if (typeof o !== 'object' || o === null) return o if (Array.isArray(o)) return cloneArray(o, clone) if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) { return handler(o, clone) } const o2 = {} for (const k in o) { if (Object.hasOwnProperty.call(o, k) === false) continue const cur = o[k] if (typeof cur !== 'object' || cur === null) { o2[k] = cur } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) { o2[k] = handler(cur, clone) } else if (ArrayBuffer.isView(cur)) { o2[k] = copyBuffer(cur) } else { o2[k] = clone(cur) } } return o2 } function cloneProto (o) { if (typeof o !== 'object' || o === null) return o if (Array.isArray(o)) return cloneArray(o, cloneProto) if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) { return handler(o, cloneProto) } const o2 = {} for (const k in o) { const cur = o[k] if (typeof cur !== 'object' || cur === null) { o2[k] = cur } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) { o2[k] = handler(cur, cloneProto) } else if (ArrayBuffer.isView(cur)) { o2[k] = copyBuffer(cur) } else { o2[k] = cloneProto(cur) } } return o2 } } function rfdcCircles (opts) { const refs = [] const refsNew = [] const constructorHandlers = new Map() constructorHandlers.set(Date, (o) => new Date(o)) constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn))) constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn))) if (opts.constructorHandlers) { for (const handler of opts.constructorHandlers) { constructorHandlers.set(handler[0], handler[1]) } } let handler = null return opts.proto ? cloneProto : clone function cloneArray (a, fn) { const keys = Object.keys(a) const a2 = new Array(keys.length) for (let i = 0; i < keys.length; i++) { const k = keys[i] const cur = a[k] if (typeof cur !== 'object' || cur === null) { a2[k] = cur } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) { a2[k] = handler(cur, fn) } else if (ArrayBuffer.isView(cur)) { a2[k] = copyBuffer(cur) } else { const index = refs.indexOf(cur) if (index !== -1) { a2[k] = refsNew[index] } else { a2[k] = fn(cur) } } } return a2 } function clone (o) { if (typeof o !== 'object' || o === null) return o if (Array.isArray(o)) return cloneArray(o, clone) if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) { return handler(o, clone) } const o2 = {} refs.push(o) refsNew.push(o2) for (const k in o) { if (Object.hasOwnProperty.call(o, k) === false) continue const cur = o[k] if (typeof cur !== 'object' || cur === null) { o2[k] = cur } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) { o2[k] = handler(cur, clone) } else if (ArrayBuffer.isView(cur)) { o2[k] = copyBuffer(cur) } else { const i = refs.indexOf(cur) if (i !== -1) { o2[k] = refsNew[i] } else { o2[k] = clone(cur) } } } refs.pop() refsNew.pop() return o2 } function cloneProto (o) { if (typeof o !== 'object' || o === null) return o if (Array.isArray(o)) return cloneArray(o, cloneProto) if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) { return handler(o, cloneProto) } const o2 = {} refs.push(o) refsNew.push(o2) for (const k in o) { const cur = o[k] if (typeof cur !== 'object' || cur === null) { o2[k] = cur } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) { o2[k] = handler(cur, cloneProto) } else if (ArrayBuffer.isView(cur)) { o2[k] = copyBuffer(cur) } else { const i = refs.indexOf(cur) if (i !== -1) { o2[k] = refsNew[i] } else { o2[k] = cloneProto(cur) } } } refs.pop() refsNew.pop() return o2 } } /***/ }), /***/ 3058: /***/ ((module, exports, __nccwpck_require__) => { /*! safe-buffer. MIT License. Feross Aboukhadijeh */ /* eslint-disable node/no-deprecated-api */ var buffer = __nccwpck_require__(181) var Buffer = buffer.Buffer // alternative to using Object.keys for old browsers function copyProps (src, dst) { for (var key in src) { dst[key] = src[key] } } if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { module.exports = buffer } else { // Copy properties from require('buffer') copyProps(buffer, exports) exports.Buffer = SafeBuffer } function SafeBuffer (arg, encodingOrOffset, length) { return Buffer(arg, encodingOrOffset, length) } SafeBuffer.prototype = Object.create(Buffer.prototype) // Copy static methods from Buffer copyProps(Buffer, SafeBuffer) SafeBuffer.from = function (arg, encodingOrOffset, length) { if (typeof arg === 'number') { throw new TypeError('Argument must not be a number') } return Buffer(arg, encodingOrOffset, length) } SafeBuffer.alloc = function (size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } var buf = Buffer(size) if (fill !== undefined) { if (typeof encoding === 'string') { buf.fill(fill, encoding) } else { buf.fill(fill) } } else { buf.fill(0) } return buf } SafeBuffer.allocUnsafe = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return Buffer(size) } SafeBuffer.allocUnsafeSlow = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return buffer.SlowBuffer(size) } /***/ }), /***/ 4690: /***/ ((module) => { /* node-bzip - a pure-javascript Node.JS module for decoding bzip2 data Copyright (C) 2012 Eli Skeggs 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. Adapted from bzip2.js, copyright 2011 antimatter15 (antimatter15@gmail.com). Based on micro-bunzip by Rob Landley (rob@landley.net). Based on bzip2 decompression code by Julian R Seward (jseward@acm.org), which also acknowledges contributions by Mike Burrows, David Wheeler, Peter Fenwick, Alistair Moffat, Radford Neal, Ian H. Witten, Robert Sedgewick, and Jon L. Bentley. */ var BITMASK = [0x00, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF]; // offset in bytes var BitReader = function(stream) { this.stream = stream; this.bitOffset = 0; this.curByte = 0; this.hasByte = false; }; BitReader.prototype._ensureByte = function() { if (!this.hasByte) { this.curByte = this.stream.readByte(); this.hasByte = true; } }; // reads bits from the buffer BitReader.prototype.read = function(bits) { var result = 0; while (bits > 0) { this._ensureByte(); var remaining = 8 - this.bitOffset; // if we're in a byte if (bits >= remaining) { result <<= remaining; result |= BITMASK[remaining] & this.curByte; this.hasByte = false; this.bitOffset = 0; bits -= remaining; } else { result <<= bits; var shift = remaining - bits; result |= (this.curByte & (BITMASK[bits] << shift)) >> shift; this.bitOffset += bits; bits = 0; } } return result; }; // seek to an arbitrary point in the buffer (expressed in bits) BitReader.prototype.seek = function(pos) { var n_bit = pos % 8; var n_byte = (pos - n_bit) / 8; this.bitOffset = n_bit; this.stream.seek(n_byte); this.hasByte = false; }; // reads 6 bytes worth of data using the read method BitReader.prototype.pi = function() { var buf = new Buffer(6), i; for (i = 0; i < buf.length; i++) { buf[i] = this.read(8); } return buf.toString('hex'); }; module.exports = BitReader; /***/ }), /***/ 9050: /***/ ((module) => { /* CRC32, used in Bzip2 implementation. * This is a port of CRC32.java from the jbzip2 implementation at * https://code.google.com/p/jbzip2 * which is: * Copyright (c) 2011 Matthew Francis * * 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. * This JavaScript implementation is: * Copyright (c) 2013 C. Scott Ananian * with the same licensing terms as Matthew Francis' original implementation. */ module.exports = (function() { /** * A static CRC lookup table */ var crc32Lookup = new Uint32Array([ 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75, 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd, 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, 0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d, 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95, 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, 0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072, 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692, 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a, 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a, 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53, 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b, 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, 0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b, 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3, 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, 0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3, 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24, 0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654, 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c, 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c, 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4 ]); var CRC32 = function() { /** * The current CRC */ var crc = 0xffffffff; /** * @return The current CRC */ this.getCRC = function() { return (~crc) >>> 0; // return an unsigned value }; /** * Update the CRC with a single byte * @param value The value to update the CRC with */ this.updateCRC = function(value) { crc = (crc << 8) ^ crc32Lookup[((crc >>> 24) ^ value) & 0xff]; }; /** * Update the CRC with a sequence of identical bytes * @param value The value to update the CRC with * @param count The number of bytes */ this.updateCRCRun = function(value, count) { while (count-- > 0) { crc = (crc << 8) ^ crc32Lookup[((crc >>> 24) ^ value) & 0xff]; } }; }; return CRC32; })(); /***/ }), /***/ 9634: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /* seek-bzip - a pure-javascript module for seeking within bzip2 data Copyright (C) 2013 C. Scott Ananian Copyright (C) 2012 Eli Skeggs Copyright (C) 2011 Kevin Kwok 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. Adapted from node-bzip, copyright 2012 Eli Skeggs. Adapted from bzip2.js, copyright 2011 Kevin Kwok (antimatter15@gmail.com). Based on micro-bunzip by Rob Landley (rob@landley.net). Based on bzip2 decompression code by Julian R Seward (jseward@acm.org), which also acknowledges contributions by Mike Burrows, David Wheeler, Peter Fenwick, Alistair Moffat, Radford Neal, Ian H. Witten, Robert Sedgewick, and Jon L. Bentley. */ var BitReader = __nccwpck_require__(4690); var Stream = __nccwpck_require__(8744); var CRC32 = __nccwpck_require__(9050); var pjson = __nccwpck_require__(5302); var MAX_HUFCODE_BITS = 20; var MAX_SYMBOLS = 258; var SYMBOL_RUNA = 0; var SYMBOL_RUNB = 1; var MIN_GROUPS = 2; var MAX_GROUPS = 6; var GROUP_SIZE = 50; var WHOLEPI = "314159265359"; var SQRTPI = "177245385090"; var mtf = function(array, index) { var src = array[index], i; for (i = index; i > 0; i--) { array[i] = array[i-1]; } array[0] = src; return src; }; var Err = { OK: 0, LAST_BLOCK: -1, NOT_BZIP_DATA: -2, UNEXPECTED_INPUT_EOF: -3, UNEXPECTED_OUTPUT_EOF: -4, DATA_ERROR: -5, OUT_OF_MEMORY: -6, OBSOLETE_INPUT: -7, END_OF_BLOCK: -8 }; var ErrorMessages = {}; ErrorMessages[Err.LAST_BLOCK] = "Bad file checksum"; ErrorMessages[Err.NOT_BZIP_DATA] = "Not bzip data"; ErrorMessages[Err.UNEXPECTED_INPUT_EOF] = "Unexpected input EOF"; ErrorMessages[Err.UNEXPECTED_OUTPUT_EOF] = "Unexpected output EOF"; ErrorMessages[Err.DATA_ERROR] = "Data error"; ErrorMessages[Err.OUT_OF_MEMORY] = "Out of memory"; ErrorMessages[Err.OBSOLETE_INPUT] = "Obsolete (pre 0.9.5) bzip format not supported."; var _throw = function(status, optDetail) { var msg = ErrorMessages[status] || 'unknown error'; if (optDetail) { msg += ': '+optDetail; } var e = new TypeError(msg); e.errorCode = status; throw e; }; var Bunzip = function(inputStream, outputStream) { this.writePos = this.writeCurrent = this.writeCount = 0; this._start_bunzip(inputStream, outputStream); }; Bunzip.prototype._init_block = function() { var moreBlocks = this._get_next_block(); if ( !moreBlocks ) { this.writeCount = -1; return false; /* no more blocks */ } this.blockCRC = new CRC32(); return true; }; /* XXX micro-bunzip uses (inputStream, inputBuffer, len) as arguments */ Bunzip.prototype._start_bunzip = function(inputStream, outputStream) { /* Ensure that file starts with "BZh['1'-'9']." */ var buf = new Buffer(4); if (inputStream.read(buf, 0, 4) !== 4 || String.fromCharCode(buf[0], buf[1], buf[2]) !== 'BZh') _throw(Err.NOT_BZIP_DATA, 'bad magic'); var level = buf[3] - 0x30; if (level < 1 || level > 9) _throw(Err.NOT_BZIP_DATA, 'level out of range'); this.reader = new BitReader(inputStream); /* Fourth byte (ascii '1'-'9'), indicates block size in units of 100k of uncompressed data. Allocate intermediate buffer for block. */ this.dbufSize = 100000 * level; this.nextoutput = 0; this.outputStream = outputStream; this.streamCRC = 0; }; Bunzip.prototype._get_next_block = function() { var i, j, k; var reader = this.reader; // this is get_next_block() function from micro-bunzip: /* Read in header signature and CRC, then validate signature. (last block signature means CRC is for whole file, return now) */ var h = reader.pi(); if (h === SQRTPI) { // last block return false; /* no more blocks */ } if (h !== WHOLEPI) _throw(Err.NOT_BZIP_DATA); this.targetBlockCRC = reader.read(32) >>> 0; // (convert to unsigned) this.streamCRC = (this.targetBlockCRC ^ ((this.streamCRC << 1) | (this.streamCRC>>>31))) >>> 0; /* We can add support for blockRandomised if anybody complains. There was some code for this in busybox 1.0.0-pre3, but nobody ever noticed that it didn't actually work. */ if (reader.read(1)) _throw(Err.OBSOLETE_INPUT); var origPointer = reader.read(24); if (origPointer > this.dbufSize) _throw(Err.DATA_ERROR, 'initial position out of bounds'); /* mapping table: if some byte values are never used (encoding things like ascii text), the compression code removes the gaps to have fewer symbols to deal with, and writes a sparse bitfield indicating which values were present. We make a translation table to convert the symbols back to the corresponding bytes. */ var t = reader.read(16); var symToByte = new Buffer(256), symTotal = 0; for (i = 0; i < 16; i++) { if (t & (1 << (0xF - i))) { var o = i * 16; k = reader.read(16); for (j = 0; j < 16; j++) if (k & (1 << (0xF - j))) symToByte[symTotal++] = o + j; } } /* How many different huffman coding groups does this block use? */ var groupCount = reader.read(3); if (groupCount < MIN_GROUPS || groupCount > MAX_GROUPS) _throw(Err.DATA_ERROR); /* nSelectors: Every GROUP_SIZE many symbols we select a new huffman coding group. Read in the group selector list, which is stored as MTF encoded bit runs. (MTF=Move To Front, as each value is used it's moved to the start of the list.) */ var nSelectors = reader.read(15); if (nSelectors === 0) _throw(Err.DATA_ERROR); var mtfSymbol = new Buffer(256); for (i = 0; i < groupCount; i++) mtfSymbol[i] = i; var selectors = new Buffer(nSelectors); // was 32768... for (i = 0; i < nSelectors; i++) { /* Get next value */ for (j = 0; reader.read(1); j++) if (j >= groupCount) _throw(Err.DATA_ERROR); /* Decode MTF to get the next selector */ selectors[i] = mtf(mtfSymbol, j); } /* Read the huffman coding tables for each group, which code for symTotal literal symbols, plus two run symbols (RUNA, RUNB) */ var symCount = symTotal + 2; var groups = [], hufGroup; for (j = 0; j < groupCount; j++) { var length = new Buffer(symCount), temp = new Uint16Array(MAX_HUFCODE_BITS + 1); /* Read huffman code lengths for each symbol. They're stored in a way similar to mtf; record a starting value for the first symbol, and an offset from the previous value for everys symbol after that. */ t = reader.read(5); // lengths for (i = 0; i < symCount; i++) { for (;;) { if (t < 1 || t > MAX_HUFCODE_BITS) _throw(Err.DATA_ERROR); /* If first bit is 0, stop. Else second bit indicates whether to increment or decrement the value. */ if(!reader.read(1)) break; if(!reader.read(1)) t++; else t--; } length[i] = t; } /* Find largest and smallest lengths in this group */ var minLen, maxLen; minLen = maxLen = length[0]; for (i = 1; i < symCount; i++) { if (length[i] > maxLen) maxLen = length[i]; else if (length[i] < minLen) minLen = length[i]; } /* Calculate permute[], base[], and limit[] tables from length[]. * * permute[] is the lookup table for converting huffman coded symbols * into decoded symbols. base[] is the amount to subtract from the * value of a huffman symbol of a given length when using permute[]. * * limit[] indicates the largest numerical value a symbol with a given * number of bits can have. This is how the huffman codes can vary in * length: each code with a value>limit[length] needs another bit. */ hufGroup = {}; groups.push(hufGroup); hufGroup.permute = new Uint16Array(MAX_SYMBOLS); hufGroup.limit = new Uint32Array(MAX_HUFCODE_BITS + 2); hufGroup.base = new Uint32Array(MAX_HUFCODE_BITS + 1); hufGroup.minLen = minLen; hufGroup.maxLen = maxLen; /* Calculate permute[]. Concurently, initialize temp[] and limit[]. */ var pp = 0; for (i = minLen; i <= maxLen; i++) { temp[i] = hufGroup.limit[i] = 0; for (t = 0; t < symCount; t++) if (length[t] === i) hufGroup.permute[pp++] = t; } /* Count symbols coded for at each bit length */ for (i = 0; i < symCount; i++) temp[length[i]]++; /* Calculate limit[] (the largest symbol-coding value at each bit * length, which is (previous limit<<1)+symbols at this level), and * base[] (number of symbols to ignore at each bit length, which is * limit minus the cumulative count of symbols coded for already). */ pp = t = 0; for (i = minLen; i < maxLen; i++) { pp += temp[i]; /* We read the largest possible symbol size and then unget bits after determining how many we need, and those extra bits could be set to anything. (They're noise from future symbols.) At each level we're really only interested in the first few bits, so here we set all the trailing to-be-ignored bits to 1 so they don't affect the value>limit[length] comparison. */ hufGroup.limit[i] = pp - 1; pp <<= 1; t += temp[i]; hufGroup.base[i + 1] = pp - t; } hufGroup.limit[maxLen + 1] = Number.MAX_VALUE; /* Sentinal value for reading next sym. */ hufGroup.limit[maxLen] = pp + temp[maxLen] - 1; hufGroup.base[minLen] = 0; } /* We've finished reading and digesting the block header. Now read this block's huffman coded symbols from the file and undo the huffman coding and run length encoding, saving the result into dbuf[dbufCount++]=uc */ /* Initialize symbol occurrence counters and symbol Move To Front table */ var byteCount = new Uint32Array(256); for (i = 0; i < 256; i++) mtfSymbol[i] = i; /* Loop through compressed symbols. */ var runPos = 0, dbufCount = 0, selector = 0, uc; var dbuf = this.dbuf = new Uint32Array(this.dbufSize); symCount = 0; for (;;) { /* Determine which huffman coding group to use. */ if (!(symCount--)) { symCount = GROUP_SIZE - 1; if (selector >= nSelectors) { _throw(Err.DATA_ERROR); } hufGroup = groups[selectors[selector++]]; } /* Read next huffman-coded symbol. */ i = hufGroup.minLen; j = reader.read(i); for (;;i++) { if (i > hufGroup.maxLen) { _throw(Err.DATA_ERROR); } if (j <= hufGroup.limit[i]) break; j = (j << 1) | reader.read(1); } /* Huffman decode value to get nextSym (with bounds checking) */ j -= hufGroup.base[i]; if (j < 0 || j >= MAX_SYMBOLS) { _throw(Err.DATA_ERROR); } var nextSym = hufGroup.permute[j]; /* We have now decoded the symbol, which indicates either a new literal byte, or a repeated run of the most recent literal byte. First, check if nextSym indicates a repeated run, and if so loop collecting how many times to repeat the last literal. */ if (nextSym === SYMBOL_RUNA || nextSym === SYMBOL_RUNB) { /* If this is the start of a new run, zero out counter */ if (!runPos){ runPos = 1; t = 0; } /* Neat trick that saves 1 symbol: instead of or-ing 0 or 1 at each bit position, add 1 or 2 instead. For example, 1011 is 1<<0 + 1<<1 + 2<<2. 1010 is 2<<0 + 2<<1 + 1<<2. You can make any bit pattern that way using 1 less symbol than the basic or 0/1 method (except all bits 0, which would use no symbols, but a run of length 0 doesn't mean anything in this context). Thus space is saved. */ if (nextSym === SYMBOL_RUNA) t += runPos; else t += 2 * runPos; runPos <<= 1; continue; } /* When we hit the first non-run symbol after a run, we now know how many times to repeat the last literal, so append that many copies to our buffer of decoded symbols (dbuf) now. (The last literal used is the one at the head of the mtfSymbol array.) */ if (runPos){ runPos = 0; if (dbufCount + t > this.dbufSize) { _throw(Err.DATA_ERROR); } uc = symToByte[mtfSymbol[0]]; byteCount[uc] += t; while (t--) dbuf[dbufCount++] = uc; } /* Is this the terminating symbol? */ if (nextSym > symTotal) break; /* At this point, nextSym indicates a new literal character. Subtract one to get the position in the MTF array at which this literal is currently to be found. (Note that the result can't be -1 or 0, because 0 and 1 are RUNA and RUNB. But another instance of the first symbol in the mtf array, position 0, would have been handled as part of a run above. Therefore 1 unused mtf position minus 2 non-literal nextSym values equals -1.) */ if (dbufCount >= this.dbufSize) { _throw(Err.DATA_ERROR); } i = nextSym - 1; uc = mtf(mtfSymbol, i); uc = symToByte[uc]; /* We have our literal byte. Save it into dbuf. */ byteCount[uc]++; dbuf[dbufCount++] = uc; } /* At this point, we've read all the huffman-coded symbols (and repeated runs) for this block from the input stream, and decoded them into the intermediate buffer. There are dbufCount many decoded bytes in dbuf[]. Now undo the Burrows-Wheeler transform on dbuf. See http://dogma.net/markn/articles/bwt/bwt.htm */ if (origPointer < 0 || origPointer >= dbufCount) { _throw(Err.DATA_ERROR); } /* Turn byteCount into cumulative occurrence counts of 0 to n-1. */ j = 0; for (i = 0; i < 256; i++) { k = j + byteCount[i]; byteCount[i] = j; j = k; } /* Figure out what order dbuf would be in if we sorted it. */ for (i = 0; i < dbufCount; i++) { uc = dbuf[i] & 0xff; dbuf[byteCount[uc]] |= (i << 8); byteCount[uc]++; } /* Decode first byte by hand to initialize "previous" byte. Note that it doesn't get output, and if the first three characters are identical it doesn't qualify as a run (hence writeRunCountdown=5). */ var pos = 0, current = 0, run = 0; if (dbufCount) { pos = dbuf[origPointer]; current = (pos & 0xff); pos >>= 8; run = -1; } this.writePos = pos; this.writeCurrent = current; this.writeCount = dbufCount; this.writeRun = run; return true; /* more blocks to come */ }; /* Undo burrows-wheeler transform on intermediate buffer to produce output. If start_bunzip was initialized with out_fd=-1, then up to len bytes of data are written to outbuf. Return value is number of bytes written or error (all errors are negative numbers). If out_fd!=-1, outbuf and len are ignored, data is written to out_fd and return is RETVAL_OK or error. */ Bunzip.prototype._read_bunzip = function(outputBuffer, len) { var copies, previous, outbyte; /* james@jamestaylor.org: writeCount goes to -1 when the buffer is fully decoded, which results in this returning RETVAL_LAST_BLOCK, also equal to -1... Confusing, I'm returning 0 here to indicate no bytes written into the buffer */ if (this.writeCount < 0) { return 0; } var gotcount = 0; var dbuf = this.dbuf, pos = this.writePos, current = this.writeCurrent; var dbufCount = this.writeCount, outputsize = this.outputsize; var run = this.writeRun; while (dbufCount) { dbufCount--; previous = current; pos = dbuf[pos]; current = pos & 0xff; pos >>= 8; if (run++ === 3){ copies = current; outbyte = previous; current = -1; } else { copies = 1; outbyte = current; } this.blockCRC.updateCRCRun(outbyte, copies); while (copies--) { this.outputStream.writeByte(outbyte); this.nextoutput++; } if (current != previous) run = 0; } this.writeCount = dbufCount; // check CRC if (this.blockCRC.getCRC() !== this.targetBlockCRC) { _throw(Err.DATA_ERROR, "Bad block CRC "+ "(got "+this.blockCRC.getCRC().toString(16)+ " expected "+this.targetBlockCRC.toString(16)+")"); } return this.nextoutput; }; var coerceInputStream = function(input) { if ('readByte' in input) { return input; } var inputStream = new Stream(); inputStream.pos = 0; inputStream.readByte = function() { return input[this.pos++]; }; inputStream.seek = function(pos) { this.pos = pos; }; inputStream.eof = function() { return this.pos >= input.length; }; return inputStream; }; var coerceOutputStream = function(output) { var outputStream = new Stream(); var resizeOk = true; if (output) { if (typeof(output)==='number') { outputStream.buffer = new Buffer(output); resizeOk = false; } else if ('writeByte' in output) { return output; } else { outputStream.buffer = output; resizeOk = false; } } else { outputStream.buffer = new Buffer(16384); } outputStream.pos = 0; outputStream.writeByte = function(_byte) { if (resizeOk && this.pos >= this.buffer.length) { var newBuffer = new Buffer(this.buffer.length*2); this.buffer.copy(newBuffer); this.buffer = newBuffer; } this.buffer[this.pos++] = _byte; }; outputStream.getBuffer = function() { // trim buffer if (this.pos !== this.buffer.length) { if (!resizeOk) throw new TypeError('outputsize does not match decoded input'); var newBuffer = new Buffer(this.pos); this.buffer.copy(newBuffer, 0, 0, this.pos); this.buffer = newBuffer; } return this.buffer; }; outputStream._coerced = true; return outputStream; }; /* Static helper functions */ Bunzip.Err = Err; // 'input' can be a stream or a buffer // 'output' can be a stream or a buffer or a number (buffer size) Bunzip.decode = function(input, output, multistream) { // make a stream from a buffer, if necessary var inputStream = coerceInputStream(input); var outputStream = coerceOutputStream(output); var bz = new Bunzip(inputStream, outputStream); while (true) { if ('eof' in inputStream && inputStream.eof()) break; if (bz._init_block()) { bz._read_bunzip(); } else { var targetStreamCRC = bz.reader.read(32) >>> 0; // (convert to unsigned) if (targetStreamCRC !== bz.streamCRC) { _throw(Err.DATA_ERROR, "Bad stream CRC "+ "(got "+bz.streamCRC.toString(16)+ " expected "+targetStreamCRC.toString(16)+")"); } if (multistream && 'eof' in inputStream && !inputStream.eof()) { // note that start_bunzip will also resync the bit reader to next byte bz._start_bunzip(inputStream, outputStream); } else break; } } if ('getBuffer' in outputStream) return outputStream.getBuffer(); }; Bunzip.decodeBlock = function(input, pos, output) { // make a stream from a buffer, if necessary var inputStream = coerceInputStream(input); var outputStream = coerceOutputStream(output); var bz = new Bunzip(inputStream, outputStream); bz.reader.seek(pos); /* Fill the decode buffer for the block */ var moreBlocks = bz._get_next_block(); if (moreBlocks) { /* Init the CRC for writing */ bz.blockCRC = new CRC32(); /* Zero this so the current byte from before the seek is not written */ bz.writeCopies = 0; /* Decompress the block and write to stdout */ bz._read_bunzip(); // XXX keep writing? } if ('getBuffer' in outputStream) return outputStream.getBuffer(); }; /* Reads bzip2 file from stream or buffer `input`, and invoke * `callback(position, size)` once for each bzip2 block, * where position gives the starting position (in *bits*) * and size gives uncompressed size of the block (in *bytes*). */ Bunzip.table = function(input, callback, multistream) { // make a stream from a buffer, if necessary var inputStream = new Stream(); inputStream.delegate = coerceInputStream(input); inputStream.pos = 0; inputStream.readByte = function() { this.pos++; return this.delegate.readByte(); }; if (inputStream.delegate.eof) { inputStream.eof = inputStream.delegate.eof.bind(inputStream.delegate); } var outputStream = new Stream(); outputStream.pos = 0; outputStream.writeByte = function() { this.pos++; }; var bz = new Bunzip(inputStream, outputStream); var blockSize = bz.dbufSize; while (true) { if ('eof' in inputStream && inputStream.eof()) break; var position = inputStream.pos*8 + bz.reader.bitOffset; if (bz.reader.hasByte) { position -= 8; } if (bz._init_block()) { var start = outputStream.pos; bz._read_bunzip(); callback(position, outputStream.pos - start); } else { var crc = bz.reader.read(32); // (but we ignore the crc) if (multistream && 'eof' in inputStream && !inputStream.eof()) { // note that start_bunzip will also resync the bit reader to next byte bz._start_bunzip(inputStream, outputStream); console.assert(bz.dbufSize === blockSize, "shouldn't change block size within multistream file"); } else break; } } }; Bunzip.Stream = Stream; Bunzip.version = pjson.version; Bunzip.license = pjson.license; module.exports = Bunzip; /***/ }), /***/ 8744: /***/ ((module) => { /* very simple input/output stream interface */ var Stream = function() { }; // input streams ////////////// /** Returns the next byte, or -1 for EOF. */ Stream.prototype.readByte = function() { throw new Error("abstract method readByte() not implemented"); }; /** Attempts to fill the buffer; returns number of bytes read, or * -1 for EOF. */ Stream.prototype.read = function(buffer, bufOffset, length) { var bytesRead = 0; while (bytesRead < length) { var c = this.readByte(); if (c < 0) { // EOF return (bytesRead===0) ? -1 : bytesRead; } buffer[bufOffset++] = c; bytesRead++; } return bytesRead; }; Stream.prototype.seek = function(new_pos) { throw new Error("abstract method seek() not implemented"); }; // output streams /////////// Stream.prototype.writeByte = function(_byte) { throw new Error("abstract method readByte() not implemented"); }; Stream.prototype.write = function(buffer, bufOffset, length) { var i; for (i=0; i { var GetIntrinsic = __nccwpck_require__(470); var define = __nccwpck_require__(1316); var hasDescriptors = __nccwpck_require__(497)(); var gOPD = __nccwpck_require__(3170); var $TypeError = __nccwpck_require__(3314); var $floor = GetIntrinsic('%Math.floor%'); /** @type {import('.')} */ module.exports = function setFunctionLength(fn, length) { if (typeof fn !== 'function') { throw new $TypeError('`fn` is not a function'); } if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) { throw new $TypeError('`length` must be a positive 32-bit integer'); } var loose = arguments.length > 2 && !!arguments[2]; var functionLengthIsConfigurable = true; var functionLengthIsWritable = true; if ('length' in fn && gOPD) { var desc = gOPD(fn, 'length'); if (desc && !desc.configurable) { functionLengthIsConfigurable = false; } if (desc && !desc.writable) { functionLengthIsWritable = false; } } if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) { if (hasDescriptors) { define(/** @type {Parameters[0]} */ (fn), 'length', length, true, true); } else { define(/** @type {Parameters[0]} */ (fn), 'length', length); } } return fn; }; /***/ }), /***/ 634: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { // Copyright Joyent, Inc. and other Node contributors. // // 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. /**/ var Buffer = (__nccwpck_require__(6132).Buffer); /**/ var isEncoding = Buffer.isEncoding || function (encoding) { encoding = '' + encoding; switch (encoding && encoding.toLowerCase()) { case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': return true; default: return false; } }; function _normalizeEncoding(enc) { if (!enc) return 'utf8'; var retried; while (true) { switch (enc) { case 'utf8': case 'utf-8': return 'utf8'; case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return 'utf16le'; case 'latin1': case 'binary': return 'latin1'; case 'base64': case 'ascii': case 'hex': return enc; default: if (retried) return; // undefined enc = ('' + enc).toLowerCase(); retried = true; } } }; // Do not cache `Buffer.isEncoding` when checking encoding names as some // modules monkey-patch it to support additional encodings function normalizeEncoding(enc) { var nenc = _normalizeEncoding(enc); if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); return nenc || enc; } // StringDecoder provides an interface for efficiently splitting a series of // buffers into a series of JS strings without breaking apart multi-byte // characters. exports.I = StringDecoder; function StringDecoder(encoding) { this.encoding = normalizeEncoding(encoding); var nb; switch (this.encoding) { case 'utf16le': this.text = utf16Text; this.end = utf16End; nb = 4; break; case 'utf8': this.fillLast = utf8FillLast; nb = 4; break; case 'base64': this.text = base64Text; this.end = base64End; nb = 3; break; default: this.write = simpleWrite; this.end = simpleEnd; return; } this.lastNeed = 0; this.lastTotal = 0; this.lastChar = Buffer.allocUnsafe(nb); } StringDecoder.prototype.write = function (buf) { if (buf.length === 0) return ''; var r; var i; if (this.lastNeed) { r = this.fillLast(buf); if (r === undefined) return ''; i = this.lastNeed; this.lastNeed = 0; } else { i = 0; } if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); return r || ''; }; StringDecoder.prototype.end = utf8End; // Returns only complete characters in a Buffer StringDecoder.prototype.text = utf8Text; // Attempts to complete a partial non-UTF-8 character using bytes from a Buffer StringDecoder.prototype.fillLast = function (buf) { if (this.lastNeed <= buf.length) { buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); this.lastNeed -= buf.length; }; // Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a // continuation byte. If an invalid byte is detected, -2 is returned. function utf8CheckByte(byte) { if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; return byte >> 6 === 0x02 ? -1 : -2; } // Checks at most 3 bytes at the end of a Buffer in order to detect an // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) // needed to complete the UTF-8 character (if applicable) are returned. function utf8CheckIncomplete(self, buf, i) { var j = buf.length - 1; if (j < i) return 0; var nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) self.lastNeed = nb - 1; return nb; } if (--j < i || nb === -2) return 0; nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) self.lastNeed = nb - 2; return nb; } if (--j < i || nb === -2) return 0; nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) { if (nb === 2) nb = 0;else self.lastNeed = nb - 3; } return nb; } return 0; } // Validates as many continuation bytes for a multi-byte UTF-8 character as // needed or are available. If we see a non-continuation byte where we expect // one, we "replace" the validated continuation bytes we've seen so far with // a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding // behavior. The continuation byte check is included three times in the case // where all of the continuation bytes for a character exist in the same buffer. // It is also done this way as a slight performance increase instead of using a // loop. function utf8CheckExtraBytes(self, buf, p) { if ((buf[0] & 0xC0) !== 0x80) { self.lastNeed = 0; return '\ufffd'; } if (self.lastNeed > 1 && buf.length > 1) { if ((buf[1] & 0xC0) !== 0x80) { self.lastNeed = 1; return '\ufffd'; } if (self.lastNeed > 2 && buf.length > 2) { if ((buf[2] & 0xC0) !== 0x80) { self.lastNeed = 2; return '\ufffd'; } } } } // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. function utf8FillLast(buf) { var p = this.lastTotal - this.lastNeed; var r = utf8CheckExtraBytes(this, buf, p); if (r !== undefined) return r; if (this.lastNeed <= buf.length) { buf.copy(this.lastChar, p, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } buf.copy(this.lastChar, p, 0, buf.length); this.lastNeed -= buf.length; } // Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a // partial character, the character's bytes are buffered until the required // number of bytes are available. function utf8Text(buf, i) { var total = utf8CheckIncomplete(this, buf, i); if (!this.lastNeed) return buf.toString('utf8', i); this.lastTotal = total; var end = buf.length - (total - this.lastNeed); buf.copy(this.lastChar, 0, end); return buf.toString('utf8', i, end); } // For UTF-8, a replacement character is added when ending on a partial // character. function utf8End(buf) { var r = buf && buf.length ? this.write(buf) : ''; if (this.lastNeed) return r + '\ufffd'; return r; } // UTF-16LE typically needs two bytes per character, but even if we have an even // number of bytes available, we need to check if we end on a leading/high // surrogate. In that case, we need to wait for the next two bytes in order to // decode the last character properly. function utf16Text(buf, i) { if ((buf.length - i) % 2 === 0) { var r = buf.toString('utf16le', i); if (r) { var c = r.charCodeAt(r.length - 1); if (c >= 0xD800 && c <= 0xDBFF) { this.lastNeed = 2; this.lastTotal = 4; this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; return r.slice(0, -1); } } return r; } this.lastNeed = 1; this.lastTotal = 2; this.lastChar[0] = buf[buf.length - 1]; return buf.toString('utf16le', i, buf.length - 1); } // For UTF-16LE we do not explicitly append special replacement characters if we // end on a partial character, we simply let v8 handle that. function utf16End(buf) { var r = buf && buf.length ? this.write(buf) : ''; if (this.lastNeed) { var end = this.lastTotal - this.lastNeed; return r + this.lastChar.toString('utf16le', 0, end); } return r; } function base64Text(buf, i) { var n = (buf.length - i) % 3; if (n === 0) return buf.toString('base64', i); this.lastNeed = 3 - n; this.lastTotal = 3; if (n === 1) { this.lastChar[0] = buf[buf.length - 1]; } else { this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; } return buf.toString('base64', i, buf.length - n); } function base64End(buf) { var r = buf && buf.length ? this.write(buf) : ''; if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); return r; } // Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) function simpleWrite(buf) { return buf.toString(this.encoding); } function simpleEnd(buf) { return buf && buf.length ? this.write(buf) : ''; } /***/ }), /***/ 6132: /***/ ((module, exports, __nccwpck_require__) => { /* eslint-disable node/no-deprecated-api */ var buffer = __nccwpck_require__(181) var Buffer = buffer.Buffer // alternative to using Object.keys for old browsers function copyProps (src, dst) { for (var key in src) { dst[key] = src[key] } } if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { module.exports = buffer } else { // Copy properties from require('buffer') copyProps(buffer, exports) exports.Buffer = SafeBuffer } function SafeBuffer (arg, encodingOrOffset, length) { return Buffer(arg, encodingOrOffset, length) } // Copy static methods from Buffer copyProps(Buffer, SafeBuffer) SafeBuffer.from = function (arg, encodingOrOffset, length) { if (typeof arg === 'number') { throw new TypeError('Argument must not be a number') } return Buffer(arg, encodingOrOffset, length) } SafeBuffer.alloc = function (size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } var buf = Buffer(size) if (fill !== undefined) { if (typeof encoding === 'string') { buf.fill(fill, encoding) } else { buf.fill(fill) } } else { buf.fill(0) } return buf } SafeBuffer.allocUnsafe = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return Buffer(size) } SafeBuffer.allocUnsafeSlow = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return buffer.SlowBuffer(size) } /***/ }), /***/ 5245: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /*! * strip-dirs | MIT (c) Shinnosuke Watanabe * https://github.com/shinnn/node-strip-dirs */ const path = __nccwpck_require__(6928); const util = __nccwpck_require__(9023); const isNaturalNumber = __nccwpck_require__(6834); module.exports = function stripDirs(pathStr, count, option) { if (typeof pathStr !== 'string') { throw new TypeError( util.inspect(pathStr) + ' is not a string. First argument to strip-dirs must be a path string.' ); } if (path.posix.isAbsolute(pathStr) || path.win32.isAbsolute(pathStr)) { throw new Error(`${pathStr} is an absolute path. strip-dirs requires a relative path.`); } if (!isNaturalNumber(count, {includeZero: true})) { throw new Error( 'The Second argument of strip-dirs must be a natural number or 0, but received ' + util.inspect(count) + '.' ); } if (option) { if (typeof option !== 'object') { throw new TypeError( util.inspect(option) + ' is not an object. Expected an object with a boolean `disallowOverflow` property.' ); } if (Array.isArray(option)) { throw new TypeError( util.inspect(option) + ' is an array. Expected an object with a boolean `disallowOverflow` property.' ); } if ('disallowOverflow' in option && typeof option.disallowOverflow !== 'boolean') { throw new TypeError( util.inspect(option.disallowOverflow) + ' is neither true nor false. `disallowOverflow` option must be a Boolean value.' ); } } else { option = {disallowOverflow: false}; } const pathComponents = path.normalize(pathStr).split(path.sep); if (pathComponents.length > 1 && pathComponents[0] === '.') { pathComponents.shift(); } if (count > pathComponents.length - 1) { if (option.disallowOverflow) { throw new RangeError('Cannot strip more directories than there are.'); } count = pathComponents.length - 1; } return path.join.apply(null, pathComponents.slice(count)); }; /***/ }), /***/ 5763: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var util = __nccwpck_require__(9023) var bl = __nccwpck_require__(794) var xtend = __nccwpck_require__(869) var headers = __nccwpck_require__(8428) var Writable = (__nccwpck_require__(6131).Writable) var PassThrough = (__nccwpck_require__(6131).PassThrough) var noop = function () {} var overflow = function (size) { size &= 511 return size && 512 - size } var emptyStream = function (self, offset) { var s = new Source(self, offset) s.end() return s } var mixinPax = function (header, pax) { if (pax.path) header.name = pax.path if (pax.linkpath) header.linkname = pax.linkpath if (pax.size) header.size = parseInt(pax.size, 10) header.pax = pax return header } var Source = function (self, offset) { this._parent = self this.offset = offset PassThrough.call(this) } util.inherits(Source, PassThrough) Source.prototype.destroy = function (err) { this._parent.destroy(err) } var Extract = function (opts) { if (!(this instanceof Extract)) return new Extract(opts) Writable.call(this, opts) opts = opts || {} this._offset = 0 this._buffer = bl() this._missing = 0 this._partial = false this._onparse = noop this._header = null this._stream = null this._overflow = null this._cb = null this._locked = false this._destroyed = false this._pax = null this._paxGlobal = null this._gnuLongPath = null this._gnuLongLinkPath = null var self = this var b = self._buffer var oncontinue = function () { self._continue() } var onunlock = function (err) { self._locked = false if (err) return self.destroy(err) if (!self._stream) oncontinue() } var onstreamend = function () { self._stream = null var drain = overflow(self._header.size) if (drain) self._parse(drain, ondrain) else self._parse(512, onheader) if (!self._locked) oncontinue() } var ondrain = function () { self._buffer.consume(overflow(self._header.size)) self._parse(512, onheader) oncontinue() } var onpaxglobalheader = function () { var size = self._header.size self._paxGlobal = headers.decodePax(b.slice(0, size)) b.consume(size) onstreamend() } var onpaxheader = function () { var size = self._header.size self._pax = headers.decodePax(b.slice(0, size)) if (self._paxGlobal) self._pax = xtend(self._paxGlobal, self._pax) b.consume(size) onstreamend() } var ongnulongpath = function () { var size = self._header.size this._gnuLongPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding) b.consume(size) onstreamend() } var ongnulonglinkpath = function () { var size = self._header.size this._gnuLongLinkPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding) b.consume(size) onstreamend() } var onheader = function () { var offset = self._offset var header try { header = self._header = headers.decode(b.slice(0, 512), opts.filenameEncoding) } catch (err) { self.emit('error', err) } b.consume(512) if (!header) { self._parse(512, onheader) oncontinue() return } if (header.type === 'gnu-long-path') { self._parse(header.size, ongnulongpath) oncontinue() return } if (header.type === 'gnu-long-link-path') { self._parse(header.size, ongnulonglinkpath) oncontinue() return } if (header.type === 'pax-global-header') { self._parse(header.size, onpaxglobalheader) oncontinue() return } if (header.type === 'pax-header') { self._parse(header.size, onpaxheader) oncontinue() return } if (self._gnuLongPath) { header.name = self._gnuLongPath self._gnuLongPath = null } if (self._gnuLongLinkPath) { header.linkname = self._gnuLongLinkPath self._gnuLongLinkPath = null } if (self._pax) { self._header = header = mixinPax(header, self._pax) self._pax = null } self._locked = true if (!header.size || header.type === 'directory') { self._parse(512, onheader) self.emit('entry', header, emptyStream(self, offset), onunlock) return } self._stream = new Source(self, offset) self.emit('entry', header, self._stream, onunlock) self._parse(header.size, onstreamend) oncontinue() } this._onheader = onheader this._parse(512, onheader) } util.inherits(Extract, Writable) Extract.prototype.destroy = function (err) { if (this._destroyed) return this._destroyed = true if (err) this.emit('error', err) this.emit('close') if (this._stream) this._stream.emit('close') } Extract.prototype._parse = function (size, onparse) { if (this._destroyed) return this._offset += size this._missing = size if (onparse === this._onheader) this._partial = false this._onparse = onparse } Extract.prototype._continue = function () { if (this._destroyed) return var cb = this._cb this._cb = noop if (this._overflow) this._write(this._overflow, undefined, cb) else cb() } Extract.prototype._write = function (data, enc, cb) { if (this._destroyed) return var s = this._stream var b = this._buffer var missing = this._missing if (data.length) this._partial = true // we do not reach end-of-chunk now. just forward it if (data.length < missing) { this._missing -= data.length this._overflow = null if (s) return s.write(data, cb) b.append(data) return cb() } // end-of-chunk. the parser should call cb. this._cb = cb this._missing = 0 var overflow = null if (data.length > missing) { overflow = data.slice(missing) data = data.slice(0, missing) } if (s) s.end(data) else b.append(data) this._overflow = overflow this._onparse() } Extract.prototype._final = function (cb) { if (this._partial) return this.destroy(new Error('Unexpected end of data')) cb() } module.exports = Extract /***/ }), /***/ 8428: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { var toBuffer = __nccwpck_require__(6870) var alloc = __nccwpck_require__(8950) var ZEROS = '0000000000000000000' var SEVENS = '7777777777777777777' var ZERO_OFFSET = '0'.charCodeAt(0) var USTAR = 'ustar\x0000' var MASK = parseInt('7777', 8) var clamp = function (index, len, defaultValue) { if (typeof index !== 'number') return defaultValue index = ~~index // Coerce to integer. if (index >= len) return len if (index >= 0) return index index += len if (index >= 0) return index return 0 } var toType = function (flag) { switch (flag) { case 0: return 'file' case 1: return 'link' case 2: return 'symlink' case 3: return 'character-device' case 4: return 'block-device' case 5: return 'directory' case 6: return 'fifo' case 7: return 'contiguous-file' case 72: return 'pax-header' case 55: return 'pax-global-header' case 27: return 'gnu-long-link-path' case 28: case 30: return 'gnu-long-path' } return null } var toTypeflag = function (flag) { switch (flag) { case 'file': return 0 case 'link': return 1 case 'symlink': return 2 case 'character-device': return 3 case 'block-device': return 4 case 'directory': return 5 case 'fifo': return 6 case 'contiguous-file': return 7 case 'pax-header': return 72 } return 0 } var indexOf = function (block, num, offset, end) { for (; offset < end; offset++) { if (block[offset] === num) return offset } return end } var cksum = function (block) { var sum = 8 * 32 for (var i = 0; i < 148; i++) sum += block[i] for (var j = 156; j < 512; j++) sum += block[j] return sum } var encodeOct = function (val, n) { val = val.toString(8) if (val.length > n) return SEVENS.slice(0, n) + ' ' else return ZEROS.slice(0, n - val.length) + val + ' ' } /* Copied from the node-tar repo and modified to meet * tar-stream coding standard. * * Source: https://github.com/npm/node-tar/blob/51b6627a1f357d2eb433e7378e5f05e83b7aa6cd/lib/header.js#L349 */ function parse256 (buf) { // first byte MUST be either 80 or FF // 80 for positive, FF for 2's comp var positive if (buf[0] === 0x80) positive = true else if (buf[0] === 0xFF) positive = false else return null // build up a base-256 tuple from the least sig to the highest var zero = false var tuple = [] for (var i = buf.length - 1; i > 0; i--) { var byte = buf[i] if (positive) tuple.push(byte) else if (zero && byte === 0) tuple.push(0) else if (zero) { zero = false tuple.push(0x100 - byte) } else tuple.push(0xFF - byte) } var sum = 0 var l = tuple.length for (i = 0; i < l; i++) { sum += tuple[i] * Math.pow(256, i) } return positive ? sum : -1 * sum } var decodeOct = function (val, offset, length) { val = val.slice(offset, offset + length) offset = 0 // If prefixed with 0x80 then parse as a base-256 integer if (val[offset] & 0x80) { return parse256(val) } else { // Older versions of tar can prefix with spaces while (offset < val.length && val[offset] === 32) offset++ var end = clamp(indexOf(val, 32, offset, val.length), val.length, val.length) while (offset < end && val[offset] === 0) offset++ if (end === offset) return 0 return parseInt(val.slice(offset, end).toString(), 8) } } var decodeStr = function (val, offset, length, encoding) { return val.slice(offset, indexOf(val, 0, offset, offset + length)).toString(encoding) } var addLength = function (str) { var len = Buffer.byteLength(str) var digits = Math.floor(Math.log(len) / Math.log(10)) + 1 if (len + digits >= Math.pow(10, digits)) digits++ return (len + digits) + str } exports.decodeLongPath = function (buf, encoding) { return decodeStr(buf, 0, buf.length, encoding) } exports.encodePax = function (opts) { // TODO: encode more stuff in pax var result = '' if (opts.name) result += addLength(' path=' + opts.name + '\n') if (opts.linkname) result += addLength(' linkpath=' + opts.linkname + '\n') var pax = opts.pax if (pax) { for (var key in pax) { result += addLength(' ' + key + '=' + pax[key] + '\n') } } return toBuffer(result) } exports.decodePax = function (buf) { var result = {} while (buf.length) { var i = 0 while (i < buf.length && buf[i] !== 32) i++ var len = parseInt(buf.slice(0, i).toString(), 10) if (!len) return result var b = buf.slice(i + 1, len - 1).toString() var keyIndex = b.indexOf('=') if (keyIndex === -1) return result result[b.slice(0, keyIndex)] = b.slice(keyIndex + 1) buf = buf.slice(len) } return result } exports.encode = function (opts) { var buf = alloc(512) var name = opts.name var prefix = '' if (opts.typeflag === 5 && name[name.length - 1] !== '/') name += '/' if (Buffer.byteLength(name) !== name.length) return null // utf-8 while (Buffer.byteLength(name) > 100) { var i = name.indexOf('/') if (i === -1) return null prefix += prefix ? '/' + name.slice(0, i) : name.slice(0, i) name = name.slice(i + 1) } if (Buffer.byteLength(name) > 100 || Buffer.byteLength(prefix) > 155) return null if (opts.linkname && Buffer.byteLength(opts.linkname) > 100) return null buf.write(name) buf.write(encodeOct(opts.mode & MASK, 6), 100) buf.write(encodeOct(opts.uid, 6), 108) buf.write(encodeOct(opts.gid, 6), 116) buf.write(encodeOct(opts.size, 11), 124) buf.write(encodeOct((opts.mtime.getTime() / 1000) | 0, 11), 136) buf[156] = ZERO_OFFSET + toTypeflag(opts.type) if (opts.linkname) buf.write(opts.linkname, 157) buf.write(USTAR, 257) if (opts.uname) buf.write(opts.uname, 265) if (opts.gname) buf.write(opts.gname, 297) buf.write(encodeOct(opts.devmajor || 0, 6), 329) buf.write(encodeOct(opts.devminor || 0, 6), 337) if (prefix) buf.write(prefix, 345) buf.write(encodeOct(cksum(buf), 6), 148) return buf } exports.decode = function (buf, filenameEncoding) { var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET var name = decodeStr(buf, 0, 100, filenameEncoding) var mode = decodeOct(buf, 100, 8) var uid = decodeOct(buf, 108, 8) var gid = decodeOct(buf, 116, 8) var size = decodeOct(buf, 124, 12) var mtime = decodeOct(buf, 136, 12) var type = toType(typeflag) var linkname = buf[157] === 0 ? null : decodeStr(buf, 157, 100, filenameEncoding) var uname = decodeStr(buf, 265, 32) var gname = decodeStr(buf, 297, 32) var devmajor = decodeOct(buf, 329, 8) var devminor = decodeOct(buf, 337, 8) if (buf[345]) name = decodeStr(buf, 345, 155, filenameEncoding) + '/' + name // to support old tar versions that use trailing / to indicate dirs if (typeflag === 0 && name && name[name.length - 1] === '/') typeflag = 5 var c = cksum(buf) // checksum is still initial value if header was null. if (c === 8 * 32) return null // valid checksum if (c !== decodeOct(buf, 148, 8)) throw new Error('Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?') return { name: name, mode: mode, uid: uid, gid: gid, size: size, mtime: new Date(1000 * mtime), type: type, linkname: linkname, uname: uname, gname: gname, devmajor: devmajor, devminor: devminor } } /***/ }), /***/ 6118: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { exports.extract = __nccwpck_require__(5763) exports.pack = __nccwpck_require__(861) /***/ }), /***/ 861: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var constants = __nccwpck_require__(2147) var eos = __nccwpck_require__(1424) var util = __nccwpck_require__(9023) var alloc = __nccwpck_require__(8950) var toBuffer = __nccwpck_require__(6870) var Readable = (__nccwpck_require__(6131).Readable) var Writable = (__nccwpck_require__(6131).Writable) var StringDecoder = (__nccwpck_require__(3193).StringDecoder) var headers = __nccwpck_require__(8428) var DMODE = parseInt('755', 8) var FMODE = parseInt('644', 8) var END_OF_TAR = alloc(1024) var noop = function () {} var overflow = function (self, size) { size &= 511 if (size) self.push(END_OF_TAR.slice(0, 512 - size)) } function modeToType (mode) { switch (mode & constants.S_IFMT) { case constants.S_IFBLK: return 'block-device' case constants.S_IFCHR: return 'character-device' case constants.S_IFDIR: return 'directory' case constants.S_IFIFO: return 'fifo' case constants.S_IFLNK: return 'symlink' } return 'file' } var Sink = function (to) { Writable.call(this) this.written = 0 this._to = to this._destroyed = false } util.inherits(Sink, Writable) Sink.prototype._write = function (data, enc, cb) { this.written += data.length if (this._to.push(data)) return cb() this._to._drain = cb } Sink.prototype.destroy = function () { if (this._destroyed) return this._destroyed = true this.emit('close') } var LinkSink = function () { Writable.call(this) this.linkname = '' this._decoder = new StringDecoder('utf-8') this._destroyed = false } util.inherits(LinkSink, Writable) LinkSink.prototype._write = function (data, enc, cb) { this.linkname += this._decoder.write(data) cb() } LinkSink.prototype.destroy = function () { if (this._destroyed) return this._destroyed = true this.emit('close') } var Void = function () { Writable.call(this) this._destroyed = false } util.inherits(Void, Writable) Void.prototype._write = function (data, enc, cb) { cb(new Error('No body allowed for this entry')) } Void.prototype.destroy = function () { if (this._destroyed) return this._destroyed = true this.emit('close') } var Pack = function (opts) { if (!(this instanceof Pack)) return new Pack(opts) Readable.call(this, opts) this._drain = noop this._finalized = false this._finalizing = false this._destroyed = false this._stream = null } util.inherits(Pack, Readable) Pack.prototype.entry = function (header, buffer, callback) { if (this._stream) throw new Error('already piping an entry') if (this._finalized || this._destroyed) return if (typeof buffer === 'function') { callback = buffer buffer = null } if (!callback) callback = noop var self = this if (!header.size || header.type === 'symlink') header.size = 0 if (!header.type) header.type = modeToType(header.mode) if (!header.mode) header.mode = header.type === 'directory' ? DMODE : FMODE if (!header.uid) header.uid = 0 if (!header.gid) header.gid = 0 if (!header.mtime) header.mtime = new Date() if (typeof buffer === 'string') buffer = toBuffer(buffer) if (Buffer.isBuffer(buffer)) { header.size = buffer.length this._encode(header) this.push(buffer) overflow(self, header.size) process.nextTick(callback) return new Void() } if (header.type === 'symlink' && !header.linkname) { var linkSink = new LinkSink() eos(linkSink, function (err) { if (err) { // stream was closed self.destroy() return callback(err) } header.linkname = linkSink.linkname self._encode(header) callback() }) return linkSink } this._encode(header) if (header.type !== 'file' && header.type !== 'contiguous-file') { process.nextTick(callback) return new Void() } var sink = new Sink(this) this._stream = sink eos(sink, function (err) { self._stream = null if (err) { // stream was closed self.destroy() return callback(err) } if (sink.written !== header.size) { // corrupting tar self.destroy() return callback(new Error('size mismatch')) } overflow(self, header.size) if (self._finalizing) self.finalize() callback() }) return sink } Pack.prototype.finalize = function () { if (this._stream) { this._finalizing = true return } if (this._finalized) return this._finalized = true this.push(END_OF_TAR) this.push(null) } Pack.prototype.destroy = function (err) { if (this._destroyed) return this._destroyed = true if (err) this.emit('error', err) this.emit('close') if (this._stream && this._stream.destroy) this._stream.destroy() } Pack.prototype._encode = function (header) { if (!header.pax) { var buf = headers.encode(header) if (buf) { this.push(buf) return } } this._encodePax(header) } Pack.prototype._encodePax = function (header) { var paxHeader = headers.encodePax({ name: header.name, linkname: header.linkname, pax: header.pax }) var newHeader = { name: 'PaxHeader', mode: header.mode, uid: header.uid, gid: header.gid, size: paxHeader.length, mtime: header.mtime, type: 'pax-header', linkname: header.linkname && 'PaxHeader', uname: header.uname, gname: header.gname, devmajor: header.devmajor, devminor: header.devminor } this.push(headers.encode(newHeader)) this.push(paxHeader) overflow(this, paxHeader.length) newHeader.size = header.size newHeader.type = header.type this.push(headers.encode(newHeader)) } Pack.prototype._read = function (n) { var drain = this._drain this._drain = noop drain() } module.exports = Pack /***/ }), /***/ 461: /***/ ((module, exports, __nccwpck_require__) => { var Stream = __nccwpck_require__(2203) // through // // a stream that does nothing but re-emit the input. // useful for aggregating a series of changing but not ending streams into one stream) exports = module.exports = through through.through = through //create a readable writable stream. function through (write, end, opts) { write = write || function (data) { this.queue(data) } end = end || function () { this.queue(null) } var ended = false, destroyed = false, buffer = [], _ended = false var stream = new Stream() stream.readable = stream.writable = true stream.paused = false // stream.autoPause = !(opts && opts.autoPause === false) stream.autoDestroy = !(opts && opts.autoDestroy === false) stream.write = function (data) { write.call(this, data) return !stream.paused } function drain() { while(buffer.length && !stream.paused) { var data = buffer.shift() if(null === data) return stream.emit('end') else stream.emit('data', data) } } stream.queue = stream.push = function (data) { // console.error(ended) if(_ended) return stream if(data === null) _ended = true buffer.push(data) drain() return stream } //this will be registered as the first 'end' listener //must call destroy next tick, to make sure we're after any //stream piped from here. //this is only a problem if end is not emitted synchronously. //a nicer way to do this is to make sure this is the last listener for 'end' stream.on('end', function () { stream.readable = false if(!stream.writable && stream.autoDestroy) process.nextTick(function () { stream.destroy() }) }) function _end () { stream.writable = false end.call(stream) if(!stream.readable && stream.autoDestroy) stream.destroy() } stream.end = function (data) { if(ended) return ended = true if(arguments.length) stream.write(data) _end() // will emit or queue return stream } stream.destroy = function () { if(destroyed) return destroyed = true ended = true buffer.length = 0 stream.writable = stream.readable = false stream.emit('close') return stream } stream.pause = function () { if(stream.paused) return stream.paused = true return stream } stream.resume = function () { if(stream.paused) { stream.paused = false stream.emit('resume') } drain() //may have become paused again, //as drain emits 'data'. if(!stream.paused) stream.emit('drain') return stream } return stream } /***/ }), /***/ 6870: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var Buffer = (__nccwpck_require__(3058).Buffer); var isArray = __nccwpck_require__(3803); var typedArrayBuffer = __nccwpck_require__(8489); var isView = ArrayBuffer.isView || function isView(obj) { try { typedArrayBuffer(obj); return true; } catch (e) { return false; } }; var useUint8Array = typeof Uint8Array !== 'undefined'; var useArrayBuffer = typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined'; var useFromArrayBuffer = useArrayBuffer && (Buffer.prototype instanceof Uint8Array || Buffer.TYPED_ARRAY_SUPPORT); module.exports = function toBuffer(data, encoding) { /* * No need to do anything for exact instance * This is only valid when safe-buffer.Buffer === buffer.Buffer, i.e. when Buffer.from/Buffer.alloc existed */ if (data instanceof Buffer) { return data; } if (typeof data === 'string') { return Buffer.from(data, encoding); } /* * Wrap any TypedArray instances and DataViews * Makes sense only on engines with full TypedArray support -- let Buffer detect that */ if (useArrayBuffer && isView(data)) { // Bug in Node.js <6.3.1, which treats this as out-of-bounds if (data.byteLength === 0) { return Buffer.alloc(0); } // When Buffer is based on Uint8Array, we can just construct it from ArrayBuffer if (useFromArrayBuffer) { var res = Buffer.from(data.buffer, data.byteOffset, data.byteLength); /* * Recheck result size, as offset/length doesn't work on Node.js <5.10 * We just go to Uint8Array case if this fails */ if (res.byteLength === data.byteLength) { return res; } } // Convert to Uint8Array bytes and then to Buffer var uint8 = data instanceof Uint8Array ? data : new Uint8Array(data.buffer, data.byteOffset, data.byteLength); var result = Buffer.from(uint8); /* * Let's recheck that conversion succeeded * We have .length but not .byteLength when useFromArrayBuffer is false */ if (result.length === data.byteLength) { return result; } } /* * Uint8Array in engines where Buffer.from might not work with ArrayBuffer, just copy over * Doesn't make sense with other TypedArray instances */ if (useUint8Array && data instanceof Uint8Array) { return Buffer.from(data); } var isArr = isArray(data); if (isArr) { for (var i = 0; i < data.length; i += 1) { var x = data[i]; if ( typeof x !== 'number' || x < 0 || x > 255 || ~~x !== x // NaN and integer check ) { throw new RangeError('Array items must be numbers in the range 0-255.'); } } } /* * Old Buffer polyfill on an engine that doesn't have TypedArray support * Also, this is from a different Buffer polyfill implementation then we have, as instanceof check failed * Convert to our current Buffer implementation */ if ( isArr || ( Buffer.isBuffer(data) && data.constructor && typeof data.constructor.isBuffer === 'function' && data.constructor.isBuffer(data) ) ) { return Buffer.from(data); } throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.'); }; /***/ }), /***/ 3803: /***/ ((module) => { var toString = {}.toString; module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; /***/ }), /***/ 7551: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /*! * to-regex-range * * Copyright (c) 2015-present, Jon Schlinkert. * Released under the MIT License. */ const isNumber = __nccwpck_require__(721); const toRegexRange = (min, max, options) => { if (isNumber(min) === false) { throw new TypeError('toRegexRange: expected the first argument to be a number'); } if (max === void 0 || min === max) { return String(min); } if (isNumber(max) === false) { throw new TypeError('toRegexRange: expected the second argument to be a number.'); } let opts = { relaxZeros: true, ...options }; if (typeof opts.strictZeros === 'boolean') { opts.relaxZeros = opts.strictZeros === false; } let relax = String(opts.relaxZeros); let shorthand = String(opts.shorthand); let capture = String(opts.capture); let wrap = String(opts.wrap); let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap; if (toRegexRange.cache.hasOwnProperty(cacheKey)) { return toRegexRange.cache[cacheKey].result; } let a = Math.min(min, max); let b = Math.max(min, max); if (Math.abs(a - b) === 1) { let result = min + '|' + max; if (opts.capture) { return `(${result})`; } if (opts.wrap === false) { return result; } return `(?:${result})`; } let isPadded = hasPadding(min) || hasPadding(max); let state = { min, max, a, b }; let positives = []; let negatives = []; if (isPadded) { state.isPadded = isPadded; state.maxLen = String(state.max).length; } if (a < 0) { let newMin = b < 0 ? Math.abs(b) : 1; negatives = splitToPatterns(newMin, Math.abs(a), state, opts); a = state.a = 0; } if (b >= 0) { positives = splitToPatterns(a, b, state, opts); } state.negatives = negatives; state.positives = positives; state.result = collatePatterns(negatives, positives, opts); if (opts.capture === true) { state.result = `(${state.result})`; } else if (opts.wrap !== false && (positives.length + negatives.length) > 1) { state.result = `(?:${state.result})`; } toRegexRange.cache[cacheKey] = state; return state.result; }; function collatePatterns(neg, pos, options) { let onlyNegative = filterPatterns(neg, pos, '-', false, options) || []; let onlyPositive = filterPatterns(pos, neg, '', false, options) || []; let intersected = filterPatterns(neg, pos, '-?', true, options) || []; let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); return subpatterns.join('|'); } function splitToRanges(min, max) { let nines = 1; let zeros = 1; let stop = countNines(min, nines); let stops = new Set([max]); while (min <= stop && stop <= max) { stops.add(stop); nines += 1; stop = countNines(min, nines); } stop = countZeros(max + 1, zeros) - 1; while (min < stop && stop <= max) { stops.add(stop); zeros += 1; stop = countZeros(max + 1, zeros) - 1; } stops = [...stops]; stops.sort(compare); return stops; } /** * Convert a range to a regex pattern * @param {Number} `start` * @param {Number} `stop` * @return {String} */ function rangeToPattern(start, stop, options) { if (start === stop) { return { pattern: start, count: [], digits: 0 }; } let zipped = zip(start, stop); let digits = zipped.length; let pattern = ''; let count = 0; for (let i = 0; i < digits; i++) { let [startDigit, stopDigit] = zipped[i]; if (startDigit === stopDigit) { pattern += startDigit; } else if (startDigit !== '0' || stopDigit !== '9') { pattern += toCharacterClass(startDigit, stopDigit, options); } else { count++; } } if (count) { pattern += options.shorthand === true ? '\\d' : '[0-9]'; } return { pattern, count: [count], digits }; } function splitToPatterns(min, max, tok, options) { let ranges = splitToRanges(min, max); let tokens = []; let start = min; let prev; for (let i = 0; i < ranges.length; i++) { let max = ranges[i]; let obj = rangeToPattern(String(start), String(max), options); let zeros = ''; if (!tok.isPadded && prev && prev.pattern === obj.pattern) { if (prev.count.length > 1) { prev.count.pop(); } prev.count.push(obj.count[0]); prev.string = prev.pattern + toQuantifier(prev.count); start = max + 1; continue; } if (tok.isPadded) { zeros = padZeros(max, tok, options); } obj.string = zeros + obj.pattern + toQuantifier(obj.count); tokens.push(obj); start = max + 1; prev = obj; } return tokens; } function filterPatterns(arr, comparison, prefix, intersection, options) { let result = []; for (let ele of arr) { let { string } = ele; // only push if _both_ are negative... if (!intersection && !contains(comparison, 'string', string)) { result.push(prefix + string); } // or _both_ are positive if (intersection && contains(comparison, 'string', string)) { result.push(prefix + string); } } return result; } /** * Zip strings */ function zip(a, b) { let arr = []; for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]); return arr; } function compare(a, b) { return a > b ? 1 : b > a ? -1 : 0; } function contains(arr, key, val) { return arr.some(ele => ele[key] === val); } function countNines(min, len) { return Number(String(min).slice(0, -len) + '9'.repeat(len)); } function countZeros(integer, zeros) { return integer - (integer % Math.pow(10, zeros)); } function toQuantifier(digits) { let [start = 0, stop = ''] = digits; if (stop || start > 1) { return `{${start + (stop ? ',' + stop : '')}}`; } return ''; } function toCharacterClass(a, b, options) { return `[${a}${(b - a === 1) ? '' : '-'}${b}]`; } function hasPadding(str) { return /^-?(0+)\d/.test(str); } function padZeros(value, tok, options) { if (!tok.isPadded) { return value; } let diff = Math.abs(tok.maxLen - String(value).length); let relax = options.relaxZeros !== false; switch (diff) { case 0: return ''; case 1: return relax ? '0?' : '0'; case 2: return relax ? '0{0,2}' : '00'; default: { return relax ? `0{0,${diff}}` : `0{${diff}}`; } } } /** * Cache */ toRegexRange.cache = {}; toRegexRange.clearCache = () => (toRegexRange.cache = {}); /** * Expose `toRegexRange` */ module.exports = toRegexRange; /***/ }), /***/ 1552: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const punycode = __nccwpck_require__(8328); const regexes = __nccwpck_require__(7023); const mappingTable = __nccwpck_require__(2472); const { STATUS_MAPPING } = __nccwpck_require__(9156); function containsNonASCII(str) { return /[^\x00-\x7F]/u.test(str); } function findStatus(val) { let start = 0; let end = mappingTable.length - 1; while (start <= end) { const mid = Math.floor((start + end) / 2); const target = mappingTable[mid]; const min = Array.isArray(target[0]) ? target[0][0] : target[0]; const max = Array.isArray(target[0]) ? target[0][1] : target[0]; if (min <= val && max >= val) { return target.slice(1); } else if (min > val) { end = mid - 1; } else { start = mid + 1; } } return null; } function mapChars(domainName, { transitionalProcessing }) { let processed = ""; for (const ch of domainName) { const [status, mapping] = findStatus(ch.codePointAt(0)); switch (status) { case STATUS_MAPPING.disallowed: processed += ch; break; case STATUS_MAPPING.ignored: break; case STATUS_MAPPING.mapped: if (transitionalProcessing && ch === "ẞ") { processed += "ss"; } else { processed += mapping; } break; case STATUS_MAPPING.deviation: if (transitionalProcessing) { processed += mapping; } else { processed += ch; } break; case STATUS_MAPPING.valid: processed += ch; break; } } return processed; } function validateLabel(label, { checkHyphens, checkBidi, checkJoiners, transitionalProcessing, useSTD3ASCIIRules, isBidi }) { // "must be satisfied for a non-empty label" if (label.length === 0) { return true; } // "1. The label must be in Unicode Normalization Form NFC." if (label.normalize("NFC") !== label) { return false; } const codePoints = Array.from(label); // "2. If CheckHyphens, the label must not contain a U+002D HYPHEN-MINUS character in both the // third and fourth positions." // // "3. If CheckHyphens, the label must neither begin nor end with a U+002D HYPHEN-MINUS character." if (checkHyphens) { if ((codePoints[2] === "-" && codePoints[3] === "-") || (label.startsWith("-") || label.endsWith("-"))) { return false; } } // "4. If not CheckHyphens, the label must not begin with “xn--”." if (!checkHyphens) { if (label.startsWith("xn--")) { return false; } } // "5. The label must not contain a U+002E ( . ) FULL STOP." if (label.includes(".")) { return false; } // "6. The label must not begin with a combining mark, that is: General_Category=Mark." if (regexes.combiningMarks.test(codePoints[0])) { return false; } // "7. Each code point in the label must only have certain Status values according to Section 5" for (const ch of codePoints) { const codePoint = ch.codePointAt(0); const [status] = findStatus(codePoint); if (transitionalProcessing) { // "For Transitional Processing (deprecated), each value must be valid." if (status !== STATUS_MAPPING.valid) { return false; } } else if (status !== STATUS_MAPPING.valid && status !== STATUS_MAPPING.deviation) { // "For Nontransitional Processing, each value must be either valid or deviation." return false; } // "In addition, if UseSTD3ASCIIRules=true and the code point is an ASCII code point (U+0000..U+007F), then it must // be a lowercase letter (a-z), a digit (0-9), or a hyphen-minus (U+002D). (Note: This excludes uppercase ASCII // A-Z which are mapped in UTS #46 and disallowed in IDNA2008.)" if (useSTD3ASCIIRules && codePoint <= 0x7F) { if (!/^(?:[a-z]|[0-9]|-)$/u.test(ch)) { return false; } } } // "8. If CheckJoiners, the label must satisify the ContextJ rules" // https://tools.ietf.org/html/rfc5892#appendix-A if (checkJoiners) { let last = 0; for (const [i, ch] of codePoints.entries()) { if (ch === "\u200C" || ch === "\u200D") { if (i > 0) { if (regexes.combiningClassVirama.test(codePoints[i - 1])) { continue; } if (ch === "\u200C") { // TODO: make this more efficient const next = codePoints.indexOf("\u200C", i + 1); const test = next < 0 ? codePoints.slice(last) : codePoints.slice(last, next); if (regexes.validZWNJ.test(test.join(""))) { last = i + 1; continue; } } } return false; } } } // "9. If CheckBidi, and if the domain name is a Bidi domain name, then the label must satisfy..." // https://tools.ietf.org/html/rfc5893#section-2 if (checkBidi && isBidi) { let rtl; // 1 if (regexes.bidiS1LTR.test(codePoints[0])) { rtl = false; } else if (regexes.bidiS1RTL.test(codePoints[0])) { rtl = true; } else { return false; } if (rtl) { // 2-4 if (!regexes.bidiS2.test(label) || !regexes.bidiS3.test(label) || (regexes.bidiS4EN.test(label) && regexes.bidiS4AN.test(label))) { return false; } } else if (!regexes.bidiS5.test(label) || !regexes.bidiS6.test(label)) { // 5-6 return false; } } return true; } function isBidiDomain(labels) { const domain = labels.map(label => { if (label.startsWith("xn--")) { try { return punycode.decode(label.substring(4)); } catch { return ""; } } return label; }).join("."); return regexes.bidiDomain.test(domain); } function processing(domainName, options) { // 1. Map. let string = mapChars(domainName, options); // 2. Normalize. string = string.normalize("NFC"); // 3. Break. const labels = string.split("."); const isBidi = isBidiDomain(labels); // 4. Convert/Validate. let error = false; for (const [i, origLabel] of labels.entries()) { let label = origLabel; let transitionalProcessingForThisLabel = options.transitionalProcessing; if (label.startsWith("xn--")) { if (containsNonASCII(label)) { error = true; continue; } try { label = punycode.decode(label.substring(4)); } catch { if (!options.ignoreInvalidPunycode) { error = true; continue; } } labels[i] = label; if (label === "" || !containsNonASCII(label)) { error = true; } transitionalProcessingForThisLabel = false; } // No need to validate if we already know there is an error. if (error) { continue; } const validation = validateLabel(label, { ...options, transitionalProcessing: transitionalProcessingForThisLabel, isBidi }); if (!validation) { error = true; } } return { string: labels.join("."), error }; } function toASCII(domainName, { checkHyphens = false, checkBidi = false, checkJoiners = false, useSTD3ASCIIRules = false, verifyDNSLength = false, transitionalProcessing = false, ignoreInvalidPunycode = false } = {}) { const result = processing(domainName, { checkHyphens, checkBidi, checkJoiners, useSTD3ASCIIRules, transitionalProcessing, ignoreInvalidPunycode }); let labels = result.string.split("."); labels = labels.map(l => { if (containsNonASCII(l)) { try { return `xn--${punycode.encode(l)}`; } catch { result.error = true; } } return l; }); if (verifyDNSLength) { const total = labels.join(".").length; if (total > 253 || total === 0) { result.error = true; } for (let i = 0; i < labels.length; ++i) { if (labels[i].length > 63 || labels[i].length === 0) { result.error = true; break; } } } if (result.error) { return null; } return labels.join("."); } function toUnicode(domainName, { checkHyphens = false, checkBidi = false, checkJoiners = false, useSTD3ASCIIRules = false, transitionalProcessing = false, ignoreInvalidPunycode = false } = {}) { const result = processing(domainName, { checkHyphens, checkBidi, checkJoiners, useSTD3ASCIIRules, transitionalProcessing, ignoreInvalidPunycode }); return { domain: result.string, error: result.error }; } module.exports = { toASCII, toUnicode }; /***/ }), /***/ 7023: /***/ ((module) => { const combiningMarks = /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{11002}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11082}\u{110B0}-\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{11134}\u{11145}\u{11146}\u{11173}\u{11180}-\u{11182}\u{111B3}-\u{111C0}\u{111C9}-\u{111CC}\u{111CE}\u{111CF}\u{1122C}-\u{11237}\u{1123E}\u{11241}\u{112DF}-\u{112EA}\u{11300}-\u{11303}\u{1133B}\u{1133C}\u{1133E}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11357}\u{11362}\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113B8}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11435}-\u{11446}\u{1145E}\u{114B0}-\u{114C3}\u{115AF}-\u{115B5}\u{115B8}-\u{115C0}\u{115DC}\u{115DD}\u{11630}-\u{11640}\u{116AB}-\u{116B7}\u{1171D}-\u{1172B}\u{1182C}-\u{1183A}\u{11930}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{1193E}\u{11940}\u{11942}\u{11943}\u{119D1}-\u{119D7}\u{119DA}-\u{119E0}\u{119E4}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A39}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A5B}\u{11A8A}-\u{11A99}\u{11C2F}-\u{11C36}\u{11C38}-\u{11C3F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D8A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D97}\u{11EF3}-\u{11EF6}\u{11F00}\u{11F01}\u{11F03}\u{11F34}-\u{11F3A}\u{11F3E}-\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F51}-\u{16F87}\u{16F8F}-\u{16F92}\u{16FE4}\u{16FF0}\u{16FF1}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D165}-\u{1D169}\u{1D16D}-\u{1D172}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]/u; const combiningClassVirama = /[\u094D\u09CD\u0A4D\u0ACD\u0B4D\u0BCD\u0C4D\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E3A\u0EBA\u0F84\u1039\u103A\u1714\u1715\u1734\u17D2\u1A60\u1B44\u1BAA\u1BAB\u1BF2\u1BF3\u2D7F\uA806\uA82C\uA8C4\uA953\uA9C0\uAAF6\uABED\u{10A3F}\u{11046}\u{11070}\u{1107F}\u{110B9}\u{11133}\u{11134}\u{111C0}\u{11235}\u{112EA}\u{1134D}\u{113CE}-\u{113D0}\u{11442}\u{114C2}\u{115BF}\u{1163F}\u{116B6}\u{1172B}\u{11839}\u{1193D}\u{1193E}\u{119E0}\u{11A34}\u{11A47}\u{11A99}\u{11C3F}\u{11D44}\u{11D45}\u{11D97}\u{11F41}\u{11F42}\u{1612F}]/u; const validZWNJ = /[\u0620\u0626\u0628\u062A-\u062E\u0633-\u063F\u0641-\u0647\u0649\u064A\u066E\u066F\u0678-\u0687\u069A-\u06BF\u06C1\u06C2\u06CC\u06CE\u06D0\u06D1\u06FA-\u06FC\u06FF\u0712-\u0714\u071A-\u071D\u071F-\u0727\u0729\u072B\u072D\u072E\u074E-\u0758\u075C-\u076A\u076D-\u0770\u0772\u0775-\u0777\u077A-\u077F\u07CA-\u07EA\u0841-\u0845\u0848\u084A-\u0853\u0855\u0860\u0862-\u0865\u0868\u0886\u0889-\u088D\u08A0-\u08A9\u08AF\u08B0\u08B3-\u08B8\u08BA-\u08C8\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA872\u{10AC0}-\u{10AC4}\u{10ACD}\u{10AD3}-\u{10ADC}\u{10ADE}-\u{10AE0}\u{10AEB}-\u{10AEE}\u{10B80}\u{10B82}\u{10B86}-\u{10B88}\u{10B8A}\u{10B8B}\u{10B8D}\u{10B90}\u{10BAD}\u{10BAE}\u{10D00}-\u{10D21}\u{10D23}\u{10EC3}\u{10EC4}\u{10F30}-\u{10F32}\u{10F34}-\u{10F44}\u{10F51}-\u{10F53}\u{10F70}-\u{10F73}\u{10F76}-\u{10F81}\u{10FB0}\u{10FB2}\u{10FB3}\u{10FB8}\u{10FBB}\u{10FBC}\u{10FBE}\u{10FBF}\u{10FC1}\u{10FC4}\u{10FCA}\u{10FCB}\u{1E900}-\u{1E943}][\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13430}-\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*\u200C[\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13430}-\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*[\u0620\u0622-\u063F\u0641-\u064A\u066E\u066F\u0671-\u0673\u0675-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u077F\u07CA-\u07EA\u0840-\u0858\u0860\u0862-\u0865\u0867-\u086A\u0870-\u0882\u0886\u0889-\u088E\u08A0-\u08AC\u08AE-\u08C8\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA871\u{10AC0}-\u{10AC5}\u{10AC7}\u{10AC9}\u{10ACA}\u{10ACE}-\u{10AD6}\u{10AD8}-\u{10AE1}\u{10AE4}\u{10AEB}-\u{10AEF}\u{10B80}-\u{10B91}\u{10BA9}-\u{10BAE}\u{10D01}-\u{10D23}\u{10EC2}-\u{10EC4}\u{10F30}-\u{10F44}\u{10F51}-\u{10F54}\u{10F70}-\u{10F81}\u{10FB0}\u{10FB2}-\u{10FB6}\u{10FB8}-\u{10FBF}\u{10FC1}-\u{10FC4}\u{10FC9}\u{10FCA}\u{1E900}-\u{1E943}]/u; const bidiDomain = /[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u08A0-\u08C9\u08E2\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u; const bidiS1LTR = /[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A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EF\u0CF1-\u0CF3\u0D02-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D4F\u0D54-\u0D61\u0D66-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B4E-\u1B6A\u1B74-\u1B7F\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200E\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u249C-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113BA}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}\u{113CD}\u{113CF}\u{113D1}\u{113D3}-\u{113D5}\u{113D7}\u{113D8}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171E}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{1612A}-\u{1612C}\u{16130}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CCD6}-\u{1CCEF}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D800}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E5D0}-\u{1E5ED}\u{1E5F0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]/u; const bidiS1RTL = /[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D4A}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u; const bidiS2 = /^[\0-\x08\x0E-\x1B!-@\[-`\{-\x84\x86-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02B9\u02BA\u02C2-\u02CF\u02D2-\u02DF\u02E5-\u02ED\u02EF-\u036F\u0374\u0375\u037E\u0384\u0385\u0387\u03F6\u0483-\u0489\u058A\u058D-\u058F\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\u0600-\u070D\u070F-\u074A\u074D-\u07B1\u07C0-\u07FA\u07FD-\u082D\u0830-\u083E\u0840-\u085B\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u0897-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09F2\u09F3\u09FB\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AF1\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0BF3-\u0BFA\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C78-\u0C7E\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E3F\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39-\u0F3D\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1390-\u1399\u1400\u169B\u169C\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DB\u17DD\u17F0-\u17F9\u1800-\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1940\u1944\u1945\u19DE-\u19FF\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u200B-\u200D\u200F-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20C0\u20D0-\u20F0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u2150-\u215F\u2189-\u218B\u2190-\u2335\u237B-\u2394\u2396-\u2429\u2440-\u244A\u2460-\u249B\u24EA-\u26AB\u26AD-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF9-\u2CFF\u2D7F\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u3004\u3008-\u3020\u302A-\u302D\u3030\u3036\u3037\u303D-\u303F\u3099-\u309C\u30A0\u30FB\u31C0-\u31E5\u31EF\u321D\u321E\u3250-\u325F\u327C-\u327E\u32B1-\u32BF\u32CC-\u32CF\u3377-\u337A\u33DE\u33DF\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA60D-\uA60F\uA66F-\uA67F\uA69E\uA69F\uA6F0\uA6F1\uA700-\uA721\uA788\uA802\uA806\uA80B\uA825\uA826\uA828-\uA82C\uA838\uA839\uA874-\uA877\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uAB6A\uAB6B\uABE5\uABE8\uABED\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD8F\uFD92-\uFDC7\uFDCF\uFDF0-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFE70-\uFE74\uFE76-\uFEFC\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10101}\u{10140}-\u{1018C}\u{10190}-\u{1019C}\u{101A0}\u{101FD}\u{102E0}-\u{102FB}\u{10376}-\u{1037A}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{1091F}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A38}-\u{10A3A}\u{10A3F}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE6}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B39}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D27}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D69}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAB}-\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10EFC}-\u{10F27}\u{10F30}-\u{10F59}\u{10F70}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{11001}\u{11038}-\u{11046}\u{11052}-\u{11065}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{11660}-\u{1166C}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{11FD5}-\u{11FF1}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE2}\u{16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\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F10F}\u{1F12F}\u{1F16A}-\u{1F16F}\u{1F1AD}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D7}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F776}\u{1F77B}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA89}\u{1FA8F}-\u{1FAC6}\u{1FACE}-\u{1FADC}\u{1FADF}-\u{1FAE9}\u{1FAF0}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBF9}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*$/u; const bidiS3 = /[0-9\xB2\xB3\xB9\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u08A0-\u08C9\u08E2\u200F\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\u{102E1}-\u{102FB}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1CCF0}-\u{1CCF9}\u{1D7CE}-\u{1D7FF}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u; const bidiS4EN = /[0-9\xB2\xB3\xB9\u06F0-\u06F9\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFF10-\uFF19\u{102E1}-\u{102FB}\u{1CCF0}-\u{1CCF9}\u{1D7CE}-\u{1D7FF}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}]/u; const bidiS4AN = /[\u0600-\u0605\u0660-\u0669\u066B\u066C\u06DD\u0890\u0891\u08E2\u{10D30}-\u{10D39}\u{10D40}-\u{10D49}\u{10E60}-\u{10E7E}]/u; const bidiS5 = /^[\0-\x08\x0E-\x1B!-\x84\x86-\u0377\u037A-\u037F\u0384-\u038A\u038C\u038E-\u03A1\u03A3-\u052F\u0531-\u0556\u0559-\u058A\u058D-\u058F\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0606\u0607\u0609\u060A\u060C\u060E-\u061A\u064B-\u065F\u066A\u0670\u06D6-\u06DC\u06DE-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07F6-\u07F9\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u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DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E3A\u0E3F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FDA\u1000-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u13A0-\u13F5\u13F8-\u13FD\u1400-\u167F\u1681-\u169C\u16A0-\u16F8\u1700-\u1715\u171F-\u1736\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u1800-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE-\u1A1B\u1A1E-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1AB0-\u1ACE\u1B00-\u1B4C\u1B4E-\u1BF3\u1BFC-\u1C37\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD0-\u1CFA\u1D00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u200B-\u200E\u2010-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2071\u2074-\u208E\u2090-\u209C\u20A0-\u20C0\u20D0-\u20F0\u2100-\u218B\u2190-\u2429\u2440-\u244A\u2460-\u2B73\u2B76-\u2B95\u2B97-\u2CF3\u2CF9-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u303F\u3041-\u3096\u3099-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31E5\u31EF-\u321E\u3220-\uA48C\uA490-\uA4C6\uA4D0-\uA62B\uA640-\uA6F7\uA700-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA82C\uA830-\uA839\uA840-\uA877\uA880-\uA8C5\uA8CE-\uA8D9\uA8E0-\uA953\uA95F-\uA97C\uA980-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAAC2\uAADB-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB6B\uAB70-\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1E\uFB29\uFD3E-\uFD4F\uFDCF\uFDFD-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}-\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1018E}\u{10190}-\u{1019C}\u{101A0}\u{101D0}-\u{101FD}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E0}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{1037A}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{1091F}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10B39}-\u{10B3F}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6E}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{1104D}\u{11052}-\u{11075}\u{1107F}-\u{110C2}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11100}-\u{11134}\u{11136}-\u{11147}\u{11150}-\u{11176}\u{11180}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{11241}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112EA}\u{112F0}-\u{112F9}\u{11300}-\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133B}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D5}\u{113D7}\u{113D8}\u{113E1}\u{113E2}\u{11400}-\u{1145B}\u{1145D}-\u{11461}\u{11480}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B5}\u{115B8}-\u{115DD}\u{11600}-\u{11644}\u{11650}-\u{11659}\u{11660}-\u{1166C}\u{11680}-\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171D}-\u{1172B}\u{11730}-\u{11746}\u{11800}-\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D7}\u{119DA}-\u{119E4}\u{11A00}-\u{11A47}\u{11A50}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C36}\u{11C38}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D47}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF8}\u{11F00}-\u{11F10}\u{11F12}-\u{11F3A}\u{11F3E}-\u{11F5A}\u{11FB0}\u{11FC0}-\u{11FF1}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{13455}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF0}-\u{16AF5}\u{16B00}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F4F}-\u{16F87}\u{16F8F}-\u{16F9F}\u{16FE0}-\u{16FE4}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}-\u{1BCA3}\u{1CC00}-\u{1CCF9}\u{1CD00}-\u{1CEB3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D1EA}\u{1D200}-\u{1D245}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D300}-\u{1D356}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D7CB}\u{1D7CE}-\u{1DA8B}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E030}-\u{1E06D}\u{1E08F}\u{1E100}-\u{1E12C}\u{1E130}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AE}\u{1E2C0}-\u{1E2F9}\u{1E2FF}\u{1E4D0}-\u{1E4F9}\u{1E5D0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F1AD}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D7}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F776}\u{1F77B}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA89}\u{1FA8F}-\u{1FAC6}\u{1FACE}-\u{1FADC}\u{1FADF}-\u{1FAE9}\u{1FAF0}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]*$/u; const bidiS6 = /[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u06F0-\u06F9\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC0\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0\u0AE1\u0AE6-\u0AF0\u0AF9\u0B02\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0BE6-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C77\u0C7F\u0C80\u0C82-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D02-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D4F\u0D54-\u0D61\u0D66-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B4E-\u1B6A\u1B74-\u1B7F\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200E\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u2488-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E1}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113BA}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}\u{113CD}\u{113CF}\u{113D1}\u{113D3}-\u{113D5}\u{113D7}\u{113D8}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171E}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{1612A}-\u{1612C}\u{16130}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CCD6}-\u{1CCF9}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D7CE}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E5D0}-\u{1E5ED}\u{1E5F0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F100}-\u{1F10A}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1FBF0}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u; module.exports = { combiningMarks, combiningClassVirama, validZWNJ, bidiDomain, bidiS1LTR, bidiS1RTL, bidiS2, bidiS3, bidiS4EN, bidiS4AN, bidiS5, bidiS6 }; /***/ }), /***/ 9156: /***/ ((module) => { module.exports.STATUS_MAPPING = { mapped: 1, valid: 2, disallowed: 3, deviation: 6, ignored: 7 }; /***/ }), /***/ 770: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = __nccwpck_require__(218); /***/ }), /***/ 218: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { var net = __nccwpck_require__(9278); var tls = __nccwpck_require__(4756); var http = __nccwpck_require__(8611); var https = __nccwpck_require__(5692); var events = __nccwpck_require__(4434); var assert = __nccwpck_require__(2613); var util = __nccwpck_require__(9023); exports.httpOverHttp = httpOverHttp; exports.httpsOverHttp = httpsOverHttp; exports.httpOverHttps = httpOverHttps; exports.httpsOverHttps = httpsOverHttps; function httpOverHttp(options) { var agent = new TunnelingAgent(options); agent.request = http.request; return agent; } function httpsOverHttp(options) { var agent = new TunnelingAgent(options); agent.request = http.request; agent.createSocket = createSecureSocket; agent.defaultPort = 443; return agent; } function httpOverHttps(options) { var agent = new TunnelingAgent(options); agent.request = https.request; return agent; } function httpsOverHttps(options) { var agent = new TunnelingAgent(options); agent.request = https.request; agent.createSocket = createSecureSocket; agent.defaultPort = 443; return agent; } function TunnelingAgent(options) { var self = this; self.options = options || {}; self.proxyOptions = self.options.proxy || {}; self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets; self.requests = []; self.sockets = []; self.on('free', function onFree(socket, host, port, localAddress) { var options = toOptions(host, port, localAddress); for (var i = 0, len = self.requests.length; i < len; ++i) { var pending = self.requests[i]; if (pending.host === options.host && pending.port === options.port) { // Detect the request to connect same origin server, // reuse the connection. self.requests.splice(i, 1); pending.request.onSocket(socket); return; } } socket.destroy(); self.removeSocket(socket); }); } util.inherits(TunnelingAgent, events.EventEmitter); TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { var self = this; var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress)); if (self.sockets.length >= this.maxSockets) { // We are over limit so we'll add it to the queue. self.requests.push(options); return; } // If we are under maxSockets create a new one. self.createSocket(options, function(socket) { socket.on('free', onFree); socket.on('close', onCloseOrRemove); socket.on('agentRemove', onCloseOrRemove); req.onSocket(socket); function onFree() { self.emit('free', socket, options); } function onCloseOrRemove(err) { self.removeSocket(socket); socket.removeListener('free', onFree); socket.removeListener('close', onCloseOrRemove); socket.removeListener('agentRemove', onCloseOrRemove); } }); }; TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { var self = this; var placeholder = {}; self.sockets.push(placeholder); var connectOptions = mergeOptions({}, self.proxyOptions, { method: 'CONNECT', path: options.host + ':' + options.port, agent: false, headers: { host: options.host + ':' + options.port } }); if (options.localAddress) { connectOptions.localAddress = options.localAddress; } if (connectOptions.proxyAuth) { connectOptions.headers = connectOptions.headers || {}; connectOptions.headers['Proxy-Authorization'] = 'Basic ' + new Buffer(connectOptions.proxyAuth).toString('base64'); } debug('making CONNECT request'); var connectReq = self.request(connectOptions); connectReq.useChunkedEncodingByDefault = false; // for v0.6 connectReq.once('response', onResponse); // for v0.6 connectReq.once('upgrade', onUpgrade); // for v0.6 connectReq.once('connect', onConnect); // for v0.7 or later connectReq.once('error', onError); connectReq.end(); function onResponse(res) { // Very hacky. This is necessary to avoid http-parser leaks. res.upgrade = true; } function onUpgrade(res, socket, head) { // Hacky. process.nextTick(function() { onConnect(res, socket, head); }); } function onConnect(res, socket, head) { connectReq.removeAllListeners(); socket.removeAllListeners(); if (res.statusCode !== 200) { debug('tunneling socket could not be established, statusCode=%d', res.statusCode); socket.destroy(); var error = new Error('tunneling socket could not be established, ' + 'statusCode=' + res.statusCode); error.code = 'ECONNRESET'; options.request.emit('error', error); self.removeSocket(placeholder); return; } if (head.length > 0) { debug('got illegal response body from proxy'); socket.destroy(); var error = new Error('got illegal response body from proxy'); error.code = 'ECONNRESET'; options.request.emit('error', error); self.removeSocket(placeholder); return; } debug('tunneling connection has established'); self.sockets[self.sockets.indexOf(placeholder)] = socket; return cb(socket); } function onError(cause) { connectReq.removeAllListeners(); debug('tunneling socket could not be established, cause=%s\n', cause.message, cause.stack); var error = new Error('tunneling socket could not be established, ' + 'cause=' + cause.message); error.code = 'ECONNRESET'; options.request.emit('error', error); self.removeSocket(placeholder); } }; TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { var pos = this.sockets.indexOf(socket) if (pos === -1) { return; } this.sockets.splice(pos, 1); var pending = this.requests.shift(); if (pending) { // If we have pending requests and a socket gets closed a new one // needs to be created to take over in the pool for the one that closed. this.createSocket(pending, function(socket) { pending.request.onSocket(socket); }); } }; function createSecureSocket(options, cb) { var self = this; TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { var hostHeader = options.request.getHeader('host'); var tlsOptions = mergeOptions({}, self.options, { socket: socket, servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host }); // 0 is dummy port for v0.6 var secureSocket = tls.connect(0, tlsOptions); self.sockets[self.sockets.indexOf(socket)] = secureSocket; cb(secureSocket); }); } function toOptions(host, port, localAddress) { if (typeof host === 'string') { // since v0.10 return { host: host, port: port, localAddress: localAddress }; } return host; // for v0.11 or later } function mergeOptions(target) { for (var i = 1, len = arguments.length; i < len; ++i) { var overrides = arguments[i]; if (typeof overrides === 'object') { var keys = Object.keys(overrides); for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { var k = keys[j]; if (overrides[k] !== undefined) { target[k] = overrides[k]; } } } } return target; } var debug; if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { debug = function() { var args = Array.prototype.slice.call(arguments); if (typeof args[0] === 'string') { args[0] = 'TUNNEL: ' + args[0]; } else { args.unshift('TUNNEL:'); } console.error.apply(console, args); } } else { debug = function() {}; } exports.debug = debug; // for test /***/ }), /***/ 8489: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var $TypeError = __nccwpck_require__(3314); var callBound = __nccwpck_require__(3105); /** @type {undefined | ((thisArg: import('.').TypedArray) => Buffer)} */ var $typedArrayBuffer = callBound('TypedArray.prototype.buffer', true); var isTypedArray = __nccwpck_require__(6405); /** @type {import('.')} */ // node <= 0.10, < 0.11.4 has a nonconfigurable own property instead of a prototype getter module.exports = $typedArrayBuffer || function typedArrayBuffer(x) { if (!isTypedArray(x)) { throw new $TypeError('Not a Typed Array'); } return x.buffer; }; /***/ }), /***/ 8183: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var through = __nccwpck_require__(461); var bz2 = __nccwpck_require__(9226); var bitIterator = __nccwpck_require__(7685); module.exports = unbzip2Stream; function unbzip2Stream() { var bufferQueue = []; var hasBytes = 0; var blockSize = 0; var broken = false; var done = false; var bitReader = null; var streamCRC = null; function decompressBlock(push){ if(!blockSize){ blockSize = bz2.header(bitReader); //console.error("got header of", blockSize); streamCRC = 0; return true; }else{ var bufsize = 100000 * blockSize; var buf = new Int32Array(bufsize); var chunk = []; var f = function(b) { chunk.push(b); }; streamCRC = bz2.decompress(bitReader, f, buf, bufsize, streamCRC); if (streamCRC === null) { // reset for next bzip2 header blockSize = 0; return false; }else{ //console.error('decompressed', chunk.length,'bytes'); push(Buffer.from(chunk)); return true; } } } var outlength = 0; function decompressAndQueue(stream) { if (broken) return; try { return decompressBlock(function(d) { stream.queue(d); if (d !== null) { //console.error('write at', outlength.toString(16)); outlength += d.length; } else { //console.error('written EOS'); } }); } catch(e) { //console.error(e); stream.emit('error', e); broken = true; return false; } } return through( function write(data) { //console.error('received', data.length,'bytes in', typeof data); bufferQueue.push(data); hasBytes += data.length; if (bitReader === null) { bitReader = bitIterator(function() { return bufferQueue.shift(); }); } while (!broken && hasBytes - bitReader.bytesRead + 1 >= ((25000 + 100000 * blockSize) || 4)){ //console.error('decompressing with', hasBytes - bitReader.bytesRead + 1, 'bytes in buffer'); decompressAndQueue(this); } }, function end(x) { //console.error(x,'last compressing with', hasBytes, 'bytes in buffer'); while (!broken && bitReader && hasBytes > bitReader.bytesRead){ decompressAndQueue(this); } if (!broken) { if (streamCRC !== null) this.emit('error', new Error("input stream ended prematurely")); this.queue(null); } } ); } /***/ }), /***/ 7685: /***/ ((module) => { var BITMASK = [0, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF]; // returns a function that reads bits. // takes a buffer iterator as input module.exports = function bitIterator(nextBuffer) { var bit = 0, byte = 0; var bytes = nextBuffer(); var f = function(n) { if (n === null && bit != 0) { // align to byte boundary bit = 0 byte++; return; } var result = 0; while(n > 0) { if (byte >= bytes.length) { byte = 0; bytes = nextBuffer(); } var left = 8 - bit; if (bit === 0 && n > 0) f.bytesRead++; if (n >= left) { result <<= left; result |= (BITMASK[left] & bytes[byte++]); bit = 0; n -= left; } else { result <<= n; result |= ((bytes[byte] & (BITMASK[n] << (8 - n - bit))) >> (8 - n - bit)); bit += n; n = 0; } } return result; }; f.bytesRead = 0; return f; }; /***/ }), /***/ 9226: /***/ ((module) => { /* bzip2.js - a small bzip2 decompression implementation Copyright 2011 by antimatter15 (antimatter15@gmail.com) Based on micro-bunzip by Rob Landley (rob@landley.net). Copyright (c) 2011 by antimatter15 (antimatter15@gmail.com). 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. */ function Bzip2Error(message) { this.name = 'Bzip2Error'; this.message = message; this.stack = (new Error()).stack; } Bzip2Error.prototype = new Error; var message = { Error: function(message) {throw new Bzip2Error(message);} }; var bzip2 = {}; bzip2.Bzip2Error = Bzip2Error; bzip2.crcTable = [ 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75, 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd, 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, 0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d, 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95, 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, 0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072, 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692, 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a, 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a, 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53, 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b, 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, 0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b, 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3, 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, 0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3, 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24, 0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654, 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c, 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c, 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4 ]; bzip2.array = function(bytes) { var bit = 0, byte = 0; var BITMASK = [0, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF ]; return function(n) { var result = 0; while(n > 0) { var left = 8 - bit; if (n >= left) { result <<= left; result |= (BITMASK[left] & bytes[byte++]); bit = 0; n -= left; } else { result <<= n; result |= ((bytes[byte] & (BITMASK[n] << (8 - n - bit))) >> (8 - n - bit)); bit += n; n = 0; } } return result; } } bzip2.simple = function(srcbuffer, stream) { var bits = bzip2.array(srcbuffer); var size = bzip2.header(bits); var ret = false; var bufsize = 100000 * size; var buf = new Int32Array(bufsize); do { ret = bzip2.decompress(bits, stream, buf, bufsize); } while(!ret); } bzip2.header = function(bits) { this.byteCount = new Int32Array(256); this.symToByte = new Uint8Array(256); this.mtfSymbol = new Int32Array(256); this.selectors = new Uint8Array(0x8000); if (bits(8*3) != 4348520) message.Error("No magic number found"); var i = bits(8) - 48; if (i < 1 || i > 9) message.Error("Not a BZIP archive"); return i; }; //takes a function for reading the block data (starting with 0x314159265359) //a block size (0-9) (optional, defaults to 9) //a length at which to stop decompressing and return the output bzip2.decompress = function(bits, stream, buf, bufsize, streamCRC) { var MAX_HUFCODE_BITS = 20; var MAX_SYMBOLS = 258; var SYMBOL_RUNA = 0; var SYMBOL_RUNB = 1; var GROUP_SIZE = 50; var crc = 0 ^ (-1); for(var h = '', i = 0; i < 6; i++) h += bits(8).toString(16); if (h == "177245385090") { var finalCRC = bits(32)|0; if (finalCRC !== streamCRC) message.Error("Error in bzip2: crc32 do not match"); // align stream to byte bits(null); return null; // reset streamCRC for next call } if (h != "314159265359") message.Error("eek not valid bzip data"); var crcblock = bits(32)|0; // CRC code if (bits(1)) message.Error("unsupported obsolete version"); var origPtr = bits(24); if (origPtr > bufsize) message.Error("Initial position larger than buffer size"); var t = bits(16); var symTotal = 0; for (i = 0; i < 16; i++) { if (t & (1 << (15 - i))) { var k = bits(16); for(j = 0; j < 16; j++) { if (k & (1 << (15 - j))) { this.symToByte[symTotal++] = (16 * i) + j; } } } } var groupCount = bits(3); if (groupCount < 2 || groupCount > 6) message.Error("another error"); var nSelectors = bits(15); if (nSelectors == 0) message.Error("meh"); for(var i = 0; i < groupCount; i++) this.mtfSymbol[i] = i; for(var i = 0; i < nSelectors; i++) { for(var j = 0; bits(1); j++) if (j >= groupCount) message.Error("whoops another error"); var uc = this.mtfSymbol[j]; for(var k = j-1; k>=0; k--) { this.mtfSymbol[k+1] = this.mtfSymbol[k]; } this.mtfSymbol[0] = uc; this.selectors[i] = uc; } var symCount = symTotal + 2; var groups = []; var length = new Uint8Array(MAX_SYMBOLS), temp = new Uint16Array(MAX_HUFCODE_BITS+1); var hufGroup; for(var j = 0; j < groupCount; j++) { t = bits(5); //lengths for(var i = 0; i < symCount; i++) { while(true){ if (t < 1 || t > MAX_HUFCODE_BITS) message.Error("I gave up a while ago on writing error messages"); if (!bits(1)) break; if (!bits(1)) t++; else t--; } length[i] = t; } var minLen, maxLen; minLen = maxLen = length[0]; for(var i = 1; i < symCount; i++) { if (length[i] > maxLen) maxLen = length[i]; else if (length[i] < minLen) minLen = length[i]; } hufGroup = groups[j] = {}; hufGroup.permute = new Int32Array(MAX_SYMBOLS); hufGroup.limit = new Int32Array(MAX_HUFCODE_BITS + 1); hufGroup.base = new Int32Array(MAX_HUFCODE_BITS + 1); hufGroup.minLen = minLen; hufGroup.maxLen = maxLen; var base = hufGroup.base; var limit = hufGroup.limit; var pp = 0; for(var i = minLen; i <= maxLen; i++) for(var t = 0; t < symCount; t++) if (length[t] == i) hufGroup.permute[pp++] = t; for(i = minLen; i <= maxLen; i++) temp[i] = limit[i] = 0; for(i = 0; i < symCount; i++) temp[length[i]]++; pp = t = 0; for(i = minLen; i < maxLen; i++) { pp += temp[i]; limit[i] = pp - 1; pp <<= 1; base[i+1] = pp - (t += temp[i]); } limit[maxLen] = pp + temp[maxLen] - 1; base[minLen] = 0; } for(var i = 0; i < 256; i++) { this.mtfSymbol[i] = i; this.byteCount[i] = 0; } var runPos, count, symCount, selector; runPos = count = symCount = selector = 0; while(true) { if (!(symCount--)) { symCount = GROUP_SIZE - 1; if (selector >= nSelectors) message.Error("meow i'm a kitty, that's an error"); hufGroup = groups[this.selectors[selector++]]; base = hufGroup.base; limit = hufGroup.limit; } i = hufGroup.minLen; j = bits(i); while(true) { if (i > hufGroup.maxLen) message.Error("rawr i'm a dinosaur"); if (j <= limit[i]) break; i++; j = (j << 1) | bits(1); } j -= base[i]; if (j < 0 || j >= MAX_SYMBOLS) message.Error("moo i'm a cow"); var nextSym = hufGroup.permute[j]; if (nextSym == SYMBOL_RUNA || nextSym == SYMBOL_RUNB) { if (!runPos){ runPos = 1; t = 0; } if (nextSym == SYMBOL_RUNA) t += runPos; else t += 2 * runPos; runPos <<= 1; continue; } if (runPos) { runPos = 0; if (count + t > bufsize) message.Error("Boom."); uc = this.symToByte[this.mtfSymbol[0]]; this.byteCount[uc] += t; while(t--) buf[count++] = uc; } if (nextSym > symTotal) break; if (count >= bufsize) message.Error("I can't think of anything. Error"); i = nextSym - 1; uc = this.mtfSymbol[i]; for(var k = i-1; k>=0; k--) { this.mtfSymbol[k+1] = this.mtfSymbol[k]; } this.mtfSymbol[0] = uc uc = this.symToByte[uc]; this.byteCount[uc]++; buf[count++] = uc; } if (origPtr < 0 || origPtr >= count) message.Error("I'm a monkey and I'm throwing something at someone, namely you"); var j = 0; for(var i = 0; i < 256; i++) { k = j + this.byteCount[i]; this.byteCount[i] = j; j = k; } for(var i = 0; i < count; i++) { uc = buf[i] & 0xff; buf[this.byteCount[uc]] |= (i << 8); this.byteCount[uc]++; } var pos = 0, current = 0, run = 0; if (count) { pos = buf[origPtr]; current = (pos & 0xff); pos >>= 8; run = -1; } count = count; var copies, previous, outbyte; while(count) { count--; previous = current; pos = buf[pos]; current = pos & 0xff; pos >>= 8; if (run++ == 3) { copies = current; outbyte = previous; current = -1; } else { copies = 1; outbyte = current; } while(copies--) { crc = ((crc << 8) ^ this.crcTable[((crc>>24) ^ outbyte) & 0xFF])&0xFFFFFFFF; // crc32 stream(outbyte); } if (current != previous) run = 0; } crc = (crc ^ (-1)) >>> 0; if ((crc|0) != (crcblock|0)) message.Error("Error in bzip2: crc32 do not match"); streamCRC = (crc ^ ((streamCRC << 1) | (streamCRC >>> 31))) & 0xFFFFFFFF; return streamCRC; } module.exports = bzip2; /***/ }), /***/ 6752: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const Client = __nccwpck_require__(6197) const Dispatcher = __nccwpck_require__(992) const errors = __nccwpck_require__(8707) const Pool = __nccwpck_require__(5076) const BalancedPool = __nccwpck_require__(1093) const Agent = __nccwpck_require__(9965) const util = __nccwpck_require__(3440) const { InvalidArgumentError } = errors const api = __nccwpck_require__(6615) const buildConnector = __nccwpck_require__(9136) const MockClient = __nccwpck_require__(7365) const MockAgent = __nccwpck_require__(7501) const MockPool = __nccwpck_require__(4004) const mockErrors = __nccwpck_require__(2429) const ProxyAgent = __nccwpck_require__(2720) const RetryHandler = __nccwpck_require__(3573) const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(2581) const DecoratorHandler = __nccwpck_require__(8840) const RedirectHandler = __nccwpck_require__(8299) const createRedirectInterceptor = __nccwpck_require__(4415) let hasCrypto try { __nccwpck_require__(6982) hasCrypto = true } catch { hasCrypto = false } Object.assign(Dispatcher.prototype, api) module.exports.Dispatcher = Dispatcher module.exports.Client = Client module.exports.Pool = Pool module.exports.BalancedPool = BalancedPool module.exports.Agent = Agent module.exports.ProxyAgent = ProxyAgent module.exports.RetryHandler = RetryHandler module.exports.DecoratorHandler = DecoratorHandler module.exports.RedirectHandler = RedirectHandler module.exports.createRedirectInterceptor = createRedirectInterceptor module.exports.buildConnector = buildConnector module.exports.errors = errors function makeDispatcher (fn) { return (url, opts, handler) => { if (typeof opts === 'function') { handler = opts opts = null } if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) { throw new InvalidArgumentError('invalid url') } if (opts != null && typeof opts !== 'object') { throw new InvalidArgumentError('invalid opts') } if (opts && opts.path != null) { if (typeof opts.path !== 'string') { throw new InvalidArgumentError('invalid opts.path') } let path = opts.path if (!opts.path.startsWith('/')) { path = `/${path}` } url = new URL(util.parseOrigin(url).origin + path) } else { if (!opts) { opts = typeof url === 'object' ? url : {} } url = util.parseURL(url) } const { agent, dispatcher = getGlobalDispatcher() } = opts if (agent) { throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?') } return fn.call(dispatcher, { ...opts, origin: url.origin, path: url.search ? `${url.pathname}${url.search}` : url.pathname, method: opts.method || (opts.body ? 'PUT' : 'GET') }, handler) } } module.exports.setGlobalDispatcher = setGlobalDispatcher module.exports.getGlobalDispatcher = getGlobalDispatcher if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) { let fetchImpl = null module.exports.fetch = async function fetch (resource) { if (!fetchImpl) { fetchImpl = (__nccwpck_require__(2315).fetch) } try { return await fetchImpl(...arguments) } catch (err) { if (typeof err === 'object') { Error.captureStackTrace(err, this) } throw err } } module.exports.Headers = __nccwpck_require__(6349).Headers module.exports.Response = __nccwpck_require__(8676).Response module.exports.Request = __nccwpck_require__(5194).Request module.exports.FormData = __nccwpck_require__(3073).FormData module.exports.File = __nccwpck_require__(3041).File module.exports.FileReader = __nccwpck_require__(2160).FileReader const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(5628) module.exports.setGlobalOrigin = setGlobalOrigin module.exports.getGlobalOrigin = getGlobalOrigin const { CacheStorage } = __nccwpck_require__(4738) const { kConstruct } = __nccwpck_require__(296) // Cache & CacheStorage are tightly coupled with fetch. Even if it may run // in an older version of Node, it doesn't have any use without fetch. module.exports.caches = new CacheStorage(kConstruct) } if (util.nodeMajor >= 16) { const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(3168) module.exports.deleteCookie = deleteCookie module.exports.getCookies = getCookies module.exports.getSetCookies = getSetCookies module.exports.setCookie = setCookie const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(4322) module.exports.parseMIMEType = parseMIMEType module.exports.serializeAMimeType = serializeAMimeType } if (util.nodeMajor >= 18 && hasCrypto) { const { WebSocket } = __nccwpck_require__(5171) module.exports.WebSocket = WebSocket } module.exports.request = makeDispatcher(api.request) module.exports.stream = makeDispatcher(api.stream) module.exports.pipeline = makeDispatcher(api.pipeline) module.exports.connect = makeDispatcher(api.connect) module.exports.upgrade = makeDispatcher(api.upgrade) module.exports.MockClient = MockClient module.exports.MockPool = MockPool module.exports.MockAgent = MockAgent module.exports.mockErrors = mockErrors /***/ }), /***/ 9965: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { InvalidArgumentError } = __nccwpck_require__(8707) const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(6443) const DispatcherBase = __nccwpck_require__(1) const Pool = __nccwpck_require__(5076) const Client = __nccwpck_require__(6197) const util = __nccwpck_require__(3440) const createRedirectInterceptor = __nccwpck_require__(4415) const { WeakRef, FinalizationRegistry } = __nccwpck_require__(3194)() const kOnConnect = Symbol('onConnect') const kOnDisconnect = Symbol('onDisconnect') const kOnConnectionError = Symbol('onConnectionError') const kMaxRedirections = Symbol('maxRedirections') const kOnDrain = Symbol('onDrain') const kFactory = Symbol('factory') const kFinalizer = Symbol('finalizer') const kOptions = Symbol('options') function defaultFactory (origin, opts) { return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts) } class Agent extends DispatcherBase { constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { super() if (typeof factory !== 'function') { throw new InvalidArgumentError('factory must be a function.') } if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { throw new InvalidArgumentError('connect must be a function or an object') } if (!Number.isInteger(maxRedirections) || maxRedirections < 0) { throw new InvalidArgumentError('maxRedirections must be a positive number') } if (connect && typeof connect !== 'function') { connect = { ...connect } } this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent) ? options.interceptors.Agent : [createRedirectInterceptor({ maxRedirections })] this[kOptions] = { ...util.deepClone(options), connect } this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : undefined this[kMaxRedirections] = maxRedirections this[kFactory] = factory this[kClients] = new Map() this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => { const ref = this[kClients].get(key) if (ref !== undefined && ref.deref() === undefined) { this[kClients].delete(key) } }) const agent = this this[kOnDrain] = (origin, targets) => { agent.emit('drain', origin, [agent, ...targets]) } this[kOnConnect] = (origin, targets) => { agent.emit('connect', origin, [agent, ...targets]) } this[kOnDisconnect] = (origin, targets, err) => { agent.emit('disconnect', origin, [agent, ...targets], err) } this[kOnConnectionError] = (origin, targets, err) => { agent.emit('connectionError', origin, [agent, ...targets], err) } } get [kRunning] () { let ret = 0 for (const ref of this[kClients].values()) { const client = ref.deref() /* istanbul ignore next: gc is undeterministic */ if (client) { ret += client[kRunning] } } return ret } [kDispatch] (opts, handler) { let key if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) { key = String(opts.origin) } else { throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.') } const ref = this[kClients].get(key) let dispatcher = ref ? ref.deref() : null if (!dispatcher) { dispatcher = this[kFactory](opts.origin, this[kOptions]) .on('drain', this[kOnDrain]) .on('connect', this[kOnConnect]) .on('disconnect', this[kOnDisconnect]) .on('connectionError', this[kOnConnectionError]) this[kClients].set(key, new WeakRef(dispatcher)) this[kFinalizer].register(dispatcher, key) } return dispatcher.dispatch(opts, handler) } async [kClose] () { const closePromises = [] for (const ref of this[kClients].values()) { const client = ref.deref() /* istanbul ignore else: gc is undeterministic */ if (client) { closePromises.push(client.close()) } } await Promise.all(closePromises) } async [kDestroy] (err) { const destroyPromises = [] for (const ref of this[kClients].values()) { const client = ref.deref() /* istanbul ignore else: gc is undeterministic */ if (client) { destroyPromises.push(client.destroy(err)) } } await Promise.all(destroyPromises) } } module.exports = Agent /***/ }), /***/ 158: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { addAbortListener } = __nccwpck_require__(3440) const { RequestAbortedError } = __nccwpck_require__(8707) const kListener = Symbol('kListener') const kSignal = Symbol('kSignal') function abort (self) { if (self.abort) { self.abort() } else { self.onError(new RequestAbortedError()) } } function addSignal (self, signal) { self[kSignal] = null self[kListener] = null if (!signal) { return } if (signal.aborted) { abort(self) return } self[kSignal] = signal self[kListener] = () => { abort(self) } addAbortListener(self[kSignal], self[kListener]) } function removeSignal (self) { if (!self[kSignal]) { return } if ('removeEventListener' in self[kSignal]) { self[kSignal].removeEventListener('abort', self[kListener]) } else { self[kSignal].removeListener('abort', self[kListener]) } self[kSignal] = null self[kListener] = null } module.exports = { addSignal, removeSignal } /***/ }), /***/ 4660: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { AsyncResource } = __nccwpck_require__(290) const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8707) const util = __nccwpck_require__(3440) const { addSignal, removeSignal } = __nccwpck_require__(158) class ConnectHandler extends AsyncResource { constructor (opts, callback) { if (!opts || typeof opts !== 'object') { throw new InvalidArgumentError('invalid opts') } if (typeof callback !== 'function') { throw new InvalidArgumentError('invalid callback') } const { signal, opaque, responseHeaders } = opts if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') } super('UNDICI_CONNECT') this.opaque = opaque || null this.responseHeaders = responseHeaders || null this.callback = callback this.abort = null addSignal(this, signal) } onConnect (abort, context) { if (!this.callback) { throw new RequestAbortedError() } this.abort = abort this.context = context } onHeaders () { throw new SocketError('bad connect', null) } onUpgrade (statusCode, rawHeaders, socket) { const { callback, opaque, context } = this removeSignal(this) this.callback = null let headers = rawHeaders // Indicates is an HTTP2Session if (headers != null) { headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) } this.runInAsyncScope(callback, null, null, { statusCode, headers, socket, opaque, context }) } onError (err) { const { callback, opaque } = this removeSignal(this) if (callback) { this.callback = null queueMicrotask(() => { this.runInAsyncScope(callback, null, err, { opaque }) }) } } } function connect (opts, callback) { if (callback === undefined) { return new Promise((resolve, reject) => { connect.call(this, opts, (err, data) => { return err ? reject(err) : resolve(data) }) }) } try { const connectHandler = new ConnectHandler(opts, callback) this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler) } catch (err) { if (typeof callback !== 'function') { throw err } const opaque = opts && opts.opaque queueMicrotask(() => callback(err, { opaque })) } } module.exports = connect /***/ }), /***/ 6862: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { Readable, Duplex, PassThrough } = __nccwpck_require__(2203) const { InvalidArgumentError, InvalidReturnValueError, RequestAbortedError } = __nccwpck_require__(8707) const util = __nccwpck_require__(3440) const { AsyncResource } = __nccwpck_require__(290) const { addSignal, removeSignal } = __nccwpck_require__(158) const assert = __nccwpck_require__(2613) const kResume = Symbol('resume') class PipelineRequest extends Readable { constructor () { super({ autoDestroy: true }) this[kResume] = null } _read () { const { [kResume]: resume } = this if (resume) { this[kResume] = null resume() } } _destroy (err, callback) { this._read() callback(err) } } class PipelineResponse extends Readable { constructor (resume) { super({ autoDestroy: true }) this[kResume] = resume } _read () { this[kResume]() } _destroy (err, callback) { if (!err && !this._readableState.endEmitted) { err = new RequestAbortedError() } callback(err) } } class PipelineHandler extends AsyncResource { constructor (opts, handler) { if (!opts || typeof opts !== 'object') { throw new InvalidArgumentError('invalid opts') } if (typeof handler !== 'function') { throw new InvalidArgumentError('invalid handler') } const { signal, method, opaque, onInfo, responseHeaders } = opts if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') } if (method === 'CONNECT') { throw new InvalidArgumentError('invalid method') } if (onInfo && typeof onInfo !== 'function') { throw new InvalidArgumentError('invalid onInfo callback') } super('UNDICI_PIPELINE') this.opaque = opaque || null this.responseHeaders = responseHeaders || null this.handler = handler this.abort = null this.context = null this.onInfo = onInfo || null this.req = new PipelineRequest().on('error', util.nop) this.ret = new Duplex({ readableObjectMode: opts.objectMode, autoDestroy: true, read: () => { const { body } = this if (body && body.resume) { body.resume() } }, write: (chunk, encoding, callback) => { const { req } = this if (req.push(chunk, encoding) || req._readableState.destroyed) { callback() } else { req[kResume] = callback } }, destroy: (err, callback) => { const { body, req, res, ret, abort } = this if (!err && !ret._readableState.endEmitted) { err = new RequestAbortedError() } if (abort && err) { abort() } util.destroy(body, err) util.destroy(req, err) util.destroy(res, err) removeSignal(this) callback(err) } }).on('prefinish', () => { const { req } = this // Node < 15 does not call _final in same tick. req.push(null) }) this.res = null addSignal(this, signal) } onConnect (abort, context) { const { ret, res } = this assert(!res, 'pipeline cannot be retried') if (ret.destroyed) { throw new RequestAbortedError() } this.abort = abort this.context = context } onHeaders (statusCode, rawHeaders, resume) { const { opaque, handler, context } = this if (statusCode < 200) { if (this.onInfo) { const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) this.onInfo({ statusCode, headers }) } return } this.res = new PipelineResponse(resume) let body try { this.handler = null const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) body = this.runInAsyncScope(handler, null, { statusCode, headers, opaque, body: this.res, context }) } catch (err) { this.res.on('error', util.nop) throw err } if (!body || typeof body.on !== 'function') { throw new InvalidReturnValueError('expected Readable') } body .on('data', (chunk) => { const { ret, body } = this if (!ret.push(chunk) && body.pause) { body.pause() } }) .on('error', (err) => { const { ret } = this util.destroy(ret, err) }) .on('end', () => { const { ret } = this ret.push(null) }) .on('close', () => { const { ret } = this if (!ret._readableState.ended) { util.destroy(ret, new RequestAbortedError()) } }) this.body = body } onData (chunk) { const { res } = this return res.push(chunk) } onComplete (trailers) { const { res } = this res.push(null) } onError (err) { const { ret } = this this.handler = null util.destroy(ret, err) } } function pipeline (opts, handler) { try { const pipelineHandler = new PipelineHandler(opts, handler) this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler) return pipelineHandler.ret } catch (err) { return new PassThrough().destroy(err) } } module.exports = pipeline /***/ }), /***/ 4043: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const Readable = __nccwpck_require__(9927) const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8707) const util = __nccwpck_require__(3440) const { getResolveErrorBodyCallback } = __nccwpck_require__(7655) const { AsyncResource } = __nccwpck_require__(290) const { addSignal, removeSignal } = __nccwpck_require__(158) class RequestHandler extends AsyncResource { constructor (opts, callback) { if (!opts || typeof opts !== 'object') { throw new InvalidArgumentError('invalid opts') } const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts try { if (typeof callback !== 'function') { throw new InvalidArgumentError('invalid callback') } if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) { throw new InvalidArgumentError('invalid highWaterMark') } if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') } if (method === 'CONNECT') { throw new InvalidArgumentError('invalid method') } if (onInfo && typeof onInfo !== 'function') { throw new InvalidArgumentError('invalid onInfo callback') } super('UNDICI_REQUEST') } catch (err) { if (util.isStream(body)) { util.destroy(body.on('error', util.nop), err) } throw err } this.responseHeaders = responseHeaders || null this.opaque = opaque || null this.callback = callback this.res = null this.abort = null this.body = body this.trailers = {} this.context = null this.onInfo = onInfo || null this.throwOnError = throwOnError this.highWaterMark = highWaterMark if (util.isStream(body)) { body.on('error', (err) => { this.onError(err) }) } addSignal(this, signal) } onConnect (abort, context) { if (!this.callback) { throw new RequestAbortedError() } this.abort = abort this.context = context } onHeaders (statusCode, rawHeaders, resume, statusMessage) { const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) if (statusCode < 200) { if (this.onInfo) { this.onInfo({ statusCode, headers }) } return } const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers const contentType = parsedHeaders['content-type'] const body = new Readable({ resume, abort, contentType, highWaterMark }) this.callback = null this.res = body if (callback !== null) { if (this.throwOnError && statusCode >= 400) { this.runInAsyncScope(getResolveErrorBodyCallback, null, { callback, body, contentType, statusCode, statusMessage, headers } ) } else { this.runInAsyncScope(callback, null, null, { statusCode, headers, trailers: this.trailers, opaque, body, context }) } } } onData (chunk) { const { res } = this return res.push(chunk) } onComplete (trailers) { const { res } = this removeSignal(this) util.parseHeaders(trailers, this.trailers) res.push(null) } onError (err) { const { res, callback, body, opaque } = this removeSignal(this) if (callback) { // TODO: Does this need queueMicrotask? this.callback = null queueMicrotask(() => { this.runInAsyncScope(callback, null, err, { opaque }) }) } if (res) { this.res = null // Ensure all queued handlers are invoked before destroying res. queueMicrotask(() => { util.destroy(res, err) }) } if (body) { this.body = null util.destroy(body, err) } } } function request (opts, callback) { if (callback === undefined) { return new Promise((resolve, reject) => { request.call(this, opts, (err, data) => { return err ? reject(err) : resolve(data) }) }) } try { this.dispatch(opts, new RequestHandler(opts, callback)) } catch (err) { if (typeof callback !== 'function') { throw err } const opaque = opts && opts.opaque queueMicrotask(() => callback(err, { opaque })) } } module.exports = request module.exports.RequestHandler = RequestHandler /***/ }), /***/ 3560: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { finished, PassThrough } = __nccwpck_require__(2203) const { InvalidArgumentError, InvalidReturnValueError, RequestAbortedError } = __nccwpck_require__(8707) const util = __nccwpck_require__(3440) const { getResolveErrorBodyCallback } = __nccwpck_require__(7655) const { AsyncResource } = __nccwpck_require__(290) const { addSignal, removeSignal } = __nccwpck_require__(158) class StreamHandler extends AsyncResource { constructor (opts, factory, callback) { if (!opts || typeof opts !== 'object') { throw new InvalidArgumentError('invalid opts') } const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts try { if (typeof callback !== 'function') { throw new InvalidArgumentError('invalid callback') } if (typeof factory !== 'function') { throw new InvalidArgumentError('invalid factory') } if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') } if (method === 'CONNECT') { throw new InvalidArgumentError('invalid method') } if (onInfo && typeof onInfo !== 'function') { throw new InvalidArgumentError('invalid onInfo callback') } super('UNDICI_STREAM') } catch (err) { if (util.isStream(body)) { util.destroy(body.on('error', util.nop), err) } throw err } this.responseHeaders = responseHeaders || null this.opaque = opaque || null this.factory = factory this.callback = callback this.res = null this.abort = null this.context = null this.trailers = null this.body = body this.onInfo = onInfo || null this.throwOnError = throwOnError || false if (util.isStream(body)) { body.on('error', (err) => { this.onError(err) }) } addSignal(this, signal) } onConnect (abort, context) { if (!this.callback) { throw new RequestAbortedError() } this.abort = abort this.context = context } onHeaders (statusCode, rawHeaders, resume, statusMessage) { const { factory, opaque, context, callback, responseHeaders } = this const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) if (statusCode < 200) { if (this.onInfo) { this.onInfo({ statusCode, headers }) } return } this.factory = null let res if (this.throwOnError && statusCode >= 400) { const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers const contentType = parsedHeaders['content-type'] res = new PassThrough() this.callback = null this.runInAsyncScope(getResolveErrorBodyCallback, null, { callback, body: res, contentType, statusCode, statusMessage, headers } ) } else { if (factory === null) { return } res = this.runInAsyncScope(factory, null, { statusCode, headers, opaque, context }) if ( !res || typeof res.write !== 'function' || typeof res.end !== 'function' || typeof res.on !== 'function' ) { throw new InvalidReturnValueError('expected Writable') } // TODO: Avoid finished. It registers an unnecessary amount of listeners. finished(res, { readable: false }, (err) => { const { callback, res, opaque, trailers, abort } = this this.res = null if (err || !res.readable) { util.destroy(res, err) } this.callback = null this.runInAsyncScope(callback, null, err || null, { opaque, trailers }) if (err) { abort() } }) } res.on('drain', resume) this.res = res const needDrain = res.writableNeedDrain !== undefined ? res.writableNeedDrain : res._writableState && res._writableState.needDrain return needDrain !== true } onData (chunk) { const { res } = this return res ? res.write(chunk) : true } onComplete (trailers) { const { res } = this removeSignal(this) if (!res) { return } this.trailers = util.parseHeaders(trailers) res.end() } onError (err) { const { res, callback, opaque, body } = this removeSignal(this) this.factory = null if (res) { this.res = null util.destroy(res, err) } else if (callback) { this.callback = null queueMicrotask(() => { this.runInAsyncScope(callback, null, err, { opaque }) }) } if (body) { this.body = null util.destroy(body, err) } } } function stream (opts, factory, callback) { if (callback === undefined) { return new Promise((resolve, reject) => { stream.call(this, opts, factory, (err, data) => { return err ? reject(err) : resolve(data) }) }) } try { this.dispatch(opts, new StreamHandler(opts, factory, callback)) } catch (err) { if (typeof callback !== 'function') { throw err } const opaque = opts && opts.opaque queueMicrotask(() => callback(err, { opaque })) } } module.exports = stream /***/ }), /***/ 1882: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8707) const { AsyncResource } = __nccwpck_require__(290) const util = __nccwpck_require__(3440) const { addSignal, removeSignal } = __nccwpck_require__(158) const assert = __nccwpck_require__(2613) class UpgradeHandler extends AsyncResource { constructor (opts, callback) { if (!opts || typeof opts !== 'object') { throw new InvalidArgumentError('invalid opts') } if (typeof callback !== 'function') { throw new InvalidArgumentError('invalid callback') } const { signal, opaque, responseHeaders } = opts if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') } super('UNDICI_UPGRADE') this.responseHeaders = responseHeaders || null this.opaque = opaque || null this.callback = callback this.abort = null this.context = null addSignal(this, signal) } onConnect (abort, context) { if (!this.callback) { throw new RequestAbortedError() } this.abort = abort this.context = null } onHeaders () { throw new SocketError('bad upgrade', null) } onUpgrade (statusCode, rawHeaders, socket) { const { callback, opaque, context } = this assert.strictEqual(statusCode, 101) removeSignal(this) this.callback = null const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) this.runInAsyncScope(callback, null, null, { headers, socket, opaque, context }) } onError (err) { const { callback, opaque } = this removeSignal(this) if (callback) { this.callback = null queueMicrotask(() => { this.runInAsyncScope(callback, null, err, { opaque }) }) } } } function upgrade (opts, callback) { if (callback === undefined) { return new Promise((resolve, reject) => { upgrade.call(this, opts, (err, data) => { return err ? reject(err) : resolve(data) }) }) } try { const upgradeHandler = new UpgradeHandler(opts, callback) this.dispatch({ ...opts, method: opts.method || 'GET', upgrade: opts.protocol || 'Websocket' }, upgradeHandler) } catch (err) { if (typeof callback !== 'function') { throw err } const opaque = opts && opts.opaque queueMicrotask(() => callback(err, { opaque })) } } module.exports = upgrade /***/ }), /***/ 6615: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports.request = __nccwpck_require__(4043) module.exports.stream = __nccwpck_require__(3560) module.exports.pipeline = __nccwpck_require__(6862) module.exports.upgrade = __nccwpck_require__(1882) module.exports.connect = __nccwpck_require__(4660) /***/ }), /***/ 9927: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // Ported from https://github.com/nodejs/undici/pull/907 const assert = __nccwpck_require__(2613) const { Readable } = __nccwpck_require__(2203) const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = __nccwpck_require__(8707) const util = __nccwpck_require__(3440) const { ReadableStreamFrom, toUSVString } = __nccwpck_require__(3440) let Blob const kConsume = Symbol('kConsume') const kReading = Symbol('kReading') const kBody = Symbol('kBody') const kAbort = Symbol('abort') const kContentType = Symbol('kContentType') const noop = () => {} module.exports = class BodyReadable extends Readable { constructor ({ resume, abort, contentType = '', highWaterMark = 64 * 1024 // Same as nodejs fs streams. }) { super({ autoDestroy: true, read: resume, highWaterMark }) this._readableState.dataEmitted = false this[kAbort] = abort this[kConsume] = null this[kBody] = null this[kContentType] = contentType // Is stream being consumed through Readable API? // This is an optimization so that we avoid checking // for 'data' and 'readable' listeners in the hot path // inside push(). this[kReading] = false } destroy (err) { if (this.destroyed) { // Node < 16 return this } if (!err && !this._readableState.endEmitted) { err = new RequestAbortedError() } if (err) { this[kAbort]() } return super.destroy(err) } emit (ev, ...args) { if (ev === 'data') { // Node < 16.7 this._readableState.dataEmitted = true } else if (ev === 'error') { // Node < 16 this._readableState.errorEmitted = true } return super.emit(ev, ...args) } on (ev, ...args) { if (ev === 'data' || ev === 'readable') { this[kReading] = true } return super.on(ev, ...args) } addListener (ev, ...args) { return this.on(ev, ...args) } off (ev, ...args) { const ret = super.off(ev, ...args) if (ev === 'data' || ev === 'readable') { this[kReading] = ( this.listenerCount('data') > 0 || this.listenerCount('readable') > 0 ) } return ret } removeListener (ev, ...args) { return this.off(ev, ...args) } push (chunk) { if (this[kConsume] && chunk !== null && this.readableLength === 0) { consumePush(this[kConsume], chunk) return this[kReading] ? super.push(chunk) : true } return super.push(chunk) } // https://fetch.spec.whatwg.org/#dom-body-text async text () { return consume(this, 'text') } // https://fetch.spec.whatwg.org/#dom-body-json async json () { return consume(this, 'json') } // https://fetch.spec.whatwg.org/#dom-body-blob async blob () { return consume(this, 'blob') } // https://fetch.spec.whatwg.org/#dom-body-arraybuffer async arrayBuffer () { return consume(this, 'arrayBuffer') } // https://fetch.spec.whatwg.org/#dom-body-formdata async formData () { // TODO: Implement. throw new NotSupportedError() } // https://fetch.spec.whatwg.org/#dom-body-bodyused get bodyUsed () { return util.isDisturbed(this) } // https://fetch.spec.whatwg.org/#dom-body-body get body () { if (!this[kBody]) { this[kBody] = ReadableStreamFrom(this) if (this[kConsume]) { // TODO: Is this the best way to force a lock? this[kBody].getReader() // Ensure stream is locked. assert(this[kBody].locked) } } return this[kBody] } dump (opts) { let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144 const signal = opts && opts.signal if (signal) { try { if (typeof signal !== 'object' || !('aborted' in signal)) { throw new InvalidArgumentError('signal must be an AbortSignal') } util.throwIfAborted(signal) } catch (err) { return Promise.reject(err) } } if (this.closed) { return Promise.resolve(null) } return new Promise((resolve, reject) => { const signalListenerCleanup = signal ? util.addAbortListener(signal, () => { this.destroy() }) : noop this .on('close', function () { signalListenerCleanup() if (signal && signal.aborted) { reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' })) } else { resolve(null) } }) .on('error', noop) .on('data', function (chunk) { limit -= chunk.length if (limit <= 0) { this.destroy() } }) .resume() }) } } // https://streams.spec.whatwg.org/#readablestream-locked function isLocked (self) { // Consume is an implicit lock. return (self[kBody] && self[kBody].locked === true) || self[kConsume] } // https://fetch.spec.whatwg.org/#body-unusable function isUnusable (self) { return util.isDisturbed(self) || isLocked(self) } async function consume (stream, type) { if (isUnusable(stream)) { throw new TypeError('unusable') } assert(!stream[kConsume]) return new Promise((resolve, reject) => { stream[kConsume] = { type, stream, resolve, reject, length: 0, body: [] } stream .on('error', function (err) { consumeFinish(this[kConsume], err) }) .on('close', function () { if (this[kConsume].body !== null) { consumeFinish(this[kConsume], new RequestAbortedError()) } }) process.nextTick(consumeStart, stream[kConsume]) }) } function consumeStart (consume) { if (consume.body === null) { return } const { _readableState: state } = consume.stream for (const chunk of state.buffer) { consumePush(consume, chunk) } if (state.endEmitted) { consumeEnd(this[kConsume]) } else { consume.stream.on('end', function () { consumeEnd(this[kConsume]) }) } consume.stream.resume() while (consume.stream.read() != null) { // Loop } } function consumeEnd (consume) { const { type, body, resolve, stream, length } = consume try { if (type === 'text') { resolve(toUSVString(Buffer.concat(body))) } else if (type === 'json') { resolve(JSON.parse(Buffer.concat(body))) } else if (type === 'arrayBuffer') { const dst = new Uint8Array(length) let pos = 0 for (const buf of body) { dst.set(buf, pos) pos += buf.byteLength } resolve(dst.buffer) } else if (type === 'blob') { if (!Blob) { Blob = (__nccwpck_require__(181).Blob) } resolve(new Blob(body, { type: stream[kContentType] })) } consumeFinish(consume) } catch (err) { stream.destroy(err) } } function consumePush (consume, chunk) { consume.length += chunk.length consume.body.push(chunk) } function consumeFinish (consume, err) { if (consume.body === null) { return } if (err) { consume.reject(err) } else { consume.resolve() } consume.type = null consume.stream = null consume.resolve = null consume.reject = null consume.length = 0 consume.body = null } /***/ }), /***/ 7655: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const assert = __nccwpck_require__(2613) const { ResponseStatusCodeError } = __nccwpck_require__(8707) const { toUSVString } = __nccwpck_require__(3440) async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) { assert(body) let chunks = [] let limit = 0 for await (const chunk of body) { chunks.push(chunk) limit += chunk.length if (limit > 128 * 1024) { chunks = null break } } if (statusCode === 204 || !contentType || !chunks) { process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers)) return } try { if (contentType.startsWith('application/json')) { const payload = JSON.parse(toUSVString(Buffer.concat(chunks))) process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload)) return } if (contentType.startsWith('text/')) { const payload = toUSVString(Buffer.concat(chunks)) process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload)) return } } catch (err) { // Process in a fallback if error } process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers)) } module.exports = { getResolveErrorBodyCallback } /***/ }), /***/ 1093: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { BalancedPoolMissingUpstreamError, InvalidArgumentError } = __nccwpck_require__(8707) const { PoolBase, kClients, kNeedDrain, kAddClient, kRemoveClient, kGetDispatcher } = __nccwpck_require__(8640) const Pool = __nccwpck_require__(5076) const { kUrl, kInterceptors } = __nccwpck_require__(6443) const { parseOrigin } = __nccwpck_require__(3440) const kFactory = Symbol('factory') const kOptions = Symbol('options') const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor') const kCurrentWeight = Symbol('kCurrentWeight') const kIndex = Symbol('kIndex') const kWeight = Symbol('kWeight') const kMaxWeightPerServer = Symbol('kMaxWeightPerServer') const kErrorPenalty = Symbol('kErrorPenalty') function getGreatestCommonDivisor (a, b) { if (b === 0) return a return getGreatestCommonDivisor(b, a % b) } function defaultFactory (origin, opts) { return new Pool(origin, opts) } class BalancedPool extends PoolBase { constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) { super() this[kOptions] = opts this[kIndex] = -1 this[kCurrentWeight] = 0 this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100 this[kErrorPenalty] = this[kOptions].errorPenalty || 15 if (!Array.isArray(upstreams)) { upstreams = [upstreams] } if (typeof factory !== 'function') { throw new InvalidArgumentError('factory must be a function.') } this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool) ? opts.interceptors.BalancedPool : [] this[kFactory] = factory for (const upstream of upstreams) { this.addUpstream(upstream) } this._updateBalancedPoolStats() } addUpstream (upstream) { const upstreamOrigin = parseOrigin(upstream).origin if (this[kClients].find((pool) => ( pool[kUrl].origin === upstreamOrigin && pool.closed !== true && pool.destroyed !== true ))) { return this } const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions])) this[kAddClient](pool) pool.on('connect', () => { pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty]) }) pool.on('connectionError', () => { pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]) this._updateBalancedPoolStats() }) pool.on('disconnect', (...args) => { const err = args[2] if (err && err.code === 'UND_ERR_SOCKET') { // decrease the weight of the pool. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]) this._updateBalancedPoolStats() } }) for (const client of this[kClients]) { client[kWeight] = this[kMaxWeightPerServer] } this._updateBalancedPoolStats() return this } _updateBalancedPoolStats () { this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0) } removeUpstream (upstream) { const upstreamOrigin = parseOrigin(upstream).origin const pool = this[kClients].find((pool) => ( pool[kUrl].origin === upstreamOrigin && pool.closed !== true && pool.destroyed !== true )) if (pool) { this[kRemoveClient](pool) } return this } get upstreams () { return this[kClients] .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true) .map((p) => p[kUrl].origin) } [kGetDispatcher] () { // We validate that pools is greater than 0, // otherwise we would have to wait until an upstream // is added, which might never happen. if (this[kClients].length === 0) { throw new BalancedPoolMissingUpstreamError() } const dispatcher = this[kClients].find(dispatcher => ( !dispatcher[kNeedDrain] && dispatcher.closed !== true && dispatcher.destroyed !== true )) if (!dispatcher) { return } const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true) if (allClientsBusy) { return } let counter = 0 let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain]) while (counter++ < this[kClients].length) { this[kIndex] = (this[kIndex] + 1) % this[kClients].length const pool = this[kClients][this[kIndex]] // find pool index with the largest weight if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) { maxWeightIndex = this[kIndex] } // decrease the current weight every `this[kClients].length`. if (this[kIndex] === 0) { // Set the current weight to the next lower weight. this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor] if (this[kCurrentWeight] <= 0) { this[kCurrentWeight] = this[kMaxWeightPerServer] } } if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) { return pool } } this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight] this[kIndex] = maxWeightIndex return this[kClients][maxWeightIndex] } } module.exports = BalancedPool /***/ }), /***/ 479: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { kConstruct } = __nccwpck_require__(296) const { urlEquals, fieldValues: getFieldValues } = __nccwpck_require__(3993) const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3440) const { kHeadersList } = __nccwpck_require__(6443) const { webidl } = __nccwpck_require__(4222) const { Response, cloneResponse } = __nccwpck_require__(8676) const { Request } = __nccwpck_require__(5194) const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(9710) const { fetching } = __nccwpck_require__(2315) const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(5523) const assert = __nccwpck_require__(2613) const { getGlobalDispatcher } = __nccwpck_require__(2581) /** * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation * @typedef {Object} CacheBatchOperation * @property {'delete' | 'put'} type * @property {any} request * @property {any} response * @property {import('../../types/cache').CacheQueryOptions} options */ /** * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list * @typedef {[any, any][]} requestResponseList */ class Cache { /** * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list * @type {requestResponseList} */ #relevantRequestResponseList constructor () { if (arguments[0] !== kConstruct) { webidl.illegalConstructor() } this.#relevantRequestResponseList = arguments[1] } async match (request, options = {}) { webidl.brandCheck(this, Cache) webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' }) request = webidl.converters.RequestInfo(request) options = webidl.converters.CacheQueryOptions(options) const p = await this.matchAll(request, options) if (p.length === 0) { return } return p[0] } async matchAll (request = undefined, options = {}) { webidl.brandCheck(this, Cache) if (request !== undefined) request = webidl.converters.RequestInfo(request) options = webidl.converters.CacheQueryOptions(options) // 1. let r = null // 2. if (request !== undefined) { if (request instanceof Request) { // 2.1.1 r = request[kState] // 2.1.2 if (r.method !== 'GET' && !options.ignoreMethod) { return [] } } else if (typeof request === 'string') { // 2.2.1 r = new Request(request)[kState] } } // 5. // 5.1 const responses = [] // 5.2 if (request === undefined) { // 5.2.1 for (const requestResponse of this.#relevantRequestResponseList) { responses.push(requestResponse[1]) } } else { // 5.3 // 5.3.1 const requestResponses = this.#queryCache(r, options) // 5.3.2 for (const requestResponse of requestResponses) { responses.push(requestResponse[1]) } } // 5.4 // We don't implement CORs so we don't need to loop over the responses, yay! // 5.5.1 const responseList = [] // 5.5.2 for (const response of responses) { // 5.5.2.1 const responseObject = new Response(response.body?.source ?? null) const body = responseObject[kState].body responseObject[kState] = response responseObject[kState].body = body responseObject[kHeaders][kHeadersList] = response.headersList responseObject[kHeaders][kGuard] = 'immutable' responseList.push(responseObject) } // 6. return Object.freeze(responseList) } async add (request) { webidl.brandCheck(this, Cache) webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' }) request = webidl.converters.RequestInfo(request) // 1. const requests = [request] // 2. const responseArrayPromise = this.addAll(requests) // 3. return await responseArrayPromise } async addAll (requests) { webidl.brandCheck(this, Cache) webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' }) requests = webidl.converters['sequence'](requests) // 1. const responsePromises = [] // 2. const requestList = [] // 3. for (const request of requests) { if (typeof request === 'string') { continue } // 3.1 const r = request[kState] // 3.2 if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') { throw webidl.errors.exception({ header: 'Cache.addAll', message: 'Expected http/s scheme when method is not GET.' }) } } // 4. /** @type {ReturnType[]} */ const fetchControllers = [] // 5. for (const request of requests) { // 5.1 const r = new Request(request)[kState] // 5.2 if (!urlIsHttpHttpsScheme(r.url)) { throw webidl.errors.exception({ header: 'Cache.addAll', message: 'Expected http/s scheme.' }) } // 5.4 r.initiator = 'fetch' r.destination = 'subresource' // 5.5 requestList.push(r) // 5.6 const responsePromise = createDeferredPromise() // 5.7 fetchControllers.push(fetching({ request: r, dispatcher: getGlobalDispatcher(), processResponse (response) { // 1. if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) { responsePromise.reject(webidl.errors.exception({ header: 'Cache.addAll', message: 'Received an invalid status code or the request failed.' })) } else if (response.headersList.contains('vary')) { // 2. // 2.1 const fieldValues = getFieldValues(response.headersList.get('vary')) // 2.2 for (const fieldValue of fieldValues) { // 2.2.1 if (fieldValue === '*') { responsePromise.reject(webidl.errors.exception({ header: 'Cache.addAll', message: 'invalid vary field value' })) for (const controller of fetchControllers) { controller.abort() } return } } } }, processResponseEndOfBody (response) { // 1. if (response.aborted) { responsePromise.reject(new DOMException('aborted', 'AbortError')) return } // 2. responsePromise.resolve(response) } })) // 5.8 responsePromises.push(responsePromise.promise) } // 6. const p = Promise.all(responsePromises) // 7. const responses = await p // 7.1 const operations = [] // 7.2 let index = 0 // 7.3 for (const response of responses) { // 7.3.1 /** @type {CacheBatchOperation} */ const operation = { type: 'put', // 7.3.2 request: requestList[index], // 7.3.3 response // 7.3.4 } operations.push(operation) // 7.3.5 index++ // 7.3.6 } // 7.5 const cacheJobPromise = createDeferredPromise() // 7.6.1 let errorData = null // 7.6.2 try { this.#batchCacheOperations(operations) } catch (e) { errorData = e } // 7.6.3 queueMicrotask(() => { // 7.6.3.1 if (errorData === null) { cacheJobPromise.resolve(undefined) } else { // 7.6.3.2 cacheJobPromise.reject(errorData) } }) // 7.7 return cacheJobPromise.promise } async put (request, response) { webidl.brandCheck(this, Cache) webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' }) request = webidl.converters.RequestInfo(request) response = webidl.converters.Response(response) // 1. let innerRequest = null // 2. if (request instanceof Request) { innerRequest = request[kState] } else { // 3. innerRequest = new Request(request)[kState] } // 4. if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') { throw webidl.errors.exception({ header: 'Cache.put', message: 'Expected an http/s scheme when method is not GET' }) } // 5. const innerResponse = response[kState] // 6. if (innerResponse.status === 206) { throw webidl.errors.exception({ header: 'Cache.put', message: 'Got 206 status' }) } // 7. if (innerResponse.headersList.contains('vary')) { // 7.1. const fieldValues = getFieldValues(innerResponse.headersList.get('vary')) // 7.2. for (const fieldValue of fieldValues) { // 7.2.1 if (fieldValue === '*') { throw webidl.errors.exception({ header: 'Cache.put', message: 'Got * vary field value' }) } } } // 8. if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) { throw webidl.errors.exception({ header: 'Cache.put', message: 'Response body is locked or disturbed' }) } // 9. const clonedResponse = cloneResponse(innerResponse) // 10. const bodyReadPromise = createDeferredPromise() // 11. if (innerResponse.body != null) { // 11.1 const stream = innerResponse.body.stream // 11.2 const reader = stream.getReader() // 11.3 readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject) } else { bodyReadPromise.resolve(undefined) } // 12. /** @type {CacheBatchOperation[]} */ const operations = [] // 13. /** @type {CacheBatchOperation} */ const operation = { type: 'put', // 14. request: innerRequest, // 15. response: clonedResponse // 16. } // 17. operations.push(operation) // 19. const bytes = await bodyReadPromise.promise if (clonedResponse.body != null) { clonedResponse.body.source = bytes } // 19.1 const cacheJobPromise = createDeferredPromise() // 19.2.1 let errorData = null // 19.2.2 try { this.#batchCacheOperations(operations) } catch (e) { errorData = e } // 19.2.3 queueMicrotask(() => { // 19.2.3.1 if (errorData === null) { cacheJobPromise.resolve() } else { // 19.2.3.2 cacheJobPromise.reject(errorData) } }) return cacheJobPromise.promise } async delete (request, options = {}) { webidl.brandCheck(this, Cache) webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' }) request = webidl.converters.RequestInfo(request) options = webidl.converters.CacheQueryOptions(options) /** * @type {Request} */ let r = null if (request instanceof Request) { r = request[kState] if (r.method !== 'GET' && !options.ignoreMethod) { return false } } else { assert(typeof request === 'string') r = new Request(request)[kState] } /** @type {CacheBatchOperation[]} */ const operations = [] /** @type {CacheBatchOperation} */ const operation = { type: 'delete', request: r, options } operations.push(operation) const cacheJobPromise = createDeferredPromise() let errorData = null let requestResponses try { requestResponses = this.#batchCacheOperations(operations) } catch (e) { errorData = e } queueMicrotask(() => { if (errorData === null) { cacheJobPromise.resolve(!!requestResponses?.length) } else { cacheJobPromise.reject(errorData) } }) return cacheJobPromise.promise } /** * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys * @param {any} request * @param {import('../../types/cache').CacheQueryOptions} options * @returns {readonly Request[]} */ async keys (request = undefined, options = {}) { webidl.brandCheck(this, Cache) if (request !== undefined) request = webidl.converters.RequestInfo(request) options = webidl.converters.CacheQueryOptions(options) // 1. let r = null // 2. if (request !== undefined) { // 2.1 if (request instanceof Request) { // 2.1.1 r = request[kState] // 2.1.2 if (r.method !== 'GET' && !options.ignoreMethod) { return [] } } else if (typeof request === 'string') { // 2.2 r = new Request(request)[kState] } } // 4. const promise = createDeferredPromise() // 5. // 5.1 const requests = [] // 5.2 if (request === undefined) { // 5.2.1 for (const requestResponse of this.#relevantRequestResponseList) { // 5.2.1.1 requests.push(requestResponse[0]) } } else { // 5.3 // 5.3.1 const requestResponses = this.#queryCache(r, options) // 5.3.2 for (const requestResponse of requestResponses) { // 5.3.2.1 requests.push(requestResponse[0]) } } // 5.4 queueMicrotask(() => { // 5.4.1 const requestList = [] // 5.4.2 for (const request of requests) { const requestObject = new Request('https://a') requestObject[kState] = request requestObject[kHeaders][kHeadersList] = request.headersList requestObject[kHeaders][kGuard] = 'immutable' requestObject[kRealm] = request.client // 5.4.2.1 requestList.push(requestObject) } // 5.4.3 promise.resolve(Object.freeze(requestList)) }) return promise.promise } /** * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm * @param {CacheBatchOperation[]} operations * @returns {requestResponseList} */ #batchCacheOperations (operations) { // 1. const cache = this.#relevantRequestResponseList // 2. const backupCache = [...cache] // 3. const addedItems = [] // 4.1 const resultList = [] try { // 4.2 for (const operation of operations) { // 4.2.1 if (operation.type !== 'delete' && operation.type !== 'put') { throw webidl.errors.exception({ header: 'Cache.#batchCacheOperations', message: 'operation type does not match "delete" or "put"' }) } // 4.2.2 if (operation.type === 'delete' && operation.response != null) { throw webidl.errors.exception({ header: 'Cache.#batchCacheOperations', message: 'delete operation should not have an associated response' }) } // 4.2.3 if (this.#queryCache(operation.request, operation.options, addedItems).length) { throw new DOMException('???', 'InvalidStateError') } // 4.2.4 let requestResponses // 4.2.5 if (operation.type === 'delete') { // 4.2.5.1 requestResponses = this.#queryCache(operation.request, operation.options) // TODO: the spec is wrong, this is needed to pass WPTs if (requestResponses.length === 0) { return [] } // 4.2.5.2 for (const requestResponse of requestResponses) { const idx = cache.indexOf(requestResponse) assert(idx !== -1) // 4.2.5.2.1 cache.splice(idx, 1) } } else if (operation.type === 'put') { // 4.2.6 // 4.2.6.1 if (operation.response == null) { throw webidl.errors.exception({ header: 'Cache.#batchCacheOperations', message: 'put operation should have an associated response' }) } // 4.2.6.2 const r = operation.request // 4.2.6.3 if (!urlIsHttpHttpsScheme(r.url)) { throw webidl.errors.exception({ header: 'Cache.#batchCacheOperations', message: 'expected http or https scheme' }) } // 4.2.6.4 if (r.method !== 'GET') { throw webidl.errors.exception({ header: 'Cache.#batchCacheOperations', message: 'not get method' }) } // 4.2.6.5 if (operation.options != null) { throw webidl.errors.exception({ header: 'Cache.#batchCacheOperations', message: 'options must not be defined' }) } // 4.2.6.6 requestResponses = this.#queryCache(operation.request) // 4.2.6.7 for (const requestResponse of requestResponses) { const idx = cache.indexOf(requestResponse) assert(idx !== -1) // 4.2.6.7.1 cache.splice(idx, 1) } // 4.2.6.8 cache.push([operation.request, operation.response]) // 4.2.6.10 addedItems.push([operation.request, operation.response]) } // 4.2.7 resultList.push([operation.request, operation.response]) } // 4.3 return resultList } catch (e) { // 5. // 5.1 this.#relevantRequestResponseList.length = 0 // 5.2 this.#relevantRequestResponseList = backupCache // 5.3 throw e } } /** * @see https://w3c.github.io/ServiceWorker/#query-cache * @param {any} requestQuery * @param {import('../../types/cache').CacheQueryOptions} options * @param {requestResponseList} targetStorage * @returns {requestResponseList} */ #queryCache (requestQuery, options, targetStorage) { /** @type {requestResponseList} */ const resultList = [] const storage = targetStorage ?? this.#relevantRequestResponseList for (const requestResponse of storage) { const [cachedRequest, cachedResponse] = requestResponse if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) { resultList.push(requestResponse) } } return resultList } /** * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm * @param {any} requestQuery * @param {any} request * @param {any | null} response * @param {import('../../types/cache').CacheQueryOptions | undefined} options * @returns {boolean} */ #requestMatchesCachedItem (requestQuery, request, response = null, options) { // if (options?.ignoreMethod === false && request.method === 'GET') { // return false // } const queryURL = new URL(requestQuery.url) const cachedURL = new URL(request.url) if (options?.ignoreSearch) { cachedURL.search = '' queryURL.search = '' } if (!urlEquals(queryURL, cachedURL, true)) { return false } if ( response == null || options?.ignoreVary || !response.headersList.contains('vary') ) { return true } const fieldValues = getFieldValues(response.headersList.get('vary')) for (const fieldValue of fieldValues) { if (fieldValue === '*') { return false } const requestValue = request.headersList.get(fieldValue) const queryValue = requestQuery.headersList.get(fieldValue) // If one has the header and the other doesn't, or one has // a different value than the other, return false if (requestValue !== queryValue) { return false } } return true } } Object.defineProperties(Cache.prototype, { [Symbol.toStringTag]: { value: 'Cache', configurable: true }, match: kEnumerableProperty, matchAll: kEnumerableProperty, add: kEnumerableProperty, addAll: kEnumerableProperty, put: kEnumerableProperty, delete: kEnumerableProperty, keys: kEnumerableProperty }) const cacheQueryOptionConverters = [ { key: 'ignoreSearch', converter: webidl.converters.boolean, defaultValue: false }, { key: 'ignoreMethod', converter: webidl.converters.boolean, defaultValue: false }, { key: 'ignoreVary', converter: webidl.converters.boolean, defaultValue: false } ] webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters) webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([ ...cacheQueryOptionConverters, { key: 'cacheName', converter: webidl.converters.DOMString } ]) webidl.converters.Response = webidl.interfaceConverter(Response) webidl.converters['sequence'] = webidl.sequenceConverter( webidl.converters.RequestInfo ) module.exports = { Cache } /***/ }), /***/ 4738: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { kConstruct } = __nccwpck_require__(296) const { Cache } = __nccwpck_require__(479) const { webidl } = __nccwpck_require__(4222) const { kEnumerableProperty } = __nccwpck_require__(3440) class CacheStorage { /** * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map * @type {Map} */ async has (cacheName) { webidl.brandCheck(this, CacheStorage) webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' }) cacheName = webidl.converters.DOMString(cacheName) // 2.1.1 // 2.2 return this.#caches.has(cacheName) } /** * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open * @param {string} cacheName * @returns {Promise} */ async open (cacheName) { webidl.brandCheck(this, CacheStorage) webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' }) cacheName = webidl.converters.DOMString(cacheName) // 2.1 if (this.#caches.has(cacheName)) { // await caches.open('v1') !== await caches.open('v1') // 2.1.1 const cache = this.#caches.get(cacheName) // 2.1.1.1 return new Cache(kConstruct, cache) } // 2.2 const cache = [] // 2.3 this.#caches.set(cacheName, cache) // 2.4 return new Cache(kConstruct, cache) } /** * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete * @param {string} cacheName * @returns {Promise} */ async delete (cacheName) { webidl.brandCheck(this, CacheStorage) webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' }) cacheName = webidl.converters.DOMString(cacheName) return this.#caches.delete(cacheName) } /** * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys * @returns {string[]} */ async keys () { webidl.brandCheck(this, CacheStorage) // 2.1 const keys = this.#caches.keys() // 2.2 return [...keys] } } Object.defineProperties(CacheStorage.prototype, { [Symbol.toStringTag]: { value: 'CacheStorage', configurable: true }, match: kEnumerableProperty, has: kEnumerableProperty, open: kEnumerableProperty, delete: kEnumerableProperty, keys: kEnumerableProperty }) module.exports = { CacheStorage } /***/ }), /***/ 296: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = { kConstruct: (__nccwpck_require__(6443).kConstruct) } /***/ }), /***/ 3993: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const assert = __nccwpck_require__(2613) const { URLSerializer } = __nccwpck_require__(4322) const { isValidHeaderName } = __nccwpck_require__(5523) /** * @see https://url.spec.whatwg.org/#concept-url-equals * @param {URL} A * @param {URL} B * @param {boolean | undefined} excludeFragment * @returns {boolean} */ function urlEquals (A, B, excludeFragment = false) { const serializedA = URLSerializer(A, excludeFragment) const serializedB = URLSerializer(B, excludeFragment) return serializedA === serializedB } /** * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262 * @param {string} header */ function fieldValues (header) { assert(header !== null) const values = [] for (let value of header.split(',')) { value = value.trim() if (!value.length) { continue } else if (!isValidHeaderName(value)) { continue } values.push(value) } return values } module.exports = { urlEquals, fieldValues } /***/ }), /***/ 6197: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // @ts-check /* global WebAssembly */ const assert = __nccwpck_require__(2613) const net = __nccwpck_require__(9278) const http = __nccwpck_require__(8611) const { pipeline } = __nccwpck_require__(2203) const util = __nccwpck_require__(3440) const timers = __nccwpck_require__(8804) const Request = __nccwpck_require__(4655) const DispatcherBase = __nccwpck_require__(1) const { RequestContentLengthMismatchError, ResponseContentLengthMismatchError, InvalidArgumentError, RequestAbortedError, HeadersTimeoutError, HeadersOverflowError, SocketError, InformationalError, BodyTimeoutError, HTTPParserError, ResponseExceededMaxSizeError, ClientDestroyedError } = __nccwpck_require__(8707) const buildConnector = __nccwpck_require__(9136) const { kUrl, kReset, kServerName, kClient, kBusy, kParser, kConnect, kBlocking, kResuming, kRunning, kPending, kSize, kWriting, kQueue, kConnected, kConnecting, kNeedDrain, kNoRef, kKeepAliveDefaultTimeout, kHostHeader, kPendingIdx, kRunningIdx, kError, kPipelining, kSocket, kKeepAliveTimeoutValue, kMaxHeadersSize, kKeepAliveMaxTimeout, kKeepAliveTimeoutThreshold, kHeadersTimeout, kBodyTimeout, kStrictContentLength, kConnector, kMaxRedirections, kMaxRequests, kCounter, kClose, kDestroy, kDispatch, kInterceptors, kLocalAddress, kMaxResponseSize, kHTTPConnVersion, // HTTP2 kHost, kHTTP2Session, kHTTP2SessionState, kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(6443) /** @type {import('http2')} */ let http2 try { http2 = __nccwpck_require__(5675) } catch { // @ts-ignore http2 = { constants: {} } } const { constants: { HTTP2_HEADER_AUTHORITY, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_SCHEME, HTTP2_HEADER_CONTENT_LENGTH, HTTP2_HEADER_EXPECT, HTTP2_HEADER_STATUS } } = http2 // Experimental let h2ExperimentalWarned = false const FastBuffer = Buffer[Symbol.species] const kClosedResolve = Symbol('kClosedResolve') const channels = {} try { const diagnosticsChannel = __nccwpck_require__(1637) channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders') channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect') channels.connectError = diagnosticsChannel.channel('undici:client:connectError') channels.connected = diagnosticsChannel.channel('undici:client:connected') } catch { channels.sendHeaders = { hasSubscribers: false } channels.beforeConnect = { hasSubscribers: false } channels.connectError = { hasSubscribers: false } channels.connected = { hasSubscribers: false } } /** * @type {import('../types/client').default} */ class Client extends DispatcherBase { /** * * @param {string|URL} url * @param {import('../types/client').Client.Options} options */ constructor (url, { interceptors, maxHeaderSize, headersTimeout, socketTimeout, requestTimeout, connectTimeout, bodyTimeout, idleTimeout, keepAlive, keepAliveTimeout, maxKeepAliveTimeout, keepAliveMaxTimeout, keepAliveTimeoutThreshold, socketPath, pipelining, tls, strictContentLength, maxCachedSessions, maxRedirections, connect, maxRequestsPerClient, localAddress, maxResponseSize, autoSelectFamily, autoSelectFamilyAttemptTimeout, // h2 allowH2, maxConcurrentStreams } = {}) { super() if (keepAlive !== undefined) { throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead') } if (socketTimeout !== undefined) { throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead') } if (requestTimeout !== undefined) { throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead') } if (idleTimeout !== undefined) { throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead') } if (maxKeepAliveTimeout !== undefined) { throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead') } if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) { throw new InvalidArgumentError('invalid maxHeaderSize') } if (socketPath != null && typeof socketPath !== 'string') { throw new InvalidArgumentError('invalid socketPath') } if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) { throw new InvalidArgumentError('invalid connectTimeout') } if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) { throw new InvalidArgumentError('invalid keepAliveTimeout') } if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) { throw new InvalidArgumentError('invalid keepAliveMaxTimeout') } if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) { throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold') } if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) { throw new InvalidArgumentError('headersTimeout must be a positive integer or zero') } if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) { throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero') } if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { throw new InvalidArgumentError('connect must be a function or an object') } if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { throw new InvalidArgumentError('maxRedirections must be a positive number') } if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) { throw new InvalidArgumentError('maxRequestsPerClient must be a positive number') } if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) { throw new InvalidArgumentError('localAddress must be valid string IP address') } if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) { throw new InvalidArgumentError('maxResponseSize must be a positive number') } if ( autoSelectFamilyAttemptTimeout != null && (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1) ) { throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number') } // h2 if (allowH2 != null && typeof allowH2 !== 'boolean') { throw new InvalidArgumentError('allowH2 must be a valid boolean value') } if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) { throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0') } if (typeof connect !== 'function') { connect = buildConnector({ ...tls, maxCachedSessions, allowH2, socketPath, timeout: connectTimeout, ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined), ...connect }) } this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client) ? interceptors.Client : [createRedirectInterceptor({ maxRedirections })] this[kUrl] = util.parseOrigin(url) this[kConnector] = connect this[kSocket] = null this[kPipelining] = pipelining != null ? pipelining : 1 this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout] this[kServerName] = null this[kLocalAddress] = localAddress != null ? localAddress : null this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n` this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3 this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3 this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength this[kMaxRedirections] = maxRedirections this[kMaxRequests] = maxRequestsPerClient this[kClosedResolve] = null this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1 this[kHTTPConnVersion] = 'h1' // HTTP/2 this[kHTTP2Session] = null this[kHTTP2SessionState] = !allowH2 ? null : { // streams: null, // Fixed queue of streams - For future support of `push` openStreams: 0, // Keep track of them to decide wether or not unref the session maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server } this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}` // kQueue is built up of 3 sections separated by // the kRunningIdx and kPendingIdx indices. // | complete | running | pending | // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length // kRunningIdx points to the first running element. // kPendingIdx points to the first pending element. // This implements a fast queue with an amortized // time of O(1). this[kQueue] = [] this[kRunningIdx] = 0 this[kPendingIdx] = 0 } get pipelining () { return this[kPipelining] } set pipelining (value) { this[kPipelining] = value resume(this, true) } get [kPending] () { return this[kQueue].length - this[kPendingIdx] } get [kRunning] () { return this[kPendingIdx] - this[kRunningIdx] } get [kSize] () { return this[kQueue].length - this[kRunningIdx] } get [kConnected] () { return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed } get [kBusy] () { const socket = this[kSocket] return ( (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) || (this[kSize] >= (this[kPipelining] || 1)) || this[kPending] > 0 ) } /* istanbul ignore: only used for test */ [kConnect] (cb) { connect(this) this.once('connect', cb) } [kDispatch] (opts, handler) { const origin = opts.origin || this[kUrl].origin const request = this[kHTTPConnVersion] === 'h2' ? Request[kHTTP2BuildRequest](origin, opts, handler) : Request[kHTTP1BuildRequest](origin, opts, handler) this[kQueue].push(request) if (this[kResuming]) { // Do nothing. } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) { // Wait a tick in case stream/iterator is ended in the same tick. this[kResuming] = 1 process.nextTick(resume, this) } else { resume(this, true) } if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) { this[kNeedDrain] = 2 } return this[kNeedDrain] < 2 } async [kClose] () { // TODO: for H2 we need to gracefully flush the remaining enqueued // request and close each stream. return new Promise((resolve) => { if (!this[kSize]) { resolve(null) } else { this[kClosedResolve] = resolve } }) } async [kDestroy] (err) { return new Promise((resolve) => { const requests = this[kQueue].splice(this[kPendingIdx]) for (let i = 0; i < requests.length; i++) { const request = requests[i] errorRequest(this, request, err) } const callback = () => { if (this[kClosedResolve]) { // TODO (fix): Should we error here with ClientDestroyedError? this[kClosedResolve]() this[kClosedResolve] = null } resolve() } if (this[kHTTP2Session] != null) { util.destroy(this[kHTTP2Session], err) this[kHTTP2Session] = null this[kHTTP2SessionState] = null } if (!this[kSocket]) { queueMicrotask(callback) } else { util.destroy(this[kSocket].on('close', callback), err) } resume(this) }) } } function onHttp2SessionError (err) { assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID') this[kSocket][kError] = err onError(this[kClient], err) } function onHttp2FrameError (type, code, id) { const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`) if (id === 0) { this[kSocket][kError] = err onError(this[kClient], err) } } function onHttp2SessionEnd () { util.destroy(this, new SocketError('other side closed')) util.destroy(this[kSocket], new SocketError('other side closed')) } function onHTTP2GoAway (code) { const client = this[kClient] const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`) client[kSocket] = null client[kHTTP2Session] = null if (client.destroyed) { assert(this[kPending] === 0) // Fail entire queue. const requests = client[kQueue].splice(client[kRunningIdx]) for (let i = 0; i < requests.length; i++) { const request = requests[i] errorRequest(this, request, err) } } else if (client[kRunning] > 0) { // Fail head of pipeline. const request = client[kQueue][client[kRunningIdx]] client[kQueue][client[kRunningIdx]++] = null errorRequest(client, request, err) } client[kPendingIdx] = client[kRunningIdx] assert(client[kRunning] === 0) client.emit('disconnect', client[kUrl], [client], err ) resume(client) } const constants = __nccwpck_require__(2824) const createRedirectInterceptor = __nccwpck_require__(4415) const EMPTY_BUF = Buffer.alloc(0) async function lazyllhttp () { const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(3870) : undefined let mod try { mod = await WebAssembly.compile(Buffer.from(__nccwpck_require__(3434), 'base64')) } catch (e) { /* istanbul ignore next */ // We could check if the error was caused by the simd option not // being enabled, but the occurring of this other error // * https://github.com/emscripten-core/emscripten/issues/11495 // got me to remove that check to avoid breaking Node 12. mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || __nccwpck_require__(3870), 'base64')) } return await WebAssembly.instantiate(mod, { env: { /* eslint-disable camelcase */ wasm_on_url: (p, at, len) => { /* istanbul ignore next */ return 0 }, wasm_on_status: (p, at, len) => { assert.strictEqual(currentParser.ptr, p) const start = at - currentBufferPtr + currentBufferRef.byteOffset return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 }, wasm_on_message_begin: (p) => { assert.strictEqual(currentParser.ptr, p) return currentParser.onMessageBegin() || 0 }, wasm_on_header_field: (p, at, len) => { assert.strictEqual(currentParser.ptr, p) const start = at - currentBufferPtr + currentBufferRef.byteOffset return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 }, wasm_on_header_value: (p, at, len) => { assert.strictEqual(currentParser.ptr, p) const start = at - currentBufferPtr + currentBufferRef.byteOffset return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 }, wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => { assert.strictEqual(currentParser.ptr, p) return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0 }, wasm_on_body: (p, at, len) => { assert.strictEqual(currentParser.ptr, p) const start = at - currentBufferPtr + currentBufferRef.byteOffset return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 }, wasm_on_message_complete: (p) => { assert.strictEqual(currentParser.ptr, p) return currentParser.onMessageComplete() || 0 } /* eslint-enable camelcase */ } }) } let llhttpInstance = null let llhttpPromise = lazyllhttp() llhttpPromise.catch() let currentParser = null let currentBufferRef = null let currentBufferSize = 0 let currentBufferPtr = null const TIMEOUT_HEADERS = 1 const TIMEOUT_BODY = 2 const TIMEOUT_IDLE = 3 class Parser { constructor (client, socket, { exports }) { assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0) this.llhttp = exports this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE) this.client = client this.socket = socket this.timeout = null this.timeoutValue = null this.timeoutType = null this.statusCode = null this.statusText = '' this.upgrade = false this.headers = [] this.headersSize = 0 this.headersMaxSize = client[kMaxHeadersSize] this.shouldKeepAlive = false this.paused = false this.resume = this.resume.bind(this) this.bytesRead = 0 this.keepAlive = '' this.contentLength = '' this.connection = '' this.maxResponseSize = client[kMaxResponseSize] } setTimeout (value, type) { this.timeoutType = type if (value !== this.timeoutValue) { timers.clearTimeout(this.timeout) if (value) { this.timeout = timers.setTimeout(onParserTimeout, value, this) // istanbul ignore else: only for jest if (this.timeout.unref) { this.timeout.unref() } } else { this.timeout = null } this.timeoutValue = value } else if (this.timeout) { // istanbul ignore else: only for jest if (this.timeout.refresh) { this.timeout.refresh() } } } resume () { if (this.socket.destroyed || !this.paused) { return } assert(this.ptr != null) assert(currentParser == null) this.llhttp.llhttp_resume(this.ptr) assert(this.timeoutType === TIMEOUT_BODY) if (this.timeout) { // istanbul ignore else: only for jest if (this.timeout.refresh) { this.timeout.refresh() } } this.paused = false this.execute(this.socket.read() || EMPTY_BUF) // Flush parser. this.readMore() } readMore () { while (!this.paused && this.ptr) { const chunk = this.socket.read() if (chunk === null) { break } this.execute(chunk) } } execute (data) { assert(this.ptr != null) assert(currentParser == null) assert(!this.paused) const { socket, llhttp } = this if (data.length > currentBufferSize) { if (currentBufferPtr) { llhttp.free(currentBufferPtr) } currentBufferSize = Math.ceil(data.length / 4096) * 4096 currentBufferPtr = llhttp.malloc(currentBufferSize) } new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data) // Call `execute` on the wasm parser. // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data, // and finally the length of bytes to parse. // The return value is an error code or `constants.ERROR.OK`. try { let ret try { currentBufferRef = data currentParser = this ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length) /* eslint-disable-next-line no-useless-catch */ } catch (err) { /* istanbul ignore next: difficult to make a test case for */ throw err } finally { currentParser = null currentBufferRef = null } const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr if (ret === constants.ERROR.PAUSED_UPGRADE) { this.onUpgrade(data.slice(offset)) } else if (ret === constants.ERROR.PAUSED) { this.paused = true socket.unshift(data.slice(offset)) } else if (ret !== constants.ERROR.OK) { const ptr = llhttp.llhttp_get_error_reason(this.ptr) let message = '' /* istanbul ignore else: difficult to make a test case for */ if (ptr) { const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0) message = 'Response does not match the HTTP/1.1 protocol (' + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ')' } throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset)) } } catch (err) { util.destroy(socket, err) } } destroy () { assert(this.ptr != null) assert(currentParser == null) this.llhttp.llhttp_free(this.ptr) this.ptr = null timers.clearTimeout(this.timeout) this.timeout = null this.timeoutValue = null this.timeoutType = null this.paused = false } onStatus (buf) { this.statusText = buf.toString() } onMessageBegin () { const { socket, client } = this /* istanbul ignore next: difficult to make a test case for */ if (socket.destroyed) { return -1 } const request = client[kQueue][client[kRunningIdx]] if (!request) { return -1 } } onHeaderField (buf) { const len = this.headers.length if ((len & 1) === 0) { this.headers.push(buf) } else { this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]) } this.trackHeader(buf.length) } onHeaderValue (buf) { let len = this.headers.length if ((len & 1) === 1) { this.headers.push(buf) len += 1 } else { this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]) } const key = this.headers[len - 2] if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') { this.keepAlive += buf.toString() } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') { this.connection += buf.toString() } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') { this.contentLength += buf.toString() } this.trackHeader(buf.length) } trackHeader (len) { this.headersSize += len if (this.headersSize >= this.headersMaxSize) { util.destroy(this.socket, new HeadersOverflowError()) } } onUpgrade (head) { const { upgrade, client, socket, headers, statusCode } = this assert(upgrade) const request = client[kQueue][client[kRunningIdx]] assert(request) assert(!socket.destroyed) assert(socket === client[kSocket]) assert(!this.paused) assert(request.upgrade || request.method === 'CONNECT') this.statusCode = null this.statusText = '' this.shouldKeepAlive = null assert(this.headers.length % 2 === 0) this.headers = [] this.headersSize = 0 socket.unshift(head) socket[kParser].destroy() socket[kParser] = null socket[kClient] = null socket[kError] = null socket .removeListener('error', onSocketError) .removeListener('readable', onSocketReadable) .removeListener('end', onSocketEnd) .removeListener('close', onSocketClose) client[kSocket] = null client[kQueue][client[kRunningIdx]++] = null client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade')) try { request.onUpgrade(statusCode, headers, socket) } catch (err) { util.destroy(socket, err) } resume(client) } onHeadersComplete (statusCode, upgrade, shouldKeepAlive) { const { client, socket, headers, statusText } = this /* istanbul ignore next: difficult to make a test case for */ if (socket.destroyed) { return -1 } const request = client[kQueue][client[kRunningIdx]] /* istanbul ignore next: difficult to make a test case for */ if (!request) { return -1 } assert(!this.upgrade) assert(this.statusCode < 200) if (statusCode === 100) { util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket))) return -1 } /* this can only happen if server is misbehaving */ if (upgrade && !request.upgrade) { util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket))) return -1 } assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS) this.statusCode = statusCode this.shouldKeepAlive = ( shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD. (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive') ) if (this.statusCode >= 200) { const bodyTimeout = request.bodyTimeout != null ? request.bodyTimeout : client[kBodyTimeout] this.setTimeout(bodyTimeout, TIMEOUT_BODY) } else if (this.timeout) { // istanbul ignore else: only for jest if (this.timeout.refresh) { this.timeout.refresh() } } if (request.method === 'CONNECT') { assert(client[kRunning] === 1) this.upgrade = true return 2 } if (upgrade) { assert(client[kRunning] === 1) this.upgrade = true return 2 } assert(this.headers.length % 2 === 0) this.headers = [] this.headersSize = 0 if (this.shouldKeepAlive && client[kPipelining]) { const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null if (keepAliveTimeout != null) { const timeout = Math.min( keepAliveTimeout - client[kKeepAliveTimeoutThreshold], client[kKeepAliveMaxTimeout] ) if (timeout <= 0) { socket[kReset] = true } else { client[kKeepAliveTimeoutValue] = timeout } } else { client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout] } } else { // Stop more requests from being dispatched. socket[kReset] = true } const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false if (request.aborted) { return -1 } if (request.method === 'HEAD') { return 1 } if (statusCode < 200) { return 1 } if (socket[kBlocking]) { socket[kBlocking] = false resume(client) } return pause ? constants.ERROR.PAUSED : 0 } onBody (buf) { const { client, socket, statusCode, maxResponseSize } = this if (socket.destroyed) { return -1 } const request = client[kQueue][client[kRunningIdx]] assert(request) assert.strictEqual(this.timeoutType, TIMEOUT_BODY) if (this.timeout) { // istanbul ignore else: only for jest if (this.timeout.refresh) { this.timeout.refresh() } } assert(statusCode >= 200) if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) { util.destroy(socket, new ResponseExceededMaxSizeError()) return -1 } this.bytesRead += buf.length if (request.onData(buf) === false) { return constants.ERROR.PAUSED } } onMessageComplete () { const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this if (socket.destroyed && (!statusCode || shouldKeepAlive)) { return -1 } if (upgrade) { return } const request = client[kQueue][client[kRunningIdx]] assert(request) assert(statusCode >= 100) this.statusCode = null this.statusText = '' this.bytesRead = 0 this.contentLength = '' this.keepAlive = '' this.connection = '' assert(this.headers.length % 2 === 0) this.headers = [] this.headersSize = 0 if (statusCode < 200) { return } /* istanbul ignore next: should be handled by llhttp? */ if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) { util.destroy(socket, new ResponseContentLengthMismatchError()) return -1 } request.onComplete(headers) client[kQueue][client[kRunningIdx]++] = null if (socket[kWriting]) { assert.strictEqual(client[kRunning], 0) // Response completed before request. util.destroy(socket, new InformationalError('reset')) return constants.ERROR.PAUSED } else if (!shouldKeepAlive) { util.destroy(socket, new InformationalError('reset')) return constants.ERROR.PAUSED } else if (socket[kReset] && client[kRunning] === 0) { // Destroy socket once all requests have completed. // The request at the tail of the pipeline is the one // that requested reset and no further requests should // have been queued since then. util.destroy(socket, new InformationalError('reset')) return constants.ERROR.PAUSED } else if (client[kPipelining] === 1) { // We must wait a full event loop cycle to reuse this socket to make sure // that non-spec compliant servers are not closing the connection even if they // said they won't. setImmediate(resume, client) } else { resume(client) } } } function onParserTimeout (parser) { const { socket, timeoutType, client } = parser /* istanbul ignore else */ if (timeoutType === TIMEOUT_HEADERS) { if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) { assert(!parser.paused, 'cannot be paused while waiting for headers') util.destroy(socket, new HeadersTimeoutError()) } } else if (timeoutType === TIMEOUT_BODY) { if (!parser.paused) { util.destroy(socket, new BodyTimeoutError()) } } else if (timeoutType === TIMEOUT_IDLE) { assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]) util.destroy(socket, new InformationalError('socket idle timeout')) } } function onSocketReadable () { const { [kParser]: parser } = this if (parser) { parser.readMore() } } function onSocketError (err) { const { [kClient]: client, [kParser]: parser } = this assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID') if (client[kHTTPConnVersion] !== 'h2') { // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded // to the user. if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) { // We treat all incoming data so for as a valid response. parser.onMessageComplete() return } } this[kError] = err onError(this[kClient], err) } function onError (client, err) { if ( client[kRunning] === 0 && err.code !== 'UND_ERR_INFO' && err.code !== 'UND_ERR_SOCKET' ) { // Error is not caused by running request and not a recoverable // socket error. assert(client[kPendingIdx] === client[kRunningIdx]) const requests = client[kQueue].splice(client[kRunningIdx]) for (let i = 0; i < requests.length; i++) { const request = requests[i] errorRequest(client, request, err) } assert(client[kSize] === 0) } } function onSocketEnd () { const { [kParser]: parser, [kClient]: client } = this if (client[kHTTPConnVersion] !== 'h2') { if (parser.statusCode && !parser.shouldKeepAlive) { // We treat all incoming data so far as a valid response. parser.onMessageComplete() return } } util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this))) } function onSocketClose () { const { [kClient]: client, [kParser]: parser } = this if (client[kHTTPConnVersion] === 'h1' && parser) { if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { // We treat all incoming data so far as a valid response. parser.onMessageComplete() } this[kParser].destroy() this[kParser] = null } const err = this[kError] || new SocketError('closed', util.getSocketInfo(this)) client[kSocket] = null if (client.destroyed) { assert(client[kPending] === 0) // Fail entire queue. const requests = client[kQueue].splice(client[kRunningIdx]) for (let i = 0; i < requests.length; i++) { const request = requests[i] errorRequest(client, request, err) } } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') { // Fail head of pipeline. const request = client[kQueue][client[kRunningIdx]] client[kQueue][client[kRunningIdx]++] = null errorRequest(client, request, err) } client[kPendingIdx] = client[kRunningIdx] assert(client[kRunning] === 0) client.emit('disconnect', client[kUrl], [client], err) resume(client) } async function connect (client) { assert(!client[kConnecting]) assert(!client[kSocket]) let { host, hostname, protocol, port } = client[kUrl] // Resolve ipv6 if (hostname[0] === '[') { const idx = hostname.indexOf(']') assert(idx !== -1) const ip = hostname.substring(1, idx) assert(net.isIP(ip)) hostname = ip } client[kConnecting] = true if (channels.beforeConnect.hasSubscribers) { channels.beforeConnect.publish({ connectParams: { host, hostname, protocol, port, servername: client[kServerName], localAddress: client[kLocalAddress] }, connector: client[kConnector] }) } try { const socket = await new Promise((resolve, reject) => { client[kConnector]({ host, hostname, protocol, port, servername: client[kServerName], localAddress: client[kLocalAddress] }, (err, socket) => { if (err) { reject(err) } else { resolve(socket) } }) }) if (client.destroyed) { util.destroy(socket.on('error', () => {}), new ClientDestroyedError()) return } client[kConnecting] = false assert(socket) const isH2 = socket.alpnProtocol === 'h2' if (isH2) { if (!h2ExperimentalWarned) { h2ExperimentalWarned = true process.emitWarning('H2 support is experimental, expect them to change at any time.', { code: 'UNDICI-H2' }) } const session = http2.connect(client[kUrl], { createConnection: () => socket, peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams }) client[kHTTPConnVersion] = 'h2' session[kClient] = client session[kSocket] = socket session.on('error', onHttp2SessionError) session.on('frameError', onHttp2FrameError) session.on('end', onHttp2SessionEnd) session.on('goaway', onHTTP2GoAway) session.on('close', onSocketClose) session.unref() client[kHTTP2Session] = session socket[kHTTP2Session] = session } else { if (!llhttpInstance) { llhttpInstance = await llhttpPromise llhttpPromise = null } socket[kNoRef] = false socket[kWriting] = false socket[kReset] = false socket[kBlocking] = false socket[kParser] = new Parser(client, socket, llhttpInstance) } socket[kCounter] = 0 socket[kMaxRequests] = client[kMaxRequests] socket[kClient] = client socket[kError] = null socket .on('error', onSocketError) .on('readable', onSocketReadable) .on('end', onSocketEnd) .on('close', onSocketClose) client[kSocket] = socket if (channels.connected.hasSubscribers) { channels.connected.publish({ connectParams: { host, hostname, protocol, port, servername: client[kServerName], localAddress: client[kLocalAddress] }, connector: client[kConnector], socket }) } client.emit('connect', client[kUrl], [client]) } catch (err) { if (client.destroyed) { return } client[kConnecting] = false if (channels.connectError.hasSubscribers) { channels.connectError.publish({ connectParams: { host, hostname, protocol, port, servername: client[kServerName], localAddress: client[kLocalAddress] }, connector: client[kConnector], error: err }) } if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') { assert(client[kRunning] === 0) while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { const request = client[kQueue][client[kPendingIdx]++] errorRequest(client, request, err) } } else { onError(client, err) } client.emit('connectionError', client[kUrl], [client], err) } resume(client) } function emitDrain (client) { client[kNeedDrain] = 0 client.emit('drain', client[kUrl], [client]) } function resume (client, sync) { if (client[kResuming] === 2) { return } client[kResuming] = 2 _resume(client, sync) client[kResuming] = 0 if (client[kRunningIdx] > 256) { client[kQueue].splice(0, client[kRunningIdx]) client[kPendingIdx] -= client[kRunningIdx] client[kRunningIdx] = 0 } } function _resume (client, sync) { while (true) { if (client.destroyed) { assert(client[kPending] === 0) return } if (client[kClosedResolve] && !client[kSize]) { client[kClosedResolve]() client[kClosedResolve] = null return } const socket = client[kSocket] if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') { if (client[kSize] === 0) { if (!socket[kNoRef] && socket.unref) { socket.unref() socket[kNoRef] = true } } else if (socket[kNoRef] && socket.ref) { socket.ref() socket[kNoRef] = false } if (client[kSize] === 0) { if (socket[kParser].timeoutType !== TIMEOUT_IDLE) { socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE) } } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) { if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) { const request = client[kQueue][client[kRunningIdx]] const headersTimeout = request.headersTimeout != null ? request.headersTimeout : client[kHeadersTimeout] socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS) } } } if (client[kBusy]) { client[kNeedDrain] = 2 } else if (client[kNeedDrain] === 2) { if (sync) { client[kNeedDrain] = 1 process.nextTick(emitDrain, client) } else { emitDrain(client) } continue } if (client[kPending] === 0) { return } if (client[kRunning] >= (client[kPipelining] || 1)) { return } const request = client[kQueue][client[kPendingIdx]] if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) { if (client[kRunning] > 0) { return } client[kServerName] = request.servername if (socket && socket.servername !== request.servername) { util.destroy(socket, new InformationalError('servername changed')) return } } if (client[kConnecting]) { return } if (!socket && !client[kHTTP2Session]) { connect(client) return } if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) { return } if (client[kRunning] > 0 && !request.idempotent) { // Non-idempotent request cannot be retried. // Ensure that no other requests are inflight and // could cause failure. return } if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) { // Don't dispatch an upgrade until all preceding requests have completed. // A misbehaving server might upgrade the connection before all pipelined // request has completed. return } if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 && (util.isStream(request.body) || util.isAsyncIterable(request.body))) { // Request with stream or iterator body can error while other requests // are inflight and indirectly error those as well. // Ensure this doesn't happen by waiting for inflight // to complete before dispatching. // Request with stream or iterator body cannot be retried. // Ensure that no other requests are inflight and // could cause failure. return } if (!request.aborted && write(client, request)) { client[kPendingIdx]++ } else { client[kQueue].splice(client[kPendingIdx], 1) } } } // https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2 function shouldSendContentLength (method) { return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT' } function write (client, request) { if (client[kHTTPConnVersion] === 'h2') { writeH2(client, client[kHTTP2Session], request) return } const { body, method, path, host, upgrade, headers, blocking, reset } = request // https://tools.ietf.org/html/rfc7231#section-4.3.1 // https://tools.ietf.org/html/rfc7231#section-4.3.2 // https://tools.ietf.org/html/rfc7231#section-4.3.5 // Sending a payload body on a request that does not // expect it can cause undefined behavior on some // servers and corrupt connection state. Do not // re-use the connection for further requests. const expectsPayload = ( method === 'PUT' || method === 'POST' || method === 'PATCH' ) if (body && typeof body.read === 'function') { // Try to read EOF in order to get length. body.read(0) } const bodyLength = util.bodyLength(body) let contentLength = bodyLength if (contentLength === null) { contentLength = request.contentLength } if (contentLength === 0 && !expectsPayload) { // https://tools.ietf.org/html/rfc7230#section-3.3.2 // A user agent SHOULD NOT send a Content-Length header field when // the request message does not contain a payload body and the method // semantics do not anticipate such a body. contentLength = null } // https://github.com/nodejs/undici/issues/2046 // A user agent may send a Content-Length header with 0 value, this should be allowed. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) { if (client[kStrictContentLength]) { errorRequest(client, request, new RequestContentLengthMismatchError()) return false } process.emitWarning(new RequestContentLengthMismatchError()) } const socket = client[kSocket] try { request.onConnect((err) => { if (request.aborted || request.completed) { return } errorRequest(client, request, err || new RequestAbortedError()) util.destroy(socket, new InformationalError('aborted')) }) } catch (err) { errorRequest(client, request, err) } if (request.aborted) { return false } if (method === 'HEAD') { // https://github.com/mcollina/undici/issues/258 // Close after a HEAD request to interop with misbehaving servers // that may send a body in the response. socket[kReset] = true } if (upgrade || method === 'CONNECT') { // On CONNECT or upgrade, block pipeline from dispatching further // requests on this connection. socket[kReset] = true } if (reset != null) { socket[kReset] = reset } if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) { socket[kReset] = true } if (blocking) { socket[kBlocking] = true } let header = `${method} ${path} HTTP/1.1\r\n` if (typeof host === 'string') { header += `host: ${host}\r\n` } else { header += client[kHostHeader] } if (upgrade) { header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n` } else if (client[kPipelining] && !socket[kReset]) { header += 'connection: keep-alive\r\n' } else { header += 'connection: close\r\n' } if (headers) { header += headers } if (channels.sendHeaders.hasSubscribers) { channels.sendHeaders.publish({ request, headers: header, socket }) } /* istanbul ignore else: assertion */ if (!body || bodyLength === 0) { if (contentLength === 0) { socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1') } else { assert(contentLength === null, 'no body must not have content length') socket.write(`${header}\r\n`, 'latin1') } request.onRequestSent() } else if (util.isBuffer(body)) { assert(contentLength === body.byteLength, 'buffer body must have content length') socket.cork() socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') socket.write(body) socket.uncork() request.onBodySent(body) request.onRequestSent() if (!expectsPayload) { socket[kReset] = true } } else if (util.isBlobLike(body)) { if (typeof body.stream === 'function') { writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload }) } else { writeBlob({ body, client, request, socket, contentLength, header, expectsPayload }) } } else if (util.isStream(body)) { writeStream({ body, client, request, socket, contentLength, header, expectsPayload }) } else if (util.isIterable(body)) { writeIterable({ body, client, request, socket, contentLength, header, expectsPayload }) } else { assert(false) } return true } function writeH2 (client, session, request) { const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request let headers if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim()) else headers = reqHeaders if (upgrade) { errorRequest(client, request, new Error('Upgrade not supported for H2')) return false } try { // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event? request.onConnect((err) => { if (request.aborted || request.completed) { return } errorRequest(client, request, err || new RequestAbortedError()) }) } catch (err) { errorRequest(client, request, err) } if (request.aborted) { return false } /** @type {import('node:http2').ClientHttp2Stream} */ let stream const h2State = client[kHTTP2SessionState] headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost] headers[HTTP2_HEADER_METHOD] = method if (method === 'CONNECT') { session.ref() // we are already connected, streams are pending, first request // will create a new stream. We trigger a request to create the stream and wait until // `ready` event is triggered // We disabled endStream to allow the user to write to the stream stream = session.request(headers, { endStream: false, signal }) if (stream.id && !stream.pending) { request.onUpgrade(null, null, stream) ++h2State.openStreams } else { stream.once('ready', () => { request.onUpgrade(null, null, stream) ++h2State.openStreams }) } stream.once('close', () => { h2State.openStreams -= 1 // TODO(HTTP/2): unref only if current streams count is 0 if (h2State.openStreams === 0) session.unref() }) return true } // https://tools.ietf.org/html/rfc7540#section-8.3 // :path and :scheme headers must be omited when sending CONNECT headers[HTTP2_HEADER_PATH] = path headers[HTTP2_HEADER_SCHEME] = 'https' // https://tools.ietf.org/html/rfc7231#section-4.3.1 // https://tools.ietf.org/html/rfc7231#section-4.3.2 // https://tools.ietf.org/html/rfc7231#section-4.3.5 // Sending a payload body on a request that does not // expect it can cause undefined behavior on some // servers and corrupt connection state. Do not // re-use the connection for further requests. const expectsPayload = ( method === 'PUT' || method === 'POST' || method === 'PATCH' ) if (body && typeof body.read === 'function') { // Try to read EOF in order to get length. body.read(0) } let contentLength = util.bodyLength(body) if (contentLength == null) { contentLength = request.contentLength } if (contentLength === 0 || !expectsPayload) { // https://tools.ietf.org/html/rfc7230#section-3.3.2 // A user agent SHOULD NOT send a Content-Length header field when // the request message does not contain a payload body and the method // semantics do not anticipate such a body. contentLength = null } // https://github.com/nodejs/undici/issues/2046 // A user agent may send a Content-Length header with 0 value, this should be allowed. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) { if (client[kStrictContentLength]) { errorRequest(client, request, new RequestContentLengthMismatchError()) return false } process.emitWarning(new RequestContentLengthMismatchError()) } if (contentLength != null) { assert(body, 'no body must not have content length') headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}` } session.ref() const shouldEndStream = method === 'GET' || method === 'HEAD' if (expectContinue) { headers[HTTP2_HEADER_EXPECT] = '100-continue' stream = session.request(headers, { endStream: shouldEndStream, signal }) stream.once('continue', writeBodyH2) } else { stream = session.request(headers, { endStream: shouldEndStream, signal }) writeBodyH2() } // Increment counter as we have new several streams open ++h2State.openStreams stream.once('response', headers => { const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) { stream.pause() } }) stream.once('end', () => { request.onComplete([]) }) stream.on('data', (chunk) => { if (request.onData(chunk) === false) { stream.pause() } }) stream.once('close', () => { h2State.openStreams -= 1 // TODO(HTTP/2): unref only if current streams count is 0 if (h2State.openStreams === 0) { session.unref() } }) stream.once('error', function (err) { if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { h2State.streams -= 1 util.destroy(stream, err) } }) stream.once('frameError', (type, code) => { const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`) errorRequest(client, request, err) if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { h2State.streams -= 1 util.destroy(stream, err) } }) // stream.on('aborted', () => { // // TODO(HTTP/2): Support aborted // }) // stream.on('timeout', () => { // // TODO(HTTP/2): Support timeout // }) // stream.on('push', headers => { // // TODO(HTTP/2): Suppor push // }) // stream.on('trailers', headers => { // // TODO(HTTP/2): Support trailers // }) return true function writeBodyH2 () { /* istanbul ignore else: assertion */ if (!body) { request.onRequestSent() } else if (util.isBuffer(body)) { assert(contentLength === body.byteLength, 'buffer body must have content length') stream.cork() stream.write(body) stream.uncork() stream.end() request.onBodySent(body) request.onRequestSent() } else if (util.isBlobLike(body)) { if (typeof body.stream === 'function') { writeIterable({ client, request, contentLength, h2stream: stream, expectsPayload, body: body.stream(), socket: client[kSocket], header: '' }) } else { writeBlob({ body, client, request, contentLength, expectsPayload, h2stream: stream, header: '', socket: client[kSocket] }) } } else if (util.isStream(body)) { writeStream({ body, client, request, contentLength, expectsPayload, socket: client[kSocket], h2stream: stream, header: '' }) } else if (util.isIterable(body)) { writeIterable({ body, client, request, contentLength, expectsPayload, header: '', h2stream: stream, socket: client[kSocket] }) } else { assert(false) } } } function writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) { assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined') if (client[kHTTPConnVersion] === 'h2') { // For HTTP/2, is enough to pipe the stream const pipe = pipeline( body, h2stream, (err) => { if (err) { util.destroy(body, err) util.destroy(h2stream, err) } else { request.onRequestSent() } } ) pipe.on('data', onPipeData) pipe.once('end', () => { pipe.removeListener('data', onPipeData) util.destroy(pipe) }) function onPipeData (chunk) { request.onBodySent(chunk) } return } let finished = false const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header }) const onData = function (chunk) { if (finished) { return } try { if (!writer.write(chunk) && this.pause) { this.pause() } } catch (err) { util.destroy(this, err) } } const onDrain = function () { if (finished) { return } if (body.resume) { body.resume() } } const onAbort = function () { if (finished) { return } const err = new RequestAbortedError() queueMicrotask(() => onFinished(err)) } const onFinished = function (err) { if (finished) { return } finished = true assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1)) socket .off('drain', onDrain) .off('error', onFinished) body .removeListener('data', onData) .removeListener('end', onFinished) .removeListener('error', onFinished) .removeListener('close', onAbort) if (!err) { try { writer.end() } catch (er) { err = er } } writer.destroy(err) if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) { util.destroy(body, err) } else { util.destroy(body) } } body .on('data', onData) .on('end', onFinished) .on('error', onFinished) .on('close', onAbort) if (body.resume) { body.resume() } socket .on('drain', onDrain) .on('error', onFinished) } async function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) { assert(contentLength === body.size, 'blob body must have content length') const isH2 = client[kHTTPConnVersion] === 'h2' try { if (contentLength != null && contentLength !== body.size) { throw new RequestContentLengthMismatchError() } const buffer = Buffer.from(await body.arrayBuffer()) if (isH2) { h2stream.cork() h2stream.write(buffer) h2stream.uncork() } else { socket.cork() socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') socket.write(buffer) socket.uncork() } request.onBodySent(buffer) request.onRequestSent() if (!expectsPayload) { socket[kReset] = true } resume(client) } catch (err) { util.destroy(isH2 ? h2stream : socket, err) } } async function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) { assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined') let callback = null function onDrain () { if (callback) { const cb = callback callback = null cb() } } const waitForDrain = () => new Promise((resolve, reject) => { assert(callback === null) if (socket[kError]) { reject(socket[kError]) } else { callback = resolve } }) if (client[kHTTPConnVersion] === 'h2') { h2stream .on('close', onDrain) .on('drain', onDrain) try { // It's up to the user to somehow abort the async iterable. for await (const chunk of body) { if (socket[kError]) { throw socket[kError] } const res = h2stream.write(chunk) request.onBodySent(chunk) if (!res) { await waitForDrain() } } } catch (err) { h2stream.destroy(err) } finally { request.onRequestSent() h2stream.end() h2stream .off('close', onDrain) .off('drain', onDrain) } return } socket .on('close', onDrain) .on('drain', onDrain) const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header }) try { // It's up to the user to somehow abort the async iterable. for await (const chunk of body) { if (socket[kError]) { throw socket[kError] } if (!writer.write(chunk)) { await waitForDrain() } } writer.end() } catch (err) { writer.destroy(err) } finally { socket .off('close', onDrain) .off('drain', onDrain) } } class AsyncWriter { constructor ({ socket, request, contentLength, client, expectsPayload, header }) { this.socket = socket this.request = request this.contentLength = contentLength this.client = client this.bytesWritten = 0 this.expectsPayload = expectsPayload this.header = header socket[kWriting] = true } write (chunk) { const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this if (socket[kError]) { throw socket[kError] } if (socket.destroyed) { return false } const len = Buffer.byteLength(chunk) if (!len) { return true } // We should defer writing chunks. if (contentLength !== null && bytesWritten + len > contentLength) { if (client[kStrictContentLength]) { throw new RequestContentLengthMismatchError() } process.emitWarning(new RequestContentLengthMismatchError()) } socket.cork() if (bytesWritten === 0) { if (!expectsPayload) { socket[kReset] = true } if (contentLength === null) { socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1') } else { socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') } } if (contentLength === null) { socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1') } this.bytesWritten += len const ret = socket.write(chunk) socket.uncork() request.onBodySent(chunk) if (!ret) { if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { // istanbul ignore else: only for jest if (socket[kParser].timeout.refresh) { socket[kParser].timeout.refresh() } } } return ret } end () { const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this request.onRequestSent() socket[kWriting] = false if (socket[kError]) { throw socket[kError] } if (socket.destroyed) { return } if (bytesWritten === 0) { if (expectsPayload) { // https://tools.ietf.org/html/rfc7230#section-3.3.2 // A user agent SHOULD send a Content-Length in a request message when // no Transfer-Encoding is sent and the request method defines a meaning // for an enclosed payload body. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1') } else { socket.write(`${header}\r\n`, 'latin1') } } else if (contentLength === null) { socket.write('\r\n0\r\n\r\n', 'latin1') } if (contentLength !== null && bytesWritten !== contentLength) { if (client[kStrictContentLength]) { throw new RequestContentLengthMismatchError() } else { process.emitWarning(new RequestContentLengthMismatchError()) } } if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { // istanbul ignore else: only for jest if (socket[kParser].timeout.refresh) { socket[kParser].timeout.refresh() } } resume(client) } destroy (err) { const { socket, client } = this socket[kWriting] = false if (err) { assert(client[kRunning] <= 1, 'pipeline should only contain this request') util.destroy(socket, err) } } } function errorRequest (client, request, err) { try { request.onError(err) assert(request.aborted) } catch (err) { client.emit('error', err) } } module.exports = Client /***/ }), /***/ 3194: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /* istanbul ignore file: only for Node 12 */ const { kConnected, kSize } = __nccwpck_require__(6443) class CompatWeakRef { constructor (value) { this.value = value } deref () { return this.value[kConnected] === 0 && this.value[kSize] === 0 ? undefined : this.value } } class CompatFinalizer { constructor (finalizer) { this.finalizer = finalizer } register (dispatcher, key) { if (dispatcher.on) { dispatcher.on('disconnect', () => { if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) { this.finalizer(key) } }) } } } module.exports = function () { // FIXME: remove workaround when the Node bug is fixed // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308 if (process.env.NODE_V8_COVERAGE) { return { WeakRef: CompatWeakRef, FinalizationRegistry: CompatFinalizer } } return { WeakRef: global.WeakRef || CompatWeakRef, FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer } } /***/ }), /***/ 9237: /***/ ((module) => { // https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size const maxAttributeValueSize = 1024 // https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size const maxNameValuePairSize = 4096 module.exports = { maxAttributeValueSize, maxNameValuePairSize } /***/ }), /***/ 3168: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { parseSetCookie } = __nccwpck_require__(8915) const { stringify } = __nccwpck_require__(3834) const { webidl } = __nccwpck_require__(4222) const { Headers } = __nccwpck_require__(6349) /** * @typedef {Object} Cookie * @property {string} name * @property {string} value * @property {Date|number|undefined} expires * @property {number|undefined} maxAge * @property {string|undefined} domain * @property {string|undefined} path * @property {boolean|undefined} secure * @property {boolean|undefined} httpOnly * @property {'Strict'|'Lax'|'None'} sameSite * @property {string[]} unparsed */ /** * @param {Headers} headers * @returns {Record} */ function getCookies (headers) { webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' }) webidl.brandCheck(headers, Headers, { strict: false }) const cookie = headers.get('cookie') const out = {} if (!cookie) { return out } for (const piece of cookie.split(';')) { const [name, ...value] = piece.split('=') out[name.trim()] = value.join('=') } return out } /** * @param {Headers} headers * @param {string} name * @param {{ path?: string, domain?: string }|undefined} attributes * @returns {void} */ function deleteCookie (headers, name, attributes) { webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' }) webidl.brandCheck(headers, Headers, { strict: false }) name = webidl.converters.DOMString(name) attributes = webidl.converters.DeleteCookieAttributes(attributes) // Matches behavior of // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278 setCookie(headers, { name, value: '', expires: new Date(0), ...attributes }) } /** * @param {Headers} headers * @returns {Cookie[]} */ function getSetCookies (headers) { webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' }) webidl.brandCheck(headers, Headers, { strict: false }) const cookies = headers.getSetCookie() if (!cookies) { return [] } return cookies.map((pair) => parseSetCookie(pair)) } /** * @param {Headers} headers * @param {Cookie} cookie * @returns {void} */ function setCookie (headers, cookie) { webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' }) webidl.brandCheck(headers, Headers, { strict: false }) cookie = webidl.converters.Cookie(cookie) const str = stringify(cookie) if (str) { headers.append('Set-Cookie', stringify(cookie)) } } webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([ { converter: webidl.nullableConverter(webidl.converters.DOMString), key: 'path', defaultValue: null }, { converter: webidl.nullableConverter(webidl.converters.DOMString), key: 'domain', defaultValue: null } ]) webidl.converters.Cookie = webidl.dictionaryConverter([ { converter: webidl.converters.DOMString, key: 'name' }, { converter: webidl.converters.DOMString, key: 'value' }, { converter: webidl.nullableConverter((value) => { if (typeof value === 'number') { return webidl.converters['unsigned long long'](value) } return new Date(value) }), key: 'expires', defaultValue: null }, { converter: webidl.nullableConverter(webidl.converters['long long']), key: 'maxAge', defaultValue: null }, { converter: webidl.nullableConverter(webidl.converters.DOMString), key: 'domain', defaultValue: null }, { converter: webidl.nullableConverter(webidl.converters.DOMString), key: 'path', defaultValue: null }, { converter: webidl.nullableConverter(webidl.converters.boolean), key: 'secure', defaultValue: null }, { converter: webidl.nullableConverter(webidl.converters.boolean), key: 'httpOnly', defaultValue: null }, { converter: webidl.converters.USVString, key: 'sameSite', allowedValues: ['Strict', 'Lax', 'None'] }, { converter: webidl.sequenceConverter(webidl.converters.DOMString), key: 'unparsed', defaultValue: [] } ]) module.exports = { getCookies, deleteCookie, getSetCookies, setCookie } /***/ }), /***/ 8915: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(9237) const { isCTLExcludingHtab } = __nccwpck_require__(3834) const { collectASequenceOfCodePointsFast } = __nccwpck_require__(4322) const assert = __nccwpck_require__(2613) /** * @description Parses the field-value attributes of a set-cookie header string. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4 * @param {string} header * @returns if the header is invalid, null will be returned */ function parseSetCookie (header) { // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F // character (CTL characters excluding HTAB): Abort these steps and // ignore the set-cookie-string entirely. if (isCTLExcludingHtab(header)) { return null } let nameValuePair = '' let unparsedAttributes = '' let name = '' let value = '' // 2. If the set-cookie-string contains a %x3B (";") character: if (header.includes(';')) { // 1. The name-value-pair string consists of the characters up to, // but not including, the first %x3B (";"), and the unparsed- // attributes consist of the remainder of the set-cookie-string // (including the %x3B (";") in question). const position = { position: 0 } nameValuePair = collectASequenceOfCodePointsFast(';', header, position) unparsedAttributes = header.slice(position.position) } else { // Otherwise: // 1. The name-value-pair string consists of all the characters // contained in the set-cookie-string, and the unparsed- // attributes is the empty string. nameValuePair = header } // 3. If the name-value-pair string lacks a %x3D ("=") character, then // the name string is empty, and the value string is the value of // name-value-pair. if (!nameValuePair.includes('=')) { value = nameValuePair } else { // Otherwise, the name string consists of the characters up to, but // not including, the first %x3D ("=") character, and the (possibly // empty) value string consists of the characters after the first // %x3D ("=") character. const position = { position: 0 } name = collectASequenceOfCodePointsFast( '=', nameValuePair, position ) value = nameValuePair.slice(position.position + 1) } // 4. Remove any leading or trailing WSP characters from the name // string and the value string. name = name.trim() value = value.trim() // 5. If the sum of the lengths of the name string and the value string // is more than 4096 octets, abort these steps and ignore the set- // cookie-string entirely. if (name.length + value.length > maxNameValuePairSize) { return null } // 6. The cookie-name is the name string, and the cookie-value is the // value string. return { name, value, ...parseUnparsedAttributes(unparsedAttributes) } } /** * Parses the remaining attributes of a set-cookie header * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4 * @param {string} unparsedAttributes * @param {[Object.]={}} cookieAttributeList */ function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) { // 1. If the unparsed-attributes string is empty, skip the rest of // these steps. if (unparsedAttributes.length === 0) { return cookieAttributeList } // 2. Discard the first character of the unparsed-attributes (which // will be a %x3B (";") character). assert(unparsedAttributes[0] === ';') unparsedAttributes = unparsedAttributes.slice(1) let cookieAv = '' // 3. If the remaining unparsed-attributes contains a %x3B (";") // character: if (unparsedAttributes.includes(';')) { // 1. Consume the characters of the unparsed-attributes up to, but // not including, the first %x3B (";") character. cookieAv = collectASequenceOfCodePointsFast( ';', unparsedAttributes, { position: 0 } ) unparsedAttributes = unparsedAttributes.slice(cookieAv.length) } else { // Otherwise: // 1. Consume the remainder of the unparsed-attributes. cookieAv = unparsedAttributes unparsedAttributes = '' } // Let the cookie-av string be the characters consumed in this step. let attributeName = '' let attributeValue = '' // 4. If the cookie-av string contains a %x3D ("=") character: if (cookieAv.includes('=')) { // 1. The (possibly empty) attribute-name string consists of the // characters up to, but not including, the first %x3D ("=") // character, and the (possibly empty) attribute-value string // consists of the characters after the first %x3D ("=") // character. const position = { position: 0 } attributeName = collectASequenceOfCodePointsFast( '=', cookieAv, position ) attributeValue = cookieAv.slice(position.position + 1) } else { // Otherwise: // 1. The attribute-name string consists of the entire cookie-av // string, and the attribute-value string is empty. attributeName = cookieAv } // 5. Remove any leading or trailing WSP characters from the attribute- // name string and the attribute-value string. attributeName = attributeName.trim() attributeValue = attributeValue.trim() // 6. If the attribute-value is longer than 1024 octets, ignore the // cookie-av string and return to Step 1 of this algorithm. if (attributeValue.length > maxAttributeValueSize) { return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) } // 7. Process the attribute-name and attribute-value according to the // requirements in the following subsections. (Notice that // attributes with unrecognized attribute-names are ignored.) const attributeNameLowercase = attributeName.toLowerCase() // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1 // If the attribute-name case-insensitively matches the string // "Expires", the user agent MUST process the cookie-av as follows. if (attributeNameLowercase === 'expires') { // 1. Let the expiry-time be the result of parsing the attribute-value // as cookie-date (see Section 5.1.1). const expiryTime = new Date(attributeValue) // 2. If the attribute-value failed to parse as a cookie date, ignore // the cookie-av. cookieAttributeList.expires = expiryTime } else if (attributeNameLowercase === 'max-age') { // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2 // If the attribute-name case-insensitively matches the string "Max- // Age", the user agent MUST process the cookie-av as follows. // 1. If the first character of the attribute-value is not a DIGIT or a // "-" character, ignore the cookie-av. const charCode = attributeValue.charCodeAt(0) if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') { return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) } // 2. If the remainder of attribute-value contains a non-DIGIT // character, ignore the cookie-av. if (!/^\d+$/.test(attributeValue)) { return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) } // 3. Let delta-seconds be the attribute-value converted to an integer. const deltaSeconds = Number(attributeValue) // 4. Let cookie-age-limit be the maximum age of the cookie (which // SHOULD be 400 days or less, see Section 4.1.2.2). // 5. Set delta-seconds to the smaller of its present value and cookie- // age-limit. // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs) // 6. If delta-seconds is less than or equal to zero (0), let expiry- // time be the earliest representable date and time. Otherwise, let // the expiry-time be the current date and time plus delta-seconds // seconds. // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds // 7. Append an attribute to the cookie-attribute-list with an // attribute-name of Max-Age and an attribute-value of expiry-time. cookieAttributeList.maxAge = deltaSeconds } else if (attributeNameLowercase === 'domain') { // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3 // If the attribute-name case-insensitively matches the string "Domain", // the user agent MUST process the cookie-av as follows. // 1. Let cookie-domain be the attribute-value. let cookieDomain = attributeValue // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be // cookie-domain without its leading %x2E ("."). if (cookieDomain[0] === '.') { cookieDomain = cookieDomain.slice(1) } // 3. Convert the cookie-domain to lower case. cookieDomain = cookieDomain.toLowerCase() // 4. Append an attribute to the cookie-attribute-list with an // attribute-name of Domain and an attribute-value of cookie-domain. cookieAttributeList.domain = cookieDomain } else if (attributeNameLowercase === 'path') { // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4 // If the attribute-name case-insensitively matches the string "Path", // the user agent MUST process the cookie-av as follows. // 1. If the attribute-value is empty or if the first character of the // attribute-value is not %x2F ("/"): let cookiePath = '' if (attributeValue.length === 0 || attributeValue[0] !== '/') { // 1. Let cookie-path be the default-path. cookiePath = '/' } else { // Otherwise: // 1. Let cookie-path be the attribute-value. cookiePath = attributeValue } // 2. Append an attribute to the cookie-attribute-list with an // attribute-name of Path and an attribute-value of cookie-path. cookieAttributeList.path = cookiePath } else if (attributeNameLowercase === 'secure') { // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5 // If the attribute-name case-insensitively matches the string "Secure", // the user agent MUST append an attribute to the cookie-attribute-list // with an attribute-name of Secure and an empty attribute-value. cookieAttributeList.secure = true } else if (attributeNameLowercase === 'httponly') { // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6 // If the attribute-name case-insensitively matches the string // "HttpOnly", the user agent MUST append an attribute to the cookie- // attribute-list with an attribute-name of HttpOnly and an empty // attribute-value. cookieAttributeList.httpOnly = true } else if (attributeNameLowercase === 'samesite') { // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7 // If the attribute-name case-insensitively matches the string // "SameSite", the user agent MUST process the cookie-av as follows: // 1. Let enforcement be "Default". let enforcement = 'Default' const attributeValueLowercase = attributeValue.toLowerCase() // 2. If cookie-av's attribute-value is a case-insensitive match for // "None", set enforcement to "None". if (attributeValueLowercase.includes('none')) { enforcement = 'None' } // 3. If cookie-av's attribute-value is a case-insensitive match for // "Strict", set enforcement to "Strict". if (attributeValueLowercase.includes('strict')) { enforcement = 'Strict' } // 4. If cookie-av's attribute-value is a case-insensitive match for // "Lax", set enforcement to "Lax". if (attributeValueLowercase.includes('lax')) { enforcement = 'Lax' } // 5. Append an attribute to the cookie-attribute-list with an // attribute-name of "SameSite" and an attribute-value of // enforcement. cookieAttributeList.sameSite = enforcement } else { cookieAttributeList.unparsed ??= [] cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`) } // 8. Return to Step 1 of this algorithm. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) } module.exports = { parseSetCookie, parseUnparsedAttributes } /***/ }), /***/ 3834: /***/ ((module) => { /** * @param {string} value * @returns {boolean} */ function isCTLExcludingHtab (value) { if (value.length === 0) { return false } for (const char of value) { const code = char.charCodeAt(0) if ( (code >= 0x00 || code <= 0x08) || (code >= 0x0A || code <= 0x1F) || code === 0x7F ) { return false } } } /** CHAR = token = 1* separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT * @param {string} name */ function validateCookieName (name) { for (const char of name) { const code = char.charCodeAt(0) if ( (code <= 0x20 || code > 0x7F) || char === '(' || char === ')' || char === '>' || char === '<' || char === '@' || char === ',' || char === ';' || char === ':' || char === '\\' || char === '"' || char === '/' || char === '[' || char === ']' || char === '?' || char === '=' || char === '{' || char === '}' ) { throw new Error('Invalid cookie name') } } } /** cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE ) cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E ; US-ASCII characters excluding CTLs, ; whitespace DQUOTE, comma, semicolon, ; and backslash * @param {string} value */ function validateCookieValue (value) { for (const char of value) { const code = char.charCodeAt(0) if ( code < 0x21 || // exclude CTLs (0-31) code === 0x22 || code === 0x2C || code === 0x3B || code === 0x5C || code > 0x7E // non-ascii ) { throw new Error('Invalid header value') } } } /** * path-value = * @param {string} path */ function validateCookiePath (path) { for (const char of path) { const code = char.charCodeAt(0) if (code < 0x21 || char === ';') { throw new Error('Invalid cookie path') } } } /** * I have no idea why these values aren't allowed to be honest, * but Deno tests these. - Khafra * @param {string} domain */ function validateCookieDomain (domain) { if ( domain.startsWith('-') || domain.endsWith('.') || domain.endsWith('-') ) { throw new Error('Invalid cookie domain') } } /** * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1 * @param {number|Date} date IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT ; fixed length/zone/capitalization subset of the format ; see Section 3.3 of [RFC5322] day-name = %x4D.6F.6E ; "Mon", case-sensitive / %x54.75.65 ; "Tue", case-sensitive / %x57.65.64 ; "Wed", case-sensitive / %x54.68.75 ; "Thu", case-sensitive / %x46.72.69 ; "Fri", case-sensitive / %x53.61.74 ; "Sat", case-sensitive / %x53.75.6E ; "Sun", case-sensitive date1 = day SP month SP year ; e.g., 02 Jun 1982 day = 2DIGIT month = %x4A.61.6E ; "Jan", case-sensitive / %x46.65.62 ; "Feb", case-sensitive / %x4D.61.72 ; "Mar", case-sensitive / %x41.70.72 ; "Apr", case-sensitive / %x4D.61.79 ; "May", case-sensitive / %x4A.75.6E ; "Jun", case-sensitive / %x4A.75.6C ; "Jul", case-sensitive / %x41.75.67 ; "Aug", case-sensitive / %x53.65.70 ; "Sep", case-sensitive / %x4F.63.74 ; "Oct", case-sensitive / %x4E.6F.76 ; "Nov", case-sensitive / %x44.65.63 ; "Dec", case-sensitive year = 4DIGIT GMT = %x47.4D.54 ; "GMT", case-sensitive time-of-day = hour ":" minute ":" second ; 00:00:00 - 23:59:60 (leap second) hour = 2DIGIT minute = 2DIGIT second = 2DIGIT */ function toIMFDate (date) { if (typeof date === 'number') { date = new Date(date) } const days = [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ] const months = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ] const dayName = days[date.getUTCDay()] const day = date.getUTCDate().toString().padStart(2, '0') const month = months[date.getUTCMonth()] const year = date.getUTCFullYear() const hour = date.getUTCHours().toString().padStart(2, '0') const minute = date.getUTCMinutes().toString().padStart(2, '0') const second = date.getUTCSeconds().toString().padStart(2, '0') return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT` } /** max-age-av = "Max-Age=" non-zero-digit *DIGIT ; In practice, both expires-av and max-age-av ; are limited to dates representable by the ; user agent. * @param {number} maxAge */ function validateCookieMaxAge (maxAge) { if (maxAge < 0) { throw new Error('Invalid cookie max-age') } } /** * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1 * @param {import('./index').Cookie} cookie */ function stringify (cookie) { if (cookie.name.length === 0) { return null } validateCookieName(cookie.name) validateCookieValue(cookie.value) const out = [`${cookie.name}=${cookie.value}`] // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1 // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2 if (cookie.name.startsWith('__Secure-')) { cookie.secure = true } if (cookie.name.startsWith('__Host-')) { cookie.secure = true cookie.domain = null cookie.path = '/' } if (cookie.secure) { out.push('Secure') } if (cookie.httpOnly) { out.push('HttpOnly') } if (typeof cookie.maxAge === 'number') { validateCookieMaxAge(cookie.maxAge) out.push(`Max-Age=${cookie.maxAge}`) } if (cookie.domain) { validateCookieDomain(cookie.domain) out.push(`Domain=${cookie.domain}`) } if (cookie.path) { validateCookiePath(cookie.path) out.push(`Path=${cookie.path}`) } if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') { out.push(`Expires=${toIMFDate(cookie.expires)}`) } if (cookie.sameSite) { out.push(`SameSite=${cookie.sameSite}`) } for (const part of cookie.unparsed) { if (!part.includes('=')) { throw new Error('Invalid unparsed') } const [key, ...value] = part.split('=') out.push(`${key.trim()}=${value.join('=')}`) } return out.join('; ') } module.exports = { isCTLExcludingHtab, validateCookieName, validateCookiePath, validateCookieValue, toIMFDate, stringify } /***/ }), /***/ 9136: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const net = __nccwpck_require__(9278) const assert = __nccwpck_require__(2613) const util = __nccwpck_require__(3440) const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(8707) let tls // include tls conditionally since it is not always available // TODO: session re-use does not wait for the first // connection to resolve the session and might therefore // resolve the same servername multiple times even when // re-use is enabled. let SessionCache // FIXME: remove workaround when the Node bug is fixed // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308 if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) { SessionCache = class WeakSessionCache { constructor (maxCachedSessions) { this._maxCachedSessions = maxCachedSessions this._sessionCache = new Map() this._sessionRegistry = new global.FinalizationRegistry((key) => { if (this._sessionCache.size < this._maxCachedSessions) { return } const ref = this._sessionCache.get(key) if (ref !== undefined && ref.deref() === undefined) { this._sessionCache.delete(key) } }) } get (sessionKey) { const ref = this._sessionCache.get(sessionKey) return ref ? ref.deref() : null } set (sessionKey, session) { if (this._maxCachedSessions === 0) { return } this._sessionCache.set(sessionKey, new WeakRef(session)) this._sessionRegistry.register(session, sessionKey) } } } else { SessionCache = class SimpleSessionCache { constructor (maxCachedSessions) { this._maxCachedSessions = maxCachedSessions this._sessionCache = new Map() } get (sessionKey) { return this._sessionCache.get(sessionKey) } set (sessionKey, session) { if (this._maxCachedSessions === 0) { return } if (this._sessionCache.size >= this._maxCachedSessions) { // remove the oldest session const { value: oldestKey } = this._sessionCache.keys().next() this._sessionCache.delete(oldestKey) } this._sessionCache.set(sessionKey, session) } } } function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) { if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) { throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero') } const options = { path: socketPath, ...opts } const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions) timeout = timeout == null ? 10e3 : timeout allowH2 = allowH2 != null ? allowH2 : false return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) { let socket if (protocol === 'https:') { if (!tls) { tls = __nccwpck_require__(4756) } servername = servername || options.servername || util.getServerName(host) || null const sessionKey = servername || hostname const session = sessionCache.get(sessionKey) || null assert(sessionKey) socket = tls.connect({ highWaterMark: 16384, // TLS in node can't have bigger HWM anyway... ...options, servername, session, localAddress, // TODO(HTTP/2): Add support for h2c ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'], socket: httpSocket, // upgrade socket connection port: port || 443, host: hostname }) socket .on('session', function (session) { // TODO (fix): Can a session become invalid once established? Don't think so? sessionCache.set(sessionKey, session) }) } else { assert(!httpSocket, 'httpSocket can only be sent on TLS update') socket = net.connect({ highWaterMark: 64 * 1024, // Same as nodejs fs streams. ...options, localAddress, port: port || 80, host: hostname }) } // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket if (options.keepAlive == null || options.keepAlive) { const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay socket.setKeepAlive(true, keepAliveInitialDelay) } const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout) socket .setNoDelay(true) .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () { cancelTimeout() if (callback) { const cb = callback callback = null cb(null, this) } }) .on('error', function (err) { cancelTimeout() if (callback) { const cb = callback callback = null cb(err) } }) return socket } } function setupTimeout (onConnectTimeout, timeout) { if (!timeout) { return () => {} } let s1 = null let s2 = null const timeoutId = setTimeout(() => { // setImmediate is added to make sure that we priotorise socket error events over timeouts s1 = setImmediate(() => { if (process.platform === 'win32') { // Windows needs an extra setImmediate probably due to implementation differences in the socket logic s2 = setImmediate(() => onConnectTimeout()) } else { onConnectTimeout() } }) }, timeout) return () => { clearTimeout(timeoutId) clearImmediate(s1) clearImmediate(s2) } } function onConnectTimeout (socket) { util.destroy(socket, new ConnectTimeoutError()) } module.exports = buildConnector /***/ }), /***/ 735: /***/ ((module) => { /** @type {Record} */ const headerNameLowerCasedRecord = {} // https://developer.mozilla.org/docs/Web/HTTP/Headers const wellknownHeaderNames = [ 'Accept', 'Accept-Encoding', 'Accept-Language', 'Accept-Ranges', 'Access-Control-Allow-Credentials', 'Access-Control-Allow-Headers', 'Access-Control-Allow-Methods', 'Access-Control-Allow-Origin', 'Access-Control-Expose-Headers', 'Access-Control-Max-Age', 'Access-Control-Request-Headers', 'Access-Control-Request-Method', 'Age', 'Allow', 'Alt-Svc', 'Alt-Used', 'Authorization', 'Cache-Control', 'Clear-Site-Data', 'Connection', 'Content-Disposition', 'Content-Encoding', 'Content-Language', 'Content-Length', 'Content-Location', 'Content-Range', 'Content-Security-Policy', 'Content-Security-Policy-Report-Only', 'Content-Type', 'Cookie', 'Cross-Origin-Embedder-Policy', 'Cross-Origin-Opener-Policy', 'Cross-Origin-Resource-Policy', 'Date', 'Device-Memory', 'Downlink', 'ECT', 'ETag', 'Expect', 'Expect-CT', 'Expires', 'Forwarded', 'From', 'Host', 'If-Match', 'If-Modified-Since', 'If-None-Match', 'If-Range', 'If-Unmodified-Since', 'Keep-Alive', 'Last-Modified', 'Link', 'Location', 'Max-Forwards', 'Origin', 'Permissions-Policy', 'Pragma', 'Proxy-Authenticate', 'Proxy-Authorization', 'RTT', 'Range', 'Referer', 'Referrer-Policy', 'Refresh', 'Retry-After', 'Sec-WebSocket-Accept', 'Sec-WebSocket-Extensions', 'Sec-WebSocket-Key', 'Sec-WebSocket-Protocol', 'Sec-WebSocket-Version', 'Server', 'Server-Timing', 'Service-Worker-Allowed', 'Service-Worker-Navigation-Preload', 'Set-Cookie', 'SourceMap', 'Strict-Transport-Security', 'Supports-Loading-Mode', 'TE', 'Timing-Allow-Origin', 'Trailer', 'Transfer-Encoding', 'Upgrade', 'Upgrade-Insecure-Requests', 'User-Agent', 'Vary', 'Via', 'WWW-Authenticate', 'X-Content-Type-Options', 'X-DNS-Prefetch-Control', 'X-Frame-Options', 'X-Permitted-Cross-Domain-Policies', 'X-Powered-By', 'X-Requested-With', 'X-XSS-Protection' ] for (let i = 0; i < wellknownHeaderNames.length; ++i) { const key = wellknownHeaderNames[i] const lowerCasedKey = key.toLowerCase() headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] = lowerCasedKey } // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`. Object.setPrototypeOf(headerNameLowerCasedRecord, null) module.exports = { wellknownHeaderNames, headerNameLowerCasedRecord } /***/ }), /***/ 8707: /***/ ((module) => { class UndiciError extends Error { constructor (message) { super(message) this.name = 'UndiciError' this.code = 'UND_ERR' } } class ConnectTimeoutError extends UndiciError { constructor (message) { super(message) Error.captureStackTrace(this, ConnectTimeoutError) this.name = 'ConnectTimeoutError' this.message = message || 'Connect Timeout Error' this.code = 'UND_ERR_CONNECT_TIMEOUT' } } class HeadersTimeoutError extends UndiciError { constructor (message) { super(message) Error.captureStackTrace(this, HeadersTimeoutError) this.name = 'HeadersTimeoutError' this.message = message || 'Headers Timeout Error' this.code = 'UND_ERR_HEADERS_TIMEOUT' } } class HeadersOverflowError extends UndiciError { constructor (message) { super(message) Error.captureStackTrace(this, HeadersOverflowError) this.name = 'HeadersOverflowError' this.message = message || 'Headers Overflow Error' this.code = 'UND_ERR_HEADERS_OVERFLOW' } } class BodyTimeoutError extends UndiciError { constructor (message) { super(message) Error.captureStackTrace(this, BodyTimeoutError) this.name = 'BodyTimeoutError' this.message = message || 'Body Timeout Error' this.code = 'UND_ERR_BODY_TIMEOUT' } } class ResponseStatusCodeError extends UndiciError { constructor (message, statusCode, headers, body) { super(message) Error.captureStackTrace(this, ResponseStatusCodeError) this.name = 'ResponseStatusCodeError' this.message = message || 'Response Status Code Error' this.code = 'UND_ERR_RESPONSE_STATUS_CODE' this.body = body this.status = statusCode this.statusCode = statusCode this.headers = headers } } class InvalidArgumentError extends UndiciError { constructor (message) { super(message) Error.captureStackTrace(this, InvalidArgumentError) this.name = 'InvalidArgumentError' this.message = message || 'Invalid Argument Error' this.code = 'UND_ERR_INVALID_ARG' } } class InvalidReturnValueError extends UndiciError { constructor (message) { super(message) Error.captureStackTrace(this, InvalidReturnValueError) this.name = 'InvalidReturnValueError' this.message = message || 'Invalid Return Value Error' this.code = 'UND_ERR_INVALID_RETURN_VALUE' } } class RequestAbortedError extends UndiciError { constructor (message) { super(message) Error.captureStackTrace(this, RequestAbortedError) this.name = 'AbortError' this.message = message || 'Request aborted' this.code = 'UND_ERR_ABORTED' } } class InformationalError extends UndiciError { constructor (message) { super(message) Error.captureStackTrace(this, InformationalError) this.name = 'InformationalError' this.message = message || 'Request information' this.code = 'UND_ERR_INFO' } } class RequestContentLengthMismatchError extends UndiciError { constructor (message) { super(message) Error.captureStackTrace(this, RequestContentLengthMismatchError) this.name = 'RequestContentLengthMismatchError' this.message = message || 'Request body length does not match content-length header' this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH' } } class ResponseContentLengthMismatchError extends UndiciError { constructor (message) { super(message) Error.captureStackTrace(this, ResponseContentLengthMismatchError) this.name = 'ResponseContentLengthMismatchError' this.message = message || 'Response body length does not match content-length header' this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH' } } class ClientDestroyedError extends UndiciError { constructor (message) { super(message) Error.captureStackTrace(this, ClientDestroyedError) this.name = 'ClientDestroyedError' this.message = message || 'The client is destroyed' this.code = 'UND_ERR_DESTROYED' } } class ClientClosedError extends UndiciError { constructor (message) { super(message) Error.captureStackTrace(this, ClientClosedError) this.name = 'ClientClosedError' this.message = message || 'The client is closed' this.code = 'UND_ERR_CLOSED' } } class SocketError extends UndiciError { constructor (message, socket) { super(message) Error.captureStackTrace(this, SocketError) this.name = 'SocketError' this.message = message || 'Socket error' this.code = 'UND_ERR_SOCKET' this.socket = socket } } class NotSupportedError extends UndiciError { constructor (message) { super(message) Error.captureStackTrace(this, NotSupportedError) this.name = 'NotSupportedError' this.message = message || 'Not supported error' this.code = 'UND_ERR_NOT_SUPPORTED' } } class BalancedPoolMissingUpstreamError extends UndiciError { constructor (message) { super(message) Error.captureStackTrace(this, NotSupportedError) this.name = 'MissingUpstreamError' this.message = message || 'No upstream has been added to the BalancedPool' this.code = 'UND_ERR_BPL_MISSING_UPSTREAM' } } class HTTPParserError extends Error { constructor (message, code, data) { super(message) Error.captureStackTrace(this, HTTPParserError) this.name = 'HTTPParserError' this.code = code ? `HPE_${code}` : undefined this.data = data ? data.toString() : undefined } } class ResponseExceededMaxSizeError extends UndiciError { constructor (message) { super(message) Error.captureStackTrace(this, ResponseExceededMaxSizeError) this.name = 'ResponseExceededMaxSizeError' this.message = message || 'Response content exceeded max size' this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE' } } class RequestRetryError extends UndiciError { constructor (message, code, { headers, data }) { super(message) Error.captureStackTrace(this, RequestRetryError) this.name = 'RequestRetryError' this.message = message || 'Request retry error' this.code = 'UND_ERR_REQ_RETRY' this.statusCode = code this.data = data this.headers = headers } } module.exports = { HTTPParserError, UndiciError, HeadersTimeoutError, HeadersOverflowError, BodyTimeoutError, RequestContentLengthMismatchError, ConnectTimeoutError, ResponseStatusCodeError, InvalidArgumentError, InvalidReturnValueError, RequestAbortedError, ClientDestroyedError, ClientClosedError, InformationalError, SocketError, NotSupportedError, ResponseContentLengthMismatchError, BalancedPoolMissingUpstreamError, ResponseExceededMaxSizeError, RequestRetryError } /***/ }), /***/ 4655: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { InvalidArgumentError, NotSupportedError } = __nccwpck_require__(8707) const assert = __nccwpck_require__(2613) const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(6443) const util = __nccwpck_require__(3440) // tokenRegExp and headerCharRegex have been lifted from // https://github.com/nodejs/node/blob/main/lib/_http_common.js /** * Verifies that the given val is a valid HTTP token * per the rules defined in RFC 7230 * See https://tools.ietf.org/html/rfc7230#section-3.2.6 */ const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/ /** * Matches if val contains an invalid field-vchar * field-value = *( field-content / obs-fold ) * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] * field-vchar = VCHAR / obs-text */ const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/ // Verifies that a given path is valid does not contain control chars \x00 to \x20 const invalidPathRegex = /[^\u0021-\u00ff]/ const kHandler = Symbol('handler') const channels = {} let extractBody try { const diagnosticsChannel = __nccwpck_require__(1637) channels.create = diagnosticsChannel.channel('undici:request:create') channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent') channels.headers = diagnosticsChannel.channel('undici:request:headers') channels.trailers = diagnosticsChannel.channel('undici:request:trailers') channels.error = diagnosticsChannel.channel('undici:request:error') } catch { channels.create = { hasSubscribers: false } channels.bodySent = { hasSubscribers: false } channels.headers = { hasSubscribers: false } channels.trailers = { hasSubscribers: false } channels.error = { hasSubscribers: false } } class Request { constructor (origin, { path, method, body, headers, query, idempotent, blocking, upgrade, headersTimeout, bodyTimeout, reset, throwOnError, expectContinue }, handler) { if (typeof path !== 'string') { throw new InvalidArgumentError('path must be a string') } else if ( path[0] !== '/' && !(path.startsWith('http://') || path.startsWith('https://')) && method !== 'CONNECT' ) { throw new InvalidArgumentError('path must be an absolute URL or start with a slash') } else if (invalidPathRegex.exec(path) !== null) { throw new InvalidArgumentError('invalid request path') } if (typeof method !== 'string') { throw new InvalidArgumentError('method must be a string') } else if (tokenRegExp.exec(method) === null) { throw new InvalidArgumentError('invalid request method') } if (upgrade && typeof upgrade !== 'string') { throw new InvalidArgumentError('upgrade must be a string') } if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) { throw new InvalidArgumentError('invalid headersTimeout') } if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) { throw new InvalidArgumentError('invalid bodyTimeout') } if (reset != null && typeof reset !== 'boolean') { throw new InvalidArgumentError('invalid reset') } if (expectContinue != null && typeof expectContinue !== 'boolean') { throw new InvalidArgumentError('invalid expectContinue') } this.headersTimeout = headersTimeout this.bodyTimeout = bodyTimeout this.throwOnError = throwOnError === true this.method = method this.abort = null if (body == null) { this.body = null } else if (util.isStream(body)) { this.body = body const rState = this.body._readableState if (!rState || !rState.autoDestroy) { this.endHandler = function autoDestroy () { util.destroy(this) } this.body.on('end', this.endHandler) } this.errorHandler = err => { if (this.abort) { this.abort(err) } else { this.error = err } } this.body.on('error', this.errorHandler) } else if (util.isBuffer(body)) { this.body = body.byteLength ? body : null } else if (ArrayBuffer.isView(body)) { this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null } else if (body instanceof ArrayBuffer) { this.body = body.byteLength ? Buffer.from(body) : null } else if (typeof body === 'string') { this.body = body.length ? Buffer.from(body) : null } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) { this.body = body } else { throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable') } this.completed = false this.aborted = false this.upgrade = upgrade || null this.path = query ? util.buildURL(path, query) : path this.origin = origin this.idempotent = idempotent == null ? method === 'HEAD' || method === 'GET' : idempotent this.blocking = blocking == null ? false : blocking this.reset = reset == null ? null : reset this.host = null this.contentLength = null this.contentType = null this.headers = '' // Only for H2 this.expectContinue = expectContinue != null ? expectContinue : false if (Array.isArray(headers)) { if (headers.length % 2 !== 0) { throw new InvalidArgumentError('headers array must be even') } for (let i = 0; i < headers.length; i += 2) { processHeader(this, headers[i], headers[i + 1]) } } else if (headers && typeof headers === 'object') { const keys = Object.keys(headers) for (let i = 0; i < keys.length; i++) { const key = keys[i] processHeader(this, key, headers[key]) } } else if (headers != null) { throw new InvalidArgumentError('headers must be an object or an array') } if (util.isFormDataLike(this.body)) { if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) { throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.') } if (!extractBody) { extractBody = (__nccwpck_require__(8923).extractBody) } const [bodyStream, contentType] = extractBody(body) if (this.contentType == null) { this.contentType = contentType this.headers += `content-type: ${contentType}\r\n` } this.body = bodyStream.stream this.contentLength = bodyStream.length } else if (util.isBlobLike(body) && this.contentType == null && body.type) { this.contentType = body.type this.headers += `content-type: ${body.type}\r\n` } util.validateHandler(handler, method, upgrade) this.servername = util.getServerName(this.host) this[kHandler] = handler if (channels.create.hasSubscribers) { channels.create.publish({ request: this }) } } onBodySent (chunk) { if (this[kHandler].onBodySent) { try { return this[kHandler].onBodySent(chunk) } catch (err) { this.abort(err) } } } onRequestSent () { if (channels.bodySent.hasSubscribers) { channels.bodySent.publish({ request: this }) } if (this[kHandler].onRequestSent) { try { return this[kHandler].onRequestSent() } catch (err) { this.abort(err) } } } onConnect (abort) { assert(!this.aborted) assert(!this.completed) if (this.error) { abort(this.error) } else { this.abort = abort return this[kHandler].onConnect(abort) } } onHeaders (statusCode, headers, resume, statusText) { assert(!this.aborted) assert(!this.completed) if (channels.headers.hasSubscribers) { channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }) } try { return this[kHandler].onHeaders(statusCode, headers, resume, statusText) } catch (err) { this.abort(err) } } onData (chunk) { assert(!this.aborted) assert(!this.completed) try { return this[kHandler].onData(chunk) } catch (err) { this.abort(err) return false } } onUpgrade (statusCode, headers, socket) { assert(!this.aborted) assert(!this.completed) return this[kHandler].onUpgrade(statusCode, headers, socket) } onComplete (trailers) { this.onFinally() assert(!this.aborted) this.completed = true if (channels.trailers.hasSubscribers) { channels.trailers.publish({ request: this, trailers }) } try { return this[kHandler].onComplete(trailers) } catch (err) { // TODO (fix): This might be a bad idea? this.onError(err) } } onError (error) { this.onFinally() if (channels.error.hasSubscribers) { channels.error.publish({ request: this, error }) } if (this.aborted) { return } this.aborted = true return this[kHandler].onError(error) } onFinally () { if (this.errorHandler) { this.body.off('error', this.errorHandler) this.errorHandler = null } if (this.endHandler) { this.body.off('end', this.endHandler) this.endHandler = null } } // TODO: adjust to support H2 addHeader (key, value) { processHeader(this, key, value) return this } static [kHTTP1BuildRequest] (origin, opts, handler) { // TODO: Migrate header parsing here, to make Requests // HTTP agnostic return new Request(origin, opts, handler) } static [kHTTP2BuildRequest] (origin, opts, handler) { const headers = opts.headers opts = { ...opts, headers: null } const request = new Request(origin, opts, handler) request.headers = {} if (Array.isArray(headers)) { if (headers.length % 2 !== 0) { throw new InvalidArgumentError('headers array must be even') } for (let i = 0; i < headers.length; i += 2) { processHeader(request, headers[i], headers[i + 1], true) } } else if (headers && typeof headers === 'object') { const keys = Object.keys(headers) for (let i = 0; i < keys.length; i++) { const key = keys[i] processHeader(request, key, headers[key], true) } } else if (headers != null) { throw new InvalidArgumentError('headers must be an object or an array') } return request } static [kHTTP2CopyHeaders] (raw) { const rawHeaders = raw.split('\r\n') const headers = {} for (const header of rawHeaders) { const [key, value] = header.split(': ') if (value == null || value.length === 0) continue if (headers[key]) headers[key] += `,${value}` else headers[key] = value } return headers } } function processHeaderValue (key, val, skipAppend) { if (val && typeof val === 'object') { throw new InvalidArgumentError(`invalid ${key} header`) } val = val != null ? `${val}` : '' if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`) } return skipAppend ? val : `${key}: ${val}\r\n` } function processHeader (request, key, val, skipAppend = false) { if (val && (typeof val === 'object' && !Array.isArray(val))) { throw new InvalidArgumentError(`invalid ${key} header`) } else if (val === undefined) { return } if ( request.host === null && key.length === 4 && key.toLowerCase() === 'host' ) { if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`) } // Consumed by Client request.host = val } else if ( request.contentLength === null && key.length === 14 && key.toLowerCase() === 'content-length' ) { request.contentLength = parseInt(val, 10) if (!Number.isFinite(request.contentLength)) { throw new InvalidArgumentError('invalid content-length header') } } else if ( request.contentType === null && key.length === 12 && key.toLowerCase() === 'content-type' ) { request.contentType = val if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend) else request.headers += processHeaderValue(key, val) } else if ( key.length === 17 && key.toLowerCase() === 'transfer-encoding' ) { throw new InvalidArgumentError('invalid transfer-encoding header') } else if ( key.length === 10 && key.toLowerCase() === 'connection' ) { const value = typeof val === 'string' ? val.toLowerCase() : null if (value !== 'close' && value !== 'keep-alive') { throw new InvalidArgumentError('invalid connection header') } else if (value === 'close') { request.reset = true } } else if ( key.length === 10 && key.toLowerCase() === 'keep-alive' ) { throw new InvalidArgumentError('invalid keep-alive header') } else if ( key.length === 7 && key.toLowerCase() === 'upgrade' ) { throw new InvalidArgumentError('invalid upgrade header') } else if ( key.length === 6 && key.toLowerCase() === 'expect' ) { throw new NotSupportedError('expect header not supported') } else if (tokenRegExp.exec(key) === null) { throw new InvalidArgumentError('invalid header key') } else { if (Array.isArray(val)) { for (let i = 0; i < val.length; i++) { if (skipAppend) { if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}` else request.headers[key] = processHeaderValue(key, val[i], skipAppend) } else { request.headers += processHeaderValue(key, val[i]) } } } else { if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend) else request.headers += processHeaderValue(key, val) } } } module.exports = Request /***/ }), /***/ 6443: /***/ ((module) => { module.exports = { kClose: Symbol('close'), kDestroy: Symbol('destroy'), kDispatch: Symbol('dispatch'), kUrl: Symbol('url'), kWriting: Symbol('writing'), kResuming: Symbol('resuming'), kQueue: Symbol('queue'), kConnect: Symbol('connect'), kConnecting: Symbol('connecting'), kHeadersList: Symbol('headers list'), kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'), kKeepAliveMaxTimeout: Symbol('max keep alive timeout'), kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'), kKeepAliveTimeoutValue: Symbol('keep alive timeout'), kKeepAlive: Symbol('keep alive'), kHeadersTimeout: Symbol('headers timeout'), kBodyTimeout: Symbol('body timeout'), kServerName: Symbol('server name'), kLocalAddress: Symbol('local address'), kHost: Symbol('host'), kNoRef: Symbol('no ref'), kBodyUsed: Symbol('used'), kRunning: Symbol('running'), kBlocking: Symbol('blocking'), kPending: Symbol('pending'), kSize: Symbol('size'), kBusy: Symbol('busy'), kQueued: Symbol('queued'), kFree: Symbol('free'), kConnected: Symbol('connected'), kClosed: Symbol('closed'), kNeedDrain: Symbol('need drain'), kReset: Symbol('reset'), kDestroyed: Symbol.for('nodejs.stream.destroyed'), kMaxHeadersSize: Symbol('max headers size'), kRunningIdx: Symbol('running index'), kPendingIdx: Symbol('pending index'), kError: Symbol('error'), kClients: Symbol('clients'), kClient: Symbol('client'), kParser: Symbol('parser'), kOnDestroyed: Symbol('destroy callbacks'), kPipelining: Symbol('pipelining'), kSocket: Symbol('socket'), kHostHeader: Symbol('host header'), kConnector: Symbol('connector'), kStrictContentLength: Symbol('strict content length'), kMaxRedirections: Symbol('maxRedirections'), kMaxRequests: Symbol('maxRequestsPerClient'), kProxy: Symbol('proxy agent options'), kCounter: Symbol('socket request counter'), kInterceptors: Symbol('dispatch interceptors'), kMaxResponseSize: Symbol('max response size'), kHTTP2Session: Symbol('http2Session'), kHTTP2SessionState: Symbol('http2Session state'), kHTTP2BuildRequest: Symbol('http2 build request'), kHTTP1BuildRequest: Symbol('http1 build request'), kHTTP2CopyHeaders: Symbol('http2 copy headers'), kHTTPConnVersion: Symbol('http connection version'), kRetryHandlerDefaultRetry: Symbol('retry agent default retry'), kConstruct: Symbol('constructable') } /***/ }), /***/ 3440: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const assert = __nccwpck_require__(2613) const { kDestroyed, kBodyUsed } = __nccwpck_require__(6443) const { IncomingMessage } = __nccwpck_require__(8611) const stream = __nccwpck_require__(2203) const net = __nccwpck_require__(9278) const { InvalidArgumentError } = __nccwpck_require__(8707) const { Blob } = __nccwpck_require__(181) const nodeUtil = __nccwpck_require__(9023) const { stringify } = __nccwpck_require__(3480) const { headerNameLowerCasedRecord } = __nccwpck_require__(735) const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v)) function nop () {} function isStream (obj) { return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function' } // based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License) function isBlobLike (object) { return (Blob && object instanceof Blob) || ( object && typeof object === 'object' && (typeof object.stream === 'function' || typeof object.arrayBuffer === 'function') && /^(Blob|File)$/.test(object[Symbol.toStringTag]) ) } function buildURL (url, queryParams) { if (url.includes('?') || url.includes('#')) { throw new Error('Query params cannot be passed when url already contains "?" or "#".') } const stringified = stringify(queryParams) if (stringified) { url += '?' + stringified } return url } function parseURL (url) { if (typeof url === 'string') { url = new URL(url) if (!/^https?:/.test(url.origin || url.protocol)) { throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.') } return url } if (!url || typeof url !== 'object') { throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.') } if (!/^https?:/.test(url.origin || url.protocol)) { throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.') } if (!(url instanceof URL)) { if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) { throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.') } if (url.path != null && typeof url.path !== 'string') { throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.') } if (url.pathname != null && typeof url.pathname !== 'string') { throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.') } if (url.hostname != null && typeof url.hostname !== 'string') { throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.') } if (url.origin != null && typeof url.origin !== 'string') { throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.') } const port = url.port != null ? url.port : (url.protocol === 'https:' ? 443 : 80) let origin = url.origin != null ? url.origin : `${url.protocol}//${url.hostname}:${port}` let path = url.path != null ? url.path : `${url.pathname || ''}${url.search || ''}` if (origin.endsWith('/')) { origin = origin.substring(0, origin.length - 1) } if (path && !path.startsWith('/')) { path = `/${path}` } // new URL(path, origin) is unsafe when `path` contains an absolute URL // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL: // If first parameter is a relative URL, second param is required, and will be used as the base URL. // If first parameter is an absolute URL, a given second param will be ignored. url = new URL(origin + path) } return url } function parseOrigin (url) { url = parseURL(url) if (url.pathname !== '/' || url.search || url.hash) { throw new InvalidArgumentError('invalid url') } return url } function getHostname (host) { if (host[0] === '[') { const idx = host.indexOf(']') assert(idx !== -1) return host.substring(1, idx) } const idx = host.indexOf(':') if (idx === -1) return host return host.substring(0, idx) } // IP addresses are not valid server names per RFC6066 // > Currently, the only server names supported are DNS hostnames function getServerName (host) { if (!host) { return null } assert.strictEqual(typeof host, 'string') const servername = getHostname(host) if (net.isIP(servername)) { return '' } return servername } function deepClone (obj) { return JSON.parse(JSON.stringify(obj)) } function isAsyncIterable (obj) { return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function') } function isIterable (obj) { return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function')) } function bodyLength (body) { if (body == null) { return 0 } else if (isStream(body)) { const state = body._readableState return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length) ? state.length : null } else if (isBlobLike(body)) { return body.size != null ? body.size : null } else if (isBuffer(body)) { return body.byteLength } return null } function isDestroyed (stream) { return !stream || !!(stream.destroyed || stream[kDestroyed]) } function isReadableAborted (stream) { const state = stream && stream._readableState return isDestroyed(stream) && state && !state.endEmitted } function destroy (stream, err) { if (stream == null || !isStream(stream) || isDestroyed(stream)) { return } if (typeof stream.destroy === 'function') { if (Object.getPrototypeOf(stream).constructor === IncomingMessage) { // See: https://github.com/nodejs/node/pull/38505/files stream.socket = null } stream.destroy(err) } else if (err) { process.nextTick((stream, err) => { stream.emit('error', err) }, stream, err) } if (stream.destroyed !== true) { stream[kDestroyed] = true } } const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/ function parseKeepAliveTimeout (val) { const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR) return m ? parseInt(m[1], 10) * 1000 : null } /** * Retrieves a header name and returns its lowercase value. * @param {string | Buffer} value Header name * @returns {string} */ function headerNameToString (value) { return headerNameLowerCasedRecord[value] || value.toLowerCase() } function parseHeaders (headers, obj = {}) { // For H2 support if (!Array.isArray(headers)) return headers for (let i = 0; i < headers.length; i += 2) { const key = headers[i].toString().toLowerCase() let val = obj[key] if (!val) { if (Array.isArray(headers[i + 1])) { obj[key] = headers[i + 1].map(x => x.toString('utf8')) } else { obj[key] = headers[i + 1].toString('utf8') } } else { if (!Array.isArray(val)) { val = [val] obj[key] = val } val.push(headers[i + 1].toString('utf8')) } } // See https://github.com/nodejs/node/pull/46528 if ('content-length' in obj && 'content-disposition' in obj) { obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1') } return obj } function parseRawHeaders (headers) { const ret = [] let hasContentLength = false let contentDispositionIdx = -1 for (let n = 0; n < headers.length; n += 2) { const key = headers[n + 0].toString() const val = headers[n + 1].toString('utf8') if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) { ret.push(key, val) hasContentLength = true } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) { contentDispositionIdx = ret.push(key, val) - 1 } else { ret.push(key, val) } } // See https://github.com/nodejs/node/pull/46528 if (hasContentLength && contentDispositionIdx !== -1) { ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1') } return ret } function isBuffer (buffer) { // See, https://github.com/mcollina/undici/pull/319 return buffer instanceof Uint8Array || Buffer.isBuffer(buffer) } function validateHandler (handler, method, upgrade) { if (!handler || typeof handler !== 'object') { throw new InvalidArgumentError('handler must be an object') } if (typeof handler.onConnect !== 'function') { throw new InvalidArgumentError('invalid onConnect method') } if (typeof handler.onError !== 'function') { throw new InvalidArgumentError('invalid onError method') } if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) { throw new InvalidArgumentError('invalid onBodySent method') } if (upgrade || method === 'CONNECT') { if (typeof handler.onUpgrade !== 'function') { throw new InvalidArgumentError('invalid onUpgrade method') } } else { if (typeof handler.onHeaders !== 'function') { throw new InvalidArgumentError('invalid onHeaders method') } if (typeof handler.onData !== 'function') { throw new InvalidArgumentError('invalid onData method') } if (typeof handler.onComplete !== 'function') { throw new InvalidArgumentError('invalid onComplete method') } } } // A body is disturbed if it has been read from and it cannot // be re-used without losing state or data. function isDisturbed (body) { return !!(body && ( stream.isDisturbed ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed? : body[kBodyUsed] || body.readableDidRead || (body._readableState && body._readableState.dataEmitted) || isReadableAborted(body) )) } function isErrored (body) { return !!(body && ( stream.isErrored ? stream.isErrored(body) : /state: 'errored'/.test(nodeUtil.inspect(body) ))) } function isReadable (body) { return !!(body && ( stream.isReadable ? stream.isReadable(body) : /state: 'readable'/.test(nodeUtil.inspect(body) ))) } function getSocketInfo (socket) { return { localAddress: socket.localAddress, localPort: socket.localPort, remoteAddress: socket.remoteAddress, remotePort: socket.remotePort, remoteFamily: socket.remoteFamily, timeout: socket.timeout, bytesWritten: socket.bytesWritten, bytesRead: socket.bytesRead } } async function * convertIterableToBuffer (iterable) { for await (const chunk of iterable) { yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk) } } let ReadableStream function ReadableStreamFrom (iterable) { if (!ReadableStream) { ReadableStream = (__nccwpck_require__(3774).ReadableStream) } if (ReadableStream.from) { return ReadableStream.from(convertIterableToBuffer(iterable)) } let iterator return new ReadableStream( { async start () { iterator = iterable[Symbol.asyncIterator]() }, async pull (controller) { const { done, value } = await iterator.next() if (done) { queueMicrotask(() => { controller.close() }) } else { const buf = Buffer.isBuffer(value) ? value : Buffer.from(value) controller.enqueue(new Uint8Array(buf)) } return controller.desiredSize > 0 }, async cancel (reason) { await iterator.return() } }, 0 ) } // The chunk should be a FormData instance and contains // all the required methods. function isFormDataLike (object) { return ( object && typeof object === 'object' && typeof object.append === 'function' && typeof object.delete === 'function' && typeof object.get === 'function' && typeof object.getAll === 'function' && typeof object.has === 'function' && typeof object.set === 'function' && object[Symbol.toStringTag] === 'FormData' ) } function throwIfAborted (signal) { if (!signal) { return } if (typeof signal.throwIfAborted === 'function') { signal.throwIfAborted() } else { if (signal.aborted) { // DOMException not available < v17.0.0 const err = new Error('The operation was aborted') err.name = 'AbortError' throw err } } } function addAbortListener (signal, listener) { if ('addEventListener' in signal) { signal.addEventListener('abort', listener, { once: true }) return () => signal.removeEventListener('abort', listener) } signal.addListener('abort', listener) return () => signal.removeListener('abort', listener) } const hasToWellFormed = !!String.prototype.toWellFormed /** * @param {string} val */ function toUSVString (val) { if (hasToWellFormed) { return `${val}`.toWellFormed() } else if (nodeUtil.toUSVString) { return nodeUtil.toUSVString(val) } return `${val}` } // Parsed accordingly to RFC 9110 // https://www.rfc-editor.org/rfc/rfc9110#field.content-range function parseRangeHeader (range) { if (range == null || range === '') return { start: 0, end: null, size: null } const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null return m ? { start: parseInt(m[1]), end: m[2] ? parseInt(m[2]) : null, size: m[3] ? parseInt(m[3]) : null } : null } const kEnumerableProperty = Object.create(null) kEnumerableProperty.enumerable = true module.exports = { kEnumerableProperty, nop, isDisturbed, isErrored, isReadable, toUSVString, isReadableAborted, isBlobLike, parseOrigin, parseURL, getServerName, isStream, isIterable, isAsyncIterable, isDestroyed, headerNameToString, parseRawHeaders, parseHeaders, parseKeepAliveTimeout, destroy, bodyLength, deepClone, ReadableStreamFrom, isBuffer, validateHandler, getSocketInfo, isFormDataLike, buildURL, throwIfAborted, addAbortListener, parseRangeHeader, nodeMajor, nodeMinor, nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13), safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE'] } /***/ }), /***/ 1: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const Dispatcher = __nccwpck_require__(992) const { ClientDestroyedError, ClientClosedError, InvalidArgumentError } = __nccwpck_require__(8707) const { kDestroy, kClose, kDispatch, kInterceptors } = __nccwpck_require__(6443) const kDestroyed = Symbol('destroyed') const kClosed = Symbol('closed') const kOnDestroyed = Symbol('onDestroyed') const kOnClosed = Symbol('onClosed') const kInterceptedDispatch = Symbol('Intercepted Dispatch') class DispatcherBase extends Dispatcher { constructor () { super() this[kDestroyed] = false this[kOnDestroyed] = null this[kClosed] = false this[kOnClosed] = [] } get destroyed () { return this[kDestroyed] } get closed () { return this[kClosed] } get interceptors () { return this[kInterceptors] } set interceptors (newInterceptors) { if (newInterceptors) { for (let i = newInterceptors.length - 1; i >= 0; i--) { const interceptor = this[kInterceptors][i] if (typeof interceptor !== 'function') { throw new InvalidArgumentError('interceptor must be an function') } } } this[kInterceptors] = newInterceptors } close (callback) { if (callback === undefined) { return new Promise((resolve, reject) => { this.close((err, data) => { return err ? reject(err) : resolve(data) }) }) } if (typeof callback !== 'function') { throw new InvalidArgumentError('invalid callback') } if (this[kDestroyed]) { queueMicrotask(() => callback(new ClientDestroyedError(), null)) return } if (this[kClosed]) { if (this[kOnClosed]) { this[kOnClosed].push(callback) } else { queueMicrotask(() => callback(null, null)) } return } this[kClosed] = true this[kOnClosed].push(callback) const onClosed = () => { const callbacks = this[kOnClosed] this[kOnClosed] = null for (let i = 0; i < callbacks.length; i++) { callbacks[i](null, null) } } // Should not error. this[kClose]() .then(() => this.destroy()) .then(() => { queueMicrotask(onClosed) }) } destroy (err, callback) { if (typeof err === 'function') { callback = err err = null } if (callback === undefined) { return new Promise((resolve, reject) => { this.destroy(err, (err, data) => { return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data) }) }) } if (typeof callback !== 'function') { throw new InvalidArgumentError('invalid callback') } if (this[kDestroyed]) { if (this[kOnDestroyed]) { this[kOnDestroyed].push(callback) } else { queueMicrotask(() => callback(null, null)) } return } if (!err) { err = new ClientDestroyedError() } this[kDestroyed] = true this[kOnDestroyed] = this[kOnDestroyed] || [] this[kOnDestroyed].push(callback) const onDestroyed = () => { const callbacks = this[kOnDestroyed] this[kOnDestroyed] = null for (let i = 0; i < callbacks.length; i++) { callbacks[i](null, null) } } // Should not error. this[kDestroy](err).then(() => { queueMicrotask(onDestroyed) }) } [kInterceptedDispatch] (opts, handler) { if (!this[kInterceptors] || this[kInterceptors].length === 0) { this[kInterceptedDispatch] = this[kDispatch] return this[kDispatch](opts, handler) } let dispatch = this[kDispatch].bind(this) for (let i = this[kInterceptors].length - 1; i >= 0; i--) { dispatch = this[kInterceptors][i](dispatch) } this[kInterceptedDispatch] = dispatch return dispatch(opts, handler) } dispatch (opts, handler) { if (!handler || typeof handler !== 'object') { throw new InvalidArgumentError('handler must be an object') } try { if (!opts || typeof opts !== 'object') { throw new InvalidArgumentError('opts must be an object.') } if (this[kDestroyed] || this[kOnDestroyed]) { throw new ClientDestroyedError() } if (this[kClosed]) { throw new ClientClosedError() } return this[kInterceptedDispatch](opts, handler) } catch (err) { if (typeof handler.onError !== 'function') { throw new InvalidArgumentError('invalid onError method') } handler.onError(err) return false } } } module.exports = DispatcherBase /***/ }), /***/ 992: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const EventEmitter = __nccwpck_require__(4434) class Dispatcher extends EventEmitter { dispatch () { throw new Error('not implemented') } close () { throw new Error('not implemented') } destroy () { throw new Error('not implemented') } } module.exports = Dispatcher /***/ }), /***/ 8923: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const Busboy = __nccwpck_require__(9581) const util = __nccwpck_require__(3440) const { ReadableStreamFrom, isBlobLike, isReadableStreamLike, readableStreamClose, createDeferredPromise, fullyReadBody } = __nccwpck_require__(5523) const { FormData } = __nccwpck_require__(3073) const { kState } = __nccwpck_require__(9710) const { webidl } = __nccwpck_require__(4222) const { DOMException, structuredClone } = __nccwpck_require__(7326) const { Blob, File: NativeFile } = __nccwpck_require__(181) const { kBodyUsed } = __nccwpck_require__(6443) const assert = __nccwpck_require__(2613) const { isErrored } = __nccwpck_require__(3440) const { isUint8Array, isArrayBuffer } = __nccwpck_require__(8253) const { File: UndiciFile } = __nccwpck_require__(3041) const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(4322) let random try { const crypto = __nccwpck_require__(7598) random = (max) => crypto.randomInt(0, max) } catch { random = (max) => Math.floor(Math.random(max)) } let ReadableStream = globalThis.ReadableStream /** @type {globalThis['File']} */ const File = NativeFile ?? UndiciFile const textEncoder = new TextEncoder() const textDecoder = new TextDecoder() // https://fetch.spec.whatwg.org/#concept-bodyinit-extract function extractBody (object, keepalive = false) { if (!ReadableStream) { ReadableStream = (__nccwpck_require__(3774).ReadableStream) } // 1. Let stream be null. let stream = null // 2. If object is a ReadableStream object, then set stream to object. if (object instanceof ReadableStream) { stream = object } else if (isBlobLike(object)) { // 3. Otherwise, if object is a Blob object, set stream to the // result of running object’s get stream. stream = object.stream() } else { // 4. Otherwise, set stream to a new ReadableStream object, and set // up stream. stream = new ReadableStream({ async pull (controller) { controller.enqueue( typeof source === 'string' ? textEncoder.encode(source) : source ) queueMicrotask(() => readableStreamClose(controller)) }, start () {}, type: undefined }) } // 5. Assert: stream is a ReadableStream object. assert(isReadableStreamLike(stream)) // 6. Let action be null. let action = null // 7. Let source be null. let source = null // 8. Let length be null. let length = null // 9. Let type be null. let type = null // 10. Switch on object: if (typeof object === 'string') { // Set source to the UTF-8 encoding of object. // Note: setting source to a Uint8Array here breaks some mocking assumptions. source = object // Set type to `text/plain;charset=UTF-8`. type = 'text/plain;charset=UTF-8' } else if (object instanceof URLSearchParams) { // URLSearchParams // spec says to run application/x-www-form-urlencoded on body.list // this is implemented in Node.js as apart of an URLSearchParams instance toString method // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490 // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100 // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list. source = object.toString() // Set type to `application/x-www-form-urlencoded;charset=UTF-8`. type = 'application/x-www-form-urlencoded;charset=UTF-8' } else if (isArrayBuffer(object)) { // BufferSource/ArrayBuffer // Set source to a copy of the bytes held by object. source = new Uint8Array(object.slice()) } else if (ArrayBuffer.isView(object)) { // BufferSource/ArrayBufferView // Set source to a copy of the bytes held by object. source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength)) } else if (util.isFormDataLike(object)) { const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}` const prefix = `--${boundary}\r\nContent-Disposition: form-data` /*! formdata-polyfill. MIT License. Jimmy Wärting */ const escape = (str) => str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22') const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, '\r\n') // Set action to this step: run the multipart/form-data // encoding algorithm, with object’s entry list and UTF-8. // - This ensures that the body is immutable and can't be changed afterwords // - That the content-length is calculated in advance. // - And that all parts are pre-encoded and ready to be sent. const blobParts = [] const rn = new Uint8Array([13, 10]) // '\r\n' length = 0 let hasUnknownSizeValue = false for (const [name, value] of object) { if (typeof value === 'string') { const chunk = textEncoder.encode(prefix + `; name="${escape(normalizeLinefeeds(name))}"` + `\r\n\r\n${normalizeLinefeeds(value)}\r\n`) blobParts.push(chunk) length += chunk.byteLength } else { const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` + (value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' + `Content-Type: ${ value.type || 'application/octet-stream' }\r\n\r\n`) blobParts.push(chunk, value, rn) if (typeof value.size === 'number') { length += chunk.byteLength + value.size + rn.byteLength } else { hasUnknownSizeValue = true } } } const chunk = textEncoder.encode(`--${boundary}--`) blobParts.push(chunk) length += chunk.byteLength if (hasUnknownSizeValue) { length = null } // Set source to object. source = object action = async function * () { for (const part of blobParts) { if (part.stream) { yield * part.stream() } else { yield part } } } // Set type to `multipart/form-data; boundary=`, // followed by the multipart/form-data boundary string generated // by the multipart/form-data encoding algorithm. type = 'multipart/form-data; boundary=' + boundary } else if (isBlobLike(object)) { // Blob // Set source to object. source = object // Set length to object’s size. length = object.size // If object’s type attribute is not the empty byte sequence, set // type to its value. if (object.type) { type = object.type } } else if (typeof object[Symbol.asyncIterator] === 'function') { // If keepalive is true, then throw a TypeError. if (keepalive) { throw new TypeError('keepalive') } // If object is disturbed or locked, then throw a TypeError. if (util.isDisturbed(object) || object.locked) { throw new TypeError( 'Response body object should not be disturbed or locked' ) } stream = object instanceof ReadableStream ? object : ReadableStreamFrom(object) } // 11. If source is a byte sequence, then set action to a // step that returns source and length to source’s length. if (typeof source === 'string' || util.isBuffer(source)) { length = Buffer.byteLength(source) } // 12. If action is non-null, then run these steps in in parallel: if (action != null) { // Run action. let iterator stream = new ReadableStream({ async start () { iterator = action(object)[Symbol.asyncIterator]() }, async pull (controller) { const { value, done } = await iterator.next() if (done) { // When running action is done, close stream. queueMicrotask(() => { controller.close() }) } else { // Whenever one or more bytes are available and stream is not errored, // enqueue a Uint8Array wrapping an ArrayBuffer containing the available // bytes into stream. if (!isErrored(stream)) { controller.enqueue(new Uint8Array(value)) } } return controller.desiredSize > 0 }, async cancel (reason) { await iterator.return() }, type: undefined }) } // 13. Let body be a body whose stream is stream, source is source, // and length is length. const body = { stream, source, length } // 14. Return (body, type). return [body, type] } // https://fetch.spec.whatwg.org/#bodyinit-safely-extract function safelyExtractBody (object, keepalive = false) { if (!ReadableStream) { // istanbul ignore next ReadableStream = (__nccwpck_require__(3774).ReadableStream) } // To safely extract a body and a `Content-Type` value from // a byte sequence or BodyInit object object, run these steps: // 1. If object is a ReadableStream object, then: if (object instanceof ReadableStream) { // Assert: object is neither disturbed nor locked. // istanbul ignore next assert(!util.isDisturbed(object), 'The body has already been consumed.') // istanbul ignore next assert(!object.locked, 'The stream is locked.') } // 2. Return the results of extracting object. return extractBody(object, keepalive) } function cloneBody (body) { // To clone a body body, run these steps: // https://fetch.spec.whatwg.org/#concept-body-clone // 1. Let « out1, out2 » be the result of teeing body’s stream. const [out1, out2] = body.stream.tee() const out2Clone = structuredClone(out2, { transfer: [out2] }) // This, for whatever reasons, unrefs out2Clone which allows // the process to exit by itself. const [, finalClone] = out2Clone.tee() // 2. Set body’s stream to out1. body.stream = out1 // 3. Return a body whose stream is out2 and other members are copied from body. return { stream: finalClone, length: body.length, source: body.source } } async function * consumeBody (body) { if (body) { if (isUint8Array(body)) { yield body } else { const stream = body.stream if (util.isDisturbed(stream)) { throw new TypeError('The body has already been consumed.') } if (stream.locked) { throw new TypeError('The stream is locked.') } // Compat. stream[kBodyUsed] = true yield * stream } } } function throwIfAborted (state) { if (state.aborted) { throw new DOMException('The operation was aborted.', 'AbortError') } } function bodyMixinMethods (instance) { const methods = { blob () { // The blob() method steps are to return the result of // running consume body with this and the following step // given a byte sequence bytes: return a Blob whose // contents are bytes and whose type attribute is this’s // MIME type. return specConsumeBody(this, (bytes) => { let mimeType = bodyMimeType(this) if (mimeType === 'failure') { mimeType = '' } else if (mimeType) { mimeType = serializeAMimeType(mimeType) } // Return a Blob whose contents are bytes and type attribute // is mimeType. return new Blob([bytes], { type: mimeType }) }, instance) }, arrayBuffer () { // The arrayBuffer() method steps are to return the result // of running consume body with this and the following step // given a byte sequence bytes: return a new ArrayBuffer // whose contents are bytes. return specConsumeBody(this, (bytes) => { return new Uint8Array(bytes).buffer }, instance) }, text () { // The text() method steps are to return the result of running // consume body with this and UTF-8 decode. return specConsumeBody(this, utf8DecodeBytes, instance) }, json () { // The json() method steps are to return the result of running // consume body with this and parse JSON from bytes. return specConsumeBody(this, parseJSONFromBytes, instance) }, async formData () { webidl.brandCheck(this, instance) throwIfAborted(this[kState]) const contentType = this.headers.get('Content-Type') // If mimeType’s essence is "multipart/form-data", then: if (/multipart\/form-data/.test(contentType)) { const headers = {} for (const [key, value] of this.headers) headers[key.toLowerCase()] = value const responseFormData = new FormData() let busboy try { busboy = new Busboy({ headers, preservePath: true }) } catch (err) { throw new DOMException(`${err}`, 'AbortError') } busboy.on('field', (name, value) => { responseFormData.append(name, value) }) busboy.on('file', (name, value, filename, encoding, mimeType) => { const chunks = [] if (encoding === 'base64' || encoding.toLowerCase() === 'base64') { let base64chunk = '' value.on('data', (chunk) => { base64chunk += chunk.toString().replace(/[\r\n]/gm, '') const end = base64chunk.length - base64chunk.length % 4 chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64')) base64chunk = base64chunk.slice(end) }) value.on('end', () => { chunks.push(Buffer.from(base64chunk, 'base64')) responseFormData.append(name, new File(chunks, filename, { type: mimeType })) }) } else { value.on('data', (chunk) => { chunks.push(chunk) }) value.on('end', () => { responseFormData.append(name, new File(chunks, filename, { type: mimeType })) }) } }) const busboyResolve = new Promise((resolve, reject) => { busboy.on('finish', resolve) busboy.on('error', (err) => reject(new TypeError(err))) }) if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk) busboy.end() await busboyResolve return responseFormData } else if (/application\/x-www-form-urlencoded/.test(contentType)) { // Otherwise, if mimeType’s essence is "application/x-www-form-urlencoded", then: // 1. Let entries be the result of parsing bytes. let entries try { let text = '' // application/x-www-form-urlencoded parser will keep the BOM. // https://url.spec.whatwg.org/#concept-urlencoded-parser // Note that streaming decoder is stateful and cannot be reused const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true }) for await (const chunk of consumeBody(this[kState].body)) { if (!isUint8Array(chunk)) { throw new TypeError('Expected Uint8Array chunk') } text += streamingDecoder.decode(chunk, { stream: true }) } text += streamingDecoder.decode() entries = new URLSearchParams(text) } catch (err) { // istanbul ignore next: Unclear when new URLSearchParams can fail on a string. // 2. If entries is failure, then throw a TypeError. throw Object.assign(new TypeError(), { cause: err }) } // 3. Return a new FormData object whose entries are entries. const formData = new FormData() for (const [name, value] of entries) { formData.append(name, value) } return formData } else { // Wait a tick before checking if the request has been aborted. // Otherwise, a TypeError can be thrown when an AbortError should. await Promise.resolve() throwIfAborted(this[kState]) // Otherwise, throw a TypeError. throw webidl.errors.exception({ header: `${instance.name}.formData`, message: 'Could not parse content as FormData.' }) } } } return methods } function mixinBody (prototype) { Object.assign(prototype.prototype, bodyMixinMethods(prototype)) } /** * @see https://fetch.spec.whatwg.org/#concept-body-consume-body * @param {Response|Request} object * @param {(value: unknown) => unknown} convertBytesToJSValue * @param {Response|Request} instance */ async function specConsumeBody (object, convertBytesToJSValue, instance) { webidl.brandCheck(object, instance) throwIfAborted(object[kState]) // 1. If object is unusable, then return a promise rejected // with a TypeError. if (bodyUnusable(object[kState].body)) { throw new TypeError('Body is unusable') } // 2. Let promise be a new promise. const promise = createDeferredPromise() // 3. Let errorSteps given error be to reject promise with error. const errorSteps = (error) => promise.reject(error) // 4. Let successSteps given a byte sequence data be to resolve // promise with the result of running convertBytesToJSValue // with data. If that threw an exception, then run errorSteps // with that exception. const successSteps = (data) => { try { promise.resolve(convertBytesToJSValue(data)) } catch (e) { errorSteps(e) } } // 5. If object’s body is null, then run successSteps with an // empty byte sequence. if (object[kState].body == null) { successSteps(new Uint8Array()) return promise.promise } // 6. Otherwise, fully read object’s body given successSteps, // errorSteps, and object’s relevant global object. await fullyReadBody(object[kState].body, successSteps, errorSteps) // 7. Return promise. return promise.promise } // https://fetch.spec.whatwg.org/#body-unusable function bodyUnusable (body) { // An object including the Body interface mixin is // said to be unusable if its body is non-null and // its body’s stream is disturbed or locked. return body != null && (body.stream.locked || util.isDisturbed(body.stream)) } /** * @see https://encoding.spec.whatwg.org/#utf-8-decode * @param {Buffer} buffer */ function utf8DecodeBytes (buffer) { if (buffer.length === 0) { return '' } // 1. Let buffer be the result of peeking three bytes from // ioQueue, converted to a byte sequence. // 2. If buffer is 0xEF 0xBB 0xBF, then read three // bytes from ioQueue. (Do nothing with those bytes.) if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) { buffer = buffer.subarray(3) } // 3. Process a queue with an instance of UTF-8’s // decoder, ioQueue, output, and "replacement". const output = textDecoder.decode(buffer) // 4. Return output. return output } /** * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value * @param {Uint8Array} bytes */ function parseJSONFromBytes (bytes) { return JSON.parse(utf8DecodeBytes(bytes)) } /** * @see https://fetch.spec.whatwg.org/#concept-body-mime-type * @param {import('./response').Response|import('./request').Request} object */ function bodyMimeType (object) { const { headersList } = object[kState] const contentType = headersList.get('content-type') if (contentType === null) { return 'failure' } return parseMIMEType(contentType) } module.exports = { extractBody, safelyExtractBody, cloneBody, mixinBody } /***/ }), /***/ 7326: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(8167) const corsSafeListedMethods = ['GET', 'HEAD', 'POST'] const corsSafeListedMethodsSet = new Set(corsSafeListedMethods) const nullBodyStatus = [101, 204, 205, 304] const redirectStatus = [301, 302, 303, 307, 308] const redirectStatusSet = new Set(redirectStatus) // https://fetch.spec.whatwg.org/#block-bad-port const badPorts = [ '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79', '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137', '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532', '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723', '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697', '10080' ] const badPortsSet = new Set(badPorts) // https://w3c.github.io/webappsec-referrer-policy/#referrer-policies const referrerPolicy = [ '', 'no-referrer', 'no-referrer-when-downgrade', 'same-origin', 'origin', 'strict-origin', 'origin-when-cross-origin', 'strict-origin-when-cross-origin', 'unsafe-url' ] const referrerPolicySet = new Set(referrerPolicy) const requestRedirect = ['follow', 'manual', 'error'] const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE'] const safeMethodsSet = new Set(safeMethods) const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors'] const requestCredentials = ['omit', 'same-origin', 'include'] const requestCache = [ 'default', 'no-store', 'reload', 'no-cache', 'force-cache', 'only-if-cached' ] // https://fetch.spec.whatwg.org/#request-body-header-name const requestBodyHeader = [ 'content-encoding', 'content-language', 'content-location', 'content-type', // See https://github.com/nodejs/undici/issues/2021 // 'Content-Length' is a forbidden header name, which is typically // removed in the Headers implementation. However, undici doesn't // filter out headers, so we add it here. 'content-length' ] // https://fetch.spec.whatwg.org/#enumdef-requestduplex const requestDuplex = [ 'half' ] // http://fetch.spec.whatwg.org/#forbidden-method const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK'] const forbiddenMethodsSet = new Set(forbiddenMethods) const subresource = [ 'audio', 'audioworklet', 'font', 'image', 'manifest', 'paintworklet', 'script', 'style', 'track', 'video', 'xslt', '' ] const subresourceSet = new Set(subresource) /** @type {globalThis['DOMException']} */ const DOMException = globalThis.DOMException ?? (() => { // DOMException was only made a global in Node v17.0.0, // but fetch supports >= v16.8. try { atob('~') } catch (err) { return Object.getPrototypeOf(err).constructor } })() let channel /** @type {globalThis['structuredClone']} */ const structuredClone = globalThis.structuredClone ?? // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js // structuredClone was added in v17.0.0, but fetch supports v16.8 function structuredClone (value, options = undefined) { if (arguments.length === 0) { throw new TypeError('missing argument') } if (!channel) { channel = new MessageChannel() } channel.port1.unref() channel.port2.unref() channel.port1.postMessage(value, options?.transfer) return receiveMessageOnPort(channel.port2).message } module.exports = { DOMException, structuredClone, subresource, forbiddenMethods, requestBodyHeader, referrerPolicy, requestRedirect, requestMode, requestCredentials, requestCache, redirectStatus, corsSafeListedMethods, nullBodyStatus, safeMethods, badPorts, requestDuplex, subresourceSet, badPortsSet, redirectStatusSet, corsSafeListedMethodsSet, safeMethodsSet, forbiddenMethodsSet, referrerPolicySet } /***/ }), /***/ 4322: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const assert = __nccwpck_require__(2613) const { atob } = __nccwpck_require__(181) const { isomorphicDecode } = __nccwpck_require__(5523) const encoder = new TextEncoder() /** * @see https://mimesniff.spec.whatwg.org/#http-token-code-point */ const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/ const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/ // eslint-disable-line /** * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point */ const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/ // eslint-disable-line // https://fetch.spec.whatwg.org/#data-url-processor /** @param {URL} dataURL */ function dataURLProcessor (dataURL) { // 1. Assert: dataURL’s scheme is "data". assert(dataURL.protocol === 'data:') // 2. Let input be the result of running the URL // serializer on dataURL with exclude fragment // set to true. let input = URLSerializer(dataURL, true) // 3. Remove the leading "data:" string from input. input = input.slice(5) // 4. Let position point at the start of input. const position = { position: 0 } // 5. Let mimeType be the result of collecting a // sequence of code points that are not equal // to U+002C (,), given position. let mimeType = collectASequenceOfCodePointsFast( ',', input, position ) // 6. Strip leading and trailing ASCII whitespace // from mimeType. // Undici implementation note: we need to store the // length because if the mimetype has spaces removed, // the wrong amount will be sliced from the input in // step #9 const mimeTypeLength = mimeType.length mimeType = removeASCIIWhitespace(mimeType, true, true) // 7. If position is past the end of input, then // return failure if (position.position >= input.length) { return 'failure' } // 8. Advance position by 1. position.position++ // 9. Let encodedBody be the remainder of input. const encodedBody = input.slice(mimeTypeLength + 1) // 10. Let body be the percent-decoding of encodedBody. let body = stringPercentDecode(encodedBody) // 11. If mimeType ends with U+003B (;), followed by // zero or more U+0020 SPACE, followed by an ASCII // case-insensitive match for "base64", then: if (/;(\u0020){0,}base64$/i.test(mimeType)) { // 1. Let stringBody be the isomorphic decode of body. const stringBody = isomorphicDecode(body) // 2. Set body to the forgiving-base64 decode of // stringBody. body = forgivingBase64(stringBody) // 3. If body is failure, then return failure. if (body === 'failure') { return 'failure' } // 4. Remove the last 6 code points from mimeType. mimeType = mimeType.slice(0, -6) // 5. Remove trailing U+0020 SPACE code points from mimeType, // if any. mimeType = mimeType.replace(/(\u0020)+$/, '') // 6. Remove the last U+003B (;) code point from mimeType. mimeType = mimeType.slice(0, -1) } // 12. If mimeType starts with U+003B (;), then prepend // "text/plain" to mimeType. if (mimeType.startsWith(';')) { mimeType = 'text/plain' + mimeType } // 13. Let mimeTypeRecord be the result of parsing // mimeType. let mimeTypeRecord = parseMIMEType(mimeType) // 14. If mimeTypeRecord is failure, then set // mimeTypeRecord to text/plain;charset=US-ASCII. if (mimeTypeRecord === 'failure') { mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII') } // 15. Return a new data: URL struct whose MIME // type is mimeTypeRecord and body is body. // https://fetch.spec.whatwg.org/#data-url-struct return { mimeType: mimeTypeRecord, body } } // https://url.spec.whatwg.org/#concept-url-serializer /** * @param {URL} url * @param {boolean} excludeFragment */ function URLSerializer (url, excludeFragment = false) { if (!excludeFragment) { return url.href } const href = url.href const hashLength = url.hash.length return hashLength === 0 ? href : href.substring(0, href.length - hashLength) } // https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points /** * @param {(char: string) => boolean} condition * @param {string} input * @param {{ position: number }} position */ function collectASequenceOfCodePoints (condition, input, position) { // 1. Let result be the empty string. let result = '' // 2. While position doesn’t point past the end of input and the // code point at position within input meets the condition condition: while (position.position < input.length && condition(input[position.position])) { // 1. Append that code point to the end of result. result += input[position.position] // 2. Advance position by 1. position.position++ } // 3. Return result. return result } /** * A faster collectASequenceOfCodePoints that only works when comparing a single character. * @param {string} char * @param {string} input * @param {{ position: number }} position */ function collectASequenceOfCodePointsFast (char, input, position) { const idx = input.indexOf(char, position.position) const start = position.position if (idx === -1) { position.position = input.length return input.slice(start) } position.position = idx return input.slice(start, position.position) } // https://url.spec.whatwg.org/#string-percent-decode /** @param {string} input */ function stringPercentDecode (input) { // 1. Let bytes be the UTF-8 encoding of input. const bytes = encoder.encode(input) // 2. Return the percent-decoding of bytes. return percentDecode(bytes) } // https://url.spec.whatwg.org/#percent-decode /** @param {Uint8Array} input */ function percentDecode (input) { // 1. Let output be an empty byte sequence. /** @type {number[]} */ const output = [] // 2. For each byte byte in input: for (let i = 0; i < input.length; i++) { const byte = input[i] // 1. If byte is not 0x25 (%), then append byte to output. if (byte !== 0x25) { output.push(byte) // 2. Otherwise, if byte is 0x25 (%) and the next two bytes // after byte in input are not in the ranges // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F), // and 0x61 (a) to 0x66 (f), all inclusive, append byte // to output. } else if ( byte === 0x25 && !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2])) ) { output.push(0x25) // 3. Otherwise: } else { // 1. Let bytePoint be the two bytes after byte in input, // decoded, and then interpreted as hexadecimal number. const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2]) const bytePoint = Number.parseInt(nextTwoBytes, 16) // 2. Append a byte whose value is bytePoint to output. output.push(bytePoint) // 3. Skip the next two bytes in input. i += 2 } } // 3. Return output. return Uint8Array.from(output) } // https://mimesniff.spec.whatwg.org/#parse-a-mime-type /** @param {string} input */ function parseMIMEType (input) { // 1. Remove any leading and trailing HTTP whitespace // from input. input = removeHTTPWhitespace(input, true, true) // 2. Let position be a position variable for input, // initially pointing at the start of input. const position = { position: 0 } // 3. Let type be the result of collecting a sequence // of code points that are not U+002F (/) from // input, given position. const type = collectASequenceOfCodePointsFast( '/', input, position ) // 4. If type is the empty string or does not solely // contain HTTP token code points, then return failure. // https://mimesniff.spec.whatwg.org/#http-token-code-point if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) { return 'failure' } // 5. If position is past the end of input, then return // failure if (position.position > input.length) { return 'failure' } // 6. Advance position by 1. (This skips past U+002F (/).) position.position++ // 7. Let subtype be the result of collecting a sequence of // code points that are not U+003B (;) from input, given // position. let subtype = collectASequenceOfCodePointsFast( ';', input, position ) // 8. Remove any trailing HTTP whitespace from subtype. subtype = removeHTTPWhitespace(subtype, false, true) // 9. If subtype is the empty string or does not solely // contain HTTP token code points, then return failure. if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) { return 'failure' } const typeLowercase = type.toLowerCase() const subtypeLowercase = subtype.toLowerCase() // 10. Let mimeType be a new MIME type record whose type // is type, in ASCII lowercase, and subtype is subtype, // in ASCII lowercase. // https://mimesniff.spec.whatwg.org/#mime-type const mimeType = { type: typeLowercase, subtype: subtypeLowercase, /** @type {Map} */ parameters: new Map(), // https://mimesniff.spec.whatwg.org/#mime-type-essence essence: `${typeLowercase}/${subtypeLowercase}` } // 11. While position is not past the end of input: while (position.position < input.length) { // 1. Advance position by 1. (This skips past U+003B (;).) position.position++ // 2. Collect a sequence of code points that are HTTP // whitespace from input given position. collectASequenceOfCodePoints( // https://fetch.spec.whatwg.org/#http-whitespace char => HTTP_WHITESPACE_REGEX.test(char), input, position ) // 3. Let parameterName be the result of collecting a // sequence of code points that are not U+003B (;) // or U+003D (=) from input, given position. let parameterName = collectASequenceOfCodePoints( (char) => char !== ';' && char !== '=', input, position ) // 4. Set parameterName to parameterName, in ASCII // lowercase. parameterName = parameterName.toLowerCase() // 5. If position is not past the end of input, then: if (position.position < input.length) { // 1. If the code point at position within input is // U+003B (;), then continue. if (input[position.position] === ';') { continue } // 2. Advance position by 1. (This skips past U+003D (=).) position.position++ } // 6. If position is past the end of input, then break. if (position.position > input.length) { break } // 7. Let parameterValue be null. let parameterValue = null // 8. If the code point at position within input is // U+0022 ("), then: if (input[position.position] === '"') { // 1. Set parameterValue to the result of collecting // an HTTP quoted string from input, given position // and the extract-value flag. parameterValue = collectAnHTTPQuotedString(input, position, true) // 2. Collect a sequence of code points that are not // U+003B (;) from input, given position. collectASequenceOfCodePointsFast( ';', input, position ) // 9. Otherwise: } else { // 1. Set parameterValue to the result of collecting // a sequence of code points that are not U+003B (;) // from input, given position. parameterValue = collectASequenceOfCodePointsFast( ';', input, position ) // 2. Remove any trailing HTTP whitespace from parameterValue. parameterValue = removeHTTPWhitespace(parameterValue, false, true) // 3. If parameterValue is the empty string, then continue. if (parameterValue.length === 0) { continue } } // 10. If all of the following are true // - parameterName is not the empty string // - parameterName solely contains HTTP token code points // - parameterValue solely contains HTTP quoted-string token code points // - mimeType’s parameters[parameterName] does not exist // then set mimeType’s parameters[parameterName] to parameterValue. if ( parameterName.length !== 0 && HTTP_TOKEN_CODEPOINTS.test(parameterName) && (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) && !mimeType.parameters.has(parameterName) ) { mimeType.parameters.set(parameterName, parameterValue) } } // 12. Return mimeType. return mimeType } // https://infra.spec.whatwg.org/#forgiving-base64-decode /** @param {string} data */ function forgivingBase64 (data) { // 1. Remove all ASCII whitespace from data. data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, '') // eslint-disable-line // 2. If data’s code point length divides by 4 leaving // no remainder, then: if (data.length % 4 === 0) { // 1. If data ends with one or two U+003D (=) code points, // then remove them from data. data = data.replace(/=?=$/, '') } // 3. If data’s code point length divides by 4 leaving // a remainder of 1, then return failure. if (data.length % 4 === 1) { return 'failure' } // 4. If data contains a code point that is not one of // U+002B (+) // U+002F (/) // ASCII alphanumeric // then return failure. if (/[^+/0-9A-Za-z]/.test(data)) { return 'failure' } const binary = atob(data) const bytes = new Uint8Array(binary.length) for (let byte = 0; byte < binary.length; byte++) { bytes[byte] = binary.charCodeAt(byte) } return bytes } // https://fetch.spec.whatwg.org/#collect-an-http-quoted-string // tests: https://fetch.spec.whatwg.org/#example-http-quoted-string /** * @param {string} input * @param {{ position: number }} position * @param {boolean?} extractValue */ function collectAnHTTPQuotedString (input, position, extractValue) { // 1. Let positionStart be position. const positionStart = position.position // 2. Let value be the empty string. let value = '' // 3. Assert: the code point at position within input // is U+0022 ("). assert(input[position.position] === '"') // 4. Advance position by 1. position.position++ // 5. While true: while (true) { // 1. Append the result of collecting a sequence of code points // that are not U+0022 (") or U+005C (\) from input, given // position, to value. value += collectASequenceOfCodePoints( (char) => char !== '"' && char !== '\\', input, position ) // 2. If position is past the end of input, then break. if (position.position >= input.length) { break } // 3. Let quoteOrBackslash be the code point at position within // input. const quoteOrBackslash = input[position.position] // 4. Advance position by 1. position.position++ // 5. If quoteOrBackslash is U+005C (\), then: if (quoteOrBackslash === '\\') { // 1. If position is past the end of input, then append // U+005C (\) to value and break. if (position.position >= input.length) { value += '\\' break } // 2. Append the code point at position within input to value. value += input[position.position] // 3. Advance position by 1. position.position++ // 6. Otherwise: } else { // 1. Assert: quoteOrBackslash is U+0022 ("). assert(quoteOrBackslash === '"') // 2. Break. break } } // 6. If the extract-value flag is set, then return value. if (extractValue) { return value } // 7. Return the code points from positionStart to position, // inclusive, within input. return input.slice(positionStart, position.position) } /** * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type */ function serializeAMimeType (mimeType) { assert(mimeType !== 'failure') const { parameters, essence } = mimeType // 1. Let serialization be the concatenation of mimeType’s // type, U+002F (/), and mimeType’s subtype. let serialization = essence // 2. For each name → value of mimeType’s parameters: for (let [name, value] of parameters.entries()) { // 1. Append U+003B (;) to serialization. serialization += ';' // 2. Append name to serialization. serialization += name // 3. Append U+003D (=) to serialization. serialization += '=' // 4. If value does not solely contain HTTP token code // points or value is the empty string, then: if (!HTTP_TOKEN_CODEPOINTS.test(value)) { // 1. Precede each occurence of U+0022 (") or // U+005C (\) in value with U+005C (\). value = value.replace(/(\\|")/g, '\\$1') // 2. Prepend U+0022 (") to value. value = '"' + value // 3. Append U+0022 (") to value. value += '"' } // 5. Append value to serialization. serialization += value } // 3. Return serialization. return serialization } /** * @see https://fetch.spec.whatwg.org/#http-whitespace * @param {string} char */ function isHTTPWhiteSpace (char) { return char === '\r' || char === '\n' || char === '\t' || char === ' ' } /** * @see https://fetch.spec.whatwg.org/#http-whitespace * @param {string} str */ function removeHTTPWhitespace (str, leading = true, trailing = true) { let lead = 0 let trail = str.length - 1 if (leading) { for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++); } if (trailing) { for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--); } return str.slice(lead, trail + 1) } /** * @see https://infra.spec.whatwg.org/#ascii-whitespace * @param {string} char */ function isASCIIWhitespace (char) { return char === '\r' || char === '\n' || char === '\t' || char === '\f' || char === ' ' } /** * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace */ function removeASCIIWhitespace (str, leading = true, trailing = true) { let lead = 0 let trail = str.length - 1 if (leading) { for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++); } if (trailing) { for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--); } return str.slice(lead, trail + 1) } module.exports = { dataURLProcessor, URLSerializer, collectASequenceOfCodePoints, collectASequenceOfCodePointsFast, stringPercentDecode, parseMIMEType, collectAnHTTPQuotedString, serializeAMimeType } /***/ }), /***/ 3041: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { Blob, File: NativeFile } = __nccwpck_require__(181) const { types } = __nccwpck_require__(9023) const { kState } = __nccwpck_require__(9710) const { isBlobLike } = __nccwpck_require__(5523) const { webidl } = __nccwpck_require__(4222) const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(4322) const { kEnumerableProperty } = __nccwpck_require__(3440) const encoder = new TextEncoder() class File extends Blob { constructor (fileBits, fileName, options = {}) { // The File constructor is invoked with two or three parameters, depending // on whether the optional dictionary parameter is used. When the File() // constructor is invoked, user agents must run the following steps: webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' }) fileBits = webidl.converters['sequence'](fileBits) fileName = webidl.converters.USVString(fileName) options = webidl.converters.FilePropertyBag(options) // 1. Let bytes be the result of processing blob parts given fileBits and // options. // Note: Blob handles this for us // 2. Let n be the fileName argument to the constructor. const n = fileName // 3. Process FilePropertyBag dictionary argument by running the following // substeps: // 1. If the type member is provided and is not the empty string, let t // be set to the type dictionary member. If t contains any characters // outside the range U+0020 to U+007E, then set t to the empty string // and return from these substeps. // 2. Convert every character in t to ASCII lowercase. let t = options.type let d // eslint-disable-next-line no-labels substep: { if (t) { t = parseMIMEType(t) if (t === 'failure') { t = '' // eslint-disable-next-line no-labels break substep } t = serializeAMimeType(t).toLowerCase() } // 3. If the lastModified member is provided, let d be set to the // lastModified dictionary member. If it is not provided, set d to the // current date and time represented as the number of milliseconds since // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]). d = options.lastModified } // 4. Return a new File object F such that: // F refers to the bytes byte sequence. // F.size is set to the number of total bytes in bytes. // F.name is set to n. // F.type is set to t. // F.lastModified is set to d. super(processBlobParts(fileBits, options), { type: t }) this[kState] = { name: n, lastModified: d, type: t } } get name () { webidl.brandCheck(this, File) return this[kState].name } get lastModified () { webidl.brandCheck(this, File) return this[kState].lastModified } get type () { webidl.brandCheck(this, File) return this[kState].type } } class FileLike { constructor (blobLike, fileName, options = {}) { // TODO: argument idl type check // The File constructor is invoked with two or three parameters, depending // on whether the optional dictionary parameter is used. When the File() // constructor is invoked, user agents must run the following steps: // 1. Let bytes be the result of processing blob parts given fileBits and // options. // 2. Let n be the fileName argument to the constructor. const n = fileName // 3. Process FilePropertyBag dictionary argument by running the following // substeps: // 1. If the type member is provided and is not the empty string, let t // be set to the type dictionary member. If t contains any characters // outside the range U+0020 to U+007E, then set t to the empty string // and return from these substeps. // TODO const t = options.type // 2. Convert every character in t to ASCII lowercase. // TODO // 3. If the lastModified member is provided, let d be set to the // lastModified dictionary member. If it is not provided, set d to the // current date and time represented as the number of milliseconds since // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]). const d = options.lastModified ?? Date.now() // 4. Return a new File object F such that: // F refers to the bytes byte sequence. // F.size is set to the number of total bytes in bytes. // F.name is set to n. // F.type is set to t. // F.lastModified is set to d. this[kState] = { blobLike, name: n, type: t, lastModified: d } } stream (...args) { webidl.brandCheck(this, FileLike) return this[kState].blobLike.stream(...args) } arrayBuffer (...args) { webidl.brandCheck(this, FileLike) return this[kState].blobLike.arrayBuffer(...args) } slice (...args) { webidl.brandCheck(this, FileLike) return this[kState].blobLike.slice(...args) } text (...args) { webidl.brandCheck(this, FileLike) return this[kState].blobLike.text(...args) } get size () { webidl.brandCheck(this, FileLike) return this[kState].blobLike.size } get type () { webidl.brandCheck(this, FileLike) return this[kState].blobLike.type } get name () { webidl.brandCheck(this, FileLike) return this[kState].name } get lastModified () { webidl.brandCheck(this, FileLike) return this[kState].lastModified } get [Symbol.toStringTag] () { return 'File' } } Object.defineProperties(File.prototype, { [Symbol.toStringTag]: { value: 'File', configurable: true }, name: kEnumerableProperty, lastModified: kEnumerableProperty }) webidl.converters.Blob = webidl.interfaceConverter(Blob) webidl.converters.BlobPart = function (V, opts) { if (webidl.util.Type(V) === 'Object') { if (isBlobLike(V)) { return webidl.converters.Blob(V, { strict: false }) } if ( ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V) ) { return webidl.converters.BufferSource(V, opts) } } return webidl.converters.USVString(V, opts) } webidl.converters['sequence'] = webidl.sequenceConverter( webidl.converters.BlobPart ) // https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag webidl.converters.FilePropertyBag = webidl.dictionaryConverter([ { key: 'lastModified', converter: webidl.converters['long long'], get defaultValue () { return Date.now() } }, { key: 'type', converter: webidl.converters.DOMString, defaultValue: '' }, { key: 'endings', converter: (value) => { value = webidl.converters.DOMString(value) value = value.toLowerCase() if (value !== 'native') { value = 'transparent' } return value }, defaultValue: 'transparent' } ]) /** * @see https://www.w3.org/TR/FileAPI/#process-blob-parts * @param {(NodeJS.TypedArray|Blob|string)[]} parts * @param {{ type: string, endings: string }} options */ function processBlobParts (parts, options) { // 1. Let bytes be an empty sequence of bytes. /** @type {NodeJS.TypedArray[]} */ const bytes = [] // 2. For each element in parts: for (const element of parts) { // 1. If element is a USVString, run the following substeps: if (typeof element === 'string') { // 1. Let s be element. let s = element // 2. If the endings member of options is "native", set s // to the result of converting line endings to native // of element. if (options.endings === 'native') { s = convertLineEndingsNative(s) } // 3. Append the result of UTF-8 encoding s to bytes. bytes.push(encoder.encode(s)) } else if ( types.isAnyArrayBuffer(element) || types.isTypedArray(element) ) { // 2. If element is a BufferSource, get a copy of the // bytes held by the buffer source, and append those // bytes to bytes. if (!element.buffer) { // ArrayBuffer bytes.push(new Uint8Array(element)) } else { bytes.push( new Uint8Array(element.buffer, element.byteOffset, element.byteLength) ) } } else if (isBlobLike(element)) { // 3. If element is a Blob, append the bytes it represents // to bytes. bytes.push(element) } } // 3. Return bytes. return bytes } /** * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native * @param {string} s */ function convertLineEndingsNative (s) { // 1. Let native line ending be be the code point U+000A LF. let nativeLineEnding = '\n' // 2. If the underlying platform’s conventions are to // represent newlines as a carriage return and line feed // sequence, set native line ending to the code point // U+000D CR followed by the code point U+000A LF. if (process.platform === 'win32') { nativeLineEnding = '\r\n' } return s.replace(/\r?\n/g, nativeLineEnding) } // If this function is moved to ./util.js, some tools (such as // rollup) will warn about circular dependencies. See: // https://github.com/nodejs/undici/issues/1629 function isFileLike (object) { return ( (NativeFile && object instanceof NativeFile) || object instanceof File || ( object && (typeof object.stream === 'function' || typeof object.arrayBuffer === 'function') && object[Symbol.toStringTag] === 'File' ) ) } module.exports = { File, FileLike, isFileLike } /***/ }), /***/ 3073: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(5523) const { kState } = __nccwpck_require__(9710) const { File: UndiciFile, FileLike, isFileLike } = __nccwpck_require__(3041) const { webidl } = __nccwpck_require__(4222) const { Blob, File: NativeFile } = __nccwpck_require__(181) /** @type {globalThis['File']} */ const File = NativeFile ?? UndiciFile // https://xhr.spec.whatwg.org/#formdata class FormData { constructor (form) { if (form !== undefined) { throw webidl.errors.conversionFailed({ prefix: 'FormData constructor', argument: 'Argument 1', types: ['undefined'] }) } this[kState] = [] } append (name, value, filename = undefined) { webidl.brandCheck(this, FormData) webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' }) if (arguments.length === 3 && !isBlobLike(value)) { throw new TypeError( "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'" ) } // 1. Let value be value if given; otherwise blobValue. name = webidl.converters.USVString(name) value = isBlobLike(value) ? webidl.converters.Blob(value, { strict: false }) : webidl.converters.USVString(value) filename = arguments.length === 3 ? webidl.converters.USVString(filename) : undefined // 2. Let entry be the result of creating an entry with // name, value, and filename if given. const entry = makeEntry(name, value, filename) // 3. Append entry to this’s entry list. this[kState].push(entry) } delete (name) { webidl.brandCheck(this, FormData) webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' }) name = webidl.converters.USVString(name) // The delete(name) method steps are to remove all entries whose name // is name from this’s entry list. this[kState] = this[kState].filter(entry => entry.name !== name) } get (name) { webidl.brandCheck(this, FormData) webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' }) name = webidl.converters.USVString(name) // 1. If there is no entry whose name is name in this’s entry list, // then return null. const idx = this[kState].findIndex((entry) => entry.name === name) if (idx === -1) { return null } // 2. Return the value of the first entry whose name is name from // this’s entry list. return this[kState][idx].value } getAll (name) { webidl.brandCheck(this, FormData) webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' }) name = webidl.converters.USVString(name) // 1. If there is no entry whose name is name in this’s entry list, // then return the empty list. // 2. Return the values of all entries whose name is name, in order, // from this’s entry list. return this[kState] .filter((entry) => entry.name === name) .map((entry) => entry.value) } has (name) { webidl.brandCheck(this, FormData) webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' }) name = webidl.converters.USVString(name) // The has(name) method steps are to return true if there is an entry // whose name is name in this’s entry list; otherwise false. return this[kState].findIndex((entry) => entry.name === name) !== -1 } set (name, value, filename = undefined) { webidl.brandCheck(this, FormData) webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' }) if (arguments.length === 3 && !isBlobLike(value)) { throw new TypeError( "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'" ) } // The set(name, value) and set(name, blobValue, filename) method steps // are: // 1. Let value be value if given; otherwise blobValue. name = webidl.converters.USVString(name) value = isBlobLike(value) ? webidl.converters.Blob(value, { strict: false }) : webidl.converters.USVString(value) filename = arguments.length === 3 ? toUSVString(filename) : undefined // 2. Let entry be the result of creating an entry with name, value, and // filename if given. const entry = makeEntry(name, value, filename) // 3. If there are entries in this’s entry list whose name is name, then // replace the first such entry with entry and remove the others. const idx = this[kState].findIndex((entry) => entry.name === name) if (idx !== -1) { this[kState] = [ ...this[kState].slice(0, idx), entry, ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name) ] } else { // 4. Otherwise, append entry to this’s entry list. this[kState].push(entry) } } entries () { webidl.brandCheck(this, FormData) return makeIterator( () => this[kState].map(pair => [pair.name, pair.value]), 'FormData', 'key+value' ) } keys () { webidl.brandCheck(this, FormData) return makeIterator( () => this[kState].map(pair => [pair.name, pair.value]), 'FormData', 'key' ) } values () { webidl.brandCheck(this, FormData) return makeIterator( () => this[kState].map(pair => [pair.name, pair.value]), 'FormData', 'value' ) } /** * @param {(value: string, key: string, self: FormData) => void} callbackFn * @param {unknown} thisArg */ forEach (callbackFn, thisArg = globalThis) { webidl.brandCheck(this, FormData) webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' }) if (typeof callbackFn !== 'function') { throw new TypeError( "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'." ) } for (const [key, value] of this) { callbackFn.apply(thisArg, [value, key, this]) } } } FormData.prototype[Symbol.iterator] = FormData.prototype.entries Object.defineProperties(FormData.prototype, { [Symbol.toStringTag]: { value: 'FormData', configurable: true } }) /** * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry * @param {string} name * @param {string|Blob} value * @param {?string} filename * @returns */ function makeEntry (name, value, filename) { // 1. Set name to the result of converting name into a scalar value string. // "To convert a string into a scalar value string, replace any surrogates // with U+FFFD." // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end name = Buffer.from(name).toString('utf8') // 2. If value is a string, then set value to the result of converting // value into a scalar value string. if (typeof value === 'string') { value = Buffer.from(value).toString('utf8') } else { // 3. Otherwise: // 1. If value is not a File object, then set value to a new File object, // representing the same bytes, whose name attribute value is "blob" if (!isFileLike(value)) { value = value instanceof Blob ? new File([value], 'blob', { type: value.type }) : new FileLike(value, 'blob', { type: value.type }) } // 2. If filename is given, then set value to a new File object, // representing the same bytes, whose name attribute is filename. if (filename !== undefined) { /** @type {FilePropertyBag} */ const options = { type: value.type, lastModified: value.lastModified } value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile ? new File([value], filename, options) : new FileLike(value, filename, options) } } // 4. Return an entry whose name is name and whose value is value. return { name, value } } module.exports = { FormData } /***/ }), /***/ 5628: /***/ ((module) => { // In case of breaking changes, increase the version // number to avoid conflicts. const globalOrigin = Symbol.for('undici.globalOrigin.1') function getGlobalOrigin () { return globalThis[globalOrigin] } function setGlobalOrigin (newOrigin) { if (newOrigin === undefined) { Object.defineProperty(globalThis, globalOrigin, { value: undefined, writable: true, enumerable: false, configurable: false }) return } const parsedURL = new URL(newOrigin) if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') { throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`) } Object.defineProperty(globalThis, globalOrigin, { value: parsedURL, writable: true, enumerable: false, configurable: false }) } module.exports = { getGlobalOrigin, setGlobalOrigin } /***/ }), /***/ 6349: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // https://github.com/Ethan-Arrowood/undici-fetch const { kHeadersList, kConstruct } = __nccwpck_require__(6443) const { kGuard } = __nccwpck_require__(9710) const { kEnumerableProperty } = __nccwpck_require__(3440) const { makeIterator, isValidHeaderName, isValidHeaderValue } = __nccwpck_require__(5523) const util = __nccwpck_require__(9023) const { webidl } = __nccwpck_require__(4222) const assert = __nccwpck_require__(2613) const kHeadersMap = Symbol('headers map') const kHeadersSortedMap = Symbol('headers map sorted') /** * @param {number} code */ function isHTTPWhiteSpaceCharCode (code) { return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020 } /** * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize * @param {string} potentialValue */ function headerValueNormalize (potentialValue) { // To normalize a byte sequence potentialValue, remove // any leading and trailing HTTP whitespace bytes from // potentialValue. let i = 0; let j = potentialValue.length while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j) } function fill (headers, object) { // To fill a Headers object headers with a given object object, run these steps: // 1. If object is a sequence, then for each header in object: // Note: webidl conversion to array has already been done. if (Array.isArray(object)) { for (let i = 0; i < object.length; ++i) { const header = object[i] // 1. If header does not contain exactly two items, then throw a TypeError. if (header.length !== 2) { throw webidl.errors.exception({ header: 'Headers constructor', message: `expected name/value pair to be length 2, found ${header.length}.` }) } // 2. Append (header’s first item, header’s second item) to headers. appendHeader(headers, header[0], header[1]) } } else if (typeof object === 'object' && object !== null) { // Note: null should throw // 2. Otherwise, object is a record, then for each key → value in object, // append (key, value) to headers const keys = Object.keys(object) for (let i = 0; i < keys.length; ++i) { appendHeader(headers, keys[i], object[keys[i]]) } } else { throw webidl.errors.conversionFailed({ prefix: 'Headers constructor', argument: 'Argument 1', types: ['sequence>', 'record'] }) } } /** * @see https://fetch.spec.whatwg.org/#concept-headers-append */ function appendHeader (headers, name, value) { // 1. Normalize value. value = headerValueNormalize(value) // 2. If name is not a header name or value is not a // header value, then throw a TypeError. if (!isValidHeaderName(name)) { throw webidl.errors.invalidArgument({ prefix: 'Headers.append', value: name, type: 'header name' }) } else if (!isValidHeaderValue(value)) { throw webidl.errors.invalidArgument({ prefix: 'Headers.append', value, type: 'header value' }) } // 3. If headers’s guard is "immutable", then throw a TypeError. // 4. Otherwise, if headers’s guard is "request" and name is a // forbidden header name, return. // Note: undici does not implement forbidden header names if (headers[kGuard] === 'immutable') { throw new TypeError('immutable') } else if (headers[kGuard] === 'request-no-cors') { // 5. Otherwise, if headers’s guard is "request-no-cors": // TODO } // 6. Otherwise, if headers’s guard is "response" and name is a // forbidden response-header name, return. // 7. Append (name, value) to headers’s header list. return headers[kHeadersList].append(name, value) // 8. If headers’s guard is "request-no-cors", then remove // privileged no-CORS request headers from headers } class HeadersList { /** @type {[string, string][]|null} */ cookies = null constructor (init) { if (init instanceof HeadersList) { this[kHeadersMap] = new Map(init[kHeadersMap]) this[kHeadersSortedMap] = init[kHeadersSortedMap] this.cookies = init.cookies === null ? null : [...init.cookies] } else { this[kHeadersMap] = new Map(init) this[kHeadersSortedMap] = null } } // https://fetch.spec.whatwg.org/#header-list-contains contains (name) { // A header list list contains a header name name if list // contains a header whose name is a byte-case-insensitive // match for name. name = name.toLowerCase() return this[kHeadersMap].has(name) } clear () { this[kHeadersMap].clear() this[kHeadersSortedMap] = null this.cookies = null } // https://fetch.spec.whatwg.org/#concept-header-list-append append (name, value) { this[kHeadersSortedMap] = null // 1. If list contains name, then set name to the first such // header’s name. const lowercaseName = name.toLowerCase() const exists = this[kHeadersMap].get(lowercaseName) // 2. Append (name, value) to list. if (exists) { const delimiter = lowercaseName === 'cookie' ? '; ' : ', ' this[kHeadersMap].set(lowercaseName, { name: exists.name, value: `${exists.value}${delimiter}${value}` }) } else { this[kHeadersMap].set(lowercaseName, { name, value }) } if (lowercaseName === 'set-cookie') { this.cookies ??= [] this.cookies.push(value) } } // https://fetch.spec.whatwg.org/#concept-header-list-set set (name, value) { this[kHeadersSortedMap] = null const lowercaseName = name.toLowerCase() if (lowercaseName === 'set-cookie') { this.cookies = [value] } // 1. If list contains name, then set the value of // the first such header to value and remove the // others. // 2. Otherwise, append header (name, value) to list. this[kHeadersMap].set(lowercaseName, { name, value }) } // https://fetch.spec.whatwg.org/#concept-header-list-delete delete (name) { this[kHeadersSortedMap] = null name = name.toLowerCase() if (name === 'set-cookie') { this.cookies = null } this[kHeadersMap].delete(name) } // https://fetch.spec.whatwg.org/#concept-header-list-get get (name) { const value = this[kHeadersMap].get(name.toLowerCase()) // 1. If list does not contain name, then return null. // 2. Return the values of all headers in list whose name // is a byte-case-insensitive match for name, // separated from each other by 0x2C 0x20, in order. return value === undefined ? null : value.value } * [Symbol.iterator] () { // use the lowercased name for (const [name, { value }] of this[kHeadersMap]) { yield [name, value] } } get entries () { const headers = {} if (this[kHeadersMap].size) { for (const { name, value } of this[kHeadersMap].values()) { headers[name] = value } } return headers } } // https://fetch.spec.whatwg.org/#headers-class class Headers { constructor (init = undefined) { if (init === kConstruct) { return } this[kHeadersList] = new HeadersList() // The new Headers(init) constructor steps are: // 1. Set this’s guard to "none". this[kGuard] = 'none' // 2. If init is given, then fill this with init. if (init !== undefined) { init = webidl.converters.HeadersInit(init) fill(this, init) } } // https://fetch.spec.whatwg.org/#dom-headers-append append (name, value) { webidl.brandCheck(this, Headers) webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' }) name = webidl.converters.ByteString(name) value = webidl.converters.ByteString(value) return appendHeader(this, name, value) } // https://fetch.spec.whatwg.org/#dom-headers-delete delete (name) { webidl.brandCheck(this, Headers) webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' }) name = webidl.converters.ByteString(name) // 1. If name is not a header name, then throw a TypeError. if (!isValidHeaderName(name)) { throw webidl.errors.invalidArgument({ prefix: 'Headers.delete', value: name, type: 'header name' }) } // 2. If this’s guard is "immutable", then throw a TypeError. // 3. Otherwise, if this’s guard is "request" and name is a // forbidden header name, return. // 4. Otherwise, if this’s guard is "request-no-cors", name // is not a no-CORS-safelisted request-header name, and // name is not a privileged no-CORS request-header name, // return. // 5. Otherwise, if this’s guard is "response" and name is // a forbidden response-header name, return. // Note: undici does not implement forbidden header names if (this[kGuard] === 'immutable') { throw new TypeError('immutable') } else if (this[kGuard] === 'request-no-cors') { // TODO } // 6. If this’s header list does not contain name, then // return. if (!this[kHeadersList].contains(name)) { return } // 7. Delete name from this’s header list. // 8. If this’s guard is "request-no-cors", then remove // privileged no-CORS request headers from this. this[kHeadersList].delete(name) } // https://fetch.spec.whatwg.org/#dom-headers-get get (name) { webidl.brandCheck(this, Headers) webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' }) name = webidl.converters.ByteString(name) // 1. If name is not a header name, then throw a TypeError. if (!isValidHeaderName(name)) { throw webidl.errors.invalidArgument({ prefix: 'Headers.get', value: name, type: 'header name' }) } // 2. Return the result of getting name from this’s header // list. return this[kHeadersList].get(name) } // https://fetch.spec.whatwg.org/#dom-headers-has has (name) { webidl.brandCheck(this, Headers) webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' }) name = webidl.converters.ByteString(name) // 1. If name is not a header name, then throw a TypeError. if (!isValidHeaderName(name)) { throw webidl.errors.invalidArgument({ prefix: 'Headers.has', value: name, type: 'header name' }) } // 2. Return true if this’s header list contains name; // otherwise false. return this[kHeadersList].contains(name) } // https://fetch.spec.whatwg.org/#dom-headers-set set (name, value) { webidl.brandCheck(this, Headers) webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' }) name = webidl.converters.ByteString(name) value = webidl.converters.ByteString(value) // 1. Normalize value. value = headerValueNormalize(value) // 2. If name is not a header name or value is not a // header value, then throw a TypeError. if (!isValidHeaderName(name)) { throw webidl.errors.invalidArgument({ prefix: 'Headers.set', value: name, type: 'header name' }) } else if (!isValidHeaderValue(value)) { throw webidl.errors.invalidArgument({ prefix: 'Headers.set', value, type: 'header value' }) } // 3. If this’s guard is "immutable", then throw a TypeError. // 4. Otherwise, if this’s guard is "request" and name is a // forbidden header name, return. // 5. Otherwise, if this’s guard is "request-no-cors" and // name/value is not a no-CORS-safelisted request-header, // return. // 6. Otherwise, if this’s guard is "response" and name is a // forbidden response-header name, return. // Note: undici does not implement forbidden header names if (this[kGuard] === 'immutable') { throw new TypeError('immutable') } else if (this[kGuard] === 'request-no-cors') { // TODO } // 7. Set (name, value) in this’s header list. // 8. If this’s guard is "request-no-cors", then remove // privileged no-CORS request headers from this this[kHeadersList].set(name, value) } // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie getSetCookie () { webidl.brandCheck(this, Headers) // 1. If this’s header list does not contain `Set-Cookie`, then return « ». // 2. Return the values of all headers in this’s header list whose name is // a byte-case-insensitive match for `Set-Cookie`, in order. const list = this[kHeadersList].cookies if (list) { return [...list] } return [] } // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine get [kHeadersSortedMap] () { if (this[kHeadersList][kHeadersSortedMap]) { return this[kHeadersList][kHeadersSortedMap] } // 1. Let headers be an empty list of headers with the key being the name // and value the value. const headers = [] // 2. Let names be the result of convert header names to a sorted-lowercase // set with all the names of the headers in list. const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1) const cookies = this[kHeadersList].cookies // 3. For each name of names: for (let i = 0; i < names.length; ++i) { const [name, value] = names[i] // 1. If name is `set-cookie`, then: if (name === 'set-cookie') { // 1. Let values be a list of all values of headers in list whose name // is a byte-case-insensitive match for name, in order. // 2. For each value of values: // 1. Append (name, value) to headers. for (let j = 0; j < cookies.length; ++j) { headers.push([name, cookies[j]]) } } else { // 2. Otherwise: // 1. Let value be the result of getting name from list. // 2. Assert: value is non-null. assert(value !== null) // 3. Append (name, value) to headers. headers.push([name, value]) } } this[kHeadersList][kHeadersSortedMap] = headers // 4. Return headers. return headers } keys () { webidl.brandCheck(this, Headers) if (this[kGuard] === 'immutable') { const value = this[kHeadersSortedMap] return makeIterator(() => value, 'Headers', 'key') } return makeIterator( () => [...this[kHeadersSortedMap].values()], 'Headers', 'key' ) } values () { webidl.brandCheck(this, Headers) if (this[kGuard] === 'immutable') { const value = this[kHeadersSortedMap] return makeIterator(() => value, 'Headers', 'value') } return makeIterator( () => [...this[kHeadersSortedMap].values()], 'Headers', 'value' ) } entries () { webidl.brandCheck(this, Headers) if (this[kGuard] === 'immutable') { const value = this[kHeadersSortedMap] return makeIterator(() => value, 'Headers', 'key+value') } return makeIterator( () => [...this[kHeadersSortedMap].values()], 'Headers', 'key+value' ) } /** * @param {(value: string, key: string, self: Headers) => void} callbackFn * @param {unknown} thisArg */ forEach (callbackFn, thisArg = globalThis) { webidl.brandCheck(this, Headers) webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' }) if (typeof callbackFn !== 'function') { throw new TypeError( "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'." ) } for (const [key, value] of this) { callbackFn.apply(thisArg, [value, key, this]) } } [Symbol.for('nodejs.util.inspect.custom')] () { webidl.brandCheck(this, Headers) return this[kHeadersList] } } Headers.prototype[Symbol.iterator] = Headers.prototype.entries Object.defineProperties(Headers.prototype, { append: kEnumerableProperty, delete: kEnumerableProperty, get: kEnumerableProperty, has: kEnumerableProperty, set: kEnumerableProperty, getSetCookie: kEnumerableProperty, keys: kEnumerableProperty, values: kEnumerableProperty, entries: kEnumerableProperty, forEach: kEnumerableProperty, [Symbol.iterator]: { enumerable: false }, [Symbol.toStringTag]: { value: 'Headers', configurable: true }, [util.inspect.custom]: { enumerable: false } }) webidl.converters.HeadersInit = function (V) { if (webidl.util.Type(V) === 'Object') { if (V[Symbol.iterator]) { return webidl.converters['sequence>'](V) } return webidl.converters['record'](V) } throw webidl.errors.conversionFailed({ prefix: 'Headers constructor', argument: 'Argument 1', types: ['sequence>', 'record'] }) } module.exports = { fill, Headers, HeadersList } /***/ }), /***/ 2315: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // https://github.com/Ethan-Arrowood/undici-fetch const { Response, makeNetworkError, makeAppropriateNetworkError, filterResponse, makeResponse } = __nccwpck_require__(8676) const { Headers } = __nccwpck_require__(6349) const { Request, makeRequest } = __nccwpck_require__(5194) const zlib = __nccwpck_require__(3106) const { bytesMatch, makePolicyContainer, clonePolicyContainer, requestBadPort, TAOCheck, appendRequestOriginHeader, responseLocationURL, requestCurrentURL, setRequestReferrerPolicyOnRedirect, tryUpgradeRequestToAPotentiallyTrustworthyURL, createOpaqueTimingInfo, appendFetchMetadata, corsCheck, crossOriginResourcePolicyCheck, determineRequestsReferrer, coarsenedSharedCurrentTime, createDeferredPromise, isBlobLike, sameOrigin, isCancelled, isAborted, isErrorLike, fullyReadBody, readableStreamClose, isomorphicEncode, urlIsLocal, urlIsHttpHttpsScheme, urlHasHttpsScheme } = __nccwpck_require__(5523) const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(9710) const assert = __nccwpck_require__(2613) const { safelyExtractBody } = __nccwpck_require__(8923) const { redirectStatusSet, nullBodyStatus, safeMethodsSet, requestBodyHeader, subresourceSet, DOMException } = __nccwpck_require__(7326) const { kHeadersList } = __nccwpck_require__(6443) const EE = __nccwpck_require__(4434) const { Readable, pipeline } = __nccwpck_require__(2203) const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = __nccwpck_require__(3440) const { dataURLProcessor, serializeAMimeType } = __nccwpck_require__(4322) const { TransformStream } = __nccwpck_require__(3774) const { getGlobalDispatcher } = __nccwpck_require__(2581) const { webidl } = __nccwpck_require__(4222) const { STATUS_CODES } = __nccwpck_require__(8611) const GET_OR_HEAD = ['GET', 'HEAD'] /** @type {import('buffer').resolveObjectURL} */ let resolveObjectURL let ReadableStream = globalThis.ReadableStream class Fetch extends EE { constructor (dispatcher) { super() this.dispatcher = dispatcher this.connection = null this.dump = false this.state = 'ongoing' // 2 terminated listeners get added per request, // but only 1 gets removed. If there are 20 redirects, // 21 listeners will be added. // See https://github.com/nodejs/undici/issues/1711 // TODO (fix): Find and fix root cause for leaked listener. this.setMaxListeners(21) } terminate (reason) { if (this.state !== 'ongoing') { return } this.state = 'terminated' this.connection?.destroy(reason) this.emit('terminated', reason) } // https://fetch.spec.whatwg.org/#fetch-controller-abort abort (error) { if (this.state !== 'ongoing') { return } // 1. Set controller’s state to "aborted". this.state = 'aborted' // 2. Let fallbackError be an "AbortError" DOMException. // 3. Set error to fallbackError if it is not given. if (!error) { error = new DOMException('The operation was aborted.', 'AbortError') } // 4. Let serializedError be StructuredSerialize(error). // If that threw an exception, catch it, and let // serializedError be StructuredSerialize(fallbackError). // 5. Set controller’s serialized abort reason to serializedError. this.serializedAbortReason = error this.connection?.destroy(error) this.emit('terminated', error) } } // https://fetch.spec.whatwg.org/#fetch-method function fetch (input, init = {}) { webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' }) // 1. Let p be a new promise. const p = createDeferredPromise() // 2. Let requestObject be the result of invoking the initial value of // Request as constructor with input and init as arguments. If this throws // an exception, reject p with it and return p. let requestObject try { requestObject = new Request(input, init) } catch (e) { p.reject(e) return p.promise } // 3. Let request be requestObject’s request. const request = requestObject[kState] // 4. If requestObject’s signal’s aborted flag is set, then: if (requestObject.signal.aborted) { // 1. Abort the fetch() call with p, request, null, and // requestObject’s signal’s abort reason. abortFetch(p, request, null, requestObject.signal.reason) // 2. Return p. return p.promise } // 5. Let globalObject be request’s client’s global object. const globalObject = request.client.globalObject // 6. If globalObject is a ServiceWorkerGlobalScope object, then set // request’s service-workers mode to "none". if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') { request.serviceWorkers = 'none' } // 7. Let responseObject be null. let responseObject = null // 8. Let relevantRealm be this’s relevant Realm. const relevantRealm = null // 9. Let locallyAborted be false. let locallyAborted = false // 10. Let controller be null. let controller = null // 11. Add the following abort steps to requestObject’s signal: addAbortListener( requestObject.signal, () => { // 1. Set locallyAborted to true. locallyAborted = true // 2. Assert: controller is non-null. assert(controller != null) // 3. Abort controller with requestObject’s signal’s abort reason. controller.abort(requestObject.signal.reason) // 4. Abort the fetch() call with p, request, responseObject, // and requestObject’s signal’s abort reason. abortFetch(p, request, responseObject, requestObject.signal.reason) } ) // 12. Let handleFetchDone given response response be to finalize and // report timing with response, globalObject, and "fetch". const handleFetchDone = (response) => finalizeAndReportTiming(response, 'fetch') // 13. Set controller to the result of calling fetch given request, // with processResponseEndOfBody set to handleFetchDone, and processResponse // given response being these substeps: const processResponse = (response) => { // 1. If locallyAborted is true, terminate these substeps. if (locallyAborted) { return Promise.resolve() } // 2. If response’s aborted flag is set, then: if (response.aborted) { // 1. Let deserializedError be the result of deserialize a serialized // abort reason given controller’s serialized abort reason and // relevantRealm. // 2. Abort the fetch() call with p, request, responseObject, and // deserializedError. abortFetch(p, request, responseObject, controller.serializedAbortReason) return Promise.resolve() } // 3. If response is a network error, then reject p with a TypeError // and terminate these substeps. if (response.type === 'error') { p.reject( Object.assign(new TypeError('fetch failed'), { cause: response.error }) ) return Promise.resolve() } // 4. Set responseObject to the result of creating a Response object, // given response, "immutable", and relevantRealm. responseObject = new Response() responseObject[kState] = response responseObject[kRealm] = relevantRealm responseObject[kHeaders][kHeadersList] = response.headersList responseObject[kHeaders][kGuard] = 'immutable' responseObject[kHeaders][kRealm] = relevantRealm // 5. Resolve p with responseObject. p.resolve(responseObject) } controller = fetching({ request, processResponseEndOfBody: handleFetchDone, processResponse, dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici }) // 14. Return p. return p.promise } // https://fetch.spec.whatwg.org/#finalize-and-report-timing function finalizeAndReportTiming (response, initiatorType = 'other') { // 1. If response is an aborted network error, then return. if (response.type === 'error' && response.aborted) { return } // 2. If response’s URL list is null or empty, then return. if (!response.urlList?.length) { return } // 3. Let originalURL be response’s URL list[0]. const originalURL = response.urlList[0] // 4. Let timingInfo be response’s timing info. let timingInfo = response.timingInfo // 5. Let cacheState be response’s cache state. let cacheState = response.cacheState // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return. if (!urlIsHttpHttpsScheme(originalURL)) { return } // 7. If timingInfo is null, then return. if (timingInfo === null) { return } // 8. If response’s timing allow passed flag is not set, then: if (!response.timingAllowPassed) { // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo. timingInfo = createOpaqueTimingInfo({ startTime: timingInfo.startTime }) // 2. Set cacheState to the empty string. cacheState = '' } // 9. Set timingInfo’s end time to the coarsened shared current time // given global’s relevant settings object’s cross-origin isolated // capability. // TODO: given global’s relevant settings object’s cross-origin isolated // capability? timingInfo.endTime = coarsenedSharedCurrentTime() // 10. Set response’s timing info to timingInfo. response.timingInfo = timingInfo // 11. Mark resource timing for timingInfo, originalURL, initiatorType, // global, and cacheState. markResourceTiming( timingInfo, originalURL, initiatorType, globalThis, cacheState ) } // https://w3c.github.io/resource-timing/#dfn-mark-resource-timing function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) { if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) { performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState) } } // https://fetch.spec.whatwg.org/#abort-fetch function abortFetch (p, request, responseObject, error) { // Note: AbortSignal.reason was added in node v17.2.0 // which would give us an undefined error to reject with. // Remove this once node v16 is no longer supported. if (!error) { error = new DOMException('The operation was aborted.', 'AbortError') } // 1. Reject promise with error. p.reject(error) // 2. If request’s body is not null and is readable, then cancel request’s // body with error. if (request.body != null && isReadable(request.body?.stream)) { request.body.stream.cancel(error).catch((err) => { if (err.code === 'ERR_INVALID_STATE') { // Node bug? return } throw err }) } // 3. If responseObject is null, then return. if (responseObject == null) { return } // 4. Let response be responseObject’s response. const response = responseObject[kState] // 5. If response’s body is not null and is readable, then error response’s // body with error. if (response.body != null && isReadable(response.body?.stream)) { response.body.stream.cancel(error).catch((err) => { if (err.code === 'ERR_INVALID_STATE') { // Node bug? return } throw err }) } } // https://fetch.spec.whatwg.org/#fetching function fetching ({ request, processRequestBodyChunkLength, processRequestEndOfBody, processResponse, processResponseEndOfBody, processResponseConsumeBody, useParallelQueue = false, dispatcher // undici }) { // 1. Let taskDestination be null. let taskDestination = null // 2. Let crossOriginIsolatedCapability be false. let crossOriginIsolatedCapability = false // 3. If request’s client is non-null, then: if (request.client != null) { // 1. Set taskDestination to request’s client’s global object. taskDestination = request.client.globalObject // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin // isolated capability. crossOriginIsolatedCapability = request.client.crossOriginIsolatedCapability } // 4. If useParallelQueue is true, then set taskDestination to the result of // starting a new parallel queue. // TODO // 5. Let timingInfo be a new fetch timing info whose start time and // post-redirect start time are the coarsened shared current time given // crossOriginIsolatedCapability. const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability) const timingInfo = createOpaqueTimingInfo({ startTime: currenTime }) // 6. Let fetchParams be a new fetch params whose // request is request, // timing info is timingInfo, // process request body chunk length is processRequestBodyChunkLength, // process request end-of-body is processRequestEndOfBody, // process response is processResponse, // process response consume body is processResponseConsumeBody, // process response end-of-body is processResponseEndOfBody, // task destination is taskDestination, // and cross-origin isolated capability is crossOriginIsolatedCapability. const fetchParams = { controller: new Fetch(dispatcher), request, timingInfo, processRequestBodyChunkLength, processRequestEndOfBody, processResponse, processResponseConsumeBody, processResponseEndOfBody, taskDestination, crossOriginIsolatedCapability } // 7. If request’s body is a byte sequence, then set request’s body to // request’s body as a body. // NOTE: Since fetching is only called from fetch, body should already be // extracted. assert(!request.body || request.body.stream) // 8. If request’s window is "client", then set request’s window to request’s // client, if request’s client’s global object is a Window object; otherwise // "no-window". if (request.window === 'client') { // TODO: What if request.client is null? request.window = request.client?.globalObject?.constructor?.name === 'Window' ? request.client : 'no-window' } // 9. If request’s origin is "client", then set request’s origin to request’s // client’s origin. if (request.origin === 'client') { // TODO: What if request.client is null? request.origin = request.client?.origin } // 10. If all of the following conditions are true: // TODO // 11. If request’s policy container is "client", then: if (request.policyContainer === 'client') { // 1. If request’s client is non-null, then set request’s policy // container to a clone of request’s client’s policy container. [HTML] if (request.client != null) { request.policyContainer = clonePolicyContainer( request.client.policyContainer ) } else { // 2. Otherwise, set request’s policy container to a new policy // container. request.policyContainer = makePolicyContainer() } } // 12. If request’s header list does not contain `Accept`, then: if (!request.headersList.contains('accept')) { // 1. Let value be `*/*`. const value = '*/*' // 2. A user agent should set value to the first matching statement, if // any, switching on request’s destination: // "document" // "frame" // "iframe" // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8` // "image" // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5` // "style" // `text/css,*/*;q=0.1` // TODO // 3. Append `Accept`/value to request’s header list. request.headersList.append('accept', value) } // 13. If request’s header list does not contain `Accept-Language`, then // user agents should append `Accept-Language`/an appropriate value to // request’s header list. if (!request.headersList.contains('accept-language')) { request.headersList.append('accept-language', '*') } // 14. If request’s priority is null, then use request’s initiator and // destination appropriately in setting request’s priority to a // user-agent-defined object. if (request.priority === null) { // TODO } // 15. If request is a subresource request, then: if (subresourceSet.has(request.destination)) { // TODO } // 16. Run main fetch given fetchParams. mainFetch(fetchParams) .catch(err => { fetchParams.controller.terminate(err) }) // 17. Return fetchParam's controller return fetchParams.controller } // https://fetch.spec.whatwg.org/#concept-main-fetch async function mainFetch (fetchParams, recursive = false) { // 1. Let request be fetchParams’s request. const request = fetchParams.request // 2. Let response be null. let response = null // 3. If request’s local-URLs-only flag is set and request’s current URL is // not local, then set response to a network error. if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) { response = makeNetworkError('local URLs only') } // 4. Run report Content Security Policy violations for request. // TODO // 5. Upgrade request to a potentially trustworthy URL, if appropriate. tryUpgradeRequestToAPotentiallyTrustworthyURL(request) // 6. If should request be blocked due to a bad port, should fetching request // be blocked as mixed content, or should request be blocked by Content // Security Policy returns blocked, then set response to a network error. if (requestBadPort(request) === 'blocked') { response = makeNetworkError('bad port') } // TODO: should fetching request be blocked as mixed content? // TODO: should request be blocked by Content Security Policy? // 7. If request’s referrer policy is the empty string, then set request’s // referrer policy to request’s policy container’s referrer policy. if (request.referrerPolicy === '') { request.referrerPolicy = request.policyContainer.referrerPolicy } // 8. If request’s referrer is not "no-referrer", then set request’s // referrer to the result of invoking determine request’s referrer. if (request.referrer !== 'no-referrer') { request.referrer = determineRequestsReferrer(request) } // 9. Set request’s current URL’s scheme to "https" if all of the following // conditions are true: // - request’s current URL’s scheme is "http" // - request’s current URL’s host is a domain // - Matching request’s current URL’s host per Known HSTS Host Domain Name // Matching results in either a superdomain match with an asserted // includeSubDomains directive or a congruent match (with or without an // asserted includeSubDomains directive). [HSTS] // TODO // 10. If recursive is false, then run the remaining steps in parallel. // TODO // 11. If response is null, then set response to the result of running // the steps corresponding to the first matching statement: if (response === null) { response = await (async () => { const currentURL = requestCurrentURL(request) if ( // - request’s current URL’s origin is same origin with request’s origin, // and request’s response tainting is "basic" (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') || // request’s current URL’s scheme is "data" (currentURL.protocol === 'data:') || // - request’s mode is "navigate" or "websocket" (request.mode === 'navigate' || request.mode === 'websocket') ) { // 1. Set request’s response tainting to "basic". request.responseTainting = 'basic' // 2. Return the result of running scheme fetch given fetchParams. return await schemeFetch(fetchParams) } // request’s mode is "same-origin" if (request.mode === 'same-origin') { // 1. Return a network error. return makeNetworkError('request mode cannot be "same-origin"') } // request’s mode is "no-cors" if (request.mode === 'no-cors') { // 1. If request’s redirect mode is not "follow", then return a network // error. if (request.redirect !== 'follow') { return makeNetworkError( 'redirect mode cannot be "follow" for "no-cors" request' ) } // 2. Set request’s response tainting to "opaque". request.responseTainting = 'opaque' // 3. Return the result of running scheme fetch given fetchParams. return await schemeFetch(fetchParams) } // request’s current URL’s scheme is not an HTTP(S) scheme if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) { // Return a network error. return makeNetworkError('URL scheme must be a HTTP(S) scheme') } // - request’s use-CORS-preflight flag is set // - request’s unsafe-request flag is set and either request’s method is // not a CORS-safelisted method or CORS-unsafe request-header names with // request’s header list is not empty // 1. Set request’s response tainting to "cors". // 2. Let corsWithPreflightResponse be the result of running HTTP fetch // given fetchParams and true. // 3. If corsWithPreflightResponse is a network error, then clear cache // entries using request. // 4. Return corsWithPreflightResponse. // TODO // Otherwise // 1. Set request’s response tainting to "cors". request.responseTainting = 'cors' // 2. Return the result of running HTTP fetch given fetchParams. return await httpFetch(fetchParams) })() } // 12. If recursive is true, then return response. if (recursive) { return response } // 13. If response is not a network error and response is not a filtered // response, then: if (response.status !== 0 && !response.internalResponse) { // If request’s response tainting is "cors", then: if (request.responseTainting === 'cors') { // 1. Let headerNames be the result of extracting header list values // given `Access-Control-Expose-Headers` and response’s header list. // TODO // 2. If request’s credentials mode is not "include" and headerNames // contains `*`, then set response’s CORS-exposed header-name list to // all unique header names in response’s header list. // TODO // 3. Otherwise, if headerNames is not null or failure, then set // response’s CORS-exposed header-name list to headerNames. // TODO } // Set response to the following filtered response with response as its // internal response, depending on request’s response tainting: if (request.responseTainting === 'basic') { response = filterResponse(response, 'basic') } else if (request.responseTainting === 'cors') { response = filterResponse(response, 'cors') } else if (request.responseTainting === 'opaque') { response = filterResponse(response, 'opaque') } else { assert(false) } } // 14. Let internalResponse be response, if response is a network error, // and response’s internal response otherwise. let internalResponse = response.status === 0 ? response : response.internalResponse // 15. If internalResponse’s URL list is empty, then set it to a clone of // request’s URL list. if (internalResponse.urlList.length === 0) { internalResponse.urlList.push(...request.urlList) } // 16. If request’s timing allow failed flag is unset, then set // internalResponse’s timing allow passed flag. if (!request.timingAllowFailed) { response.timingAllowPassed = true } // 17. If response is not a network error and any of the following returns // blocked // - should internalResponse to request be blocked as mixed content // - should internalResponse to request be blocked by Content Security Policy // - should internalResponse to request be blocked due to its MIME type // - should internalResponse to request be blocked due to nosniff // TODO // 18. If response’s type is "opaque", internalResponse’s status is 206, // internalResponse’s range-requested flag is set, and request’s header // list does not contain `Range`, then set response and internalResponse // to a network error. if ( response.type === 'opaque' && internalResponse.status === 206 && internalResponse.rangeRequested && !request.headers.contains('range') ) { response = internalResponse = makeNetworkError() } // 19. If response is not a network error and either request’s method is // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status, // set internalResponse’s body to null and disregard any enqueuing toward // it (if any). if ( response.status !== 0 && (request.method === 'HEAD' || request.method === 'CONNECT' || nullBodyStatus.includes(internalResponse.status)) ) { internalResponse.body = null fetchParams.controller.dump = true } // 20. If request’s integrity metadata is not the empty string, then: if (request.integrity) { // 1. Let processBodyError be this step: run fetch finale given fetchParams // and a network error. const processBodyError = (reason) => fetchFinale(fetchParams, makeNetworkError(reason)) // 2. If request’s response tainting is "opaque", or response’s body is null, // then run processBodyError and abort these steps. if (request.responseTainting === 'opaque' || response.body == null) { processBodyError(response.error) return } // 3. Let processBody given bytes be these steps: const processBody = (bytes) => { // 1. If bytes do not match request’s integrity metadata, // then run processBodyError and abort these steps. [SRI] if (!bytesMatch(bytes, request.integrity)) { processBodyError('integrity mismatch') return } // 2. Set response’s body to bytes as a body. response.body = safelyExtractBody(bytes)[0] // 3. Run fetch finale given fetchParams and response. fetchFinale(fetchParams, response) } // 4. Fully read response’s body given processBody and processBodyError. await fullyReadBody(response.body, processBody, processBodyError) } else { // 21. Otherwise, run fetch finale given fetchParams and response. fetchFinale(fetchParams, response) } } // https://fetch.spec.whatwg.org/#concept-scheme-fetch // given a fetch params fetchParams function schemeFetch (fetchParams) { // Note: since the connection is destroyed on redirect, which sets fetchParams to a // cancelled state, we do not want this condition to trigger *unless* there have been // no redirects. See https://github.com/nodejs/undici/issues/1776 // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams. if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) { return Promise.resolve(makeAppropriateNetworkError(fetchParams)) } // 2. Let request be fetchParams’s request. const { request } = fetchParams const { protocol: scheme } = requestCurrentURL(request) // 3. Switch on request’s current URL’s scheme and run the associated steps: switch (scheme) { case 'about:': { // If request’s current URL’s path is the string "blank", then return a new response // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) », // and body is the empty byte sequence as a body. // Otherwise, return a network error. return Promise.resolve(makeNetworkError('about scheme is not supported')) } case 'blob:': { if (!resolveObjectURL) { resolveObjectURL = (__nccwpck_require__(181).resolveObjectURL) } // 1. Let blobURLEntry be request’s current URL’s blob URL entry. const blobURLEntry = requestCurrentURL(request) // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56 // Buffer.resolveObjectURL does not ignore URL queries. if (blobURLEntry.search.length !== 0) { return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.')) } const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString()) // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s // object is not a Blob object, then return a network error. if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) { return Promise.resolve(makeNetworkError('invalid method')) } // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object. const bodyWithType = safelyExtractBody(blobURLEntryObject) // 4. Let body be bodyWithType’s body. const body = bodyWithType[0] // 5. Let length be body’s length, serialized and isomorphic encoded. const length = isomorphicEncode(`${body.length}`) // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence. const type = bodyWithType[1] ?? '' // 7. Return a new response whose status message is `OK`, header list is // « (`Content-Length`, length), (`Content-Type`, type) », and body is body. const response = makeResponse({ statusText: 'OK', headersList: [ ['content-length', { name: 'Content-Length', value: length }], ['content-type', { name: 'Content-Type', value: type }] ] }) response.body = body return Promise.resolve(response) } case 'data:': { // 1. Let dataURLStruct be the result of running the // data: URL processor on request’s current URL. const currentURL = requestCurrentURL(request) const dataURLStruct = dataURLProcessor(currentURL) // 2. If dataURLStruct is failure, then return a // network error. if (dataURLStruct === 'failure') { return Promise.resolve(makeNetworkError('failed to fetch the data URL')) } // 3. Let mimeType be dataURLStruct’s MIME type, serialized. const mimeType = serializeAMimeType(dataURLStruct.mimeType) // 4. Return a response whose status message is `OK`, // header list is « (`Content-Type`, mimeType) », // and body is dataURLStruct’s body as a body. return Promise.resolve(makeResponse({ statusText: 'OK', headersList: [ ['content-type', { name: 'Content-Type', value: mimeType }] ], body: safelyExtractBody(dataURLStruct.body)[0] })) } case 'file:': { // For now, unfortunate as it is, file URLs are left as an exercise for the reader. // When in doubt, return a network error. return Promise.resolve(makeNetworkError('not implemented... yet...')) } case 'http:': case 'https:': { // Return the result of running HTTP fetch given fetchParams. return httpFetch(fetchParams) .catch((err) => makeNetworkError(err)) } default: { return Promise.resolve(makeNetworkError('unknown scheme')) } } } // https://fetch.spec.whatwg.org/#finalize-response function finalizeResponse (fetchParams, response) { // 1. Set fetchParams’s request’s done flag. fetchParams.request.done = true // 2, If fetchParams’s process response done is not null, then queue a fetch // task to run fetchParams’s process response done given response, with // fetchParams’s task destination. if (fetchParams.processResponseDone != null) { queueMicrotask(() => fetchParams.processResponseDone(response)) } } // https://fetch.spec.whatwg.org/#fetch-finale function fetchFinale (fetchParams, response) { // 1. If response is a network error, then: if (response.type === 'error') { // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ». response.urlList = [fetchParams.request.urlList[0]] // 2. Set response’s timing info to the result of creating an opaque timing // info for fetchParams’s timing info. response.timingInfo = createOpaqueTimingInfo({ startTime: fetchParams.timingInfo.startTime }) } // 2. Let processResponseEndOfBody be the following steps: const processResponseEndOfBody = () => { // 1. Set fetchParams’s request’s done flag. fetchParams.request.done = true // If fetchParams’s process response end-of-body is not null, // then queue a fetch task to run fetchParams’s process response // end-of-body given response with fetchParams’s task destination. if (fetchParams.processResponseEndOfBody != null) { queueMicrotask(() => fetchParams.processResponseEndOfBody(response)) } } // 3. If fetchParams’s process response is non-null, then queue a fetch task // to run fetchParams’s process response given response, with fetchParams’s // task destination. if (fetchParams.processResponse != null) { queueMicrotask(() => fetchParams.processResponse(response)) } // 4. If response’s body is null, then run processResponseEndOfBody. if (response.body == null) { processResponseEndOfBody() } else { // 5. Otherwise: // 1. Let transformStream be a new a TransformStream. // 2. Let identityTransformAlgorithm be an algorithm which, given chunk, // enqueues chunk in transformStream. const identityTransformAlgorithm = (chunk, controller) => { controller.enqueue(chunk) } // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm // and flushAlgorithm set to processResponseEndOfBody. const transformStream = new TransformStream({ start () {}, transform: identityTransformAlgorithm, flush: processResponseEndOfBody }, { size () { return 1 } }, { size () { return 1 } }) // 4. Set response’s body to the result of piping response’s body through transformStream. response.body = { stream: response.body.stream.pipeThrough(transformStream) } } // 6. If fetchParams’s process response consume body is non-null, then: if (fetchParams.processResponseConsumeBody != null) { // 1. Let processBody given nullOrBytes be this step: run fetchParams’s // process response consume body given response and nullOrBytes. const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes) // 2. Let processBodyError be this step: run fetchParams’s process // response consume body given response and failure. const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure) // 3. If response’s body is null, then queue a fetch task to run processBody // given null, with fetchParams’s task destination. if (response.body == null) { queueMicrotask(() => processBody(null)) } else { // 4. Otherwise, fully read response’s body given processBody, processBodyError, // and fetchParams’s task destination. return fullyReadBody(response.body, processBody, processBodyError) } return Promise.resolve() } } // https://fetch.spec.whatwg.org/#http-fetch async function httpFetch (fetchParams) { // 1. Let request be fetchParams’s request. const request = fetchParams.request // 2. Let response be null. let response = null // 3. Let actualResponse be null. let actualResponse = null // 4. Let timingInfo be fetchParams’s timing info. const timingInfo = fetchParams.timingInfo // 5. If request’s service-workers mode is "all", then: if (request.serviceWorkers === 'all') { // TODO } // 6. If response is null, then: if (response === null) { // 1. If makeCORSPreflight is true and one of these conditions is true: // TODO // 2. If request’s redirect mode is "follow", then set request’s // service-workers mode to "none". if (request.redirect === 'follow') { request.serviceWorkers = 'none' } // 3. Set response and actualResponse to the result of running // HTTP-network-or-cache fetch given fetchParams. actualResponse = response = await httpNetworkOrCacheFetch(fetchParams) // 4. If request’s response tainting is "cors" and a CORS check // for request and response returns failure, then return a network error. if ( request.responseTainting === 'cors' && corsCheck(request, response) === 'failure' ) { return makeNetworkError('cors failure') } // 5. If the TAO check for request and response returns failure, then set // request’s timing allow failed flag. if (TAOCheck(request, response) === 'failure') { request.timingAllowFailed = true } } // 7. If either request’s response tainting or response’s type // is "opaque", and the cross-origin resource policy check with // request’s origin, request’s client, request’s destination, // and actualResponse returns blocked, then return a network error. if ( (request.responseTainting === 'opaque' || response.type === 'opaque') && crossOriginResourcePolicyCheck( request.origin, request.client, request.destination, actualResponse ) === 'blocked' ) { return makeNetworkError('blocked') } // 8. If actualResponse’s status is a redirect status, then: if (redirectStatusSet.has(actualResponse.status)) { // 1. If actualResponse’s status is not 303, request’s body is not null, // and the connection uses HTTP/2, then user agents may, and are even // encouraged to, transmit an RST_STREAM frame. // See, https://github.com/whatwg/fetch/issues/1288 if (request.redirect !== 'manual') { fetchParams.controller.connection.destroy() } // 2. Switch on request’s redirect mode: if (request.redirect === 'error') { // Set response to a network error. response = makeNetworkError('unexpected redirect') } else if (request.redirect === 'manual') { // Set response to an opaque-redirect filtered response whose internal // response is actualResponse. // NOTE(spec): On the web this would return an `opaqueredirect` response, // but that doesn't make sense server side. // See https://github.com/nodejs/undici/issues/1193. response = actualResponse } else if (request.redirect === 'follow') { // Set response to the result of running HTTP-redirect fetch given // fetchParams and response. response = await httpRedirectFetch(fetchParams, response) } else { assert(false) } } // 9. Set response’s timing info to timingInfo. response.timingInfo = timingInfo // 10. Return response. return response } // https://fetch.spec.whatwg.org/#http-redirect-fetch function httpRedirectFetch (fetchParams, response) { // 1. Let request be fetchParams’s request. const request = fetchParams.request // 2. Let actualResponse be response, if response is not a filtered response, // and response’s internal response otherwise. const actualResponse = response.internalResponse ? response.internalResponse : response // 3. Let locationURL be actualResponse’s location URL given request’s current // URL’s fragment. let locationURL try { locationURL = responseLocationURL( actualResponse, requestCurrentURL(request).hash ) // 4. If locationURL is null, then return response. if (locationURL == null) { return response } } catch (err) { // 5. If locationURL is failure, then return a network error. return Promise.resolve(makeNetworkError(err)) } // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network // error. if (!urlIsHttpHttpsScheme(locationURL)) { return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme')) } // 7. If request’s redirect count is 20, then return a network error. if (request.redirectCount === 20) { return Promise.resolve(makeNetworkError('redirect count exceeded')) } // 8. Increase request’s redirect count by 1. request.redirectCount += 1 // 9. If request’s mode is "cors", locationURL includes credentials, and // request’s origin is not same origin with locationURL’s origin, then return // a network error. if ( request.mode === 'cors' && (locationURL.username || locationURL.password) && !sameOrigin(request, locationURL) ) { return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"')) } // 10. If request’s response tainting is "cors" and locationURL includes // credentials, then return a network error. if ( request.responseTainting === 'cors' && (locationURL.username || locationURL.password) ) { return Promise.resolve(makeNetworkError( 'URL cannot contain credentials for request mode "cors"' )) } // 11. If actualResponse’s status is not 303, request’s body is non-null, // and request’s body’s source is null, then return a network error. if ( actualResponse.status !== 303 && request.body != null && request.body.source == null ) { return Promise.resolve(makeNetworkError()) } // 12. If one of the following is true // - actualResponse’s status is 301 or 302 and request’s method is `POST` // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD` if ( ([301, 302].includes(actualResponse.status) && request.method === 'POST') || (actualResponse.status === 303 && !GET_OR_HEAD.includes(request.method)) ) { // then: // 1. Set request’s method to `GET` and request’s body to null. request.method = 'GET' request.body = null // 2. For each headerName of request-body-header name, delete headerName from // request’s header list. for (const headerName of requestBodyHeader) { request.headersList.delete(headerName) } } // 13. If request’s current URL’s origin is not same origin with locationURL’s // origin, then for each headerName of CORS non-wildcard request-header name, // delete headerName from request’s header list. if (!sameOrigin(requestCurrentURL(request), locationURL)) { // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name request.headersList.delete('authorization') // https://fetch.spec.whatwg.org/#authentication-entries request.headersList.delete('proxy-authorization', true) // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement. request.headersList.delete('cookie') request.headersList.delete('host') } // 14. If request’s body is non-null, then set request’s body to the first return // value of safely extracting request’s body’s source. if (request.body != null) { assert(request.body.source != null) request.body = safelyExtractBody(request.body.source)[0] } // 15. Let timingInfo be fetchParams’s timing info. const timingInfo = fetchParams.timingInfo // 16. Set timingInfo’s redirect end time and post-redirect start time to the // coarsened shared current time given fetchParams’s cross-origin isolated // capability. timingInfo.redirectEndTime = timingInfo.postRedirectStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability) // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s // redirect start time to timingInfo’s start time. if (timingInfo.redirectStartTime === 0) { timingInfo.redirectStartTime = timingInfo.startTime } // 18. Append locationURL to request’s URL list. request.urlList.push(locationURL) // 19. Invoke set request’s referrer policy on redirect on request and // actualResponse. setRequestReferrerPolicyOnRedirect(request, actualResponse) // 20. Return the result of running main fetch given fetchParams and true. return mainFetch(fetchParams, true) } // https://fetch.spec.whatwg.org/#http-network-or-cache-fetch async function httpNetworkOrCacheFetch ( fetchParams, isAuthenticationFetch = false, isNewConnectionFetch = false ) { // 1. Let request be fetchParams’s request. const request = fetchParams.request // 2. Let httpFetchParams be null. let httpFetchParams = null // 3. Let httpRequest be null. let httpRequest = null // 4. Let response be null. let response = null // 5. Let storedResponse be null. // TODO: cache // 6. Let httpCache be null. const httpCache = null // 7. Let the revalidatingFlag be unset. const revalidatingFlag = false // 8. Run these steps, but abort when the ongoing fetch is terminated: // 1. If request’s window is "no-window" and request’s redirect mode is // "error", then set httpFetchParams to fetchParams and httpRequest to // request. if (request.window === 'no-window' && request.redirect === 'error') { httpFetchParams = fetchParams httpRequest = request } else { // Otherwise: // 1. Set httpRequest to a clone of request. httpRequest = makeRequest(request) // 2. Set httpFetchParams to a copy of fetchParams. httpFetchParams = { ...fetchParams } // 3. Set httpFetchParams’s request to httpRequest. httpFetchParams.request = httpRequest } // 3. Let includeCredentials be true if one of const includeCredentials = request.credentials === 'include' || (request.credentials === 'same-origin' && request.responseTainting === 'basic') // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s // body is non-null; otherwise null. const contentLength = httpRequest.body ? httpRequest.body.length : null // 5. Let contentLengthHeaderValue be null. let contentLengthHeaderValue = null // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or // `PUT`, then set contentLengthHeaderValue to `0`. if ( httpRequest.body == null && ['POST', 'PUT'].includes(httpRequest.method) ) { contentLengthHeaderValue = '0' } // 7. If contentLength is non-null, then set contentLengthHeaderValue to // contentLength, serialized and isomorphic encoded. if (contentLength != null) { contentLengthHeaderValue = isomorphicEncode(`${contentLength}`) } // 8. If contentLengthHeaderValue is non-null, then append // `Content-Length`/contentLengthHeaderValue to httpRequest’s header // list. if (contentLengthHeaderValue != null) { httpRequest.headersList.append('content-length', contentLengthHeaderValue) } // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`, // contentLengthHeaderValue) to httpRequest’s header list. // 10. If contentLength is non-null and httpRequest’s keepalive is true, // then: if (contentLength != null && httpRequest.keepalive) { // NOTE: keepalive is a noop outside of browser context. } // 11. If httpRequest’s referrer is a URL, then append // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded, // to httpRequest’s header list. if (httpRequest.referrer instanceof URL) { httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href)) } // 12. Append a request `Origin` header for httpRequest. appendRequestOriginHeader(httpRequest) // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA] appendFetchMetadata(httpRequest) // 14. If httpRequest’s header list does not contain `User-Agent`, then // user agents should append `User-Agent`/default `User-Agent` value to // httpRequest’s header list. if (!httpRequest.headersList.contains('user-agent')) { httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node') } // 15. If httpRequest’s cache mode is "default" and httpRequest’s header // list contains `If-Modified-Since`, `If-None-Match`, // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set // httpRequest’s cache mode to "no-store". if ( httpRequest.cache === 'default' && (httpRequest.headersList.contains('if-modified-since') || httpRequest.headersList.contains('if-none-match') || httpRequest.headersList.contains('if-unmodified-since') || httpRequest.headersList.contains('if-match') || httpRequest.headersList.contains('if-range')) ) { httpRequest.cache = 'no-store' } // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent // no-cache cache-control header modification flag is unset, and // httpRequest’s header list does not contain `Cache-Control`, then append // `Cache-Control`/`max-age=0` to httpRequest’s header list. if ( httpRequest.cache === 'no-cache' && !httpRequest.preventNoCacheCacheControlHeaderModification && !httpRequest.headersList.contains('cache-control') ) { httpRequest.headersList.append('cache-control', 'max-age=0') } // 17. If httpRequest’s cache mode is "no-store" or "reload", then: if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') { // 1. If httpRequest’s header list does not contain `Pragma`, then append // `Pragma`/`no-cache` to httpRequest’s header list. if (!httpRequest.headersList.contains('pragma')) { httpRequest.headersList.append('pragma', 'no-cache') } // 2. If httpRequest’s header list does not contain `Cache-Control`, // then append `Cache-Control`/`no-cache` to httpRequest’s header list. if (!httpRequest.headersList.contains('cache-control')) { httpRequest.headersList.append('cache-control', 'no-cache') } } // 18. If httpRequest’s header list contains `Range`, then append // `Accept-Encoding`/`identity` to httpRequest’s header list. if (httpRequest.headersList.contains('range')) { httpRequest.headersList.append('accept-encoding', 'identity') } // 19. Modify httpRequest’s header list per HTTP. Do not append a given // header if httpRequest’s header list contains that header’s name. // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129 if (!httpRequest.headersList.contains('accept-encoding')) { if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) { httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate') } else { httpRequest.headersList.append('accept-encoding', 'gzip, deflate') } } httpRequest.headersList.delete('host') // 20. If includeCredentials is true, then: if (includeCredentials) { // 1. If the user agent is not configured to block cookies for httpRequest // (see section 7 of [COOKIES]), then: // TODO: credentials // 2. If httpRequest’s header list does not contain `Authorization`, then: // TODO: credentials } // 21. If there’s a proxy-authentication entry, use it as appropriate. // TODO: proxy-authentication // 22. Set httpCache to the result of determining the HTTP cache // partition, given httpRequest. // TODO: cache // 23. If httpCache is null, then set httpRequest’s cache mode to // "no-store". if (httpCache == null) { httpRequest.cache = 'no-store' } // 24. If httpRequest’s cache mode is neither "no-store" nor "reload", // then: if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') { // TODO: cache } // 9. If aborted, then return the appropriate network error for fetchParams. // TODO // 10. If response is null, then: if (response == null) { // 1. If httpRequest’s cache mode is "only-if-cached", then return a // network error. if (httpRequest.mode === 'only-if-cached') { return makeNetworkError('only if cached') } // 2. Let forwardResponse be the result of running HTTP-network fetch // given httpFetchParams, includeCredentials, and isNewConnectionFetch. const forwardResponse = await httpNetworkFetch( httpFetchParams, includeCredentials, isNewConnectionFetch ) // 3. If httpRequest’s method is unsafe and forwardResponse’s status is // in the range 200 to 399, inclusive, invalidate appropriate stored // responses in httpCache, as per the "Invalidation" chapter of HTTP // Caching, and set storedResponse to null. [HTTP-CACHING] if ( !safeMethodsSet.has(httpRequest.method) && forwardResponse.status >= 200 && forwardResponse.status <= 399 ) { // TODO: cache } // 4. If the revalidatingFlag is set and forwardResponse’s status is 304, // then: if (revalidatingFlag && forwardResponse.status === 304) { // TODO: cache } // 5. If response is null, then: if (response == null) { // 1. Set response to forwardResponse. response = forwardResponse // 2. Store httpRequest and forwardResponse in httpCache, as per the // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING] // TODO: cache } } // 11. Set response’s URL list to a clone of httpRequest’s URL list. response.urlList = [...httpRequest.urlList] // 12. If httpRequest’s header list contains `Range`, then set response’s // range-requested flag. if (httpRequest.headersList.contains('range')) { response.rangeRequested = true } // 13. Set response’s request-includes-credentials to includeCredentials. response.requestIncludesCredentials = includeCredentials // 14. If response’s status is 401, httpRequest’s response tainting is not // "cors", includeCredentials is true, and request’s window is an environment // settings object, then: // TODO // 15. If response’s status is 407, then: if (response.status === 407) { // 1. If request’s window is "no-window", then return a network error. if (request.window === 'no-window') { return makeNetworkError() } // 2. ??? // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams. if (isCancelled(fetchParams)) { return makeAppropriateNetworkError(fetchParams) } // 4. Prompt the end user as appropriate in request’s window and store // the result as a proxy-authentication entry. [HTTP-AUTH] // TODO: Invoke some kind of callback? // 5. Set response to the result of running HTTP-network-or-cache fetch given // fetchParams. // TODO return makeNetworkError('proxy authentication required') } // 16. If all of the following are true if ( // response’s status is 421 response.status === 421 && // isNewConnectionFetch is false !isNewConnectionFetch && // request’s body is null, or request’s body is non-null and request’s body’s source is non-null (request.body == null || request.body.source != null) ) { // then: // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams. if (isCancelled(fetchParams)) { return makeAppropriateNetworkError(fetchParams) } // 2. Set response to the result of running HTTP-network-or-cache // fetch given fetchParams, isAuthenticationFetch, and true. // TODO (spec): The spec doesn't specify this but we need to cancel // the active response before we can start a new one. // https://github.com/whatwg/fetch/issues/1293 fetchParams.controller.connection.destroy() response = await httpNetworkOrCacheFetch( fetchParams, isAuthenticationFetch, true ) } // 17. If isAuthenticationFetch is true, then create an authentication entry if (isAuthenticationFetch) { // TODO } // 18. Return response. return response } // https://fetch.spec.whatwg.org/#http-network-fetch async function httpNetworkFetch ( fetchParams, includeCredentials = false, forceNewConnection = false ) { assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed) fetchParams.controller.connection = { abort: null, destroyed: false, destroy (err) { if (!this.destroyed) { this.destroyed = true this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError')) } } } // 1. Let request be fetchParams’s request. const request = fetchParams.request // 2. Let response be null. let response = null // 3. Let timingInfo be fetchParams’s timing info. const timingInfo = fetchParams.timingInfo // 4. Let httpCache be the result of determining the HTTP cache partition, // given request. // TODO: cache const httpCache = null // 5. If httpCache is null, then set request’s cache mode to "no-store". if (httpCache == null) { request.cache = 'no-store' } // 6. Let networkPartitionKey be the result of determining the network // partition key given request. // TODO // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise // "no". const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars // 8. Switch on request’s mode: if (request.mode === 'websocket') { // Let connection be the result of obtaining a WebSocket connection, // given request’s current URL. // TODO } else { // Let connection be the result of obtaining a connection, given // networkPartitionKey, request’s current URL’s origin, // includeCredentials, and forceNewConnection. // TODO } // 9. Run these steps, but abort when the ongoing fetch is terminated: // 1. If connection is failure, then return a network error. // 2. Set timingInfo’s final connection timing info to the result of // calling clamp and coarsen connection timing info with connection’s // timing info, timingInfo’s post-redirect start time, and fetchParams’s // cross-origin isolated capability. // 3. If connection is not an HTTP/2 connection, request’s body is non-null, // and request’s body’s source is null, then append (`Transfer-Encoding`, // `chunked`) to request’s header list. // 4. Set timingInfo’s final network-request start time to the coarsened // shared current time given fetchParams’s cross-origin isolated // capability. // 5. Set response to the result of making an HTTP request over connection // using request with the following caveats: // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS] // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH] // - If request’s body is non-null, and request’s body’s source is null, // then the user agent may have a buffer of up to 64 kibibytes and store // a part of request’s body in that buffer. If the user agent reads from // request’s body beyond that buffer’s size and the user agent needs to // resend request, then instead return a network error. // - Set timingInfo’s final network-response start time to the coarsened // shared current time given fetchParams’s cross-origin isolated capability, // immediately after the user agent’s HTTP parser receives the first byte // of the response (e.g., frame header bytes for HTTP/2 or response status // line for HTTP/1.x). // - Wait until all the headers are transmitted. // - Any responses whose status is in the range 100 to 199, inclusive, // and is not 101, are to be ignored, except for the purposes of setting // timingInfo’s final network-response start time above. // - If request’s header list contains `Transfer-Encoding`/`chunked` and // response is transferred via HTTP/1.0 or older, then return a network // error. // - If the HTTP request results in a TLS client certificate dialog, then: // 1. If request’s window is an environment settings object, make the // dialog available in request’s window. // 2. Otherwise, return a network error. // To transmit request’s body body, run these steps: let requestBody = null // 1. If body is null and fetchParams’s process request end-of-body is // non-null, then queue a fetch task given fetchParams’s process request // end-of-body and fetchParams’s task destination. if (request.body == null && fetchParams.processRequestEndOfBody) { queueMicrotask(() => fetchParams.processRequestEndOfBody()) } else if (request.body != null) { // 2. Otherwise, if body is non-null: // 1. Let processBodyChunk given bytes be these steps: const processBodyChunk = async function * (bytes) { // 1. If the ongoing fetch is terminated, then abort these steps. if (isCancelled(fetchParams)) { return } // 2. Run this step in parallel: transmit bytes. yield bytes // 3. If fetchParams’s process request body is non-null, then run // fetchParams’s process request body given bytes’s length. fetchParams.processRequestBodyChunkLength?.(bytes.byteLength) } // 2. Let processEndOfBody be these steps: const processEndOfBody = () => { // 1. If fetchParams is canceled, then abort these steps. if (isCancelled(fetchParams)) { return } // 2. If fetchParams’s process request end-of-body is non-null, // then run fetchParams’s process request end-of-body. if (fetchParams.processRequestEndOfBody) { fetchParams.processRequestEndOfBody() } } // 3. Let processBodyError given e be these steps: const processBodyError = (e) => { // 1. If fetchParams is canceled, then abort these steps. if (isCancelled(fetchParams)) { return } // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller. if (e.name === 'AbortError') { fetchParams.controller.abort() } else { fetchParams.controller.terminate(e) } } // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody, // processBodyError, and fetchParams’s task destination. requestBody = (async function * () { try { for await (const bytes of request.body.stream) { yield * processBodyChunk(bytes) } processEndOfBody() } catch (err) { processBodyError(err) } })() } try { // socket is only provided for websockets const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody }) if (socket) { response = makeResponse({ status, statusText, headersList, socket }) } else { const iterator = body[Symbol.asyncIterator]() fetchParams.controller.next = () => iterator.next() response = makeResponse({ status, statusText, headersList }) } } catch (err) { // 10. If aborted, then: if (err.name === 'AbortError') { // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame. fetchParams.controller.connection.destroy() // 2. Return the appropriate network error for fetchParams. return makeAppropriateNetworkError(fetchParams, err) } return makeNetworkError(err) } // 11. Let pullAlgorithm be an action that resumes the ongoing fetch // if it is suspended. const pullAlgorithm = () => { fetchParams.controller.resume() } // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s // controller with reason, given reason. const cancelAlgorithm = (reason) => { fetchParams.controller.abort(reason) } // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by // the user agent. // TODO // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent. // TODO // 15. Let stream be a new ReadableStream. // 16. Set up stream with pullAlgorithm set to pullAlgorithm, // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to // highWaterMark, and sizeAlgorithm set to sizeAlgorithm. if (!ReadableStream) { ReadableStream = (__nccwpck_require__(3774).ReadableStream) } const stream = new ReadableStream( { async start (controller) { fetchParams.controller.controller = controller }, async pull (controller) { await pullAlgorithm(controller) }, async cancel (reason) { await cancelAlgorithm(reason) } }, { highWaterMark: 0, size () { return 1 } } ) // 17. Run these steps, but abort when the ongoing fetch is terminated: // 1. Set response’s body to a new body whose stream is stream. response.body = { stream } // 2. If response is not a network error and request’s cache mode is // not "no-store", then update response in httpCache for request. // TODO // 3. If includeCredentials is true and the user agent is not configured // to block cookies for request (see section 7 of [COOKIES]), then run the // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on // the value of each header whose name is a byte-case-insensitive match for // `Set-Cookie` in response’s header list, if any, and request’s current URL. // TODO // 18. If aborted, then: // TODO // 19. Run these steps in parallel: // 1. Run these steps, but abort when fetchParams is canceled: fetchParams.controller.on('terminated', onAborted) fetchParams.controller.resume = async () => { // 1. While true while (true) { // 1-3. See onData... // 4. Set bytes to the result of handling content codings given // codings and bytes. let bytes let isFailure try { const { done, value } = await fetchParams.controller.next() if (isAborted(fetchParams)) { break } bytes = done ? undefined : value } catch (err) { if (fetchParams.controller.ended && !timingInfo.encodedBodySize) { // zlib doesn't like empty streams. bytes = undefined } else { bytes = err // err may be propagated from the result of calling readablestream.cancel, // which might not be an error. https://github.com/nodejs/undici/issues/2009 isFailure = true } } if (bytes === undefined) { // 2. Otherwise, if the bytes transmission for response’s message // body is done normally and stream is readable, then close // stream, finalize response for fetchParams and response, and // abort these in-parallel steps. readableStreamClose(fetchParams.controller.controller) finalizeResponse(fetchParams, response) return } // 5. Increase timingInfo’s decoded body size by bytes’s length. timingInfo.decodedBodySize += bytes?.byteLength ?? 0 // 6. If bytes is failure, then terminate fetchParams’s controller. if (isFailure) { fetchParams.controller.terminate(bytes) return } // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes // into stream. fetchParams.controller.controller.enqueue(new Uint8Array(bytes)) // 8. If stream is errored, then terminate the ongoing fetch. if (isErrored(stream)) { fetchParams.controller.terminate() return } // 9. If stream doesn’t need more data ask the user agent to suspend // the ongoing fetch. if (!fetchParams.controller.controller.desiredSize) { return } } } // 2. If aborted, then: function onAborted (reason) { // 2. If fetchParams is aborted, then: if (isAborted(fetchParams)) { // 1. Set response’s aborted flag. response.aborted = true // 2. If stream is readable, then error stream with the result of // deserialize a serialized abort reason given fetchParams’s // controller’s serialized abort reason and an // implementation-defined realm. if (isReadable(stream)) { fetchParams.controller.controller.error( fetchParams.controller.serializedAbortReason ) } } else { // 3. Otherwise, if stream is readable, error stream with a TypeError. if (isReadable(stream)) { fetchParams.controller.controller.error(new TypeError('terminated', { cause: isErrorLike(reason) ? reason : undefined })) } } // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame. // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so. fetchParams.controller.connection.destroy() } // 20. Return response. return response async function dispatch ({ body }) { const url = requestCurrentURL(request) /** @type {import('../..').Agent} */ const agent = fetchParams.controller.dispatcher return new Promise((resolve, reject) => agent.dispatch( { path: url.pathname + url.search, origin: url.origin, method: request.method, body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body, headers: request.headersList.entries, maxRedirections: 0, upgrade: request.mode === 'websocket' ? 'websocket' : undefined }, { body: null, abort: null, onConnect (abort) { // TODO (fix): Do we need connection here? const { connection } = fetchParams.controller if (connection.destroyed) { abort(new DOMException('The operation was aborted.', 'AbortError')) } else { fetchParams.controller.on('terminated', abort) this.abort = connection.abort = abort } }, onHeaders (status, headersList, resume, statusText) { if (status < 200) { return } let codings = [] let location = '' const headers = new Headers() // For H2, the headers are a plain JS object // We distinguish between them and iterate accordingly if (Array.isArray(headersList)) { for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString('latin1') const val = headersList[n + 1].toString('latin1') if (key.toLowerCase() === 'content-encoding') { // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1 // "All content-coding values are case-insensitive..." codings = val.toLowerCase().split(',').map((x) => x.trim()) } else if (key.toLowerCase() === 'location') { location = val } headers[kHeadersList].append(key, val) } } else { const keys = Object.keys(headersList) for (const key of keys) { const val = headersList[key] if (key.toLowerCase() === 'content-encoding') { // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1 // "All content-coding values are case-insensitive..." codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse() } else if (key.toLowerCase() === 'location') { location = val } headers[kHeadersList].append(key, val) } } this.body = new Readable({ read: resume }) const decoders = [] const willFollow = request.redirect === 'follow' && location && redirectStatusSet.has(status) // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) { for (const coding of codings) { // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2 if (coding === 'x-gzip' || coding === 'gzip') { decoders.push(zlib.createGunzip({ // 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. flush: zlib.constants.Z_SYNC_FLUSH, finishFlush: zlib.constants.Z_SYNC_FLUSH })) } else if (coding === 'deflate') { decoders.push(zlib.createInflate()) } else if (coding === 'br') { decoders.push(zlib.createBrotliDecompress()) } else { decoders.length = 0 break } } } resolve({ status, statusText, headersList: headers[kHeadersList], body: decoders.length ? pipeline(this.body, ...decoders, () => { }) : this.body.on('error', () => {}) }) return true }, onData (chunk) { if (fetchParams.controller.dump) { return } // 1. If one or more bytes have been transmitted from response’s // message body, then: // 1. Let bytes be the transmitted bytes. const bytes = chunk // 2. Let codings be the result of extracting header list values // given `Content-Encoding` and response’s header list. // See pullAlgorithm. // 3. Increase timingInfo’s encoded body size by bytes’s length. timingInfo.encodedBodySize += bytes.byteLength // 4. See pullAlgorithm... return this.body.push(bytes) }, onComplete () { if (this.abort) { fetchParams.controller.off('terminated', this.abort) } fetchParams.controller.ended = true this.body.push(null) }, onError (error) { if (this.abort) { fetchParams.controller.off('terminated', this.abort) } this.body?.destroy(error) fetchParams.controller.terminate(error) reject(error) }, onUpgrade (status, headersList, socket) { if (status !== 101) { return } const headers = new Headers() for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString('latin1') const val = headersList[n + 1].toString('latin1') headers[kHeadersList].append(key, val) } resolve({ status, statusText: STATUS_CODES[status], headersList: headers[kHeadersList], socket }) return true } } )) } } module.exports = { fetch, Fetch, fetching, finalizeAndReportTiming } /***/ }), /***/ 5194: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /* globals AbortController */ const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(8923) const { Headers, fill: fillHeaders, HeadersList } = __nccwpck_require__(6349) const { FinalizationRegistry } = __nccwpck_require__(3194)() const util = __nccwpck_require__(3440) const { isValidHTTPToken, sameOrigin, normalizeMethod, makePolicyContainer, normalizeMethodRecord } = __nccwpck_require__(5523) const { forbiddenMethodsSet, corsSafeListedMethodsSet, referrerPolicy, requestRedirect, requestMode, requestCredentials, requestCache, requestDuplex } = __nccwpck_require__(7326) const { kEnumerableProperty } = util const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(9710) const { webidl } = __nccwpck_require__(4222) const { getGlobalOrigin } = __nccwpck_require__(5628) const { URLSerializer } = __nccwpck_require__(4322) const { kHeadersList, kConstruct } = __nccwpck_require__(6443) const assert = __nccwpck_require__(2613) const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(4434) let TransformStream = globalThis.TransformStream const kAbortController = Symbol('abortController') const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { signal.removeEventListener('abort', abort) }) // https://fetch.spec.whatwg.org/#request-class class Request { // https://fetch.spec.whatwg.org/#dom-request constructor (input, init = {}) { if (input === kConstruct) { return } webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' }) input = webidl.converters.RequestInfo(input) init = webidl.converters.RequestInit(init) // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object this[kRealm] = { settingsObject: { baseUrl: getGlobalOrigin(), get origin () { return this.baseUrl?.origin }, policyContainer: makePolicyContainer() } } // 1. Let request be null. let request = null // 2. Let fallbackMode be null. let fallbackMode = null // 3. Let baseURL be this’s relevant settings object’s API base URL. const baseUrl = this[kRealm].settingsObject.baseUrl // 4. Let signal be null. let signal = null // 5. If input is a string, then: if (typeof input === 'string') { // 1. Let parsedURL be the result of parsing input with baseURL. // 2. If parsedURL is failure, then throw a TypeError. let parsedURL try { parsedURL = new URL(input, baseUrl) } catch (err) { throw new TypeError('Failed to parse URL from ' + input, { cause: err }) } // 3. If parsedURL includes credentials, then throw a TypeError. if (parsedURL.username || parsedURL.password) { throw new TypeError( 'Request cannot be constructed from a URL that includes credentials: ' + input ) } // 4. Set request to a new request whose URL is parsedURL. request = makeRequest({ urlList: [parsedURL] }) // 5. Set fallbackMode to "cors". fallbackMode = 'cors' } else { // 6. Otherwise: // 7. Assert: input is a Request object. assert(input instanceof Request) // 8. Set request to input’s request. request = input[kState] // 9. Set signal to input’s signal. signal = input[kSignal] } // 7. Let origin be this’s relevant settings object’s origin. const origin = this[kRealm].settingsObject.origin // 8. Let window be "client". let window = 'client' // 9. If request’s window is an environment settings object and its origin // is same origin with origin, then set window to request’s window. if ( request.window?.constructor?.name === 'EnvironmentSettingsObject' && sameOrigin(request.window, origin) ) { window = request.window } // 10. If init["window"] exists and is non-null, then throw a TypeError. if (init.window != null) { throw new TypeError(`'window' option '${window}' must be null`) } // 11. If init["window"] exists, then set window to "no-window". if ('window' in init) { window = 'no-window' } // 12. Set request to a new request with the following properties: request = makeRequest({ // URL request’s URL. // undici implementation note: this is set as the first item in request's urlList in makeRequest // method request’s method. method: request.method, // header list A copy of request’s header list. // undici implementation note: headersList is cloned in makeRequest headersList: request.headersList, // unsafe-request flag Set. unsafeRequest: request.unsafeRequest, // client This’s relevant settings object. client: this[kRealm].settingsObject, // window window. window, // priority request’s priority. priority: request.priority, // origin request’s origin. The propagation of the origin is only significant for navigation requests // being handled by a service worker. In this scenario a request can have an origin that is different // from the current client. origin: request.origin, // referrer request’s referrer. referrer: request.referrer, // referrer policy request’s referrer policy. referrerPolicy: request.referrerPolicy, // mode request’s mode. mode: request.mode, // credentials mode request’s credentials mode. credentials: request.credentials, // cache mode request’s cache mode. cache: request.cache, // redirect mode request’s redirect mode. redirect: request.redirect, // integrity metadata request’s integrity metadata. integrity: request.integrity, // keepalive request’s keepalive. keepalive: request.keepalive, // reload-navigation flag request’s reload-navigation flag. reloadNavigation: request.reloadNavigation, // history-navigation flag request’s history-navigation flag. historyNavigation: request.historyNavigation, // URL list A clone of request’s URL list. urlList: [...request.urlList] }) const initHasKey = Object.keys(init).length !== 0 // 13. If init is not empty, then: if (initHasKey) { // 1. If request’s mode is "navigate", then set it to "same-origin". if (request.mode === 'navigate') { request.mode = 'same-origin' } // 2. Unset request’s reload-navigation flag. request.reloadNavigation = false // 3. Unset request’s history-navigation flag. request.historyNavigation = false // 4. Set request’s origin to "client". request.origin = 'client' // 5. Set request’s referrer to "client" request.referrer = 'client' // 6. Set request’s referrer policy to the empty string. request.referrerPolicy = '' // 7. Set request’s URL to request’s current URL. request.url = request.urlList[request.urlList.length - 1] // 8. Set request’s URL list to « request’s URL ». request.urlList = [request.url] } // 14. If init["referrer"] exists, then: if (init.referrer !== undefined) { // 1. Let referrer be init["referrer"]. const referrer = init.referrer // 2. If referrer is the empty string, then set request’s referrer to "no-referrer". if (referrer === '') { request.referrer = 'no-referrer' } else { // 1. Let parsedReferrer be the result of parsing referrer with // baseURL. // 2. If parsedReferrer is failure, then throw a TypeError. let parsedReferrer try { parsedReferrer = new URL(referrer, baseUrl) } catch (err) { throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err }) } // 3. If one of the following is true // - parsedReferrer’s scheme is "about" and path is the string "client" // - parsedReferrer’s origin is not same origin with origin // then set request’s referrer to "client". if ( (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') || (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl)) ) { request.referrer = 'client' } else { // 4. Otherwise, set request’s referrer to parsedReferrer. request.referrer = parsedReferrer } } } // 15. If init["referrerPolicy"] exists, then set request’s referrer policy // to it. if (init.referrerPolicy !== undefined) { request.referrerPolicy = init.referrerPolicy } // 16. Let mode be init["mode"] if it exists, and fallbackMode otherwise. let mode if (init.mode !== undefined) { mode = init.mode } else { mode = fallbackMode } // 17. If mode is "navigate", then throw a TypeError. if (mode === 'navigate') { throw webidl.errors.exception({ header: 'Request constructor', message: 'invalid request mode navigate.' }) } // 18. If mode is non-null, set request’s mode to mode. if (mode != null) { request.mode = mode } // 19. If init["credentials"] exists, then set request’s credentials mode // to it. if (init.credentials !== undefined) { request.credentials = init.credentials } // 18. If init["cache"] exists, then set request’s cache mode to it. if (init.cache !== undefined) { request.cache = init.cache } // 21. If request’s cache mode is "only-if-cached" and request’s mode is // not "same-origin", then throw a TypeError. if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') { throw new TypeError( "'only-if-cached' can be set only with 'same-origin' mode" ) } // 22. If init["redirect"] exists, then set request’s redirect mode to it. if (init.redirect !== undefined) { request.redirect = init.redirect } // 23. If init["integrity"] exists, then set request’s integrity metadata to it. if (init.integrity != null) { request.integrity = String(init.integrity) } // 24. If init["keepalive"] exists, then set request’s keepalive to it. if (init.keepalive !== undefined) { request.keepalive = Boolean(init.keepalive) } // 25. If init["method"] exists, then: if (init.method !== undefined) { // 1. Let method be init["method"]. let method = init.method // 2. If method is not a method or method is a forbidden method, then // throw a TypeError. if (!isValidHTTPToken(method)) { throw new TypeError(`'${method}' is not a valid HTTP method.`) } if (forbiddenMethodsSet.has(method.toUpperCase())) { throw new TypeError(`'${method}' HTTP method is unsupported.`) } // 3. Normalize method. method = normalizeMethodRecord[method] ?? normalizeMethod(method) // 4. Set request’s method to method. request.method = method } // 26. If init["signal"] exists, then set signal to it. if (init.signal !== undefined) { signal = init.signal } // 27. Set this’s request to request. this[kState] = request // 28. Set this’s signal to a new AbortSignal object with this’s relevant // Realm. // TODO: could this be simplified with AbortSignal.any // (https://dom.spec.whatwg.org/#dom-abortsignal-any) const ac = new AbortController() this[kSignal] = ac.signal this[kSignal][kRealm] = this[kRealm] // 29. If signal is not null, then make this’s signal follow signal. if (signal != null) { if ( !signal || typeof signal.aborted !== 'boolean' || typeof signal.addEventListener !== 'function' ) { throw new TypeError( "Failed to construct 'Request': member signal is not of type AbortSignal." ) } if (signal.aborted) { ac.abort(signal.reason) } else { // Keep a strong ref to ac while request object // is alive. This is needed to prevent AbortController // from being prematurely garbage collected. // See, https://github.com/nodejs/undici/issues/1926. this[kAbortController] = ac const acRef = new WeakRef(ac) const abort = function () { const ac = acRef.deref() if (ac !== undefined) { ac.abort(this.reason) } } // Third-party AbortControllers may not work with these. // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619. try { // If the max amount of listeners is equal to the default, increase it // This is only available in node >= v19.9.0 if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) { setMaxListeners(100, signal) } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) { setMaxListeners(100, signal) } } catch {} util.addAbortListener(signal, abort) requestFinalizer.register(ac, { signal, abort }) } } // 30. Set this’s headers to a new Headers object with this’s relevant // Realm, whose header list is request’s header list and guard is // "request". this[kHeaders] = new Headers(kConstruct) this[kHeaders][kHeadersList] = request.headersList this[kHeaders][kGuard] = 'request' this[kHeaders][kRealm] = this[kRealm] // 31. If this’s request’s mode is "no-cors", then: if (mode === 'no-cors') { // 1. If this’s request’s method is not a CORS-safelisted method, // then throw a TypeError. if (!corsSafeListedMethodsSet.has(request.method)) { throw new TypeError( `'${request.method} is unsupported in no-cors mode.` ) } // 2. Set this’s headers’s guard to "request-no-cors". this[kHeaders][kGuard] = 'request-no-cors' } // 32. If init is not empty, then: if (initHasKey) { /** @type {HeadersList} */ const headersList = this[kHeaders][kHeadersList] // 1. Let headers be a copy of this’s headers and its associated header // list. // 2. If init["headers"] exists, then set headers to init["headers"]. const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList) // 3. Empty this’s headers’s header list. headersList.clear() // 4. If headers is a Headers object, then for each header in its header // list, append header’s name/header’s value to this’s headers. if (headers instanceof HeadersList) { for (const [key, val] of headers) { headersList.append(key, val) } // Note: Copy the `set-cookie` meta-data. headersList.cookies = headers.cookies } else { // 5. Otherwise, fill this’s headers with headers. fillHeaders(this[kHeaders], headers) } } // 33. Let inputBody be input’s request’s body if input is a Request // object; otherwise null. const inputBody = input instanceof Request ? input[kState].body : null // 34. If either init["body"] exists and is non-null or inputBody is // non-null, and request’s method is `GET` or `HEAD`, then throw a // TypeError. if ( (init.body != null || inputBody != null) && (request.method === 'GET' || request.method === 'HEAD') ) { throw new TypeError('Request with GET/HEAD method cannot have body.') } // 35. Let initBody be null. let initBody = null // 36. If init["body"] exists and is non-null, then: if (init.body != null) { // 1. Let Content-Type be null. // 2. Set initBody and Content-Type to the result of extracting // init["body"], with keepalive set to request’s keepalive. const [extractedBody, contentType] = extractBody( init.body, request.keepalive ) initBody = extractedBody // 3, If Content-Type is non-null and this’s headers’s header list does // not contain `Content-Type`, then append `Content-Type`/Content-Type to // this’s headers. if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) { this[kHeaders].append('content-type', contentType) } } // 37. Let inputOrInitBody be initBody if it is non-null; otherwise // inputBody. const inputOrInitBody = initBody ?? inputBody // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is // null, then: if (inputOrInitBody != null && inputOrInitBody.source == null) { // 1. If initBody is non-null and init["duplex"] does not exist, // then throw a TypeError. if (initBody != null && init.duplex == null) { throw new TypeError('RequestInit: duplex option is required when sending a body.') } // 2. If this’s request’s mode is neither "same-origin" nor "cors", // then throw a TypeError. if (request.mode !== 'same-origin' && request.mode !== 'cors') { throw new TypeError( 'If request is made from ReadableStream, mode should be "same-origin" or "cors"' ) } // 3. Set this’s request’s use-CORS-preflight flag. request.useCORSPreflightFlag = true } // 39. Let finalBody be inputOrInitBody. let finalBody = inputOrInitBody // 40. If initBody is null and inputBody is non-null, then: if (initBody == null && inputBody != null) { // 1. If input is unusable, then throw a TypeError. if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) { throw new TypeError( 'Cannot construct a Request with a Request object that has already been used.' ) } // 2. Set finalBody to the result of creating a proxy for inputBody. if (!TransformStream) { TransformStream = (__nccwpck_require__(3774).TransformStream) } // https://streams.spec.whatwg.org/#readablestream-create-a-proxy const identityTransform = new TransformStream() inputBody.stream.pipeThrough(identityTransform) finalBody = { source: inputBody.source, length: inputBody.length, stream: identityTransform.readable } } // 41. Set this’s request’s body to finalBody. this[kState].body = finalBody } // Returns request’s HTTP method, which is "GET" by default. get method () { webidl.brandCheck(this, Request) // The method getter steps are to return this’s request’s method. return this[kState].method } // Returns the URL of request as a string. get url () { webidl.brandCheck(this, Request) // The url getter steps are to return this’s request’s URL, serialized. return URLSerializer(this[kState].url) } // Returns a Headers object consisting of the headers associated with request. // Note that headers added in the network layer by the user agent will not // be accounted for in this object, e.g., the "Host" header. get headers () { webidl.brandCheck(this, Request) // The headers getter steps are to return this’s headers. return this[kHeaders] } // Returns the kind of resource requested by request, e.g., "document" // or "script". get destination () { webidl.brandCheck(this, Request) // The destination getter are to return this’s request’s destination. return this[kState].destination } // Returns the referrer of request. Its value can be a same-origin URL if // explicitly set in init, the empty string to indicate no referrer, and // "about:client" when defaulting to the global’s default. This is used // during fetching to determine the value of the `Referer` header of the // request being made. get referrer () { webidl.brandCheck(this, Request) // 1. If this’s request’s referrer is "no-referrer", then return the // empty string. if (this[kState].referrer === 'no-referrer') { return '' } // 2. If this’s request’s referrer is "client", then return // "about:client". if (this[kState].referrer === 'client') { return 'about:client' } // Return this’s request’s referrer, serialized. return this[kState].referrer.toString() } // Returns the referrer policy associated with request. // This is used during fetching to compute the value of the request’s // referrer. get referrerPolicy () { webidl.brandCheck(this, Request) // The referrerPolicy getter steps are to return this’s request’s referrer policy. return this[kState].referrerPolicy } // Returns the mode associated with request, which is a string indicating // whether the request will use CORS, or will be restricted to same-origin // URLs. get mode () { webidl.brandCheck(this, Request) // The mode getter steps are to return this’s request’s mode. return this[kState].mode } // Returns the credentials mode associated with request, // which is a string indicating whether credentials will be sent with the // request always, never, or only when sent to a same-origin URL. get credentials () { // The credentials getter steps are to return this’s request’s credentials mode. return this[kState].credentials } // Returns the cache mode associated with request, // which is a string indicating how the request will // interact with the browser’s cache when fetching. get cache () { webidl.brandCheck(this, Request) // The cache getter steps are to return this’s request’s cache mode. return this[kState].cache } // Returns the redirect mode associated with request, // which is a string indicating how redirects for the // request will be handled during fetching. A request // will follow redirects by default. get redirect () { webidl.brandCheck(this, Request) // The redirect getter steps are to return this’s request’s redirect mode. return this[kState].redirect } // Returns request’s subresource integrity metadata, which is a // cryptographic hash of the resource being fetched. Its value // consists of multiple hashes separated by whitespace. [SRI] get integrity () { webidl.brandCheck(this, Request) // The integrity getter steps are to return this’s request’s integrity // metadata. return this[kState].integrity } // Returns a boolean indicating whether or not request can outlive the // global in which it was created. get keepalive () { webidl.brandCheck(this, Request) // The keepalive getter steps are to return this’s request’s keepalive. return this[kState].keepalive } // Returns a boolean indicating whether or not request is for a reload // navigation. get isReloadNavigation () { webidl.brandCheck(this, Request) // The isReloadNavigation getter steps are to return true if this’s // request’s reload-navigation flag is set; otherwise false. return this[kState].reloadNavigation } // Returns a boolean indicating whether or not request is for a history // navigation (a.k.a. back-foward navigation). get isHistoryNavigation () { webidl.brandCheck(this, Request) // The isHistoryNavigation getter steps are to return true if this’s request’s // history-navigation flag is set; otherwise false. return this[kState].historyNavigation } // Returns the signal associated with request, which is an AbortSignal // object indicating whether or not request has been aborted, and its // abort event handler. get signal () { webidl.brandCheck(this, Request) // The signal getter steps are to return this’s signal. return this[kSignal] } get body () { webidl.brandCheck(this, Request) return this[kState].body ? this[kState].body.stream : null } get bodyUsed () { webidl.brandCheck(this, Request) return !!this[kState].body && util.isDisturbed(this[kState].body.stream) } get duplex () { webidl.brandCheck(this, Request) return 'half' } // Returns a clone of request. clone () { webidl.brandCheck(this, Request) // 1. If this is unusable, then throw a TypeError. if (this.bodyUsed || this.body?.locked) { throw new TypeError('unusable') } // 2. Let clonedRequest be the result of cloning this’s request. const clonedRequest = cloneRequest(this[kState]) // 3. Let clonedRequestObject be the result of creating a Request object, // given clonedRequest, this’s headers’s guard, and this’s relevant Realm. const clonedRequestObject = new Request(kConstruct) clonedRequestObject[kState] = clonedRequest clonedRequestObject[kRealm] = this[kRealm] clonedRequestObject[kHeaders] = new Headers(kConstruct) clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard] clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm] // 4. Make clonedRequestObject’s signal follow this’s signal. const ac = new AbortController() if (this.signal.aborted) { ac.abort(this.signal.reason) } else { util.addAbortListener( this.signal, () => { ac.abort(this.signal.reason) } ) } clonedRequestObject[kSignal] = ac.signal // 4. Return clonedRequestObject. return clonedRequestObject } } mixinBody(Request) function makeRequest (init) { // https://fetch.spec.whatwg.org/#requests const request = { method: 'GET', localURLsOnly: false, unsafeRequest: false, body: null, client: null, reservedClient: null, replacesClientId: '', window: 'client', keepalive: false, serviceWorkers: 'all', initiator: '', destination: '', priority: null, origin: 'client', policyContainer: 'client', referrer: 'client', referrerPolicy: '', mode: 'no-cors', useCORSPreflightFlag: false, credentials: 'same-origin', useCredentials: false, cache: 'default', redirect: 'follow', integrity: '', cryptoGraphicsNonceMetadata: '', parserMetadata: '', reloadNavigation: false, historyNavigation: false, userActivation: false, taintedOrigin: false, redirectCount: 0, responseTainting: 'basic', preventNoCacheCacheControlHeaderModification: false, done: false, timingAllowFailed: false, ...init, headersList: init.headersList ? new HeadersList(init.headersList) : new HeadersList() } request.url = request.urlList[0] return request } // https://fetch.spec.whatwg.org/#concept-request-clone function cloneRequest (request) { // To clone a request request, run these steps: // 1. Let newRequest be a copy of request, except for its body. const newRequest = makeRequest({ ...request, body: null }) // 2. If request’s body is non-null, set newRequest’s body to the // result of cloning request’s body. if (request.body != null) { newRequest.body = cloneBody(request.body) } // 3. Return newRequest. return newRequest } Object.defineProperties(Request.prototype, { method: kEnumerableProperty, url: kEnumerableProperty, headers: kEnumerableProperty, redirect: kEnumerableProperty, clone: kEnumerableProperty, signal: kEnumerableProperty, duplex: kEnumerableProperty, destination: kEnumerableProperty, body: kEnumerableProperty, bodyUsed: kEnumerableProperty, isHistoryNavigation: kEnumerableProperty, isReloadNavigation: kEnumerableProperty, keepalive: kEnumerableProperty, integrity: kEnumerableProperty, cache: kEnumerableProperty, credentials: kEnumerableProperty, attribute: kEnumerableProperty, referrerPolicy: kEnumerableProperty, referrer: kEnumerableProperty, mode: kEnumerableProperty, [Symbol.toStringTag]: { value: 'Request', configurable: true } }) webidl.converters.Request = webidl.interfaceConverter( Request ) // https://fetch.spec.whatwg.org/#requestinfo webidl.converters.RequestInfo = function (V) { if (typeof V === 'string') { return webidl.converters.USVString(V) } if (V instanceof Request) { return webidl.converters.Request(V) } return webidl.converters.USVString(V) } webidl.converters.AbortSignal = webidl.interfaceConverter( AbortSignal ) // https://fetch.spec.whatwg.org/#requestinit webidl.converters.RequestInit = webidl.dictionaryConverter([ { key: 'method', converter: webidl.converters.ByteString }, { key: 'headers', converter: webidl.converters.HeadersInit }, { key: 'body', converter: webidl.nullableConverter( webidl.converters.BodyInit ) }, { key: 'referrer', converter: webidl.converters.USVString }, { key: 'referrerPolicy', converter: webidl.converters.DOMString, // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy allowedValues: referrerPolicy }, { key: 'mode', converter: webidl.converters.DOMString, // https://fetch.spec.whatwg.org/#concept-request-mode allowedValues: requestMode }, { key: 'credentials', converter: webidl.converters.DOMString, // https://fetch.spec.whatwg.org/#requestcredentials allowedValues: requestCredentials }, { key: 'cache', converter: webidl.converters.DOMString, // https://fetch.spec.whatwg.org/#requestcache allowedValues: requestCache }, { key: 'redirect', converter: webidl.converters.DOMString, // https://fetch.spec.whatwg.org/#requestredirect allowedValues: requestRedirect }, { key: 'integrity', converter: webidl.converters.DOMString }, { key: 'keepalive', converter: webidl.converters.boolean }, { key: 'signal', converter: webidl.nullableConverter( (signal) => webidl.converters.AbortSignal( signal, { strict: false } ) ) }, { key: 'window', converter: webidl.converters.any }, { key: 'duplex', converter: webidl.converters.DOMString, allowedValues: requestDuplex } ]) module.exports = { Request, makeRequest } /***/ }), /***/ 8676: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { Headers, HeadersList, fill } = __nccwpck_require__(6349) const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(8923) const util = __nccwpck_require__(3440) const { kEnumerableProperty } = util const { isValidReasonPhrase, isCancelled, isAborted, isBlobLike, serializeJavascriptValueToJSONString, isErrorLike, isomorphicEncode } = __nccwpck_require__(5523) const { redirectStatusSet, nullBodyStatus, DOMException } = __nccwpck_require__(7326) const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(9710) const { webidl } = __nccwpck_require__(4222) const { FormData } = __nccwpck_require__(3073) const { getGlobalOrigin } = __nccwpck_require__(5628) const { URLSerializer } = __nccwpck_require__(4322) const { kHeadersList, kConstruct } = __nccwpck_require__(6443) const assert = __nccwpck_require__(2613) const { types } = __nccwpck_require__(9023) const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(3774).ReadableStream) const textEncoder = new TextEncoder('utf-8') // https://fetch.spec.whatwg.org/#response-class class Response { // Creates network error Response. static error () { // TODO const relevantRealm = { settingsObject: {} } // The static error() method steps are to return the result of creating a // Response object, given a new network error, "immutable", and this’s // relevant Realm. const responseObject = new Response() responseObject[kState] = makeNetworkError() responseObject[kRealm] = relevantRealm responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList responseObject[kHeaders][kGuard] = 'immutable' responseObject[kHeaders][kRealm] = relevantRealm return responseObject } // https://fetch.spec.whatwg.org/#dom-response-json static json (data, init = {}) { webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' }) if (init !== null) { init = webidl.converters.ResponseInit(init) } // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data. const bytes = textEncoder.encode( serializeJavascriptValueToJSONString(data) ) // 2. Let body be the result of extracting bytes. const body = extractBody(bytes) // 3. Let responseObject be the result of creating a Response object, given a new response, // "response", and this’s relevant Realm. const relevantRealm = { settingsObject: {} } const responseObject = new Response() responseObject[kRealm] = relevantRealm responseObject[kHeaders][kGuard] = 'response' responseObject[kHeaders][kRealm] = relevantRealm // 4. Perform initialize a response given responseObject, init, and (body, "application/json"). initializeResponse(responseObject, init, { body: body[0], type: 'application/json' }) // 5. Return responseObject. return responseObject } // Creates a redirect Response that redirects to url with status status. static redirect (url, status = 302) { const relevantRealm = { settingsObject: {} } webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' }) url = webidl.converters.USVString(url) status = webidl.converters['unsigned short'](status) // 1. Let parsedURL be the result of parsing url with current settings // object’s API base URL. // 2. If parsedURL is failure, then throw a TypeError. // TODO: base-URL? let parsedURL try { parsedURL = new URL(url, getGlobalOrigin()) } catch (err) { throw Object.assign(new TypeError('Failed to parse URL from ' + url), { cause: err }) } // 3. If status is not a redirect status, then throw a RangeError. if (!redirectStatusSet.has(status)) { throw new RangeError('Invalid status code ' + status) } // 4. Let responseObject be the result of creating a Response object, // given a new response, "immutable", and this’s relevant Realm. const responseObject = new Response() responseObject[kRealm] = relevantRealm responseObject[kHeaders][kGuard] = 'immutable' responseObject[kHeaders][kRealm] = relevantRealm // 5. Set responseObject’s response’s status to status. responseObject[kState].status = status // 6. Let value be parsedURL, serialized and isomorphic encoded. const value = isomorphicEncode(URLSerializer(parsedURL)) // 7. Append `Location`/value to responseObject’s response’s header list. responseObject[kState].headersList.append('location', value) // 8. Return responseObject. return responseObject } // https://fetch.spec.whatwg.org/#dom-response constructor (body = null, init = {}) { if (body !== null) { body = webidl.converters.BodyInit(body) } init = webidl.converters.ResponseInit(init) // TODO this[kRealm] = { settingsObject: {} } // 1. Set this’s response to a new response. this[kState] = makeResponse({}) // 2. Set this’s headers to a new Headers object with this’s relevant // Realm, whose header list is this’s response’s header list and guard // is "response". this[kHeaders] = new Headers(kConstruct) this[kHeaders][kGuard] = 'response' this[kHeaders][kHeadersList] = this[kState].headersList this[kHeaders][kRealm] = this[kRealm] // 3. Let bodyWithType be null. let bodyWithType = null // 4. If body is non-null, then set bodyWithType to the result of extracting body. if (body != null) { const [extractedBody, type] = extractBody(body) bodyWithType = { body: extractedBody, type } } // 5. Perform initialize a response given this, init, and bodyWithType. initializeResponse(this, init, bodyWithType) } // Returns response’s type, e.g., "cors". get type () { webidl.brandCheck(this, Response) // The type getter steps are to return this’s response’s type. return this[kState].type } // Returns response’s URL, if it has one; otherwise the empty string. get url () { webidl.brandCheck(this, Response) const urlList = this[kState].urlList // The url getter steps are to return the empty string if this’s // response’s URL is null; otherwise this’s response’s URL, // serialized with exclude fragment set to true. const url = urlList[urlList.length - 1] ?? null if (url === null) { return '' } return URLSerializer(url, true) } // Returns whether response was obtained through a redirect. get redirected () { webidl.brandCheck(this, Response) // The redirected getter steps are to return true if this’s response’s URL // list has more than one item; otherwise false. return this[kState].urlList.length > 1 } // Returns response’s status. get status () { webidl.brandCheck(this, Response) // The status getter steps are to return this’s response’s status. return this[kState].status } // Returns whether response’s status is an ok status. get ok () { webidl.brandCheck(this, Response) // The ok getter steps are to return true if this’s response’s status is an // ok status; otherwise false. return this[kState].status >= 200 && this[kState].status <= 299 } // Returns response’s status message. get statusText () { webidl.brandCheck(this, Response) // The statusText getter steps are to return this’s response’s status // message. return this[kState].statusText } // Returns response’s headers as Headers. get headers () { webidl.brandCheck(this, Response) // The headers getter steps are to return this’s headers. return this[kHeaders] } get body () { webidl.brandCheck(this, Response) return this[kState].body ? this[kState].body.stream : null } get bodyUsed () { webidl.brandCheck(this, Response) return !!this[kState].body && util.isDisturbed(this[kState].body.stream) } // Returns a clone of response. clone () { webidl.brandCheck(this, Response) // 1. If this is unusable, then throw a TypeError. if (this.bodyUsed || (this.body && this.body.locked)) { throw webidl.errors.exception({ header: 'Response.clone', message: 'Body has already been consumed.' }) } // 2. Let clonedResponse be the result of cloning this’s response. const clonedResponse = cloneResponse(this[kState]) // 3. Return the result of creating a Response object, given // clonedResponse, this’s headers’s guard, and this’s relevant Realm. const clonedResponseObject = new Response() clonedResponseObject[kState] = clonedResponse clonedResponseObject[kRealm] = this[kRealm] clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard] clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm] return clonedResponseObject } } mixinBody(Response) Object.defineProperties(Response.prototype, { type: kEnumerableProperty, url: kEnumerableProperty, status: kEnumerableProperty, ok: kEnumerableProperty, redirected: kEnumerableProperty, statusText: kEnumerableProperty, headers: kEnumerableProperty, clone: kEnumerableProperty, body: kEnumerableProperty, bodyUsed: kEnumerableProperty, [Symbol.toStringTag]: { value: 'Response', configurable: true } }) Object.defineProperties(Response, { json: kEnumerableProperty, redirect: kEnumerableProperty, error: kEnumerableProperty }) // https://fetch.spec.whatwg.org/#concept-response-clone function cloneResponse (response) { // To clone a response response, run these steps: // 1. If response is a filtered response, then return a new identical // filtered response whose internal response is a clone of response’s // internal response. if (response.internalResponse) { return filterResponse( cloneResponse(response.internalResponse), response.type ) } // 2. Let newResponse be a copy of response, except for its body. const newResponse = makeResponse({ ...response, body: null }) // 3. If response’s body is non-null, then set newResponse’s body to the // result of cloning response’s body. if (response.body != null) { newResponse.body = cloneBody(response.body) } // 4. Return newResponse. return newResponse } function makeResponse (init) { return { aborted: false, rangeRequested: false, timingAllowPassed: false, requestIncludesCredentials: false, type: 'default', status: 200, timingInfo: null, cacheState: '', statusText: '', ...init, headersList: init.headersList ? new HeadersList(init.headersList) : new HeadersList(), urlList: init.urlList ? [...init.urlList] : [] } } function makeNetworkError (reason) { const isError = isErrorLike(reason) return makeResponse({ type: 'error', status: 0, error: isError ? reason : new Error(reason ? String(reason) : reason), aborted: reason && reason.name === 'AbortError' }) } function makeFilteredResponse (response, state) { state = { internalResponse: response, ...state } return new Proxy(response, { get (target, p) { return p in state ? state[p] : target[p] }, set (target, p, value) { assert(!(p in state)) target[p] = value return true } }) } // https://fetch.spec.whatwg.org/#concept-filtered-response function filterResponse (response, type) { // Set response to the following filtered response with response as its // internal response, depending on request’s response tainting: if (type === 'basic') { // A basic filtered response is a filtered response whose type is "basic" // and header list excludes any headers in internal response’s header list // whose name is a forbidden response-header name. // Note: undici does not implement forbidden response-header names return makeFilteredResponse(response, { type: 'basic', headersList: response.headersList }) } else if (type === 'cors') { // A CORS filtered response is a filtered response whose type is "cors" // and header list excludes any headers in internal response’s header // list whose name is not a CORS-safelisted response-header name, given // internal response’s CORS-exposed header-name list. // Note: undici does not implement CORS-safelisted response-header names return makeFilteredResponse(response, { type: 'cors', headersList: response.headersList }) } else if (type === 'opaque') { // An opaque filtered response is a filtered response whose type is // "opaque", URL list is the empty list, status is 0, status message // is the empty byte sequence, header list is empty, and body is null. return makeFilteredResponse(response, { type: 'opaque', urlList: Object.freeze([]), status: 0, statusText: '', body: null }) } else if (type === 'opaqueredirect') { // An opaque-redirect filtered response is a filtered response whose type // is "opaqueredirect", status is 0, status message is the empty byte // sequence, header list is empty, and body is null. return makeFilteredResponse(response, { type: 'opaqueredirect', status: 0, statusText: '', headersList: [], body: null }) } else { assert(false) } } // https://fetch.spec.whatwg.org/#appropriate-network-error function makeAppropriateNetworkError (fetchParams, err = null) { // 1. Assert: fetchParams is canceled. assert(isCancelled(fetchParams)) // 2. Return an aborted network error if fetchParams is aborted; // otherwise return a network error. return isAborted(fetchParams) ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err })) : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err })) } // https://whatpr.org/fetch/1392.html#initialize-a-response function initializeResponse (response, init, body) { // 1. If init["status"] is not in the range 200 to 599, inclusive, then // throw a RangeError. if (init.status !== null && (init.status < 200 || init.status > 599)) { throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.') } // 2. If init["statusText"] does not match the reason-phrase token production, // then throw a TypeError. if ('statusText' in init && init.statusText != null) { // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2: // reason-phrase = *( HTAB / SP / VCHAR / obs-text ) if (!isValidReasonPhrase(String(init.statusText))) { throw new TypeError('Invalid statusText') } } // 3. Set response’s response’s status to init["status"]. if ('status' in init && init.status != null) { response[kState].status = init.status } // 4. Set response’s response’s status message to init["statusText"]. if ('statusText' in init && init.statusText != null) { response[kState].statusText = init.statusText } // 5. If init["headers"] exists, then fill response’s headers with init["headers"]. if ('headers' in init && init.headers != null) { fill(response[kHeaders], init.headers) } // 6. If body was given, then: if (body) { // 1. If response's status is a null body status, then throw a TypeError. if (nullBodyStatus.includes(response.status)) { throw webidl.errors.exception({ header: 'Response constructor', message: 'Invalid response status code ' + response.status }) } // 2. Set response's body to body's body. response[kState].body = body.body // 3. If body's type is non-null and response's header list does not contain // `Content-Type`, then append (`Content-Type`, body's type) to response's header list. if (body.type != null && !response[kState].headersList.contains('Content-Type')) { response[kState].headersList.append('content-type', body.type) } } } webidl.converters.ReadableStream = webidl.interfaceConverter( ReadableStream ) webidl.converters.FormData = webidl.interfaceConverter( FormData ) webidl.converters.URLSearchParams = webidl.interfaceConverter( URLSearchParams ) // https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit webidl.converters.XMLHttpRequestBodyInit = function (V) { if (typeof V === 'string') { return webidl.converters.USVString(V) } if (isBlobLike(V)) { return webidl.converters.Blob(V, { strict: false }) } if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) { return webidl.converters.BufferSource(V) } if (util.isFormDataLike(V)) { return webidl.converters.FormData(V, { strict: false }) } if (V instanceof URLSearchParams) { return webidl.converters.URLSearchParams(V) } return webidl.converters.DOMString(V) } // https://fetch.spec.whatwg.org/#bodyinit webidl.converters.BodyInit = function (V) { if (V instanceof ReadableStream) { return webidl.converters.ReadableStream(V) } // Note: the spec doesn't include async iterables, // this is an undici extension. if (V?.[Symbol.asyncIterator]) { return V } return webidl.converters.XMLHttpRequestBodyInit(V) } webidl.converters.ResponseInit = webidl.dictionaryConverter([ { key: 'status', converter: webidl.converters['unsigned short'], defaultValue: 200 }, { key: 'statusText', converter: webidl.converters.ByteString, defaultValue: '' }, { key: 'headers', converter: webidl.converters.HeadersInit } ]) module.exports = { makeNetworkError, makeResponse, makeAppropriateNetworkError, filterResponse, Response, cloneResponse } /***/ }), /***/ 9710: /***/ ((module) => { module.exports = { kUrl: Symbol('url'), kHeaders: Symbol('headers'), kSignal: Symbol('signal'), kState: Symbol('state'), kGuard: Symbol('guard'), kRealm: Symbol('realm') } /***/ }), /***/ 5523: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(7326) const { getGlobalOrigin } = __nccwpck_require__(5628) const { performance } = __nccwpck_require__(2987) const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3440) const assert = __nccwpck_require__(2613) const { isUint8Array } = __nccwpck_require__(8253) let supportedHashes = [] // https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable /** @type {import('crypto')|undefined} */ let crypto try { crypto = __nccwpck_require__(6982) const possibleRelevantHashes = ['sha256', 'sha384', 'sha512'] supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)) /* c8 ignore next 3 */ } catch { } function responseURL (response) { // https://fetch.spec.whatwg.org/#responses // A response has an associated URL. It is a pointer to the last URL // in response’s URL list and null if response’s URL list is empty. const urlList = response.urlList const length = urlList.length return length === 0 ? null : urlList[length - 1].toString() } // https://fetch.spec.whatwg.org/#concept-response-location-url function responseLocationURL (response, requestFragment) { // 1. If response’s status is not a redirect status, then return null. if (!redirectStatusSet.has(response.status)) { return null } // 2. Let location be the result of extracting header list values given // `Location` and response’s header list. let location = response.headersList.get('location') // 3. If location is a header value, then set location to the result of // parsing location with response’s URL. if (location !== null && isValidHeaderValue(location)) { location = new URL(location, responseURL(response)) } // 4. If location is a URL whose fragment is null, then set location’s // fragment to requestFragment. if (location && !location.hash) { location.hash = requestFragment } // 5. Return location. return location } /** @returns {URL} */ function requestCurrentURL (request) { return request.urlList[request.urlList.length - 1] } function requestBadPort (request) { // 1. Let url be request’s current URL. const url = requestCurrentURL(request) // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port, // then return blocked. if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) { return 'blocked' } // 3. Return allowed. return 'allowed' } function isErrorLike (object) { return object instanceof Error || ( object?.constructor?.name === 'Error' || object?.constructor?.name === 'DOMException' ) } // Check whether |statusText| is a ByteString and // matches the Reason-Phrase token production. // RFC 2616: https://tools.ietf.org/html/rfc2616 // RFC 7230: https://tools.ietf.org/html/rfc7230 // "reason-phrase = *( HTAB / SP / VCHAR / obs-text )" // https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116 function isValidReasonPhrase (statusText) { for (let i = 0; i < statusText.length; ++i) { const c = statusText.charCodeAt(i) if ( !( ( c === 0x09 || // HTAB (c >= 0x20 && c <= 0x7e) || // SP / VCHAR (c >= 0x80 && c <= 0xff) ) // obs-text ) ) { return false } } return true } /** * @see https://tools.ietf.org/html/rfc7230#section-3.2.6 * @param {number} c */ function isTokenCharCode (c) { switch (c) { case 0x22: case 0x28: case 0x29: case 0x2c: case 0x2f: case 0x3a: case 0x3b: case 0x3c: case 0x3d: case 0x3e: case 0x3f: case 0x40: case 0x5b: case 0x5c: case 0x5d: case 0x7b: case 0x7d: // DQUOTE and "(),/:;<=>?@[\]{}" return false default: // VCHAR %x21-7E return c >= 0x21 && c <= 0x7e } } /** * @param {string} characters */ function isValidHTTPToken (characters) { if (characters.length === 0) { return false } for (let i = 0; i < characters.length; ++i) { if (!isTokenCharCode(characters.charCodeAt(i))) { return false } } return true } /** * @see https://fetch.spec.whatwg.org/#header-name * @param {string} potentialValue */ function isValidHeaderName (potentialValue) { return isValidHTTPToken(potentialValue) } /** * @see https://fetch.spec.whatwg.org/#header-value * @param {string} potentialValue */ function isValidHeaderValue (potentialValue) { // - Has no leading or trailing HTTP tab or space bytes. // - Contains no 0x00 (NUL) or HTTP newline bytes. if ( potentialValue.startsWith('\t') || potentialValue.startsWith(' ') || potentialValue.endsWith('\t') || potentialValue.endsWith(' ') ) { return false } if ( potentialValue.includes('\0') || potentialValue.includes('\r') || potentialValue.includes('\n') ) { return false } return true } // https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect function setRequestReferrerPolicyOnRedirect (request, actualResponse) { // Given a request request and a response actualResponse, this algorithm // updates request’s referrer policy according to the Referrer-Policy // header (if any) in actualResponse. // 1. Let policy be the result of executing § 8.1 Parse a referrer policy // from a Referrer-Policy header on actualResponse. // 8.1 Parse a referrer policy from a Referrer-Policy header // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list. const { headersList } = actualResponse // 2. Let policy be the empty string. // 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty string, then set policy to token. // 4. Return policy. const policyHeader = (headersList.get('referrer-policy') ?? '').split(',') // Note: As the referrer-policy can contain multiple policies // separated by comma, we need to loop through all of them // and pick the first valid one. // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy let policy = '' if (policyHeader.length > 0) { // The right-most policy takes precedence. // The left-most policy is the fallback. for (let i = policyHeader.length; i !== 0; i--) { const token = policyHeader[i - 1].trim() if (referrerPolicyTokens.has(token)) { policy = token break } } } // 2. If policy is not the empty string, then set request’s referrer policy to policy. if (policy !== '') { request.referrerPolicy = policy } } // https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check function crossOriginResourcePolicyCheck () { // TODO return 'allowed' } // https://fetch.spec.whatwg.org/#concept-cors-check function corsCheck () { // TODO return 'success' } // https://fetch.spec.whatwg.org/#concept-tao-check function TAOCheck () { // TODO return 'success' } function appendFetchMetadata (httpRequest) { // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header // TODO // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header // 1. Assert: r’s url is a potentially trustworthy URL. // TODO // 2. Let header be a Structured Header whose value is a token. let header = null // 3. Set header’s value to r’s mode. header = httpRequest.mode // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list. httpRequest.headersList.set('sec-fetch-mode', header) // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header // TODO // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header // TODO } // https://fetch.spec.whatwg.org/#append-a-request-origin-header function appendRequestOriginHeader (request) { // 1. Let serializedOrigin be the result of byte-serializing a request origin with request. let serializedOrigin = request.origin // 2. If request’s response tainting is "cors" or request’s mode is "websocket", then append (`Origin`, serializedOrigin) to request’s header list. if (request.responseTainting === 'cors' || request.mode === 'websocket') { if (serializedOrigin) { request.headersList.append('origin', serializedOrigin) } // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then: } else if (request.method !== 'GET' && request.method !== 'HEAD') { // 1. Switch on request’s referrer policy: switch (request.referrerPolicy) { case 'no-referrer': // Set serializedOrigin to `null`. serializedOrigin = null break case 'no-referrer-when-downgrade': case 'strict-origin': case 'strict-origin-when-cross-origin': // If request’s origin is a tuple origin, its scheme is "https", and request’s current URL’s scheme is not "https", then set serializedOrigin to `null`. if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) { serializedOrigin = null } break case 'same-origin': // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`. if (!sameOrigin(request, requestCurrentURL(request))) { serializedOrigin = null } break default: // Do nothing. } if (serializedOrigin) { // 2. Append (`Origin`, serializedOrigin) to request’s header list. request.headersList.append('origin', serializedOrigin) } } } function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) { // TODO return performance.now() } // https://fetch.spec.whatwg.org/#create-an-opaque-timing-info function createOpaqueTimingInfo (timingInfo) { return { startTime: timingInfo.startTime ?? 0, redirectStartTime: 0, redirectEndTime: 0, postRedirectStartTime: timingInfo.startTime ?? 0, finalServiceWorkerStartTime: 0, finalNetworkResponseStartTime: 0, finalNetworkRequestStartTime: 0, endTime: 0, encodedBodySize: 0, decodedBodySize: 0, finalConnectionTimingInfo: null } } // https://html.spec.whatwg.org/multipage/origin.html#policy-container function makePolicyContainer () { // Note: the fetch spec doesn't make use of embedder policy or CSP list return { referrerPolicy: 'strict-origin-when-cross-origin' } } // https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container function clonePolicyContainer (policyContainer) { return { referrerPolicy: policyContainer.referrerPolicy } } // https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer function determineRequestsReferrer (request) { // 1. Let policy be request's referrer policy. const policy = request.referrerPolicy // Note: policy cannot (shouldn't) be null or an empty string. assert(policy) // 2. Let environment be request’s client. let referrerSource = null // 3. Switch on request’s referrer: if (request.referrer === 'client') { // Note: node isn't a browser and doesn't implement document/iframes, // so we bypass this step and replace it with our own. const globalOrigin = getGlobalOrigin() if (!globalOrigin || globalOrigin.origin === 'null') { return 'no-referrer' } // note: we need to clone it as it's mutated referrerSource = new URL(globalOrigin) } else if (request.referrer instanceof URL) { // Let referrerSource be request’s referrer. referrerSource = request.referrer } // 4. Let request’s referrerURL be the result of stripping referrerSource for // use as a referrer. let referrerURL = stripURLForReferrer(referrerSource) // 5. Let referrerOrigin be the result of stripping referrerSource for use as // a referrer, with the origin-only flag set to true. const referrerOrigin = stripURLForReferrer(referrerSource, true) // 6. If the result of serializing referrerURL is a string whose length is // greater than 4096, set referrerURL to referrerOrigin. if (referrerURL.toString().length > 4096) { referrerURL = referrerOrigin } const areSameOrigin = sameOrigin(request, referrerURL) const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(request.url) // 8. Execute the switch statements corresponding to the value of policy: switch (policy) { case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true) case 'unsafe-url': return referrerURL case 'same-origin': return areSameOrigin ? referrerOrigin : 'no-referrer' case 'origin-when-cross-origin': return areSameOrigin ? referrerURL : referrerOrigin case 'strict-origin-when-cross-origin': { const currentURL = requestCurrentURL(request) // 1. If the origin of referrerURL and the origin of request’s current // URL are the same, then return referrerURL. if (sameOrigin(referrerURL, currentURL)) { return referrerURL } // 2. If referrerURL is a potentially trustworthy URL and request’s // current URL is not a potentially trustworthy URL, then return no // referrer. if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) { return 'no-referrer' } // 3. Return referrerOrigin. return referrerOrigin } case 'strict-origin': // eslint-disable-line /** * 1. If referrerURL is a potentially trustworthy URL and * request’s current URL is not a potentially trustworthy URL, * then return no referrer. * 2. Return referrerOrigin */ case 'no-referrer-when-downgrade': // eslint-disable-line /** * 1. If referrerURL is a potentially trustworthy URL and * request’s current URL is not a potentially trustworthy URL, * then return no referrer. * 2. Return referrerOrigin */ default: // eslint-disable-line return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin } } /** * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url * @param {URL} url * @param {boolean|undefined} originOnly */ function stripURLForReferrer (url, originOnly) { // 1. Assert: url is a URL. assert(url instanceof URL) // 2. If url’s scheme is a local scheme, then return no referrer. if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') { return 'no-referrer' } // 3. Set url’s username to the empty string. url.username = '' // 4. Set url’s password to the empty string. url.password = '' // 5. Set url’s fragment to null. url.hash = '' // 6. If the origin-only flag is true, then: if (originOnly) { // 1. Set url’s path to « the empty string ». url.pathname = '' // 2. Set url’s query to null. url.search = '' } // 7. Return url. return url } function isURLPotentiallyTrustworthy (url) { if (!(url instanceof URL)) { return false } // If child of about, return true if (url.href === 'about:blank' || url.href === 'about:srcdoc') { return true } // If scheme is data, return true if (url.protocol === 'data:') return true // If file, return true if (url.protocol === 'file:') return true return isOriginPotentiallyTrustworthy(url.origin) function isOriginPotentiallyTrustworthy (origin) { // If origin is explicitly null, return false if (origin == null || origin === 'null') return false const originAsURL = new URL(origin) // If secure, return true if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') { return true } // If localhost or variants, return true if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) || (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) || (originAsURL.hostname.endsWith('.localhost'))) { return true } // If any other, return false return false } } /** * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist * @param {Uint8Array} bytes * @param {string} metadataList */ function bytesMatch (bytes, metadataList) { // If node is not built with OpenSSL support, we cannot check // a request's integrity, so allow it by default (the spec will // allow requests if an invalid hash is given, as precedence). /* istanbul ignore if: only if node is built with --without-ssl */ if (crypto === undefined) { return true } // 1. Let parsedMetadata be the result of parsing metadataList. const parsedMetadata = parseMetadata(metadataList) // 2. If parsedMetadata is no metadata, return true. if (parsedMetadata === 'no metadata') { return true } // 3. If response is not eligible for integrity validation, return false. // TODO // 4. If parsedMetadata is the empty set, return true. if (parsedMetadata.length === 0) { return true } // 5. Let metadata be the result of getting the strongest // metadata from parsedMetadata. const strongest = getStrongestMetadata(parsedMetadata) const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest) // 6. For each item in metadata: for (const item of metadata) { // 1. Let algorithm be the alg component of item. const algorithm = item.algo // 2. Let expectedValue be the val component of item. const expectedValue = item.hash // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e // "be liberal with padding". This is annoying, and it's not even in the spec. // 3. Let actualValue be the result of applying algorithm to bytes. let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64') if (actualValue[actualValue.length - 1] === '=') { if (actualValue[actualValue.length - 2] === '=') { actualValue = actualValue.slice(0, -2) } else { actualValue = actualValue.slice(0, -1) } } // 4. If actualValue is a case-sensitive match for expectedValue, // return true. if (compareBase64Mixed(actualValue, expectedValue)) { return true } } // 7. Return false. return false } // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options // https://www.w3.org/TR/CSP2/#source-list-syntax // https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1 const parseHashWithOptions = /(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i /** * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata * @param {string} metadata */ function parseMetadata (metadata) { // 1. Let result be the empty set. /** @type {{ algo: string, hash: string }[]} */ const result = [] // 2. Let empty be equal to true. let empty = true // 3. For each token returned by splitting metadata on spaces: for (const token of metadata.split(' ')) { // 1. Set empty to false. empty = false // 2. Parse token as a hash-with-options. const parsedToken = parseHashWithOptions.exec(token) // 3. If token does not parse, continue to the next token. if ( parsedToken === null || parsedToken.groups === undefined || parsedToken.groups.algo === undefined ) { // Note: Chromium blocks the request at this point, but Firefox // gives a warning that an invalid integrity was given. The // correct behavior is to ignore these, and subsequently not // check the integrity of the resource. continue } // 4. Let algorithm be the hash-algo component of token. const algorithm = parsedToken.groups.algo.toLowerCase() // 5. If algorithm is a hash function recognized by the user // agent, add the parsed token to result. if (supportedHashes.includes(algorithm)) { result.push(parsedToken.groups) } } // 4. Return no metadata if empty is true, otherwise return result. if (empty === true) { return 'no metadata' } return result } /** * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList */ function getStrongestMetadata (metadataList) { // Let algorithm be the algo component of the first item in metadataList. // Can be sha256 let algorithm = metadataList[0].algo // If the algorithm is sha512, then it is the strongest // and we can return immediately if (algorithm[3] === '5') { return algorithm } for (let i = 1; i < metadataList.length; ++i) { const metadata = metadataList[i] // If the algorithm is sha512, then it is the strongest // and we can break the loop immediately if (metadata.algo[3] === '5') { algorithm = 'sha512' break // If the algorithm is sha384, then a potential sha256 or sha384 is ignored } else if (algorithm[3] === '3') { continue // algorithm is sha256, check if algorithm is sha384 and if so, set it as // the strongest } else if (metadata.algo[3] === '3') { algorithm = 'sha384' } } return algorithm } function filterMetadataListByAlgorithm (metadataList, algorithm) { if (metadataList.length === 1) { return metadataList } let pos = 0 for (let i = 0; i < metadataList.length; ++i) { if (metadataList[i].algo === algorithm) { metadataList[pos++] = metadataList[i] } } metadataList.length = pos return metadataList } /** * Compares two base64 strings, allowing for base64url * in the second string. * * @param {string} actualValue always base64 * @param {string} expectedValue base64 or base64url * @returns {boolean} */ function compareBase64Mixed (actualValue, expectedValue) { if (actualValue.length !== expectedValue.length) { return false } for (let i = 0; i < actualValue.length; ++i) { if (actualValue[i] !== expectedValue[i]) { if ( (actualValue[i] === '+' && expectedValue[i] === '-') || (actualValue[i] === '/' && expectedValue[i] === '_') ) { continue } return false } } return true } // https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) { // TODO } /** * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin} * @param {URL} A * @param {URL} B */ function sameOrigin (A, B) { // 1. If A and B are the same opaque origin, then return true. if (A.origin === B.origin && A.origin === 'null') { return true } // 2. If A and B are both tuple origins and their schemes, // hosts, and port are identical, then return true. if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) { return true } // 3. Return false. return false } function createDeferredPromise () { let res let rej const promise = new Promise((resolve, reject) => { res = resolve rej = reject }) return { promise, resolve: res, reject: rej } } function isAborted (fetchParams) { return fetchParams.controller.state === 'aborted' } function isCancelled (fetchParams) { return fetchParams.controller.state === 'aborted' || fetchParams.controller.state === 'terminated' } const normalizeMethodRecord = { delete: 'DELETE', DELETE: 'DELETE', get: 'GET', GET: 'GET', head: 'HEAD', HEAD: 'HEAD', options: 'OPTIONS', OPTIONS: 'OPTIONS', post: 'POST', POST: 'POST', put: 'PUT', PUT: 'PUT' } // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`. Object.setPrototypeOf(normalizeMethodRecord, null) /** * @see https://fetch.spec.whatwg.org/#concept-method-normalize * @param {string} method */ function normalizeMethod (method) { return normalizeMethodRecord[method.toLowerCase()] ?? method } // https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string function serializeJavascriptValueToJSONString (value) { // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »). const result = JSON.stringify(value) // 2. If result is undefined, then throw a TypeError. if (result === undefined) { throw new TypeError('Value is not JSON serializable') } // 3. Assert: result is a string. assert(typeof result === 'string') // 4. Return result. return result } // https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())) /** * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object * @param {() => unknown[]} iterator * @param {string} name name of the instance * @param {'key'|'value'|'key+value'} kind */ function makeIterator (iterator, name, kind) { const object = { index: 0, kind, target: iterator } const i = { next () { // 1. Let interface be the interface for which the iterator prototype object exists. // 2. Let thisValue be the this value. // 3. Let object be ? ToObject(thisValue). // 4. If object is a platform object, then perform a security // check, passing: // 5. If object is not a default iterator object for interface, // then throw a TypeError. if (Object.getPrototypeOf(this) !== i) { throw new TypeError( `'next' called on an object that does not implement interface ${name} Iterator.` ) } // 6. Let index be object’s index. // 7. Let kind be object’s kind. // 8. Let values be object’s target's value pairs to iterate over. const { index, kind, target } = object const values = target() // 9. Let len be the length of values. const len = values.length // 10. If index is greater than or equal to len, then return // CreateIterResultObject(undefined, true). if (index >= len) { return { value: undefined, done: true } } // 11. Let pair be the entry in values at index index. const pair = values[index] // 12. Set object’s index to index + 1. object.index = index + 1 // 13. Return the iterator result for pair and kind. return iteratorResult(pair, kind) }, // The class string of an iterator prototype object for a given interface is the // result of concatenating the identifier of the interface and the string " Iterator". [Symbol.toStringTag]: `${name} Iterator` } // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%. Object.setPrototypeOf(i, esIteratorPrototype) // esIteratorPrototype needs to be the prototype of i // which is the prototype of an empty object. Yes, it's confusing. return Object.setPrototypeOf({}, i) } // https://webidl.spec.whatwg.org/#iterator-result function iteratorResult (pair, kind) { let result // 1. Let result be a value determined by the value of kind: switch (kind) { case 'key': { // 1. Let idlKey be pair’s key. // 2. Let key be the result of converting idlKey to an // ECMAScript value. // 3. result is key. result = pair[0] break } case 'value': { // 1. Let idlValue be pair’s value. // 2. Let value be the result of converting idlValue to // an ECMAScript value. // 3. result is value. result = pair[1] break } case 'key+value': { // 1. Let idlKey be pair’s key. // 2. Let idlValue be pair’s value. // 3. Let key be the result of converting idlKey to an // ECMAScript value. // 4. Let value be the result of converting idlValue to // an ECMAScript value. // 5. Let array be ! ArrayCreate(2). // 6. Call ! CreateDataProperty(array, "0", key). // 7. Call ! CreateDataProperty(array, "1", value). // 8. result is array. result = pair break } } // 2. Return CreateIterResultObject(result, false). return { value: result, done: false } } /** * @see https://fetch.spec.whatwg.org/#body-fully-read */ async function fullyReadBody (body, processBody, processBodyError) { // 1. If taskDestination is null, then set taskDestination to // the result of starting a new parallel queue. // 2. Let successSteps given a byte sequence bytes be to queue a // fetch task to run processBody given bytes, with taskDestination. const successSteps = processBody // 3. Let errorSteps be to queue a fetch task to run processBodyError, // with taskDestination. const errorSteps = processBodyError // 4. Let reader be the result of getting a reader for body’s stream. // If that threw an exception, then run errorSteps with that // exception and return. let reader try { reader = body.stream.getReader() } catch (e) { errorSteps(e) return } // 5. Read all bytes from reader, given successSteps and errorSteps. try { const result = await readAllBytes(reader) successSteps(result) } catch (e) { errorSteps(e) } } /** @type {ReadableStream} */ let ReadableStream = globalThis.ReadableStream function isReadableStreamLike (stream) { if (!ReadableStream) { ReadableStream = (__nccwpck_require__(3774).ReadableStream) } return stream instanceof ReadableStream || ( stream[Symbol.toStringTag] === 'ReadableStream' && typeof stream.tee === 'function' ) } const MAXIMUM_ARGUMENT_LENGTH = 65535 /** * @see https://infra.spec.whatwg.org/#isomorphic-decode * @param {number[]|Uint8Array} input */ function isomorphicDecode (input) { // 1. To isomorphic decode a byte sequence input, return a string whose code point // length is equal to input’s length and whose code points have the same values // as the values of input’s bytes, in the same order. if (input.length < MAXIMUM_ARGUMENT_LENGTH) { return String.fromCharCode(...input) } return input.reduce((previous, current) => previous + String.fromCharCode(current), '') } /** * @param {ReadableStreamController} controller */ function readableStreamClose (controller) { try { controller.close() } catch (err) { // TODO: add comment explaining why this error occurs. if (!err.message.includes('Controller is already closed')) { throw err } } } /** * @see https://infra.spec.whatwg.org/#isomorphic-encode * @param {string} input */ function isomorphicEncode (input) { // 1. Assert: input contains no code points greater than U+00FF. for (let i = 0; i < input.length; i++) { assert(input.charCodeAt(i) <= 0xFF) } // 2. Return a byte sequence whose length is equal to input’s code // point length and whose bytes have the same values as the // values of input’s code points, in the same order return input } /** * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes * @see https://streams.spec.whatwg.org/#read-loop * @param {ReadableStreamDefaultReader} reader */ async function readAllBytes (reader) { const bytes = [] let byteLength = 0 while (true) { const { done, value: chunk } = await reader.read() if (done) { // 1. Call successSteps with bytes. return Buffer.concat(bytes, byteLength) } // 1. If chunk is not a Uint8Array object, call failureSteps // with a TypeError and abort these steps. if (!isUint8Array(chunk)) { throw new TypeError('Received non-Uint8Array chunk') } // 2. Append the bytes represented by chunk to bytes. bytes.push(chunk) byteLength += chunk.length // 3. Read-loop given reader, bytes, successSteps, and failureSteps. } } /** * @see https://fetch.spec.whatwg.org/#is-local * @param {URL} url */ function urlIsLocal (url) { assert('protocol' in url) // ensure it's a url object const protocol = url.protocol return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:' } /** * @param {string|URL} url */ function urlHasHttpsScheme (url) { if (typeof url === 'string') { return url.startsWith('https:') } return url.protocol === 'https:' } /** * @see https://fetch.spec.whatwg.org/#http-scheme * @param {URL} url */ function urlIsHttpHttpsScheme (url) { assert('protocol' in url) // ensure it's a url object const protocol = url.protocol return protocol === 'http:' || protocol === 'https:' } /** * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0. */ const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key)) module.exports = { isAborted, isCancelled, createDeferredPromise, ReadableStreamFrom, toUSVString, tryUpgradeRequestToAPotentiallyTrustworthyURL, coarsenedSharedCurrentTime, determineRequestsReferrer, makePolicyContainer, clonePolicyContainer, appendFetchMetadata, appendRequestOriginHeader, TAOCheck, corsCheck, crossOriginResourcePolicyCheck, createOpaqueTimingInfo, setRequestReferrerPolicyOnRedirect, isValidHTTPToken, requestBadPort, requestCurrentURL, responseURL, responseLocationURL, isBlobLike, isURLPotentiallyTrustworthy, isValidReasonPhrase, sameOrigin, normalizeMethod, serializeJavascriptValueToJSONString, makeIterator, isValidHeaderName, isValidHeaderValue, hasOwn, isErrorLike, fullyReadBody, bytesMatch, isReadableStreamLike, readableStreamClose, isomorphicEncode, isomorphicDecode, urlIsLocal, urlHasHttpsScheme, urlIsHttpHttpsScheme, readAllBytes, normalizeMethodRecord, parseMetadata } /***/ }), /***/ 4222: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { types } = __nccwpck_require__(9023) const { hasOwn, toUSVString } = __nccwpck_require__(5523) /** @type {import('../../types/webidl').Webidl} */ const webidl = {} webidl.converters = {} webidl.util = {} webidl.errors = {} webidl.errors.exception = function (message) { return new TypeError(`${message.header}: ${message.message}`) } webidl.errors.conversionFailed = function (context) { const plural = context.types.length === 1 ? '' : ' one of' const message = `${context.argument} could not be converted to` + `${plural}: ${context.types.join(', ')}.` return webidl.errors.exception({ header: context.prefix, message }) } webidl.errors.invalidArgument = function (context) { return webidl.errors.exception({ header: context.prefix, message: `"${context.value}" is an invalid ${context.type}.` }) } // https://webidl.spec.whatwg.org/#implements webidl.brandCheck = function (V, I, opts = undefined) { if (opts?.strict !== false && !(V instanceof I)) { throw new TypeError('Illegal invocation') } else { return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag] } } webidl.argumentLengthCheck = function ({ length }, min, ctx) { if (length < min) { throw webidl.errors.exception({ message: `${min} argument${min !== 1 ? 's' : ''} required, ` + `but${length ? ' only' : ''} ${length} found.`, ...ctx }) } } webidl.illegalConstructor = function () { throw webidl.errors.exception({ header: 'TypeError', message: 'Illegal constructor' }) } // https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values webidl.util.Type = function (V) { switch (typeof V) { case 'undefined': return 'Undefined' case 'boolean': return 'Boolean' case 'string': return 'String' case 'symbol': return 'Symbol' case 'number': return 'Number' case 'bigint': return 'BigInt' case 'function': case 'object': { if (V === null) { return 'Null' } return 'Object' } } } // https://webidl.spec.whatwg.org/#abstract-opdef-converttoint webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) { let upperBound let lowerBound // 1. If bitLength is 64, then: if (bitLength === 64) { // 1. Let upperBound be 2^53 − 1. upperBound = Math.pow(2, 53) - 1 // 2. If signedness is "unsigned", then let lowerBound be 0. if (signedness === 'unsigned') { lowerBound = 0 } else { // 3. Otherwise let lowerBound be −2^53 + 1. lowerBound = Math.pow(-2, 53) + 1 } } else if (signedness === 'unsigned') { // 2. Otherwise, if signedness is "unsigned", then: // 1. Let lowerBound be 0. lowerBound = 0 // 2. Let upperBound be 2^bitLength − 1. upperBound = Math.pow(2, bitLength) - 1 } else { // 3. Otherwise: // 1. Let lowerBound be -2^bitLength − 1. lowerBound = Math.pow(-2, bitLength) - 1 // 2. Let upperBound be 2^bitLength − 1 − 1. upperBound = Math.pow(2, bitLength - 1) - 1 } // 4. Let x be ? ToNumber(V). let x = Number(V) // 5. If x is −0, then set x to +0. if (x === 0) { x = 0 } // 6. If the conversion is to an IDL type associated // with the [EnforceRange] extended attribute, then: if (opts.enforceRange === true) { // 1. If x is NaN, +∞, or −∞, then throw a TypeError. if ( Number.isNaN(x) || x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY ) { throw webidl.errors.exception({ header: 'Integer conversion', message: `Could not convert ${V} to an integer.` }) } // 2. Set x to IntegerPart(x). x = webidl.util.IntegerPart(x) // 3. If x < lowerBound or x > upperBound, then // throw a TypeError. if (x < lowerBound || x > upperBound) { throw webidl.errors.exception({ header: 'Integer conversion', message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.` }) } // 4. Return x. return x } // 7. If x is not NaN and the conversion is to an IDL // type associated with the [Clamp] extended // attribute, then: if (!Number.isNaN(x) && opts.clamp === true) { // 1. Set x to min(max(x, lowerBound), upperBound). x = Math.min(Math.max(x, lowerBound), upperBound) // 2. Round x to the nearest integer, choosing the // even integer if it lies halfway between two, // and choosing +0 rather than −0. if (Math.floor(x) % 2 === 0) { x = Math.floor(x) } else { x = Math.ceil(x) } // 3. Return x. return x } // 8. If x is NaN, +0, +∞, or −∞, then return +0. if ( Number.isNaN(x) || (x === 0 && Object.is(0, x)) || x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY ) { return 0 } // 9. Set x to IntegerPart(x). x = webidl.util.IntegerPart(x) // 10. Set x to x modulo 2^bitLength. x = x % Math.pow(2, bitLength) // 11. If signedness is "signed" and x ≥ 2^bitLength − 1, // then return x − 2^bitLength. if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) { return x - Math.pow(2, bitLength) } // 12. Otherwise, return x. return x } // https://webidl.spec.whatwg.org/#abstract-opdef-integerpart webidl.util.IntegerPart = function (n) { // 1. Let r be floor(abs(n)). const r = Math.floor(Math.abs(n)) // 2. If n < 0, then return -1 × r. if (n < 0) { return -1 * r } // 3. Otherwise, return r. return r } // https://webidl.spec.whatwg.org/#es-sequence webidl.sequenceConverter = function (converter) { return (V) => { // 1. If Type(V) is not Object, throw a TypeError. if (webidl.util.Type(V) !== 'Object') { throw webidl.errors.exception({ header: 'Sequence', message: `Value of type ${webidl.util.Type(V)} is not an Object.` }) } // 2. Let method be ? GetMethod(V, @@iterator). /** @type {Generator} */ const method = V?.[Symbol.iterator]?.() const seq = [] // 3. If method is undefined, throw a TypeError. if ( method === undefined || typeof method.next !== 'function' ) { throw webidl.errors.exception({ header: 'Sequence', message: 'Object is not an iterator.' }) } // https://webidl.spec.whatwg.org/#create-sequence-from-iterable while (true) { const { done, value } = method.next() if (done) { break } seq.push(converter(value)) } return seq } } // https://webidl.spec.whatwg.org/#es-to-record webidl.recordConverter = function (keyConverter, valueConverter) { return (O) => { // 1. If Type(O) is not Object, throw a TypeError. if (webidl.util.Type(O) !== 'Object') { throw webidl.errors.exception({ header: 'Record', message: `Value of type ${webidl.util.Type(O)} is not an Object.` }) } // 2. Let result be a new empty instance of record. const result = {} if (!types.isProxy(O)) { // Object.keys only returns enumerable properties const keys = Object.keys(O) for (const key of keys) { // 1. Let typedKey be key converted to an IDL value of type K. const typedKey = keyConverter(key) // 2. Let value be ? Get(O, key). // 3. Let typedValue be value converted to an IDL value of type V. const typedValue = valueConverter(O[key]) // 4. Set result[typedKey] to typedValue. result[typedKey] = typedValue } // 5. Return result. return result } // 3. Let keys be ? O.[[OwnPropertyKeys]](). const keys = Reflect.ownKeys(O) // 4. For each key of keys. for (const key of keys) { // 1. Let desc be ? O.[[GetOwnProperty]](key). const desc = Reflect.getOwnPropertyDescriptor(O, key) // 2. If desc is not undefined and desc.[[Enumerable]] is true: if (desc?.enumerable) { // 1. Let typedKey be key converted to an IDL value of type K. const typedKey = keyConverter(key) // 2. Let value be ? Get(O, key). // 3. Let typedValue be value converted to an IDL value of type V. const typedValue = valueConverter(O[key]) // 4. Set result[typedKey] to typedValue. result[typedKey] = typedValue } } // 5. Return result. return result } } webidl.interfaceConverter = function (i) { return (V, opts = {}) => { if (opts.strict !== false && !(V instanceof i)) { throw webidl.errors.exception({ header: i.name, message: `Expected ${V} to be an instance of ${i.name}.` }) } return V } } webidl.dictionaryConverter = function (converters) { return (dictionary) => { const type = webidl.util.Type(dictionary) const dict = {} if (type === 'Null' || type === 'Undefined') { return dict } else if (type !== 'Object') { throw webidl.errors.exception({ header: 'Dictionary', message: `Expected ${dictionary} to be one of: Null, Undefined, Object.` }) } for (const options of converters) { const { key, defaultValue, required, converter } = options if (required === true) { if (!hasOwn(dictionary, key)) { throw webidl.errors.exception({ header: 'Dictionary', message: `Missing required key "${key}".` }) } } let value = dictionary[key] const hasDefault = hasOwn(options, 'defaultValue') // Only use defaultValue if value is undefined and // a defaultValue options was provided. if (hasDefault && value !== null) { value = value ?? defaultValue } // A key can be optional and have no default value. // When this happens, do not perform a conversion, // and do not assign the key a value. if (required || hasDefault || value !== undefined) { value = converter(value) if ( options.allowedValues && !options.allowedValues.includes(value) ) { throw webidl.errors.exception({ header: 'Dictionary', message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.` }) } dict[key] = value } } return dict } } webidl.nullableConverter = function (converter) { return (V) => { if (V === null) { return V } return converter(V) } } // https://webidl.spec.whatwg.org/#es-DOMString webidl.converters.DOMString = function (V, opts = {}) { // 1. If V is null and the conversion is to an IDL type // associated with the [LegacyNullToEmptyString] // extended attribute, then return the DOMString value // that represents the empty string. if (V === null && opts.legacyNullToEmptyString) { return '' } // 2. Let x be ? ToString(V). if (typeof V === 'symbol') { throw new TypeError('Could not convert argument of type symbol to string.') } // 3. Return the IDL DOMString value that represents the // same sequence of code units as the one the // ECMAScript String value x represents. return String(V) } // https://webidl.spec.whatwg.org/#es-ByteString webidl.converters.ByteString = function (V) { // 1. Let x be ? ToString(V). // Note: DOMString converter perform ? ToString(V) const x = webidl.converters.DOMString(V) // 2. If the value of any element of x is greater than // 255, then throw a TypeError. for (let index = 0; index < x.length; index++) { if (x.charCodeAt(index) > 255) { throw new TypeError( 'Cannot convert argument to a ByteString because the character at ' + `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.` ) } } // 3. Return an IDL ByteString value whose length is the // length of x, and where the value of each element is // the value of the corresponding element of x. return x } // https://webidl.spec.whatwg.org/#es-USVString webidl.converters.USVString = toUSVString // https://webidl.spec.whatwg.org/#es-boolean webidl.converters.boolean = function (V) { // 1. Let x be the result of computing ToBoolean(V). const x = Boolean(V) // 2. Return the IDL boolean value that is the one that represents // the same truth value as the ECMAScript Boolean value x. return x } // https://webidl.spec.whatwg.org/#es-any webidl.converters.any = function (V) { return V } // https://webidl.spec.whatwg.org/#es-long-long webidl.converters['long long'] = function (V) { // 1. Let x be ? ConvertToInt(V, 64, "signed"). const x = webidl.util.ConvertToInt(V, 64, 'signed') // 2. Return the IDL long long value that represents // the same numeric value as x. return x } // https://webidl.spec.whatwg.org/#es-unsigned-long-long webidl.converters['unsigned long long'] = function (V) { // 1. Let x be ? ConvertToInt(V, 64, "unsigned"). const x = webidl.util.ConvertToInt(V, 64, 'unsigned') // 2. Return the IDL unsigned long long value that // represents the same numeric value as x. return x } // https://webidl.spec.whatwg.org/#es-unsigned-long webidl.converters['unsigned long'] = function (V) { // 1. Let x be ? ConvertToInt(V, 32, "unsigned"). const x = webidl.util.ConvertToInt(V, 32, 'unsigned') // 2. Return the IDL unsigned long value that // represents the same numeric value as x. return x } // https://webidl.spec.whatwg.org/#es-unsigned-short webidl.converters['unsigned short'] = function (V, opts) { // 1. Let x be ? ConvertToInt(V, 16, "unsigned"). const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts) // 2. Return the IDL unsigned short value that represents // the same numeric value as x. return x } // https://webidl.spec.whatwg.org/#idl-ArrayBuffer webidl.converters.ArrayBuffer = function (V, opts = {}) { // 1. If Type(V) is not Object, or V does not have an // [[ArrayBufferData]] internal slot, then throw a // TypeError. // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances if ( webidl.util.Type(V) !== 'Object' || !types.isAnyArrayBuffer(V) ) { throw webidl.errors.conversionFailed({ prefix: `${V}`, argument: `${V}`, types: ['ArrayBuffer'] }) } // 2. If the conversion is not to an IDL type associated // with the [AllowShared] extended attribute, and // IsSharedArrayBuffer(V) is true, then throw a // TypeError. if (opts.allowShared === false && types.isSharedArrayBuffer(V)) { throw webidl.errors.exception({ header: 'ArrayBuffer', message: 'SharedArrayBuffer is not allowed.' }) } // 3. If the conversion is not to an IDL type associated // with the [AllowResizable] extended attribute, and // IsResizableArrayBuffer(V) is true, then throw a // TypeError. // Note: resizable ArrayBuffers are currently a proposal. // 4. Return the IDL ArrayBuffer value that is a // reference to the same object as V. return V } webidl.converters.TypedArray = function (V, T, opts = {}) { // 1. Let T be the IDL type V is being converted to. // 2. If Type(V) is not Object, or V does not have a // [[TypedArrayName]] internal slot with a value // equal to T’s name, then throw a TypeError. if ( webidl.util.Type(V) !== 'Object' || !types.isTypedArray(V) || V.constructor.name !== T.name ) { throw webidl.errors.conversionFailed({ prefix: `${T.name}`, argument: `${V}`, types: [T.name] }) } // 3. If the conversion is not to an IDL type associated // with the [AllowShared] extended attribute, and // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is // true, then throw a TypeError. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) { throw webidl.errors.exception({ header: 'ArrayBuffer', message: 'SharedArrayBuffer is not allowed.' }) } // 4. If the conversion is not to an IDL type associated // with the [AllowResizable] extended attribute, and // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is // true, then throw a TypeError. // Note: resizable array buffers are currently a proposal // 5. Return the IDL value of type T that is a reference // to the same object as V. return V } webidl.converters.DataView = function (V, opts = {}) { // 1. If Type(V) is not Object, or V does not have a // [[DataView]] internal slot, then throw a TypeError. if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) { throw webidl.errors.exception({ header: 'DataView', message: 'Object is not a DataView.' }) } // 2. If the conversion is not to an IDL type associated // with the [AllowShared] extended attribute, and // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true, // then throw a TypeError. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) { throw webidl.errors.exception({ header: 'ArrayBuffer', message: 'SharedArrayBuffer is not allowed.' }) } // 3. If the conversion is not to an IDL type associated // with the [AllowResizable] extended attribute, and // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is // true, then throw a TypeError. // Note: resizable ArrayBuffers are currently a proposal // 4. Return the IDL DataView value that is a reference // to the same object as V. return V } // https://webidl.spec.whatwg.org/#BufferSource webidl.converters.BufferSource = function (V, opts = {}) { if (types.isAnyArrayBuffer(V)) { return webidl.converters.ArrayBuffer(V, opts) } if (types.isTypedArray(V)) { return webidl.converters.TypedArray(V, V.constructor) } if (types.isDataView(V)) { return webidl.converters.DataView(V, opts) } throw new TypeError(`Could not convert ${V} to a BufferSource.`) } webidl.converters['sequence'] = webidl.sequenceConverter( webidl.converters.ByteString ) webidl.converters['sequence>'] = webidl.sequenceConverter( webidl.converters['sequence'] ) webidl.converters['record'] = webidl.recordConverter( webidl.converters.ByteString, webidl.converters.ByteString ) module.exports = { webidl } /***/ }), /***/ 396: /***/ ((module) => { /** * @see https://encoding.spec.whatwg.org/#concept-encoding-get * @param {string|undefined} label */ function getEncoding (label) { if (!label) { return 'failure' } // 1. Remove any leading and trailing ASCII whitespace from label. // 2. If label is an ASCII case-insensitive match for any of the // labels listed in the table below, then return the // corresponding encoding; otherwise return failure. switch (label.trim().toLowerCase()) { case 'unicode-1-1-utf-8': case 'unicode11utf8': case 'unicode20utf8': case 'utf-8': case 'utf8': case 'x-unicode20utf8': return 'UTF-8' case '866': case 'cp866': case 'csibm866': case 'ibm866': return 'IBM866' case 'csisolatin2': case 'iso-8859-2': case 'iso-ir-101': case 'iso8859-2': case 'iso88592': case 'iso_8859-2': case 'iso_8859-2:1987': case 'l2': case 'latin2': return 'ISO-8859-2' case 'csisolatin3': case 'iso-8859-3': case 'iso-ir-109': case 'iso8859-3': case 'iso88593': case 'iso_8859-3': case 'iso_8859-3:1988': case 'l3': case 'latin3': return 'ISO-8859-3' case 'csisolatin4': case 'iso-8859-4': case 'iso-ir-110': case 'iso8859-4': case 'iso88594': case 'iso_8859-4': case 'iso_8859-4:1988': case 'l4': case 'latin4': return 'ISO-8859-4' case 'csisolatincyrillic': case 'cyrillic': case 'iso-8859-5': case 'iso-ir-144': case 'iso8859-5': case 'iso88595': case 'iso_8859-5': case 'iso_8859-5:1988': return 'ISO-8859-5' case 'arabic': case 'asmo-708': case 'csiso88596e': case 'csiso88596i': case 'csisolatinarabic': case 'ecma-114': case 'iso-8859-6': case 'iso-8859-6-e': case 'iso-8859-6-i': case 'iso-ir-127': case 'iso8859-6': case 'iso88596': case 'iso_8859-6': case 'iso_8859-6:1987': return 'ISO-8859-6' case 'csisolatingreek': case 'ecma-118': case 'elot_928': case 'greek': case 'greek8': case 'iso-8859-7': case 'iso-ir-126': case 'iso8859-7': case 'iso88597': case 'iso_8859-7': case 'iso_8859-7:1987': case 'sun_eu_greek': return 'ISO-8859-7' case 'csiso88598e': case 'csisolatinhebrew': case 'hebrew': case 'iso-8859-8': case 'iso-8859-8-e': case 'iso-ir-138': case 'iso8859-8': case 'iso88598': case 'iso_8859-8': case 'iso_8859-8:1988': case 'visual': return 'ISO-8859-8' case 'csiso88598i': case 'iso-8859-8-i': case 'logical': return 'ISO-8859-8-I' case 'csisolatin6': case 'iso-8859-10': case 'iso-ir-157': case 'iso8859-10': case 'iso885910': case 'l6': case 'latin6': return 'ISO-8859-10' case 'iso-8859-13': case 'iso8859-13': case 'iso885913': return 'ISO-8859-13' case 'iso-8859-14': case 'iso8859-14': case 'iso885914': return 'ISO-8859-14' case 'csisolatin9': case 'iso-8859-15': case 'iso8859-15': case 'iso885915': case 'iso_8859-15': case 'l9': return 'ISO-8859-15' case 'iso-8859-16': return 'ISO-8859-16' case 'cskoi8r': case 'koi': case 'koi8': case 'koi8-r': case 'koi8_r': return 'KOI8-R' case 'koi8-ru': case 'koi8-u': return 'KOI8-U' case 'csmacintosh': case 'mac': case 'macintosh': case 'x-mac-roman': return 'macintosh' case 'iso-8859-11': case 'iso8859-11': case 'iso885911': case 'tis-620': case 'windows-874': return 'windows-874' case 'cp1250': case 'windows-1250': case 'x-cp1250': return 'windows-1250' case 'cp1251': case 'windows-1251': case 'x-cp1251': return 'windows-1251' case 'ansi_x3.4-1968': case 'ascii': case 'cp1252': case 'cp819': case 'csisolatin1': case 'ibm819': case 'iso-8859-1': case 'iso-ir-100': case 'iso8859-1': case 'iso88591': case 'iso_8859-1': case 'iso_8859-1:1987': case 'l1': case 'latin1': case 'us-ascii': case 'windows-1252': case 'x-cp1252': return 'windows-1252' case 'cp1253': case 'windows-1253': case 'x-cp1253': return 'windows-1253' case 'cp1254': case 'csisolatin5': case 'iso-8859-9': case 'iso-ir-148': case 'iso8859-9': case 'iso88599': case 'iso_8859-9': case 'iso_8859-9:1989': case 'l5': case 'latin5': case 'windows-1254': case 'x-cp1254': return 'windows-1254' case 'cp1255': case 'windows-1255': case 'x-cp1255': return 'windows-1255' case 'cp1256': case 'windows-1256': case 'x-cp1256': return 'windows-1256' case 'cp1257': case 'windows-1257': case 'x-cp1257': return 'windows-1257' case 'cp1258': case 'windows-1258': case 'x-cp1258': return 'windows-1258' case 'x-mac-cyrillic': case 'x-mac-ukrainian': return 'x-mac-cyrillic' case 'chinese': case 'csgb2312': case 'csiso58gb231280': case 'gb2312': case 'gb_2312': case 'gb_2312-80': case 'gbk': case 'iso-ir-58': case 'x-gbk': return 'GBK' case 'gb18030': return 'gb18030' case 'big5': case 'big5-hkscs': case 'cn-big5': case 'csbig5': case 'x-x-big5': return 'Big5' case 'cseucpkdfmtjapanese': case 'euc-jp': case 'x-euc-jp': return 'EUC-JP' case 'csiso2022jp': case 'iso-2022-jp': return 'ISO-2022-JP' case 'csshiftjis': case 'ms932': case 'ms_kanji': case 'shift-jis': case 'shift_jis': case 'sjis': case 'windows-31j': case 'x-sjis': return 'Shift_JIS' case 'cseuckr': case 'csksc56011987': case 'euc-kr': case 'iso-ir-149': case 'korean': case 'ks_c_5601-1987': case 'ks_c_5601-1989': case 'ksc5601': case 'ksc_5601': case 'windows-949': return 'EUC-KR' case 'csiso2022kr': case 'hz-gb-2312': case 'iso-2022-cn': case 'iso-2022-cn-ext': case 'iso-2022-kr': case 'replacement': return 'replacement' case 'unicodefffe': case 'utf-16be': return 'UTF-16BE' case 'csunicode': case 'iso-10646-ucs-2': case 'ucs-2': case 'unicode': case 'unicodefeff': case 'utf-16': case 'utf-16le': return 'UTF-16LE' case 'x-user-defined': return 'x-user-defined' default: return 'failure' } } module.exports = { getEncoding } /***/ }), /***/ 2160: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { staticPropertyDescriptors, readOperation, fireAProgressEvent } = __nccwpck_require__(165) const { kState, kError, kResult, kEvents, kAborted } = __nccwpck_require__(6812) const { webidl } = __nccwpck_require__(4222) const { kEnumerableProperty } = __nccwpck_require__(3440) class FileReader extends EventTarget { constructor () { super() this[kState] = 'empty' this[kResult] = null this[kError] = null this[kEvents] = { loadend: null, error: null, abort: null, load: null, progress: null, loadstart: null } } /** * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer * @param {import('buffer').Blob} blob */ readAsArrayBuffer (blob) { webidl.brandCheck(this, FileReader) webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' }) blob = webidl.converters.Blob(blob, { strict: false }) // The readAsArrayBuffer(blob) method, when invoked, // must initiate a read operation for blob with ArrayBuffer. readOperation(this, blob, 'ArrayBuffer') } /** * @see https://w3c.github.io/FileAPI/#readAsBinaryString * @param {import('buffer').Blob} blob */ readAsBinaryString (blob) { webidl.brandCheck(this, FileReader) webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' }) blob = webidl.converters.Blob(blob, { strict: false }) // The readAsBinaryString(blob) method, when invoked, // must initiate a read operation for blob with BinaryString. readOperation(this, blob, 'BinaryString') } /** * @see https://w3c.github.io/FileAPI/#readAsDataText * @param {import('buffer').Blob} blob * @param {string?} encoding */ readAsText (blob, encoding = undefined) { webidl.brandCheck(this, FileReader) webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' }) blob = webidl.converters.Blob(blob, { strict: false }) if (encoding !== undefined) { encoding = webidl.converters.DOMString(encoding) } // The readAsText(blob, encoding) method, when invoked, // must initiate a read operation for blob with Text and encoding. readOperation(this, blob, 'Text', encoding) } /** * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL * @param {import('buffer').Blob} blob */ readAsDataURL (blob) { webidl.brandCheck(this, FileReader) webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' }) blob = webidl.converters.Blob(blob, { strict: false }) // The readAsDataURL(blob) method, when invoked, must // initiate a read operation for blob with DataURL. readOperation(this, blob, 'DataURL') } /** * @see https://w3c.github.io/FileAPI/#dfn-abort */ abort () { // 1. If this's state is "empty" or if this's state is // "done" set this's result to null and terminate // this algorithm. if (this[kState] === 'empty' || this[kState] === 'done') { this[kResult] = null return } // 2. If this's state is "loading" set this's state to // "done" and set this's result to null. if (this[kState] === 'loading') { this[kState] = 'done' this[kResult] = null } // 3. If there are any tasks from this on the file reading // task source in an affiliated task queue, then remove // those tasks from that task queue. this[kAborted] = true // 4. Terminate the algorithm for the read method being processed. // TODO // 5. Fire a progress event called abort at this. fireAProgressEvent('abort', this) // 6. If this's state is not "loading", fire a progress // event called loadend at this. if (this[kState] !== 'loading') { fireAProgressEvent('loadend', this) } } /** * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate */ get readyState () { webidl.brandCheck(this, FileReader) switch (this[kState]) { case 'empty': return this.EMPTY case 'loading': return this.LOADING case 'done': return this.DONE } } /** * @see https://w3c.github.io/FileAPI/#dom-filereader-result */ get result () { webidl.brandCheck(this, FileReader) // The result attribute’s getter, when invoked, must return // this's result. return this[kResult] } /** * @see https://w3c.github.io/FileAPI/#dom-filereader-error */ get error () { webidl.brandCheck(this, FileReader) // The error attribute’s getter, when invoked, must return // this's error. return this[kError] } get onloadend () { webidl.brandCheck(this, FileReader) return this[kEvents].loadend } set onloadend (fn) { webidl.brandCheck(this, FileReader) if (this[kEvents].loadend) { this.removeEventListener('loadend', this[kEvents].loadend) } if (typeof fn === 'function') { this[kEvents].loadend = fn this.addEventListener('loadend', fn) } else { this[kEvents].loadend = null } } get onerror () { webidl.brandCheck(this, FileReader) return this[kEvents].error } set onerror (fn) { webidl.brandCheck(this, FileReader) if (this[kEvents].error) { this.removeEventListener('error', this[kEvents].error) } if (typeof fn === 'function') { this[kEvents].error = fn this.addEventListener('error', fn) } else { this[kEvents].error = null } } get onloadstart () { webidl.brandCheck(this, FileReader) return this[kEvents].loadstart } set onloadstart (fn) { webidl.brandCheck(this, FileReader) if (this[kEvents].loadstart) { this.removeEventListener('loadstart', this[kEvents].loadstart) } if (typeof fn === 'function') { this[kEvents].loadstart = fn this.addEventListener('loadstart', fn) } else { this[kEvents].loadstart = null } } get onprogress () { webidl.brandCheck(this, FileReader) return this[kEvents].progress } set onprogress (fn) { webidl.brandCheck(this, FileReader) if (this[kEvents].progress) { this.removeEventListener('progress', this[kEvents].progress) } if (typeof fn === 'function') { this[kEvents].progress = fn this.addEventListener('progress', fn) } else { this[kEvents].progress = null } } get onload () { webidl.brandCheck(this, FileReader) return this[kEvents].load } set onload (fn) { webidl.brandCheck(this, FileReader) if (this[kEvents].load) { this.removeEventListener('load', this[kEvents].load) } if (typeof fn === 'function') { this[kEvents].load = fn this.addEventListener('load', fn) } else { this[kEvents].load = null } } get onabort () { webidl.brandCheck(this, FileReader) return this[kEvents].abort } set onabort (fn) { webidl.brandCheck(this, FileReader) if (this[kEvents].abort) { this.removeEventListener('abort', this[kEvents].abort) } if (typeof fn === 'function') { this[kEvents].abort = fn this.addEventListener('abort', fn) } else { this[kEvents].abort = null } } } // https://w3c.github.io/FileAPI/#dom-filereader-empty FileReader.EMPTY = FileReader.prototype.EMPTY = 0 // https://w3c.github.io/FileAPI/#dom-filereader-loading FileReader.LOADING = FileReader.prototype.LOADING = 1 // https://w3c.github.io/FileAPI/#dom-filereader-done FileReader.DONE = FileReader.prototype.DONE = 2 Object.defineProperties(FileReader.prototype, { EMPTY: staticPropertyDescriptors, LOADING: staticPropertyDescriptors, DONE: staticPropertyDescriptors, readAsArrayBuffer: kEnumerableProperty, readAsBinaryString: kEnumerableProperty, readAsText: kEnumerableProperty, readAsDataURL: kEnumerableProperty, abort: kEnumerableProperty, readyState: kEnumerableProperty, result: kEnumerableProperty, error: kEnumerableProperty, onloadstart: kEnumerableProperty, onprogress: kEnumerableProperty, onload: kEnumerableProperty, onabort: kEnumerableProperty, onerror: kEnumerableProperty, onloadend: kEnumerableProperty, [Symbol.toStringTag]: { value: 'FileReader', writable: false, enumerable: false, configurable: true } }) Object.defineProperties(FileReader, { EMPTY: staticPropertyDescriptors, LOADING: staticPropertyDescriptors, DONE: staticPropertyDescriptors }) module.exports = { FileReader } /***/ }), /***/ 5976: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { webidl } = __nccwpck_require__(4222) const kState = Symbol('ProgressEvent state') /** * @see https://xhr.spec.whatwg.org/#progressevent */ class ProgressEvent extends Event { constructor (type, eventInitDict = {}) { type = webidl.converters.DOMString(type) eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {}) super(type, eventInitDict) this[kState] = { lengthComputable: eventInitDict.lengthComputable, loaded: eventInitDict.loaded, total: eventInitDict.total } } get lengthComputable () { webidl.brandCheck(this, ProgressEvent) return this[kState].lengthComputable } get loaded () { webidl.brandCheck(this, ProgressEvent) return this[kState].loaded } get total () { webidl.brandCheck(this, ProgressEvent) return this[kState].total } } webidl.converters.ProgressEventInit = webidl.dictionaryConverter([ { key: 'lengthComputable', converter: webidl.converters.boolean, defaultValue: false }, { key: 'loaded', converter: webidl.converters['unsigned long long'], defaultValue: 0 }, { key: 'total', converter: webidl.converters['unsigned long long'], defaultValue: 0 }, { key: 'bubbles', converter: webidl.converters.boolean, defaultValue: false }, { key: 'cancelable', converter: webidl.converters.boolean, defaultValue: false }, { key: 'composed', converter: webidl.converters.boolean, defaultValue: false } ]) module.exports = { ProgressEvent } /***/ }), /***/ 6812: /***/ ((module) => { module.exports = { kState: Symbol('FileReader state'), kResult: Symbol('FileReader result'), kError: Symbol('FileReader error'), kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'), kEvents: Symbol('FileReader events'), kAborted: Symbol('FileReader aborted') } /***/ }), /***/ 165: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { kState, kError, kResult, kAborted, kLastProgressEventFired } = __nccwpck_require__(6812) const { ProgressEvent } = __nccwpck_require__(5976) const { getEncoding } = __nccwpck_require__(396) const { DOMException } = __nccwpck_require__(7326) const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(4322) const { types } = __nccwpck_require__(9023) const { StringDecoder } = __nccwpck_require__(3193) const { btoa } = __nccwpck_require__(181) /** @type {PropertyDescriptor} */ const staticPropertyDescriptors = { enumerable: true, writable: false, configurable: false } /** * @see https://w3c.github.io/FileAPI/#readOperation * @param {import('./filereader').FileReader} fr * @param {import('buffer').Blob} blob * @param {string} type * @param {string?} encodingName */ function readOperation (fr, blob, type, encodingName) { // 1. If fr’s state is "loading", throw an InvalidStateError // DOMException. if (fr[kState] === 'loading') { throw new DOMException('Invalid state', 'InvalidStateError') } // 2. Set fr’s state to "loading". fr[kState] = 'loading' // 3. Set fr’s result to null. fr[kResult] = null // 4. Set fr’s error to null. fr[kError] = null // 5. Let stream be the result of calling get stream on blob. /** @type {import('stream/web').ReadableStream} */ const stream = blob.stream() // 6. Let reader be the result of getting a reader from stream. const reader = stream.getReader() // 7. Let bytes be an empty byte sequence. /** @type {Uint8Array[]} */ const bytes = [] // 8. Let chunkPromise be the result of reading a chunk from // stream with reader. let chunkPromise = reader.read() // 9. Let isFirstChunk be true. let isFirstChunk = true // 10. In parallel, while true: // Note: "In parallel" just means non-blocking // Note 2: readOperation itself cannot be async as double // reading the body would then reject the promise, instead // of throwing an error. ;(async () => { while (!fr[kAborted]) { // 1. Wait for chunkPromise to be fulfilled or rejected. try { const { done, value } = await chunkPromise // 2. If chunkPromise is fulfilled, and isFirstChunk is // true, queue a task to fire a progress event called // loadstart at fr. if (isFirstChunk && !fr[kAborted]) { queueMicrotask(() => { fireAProgressEvent('loadstart', fr) }) } // 3. Set isFirstChunk to false. isFirstChunk = false // 4. If chunkPromise is fulfilled with an object whose // done property is false and whose value property is // a Uint8Array object, run these steps: if (!done && types.isUint8Array(value)) { // 1. Let bs be the byte sequence represented by the // Uint8Array object. // 2. Append bs to bytes. bytes.push(value) // 3. If roughly 50ms have passed since these steps // were last invoked, queue a task to fire a // progress event called progress at fr. if ( ( fr[kLastProgressEventFired] === undefined || Date.now() - fr[kLastProgressEventFired] >= 50 ) && !fr[kAborted] ) { fr[kLastProgressEventFired] = Date.now() queueMicrotask(() => { fireAProgressEvent('progress', fr) }) } // 4. Set chunkPromise to the result of reading a // chunk from stream with reader. chunkPromise = reader.read() } else if (done) { // 5. Otherwise, if chunkPromise is fulfilled with an // object whose done property is true, queue a task // to run the following steps and abort this algorithm: queueMicrotask(() => { // 1. Set fr’s state to "done". fr[kState] = 'done' // 2. Let result be the result of package data given // bytes, type, blob’s type, and encodingName. try { const result = packageData(bytes, type, blob.type, encodingName) // 4. Else: if (fr[kAborted]) { return } // 1. Set fr’s result to result. fr[kResult] = result // 2. Fire a progress event called load at the fr. fireAProgressEvent('load', fr) } catch (error) { // 3. If package data threw an exception error: // 1. Set fr’s error to error. fr[kError] = error // 2. Fire a progress event called error at fr. fireAProgressEvent('error', fr) } // 5. If fr’s state is not "loading", fire a progress // event called loadend at the fr. if (fr[kState] !== 'loading') { fireAProgressEvent('loadend', fr) } }) break } } catch (error) { if (fr[kAborted]) { return } // 6. Otherwise, if chunkPromise is rejected with an // error error, queue a task to run the following // steps and abort this algorithm: queueMicrotask(() => { // 1. Set fr’s state to "done". fr[kState] = 'done' // 2. Set fr’s error to error. fr[kError] = error // 3. Fire a progress event called error at fr. fireAProgressEvent('error', fr) // 4. If fr’s state is not "loading", fire a progress // event called loadend at fr. if (fr[kState] !== 'loading') { fireAProgressEvent('loadend', fr) } }) break } } })() } /** * @see https://w3c.github.io/FileAPI/#fire-a-progress-event * @see https://dom.spec.whatwg.org/#concept-event-fire * @param {string} e The name of the event * @param {import('./filereader').FileReader} reader */ function fireAProgressEvent (e, reader) { // The progress event e does not bubble. e.bubbles must be false // The progress event e is NOT cancelable. e.cancelable must be false const event = new ProgressEvent(e, { bubbles: false, cancelable: false }) reader.dispatchEvent(event) } /** * @see https://w3c.github.io/FileAPI/#blob-package-data * @param {Uint8Array[]} bytes * @param {string} type * @param {string?} mimeType * @param {string?} encodingName */ function packageData (bytes, type, mimeType, encodingName) { // 1. A Blob has an associated package data algorithm, given // bytes, a type, a optional mimeType, and a optional // encodingName, which switches on type and runs the // associated steps: switch (type) { case 'DataURL': { // 1. Return bytes as a DataURL [RFC2397] subject to // the considerations below: // * Use mimeType as part of the Data URL if it is // available in keeping with the Data URL // specification [RFC2397]. // * If mimeType is not available return a Data URL // without a media-type. [RFC2397]. // https://datatracker.ietf.org/doc/html/rfc2397#section-3 // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data // mediatype := [ type "/" subtype ] *( ";" parameter ) // data := *urlchar // parameter := attribute "=" value let dataURL = 'data:' const parsed = parseMIMEType(mimeType || 'application/octet-stream') if (parsed !== 'failure') { dataURL += serializeAMimeType(parsed) } dataURL += ';base64,' const decoder = new StringDecoder('latin1') for (const chunk of bytes) { dataURL += btoa(decoder.write(chunk)) } dataURL += btoa(decoder.end()) return dataURL } case 'Text': { // 1. Let encoding be failure let encoding = 'failure' // 2. If the encodingName is present, set encoding to the // result of getting an encoding from encodingName. if (encodingName) { encoding = getEncoding(encodingName) } // 3. If encoding is failure, and mimeType is present: if (encoding === 'failure' && mimeType) { // 1. Let type be the result of parse a MIME type // given mimeType. const type = parseMIMEType(mimeType) // 2. If type is not failure, set encoding to the result // of getting an encoding from type’s parameters["charset"]. if (type !== 'failure') { encoding = getEncoding(type.parameters.get('charset')) } } // 4. If encoding is failure, then set encoding to UTF-8. if (encoding === 'failure') { encoding = 'UTF-8' } // 5. Decode bytes using fallback encoding encoding, and // return the result. return decode(bytes, encoding) } case 'ArrayBuffer': { // Return a new ArrayBuffer whose contents are bytes. const sequence = combineByteSequences(bytes) return sequence.buffer } case 'BinaryString': { // Return bytes as a binary string, in which every byte // is represented by a code unit of equal value [0..255]. let binaryString = '' const decoder = new StringDecoder('latin1') for (const chunk of bytes) { binaryString += decoder.write(chunk) } binaryString += decoder.end() return binaryString } } } /** * @see https://encoding.spec.whatwg.org/#decode * @param {Uint8Array[]} ioQueue * @param {string} encoding */ function decode (ioQueue, encoding) { const bytes = combineByteSequences(ioQueue) // 1. Let BOMEncoding be the result of BOM sniffing ioQueue. const BOMEncoding = BOMSniffing(bytes) let slice = 0 // 2. If BOMEncoding is non-null: if (BOMEncoding !== null) { // 1. Set encoding to BOMEncoding. encoding = BOMEncoding // 2. Read three bytes from ioQueue, if BOMEncoding is // UTF-8; otherwise read two bytes. // (Do nothing with those bytes.) slice = BOMEncoding === 'UTF-8' ? 3 : 2 } // 3. Process a queue with an instance of encoding’s // decoder, ioQueue, output, and "replacement". // 4. Return output. const sliced = bytes.slice(slice) return new TextDecoder(encoding).decode(sliced) } /** * @see https://encoding.spec.whatwg.org/#bom-sniff * @param {Uint8Array} ioQueue */ function BOMSniffing (ioQueue) { // 1. Let BOM be the result of peeking 3 bytes from ioQueue, // converted to a byte sequence. const [a, b, c] = ioQueue // 2. For each of the rows in the table below, starting with // the first one and going down, if BOM starts with the // bytes given in the first column, then return the // encoding given in the cell in the second column of that // row. Otherwise, return null. if (a === 0xEF && b === 0xBB && c === 0xBF) { return 'UTF-8' } else if (a === 0xFE && b === 0xFF) { return 'UTF-16BE' } else if (a === 0xFF && b === 0xFE) { return 'UTF-16LE' } return null } /** * @param {Uint8Array[]} sequences */ function combineByteSequences (sequences) { const size = sequences.reduce((a, b) => { return a + b.byteLength }, 0) let offset = 0 return sequences.reduce((a, b) => { a.set(b, offset) offset += b.byteLength return a }, new Uint8Array(size)) } module.exports = { staticPropertyDescriptors, readOperation, fireAProgressEvent } /***/ }), /***/ 2581: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // We include a version number for the Dispatcher API. In case of breaking changes, // this version number must be increased to avoid conflicts. const globalDispatcher = Symbol.for('undici.globalDispatcher.1') const { InvalidArgumentError } = __nccwpck_require__(8707) const Agent = __nccwpck_require__(9965) if (getGlobalDispatcher() === undefined) { setGlobalDispatcher(new Agent()) } function setGlobalDispatcher (agent) { if (!agent || typeof agent.dispatch !== 'function') { throw new InvalidArgumentError('Argument agent must implement Agent') } Object.defineProperty(globalThis, globalDispatcher, { value: agent, writable: true, enumerable: false, configurable: false }) } function getGlobalDispatcher () { return globalThis[globalDispatcher] } module.exports = { setGlobalDispatcher, getGlobalDispatcher } /***/ }), /***/ 8840: /***/ ((module) => { module.exports = class DecoratorHandler { constructor (handler) { this.handler = handler } onConnect (...args) { return this.handler.onConnect(...args) } onError (...args) { return this.handler.onError(...args) } onUpgrade (...args) { return this.handler.onUpgrade(...args) } onHeaders (...args) { return this.handler.onHeaders(...args) } onData (...args) { return this.handler.onData(...args) } onComplete (...args) { return this.handler.onComplete(...args) } onBodySent (...args) { return this.handler.onBodySent(...args) } } /***/ }), /***/ 8299: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const util = __nccwpck_require__(3440) const { kBodyUsed } = __nccwpck_require__(6443) const assert = __nccwpck_require__(2613) const { InvalidArgumentError } = __nccwpck_require__(8707) const EE = __nccwpck_require__(4434) const redirectableStatusCodes = [300, 301, 302, 303, 307, 308] const kBody = Symbol('body') class BodyAsyncIterable { constructor (body) { this[kBody] = body this[kBodyUsed] = false } async * [Symbol.asyncIterator] () { assert(!this[kBodyUsed], 'disturbed') this[kBodyUsed] = true yield * this[kBody] } } class RedirectHandler { constructor (dispatch, maxRedirections, opts, handler) { if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { throw new InvalidArgumentError('maxRedirections must be a positive number') } util.validateHandler(handler, opts.method, opts.upgrade) this.dispatch = dispatch this.location = null this.abort = null this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy this.maxRedirections = maxRedirections this.handler = handler this.history = [] if (util.isStream(this.opts.body)) { // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp // so that it can be dispatched again? // TODO (fix): Do we need 100-expect support to provide a way to do this properly? if (util.bodyLength(this.opts.body) === 0) { this.opts.body .on('data', function () { assert(false) }) } if (typeof this.opts.body.readableDidRead !== 'boolean') { this.opts.body[kBodyUsed] = false EE.prototype.on.call(this.opts.body, 'data', function () { this[kBodyUsed] = true }) } } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') { // TODO (fix): We can't access ReadableStream internal state // to determine whether or not it has been disturbed. This is just // a workaround. this.opts.body = new BodyAsyncIterable(this.opts.body) } else if ( this.opts.body && typeof this.opts.body !== 'string' && !ArrayBuffer.isView(this.opts.body) && util.isIterable(this.opts.body) ) { // TODO: Should we allow re-using iterable if !this.opts.idempotent // or through some other flag? this.opts.body = new BodyAsyncIterable(this.opts.body) } } onConnect (abort) { this.abort = abort this.handler.onConnect(abort, { history: this.history }) } onUpgrade (statusCode, headers, socket) { this.handler.onUpgrade(statusCode, headers, socket) } onError (error) { this.handler.onError(error) } onHeaders (statusCode, headers, resume, statusText) { this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers) if (this.opts.origin) { this.history.push(new URL(this.opts.path, this.opts.origin)) } if (!this.location) { return this.handler.onHeaders(statusCode, headers, resume, statusText) } const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))) const path = search ? `${pathname}${search}` : pathname // Remove headers referring to the original URL. // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers. // https://tools.ietf.org/html/rfc7231#section-6.4 this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin) this.opts.path = path this.opts.origin = origin this.opts.maxRedirections = 0 this.opts.query = null // https://tools.ietf.org/html/rfc7231#section-6.4.4 // In case of HTTP 303, always replace method to be either HEAD or GET if (statusCode === 303 && this.opts.method !== 'HEAD') { this.opts.method = 'GET' this.opts.body = null } } onData (chunk) { if (this.location) { /* https://tools.ietf.org/html/rfc7231#section-6.4 TLDR: undici always ignores 3xx response bodies. Redirection is used to serve the requested resource from another URL, so it is assumes that no body is generated (and thus can be ignored). Even though generating a body is not prohibited. For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually (which means it's optional and not mandated) contain just an hyperlink to the value of the Location response header, so the body can be ignored safely. For status 300, which is "Multiple Choices", the spec mentions both generating a Location response header AND a response body with the other possible location to follow. Since the spec explicitily chooses not to specify a format for such body and leave it to servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it. */ } else { return this.handler.onData(chunk) } } onComplete (trailers) { if (this.location) { /* https://tools.ietf.org/html/rfc7231#section-6.4 TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections and neither are useful if present. See comment on onData method above for more detailed informations. */ this.location = null this.abort = null this.dispatch(this.opts, this) } else { this.handler.onComplete(trailers) } } onBodySent (chunk) { if (this.handler.onBodySent) { this.handler.onBodySent(chunk) } } } function parseLocation (statusCode, headers) { if (redirectableStatusCodes.indexOf(statusCode) === -1) { return null } for (let i = 0; i < headers.length; i += 2) { if (headers[i].toString().toLowerCase() === 'location') { return headers[i + 1] } } } // https://tools.ietf.org/html/rfc7231#section-6.4.4 function shouldRemoveHeader (header, removeContent, unknownOrigin) { if (header.length === 4) { return util.headerNameToString(header) === 'host' } if (removeContent && util.headerNameToString(header).startsWith('content-')) { return true } if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) { const name = util.headerNameToString(header) return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization' } return false } // https://tools.ietf.org/html/rfc7231#section-6.4 function cleanRequestHeaders (headers, removeContent, unknownOrigin) { const ret = [] if (Array.isArray(headers)) { for (let i = 0; i < headers.length; i += 2) { if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) { ret.push(headers[i], headers[i + 1]) } } } else if (headers && typeof headers === 'object') { for (const key of Object.keys(headers)) { if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) { ret.push(key, headers[key]) } } } else { assert(headers == null, 'headers must be an object or an array') } return ret } module.exports = RedirectHandler /***/ }), /***/ 3573: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const assert = __nccwpck_require__(2613) const { kRetryHandlerDefaultRetry } = __nccwpck_require__(6443) const { RequestRetryError } = __nccwpck_require__(8707) const { isDisturbed, parseHeaders, parseRangeHeader } = __nccwpck_require__(3440) function calculateRetryAfterHeader (retryAfter) { const current = Date.now() const diff = new Date(retryAfter).getTime() - current return diff } class RetryHandler { constructor (opts, handlers) { const { retryOptions, ...dispatchOpts } = opts const { // Retry scoped retry: retryFn, maxRetries, maxTimeout, minTimeout, timeoutFactor, // Response scoped methods, errorCodes, retryAfter, statusCodes } = retryOptions ?? {} this.dispatch = handlers.dispatch this.handler = handlers.handler this.opts = dispatchOpts this.abort = null this.aborted = false this.retryOpts = { retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry], retryAfter: retryAfter ?? true, maxTimeout: maxTimeout ?? 30 * 1000, // 30s, timeout: minTimeout ?? 500, // .5s timeoutFactor: timeoutFactor ?? 2, maxRetries: maxRetries ?? 5, // What errors we should retry methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'], // Indicates which errors to retry statusCodes: statusCodes ?? [500, 502, 503, 504, 429], // List of errors to retry errorCodes: errorCodes ?? [ 'ECONNRESET', 'ECONNREFUSED', 'ENOTFOUND', 'ENETDOWN', 'ENETUNREACH', 'EHOSTDOWN', 'EHOSTUNREACH', 'EPIPE' ] } this.retryCount = 0 this.start = 0 this.end = null this.etag = null this.resume = null // Handle possible onConnect duplication this.handler.onConnect(reason => { this.aborted = true if (this.abort) { this.abort(reason) } else { this.reason = reason } }) } onRequestSent () { if (this.handler.onRequestSent) { this.handler.onRequestSent() } } onUpgrade (statusCode, headers, socket) { if (this.handler.onUpgrade) { this.handler.onUpgrade(statusCode, headers, socket) } } onConnect (abort) { if (this.aborted) { abort(this.reason) } else { this.abort = abort } } onBodySent (chunk) { if (this.handler.onBodySent) return this.handler.onBodySent(chunk) } static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) { const { statusCode, code, headers } = err const { method, retryOptions } = opts const { maxRetries, timeout, maxTimeout, timeoutFactor, statusCodes, errorCodes, methods } = retryOptions let { counter, currentTimeout } = state currentTimeout = currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout // Any code that is not a Undici's originated and allowed to retry if ( code && code !== 'UND_ERR_REQ_RETRY' && code !== 'UND_ERR_SOCKET' && !errorCodes.includes(code) ) { cb(err) return } // If a set of method are provided and the current method is not in the list if (Array.isArray(methods) && !methods.includes(method)) { cb(err) return } // If a set of status code are provided and the current status code is not in the list if ( statusCode != null && Array.isArray(statusCodes) && !statusCodes.includes(statusCode) ) { cb(err) return } // If we reached the max number of retries if (counter > maxRetries) { cb(err) return } let retryAfterHeader = headers != null && headers['retry-after'] if (retryAfterHeader) { retryAfterHeader = Number(retryAfterHeader) retryAfterHeader = isNaN(retryAfterHeader) ? calculateRetryAfterHeader(retryAfterHeader) : retryAfterHeader * 1e3 // Retry-After is in seconds } const retryTimeout = retryAfterHeader > 0 ? Math.min(retryAfterHeader, maxTimeout) : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout) state.currentTimeout = retryTimeout setTimeout(() => cb(null), retryTimeout) } onHeaders (statusCode, rawHeaders, resume, statusMessage) { const headers = parseHeaders(rawHeaders) this.retryCount += 1 if (statusCode >= 300) { this.abort( new RequestRetryError('Request failed', statusCode, { headers, count: this.retryCount }) ) return false } // Checkpoint for resume from where we left it if (this.resume != null) { this.resume = null if (statusCode !== 206) { return true } const contentRange = parseRangeHeader(headers['content-range']) // If no content range if (!contentRange) { this.abort( new RequestRetryError('Content-Range mismatch', statusCode, { headers, count: this.retryCount }) ) return false } // Let's start with a weak etag check if (this.etag != null && this.etag !== headers.etag) { this.abort( new RequestRetryError('ETag mismatch', statusCode, { headers, count: this.retryCount }) ) return false } const { start, size, end = size } = contentRange assert(this.start === start, 'content-range mismatch') assert(this.end == null || this.end === end, 'content-range mismatch') this.resume = resume return true } if (this.end == null) { if (statusCode === 206) { // First time we receive 206 const range = parseRangeHeader(headers['content-range']) if (range == null) { return this.handler.onHeaders( statusCode, rawHeaders, resume, statusMessage ) } const { start, size, end = size } = range assert( start != null && Number.isFinite(start) && this.start !== start, 'content-range mismatch' ) assert(Number.isFinite(start)) assert( end != null && Number.isFinite(end) && this.end !== end, 'invalid content-length' ) this.start = start this.end = end } // We make our best to checkpoint the body for further range headers if (this.end == null) { const contentLength = headers['content-length'] this.end = contentLength != null ? Number(contentLength) : null } assert(Number.isFinite(this.start)) assert( this.end == null || Number.isFinite(this.end), 'invalid content-length' ) this.resume = resume this.etag = headers.etag != null ? headers.etag : null return this.handler.onHeaders( statusCode, rawHeaders, resume, statusMessage ) } const err = new RequestRetryError('Request failed', statusCode, { headers, count: this.retryCount }) this.abort(err) return false } onData (chunk) { this.start += chunk.length return this.handler.onData(chunk) } onComplete (rawTrailers) { this.retryCount = 0 return this.handler.onComplete(rawTrailers) } onError (err) { if (this.aborted || isDisturbed(this.opts.body)) { return this.handler.onError(err) } this.retryOpts.retry( err, { state: { counter: this.retryCount++, currentTimeout: this.retryAfter }, opts: { retryOptions: this.retryOpts, ...this.opts } }, onRetry.bind(this) ) function onRetry (err) { if (err != null || this.aborted || isDisturbed(this.opts.body)) { return this.handler.onError(err) } if (this.start !== 0) { this.opts = { ...this.opts, headers: { ...this.opts.headers, range: `bytes=${this.start}-${this.end ?? ''}` } } } try { this.dispatch(this.opts, this) } catch (err) { this.handler.onError(err) } } } } module.exports = RetryHandler /***/ }), /***/ 4415: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const RedirectHandler = __nccwpck_require__(8299) function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) { return (dispatch) => { return function Intercept (opts, handler) { const { maxRedirections = defaultMaxRedirections } = opts if (!maxRedirections) { return dispatch(opts, handler) } const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler) opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting. return dispatch(opts, redirectHandler) } } } module.exports = createRedirectInterceptor /***/ }), /***/ 2824: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; const utils_1 = __nccwpck_require__(172); // C headers var ERROR; (function (ERROR) { ERROR[ERROR["OK"] = 0] = "OK"; ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL"; ERROR[ERROR["STRICT"] = 2] = "STRICT"; ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED"; ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH"; ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION"; ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD"; ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL"; ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT"; ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION"; ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN"; ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH"; ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE"; ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS"; ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE"; ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING"; ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN"; ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE"; ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE"; ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER"; ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE"; ERROR[ERROR["PAUSED"] = 21] = "PAUSED"; ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE"; ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE"; ERROR[ERROR["USER"] = 24] = "USER"; })(ERROR = exports.ERROR || (exports.ERROR = {})); var TYPE; (function (TYPE) { TYPE[TYPE["BOTH"] = 0] = "BOTH"; TYPE[TYPE["REQUEST"] = 1] = "REQUEST"; TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE"; })(TYPE = exports.TYPE || (exports.TYPE = {})); var FLAGS; (function (FLAGS) { FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE"; FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE"; FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE"; FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED"; FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE"; FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH"; FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY"; FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING"; // 1 << 8 is unused FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING"; })(FLAGS = exports.FLAGS || (exports.FLAGS = {})); var LENIENT_FLAGS; (function (LENIENT_FLAGS) { LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS"; LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH"; LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE"; })(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {})); var METHODS; (function (METHODS) { METHODS[METHODS["DELETE"] = 0] = "DELETE"; METHODS[METHODS["GET"] = 1] = "GET"; METHODS[METHODS["HEAD"] = 2] = "HEAD"; METHODS[METHODS["POST"] = 3] = "POST"; METHODS[METHODS["PUT"] = 4] = "PUT"; /* pathological */ METHODS[METHODS["CONNECT"] = 5] = "CONNECT"; METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS"; METHODS[METHODS["TRACE"] = 7] = "TRACE"; /* WebDAV */ METHODS[METHODS["COPY"] = 8] = "COPY"; METHODS[METHODS["LOCK"] = 9] = "LOCK"; METHODS[METHODS["MKCOL"] = 10] = "MKCOL"; METHODS[METHODS["MOVE"] = 11] = "MOVE"; METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND"; METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH"; METHODS[METHODS["SEARCH"] = 14] = "SEARCH"; METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK"; METHODS[METHODS["BIND"] = 16] = "BIND"; METHODS[METHODS["REBIND"] = 17] = "REBIND"; METHODS[METHODS["UNBIND"] = 18] = "UNBIND"; METHODS[METHODS["ACL"] = 19] = "ACL"; /* subversion */ METHODS[METHODS["REPORT"] = 20] = "REPORT"; METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY"; METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT"; METHODS[METHODS["MERGE"] = 23] = "MERGE"; /* upnp */ METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH"; METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY"; METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE"; METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE"; /* RFC-5789 */ METHODS[METHODS["PATCH"] = 28] = "PATCH"; METHODS[METHODS["PURGE"] = 29] = "PURGE"; /* CalDAV */ METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR"; /* RFC-2068, section 19.6.1.2 */ METHODS[METHODS["LINK"] = 31] = "LINK"; METHODS[METHODS["UNLINK"] = 32] = "UNLINK"; /* icecast */ METHODS[METHODS["SOURCE"] = 33] = "SOURCE"; /* RFC-7540, section 11.6 */ METHODS[METHODS["PRI"] = 34] = "PRI"; /* RFC-2326 RTSP */ METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE"; METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE"; METHODS[METHODS["SETUP"] = 37] = "SETUP"; METHODS[METHODS["PLAY"] = 38] = "PLAY"; METHODS[METHODS["PAUSE"] = 39] = "PAUSE"; METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN"; METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER"; METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER"; METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT"; METHODS[METHODS["RECORD"] = 44] = "RECORD"; /* RAOP */ METHODS[METHODS["FLUSH"] = 45] = "FLUSH"; })(METHODS = exports.METHODS || (exports.METHODS = {})); exports.METHODS_HTTP = [ METHODS.DELETE, METHODS.GET, METHODS.HEAD, METHODS.POST, METHODS.PUT, METHODS.CONNECT, METHODS.OPTIONS, METHODS.TRACE, METHODS.COPY, METHODS.LOCK, METHODS.MKCOL, METHODS.MOVE, METHODS.PROPFIND, METHODS.PROPPATCH, METHODS.SEARCH, METHODS.UNLOCK, METHODS.BIND, METHODS.REBIND, METHODS.UNBIND, METHODS.ACL, METHODS.REPORT, METHODS.MKACTIVITY, METHODS.CHECKOUT, METHODS.MERGE, METHODS['M-SEARCH'], METHODS.NOTIFY, METHODS.SUBSCRIBE, METHODS.UNSUBSCRIBE, METHODS.PATCH, METHODS.PURGE, METHODS.MKCALENDAR, METHODS.LINK, METHODS.UNLINK, METHODS.PRI, // TODO(indutny): should we allow it with HTTP? METHODS.SOURCE, ]; exports.METHODS_ICE = [ METHODS.SOURCE, ]; exports.METHODS_RTSP = [ METHODS.OPTIONS, METHODS.DESCRIBE, METHODS.ANNOUNCE, METHODS.SETUP, METHODS.PLAY, METHODS.PAUSE, METHODS.TEARDOWN, METHODS.GET_PARAMETER, METHODS.SET_PARAMETER, METHODS.REDIRECT, METHODS.RECORD, METHODS.FLUSH, // For AirPlay METHODS.GET, METHODS.POST, ]; exports.METHOD_MAP = utils_1.enumToMap(METHODS); exports.H_METHOD_MAP = {}; Object.keys(exports.METHOD_MAP).forEach((key) => { if (/^H/.test(key)) { exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key]; } }); var FINISH; (function (FINISH) { FINISH[FINISH["SAFE"] = 0] = "SAFE"; FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB"; FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE"; })(FINISH = exports.FINISH || (exports.FINISH = {})); exports.ALPHA = []; for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) { // Upper case exports.ALPHA.push(String.fromCharCode(i)); // Lower case exports.ALPHA.push(String.fromCharCode(i + 0x20)); } exports.NUM_MAP = { 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, }; exports.HEX_MAP = { 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF, a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf, }; exports.NUM = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ]; exports.ALPHANUM = exports.ALPHA.concat(exports.NUM); exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')']; exports.USERINFO_CHARS = exports.ALPHANUM .concat(exports.MARK) .concat(['%', ';', ':', '&', '=', '+', '$', ',']); // TODO(indutny): use RFC exports.STRICT_URL_CHAR = [ '!', '"', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '@', '[', '\\', ']', '^', '_', '`', '{', '|', '}', '~', ].concat(exports.ALPHANUM); exports.URL_CHAR = exports.STRICT_URL_CHAR .concat(['\t', '\f']); // All characters with 0x80 bit set to 1 for (let i = 0x80; i <= 0xff; i++) { exports.URL_CHAR.push(i); } exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']); /* Tokens as defined by rfc 2616. Also lowercases them. * token = 1* * separators = "(" | ")" | "<" | ">" | "@" * | "," | ";" | ":" | "\" | <"> * | "/" | "[" | "]" | "?" | "=" * | "{" | "}" | SP | HT */ exports.STRICT_TOKEN = [ '!', '#', '$', '%', '&', '\'', '*', '+', '-', '.', '^', '_', '`', '|', '~', ].concat(exports.ALPHANUM); exports.TOKEN = exports.STRICT_TOKEN.concat([' ']); /* * Verify that a char is a valid visible (printable) US-ASCII * character or %x80-FF */ exports.HEADER_CHARS = ['\t']; for (let i = 32; i <= 255; i++) { if (i !== 127) { exports.HEADER_CHARS.push(i); } } // ',' = \x44 exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44); exports.MAJOR = exports.NUM_MAP; exports.MINOR = exports.MAJOR; var HEADER_STATE; (function (HEADER_STATE) { HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL"; HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION"; HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH"; HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING"; HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE"; HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE"; HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE"; HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE"; HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED"; })(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {})); exports.SPECIAL_HEADERS = { 'connection': HEADER_STATE.CONNECTION, 'content-length': HEADER_STATE.CONTENT_LENGTH, 'proxy-connection': HEADER_STATE.CONNECTION, 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING, 'upgrade': HEADER_STATE.UPGRADE, }; //# sourceMappingURL=constants.js.map /***/ }), /***/ 3870: /***/ ((module) => { module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAG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ECAwQFCwYHNTk3MS8tJyspCsLgAkUCAAsIABCIgICAAAsZACAAEMKAgIAAGiAAIAI2AjggACABOgAoCxwAIAAgAC8BMiAALQAuIAAQwYCAgAAQgICAgAALKgEBf0HAABDGgICAACIBEMKAgIAAGiABQYCIgIAANgI4IAEgADoAKCABCwoAIAAQyICAgAALBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LRQEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABDCgICAABogACAENgI4IAAgAzoAKCAAIAI6AC0gACABNgIYCxEAIAAgASABIAJqEMOAgIAACxAAIABBAEHcABDMgICAABoLZwEBf0EAIQECQCAAKAIMDQACQAJAAkACQCAALQAvDgMBAAMCCyAAKAI4IgFFDQAgASgCLCIBRQ0AIAAgARGAgICAAAAiAQ0DC0EADwsQyoCAgAAACyAAQcOWgIAANgIQQQ4hAQsgAQseAAJAIAAoAgwNACAAQdGbgIAANgIQIABBFTYCDAsLFgACQCAAKAIMQRVHDQAgAEEANgIMCwsWAAJAIAAoAgxBFkcNACAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsiAAJAIABBJEkNABDKgICAAAALIABBAnRBoLOAgABqKAIACyIAAkAgAEEuSQ0AEMqAgIAAAAsgAEECdEGwtICAAGooAgAL7gsBAX9B66iAgAAhAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABBnH9qDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWF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GABEYNACAEQShxQQBHIQMLIABBADsBMCAAQQA6AC8gAwuZAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQBBACEBIAAvATAiAkECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC1kAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEHdATYCHEEAC3sBAX8CQCAAKAIMIgMNAAJAIAAoAgRFDQAgACABNgIECwJAIAAgASACEMSAgIAAIgMNACAAKAIMDwsgACADNgIcQQAhAyAAKAIEIgFFDQAgACABIAIgACgCCBGBgICAAAAiAUUNACAAIAI2AhQgACABNgIMIAEhAwsgAwvk8wEDDn8DfgR/I4CAgIAAQRBrIgMkgICAgAAgASEEIAEhBSABIQYgASEHIAEhCCABIQkgASEKIAEhCyABIQwgASENIAEhDiABIQ8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAA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ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQDscBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxweHyAhIyUoP0BBREVGR0hJSktMTU9QUVJT3gNXWVtcXWBiZWZnaGlqa2xtb3BxcnN0dXZ3eHl6e3x9foABggGFAYYBhwGJAYsBjAGNAY4BjwGQAZEBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBxwHIAckBygHLAcwBzQHOAc8B0AHRAdIB0wHUAdUB1gHXAdgB2QHaAdsB3AHdAd4B4AHhAeIB4wHkAeUB5gHnAegB6QHqAesB7AHtAe4B7wHwAfEB8gHzAZkCpAKwAv4C/gILIAE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ABCyAAQQA2AhwgACABNgIUIABBxoqAgAA2AhAgAEEHNgIMQQAhEAyvAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0wA2AhwgACAUNgIUIAAgATYCDEEAIRAMowELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDEMLIABB5QA2AhwgACAUNgIUIAAgATYCDEEAIRAMogELIABBADYCHCAAIBQ2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKEBCyAAQQA2AhwgACABNgIUIABBw4+AgAA2AhAgAEEHNgIMQQAhEAygAQtBACEQIABBADYCHC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QDAgLQcYBIRAMBwtBvAEhEAwGC0G9ASEQDAULQb4BIRAMBAtBvwEhEAwDC0HAASEQDAILQcIBIRAMAQtBwQEhEAsDQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAC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IQu4CAgAAiEA3oASABIQEMMQsgAEIANwMgQRIhEAzVAwsgASIQIAJHDStBHSEQDO0DCwJAIAEiASACRg0AIAFBAWohAUEQIRAM1AMLQQchEAzsAwsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECABQQFqIgEQuYCAgAAiEA3qASABIQEM9AILIAFBAWoiASACRw0AC0ESIRAM4gMLIAAgASIBIAIQuoCAgAAiEA3pASABIQEMCgsgASIBIAJHDQZBGyEQDOADCwJAIAEiASACRw0AQRYhEAzgAwsgAEGKgICAADYCCCAAIAE2AgQgACABIAIQuICAgAAiEA3qASABIQFBICEQDMYDCwJAIAEiASACRg0AA0ACQCABLQAAQfC3gIAAai0AACIQQQJGDQACQCAQQX9qDgTlAewBAOsB7AELIAFBAWohAUEIIRAMyAMLIAFBAWoiASACRw0AC0EVIRAM3wMLQRUhEAzeAwsDQAJAIAEtAABB8LmAgABqLQAAIhBBAkYNACAQQX9qDgTeAewB4AHrAewBCyABQQFqIgEgAkcNAAtBGCEQDN0DCwJAIAEiASACRg0AIABBi4CAgAA2AgggACABNgIEIAEhAUEHIRAMxAMLQRkhEAzcAwsgAUEBaiEBDAILAkAgAS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AAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDK0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDKwBCyAAQQA2AhwgACABNgIUIABB3IiAgAA2AhAgAEEHNgIMQQAhEAyrAQsgEEE/Rw0BIAFBAWohAQtBBSEQDJABC0EAIRAgAEEANgIcIAAgATYCFCAAQf2SgIAANgIQIABBBzYCDAyoAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEH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AAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAgAAAAACAAAAAAAAAAAAAAAAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==' /***/ }), /***/ 172: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.enumToMap = void 0; function enumToMap(obj) { const res = {}; Object.keys(obj).forEach((key) => { const value = obj[key]; if (typeof value === 'number') { res[key] = value; } }); return res; } exports.enumToMap = enumToMap; //# sourceMappingURL=utils.js.map /***/ }), /***/ 7501: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { kClients } = __nccwpck_require__(6443) const Agent = __nccwpck_require__(9965) const { kAgent, kMockAgentSet, kMockAgentGet, kDispatches, kIsMockActive, kNetConnect, kGetNetConnect, kOptions, kFactory } = __nccwpck_require__(1117) const MockClient = __nccwpck_require__(7365) const MockPool = __nccwpck_require__(4004) const { matchValue, buildMockOptions } = __nccwpck_require__(3397) const { InvalidArgumentError, UndiciError } = __nccwpck_require__(8707) const Dispatcher = __nccwpck_require__(992) const Pluralizer = __nccwpck_require__(1529) const PendingInterceptorsFormatter = __nccwpck_require__(6142) class FakeWeakRef { constructor (value) { this.value = value } deref () { return this.value } } class MockAgent extends Dispatcher { constructor (opts) { super(opts) this[kNetConnect] = true this[kIsMockActive] = true // Instantiate Agent and encapsulate if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) { throw new InvalidArgumentError('Argument opts.agent must implement Agent') } const agent = opts && opts.agent ? opts.agent : new Agent(opts) this[kAgent] = agent this[kClients] = agent[kClients] this[kOptions] = buildMockOptions(opts) } get (origin) { let dispatcher = this[kMockAgentGet](origin) if (!dispatcher) { dispatcher = this[kFactory](origin) this[kMockAgentSet](origin, dispatcher) } return dispatcher } dispatch (opts, handler) { // Call MockAgent.get to perform additional setup before dispatching as normal this.get(opts.origin) return this[kAgent].dispatch(opts, handler) } async close () { await this[kAgent].close() this[kClients].clear() } deactivate () { this[kIsMockActive] = false } activate () { this[kIsMockActive] = true } enableNetConnect (matcher) { if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) { if (Array.isArray(this[kNetConnect])) { this[kNetConnect].push(matcher) } else { this[kNetConnect] = [matcher] } } else if (typeof matcher === 'undefined') { this[kNetConnect] = true } else { throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.') } } disableNetConnect () { this[kNetConnect] = false } // This is required to bypass issues caused by using global symbols - see: // https://github.com/nodejs/undici/issues/1447 get isMockActive () { return this[kIsMockActive] } [kMockAgentSet] (origin, dispatcher) { this[kClients].set(origin, new FakeWeakRef(dispatcher)) } [kFactory] (origin) { const mockOptions = Object.assign({ agent: this }, this[kOptions]) return this[kOptions] && this[kOptions].connections === 1 ? new MockClient(origin, mockOptions) : new MockPool(origin, mockOptions) } [kMockAgentGet] (origin) { // First check if we can immediately find it const ref = this[kClients].get(origin) if (ref) { return ref.deref() } // If the origin is not a string create a dummy parent pool and return to user if (typeof origin !== 'string') { const dispatcher = this[kFactory]('http://localhost:9999') this[kMockAgentSet](origin, dispatcher) return dispatcher } // If we match, create a pool and assign the same dispatches for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) { const nonExplicitDispatcher = nonExplicitRef.deref() if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) { const dispatcher = this[kFactory](origin) this[kMockAgentSet](origin, dispatcher) dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches] return dispatcher } } } [kGetNetConnect] () { return this[kNetConnect] } pendingInterceptors () { const mockAgentClients = this[kClients] return Array.from(mockAgentClients.entries()) .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin }))) .filter(({ pending }) => pending) } assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) { const pending = this.pendingInterceptors() if (pending.length === 0) { return } const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length) throw new UndiciError(` ${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending: ${pendingInterceptorsFormatter.format(pending)} `.trim()) } } module.exports = MockAgent /***/ }), /***/ 7365: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { promisify } = __nccwpck_require__(9023) const Client = __nccwpck_require__(6197) const { buildMockDispatch } = __nccwpck_require__(3397) const { kDispatches, kMockAgent, kClose, kOriginalClose, kOrigin, kOriginalDispatch, kConnected } = __nccwpck_require__(1117) const { MockInterceptor } = __nccwpck_require__(1511) const Symbols = __nccwpck_require__(6443) const { InvalidArgumentError } = __nccwpck_require__(8707) /** * MockClient provides an API that extends the Client to influence the mockDispatches. */ class MockClient extends Client { constructor (origin, opts) { super(origin, opts) if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') { throw new InvalidArgumentError('Argument opts.agent must implement Agent') } this[kMockAgent] = opts.agent this[kOrigin] = origin this[kDispatches] = [] this[kConnected] = 1 this[kOriginalDispatch] = this.dispatch this[kOriginalClose] = this.close.bind(this) this.dispatch = buildMockDispatch.call(this) this.close = this[kClose] } get [Symbols.kConnected] () { return this[kConnected] } /** * Sets up the base interceptor for mocking replies from undici. */ intercept (opts) { return new MockInterceptor(opts, this[kDispatches]) } async [kClose] () { await promisify(this[kOriginalClose])() this[kConnected] = 0 this[kMockAgent][Symbols.kClients].delete(this[kOrigin]) } } module.exports = MockClient /***/ }), /***/ 2429: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { UndiciError } = __nccwpck_require__(8707) class MockNotMatchedError extends UndiciError { constructor (message) { super(message) Error.captureStackTrace(this, MockNotMatchedError) this.name = 'MockNotMatchedError' this.message = message || 'The request does not match any registered mock dispatches' this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED' } } module.exports = { MockNotMatchedError } /***/ }), /***/ 1511: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(3397) const { kDispatches, kDispatchKey, kDefaultHeaders, kDefaultTrailers, kContentLength, kMockDispatch } = __nccwpck_require__(1117) const { InvalidArgumentError } = __nccwpck_require__(8707) const { buildURL } = __nccwpck_require__(3440) /** * Defines the scope API for an interceptor reply */ class MockScope { constructor (mockDispatch) { this[kMockDispatch] = mockDispatch } /** * Delay a reply by a set amount in ms. */ delay (waitInMs) { if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) { throw new InvalidArgumentError('waitInMs must be a valid integer > 0') } this[kMockDispatch].delay = waitInMs return this } /** * For a defined reply, never mark as consumed. */ persist () { this[kMockDispatch].persist = true return this } /** * Allow one to define a reply for a set amount of matching requests. */ times (repeatTimes) { if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) { throw new InvalidArgumentError('repeatTimes must be a valid integer > 0') } this[kMockDispatch].times = repeatTimes return this } } /** * Defines an interceptor for a Mock */ class MockInterceptor { constructor (opts, mockDispatches) { if (typeof opts !== 'object') { throw new InvalidArgumentError('opts must be an object') } if (typeof opts.path === 'undefined') { throw new InvalidArgumentError('opts.path must be defined') } if (typeof opts.method === 'undefined') { opts.method = 'GET' } // See https://github.com/nodejs/undici/issues/1245 // As per RFC 3986, clients are not supposed to send URI // fragments to servers when they retrieve a document, if (typeof opts.path === 'string') { if (opts.query) { opts.path = buildURL(opts.path, opts.query) } else { // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811 const parsedURL = new URL(opts.path, 'data://') opts.path = parsedURL.pathname + parsedURL.search } } if (typeof opts.method === 'string') { opts.method = opts.method.toUpperCase() } this[kDispatchKey] = buildKey(opts) this[kDispatches] = mockDispatches this[kDefaultHeaders] = {} this[kDefaultTrailers] = {} this[kContentLength] = false } createMockScopeDispatchData (statusCode, data, responseOptions = {}) { const responseData = getResponseData(data) const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {} const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers } const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers } return { statusCode, data, headers, trailers } } validateReplyParameters (statusCode, data, responseOptions) { if (typeof statusCode === 'undefined') { throw new InvalidArgumentError('statusCode must be defined') } if (typeof data === 'undefined') { throw new InvalidArgumentError('data must be defined') } if (typeof responseOptions !== 'object') { throw new InvalidArgumentError('responseOptions must be an object') } } /** * Mock an undici request with a defined reply. */ reply (replyData) { // Values of reply aren't available right now as they // can only be available when the reply callback is invoked. if (typeof replyData === 'function') { // We'll first wrap the provided callback in another function, // this function will properly resolve the data from the callback // when invoked. const wrappedDefaultsCallback = (opts) => { // Our reply options callback contains the parameter for statusCode, data and options. const resolvedData = replyData(opts) // Check if it is in the right format if (typeof resolvedData !== 'object') { throw new InvalidArgumentError('reply options callback must return an object') } const { statusCode, data = '', responseOptions = {} } = resolvedData this.validateReplyParameters(statusCode, data, responseOptions) // Since the values can be obtained immediately we return them // from this higher order function that will be resolved later. return { ...this.createMockScopeDispatchData(statusCode, data, responseOptions) } } // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback) return new MockScope(newMockDispatch) } // We can have either one or three parameters, if we get here, // we should have 1-3 parameters. So we spread the arguments of // this function to obtain the parameters, since replyData will always // just be the statusCode. const [statusCode, data = '', responseOptions = {}] = [...arguments] this.validateReplyParameters(statusCode, data, responseOptions) // Send in-already provided data like usual const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions) const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData) return new MockScope(newMockDispatch) } /** * Mock an undici request with a defined error. */ replyWithError (error) { if (typeof error === 'undefined') { throw new InvalidArgumentError('error must be defined') } const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error }) return new MockScope(newMockDispatch) } /** * Set default reply headers on the interceptor for subsequent replies */ defaultReplyHeaders (headers) { if (typeof headers === 'undefined') { throw new InvalidArgumentError('headers must be defined') } this[kDefaultHeaders] = headers return this } /** * Set default reply trailers on the interceptor for subsequent replies */ defaultReplyTrailers (trailers) { if (typeof trailers === 'undefined') { throw new InvalidArgumentError('trailers must be defined') } this[kDefaultTrailers] = trailers return this } /** * Set reply content length header for replies on the interceptor */ replyContentLength () { this[kContentLength] = true return this } } module.exports.MockInterceptor = MockInterceptor module.exports.MockScope = MockScope /***/ }), /***/ 4004: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { promisify } = __nccwpck_require__(9023) const Pool = __nccwpck_require__(5076) const { buildMockDispatch } = __nccwpck_require__(3397) const { kDispatches, kMockAgent, kClose, kOriginalClose, kOrigin, kOriginalDispatch, kConnected } = __nccwpck_require__(1117) const { MockInterceptor } = __nccwpck_require__(1511) const Symbols = __nccwpck_require__(6443) const { InvalidArgumentError } = __nccwpck_require__(8707) /** * MockPool provides an API that extends the Pool to influence the mockDispatches. */ class MockPool extends Pool { constructor (origin, opts) { super(origin, opts) if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') { throw new InvalidArgumentError('Argument opts.agent must implement Agent') } this[kMockAgent] = opts.agent this[kOrigin] = origin this[kDispatches] = [] this[kConnected] = 1 this[kOriginalDispatch] = this.dispatch this[kOriginalClose] = this.close.bind(this) this.dispatch = buildMockDispatch.call(this) this.close = this[kClose] } get [Symbols.kConnected] () { return this[kConnected] } /** * Sets up the base interceptor for mocking replies from undici. */ intercept (opts) { return new MockInterceptor(opts, this[kDispatches]) } async [kClose] () { await promisify(this[kOriginalClose])() this[kConnected] = 0 this[kMockAgent][Symbols.kClients].delete(this[kOrigin]) } } module.exports = MockPool /***/ }), /***/ 1117: /***/ ((module) => { module.exports = { kAgent: Symbol('agent'), kOptions: Symbol('options'), kFactory: Symbol('factory'), kDispatches: Symbol('dispatches'), kDispatchKey: Symbol('dispatch key'), kDefaultHeaders: Symbol('default headers'), kDefaultTrailers: Symbol('default trailers'), kContentLength: Symbol('content length'), kMockAgent: Symbol('mock agent'), kMockAgentSet: Symbol('mock agent set'), kMockAgentGet: Symbol('mock agent get'), kMockDispatch: Symbol('mock dispatch'), kClose: Symbol('close'), kOriginalClose: Symbol('original agent close'), kOrigin: Symbol('origin'), kIsMockActive: Symbol('is mock active'), kNetConnect: Symbol('net connect'), kGetNetConnect: Symbol('get net connect'), kConnected: Symbol('connected') } /***/ }), /***/ 3397: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { MockNotMatchedError } = __nccwpck_require__(2429) const { kDispatches, kMockAgent, kOriginalDispatch, kOrigin, kGetNetConnect } = __nccwpck_require__(1117) const { buildURL, nop } = __nccwpck_require__(3440) const { STATUS_CODES } = __nccwpck_require__(8611) const { types: { isPromise } } = __nccwpck_require__(9023) function matchValue (match, value) { if (typeof match === 'string') { return match === value } if (match instanceof RegExp) { return match.test(value) } if (typeof match === 'function') { return match(value) === true } return false } function lowerCaseEntries (headers) { return Object.fromEntries( Object.entries(headers).map(([headerName, headerValue]) => { return [headerName.toLocaleLowerCase(), headerValue] }) ) } /** * @param {import('../../index').Headers|string[]|Record} headers * @param {string} key */ function getHeaderByName (headers, key) { if (Array.isArray(headers)) { for (let i = 0; i < headers.length; i += 2) { if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) { return headers[i + 1] } } return undefined } else if (typeof headers.get === 'function') { return headers.get(key) } else { return lowerCaseEntries(headers)[key.toLocaleLowerCase()] } } /** @param {string[]} headers */ function buildHeadersFromArray (headers) { // fetch HeadersList const clone = headers.slice() const entries = [] for (let index = 0; index < clone.length; index += 2) { entries.push([clone[index], clone[index + 1]]) } return Object.fromEntries(entries) } function matchHeaders (mockDispatch, headers) { if (typeof mockDispatch.headers === 'function') { if (Array.isArray(headers)) { // fetch HeadersList headers = buildHeadersFromArray(headers) } return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {}) } if (typeof mockDispatch.headers === 'undefined') { return true } if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') { return false } for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) { const headerValue = getHeaderByName(headers, matchHeaderName) if (!matchValue(matchHeaderValue, headerValue)) { return false } } return true } function safeUrl (path) { if (typeof path !== 'string') { return path } const pathSegments = path.split('?') if (pathSegments.length !== 2) { return path } const qp = new URLSearchParams(pathSegments.pop()) qp.sort() return [...pathSegments, qp.toString()].join('?') } function matchKey (mockDispatch, { path, method, body, headers }) { const pathMatch = matchValue(mockDispatch.path, path) const methodMatch = matchValue(mockDispatch.method, method) const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true const headersMatch = matchHeaders(mockDispatch, headers) return pathMatch && methodMatch && bodyMatch && headersMatch } function getResponseData (data) { if (Buffer.isBuffer(data)) { return data } else if (typeof data === 'object') { return JSON.stringify(data) } else { return data.toString() } } function getMockDispatch (mockDispatches, key) { const basePath = key.query ? buildURL(key.path, key.query) : key.path const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath // Match path let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath)) if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`) } // Match method matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method)) if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`) } // Match body matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true) if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`) } // Match headers matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers)) if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`) } return matchedMockDispatches[0] } function addMockDispatch (mockDispatches, key, data) { const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false } const replyData = typeof data === 'function' ? { callback: data } : { ...data } const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } } mockDispatches.push(newMockDispatch) return newMockDispatch } function deleteMockDispatch (mockDispatches, key) { const index = mockDispatches.findIndex(dispatch => { if (!dispatch.consumed) { return false } return matchKey(dispatch, key) }) if (index !== -1) { mockDispatches.splice(index, 1) } } function buildKey (opts) { const { path, method, body, headers, query } = opts return { path, method, body, headers, query } } function generateKeyValues (data) { return Object.entries(data).reduce((keyValuePairs, [key, value]) => [ ...keyValuePairs, Buffer.from(`${key}`), Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`) ], []) } /** * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status * @param {number} statusCode */ function getStatusText (statusCode) { return STATUS_CODES[statusCode] || 'unknown' } async function getResponse (body) { const buffers = [] for await (const data of body) { buffers.push(data) } return Buffer.concat(buffers).toString('utf8') } /** * Mock dispatch function used to simulate undici dispatches */ function mockDispatch (opts, handler) { // Get mock dispatch from built key const key = buildKey(opts) const mockDispatch = getMockDispatch(this[kDispatches], key) mockDispatch.timesInvoked++ // Here's where we resolve a callback if a callback is present for the dispatch data. if (mockDispatch.data.callback) { mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) } } // Parse mockDispatch data const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch const { timesInvoked, times } = mockDispatch // If it's used up and not persistent, mark as consumed mockDispatch.consumed = !persist && timesInvoked >= times mockDispatch.pending = timesInvoked < times // If specified, trigger dispatch error if (error !== null) { deleteMockDispatch(this[kDispatches], key) handler.onError(error) return true } // Handle the request with a delay if necessary if (typeof delay === 'number' && delay > 0) { setTimeout(() => { handleReply(this[kDispatches]) }, delay) } else { handleReply(this[kDispatches]) } function handleReply (mockDispatches, _data = data) { // fetch's HeadersList is a 1D string array const optsHeaders = Array.isArray(opts.headers) ? buildHeadersFromArray(opts.headers) : opts.headers const body = typeof _data === 'function' ? _data({ ...opts, headers: optsHeaders }) : _data // util.types.isPromise is likely needed for jest. if (isPromise(body)) { // If handleReply is asynchronous, throwing an error // in the callback will reject the promise, rather than // synchronously throw the error, which breaks some tests. // Rather, we wait for the callback to resolve if it is a // promise, and then re-run handleReply with the new body. body.then((newData) => handleReply(mockDispatches, newData)) return } const responseData = getResponseData(body) const responseHeaders = generateKeyValues(headers) const responseTrailers = generateKeyValues(trailers) handler.abort = nop handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode)) handler.onData(Buffer.from(responseData)) handler.onComplete(responseTrailers) deleteMockDispatch(mockDispatches, key) } function resume () {} return true } function buildMockDispatch () { const agent = this[kMockAgent] const origin = this[kOrigin] const originalDispatch = this[kOriginalDispatch] return function dispatch (opts, handler) { if (agent.isMockActive) { try { mockDispatch.call(this, opts, handler) } catch (error) { if (error instanceof MockNotMatchedError) { const netConnect = agent[kGetNetConnect]() if (netConnect === false) { throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`) } if (checkNetConnect(netConnect, origin)) { originalDispatch.call(this, opts, handler) } else { throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`) } } else { throw error } } } else { originalDispatch.call(this, opts, handler) } } } function checkNetConnect (netConnect, origin) { const url = new URL(origin) if (netConnect === true) { return true } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) { return true } return false } function buildMockOptions (opts) { if (opts) { const { agent, ...mockOptions } = opts return mockOptions } } module.exports = { getResponseData, getMockDispatch, addMockDispatch, deleteMockDispatch, buildKey, generateKeyValues, matchValue, getResponse, getStatusText, mockDispatch, buildMockDispatch, checkNetConnect, buildMockOptions, getHeaderByName } /***/ }), /***/ 6142: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { Transform } = __nccwpck_require__(2203) const { Console } = __nccwpck_require__(4236) /** * Gets the output of `console.table(…)` as a string. */ module.exports = class PendingInterceptorsFormatter { constructor ({ disableColors } = {}) { this.transform = new Transform({ transform (chunk, _enc, cb) { cb(null, chunk) } }) this.logger = new Console({ stdout: this.transform, inspectOptions: { colors: !disableColors && !process.env.CI } }) } format (pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, Path: path, 'Status code': statusCode, Persistent: persist ? '✅' : '❌', Invocations: timesInvoked, Remaining: persist ? Infinity : times - timesInvoked })) this.logger.table(withPrettyHeaders) return this.transform.read().toString() } } /***/ }), /***/ 1529: /***/ ((module) => { const singulars = { pronoun: 'it', is: 'is', was: 'was', this: 'this' } const plurals = { pronoun: 'they', is: 'are', was: 'were', this: 'these' } module.exports = class Pluralizer { constructor (singular, plural) { this.singular = singular this.plural = plural } pluralize (count) { const one = count === 1 const keys = one ? singulars : plurals const noun = one ? this.singular : this.plural return { ...keys, count, noun } } } /***/ }), /***/ 4869: /***/ ((module) => { /* eslint-disable */ // Extracted from node/lib/internal/fixed_queue.js // Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two. const kSize = 2048; const kMask = kSize - 1; // The FixedQueue is implemented as a singly-linked list of fixed-size // circular buffers. It looks something like this: // // head tail // | | // v v // +-----------+ <-----\ +-----------+ <------\ +-----------+ // | [null] | \----- | next | \------- | next | // +-----------+ +-----------+ +-----------+ // | item | <-- bottom | item | <-- bottom | [empty] | // | item | | item | | [empty] | // | item | | item | | [empty] | // | item | | item | | [empty] | // | item | | item | bottom --> | item | // | item | | item | | item | // | ... | | ... | | ... | // | item | | item | | item | // | item | | item | | item | // | [empty] | <-- top | item | | item | // | [empty] | | item | | item | // | [empty] | | [empty] | <-- top top --> | [empty] | // +-----------+ +-----------+ +-----------+ // // Or, if there is only one circular buffer, it looks something // like either of these: // // head tail head tail // | | | | // v v v v // +-----------+ +-----------+ // | [null] | | [null] | // +-----------+ +-----------+ // | [empty] | | item | // | [empty] | | item | // | item | <-- bottom top --> | [empty] | // | item | | [empty] | // | [empty] | <-- top bottom --> | item | // | [empty] | | item | // +-----------+ +-----------+ // // Adding a value means moving `top` forward by one, removing means // moving `bottom` forward by one. After reaching the end, the queue // wraps around. // // When `top === bottom` the current queue is empty and when // `top + 1 === bottom` it's full. This wastes a single space of storage // but allows much quicker checks. class FixedCircularBuffer { constructor() { this.bottom = 0; this.top = 0; this.list = new Array(kSize); this.next = null; } isEmpty() { return this.top === this.bottom; } isFull() { return ((this.top + 1) & kMask) === this.bottom; } push(data) { this.list[this.top] = data; this.top = (this.top + 1) & kMask; } shift() { const nextItem = this.list[this.bottom]; if (nextItem === undefined) return null; this.list[this.bottom] = undefined; this.bottom = (this.bottom + 1) & kMask; return nextItem; } } module.exports = class FixedQueue { constructor() { this.head = this.tail = new FixedCircularBuffer(); } isEmpty() { return this.head.isEmpty(); } push(data) { if (this.head.isFull()) { // Head is full: Creates a new queue, sets the old queue's `.next` to it, // and sets it as the new main queue. this.head = this.head.next = new FixedCircularBuffer(); } this.head.push(data); } shift() { const tail = this.tail; const next = tail.shift(); if (tail.isEmpty() && tail.next !== null) { // If there is another queue, it forms the new tail. this.tail = tail.next; } return next; } }; /***/ }), /***/ 8640: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const DispatcherBase = __nccwpck_require__(1) const FixedQueue = __nccwpck_require__(4869) const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(6443) const PoolStats = __nccwpck_require__(4622) const kClients = Symbol('clients') const kNeedDrain = Symbol('needDrain') const kQueue = Symbol('queue') const kClosedResolve = Symbol('closed resolve') const kOnDrain = Symbol('onDrain') const kOnConnect = Symbol('onConnect') const kOnDisconnect = Symbol('onDisconnect') const kOnConnectionError = Symbol('onConnectionError') const kGetDispatcher = Symbol('get dispatcher') const kAddClient = Symbol('add client') const kRemoveClient = Symbol('remove client') const kStats = Symbol('stats') class PoolBase extends DispatcherBase { constructor () { super() this[kQueue] = new FixedQueue() this[kClients] = [] this[kQueued] = 0 const pool = this this[kOnDrain] = function onDrain (origin, targets) { const queue = pool[kQueue] let needDrain = false while (!needDrain) { const item = queue.shift() if (!item) { break } pool[kQueued]-- needDrain = !this.dispatch(item.opts, item.handler) } this[kNeedDrain] = needDrain if (!this[kNeedDrain] && pool[kNeedDrain]) { pool[kNeedDrain] = false pool.emit('drain', origin, [pool, ...targets]) } if (pool[kClosedResolve] && queue.isEmpty()) { Promise .all(pool[kClients].map(c => c.close())) .then(pool[kClosedResolve]) } } this[kOnConnect] = (origin, targets) => { pool.emit('connect', origin, [pool, ...targets]) } this[kOnDisconnect] = (origin, targets, err) => { pool.emit('disconnect', origin, [pool, ...targets], err) } this[kOnConnectionError] = (origin, targets, err) => { pool.emit('connectionError', origin, [pool, ...targets], err) } this[kStats] = new PoolStats(this) } get [kBusy] () { return this[kNeedDrain] } get [kConnected] () { return this[kClients].filter(client => client[kConnected]).length } get [kFree] () { return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length } get [kPending] () { let ret = this[kQueued] for (const { [kPending]: pending } of this[kClients]) { ret += pending } return ret } get [kRunning] () { let ret = 0 for (const { [kRunning]: running } of this[kClients]) { ret += running } return ret } get [kSize] () { let ret = this[kQueued] for (const { [kSize]: size } of this[kClients]) { ret += size } return ret } get stats () { return this[kStats] } async [kClose] () { if (this[kQueue].isEmpty()) { return Promise.all(this[kClients].map(c => c.close())) } else { return new Promise((resolve) => { this[kClosedResolve] = resolve }) } } async [kDestroy] (err) { while (true) { const item = this[kQueue].shift() if (!item) { break } item.handler.onError(err) } return Promise.all(this[kClients].map(c => c.destroy(err))) } [kDispatch] (opts, handler) { const dispatcher = this[kGetDispatcher]() if (!dispatcher) { this[kNeedDrain] = true this[kQueue].push({ opts, handler }) this[kQueued]++ } else if (!dispatcher.dispatch(opts, handler)) { dispatcher[kNeedDrain] = true this[kNeedDrain] = !this[kGetDispatcher]() } return !this[kNeedDrain] } [kAddClient] (client) { client .on('drain', this[kOnDrain]) .on('connect', this[kOnConnect]) .on('disconnect', this[kOnDisconnect]) .on('connectionError', this[kOnConnectionError]) this[kClients].push(client) if (this[kNeedDrain]) { process.nextTick(() => { if (this[kNeedDrain]) { this[kOnDrain](client[kUrl], [this, client]) } }) } return this } [kRemoveClient] (client) { client.close(() => { const idx = this[kClients].indexOf(client) if (idx !== -1) { this[kClients].splice(idx, 1) } }) this[kNeedDrain] = this[kClients].some(dispatcher => ( !dispatcher[kNeedDrain] && dispatcher.closed !== true && dispatcher.destroyed !== true )) } } module.exports = { PoolBase, kClients, kNeedDrain, kAddClient, kRemoveClient, kGetDispatcher } /***/ }), /***/ 4622: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(6443) const kPool = Symbol('pool') class PoolStats { constructor (pool) { this[kPool] = pool } get connected () { return this[kPool][kConnected] } get free () { return this[kPool][kFree] } get pending () { return this[kPool][kPending] } get queued () { return this[kPool][kQueued] } get running () { return this[kPool][kRunning] } get size () { return this[kPool][kSize] } } module.exports = PoolStats /***/ }), /***/ 5076: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { PoolBase, kClients, kNeedDrain, kAddClient, kGetDispatcher } = __nccwpck_require__(8640) const Client = __nccwpck_require__(6197) const { InvalidArgumentError } = __nccwpck_require__(8707) const util = __nccwpck_require__(3440) const { kUrl, kInterceptors } = __nccwpck_require__(6443) const buildConnector = __nccwpck_require__(9136) const kOptions = Symbol('options') const kConnections = Symbol('connections') const kFactory = Symbol('factory') function defaultFactory (origin, opts) { return new Client(origin, opts) } class Pool extends PoolBase { constructor (origin, { connections, factory = defaultFactory, connect, connectTimeout, tls, maxCachedSessions, socketPath, autoSelectFamily, autoSelectFamilyAttemptTimeout, allowH2, ...options } = {}) { super() if (connections != null && (!Number.isFinite(connections) || connections < 0)) { throw new InvalidArgumentError('invalid connections') } if (typeof factory !== 'function') { throw new InvalidArgumentError('factory must be a function.') } if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { throw new InvalidArgumentError('connect must be a function or an object') } if (typeof connect !== 'function') { connect = buildConnector({ ...tls, maxCachedSessions, allowH2, socketPath, timeout: connectTimeout, ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined), ...connect }) } this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool) ? options.interceptors.Pool : [] this[kConnections] = connections || null this[kUrl] = util.parseOrigin(origin) this[kOptions] = { ...util.deepClone(options), connect, allowH2 } this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : undefined this[kFactory] = factory this.on('connectionError', (origin, targets, error) => { // If a connection error occurs, we remove the client from the pool, // and emit a connectionError event. They will not be re-used. // Fixes https://github.com/nodejs/undici/issues/3895 for (const target of targets) { // Do not use kRemoveClient here, as it will close the client, // but the client cannot be closed in this state. const idx = this[kClients].indexOf(target) if (idx !== -1) { this[kClients].splice(idx, 1) } } }) } [kGetDispatcher] () { let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain]) if (dispatcher) { return dispatcher } if (!this[kConnections] || this[kClients].length < this[kConnections]) { dispatcher = this[kFactory](this[kUrl], this[kOptions]) this[kAddClient](dispatcher) } return dispatcher } } module.exports = Pool /***/ }), /***/ 2720: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(6443) const { URL } = __nccwpck_require__(7016) const Agent = __nccwpck_require__(9965) const Pool = __nccwpck_require__(5076) const DispatcherBase = __nccwpck_require__(1) const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8707) const buildConnector = __nccwpck_require__(9136) const kAgent = Symbol('proxy agent') const kClient = Symbol('proxy client') const kProxyHeaders = Symbol('proxy headers') const kRequestTls = Symbol('request tls settings') const kProxyTls = Symbol('proxy tls settings') const kConnectEndpoint = Symbol('connect endpoint function') function defaultProtocolPort (protocol) { return protocol === 'https:' ? 443 : 80 } function buildProxyOptions (opts) { if (typeof opts === 'string') { opts = { uri: opts } } if (!opts || !opts.uri) { throw new InvalidArgumentError('Proxy opts.uri is mandatory') } return { uri: opts.uri, protocol: opts.protocol || 'https' } } function defaultFactory (origin, opts) { return new Pool(origin, opts) } class ProxyAgent extends DispatcherBase { constructor (opts) { super(opts) this[kProxy] = buildProxyOptions(opts) this[kAgent] = new Agent(opts) this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent) ? opts.interceptors.ProxyAgent : [] if (typeof opts === 'string') { opts = { uri: opts } } if (!opts || !opts.uri) { throw new InvalidArgumentError('Proxy opts.uri is mandatory') } const { clientFactory = defaultFactory } = opts if (typeof clientFactory !== 'function') { throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.') } this[kRequestTls] = opts.requestTls this[kProxyTls] = opts.proxyTls this[kProxyHeaders] = opts.headers || {} const resolvedUrl = new URL(opts.uri) const { origin, port, host, username, password } = resolvedUrl if (opts.auth && opts.token) { throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token') } else if (opts.auth) { /* @deprecated in favour of opts.token */ this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}` } else if (opts.token) { this[kProxyHeaders]['proxy-authorization'] = opts.token } else if (username && password) { this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}` } const connect = buildConnector({ ...opts.proxyTls }) this[kConnectEndpoint] = buildConnector({ ...opts.requestTls }) this[kClient] = clientFactory(resolvedUrl, { connect }) this[kAgent] = new Agent({ ...opts, connect: async (opts, callback) => { let requestedHost = opts.host if (!opts.port) { requestedHost += `:${defaultProtocolPort(opts.protocol)}` } try { const { socket, statusCode } = await this[kClient].connect({ origin, port, path: requestedHost, signal: opts.signal, headers: { ...this[kProxyHeaders], host } }) if (statusCode !== 200) { socket.on('error', () => {}).destroy() callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`)) } if (opts.protocol !== 'https:') { callback(null, socket) return } let servername if (this[kRequestTls]) { servername = this[kRequestTls].servername } else { servername = opts.servername } this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback) } catch (err) { callback(err) } } }) } dispatch (opts, handler) { const { host } = new URL(opts.origin) const headers = buildHeaders(opts.headers) throwIfProxyAuthIsSent(headers) return this[kAgent].dispatch( { ...opts, headers: { ...headers, host } }, handler ) } async [kClose] () { await this[kAgent].close() await this[kClient].close() } async [kDestroy] () { await this[kAgent].destroy() await this[kClient].destroy() } } /** * @param {string[] | Record} headers * @returns {Record} */ function buildHeaders (headers) { // When using undici.fetch, the headers list is stored // as an array. if (Array.isArray(headers)) { /** @type {Record} */ const headersPair = {} for (let i = 0; i < headers.length; i += 2) { headersPair[headers[i]] = headers[i + 1] } return headersPair } return headers } /** * @param {Record} headers * * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers * Nevertheless, it was changed and to avoid a security vulnerability by end users * this check was created. * It should be removed in the next major version for performance reasons */ function throwIfProxyAuthIsSent (headers) { const existProxyAuth = headers && Object.keys(headers) .find((key) => key.toLowerCase() === 'proxy-authorization') if (existProxyAuth) { throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor') } } module.exports = ProxyAgent /***/ }), /***/ 8804: /***/ ((module) => { let fastNow = Date.now() let fastNowTimeout const fastTimers = [] function onTimeout () { fastNow = Date.now() let len = fastTimers.length let idx = 0 while (idx < len) { const timer = fastTimers[idx] if (timer.state === 0) { timer.state = fastNow + timer.delay } else if (timer.state > 0 && fastNow >= timer.state) { timer.state = -1 timer.callback(timer.opaque) } if (timer.state === -1) { timer.state = -2 if (idx !== len - 1) { fastTimers[idx] = fastTimers.pop() } else { fastTimers.pop() } len -= 1 } else { idx += 1 } } if (fastTimers.length > 0) { refreshTimeout() } } function refreshTimeout () { if (fastNowTimeout && fastNowTimeout.refresh) { fastNowTimeout.refresh() } else { clearTimeout(fastNowTimeout) fastNowTimeout = setTimeout(onTimeout, 1e3) if (fastNowTimeout.unref) { fastNowTimeout.unref() } } } class Timeout { constructor (callback, delay, opaque) { this.callback = callback this.delay = delay this.opaque = opaque // -2 not in timer list // -1 in timer list but inactive // 0 in timer list waiting for time // > 0 in timer list waiting for time to expire this.state = -2 this.refresh() } refresh () { if (this.state === -2) { fastTimers.push(this) if (!fastNowTimeout || fastTimers.length === 1) { refreshTimeout() } } this.state = 0 } clear () { this.state = -1 } } module.exports = { setTimeout (callback, delay, opaque) { return delay < 1e3 ? setTimeout(callback, delay, opaque) : new Timeout(callback, delay, opaque) }, clearTimeout (timeout) { if (timeout instanceof Timeout) { timeout.clear() } else { clearTimeout(timeout) } } } /***/ }), /***/ 8550: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const diagnosticsChannel = __nccwpck_require__(1637) const { uid, states } = __nccwpck_require__(5913) const { kReadyState, kSentClose, kByteParser, kReceivedClose } = __nccwpck_require__(2933) const { fireEvent, failWebsocketConnection } = __nccwpck_require__(3574) const { CloseEvent } = __nccwpck_require__(6255) const { makeRequest } = __nccwpck_require__(5194) const { fetching } = __nccwpck_require__(2315) const { Headers } = __nccwpck_require__(6349) const { getGlobalDispatcher } = __nccwpck_require__(2581) const { kHeadersList } = __nccwpck_require__(6443) const channels = {} channels.open = diagnosticsChannel.channel('undici:websocket:open') channels.close = diagnosticsChannel.channel('undici:websocket:close') channels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error') /** @type {import('crypto')} */ let crypto try { crypto = __nccwpck_require__(6982) } catch { } /** * @see https://websockets.spec.whatwg.org/#concept-websocket-establish * @param {URL} url * @param {string|string[]} protocols * @param {import('./websocket').WebSocket} ws * @param {(response: any) => void} onEstablish * @param {Partial} options */ function establishWebSocketConnection (url, protocols, ws, onEstablish, options) { // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s // scheme is "ws", and to "https" otherwise. const requestURL = url requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:' // 2. Let request be a new request, whose URL is requestURL, client is client, // service-workers mode is "none", referrer is "no-referrer", mode is // "websocket", credentials mode is "include", cache mode is "no-store" , // and redirect mode is "error". const request = makeRequest({ urlList: [requestURL], serviceWorkers: 'none', referrer: 'no-referrer', mode: 'websocket', credentials: 'include', cache: 'no-store', redirect: 'error' }) // Note: undici extension, allow setting custom headers. if (options.headers) { const headersList = new Headers(options.headers)[kHeadersList] request.headersList = headersList } // 3. Append (`Upgrade`, `websocket`) to request’s header list. // 4. Append (`Connection`, `Upgrade`) to request’s header list. // Note: both of these are handled by undici currently. // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397 // 5. Let keyValue be a nonce consisting of a randomly selected // 16-byte value that has been forgiving-base64-encoded and // isomorphic encoded. const keyValue = crypto.randomBytes(16).toString('base64') // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s // header list. request.headersList.append('sec-websocket-key', keyValue) // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s // header list. request.headersList.append('sec-websocket-version', '13') // 8. For each protocol in protocols, combine // (`Sec-WebSocket-Protocol`, protocol) in request’s header // list. for (const protocol of protocols) { request.headersList.append('sec-websocket-protocol', protocol) } // 9. Let permessageDeflate be a user-agent defined // "permessage-deflate" extension header value. // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673 // TODO: enable once permessage-deflate is supported const permessageDeflate = '' // 'permessage-deflate; 15' // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to // request’s header list. // request.headersList.append('sec-websocket-extensions', permessageDeflate) // 11. Fetch request with useParallelQueue set to true, and // processResponse given response being these steps: const controller = fetching({ request, useParallelQueue: true, dispatcher: options.dispatcher ?? getGlobalDispatcher(), processResponse (response) { // 1. If response is a network error or its status is not 101, // fail the WebSocket connection. if (response.type === 'error' || response.status !== 101) { failWebsocketConnection(ws, 'Received network error or non-101 status code.') return } // 2. If protocols is not the empty list and extracting header // list values given `Sec-WebSocket-Protocol` and response’s // header list results in null, failure, or the empty byte // sequence, then fail the WebSocket connection. if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) { failWebsocketConnection(ws, 'Server did not respond with sent protocols.') return } // 3. Follow the requirements stated step 2 to step 6, inclusive, // of the last set of steps in section 4.1 of The WebSocket // Protocol to validate response. This either results in fail // the WebSocket connection or the WebSocket connection is // established. // 2. If the response lacks an |Upgrade| header field or the |Upgrade| // header field contains a value that is not an ASCII case- // insensitive match for the value "websocket", the client MUST // _Fail the WebSocket Connection_. if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') { failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".') return } // 3. If the response lacks a |Connection| header field or the // |Connection| header field doesn't contain a token that is an // ASCII case-insensitive match for the value "Upgrade", the client // MUST _Fail the WebSocket Connection_. if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') { failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".') return } // 4. If the response lacks a |Sec-WebSocket-Accept| header field or // the |Sec-WebSocket-Accept| contains a value other than the // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket- // Key| (as a string, not base64-decoded) with the string "258EAFA5- // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and // trailing whitespace, the client MUST _Fail the WebSocket // Connection_. const secWSAccept = response.headersList.get('Sec-WebSocket-Accept') const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64') if (secWSAccept !== digest) { failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.') return } // 5. If the response includes a |Sec-WebSocket-Extensions| header // field and this header field indicates the use of an extension // that was not present in the client's handshake (the server has // indicated an extension not requested by the client), the client // MUST _Fail the WebSocket Connection_. (The parsing of this // header field to determine which extensions are requested is // discussed in Section 9.1.) const secExtension = response.headersList.get('Sec-WebSocket-Extensions') if (secExtension !== null && secExtension !== permessageDeflate) { failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.') return } // 6. If the response includes a |Sec-WebSocket-Protocol| header field // and this header field indicates the use of a subprotocol that was // not present in the client's handshake (the server has indicated a // subprotocol not requested by the client), the client MUST _Fail // the WebSocket Connection_. const secProtocol = response.headersList.get('Sec-WebSocket-Protocol') if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) { failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.') return } response.socket.on('data', onSocketData) response.socket.on('close', onSocketClose) response.socket.on('error', onSocketError) if (channels.open.hasSubscribers) { channels.open.publish({ address: response.socket.address(), protocol: secProtocol, extensions: secExtension }) } onEstablish(response) } }) return controller } /** * @param {Buffer} chunk */ function onSocketData (chunk) { if (!this.ws[kByteParser].write(chunk)) { this.pause() } } /** * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4 */ function onSocketClose () { const { ws } = this // If the TCP connection was closed after the // WebSocket closing handshake was completed, the WebSocket connection // is said to have been closed _cleanly_. const wasClean = ws[kSentClose] && ws[kReceivedClose] let code = 1005 let reason = '' const result = ws[kByteParser].closingInfo if (result) { code = result.code ?? 1005 reason = result.reason } else if (!ws[kSentClose]) { // If _The WebSocket // Connection is Closed_ and no Close control frame was received by the // endpoint (such as could occur if the underlying transport connection // is lost), _The WebSocket Connection Close Code_ is considered to be // 1006. code = 1006 } // 1. Change the ready state to CLOSED (3). ws[kReadyState] = states.CLOSED // 2. If the user agent was required to fail the WebSocket // connection, or if the WebSocket connection was closed // after being flagged as full, fire an event named error // at the WebSocket object. // TODO // 3. Fire an event named close at the WebSocket object, // using CloseEvent, with the wasClean attribute // initialized to true if the connection closed cleanly // and false otherwise, the code attribute initialized to // the WebSocket connection close code, and the reason // attribute initialized to the result of applying UTF-8 // decode without BOM to the WebSocket connection close // reason. fireEvent('close', ws, CloseEvent, { wasClean, code, reason }) if (channels.close.hasSubscribers) { channels.close.publish({ websocket: ws, code, reason }) } } function onSocketError (error) { const { ws } = this ws[kReadyState] = states.CLOSING if (channels.socketError.hasSubscribers) { channels.socketError.publish(error) } this.destroy() } module.exports = { establishWebSocketConnection } /***/ }), /***/ 5913: /***/ ((module) => { // This is a Globally Unique Identifier unique used // to validate that the endpoint accepts websocket // connections. // See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3 const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11' /** @type {PropertyDescriptor} */ const staticPropertyDescriptors = { enumerable: true, writable: false, configurable: false } const states = { CONNECTING: 0, OPEN: 1, CLOSING: 2, CLOSED: 3 } const opcodes = { CONTINUATION: 0x0, TEXT: 0x1, BINARY: 0x2, CLOSE: 0x8, PING: 0x9, PONG: 0xA } const maxUnsigned16Bit = 2 ** 16 - 1 // 65535 const parserStates = { INFO: 0, PAYLOADLENGTH_16: 2, PAYLOADLENGTH_64: 3, READ_DATA: 4 } const emptyBuffer = Buffer.allocUnsafe(0) module.exports = { uid, staticPropertyDescriptors, states, opcodes, maxUnsigned16Bit, parserStates, emptyBuffer } /***/ }), /***/ 6255: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { webidl } = __nccwpck_require__(4222) const { kEnumerableProperty } = __nccwpck_require__(3440) const { MessagePort } = __nccwpck_require__(8167) /** * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent */ class MessageEvent extends Event { #eventInit constructor (type, eventInitDict = {}) { webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' }) type = webidl.converters.DOMString(type) eventInitDict = webidl.converters.MessageEventInit(eventInitDict) super(type, eventInitDict) this.#eventInit = eventInitDict } get data () { webidl.brandCheck(this, MessageEvent) return this.#eventInit.data } get origin () { webidl.brandCheck(this, MessageEvent) return this.#eventInit.origin } get lastEventId () { webidl.brandCheck(this, MessageEvent) return this.#eventInit.lastEventId } get source () { webidl.brandCheck(this, MessageEvent) return this.#eventInit.source } get ports () { webidl.brandCheck(this, MessageEvent) if (!Object.isFrozen(this.#eventInit.ports)) { Object.freeze(this.#eventInit.ports) } return this.#eventInit.ports } initMessageEvent ( type, bubbles = false, cancelable = false, data = null, origin = '', lastEventId = '', source = null, ports = [] ) { webidl.brandCheck(this, MessageEvent) webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' }) return new MessageEvent(type, { bubbles, cancelable, data, origin, lastEventId, source, ports }) } } /** * @see https://websockets.spec.whatwg.org/#the-closeevent-interface */ class CloseEvent extends Event { #eventInit constructor (type, eventInitDict = {}) { webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' }) type = webidl.converters.DOMString(type) eventInitDict = webidl.converters.CloseEventInit(eventInitDict) super(type, eventInitDict) this.#eventInit = eventInitDict } get wasClean () { webidl.brandCheck(this, CloseEvent) return this.#eventInit.wasClean } get code () { webidl.brandCheck(this, CloseEvent) return this.#eventInit.code } get reason () { webidl.brandCheck(this, CloseEvent) return this.#eventInit.reason } } // https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface class ErrorEvent extends Event { #eventInit constructor (type, eventInitDict) { webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' }) super(type, eventInitDict) type = webidl.converters.DOMString(type) eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {}) this.#eventInit = eventInitDict } get message () { webidl.brandCheck(this, ErrorEvent) return this.#eventInit.message } get filename () { webidl.brandCheck(this, ErrorEvent) return this.#eventInit.filename } get lineno () { webidl.brandCheck(this, ErrorEvent) return this.#eventInit.lineno } get colno () { webidl.brandCheck(this, ErrorEvent) return this.#eventInit.colno } get error () { webidl.brandCheck(this, ErrorEvent) return this.#eventInit.error } } Object.defineProperties(MessageEvent.prototype, { [Symbol.toStringTag]: { value: 'MessageEvent', configurable: true }, data: kEnumerableProperty, origin: kEnumerableProperty, lastEventId: kEnumerableProperty, source: kEnumerableProperty, ports: kEnumerableProperty, initMessageEvent: kEnumerableProperty }) Object.defineProperties(CloseEvent.prototype, { [Symbol.toStringTag]: { value: 'CloseEvent', configurable: true }, reason: kEnumerableProperty, code: kEnumerableProperty, wasClean: kEnumerableProperty }) Object.defineProperties(ErrorEvent.prototype, { [Symbol.toStringTag]: { value: 'ErrorEvent', configurable: true }, message: kEnumerableProperty, filename: kEnumerableProperty, lineno: kEnumerableProperty, colno: kEnumerableProperty, error: kEnumerableProperty }) webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort) webidl.converters['sequence'] = webidl.sequenceConverter( webidl.converters.MessagePort ) const eventInit = [ { key: 'bubbles', converter: webidl.converters.boolean, defaultValue: false }, { key: 'cancelable', converter: webidl.converters.boolean, defaultValue: false }, { key: 'composed', converter: webidl.converters.boolean, defaultValue: false } ] webidl.converters.MessageEventInit = webidl.dictionaryConverter([ ...eventInit, { key: 'data', converter: webidl.converters.any, defaultValue: null }, { key: 'origin', converter: webidl.converters.USVString, defaultValue: '' }, { key: 'lastEventId', converter: webidl.converters.DOMString, defaultValue: '' }, { key: 'source', // Node doesn't implement WindowProxy or ServiceWorker, so the only // valid value for source is a MessagePort. converter: webidl.nullableConverter(webidl.converters.MessagePort), defaultValue: null }, { key: 'ports', converter: webidl.converters['sequence'], get defaultValue () { return [] } } ]) webidl.converters.CloseEventInit = webidl.dictionaryConverter([ ...eventInit, { key: 'wasClean', converter: webidl.converters.boolean, defaultValue: false }, { key: 'code', converter: webidl.converters['unsigned short'], defaultValue: 0 }, { key: 'reason', converter: webidl.converters.USVString, defaultValue: '' } ]) webidl.converters.ErrorEventInit = webidl.dictionaryConverter([ ...eventInit, { key: 'message', converter: webidl.converters.DOMString, defaultValue: '' }, { key: 'filename', converter: webidl.converters.USVString, defaultValue: '' }, { key: 'lineno', converter: webidl.converters['unsigned long'], defaultValue: 0 }, { key: 'colno', converter: webidl.converters['unsigned long'], defaultValue: 0 }, { key: 'error', converter: webidl.converters.any } ]) module.exports = { MessageEvent, CloseEvent, ErrorEvent } /***/ }), /***/ 1237: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { maxUnsigned16Bit } = __nccwpck_require__(5913) /** @type {import('crypto')} */ let crypto try { crypto = __nccwpck_require__(6982) } catch { } class WebsocketFrameSend { /** * @param {Buffer|undefined} data */ constructor (data) { this.frameData = data this.maskKey = crypto.randomBytes(4) } createFrame (opcode) { const bodyLength = this.frameData?.byteLength ?? 0 /** @type {number} */ let payloadLength = bodyLength // 0-125 let offset = 6 if (bodyLength > maxUnsigned16Bit) { offset += 8 // payload length is next 8 bytes payloadLength = 127 } else if (bodyLength > 125) { offset += 2 // payload length is next 2 bytes payloadLength = 126 } const buffer = Buffer.allocUnsafe(bodyLength + offset) // Clear first 2 bytes, everything else is overwritten buffer[0] = buffer[1] = 0 buffer[0] |= 0x80 // FIN buffer[0] = (buffer[0] & 0xF0) + opcode // opcode /*! ws. MIT License. Einar Otto Stangvik */ buffer[offset - 4] = this.maskKey[0] buffer[offset - 3] = this.maskKey[1] buffer[offset - 2] = this.maskKey[2] buffer[offset - 1] = this.maskKey[3] buffer[1] = payloadLength if (payloadLength === 126) { buffer.writeUInt16BE(bodyLength, 2) } else if (payloadLength === 127) { // Clear extended payload length buffer[2] = buffer[3] = 0 buffer.writeUIntBE(bodyLength, 4, 6) } buffer[1] |= 0x80 // MASK // mask body for (let i = 0; i < bodyLength; i++) { buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4] } return buffer } } module.exports = { WebsocketFrameSend } /***/ }), /***/ 3171: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { Writable } = __nccwpck_require__(2203) const diagnosticsChannel = __nccwpck_require__(1637) const { parserStates, opcodes, states, emptyBuffer } = __nccwpck_require__(5913) const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(2933) const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = __nccwpck_require__(3574) const { WebsocketFrameSend } = __nccwpck_require__(1237) // This code was influenced by ws released under the MIT license. // Copyright (c) 2011 Einar Otto Stangvik // Copyright (c) 2013 Arnout Kazemier and contributors // Copyright (c) 2016 Luigi Pinca and contributors const channels = {} channels.ping = diagnosticsChannel.channel('undici:websocket:ping') channels.pong = diagnosticsChannel.channel('undici:websocket:pong') class ByteParser extends Writable { #buffers = [] #byteOffset = 0 #state = parserStates.INFO #info = {} #fragments = [] constructor (ws) { super() this.ws = ws } /** * @param {Buffer} chunk * @param {() => void} callback */ _write (chunk, _, callback) { this.#buffers.push(chunk) this.#byteOffset += chunk.length this.run(callback) } /** * Runs whenever a new chunk is received. * Callback is called whenever there are no more chunks buffering, * or not enough bytes are buffered to parse. */ run (callback) { while (true) { if (this.#state === parserStates.INFO) { // If there aren't enough bytes to parse the payload length, etc. if (this.#byteOffset < 2) { return callback() } const buffer = this.consume(2) this.#info.fin = (buffer[0] & 0x80) !== 0 this.#info.opcode = buffer[0] & 0x0F // If we receive a fragmented message, we use the type of the first // frame to parse the full message as binary/text, when it's terminated this.#info.originalOpcode ??= this.#info.opcode this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) { // Only text and binary frames can be fragmented failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.') return } const payloadLength = buffer[1] & 0x7F if (payloadLength <= 125) { this.#info.payloadLength = payloadLength this.#state = parserStates.READ_DATA } else if (payloadLength === 126) { this.#state = parserStates.PAYLOADLENGTH_16 } else if (payloadLength === 127) { this.#state = parserStates.PAYLOADLENGTH_64 } if (this.#info.fragmented && payloadLength > 125) { // A fragmented frame can't be fragmented itself failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.') return } else if ( (this.#info.opcode === opcodes.PING || this.#info.opcode === opcodes.PONG || this.#info.opcode === opcodes.CLOSE) && payloadLength > 125 ) { // Control frames can have a payload length of 125 bytes MAX failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.') return } else if (this.#info.opcode === opcodes.CLOSE) { if (payloadLength === 1) { failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.') return } const body = this.consume(payloadLength) this.#info.closeInfo = this.parseCloseBody(false, body) if (!this.ws[kSentClose]) { // If an endpoint receives a Close frame and did not previously send a // Close frame, the endpoint MUST send a Close frame in response. (When // sending a Close frame in response, the endpoint typically echos the // status code it received.) const body = Buffer.allocUnsafe(2) body.writeUInt16BE(this.#info.closeInfo.code, 0) const closeFrame = new WebsocketFrameSend(body) this.ws[kResponse].socket.write( closeFrame.createFrame(opcodes.CLOSE), (err) => { if (!err) { this.ws[kSentClose] = true } } ) } // Upon either sending or receiving a Close control frame, it is said // that _The WebSocket Closing Handshake is Started_ and that the // WebSocket connection is in the CLOSING state. this.ws[kReadyState] = states.CLOSING this.ws[kReceivedClose] = true this.end() return } else if (this.#info.opcode === opcodes.PING) { // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in // response, unless it already received a Close frame. // A Pong frame sent in response to a Ping frame must have identical // "Application data" const body = this.consume(payloadLength) if (!this.ws[kReceivedClose]) { const frame = new WebsocketFrameSend(body) this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG)) if (channels.ping.hasSubscribers) { channels.ping.publish({ payload: body }) } } this.#state = parserStates.INFO if (this.#byteOffset > 0) { continue } else { callback() return } } else if (this.#info.opcode === opcodes.PONG) { // A Pong frame MAY be sent unsolicited. This serves as a // unidirectional heartbeat. A response to an unsolicited Pong frame is // not expected. const body = this.consume(payloadLength) if (channels.pong.hasSubscribers) { channels.pong.publish({ payload: body }) } if (this.#byteOffset > 0) { continue } else { callback() return } } } else if (this.#state === parserStates.PAYLOADLENGTH_16) { if (this.#byteOffset < 2) { return callback() } const buffer = this.consume(2) this.#info.payloadLength = buffer.readUInt16BE(0) this.#state = parserStates.READ_DATA } else if (this.#state === parserStates.PAYLOADLENGTH_64) { if (this.#byteOffset < 8) { return callback() } const buffer = this.consume(8) const upper = buffer.readUInt32BE(0) // 2^31 is the maxinimum bytes an arraybuffer can contain // on 32-bit systems. Although, on 64-bit systems, this is // 2^53-1 bytes. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275 // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e if (upper > 2 ** 31 - 1) { failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.') return } const lower = buffer.readUInt32BE(4) this.#info.payloadLength = (upper << 8) + lower this.#state = parserStates.READ_DATA } else if (this.#state === parserStates.READ_DATA) { if (this.#byteOffset < this.#info.payloadLength) { // If there is still more data in this chunk that needs to be read return callback() } else if (this.#byteOffset >= this.#info.payloadLength) { // If the server sent multiple frames in a single chunk const body = this.consume(this.#info.payloadLength) this.#fragments.push(body) // If the frame is unfragmented, or a fragmented frame was terminated, // a message was received if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) { const fullMessage = Buffer.concat(this.#fragments) websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage) this.#info = {} this.#fragments.length = 0 } this.#state = parserStates.INFO } } if (this.#byteOffset > 0) { continue } else { callback() break } } } /** * Take n bytes from the buffered Buffers * @param {number} n * @returns {Buffer|null} */ consume (n) { if (n > this.#byteOffset) { return null } else if (n === 0) { return emptyBuffer } if (this.#buffers[0].length === n) { this.#byteOffset -= this.#buffers[0].length return this.#buffers.shift() } const buffer = Buffer.allocUnsafe(n) let offset = 0 while (offset !== n) { const next = this.#buffers[0] const { length } = next if (length + offset === n) { buffer.set(this.#buffers.shift(), offset) break } else if (length + offset > n) { buffer.set(next.subarray(0, n - offset), offset) this.#buffers[0] = next.subarray(n - offset) break } else { buffer.set(this.#buffers.shift(), offset) offset += next.length } } this.#byteOffset -= n return buffer } parseCloseBody (onlyCode, data) { // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5 /** @type {number|undefined} */ let code if (data.length >= 2) { // _The WebSocket Connection Close Code_ is // defined as the status code (Section 7.4) contained in the first Close // control frame received by the application code = data.readUInt16BE(0) } if (onlyCode) { if (!isValidStatusCode(code)) { return null } return { code } } // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6 /** @type {Buffer} */ let reason = data.subarray(2) // Remove BOM if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) { reason = reason.subarray(3) } if (code !== undefined && !isValidStatusCode(code)) { return null } try { // TODO: optimize this reason = new TextDecoder('utf-8', { fatal: true }).decode(reason) } catch { return null } return { code, reason } } get closingInfo () { return this.#info.closeInfo } } module.exports = { ByteParser } /***/ }), /***/ 2933: /***/ ((module) => { module.exports = { kWebSocketURL: Symbol('url'), kReadyState: Symbol('ready state'), kController: Symbol('controller'), kResponse: Symbol('response'), kBinaryType: Symbol('binary type'), kSentClose: Symbol('sent close'), kReceivedClose: Symbol('received close'), kByteParser: Symbol('byte parser') } /***/ }), /***/ 3574: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(2933) const { states, opcodes } = __nccwpck_require__(5913) const { MessageEvent, ErrorEvent } = __nccwpck_require__(6255) /* globals Blob */ /** * @param {import('./websocket').WebSocket} ws */ function isEstablished (ws) { // If the server's response is validated as provided for above, it is // said that _The WebSocket Connection is Established_ and that the // WebSocket Connection is in the OPEN state. return ws[kReadyState] === states.OPEN } /** * @param {import('./websocket').WebSocket} ws */ function isClosing (ws) { // Upon either sending or receiving a Close control frame, it is said // that _The WebSocket Closing Handshake is Started_ and that the // WebSocket connection is in the CLOSING state. return ws[kReadyState] === states.CLOSING } /** * @param {import('./websocket').WebSocket} ws */ function isClosed (ws) { return ws[kReadyState] === states.CLOSED } /** * @see https://dom.spec.whatwg.org/#concept-event-fire * @param {string} e * @param {EventTarget} target * @param {EventInit | undefined} eventInitDict */ function fireEvent (e, target, eventConstructor = Event, eventInitDict) { // 1. If eventConstructor is not given, then let eventConstructor be Event. // 2. Let event be the result of creating an event given eventConstructor, // in the relevant realm of target. // 3. Initialize event’s type attribute to e. const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap // 4. Initialize any other IDL attributes of event as described in the // invocation of this algorithm. // 5. Return the result of dispatching event at target, with legacy target // override flag set if set. target.dispatchEvent(event) } /** * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol * @param {import('./websocket').WebSocket} ws * @param {number} type Opcode * @param {Buffer} data application data */ function websocketMessageReceived (ws, type, data) { // 1. If ready state is not OPEN (1), then return. if (ws[kReadyState] !== states.OPEN) { return } // 2. Let dataForEvent be determined by switching on type and binary type: let dataForEvent if (type === opcodes.TEXT) { // -> type indicates that the data is Text // a new DOMString containing data try { dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data) } catch { failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.') return } } else if (type === opcodes.BINARY) { if (ws[kBinaryType] === 'blob') { // -> type indicates that the data is Binary and binary type is "blob" // a new Blob object, created in the relevant Realm of the WebSocket // object, that represents data as its raw data dataForEvent = new Blob([data]) } else { // -> type indicates that the data is Binary and binary type is "arraybuffer" // a new ArrayBuffer object, created in the relevant Realm of the // WebSocket object, whose contents are data dataForEvent = new Uint8Array(data).buffer } } // 3. Fire an event named message at the WebSocket object, using MessageEvent, // with the origin attribute initialized to the serialization of the WebSocket // object’s url's origin, and the data attribute initialized to dataForEvent. fireEvent('message', ws, MessageEvent, { origin: ws[kWebSocketURL].origin, data: dataForEvent }) } /** * @see https://datatracker.ietf.org/doc/html/rfc6455 * @see https://datatracker.ietf.org/doc/html/rfc2616 * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407 * @param {string} protocol */ function isValidSubprotocol (protocol) { // If present, this value indicates one // or more comma-separated subprotocol the client wishes to speak, // ordered by preference. The elements that comprise this value // MUST be non-empty strings with characters in the range U+0021 to // U+007E not including separator characters as defined in // [RFC2616] and MUST all be unique strings. if (protocol.length === 0) { return false } for (const char of protocol) { const code = char.charCodeAt(0) if ( code < 0x21 || code > 0x7E || char === '(' || char === ')' || char === '<' || char === '>' || char === '@' || char === ',' || char === ';' || char === ':' || char === '\\' || char === '"' || char === '/' || char === '[' || char === ']' || char === '?' || char === '=' || char === '{' || char === '}' || code === 32 || // SP code === 9 // HT ) { return false } } return true } /** * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4 * @param {number} code */ function isValidStatusCode (code) { if (code >= 1000 && code < 1015) { return ( code !== 1004 && // reserved code !== 1005 && // "MUST NOT be set as a status code" code !== 1006 // "MUST NOT be set as a status code" ) } return code >= 3000 && code <= 4999 } /** * @param {import('./websocket').WebSocket} ws * @param {string|undefined} reason */ function failWebsocketConnection (ws, reason) { const { [kController]: controller, [kResponse]: response } = ws controller.abort() if (response?.socket && !response.socket.destroyed) { response.socket.destroy() } if (reason) { fireEvent('error', ws, ErrorEvent, { error: new Error(reason) }) } } module.exports = { isEstablished, isClosing, isClosed, fireEvent, isValidSubprotocol, isValidStatusCode, failWebsocketConnection, websocketMessageReceived } /***/ }), /***/ 5171: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { webidl } = __nccwpck_require__(4222) const { DOMException } = __nccwpck_require__(7326) const { URLSerializer } = __nccwpck_require__(4322) const { getGlobalOrigin } = __nccwpck_require__(5628) const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = __nccwpck_require__(5913) const { kWebSocketURL, kReadyState, kController, kBinaryType, kResponse, kSentClose, kByteParser } = __nccwpck_require__(2933) const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = __nccwpck_require__(3574) const { establishWebSocketConnection } = __nccwpck_require__(8550) const { WebsocketFrameSend } = __nccwpck_require__(1237) const { ByteParser } = __nccwpck_require__(3171) const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3440) const { getGlobalDispatcher } = __nccwpck_require__(2581) const { types } = __nccwpck_require__(9023) let experimentalWarned = false // https://websockets.spec.whatwg.org/#interface-definition class WebSocket extends EventTarget { #events = { open: null, error: null, close: null, message: null } #bufferedAmount = 0 #protocol = '' #extensions = '' /** * @param {string} url * @param {string|string[]} protocols */ constructor (url, protocols = []) { super() webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' }) if (!experimentalWarned) { experimentalWarned = true process.emitWarning('WebSockets are experimental, expect them to change at any time.', { code: 'UNDICI-WS' }) } const options = webidl.converters['DOMString or sequence or WebSocketInit'](protocols) url = webidl.converters.USVString(url) protocols = options.protocols // 1. Let baseURL be this's relevant settings object's API base URL. const baseURL = getGlobalOrigin() // 1. Let urlRecord be the result of applying the URL parser to url with baseURL. let urlRecord try { urlRecord = new URL(url, baseURL) } catch (e) { // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException. throw new DOMException(e, 'SyntaxError') } // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws". if (urlRecord.protocol === 'http:') { urlRecord.protocol = 'ws:' } else if (urlRecord.protocol === 'https:') { // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss". urlRecord.protocol = 'wss:' } // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException. if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') { throw new DOMException( `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`, 'SyntaxError' ) } // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError" // DOMException. if (urlRecord.hash || urlRecord.href.endsWith('#')) { throw new DOMException('Got fragment', 'SyntaxError') } // 8. If protocols is a string, set protocols to a sequence consisting // of just that string. if (typeof protocols === 'string') { protocols = [protocols] } // 9. If any of the values in protocols occur more than once or otherwise // fail to match the requirements for elements that comprise the value // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket // protocol, then throw a "SyntaxError" DOMException. if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) { throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError') } if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) { throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError') } // 10. Set this's url to urlRecord. this[kWebSocketURL] = new URL(urlRecord.href) // 11. Let client be this's relevant settings object. // 12. Run this step in parallel: // 1. Establish a WebSocket connection given urlRecord, protocols, // and client. this[kController] = establishWebSocketConnection( urlRecord, protocols, this, (response) => this.#onConnectionEstablished(response), options ) // Each WebSocket object has an associated ready state, which is a // number representing the state of the connection. Initially it must // be CONNECTING (0). this[kReadyState] = WebSocket.CONNECTING // The extensions attribute must initially return the empty string. // The protocol attribute must initially return the empty string. // Each WebSocket object has an associated binary type, which is a // BinaryType. Initially it must be "blob". this[kBinaryType] = 'blob' } /** * @see https://websockets.spec.whatwg.org/#dom-websocket-close * @param {number|undefined} code * @param {string|undefined} reason */ close (code = undefined, reason = undefined) { webidl.brandCheck(this, WebSocket) if (code !== undefined) { code = webidl.converters['unsigned short'](code, { clamp: true }) } if (reason !== undefined) { reason = webidl.converters.USVString(reason) } // 1. If code is present, but is neither an integer equal to 1000 nor an // integer in the range 3000 to 4999, inclusive, throw an // "InvalidAccessError" DOMException. if (code !== undefined) { if (code !== 1000 && (code < 3000 || code > 4999)) { throw new DOMException('invalid code', 'InvalidAccessError') } } let reasonByteLength = 0 // 2. If reason is present, then run these substeps: if (reason !== undefined) { // 1. Let reasonBytes be the result of encoding reason. // 2. If reasonBytes is longer than 123 bytes, then throw a // "SyntaxError" DOMException. reasonByteLength = Buffer.byteLength(reason) if (reasonByteLength > 123) { throw new DOMException( `Reason must be less than 123 bytes; received ${reasonByteLength}`, 'SyntaxError' ) } } // 3. Run the first matching steps from the following list: if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) { // If this's ready state is CLOSING (2) or CLOSED (3) // Do nothing. } else if (!isEstablished(this)) { // If the WebSocket connection is not yet established // Fail the WebSocket connection and set this's ready state // to CLOSING (2). failWebsocketConnection(this, 'Connection was closed before it was established.') this[kReadyState] = WebSocket.CLOSING } else if (!isClosing(this)) { // If the WebSocket closing handshake has not yet been started // Start the WebSocket closing handshake and set this's ready // state to CLOSING (2). // - If neither code nor reason is present, the WebSocket Close // message must not have a body. // - If code is present, then the status code to use in the // WebSocket Close message must be the integer given by code. // - If reason is also present, then reasonBytes must be // provided in the Close message after the status code. const frame = new WebsocketFrameSend() // If neither code nor reason is present, the WebSocket Close // message must not have a body. // If code is present, then the status code to use in the // WebSocket Close message must be the integer given by code. if (code !== undefined && reason === undefined) { frame.frameData = Buffer.allocUnsafe(2) frame.frameData.writeUInt16BE(code, 0) } else if (code !== undefined && reason !== undefined) { // If reason is also present, then reasonBytes must be // provided in the Close message after the status code. frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength) frame.frameData.writeUInt16BE(code, 0) // the body MAY contain UTF-8-encoded data with value /reason/ frame.frameData.write(reason, 2, 'utf-8') } else { frame.frameData = emptyBuffer } /** @type {import('stream').Duplex} */ const socket = this[kResponse].socket socket.write(frame.createFrame(opcodes.CLOSE), (err) => { if (!err) { this[kSentClose] = true } }) // Upon either sending or receiving a Close control frame, it is said // that _The WebSocket Closing Handshake is Started_ and that the // WebSocket connection is in the CLOSING state. this[kReadyState] = states.CLOSING } else { // Otherwise // Set this's ready state to CLOSING (2). this[kReadyState] = WebSocket.CLOSING } } /** * @see https://websockets.spec.whatwg.org/#dom-websocket-send * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data */ send (data) { webidl.brandCheck(this, WebSocket) webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' }) data = webidl.converters.WebSocketSendData(data) // 1. If this's ready state is CONNECTING, then throw an // "InvalidStateError" DOMException. if (this[kReadyState] === WebSocket.CONNECTING) { throw new DOMException('Sent before connected.', 'InvalidStateError') } // 2. Run the appropriate set of steps from the following list: // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1 // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2 if (!isEstablished(this) || isClosing(this)) { return } /** @type {import('stream').Duplex} */ const socket = this[kResponse].socket // If data is a string if (typeof data === 'string') { // If the WebSocket connection is established and the WebSocket // closing handshake has not yet started, then the user agent // must send a WebSocket Message comprised of the data argument // using a text frame opcode; if the data cannot be sent, e.g. // because it would need to be buffered but the buffer is full, // the user agent must flag the WebSocket as full and then close // the WebSocket connection. Any invocation of this method with a // string argument that does not throw an exception must increase // the bufferedAmount attribute by the number of bytes needed to // express the argument as UTF-8. const value = Buffer.from(data) const frame = new WebsocketFrameSend(value) const buffer = frame.createFrame(opcodes.TEXT) this.#bufferedAmount += value.byteLength socket.write(buffer, () => { this.#bufferedAmount -= value.byteLength }) } else if (types.isArrayBuffer(data)) { // If the WebSocket connection is established, and the WebSocket // closing handshake has not yet started, then the user agent must // send a WebSocket Message comprised of data using a binary frame // opcode; if the data cannot be sent, e.g. because it would need // to be buffered but the buffer is full, the user agent must flag // the WebSocket as full and then close the WebSocket connection. // The data to be sent is the data stored in the buffer described // by the ArrayBuffer object. Any invocation of this method with an // ArrayBuffer argument that does not throw an exception must // increase the bufferedAmount attribute by the length of the // ArrayBuffer in bytes. const value = Buffer.from(data) const frame = new WebsocketFrameSend(value) const buffer = frame.createFrame(opcodes.BINARY) this.#bufferedAmount += value.byteLength socket.write(buffer, () => { this.#bufferedAmount -= value.byteLength }) } else if (ArrayBuffer.isView(data)) { // If the WebSocket connection is established, and the WebSocket // closing handshake has not yet started, then the user agent must // send a WebSocket Message comprised of data using a binary frame // opcode; if the data cannot be sent, e.g. because it would need to // be buffered but the buffer is full, the user agent must flag the // WebSocket as full and then close the WebSocket connection. The // data to be sent is the data stored in the section of the buffer // described by the ArrayBuffer object that data references. Any // invocation of this method with this kind of argument that does // not throw an exception must increase the bufferedAmount attribute // by the length of data’s buffer in bytes. const ab = Buffer.from(data, data.byteOffset, data.byteLength) const frame = new WebsocketFrameSend(ab) const buffer = frame.createFrame(opcodes.BINARY) this.#bufferedAmount += ab.byteLength socket.write(buffer, () => { this.#bufferedAmount -= ab.byteLength }) } else if (isBlobLike(data)) { // If the WebSocket connection is established, and the WebSocket // closing handshake has not yet started, then the user agent must // send a WebSocket Message comprised of data using a binary frame // opcode; if the data cannot be sent, e.g. because it would need to // be buffered but the buffer is full, the user agent must flag the // WebSocket as full and then close the WebSocket connection. The data // to be sent is the raw data represented by the Blob object. Any // invocation of this method with a Blob argument that does not throw // an exception must increase the bufferedAmount attribute by the size // of the Blob object’s raw data, in bytes. const frame = new WebsocketFrameSend() data.arrayBuffer().then((ab) => { const value = Buffer.from(ab) frame.frameData = value const buffer = frame.createFrame(opcodes.BINARY) this.#bufferedAmount += value.byteLength socket.write(buffer, () => { this.#bufferedAmount -= value.byteLength }) }) } } get readyState () { webidl.brandCheck(this, WebSocket) // The readyState getter steps are to return this's ready state. return this[kReadyState] } get bufferedAmount () { webidl.brandCheck(this, WebSocket) return this.#bufferedAmount } get url () { webidl.brandCheck(this, WebSocket) // The url getter steps are to return this's url, serialized. return URLSerializer(this[kWebSocketURL]) } get extensions () { webidl.brandCheck(this, WebSocket) return this.#extensions } get protocol () { webidl.brandCheck(this, WebSocket) return this.#protocol } get onopen () { webidl.brandCheck(this, WebSocket) return this.#events.open } set onopen (fn) { webidl.brandCheck(this, WebSocket) if (this.#events.open) { this.removeEventListener('open', this.#events.open) } if (typeof fn === 'function') { this.#events.open = fn this.addEventListener('open', fn) } else { this.#events.open = null } } get onerror () { webidl.brandCheck(this, WebSocket) return this.#events.error } set onerror (fn) { webidl.brandCheck(this, WebSocket) if (this.#events.error) { this.removeEventListener('error', this.#events.error) } if (typeof fn === 'function') { this.#events.error = fn this.addEventListener('error', fn) } else { this.#events.error = null } } get onclose () { webidl.brandCheck(this, WebSocket) return this.#events.close } set onclose (fn) { webidl.brandCheck(this, WebSocket) if (this.#events.close) { this.removeEventListener('close', this.#events.close) } if (typeof fn === 'function') { this.#events.close = fn this.addEventListener('close', fn) } else { this.#events.close = null } } get onmessage () { webidl.brandCheck(this, WebSocket) return this.#events.message } set onmessage (fn) { webidl.brandCheck(this, WebSocket) if (this.#events.message) { this.removeEventListener('message', this.#events.message) } if (typeof fn === 'function') { this.#events.message = fn this.addEventListener('message', fn) } else { this.#events.message = null } } get binaryType () { webidl.brandCheck(this, WebSocket) return this[kBinaryType] } set binaryType (type) { webidl.brandCheck(this, WebSocket) if (type !== 'blob' && type !== 'arraybuffer') { this[kBinaryType] = 'blob' } else { this[kBinaryType] = type } } /** * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol */ #onConnectionEstablished (response) { // processResponse is called when the "response’s header list has been received and initialized." // once this happens, the connection is open this[kResponse] = response const parser = new ByteParser(this) parser.on('drain', function onParserDrain () { this.ws[kResponse].socket.resume() }) response.socket.ws = this this[kByteParser] = parser // 1. Change the ready state to OPEN (1). this[kReadyState] = states.OPEN // 2. Change the extensions attribute’s value to the extensions in use, if // it is not the null value. // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1 const extensions = response.headersList.get('sec-websocket-extensions') if (extensions !== null) { this.#extensions = extensions } // 3. Change the protocol attribute’s value to the subprotocol in use, if // it is not the null value. // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9 const protocol = response.headersList.get('sec-websocket-protocol') if (protocol !== null) { this.#protocol = protocol } // 4. Fire an event named open at the WebSocket object. fireEvent('open', this) } } // https://websockets.spec.whatwg.org/#dom-websocket-connecting WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING // https://websockets.spec.whatwg.org/#dom-websocket-open WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN // https://websockets.spec.whatwg.org/#dom-websocket-closing WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING // https://websockets.spec.whatwg.org/#dom-websocket-closed WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED Object.defineProperties(WebSocket.prototype, { CONNECTING: staticPropertyDescriptors, OPEN: staticPropertyDescriptors, CLOSING: staticPropertyDescriptors, CLOSED: staticPropertyDescriptors, url: kEnumerableProperty, readyState: kEnumerableProperty, bufferedAmount: kEnumerableProperty, onopen: kEnumerableProperty, onerror: kEnumerableProperty, onclose: kEnumerableProperty, close: kEnumerableProperty, onmessage: kEnumerableProperty, binaryType: kEnumerableProperty, send: kEnumerableProperty, extensions: kEnumerableProperty, protocol: kEnumerableProperty, [Symbol.toStringTag]: { value: 'WebSocket', writable: false, enumerable: false, configurable: true } }) Object.defineProperties(WebSocket, { CONNECTING: staticPropertyDescriptors, OPEN: staticPropertyDescriptors, CLOSING: staticPropertyDescriptors, CLOSED: staticPropertyDescriptors }) webidl.converters['sequence'] = webidl.sequenceConverter( webidl.converters.DOMString ) webidl.converters['DOMString or sequence'] = function (V) { if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) { return webidl.converters['sequence'](V) } return webidl.converters.DOMString(V) } // This implements the propsal made in https://github.com/whatwg/websockets/issues/42 webidl.converters.WebSocketInit = webidl.dictionaryConverter([ { key: 'protocols', converter: webidl.converters['DOMString or sequence'], get defaultValue () { return [] } }, { key: 'dispatcher', converter: (V) => V, get defaultValue () { return getGlobalDispatcher() } }, { key: 'headers', converter: webidl.nullableConverter(webidl.converters.HeadersInit) } ]) webidl.converters['DOMString or sequence or WebSocketInit'] = function (V) { if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) { return webidl.converters.WebSocketInit(V) } return { protocols: webidl.converters['DOMString or sequence'](V) } } webidl.converters.WebSocketSendData = function (V) { if (webidl.util.Type(V) === 'Object') { if (isBlobLike(V)) { return webidl.converters.Blob(V, { strict: false }) } if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) { return webidl.converters.BufferSource(V) } } return webidl.converters.USVString(V) } module.exports = { WebSocket } /***/ }), /***/ 4488: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /** * For Node.js, simply re-export the core `util.deprecate` function. */ module.exports = __nccwpck_require__(9023).deprecate; /***/ }), /***/ 7125: /***/ ((__unused_webpack_module, exports) => { function makeException(ErrorType, message, options) { if (options.globals) { ErrorType = options.globals[ErrorType.name]; } return new ErrorType(`${options.context ? options.context : "Value"} ${message}.`); } function toNumber(value, options) { if (typeof value === "bigint") { throw makeException(TypeError, "is a BigInt which cannot be converted to a number", options); } if (!options.globals) { return Number(value); } return options.globals.Number(value); } // Round x to the nearest integer, choosing the even integer if it lies halfway between two. function evenRound(x) { // There are four cases for numbers with fractional part being .5: // // case | x | floor(x) | round(x) | expected | x <> 0 | x % 1 | x & 1 | example // 1 | 2n + 0.5 | 2n | 2n + 1 | 2n | > | 0.5 | 0 | 0.5 -> 0 // 2 | 2n + 1.5 | 2n + 1 | 2n + 2 | 2n + 2 | > | 0.5 | 1 | 1.5 -> 2 // 3 | -2n - 0.5 | -2n - 1 | -2n | -2n | < | -0.5 | 0 | -0.5 -> 0 // 4 | -2n - 1.5 | -2n - 2 | -2n - 1 | -2n - 2 | < | -0.5 | 1 | -1.5 -> -2 // (where n is a non-negative integer) // // Branch here for cases 1 and 4 if ((x > 0 && (x % 1) === +0.5 && (x & 1) === 0) || (x < 0 && (x % 1) === -0.5 && (x & 1) === 1)) { return censorNegativeZero(Math.floor(x)); } return censorNegativeZero(Math.round(x)); } function integerPart(n) { return censorNegativeZero(Math.trunc(n)); } function sign(x) { return x < 0 ? -1 : 1; } function modulo(x, y) { // https://tc39.github.io/ecma262/#eqn-modulo // Note that http://stackoverflow.com/a/4467559/3191 does NOT work for large modulos const signMightNotMatch = x % y; if (sign(y) !== sign(signMightNotMatch)) { return signMightNotMatch + y; } return signMightNotMatch; } function censorNegativeZero(x) { return x === 0 ? 0 : x; } function createIntegerConversion(bitLength, { unsigned }) { let lowerBound, upperBound; if (unsigned) { lowerBound = 0; upperBound = 2 ** bitLength - 1; } else { lowerBound = -(2 ** (bitLength - 1)); upperBound = 2 ** (bitLength - 1) - 1; } const twoToTheBitLength = 2 ** bitLength; const twoToOneLessThanTheBitLength = 2 ** (bitLength - 1); return (value, options = {}) => { let x = toNumber(value, options); x = censorNegativeZero(x); if (options.enforceRange) { if (!Number.isFinite(x)) { throw makeException(TypeError, "is not a finite number", options); } x = integerPart(x); if (x < lowerBound || x > upperBound) { throw makeException( TypeError, `is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`, options ); } return x; } if (!Number.isNaN(x) && options.clamp) { x = Math.min(Math.max(x, lowerBound), upperBound); x = evenRound(x); return x; } if (!Number.isFinite(x) || x === 0) { return 0; } x = integerPart(x); // Math.pow(2, 64) is not accurately representable in JavaScript, so try to avoid these per-spec operations if // possible. Hopefully it's an optimization for the non-64-bitLength cases too. if (x >= lowerBound && x <= upperBound) { return x; } // These will not work great for bitLength of 64, but oh well. See the README for more details. x = modulo(x, twoToTheBitLength); if (!unsigned && x >= twoToOneLessThanTheBitLength) { return x - twoToTheBitLength; } return x; }; } function createLongLongConversion(bitLength, { unsigned }) { const upperBound = Number.MAX_SAFE_INTEGER; const lowerBound = unsigned ? 0 : Number.MIN_SAFE_INTEGER; const asBigIntN = unsigned ? BigInt.asUintN : BigInt.asIntN; return (value, options = {}) => { let x = toNumber(value, options); x = censorNegativeZero(x); if (options.enforceRange) { if (!Number.isFinite(x)) { throw makeException(TypeError, "is not a finite number", options); } x = integerPart(x); if (x < lowerBound || x > upperBound) { throw makeException( TypeError, `is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`, options ); } return x; } if (!Number.isNaN(x) && options.clamp) { x = Math.min(Math.max(x, lowerBound), upperBound); x = evenRound(x); return x; } if (!Number.isFinite(x) || x === 0) { return 0; } let xBigInt = BigInt(integerPart(x)); xBigInt = asBigIntN(bitLength, xBigInt); return Number(xBigInt); }; } exports.any = value => { return value; }; exports.undefined = () => { return undefined; }; exports.boolean = value => { return Boolean(value); }; exports.byte = createIntegerConversion(8, { unsigned: false }); exports.octet = createIntegerConversion(8, { unsigned: true }); exports.short = createIntegerConversion(16, { unsigned: false }); exports["unsigned short"] = createIntegerConversion(16, { unsigned: true }); exports.long = createIntegerConversion(32, { unsigned: false }); exports["unsigned long"] = createIntegerConversion(32, { unsigned: true }); exports["long long"] = createLongLongConversion(64, { unsigned: false }); exports["unsigned long long"] = createLongLongConversion(64, { unsigned: true }); exports.double = (value, options = {}) => { const x = toNumber(value, options); if (!Number.isFinite(x)) { throw makeException(TypeError, "is not a finite floating-point value", options); } return x; }; exports["unrestricted double"] = (value, options = {}) => { const x = toNumber(value, options); return x; }; exports.float = (value, options = {}) => { const x = toNumber(value, options); if (!Number.isFinite(x)) { throw makeException(TypeError, "is not a finite floating-point value", options); } if (Object.is(x, -0)) { return x; } const y = Math.fround(x); if (!Number.isFinite(y)) { throw makeException(TypeError, "is outside the range of a single-precision floating-point value", options); } return y; }; exports["unrestricted float"] = (value, options = {}) => { const x = toNumber(value, options); if (isNaN(x)) { return x; } if (Object.is(x, -0)) { return x; } return Math.fround(x); }; exports.DOMString = (value, options = {}) => { if (options.treatNullAsEmptyString && value === null) { return ""; } if (typeof value === "symbol") { throw makeException(TypeError, "is a symbol, which cannot be converted to a string", options); } const StringCtor = options.globals ? options.globals.String : String; return StringCtor(value); }; exports.ByteString = (value, options = {}) => { const x = exports.DOMString(value, options); let c; for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) { if (c > 255) { throw makeException(TypeError, "is not a valid ByteString", options); } } return x; }; exports.USVString = (value, options = {}) => { const S = exports.DOMString(value, options); const n = S.length; const U = []; for (let i = 0; i < n; ++i) { const c = S.charCodeAt(i); if (c < 0xD800 || c > 0xDFFF) { U.push(String.fromCodePoint(c)); } else if (0xDC00 <= c && c <= 0xDFFF) { U.push(String.fromCodePoint(0xFFFD)); } else if (i === n - 1) { U.push(String.fromCodePoint(0xFFFD)); } else { const d = S.charCodeAt(i + 1); if (0xDC00 <= d && d <= 0xDFFF) { const a = c & 0x3FF; const b = d & 0x3FF; U.push(String.fromCodePoint((2 << 15) + ((2 << 9) * a) + b)); ++i; } else { U.push(String.fromCodePoint(0xFFFD)); } } } return U.join(""); }; exports.object = (value, options = {}) => { if (value === null || (typeof value !== "object" && typeof value !== "function")) { throw makeException(TypeError, "is not an object", options); } return value; }; const abByteLengthGetter = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get; const sabByteLengthGetter = typeof SharedArrayBuffer === "function" ? Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, "byteLength").get : null; function isNonSharedArrayBuffer(value) { try { // This will throw on SharedArrayBuffers, but not detached ArrayBuffers. // (The spec says it should throw, but the spec conflicts with implementations: https://github.com/tc39/ecma262/issues/678) abByteLengthGetter.call(value); return true; } catch { return false; } } function isSharedArrayBuffer(value) { try { sabByteLengthGetter.call(value); return true; } catch { return false; } } function isArrayBufferDetached(value) { try { // eslint-disable-next-line no-new new Uint8Array(value); return false; } catch { return true; } } exports.ArrayBuffer = (value, options = {}) => { if (!isNonSharedArrayBuffer(value)) { if (options.allowShared && !isSharedArrayBuffer(value)) { throw makeException(TypeError, "is not an ArrayBuffer or SharedArrayBuffer", options); } throw makeException(TypeError, "is not an ArrayBuffer", options); } if (isArrayBufferDetached(value)) { throw makeException(TypeError, "is a detached ArrayBuffer", options); } return value; }; const dvByteLengthGetter = Object.getOwnPropertyDescriptor(DataView.prototype, "byteLength").get; exports.DataView = (value, options = {}) => { try { dvByteLengthGetter.call(value); } catch (e) { throw makeException(TypeError, "is not a DataView", options); } if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { throw makeException(TypeError, "is backed by a SharedArrayBuffer, which is not allowed", options); } if (isArrayBufferDetached(value.buffer)) { throw makeException(TypeError, "is backed by a detached ArrayBuffer", options); } return value; }; // Returns the unforgeable `TypedArray` constructor name or `undefined`, // if the `this` value isn't a valid `TypedArray` object. // // https://tc39.es/ecma262/#sec-get-%typedarray%.prototype-@@tostringtag const typedArrayNameGetter = Object.getOwnPropertyDescriptor( Object.getPrototypeOf(Uint8Array).prototype, Symbol.toStringTag ).get; [ Int8Array, Int16Array, Int32Array, Uint8Array, Uint16Array, Uint32Array, Uint8ClampedArray, Float32Array, Float64Array ].forEach(func => { const { name } = func; const article = /^[AEIOU]/u.test(name) ? "an" : "a"; exports[name] = (value, options = {}) => { if (!ArrayBuffer.isView(value) || typedArrayNameGetter.call(value) !== name) { throw makeException(TypeError, `is not ${article} ${name} object`, options); } if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options); } if (isArrayBufferDetached(value.buffer)) { throw makeException(TypeError, "is a view on a detached ArrayBuffer", options); } return value; }; }); // Common definitions exports.ArrayBufferView = (value, options = {}) => { if (!ArrayBuffer.isView(value)) { throw makeException(TypeError, "is not a view on an ArrayBuffer or SharedArrayBuffer", options); } if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options); } if (isArrayBufferDetached(value.buffer)) { throw makeException(TypeError, "is a view on a detached ArrayBuffer", options); } return value; }; exports.BufferSource = (value, options = {}) => { if (ArrayBuffer.isView(value)) { if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options); } if (isArrayBufferDetached(value.buffer)) { throw makeException(TypeError, "is a view on a detached ArrayBuffer", options); } return value; } if (!options.allowShared && !isNonSharedArrayBuffer(value)) { throw makeException(TypeError, "is not an ArrayBuffer or a view on one", options); } if (options.allowShared && !isSharedArrayBuffer(value) && !isNonSharedArrayBuffer(value)) { throw makeException(TypeError, "is not an ArrayBuffer, SharedArrayBuffer, or a view on one", options); } if (isArrayBufferDetached(value)) { throw makeException(TypeError, "is a detached ArrayBuffer", options); } return value; }; exports.DOMTimeStamp = exports["unsigned long long"]; /***/ }), /***/ 8012: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { var __webpack_unused_export__; const { URL, URLSearchParams } = __nccwpck_require__(4108); const urlStateMachine = __nccwpck_require__(905); const percentEncoding = __nccwpck_require__(687); const sharedGlobalObject = { Array, Object, Promise, String, TypeError }; URL.install(sharedGlobalObject, ["Window"]); URLSearchParams.install(sharedGlobalObject, ["Window"]); exports.k = sharedGlobalObject.URL; __webpack_unused_export__ = sharedGlobalObject.URLSearchParams; __webpack_unused_export__ = urlStateMachine.parseURL; __webpack_unused_export__ = urlStateMachine.basicURLParse; __webpack_unused_export__ = urlStateMachine.serializeURL; __webpack_unused_export__ = urlStateMachine.serializePath; __webpack_unused_export__ = urlStateMachine.serializeHost; __webpack_unused_export__ = urlStateMachine.serializeInteger; __webpack_unused_export__ = urlStateMachine.serializeURLOrigin; __webpack_unused_export__ = urlStateMachine.setTheUsername; __webpack_unused_export__ = urlStateMachine.setThePassword; __webpack_unused_export__ = urlStateMachine.cannotHaveAUsernamePasswordPort; __webpack_unused_export__ = urlStateMachine.hasAnOpaquePath; __webpack_unused_export__ = percentEncoding.percentDecodeString; __webpack_unused_export__ = percentEncoding.percentDecodeBytes; /***/ }), /***/ 6426: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { const conversions = __nccwpck_require__(7125); const utils = __nccwpck_require__(9857); exports.convert = (globalObject, value, { context = "The provided value" } = {}) => { if (typeof value !== "function") { throw new globalObject.TypeError(context + " is not a function"); } function invokeTheCallbackFunction(...args) { const thisArg = utils.tryWrapperForImpl(this); let callResult; for (let i = 0; i < args.length; i++) { args[i] = utils.tryWrapperForImpl(args[i]); } callResult = Reflect.apply(value, thisArg, args); callResult = conversions["any"](callResult, { context: context, globals: globalObject }); return callResult; } invokeTheCallbackFunction.construct = (...args) => { for (let i = 0; i < args.length; i++) { args[i] = utils.tryWrapperForImpl(args[i]); } let callResult = Reflect.construct(value, args); callResult = conversions["any"](callResult, { context: context, globals: globalObject }); return callResult; }; invokeTheCallbackFunction[utils.wrapperSymbol] = value; invokeTheCallbackFunction.objectReference = value; return invokeTheCallbackFunction; }; /***/ }), /***/ 3184: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { const usm = __nccwpck_require__(905); const urlencoded = __nccwpck_require__(6367); const URLSearchParams = __nccwpck_require__(3627); exports.implementation = class URLImpl { // Unlike the spec, we duplicate some code between the constructor and canParse, because we want to give useful error // messages in the constructor that distinguish between the different causes of failure. constructor(globalObject, [url, base]) { let parsedBase = null; if (base !== undefined) { parsedBase = usm.basicURLParse(base); if (parsedBase === null) { throw new TypeError(`Invalid base URL: ${base}`); } } const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); if (parsedURL === null) { throw new TypeError(`Invalid URL: ${url}`); } const query = parsedURL.query !== null ? parsedURL.query : ""; this._url = parsedURL; // We cannot invoke the "new URLSearchParams object" algorithm without going through the constructor, which strips // question mark by default. Therefore the doNotStripQMark hack is used. this._query = URLSearchParams.createImpl(globalObject, [query], { doNotStripQMark: true }); this._query._url = this; } static parse(globalObject, input, base) { try { return new URLImpl(globalObject, [input, base]); } catch { return null; } } static canParse(url, base) { let parsedBase = null; if (base !== undefined) { parsedBase = usm.basicURLParse(base); if (parsedBase === null) { return false; } } const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); if (parsedURL === null) { return false; } return true; } get href() { return usm.serializeURL(this._url); } set href(v) { const parsedURL = usm.basicURLParse(v); if (parsedURL === null) { throw new TypeError(`Invalid URL: ${v}`); } this._url = parsedURL; this._query._list.splice(0); const { query } = parsedURL; if (query !== null) { this._query._list = urlencoded.parseUrlencodedString(query); } } get origin() { return usm.serializeURLOrigin(this._url); } get protocol() { return `${this._url.scheme}:`; } set protocol(v) { usm.basicURLParse(`${v}:`, { url: this._url, stateOverride: "scheme start" }); } get username() { return this._url.username; } set username(v) { if (usm.cannotHaveAUsernamePasswordPort(this._url)) { return; } usm.setTheUsername(this._url, v); } get password() { return this._url.password; } set password(v) { if (usm.cannotHaveAUsernamePasswordPort(this._url)) { return; } usm.setThePassword(this._url, v); } get host() { const url = this._url; if (url.host === null) { return ""; } if (url.port === null) { return usm.serializeHost(url.host); } return `${usm.serializeHost(url.host)}:${usm.serializeInteger(url.port)}`; } set host(v) { if (usm.hasAnOpaquePath(this._url)) { return; } usm.basicURLParse(v, { url: this._url, stateOverride: "host" }); } get hostname() { if (this._url.host === null) { return ""; } return usm.serializeHost(this._url.host); } set hostname(v) { if (usm.hasAnOpaquePath(this._url)) { return; } usm.basicURLParse(v, { url: this._url, stateOverride: "hostname" }); } get port() { if (this._url.port === null) { return ""; } return usm.serializeInteger(this._url.port); } set port(v) { if (usm.cannotHaveAUsernamePasswordPort(this._url)) { return; } if (v === "") { this._url.port = null; } else { usm.basicURLParse(v, { url: this._url, stateOverride: "port" }); } } get pathname() { return usm.serializePath(this._url); } set pathname(v) { if (usm.hasAnOpaquePath(this._url)) { return; } this._url.path = []; usm.basicURLParse(v, { url: this._url, stateOverride: "path start" }); } get search() { if (this._url.query === null || this._url.query === "") { return ""; } return `?${this._url.query}`; } set search(v) { const url = this._url; if (v === "") { url.query = null; this._query._list = []; return; } const input = v[0] === "?" ? v.substring(1) : v; url.query = ""; usm.basicURLParse(input, { url, stateOverride: "query" }); this._query._list = urlencoded.parseUrlencodedString(input); } get searchParams() { return this._query; } get hash() { if (this._url.fragment === null || this._url.fragment === "") { return ""; } return `#${this._url.fragment}`; } set hash(v) { if (v === "") { this._url.fragment = null; return; } const input = v[0] === "#" ? v.substring(1) : v; this._url.fragment = ""; usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" }); } toJSON() { return this.href; } }; /***/ }), /***/ 6633: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { const conversions = __nccwpck_require__(7125); const utils = __nccwpck_require__(9857); const implSymbol = utils.implSymbol; const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "URL"; exports.is = value => { return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; exports.convert = (globalObject, value, { context = "The provided value" } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } throw new globalObject.TypeError(`${context} is not of type 'URL'.`); }; function makeWrapper(globalObject, newTarget) { let proto; if (newTarget !== undefined) { proto = newTarget.prototype; } if (!utils.isObject(proto)) { proto = globalObject[ctorRegistrySymbol]["URL"].prototype; } return Object.create(proto); } exports.create = (globalObject, constructorArgs, privateData) => { const wrapper = makeWrapper(globalObject); return exports.setup(wrapper, globalObject, constructorArgs, privateData); }; exports.createImpl = (globalObject, constructorArgs, privateData) => { const wrapper = exports.create(globalObject, constructorArgs, privateData); return utils.implForWrapper(wrapper); }; exports._internalSetup = (wrapper, globalObject) => {}; exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => { privateData.wrapper = wrapper; exports._internalSetup(wrapper, globalObject); Object.defineProperty(wrapper, implSymbol, { value: new Impl.implementation(globalObject, constructorArgs, privateData), configurable: true }); wrapper[implSymbol][utils.wrapperSymbol] = wrapper; if (Impl.init) { Impl.init(wrapper[implSymbol]); } return wrapper; }; exports["new"] = (globalObject, newTarget) => { const wrapper = makeWrapper(globalObject, newTarget); exports._internalSetup(wrapper, globalObject); Object.defineProperty(wrapper, implSymbol, { value: Object.create(Impl.implementation.prototype), configurable: true }); wrapper[implSymbol][utils.wrapperSymbol] = wrapper; if (Impl.init) { Impl.init(wrapper[implSymbol]); } return wrapper[implSymbol]; }; const exposed = new Set(["Window", "Worker"]); exports.install = (globalObject, globalNames) => { if (!globalNames.some(globalName => exposed.has(globalName))) { return; } const ctorRegistry = utils.initCtorRegistry(globalObject); class URL { constructor(url) { if (arguments.length < 1) { throw new globalObject.TypeError( `Failed to construct 'URL': 1 argument required, but only ${arguments.length} present.` ); } const args = []; { let curArg = arguments[0]; curArg = conversions["USVString"](curArg, { context: "Failed to construct 'URL': parameter 1", globals: globalObject }); args.push(curArg); } { let curArg = arguments[1]; if (curArg !== undefined) { curArg = conversions["USVString"](curArg, { context: "Failed to construct 'URL': parameter 2", globals: globalObject }); } args.push(curArg); } return exports.setup(Object.create(new.target.prototype), globalObject, args); } toJSON() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'toJSON' called on an object that is not a valid instance of URL."); } return esValue[implSymbol].toJSON(); } get href() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'get href' called on an object that is not a valid instance of URL."); } return esValue[implSymbol]["href"]; } set href(V) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'set href' called on an object that is not a valid instance of URL."); } V = conversions["USVString"](V, { context: "Failed to set the 'href' property on 'URL': The provided value", globals: globalObject }); esValue[implSymbol]["href"] = V; } toString() { const esValue = this; if (!exports.is(esValue)) { throw new globalObject.TypeError("'toString' called on an object that is not a valid instance of URL."); } return esValue[implSymbol]["href"]; } get origin() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'get origin' called on an object that is not a valid instance of URL."); } return esValue[implSymbol]["origin"]; } get protocol() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'get protocol' called on an object that is not a valid instance of URL."); } return esValue[implSymbol]["protocol"]; } set protocol(V) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'set protocol' called on an object that is not a valid instance of URL."); } V = conversions["USVString"](V, { context: "Failed to set the 'protocol' property on 'URL': The provided value", globals: globalObject }); esValue[implSymbol]["protocol"] = V; } get username() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'get username' called on an object that is not a valid instance of URL."); } return esValue[implSymbol]["username"]; } set username(V) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'set username' called on an object that is not a valid instance of URL."); } V = conversions["USVString"](V, { context: "Failed to set the 'username' property on 'URL': The provided value", globals: globalObject }); esValue[implSymbol]["username"] = V; } get password() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'get password' called on an object that is not a valid instance of URL."); } return esValue[implSymbol]["password"]; } set password(V) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'set password' called on an object that is not a valid instance of URL."); } V = conversions["USVString"](V, { context: "Failed to set the 'password' property on 'URL': The provided value", globals: globalObject }); esValue[implSymbol]["password"] = V; } get host() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'get host' called on an object that is not a valid instance of URL."); } return esValue[implSymbol]["host"]; } set host(V) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'set host' called on an object that is not a valid instance of URL."); } V = conversions["USVString"](V, { context: "Failed to set the 'host' property on 'URL': The provided value", globals: globalObject }); esValue[implSymbol]["host"] = V; } get hostname() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'get hostname' called on an object that is not a valid instance of URL."); } return esValue[implSymbol]["hostname"]; } set hostname(V) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'set hostname' called on an object that is not a valid instance of URL."); } V = conversions["USVString"](V, { context: "Failed to set the 'hostname' property on 'URL': The provided value", globals: globalObject }); esValue[implSymbol]["hostname"] = V; } get port() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'get port' called on an object that is not a valid instance of URL."); } return esValue[implSymbol]["port"]; } set port(V) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'set port' called on an object that is not a valid instance of URL."); } V = conversions["USVString"](V, { context: "Failed to set the 'port' property on 'URL': The provided value", globals: globalObject }); esValue[implSymbol]["port"] = V; } get pathname() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'get pathname' called on an object that is not a valid instance of URL."); } return esValue[implSymbol]["pathname"]; } set pathname(V) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'set pathname' called on an object that is not a valid instance of URL."); } V = conversions["USVString"](V, { context: "Failed to set the 'pathname' property on 'URL': The provided value", globals: globalObject }); esValue[implSymbol]["pathname"] = V; } get search() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'get search' called on an object that is not a valid instance of URL."); } return esValue[implSymbol]["search"]; } set search(V) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'set search' called on an object that is not a valid instance of URL."); } V = conversions["USVString"](V, { context: "Failed to set the 'search' property on 'URL': The provided value", globals: globalObject }); esValue[implSymbol]["search"] = V; } get searchParams() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'get searchParams' called on an object that is not a valid instance of URL."); } return utils.getSameObject(this, "searchParams", () => { return utils.tryWrapperForImpl(esValue[implSymbol]["searchParams"]); }); } get hash() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'get hash' called on an object that is not a valid instance of URL."); } return esValue[implSymbol]["hash"]; } set hash(V) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'set hash' called on an object that is not a valid instance of URL."); } V = conversions["USVString"](V, { context: "Failed to set the 'hash' property on 'URL': The provided value", globals: globalObject }); esValue[implSymbol]["hash"] = V; } static parse(url) { if (arguments.length < 1) { throw new globalObject.TypeError( `Failed to execute 'parse' on 'URL': 1 argument required, but only ${arguments.length} present.` ); } const args = []; { let curArg = arguments[0]; curArg = conversions["USVString"](curArg, { context: "Failed to execute 'parse' on 'URL': parameter 1", globals: globalObject }); args.push(curArg); } { let curArg = arguments[1]; if (curArg !== undefined) { curArg = conversions["USVString"](curArg, { context: "Failed to execute 'parse' on 'URL': parameter 2", globals: globalObject }); } args.push(curArg); } return utils.tryWrapperForImpl(Impl.implementation.parse(globalObject, ...args)); } static canParse(url) { if (arguments.length < 1) { throw new globalObject.TypeError( `Failed to execute 'canParse' on 'URL': 1 argument required, but only ${arguments.length} present.` ); } const args = []; { let curArg = arguments[0]; curArg = conversions["USVString"](curArg, { context: "Failed to execute 'canParse' on 'URL': parameter 1", globals: globalObject }); args.push(curArg); } { let curArg = arguments[1]; if (curArg !== undefined) { curArg = conversions["USVString"](curArg, { context: "Failed to execute 'canParse' on 'URL': parameter 2", globals: globalObject }); } args.push(curArg); } return Impl.implementation.canParse(...args); } } Object.defineProperties(URL.prototype, { toJSON: { enumerable: true }, href: { enumerable: true }, toString: { enumerable: true }, origin: { enumerable: true }, protocol: { enumerable: true }, username: { enumerable: true }, password: { enumerable: true }, host: { enumerable: true }, hostname: { enumerable: true }, port: { enumerable: true }, pathname: { enumerable: true }, search: { enumerable: true }, searchParams: { enumerable: true }, hash: { enumerable: true }, [Symbol.toStringTag]: { value: "URL", configurable: true } }); Object.defineProperties(URL, { parse: { enumerable: true }, canParse: { enumerable: true } }); ctorRegistry[interfaceName] = URL; Object.defineProperty(globalObject, interfaceName, { configurable: true, writable: true, value: URL }); if (globalNames.includes("Window")) { Object.defineProperty(globalObject, "webkitURL", { configurable: true, writable: true, value: URL }); } }; const Impl = __nccwpck_require__(3184); /***/ }), /***/ 2894: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { const urlencoded = __nccwpck_require__(6367); exports.implementation = class URLSearchParamsImpl { constructor(globalObject, constructorArgs, { doNotStripQMark = false }) { let init = constructorArgs[0]; this._list = []; this._url = null; if (!doNotStripQMark && typeof init === "string" && init[0] === "?") { init = init.slice(1); } if (Array.isArray(init)) { for (const pair of init) { if (pair.length !== 2) { throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element does not " + "contain exactly two elements."); } this._list.push([pair[0], pair[1]]); } } else if (typeof init === "object" && Object.getPrototypeOf(init) === null) { for (const name of Object.keys(init)) { const value = init[name]; this._list.push([name, value]); } } else { this._list = urlencoded.parseUrlencodedString(init); } } _updateSteps() { if (this._url !== null) { let serializedQuery = urlencoded.serializeUrlencoded(this._list); if (serializedQuery === "") { serializedQuery = null; } this._url._url.query = serializedQuery; } } get size() { return this._list.length; } append(name, value) { this._list.push([name, value]); this._updateSteps(); } delete(name, value) { let i = 0; while (i < this._list.length) { if (this._list[i][0] === name && (value === undefined || this._list[i][1] === value)) { this._list.splice(i, 1); } else { i++; } } this._updateSteps(); } get(name) { for (const tuple of this._list) { if (tuple[0] === name) { return tuple[1]; } } return null; } getAll(name) { const output = []; for (const tuple of this._list) { if (tuple[0] === name) { output.push(tuple[1]); } } return output; } has(name, value) { for (const tuple of this._list) { if (tuple[0] === name && (value === undefined || tuple[1] === value)) { return true; } } return false; } set(name, value) { let found = false; let i = 0; while (i < this._list.length) { if (this._list[i][0] === name) { if (found) { this._list.splice(i, 1); } else { found = true; this._list[i][1] = value; i++; } } else { i++; } } if (!found) { this._list.push([name, value]); } this._updateSteps(); } sort() { this._list.sort((a, b) => { if (a[0] < b[0]) { return -1; } if (a[0] > b[0]) { return 1; } return 0; }); this._updateSteps(); } [Symbol.iterator]() { return this._list[Symbol.iterator](); } toString() { return urlencoded.serializeUrlencoded(this._list); } }; /***/ }), /***/ 3627: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { const conversions = __nccwpck_require__(7125); const utils = __nccwpck_require__(9857); const Function = __nccwpck_require__(6426); const newObjectInRealm = utils.newObjectInRealm; const implSymbol = utils.implSymbol; const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "URLSearchParams"; exports.is = value => { return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; exports.convert = (globalObject, value, { context = "The provided value" } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } throw new globalObject.TypeError(`${context} is not of type 'URLSearchParams'.`); }; exports.createDefaultIterator = (globalObject, target, kind) => { const ctorRegistry = globalObject[ctorRegistrySymbol]; const iteratorPrototype = ctorRegistry["URLSearchParams Iterator"]; const iterator = Object.create(iteratorPrototype); Object.defineProperty(iterator, utils.iterInternalSymbol, { value: { target, kind, index: 0 }, configurable: true }); return iterator; }; function makeWrapper(globalObject, newTarget) { let proto; if (newTarget !== undefined) { proto = newTarget.prototype; } if (!utils.isObject(proto)) { proto = globalObject[ctorRegistrySymbol]["URLSearchParams"].prototype; } return Object.create(proto); } exports.create = (globalObject, constructorArgs, privateData) => { const wrapper = makeWrapper(globalObject); return exports.setup(wrapper, globalObject, constructorArgs, privateData); }; exports.createImpl = (globalObject, constructorArgs, privateData) => { const wrapper = exports.create(globalObject, constructorArgs, privateData); return utils.implForWrapper(wrapper); }; exports._internalSetup = (wrapper, globalObject) => {}; exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => { privateData.wrapper = wrapper; exports._internalSetup(wrapper, globalObject); Object.defineProperty(wrapper, implSymbol, { value: new Impl.implementation(globalObject, constructorArgs, privateData), configurable: true }); wrapper[implSymbol][utils.wrapperSymbol] = wrapper; if (Impl.init) { Impl.init(wrapper[implSymbol]); } return wrapper; }; exports["new"] = (globalObject, newTarget) => { const wrapper = makeWrapper(globalObject, newTarget); exports._internalSetup(wrapper, globalObject); Object.defineProperty(wrapper, implSymbol, { value: Object.create(Impl.implementation.prototype), configurable: true }); wrapper[implSymbol][utils.wrapperSymbol] = wrapper; if (Impl.init) { Impl.init(wrapper[implSymbol]); } return wrapper[implSymbol]; }; const exposed = new Set(["Window", "Worker"]); exports.install = (globalObject, globalNames) => { if (!globalNames.some(globalName => exposed.has(globalName))) { return; } const ctorRegistry = utils.initCtorRegistry(globalObject); class URLSearchParams { constructor() { const args = []; { let curArg = arguments[0]; if (curArg !== undefined) { if (utils.isObject(curArg)) { if (curArg[Symbol.iterator] !== undefined) { if (!utils.isObject(curArg)) { throw new globalObject.TypeError( "Failed to construct 'URLSearchParams': parameter 1" + " sequence" + " is not an iterable object." ); } else { const V = []; const tmp = curArg; for (let nextItem of tmp) { if (!utils.isObject(nextItem)) { throw new globalObject.TypeError( "Failed to construct 'URLSearchParams': parameter 1" + " sequence" + "'s element" + " is not an iterable object." ); } else { const V = []; const tmp = nextItem; for (let nextItem of tmp) { nextItem = conversions["USVString"](nextItem, { context: "Failed to construct 'URLSearchParams': parameter 1" + " sequence" + "'s element" + "'s element", globals: globalObject }); V.push(nextItem); } nextItem = V; } V.push(nextItem); } curArg = V; } } else { if (!utils.isObject(curArg)) { throw new globalObject.TypeError( "Failed to construct 'URLSearchParams': parameter 1" + " record" + " is not an object." ); } else { const result = Object.create(null); for (const key of Reflect.ownKeys(curArg)) { const desc = Object.getOwnPropertyDescriptor(curArg, key); if (desc && desc.enumerable) { let typedKey = key; typedKey = conversions["USVString"](typedKey, { context: "Failed to construct 'URLSearchParams': parameter 1" + " record" + "'s key", globals: globalObject }); let typedValue = curArg[key]; typedValue = conversions["USVString"](typedValue, { context: "Failed to construct 'URLSearchParams': parameter 1" + " record" + "'s value", globals: globalObject }); result[typedKey] = typedValue; } } curArg = result; } } } else { curArg = conversions["USVString"](curArg, { context: "Failed to construct 'URLSearchParams': parameter 1", globals: globalObject }); } } else { curArg = ""; } args.push(curArg); } return exports.setup(Object.create(new.target.prototype), globalObject, args); } append(name, value) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError( "'append' called on an object that is not a valid instance of URLSearchParams." ); } if (arguments.length < 2) { throw new globalObject.TypeError( `Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.` ); } const args = []; { let curArg = arguments[0]; curArg = conversions["USVString"](curArg, { context: "Failed to execute 'append' on 'URLSearchParams': parameter 1", globals: globalObject }); args.push(curArg); } { let curArg = arguments[1]; curArg = conversions["USVString"](curArg, { context: "Failed to execute 'append' on 'URLSearchParams': parameter 2", globals: globalObject }); args.push(curArg); } return utils.tryWrapperForImpl(esValue[implSymbol].append(...args)); } delete(name) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError( "'delete' called on an object that is not a valid instance of URLSearchParams." ); } if (arguments.length < 1) { throw new globalObject.TypeError( `Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` ); } const args = []; { let curArg = arguments[0]; curArg = conversions["USVString"](curArg, { context: "Failed to execute 'delete' on 'URLSearchParams': parameter 1", globals: globalObject }); args.push(curArg); } { let curArg = arguments[1]; if (curArg !== undefined) { curArg = conversions["USVString"](curArg, { context: "Failed to execute 'delete' on 'URLSearchParams': parameter 2", globals: globalObject }); } args.push(curArg); } return utils.tryWrapperForImpl(esValue[implSymbol].delete(...args)); } get(name) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'get' called on an object that is not a valid instance of URLSearchParams."); } if (arguments.length < 1) { throw new globalObject.TypeError( `Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` ); } const args = []; { let curArg = arguments[0]; curArg = conversions["USVString"](curArg, { context: "Failed to execute 'get' on 'URLSearchParams': parameter 1", globals: globalObject }); args.push(curArg); } return esValue[implSymbol].get(...args); } getAll(name) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError( "'getAll' called on an object that is not a valid instance of URLSearchParams." ); } if (arguments.length < 1) { throw new globalObject.TypeError( `Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` ); } const args = []; { let curArg = arguments[0]; curArg = conversions["USVString"](curArg, { context: "Failed to execute 'getAll' on 'URLSearchParams': parameter 1", globals: globalObject }); args.push(curArg); } return utils.tryWrapperForImpl(esValue[implSymbol].getAll(...args)); } has(name) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'has' called on an object that is not a valid instance of URLSearchParams."); } if (arguments.length < 1) { throw new globalObject.TypeError( `Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` ); } const args = []; { let curArg = arguments[0]; curArg = conversions["USVString"](curArg, { context: "Failed to execute 'has' on 'URLSearchParams': parameter 1", globals: globalObject }); args.push(curArg); } { let curArg = arguments[1]; if (curArg !== undefined) { curArg = conversions["USVString"](curArg, { context: "Failed to execute 'has' on 'URLSearchParams': parameter 2", globals: globalObject }); } args.push(curArg); } return esValue[implSymbol].has(...args); } set(name, value) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'set' called on an object that is not a valid instance of URLSearchParams."); } if (arguments.length < 2) { throw new globalObject.TypeError( `Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.` ); } const args = []; { let curArg = arguments[0]; curArg = conversions["USVString"](curArg, { context: "Failed to execute 'set' on 'URLSearchParams': parameter 1", globals: globalObject }); args.push(curArg); } { let curArg = arguments[1]; curArg = conversions["USVString"](curArg, { context: "Failed to execute 'set' on 'URLSearchParams': parameter 2", globals: globalObject }); args.push(curArg); } return utils.tryWrapperForImpl(esValue[implSymbol].set(...args)); } sort() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError("'sort' called on an object that is not a valid instance of URLSearchParams."); } return utils.tryWrapperForImpl(esValue[implSymbol].sort()); } toString() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError( "'toString' called on an object that is not a valid instance of URLSearchParams." ); } return esValue[implSymbol].toString(); } keys() { if (!exports.is(this)) { throw new globalObject.TypeError("'keys' called on an object that is not a valid instance of URLSearchParams."); } return exports.createDefaultIterator(globalObject, this, "key"); } values() { if (!exports.is(this)) { throw new globalObject.TypeError( "'values' called on an object that is not a valid instance of URLSearchParams." ); } return exports.createDefaultIterator(globalObject, this, "value"); } entries() { if (!exports.is(this)) { throw new globalObject.TypeError( "'entries' called on an object that is not a valid instance of URLSearchParams." ); } return exports.createDefaultIterator(globalObject, this, "key+value"); } forEach(callback) { if (!exports.is(this)) { throw new globalObject.TypeError( "'forEach' called on an object that is not a valid instance of URLSearchParams." ); } if (arguments.length < 1) { throw new globalObject.TypeError( "Failed to execute 'forEach' on 'iterable': 1 argument required, but only 0 present." ); } callback = Function.convert(globalObject, callback, { context: "Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1" }); const thisArg = arguments[1]; let pairs = Array.from(this[implSymbol]); let i = 0; while (i < pairs.length) { const [key, value] = pairs[i].map(utils.tryWrapperForImpl); callback.call(thisArg, value, key, this); pairs = Array.from(this[implSymbol]); i++; } } get size() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { throw new globalObject.TypeError( "'get size' called on an object that is not a valid instance of URLSearchParams." ); } return esValue[implSymbol]["size"]; } } Object.defineProperties(URLSearchParams.prototype, { append: { enumerable: true }, delete: { enumerable: true }, get: { enumerable: true }, getAll: { enumerable: true }, has: { enumerable: true }, set: { enumerable: true }, sort: { enumerable: true }, toString: { enumerable: true }, keys: { enumerable: true }, values: { enumerable: true }, entries: { enumerable: true }, forEach: { enumerable: true }, size: { enumerable: true }, [Symbol.toStringTag]: { value: "URLSearchParams", configurable: true }, [Symbol.iterator]: { value: URLSearchParams.prototype.entries, configurable: true, writable: true } }); ctorRegistry[interfaceName] = URLSearchParams; ctorRegistry["URLSearchParams Iterator"] = Object.create(ctorRegistry["%IteratorPrototype%"], { [Symbol.toStringTag]: { configurable: true, value: "URLSearchParams Iterator" } }); utils.define(ctorRegistry["URLSearchParams Iterator"], { next() { const internal = this && this[utils.iterInternalSymbol]; if (!internal) { throw new globalObject.TypeError("next() called on a value that is not a URLSearchParams iterator object"); } const { target, kind, index } = internal; const values = Array.from(target[implSymbol]); const len = values.length; if (index >= len) { return newObjectInRealm(globalObject, { value: undefined, done: true }); } const pair = values[index]; internal.index = index + 1; return newObjectInRealm(globalObject, utils.iteratorResult(pair.map(utils.tryWrapperForImpl), kind)); } }); Object.defineProperty(globalObject, interfaceName, { configurable: true, writable: true, value: URLSearchParams }); }; const Impl = __nccwpck_require__(2894); /***/ }), /***/ 4887: /***/ ((module) => { const utf8Encoder = new TextEncoder(); const utf8Decoder = new TextDecoder("utf-8", { ignoreBOM: true }); function utf8Encode(string) { return utf8Encoder.encode(string); } function utf8DecodeWithoutBOM(bytes) { return utf8Decoder.decode(bytes); } module.exports = { utf8Encode, utf8DecodeWithoutBOM }; /***/ }), /***/ 3102: /***/ ((module) => { // Note that we take code points as JS numbers, not JS strings. function isASCIIDigit(c) { return c >= 0x30 && c <= 0x39; } function isASCIIAlpha(c) { return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A); } function isASCIIAlphanumeric(c) { return isASCIIAlpha(c) || isASCIIDigit(c); } function isASCIIHex(c) { return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66); } module.exports = { isASCIIDigit, isASCIIAlpha, isASCIIAlphanumeric, isASCIIHex }; /***/ }), /***/ 687: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { isASCIIHex } = __nccwpck_require__(3102); const { utf8Encode } = __nccwpck_require__(4887); function p(char) { return char.codePointAt(0); } // https://url.spec.whatwg.org/#percent-encode function percentEncode(c) { let hex = c.toString(16).toUpperCase(); if (hex.length === 1) { hex = `0${hex}`; } return `%${hex}`; } // https://url.spec.whatwg.org/#percent-decode function percentDecodeBytes(input) { const output = new Uint8Array(input.byteLength); let outputIndex = 0; for (let i = 0; i < input.byteLength; ++i) { const byte = input[i]; if (byte !== 0x25) { output[outputIndex++] = byte; } else if (byte === 0x25 && (!isASCIIHex(input[i + 1]) || !isASCIIHex(input[i + 2]))) { output[outputIndex++] = byte; } else { const bytePoint = parseInt(String.fromCodePoint(input[i + 1], input[i + 2]), 16); output[outputIndex++] = bytePoint; i += 2; } } return output.slice(0, outputIndex); } // https://url.spec.whatwg.org/#string-percent-decode function percentDecodeString(input) { const bytes = utf8Encode(input); return percentDecodeBytes(bytes); } // https://url.spec.whatwg.org/#c0-control-percent-encode-set function isC0ControlPercentEncode(c) { return c <= 0x1F || c > 0x7E; } // https://url.spec.whatwg.org/#fragment-percent-encode-set const extraFragmentPercentEncodeSet = new Set([p(" "), p("\""), p("<"), p(">"), p("`")]); function isFragmentPercentEncode(c) { return isC0ControlPercentEncode(c) || extraFragmentPercentEncodeSet.has(c); } // https://url.spec.whatwg.org/#query-percent-encode-set const extraQueryPercentEncodeSet = new Set([p(" "), p("\""), p("#"), p("<"), p(">")]); function isQueryPercentEncode(c) { return isC0ControlPercentEncode(c) || extraQueryPercentEncodeSet.has(c); } // https://url.spec.whatwg.org/#special-query-percent-encode-set function isSpecialQueryPercentEncode(c) { return isQueryPercentEncode(c) || c === p("'"); } // https://url.spec.whatwg.org/#path-percent-encode-set const extraPathPercentEncodeSet = new Set([p("?"), p("`"), p("{"), p("}"), p("^")]); function isPathPercentEncode(c) { return isQueryPercentEncode(c) || extraPathPercentEncodeSet.has(c); } // https://url.spec.whatwg.org/#userinfo-percent-encode-set const extraUserinfoPercentEncodeSet = new Set([p("/"), p(":"), p(";"), p("="), p("@"), p("["), p("\\"), p("]"), p("|")]); function isUserinfoPercentEncode(c) { return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c); } // https://url.spec.whatwg.org/#component-percent-encode-set const extraComponentPercentEncodeSet = new Set([p("$"), p("%"), p("&"), p("+"), p(",")]); function isComponentPercentEncode(c) { return isUserinfoPercentEncode(c) || extraComponentPercentEncodeSet.has(c); } // https://url.spec.whatwg.org/#application-x-www-form-urlencoded-percent-encode-set const extraURLEncodedPercentEncodeSet = new Set([p("!"), p("'"), p("("), p(")"), p("~")]); function isURLEncodedPercentEncode(c) { return isComponentPercentEncode(c) || extraURLEncodedPercentEncodeSet.has(c); } // https://url.spec.whatwg.org/#code-point-percent-encode-after-encoding // https://url.spec.whatwg.org/#utf-8-percent-encode // Assuming encoding is always utf-8 allows us to trim one of the logic branches. TODO: support encoding. // The "-Internal" variant here has code points as JS strings. The external version used by other files has code points // as JS numbers, like the rest of the codebase. function utf8PercentEncodeCodePointInternal(codePoint, percentEncodePredicate) { const bytes = utf8Encode(codePoint); let output = ""; for (const byte of bytes) { // Our percentEncodePredicate operates on bytes, not code points, so this is slightly different from the spec. if (!percentEncodePredicate(byte)) { output += String.fromCharCode(byte); } else { output += percentEncode(byte); } } return output; } function utf8PercentEncodeCodePoint(codePoint, percentEncodePredicate) { return utf8PercentEncodeCodePointInternal(String.fromCodePoint(codePoint), percentEncodePredicate); } // https://url.spec.whatwg.org/#string-percent-encode-after-encoding // https://url.spec.whatwg.org/#string-utf-8-percent-encode function utf8PercentEncodeString(input, percentEncodePredicate, spaceAsPlus = false) { let output = ""; for (const codePoint of input) { if (spaceAsPlus && codePoint === " ") { output += "+"; } else { output += utf8PercentEncodeCodePointInternal(codePoint, percentEncodePredicate); } } return output; } module.exports = { isC0ControlPercentEncode, isFragmentPercentEncode, isQueryPercentEncode, isSpecialQueryPercentEncode, isPathPercentEncode, isUserinfoPercentEncode, isURLEncodedPercentEncode, percentDecodeString, percentDecodeBytes, utf8PercentEncodeString, utf8PercentEncodeCodePoint }; /***/ }), /***/ 905: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const tr46 = __nccwpck_require__(1552); const infra = __nccwpck_require__(3102); const { utf8DecodeWithoutBOM } = __nccwpck_require__(4887); const { percentDecodeString, utf8PercentEncodeCodePoint, utf8PercentEncodeString, isC0ControlPercentEncode, isFragmentPercentEncode, isQueryPercentEncode, isSpecialQueryPercentEncode, isPathPercentEncode, isUserinfoPercentEncode } = __nccwpck_require__(687); function p(char) { return char.codePointAt(0); } const specialSchemes = { ftp: 21, file: null, http: 80, https: 443, ws: 80, wss: 443 }; const failure = Symbol("failure"); function countSymbols(str) { return [...str].length; } function at(input, idx) { const c = input[idx]; return isNaN(c) ? undefined : String.fromCodePoint(c); } function isSingleDot(buffer) { return buffer === "." || buffer.toLowerCase() === "%2e"; } function isDoubleDot(buffer) { buffer = buffer.toLowerCase(); return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e"; } function isWindowsDriveLetterCodePoints(cp1, cp2) { return infra.isASCIIAlpha(cp1) && (cp2 === p(":") || cp2 === p("|")); } function isWindowsDriveLetterString(string) { return string.length === 2 && infra.isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|"); } function isNormalizedWindowsDriveLetterString(string) { return string.length === 2 && infra.isASCIIAlpha(string.codePointAt(0)) && string[1] === ":"; } function containsForbiddenHostCodePoint(string) { return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|<|>|\?|@|\[|\\|\]|\^|\|/u) !== -1; } function containsForbiddenDomainCodePoint(string) { return containsForbiddenHostCodePoint(string) || string.search(/[\u0000-\u001F]|%|\u007F/u) !== -1; } function isSpecialScheme(scheme) { return specialSchemes[scheme] !== undefined; } function isSpecial(url) { return isSpecialScheme(url.scheme); } function isNotSpecial(url) { return !isSpecialScheme(url.scheme); } function defaultPort(scheme) { return specialSchemes[scheme]; } function parseIPv4Number(input) { if (input === "") { return failure; } let R = 10; if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") { input = input.substring(2); R = 16; } else if (input.length >= 2 && input.charAt(0) === "0") { input = input.substring(1); R = 8; } if (input === "") { return 0; } let regex = /[^0-7]/u; if (R === 10) { regex = /[^0-9]/u; } if (R === 16) { regex = /[^0-9A-Fa-f]/u; } if (regex.test(input)) { return failure; } return parseInt(input, R); } function parseIPv4(input) { const parts = input.split("."); if (parts[parts.length - 1] === "") { if (parts.length > 1) { parts.pop(); } } if (parts.length > 4) { return failure; } const numbers = []; for (const part of parts) { const n = parseIPv4Number(part); if (n === failure) { return failure; } numbers.push(n); } for (let i = 0; i < numbers.length - 1; ++i) { if (numbers[i] > 255) { return failure; } } if (numbers[numbers.length - 1] >= 256 ** (5 - numbers.length)) { return failure; } let ipv4 = numbers.pop(); let counter = 0; for (const n of numbers) { ipv4 += n * 256 ** (3 - counter); ++counter; } return ipv4; } function serializeIPv4(address) { let output = ""; let n = address; for (let i = 1; i <= 4; ++i) { output = String(n % 256) + output; if (i !== 4) { output = `.${output}`; } n = Math.floor(n / 256); } return output; } function parseIPv6(input) { const address = [0, 0, 0, 0, 0, 0, 0, 0]; let pieceIndex = 0; let compress = null; let pointer = 0; input = Array.from(input, c => c.codePointAt(0)); if (input[pointer] === p(":")) { if (input[pointer + 1] !== p(":")) { return failure; } pointer += 2; ++pieceIndex; compress = pieceIndex; } while (pointer < input.length) { if (pieceIndex === 8) { return failure; } if (input[pointer] === p(":")) { if (compress !== null) { return failure; } ++pointer; ++pieceIndex; compress = pieceIndex; continue; } let value = 0; let length = 0; while (length < 4 && infra.isASCIIHex(input[pointer])) { value = value * 0x10 + parseInt(at(input, pointer), 16); ++pointer; ++length; } if (input[pointer] === p(".")) { if (length === 0) { return failure; } pointer -= length; if (pieceIndex > 6) { return failure; } let numbersSeen = 0; while (input[pointer] !== undefined) { let ipv4Piece = null; if (numbersSeen > 0) { if (input[pointer] === p(".") && numbersSeen < 4) { ++pointer; } else { return failure; } } if (!infra.isASCIIDigit(input[pointer])) { return failure; } while (infra.isASCIIDigit(input[pointer])) { const number = parseInt(at(input, pointer)); if (ipv4Piece === null) { ipv4Piece = number; } else if (ipv4Piece === 0) { return failure; } else { ipv4Piece = ipv4Piece * 10 + number; } if (ipv4Piece > 255) { return failure; } ++pointer; } address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece; ++numbersSeen; if (numbersSeen === 2 || numbersSeen === 4) { ++pieceIndex; } } if (numbersSeen !== 4) { return failure; } break; } else if (input[pointer] === p(":")) { ++pointer; if (input[pointer] === undefined) { return failure; } } else if (input[pointer] !== undefined) { return failure; } address[pieceIndex] = value; ++pieceIndex; } if (compress !== null) { let swaps = pieceIndex - compress; pieceIndex = 7; while (pieceIndex !== 0 && swaps > 0) { const temp = address[compress + swaps - 1]; address[compress + swaps - 1] = address[pieceIndex]; address[pieceIndex] = temp; --pieceIndex; --swaps; } } else if (compress === null && pieceIndex !== 8) { return failure; } return address; } function serializeIPv6(address) { let output = ""; const compress = findTheIPv6AddressCompressedPieceIndex(address); let ignore0 = false; for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { if (ignore0 && address[pieceIndex] === 0) { continue; } else if (ignore0) { ignore0 = false; } if (compress === pieceIndex) { const separator = pieceIndex === 0 ? "::" : ":"; output += separator; ignore0 = true; continue; } output += address[pieceIndex].toString(16); if (pieceIndex !== 7) { output += ":"; } } return output; } function parseHost(input, isOpaque = false) { if (input[0] === "[") { if (input[input.length - 1] !== "]") { return failure; } return parseIPv6(input.substring(1, input.length - 1)); } if (isOpaque) { return parseOpaqueHost(input); } const domain = utf8DecodeWithoutBOM(percentDecodeString(input)); const asciiDomain = domainToASCII(domain); if (asciiDomain === failure) { return failure; } if (endsInANumber(asciiDomain)) { return parseIPv4(asciiDomain); } return asciiDomain; } function endsInANumber(input) { const parts = input.split("."); if (parts[parts.length - 1] === "") { if (parts.length === 1) { return false; } parts.pop(); } const last = parts[parts.length - 1]; if (parseIPv4Number(last) !== failure) { return true; } if (/^[0-9]+$/u.test(last)) { return true; } return false; } function parseOpaqueHost(input) { if (containsForbiddenHostCodePoint(input)) { return failure; } return utf8PercentEncodeString(input, isC0ControlPercentEncode); } function findTheIPv6AddressCompressedPieceIndex(address) { let longestIndex = null; let longestSize = 1; // only find elements > 1 let foundIndex = null; let foundSize = 0; for (let pieceIndex = 0; pieceIndex < address.length; ++pieceIndex) { if (address[pieceIndex] !== 0) { if (foundSize > longestSize) { longestIndex = foundIndex; longestSize = foundSize; } foundIndex = null; foundSize = 0; } else { if (foundIndex === null) { foundIndex = pieceIndex; } ++foundSize; } } if (foundSize > longestSize) { return foundIndex; } return longestIndex; } function serializeHost(host) { if (typeof host === "number") { return serializeIPv4(host); } // IPv6 serializer if (host instanceof Array) { return `[${serializeIPv6(host)}]`; } return host; } function domainToASCII(domain, beStrict = false) { const result = tr46.toASCII(domain, { checkHyphens: beStrict, checkBidi: true, checkJoiners: true, useSTD3ASCIIRules: beStrict, transitionalProcessing: false, verifyDNSLength: beStrict, ignoreInvalidPunycode: false }); if (result === null) { return failure; } if (!beStrict) { if (result === "") { return failure; } if (containsForbiddenDomainCodePoint(result)) { return failure; } } return result; } function trimControlChars(string) { // Avoid using regexp because of this V8 bug: https://issues.chromium.org/issues/42204424 let start = 0; let end = string.length; for (; start < end; ++start) { if (string.charCodeAt(start) > 0x20) { break; } } for (; end > start; --end) { if (string.charCodeAt(end - 1) > 0x20) { break; } } return string.substring(start, end); } function trimTabAndNewline(url) { return url.replace(/\u0009|\u000A|\u000D/ug, ""); } function shortenPath(url) { const { path } = url; if (path.length === 0) { return; } if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) { return; } path.pop(); } function includesCredentials(url) { return url.username !== "" || url.password !== ""; } function cannotHaveAUsernamePasswordPort(url) { return url.host === null || url.host === "" || url.scheme === "file"; } function hasAnOpaquePath(url) { return typeof url.path === "string"; } function isNormalizedWindowsDriveLetter(string) { return /^[A-Za-z]:$/u.test(string); } function URLStateMachine(input, base, encodingOverride, url, stateOverride) { this.pointer = 0; this.input = input; this.base = base || null; this.encodingOverride = encodingOverride || "utf-8"; this.stateOverride = stateOverride; this.url = url; this.failure = false; this.parseError = false; if (!this.url) { this.url = { scheme: "", username: "", password: "", host: null, port: null, path: [], query: null, fragment: null }; const res = trimControlChars(this.input); if (res !== this.input) { this.parseError = true; } this.input = res; } const res = trimTabAndNewline(this.input); if (res !== this.input) { this.parseError = true; } this.input = res; this.state = stateOverride || "scheme start"; this.buffer = ""; this.atFlag = false; this.arrFlag = false; this.passwordTokenSeenFlag = false; this.input = Array.from(this.input, c => c.codePointAt(0)); for (; this.pointer <= this.input.length; ++this.pointer) { const c = this.input[this.pointer]; const cStr = isNaN(c) ? undefined : String.fromCodePoint(c); // exec state machine const ret = this[`parse ${this.state}`](c, cStr); if (!ret) { break; // terminate algorithm } else if (ret === failure) { this.failure = true; break; } } } URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c, cStr) { if (infra.isASCIIAlpha(c)) { this.buffer += cStr.toLowerCase(); this.state = "scheme"; } else if (!this.stateOverride) { this.state = "no scheme"; --this.pointer; } else { this.parseError = true; return failure; } return true; }; URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) { if (infra.isASCIIAlphanumeric(c) || c === p("+") || c === p("-") || c === p(".")) { this.buffer += cStr.toLowerCase(); } else if (c === p(":")) { if (this.stateOverride) { if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { return false; } if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { return false; } if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") { return false; } if (this.url.scheme === "file" && this.url.host === "") { return false; } } this.url.scheme = this.buffer; if (this.stateOverride) { if (this.url.port === defaultPort(this.url.scheme)) { this.url.port = null; } return false; } this.buffer = ""; if (this.url.scheme === "file") { if (this.input[this.pointer + 1] !== p("/") || this.input[this.pointer + 2] !== p("/")) { this.parseError = true; } this.state = "file"; } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) { this.state = "special relative or authority"; } else if (isSpecial(this.url)) { this.state = "special authority slashes"; } else if (this.input[this.pointer + 1] === p("/")) { this.state = "path or authority"; ++this.pointer; } else { this.url.path = ""; this.state = "opaque path"; } } else if (!this.stateOverride) { this.buffer = ""; this.state = "no scheme"; this.pointer = -1; } else { this.parseError = true; return failure; } return true; }; URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) { if (this.base === null || (hasAnOpaquePath(this.base) && c !== p("#"))) { return failure; } else if (hasAnOpaquePath(this.base) && c === p("#")) { this.url.scheme = this.base.scheme; this.url.path = this.base.path; this.url.query = this.base.query; this.url.fragment = ""; this.state = "fragment"; } else if (this.base.scheme === "file") { this.state = "file"; --this.pointer; } else { this.state = "relative"; --this.pointer; } return true; }; URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c) { if (c === p("/") && this.input[this.pointer + 1] === p("/")) { this.state = "special authority ignore slashes"; ++this.pointer; } else { this.parseError = true; this.state = "relative"; --this.pointer; } return true; }; URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c) { if (c === p("/")) { this.state = "authority"; } else { this.state = "path"; --this.pointer; } return true; }; URLStateMachine.prototype["parse relative"] = function parseRelative(c) { this.url.scheme = this.base.scheme; if (c === p("/")) { this.state = "relative slash"; } else if (isSpecial(this.url) && c === p("\\")) { this.parseError = true; this.state = "relative slash"; } else { this.url.username = this.base.username; this.url.password = this.base.password; this.url.host = this.base.host; this.url.port = this.base.port; this.url.path = this.base.path.slice(); this.url.query = this.base.query; if (c === p("?")) { this.url.query = ""; this.state = "query"; } else if (c === p("#")) { this.url.fragment = ""; this.state = "fragment"; } else if (!isNaN(c)) { this.url.query = null; this.url.path.pop(); this.state = "path"; --this.pointer; } } return true; }; URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c) { if (isSpecial(this.url) && (c === p("/") || c === p("\\"))) { if (c === p("\\")) { this.parseError = true; } this.state = "special authority ignore slashes"; } else if (c === p("/")) { this.state = "authority"; } else { this.url.username = this.base.username; this.url.password = this.base.password; this.url.host = this.base.host; this.url.port = this.base.port; this.state = "path"; --this.pointer; } return true; }; URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c) { if (c === p("/") && this.input[this.pointer + 1] === p("/")) { this.state = "special authority ignore slashes"; ++this.pointer; } else { this.parseError = true; this.state = "special authority ignore slashes"; --this.pointer; } return true; }; URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c) { if (c !== p("/") && c !== p("\\")) { this.state = "authority"; --this.pointer; } else { this.parseError = true; } return true; }; URLStateMachine.prototype["parse authority"] = function parseAuthority(c, cStr) { if (c === p("@")) { this.parseError = true; if (this.atFlag) { this.buffer = `%40${this.buffer}`; } this.atFlag = true; // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars const len = countSymbols(this.buffer); for (let pointer = 0; pointer < len; ++pointer) { const codePoint = this.buffer.codePointAt(pointer); if (codePoint === p(":") && !this.passwordTokenSeenFlag) { this.passwordTokenSeenFlag = true; continue; } const encodedCodePoints = utf8PercentEncodeCodePoint(codePoint, isUserinfoPercentEncode); if (this.passwordTokenSeenFlag) { this.url.password += encodedCodePoints; } else { this.url.username += encodedCodePoints; } } this.buffer = ""; } else if (isNaN(c) || c === p("/") || c === p("?") || c === p("#") || (isSpecial(this.url) && c === p("\\"))) { if (this.atFlag && this.buffer === "") { this.parseError = true; return failure; } this.pointer -= countSymbols(this.buffer) + 1; this.buffer = ""; this.state = "host"; } else { this.buffer += cStr; } return true; }; URLStateMachine.prototype["parse hostname"] = URLStateMachine.prototype["parse host"] = function parseHostName(c, cStr) { if (this.stateOverride && this.url.scheme === "file") { --this.pointer; this.state = "file host"; } else if (c === p(":") && !this.arrFlag) { if (this.buffer === "") { this.parseError = true; return failure; } if (this.stateOverride === "hostname") { return false; } const host = parseHost(this.buffer, isNotSpecial(this.url)); if (host === failure) { return failure; } this.url.host = host; this.buffer = ""; this.state = "port"; } else if (isNaN(c) || c === p("/") || c === p("?") || c === p("#") || (isSpecial(this.url) && c === p("\\"))) { --this.pointer; if (isSpecial(this.url) && this.buffer === "") { this.parseError = true; return failure; } else if (this.stateOverride && this.buffer === "" && (includesCredentials(this.url) || this.url.port !== null)) { this.parseError = true; return false; } const host = parseHost(this.buffer, isNotSpecial(this.url)); if (host === failure) { return failure; } this.url.host = host; this.buffer = ""; this.state = "path start"; if (this.stateOverride) { return false; } } else { if (c === p("[")) { this.arrFlag = true; } else if (c === p("]")) { this.arrFlag = false; } this.buffer += cStr; } return true; }; URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) { if (infra.isASCIIDigit(c)) { this.buffer += cStr; } else if (isNaN(c) || c === p("/") || c === p("?") || c === p("#") || (isSpecial(this.url) && c === p("\\")) || this.stateOverride) { if (this.buffer !== "") { const port = parseInt(this.buffer); if (port > 2 ** 16 - 1) { this.parseError = true; return failure; } this.url.port = port === defaultPort(this.url.scheme) ? null : port; this.buffer = ""; } if (this.stateOverride) { return false; } this.state = "path start"; --this.pointer; } else { this.parseError = true; return failure; } return true; }; const fileOtherwiseCodePoints = new Set([p("/"), p("\\"), p("?"), p("#")]); function startsWithWindowsDriveLetter(input, pointer) { const length = input.length - pointer; return length >= 2 && isWindowsDriveLetterCodePoints(input[pointer], input[pointer + 1]) && (length === 2 || fileOtherwiseCodePoints.has(input[pointer + 2])); } URLStateMachine.prototype["parse file"] = function parseFile(c) { this.url.scheme = "file"; this.url.host = ""; if (c === p("/") || c === p("\\")) { if (c === p("\\")) { this.parseError = true; } this.state = "file slash"; } else if (this.base !== null && this.base.scheme === "file") { this.url.host = this.base.host; this.url.path = this.base.path.slice(); this.url.query = this.base.query; if (c === p("?")) { this.url.query = ""; this.state = "query"; } else if (c === p("#")) { this.url.fragment = ""; this.state = "fragment"; } else if (!isNaN(c)) { this.url.query = null; if (!startsWithWindowsDriveLetter(this.input, this.pointer)) { shortenPath(this.url); } else { this.parseError = true; this.url.path = []; } this.state = "path"; --this.pointer; } } else { this.state = "path"; --this.pointer; } return true; }; URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) { if (c === p("/") || c === p("\\")) { if (c === p("\\")) { this.parseError = true; } this.state = "file host"; } else { if (this.base !== null && this.base.scheme === "file") { if (!startsWithWindowsDriveLetter(this.input, this.pointer) && isNormalizedWindowsDriveLetterString(this.base.path[0])) { this.url.path.push(this.base.path[0]); } this.url.host = this.base.host; } this.state = "path"; --this.pointer; } return true; }; URLStateMachine.prototype["parse file host"] = function parseFileHost(c, cStr) { if (isNaN(c) || c === p("/") || c === p("\\") || c === p("?") || c === p("#")) { --this.pointer; if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { this.parseError = true; this.state = "path"; } else if (this.buffer === "") { this.url.host = ""; if (this.stateOverride) { return false; } this.state = "path start"; } else { let host = parseHost(this.buffer, isNotSpecial(this.url)); if (host === failure) { return failure; } if (host === "localhost") { host = ""; } this.url.host = host; if (this.stateOverride) { return false; } this.buffer = ""; this.state = "path start"; } } else { this.buffer += cStr; } return true; }; URLStateMachine.prototype["parse path start"] = function parsePathStart(c) { if (isSpecial(this.url)) { if (c === p("\\")) { this.parseError = true; } this.state = "path"; if (c !== p("/") && c !== p("\\")) { --this.pointer; } } else if (!this.stateOverride && c === p("?")) { this.url.query = ""; this.state = "query"; } else if (!this.stateOverride && c === p("#")) { this.url.fragment = ""; this.state = "fragment"; } else if (c !== undefined) { this.state = "path"; if (c !== p("/")) { --this.pointer; } } else if (this.stateOverride && this.url.host === null) { this.url.path.push(""); } return true; }; URLStateMachine.prototype["parse path"] = function parsePath(c) { if (isNaN(c) || c === p("/") || (isSpecial(this.url) && c === p("\\")) || (!this.stateOverride && (c === p("?") || c === p("#")))) { if (isSpecial(this.url) && c === p("\\")) { this.parseError = true; } if (isDoubleDot(this.buffer)) { shortenPath(this.url); if (c !== p("/") && !(isSpecial(this.url) && c === p("\\"))) { this.url.path.push(""); } } else if (isSingleDot(this.buffer) && c !== p("/") && !(isSpecial(this.url) && c === p("\\"))) { this.url.path.push(""); } else if (!isSingleDot(this.buffer)) { if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { this.buffer = `${this.buffer[0]}:`; } this.url.path.push(this.buffer); } this.buffer = ""; if (c === p("?")) { this.url.query = ""; this.state = "query"; } if (c === p("#")) { this.url.fragment = ""; this.state = "fragment"; } } else { // TODO: If c is not a URL code point and not "%", parse error. if (c === p("%") && (!infra.isASCIIHex(this.input[this.pointer + 1]) || !infra.isASCIIHex(this.input[this.pointer + 2]))) { this.parseError = true; } this.buffer += utf8PercentEncodeCodePoint(c, isPathPercentEncode); } return true; }; URLStateMachine.prototype["parse opaque path"] = function parseOpaquePath(c) { if (c === p("?")) { this.url.query = ""; this.state = "query"; } else if (c === p("#")) { this.url.fragment = ""; this.state = "fragment"; } else if (c === p(" ")) { const remaining = this.input[this.pointer + 1]; if (remaining === p("?") || remaining === p("#")) { this.url.path += "%20"; } else { this.url.path += " "; } } else { // TODO: Add: not a URL code point if (!isNaN(c) && c !== p("%")) { this.parseError = true; } if (c === p("%") && (!infra.isASCIIHex(this.input[this.pointer + 1]) || !infra.isASCIIHex(this.input[this.pointer + 2]))) { this.parseError = true; } if (!isNaN(c)) { this.url.path += utf8PercentEncodeCodePoint(c, isC0ControlPercentEncode); } } return true; }; URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) { if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { this.encodingOverride = "utf-8"; } if ((!this.stateOverride && c === p("#")) || isNaN(c)) { const queryPercentEncodePredicate = isSpecial(this.url) ? isSpecialQueryPercentEncode : isQueryPercentEncode; this.url.query += utf8PercentEncodeString(this.buffer, queryPercentEncodePredicate); this.buffer = ""; if (c === p("#")) { this.url.fragment = ""; this.state = "fragment"; } } else if (!isNaN(c)) { // TODO: If c is not a URL code point and not "%", parse error. if (c === p("%") && (!infra.isASCIIHex(this.input[this.pointer + 1]) || !infra.isASCIIHex(this.input[this.pointer + 2]))) { this.parseError = true; } this.buffer += cStr; } return true; }; URLStateMachine.prototype["parse fragment"] = function parseFragment(c) { if (!isNaN(c)) { // TODO: If c is not a URL code point and not "%", parse error. if (c === p("%") && (!infra.isASCIIHex(this.input[this.pointer + 1]) || !infra.isASCIIHex(this.input[this.pointer + 2]))) { this.parseError = true; } this.url.fragment += utf8PercentEncodeCodePoint(c, isFragmentPercentEncode); } return true; }; function serializeURL(url, excludeFragment) { let output = `${url.scheme}:`; if (url.host !== null) { output += "//"; if (url.username !== "" || url.password !== "") { output += url.username; if (url.password !== "") { output += `:${url.password}`; } output += "@"; } output += serializeHost(url.host); if (url.port !== null) { output += `:${url.port}`; } } if (url.host === null && !hasAnOpaquePath(url) && url.path.length > 1 && url.path[0] === "") { output += "/."; } output += serializePath(url); if (url.query !== null) { output += `?${url.query}`; } if (!excludeFragment && url.fragment !== null) { output += `#${url.fragment}`; } return output; } function serializeOrigin(tuple) { let result = `${tuple.scheme}://`; result += serializeHost(tuple.host); if (tuple.port !== null) { result += `:${tuple.port}`; } return result; } function serializePath(url) { if (hasAnOpaquePath(url)) { return url.path; } let output = ""; for (const segment of url.path) { output += `/${segment}`; } return output; } module.exports.serializeURL = serializeURL; module.exports.serializePath = serializePath; module.exports.serializeURLOrigin = function (url) { // https://url.spec.whatwg.org/#concept-url-origin switch (url.scheme) { case "blob": { const pathURL = module.exports.parseURL(serializePath(url)); if (pathURL === null) { return "null"; } if (pathURL.scheme !== "http" && pathURL.scheme !== "https") { return "null"; } return module.exports.serializeURLOrigin(pathURL); } case "ftp": case "http": case "https": case "ws": case "wss": return serializeOrigin({ scheme: url.scheme, host: url.host, port: url.port }); case "file": // The spec says: // > Unfortunate as it is, this is left as an exercise to the reader. When in doubt, return a new opaque origin. // Browsers tested so far: // - Chrome says "file://", but treats file: URLs as cross-origin for most (all?) purposes; see e.g. // https://bugs.chromium.org/p/chromium/issues/detail?id=37586 // - Firefox says "null", but treats file: URLs as same-origin sometimes based on directory stuff; see // https://developer.mozilla.org/en-US/docs/Archive/Misc_top_level/Same-origin_policy_for_file:_URIs return "null"; default: // serializing an opaque origin returns "null" return "null"; } }; module.exports.basicURLParse = function (input, options) { if (options === undefined) { options = {}; } const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride); if (usm.failure) { return null; } return usm.url; }; module.exports.setTheUsername = function (url, username) { url.username = utf8PercentEncodeString(username, isUserinfoPercentEncode); }; module.exports.setThePassword = function (url, password) { url.password = utf8PercentEncodeString(password, isUserinfoPercentEncode); }; module.exports.serializeHost = serializeHost; module.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort; module.exports.hasAnOpaquePath = hasAnOpaquePath; module.exports.serializeInteger = function (integer) { return String(integer); }; module.exports.parseURL = function (input, options) { if (options === undefined) { options = {}; } // We don't handle blobs, so this just delegates: return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); }; /***/ }), /***/ 6367: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { utf8Encode, utf8DecodeWithoutBOM } = __nccwpck_require__(4887); const { percentDecodeBytes, utf8PercentEncodeString, isURLEncodedPercentEncode } = __nccwpck_require__(687); function p(char) { return char.codePointAt(0); } // https://url.spec.whatwg.org/#concept-urlencoded-parser function parseUrlencoded(input) { const sequences = strictlySplitByteSequence(input, p("&")); const output = []; for (const bytes of sequences) { if (bytes.length === 0) { continue; } let name, value; const indexOfEqual = bytes.indexOf(p("=")); if (indexOfEqual >= 0) { name = bytes.slice(0, indexOfEqual); value = bytes.slice(indexOfEqual + 1); } else { name = bytes; value = new Uint8Array(0); } name = replaceByteInByteSequence(name, 0x2B, 0x20); value = replaceByteInByteSequence(value, 0x2B, 0x20); const nameString = utf8DecodeWithoutBOM(percentDecodeBytes(name)); const valueString = utf8DecodeWithoutBOM(percentDecodeBytes(value)); output.push([nameString, valueString]); } return output; } // https://url.spec.whatwg.org/#concept-urlencoded-string-parser function parseUrlencodedString(input) { return parseUrlencoded(utf8Encode(input)); } // https://url.spec.whatwg.org/#concept-urlencoded-serializer function serializeUrlencoded(tuples) { // TODO: accept and use encoding argument let output = ""; for (const [i, tuple] of tuples.entries()) { const name = utf8PercentEncodeString(tuple[0], isURLEncodedPercentEncode, true); const value = utf8PercentEncodeString(tuple[1], isURLEncodedPercentEncode, true); if (i !== 0) { output += "&"; } output += `${name}=${value}`; } return output; } function strictlySplitByteSequence(buf, cp) { const list = []; let last = 0; let i = buf.indexOf(cp); while (i >= 0) { list.push(buf.slice(last, i)); last = i + 1; i = buf.indexOf(cp, last); } if (last !== buf.length) { list.push(buf.slice(last)); } return list; } function replaceByteInByteSequence(buf, from, to) { let i = buf.indexOf(from); while (i >= 0) { buf[i] = to; i = buf.indexOf(from, i + 1); } return buf; } module.exports = { parseUrlencodedString, serializeUrlencoded }; /***/ }), /***/ 9857: /***/ ((module, exports) => { // Returns "Type(value) is Object" in ES terminology. function isObject(value) { return (typeof value === "object" && value !== null) || typeof value === "function"; } const hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty); // Like `Object.assign`, but using `[[GetOwnProperty]]` and `[[DefineOwnProperty]]` // instead of `[[Get]]` and `[[Set]]` and only allowing objects function define(target, source) { for (const key of Reflect.ownKeys(source)) { const descriptor = Reflect.getOwnPropertyDescriptor(source, key); if (descriptor && !Reflect.defineProperty(target, key, descriptor)) { throw new TypeError(`Cannot redefine property: ${String(key)}`); } } } function newObjectInRealm(globalObject, object) { const ctorRegistry = initCtorRegistry(globalObject); return Object.defineProperties( Object.create(ctorRegistry["%Object.prototype%"]), Object.getOwnPropertyDescriptors(object) ); } const wrapperSymbol = Symbol("wrapper"); const implSymbol = Symbol("impl"); const sameObjectCaches = Symbol("SameObject caches"); const ctorRegistrySymbol = Symbol.for("[webidl2js] constructor registry"); const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(async function* () {}).prototype); function initCtorRegistry(globalObject) { if (hasOwn(globalObject, ctorRegistrySymbol)) { return globalObject[ctorRegistrySymbol]; } const ctorRegistry = Object.create(null); // In addition to registering all the WebIDL2JS-generated types in the constructor registry, // we also register a few intrinsics that we make use of in generated code, since they are not // easy to grab from the globalObject variable. ctorRegistry["%Object.prototype%"] = globalObject.Object.prototype; ctorRegistry["%IteratorPrototype%"] = Object.getPrototypeOf( Object.getPrototypeOf(new globalObject.Array()[Symbol.iterator]()) ); try { ctorRegistry["%AsyncIteratorPrototype%"] = Object.getPrototypeOf( Object.getPrototypeOf( globalObject.eval("(async function* () {})").prototype ) ); } catch { ctorRegistry["%AsyncIteratorPrototype%"] = AsyncIteratorPrototype; } globalObject[ctorRegistrySymbol] = ctorRegistry; return ctorRegistry; } function getSameObject(wrapper, prop, creator) { if (!wrapper[sameObjectCaches]) { wrapper[sameObjectCaches] = Object.create(null); } if (prop in wrapper[sameObjectCaches]) { return wrapper[sameObjectCaches][prop]; } wrapper[sameObjectCaches][prop] = creator(); return wrapper[sameObjectCaches][prop]; } function wrapperForImpl(impl) { return impl ? impl[wrapperSymbol] : null; } function implForWrapper(wrapper) { return wrapper ? wrapper[implSymbol] : null; } function tryWrapperForImpl(impl) { const wrapper = wrapperForImpl(impl); return wrapper ? wrapper : impl; } function tryImplForWrapper(wrapper) { const impl = implForWrapper(wrapper); return impl ? impl : wrapper; } const iterInternalSymbol = Symbol("internal"); function isArrayIndexPropName(P) { if (typeof P !== "string") { return false; } const i = P >>> 0; if (i === 2 ** 32 - 1) { return false; } const s = `${i}`; if (P !== s) { return false; } return true; } const byteLengthGetter = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get; function isArrayBuffer(value) { try { byteLengthGetter.call(value); return true; } catch (e) { return false; } } function iteratorResult([key, value], kind) { let result; switch (kind) { case "key": result = key; break; case "value": result = value; break; case "key+value": result = [key, value]; break; } return { value: result, done: false }; } const supportsPropertyIndex = Symbol("supports property index"); const supportedPropertyIndices = Symbol("supported property indices"); const supportsPropertyName = Symbol("supports property name"); const supportedPropertyNames = Symbol("supported property names"); const indexedGet = Symbol("indexed property get"); const indexedSetNew = Symbol("indexed property set new"); const indexedSetExisting = Symbol("indexed property set existing"); const namedGet = Symbol("named property get"); const namedSetNew = Symbol("named property set new"); const namedSetExisting = Symbol("named property set existing"); const namedDelete = Symbol("named property delete"); const asyncIteratorNext = Symbol("async iterator get the next iteration result"); const asyncIteratorReturn = Symbol("async iterator return steps"); const asyncIteratorInit = Symbol("async iterator initialization steps"); const asyncIteratorEOI = Symbol("async iterator end of iteration"); module.exports = exports = { isObject, hasOwn, define, newObjectInRealm, wrapperSymbol, implSymbol, getSameObject, ctorRegistrySymbol, initCtorRegistry, wrapperForImpl, implForWrapper, tryWrapperForImpl, tryImplForWrapper, iterInternalSymbol, isArrayBuffer, isArrayIndexPropName, supportsPropertyIndex, supportedPropertyIndices, supportsPropertyName, supportedPropertyNames, indexedGet, indexedSetNew, indexedSetExisting, namedGet, namedSetNew, namedSetExisting, namedDelete, asyncIteratorNext, asyncIteratorReturn, asyncIteratorInit, asyncIteratorEOI, iteratorResult }; /***/ }), /***/ 4108: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { const URL = __nccwpck_require__(6633); const URLSearchParams = __nccwpck_require__(3627); exports.URL = URL; exports.URLSearchParams = URLSearchParams; /***/ }), /***/ 4768: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var forEach = __nccwpck_require__(4963); var availableTypedArrays = __nccwpck_require__(1506); var callBind = __nccwpck_require__(3844); var callBound = __nccwpck_require__(3105); var gOPD = __nccwpck_require__(3170); var getProto = __nccwpck_require__(1967); var $toString = callBound('Object.prototype.toString'); var hasToStringTag = __nccwpck_require__(5479)(); var g = typeof globalThis === 'undefined' ? global : globalThis; var typedArrays = availableTypedArrays(); var $slice = callBound('String.prototype.slice'); /** @type {(array: readonly T[], value: unknown) => number} */ var $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) { for (var i = 0; i < array.length; i += 1) { if (array[i] === value) { return i; } } return -1; }; /** @typedef {import('./types').Getter} Getter */ /** @type {import('./types').Cache} */ var cache = { __proto__: null }; if (hasToStringTag && gOPD && getProto) { forEach(typedArrays, function (typedArray) { var arr = new g[typedArray](); if (Symbol.toStringTag in arr && getProto) { var proto = getProto(arr); // @ts-expect-error TS won't narrow inside a closure var descriptor = gOPD(proto, Symbol.toStringTag); if (!descriptor && proto) { var superProto = getProto(proto); // @ts-expect-error TS won't narrow inside a closure descriptor = gOPD(superProto, Symbol.toStringTag); } // @ts-expect-error TODO: fix cache['$' + typedArray] = callBind(descriptor.get); } }); } else { forEach(typedArrays, function (typedArray) { var arr = new g[typedArray](); var fn = arr.slice || arr.set; if (fn) { cache[ /** @type {`$${import('.').TypedArrayName}`} */ ('$' + typedArray) ] = /** @type {import('./types').BoundSlice | import('./types').BoundSet} */ ( // @ts-expect-error TODO FIXME callBind(fn) ); } }); } /** @type {(value: object) => false | import('.').TypedArrayName} */ var tryTypedArrays = function tryAllTypedArrays(value) { /** @type {ReturnType} */ var found = false; forEach( /** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */ (cache), /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */ function (getter, typedArray) { if (!found) { try { // @ts-expect-error a throw is fine here if ('$' + getter(value) === typedArray) { found = /** @type {import('.').TypedArrayName} */ ($slice(typedArray, 1)); } } catch (e) { /**/ } } } ); return found; }; /** @type {(value: object) => false | import('.').TypedArrayName} */ var trySlices = function tryAllSlices(value) { /** @type {ReturnType} */ var found = false; forEach( /** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */(cache), /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */ function (getter, name) { if (!found) { try { // @ts-expect-error a throw is fine here getter(value); found = /** @type {import('.').TypedArrayName} */ ($slice(name, 1)); } catch (e) { /**/ } } } ); return found; }; /** @type {import('.')} */ module.exports = function whichTypedArray(value) { if (!value || typeof value !== 'object') { return false; } if (!hasToStringTag) { /** @type {string} */ var tag = $slice($toString(value), 8, -1); if ($indexOf(typedArrays, tag) > -1) { return tag; } if (tag !== 'Object') { return false; } // node < 0.6 hits here on real Typed Arrays return trySlices(value); } if (!gOPD) { return null; } // unknown engine return tryTypedArrays(value); }; /***/ }), /***/ 8264: /***/ ((module) => { // Returns a wrapper function that returns a wrapped callback // The wrapper function should do some stuff, and return a // presumably different callback function. // This makes sure that own properties are retained, so that // decorations and such are not lost along the way. module.exports = wrappy function wrappy (fn, cb) { if (fn && cb) return wrappy(fn)(cb) if (typeof fn !== 'function') throw new TypeError('need wrapper function') Object.keys(fn).forEach(function (k) { wrapper[k] = fn[k] }) return wrapper function wrapper() { var args = new Array(arguments.length) for (var i = 0; i < args.length; i++) { args[i] = arguments[i] } var ret = fn.apply(this, args) var cb = args[args.length-1] if (typeof ret === 'function' && ret !== cb) { Object.keys(cb).forEach(function (k) { ret[k] = cb[k] }) } return ret } } /***/ }), /***/ 869: /***/ ((module) => { module.exports = extend var hasOwnProperty = Object.prototype.hasOwnProperty; function extend() { var target = {} for (var i = 0; i < arguments.length; i++) { var source = arguments[i] for (var key in source) { if (hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target } /***/ }), /***/ 663: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { var fs = __nccwpck_require__(9896); var zlib = __nccwpck_require__(3106); var fd_slicer = __nccwpck_require__(3045); var crc32 = __nccwpck_require__(9776); var util = __nccwpck_require__(9023); var EventEmitter = (__nccwpck_require__(4434).EventEmitter); var Transform = (__nccwpck_require__(2203).Transform); var PassThrough = (__nccwpck_require__(2203).PassThrough); var Writable = (__nccwpck_require__(2203).Writable); exports.open = open; exports.fromFd = fromFd; exports.fromBuffer = fromBuffer; exports.fromRandomAccessReader = fromRandomAccessReader; exports.dosDateTimeToDate = dosDateTimeToDate; exports.validateFileName = validateFileName; exports.ZipFile = ZipFile; exports.Entry = Entry; exports.RandomAccessReader = RandomAccessReader; function open(path, options, callback) { if (typeof options === "function") { callback = options; options = null; } if (options == null) options = {}; if (options.autoClose == null) options.autoClose = true; if (options.lazyEntries == null) options.lazyEntries = false; if (options.decodeStrings == null) options.decodeStrings = true; if (options.validateEntrySizes == null) options.validateEntrySizes = true; if (options.strictFileNames == null) options.strictFileNames = false; if (callback == null) callback = defaultCallback; fs.open(path, "r", function(err, fd) { if (err) return callback(err); fromFd(fd, options, function(err, zipfile) { if (err) fs.close(fd, defaultCallback); callback(err, zipfile); }); }); } function fromFd(fd, options, callback) { if (typeof options === "function") { callback = options; options = null; } if (options == null) options = {}; if (options.autoClose == null) options.autoClose = false; if (options.lazyEntries == null) options.lazyEntries = false; if (options.decodeStrings == null) options.decodeStrings = true; if (options.validateEntrySizes == null) options.validateEntrySizes = true; if (options.strictFileNames == null) options.strictFileNames = false; if (callback == null) callback = defaultCallback; fs.fstat(fd, function(err, stats) { if (err) return callback(err); var reader = fd_slicer.createFromFd(fd, {autoClose: true}); fromRandomAccessReader(reader, stats.size, options, callback); }); } function fromBuffer(buffer, options, callback) { if (typeof options === "function") { callback = options; options = null; } if (options == null) options = {}; options.autoClose = false; if (options.lazyEntries == null) options.lazyEntries = false; if (options.decodeStrings == null) options.decodeStrings = true; if (options.validateEntrySizes == null) options.validateEntrySizes = true; if (options.strictFileNames == null) options.strictFileNames = false; // limit the max chunk size. see https://github.com/thejoshwolfe/yauzl/issues/87 var reader = fd_slicer.createFromBuffer(buffer, {maxChunkSize: 0x10000}); fromRandomAccessReader(reader, buffer.length, options, callback); } function fromRandomAccessReader(reader, totalSize, options, callback) { if (typeof options === "function") { callback = options; options = null; } if (options == null) options = {}; if (options.autoClose == null) options.autoClose = true; if (options.lazyEntries == null) options.lazyEntries = false; if (options.decodeStrings == null) options.decodeStrings = true; var decodeStrings = !!options.decodeStrings; if (options.validateEntrySizes == null) options.validateEntrySizes = true; if (options.strictFileNames == null) options.strictFileNames = false; if (callback == null) callback = defaultCallback; if (typeof totalSize !== "number") throw new Error("expected totalSize parameter to be a number"); if (totalSize > Number.MAX_SAFE_INTEGER) { throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double."); } // the matching unref() call is in zipfile.close() reader.ref(); // eocdr means End of Central Directory Record. // search backwards for the eocdr signature. // the last field of the eocdr is a variable-length comment. // the comment size is encoded in a 2-byte field in the eocdr, which we can't find without trudging backwards through the comment to find it. // as a consequence of this design decision, it's possible to have ambiguous zip file metadata if a coherent eocdr was in the comment. // we search backwards for a eocdr signature, and hope that whoever made the zip file was smart enough to forbid the eocdr signature in the comment. var eocdrWithoutCommentSize = 22; var maxCommentSize = 0xffff; // 2-byte size var bufferSize = Math.min(eocdrWithoutCommentSize + maxCommentSize, totalSize); var buffer = newBuffer(bufferSize); var bufferReadStart = totalSize - buffer.length; readAndAssertNoEof(reader, buffer, 0, bufferSize, bufferReadStart, function(err) { if (err) return callback(err); for (var i = bufferSize - eocdrWithoutCommentSize; i >= 0; i -= 1) { if (buffer.readUInt32LE(i) !== 0x06054b50) continue; // found eocdr var eocdrBuffer = buffer.slice(i); // 0 - End of central directory signature = 0x06054b50 // 4 - Number of this disk var diskNumber = eocdrBuffer.readUInt16LE(4); if (diskNumber !== 0) { return callback(new Error("multi-disk zip files are not supported: found disk number: " + diskNumber)); } // 6 - Disk where central directory starts // 8 - Number of central directory records on this disk // 10 - Total number of central directory records var entryCount = eocdrBuffer.readUInt16LE(10); // 12 - Size of central directory (bytes) // 16 - Offset of start of central directory, relative to start of archive var centralDirectoryOffset = eocdrBuffer.readUInt32LE(16); // 20 - Comment length var commentLength = eocdrBuffer.readUInt16LE(20); var expectedCommentLength = eocdrBuffer.length - eocdrWithoutCommentSize; if (commentLength !== expectedCommentLength) { return callback(new Error("invalid comment length. expected: " + expectedCommentLength + ". found: " + commentLength)); } // 22 - Comment // the encoding is always cp437. var comment = decodeStrings ? decodeBuffer(eocdrBuffer, 22, eocdrBuffer.length, false) : eocdrBuffer.slice(22); if (!(entryCount === 0xffff || centralDirectoryOffset === 0xffffffff)) { return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames)); } // ZIP64 format // ZIP64 Zip64 end of central directory locator var zip64EocdlBuffer = newBuffer(20); var zip64EocdlOffset = bufferReadStart + i - zip64EocdlBuffer.length; readAndAssertNoEof(reader, zip64EocdlBuffer, 0, zip64EocdlBuffer.length, zip64EocdlOffset, function(err) { if (err) return callback(err); // 0 - zip64 end of central dir locator signature = 0x07064b50 if (zip64EocdlBuffer.readUInt32LE(0) !== 0x07064b50) { return callback(new Error("invalid zip64 end of central directory locator signature")); } // 4 - number of the disk with the start of the zip64 end of central directory // 8 - relative offset of the zip64 end of central directory record var zip64EocdrOffset = readUInt64LE(zip64EocdlBuffer, 8); // 16 - total number of disks // ZIP64 end of central directory record var zip64EocdrBuffer = newBuffer(56); readAndAssertNoEof(reader, zip64EocdrBuffer, 0, zip64EocdrBuffer.length, zip64EocdrOffset, function(err) { if (err) return callback(err); // 0 - zip64 end of central dir signature 4 bytes (0x06064b50) if (zip64EocdrBuffer.readUInt32LE(0) !== 0x06064b50) { return callback(new Error("invalid zip64 end of central directory record signature")); } // 4 - size of zip64 end of central directory record 8 bytes // 12 - version made by 2 bytes // 14 - version needed to extract 2 bytes // 16 - number of this disk 4 bytes // 20 - number of the disk with the start of the central directory 4 bytes // 24 - total number of entries in the central directory on this disk 8 bytes // 32 - total number of entries in the central directory 8 bytes entryCount = readUInt64LE(zip64EocdrBuffer, 32); // 40 - size of the central directory 8 bytes // 48 - offset of start of central directory with respect to the starting disk number 8 bytes centralDirectoryOffset = readUInt64LE(zip64EocdrBuffer, 48); // 56 - zip64 extensible data sector (variable size) return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames)); }); }); return; } callback(new Error("end of central directory record signature not found")); }); } util.inherits(ZipFile, EventEmitter); function ZipFile(reader, centralDirectoryOffset, fileSize, entryCount, comment, autoClose, lazyEntries, decodeStrings, validateEntrySizes, strictFileNames) { var self = this; EventEmitter.call(self); self.reader = reader; // forward close events self.reader.on("error", function(err) { // error closing the fd emitError(self, err); }); self.reader.once("close", function() { self.emit("close"); }); self.readEntryCursor = centralDirectoryOffset; self.fileSize = fileSize; self.entryCount = entryCount; self.comment = comment; self.entriesRead = 0; self.autoClose = !!autoClose; self.lazyEntries = !!lazyEntries; self.decodeStrings = !!decodeStrings; self.validateEntrySizes = !!validateEntrySizes; self.strictFileNames = !!strictFileNames; self.isOpen = true; self.emittedError = false; if (!self.lazyEntries) self._readEntry(); } ZipFile.prototype.close = function() { if (!this.isOpen) return; this.isOpen = false; this.reader.unref(); }; function emitErrorAndAutoClose(self, err) { if (self.autoClose) self.close(); emitError(self, err); } function emitError(self, err) { if (self.emittedError) return; self.emittedError = true; self.emit("error", err); } ZipFile.prototype.readEntry = function() { if (!this.lazyEntries) throw new Error("readEntry() called without lazyEntries:true"); this._readEntry(); }; ZipFile.prototype._readEntry = function() { var self = this; if (self.entryCount === self.entriesRead) { // done with metadata setImmediate(function() { if (self.autoClose) self.close(); if (self.emittedError) return; self.emit("end"); }); return; } if (self.emittedError) return; var buffer = newBuffer(46); readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) { if (err) return emitErrorAndAutoClose(self, err); if (self.emittedError) return; var entry = new Entry(); // 0 - Central directory file header signature var signature = buffer.readUInt32LE(0); if (signature !== 0x02014b50) return emitErrorAndAutoClose(self, new Error("invalid central directory file header signature: 0x" + signature.toString(16))); // 4 - Version made by entry.versionMadeBy = buffer.readUInt16LE(4); // 6 - Version needed to extract (minimum) entry.versionNeededToExtract = buffer.readUInt16LE(6); // 8 - General purpose bit flag entry.generalPurposeBitFlag = buffer.readUInt16LE(8); // 10 - Compression method entry.compressionMethod = buffer.readUInt16LE(10); // 12 - File last modification time entry.lastModFileTime = buffer.readUInt16LE(12); // 14 - File last modification date entry.lastModFileDate = buffer.readUInt16LE(14); // 16 - CRC-32 entry.crc32 = buffer.readUInt32LE(16); // 20 - Compressed size entry.compressedSize = buffer.readUInt32LE(20); // 24 - Uncompressed size entry.uncompressedSize = buffer.readUInt32LE(24); // 28 - File name length (n) entry.fileNameLength = buffer.readUInt16LE(28); // 30 - Extra field length (m) entry.extraFieldLength = buffer.readUInt16LE(30); // 32 - File comment length (k) entry.fileCommentLength = buffer.readUInt16LE(32); // 34 - Disk number where file starts // 36 - Internal file attributes entry.internalFileAttributes = buffer.readUInt16LE(36); // 38 - External file attributes entry.externalFileAttributes = buffer.readUInt32LE(38); // 42 - Relative offset of local file header entry.relativeOffsetOfLocalHeader = buffer.readUInt32LE(42); if (entry.generalPurposeBitFlag & 0x40) return emitErrorAndAutoClose(self, new Error("strong encryption is not supported")); self.readEntryCursor += 46; buffer = newBuffer(entry.fileNameLength + entry.extraFieldLength + entry.fileCommentLength); readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) { if (err) return emitErrorAndAutoClose(self, err); if (self.emittedError) return; // 46 - File name var isUtf8 = (entry.generalPurposeBitFlag & 0x800) !== 0; entry.fileName = self.decodeStrings ? decodeBuffer(buffer, 0, entry.fileNameLength, isUtf8) : buffer.slice(0, entry.fileNameLength); // 46+n - Extra field var fileCommentStart = entry.fileNameLength + entry.extraFieldLength; var extraFieldBuffer = buffer.slice(entry.fileNameLength, fileCommentStart); entry.extraFields = []; var i = 0; while (i < extraFieldBuffer.length - 3) { var headerId = extraFieldBuffer.readUInt16LE(i + 0); var dataSize = extraFieldBuffer.readUInt16LE(i + 2); var dataStart = i + 4; var dataEnd = dataStart + dataSize; if (dataEnd > extraFieldBuffer.length) return emitErrorAndAutoClose(self, new Error("extra field length exceeds extra field buffer size")); var dataBuffer = newBuffer(dataSize); extraFieldBuffer.copy(dataBuffer, 0, dataStart, dataEnd); entry.extraFields.push({ id: headerId, data: dataBuffer, }); i = dataEnd; } // 46+n+m - File comment entry.fileComment = self.decodeStrings ? decodeBuffer(buffer, fileCommentStart, fileCommentStart + entry.fileCommentLength, isUtf8) : buffer.slice(fileCommentStart, fileCommentStart + entry.fileCommentLength); // compatibility hack for https://github.com/thejoshwolfe/yauzl/issues/47 entry.comment = entry.fileComment; self.readEntryCursor += buffer.length; self.entriesRead += 1; if (entry.uncompressedSize === 0xffffffff || entry.compressedSize === 0xffffffff || entry.relativeOffsetOfLocalHeader === 0xffffffff) { // ZIP64 format // find the Zip64 Extended Information Extra Field var zip64EiefBuffer = null; for (var i = 0; i < entry.extraFields.length; i++) { var extraField = entry.extraFields[i]; if (extraField.id === 0x0001) { zip64EiefBuffer = extraField.data; break; } } if (zip64EiefBuffer == null) { return emitErrorAndAutoClose(self, new Error("expected zip64 extended information extra field")); } var index = 0; // 0 - Original Size 8 bytes if (entry.uncompressedSize === 0xffffffff) { if (index + 8 > zip64EiefBuffer.length) { return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include uncompressed size")); } entry.uncompressedSize = readUInt64LE(zip64EiefBuffer, index); index += 8; } // 8 - Compressed Size 8 bytes if (entry.compressedSize === 0xffffffff) { if (index + 8 > zip64EiefBuffer.length) { return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include compressed size")); } entry.compressedSize = readUInt64LE(zip64EiefBuffer, index); index += 8; } // 16 - Relative Header Offset 8 bytes if (entry.relativeOffsetOfLocalHeader === 0xffffffff) { if (index + 8 > zip64EiefBuffer.length) { return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include relative header offset")); } entry.relativeOffsetOfLocalHeader = readUInt64LE(zip64EiefBuffer, index); index += 8; } // 24 - Disk Start Number 4 bytes } // check for Info-ZIP Unicode Path Extra Field (0x7075) // see https://github.com/thejoshwolfe/yauzl/issues/33 if (self.decodeStrings) { for (var i = 0; i < entry.extraFields.length; i++) { var extraField = entry.extraFields[i]; if (extraField.id === 0x7075) { if (extraField.data.length < 6) { // too short to be meaningful continue; } // Version 1 byte version of this extra field, currently 1 if (extraField.data.readUInt8(0) !== 1) { // > Changes may not be backward compatible so this extra // > field should not be used if the version is not recognized. continue; } // NameCRC32 4 bytes File Name Field CRC32 Checksum var oldNameCrc32 = extraField.data.readUInt32LE(1); if (crc32.unsigned(buffer.slice(0, entry.fileNameLength)) !== oldNameCrc32) { // > If the CRC check fails, this UTF-8 Path Extra Field should be // > ignored and the File Name field in the header should be used instead. continue; } // UnicodeName Variable UTF-8 version of the entry File Name entry.fileName = decodeBuffer(extraField.data, 5, extraField.data.length, true); break; } } } // validate file size if (self.validateEntrySizes && entry.compressionMethod === 0) { var expectedCompressedSize = entry.uncompressedSize; if (entry.isEncrypted()) { // traditional encryption prefixes the file data with a header expectedCompressedSize += 12; } if (entry.compressedSize !== expectedCompressedSize) { var msg = "compressed/uncompressed size mismatch for stored file: " + entry.compressedSize + " != " + entry.uncompressedSize; return emitErrorAndAutoClose(self, new Error(msg)); } } if (self.decodeStrings) { if (!self.strictFileNames) { // allow backslash entry.fileName = entry.fileName.replace(/\\/g, "/"); } var errorMessage = validateFileName(entry.fileName, self.validateFileNameOptions); if (errorMessage != null) return emitErrorAndAutoClose(self, new Error(errorMessage)); } self.emit("entry", entry); if (!self.lazyEntries) self._readEntry(); }); }); }; ZipFile.prototype.openReadStream = function(entry, options, callback) { var self = this; // parameter validation var relativeStart = 0; var relativeEnd = entry.compressedSize; if (callback == null) { callback = options; options = {}; } else { // validate options that the caller has no excuse to get wrong if (options.decrypt != null) { if (!entry.isEncrypted()) { throw new Error("options.decrypt can only be specified for encrypted entries"); } if (options.decrypt !== false) throw new Error("invalid options.decrypt value: " + options.decrypt); if (entry.isCompressed()) { if (options.decompress !== false) throw new Error("entry is encrypted and compressed, and options.decompress !== false"); } } if (options.decompress != null) { if (!entry.isCompressed()) { throw new Error("options.decompress can only be specified for compressed entries"); } if (!(options.decompress === false || options.decompress === true)) { throw new Error("invalid options.decompress value: " + options.decompress); } } if (options.start != null || options.end != null) { if (entry.isCompressed() && options.decompress !== false) { throw new Error("start/end range not allowed for compressed entry without options.decompress === false"); } if (entry.isEncrypted() && options.decrypt !== false) { throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false"); } } if (options.start != null) { relativeStart = options.start; if (relativeStart < 0) throw new Error("options.start < 0"); if (relativeStart > entry.compressedSize) throw new Error("options.start > entry.compressedSize"); } if (options.end != null) { relativeEnd = options.end; if (relativeEnd < 0) throw new Error("options.end < 0"); if (relativeEnd > entry.compressedSize) throw new Error("options.end > entry.compressedSize"); if (relativeEnd < relativeStart) throw new Error("options.end < options.start"); } } // any further errors can either be caused by the zipfile, // or were introduced in a minor version of yauzl, // so should be passed to the client rather than thrown. if (!self.isOpen) return callback(new Error("closed")); if (entry.isEncrypted()) { if (options.decrypt !== false) return callback(new Error("entry is encrypted, and options.decrypt !== false")); } // make sure we don't lose the fd before we open the actual read stream self.reader.ref(); var buffer = newBuffer(30); readAndAssertNoEof(self.reader, buffer, 0, buffer.length, entry.relativeOffsetOfLocalHeader, function(err) { try { if (err) return callback(err); // 0 - Local file header signature = 0x04034b50 var signature = buffer.readUInt32LE(0); if (signature !== 0x04034b50) { return callback(new Error("invalid local file header signature: 0x" + signature.toString(16))); } // all this should be redundant // 4 - Version needed to extract (minimum) // 6 - General purpose bit flag // 8 - Compression method // 10 - File last modification time // 12 - File last modification date // 14 - CRC-32 // 18 - Compressed size // 22 - Uncompressed size // 26 - File name length (n) var fileNameLength = buffer.readUInt16LE(26); // 28 - Extra field length (m) var extraFieldLength = buffer.readUInt16LE(28); // 30 - File name // 30+n - Extra field var localFileHeaderEnd = entry.relativeOffsetOfLocalHeader + buffer.length + fileNameLength + extraFieldLength; var decompress; if (entry.compressionMethod === 0) { // 0 - The file is stored (no compression) decompress = false; } else if (entry.compressionMethod === 8) { // 8 - The file is Deflated decompress = options.decompress != null ? options.decompress : true; } else { return callback(new Error("unsupported compression method: " + entry.compressionMethod)); } var fileDataStart = localFileHeaderEnd; var fileDataEnd = fileDataStart + entry.compressedSize; if (entry.compressedSize !== 0) { // bounds check now, because the read streams will probably not complain loud enough. // since we're dealing with an unsigned offset plus an unsigned size, // we only have 1 thing to check for. if (fileDataEnd > self.fileSize) { return callback(new Error("file data overflows file bounds: " + fileDataStart + " + " + entry.compressedSize + " > " + self.fileSize)); } } var readStream = self.reader.createReadStream({ start: fileDataStart + relativeStart, end: fileDataStart + relativeEnd, }); var endpointStream = readStream; if (decompress) { var destroyed = false; var inflateFilter = zlib.createInflateRaw(); readStream.on("error", function(err) { // setImmediate here because errors can be emitted during the first call to pipe() setImmediate(function() { if (!destroyed) inflateFilter.emit("error", err); }); }); readStream.pipe(inflateFilter); if (self.validateEntrySizes) { endpointStream = new AssertByteCountStream(entry.uncompressedSize); inflateFilter.on("error", function(err) { // forward zlib errors to the client-visible stream setImmediate(function() { if (!destroyed) endpointStream.emit("error", err); }); }); inflateFilter.pipe(endpointStream); } else { // the zlib filter is the client-visible stream endpointStream = inflateFilter; } // this is part of yauzl's API, so implement this function on the client-visible stream endpointStream.destroy = function() { destroyed = true; if (inflateFilter !== endpointStream) inflateFilter.unpipe(endpointStream); readStream.unpipe(inflateFilter); // TODO: the inflateFilter may cause a memory leak. see Issue #27. readStream.destroy(); }; } callback(null, endpointStream); } finally { self.reader.unref(); } }); }; function Entry() { } Entry.prototype.getLastModDate = function() { return dosDateTimeToDate(this.lastModFileDate, this.lastModFileTime); }; Entry.prototype.isEncrypted = function() { return (this.generalPurposeBitFlag & 0x1) !== 0; }; Entry.prototype.isCompressed = function() { return this.compressionMethod === 8; }; function dosDateTimeToDate(date, time) { var day = date & 0x1f; // 1-31 var month = (date >> 5 & 0xf) - 1; // 1-12, 0-11 var year = (date >> 9 & 0x7f) + 1980; // 0-128, 1980-2108 var millisecond = 0; var second = (time & 0x1f) * 2; // 0-29, 0-58 (even numbers) var minute = time >> 5 & 0x3f; // 0-59 var hour = time >> 11 & 0x1f; // 0-23 return new Date(year, month, day, hour, minute, second, millisecond); } function validateFileName(fileName) { if (fileName.indexOf("\\") !== -1) { return "invalid characters in fileName: " + fileName; } if (/^[a-zA-Z]:/.test(fileName) || /^\//.test(fileName)) { return "absolute path: " + fileName; } if (fileName.split("/").indexOf("..") !== -1) { return "invalid relative path: " + fileName; } // all good return null; } function readAndAssertNoEof(reader, buffer, offset, length, position, callback) { if (length === 0) { // fs.read will throw an out-of-bounds error if you try to read 0 bytes from a 0 byte file return setImmediate(function() { callback(null, newBuffer(0)); }); } reader.read(buffer, offset, length, position, function(err, bytesRead) { if (err) return callback(err); if (bytesRead < length) { return callback(new Error("unexpected EOF")); } callback(); }); } util.inherits(AssertByteCountStream, Transform); function AssertByteCountStream(byteCount) { Transform.call(this); this.actualByteCount = 0; this.expectedByteCount = byteCount; } AssertByteCountStream.prototype._transform = function(chunk, encoding, cb) { this.actualByteCount += chunk.length; if (this.actualByteCount > this.expectedByteCount) { var msg = "too many bytes in the stream. expected " + this.expectedByteCount + ". got at least " + this.actualByteCount; return cb(new Error(msg)); } cb(null, chunk); }; AssertByteCountStream.prototype._flush = function(cb) { if (this.actualByteCount < this.expectedByteCount) { var msg = "not enough bytes in the stream. expected " + this.expectedByteCount + ". got only " + this.actualByteCount; return cb(new Error(msg)); } cb(); }; util.inherits(RandomAccessReader, EventEmitter); function RandomAccessReader() { EventEmitter.call(this); this.refCount = 0; } RandomAccessReader.prototype.ref = function() { this.refCount += 1; }; RandomAccessReader.prototype.unref = function() { var self = this; self.refCount -= 1; if (self.refCount > 0) return; if (self.refCount < 0) throw new Error("invalid unref"); self.close(onCloseDone); function onCloseDone(err) { if (err) return self.emit('error', err); self.emit('close'); } }; RandomAccessReader.prototype.createReadStream = function(options) { var start = options.start; var end = options.end; if (start === end) { var emptyStream = new PassThrough(); setImmediate(function() { emptyStream.end(); }); return emptyStream; } var stream = this._readStreamForRange(start, end); var destroyed = false; var refUnrefFilter = new RefUnrefFilter(this); stream.on("error", function(err) { setImmediate(function() { if (!destroyed) refUnrefFilter.emit("error", err); }); }); refUnrefFilter.destroy = function() { stream.unpipe(refUnrefFilter); refUnrefFilter.unref(); stream.destroy(); }; var byteCounter = new AssertByteCountStream(end - start); refUnrefFilter.on("error", function(err) { setImmediate(function() { if (!destroyed) byteCounter.emit("error", err); }); }); byteCounter.destroy = function() { destroyed = true; refUnrefFilter.unpipe(byteCounter); refUnrefFilter.destroy(); }; return stream.pipe(refUnrefFilter).pipe(byteCounter); }; RandomAccessReader.prototype._readStreamForRange = function(start, end) { throw new Error("not implemented"); }; RandomAccessReader.prototype.read = function(buffer, offset, length, position, callback) { var readStream = this.createReadStream({start: position, end: position + length}); var writeStream = new Writable(); var written = 0; writeStream._write = function(chunk, encoding, cb) { chunk.copy(buffer, offset + written, 0, chunk.length); written += chunk.length; cb(); }; writeStream.on("finish", callback); readStream.on("error", function(error) { callback(error); }); readStream.pipe(writeStream); }; RandomAccessReader.prototype.close = function(callback) { setImmediate(callback); }; util.inherits(RefUnrefFilter, PassThrough); function RefUnrefFilter(context) { PassThrough.call(this); this.context = context; this.context.ref(); this.unreffedYet = false; } RefUnrefFilter.prototype._flush = function(cb) { this.unref(); cb(); }; RefUnrefFilter.prototype.unref = function(cb) { if (this.unreffedYet) return; this.unreffedYet = true; this.context.unref(); }; var cp437 = '\u0000☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ '; function decodeBuffer(buffer, start, end, isUtf8) { if (isUtf8) { return buffer.toString("utf8", start, end); } else { var result = ""; for (var i = start; i < end; i++) { result += cp437[buffer[i]]; } return result; } } function readUInt64LE(buffer, offset) { // there is no native function for this, because we can't actually store 64-bit integers precisely. // after 53 bits, JavaScript's Number type (IEEE 754 double) can't store individual integers anymore. // but since 53 bits is a whole lot more than 32 bits, we do our best anyway. var lower32 = buffer.readUInt32LE(offset); var upper32 = buffer.readUInt32LE(offset + 4); // we can't use bitshifting here, because JavaScript bitshifting only works on 32-bit integers. return upper32 * 0x100000000 + lower32; // as long as we're bounds checking the result of this function against the total file size, // we'll catch any overflow errors, because we already made sure the total file size was within reason. } // Node 10 deprecated new Buffer(). var newBuffer; if (typeof Buffer.allocUnsafe === "function") { newBuffer = function(len) { return Buffer.allocUnsafe(len); }; } else { newBuffer = function(len) { return new Buffer(len); }; } function defaultCallback(err) { if (err) throw err; } /***/ }), /***/ 6539: /***/ ((module, exports, __nccwpck_require__) => { /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); /** * Colors. */ exports.colors = [ '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' ]; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // Is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || // Double check webkit in userAgent just in case we are in a worker (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } const c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, match => { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log(...args) { // This hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return typeof console === 'object' && console.log && console.log(...args); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { let r; try { r = exports.storage.getItem('debug'); } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } module.exports = __nccwpck_require__(8230)(exports); const {formatters} = module.exports; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; /***/ }), /***/ 8230: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = __nccwpck_require__(4263); Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); /** * Active `debug` instances. */ createDebug.instances = []; /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { let prevTime; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return match; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { const val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); const logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; debug.extend = extend; // Debug.formatArgs = formatArgs; // debug.rawLog = rawLog; // env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } createDebug.instances.push(debug); return debug; } function destroy() { const index = createDebug.instances.indexOf(this); if (index !== -1) { createDebug.instances.splice(index, 1); return true; } return false; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; let i; const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); const len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < createDebug.instances.length; i++) { const instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { const namespaces = [ ...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } let i; let len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString() .substring(2, regexp.toString().length - 2) .replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; /***/ }), /***/ 983: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /** * Detect Electron renderer / nwjs process, which is node, but we should * treat as a browser. */ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { module.exports = __nccwpck_require__(6539); } else { module.exports = __nccwpck_require__(9703); } /***/ }), /***/ 9703: /***/ ((module, exports, __nccwpck_require__) => { /** * Module dependencies. */ const tty = __nccwpck_require__(2018); const util = __nccwpck_require__(9023); /** * This is the Node.js implementation of `debug()`. */ exports.init = init; exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; /** * Colors. */ exports.colors = [6, 2, 3, 4, 5, 1]; try { // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) // eslint-disable-next-line import/no-extraneous-dependencies const supportsColor = __nccwpck_require__(75); if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { exports.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ]; } } catch (error) { // Swallow - we only care if `supports-color` is available; it doesn't have to be. } /** * Build up the default `inspectOpts` object from the environment variables. * * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ exports.inspectOpts = Object.keys(process.env).filter(key => { return /^debug_/i.test(key); }).reduce((obj, key) => { // Camel-case const prop = key .substring(6) .toLowerCase() .replace(/_([a-z])/g, (_, k) => { return k.toUpperCase(); }); // Coerce string value into JS value let val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) { val = true; } else if (/^(no|off|false|disabled)$/i.test(val)) { val = false; } else if (val === 'null') { val = null; } else { val = Number(val); } obj[prop] = val; return obj; }, {}); /** * Is stdout a TTY? Colored output is enabled when `true`. */ function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); } /** * Adds ANSI color escape codes if enabled. * * @api public */ function formatArgs(args) { const {namespace: name, useColors} = this; if (useColors) { const c = this.color; const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); const prefix = ` ${colorCode};1m${name} \u001B[0m`; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); } else { args[0] = getDate() + name + ' ' + args[0]; } } function getDate() { if (exports.inspectOpts.hideDate) { return ''; } return new Date().toISOString() + ' '; } /** * Invokes `util.format()` with the specified arguments and writes to stderr. */ function log(...args) { return process.stderr.write(util.format(...args) + '\n'); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { if (namespaces) { process.env.DEBUG = namespaces; } else { // If you set a process.env field to null or undefined, it gets cast to the // string 'null' or 'undefined'. Just delete instead. delete process.env.DEBUG; } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { return process.env.DEBUG; } /** * Init logic for `debug` instances. * * Create a new `inspectOpts` object in case `useColors` is set * differently for a particular `debug` instance. */ function init(debug) { debug.inspectOpts = {}; const keys = Object.keys(exports.inspectOpts); for (let i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } } module.exports = __nccwpck_require__(8230)(exports); const {formatters} = module.exports; /** * Map %o to `util.inspect()`, all on a single line. */ formatters.o = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts) .replace(/\s*\n\s*/g, ' '); }; /** * Map %O to `util.inspect()`, allowing multiple lines if needed. */ formatters.O = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; /***/ }), /***/ 4263: /***/ ((module) => { /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( 'val is not a non-empty string or a valid number. val=' + JSON.stringify(val) ); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } /***/ }), /***/ 8383: /***/ ((module) => { module.exports = eval("require")("fsevents"); /***/ }), /***/ 75: /***/ ((module) => { module.exports = eval("require")("supports-color"); /***/ }), /***/ 2613: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("assert"); /***/ }), /***/ 290: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("async_hooks"); /***/ }), /***/ 181: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("buffer"); /***/ }), /***/ 5317: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("child_process"); /***/ }), /***/ 4236: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("console"); /***/ }), /***/ 9140: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("constants"); /***/ }), /***/ 6982: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("crypto"); /***/ }), /***/ 1637: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("diagnostics_channel"); /***/ }), /***/ 4434: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("events"); /***/ }), /***/ 9896: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs"); /***/ }), /***/ 8611: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("http"); /***/ }), /***/ 5675: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("http2"); /***/ }), /***/ 5692: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("https"); /***/ }), /***/ 9278: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("net"); /***/ }), /***/ 7598: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:crypto"); /***/ }), /***/ 8474: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:events"); /***/ }), /***/ 7075: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream"); /***/ }), /***/ 7975: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:util"); /***/ }), /***/ 857: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("os"); /***/ }), /***/ 6928: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("path"); /***/ }), /***/ 2987: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("perf_hooks"); /***/ }), /***/ 3480: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("querystring"); /***/ }), /***/ 2203: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("stream"); /***/ }), /***/ 3774: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("stream/web"); /***/ }), /***/ 3193: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("string_decoder"); /***/ }), /***/ 3557: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("timers"); /***/ }), /***/ 4756: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("tls"); /***/ }), /***/ 2018: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("tty"); /***/ }), /***/ 7016: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("url"); /***/ }), /***/ 9023: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("util"); /***/ }), /***/ 8253: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("util/types"); /***/ }), /***/ 8167: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("worker_threads"); /***/ }), /***/ 3106: /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("zlib"); /***/ }), /***/ 7182: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const WritableStream = (__nccwpck_require__(7075).Writable) const inherits = (__nccwpck_require__(7975).inherits) const StreamSearch = __nccwpck_require__(4136) const PartStream = __nccwpck_require__(612) const HeaderParser = __nccwpck_require__(2271) const DASH = 45 const B_ONEDASH = Buffer.from('-') const B_CRLF = Buffer.from('\r\n') const EMPTY_FN = function () {} function Dicer (cfg) { if (!(this instanceof Dicer)) { return new Dicer(cfg) } WritableStream.call(this, cfg) if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') } if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined } this._headerFirst = cfg.headerFirst this._dashes = 0 this._parts = 0 this._finished = false this._realFinish = false this._isPreamble = true this._justMatched = false this._firstWrite = true this._inHeader = true this._part = undefined this._cb = undefined this._ignoreData = false this._partOpts = { highWaterMark: cfg.partHwm } this._pause = false const self = this this._hparser = new HeaderParser(cfg) this._hparser.on('header', function (header) { self._inHeader = false self._part.emit('header', header) }) } inherits(Dicer, WritableStream) Dicer.prototype.emit = function (ev) { if (ev === 'finish' && !this._realFinish) { if (!this._finished) { const self = this process.nextTick(function () { self.emit('error', new Error('Unexpected end of multipart data')) if (self._part && !self._ignoreData) { const type = (self._isPreamble ? 'Preamble' : 'Part') self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data')) self._part.push(null) process.nextTick(function () { self._realFinish = true self.emit('finish') self._realFinish = false }) return } self._realFinish = true self.emit('finish') self._realFinish = false }) } } else { WritableStream.prototype.emit.apply(this, arguments) } } Dicer.prototype._write = function (data, encoding, cb) { // ignore unexpected data (e.g. extra trailer data after finished) if (!this._hparser && !this._bparser) { return cb() } if (this._headerFirst && this._isPreamble) { if (!this._part) { this._part = new PartStream(this._partOpts) if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() } } const r = this._hparser.push(data) if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() } } // allows for "easier" testing if (this._firstWrite) { this._bparser.push(B_CRLF) this._firstWrite = false } this._bparser.push(data) if (this._pause) { this._cb = cb } else { cb() } } Dicer.prototype.reset = function () { this._part = undefined this._bparser = undefined this._hparser = undefined } Dicer.prototype.setBoundary = function (boundary) { const self = this this._bparser = new StreamSearch('\r\n--' + boundary) this._bparser.on('info', function (isMatch, data, start, end) { self._oninfo(isMatch, data, start, end) }) } Dicer.prototype._ignore = function () { if (this._part && !this._ignoreData) { this._ignoreData = true this._part.on('error', EMPTY_FN) // we must perform some kind of read on the stream even though we are // ignoring the data, otherwise node's Readable stream will not emit 'end' // after pushing null to the stream this._part.resume() } } Dicer.prototype._oninfo = function (isMatch, data, start, end) { let buf; const self = this; let i = 0; let r; let shouldWriteMore = true if (!this._part && this._justMatched && data) { while (this._dashes < 2 && (start + i) < end) { if (data[start + i] === DASH) { ++i ++this._dashes } else { if (this._dashes) { buf = B_ONEDASH } this._dashes = 0 break } } if (this._dashes === 2) { if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) } this.reset() this._finished = true // no more parts will be added if (self._parts === 0) { self._realFinish = true self.emit('finish') self._realFinish = false } } if (this._dashes) { return } } if (this._justMatched) { this._justMatched = false } if (!this._part) { this._part = new PartStream(this._partOpts) this._part._read = function (n) { self._unpause() } if (this._isPreamble && this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else if (this._isPreamble !== true && this.listenerCount('part') !== 0) { this.emit('part', this._part) } else { this._ignore() } if (!this._isPreamble) { this._inHeader = true } } if (data && start < end && !this._ignoreData) { if (this._isPreamble || !this._inHeader) { if (buf) { shouldWriteMore = this._part.push(buf) } shouldWriteMore = this._part.push(data.slice(start, end)) if (!shouldWriteMore) { this._pause = true } } else if (!this._isPreamble && this._inHeader) { if (buf) { this._hparser.push(buf) } r = this._hparser.push(data.slice(start, end)) if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) } } } if (isMatch) { this._hparser.reset() if (this._isPreamble) { this._isPreamble = false } else { if (start !== end) { ++this._parts this._part.on('end', function () { if (--self._parts === 0) { if (self._finished) { self._realFinish = true self.emit('finish') self._realFinish = false } else { self._unpause() } } }) } } this._part.push(null) this._part = undefined this._ignoreData = false this._justMatched = true this._dashes = 0 } } Dicer.prototype._unpause = function () { if (!this._pause) { return } this._pause = false if (this._cb) { const cb = this._cb this._cb = undefined cb() } } module.exports = Dicer /***/ }), /***/ 2271: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const EventEmitter = (__nccwpck_require__(8474).EventEmitter) const inherits = (__nccwpck_require__(7975).inherits) const getLimit = __nccwpck_require__(2393) const StreamSearch = __nccwpck_require__(4136) const B_DCRLF = Buffer.from('\r\n\r\n') const RE_CRLF = /\r\n/g const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex function HeaderParser (cfg) { EventEmitter.call(this) cfg = cfg || {} const self = this this.nread = 0 this.maxed = false this.npairs = 0 this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000) this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024) this.buffer = '' this.header = {} this.finished = false this.ss = new StreamSearch(B_DCRLF) this.ss.on('info', function (isMatch, data, start, end) { if (data && !self.maxed) { if (self.nread + end - start >= self.maxHeaderSize) { end = self.maxHeaderSize - self.nread + start self.nread = self.maxHeaderSize self.maxed = true } else { self.nread += (end - start) } self.buffer += data.toString('binary', start, end) } if (isMatch) { self._finish() } }) } inherits(HeaderParser, EventEmitter) HeaderParser.prototype.push = function (data) { const r = this.ss.push(data) if (this.finished) { return r } } HeaderParser.prototype.reset = function () { this.finished = false this.buffer = '' this.header = {} this.ss.reset() } HeaderParser.prototype._finish = function () { if (this.buffer) { this._parseHeader() } this.ss.matches = this.ss.maxMatches const header = this.header this.header = {} this.buffer = '' this.finished = true this.nread = this.npairs = 0 this.maxed = false this.emit('header', header) } HeaderParser.prototype._parseHeader = function () { if (this.npairs === this.maxHeaderPairs) { return } const lines = this.buffer.split(RE_CRLF) const len = lines.length let m, h for (var i = 0; i < len; ++i) { // eslint-disable-line no-var if (lines[i].length === 0) { continue } if (lines[i][0] === '\t' || lines[i][0] === ' ') { // folded header content // RFC2822 says to just remove the CRLF and not the whitespace following // it, so we follow the RFC and include the leading whitespace ... if (h) { this.header[h][this.header[h].length - 1] += lines[i] continue } } const posColon = lines[i].indexOf(':') if ( posColon === -1 || posColon === 0 ) { return } m = RE_HDR.exec(lines[i]) h = m[1].toLowerCase() this.header[h] = this.header[h] || [] this.header[h].push((m[2] || '')) if (++this.npairs === this.maxHeaderPairs) { break } } } module.exports = HeaderParser /***/ }), /***/ 612: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const inherits = (__nccwpck_require__(7975).inherits) const ReadableStream = (__nccwpck_require__(7075).Readable) function PartStream (opts) { ReadableStream.call(this, opts) } inherits(PartStream, ReadableStream) PartStream.prototype._read = function (n) {} module.exports = PartStream /***/ }), /***/ 4136: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /** * Copyright Brian White. All rights reserved. * * @see https://github.com/mscdex/streamsearch * * 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. * * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool */ const EventEmitter = (__nccwpck_require__(8474).EventEmitter) const inherits = (__nccwpck_require__(7975).inherits) function SBMH (needle) { if (typeof needle === 'string') { needle = Buffer.from(needle) } if (!Buffer.isBuffer(needle)) { throw new TypeError('The needle has to be a String or a Buffer.') } const needleLength = needle.length if (needleLength === 0) { throw new Error('The needle cannot be an empty String/Buffer.') } if (needleLength > 256) { throw new Error('The needle cannot have a length bigger than 256.') } this.maxMatches = Infinity this.matches = 0 this._occ = new Array(256) .fill(needleLength) // Initialize occurrence table. this._lookbehind_size = 0 this._needle = needle this._bufpos = 0 this._lookbehind = Buffer.alloc(needleLength) // Populate occurrence table with analysis of the needle, // ignoring last letter. for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var this._occ[needle[i]] = needleLength - 1 - i } } inherits(SBMH, EventEmitter) SBMH.prototype.reset = function () { this._lookbehind_size = 0 this.matches = 0 this._bufpos = 0 } SBMH.prototype.push = function (chunk, pos) { if (!Buffer.isBuffer(chunk)) { chunk = Buffer.from(chunk, 'binary') } const chlen = chunk.length this._bufpos = pos || 0 let r while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) } return r } SBMH.prototype._sbmh_feed = function (data) { const len = data.length const needle = this._needle const needleLength = needle.length const lastNeedleChar = needle[needleLength - 1] // Positive: points to a position in `data` // pos == 3 points to data[3] // Negative: points to a position in the lookbehind buffer // pos == -2 points to lookbehind[lookbehind_size - 2] let pos = -this._lookbehind_size let ch if (pos < 0) { // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool // search with character lookup code that considers both the // lookbehind buffer and the current round's haystack data. // // Loop until // there is a match. // or until // we've moved past the position that requires the // lookbehind buffer. In this case we switch to the // optimized loop. // or until // the character to look at lies outside the haystack. while (pos < 0 && pos <= len - needleLength) { ch = this._sbmh_lookup_char(data, pos + needleLength - 1) if ( ch === lastNeedleChar && this._sbmh_memcmp(data, pos, needleLength - 1) ) { this._lookbehind_size = 0 ++this.matches this.emit('info', true) return (this._bufpos = pos + needleLength) } pos += this._occ[ch] } // No match. if (pos < 0) { // There's too few data for Boyer-Moore-Horspool to run, // so let's use a different algorithm to skip as much as // we can. // Forward pos until // the trailing part of lookbehind + data // looks like the beginning of the needle // or until // pos == 0 while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos } } if (pos >= 0) { // Discard lookbehind buffer. this.emit('info', false, this._lookbehind, 0, this._lookbehind_size) this._lookbehind_size = 0 } else { // Cut off part of the lookbehind buffer that has // been processed and append the entire haystack // into it. const bytesToCutOff = this._lookbehind_size + pos if (bytesToCutOff > 0) { // The cut off data is guaranteed not to contain the needle. this.emit('info', false, this._lookbehind, 0, bytesToCutOff) } this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff, this._lookbehind_size - bytesToCutOff) this._lookbehind_size -= bytesToCutOff data.copy(this._lookbehind, this._lookbehind_size) this._lookbehind_size += len this._bufpos = len return len } } pos += (pos >= 0) * this._bufpos // Lookbehind buffer is now empty. We only need to check if the // needle is in the haystack. if (data.indexOf(needle, pos) !== -1) { pos = data.indexOf(needle, pos) ++this.matches if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) } return (this._bufpos = pos + needleLength) } else { pos = len - needleLength } // There was no match. If there's trailing haystack data that we cannot // match yet using the Boyer-Moore-Horspool algorithm (because the trailing // data is less than the needle size) then match using a modified // algorithm that starts matching from the beginning instead of the end. // Whatever trailing data is left after running this algorithm is added to // the lookbehind buffer. while ( pos < len && ( data[pos] !== needle[0] || ( (Buffer.compare( data.subarray(pos, pos + len - pos), needle.subarray(0, len - pos) ) !== 0) ) ) ) { ++pos } if (pos < len) { data.copy(this._lookbehind, 0, pos, pos + (len - pos)) this._lookbehind_size = len - pos } // Everything until pos is guaranteed not to contain needle data. if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) } this._bufpos = len return len } SBMH.prototype._sbmh_lookup_char = function (data, pos) { return (pos < 0) ? this._lookbehind[this._lookbehind_size + pos] : data[pos] } SBMH.prototype._sbmh_memcmp = function (data, pos, len) { for (var i = 0; i < len; ++i) { // eslint-disable-line no-var if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false } } return true } module.exports = SBMH /***/ }), /***/ 9581: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const WritableStream = (__nccwpck_require__(7075).Writable) const { inherits } = __nccwpck_require__(7975) const Dicer = __nccwpck_require__(7182) const MultipartParser = __nccwpck_require__(1192) const UrlencodedParser = __nccwpck_require__(855) const parseParams = __nccwpck_require__(8929) function Busboy (opts) { if (!(this instanceof Busboy)) { return new Busboy(opts) } if (typeof opts !== 'object') { throw new TypeError('Busboy expected an options-Object.') } if (typeof opts.headers !== 'object') { throw new TypeError('Busboy expected an options-Object with headers-attribute.') } if (typeof opts.headers['content-type'] !== 'string') { throw new TypeError('Missing Content-Type-header.') } const { headers, ...streamOptions } = opts this.opts = { autoDestroy: false, ...streamOptions } WritableStream.call(this, this.opts) this._done = false this._parser = this.getParserByHeaders(headers) this._finished = false } inherits(Busboy, WritableStream) Busboy.prototype.emit = function (ev) { if (ev === 'finish') { if (!this._done) { this._parser?.end() return } else if (this._finished) { return } this._finished = true } WritableStream.prototype.emit.apply(this, arguments) } Busboy.prototype.getParserByHeaders = function (headers) { const parsed = parseParams(headers['content-type']) const cfg = { defCharset: this.opts.defCharset, fileHwm: this.opts.fileHwm, headers, highWaterMark: this.opts.highWaterMark, isPartAFile: this.opts.isPartAFile, limits: this.opts.limits, parsedConType: parsed, preservePath: this.opts.preservePath } if (MultipartParser.detect.test(parsed[0])) { return new MultipartParser(this, cfg) } if (UrlencodedParser.detect.test(parsed[0])) { return new UrlencodedParser(this, cfg) } throw new Error('Unsupported Content-Type.') } Busboy.prototype._write = function (chunk, encoding, cb) { this._parser.write(chunk, cb) } module.exports = Busboy module.exports["default"] = Busboy module.exports.Busboy = Busboy module.exports.Dicer = Dicer /***/ }), /***/ 1192: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // TODO: // * support 1 nested multipart level // (see second multipart example here: // http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data) // * support limits.fieldNameSize // -- this will require modifications to utils.parseParams const { Readable } = __nccwpck_require__(7075) const { inherits } = __nccwpck_require__(7975) const Dicer = __nccwpck_require__(7182) const parseParams = __nccwpck_require__(8929) const decodeText = __nccwpck_require__(2747) const basename = __nccwpck_require__(692) const getLimit = __nccwpck_require__(2393) const RE_BOUNDARY = /^boundary$/i const RE_FIELD = /^form-data$/i const RE_CHARSET = /^charset$/i const RE_FILENAME = /^filename$/i const RE_NAME = /^name$/i Multipart.detect = /^multipart\/form-data/i function Multipart (boy, cfg) { let i let len const self = this let boundary const limits = cfg.limits const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined)) const parsedConType = cfg.parsedConType || [] const defCharset = cfg.defCharset || 'utf8' const preservePath = cfg.preservePath const fileOpts = { highWaterMark: cfg.fileHwm } for (i = 0, len = parsedConType.length; i < len; ++i) { if (Array.isArray(parsedConType[i]) && RE_BOUNDARY.test(parsedConType[i][0])) { boundary = parsedConType[i][1] break } } function checkFinished () { if (nends === 0 && finished && !boy._done) { finished = false self.end() } } if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') } const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024) const fileSizeLimit = getLimit(limits, 'fileSize', Infinity) const filesLimit = getLimit(limits, 'files', Infinity) const fieldsLimit = getLimit(limits, 'fields', Infinity) const partsLimit = getLimit(limits, 'parts', Infinity) const headerPairsLimit = getLimit(limits, 'headerPairs', 2000) const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024) let nfiles = 0 let nfields = 0 let nends = 0 let curFile let curField let finished = false this._needDrain = false this._pause = false this._cb = undefined this._nparts = 0 this._boy = boy const parserCfg = { boundary, maxHeaderPairs: headerPairsLimit, maxHeaderSize: headerSizeLimit, partHwm: fileOpts.highWaterMark, highWaterMark: cfg.highWaterMark } this.parser = new Dicer(parserCfg) this.parser.on('drain', function () { self._needDrain = false if (self._cb && !self._pause) { const cb = self._cb self._cb = undefined cb() } }).on('part', function onPart (part) { if (++self._nparts > partsLimit) { self.parser.removeListener('part', onPart) self.parser.on('part', skipPart) boy.hitPartsLimit = true boy.emit('partsLimit') return skipPart(part) } // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let // us emit 'end' early since we know the part has ended if we are already // seeing the next part if (curField) { const field = curField field.emit('end') field.removeAllListeners('end') } part.on('header', function (header) { let contype let fieldname let parsed let charset let encoding let filename let nsize = 0 if (header['content-type']) { parsed = parseParams(header['content-type'][0]) if (parsed[0]) { contype = parsed[0].toLowerCase() for (i = 0, len = parsed.length; i < len; ++i) { if (RE_CHARSET.test(parsed[i][0])) { charset = parsed[i][1].toLowerCase() break } } } } if (contype === undefined) { contype = 'text/plain' } if (charset === undefined) { charset = defCharset } if (header['content-disposition']) { parsed = parseParams(header['content-disposition'][0]) if (!RE_FIELD.test(parsed[0])) { return skipPart(part) } for (i = 0, len = parsed.length; i < len; ++i) { if (RE_NAME.test(parsed[i][0])) { fieldname = parsed[i][1] } else if (RE_FILENAME.test(parsed[i][0])) { filename = parsed[i][1] if (!preservePath) { filename = basename(filename) } } } } else { return skipPart(part) } if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' } let onData, onEnd if (isPartAFile(fieldname, contype, filename)) { // file/binary field if (nfiles === filesLimit) { if (!boy.hitFilesLimit) { boy.hitFilesLimit = true boy.emit('filesLimit') } return skipPart(part) } ++nfiles if (boy.listenerCount('file') === 0) { self.parser._ignore() return } ++nends const file = new FileStream(fileOpts) curFile = file file.on('end', function () { --nends self._pause = false checkFinished() if (self._cb && !self._needDrain) { const cb = self._cb self._cb = undefined cb() } }) file._read = function (n) { if (!self._pause) { return } self._pause = false if (self._cb && !self._needDrain) { const cb = self._cb self._cb = undefined cb() } } boy.emit('file', fieldname, file, filename, encoding, contype) onData = function (data) { if ((nsize += data.length) > fileSizeLimit) { const extralen = fileSizeLimit - nsize + data.length if (extralen > 0) { file.push(data.slice(0, extralen)) } file.truncated = true file.bytesRead = fileSizeLimit part.removeAllListeners('data') file.emit('limit') return } else if (!file.push(data)) { self._pause = true } file.bytesRead = nsize } onEnd = function () { curFile = undefined file.push(null) } } else { // non-file field if (nfields === fieldsLimit) { if (!boy.hitFieldsLimit) { boy.hitFieldsLimit = true boy.emit('fieldsLimit') } return skipPart(part) } ++nfields ++nends let buffer = '' let truncated = false curField = part onData = function (data) { if ((nsize += data.length) > fieldSizeLimit) { const extralen = (fieldSizeLimit - (nsize - data.length)) buffer += data.toString('binary', 0, extralen) truncated = true part.removeAllListeners('data') } else { buffer += data.toString('binary') } } onEnd = function () { curField = undefined if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) } boy.emit('field', fieldname, buffer, false, truncated, encoding, contype) --nends checkFinished() } } /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become broken. Streams2/streams3 is a huge black box of confusion, but somehow overriding the sync state seems to fix things again (and still seems to work for previous node versions). */ part._readableState.sync = false part.on('data', onData) part.on('end', onEnd) }).on('error', function (err) { if (curFile) { curFile.emit('error', err) } }) }).on('error', function (err) { boy.emit('error', err) }).on('finish', function () { finished = true checkFinished() }) } Multipart.prototype.write = function (chunk, cb) { const r = this.parser.write(chunk) if (r && !this._pause) { cb() } else { this._needDrain = !r this._cb = cb } } Multipart.prototype.end = function () { const self = this if (self.parser.writable) { self.parser.end() } else if (!self._boy._done) { process.nextTick(function () { self._boy._done = true self._boy.emit('finish') }) } } function skipPart (part) { part.resume() } function FileStream (opts) { Readable.call(this, opts) this.bytesRead = 0 this.truncated = false } inherits(FileStream, Readable) FileStream.prototype._read = function (n) {} module.exports = Multipart /***/ }), /***/ 855: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const Decoder = __nccwpck_require__(1496) const decodeText = __nccwpck_require__(2747) const getLimit = __nccwpck_require__(2393) const RE_CHARSET = /^charset$/i UrlEncoded.detect = /^application\/x-www-form-urlencoded/i function UrlEncoded (boy, cfg) { const limits = cfg.limits const parsedConType = cfg.parsedConType this.boy = boy this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024) this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100) this.fieldsLimit = getLimit(limits, 'fields', Infinity) let charset for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var if (Array.isArray(parsedConType[i]) && RE_CHARSET.test(parsedConType[i][0])) { charset = parsedConType[i][1].toLowerCase() break } } if (charset === undefined) { charset = cfg.defCharset || 'utf8' } this.decoder = new Decoder() this.charset = charset this._fields = 0 this._state = 'key' this._checkingBytes = true this._bytesKey = 0 this._bytesVal = 0 this._key = '' this._val = '' this._keyTrunc = false this._valTrunc = false this._hitLimit = false } UrlEncoded.prototype.write = function (data, cb) { if (this._fields === this.fieldsLimit) { if (!this.boy.hitFieldsLimit) { this.boy.hitFieldsLimit = true this.boy.emit('fieldsLimit') } return cb() } let idxeq; let idxamp; let i; let p = 0; const len = data.length while (p < len) { if (this._state === 'key') { idxeq = idxamp = undefined for (i = p; i < len; ++i) { if (!this._checkingBytes) { ++p } if (data[i] === 0x3D/* = */) { idxeq = i break } else if (data[i] === 0x26/* & */) { idxamp = i break } if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) { this._hitLimit = true break } else if (this._checkingBytes) { ++this._bytesKey } } if (idxeq !== undefined) { // key with assignment if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) } this._state = 'val' this._hitLimit = false this._checkingBytes = true this._val = '' this._bytesVal = 0 this._valTrunc = false this.decoder.reset() p = idxeq + 1 } else if (idxamp !== undefined) { // key with no assignment ++this._fields let key; const keyTrunc = this._keyTrunc if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key } this._hitLimit = false this._checkingBytes = true this._key = '' this._bytesKey = 0 this._keyTrunc = false this.decoder.reset() if (key.length) { this.boy.emit('field', decodeText(key, 'binary', this.charset), '', keyTrunc, false) } p = idxamp + 1 if (this._fields === this.fieldsLimit) { return cb() } } else if (this._hitLimit) { // we may not have hit the actual limit if there are encoded bytes... if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) } p = i if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) { // yep, we actually did hit the limit this._checkingBytes = false this._keyTrunc = true } } else { if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) } p = len } } else { idxamp = undefined for (i = p; i < len; ++i) { if (!this._checkingBytes) { ++p } if (data[i] === 0x26/* & */) { idxamp = i break } if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) { this._hitLimit = true break } else if (this._checkingBytes) { ++this._bytesVal } } if (idxamp !== undefined) { ++this._fields if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) } this.boy.emit('field', decodeText(this._key, 'binary', this.charset), decodeText(this._val, 'binary', this.charset), this._keyTrunc, this._valTrunc) this._state = 'key' this._hitLimit = false this._checkingBytes = true this._key = '' this._bytesKey = 0 this._keyTrunc = false this.decoder.reset() p = idxamp + 1 if (this._fields === this.fieldsLimit) { return cb() } } else if (this._hitLimit) { // we may not have hit the actual limit if there are encoded bytes... if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) } p = i if ((this._val === '' && this.fieldSizeLimit === 0) || (this._bytesVal = this._val.length) === this.fieldSizeLimit) { // yep, we actually did hit the limit this._checkingBytes = false this._valTrunc = true } } else { if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) } p = len } } } cb() } UrlEncoded.prototype.end = function () { if (this.boy._done) { return } if (this._state === 'key' && this._key.length > 0) { this.boy.emit('field', decodeText(this._key, 'binary', this.charset), '', this._keyTrunc, false) } else if (this._state === 'val') { this.boy.emit('field', decodeText(this._key, 'binary', this.charset), decodeText(this._val, 'binary', this.charset), this._keyTrunc, this._valTrunc) } this.boy._done = true this.boy.emit('finish') } module.exports = UrlEncoded /***/ }), /***/ 1496: /***/ ((module) => { const RE_PLUS = /\+/g const HEX = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] function Decoder () { this.buffer = undefined } Decoder.prototype.write = function (str) { // Replace '+' with ' ' before decoding str = str.replace(RE_PLUS, ' ') let res = '' let i = 0; let p = 0; const len = str.length for (; i < len; ++i) { if (this.buffer !== undefined) { if (!HEX[str.charCodeAt(i)]) { res += '%' + this.buffer this.buffer = undefined --i // retry character } else { this.buffer += str[i] ++p if (this.buffer.length === 2) { res += String.fromCharCode(parseInt(this.buffer, 16)) this.buffer = undefined } } } else if (str[i] === '%') { if (i > p) { res += str.substring(p, i) p = i } this.buffer = '' ++p } } if (p < len && this.buffer === undefined) { res += str.substring(p) } return res } Decoder.prototype.reset = function () { this.buffer = undefined } module.exports = Decoder /***/ }), /***/ 692: /***/ ((module) => { module.exports = function basename (path) { if (typeof path !== 'string') { return '' } for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var switch (path.charCodeAt(i)) { case 0x2F: // '/' case 0x5C: // '\' path = path.slice(i + 1) return (path === '..' || path === '.' ? '' : path) } } return (path === '..' || path === '.' ? '' : path) } /***/ }), /***/ 2747: /***/ (function(module) { // Node has always utf-8 const utf8Decoder = new TextDecoder('utf-8') const textDecoders = new Map([ ['utf-8', utf8Decoder], ['utf8', utf8Decoder] ]) function getDecoder (charset) { let lc while (true) { switch (charset) { case 'utf-8': case 'utf8': return decoders.utf8 case 'latin1': case 'ascii': // TODO: Make these a separate, strict decoder? case 'us-ascii': case 'iso-8859-1': case 'iso8859-1': case 'iso88591': case 'iso_8859-1': case 'windows-1252': case 'iso_8859-1:1987': case 'cp1252': case 'x-cp1252': return decoders.latin1 case 'utf16le': case 'utf-16le': case 'ucs2': case 'ucs-2': return decoders.utf16le case 'base64': return decoders.base64 default: if (lc === undefined) { lc = true charset = charset.toLowerCase() continue } return decoders.other.bind(charset) } } } const decoders = { utf8: (data, sourceEncoding) => { if (data.length === 0) { return '' } if (typeof data === 'string') { data = Buffer.from(data, sourceEncoding) } return data.utf8Slice(0, data.length) }, latin1: (data, sourceEncoding) => { if (data.length === 0) { return '' } if (typeof data === 'string') { return data } return data.latin1Slice(0, data.length) }, utf16le: (data, sourceEncoding) => { if (data.length === 0) { return '' } if (typeof data === 'string') { data = Buffer.from(data, sourceEncoding) } return data.ucs2Slice(0, data.length) }, base64: (data, sourceEncoding) => { if (data.length === 0) { return '' } if (typeof data === 'string') { data = Buffer.from(data, sourceEncoding) } return data.base64Slice(0, data.length) }, other: (data, sourceEncoding) => { if (data.length === 0) { return '' } if (typeof data === 'string') { data = Buffer.from(data, sourceEncoding) } if (textDecoders.has(this.toString())) { try { return textDecoders.get(this).decode(data) } catch {} } return typeof data === 'string' ? data : data.toString() } } function decodeText (text, sourceEncoding, destEncoding) { if (text) { return getDecoder(destEncoding)(text, sourceEncoding) } return text } module.exports = decodeText /***/ }), /***/ 2393: /***/ ((module) => { module.exports = function getLimit (limits, name, defaultLimit) { if ( !limits || limits[name] === undefined || limits[name] === null ) { return defaultLimit } if ( typeof limits[name] !== 'number' || isNaN(limits[name]) ) { throw new TypeError('Limit ' + name + ' is not a valid number') } return limits[name] } /***/ }), /***/ 8929: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /* eslint-disable object-property-newline */ const decodeText = __nccwpck_require__(2747) const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g const EncodedLookup = { '%00': '\x00', '%01': '\x01', '%02': '\x02', '%03': '\x03', '%04': '\x04', '%05': '\x05', '%06': '\x06', '%07': '\x07', '%08': '\x08', '%09': '\x09', '%0a': '\x0a', '%0A': '\x0a', '%0b': '\x0b', '%0B': '\x0b', '%0c': '\x0c', '%0C': '\x0c', '%0d': '\x0d', '%0D': '\x0d', '%0e': '\x0e', '%0E': '\x0e', '%0f': '\x0f', '%0F': '\x0f', '%10': '\x10', '%11': '\x11', '%12': '\x12', '%13': '\x13', '%14': '\x14', '%15': '\x15', '%16': '\x16', '%17': '\x17', '%18': '\x18', '%19': '\x19', '%1a': '\x1a', '%1A': '\x1a', '%1b': '\x1b', '%1B': '\x1b', '%1c': '\x1c', '%1C': '\x1c', '%1d': '\x1d', '%1D': '\x1d', '%1e': '\x1e', '%1E': '\x1e', '%1f': '\x1f', '%1F': '\x1f', '%20': '\x20', '%21': '\x21', '%22': '\x22', '%23': '\x23', '%24': '\x24', '%25': '\x25', '%26': '\x26', '%27': '\x27', '%28': '\x28', '%29': '\x29', '%2a': '\x2a', '%2A': '\x2a', '%2b': '\x2b', '%2B': '\x2b', '%2c': '\x2c', '%2C': '\x2c', '%2d': '\x2d', '%2D': '\x2d', '%2e': '\x2e', '%2E': '\x2e', '%2f': '\x2f', '%2F': '\x2f', '%30': '\x30', '%31': '\x31', '%32': '\x32', '%33': '\x33', '%34': '\x34', '%35': '\x35', '%36': '\x36', '%37': '\x37', '%38': '\x38', '%39': '\x39', '%3a': '\x3a', '%3A': '\x3a', '%3b': '\x3b', '%3B': '\x3b', '%3c': '\x3c', '%3C': '\x3c', '%3d': '\x3d', '%3D': '\x3d', '%3e': '\x3e', '%3E': '\x3e', '%3f': '\x3f', '%3F': '\x3f', '%40': '\x40', '%41': '\x41', '%42': '\x42', '%43': '\x43', '%44': '\x44', '%45': '\x45', '%46': '\x46', '%47': '\x47', '%48': '\x48', '%49': '\x49', '%4a': '\x4a', '%4A': '\x4a', '%4b': '\x4b', '%4B': '\x4b', '%4c': '\x4c', '%4C': '\x4c', '%4d': '\x4d', '%4D': '\x4d', '%4e': '\x4e', '%4E': '\x4e', '%4f': '\x4f', '%4F': '\x4f', '%50': '\x50', '%51': '\x51', '%52': '\x52', '%53': '\x53', '%54': '\x54', '%55': '\x55', '%56': '\x56', '%57': '\x57', '%58': '\x58', '%59': '\x59', '%5a': '\x5a', '%5A': '\x5a', '%5b': '\x5b', '%5B': '\x5b', '%5c': '\x5c', '%5C': '\x5c', '%5d': '\x5d', '%5D': '\x5d', '%5e': '\x5e', '%5E': '\x5e', '%5f': '\x5f', '%5F': '\x5f', '%60': '\x60', '%61': '\x61', '%62': '\x62', '%63': '\x63', '%64': '\x64', '%65': '\x65', '%66': '\x66', '%67': '\x67', '%68': '\x68', '%69': '\x69', '%6a': '\x6a', '%6A': '\x6a', '%6b': '\x6b', '%6B': '\x6b', '%6c': '\x6c', '%6C': '\x6c', '%6d': '\x6d', '%6D': '\x6d', '%6e': '\x6e', '%6E': '\x6e', '%6f': '\x6f', '%6F': '\x6f', '%70': '\x70', '%71': '\x71', '%72': '\x72', '%73': '\x73', '%74': '\x74', '%75': '\x75', '%76': '\x76', '%77': '\x77', '%78': '\x78', '%79': '\x79', '%7a': '\x7a', '%7A': '\x7a', '%7b': '\x7b', '%7B': '\x7b', '%7c': '\x7c', '%7C': '\x7c', '%7d': '\x7d', '%7D': '\x7d', '%7e': '\x7e', '%7E': '\x7e', '%7f': '\x7f', '%7F': '\x7f', '%80': '\x80', '%81': '\x81', '%82': '\x82', '%83': '\x83', '%84': '\x84', '%85': '\x85', '%86': '\x86', '%87': '\x87', '%88': '\x88', '%89': '\x89', '%8a': '\x8a', '%8A': '\x8a', '%8b': '\x8b', '%8B': '\x8b', '%8c': '\x8c', '%8C': '\x8c', '%8d': '\x8d', '%8D': '\x8d', '%8e': '\x8e', '%8E': '\x8e', '%8f': '\x8f', '%8F': '\x8f', '%90': '\x90', '%91': '\x91', '%92': '\x92', '%93': '\x93', '%94': '\x94', '%95': '\x95', '%96': '\x96', '%97': '\x97', '%98': '\x98', '%99': '\x99', '%9a': '\x9a', '%9A': '\x9a', '%9b': '\x9b', '%9B': '\x9b', '%9c': '\x9c', '%9C': '\x9c', '%9d': '\x9d', '%9D': '\x9d', '%9e': '\x9e', '%9E': '\x9e', '%9f': '\x9f', '%9F': '\x9f', '%a0': '\xa0', '%A0': '\xa0', '%a1': '\xa1', '%A1': '\xa1', '%a2': '\xa2', '%A2': '\xa2', '%a3': '\xa3', '%A3': '\xa3', '%a4': '\xa4', '%A4': '\xa4', '%a5': '\xa5', '%A5': '\xa5', '%a6': '\xa6', '%A6': '\xa6', '%a7': '\xa7', '%A7': '\xa7', '%a8': '\xa8', '%A8': '\xa8', '%a9': '\xa9', '%A9': '\xa9', '%aa': '\xaa', '%Aa': '\xaa', '%aA': '\xaa', '%AA': '\xaa', '%ab': '\xab', '%Ab': '\xab', '%aB': '\xab', '%AB': '\xab', '%ac': '\xac', '%Ac': '\xac', '%aC': '\xac', '%AC': '\xac', '%ad': '\xad', '%Ad': '\xad', '%aD': '\xad', '%AD': '\xad', '%ae': '\xae', '%Ae': '\xae', '%aE': '\xae', '%AE': '\xae', '%af': '\xaf', '%Af': '\xaf', '%aF': '\xaf', '%AF': '\xaf', '%b0': '\xb0', '%B0': '\xb0', '%b1': '\xb1', '%B1': '\xb1', '%b2': '\xb2', '%B2': '\xb2', '%b3': '\xb3', '%B3': '\xb3', '%b4': '\xb4', '%B4': '\xb4', '%b5': '\xb5', '%B5': '\xb5', '%b6': '\xb6', '%B6': '\xb6', '%b7': '\xb7', '%B7': '\xb7', '%b8': '\xb8', '%B8': '\xb8', '%b9': '\xb9', '%B9': '\xb9', '%ba': '\xba', '%Ba': '\xba', '%bA': '\xba', '%BA': '\xba', '%bb': '\xbb', '%Bb': '\xbb', '%bB': '\xbb', '%BB': '\xbb', '%bc': '\xbc', '%Bc': '\xbc', '%bC': '\xbc', '%BC': '\xbc', '%bd': '\xbd', '%Bd': '\xbd', '%bD': '\xbd', '%BD': '\xbd', '%be': '\xbe', '%Be': '\xbe', '%bE': '\xbe', '%BE': '\xbe', '%bf': '\xbf', '%Bf': '\xbf', '%bF': '\xbf', '%BF': '\xbf', '%c0': '\xc0', '%C0': '\xc0', '%c1': '\xc1', '%C1': '\xc1', '%c2': '\xc2', '%C2': '\xc2', '%c3': '\xc3', '%C3': '\xc3', '%c4': '\xc4', '%C4': '\xc4', '%c5': '\xc5', '%C5': '\xc5', '%c6': '\xc6', '%C6': '\xc6', '%c7': '\xc7', '%C7': '\xc7', '%c8': '\xc8', '%C8': '\xc8', '%c9': '\xc9', '%C9': '\xc9', '%ca': '\xca', '%Ca': '\xca', '%cA': '\xca', '%CA': '\xca', '%cb': '\xcb', '%Cb': '\xcb', '%cB': '\xcb', '%CB': '\xcb', '%cc': '\xcc', '%Cc': '\xcc', '%cC': '\xcc', '%CC': '\xcc', '%cd': '\xcd', '%Cd': '\xcd', '%cD': '\xcd', '%CD': '\xcd', '%ce': '\xce', '%Ce': '\xce', '%cE': '\xce', '%CE': '\xce', '%cf': '\xcf', '%Cf': '\xcf', '%cF': '\xcf', '%CF': '\xcf', '%d0': '\xd0', '%D0': '\xd0', '%d1': '\xd1', '%D1': '\xd1', '%d2': '\xd2', '%D2': '\xd2', '%d3': '\xd3', '%D3': '\xd3', '%d4': '\xd4', '%D4': '\xd4', '%d5': '\xd5', '%D5': '\xd5', '%d6': '\xd6', '%D6': '\xd6', '%d7': '\xd7', '%D7': '\xd7', '%d8': '\xd8', '%D8': '\xd8', '%d9': '\xd9', '%D9': '\xd9', '%da': '\xda', '%Da': '\xda', '%dA': '\xda', '%DA': '\xda', '%db': '\xdb', '%Db': '\xdb', '%dB': '\xdb', '%DB': '\xdb', '%dc': '\xdc', '%Dc': '\xdc', '%dC': '\xdc', '%DC': '\xdc', '%dd': '\xdd', '%Dd': '\xdd', '%dD': '\xdd', '%DD': '\xdd', '%de': '\xde', '%De': '\xde', '%dE': '\xde', '%DE': '\xde', '%df': '\xdf', '%Df': '\xdf', '%dF': '\xdf', '%DF': '\xdf', '%e0': '\xe0', '%E0': '\xe0', '%e1': '\xe1', '%E1': '\xe1', '%e2': '\xe2', '%E2': '\xe2', '%e3': '\xe3', '%E3': '\xe3', '%e4': '\xe4', '%E4': '\xe4', '%e5': '\xe5', '%E5': '\xe5', '%e6': '\xe6', '%E6': '\xe6', '%e7': '\xe7', '%E7': '\xe7', '%e8': '\xe8', '%E8': '\xe8', '%e9': '\xe9', '%E9': '\xe9', '%ea': '\xea', '%Ea': '\xea', '%eA': '\xea', '%EA': '\xea', '%eb': '\xeb', '%Eb': '\xeb', '%eB': '\xeb', '%EB': '\xeb', '%ec': '\xec', '%Ec': '\xec', '%eC': '\xec', '%EC': '\xec', '%ed': '\xed', '%Ed': '\xed', '%eD': '\xed', '%ED': '\xed', '%ee': '\xee', '%Ee': '\xee', '%eE': '\xee', '%EE': '\xee', '%ef': '\xef', '%Ef': '\xef', '%eF': '\xef', '%EF': '\xef', '%f0': '\xf0', '%F0': '\xf0', '%f1': '\xf1', '%F1': '\xf1', '%f2': '\xf2', '%F2': '\xf2', '%f3': '\xf3', '%F3': '\xf3', '%f4': '\xf4', '%F4': '\xf4', '%f5': '\xf5', '%F5': '\xf5', '%f6': '\xf6', '%F6': '\xf6', '%f7': '\xf7', '%F7': '\xf7', '%f8': '\xf8', '%F8': '\xf8', '%f9': '\xf9', '%F9': '\xf9', '%fa': '\xfa', '%Fa': '\xfa', '%fA': '\xfa', '%FA': '\xfa', '%fb': '\xfb', '%Fb': '\xfb', '%fB': '\xfb', '%FB': '\xfb', '%fc': '\xfc', '%Fc': '\xfc', '%fC': '\xfc', '%FC': '\xfc', '%fd': '\xfd', '%Fd': '\xfd', '%fD': '\xfd', '%FD': '\xfd', '%fe': '\xfe', '%Fe': '\xfe', '%fE': '\xfe', '%FE': '\xfe', '%ff': '\xff', '%Ff': '\xff', '%fF': '\xff', '%FF': '\xff' } function encodedReplacer (match) { return EncodedLookup[match] } const STATE_KEY = 0 const STATE_VALUE = 1 const STATE_CHARSET = 2 const STATE_LANG = 3 function parseParams (str) { const res = [] let state = STATE_KEY let charset = '' let inquote = false let escaping = false let p = 0 let tmp = '' const len = str.length for (var i = 0; i < len; ++i) { // eslint-disable-line no-var const char = str[i] if (char === '\\' && inquote) { if (escaping) { escaping = false } else { escaping = true continue } } else if (char === '"') { if (!escaping) { if (inquote) { inquote = false state = STATE_KEY } else { inquote = true } continue } else { escaping = false } } else { if (escaping && inquote) { tmp += '\\' } escaping = false if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") { if (state === STATE_CHARSET) { state = STATE_LANG charset = tmp.substring(1) } else { state = STATE_VALUE } tmp = '' continue } else if (state === STATE_KEY && (char === '*' || char === '=') && res.length) { state = char === '*' ? STATE_CHARSET : STATE_VALUE res[p] = [tmp, undefined] tmp = '' continue } else if (!inquote && char === ';') { state = STATE_KEY if (charset) { if (tmp.length) { tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer), 'binary', charset) } charset = '' } else if (tmp.length) { tmp = decodeText(tmp, 'binary', 'utf8') } if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp } tmp = '' ++p continue } else if (!inquote && (char === ' ' || char === '\t')) { continue } } tmp += char } if (charset && tmp.length) { tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer), 'binary', charset) } else if (tmp) { tmp = decodeText(tmp, 'binary', 'utf8') } if (res[p] === undefined) { if (tmp) { res[p] = tmp } } else { res[p][1] = tmp } return res } module.exports = parseParams /***/ }), /***/ 1506: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var possibleNames = __nccwpck_require__(8879); var g = typeof globalThis === 'undefined' ? global : globalThis; /** @type {import('.')} */ module.exports = function availableTypedArrays() { var /** @type {ReturnType} */ out = []; for (var i = 0; i < possibleNames.length; i++) { if (typeof g[possibleNames[i]] === 'function') { // @ts-expect-error out[out.length] = possibleNames[i]; } } return out; }; /***/ }), /***/ 9272: /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => { __nccwpck_require__.r(__webpack_exports__); /* harmony export */ __nccwpck_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"array":"an array","boolean":"a boolean","bug-of-mc":"Due to a bug of Minecraft (%0%), %1%. Please Mojang, fix your game","code-action.block-state-sort-keys":"Sort block state","code-action.command-replaceitem":"Update this command to /item … replace","code-action.fix-file":"Fix all auto-fixable problems in this file","code-action.fix-workspace":"Fix all auto-fixable problems in the workspace","code-action.id-attribute-datafix":"Update this attribute name to 1.16","code-action.add-default-namespace":"Add default namespace","code-action.add-leading-slash":"Add leading slash","code-action.create-undeclared-file":"Create %0% %1% in the same pack","code-action.id-omit-default-namespace":"Omit default namespace","code-action.id-zombified-piglin-datafix":"Change this ID to Zombified Piglin's","code-action.nbt-compound-sort-keys":"Sort NBT compound tag","code-action.nbt-type-to-byte":"Convert to an NBT byte tag","code-action.nbt-type-to-double":"Convert to an NBT double tag","code-action.nbt-type-to-float":"Convert to an NBT float tag","code-action.nbt-type-to-int":"Convert to an NBT int tag","code-action.nbt-type-to-long":"Convert to an NBT long tag","code-action.nbt-type-to-short":"Convert to an NBT short tag","code-action.nbt-uuid-datafix":"Update this UUID to 1.16","code-action.remove-leading-slash":"Remove leading slash","code-action.remove-trailing-separation":"Remove trailing separation","code-action.selector-sort-keys":"Sort selector argument","code-action.string-double-quote":"Quote this string with double quotation marks","code-action.string-single-quote":"Quote this string with single quotation marks","code-action.string-unquote":"Unquote this string","code-action.vector-align-0.0":"Align this vector to block origin","code-action.vector-align-0.5":"Align this vector to block center","comment":"a comment starting with %0%","conjunction.and_2":" and ","conjunction.and_3+_1":", ","conjunction.and_3+_2":", and ","conjunction.or_2":" or ","conjunction.or_3+_1":", ","conjunction.or_3+_2":", or ","datafix.error.command-replaceitem":"/replaceitem was removed in 20w46a (the second snapshot of 1.17) in favour of /item","duplicate-key":"Duplicate key %0%","ending-quote":"an ending quote %0%","entity":"an entity","error.unparseable-content":"Encountered unparseable content","expected":"Expected %0%","expected-got":"Expected %0% but got %1%","float":"a float","float.between":"a float between %0% and %1%","integer":"an integer","integer.between":"an integer between %0% and %1%","invalid-key-combination":"Invalid combination of keys %0%","invalid-regex-pattern":"Invalid regex pattern: %0%","mismatching-regex-pattern":"Value does not match regex: %0%","java-edition.binder.wrong-folder":"Files in the %0% folder are not recognized in loaded version %1%, did you meant to use the %2% folder?","java-edition.binder.wrong-version":"Files in the %0% folder are not recognized in loaded version %1%","java-edition.translation-value.percent-escape-hint":"%0%. If you want to display a literal percent sign, use “%%” instead","json.doc.advancement.display":"Advancement display settings. If present, the advancement will be visible in the advancement tabs.","json.checker.array.length-between":"%0% with length between %1% and %2%","json.checker.object.field.union-empty-members":"Disallowed property","json.checker.item.duplicate":"Duplicate list item","json.checker.property.deprecated":"Property %0% is deprecated","json.checker.property.missing":"Missing property %0%","json.checker.property.unknown":"Unknown property %0%","json.checker.string.hex-color":"a 6-digit hexadecimal number","json.checker.tag-entry.duplicate":"Duplicate tag entry","json.checker.value":"a value","json.node.array":"an array","json.node.boolean":"a boolean","json.node.null":"a null","json.node.number":"a number","json.node.object":"an object","json.node.string":"a string","key-not-following-convention":"Invalid key %0% which doesn't follow %1% convention","linter.diagnostic-message-wrapper":"%0% (rule: %1%)","linter.name-convention.illegal":"Name %0% doesn't match %1%","linter.undeclared-symbol.message":"Cannot find %0% %1%","linter-config-validator.name-convention.type":"Expects a string that contains a regular expression describing the name","linter-config-validator.wrapper":"%0%. See [the documentation](%1) for more information","long":"a long","long.between":"a long between %0% and %1%","mcdoc.binder.dispatcher-statement.duplicated-key":"Duplicated dispatcher case %0%","mcdoc.binder.dispatcher-statement.duplicated-key.related":"%0% has already been dispatched here","mcdoc.binder.duplicated-declaration":"Duplicated declaration for %0%","mcdoc.binder.duplicated-declaration.related":"%0% is already declared here","mcdoc.binder.out-of-root":"File %0% is not under the root directory of any mcdoc project; semantic checking will be skipped","mcdoc.binder.path.super-from-root":"Cannot access super of the project root","mcdoc.binder.path.unknown-identifier":"Identifier %0% does not exist in module %1%","mcdoc.binder.path.unknown-module":"Module %0% does not exist","mcdoc.checker.entry.empty-mod-seg":"You cannot put “mod.mcdoc” under a root directly","mcdoc.checker.inject-clause.unmatched-injection":"Cannot inject %0% with %1%","mcdoc.checker.type-not-assignable":"Type %0% is not assignable to type %1%","mcdoc.node.compound-definition":"a compound definition","mcdoc.node.enum-definition":"an enum definition","mcdoc.node.identifier":"an identifier","mcdoc.parser.compound-definition.field-type":"a field type","mcdoc.parser.float.illegal":"Encountered illegal float number","mcdoc.parser.identifier.reserved-word":"%0% is a reserved word and cannot be used as an identifier name","mcdoc.parser.identifier.illegal":"%0% doesn't follow the format of %1%","mcdoc.parser.index-body.dynamic-index-not-allowed":"Dynamic indexing is not allowed","mcdoc.parser.inject-clause.definition-expected":"Expected either an enum inject or a compound inject","mcdoc.parser.keyword.separation":"a separation","mcdoc.parser.resource-location.colon-expected":"Expected the colon (%0%) of resource locations","mcdoc.parser.syntax.doc-comment-unexpected":"Doc comments are not allowed here; you might want to replace the three slashes with two slashes","mcdoc.runtime.checker.key-value-pair":"a key-value pair","mcdoc.runtime.checker.range.collection":"collection length to be %0%","mcdoc.runtime.checker.range.concat":"%0% and %1%","mcdoc.runtime.checker.range.left-exclusive":"above %0%","mcdoc.runtime.checker.range.left-inclusive":"at least %0%","mcdoc.runtime.checker.range.right-exclusive":"below %0%","mcdoc.runtime.checker.range.right-inclusive":"at most %0%","mcdoc.runtime.checker.range.number":"numeric value to be %0%","mcdoc.runtime.checker.range.string":"string length to be %0%","mcdoc.runtime.checker.some-missing-keys":"Missing at least one of the keys %0%","mcdoc.runtime.checker.trailing":"Trailing data encountered","mcdoc.runtime.checker.value":"a value","mcdoc.type.boolean":"a boolean","mcdoc.type.byte":"a byte","mcdoc.type.short":"a short","mcdoc.type.int":"an int","mcdoc.type.long":"a long","mcdoc.type.float":"a float","mcdoc.type.double":"a double","mcdoc.type.list":"a list","mcdoc.type.byte_array":"a byte array","mcdoc.type.int_array":"an int array","mcdoc.type.long_array":"a long array","mcdoc.type.string":"a string","mcdoc.type.struct":"a map-like","mcfunction.checker.command.data-modify-unapplicable-operation":"Operation %0% can only be used on %1%; the target path has type %2% instead","mcfunction.completer.block.states.default-value":"Default: %0%","mcfunction.parser.command-too-long":"Command with length %0% is longer than maximum length %1%","mcfunction.parser.duplicate-components":"Duplicate component","mcfunction.parser.entity-selector.arguments.not-applicable":"%0% is not applicable here","mcfunction.parser.entity-selector.arguments.unknown":"Unknown entity selector argument %0%","mcfunction.parser.entity-selector.entities-disallowed":"The selector contains non-player entities","mcfunction.parser.entity-selector.invalid":"Invalid entity selector: “%0%”","mcfunction.parser.entity-selector.multiple-disallowed":"The selector contains multiple entities","mcfunction.parser.entity-selector.player-name.too-long":"Player names cannot be longer than %0% characters","mcfunction.parser.eoc-unexpected":"Expected more arguments","mcfunction.parser.leading-slash":"a leading slash “/”","mcfunction.parser.leading-slash.unexpected":"Unexpected leading slash “/”","mcfunction.parser.macro.at-least-one":"at least one macro argument","mcfunction.parser.macro.disallowed":"Macro lines are only supported since 1.20.2","mcfunction.parser.macro.illegal-key":"Illegal key character: “%0%”","mcfunction.parser.macro.key":"a macro key","mcfunction.parser.no-permission":"Permission level %0% is required, which is higher than %1% defined in config","mcfunction.parser.objective.too-long":"Objective names cannot be longer than %0% characters","mcfunction.parser.range.min>max":"The minimum value %0% is larger than the maximum value %1%","mcfunction.parser.range.span-too-large":"The range size %0% is larger than the maximum %1%","mcfunction.parser.range.span-too-small":"The range size %0% is smaller than the minimum %1%","mcfunction.parser.score_holder.fake-name.too-long":"Fake names cannot be longer than %0% characters","mcfunction.parser.sep":"a space (%0%)","mcfunction.parser.trailing":"Trailing data encountered: %0%","mcfunction.parser.unknown-parser":"Parser %0% hasn't been supported yet","mcfunction.parser.uuid.invalid":"Invalid UUID format","mcfunction.parser.vector.local-disallowed":"Local coordinates disallowed","mcfunction.parser.vector.mixed":"Cannot mix local coordinates and world coordinates together","mcfunction.signature-help.command-documentation":"[Minecraft Wiki: `%0%` command](https://minecraft.fandom.com/wiki/Commands/%0%)","mcfunction.signature-help.argument-parser-documentation":"[Minecraft Wiki: `%0%` argument parser](https://minecraft.fandom.com/wiki/Argument_types#%0%)","missing-key":"Missing key %0%","nbt.checker.block-states.fake-boolean":"Boolean block state values should be quoted","nbt.checker.block-states.unexpected-value-type":"Block state values should be either a string or an int","nbt.checker.block-states.unknown-state":"Unknown block state %0% for the following block(s): %1%","nbt.checker.boolean.out-of-range":"A boolean value should be either %0% or %1%","nbt.checker.collection.length-between":"%0% with length between %1% and %2%","nbt.checker.compound.field.union-empty-members":"Disallowed property","nbt.checker.path.index-out-of-bound":"The provided index %0% is out of bound, as the collection can only have at most %1% elements","nbt.checker.path.unexpected-filter":"Compound filters can only be used on compound tags","nbt.checker.path.unexpected-index":"Indices can only be used on array or list tags","nbt.checker.path.unexpected-key":"String keys can only be specified for compound tags","nbt.node":"a tag","nbt.node.byte":"a byte tag","nbt.node.byte_array":"a byte array tag","nbt.node.compound":"a compound tag","nbt.node.double":"a double tag","nbt.node.float":"a float tag","nbt.node.int":"an int tag","nbt.node.int_array":"an int array tag","nbt.node.list":"a list tag","nbt.node.long":"a long tag","nbt.node.long_array":"a long array tag","nbt.node.path.end":"the end of path","nbt.node.path.filter":"a compound filter","nbt.node.path.index":"an index","nbt.node.path.key":"a key","nbt.node.short":"a short tag","nbt.node.string":"a string tag","nbt.path":"an NBT path","nbt.parser.number.out-of-range":"This looks like %0%, but it is actually %1% due to the numeral value being out of [%2%, %3%]","not-allowed-here":"Value %0% is not allowed here","not-divisible-by":"Value %0% is not divisible by %1%","not-matching-any-child":"Invalid argument type","nothing":"nothing","number":"a number","number-range":"a number range","number-range.missing-min-and-max":"Expected either a minimum value or a maximum value","number.<=":"a number smaller than or equal to %0%","number.>=":"a number greater than or equal to %0%","number.between":"a number between %0% and %1%","object":"an object","objective":"an objective","objective-not-following-convention":"Invalid objective %0% which doesn't follow %1% convention","parser.float.illegal":"Illegal float numeral that doesn't follow %0%","parser.integer.illegal":"Illegal integer that doesn't follow %0%","parser.line-continuation-end-of-file":"A line continuation cannot be the end of the file","parser.list.value":"a value","parser.list.trailing-sep":"Trailing separation","parser.long.illegal":"Illegal long numeral that doesn't follow %0%","parser.record.key":"a key","parser.record.trailing-end":"Trailing separation","parser.record.unexpected-char":"Unexpected character %0%","parser.record.value":"a value","parser.resource-location.illegal":"Illegal character(s): %0%","parser.resource-location.namespace-expected":"Namespaces cannot be omitted here","parser.resource-location.tag-disallowed":"Tags are not allowed here","parser.resource-location.tag-required":"Only tags are allowed here","parser.string.illegal-brigadier":"Encountered non-[0-9A-Za-z_.+-] characters in %0%","parser.string.illegal-escape":"Unexpected escape character %0%","parser.string.illegal-quote":"Only %0% can be used to quote strings here","parser.string.illegal-unicode-escape":"Hexadecimal digit expected","progress.initializing.title":"Initializing Spyglass…","progress.reset-project-cache.title":"Resetting Project Cache…","punc.period":".","punc.quote":"“%0%”","quote":"a quote (“'” or “\"”)","quote_prefer_double":"Double quote (“\"”) is preferable here","quote_prefer_single":"Single quote (“'”) is preferable here","resource-location":"a resource location","score-holder":"a score holder","scoreholder-not-following-convention":"Invalid score_holder %0% which doesn't follow %1% convention","selector":"a selector","server.new-version":"The Data-pack Language Server has been updated to a newer version: %0%","server.progress.fixing-workspace.begin":"Fixing all auto-fixable problems in the workspace","server.progress.fixing-workspace.report":"fixing %0%","server.progress.preparing.title":"Preparing Spyglass language features","server.remove-cache-file":"The cache file of DHP was moved to a storage location provided by VSCode. You can safely delete the ugly “.datapack” folder in your workspace root.","server.show-release-notes":"Show Release Notes","string":"a string","tag":"a tag","tag-not-following-convention":"Invalid tag %0% which doesn't follow %1% convention","team":"a team","team-not-following-convention":"Invalid team %0% which doesn't follow %1% convention","text-component":"a text component","time-unit":"a time unit","too-many-block-affected":"Too many blocks in the specified area (maximum %0%, specified %1%)","too-many-chunk-affected":"Too many chunks in the specified area (maximum %0%, specified %1%)","unexpected-character":"Found non [a-z0-9/._-] character(s)","unexpected-datapack-tag":"Tags are not allowed here","unexpected-default-namespace":"Default namespace should be omitted here","unexpected-local-coordinate":"Local coordinate %0% is not allowed","unexpected-nbt":"This tag doesn't exist here","unexpected-nbt-array-type":"Invalid array type %0%. Should be one of “B”, “I”, and “L”","unexpected-nbt-path-filter":"Compound filters are only used for compound tags","unexpected-nbt-path-index":"Indices are only used for lists/arrays tags","unexpected-nbt-path-key":"Keys are only used for compound tags","unexpected-nbt-path-sub":"The current tag doesn't have extra items","unexpected-omitted-default-namespace":"Default namespace shouldn't be omitted here","unexpected-relative-coordinate":"Relative coordinate %0% is not allowed","unexpected-scoreboard-sub-slot":"Only “sidebar” has sub slots","unknown-command":"Unknown command %0%","unknown-escape":"Unexpected escape character %0%","unknown-key":"Unknown key %0%","unquoted-string":"an unquoted string","unsorted-keys":"Unsorted keys","uuid":"a UUID","vector":"a vector"}); /***/ }), /***/ 6548: /***/ ((module) => { module.exports = /*#__PURE__*/JSON.parse('["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]'); /***/ }), /***/ 5302: /***/ ((module) => { module.exports = /*#__PURE__*/JSON.parse('{"name":"seek-bzip","version":"1.0.6","contributors":["C. Scott Ananian (http://cscott.net)","Eli Skeggs","Kevin Kwok","Rob Landley (http://landley.net)"],"description":"a pure-JavaScript Node.JS module for random-access decoding bzip2 data","main":"./lib/index.js","repository":{"type":"git","url":"https://github.com/cscott/seek-bzip.git"},"license":"MIT","bin":{"seek-bunzip":"./bin/seek-bunzip","seek-table":"./bin/seek-bzip-table"},"directories":{"test":"test"},"dependencies":{"commander":"^2.8.1"},"devDependencies":{"fibers":"~1.0.6","mocha":"~2.2.5"},"scripts":{"test":"mocha"}}'); /***/ }), /***/ 2472: /***/ ((module) => { module.exports = /*#__PURE__*/JSON.parse('[[[0,44],2],[[45,46],2],[47,2],[[48,57],2],[[58,64],2],[65,1,"a"],[66,1,"b"],[67,1,"c"],[68,1,"d"],[69,1,"e"],[70,1,"f"],[71,1,"g"],[72,1,"h"],[73,1,"i"],[74,1,"j"],[75,1,"k"],[76,1,"l"],[77,1,"m"],[78,1,"n"],[79,1,"o"],[80,1,"p"],[81,1,"q"],[82,1,"r"],[83,1,"s"],[84,1,"t"],[85,1,"u"],[86,1,"v"],[87,1,"w"],[88,1,"x"],[89,1,"y"],[90,1,"z"],[[91,96],2],[[97,122],2],[[123,127],2],[[128,159],3],[160,1," "],[[161,167],2],[168,1," ̈"],[169,2],[170,1,"a"],[[171,172],2],[173,7],[174,2],[175,1," ̄"],[[176,177],2],[178,1,"2"],[179,1,"3"],[180,1," ́"],[181,1,"μ"],[182,2],[183,2],[184,1," ̧"],[185,1,"1"],[186,1,"o"],[187,2],[188,1,"1⁄4"],[189,1,"1⁄2"],[190,1,"3⁄4"],[191,2],[192,1,"à"],[193,1,"á"],[194,1,"â"],[195,1,"ã"],[196,1,"ä"],[197,1,"å"],[198,1,"æ"],[199,1,"ç"],[200,1,"è"],[201,1,"é"],[202,1,"ê"],[203,1,"ë"],[204,1,"ì"],[205,1,"í"],[206,1,"î"],[207,1,"ï"],[208,1,"ð"],[209,1,"ñ"],[210,1,"ò"],[211,1,"ó"],[212,1,"ô"],[213,1,"õ"],[214,1,"ö"],[215,2],[216,1,"ø"],[217,1,"ù"],[218,1,"ú"],[219,1,"û"],[220,1,"ü"],[221,1,"ý"],[222,1,"þ"],[223,6,"ss"],[[224,246],2],[247,2],[[248,255],2],[256,1,"ā"],[257,2],[258,1,"ă"],[259,2],[260,1,"ą"],[261,2],[262,1,"ć"],[263,2],[264,1,"ĉ"],[265,2],[266,1,"ċ"],[267,2],[268,1,"č"],[269,2],[270,1,"ď"],[271,2],[272,1,"đ"],[273,2],[274,1,"ē"],[275,2],[276,1,"ĕ"],[277,2],[278,1,"ė"],[279,2],[280,1,"ę"],[281,2],[282,1,"ě"],[283,2],[284,1,"ĝ"],[285,2],[286,1,"ğ"],[287,2],[288,1,"ġ"],[289,2],[290,1,"ģ"],[291,2],[292,1,"ĥ"],[293,2],[294,1,"ħ"],[295,2],[296,1,"ĩ"],[297,2],[298,1,"ī"],[299,2],[300,1,"ĭ"],[301,2],[302,1,"į"],[303,2],[304,1,"i̇"],[305,2],[[306,307],1,"ij"],[308,1,"ĵ"],[309,2],[310,1,"ķ"],[[311,312],2],[313,1,"ĺ"],[314,2],[315,1,"ļ"],[316,2],[317,1,"ľ"],[318,2],[[319,320],1,"l·"],[321,1,"ł"],[322,2],[323,1,"ń"],[324,2],[325,1,"ņ"],[326,2],[327,1,"ň"],[328,2],[329,1,"ʼn"],[330,1,"ŋ"],[331,2],[332,1,"ō"],[333,2],[334,1,"ŏ"],[335,2],[336,1,"ő"],[337,2],[338,1,"œ"],[339,2],[340,1,"ŕ"],[341,2],[342,1,"ŗ"],[343,2],[344,1,"ř"],[345,2],[346,1,"ś"],[347,2],[348,1,"ŝ"],[349,2],[350,1,"ş"],[351,2],[352,1,"š"],[353,2],[354,1,"ţ"],[355,2],[356,1,"ť"],[357,2],[358,1,"ŧ"],[359,2],[360,1,"ũ"],[361,2],[362,1,"ū"],[363,2],[364,1,"ŭ"],[365,2],[366,1,"ů"],[367,2],[368,1,"ű"],[369,2],[370,1,"ų"],[371,2],[372,1,"ŵ"],[373,2],[374,1,"ŷ"],[375,2],[376,1,"ÿ"],[377,1,"ź"],[378,2],[379,1,"ż"],[380,2],[381,1,"ž"],[382,2],[383,1,"s"],[384,2],[385,1,"ɓ"],[386,1,"ƃ"],[387,2],[388,1,"ƅ"],[389,2],[390,1,"ɔ"],[391,1,"ƈ"],[392,2],[393,1,"ɖ"],[394,1,"ɗ"],[395,1,"ƌ"],[[396,397],2],[398,1,"ǝ"],[399,1,"ə"],[400,1,"ɛ"],[401,1,"ƒ"],[402,2],[403,1,"ɠ"],[404,1,"ɣ"],[405,2],[406,1,"ɩ"],[407,1,"ɨ"],[408,1,"ƙ"],[[409,411],2],[412,1,"ɯ"],[413,1,"ɲ"],[414,2],[415,1,"ɵ"],[416,1,"ơ"],[417,2],[418,1,"ƣ"],[419,2],[420,1,"ƥ"],[421,2],[422,1,"ʀ"],[423,1,"ƨ"],[424,2],[425,1,"ʃ"],[[426,427],2],[428,1,"ƭ"],[429,2],[430,1,"ʈ"],[431,1,"ư"],[432,2],[433,1,"ʊ"],[434,1,"ʋ"],[435,1,"ƴ"],[436,2],[437,1,"ƶ"],[438,2],[439,1,"ʒ"],[440,1,"ƹ"],[[441,443],2],[444,1,"ƽ"],[[445,451],2],[[452,454],1,"dž"],[[455,457],1,"lj"],[[458,460],1,"nj"],[461,1,"ǎ"],[462,2],[463,1,"ǐ"],[464,2],[465,1,"ǒ"],[466,2],[467,1,"ǔ"],[468,2],[469,1,"ǖ"],[470,2],[471,1,"ǘ"],[472,2],[473,1,"ǚ"],[474,2],[475,1,"ǜ"],[[476,477],2],[478,1,"ǟ"],[479,2],[480,1,"ǡ"],[481,2],[482,1,"ǣ"],[483,2],[484,1,"ǥ"],[485,2],[486,1,"ǧ"],[487,2],[488,1,"ǩ"],[489,2],[490,1,"ǫ"],[491,2],[492,1,"ǭ"],[493,2],[494,1,"ǯ"],[[495,496],2],[[497,499],1,"dz"],[500,1,"ǵ"],[501,2],[502,1,"ƕ"],[503,1,"ƿ"],[504,1,"ǹ"],[505,2],[506,1,"ǻ"],[507,2],[508,1,"ǽ"],[509,2],[510,1,"ǿ"],[511,2],[512,1,"ȁ"],[513,2],[514,1,"ȃ"],[515,2],[516,1,"ȅ"],[517,2],[518,1,"ȇ"],[519,2],[520,1,"ȉ"],[521,2],[522,1,"ȋ"],[523,2],[524,1,"ȍ"],[525,2],[526,1,"ȏ"],[527,2],[528,1,"ȑ"],[529,2],[530,1,"ȓ"],[531,2],[532,1,"ȕ"],[533,2],[534,1,"ȗ"],[535,2],[536,1,"ș"],[537,2],[538,1,"ț"],[539,2],[540,1,"ȝ"],[541,2],[542,1,"ȟ"],[543,2],[544,1,"ƞ"],[545,2],[546,1,"ȣ"],[547,2],[548,1,"ȥ"],[549,2],[550,1,"ȧ"],[551,2],[552,1,"ȩ"],[553,2],[554,1,"ȫ"],[555,2],[556,1,"ȭ"],[557,2],[558,1,"ȯ"],[559,2],[560,1,"ȱ"],[561,2],[562,1,"ȳ"],[563,2],[[564,566],2],[[567,569],2],[570,1,"ⱥ"],[571,1,"ȼ"],[572,2],[573,1,"ƚ"],[574,1,"ⱦ"],[[575,576],2],[577,1,"ɂ"],[578,2],[579,1,"ƀ"],[580,1,"ʉ"],[581,1,"ʌ"],[582,1,"ɇ"],[583,2],[584,1,"ɉ"],[585,2],[586,1,"ɋ"],[587,2],[588,1,"ɍ"],[589,2],[590,1,"ɏ"],[591,2],[[592,680],2],[[681,685],2],[[686,687],2],[688,1,"h"],[689,1,"ɦ"],[690,1,"j"],[691,1,"r"],[692,1,"ɹ"],[693,1,"ɻ"],[694,1,"ʁ"],[695,1,"w"],[696,1,"y"],[[697,705],2],[[706,709],2],[[710,721],2],[[722,727],2],[728,1," ̆"],[729,1," ̇"],[730,1," ̊"],[731,1," ̨"],[732,1," ̃"],[733,1," ̋"],[734,2],[735,2],[736,1,"ɣ"],[737,1,"l"],[738,1,"s"],[739,1,"x"],[740,1,"ʕ"],[[741,745],2],[[746,747],2],[748,2],[749,2],[750,2],[[751,767],2],[[768,831],2],[832,1,"̀"],[833,1,"́"],[834,2],[835,1,"̓"],[836,1,"̈́"],[837,1,"ι"],[[838,846],2],[847,7],[[848,855],2],[[856,860],2],[[861,863],2],[[864,865],2],[866,2],[[867,879],2],[880,1,"ͱ"],[881,2],[882,1,"ͳ"],[883,2],[884,1,"ʹ"],[885,2],[886,1,"ͷ"],[887,2],[[888,889],3],[890,1," ι"],[[891,893],2],[894,1,";"],[895,1,"ϳ"],[[896,899],3],[900,1," ́"],[901,1," ̈́"],[902,1,"ά"],[903,1,"·"],[904,1,"έ"],[905,1,"ή"],[906,1,"ί"],[907,3],[908,1,"ό"],[909,3],[910,1,"ύ"],[911,1,"ώ"],[912,2],[913,1,"α"],[914,1,"β"],[915,1,"γ"],[916,1,"δ"],[917,1,"ε"],[918,1,"ζ"],[919,1,"η"],[920,1,"θ"],[921,1,"ι"],[922,1,"κ"],[923,1,"λ"],[924,1,"μ"],[925,1,"ν"],[926,1,"ξ"],[927,1,"ο"],[928,1,"π"],[929,1,"ρ"],[930,3],[931,1,"σ"],[932,1,"τ"],[933,1,"υ"],[934,1,"φ"],[935,1,"χ"],[936,1,"ψ"],[937,1,"ω"],[938,1,"ϊ"],[939,1,"ϋ"],[[940,961],2],[962,6,"σ"],[[963,974],2],[975,1,"ϗ"],[976,1,"β"],[977,1,"θ"],[978,1,"υ"],[979,1,"ύ"],[980,1,"ϋ"],[981,1,"φ"],[982,1,"π"],[983,2],[984,1,"ϙ"],[985,2],[986,1,"ϛ"],[987,2],[988,1,"ϝ"],[989,2],[990,1,"ϟ"],[991,2],[992,1,"ϡ"],[993,2],[994,1,"ϣ"],[995,2],[996,1,"ϥ"],[997,2],[998,1,"ϧ"],[999,2],[1000,1,"ϩ"],[1001,2],[1002,1,"ϫ"],[1003,2],[1004,1,"ϭ"],[1005,2],[1006,1,"ϯ"],[1007,2],[1008,1,"κ"],[1009,1,"ρ"],[1010,1,"σ"],[1011,2],[1012,1,"θ"],[1013,1,"ε"],[1014,2],[1015,1,"ϸ"],[1016,2],[1017,1,"σ"],[1018,1,"ϻ"],[1019,2],[1020,2],[1021,1,"ͻ"],[1022,1,"ͼ"],[1023,1,"ͽ"],[1024,1,"ѐ"],[1025,1,"ё"],[1026,1,"ђ"],[1027,1,"ѓ"],[1028,1,"є"],[1029,1,"ѕ"],[1030,1,"і"],[1031,1,"ї"],[1032,1,"ј"],[1033,1,"љ"],[1034,1,"њ"],[1035,1,"ћ"],[1036,1,"ќ"],[1037,1,"ѝ"],[1038,1,"ў"],[1039,1,"џ"],[1040,1,"а"],[1041,1,"б"],[1042,1,"в"],[1043,1,"г"],[1044,1,"д"],[1045,1,"е"],[1046,1,"ж"],[1047,1,"з"],[1048,1,"и"],[1049,1,"й"],[1050,1,"к"],[1051,1,"л"],[1052,1,"м"],[1053,1,"н"],[1054,1,"о"],[1055,1,"п"],[1056,1,"р"],[1057,1,"с"],[1058,1,"т"],[1059,1,"у"],[1060,1,"ф"],[1061,1,"х"],[1062,1,"ц"],[1063,1,"ч"],[1064,1,"ш"],[1065,1,"щ"],[1066,1,"ъ"],[1067,1,"ы"],[1068,1,"ь"],[1069,1,"э"],[1070,1,"ю"],[1071,1,"я"],[[1072,1103],2],[1104,2],[[1105,1116],2],[1117,2],[[1118,1119],2],[1120,1,"ѡ"],[1121,2],[1122,1,"ѣ"],[1123,2],[1124,1,"ѥ"],[1125,2],[1126,1,"ѧ"],[1127,2],[1128,1,"ѩ"],[1129,2],[1130,1,"ѫ"],[1131,2],[1132,1,"ѭ"],[1133,2],[1134,1,"ѯ"],[1135,2],[1136,1,"ѱ"],[1137,2],[1138,1,"ѳ"],[1139,2],[1140,1,"ѵ"],[1141,2],[1142,1,"ѷ"],[1143,2],[1144,1,"ѹ"],[1145,2],[1146,1,"ѻ"],[1147,2],[1148,1,"ѽ"],[1149,2],[1150,1,"ѿ"],[1151,2],[1152,1,"ҁ"],[1153,2],[1154,2],[[1155,1158],2],[1159,2],[[1160,1161],2],[1162,1,"ҋ"],[1163,2],[1164,1,"ҍ"],[1165,2],[1166,1,"ҏ"],[1167,2],[1168,1,"ґ"],[1169,2],[1170,1,"ғ"],[1171,2],[1172,1,"ҕ"],[1173,2],[1174,1,"җ"],[1175,2],[1176,1,"ҙ"],[1177,2],[1178,1,"қ"],[1179,2],[1180,1,"ҝ"],[1181,2],[1182,1,"ҟ"],[1183,2],[1184,1,"ҡ"],[1185,2],[1186,1,"ң"],[1187,2],[1188,1,"ҥ"],[1189,2],[1190,1,"ҧ"],[1191,2],[1192,1,"ҩ"],[1193,2],[1194,1,"ҫ"],[1195,2],[1196,1,"ҭ"],[1197,2],[1198,1,"ү"],[1199,2],[1200,1,"ұ"],[1201,2],[1202,1,"ҳ"],[1203,2],[1204,1,"ҵ"],[1205,2],[1206,1,"ҷ"],[1207,2],[1208,1,"ҹ"],[1209,2],[1210,1,"һ"],[1211,2],[1212,1,"ҽ"],[1213,2],[1214,1,"ҿ"],[1215,2],[1216,1,"ӏ"],[1217,1,"ӂ"],[1218,2],[1219,1,"ӄ"],[1220,2],[1221,1,"ӆ"],[1222,2],[1223,1,"ӈ"],[1224,2],[1225,1,"ӊ"],[1226,2],[1227,1,"ӌ"],[1228,2],[1229,1,"ӎ"],[1230,2],[1231,2],[1232,1,"ӑ"],[1233,2],[1234,1,"ӓ"],[1235,2],[1236,1,"ӕ"],[1237,2],[1238,1,"ӗ"],[1239,2],[1240,1,"ә"],[1241,2],[1242,1,"ӛ"],[1243,2],[1244,1,"ӝ"],[1245,2],[1246,1,"ӟ"],[1247,2],[1248,1,"ӡ"],[1249,2],[1250,1,"ӣ"],[1251,2],[1252,1,"ӥ"],[1253,2],[1254,1,"ӧ"],[1255,2],[1256,1,"ө"],[1257,2],[1258,1,"ӫ"],[1259,2],[1260,1,"ӭ"],[1261,2],[1262,1,"ӯ"],[1263,2],[1264,1,"ӱ"],[1265,2],[1266,1,"ӳ"],[1267,2],[1268,1,"ӵ"],[1269,2],[1270,1,"ӷ"],[1271,2],[1272,1,"ӹ"],[1273,2],[1274,1,"ӻ"],[1275,2],[1276,1,"ӽ"],[1277,2],[1278,1,"ӿ"],[1279,2],[1280,1,"ԁ"],[1281,2],[1282,1,"ԃ"],[1283,2],[1284,1,"ԅ"],[1285,2],[1286,1,"ԇ"],[1287,2],[1288,1,"ԉ"],[1289,2],[1290,1,"ԋ"],[1291,2],[1292,1,"ԍ"],[1293,2],[1294,1,"ԏ"],[1295,2],[1296,1,"ԑ"],[1297,2],[1298,1,"ԓ"],[1299,2],[1300,1,"ԕ"],[1301,2],[1302,1,"ԗ"],[1303,2],[1304,1,"ԙ"],[1305,2],[1306,1,"ԛ"],[1307,2],[1308,1,"ԝ"],[1309,2],[1310,1,"ԟ"],[1311,2],[1312,1,"ԡ"],[1313,2],[1314,1,"ԣ"],[1315,2],[1316,1,"ԥ"],[1317,2],[1318,1,"ԧ"],[1319,2],[1320,1,"ԩ"],[1321,2],[1322,1,"ԫ"],[1323,2],[1324,1,"ԭ"],[1325,2],[1326,1,"ԯ"],[1327,2],[1328,3],[1329,1,"ա"],[1330,1,"բ"],[1331,1,"գ"],[1332,1,"դ"],[1333,1,"ե"],[1334,1,"զ"],[1335,1,"է"],[1336,1,"ը"],[1337,1,"թ"],[1338,1,"ժ"],[1339,1,"ի"],[1340,1,"լ"],[1341,1,"խ"],[1342,1,"ծ"],[1343,1,"կ"],[1344,1,"հ"],[1345,1,"ձ"],[1346,1,"ղ"],[1347,1,"ճ"],[1348,1,"մ"],[1349,1,"յ"],[1350,1,"ն"],[1351,1,"շ"],[1352,1,"ո"],[1353,1,"չ"],[1354,1,"պ"],[1355,1,"ջ"],[1356,1,"ռ"],[1357,1,"ս"],[1358,1,"վ"],[1359,1,"տ"],[1360,1,"ր"],[1361,1,"ց"],[1362,1,"ւ"],[1363,1,"փ"],[1364,1,"ք"],[1365,1,"օ"],[1366,1,"ֆ"],[[1367,1368],3],[1369,2],[[1370,1375],2],[1376,2],[[1377,1414],2],[1415,1,"եւ"],[1416,2],[1417,2],[1418,2],[[1419,1420],3],[[1421,1422],2],[1423,2],[1424,3],[[1425,1441],2],[1442,2],[[1443,1455],2],[[1456,1465],2],[1466,2],[[1467,1469],2],[1470,2],[1471,2],[1472,2],[[1473,1474],2],[1475,2],[1476,2],[1477,2],[1478,2],[1479,2],[[1480,1487],3],[[1488,1514],2],[[1515,1518],3],[1519,2],[[1520,1524],2],[[1525,1535],3],[[1536,1539],3],[1540,3],[1541,3],[[1542,1546],2],[1547,2],[1548,2],[[1549,1551],2],[[1552,1557],2],[[1558,1562],2],[1563,2],[1564,3],[1565,2],[1566,2],[1567,2],[1568,2],[[1569,1594],2],[[1595,1599],2],[1600,2],[[1601,1618],2],[[1619,1621],2],[[1622,1624],2],[[1625,1630],2],[1631,2],[[1632,1641],2],[[1642,1645],2],[[1646,1647],2],[[1648,1652],2],[1653,1,"اٴ"],[1654,1,"وٴ"],[1655,1,"ۇٴ"],[1656,1,"يٴ"],[[1657,1719],2],[[1720,1721],2],[[1722,1726],2],[1727,2],[[1728,1742],2],[1743,2],[[1744,1747],2],[1748,2],[[1749,1756],2],[1757,3],[1758,2],[[1759,1768],2],[1769,2],[[1770,1773],2],[[1774,1775],2],[[1776,1785],2],[[1786,1790],2],[1791,2],[[1792,1805],2],[1806,3],[1807,3],[[1808,1836],2],[[1837,1839],2],[[1840,1866],2],[[1867,1868],3],[[1869,1871],2],[[1872,1901],2],[[1902,1919],2],[[1920,1968],2],[1969,2],[[1970,1983],3],[[1984,2037],2],[[2038,2042],2],[[2043,2044],3],[2045,2],[[2046,2047],2],[[2048,2093],2],[[2094,2095],3],[[2096,2110],2],[2111,3],[[2112,2139],2],[[2140,2141],3],[2142,2],[2143,3],[[2144,2154],2],[[2155,2159],3],[[2160,2183],2],[2184,2],[[2185,2190],2],[2191,3],[[2192,2193],3],[[2194,2198],3],[2199,2],[[2200,2207],2],[2208,2],[2209,2],[[2210,2220],2],[[2221,2226],2],[[2227,2228],2],[2229,2],[[2230,2237],2],[[2238,2247],2],[[2248,2258],2],[2259,2],[[2260,2273],2],[2274,3],[2275,2],[[2276,2302],2],[2303,2],[2304,2],[[2305,2307],2],[2308,2],[[2309,2361],2],[[2362,2363],2],[[2364,2381],2],[2382,2],[2383,2],[[2384,2388],2],[2389,2],[[2390,2391],2],[2392,1,"क़"],[2393,1,"ख़"],[2394,1,"ग़"],[2395,1,"ज़"],[2396,1,"ड़"],[2397,1,"ढ़"],[2398,1,"फ़"],[2399,1,"य़"],[[2400,2403],2],[[2404,2405],2],[[2406,2415],2],[2416,2],[[2417,2418],2],[[2419,2423],2],[2424,2],[[2425,2426],2],[[2427,2428],2],[2429,2],[[2430,2431],2],[2432,2],[[2433,2435],2],[2436,3],[[2437,2444],2],[[2445,2446],3],[[2447,2448],2],[[2449,2450],3],[[2451,2472],2],[2473,3],[[2474,2480],2],[2481,3],[2482,2],[[2483,2485],3],[[2486,2489],2],[[2490,2491],3],[2492,2],[2493,2],[[2494,2500],2],[[2501,2502],3],[[2503,2504],2],[[2505,2506],3],[[2507,2509],2],[2510,2],[[2511,2518],3],[2519,2],[[2520,2523],3],[2524,1,"ড়"],[2525,1,"ঢ়"],[2526,3],[2527,1,"য়"],[[2528,2531],2],[[2532,2533],3],[[2534,2545],2],[[2546,2554],2],[2555,2],[2556,2],[2557,2],[2558,2],[[2559,2560],3],[2561,2],[2562,2],[2563,2],[2564,3],[[2565,2570],2],[[2571,2574],3],[[2575,2576],2],[[2577,2578],3],[[2579,2600],2],[2601,3],[[2602,2608],2],[2609,3],[2610,2],[2611,1,"ਲ਼"],[2612,3],[2613,2],[2614,1,"ਸ਼"],[2615,3],[[2616,2617],2],[[2618,2619],3],[2620,2],[2621,3],[[2622,2626],2],[[2627,2630],3],[[2631,2632],2],[[2633,2634],3],[[2635,2637],2],[[2638,2640],3],[2641,2],[[2642,2648],3],[2649,1,"ਖ਼"],[2650,1,"ਗ਼"],[2651,1,"ਜ਼"],[2652,2],[2653,3],[2654,1,"ਫ਼"],[[2655,2661],3],[[2662,2676],2],[2677,2],[2678,2],[[2679,2688],3],[[2689,2691],2],[2692,3],[[2693,2699],2],[2700,2],[2701,2],[2702,3],[[2703,2705],2],[2706,3],[[2707,2728],2],[2729,3],[[2730,2736],2],[2737,3],[[2738,2739],2],[2740,3],[[2741,2745],2],[[2746,2747],3],[[2748,2757],2],[2758,3],[[2759,2761],2],[2762,3],[[2763,2765],2],[[2766,2767],3],[2768,2],[[2769,2783],3],[2784,2],[[2785,2787],2],[[2788,2789],3],[[2790,2799],2],[2800,2],[2801,2],[[2802,2808],3],[2809,2],[[2810,2815],2],[2816,3],[[2817,2819],2],[2820,3],[[2821,2828],2],[[2829,2830],3],[[2831,2832],2],[[2833,2834],3],[[2835,2856],2],[2857,3],[[2858,2864],2],[2865,3],[[2866,2867],2],[2868,3],[2869,2],[[2870,2873],2],[[2874,2875],3],[[2876,2883],2],[2884,2],[[2885,2886],3],[[2887,2888],2],[[2889,2890],3],[[2891,2893],2],[[2894,2900],3],[2901,2],[[2902,2903],2],[[2904,2907],3],[2908,1,"ଡ଼"],[2909,1,"ଢ଼"],[2910,3],[[2911,2913],2],[[2914,2915],2],[[2916,2917],3],[[2918,2927],2],[2928,2],[2929,2],[[2930,2935],2],[[2936,2945],3],[[2946,2947],2],[2948,3],[[2949,2954],2],[[2955,2957],3],[[2958,2960],2],[2961,3],[[2962,2965],2],[[2966,2968],3],[[2969,2970],2],[2971,3],[2972,2],[2973,3],[[2974,2975],2],[[2976,2978],3],[[2979,2980],2],[[2981,2983],3],[[2984,2986],2],[[2987,2989],3],[[2990,2997],2],[2998,2],[[2999,3001],2],[[3002,3005],3],[[3006,3010],2],[[3011,3013],3],[[3014,3016],2],[3017,3],[[3018,3021],2],[[3022,3023],3],[3024,2],[[3025,3030],3],[3031,2],[[3032,3045],3],[3046,2],[[3047,3055],2],[[3056,3058],2],[[3059,3066],2],[[3067,3071],3],[3072,2],[[3073,3075],2],[3076,2],[[3077,3084],2],[3085,3],[[3086,3088],2],[3089,3],[[3090,3112],2],[3113,3],[[3114,3123],2],[3124,2],[[3125,3129],2],[[3130,3131],3],[3132,2],[3133,2],[[3134,3140],2],[3141,3],[[3142,3144],2],[3145,3],[[3146,3149],2],[[3150,3156],3],[[3157,3158],2],[3159,3],[[3160,3161],2],[3162,2],[[3163,3164],3],[3165,2],[[3166,3167],3],[[3168,3169],2],[[3170,3171],2],[[3172,3173],3],[[3174,3183],2],[[3184,3190],3],[3191,2],[[3192,3199],2],[3200,2],[3201,2],[[3202,3203],2],[3204,2],[[3205,3212],2],[3213,3],[[3214,3216],2],[3217,3],[[3218,3240],2],[3241,3],[[3242,3251],2],[3252,3],[[3253,3257],2],[[3258,3259],3],[[3260,3261],2],[[3262,3268],2],[3269,3],[[3270,3272],2],[3273,3],[[3274,3277],2],[[3278,3284],3],[[3285,3286],2],[[3287,3292],3],[3293,2],[3294,2],[3295,3],[[3296,3297],2],[[3298,3299],2],[[3300,3301],3],[[3302,3311],2],[3312,3],[[3313,3314],2],[3315,2],[[3316,3327],3],[3328,2],[3329,2],[[3330,3331],2],[3332,2],[[3333,3340],2],[3341,3],[[3342,3344],2],[3345,3],[[3346,3368],2],[3369,2],[[3370,3385],2],[3386,2],[[3387,3388],2],[3389,2],[[3390,3395],2],[3396,2],[3397,3],[[3398,3400],2],[3401,3],[[3402,3405],2],[3406,2],[3407,2],[[3408,3411],3],[[3412,3414],2],[3415,2],[[3416,3422],2],[3423,2],[[3424,3425],2],[[3426,3427],2],[[3428,3429],3],[[3430,3439],2],[[3440,3445],2],[[3446,3448],2],[3449,2],[[3450,3455],2],[3456,3],[3457,2],[[3458,3459],2],[3460,3],[[3461,3478],2],[[3479,3481],3],[[3482,3505],2],[3506,3],[[3507,3515],2],[3516,3],[3517,2],[[3518,3519],3],[[3520,3526],2],[[3527,3529],3],[3530,2],[[3531,3534],3],[[3535,3540],2],[3541,3],[3542,2],[3543,3],[[3544,3551],2],[[3552,3557],3],[[3558,3567],2],[[3568,3569],3],[[3570,3571],2],[3572,2],[[3573,3584],3],[[3585,3634],2],[3635,1,"ํา"],[[3636,3642],2],[[3643,3646],3],[3647,2],[[3648,3662],2],[3663,2],[[3664,3673],2],[[3674,3675],2],[[3676,3712],3],[[3713,3714],2],[3715,3],[3716,2],[3717,3],[3718,2],[[3719,3720],2],[3721,2],[3722,2],[3723,3],[3724,2],[3725,2],[[3726,3731],2],[[3732,3735],2],[3736,2],[[3737,3743],2],[3744,2],[[3745,3747],2],[3748,3],[3749,2],[3750,3],[3751,2],[[3752,3753],2],[[3754,3755],2],[3756,2],[[3757,3762],2],[3763,1,"ໍາ"],[[3764,3769],2],[3770,2],[[3771,3773],2],[[3774,3775],3],[[3776,3780],2],[3781,3],[3782,2],[3783,3],[[3784,3789],2],[3790,2],[3791,3],[[3792,3801],2],[[3802,3803],3],[3804,1,"ຫນ"],[3805,1,"ຫມ"],[[3806,3807],2],[[3808,3839],3],[3840,2],[[3841,3850],2],[3851,2],[3852,1,"་"],[[3853,3863],2],[[3864,3865],2],[[3866,3871],2],[[3872,3881],2],[[3882,3892],2],[3893,2],[3894,2],[3895,2],[3896,2],[3897,2],[[3898,3901],2],[[3902,3906],2],[3907,1,"གྷ"],[[3908,3911],2],[3912,3],[[3913,3916],2],[3917,1,"ཌྷ"],[[3918,3921],2],[3922,1,"དྷ"],[[3923,3926],2],[3927,1,"བྷ"],[[3928,3931],2],[3932,1,"ཛྷ"],[[3933,3944],2],[3945,1,"ཀྵ"],[3946,2],[[3947,3948],2],[[3949,3952],3],[[3953,3954],2],[3955,1,"ཱི"],[3956,2],[3957,1,"ཱུ"],[3958,1,"ྲྀ"],[3959,1,"ྲཱྀ"],[3960,1,"ླྀ"],[3961,1,"ླཱྀ"],[[3962,3968],2],[3969,1,"ཱྀ"],[[3970,3972],2],[3973,2],[[3974,3979],2],[[3980,3983],2],[[3984,3986],2],[3987,1,"ྒྷ"],[[3988,3989],2],[3990,2],[3991,2],[3992,3],[[3993,3996],2],[3997,1,"ྜྷ"],[[3998,4001],2],[4002,1,"ྡྷ"],[[4003,4006],2],[4007,1,"ྦྷ"],[[4008,4011],2],[4012,1,"ྫྷ"],[4013,2],[[4014,4016],2],[[4017,4023],2],[4024,2],[4025,1,"ྐྵ"],[[4026,4028],2],[4029,3],[[4030,4037],2],[4038,2],[[4039,4044],2],[4045,3],[4046,2],[4047,2],[[4048,4049],2],[[4050,4052],2],[[4053,4056],2],[[4057,4058],2],[[4059,4095],3],[[4096,4129],2],[4130,2],[[4131,4135],2],[4136,2],[[4137,4138],2],[4139,2],[[4140,4146],2],[[4147,4149],2],[[4150,4153],2],[[4154,4159],2],[[4160,4169],2],[[4170,4175],2],[[4176,4185],2],[[4186,4249],2],[[4250,4253],2],[[4254,4255],2],[4256,1,"ⴀ"],[4257,1,"ⴁ"],[4258,1,"ⴂ"],[4259,1,"ⴃ"],[4260,1,"ⴄ"],[4261,1,"ⴅ"],[4262,1,"ⴆ"],[4263,1,"ⴇ"],[4264,1,"ⴈ"],[4265,1,"ⴉ"],[4266,1,"ⴊ"],[4267,1,"ⴋ"],[4268,1,"ⴌ"],[4269,1,"ⴍ"],[4270,1,"ⴎ"],[4271,1,"ⴏ"],[4272,1,"ⴐ"],[4273,1,"ⴑ"],[4274,1,"ⴒ"],[4275,1,"ⴓ"],[4276,1,"ⴔ"],[4277,1,"ⴕ"],[4278,1,"ⴖ"],[4279,1,"ⴗ"],[4280,1,"ⴘ"],[4281,1,"ⴙ"],[4282,1,"ⴚ"],[4283,1,"ⴛ"],[4284,1,"ⴜ"],[4285,1,"ⴝ"],[4286,1,"ⴞ"],[4287,1,"ⴟ"],[4288,1,"ⴠ"],[4289,1,"ⴡ"],[4290,1,"ⴢ"],[4291,1,"ⴣ"],[4292,1,"ⴤ"],[4293,1,"ⴥ"],[4294,3],[4295,1,"ⴧ"],[[4296,4300],3],[4301,1,"ⴭ"],[[4302,4303],3],[[4304,4342],2],[[4343,4344],2],[[4345,4346],2],[4347,2],[4348,1,"ნ"],[[4349,4351],2],[[4352,4441],2],[[4442,4446],2],[[4447,4448],7],[[4449,4514],2],[[4515,4519],2],[[4520,4601],2],[[4602,4607],2],[[4608,4614],2],[4615,2],[[4616,4678],2],[4679,2],[4680,2],[4681,3],[[4682,4685],2],[[4686,4687],3],[[4688,4694],2],[4695,3],[4696,2],[4697,3],[[4698,4701],2],[[4702,4703],3],[[4704,4742],2],[4743,2],[4744,2],[4745,3],[[4746,4749],2],[[4750,4751],3],[[4752,4782],2],[4783,2],[4784,2],[4785,3],[[4786,4789],2],[[4790,4791],3],[[4792,4798],2],[4799,3],[4800,2],[4801,3],[[4802,4805],2],[[4806,4807],3],[[4808,4814],2],[4815,2],[[4816,4822],2],[4823,3],[[4824,4846],2],[4847,2],[[4848,4878],2],[4879,2],[4880,2],[4881,3],[[4882,4885],2],[[4886,4887],3],[[4888,4894],2],[4895,2],[[4896,4934],2],[4935,2],[[4936,4954],2],[[4955,4956],3],[[4957,4958],2],[4959,2],[4960,2],[[4961,4988],2],[[4989,4991],3],[[4992,5007],2],[[5008,5017],2],[[5018,5023],3],[[5024,5108],2],[5109,2],[[5110,5111],3],[5112,1,"Ᏸ"],[5113,1,"Ᏹ"],[5114,1,"Ᏺ"],[5115,1,"Ᏻ"],[5116,1,"Ᏼ"],[5117,1,"Ᏽ"],[[5118,5119],3],[5120,2],[[5121,5740],2],[[5741,5742],2],[[5743,5750],2],[[5751,5759],2],[5760,3],[[5761,5786],2],[[5787,5788],2],[[5789,5791],3],[[5792,5866],2],[[5867,5872],2],[[5873,5880],2],[[5881,5887],3],[[5888,5900],2],[5901,2],[[5902,5908],2],[5909,2],[[5910,5918],3],[5919,2],[[5920,5940],2],[[5941,5942],2],[[5943,5951],3],[[5952,5971],2],[[5972,5983],3],[[5984,5996],2],[5997,3],[[5998,6000],2],[6001,3],[[6002,6003],2],[[6004,6015],3],[[6016,6067],2],[[6068,6069],7],[[6070,6099],2],[[6100,6102],2],[6103,2],[[6104,6107],2],[6108,2],[6109,2],[[6110,6111],3],[[6112,6121],2],[[6122,6127],3],[[6128,6137],2],[[6138,6143],3],[[6144,6154],2],[[6155,6158],7],[6159,7],[[6160,6169],2],[[6170,6175],3],[[6176,6263],2],[6264,2],[[6265,6271],3],[[6272,6313],2],[6314,2],[[6315,6319],3],[[6320,6389],2],[[6390,6399],3],[[6400,6428],2],[[6429,6430],2],[6431,3],[[6432,6443],2],[[6444,6447],3],[[6448,6459],2],[[6460,6463],3],[6464,2],[[6465,6467],3],[[6468,6469],2],[[6470,6509],2],[[6510,6511],3],[[6512,6516],2],[[6517,6527],3],[[6528,6569],2],[[6570,6571],2],[[6572,6575],3],[[6576,6601],2],[[6602,6607],3],[[6608,6617],2],[6618,2],[[6619,6621],3],[[6622,6623],2],[[6624,6655],2],[[6656,6683],2],[[6684,6685],3],[[6686,6687],2],[[6688,6750],2],[6751,3],[[6752,6780],2],[[6781,6782],3],[[6783,6793],2],[[6794,6799],3],[[6800,6809],2],[[6810,6815],3],[[6816,6822],2],[6823,2],[[6824,6829],2],[[6830,6831],3],[[6832,6845],2],[6846,2],[[6847,6848],2],[[6849,6862],2],[[6863,6911],3],[[6912,6987],2],[6988,2],[6989,3],[[6990,6991],2],[[6992,7001],2],[[7002,7018],2],[[7019,7027],2],[[7028,7036],2],[[7037,7038],2],[7039,2],[[7040,7082],2],[[7083,7085],2],[[7086,7097],2],[[7098,7103],2],[[7104,7155],2],[[7156,7163],3],[[7164,7167],2],[[7168,7223],2],[[7224,7226],3],[[7227,7231],2],[[7232,7241],2],[[7242,7244],3],[[7245,7293],2],[[7294,7295],2],[7296,1,"в"],[7297,1,"д"],[7298,1,"о"],[7299,1,"с"],[[7300,7301],1,"т"],[7302,1,"ъ"],[7303,1,"ѣ"],[7304,1,"ꙋ"],[7305,1,"ᲊ"],[7306,2],[[7307,7311],3],[7312,1,"ა"],[7313,1,"ბ"],[7314,1,"გ"],[7315,1,"დ"],[7316,1,"ე"],[7317,1,"ვ"],[7318,1,"ზ"],[7319,1,"თ"],[7320,1,"ი"],[7321,1,"კ"],[7322,1,"ლ"],[7323,1,"მ"],[7324,1,"ნ"],[7325,1,"ო"],[7326,1,"პ"],[7327,1,"ჟ"],[7328,1,"რ"],[7329,1,"ს"],[7330,1,"ტ"],[7331,1,"უ"],[7332,1,"ფ"],[7333,1,"ქ"],[7334,1,"ღ"],[7335,1,"ყ"],[7336,1,"შ"],[7337,1,"ჩ"],[7338,1,"ც"],[7339,1,"ძ"],[7340,1,"წ"],[7341,1,"ჭ"],[7342,1,"ხ"],[7343,1,"ჯ"],[7344,1,"ჰ"],[7345,1,"ჱ"],[7346,1,"ჲ"],[7347,1,"ჳ"],[7348,1,"ჴ"],[7349,1,"ჵ"],[7350,1,"ჶ"],[7351,1,"ჷ"],[7352,1,"ჸ"],[7353,1,"ჹ"],[7354,1,"ჺ"],[[7355,7356],3],[7357,1,"ჽ"],[7358,1,"ჾ"],[7359,1,"ჿ"],[[7360,7367],2],[[7368,7375],3],[[7376,7378],2],[7379,2],[[7380,7410],2],[[7411,7414],2],[7415,2],[[7416,7417],2],[7418,2],[[7419,7423],3],[[7424,7467],2],[7468,1,"a"],[7469,1,"æ"],[7470,1,"b"],[7471,2],[7472,1,"d"],[7473,1,"e"],[7474,1,"ǝ"],[7475,1,"g"],[7476,1,"h"],[7477,1,"i"],[7478,1,"j"],[7479,1,"k"],[7480,1,"l"],[7481,1,"m"],[7482,1,"n"],[7483,2],[7484,1,"o"],[7485,1,"ȣ"],[7486,1,"p"],[7487,1,"r"],[7488,1,"t"],[7489,1,"u"],[7490,1,"w"],[7491,1,"a"],[7492,1,"ɐ"],[7493,1,"ɑ"],[7494,1,"ᴂ"],[7495,1,"b"],[7496,1,"d"],[7497,1,"e"],[7498,1,"ə"],[7499,1,"ɛ"],[7500,1,"ɜ"],[7501,1,"g"],[7502,2],[7503,1,"k"],[7504,1,"m"],[7505,1,"ŋ"],[7506,1,"o"],[7507,1,"ɔ"],[7508,1,"ᴖ"],[7509,1,"ᴗ"],[7510,1,"p"],[7511,1,"t"],[7512,1,"u"],[7513,1,"ᴝ"],[7514,1,"ɯ"],[7515,1,"v"],[7516,1,"ᴥ"],[7517,1,"β"],[7518,1,"γ"],[7519,1,"δ"],[7520,1,"φ"],[7521,1,"χ"],[7522,1,"i"],[7523,1,"r"],[7524,1,"u"],[7525,1,"v"],[7526,1,"β"],[7527,1,"γ"],[7528,1,"ρ"],[7529,1,"φ"],[7530,1,"χ"],[7531,2],[[7532,7543],2],[7544,1,"н"],[[7545,7578],2],[7579,1,"ɒ"],[7580,1,"c"],[7581,1,"ɕ"],[7582,1,"ð"],[7583,1,"ɜ"],[7584,1,"f"],[7585,1,"ɟ"],[7586,1,"ɡ"],[7587,1,"ɥ"],[7588,1,"ɨ"],[7589,1,"ɩ"],[7590,1,"ɪ"],[7591,1,"ᵻ"],[7592,1,"ʝ"],[7593,1,"ɭ"],[7594,1,"ᶅ"],[7595,1,"ʟ"],[7596,1,"ɱ"],[7597,1,"ɰ"],[7598,1,"ɲ"],[7599,1,"ɳ"],[7600,1,"ɴ"],[7601,1,"ɵ"],[7602,1,"ɸ"],[7603,1,"ʂ"],[7604,1,"ʃ"],[7605,1,"ƫ"],[7606,1,"ʉ"],[7607,1,"ʊ"],[7608,1,"ᴜ"],[7609,1,"ʋ"],[7610,1,"ʌ"],[7611,1,"z"],[7612,1,"ʐ"],[7613,1,"ʑ"],[7614,1,"ʒ"],[7615,1,"θ"],[[7616,7619],2],[[7620,7626],2],[[7627,7654],2],[[7655,7669],2],[[7670,7673],2],[7674,2],[7675,2],[7676,2],[7677,2],[[7678,7679],2],[7680,1,"ḁ"],[7681,2],[7682,1,"ḃ"],[7683,2],[7684,1,"ḅ"],[7685,2],[7686,1,"ḇ"],[7687,2],[7688,1,"ḉ"],[7689,2],[7690,1,"ḋ"],[7691,2],[7692,1,"ḍ"],[7693,2],[7694,1,"ḏ"],[7695,2],[7696,1,"ḑ"],[7697,2],[7698,1,"ḓ"],[7699,2],[7700,1,"ḕ"],[7701,2],[7702,1,"ḗ"],[7703,2],[7704,1,"ḙ"],[7705,2],[7706,1,"ḛ"],[7707,2],[7708,1,"ḝ"],[7709,2],[7710,1,"ḟ"],[7711,2],[7712,1,"ḡ"],[7713,2],[7714,1,"ḣ"],[7715,2],[7716,1,"ḥ"],[7717,2],[7718,1,"ḧ"],[7719,2],[7720,1,"ḩ"],[7721,2],[7722,1,"ḫ"],[7723,2],[7724,1,"ḭ"],[7725,2],[7726,1,"ḯ"],[7727,2],[7728,1,"ḱ"],[7729,2],[7730,1,"ḳ"],[7731,2],[7732,1,"ḵ"],[7733,2],[7734,1,"ḷ"],[7735,2],[7736,1,"ḹ"],[7737,2],[7738,1,"ḻ"],[7739,2],[7740,1,"ḽ"],[7741,2],[7742,1,"ḿ"],[7743,2],[7744,1,"ṁ"],[7745,2],[7746,1,"ṃ"],[7747,2],[7748,1,"ṅ"],[7749,2],[7750,1,"ṇ"],[7751,2],[7752,1,"ṉ"],[7753,2],[7754,1,"ṋ"],[7755,2],[7756,1,"ṍ"],[7757,2],[7758,1,"ṏ"],[7759,2],[7760,1,"ṑ"],[7761,2],[7762,1,"ṓ"],[7763,2],[7764,1,"ṕ"],[7765,2],[7766,1,"ṗ"],[7767,2],[7768,1,"ṙ"],[7769,2],[7770,1,"ṛ"],[7771,2],[7772,1,"ṝ"],[7773,2],[7774,1,"ṟ"],[7775,2],[7776,1,"ṡ"],[7777,2],[7778,1,"ṣ"],[7779,2],[7780,1,"ṥ"],[7781,2],[7782,1,"ṧ"],[7783,2],[7784,1,"ṩ"],[7785,2],[7786,1,"ṫ"],[7787,2],[7788,1,"ṭ"],[7789,2],[7790,1,"ṯ"],[7791,2],[7792,1,"ṱ"],[7793,2],[7794,1,"ṳ"],[7795,2],[7796,1,"ṵ"],[7797,2],[7798,1,"ṷ"],[7799,2],[7800,1,"ṹ"],[7801,2],[7802,1,"ṻ"],[7803,2],[7804,1,"ṽ"],[7805,2],[7806,1,"ṿ"],[7807,2],[7808,1,"ẁ"],[7809,2],[7810,1,"ẃ"],[7811,2],[7812,1,"ẅ"],[7813,2],[7814,1,"ẇ"],[7815,2],[7816,1,"ẉ"],[7817,2],[7818,1,"ẋ"],[7819,2],[7820,1,"ẍ"],[7821,2],[7822,1,"ẏ"],[7823,2],[7824,1,"ẑ"],[7825,2],[7826,1,"ẓ"],[7827,2],[7828,1,"ẕ"],[[7829,7833],2],[7834,1,"aʾ"],[7835,1,"ṡ"],[[7836,7837],2],[7838,1,"ß"],[7839,2],[7840,1,"ạ"],[7841,2],[7842,1,"ả"],[7843,2],[7844,1,"ấ"],[7845,2],[7846,1,"ầ"],[7847,2],[7848,1,"ẩ"],[7849,2],[7850,1,"ẫ"],[7851,2],[7852,1,"ậ"],[7853,2],[7854,1,"ắ"],[7855,2],[7856,1,"ằ"],[7857,2],[7858,1,"ẳ"],[7859,2],[7860,1,"ẵ"],[7861,2],[7862,1,"ặ"],[7863,2],[7864,1,"ẹ"],[7865,2],[7866,1,"ẻ"],[7867,2],[7868,1,"ẽ"],[7869,2],[7870,1,"ế"],[7871,2],[7872,1,"ề"],[7873,2],[7874,1,"ể"],[7875,2],[7876,1,"ễ"],[7877,2],[7878,1,"ệ"],[7879,2],[7880,1,"ỉ"],[7881,2],[7882,1,"ị"],[7883,2],[7884,1,"ọ"],[7885,2],[7886,1,"ỏ"],[7887,2],[7888,1,"ố"],[7889,2],[7890,1,"ồ"],[7891,2],[7892,1,"ổ"],[7893,2],[7894,1,"ỗ"],[7895,2],[7896,1,"ộ"],[7897,2],[7898,1,"ớ"],[7899,2],[7900,1,"ờ"],[7901,2],[7902,1,"ở"],[7903,2],[7904,1,"ỡ"],[7905,2],[7906,1,"ợ"],[7907,2],[7908,1,"ụ"],[7909,2],[7910,1,"ủ"],[7911,2],[7912,1,"ứ"],[7913,2],[7914,1,"ừ"],[7915,2],[7916,1,"ử"],[7917,2],[7918,1,"ữ"],[7919,2],[7920,1,"ự"],[7921,2],[7922,1,"ỳ"],[7923,2],[7924,1,"ỵ"],[7925,2],[7926,1,"ỷ"],[7927,2],[7928,1,"ỹ"],[7929,2],[7930,1,"ỻ"],[7931,2],[7932,1,"ỽ"],[7933,2],[7934,1,"ỿ"],[7935,2],[[7936,7943],2],[7944,1,"ἀ"],[7945,1,"ἁ"],[7946,1,"ἂ"],[7947,1,"ἃ"],[7948,1,"ἄ"],[7949,1,"ἅ"],[7950,1,"ἆ"],[7951,1,"ἇ"],[[7952,7957],2],[[7958,7959],3],[7960,1,"ἐ"],[7961,1,"ἑ"],[7962,1,"ἒ"],[7963,1,"ἓ"],[7964,1,"ἔ"],[7965,1,"ἕ"],[[7966,7967],3],[[7968,7975],2],[7976,1,"ἠ"],[7977,1,"ἡ"],[7978,1,"ἢ"],[7979,1,"ἣ"],[7980,1,"ἤ"],[7981,1,"ἥ"],[7982,1,"ἦ"],[7983,1,"ἧ"],[[7984,7991],2],[7992,1,"ἰ"],[7993,1,"ἱ"],[7994,1,"ἲ"],[7995,1,"ἳ"],[7996,1,"ἴ"],[7997,1,"ἵ"],[7998,1,"ἶ"],[7999,1,"ἷ"],[[8000,8005],2],[[8006,8007],3],[8008,1,"ὀ"],[8009,1,"ὁ"],[8010,1,"ὂ"],[8011,1,"ὃ"],[8012,1,"ὄ"],[8013,1,"ὅ"],[[8014,8015],3],[[8016,8023],2],[8024,3],[8025,1,"ὑ"],[8026,3],[8027,1,"ὓ"],[8028,3],[8029,1,"ὕ"],[8030,3],[8031,1,"ὗ"],[[8032,8039],2],[8040,1,"ὠ"],[8041,1,"ὡ"],[8042,1,"ὢ"],[8043,1,"ὣ"],[8044,1,"ὤ"],[8045,1,"ὥ"],[8046,1,"ὦ"],[8047,1,"ὧ"],[8048,2],[8049,1,"ά"],[8050,2],[8051,1,"έ"],[8052,2],[8053,1,"ή"],[8054,2],[8055,1,"ί"],[8056,2],[8057,1,"ό"],[8058,2],[8059,1,"ύ"],[8060,2],[8061,1,"ώ"],[[8062,8063],3],[8064,1,"ἀι"],[8065,1,"ἁι"],[8066,1,"ἂι"],[8067,1,"ἃι"],[8068,1,"ἄι"],[8069,1,"ἅι"],[8070,1,"ἆι"],[8071,1,"ἇι"],[8072,1,"ἀι"],[8073,1,"ἁι"],[8074,1,"ἂι"],[8075,1,"ἃι"],[8076,1,"ἄι"],[8077,1,"ἅι"],[8078,1,"ἆι"],[8079,1,"ἇι"],[8080,1,"ἠι"],[8081,1,"ἡι"],[8082,1,"ἢι"],[8083,1,"ἣι"],[8084,1,"ἤι"],[8085,1,"ἥι"],[8086,1,"ἦι"],[8087,1,"ἧι"],[8088,1,"ἠι"],[8089,1,"ἡι"],[8090,1,"ἢι"],[8091,1,"ἣι"],[8092,1,"ἤι"],[8093,1,"ἥι"],[8094,1,"ἦι"],[8095,1,"ἧι"],[8096,1,"ὠι"],[8097,1,"ὡι"],[8098,1,"ὢι"],[8099,1,"ὣι"],[8100,1,"ὤι"],[8101,1,"ὥι"],[8102,1,"ὦι"],[8103,1,"ὧι"],[8104,1,"ὠι"],[8105,1,"ὡι"],[8106,1,"ὢι"],[8107,1,"ὣι"],[8108,1,"ὤι"],[8109,1,"ὥι"],[8110,1,"ὦι"],[8111,1,"ὧι"],[[8112,8113],2],[8114,1,"ὰι"],[8115,1,"αι"],[8116,1,"άι"],[8117,3],[8118,2],[8119,1,"ᾶι"],[8120,1,"ᾰ"],[8121,1,"ᾱ"],[8122,1,"ὰ"],[8123,1,"ά"],[8124,1,"αι"],[8125,1," ̓"],[8126,1,"ι"],[8127,1," ̓"],[8128,1," ͂"],[8129,1," ̈͂"],[8130,1,"ὴι"],[8131,1,"ηι"],[8132,1,"ήι"],[8133,3],[8134,2],[8135,1,"ῆι"],[8136,1,"ὲ"],[8137,1,"έ"],[8138,1,"ὴ"],[8139,1,"ή"],[8140,1,"ηι"],[8141,1," ̓̀"],[8142,1," ̓́"],[8143,1," ̓͂"],[[8144,8146],2],[8147,1,"ΐ"],[[8148,8149],3],[[8150,8151],2],[8152,1,"ῐ"],[8153,1,"ῑ"],[8154,1,"ὶ"],[8155,1,"ί"],[8156,3],[8157,1," ̔̀"],[8158,1," ̔́"],[8159,1," ̔͂"],[[8160,8162],2],[8163,1,"ΰ"],[[8164,8167],2],[8168,1,"ῠ"],[8169,1,"ῡ"],[8170,1,"ὺ"],[8171,1,"ύ"],[8172,1,"ῥ"],[8173,1," ̈̀"],[8174,1," ̈́"],[8175,1,"`"],[[8176,8177],3],[8178,1,"ὼι"],[8179,1,"ωι"],[8180,1,"ώι"],[8181,3],[8182,2],[8183,1,"ῶι"],[8184,1,"ὸ"],[8185,1,"ό"],[8186,1,"ὼ"],[8187,1,"ώ"],[8188,1,"ωι"],[8189,1," ́"],[8190,1," ̔"],[8191,3],[[8192,8202],1," "],[8203,7],[[8204,8205],6,""],[[8206,8207],3],[8208,2],[8209,1,"‐"],[[8210,8214],2],[8215,1," ̳"],[[8216,8227],2],[[8228,8230],3],[8231,2],[[8232,8238],3],[8239,1," "],[[8240,8242],2],[8243,1,"′′"],[8244,1,"′′′"],[8245,2],[8246,1,"‵‵"],[8247,1,"‵‵‵"],[[8248,8251],2],[8252,1,"!!"],[8253,2],[8254,1," ̅"],[[8255,8262],2],[8263,1,"??"],[8264,1,"?!"],[8265,1,"!?"],[[8266,8269],2],[[8270,8274],2],[[8275,8276],2],[[8277,8278],2],[8279,1,"′′′′"],[[8280,8286],2],[8287,1," "],[[8288,8291],7],[8292,7],[8293,3],[[8294,8297],3],[[8298,8303],7],[8304,1,"0"],[8305,1,"i"],[[8306,8307],3],[8308,1,"4"],[8309,1,"5"],[8310,1,"6"],[8311,1,"7"],[8312,1,"8"],[8313,1,"9"],[8314,1,"+"],[8315,1,"−"],[8316,1,"="],[8317,1,"("],[8318,1,")"],[8319,1,"n"],[8320,1,"0"],[8321,1,"1"],[8322,1,"2"],[8323,1,"3"],[8324,1,"4"],[8325,1,"5"],[8326,1,"6"],[8327,1,"7"],[8328,1,"8"],[8329,1,"9"],[8330,1,"+"],[8331,1,"−"],[8332,1,"="],[8333,1,"("],[8334,1,")"],[8335,3],[8336,1,"a"],[8337,1,"e"],[8338,1,"o"],[8339,1,"x"],[8340,1,"ə"],[8341,1,"h"],[8342,1,"k"],[8343,1,"l"],[8344,1,"m"],[8345,1,"n"],[8346,1,"p"],[8347,1,"s"],[8348,1,"t"],[[8349,8351],3],[[8352,8359],2],[8360,1,"rs"],[[8361,8362],2],[8363,2],[8364,2],[[8365,8367],2],[[8368,8369],2],[[8370,8373],2],[[8374,8376],2],[8377,2],[8378,2],[[8379,8381],2],[8382,2],[8383,2],[8384,2],[[8385,8399],3],[[8400,8417],2],[[8418,8419],2],[[8420,8426],2],[8427,2],[[8428,8431],2],[8432,2],[[8433,8447],3],[8448,1,"a/c"],[8449,1,"a/s"],[8450,1,"c"],[8451,1,"°c"],[8452,2],[8453,1,"c/o"],[8454,1,"c/u"],[8455,1,"ɛ"],[8456,2],[8457,1,"°f"],[8458,1,"g"],[[8459,8462],1,"h"],[8463,1,"ħ"],[[8464,8465],1,"i"],[[8466,8467],1,"l"],[8468,2],[8469,1,"n"],[8470,1,"no"],[[8471,8472],2],[8473,1,"p"],[8474,1,"q"],[[8475,8477],1,"r"],[[8478,8479],2],[8480,1,"sm"],[8481,1,"tel"],[8482,1,"tm"],[8483,2],[8484,1,"z"],[8485,2],[8486,1,"ω"],[8487,2],[8488,1,"z"],[8489,2],[8490,1,"k"],[8491,1,"å"],[8492,1,"b"],[8493,1,"c"],[8494,2],[[8495,8496],1,"e"],[8497,1,"f"],[8498,1,"ⅎ"],[8499,1,"m"],[8500,1,"o"],[8501,1,"א"],[8502,1,"ב"],[8503,1,"ג"],[8504,1,"ד"],[8505,1,"i"],[8506,2],[8507,1,"fax"],[8508,1,"π"],[[8509,8510],1,"γ"],[8511,1,"π"],[8512,1,"∑"],[[8513,8516],2],[[8517,8518],1,"d"],[8519,1,"e"],[8520,1,"i"],[8521,1,"j"],[[8522,8523],2],[8524,2],[8525,2],[8526,2],[8527,2],[8528,1,"1⁄7"],[8529,1,"1⁄9"],[8530,1,"1⁄10"],[8531,1,"1⁄3"],[8532,1,"2⁄3"],[8533,1,"1⁄5"],[8534,1,"2⁄5"],[8535,1,"3⁄5"],[8536,1,"4⁄5"],[8537,1,"1⁄6"],[8538,1,"5⁄6"],[8539,1,"1⁄8"],[8540,1,"3⁄8"],[8541,1,"5⁄8"],[8542,1,"7⁄8"],[8543,1,"1⁄"],[8544,1,"i"],[8545,1,"ii"],[8546,1,"iii"],[8547,1,"iv"],[8548,1,"v"],[8549,1,"vi"],[8550,1,"vii"],[8551,1,"viii"],[8552,1,"ix"],[8553,1,"x"],[8554,1,"xi"],[8555,1,"xii"],[8556,1,"l"],[8557,1,"c"],[8558,1,"d"],[8559,1,"m"],[8560,1,"i"],[8561,1,"ii"],[8562,1,"iii"],[8563,1,"iv"],[8564,1,"v"],[8565,1,"vi"],[8566,1,"vii"],[8567,1,"viii"],[8568,1,"ix"],[8569,1,"x"],[8570,1,"xi"],[8571,1,"xii"],[8572,1,"l"],[8573,1,"c"],[8574,1,"d"],[8575,1,"m"],[[8576,8578],2],[8579,1,"ↄ"],[8580,2],[[8581,8584],2],[8585,1,"0⁄3"],[[8586,8587],2],[[8588,8591],3],[[8592,8682],2],[[8683,8691],2],[[8692,8703],2],[[8704,8747],2],[8748,1,"∫∫"],[8749,1,"∫∫∫"],[8750,2],[8751,1,"∮∮"],[8752,1,"∮∮∮"],[[8753,8945],2],[[8946,8959],2],[8960,2],[8961,2],[[8962,9000],2],[9001,1,"〈"],[9002,1,"〉"],[[9003,9082],2],[9083,2],[9084,2],[[9085,9114],2],[[9115,9166],2],[[9167,9168],2],[[9169,9179],2],[[9180,9191],2],[9192,2],[[9193,9203],2],[[9204,9210],2],[[9211,9214],2],[9215,2],[[9216,9252],2],[[9253,9254],2],[[9255,9257],2],[[9258,9279],3],[[9280,9290],2],[[9291,9311],3],[9312,1,"1"],[9313,1,"2"],[9314,1,"3"],[9315,1,"4"],[9316,1,"5"],[9317,1,"6"],[9318,1,"7"],[9319,1,"8"],[9320,1,"9"],[9321,1,"10"],[9322,1,"11"],[9323,1,"12"],[9324,1,"13"],[9325,1,"14"],[9326,1,"15"],[9327,1,"16"],[9328,1,"17"],[9329,1,"18"],[9330,1,"19"],[9331,1,"20"],[9332,1,"(1)"],[9333,1,"(2)"],[9334,1,"(3)"],[9335,1,"(4)"],[9336,1,"(5)"],[9337,1,"(6)"],[9338,1,"(7)"],[9339,1,"(8)"],[9340,1,"(9)"],[9341,1,"(10)"],[9342,1,"(11)"],[9343,1,"(12)"],[9344,1,"(13)"],[9345,1,"(14)"],[9346,1,"(15)"],[9347,1,"(16)"],[9348,1,"(17)"],[9349,1,"(18)"],[9350,1,"(19)"],[9351,1,"(20)"],[[9352,9371],3],[9372,1,"(a)"],[9373,1,"(b)"],[9374,1,"(c)"],[9375,1,"(d)"],[9376,1,"(e)"],[9377,1,"(f)"],[9378,1,"(g)"],[9379,1,"(h)"],[9380,1,"(i)"],[9381,1,"(j)"],[9382,1,"(k)"],[9383,1,"(l)"],[9384,1,"(m)"],[9385,1,"(n)"],[9386,1,"(o)"],[9387,1,"(p)"],[9388,1,"(q)"],[9389,1,"(r)"],[9390,1,"(s)"],[9391,1,"(t)"],[9392,1,"(u)"],[9393,1,"(v)"],[9394,1,"(w)"],[9395,1,"(x)"],[9396,1,"(y)"],[9397,1,"(z)"],[9398,1,"a"],[9399,1,"b"],[9400,1,"c"],[9401,1,"d"],[9402,1,"e"],[9403,1,"f"],[9404,1,"g"],[9405,1,"h"],[9406,1,"i"],[9407,1,"j"],[9408,1,"k"],[9409,1,"l"],[9410,1,"m"],[9411,1,"n"],[9412,1,"o"],[9413,1,"p"],[9414,1,"q"],[9415,1,"r"],[9416,1,"s"],[9417,1,"t"],[9418,1,"u"],[9419,1,"v"],[9420,1,"w"],[9421,1,"x"],[9422,1,"y"],[9423,1,"z"],[9424,1,"a"],[9425,1,"b"],[9426,1,"c"],[9427,1,"d"],[9428,1,"e"],[9429,1,"f"],[9430,1,"g"],[9431,1,"h"],[9432,1,"i"],[9433,1,"j"],[9434,1,"k"],[9435,1,"l"],[9436,1,"m"],[9437,1,"n"],[9438,1,"o"],[9439,1,"p"],[9440,1,"q"],[9441,1,"r"],[9442,1,"s"],[9443,1,"t"],[9444,1,"u"],[9445,1,"v"],[9446,1,"w"],[9447,1,"x"],[9448,1,"y"],[9449,1,"z"],[9450,1,"0"],[[9451,9470],2],[9471,2],[[9472,9621],2],[[9622,9631],2],[[9632,9711],2],[[9712,9719],2],[[9720,9727],2],[[9728,9747],2],[[9748,9749],2],[[9750,9751],2],[9752,2],[9753,2],[[9754,9839],2],[[9840,9841],2],[[9842,9853],2],[[9854,9855],2],[[9856,9865],2],[[9866,9873],2],[[9874,9884],2],[9885,2],[[9886,9887],2],[[9888,9889],2],[[9890,9905],2],[9906,2],[[9907,9916],2],[[9917,9919],2],[[9920,9923],2],[[9924,9933],2],[9934,2],[[9935,9953],2],[9954,2],[9955,2],[[9956,9959],2],[[9960,9983],2],[9984,2],[[9985,9988],2],[9989,2],[[9990,9993],2],[[9994,9995],2],[[9996,10023],2],[10024,2],[[10025,10059],2],[10060,2],[10061,2],[10062,2],[[10063,10066],2],[[10067,10069],2],[10070,2],[10071,2],[[10072,10078],2],[[10079,10080],2],[[10081,10087],2],[[10088,10101],2],[[10102,10132],2],[[10133,10135],2],[[10136,10159],2],[10160,2],[[10161,10174],2],[10175,2],[[10176,10182],2],[[10183,10186],2],[10187,2],[10188,2],[10189,2],[[10190,10191],2],[[10192,10219],2],[[10220,10223],2],[[10224,10239],2],[[10240,10495],2],[[10496,10763],2],[10764,1,"∫∫∫∫"],[[10765,10867],2],[10868,1,"::="],[10869,1,"=="],[10870,1,"==="],[[10871,10971],2],[10972,1,"⫝̸"],[[10973,11007],2],[[11008,11021],2],[[11022,11027],2],[[11028,11034],2],[[11035,11039],2],[[11040,11043],2],[[11044,11084],2],[[11085,11087],2],[[11088,11092],2],[[11093,11097],2],[[11098,11123],2],[[11124,11125],3],[[11126,11157],2],[11158,3],[11159,2],[[11160,11193],2],[[11194,11196],2],[[11197,11208],2],[11209,2],[[11210,11217],2],[11218,2],[[11219,11243],2],[[11244,11247],2],[[11248,11262],2],[11263,2],[11264,1,"ⰰ"],[11265,1,"ⰱ"],[11266,1,"ⰲ"],[11267,1,"ⰳ"],[11268,1,"ⰴ"],[11269,1,"ⰵ"],[11270,1,"ⰶ"],[11271,1,"ⰷ"],[11272,1,"ⰸ"],[11273,1,"ⰹ"],[11274,1,"ⰺ"],[11275,1,"ⰻ"],[11276,1,"ⰼ"],[11277,1,"ⰽ"],[11278,1,"ⰾ"],[11279,1,"ⰿ"],[11280,1,"ⱀ"],[11281,1,"ⱁ"],[11282,1,"ⱂ"],[11283,1,"ⱃ"],[11284,1,"ⱄ"],[11285,1,"ⱅ"],[11286,1,"ⱆ"],[11287,1,"ⱇ"],[11288,1,"ⱈ"],[11289,1,"ⱉ"],[11290,1,"ⱊ"],[11291,1,"ⱋ"],[11292,1,"ⱌ"],[11293,1,"ⱍ"],[11294,1,"ⱎ"],[11295,1,"ⱏ"],[11296,1,"ⱐ"],[11297,1,"ⱑ"],[11298,1,"ⱒ"],[11299,1,"ⱓ"],[11300,1,"ⱔ"],[11301,1,"ⱕ"],[11302,1,"ⱖ"],[11303,1,"ⱗ"],[11304,1,"ⱘ"],[11305,1,"ⱙ"],[11306,1,"ⱚ"],[11307,1,"ⱛ"],[11308,1,"ⱜ"],[11309,1,"ⱝ"],[11310,1,"ⱞ"],[11311,1,"ⱟ"],[[11312,11358],2],[11359,2],[11360,1,"ⱡ"],[11361,2],[11362,1,"ɫ"],[11363,1,"ᵽ"],[11364,1,"ɽ"],[[11365,11366],2],[11367,1,"ⱨ"],[11368,2],[11369,1,"ⱪ"],[11370,2],[11371,1,"ⱬ"],[11372,2],[11373,1,"ɑ"],[11374,1,"ɱ"],[11375,1,"ɐ"],[11376,1,"ɒ"],[11377,2],[11378,1,"ⱳ"],[11379,2],[11380,2],[11381,1,"ⱶ"],[[11382,11383],2],[[11384,11387],2],[11388,1,"j"],[11389,1,"v"],[11390,1,"ȿ"],[11391,1,"ɀ"],[11392,1,"ⲁ"],[11393,2],[11394,1,"ⲃ"],[11395,2],[11396,1,"ⲅ"],[11397,2],[11398,1,"ⲇ"],[11399,2],[11400,1,"ⲉ"],[11401,2],[11402,1,"ⲋ"],[11403,2],[11404,1,"ⲍ"],[11405,2],[11406,1,"ⲏ"],[11407,2],[11408,1,"ⲑ"],[11409,2],[11410,1,"ⲓ"],[11411,2],[11412,1,"ⲕ"],[11413,2],[11414,1,"ⲗ"],[11415,2],[11416,1,"ⲙ"],[11417,2],[11418,1,"ⲛ"],[11419,2],[11420,1,"ⲝ"],[11421,2],[11422,1,"ⲟ"],[11423,2],[11424,1,"ⲡ"],[11425,2],[11426,1,"ⲣ"],[11427,2],[11428,1,"ⲥ"],[11429,2],[11430,1,"ⲧ"],[11431,2],[11432,1,"ⲩ"],[11433,2],[11434,1,"ⲫ"],[11435,2],[11436,1,"ⲭ"],[11437,2],[11438,1,"ⲯ"],[11439,2],[11440,1,"ⲱ"],[11441,2],[11442,1,"ⲳ"],[11443,2],[11444,1,"ⲵ"],[11445,2],[11446,1,"ⲷ"],[11447,2],[11448,1,"ⲹ"],[11449,2],[11450,1,"ⲻ"],[11451,2],[11452,1,"ⲽ"],[11453,2],[11454,1,"ⲿ"],[11455,2],[11456,1,"ⳁ"],[11457,2],[11458,1,"ⳃ"],[11459,2],[11460,1,"ⳅ"],[11461,2],[11462,1,"ⳇ"],[11463,2],[11464,1,"ⳉ"],[11465,2],[11466,1,"ⳋ"],[11467,2],[11468,1,"ⳍ"],[11469,2],[11470,1,"ⳏ"],[11471,2],[11472,1,"ⳑ"],[11473,2],[11474,1,"ⳓ"],[11475,2],[11476,1,"ⳕ"],[11477,2],[11478,1,"ⳗ"],[11479,2],[11480,1,"ⳙ"],[11481,2],[11482,1,"ⳛ"],[11483,2],[11484,1,"ⳝ"],[11485,2],[11486,1,"ⳟ"],[11487,2],[11488,1,"ⳡ"],[11489,2],[11490,1,"ⳣ"],[[11491,11492],2],[[11493,11498],2],[11499,1,"ⳬ"],[11500,2],[11501,1,"ⳮ"],[[11502,11505],2],[11506,1,"ⳳ"],[11507,2],[[11508,11512],3],[[11513,11519],2],[[11520,11557],2],[11558,3],[11559,2],[[11560,11564],3],[11565,2],[[11566,11567],3],[[11568,11621],2],[[11622,11623],2],[[11624,11630],3],[11631,1,"ⵡ"],[11632,2],[[11633,11646],3],[11647,2],[[11648,11670],2],[[11671,11679],3],[[11680,11686],2],[11687,3],[[11688,11694],2],[11695,3],[[11696,11702],2],[11703,3],[[11704,11710],2],[11711,3],[[11712,11718],2],[11719,3],[[11720,11726],2],[11727,3],[[11728,11734],2],[11735,3],[[11736,11742],2],[11743,3],[[11744,11775],2],[[11776,11799],2],[[11800,11803],2],[[11804,11805],2],[[11806,11822],2],[11823,2],[11824,2],[11825,2],[[11826,11835],2],[[11836,11842],2],[[11843,11844],2],[[11845,11849],2],[[11850,11854],2],[11855,2],[[11856,11858],2],[[11859,11869],2],[[11870,11903],3],[[11904,11929],2],[11930,3],[[11931,11934],2],[11935,1,"母"],[[11936,12018],2],[12019,1,"龟"],[[12020,12031],3],[12032,1,"一"],[12033,1,"丨"],[12034,1,"丶"],[12035,1,"丿"],[12036,1,"乙"],[12037,1,"亅"],[12038,1,"二"],[12039,1,"亠"],[12040,1,"人"],[12041,1,"儿"],[12042,1,"入"],[12043,1,"八"],[12044,1,"冂"],[12045,1,"冖"],[12046,1,"冫"],[12047,1,"几"],[12048,1,"凵"],[12049,1,"刀"],[12050,1,"力"],[12051,1,"勹"],[12052,1,"匕"],[12053,1,"匚"],[12054,1,"匸"],[12055,1,"十"],[12056,1,"卜"],[12057,1,"卩"],[12058,1,"厂"],[12059,1,"厶"],[12060,1,"又"],[12061,1,"口"],[12062,1,"囗"],[12063,1,"土"],[12064,1,"士"],[12065,1,"夂"],[12066,1,"夊"],[12067,1,"夕"],[12068,1,"大"],[12069,1,"女"],[12070,1,"子"],[12071,1,"宀"],[12072,1,"寸"],[12073,1,"小"],[12074,1,"尢"],[12075,1,"尸"],[12076,1,"屮"],[12077,1,"山"],[12078,1,"巛"],[12079,1,"工"],[12080,1,"己"],[12081,1,"巾"],[12082,1,"干"],[12083,1,"幺"],[12084,1,"广"],[12085,1,"廴"],[12086,1,"廾"],[12087,1,"弋"],[12088,1,"弓"],[12089,1,"彐"],[12090,1,"彡"],[12091,1,"彳"],[12092,1,"心"],[12093,1,"戈"],[12094,1,"戶"],[12095,1,"手"],[12096,1,"支"],[12097,1,"攴"],[12098,1,"文"],[12099,1,"斗"],[12100,1,"斤"],[12101,1,"方"],[12102,1,"无"],[12103,1,"日"],[12104,1,"曰"],[12105,1,"月"],[12106,1,"木"],[12107,1,"欠"],[12108,1,"止"],[12109,1,"歹"],[12110,1,"殳"],[12111,1,"毋"],[12112,1,"比"],[12113,1,"毛"],[12114,1,"氏"],[12115,1,"气"],[12116,1,"水"],[12117,1,"火"],[12118,1,"爪"],[12119,1,"父"],[12120,1,"爻"],[12121,1,"爿"],[12122,1,"片"],[12123,1,"牙"],[12124,1,"牛"],[12125,1,"犬"],[12126,1,"玄"],[12127,1,"玉"],[12128,1,"瓜"],[12129,1,"瓦"],[12130,1,"甘"],[12131,1,"生"],[12132,1,"用"],[12133,1,"田"],[12134,1,"疋"],[12135,1,"疒"],[12136,1,"癶"],[12137,1,"白"],[12138,1,"皮"],[12139,1,"皿"],[12140,1,"目"],[12141,1,"矛"],[12142,1,"矢"],[12143,1,"石"],[12144,1,"示"],[12145,1,"禸"],[12146,1,"禾"],[12147,1,"穴"],[12148,1,"立"],[12149,1,"竹"],[12150,1,"米"],[12151,1,"糸"],[12152,1,"缶"],[12153,1,"网"],[12154,1,"羊"],[12155,1,"羽"],[12156,1,"老"],[12157,1,"而"],[12158,1,"耒"],[12159,1,"耳"],[12160,1,"聿"],[12161,1,"肉"],[12162,1,"臣"],[12163,1,"自"],[12164,1,"至"],[12165,1,"臼"],[12166,1,"舌"],[12167,1,"舛"],[12168,1,"舟"],[12169,1,"艮"],[12170,1,"色"],[12171,1,"艸"],[12172,1,"虍"],[12173,1,"虫"],[12174,1,"血"],[12175,1,"行"],[12176,1,"衣"],[12177,1,"襾"],[12178,1,"見"],[12179,1,"角"],[12180,1,"言"],[12181,1,"谷"],[12182,1,"豆"],[12183,1,"豕"],[12184,1,"豸"],[12185,1,"貝"],[12186,1,"赤"],[12187,1,"走"],[12188,1,"足"],[12189,1,"身"],[12190,1,"車"],[12191,1,"辛"],[12192,1,"辰"],[12193,1,"辵"],[12194,1,"邑"],[12195,1,"酉"],[12196,1,"釆"],[12197,1,"里"],[12198,1,"金"],[12199,1,"長"],[12200,1,"門"],[12201,1,"阜"],[12202,1,"隶"],[12203,1,"隹"],[12204,1,"雨"],[12205,1,"靑"],[12206,1,"非"],[12207,1,"面"],[12208,1,"革"],[12209,1,"韋"],[12210,1,"韭"],[12211,1,"音"],[12212,1,"頁"],[12213,1,"風"],[12214,1,"飛"],[12215,1,"食"],[12216,1,"首"],[12217,1,"香"],[12218,1,"馬"],[12219,1,"骨"],[12220,1,"高"],[12221,1,"髟"],[12222,1,"鬥"],[12223,1,"鬯"],[12224,1,"鬲"],[12225,1,"鬼"],[12226,1,"魚"],[12227,1,"鳥"],[12228,1,"鹵"],[12229,1,"鹿"],[12230,1,"麥"],[12231,1,"麻"],[12232,1,"黃"],[12233,1,"黍"],[12234,1,"黑"],[12235,1,"黹"],[12236,1,"黽"],[12237,1,"鼎"],[12238,1,"鼓"],[12239,1,"鼠"],[12240,1,"鼻"],[12241,1,"齊"],[12242,1,"齒"],[12243,1,"龍"],[12244,1,"龜"],[12245,1,"龠"],[[12246,12271],3],[[12272,12283],3],[[12284,12287],3],[12288,1," "],[12289,2],[12290,1,"."],[[12291,12292],2],[[12293,12295],2],[[12296,12329],2],[[12330,12333],2],[[12334,12341],2],[12342,1,"〒"],[12343,2],[12344,1,"十"],[12345,1,"卄"],[12346,1,"卅"],[12347,2],[12348,2],[12349,2],[12350,2],[12351,2],[12352,3],[[12353,12436],2],[[12437,12438],2],[[12439,12440],3],[[12441,12442],2],[12443,1," ゙"],[12444,1," ゚"],[[12445,12446],2],[12447,1,"より"],[12448,2],[[12449,12542],2],[12543,1,"コト"],[[12544,12548],3],[[12549,12588],2],[12589,2],[12590,2],[12591,2],[12592,3],[12593,1,"ᄀ"],[12594,1,"ᄁ"],[12595,1,"ᆪ"],[12596,1,"ᄂ"],[12597,1,"ᆬ"],[12598,1,"ᆭ"],[12599,1,"ᄃ"],[12600,1,"ᄄ"],[12601,1,"ᄅ"],[12602,1,"ᆰ"],[12603,1,"ᆱ"],[12604,1,"ᆲ"],[12605,1,"ᆳ"],[12606,1,"ᆴ"],[12607,1,"ᆵ"],[12608,1,"ᄚ"],[12609,1,"ᄆ"],[12610,1,"ᄇ"],[12611,1,"ᄈ"],[12612,1,"ᄡ"],[12613,1,"ᄉ"],[12614,1,"ᄊ"],[12615,1,"ᄋ"],[12616,1,"ᄌ"],[12617,1,"ᄍ"],[12618,1,"ᄎ"],[12619,1,"ᄏ"],[12620,1,"ᄐ"],[12621,1,"ᄑ"],[12622,1,"ᄒ"],[12623,1,"ᅡ"],[12624,1,"ᅢ"],[12625,1,"ᅣ"],[12626,1,"ᅤ"],[12627,1,"ᅥ"],[12628,1,"ᅦ"],[12629,1,"ᅧ"],[12630,1,"ᅨ"],[12631,1,"ᅩ"],[12632,1,"ᅪ"],[12633,1,"ᅫ"],[12634,1,"ᅬ"],[12635,1,"ᅭ"],[12636,1,"ᅮ"],[12637,1,"ᅯ"],[12638,1,"ᅰ"],[12639,1,"ᅱ"],[12640,1,"ᅲ"],[12641,1,"ᅳ"],[12642,1,"ᅴ"],[12643,1,"ᅵ"],[12644,7],[12645,1,"ᄔ"],[12646,1,"ᄕ"],[12647,1,"ᇇ"],[12648,1,"ᇈ"],[12649,1,"ᇌ"],[12650,1,"ᇎ"],[12651,1,"ᇓ"],[12652,1,"ᇗ"],[12653,1,"ᇙ"],[12654,1,"ᄜ"],[12655,1,"ᇝ"],[12656,1,"ᇟ"],[12657,1,"ᄝ"],[12658,1,"ᄞ"],[12659,1,"ᄠ"],[12660,1,"ᄢ"],[12661,1,"ᄣ"],[12662,1,"ᄧ"],[12663,1,"ᄩ"],[12664,1,"ᄫ"],[12665,1,"ᄬ"],[12666,1,"ᄭ"],[12667,1,"ᄮ"],[12668,1,"ᄯ"],[12669,1,"ᄲ"],[12670,1,"ᄶ"],[12671,1,"ᅀ"],[12672,1,"ᅇ"],[12673,1,"ᅌ"],[12674,1,"ᇱ"],[12675,1,"ᇲ"],[12676,1,"ᅗ"],[12677,1,"ᅘ"],[12678,1,"ᅙ"],[12679,1,"ᆄ"],[12680,1,"ᆅ"],[12681,1,"ᆈ"],[12682,1,"ᆑ"],[12683,1,"ᆒ"],[12684,1,"ᆔ"],[12685,1,"ᆞ"],[12686,1,"ᆡ"],[12687,3],[[12688,12689],2],[12690,1,"一"],[12691,1,"二"],[12692,1,"三"],[12693,1,"四"],[12694,1,"上"],[12695,1,"中"],[12696,1,"下"],[12697,1,"甲"],[12698,1,"乙"],[12699,1,"丙"],[12700,1,"丁"],[12701,1,"天"],[12702,1,"地"],[12703,1,"人"],[[12704,12727],2],[[12728,12730],2],[[12731,12735],2],[[12736,12751],2],[[12752,12771],2],[[12772,12773],2],[[12774,12782],3],[12783,3],[[12784,12799],2],[12800,1,"(ᄀ)"],[12801,1,"(ᄂ)"],[12802,1,"(ᄃ)"],[12803,1,"(ᄅ)"],[12804,1,"(ᄆ)"],[12805,1,"(ᄇ)"],[12806,1,"(ᄉ)"],[12807,1,"(ᄋ)"],[12808,1,"(ᄌ)"],[12809,1,"(ᄎ)"],[12810,1,"(ᄏ)"],[12811,1,"(ᄐ)"],[12812,1,"(ᄑ)"],[12813,1,"(ᄒ)"],[12814,1,"(가)"],[12815,1,"(나)"],[12816,1,"(다)"],[12817,1,"(라)"],[12818,1,"(마)"],[12819,1,"(바)"],[12820,1,"(사)"],[12821,1,"(아)"],[12822,1,"(자)"],[12823,1,"(차)"],[12824,1,"(카)"],[12825,1,"(타)"],[12826,1,"(파)"],[12827,1,"(하)"],[12828,1,"(주)"],[12829,1,"(오전)"],[12830,1,"(오후)"],[12831,3],[12832,1,"(一)"],[12833,1,"(二)"],[12834,1,"(三)"],[12835,1,"(四)"],[12836,1,"(五)"],[12837,1,"(六)"],[12838,1,"(七)"],[12839,1,"(八)"],[12840,1,"(九)"],[12841,1,"(十)"],[12842,1,"(月)"],[12843,1,"(火)"],[12844,1,"(水)"],[12845,1,"(木)"],[12846,1,"(金)"],[12847,1,"(土)"],[12848,1,"(日)"],[12849,1,"(株)"],[12850,1,"(有)"],[12851,1,"(社)"],[12852,1,"(名)"],[12853,1,"(特)"],[12854,1,"(財)"],[12855,1,"(祝)"],[12856,1,"(労)"],[12857,1,"(代)"],[12858,1,"(呼)"],[12859,1,"(学)"],[12860,1,"(監)"],[12861,1,"(企)"],[12862,1,"(資)"],[12863,1,"(協)"],[12864,1,"(祭)"],[12865,1,"(休)"],[12866,1,"(自)"],[12867,1,"(至)"],[12868,1,"問"],[12869,1,"幼"],[12870,1,"文"],[12871,1,"箏"],[[12872,12879],2],[12880,1,"pte"],[12881,1,"21"],[12882,1,"22"],[12883,1,"23"],[12884,1,"24"],[12885,1,"25"],[12886,1,"26"],[12887,1,"27"],[12888,1,"28"],[12889,1,"29"],[12890,1,"30"],[12891,1,"31"],[12892,1,"32"],[12893,1,"33"],[12894,1,"34"],[12895,1,"35"],[12896,1,"ᄀ"],[12897,1,"ᄂ"],[12898,1,"ᄃ"],[12899,1,"ᄅ"],[12900,1,"ᄆ"],[12901,1,"ᄇ"],[12902,1,"ᄉ"],[12903,1,"ᄋ"],[12904,1,"ᄌ"],[12905,1,"ᄎ"],[12906,1,"ᄏ"],[12907,1,"ᄐ"],[12908,1,"ᄑ"],[12909,1,"ᄒ"],[12910,1,"가"],[12911,1,"나"],[12912,1,"다"],[12913,1,"라"],[12914,1,"마"],[12915,1,"바"],[12916,1,"사"],[12917,1,"아"],[12918,1,"자"],[12919,1,"차"],[12920,1,"카"],[12921,1,"타"],[12922,1,"파"],[12923,1,"하"],[12924,1,"참고"],[12925,1,"주의"],[12926,1,"우"],[12927,2],[12928,1,"一"],[12929,1,"二"],[12930,1,"三"],[12931,1,"四"],[12932,1,"五"],[12933,1,"六"],[12934,1,"七"],[12935,1,"八"],[12936,1,"九"],[12937,1,"十"],[12938,1,"月"],[12939,1,"火"],[12940,1,"水"],[12941,1,"木"],[12942,1,"金"],[12943,1,"土"],[12944,1,"日"],[12945,1,"株"],[12946,1,"有"],[12947,1,"社"],[12948,1,"名"],[12949,1,"特"],[12950,1,"財"],[12951,1,"祝"],[12952,1,"労"],[12953,1,"秘"],[12954,1,"男"],[12955,1,"女"],[12956,1,"適"],[12957,1,"優"],[12958,1,"印"],[12959,1,"注"],[12960,1,"項"],[12961,1,"休"],[12962,1,"写"],[12963,1,"正"],[12964,1,"上"],[12965,1,"中"],[12966,1,"下"],[12967,1,"左"],[12968,1,"右"],[12969,1,"医"],[12970,1,"宗"],[12971,1,"学"],[12972,1,"監"],[12973,1,"企"],[12974,1,"資"],[12975,1,"協"],[12976,1,"夜"],[12977,1,"36"],[12978,1,"37"],[12979,1,"38"],[12980,1,"39"],[12981,1,"40"],[12982,1,"41"],[12983,1,"42"],[12984,1,"43"],[12985,1,"44"],[12986,1,"45"],[12987,1,"46"],[12988,1,"47"],[12989,1,"48"],[12990,1,"49"],[12991,1,"50"],[12992,1,"1月"],[12993,1,"2月"],[12994,1,"3月"],[12995,1,"4月"],[12996,1,"5月"],[12997,1,"6月"],[12998,1,"7月"],[12999,1,"8月"],[13000,1,"9月"],[13001,1,"10月"],[13002,1,"11月"],[13003,1,"12月"],[13004,1,"hg"],[13005,1,"erg"],[13006,1,"ev"],[13007,1,"ltd"],[13008,1,"ア"],[13009,1,"イ"],[13010,1,"ウ"],[13011,1,"エ"],[13012,1,"オ"],[13013,1,"カ"],[13014,1,"キ"],[13015,1,"ク"],[13016,1,"ケ"],[13017,1,"コ"],[13018,1,"サ"],[13019,1,"シ"],[13020,1,"ス"],[13021,1,"セ"],[13022,1,"ソ"],[13023,1,"タ"],[13024,1,"チ"],[13025,1,"ツ"],[13026,1,"テ"],[13027,1,"ト"],[13028,1,"ナ"],[13029,1,"ニ"],[13030,1,"ヌ"],[13031,1,"ネ"],[13032,1,"ノ"],[13033,1,"ハ"],[13034,1,"ヒ"],[13035,1,"フ"],[13036,1,"ヘ"],[13037,1,"ホ"],[13038,1,"マ"],[13039,1,"ミ"],[13040,1,"ム"],[13041,1,"メ"],[13042,1,"モ"],[13043,1,"ヤ"],[13044,1,"ユ"],[13045,1,"ヨ"],[13046,1,"ラ"],[13047,1,"リ"],[13048,1,"ル"],[13049,1,"レ"],[13050,1,"ロ"],[13051,1,"ワ"],[13052,1,"ヰ"],[13053,1,"ヱ"],[13054,1,"ヲ"],[13055,1,"令和"],[13056,1,"アパート"],[13057,1,"アルファ"],[13058,1,"アンペア"],[13059,1,"アール"],[13060,1,"イニング"],[13061,1,"インチ"],[13062,1,"ウォン"],[13063,1,"エスクード"],[13064,1,"エーカー"],[13065,1,"オンス"],[13066,1,"オーム"],[13067,1,"カイリ"],[13068,1,"カラット"],[13069,1,"カロリー"],[13070,1,"ガロン"],[13071,1,"ガンマ"],[13072,1,"ギガ"],[13073,1,"ギニー"],[13074,1,"キュリー"],[13075,1,"ギルダー"],[13076,1,"キロ"],[13077,1,"キログラム"],[13078,1,"キロメートル"],[13079,1,"キロワット"],[13080,1,"グラム"],[13081,1,"グラムトン"],[13082,1,"クルゼイロ"],[13083,1,"クローネ"],[13084,1,"ケース"],[13085,1,"コルナ"],[13086,1,"コーポ"],[13087,1,"サイクル"],[13088,1,"サンチーム"],[13089,1,"シリング"],[13090,1,"センチ"],[13091,1,"セント"],[13092,1,"ダース"],[13093,1,"デシ"],[13094,1,"ドル"],[13095,1,"トン"],[13096,1,"ナノ"],[13097,1,"ノット"],[13098,1,"ハイツ"],[13099,1,"パーセント"],[13100,1,"パーツ"],[13101,1,"バーレル"],[13102,1,"ピアストル"],[13103,1,"ピクル"],[13104,1,"ピコ"],[13105,1,"ビル"],[13106,1,"ファラッド"],[13107,1,"フィート"],[13108,1,"ブッシェル"],[13109,1,"フラン"],[13110,1,"ヘクタール"],[13111,1,"ペソ"],[13112,1,"ペニヒ"],[13113,1,"ヘルツ"],[13114,1,"ペンス"],[13115,1,"ページ"],[13116,1,"ベータ"],[13117,1,"ポイント"],[13118,1,"ボルト"],[13119,1,"ホン"],[13120,1,"ポンド"],[13121,1,"ホール"],[13122,1,"ホーン"],[13123,1,"マイクロ"],[13124,1,"マイル"],[13125,1,"マッハ"],[13126,1,"マルク"],[13127,1,"マンション"],[13128,1,"ミクロン"],[13129,1,"ミリ"],[13130,1,"ミリバール"],[13131,1,"メガ"],[13132,1,"メガトン"],[13133,1,"メートル"],[13134,1,"ヤード"],[13135,1,"ヤール"],[13136,1,"ユアン"],[13137,1,"リットル"],[13138,1,"リラ"],[13139,1,"ルピー"],[13140,1,"ルーブル"],[13141,1,"レム"],[13142,1,"レントゲン"],[13143,1,"ワット"],[13144,1,"0点"],[13145,1,"1点"],[13146,1,"2点"],[13147,1,"3点"],[13148,1,"4点"],[13149,1,"5点"],[13150,1,"6点"],[13151,1,"7点"],[13152,1,"8点"],[13153,1,"9点"],[13154,1,"10点"],[13155,1,"11点"],[13156,1,"12点"],[13157,1,"13点"],[13158,1,"14点"],[13159,1,"15点"],[13160,1,"16点"],[13161,1,"17点"],[13162,1,"18点"],[13163,1,"19点"],[13164,1,"20点"],[13165,1,"21点"],[13166,1,"22点"],[13167,1,"23点"],[13168,1,"24点"],[13169,1,"hpa"],[13170,1,"da"],[13171,1,"au"],[13172,1,"bar"],[13173,1,"ov"],[13174,1,"pc"],[13175,1,"dm"],[13176,1,"dm2"],[13177,1,"dm3"],[13178,1,"iu"],[13179,1,"平成"],[13180,1,"昭和"],[13181,1,"大正"],[13182,1,"明治"],[13183,1,"株式会社"],[13184,1,"pa"],[13185,1,"na"],[13186,1,"μa"],[13187,1,"ma"],[13188,1,"ka"],[13189,1,"kb"],[13190,1,"mb"],[13191,1,"gb"],[13192,1,"cal"],[13193,1,"kcal"],[13194,1,"pf"],[13195,1,"nf"],[13196,1,"μf"],[13197,1,"μg"],[13198,1,"mg"],[13199,1,"kg"],[13200,1,"hz"],[13201,1,"khz"],[13202,1,"mhz"],[13203,1,"ghz"],[13204,1,"thz"],[13205,1,"μl"],[13206,1,"ml"],[13207,1,"dl"],[13208,1,"kl"],[13209,1,"fm"],[13210,1,"nm"],[13211,1,"μm"],[13212,1,"mm"],[13213,1,"cm"],[13214,1,"km"],[13215,1,"mm2"],[13216,1,"cm2"],[13217,1,"m2"],[13218,1,"km2"],[13219,1,"mm3"],[13220,1,"cm3"],[13221,1,"m3"],[13222,1,"km3"],[13223,1,"m∕s"],[13224,1,"m∕s2"],[13225,1,"pa"],[13226,1,"kpa"],[13227,1,"mpa"],[13228,1,"gpa"],[13229,1,"rad"],[13230,1,"rad∕s"],[13231,1,"rad∕s2"],[13232,1,"ps"],[13233,1,"ns"],[13234,1,"μs"],[13235,1,"ms"],[13236,1,"pv"],[13237,1,"nv"],[13238,1,"μv"],[13239,1,"mv"],[13240,1,"kv"],[13241,1,"mv"],[13242,1,"pw"],[13243,1,"nw"],[13244,1,"μw"],[13245,1,"mw"],[13246,1,"kw"],[13247,1,"mw"],[13248,1,"kω"],[13249,1,"mω"],[13250,3],[13251,1,"bq"],[13252,1,"cc"],[13253,1,"cd"],[13254,1,"c∕kg"],[13255,3],[13256,1,"db"],[13257,1,"gy"],[13258,1,"ha"],[13259,1,"hp"],[13260,1,"in"],[13261,1,"kk"],[13262,1,"km"],[13263,1,"kt"],[13264,1,"lm"],[13265,1,"ln"],[13266,1,"log"],[13267,1,"lx"],[13268,1,"mb"],[13269,1,"mil"],[13270,1,"mol"],[13271,1,"ph"],[13272,3],[13273,1,"ppm"],[13274,1,"pr"],[13275,1,"sr"],[13276,1,"sv"],[13277,1,"wb"],[13278,1,"v∕m"],[13279,1,"a∕m"],[13280,1,"1日"],[13281,1,"2日"],[13282,1,"3日"],[13283,1,"4日"],[13284,1,"5日"],[13285,1,"6日"],[13286,1,"7日"],[13287,1,"8日"],[13288,1,"9日"],[13289,1,"10日"],[13290,1,"11日"],[13291,1,"12日"],[13292,1,"13日"],[13293,1,"14日"],[13294,1,"15日"],[13295,1,"16日"],[13296,1,"17日"],[13297,1,"18日"],[13298,1,"19日"],[13299,1,"20日"],[13300,1,"21日"],[13301,1,"22日"],[13302,1,"23日"],[13303,1,"24日"],[13304,1,"25日"],[13305,1,"26日"],[13306,1,"27日"],[13307,1,"28日"],[13308,1,"29日"],[13309,1,"30日"],[13310,1,"31日"],[13311,1,"gal"],[[13312,19893],2],[[19894,19903],2],[[19904,19967],2],[[19968,40869],2],[[40870,40891],2],[[40892,40899],2],[[40900,40907],2],[40908,2],[[40909,40917],2],[[40918,40938],2],[[40939,40943],2],[[40944,40956],2],[[40957,40959],2],[[40960,42124],2],[[42125,42127],3],[[42128,42145],2],[[42146,42147],2],[[42148,42163],2],[42164,2],[[42165,42176],2],[42177,2],[[42178,42180],2],[42181,2],[42182,2],[[42183,42191],3],[[42192,42237],2],[[42238,42239],2],[[42240,42508],2],[[42509,42511],2],[[42512,42539],2],[[42540,42559],3],[42560,1,"ꙁ"],[42561,2],[42562,1,"ꙃ"],[42563,2],[42564,1,"ꙅ"],[42565,2],[42566,1,"ꙇ"],[42567,2],[42568,1,"ꙉ"],[42569,2],[42570,1,"ꙋ"],[42571,2],[42572,1,"ꙍ"],[42573,2],[42574,1,"ꙏ"],[42575,2],[42576,1,"ꙑ"],[42577,2],[42578,1,"ꙓ"],[42579,2],[42580,1,"ꙕ"],[42581,2],[42582,1,"ꙗ"],[42583,2],[42584,1,"ꙙ"],[42585,2],[42586,1,"ꙛ"],[42587,2],[42588,1,"ꙝ"],[42589,2],[42590,1,"ꙟ"],[42591,2],[42592,1,"ꙡ"],[42593,2],[42594,1,"ꙣ"],[42595,2],[42596,1,"ꙥ"],[42597,2],[42598,1,"ꙧ"],[42599,2],[42600,1,"ꙩ"],[42601,2],[42602,1,"ꙫ"],[42603,2],[42604,1,"ꙭ"],[[42605,42607],2],[[42608,42611],2],[[42612,42619],2],[[42620,42621],2],[42622,2],[42623,2],[42624,1,"ꚁ"],[42625,2],[42626,1,"ꚃ"],[42627,2],[42628,1,"ꚅ"],[42629,2],[42630,1,"ꚇ"],[42631,2],[42632,1,"ꚉ"],[42633,2],[42634,1,"ꚋ"],[42635,2],[42636,1,"ꚍ"],[42637,2],[42638,1,"ꚏ"],[42639,2],[42640,1,"ꚑ"],[42641,2],[42642,1,"ꚓ"],[42643,2],[42644,1,"ꚕ"],[42645,2],[42646,1,"ꚗ"],[42647,2],[42648,1,"ꚙ"],[42649,2],[42650,1,"ꚛ"],[42651,2],[42652,1,"ъ"],[42653,1,"ь"],[42654,2],[42655,2],[[42656,42725],2],[[42726,42735],2],[[42736,42737],2],[[42738,42743],2],[[42744,42751],3],[[42752,42774],2],[[42775,42778],2],[[42779,42783],2],[[42784,42785],2],[42786,1,"ꜣ"],[42787,2],[42788,1,"ꜥ"],[42789,2],[42790,1,"ꜧ"],[42791,2],[42792,1,"ꜩ"],[42793,2],[42794,1,"ꜫ"],[42795,2],[42796,1,"ꜭ"],[42797,2],[42798,1,"ꜯ"],[[42799,42801],2],[42802,1,"ꜳ"],[42803,2],[42804,1,"ꜵ"],[42805,2],[42806,1,"ꜷ"],[42807,2],[42808,1,"ꜹ"],[42809,2],[42810,1,"ꜻ"],[42811,2],[42812,1,"ꜽ"],[42813,2],[42814,1,"ꜿ"],[42815,2],[42816,1,"ꝁ"],[42817,2],[42818,1,"ꝃ"],[42819,2],[42820,1,"ꝅ"],[42821,2],[42822,1,"ꝇ"],[42823,2],[42824,1,"ꝉ"],[42825,2],[42826,1,"ꝋ"],[42827,2],[42828,1,"ꝍ"],[42829,2],[42830,1,"ꝏ"],[42831,2],[42832,1,"ꝑ"],[42833,2],[42834,1,"ꝓ"],[42835,2],[42836,1,"ꝕ"],[42837,2],[42838,1,"ꝗ"],[42839,2],[42840,1,"ꝙ"],[42841,2],[42842,1,"ꝛ"],[42843,2],[42844,1,"ꝝ"],[42845,2],[42846,1,"ꝟ"],[42847,2],[42848,1,"ꝡ"],[42849,2],[42850,1,"ꝣ"],[42851,2],[42852,1,"ꝥ"],[42853,2],[42854,1,"ꝧ"],[42855,2],[42856,1,"ꝩ"],[42857,2],[42858,1,"ꝫ"],[42859,2],[42860,1,"ꝭ"],[42861,2],[42862,1,"ꝯ"],[42863,2],[42864,1,"ꝯ"],[[42865,42872],2],[42873,1,"ꝺ"],[42874,2],[42875,1,"ꝼ"],[42876,2],[42877,1,"ᵹ"],[42878,1,"ꝿ"],[42879,2],[42880,1,"ꞁ"],[42881,2],[42882,1,"ꞃ"],[42883,2],[42884,1,"ꞅ"],[42885,2],[42886,1,"ꞇ"],[[42887,42888],2],[[42889,42890],2],[42891,1,"ꞌ"],[42892,2],[42893,1,"ɥ"],[42894,2],[42895,2],[42896,1,"ꞑ"],[42897,2],[42898,1,"ꞓ"],[42899,2],[[42900,42901],2],[42902,1,"ꞗ"],[42903,2],[42904,1,"ꞙ"],[42905,2],[42906,1,"ꞛ"],[42907,2],[42908,1,"ꞝ"],[42909,2],[42910,1,"ꞟ"],[42911,2],[42912,1,"ꞡ"],[42913,2],[42914,1,"ꞣ"],[42915,2],[42916,1,"ꞥ"],[42917,2],[42918,1,"ꞧ"],[42919,2],[42920,1,"ꞩ"],[42921,2],[42922,1,"ɦ"],[42923,1,"ɜ"],[42924,1,"ɡ"],[42925,1,"ɬ"],[42926,1,"ɪ"],[42927,2],[42928,1,"ʞ"],[42929,1,"ʇ"],[42930,1,"ʝ"],[42931,1,"ꭓ"],[42932,1,"ꞵ"],[42933,2],[42934,1,"ꞷ"],[42935,2],[42936,1,"ꞹ"],[42937,2],[42938,1,"ꞻ"],[42939,2],[42940,1,"ꞽ"],[42941,2],[42942,1,"ꞿ"],[42943,2],[42944,1,"ꟁ"],[42945,2],[42946,1,"ꟃ"],[42947,2],[42948,1,"ꞔ"],[42949,1,"ʂ"],[42950,1,"ᶎ"],[42951,1,"ꟈ"],[42952,2],[42953,1,"ꟊ"],[42954,2],[42955,1,"ɤ"],[42956,1,"ꟍ"],[42957,2],[[42958,42959],3],[42960,1,"ꟑ"],[42961,2],[42962,3],[42963,2],[42964,3],[42965,2],[42966,1,"ꟗ"],[42967,2],[42968,1,"ꟙ"],[42969,2],[42970,1,"ꟛ"],[42971,2],[42972,1,"ƛ"],[[42973,42993],3],[42994,1,"c"],[42995,1,"f"],[42996,1,"q"],[42997,1,"ꟶ"],[42998,2],[42999,2],[43000,1,"ħ"],[43001,1,"œ"],[43002,2],[[43003,43007],2],[[43008,43047],2],[[43048,43051],2],[43052,2],[[43053,43055],3],[[43056,43065],2],[[43066,43071],3],[[43072,43123],2],[[43124,43127],2],[[43128,43135],3],[[43136,43204],2],[43205,2],[[43206,43213],3],[[43214,43215],2],[[43216,43225],2],[[43226,43231],3],[[43232,43255],2],[[43256,43258],2],[43259,2],[43260,2],[43261,2],[[43262,43263],2],[[43264,43309],2],[[43310,43311],2],[[43312,43347],2],[[43348,43358],3],[43359,2],[[43360,43388],2],[[43389,43391],3],[[43392,43456],2],[[43457,43469],2],[43470,3],[[43471,43481],2],[[43482,43485],3],[[43486,43487],2],[[43488,43518],2],[43519,3],[[43520,43574],2],[[43575,43583],3],[[43584,43597],2],[[43598,43599],3],[[43600,43609],2],[[43610,43611],3],[[43612,43615],2],[[43616,43638],2],[[43639,43641],2],[[43642,43643],2],[[43644,43647],2],[[43648,43714],2],[[43715,43738],3],[[43739,43741],2],[[43742,43743],2],[[43744,43759],2],[[43760,43761],2],[[43762,43766],2],[[43767,43776],3],[[43777,43782],2],[[43783,43784],3],[[43785,43790],2],[[43791,43792],3],[[43793,43798],2],[[43799,43807],3],[[43808,43814],2],[43815,3],[[43816,43822],2],[43823,3],[[43824,43866],2],[43867,2],[43868,1,"ꜧ"],[43869,1,"ꬷ"],[43870,1,"ɫ"],[43871,1,"ꭒ"],[[43872,43875],2],[[43876,43877],2],[[43878,43879],2],[43880,2],[43881,1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"Ꮲ"],[43955,1,"Ꮳ"],[43956,1,"Ꮴ"],[43957,1,"Ꮵ"],[43958,1,"Ꮶ"],[43959,1,"Ꮷ"],[43960,1,"Ꮸ"],[43961,1,"Ꮹ"],[43962,1,"Ꮺ"],[43963,1,"Ꮻ"],[43964,1,"Ꮼ"],[43965,1,"Ꮽ"],[43966,1,"Ꮾ"],[43967,1,"Ꮿ"],[[43968,44010],2],[44011,2],[[44012,44013],2],[[44014,44015],3],[[44016,44025],2],[[44026,44031],3],[[44032,55203],2],[[55204,55215],3],[[55216,55238],2],[[55239,55242],3],[[55243,55291],2],[[55292,55295],3],[[55296,57343],3],[[57344,63743],3],[63744,1,"豈"],[63745,1,"更"],[63746,1,"車"],[63747,1,"賈"],[63748,1,"滑"],[63749,1,"串"],[63750,1,"句"],[[63751,63752],1,"龜"],[63753,1,"契"],[63754,1,"金"],[63755,1,"喇"],[63756,1,"奈"],[63757,1,"懶"],[63758,1,"癩"],[63759,1,"羅"],[63760,1,"蘿"],[63761,1,"螺"],[63762,1,"裸"],[63763,1,"邏"],[63764,1,"樂"],[63765,1,"洛"],[63766,1,"烙"],[63767,1,"珞"],[63768,1,"落"],[63769,1,"酪"],[63770,1,"駱"],[63771,1,"亂"],[63772,1,"卵"],[63773,1,"欄"],[63774,1,"爛"],[63775,1,"蘭"],[63776,1,"鸞"],[63777,1,"嵐"],[63778,1,"濫"],[63779,1,"藍"],[63780,1,"襤"],[63781,1,"拉"],[63782,1,"臘"],[63783,1,"蠟"],[63784,1,"廊"],[63785,1,"朗"],[63786,1,"浪"],[63787,1,"狼"],[63788,1,"郎"],[63789,1,"來"],[63790,1,"冷"],[63791,1,"勞"],[63792,1,"擄"],[63793,1,"櫓"],[63794,1,"爐"],[63795,1,"盧"],[63796,1,"老"],[63797,1,"蘆"],[63798,1,"虜"],[63799,1,"路"],[63800,1,"露"],[63801,1,"魯"],[63802,1,"鷺"],[63803,1,"碌"],[63804,1,"祿"],[63805,1,"綠"],[63806,1,"菉"],[63807,1,"錄"],[63808,1,"鹿"],[63809,1,"論"],[63810,1,"壟"],[63811,1,"弄"],[63812,1,"籠"],[63813,1,"聾"],[63814,1,"牢"],[63815,1,"磊"],[63816,1,"賂"],[63817,1,"雷"],[63818,1,"壘"],[63819,1,"屢"],[63820,1,"樓"],[63821,1,"淚"],[63822,1,"漏"],[63823,1,"累"],[63824,1,"縷"],[63825,1,"陋"],[63826,1,"勒"],[63827,1,"肋"],[63828,1,"凜"],[63829,1,"凌"],[63830,1,"稜"],[63831,1,"綾"],[63832,1,"菱"],[63833,1,"陵"],[63834,1,"讀"],[63835,1,"拏"],[63836,1,"樂"],[63837,1,"諾"],[63838,1,"丹"],[63839,1,"寧"],[63840,1,"怒"],[63841,1,"率"],[63842,1,"異"],[63843,1,"北"],[63844,1,"磻"],[63845,1,"便"],[63846,1,"復"],[63847,1,"不"],[63848,1,"泌"],[63849,1,"數"],[63850,1,"索"],[63851,1,"參"],[63852,1,"塞"],[63853,1,"省"],[63854,1,"葉"],[63855,1,"說"],[63856,1,"殺"],[63857,1,"辰"],[63858,1,"沈"],[63859,1,"拾"],[63860,1,"若"],[63861,1,"掠"],[63862,1,"略"],[63863,1,"亮"],[63864,1,"兩"],[63865,1,"凉"],[63866,1,"梁"],[63867,1,"糧"],[63868,1,"良"],[63869,1,"諒"],[63870,1,"量"],[63871,1,"勵"],[63872,1,"呂"],[63873,1,"女"],[63874,1,"廬"],[63875,1,"旅"],[63876,1,"濾"],[63877,1,"礪"],[63878,1,"閭"],[63879,1,"驪"],[63880,1,"麗"],[63881,1,"黎"],[63882,1,"力"],[63883,1,"曆"],[63884,1,"歷"],[63885,1,"轢"],[63886,1,"年"],[63887,1,"憐"],[63888,1,"戀"],[63889,1,"撚"],[63890,1,"漣"],[63891,1,"煉"],[63892,1,"璉"],[63893,1,"秊"],[63894,1,"練"],[63895,1,"聯"],[63896,1,"輦"],[63897,1,"蓮"],[63898,1,"連"],[63899,1,"鍊"],[63900,1,"列"],[63901,1,"劣"],[63902,1,"咽"],[63903,1,"烈"],[63904,1,"裂"],[63905,1,"說"],[63906,1,"廉"],[63907,1,"念"],[63908,1,"捻"],[63909,1,"殮"],[63910,1,"簾"],[63911,1,"獵"],[63912,1,"令"],[63913,1,"囹"],[63914,1,"寧"],[63915,1,"嶺"],[63916,1,"怜"],[63917,1,"玲"],[63918,1,"瑩"],[63919,1,"羚"],[63920,1,"聆"],[63921,1,"鈴"],[63922,1,"零"],[63923,1,"靈"],[63924,1,"領"],[63925,1,"例"],[63926,1,"禮"],[63927,1,"醴"],[63928,1,"隸"],[63929,1,"惡"],[63930,1,"了"],[63931,1,"僚"],[63932,1,"寮"],[63933,1,"尿"],[63934,1,"料"],[63935,1,"樂"],[63936,1,"燎"],[63937,1,"療"],[63938,1,"蓼"],[63939,1,"遼"],[63940,1,"龍"],[63941,1,"暈"],[63942,1,"阮"],[63943,1,"劉"],[63944,1,"杻"],[63945,1,"柳"],[63946,1,"流"],[63947,1,"溜"],[63948,1,"琉"],[63949,1,"留"],[63950,1,"硫"],[63951,1,"紐"],[63952,1,"類"],[63953,1,"六"],[63954,1,"戮"],[63955,1,"陸"],[63956,1,"倫"],[63957,1,"崙"],[63958,1,"淪"],[63959,1,"輪"],[63960,1,"律"],[63961,1,"慄"],[63962,1,"栗"],[63963,1,"率"],[63964,1,"隆"],[63965,1,"利"],[63966,1,"吏"],[63967,1,"履"],[63968,1,"易"],[63969,1,"李"],[63970,1,"梨"],[63971,1,"泥"],[63972,1,"理"],[63973,1,"痢"],[63974,1,"罹"],[63975,1,"裏"],[63976,1,"裡"],[63977,1,"里"],[63978,1,"離"],[63979,1,"匿"],[63980,1,"溺"],[63981,1,"吝"],[63982,1,"燐"],[63983,1,"璘"],[63984,1,"藺"],[63985,1,"隣"],[63986,1,"鱗"],[63987,1,"麟"],[63988,1,"林"],[63989,1,"淋"],[63990,1,"臨"],[63991,1,"立"],[63992,1,"笠"],[63993,1,"粒"],[63994,1,"狀"],[63995,1,"炙"],[63996,1,"識"],[63997,1,"什"],[63998,1,"茶"],[63999,1,"刺"],[64000,1,"切"],[64001,1,"度"],[64002,1,"拓"],[64003,1,"糖"],[64004,1,"宅"],[64005,1,"洞"],[64006,1,"暴"],[64007,1,"輻"],[64008,1,"行"],[64009,1,"降"],[64010,1,"見"],[64011,1,"廓"],[64012,1,"兀"],[64013,1,"嗀"],[[64014,64015],2],[64016,1,"塚"],[64017,2],[64018,1,"晴"],[[64019,64020],2],[64021,1,"凞"],[64022,1,"猪"],[64023,1,"益"],[64024,1,"礼"],[64025,1,"神"],[64026,1,"祥"],[64027,1,"福"],[64028,1,"靖"],[64029,1,"精"],[64030,1,"羽"],[64031,2],[64032,1,"蘒"],[64033,2],[64034,1,"諸"],[[64035,64036],2],[64037,1,"逸"],[64038,1,"都"],[[64039,64041],2],[64042,1,"飯"],[64043,1,"飼"],[64044,1,"館"],[64045,1,"鶴"],[64046,1,"郞"],[64047,1,"隷"],[64048,1,"侮"],[64049,1,"僧"],[64050,1,"免"],[64051,1,"勉"],[64052,1,"勤"],[64053,1,"卑"],[64054,1,"喝"],[64055,1,"嘆"],[64056,1,"器"],[64057,1,"塀"],[64058,1,"墨"],[64059,1,"層"],[64060,1,"屮"],[64061,1,"悔"],[64062,1,"慨"],[64063,1,"憎"],[64064,1,"懲"],[64065,1,"敏"],[64066,1,"既"],[64067,1,"暑"],[64068,1,"梅"],[64069,1,"海"],[64070,1,"渚"],[64071,1,"漢"],[64072,1,"煮"],[64073,1,"爫"],[64074,1,"琢"],[64075,1,"碑"],[64076,1,"社"],[64077,1,"祉"],[64078,1,"祈"],[64079,1,"祐"],[64080,1,"祖"],[64081,1,"祝"],[64082,1,"禍"],[64083,1,"禎"],[64084,1,"穀"],[64085,1,"突"],[64086,1,"節"],[64087,1,"練"],[64088,1,"縉"],[64089,1,"繁"],[64090,1,"署"],[64091,1,"者"],[64092,1,"臭"],[[64093,64094],1,"艹"],[64095,1,"著"],[64096,1,"褐"],[64097,1,"視"],[64098,1,"謁"],[64099,1,"謹"],[64100,1,"賓"],[64101,1,"贈"],[64102,1,"辶"],[64103,1,"逸"],[64104,1,"難"],[64105,1,"響"],[64106,1,"頻"],[64107,1,"恵"],[64108,1,"𤋮"],[64109,1,"舘"],[[64110,64111],3],[64112,1,"並"],[64113,1,"况"],[64114,1,"全"],[64115,1,"侀"],[64116,1,"充"],[64117,1,"冀"],[64118,1,"勇"],[64119,1,"勺"],[64120,1,"喝"],[64121,1,"啕"],[64122,1,"喙"],[64123,1,"嗢"],[64124,1,"塚"],[64125,1,"墳"],[64126,1,"奄"],[64127,1,"奔"],[64128,1,"婢"],[64129,1,"嬨"],[64130,1,"廒"],[64131,1,"廙"],[64132,1,"彩"],[64133,1,"徭"],[64134,1,"惘"],[64135,1,"慎"],[64136,1,"愈"],[64137,1,"憎"],[64138,1,"慠"],[64139,1,"懲"],[64140,1,"戴"],[64141,1,"揄"],[64142,1,"搜"],[64143,1,"摒"],[64144,1,"敖"],[64145,1,"晴"],[64146,1,"朗"],[64147,1,"望"],[64148,1,"杖"],[64149,1,"歹"],[64150,1,"殺"],[64151,1,"流"],[64152,1,"滛"],[64153,1,"滋"],[64154,1,"漢"],[64155,1,"瀞"],[64156,1,"煮"],[64157,1,"瞧"],[64158,1,"爵"],[64159,1,"犯"],[64160,1,"猪"],[64161,1,"瑱"],[64162,1,"甆"],[64163,1,"画"],[64164,1,"瘝"],[64165,1,"瘟"],[64166,1,"益"],[64167,1,"盛"],[64168,1,"直"],[64169,1,"睊"],[64170,1,"着"],[64171,1,"磌"],[64172,1,"窱"],[64173,1,"節"],[64174,1,"类"],[64175,1,"絛"],[64176,1,"練"],[64177,1,"缾"],[64178,1,"者"],[64179,1,"荒"],[64180,1,"華"],[64181,1,"蝹"],[64182,1,"襁"],[64183,1,"覆"],[64184,1,"視"],[64185,1,"調"],[64186,1,"諸"],[64187,1,"請"],[64188,1,"謁"],[64189,1,"諾"],[64190,1,"諭"],[64191,1,"謹"],[64192,1,"變"],[64193,1,"贈"],[64194,1,"輸"],[64195,1,"遲"],[64196,1,"醙"],[64197,1,"鉶"],[64198,1,"陼"],[64199,1,"難"],[64200,1,"靖"],[64201,1,"韛"],[64202,1,"響"],[64203,1,"頋"],[64204,1,"頻"],[64205,1,"鬒"],[64206,1,"龜"],[64207,1,"𢡊"],[64208,1,"𢡄"],[64209,1,"𣏕"],[64210,1,"㮝"],[64211,1,"䀘"],[64212,1,"䀹"],[64213,1,"𥉉"],[64214,1,"𥳐"],[64215,1,"𧻓"],[64216,1,"齃"],[64217,1,"龎"],[[64218,64255],3],[64256,1,"ff"],[64257,1,"fi"],[64258,1,"fl"],[64259,1,"ffi"],[64260,1,"ffl"],[[64261,64262],1,"st"],[[64263,64274],3],[64275,1,"մն"],[64276,1,"մե"],[64277,1,"մի"],[64278,1,"վն"],[64279,1,"մխ"],[[64280,64284],3],[64285,1,"יִ"],[64286,2],[64287,1,"ײַ"],[64288,1,"ע"],[64289,1,"א"],[64290,1,"ד"],[64291,1,"ה"],[64292,1,"כ"],[64293,1,"ל"],[64294,1,"ם"],[64295,1,"ר"],[64296,1,"ת"],[64297,1,"+"],[64298,1,"שׁ"],[64299,1,"שׂ"],[64300,1,"שּׁ"],[64301,1,"שּׂ"],[64302,1,"אַ"],[64303,1,"אָ"],[64304,1,"אּ"],[64305,1,"בּ"],[64306,1,"גּ"],[64307,1,"דּ"],[64308,1,"הּ"],[64309,1,"וּ"],[64310,1,"זּ"],[64311,3],[64312,1,"טּ"],[64313,1,"יּ"],[64314,1,"ךּ"],[64315,1,"כּ"],[64316,1,"לּ"],[64317,3],[64318,1,"מּ"],[64319,3],[64320,1,"נּ"],[64321,1,"סּ"],[64322,3],[64323,1,"ףּ"],[64324,1,"פּ"],[64325,3],[64326,1,"צּ"],[64327,1,"קּ"],[64328,1,"רּ"],[64329,1,"שּ"],[64330,1,"תּ"],[64331,1,"וֹ"],[64332,1,"בֿ"],[64333,1,"כֿ"],[64334,1,"פֿ"],[64335,1,"אל"],[[64336,64337],1,"ٱ"],[[64338,64341],1,"ٻ"],[[64342,64345],1,"پ"],[[64346,64349],1,"ڀ"],[[64350,64353],1,"ٺ"],[[64354,64357],1,"ٿ"],[[64358,64361],1,"ٹ"],[[64362,64365],1,"ڤ"],[[64366,64369],1,"ڦ"],[[64370,64373],1,"ڄ"],[[64374,64377],1,"ڃ"],[[64378,64381],1,"چ"],[[64382,64385],1,"ڇ"],[[64386,64387],1,"ڍ"],[[64388,64389],1,"ڌ"],[[64390,64391],1,"ڎ"],[[64392,64393],1,"ڈ"],[[64394,64395],1,"ژ"],[[64396,64397],1,"ڑ"],[[64398,64401],1,"ک"],[[64402,64405],1,"گ"],[[64406,64409],1,"ڳ"],[[64410,64413],1,"ڱ"],[[64414,64415],1,"ں"],[[64416,64419],1,"ڻ"],[[64420,64421],1,"ۀ"],[[64422,64425],1,"ہ"],[[64426,64429],1,"ھ"],[[64430,64431],1,"ے"],[[64432,64433],1,"ۓ"],[[64434,64449],2],[64450,2],[[64451,64466],3],[[64467,64470],1,"ڭ"],[[64471,64472],1,"ۇ"],[[64473,64474],1,"ۆ"],[[64475,64476],1,"ۈ"],[64477,1,"ۇٴ"],[[64478,64479],1,"ۋ"],[[64480,64481],1,"ۅ"],[[64482,64483],1,"ۉ"],[[64484,64487],1,"ې"],[[64488,64489],1,"ى"],[[64490,64491],1,"ئا"],[[64492,64493],1,"ئە"],[[64494,64495],1,"ئو"],[[64496,64497],1,"ئۇ"],[[64498,64499],1,"ئۆ"],[[64500,64501],1,"ئۈ"],[[64502,64504],1,"ئې"],[[64505,64507],1,"ئى"],[[64508,64511],1,"ی"],[64512,1,"ئج"],[64513,1,"ئح"],[64514,1,"ئم"],[64515,1,"ئى"],[64516,1,"ئي"],[64517,1,"بج"],[64518,1,"بح"],[64519,1,"بخ"],[64520,1,"بم"],[64521,1,"بى"],[64522,1,"بي"],[64523,1,"تج"],[64524,1,"تح"],[64525,1,"تخ"],[64526,1,"تم"],[64527,1,"تى"],[64528,1,"تي"],[64529,1,"ثج"],[64530,1,"ثم"],[64531,1,"ثى"],[64532,1,"ثي"],[64533,1,"جح"],[64534,1,"جم"],[64535,1,"حج"],[64536,1,"حم"],[64537,1,"خج"],[64538,1,"خح"],[64539,1,"خم"],[64540,1,"سج"],[64541,1,"سح"],[64542,1,"سخ"],[64543,1,"سم"],[64544,1,"صح"],[64545,1,"صم"],[64546,1,"ضج"],[64547,1,"ضح"],[64548,1,"ضخ"],[64549,1,"ضم"],[64550,1,"طح"],[64551,1,"طم"],[64552,1,"ظم"],[64553,1,"عج"],[64554,1,"عم"],[64555,1,"غج"],[64556,1,"غم"],[64557,1,"فج"],[64558,1,"فح"],[64559,1,"فخ"],[64560,1,"فم"],[64561,1,"فى"],[64562,1,"في"],[64563,1,"قح"],[64564,1,"قم"],[64565,1,"قى"],[64566,1,"قي"],[64567,1,"كا"],[64568,1,"كج"],[64569,1,"كح"],[64570,1,"كخ"],[64571,1,"كل"],[64572,1,"كم"],[64573,1,"كى"],[64574,1,"كي"],[64575,1,"لج"],[64576,1,"لح"],[64577,1,"لخ"],[64578,1,"لم"],[64579,1,"لى"],[64580,1,"لي"],[64581,1,"مج"],[64582,1,"مح"],[64583,1,"مخ"],[64584,1,"مم"],[64585,1,"مى"],[64586,1,"مي"],[64587,1,"نج"],[64588,1,"نح"],[64589,1,"نخ"],[64590,1,"نم"],[64591,1,"نى"],[64592,1,"ني"],[64593,1,"هج"],[64594,1,"هم"],[64595,1,"هى"],[64596,1,"هي"],[64597,1,"يج"],[64598,1,"يح"],[64599,1,"يخ"],[64600,1,"يم"],[64601,1,"يى"],[64602,1,"يي"],[64603,1,"ذٰ"],[64604,1,"رٰ"],[64605,1,"ىٰ"],[64606,1," ٌّ"],[64607,1," ٍّ"],[64608,1," َّ"],[64609,1," ُّ"],[64610,1," ِّ"],[64611,1," ّٰ"],[64612,1,"ئر"],[64613,1,"ئز"],[64614,1,"ئم"],[64615,1,"ئن"],[64616,1,"ئى"],[64617,1,"ئي"],[64618,1,"بر"],[64619,1,"بز"],[64620,1,"بم"],[64621,1,"بن"],[64622,1,"بى"],[64623,1,"بي"],[64624,1,"تر"],[64625,1,"تز"],[64626,1,"تم"],[64627,1,"تن"],[64628,1,"تى"],[64629,1,"تي"],[64630,1,"ثر"],[64631,1,"ثز"],[64632,1,"ثم"],[64633,1,"ثن"],[64634,1,"ثى"],[64635,1,"ثي"],[64636,1,"فى"],[64637,1,"في"],[64638,1,"قى"],[64639,1,"قي"],[64640,1,"كا"],[64641,1,"كل"],[64642,1,"كم"],[64643,1,"كى"],[64644,1,"كي"],[64645,1,"لم"],[64646,1,"لى"],[64647,1,"لي"],[64648,1,"ما"],[64649,1,"مم"],[64650,1,"نر"],[64651,1,"نز"],[64652,1,"نم"],[64653,1,"نن"],[64654,1,"نى"],[64655,1,"ني"],[64656,1,"ىٰ"],[64657,1,"ير"],[64658,1,"يز"],[64659,1,"يم"],[64660,1,"ين"],[64661,1,"يى"],[64662,1,"يي"],[64663,1,"ئج"],[64664,1,"ئح"],[64665,1,"ئخ"],[64666,1,"ئم"],[64667,1,"ئه"],[64668,1,"بج"],[64669,1,"بح"],[64670,1,"بخ"],[64671,1,"بم"],[64672,1,"به"],[64673,1,"تج"],[64674,1,"تح"],[64675,1,"تخ"],[64676,1,"تم"],[64677,1,"ته"],[64678,1,"ثم"],[64679,1,"جح"],[64680,1,"جم"],[64681,1,"حج"],[64682,1,"حم"],[64683,1,"خج"],[64684,1,"خم"],[64685,1,"سج"],[64686,1,"سح"],[64687,1,"سخ"],[64688,1,"سم"],[64689,1,"صح"],[64690,1,"صخ"],[64691,1,"صم"],[64692,1,"ضج"],[64693,1,"ضح"],[64694,1,"ضخ"],[64695,1,"ضم"],[64696,1,"طح"],[64697,1,"ظم"],[64698,1,"عج"],[64699,1,"عم"],[64700,1,"غج"],[64701,1,"غم"],[64702,1,"فج"],[64703,1,"فح"],[64704,1,"فخ"],[64705,1,"فم"],[64706,1,"قح"],[64707,1,"قم"],[64708,1,"كج"],[64709,1,"كح"],[64710,1,"كخ"],[64711,1,"كل"],[64712,1,"كم"],[64713,1,"لج"],[64714,1,"لح"],[64715,1,"لخ"],[64716,1,"لم"],[64717,1,"له"],[64718,1,"مج"],[64719,1,"مح"],[64720,1,"مخ"],[64721,1,"مم"],[64722,1,"نج"],[64723,1,"نح"],[64724,1,"نخ"],[64725,1,"نم"],[64726,1,"نه"],[64727,1,"هج"],[64728,1,"هم"],[64729,1,"هٰ"],[64730,1,"يج"],[64731,1,"يح"],[64732,1,"يخ"],[64733,1,"يم"],[64734,1,"يه"],[64735,1,"ئم"],[64736,1,"ئه"],[64737,1,"بم"],[64738,1,"به"],[64739,1,"تم"],[64740,1,"ته"],[64741,1,"ثم"],[64742,1,"ثه"],[64743,1,"سم"],[64744,1,"سه"],[64745,1,"شم"],[64746,1,"شه"],[64747,1,"كل"],[64748,1,"كم"],[64749,1,"لم"],[64750,1,"نم"],[64751,1,"نه"],[64752,1,"يم"],[64753,1,"يه"],[64754,1,"ـَّ"],[64755,1,"ـُّ"],[64756,1,"ـِّ"],[64757,1,"طى"],[64758,1,"طي"],[64759,1,"عى"],[64760,1,"عي"],[64761,1,"غى"],[64762,1,"غي"],[64763,1,"سى"],[64764,1,"سي"],[64765,1,"شى"],[64766,1,"شي"],[64767,1,"حى"],[64768,1,"حي"],[64769,1,"جى"],[64770,1,"جي"],[64771,1,"خى"],[64772,1,"خي"],[64773,1,"صى"],[64774,1,"صي"],[64775,1,"ضى"],[64776,1,"ضي"],[64777,1,"شج"],[64778,1,"شح"],[64779,1,"شخ"],[64780,1,"شم"],[64781,1,"شر"],[64782,1,"سر"],[64783,1,"صر"],[64784,1,"ضر"],[64785,1,"طى"],[64786,1,"طي"],[64787,1,"عى"],[64788,1,"عي"],[64789,1,"غى"],[64790,1,"غي"],[64791,1,"سى"],[64792,1,"سي"],[64793,1,"شى"],[64794,1,"شي"],[64795,1,"حى"],[64796,1,"حي"],[64797,1,"جى"],[64798,1,"جي"],[64799,1,"خى"],[64800,1,"خي"],[64801,1,"صى"],[64802,1,"صي"],[64803,1,"ضى"],[64804,1,"ضي"],[64805,1,"شج"],[64806,1,"شح"],[64807,1,"شخ"],[64808,1,"شم"],[64809,1,"شر"],[64810,1,"سر"],[64811,1,"صر"],[64812,1,"ضر"],[64813,1,"شج"],[64814,1,"شح"],[64815,1,"شخ"],[64816,1,"شم"],[64817,1,"سه"],[64818,1,"شه"],[64819,1,"طم"],[64820,1,"سج"],[64821,1,"سح"],[64822,1,"سخ"],[64823,1,"شج"],[64824,1,"شح"],[64825,1,"شخ"],[64826,1,"طم"],[64827,1,"ظم"],[[64828,64829],1,"اً"],[[64830,64831],2],[[64832,64847],2],[64848,1,"تجم"],[[64849,64850],1,"تحج"],[64851,1,"تحم"],[64852,1,"تخم"],[64853,1,"تمج"],[64854,1,"تمح"],[64855,1,"تمخ"],[[64856,64857],1,"جمح"],[64858,1,"حمي"],[64859,1,"حمى"],[64860,1,"سحج"],[64861,1,"سجح"],[64862,1,"سجى"],[[64863,64864],1,"سمح"],[64865,1,"سمج"],[[64866,64867],1,"سمم"],[[64868,64869],1,"صحح"],[64870,1,"صمم"],[[64871,64872],1,"شحم"],[64873,1,"شجي"],[[64874,64875],1,"شمخ"],[[64876,64877],1,"شمم"],[64878,1,"ضحى"],[[64879,64880],1,"ضخم"],[[64881,64882],1,"طمح"],[64883,1,"طمم"],[64884,1,"طمي"],[64885,1,"عجم"],[[64886,64887],1,"عمم"],[64888,1,"عمى"],[64889,1,"غمم"],[64890,1,"غمي"],[64891,1,"غمى"],[[64892,64893],1,"فخم"],[64894,1,"قمح"],[64895,1,"قمم"],[64896,1,"لحم"],[64897,1,"لحي"],[64898,1,"لحى"],[[64899,64900],1,"لجج"],[[64901,64902],1,"لخم"],[[64903,64904],1,"لمح"],[64905,1,"محج"],[64906,1,"محم"],[64907,1,"محي"],[64908,1,"مجح"],[64909,1,"مجم"],[64910,1,"مخج"],[64911,1,"مخم"],[[64912,64913],3],[64914,1,"مجخ"],[64915,1,"همج"],[64916,1,"همم"],[64917,1,"نحم"],[64918,1,"نحى"],[[64919,64920],1,"نجم"],[64921,1,"نجى"],[64922,1,"نمي"],[64923,1,"نمى"],[[64924,64925],1,"يمم"],[64926,1,"بخي"],[64927,1,"تجي"],[64928,1,"تجى"],[64929,1,"تخي"],[64930,1,"تخى"],[64931,1,"تمي"],[64932,1,"تمى"],[64933,1,"جمي"],[64934,1,"جحى"],[64935,1,"جمى"],[64936,1,"سخى"],[64937,1,"صحي"],[64938,1,"شحي"],[64939,1,"ضحي"],[64940,1,"لجي"],[64941,1,"لمي"],[64942,1,"يحي"],[64943,1,"يجي"],[64944,1,"يمي"],[64945,1,"ممي"],[64946,1,"قمي"],[64947,1,"نحي"],[64948,1,"قمح"],[64949,1,"لحم"],[64950,1,"عمي"],[64951,1,"كمي"],[64952,1,"نجح"],[64953,1,"مخي"],[64954,1,"لجم"],[64955,1,"كمم"],[64956,1,"لجم"],[64957,1,"نجح"],[64958,1,"جحي"],[64959,1,"حجي"],[64960,1,"مجي"],[64961,1,"فمي"],[64962,1,"بحي"],[64963,1,"كمم"],[64964,1,"عجم"],[64965,1,"صمم"],[64966,1,"سخي"],[64967,1,"نجي"],[[64968,64974],3],[64975,2],[[64976,65007],3],[65008,1,"صلے"],[65009,1,"قلے"],[65010,1,"الله"],[65011,1,"اكبر"],[65012,1,"محمد"],[65013,1,"صلعم"],[65014,1,"رسول"],[65015,1,"عليه"],[65016,1,"وسلم"],[65017,1,"صلى"],[65018,1,"صلى الله عليه وسلم"],[65019,1,"جل جلاله"],[65020,1,"ریال"],[65021,2],[[65022,65023],2],[[65024,65039],7],[65040,1,","],[65041,1,"、"],[65042,3],[65043,1,":"],[65044,1,";"],[65045,1,"!"],[65046,1,"?"],[65047,1,"〖"],[65048,1,"〗"],[65049,3],[[65050,65055],3],[[65056,65059],2],[[65060,65062],2],[[65063,65069],2],[[65070,65071],2],[65072,3],[65073,1,"—"],[65074,1,"–"],[[65075,65076],1,"_"],[65077,1,"("],[65078,1,")"],[65079,1,"{"],[65080,1,"}"],[65081,1,"〔"],[65082,1,"〕"],[65083,1,"【"],[65084,1,"】"],[65085,1,"《"],[65086,1,"》"],[65087,1,"〈"],[65088,1,"〉"],[65089,1,"「"],[65090,1,"」"],[65091,1,"『"],[65092,1,"』"],[[65093,65094],2],[65095,1,"["],[65096,1,"]"],[[65097,65100],1," ̅"],[[65101,65103],1,"_"],[65104,1,","],[65105,1,"、"],[65106,3],[65107,3],[65108,1,";"],[65109,1,":"],[65110,1,"?"],[65111,1,"!"],[65112,1,"—"],[65113,1,"("],[65114,1,")"],[65115,1,"{"],[65116,1,"}"],[65117,1,"〔"],[65118,1,"〕"],[65119,1,"#"],[65120,1,"&"],[65121,1,"*"],[65122,1,"+"],[65123,1,"-"],[65124,1,"<"],[65125,1,">"],[65126,1,"="],[65127,3],[65128,1,"\\\\"],[65129,1,"$"],[65130,1,"%"],[65131,1,"@"],[[65132,65135],3],[65136,1," ً"],[65137,1,"ـً"],[65138,1," ٌ"],[65139,2],[65140,1," ٍ"],[65141,3],[65142,1," َ"],[65143,1,"ـَ"],[65144,1," ُ"],[65145,1,"ـُ"],[65146,1," ِ"],[65147,1,"ـِ"],[65148,1," ّ"],[65149,1,"ـّ"],[65150,1," ْ"],[65151,1,"ـْ"],[65152,1,"ء"],[[65153,65154],1,"آ"],[[65155,65156],1,"أ"],[[65157,65158],1,"ؤ"],[[65159,65160],1,"إ"],[[65161,65164],1,"ئ"],[[65165,65166],1,"ا"],[[65167,65170],1,"ب"],[[65171,65172],1,"ة"],[[65173,65176],1,"ت"],[[65177,65180],1,"ث"],[[65181,65184],1,"ج"],[[65185,65188],1,"ح"],[[65189,65192],1,"خ"],[[65193,65194],1,"د"],[[65195,65196],1,"ذ"],[[65197,65198],1,"ر"],[[65199,65200],1,"ز"],[[65201,65204],1,"س"],[[65205,65208],1,"ش"],[[65209,65212],1,"ص"],[[65213,65216],1,"ض"],[[65217,65220],1,"ط"],[[65221,65224],1,"ظ"],[[65225,65228],1,"ع"],[[65229,65232],1,"غ"],[[65233,65236],1,"ف"],[[65237,65240],1,"ق"],[[65241,65244],1,"ك"],[[65245,65248],1,"ل"],[[65249,65252],1,"م"],[[65253,65256],1,"ن"],[[65257,65260],1,"ه"],[[65261,65262],1,"و"],[[65263,65264],1,"ى"],[[65265,65268],1,"ي"],[[65269,65270],1,"لآ"],[[65271,65272],1,"لأ"],[[65273,65274],1,"لإ"],[[65275,65276],1,"لا"],[[65277,65278],3],[65279,7],[65280,3],[65281,1,"!"],[65282,1,"\\""],[65283,1,"#"],[65284,1,"$"],[65285,1,"%"],[65286,1,"&"],[65287,1,"\'"],[65288,1,"("],[65289,1,")"],[65290,1,"*"],[65291,1,"+"],[65292,1,","],[65293,1,"-"],[65294,1,"."],[65295,1,"/"],[65296,1,"0"],[65297,1,"1"],[65298,1,"2"],[65299,1,"3"],[65300,1,"4"],[65301,1,"5"],[65302,1,"6"],[65303,1,"7"],[65304,1,"8"],[65305,1,"9"],[65306,1,":"],[65307,1,";"],[65308,1,"<"],[65309,1,"="],[65310,1,">"],[65311,1,"?"],[65312,1,"@"],[65313,1,"a"],[65314,1,"b"],[65315,1,"c"],[65316,1,"d"],[65317,1,"e"],[65318,1,"f"],[65319,1,"g"],[65320,1,"h"],[65321,1,"i"],[65322,1,"j"],[65323,1,"k"],[65324,1,"l"],[65325,1,"m"],[65326,1,"n"],[65327,1,"o"],[65328,1,"p"],[65329,1,"q"],[65330,1,"r"],[65331,1,"s"],[65332,1,"t"],[65333,1,"u"],[65334,1,"v"],[65335,1,"w"],[65336,1,"x"],[65337,1,"y"],[65338,1,"z"],[65339,1,"["],[65340,1,"\\\\"],[65341,1,"]"],[65342,1,"^"],[65343,1,"_"],[65344,1,"`"],[65345,1,"a"],[65346,1,"b"],[65347,1,"c"],[65348,1,"d"],[65349,1,"e"],[65350,1,"f"],[65351,1,"g"],[65352,1,"h"],[65353,1,"i"],[65354,1,"j"],[65355,1,"k"],[65356,1,"l"],[65357,1,"m"],[65358,1,"n"],[65359,1,"o"],[65360,1,"p"],[65361,1,"q"],[65362,1,"r"],[65363,1,"s"],[65364,1,"t"],[65365,1,"u"],[65366,1,"v"],[65367,1,"w"],[65368,1,"x"],[65369,1,"y"],[65370,1,"z"],[65371,1,"{"],[65372,1,"|"],[65373,1,"}"],[65374,1,"~"],[65375,1,"⦅"],[65376,1,"⦆"],[65377,1,"."],[65378,1,"「"],[65379,1,"」"],[65380,1,"、"],[65381,1,"・"],[65382,1,"ヲ"],[65383,1,"ァ"],[65384,1,"ィ"],[65385,1,"ゥ"],[65386,1,"ェ"],[65387,1,"ォ"],[65388,1,"ャ"],[65389,1,"ュ"],[65390,1,"ョ"],[65391,1,"ッ"],[65392,1,"ー"],[65393,1,"ア"],[65394,1,"イ"],[65395,1,"ウ"],[65396,1,"エ"],[65397,1,"オ"],[65398,1,"カ"],[65399,1,"キ"],[65400,1,"ク"],[65401,1,"ケ"],[65402,1,"コ"],[65403,1,"サ"],[65404,1,"シ"],[65405,1,"ス"],[65406,1,"セ"],[65407,1,"ソ"],[65408,1,"タ"],[65409,1,"チ"],[65410,1,"ツ"],[65411,1,"テ"],[65412,1,"ト"],[65413,1,"ナ"],[65414,1,"ニ"],[65415,1,"ヌ"],[65416,1,"ネ"],[65417,1,"ノ"],[65418,1,"ハ"],[65419,1,"ヒ"],[65420,1,"フ"],[65421,1,"ヘ"],[65422,1,"ホ"],[65423,1,"マ"],[65424,1,"ミ"],[65425,1,"ム"],[65426,1,"メ"],[65427,1,"モ"],[65428,1,"ヤ"],[65429,1,"ユ"],[65430,1,"ヨ"],[65431,1,"ラ"],[65432,1,"リ"],[65433,1,"ル"],[65434,1,"レ"],[65435,1,"ロ"],[65436,1,"ワ"],[65437,1,"ン"],[65438,1,"゙"],[65439,1,"゚"],[65440,7],[65441,1,"ᄀ"],[65442,1,"ᄁ"],[65443,1,"ᆪ"],[65444,1,"ᄂ"],[65445,1,"ᆬ"],[65446,1,"ᆭ"],[65447,1,"ᄃ"],[65448,1,"ᄄ"],[65449,1,"ᄅ"],[65450,1,"ᆰ"],[65451,1,"ᆱ"],[65452,1,"ᆲ"],[65453,1,"ᆳ"],[65454,1,"ᆴ"],[65455,1,"ᆵ"],[65456,1,"ᄚ"],[65457,1,"ᄆ"],[65458,1,"ᄇ"],[65459,1,"ᄈ"],[65460,1,"ᄡ"],[65461,1,"ᄉ"],[65462,1,"ᄊ"],[65463,1,"ᄋ"],[65464,1,"ᄌ"],[65465,1,"ᄍ"],[65466,1,"ᄎ"],[65467,1,"ᄏ"],[65468,1,"ᄐ"],[65469,1,"ᄑ"],[65470,1,"ᄒ"],[[65471,65473],3],[65474,1,"ᅡ"],[65475,1,"ᅢ"],[65476,1,"ᅣ"],[65477,1,"ᅤ"],[65478,1,"ᅥ"],[65479,1,"ᅦ"],[[65480,65481],3],[65482,1,"ᅧ"],[65483,1,"ᅨ"],[65484,1,"ᅩ"],[65485,1,"ᅪ"],[65486,1,"ᅫ"],[65487,1,"ᅬ"],[[65488,65489],3],[65490,1,"ᅭ"],[65491,1,"ᅮ"],[65492,1,"ᅯ"],[65493,1,"ᅰ"],[65494,1,"ᅱ"],[65495,1,"ᅲ"],[[65496,65497],3],[65498,1,"ᅳ"],[65499,1,"ᅴ"],[65500,1,"ᅵ"],[[65501,65503],3],[65504,1,"¢"],[65505,1,"£"],[65506,1,"¬"],[65507,1," ̄"],[65508,1,"¦"],[65509,1,"¥"],[65510,1,"₩"],[65511,3],[65512,1,"│"],[65513,1,"←"],[65514,1,"↑"],[65515,1,"→"],[65516,1,"↓"],[65517,1,"■"],[65518,1,"○"],[[65519,65528],3],[[65529,65531],3],[65532,3],[65533,3],[[65534,65535],3],[[65536,65547],2],[65548,3],[[65549,65574],2],[65575,3],[[65576,65594],2],[65595,3],[[65596,65597],2],[65598,3],[[65599,65613],2],[[65614,65615],3],[[65616,65629],2],[[65630,65663],3],[[65664,65786],2],[[65787,65791],3],[[65792,65794],2],[[65795,65798],3],[[65799,65843],2],[[65844,65846],3],[[65847,65855],2],[[65856,65930],2],[[65931,65932],2],[[65933,65934],2],[65935,3],[[65936,65947],2],[65948,2],[[65949,65951],3],[65952,2],[[65953,65999],3],[[66000,66044],2],[66045,2],[[66046,66175],3],[[66176,66204],2],[[66205,66207],3],[[66208,66256],2],[[66257,66271],3],[66272,2],[[66273,66299],2],[[66300,66303],3],[[66304,66334],2],[66335,2],[[66336,66339],2],[[66340,66348],3],[[66349,66351],2],[[66352,66368],2],[66369,2],[[66370,66377],2],[66378,2],[[66379,66383],3],[[66384,66426],2],[[66427,66431],3],[[66432,66461],2],[66462,3],[66463,2],[[66464,66499],2],[[66500,66503],3],[[66504,66511],2],[[66512,66517],2],[[66518,66559],3],[66560,1,"𐐨"],[66561,1,"𐐩"],[66562,1,"𐐪"],[66563,1,"𐐫"],[66564,1,"𐐬"],[66565,1,"𐐭"],[66566,1,"𐐮"],[66567,1,"𐐯"],[66568,1,"𐐰"],[66569,1,"𐐱"],[66570,1,"𐐲"],[66571,1,"𐐳"],[66572,1,"𐐴"],[66573,1,"𐐵"],[66574,1,"𐐶"],[66575,1,"𐐷"],[66576,1,"𐐸"],[66577,1,"𐐹"],[66578,1,"𐐺"],[66579,1,"𐐻"],[66580,1,"𐐼"],[66581,1,"𐐽"],[66582,1,"𐐾"],[66583,1,"𐐿"],[66584,1,"𐑀"],[66585,1,"𐑁"],[66586,1,"𐑂"],[66587,1,"𐑃"],[66588,1,"𐑄"],[66589,1,"𐑅"],[66590,1,"𐑆"],[66591,1,"𐑇"],[66592,1,"𐑈"],[66593,1,"𐑉"],[66594,1,"𐑊"],[66595,1,"𐑋"],[66596,1,"𐑌"],[66597,1,"𐑍"],[66598,1,"𐑎"],[66599,1,"𐑏"],[[66600,66637],2],[[66638,66717],2],[[66718,66719],3],[[66720,66729],2],[[66730,66735],3],[66736,1,"𐓘"],[66737,1,"𐓙"],[66738,1,"𐓚"],[66739,1,"𐓛"],[66740,1,"𐓜"],[66741,1,"𐓝"],[66742,1,"𐓞"],[66743,1,"𐓟"],[66744,1,"𐓠"],[66745,1,"𐓡"],[66746,1,"𐓢"],[66747,1,"𐓣"],[66748,1,"𐓤"],[66749,1,"𐓥"],[66750,1,"𐓦"],[66751,1,"𐓧"],[66752,1,"𐓨"],[66753,1,"𐓩"],[66754,1,"𐓪"],[66755,1,"𐓫"],[66756,1,"𐓬"],[66757,1,"𐓭"],[66758,1,"𐓮"],[66759,1,"𐓯"],[66760,1,"𐓰"],[66761,1,"𐓱"],[66762,1,"𐓲"],[66763,1,"𐓳"],[66764,1,"𐓴"],[66765,1,"𐓵"],[66766,1,"𐓶"],[66767,1,"𐓷"],[66768,1,"𐓸"],[66769,1,"𐓹"],[66770,1,"𐓺"],[66771,1,"𐓻"],[[66772,66775],3],[[66776,66811],2],[[66812,66815],3],[[66816,66855],2],[[66856,66863],3],[[66864,66915],2],[[66916,66926],3],[66927,2],[66928,1,"𐖗"],[66929,1,"𐖘"],[66930,1,"𐖙"],[66931,1,"𐖚"],[66932,1,"𐖛"],[66933,1,"𐖜"],[66934,1,"𐖝"],[66935,1,"𐖞"],[66936,1,"𐖟"],[66937,1,"𐖠"],[66938,1,"𐖡"],[66939,3],[66940,1,"𐖣"],[66941,1,"𐖤"],[66942,1,"𐖥"],[66943,1,"𐖦"],[66944,1,"𐖧"],[66945,1,"𐖨"],[66946,1,"𐖩"],[66947,1,"𐖪"],[66948,1,"𐖫"],[66949,1,"𐖬"],[66950,1,"𐖭"],[66951,1,"𐖮"],[66952,1,"𐖯"],[66953,1,"𐖰"],[66954,1,"𐖱"],[66955,3],[66956,1,"𐖳"],[66957,1,"𐖴"],[66958,1,"𐖵"],[66959,1,"𐖶"],[66960,1,"𐖷"],[66961,1,"𐖸"],[66962,1,"𐖹"],[66963,3],[66964,1,"𐖻"],[66965,1,"𐖼"],[66966,3],[[66967,66977],2],[66978,3],[[66979,66993],2],[66994,3],[[66995,67001],2],[67002,3],[[67003,67004],2],[[67005,67007],3],[[67008,67059],2],[[67060,67071],3],[[67072,67382],2],[[67383,67391],3],[[67392,67413],2],[[67414,67423],3],[[67424,67431],2],[[67432,67455],3],[67456,2],[67457,1,"ː"],[67458,1,"ˑ"],[67459,1,"æ"],[67460,1,"ʙ"],[67461,1,"ɓ"],[67462,3],[67463,1,"ʣ"],[67464,1,"ꭦ"],[67465,1,"ʥ"],[67466,1,"ʤ"],[67467,1,"ɖ"],[67468,1,"ɗ"],[67469,1,"ᶑ"],[67470,1,"ɘ"],[67471,1,"ɞ"],[67472,1,"ʩ"],[67473,1,"ɤ"],[67474,1,"ɢ"],[67475,1,"ɠ"],[67476,1,"ʛ"],[67477,1,"ħ"],[67478,1,"ʜ"],[67479,1,"ɧ"],[67480,1,"ʄ"],[67481,1,"ʪ"],[67482,1,"ʫ"],[67483,1,"ɬ"],[67484,1,"𝼄"],[67485,1,"ꞎ"],[67486,1,"ɮ"],[67487,1,"𝼅"],[67488,1,"ʎ"],[67489,1,"𝼆"],[67490,1,"ø"],[67491,1,"ɶ"],[67492,1,"ɷ"],[67493,1,"q"],[67494,1,"ɺ"],[67495,1,"𝼈"],[67496,1,"ɽ"],[67497,1,"ɾ"],[67498,1,"ʀ"],[67499,1,"ʨ"],[67500,1,"ʦ"],[67501,1,"ꭧ"],[67502,1,"ʧ"],[67503,1,"ʈ"],[67504,1,"ⱱ"],[67505,3],[67506,1,"ʏ"],[67507,1,"ʡ"],[67508,1,"ʢ"],[67509,1,"ʘ"],[67510,1,"ǀ"],[67511,1,"ǁ"],[67512,1,"ǂ"],[67513,1,"𝼊"],[67514,1,"𝼞"],[[67515,67583],3],[[67584,67589],2],[[67590,67591],3],[67592,2],[67593,3],[[67594,67637],2],[67638,3],[[67639,67640],2],[[67641,67643],3],[67644,2],[[67645,67646],3],[67647,2],[[67648,67669],2],[67670,3],[[67671,67679],2],[[67680,67702],2],[[67703,67711],2],[[67712,67742],2],[[67743,67750],3],[[67751,67759],2],[[67760,67807],3],[[67808,67826],2],[67827,3],[[67828,67829],2],[[67830,67834],3],[[67835,67839],2],[[67840,67861],2],[[67862,67865],2],[[67866,67867],2],[[67868,67870],3],[67871,2],[[67872,67897],2],[[67898,67902],3],[67903,2],[[67904,67967],3],[[67968,68023],2],[[68024,68027],3],[[68028,68029],2],[[68030,68031],2],[[68032,68047],2],[[68048,68049],3],[[68050,68095],2],[[68096,68099],2],[68100,3],[[68101,68102],2],[[68103,68107],3],[[68108,68115],2],[68116,3],[[68117,68119],2],[68120,3],[[68121,68147],2],[[68148,68149],2],[[68150,68151],3],[[68152,68154],2],[[68155,68158],3],[68159,2],[[68160,68167],2],[68168,2],[[68169,68175],3],[[68176,68184],2],[[68185,68191],3],[[68192,68220],2],[[68221,68223],2],[[68224,68252],2],[[68253,68255],2],[[68256,68287],3],[[68288,68295],2],[68296,2],[[68297,68326],2],[[68327,68330],3],[[68331,68342],2],[[68343,68351],3],[[68352,68405],2],[[68406,68408],3],[[68409,68415],2],[[68416,68437],2],[[68438,68439],3],[[68440,68447],2],[[68448,68466],2],[[68467,68471],3],[[68472,68479],2],[[68480,68497],2],[[68498,68504],3],[[68505,68508],2],[[68509,68520],3],[[68521,68527],2],[[68528,68607],3],[[68608,68680],2],[[68681,68735],3],[68736,1,"𐳀"],[68737,1,"𐳁"],[68738,1,"𐳂"],[68739,1,"𐳃"],[68740,1,"𐳄"],[68741,1,"𐳅"],[68742,1,"𐳆"],[68743,1,"𐳇"],[68744,1,"𐳈"],[68745,1,"𐳉"],[68746,1,"𐳊"],[68747,1,"𐳋"],[68748,1,"𐳌"],[68749,1,"𐳍"],[68750,1,"𐳎"],[68751,1,"𐳏"],[68752,1,"𐳐"],[68753,1,"𐳑"],[68754,1,"𐳒"],[68755,1,"𐳓"],[68756,1,"𐳔"],[68757,1,"𐳕"],[68758,1,"𐳖"],[68759,1,"𐳗"],[68760,1,"𐳘"],[68761,1,"𐳙"],[68762,1,"𐳚"],[68763,1,"𐳛"],[68764,1,"𐳜"],[68765,1,"𐳝"],[68766,1,"𐳞"],[68767,1,"𐳟"],[68768,1,"𐳠"],[68769,1,"𐳡"],[68770,1,"𐳢"],[68771,1,"𐳣"],[68772,1,"𐳤"],[68773,1,"𐳥"],[68774,1,"𐳦"],[68775,1,"𐳧"],[68776,1,"𐳨"],[68777,1,"𐳩"],[68778,1,"𐳪"],[68779,1,"𐳫"],[68780,1,"𐳬"],[68781,1,"𐳭"],[68782,1,"𐳮"],[68783,1,"𐳯"],[68784,1,"𐳰"],[68785,1,"𐳱"],[68786,1,"𐳲"],[[68787,68799],3],[[68800,68850],2],[[68851,68857],3],[[68858,68863],2],[[68864,68903],2],[[68904,68911],3],[[68912,68921],2],[[68922,68927],3],[[68928,68943],2],[68944,1,"𐵰"],[68945,1,"𐵱"],[68946,1,"𐵲"],[68947,1,"𐵳"],[68948,1,"𐵴"],[68949,1,"𐵵"],[68950,1,"𐵶"],[68951,1,"𐵷"],[68952,1,"𐵸"],[68953,1,"𐵹"],[68954,1,"𐵺"],[68955,1,"𐵻"],[68956,1,"𐵼"],[68957,1,"𐵽"],[68958,1,"𐵾"],[68959,1,"𐵿"],[68960,1,"𐶀"],[68961,1,"𐶁"],[68962,1,"𐶂"],[68963,1,"𐶃"],[68964,1,"𐶄"],[68965,1,"𐶅"],[[68966,68968],3],[[68969,68973],2],[68974,2],[[68975,68997],2],[[68998,69005],3],[[69006,69007],2],[[69008,69215],3],[[69216,69246],2],[69247,3],[[69248,69289],2],[69290,3],[[69291,69292],2],[69293,2],[[69294,69295],3],[[69296,69297],2],[[69298,69313],3],[[69314,69316],2],[[69317,69371],3],[69372,2],[[69373,69375],2],[[69376,69404],2],[[69405,69414],2],[69415,2],[[69416,69423],3],[[69424,69456],2],[[69457,69465],2],[[69466,69487],3],[[69488,69509],2],[[69510,69513],2],[[69514,69551],3],[[69552,69572],2],[[69573,69579],2],[[69580,69599],3],[[69600,69622],2],[[69623,69631],3],[[69632,69702],2],[[69703,69709],2],[[69710,69713],3],[[69714,69733],2],[[69734,69743],2],[[69744,69749],2],[[69750,69758],3],[69759,2],[[69760,69818],2],[[69819,69820],2],[69821,3],[[69822,69825],2],[69826,2],[[69827,69836],3],[69837,3],[[69838,69839],3],[[69840,69864],2],[[69865,69871],3],[[69872,69881],2],[[69882,69887],3],[[69888,69940],2],[69941,3],[[69942,69951],2],[[69952,69955],2],[[69956,69958],2],[69959,2],[[69960,69967],3],[[69968,70003],2],[[70004,70005],2],[70006,2],[[70007,70015],3],[[70016,70084],2],[[70085,70088],2],[[70089,70092],2],[70093,2],[[70094,70095],2],[[70096,70105],2],[70106,2],[70107,2],[70108,2],[[70109,70111],2],[70112,3],[[70113,70132],2],[[70133,70143],3],[[70144,70161],2],[70162,3],[[70163,70199],2],[[70200,70205],2],[70206,2],[[70207,70209],2],[[70210,70271],3],[[70272,70278],2],[70279,3],[70280,2],[70281,3],[[70282,70285],2],[70286,3],[[70287,70301],2],[70302,3],[[70303,70312],2],[70313,2],[[70314,70319],3],[[70320,70378],2],[[70379,70383],3],[[70384,70393],2],[[70394,70399],3],[70400,2],[[70401,70403],2],[70404,3],[[70405,70412],2],[[70413,70414],3],[[70415,70416],2],[[70417,70418],3],[[70419,70440],2],[70441,3],[[70442,70448],2],[70449,3],[[70450,70451],2],[70452,3],[[70453,70457],2],[70458,3],[70459,2],[[70460,70468],2],[[70469,70470],3],[[70471,70472],2],[[70473,70474],3],[[70475,70477],2],[[70478,70479],3],[70480,2],[[70481,70486],3],[70487,2],[[70488,70492],3],[[70493,70499],2],[[70500,70501],3],[[70502,70508],2],[[70509,70511],3],[[70512,70516],2],[[70517,70527],3],[[70528,70537],2],[70538,3],[70539,2],[[70540,70541],3],[70542,2],[70543,3],[[70544,70581],2],[70582,3],[[70583,70592],2],[70593,3],[70594,2],[[70595,70596],3],[70597,2],[70598,3],[[70599,70602],2],[70603,3],[[70604,70611],2],[[70612,70613],2],[70614,3],[[70615,70616],2],[[70617,70624],3],[[70625,70626],2],[[70627,70655],3],[[70656,70730],2],[[70731,70735],2],[[70736,70745],2],[70746,2],[70747,2],[70748,3],[70749,2],[70750,2],[70751,2],[[70752,70753],2],[[70754,70783],3],[[70784,70853],2],[70854,2],[70855,2],[[70856,70863],3],[[70864,70873],2],[[70874,71039],3],[[71040,71093],2],[[71094,71095],3],[[71096,71104],2],[[71105,71113],2],[[71114,71127],2],[[71128,71133],2],[[71134,71167],3],[[71168,71232],2],[[71233,71235],2],[71236,2],[[71237,71247],3],[[71248,71257],2],[[71258,71263],3],[[71264,71276],2],[[71277,71295],3],[[71296,71351],2],[71352,2],[71353,2],[[71354,71359],3],[[71360,71369],2],[[71370,71375],3],[[71376,71395],2],[[71396,71423],3],[[71424,71449],2],[71450,2],[[71451,71452],3],[[71453,71467],2],[[71468,71471],3],[[71472,71481],2],[[71482,71487],2],[[71488,71494],2],[[71495,71679],3],[[71680,71738],2],[71739,2],[[71740,71839],3],[71840,1,"𑣀"],[71841,1,"𑣁"],[71842,1,"𑣂"],[71843,1,"𑣃"],[71844,1,"𑣄"],[71845,1,"𑣅"],[71846,1,"𑣆"],[71847,1,"𑣇"],[71848,1,"𑣈"],[71849,1,"𑣉"],[71850,1,"𑣊"],[71851,1,"𑣋"],[71852,1,"𑣌"],[71853,1,"𑣍"],[71854,1,"𑣎"],[71855,1,"𑣏"],[71856,1,"𑣐"],[71857,1,"𑣑"],[71858,1,"𑣒"],[71859,1,"𑣓"],[71860,1,"𑣔"],[71861,1,"𑣕"],[71862,1,"𑣖"],[71863,1,"𑣗"],[71864,1,"𑣘"],[71865,1,"𑣙"],[71866,1,"𑣚"],[71867,1,"𑣛"],[71868,1,"𑣜"],[71869,1,"𑣝"],[71870,1,"𑣞"],[71871,1,"𑣟"],[[71872,71913],2],[[71914,71922],2],[[71923,71934],3],[71935,2],[[71936,71942],2],[[71943,71944],3],[71945,2],[[71946,71947],3],[[71948,71955],2],[71956,3],[[71957,71958],2],[71959,3],[[71960,71989],2],[71990,3],[[71991,71992],2],[[71993,71994],3],[[71995,72003],2],[[72004,72006],2],[[72007,72015],3],[[72016,72025],2],[[72026,72095],3],[[72096,72103],2],[[72104,72105],3],[[72106,72151],2],[[72152,72153],3],[[72154,72161],2],[72162,2],[[72163,72164],2],[[72165,72191],3],[[72192,72254],2],[[72255,72262],2],[72263,2],[[72264,72271],3],[[72272,72323],2],[[72324,72325],2],[[72326,72345],2],[[72346,72348],2],[72349,2],[[72350,72354],2],[[72355,72367],3],[[72368,72383],2],[[72384,72440],2],[[72441,72447],3],[[72448,72457],2],[[72458,72639],3],[[72640,72672],2],[72673,2],[[72674,72687],3],[[72688,72697],2],[[72698,72703],3],[[72704,72712],2],[72713,3],[[72714,72758],2],[72759,3],[[72760,72768],2],[[72769,72773],2],[[72774,72783],3],[[72784,72793],2],[[72794,72812],2],[[72813,72815],3],[[72816,72817],2],[[72818,72847],2],[[72848,72849],3],[[72850,72871],2],[72872,3],[[72873,72886],2],[[72887,72959],3],[[72960,72966],2],[72967,3],[[72968,72969],2],[72970,3],[[72971,73014],2],[[73015,73017],3],[73018,2],[73019,3],[[73020,73021],2],[73022,3],[[73023,73031],2],[[73032,73039],3],[[73040,73049],2],[[73050,73055],3],[[73056,73061],2],[73062,3],[[73063,73064],2],[73065,3],[[73066,73102],2],[73103,3],[[73104,73105],2],[73106,3],[[73107,73112],2],[[73113,73119],3],[[73120,73129],2],[[73130,73439],3],[[73440,73462],2],[[73463,73464],2],[[73465,73471],3],[[73472,73488],2],[73489,3],[[73490,73530],2],[[73531,73533],3],[[73534,73538],2],[[73539,73551],2],[[73552,73561],2],[73562,2],[[73563,73647],3],[73648,2],[[73649,73663],3],[[73664,73713],2],[[73714,73726],3],[73727,2],[[73728,74606],2],[[74607,74648],2],[74649,2],[[74650,74751],3],[[74752,74850],2],[[74851,74862],2],[74863,3],[[74864,74867],2],[74868,2],[[74869,74879],3],[[74880,75075],2],[[75076,77711],3],[[77712,77808],2],[[77809,77810],2],[[77811,77823],3],[[77824,78894],2],[78895,2],[[78896,78904],3],[[78905,78911],3],[[78912,78933],2],[[78934,78943],3],[[78944,82938],2],[[82939,82943],3],[[82944,83526],2],[[83527,90367],3],[[90368,90425],2],[[90426,92159],3],[[92160,92728],2],[[92729,92735],3],[[92736,92766],2],[92767,3],[[92768,92777],2],[[92778,92781],3],[[92782,92783],2],[[92784,92862],2],[92863,3],[[92864,92873],2],[[92874,92879],3],[[92880,92909],2],[[92910,92911],3],[[92912,92916],2],[92917,2],[[92918,92927],3],[[92928,92982],2],[[92983,92991],2],[[92992,92995],2],[[92996,92997],2],[[92998,93007],3],[[93008,93017],2],[93018,3],[[93019,93025],2],[93026,3],[[93027,93047],2],[[93048,93052],3],[[93053,93071],2],[[93072,93503],3],[[93504,93548],2],[[93549,93551],2],[[93552,93561],2],[[93562,93759],3],[93760,1,"𖹠"],[93761,1,"𖹡"],[93762,1,"𖹢"],[93763,1,"𖹣"],[93764,1,"𖹤"],[93765,1,"𖹥"],[93766,1,"𖹦"],[93767,1,"𖹧"],[93768,1,"𖹨"],[93769,1,"𖹩"],[93770,1,"𖹪"],[93771,1,"𖹫"],[93772,1,"𖹬"],[93773,1,"𖹭"],[93774,1,"𖹮"],[93775,1,"𖹯"],[93776,1,"𖹰"],[93777,1,"𖹱"],[93778,1,"𖹲"],[93779,1,"𖹳"],[93780,1,"𖹴"],[93781,1,"𖹵"],[93782,1,"𖹶"],[93783,1,"𖹷"],[93784,1,"𖹸"],[93785,1,"𖹹"],[93786,1,"𖹺"],[93787,1,"𖹻"],[93788,1,"𖹼"],[93789,1,"𖹽"],[93790,1,"𖹾"],[93791,1,"𖹿"],[[93792,93823],2],[[93824,93850],2],[[93851,93951],3],[[93952,94020],2],[[94021,94026],2],[[94027,94030],3],[94031,2],[[94032,94078],2],[[94079,94087],2],[[94088,94094],3],[[94095,94111],2],[[94112,94175],3],[94176,2],[94177,2],[94178,2],[94179,2],[94180,2],[[94181,94191],3],[[94192,94193],2],[[94194,94207],3],[[94208,100332],2],[[100333,100337],2],[[100338,100343],2],[[100344,100351],3],[[100352,101106],2],[[101107,101589],2],[[101590,101630],3],[101631,2],[[101632,101640],2],[[101641,110575],3],[[110576,110579],2],[110580,3],[[110581,110587],2],[110588,3],[[110589,110590],2],[110591,3],[[110592,110593],2],[[110594,110878],2],[[110879,110882],2],[[110883,110897],3],[110898,2],[[110899,110927],3],[[110928,110930],2],[[110931,110932],3],[110933,2],[[110934,110947],3],[[110948,110951],2],[[110952,110959],3],[[110960,111355],2],[[111356,113663],3],[[113664,113770],2],[[113771,113775],3],[[113776,113788],2],[[113789,113791],3],[[113792,113800],2],[[113801,113807],3],[[113808,113817],2],[[113818,113819],3],[113820,2],[[113821,113822],2],[113823,2],[[113824,113827],7],[[113828,117759],3],[[117760,117973],2],[117974,1,"a"],[117975,1,"b"],[117976,1,"c"],[117977,1,"d"],[117978,1,"e"],[117979,1,"f"],[117980,1,"g"],[117981,1,"h"],[117982,1,"i"],[117983,1,"j"],[117984,1,"k"],[117985,1,"l"],[117986,1,"m"],[117987,1,"n"],[117988,1,"o"],[117989,1,"p"],[117990,1,"q"],[117991,1,"r"],[117992,1,"s"],[117993,1,"t"],[117994,1,"u"],[117995,1,"v"],[117996,1,"w"],[117997,1,"x"],[117998,1,"y"],[117999,1,"z"],[118000,1,"0"],[118001,1,"1"],[118002,1,"2"],[118003,1,"3"],[118004,1,"4"],[118005,1,"5"],[118006,1,"6"],[118007,1,"7"],[118008,1,"8"],[118009,1,"9"],[[118010,118015],3],[[118016,118451],2],[[118452,118527],3],[[118528,118573],2],[[118574,118575],3],[[118576,118598],2],[[118599,118607],3],[[118608,118723],2],[[118724,118783],3],[[118784,119029],2],[[119030,119039],3],[[119040,119078],2],[[119079,119080],3],[119081,2],[[119082,119133],2],[119134,1,"𝅗𝅥"],[119135,1,"𝅘𝅥"],[119136,1,"𝅘𝅥𝅮"],[119137,1,"𝅘𝅥𝅯"],[119138,1,"𝅘𝅥𝅰"],[119139,1,"𝅘𝅥𝅱"],[119140,1,"𝅘𝅥𝅲"],[[119141,119154],2],[[119155,119162],7],[[119163,119226],2],[119227,1,"𝆹𝅥"],[119228,1,"𝆺𝅥"],[119229,1,"𝆹𝅥𝅮"],[119230,1,"𝆺𝅥𝅮"],[119231,1,"𝆹𝅥𝅯"],[119232,1,"𝆺𝅥𝅯"],[[119233,119261],2],[[119262,119272],2],[[119273,119274],2],[[119275,119295],3],[[119296,119365],2],[[119366,119487],3],[[119488,119507],2],[[119508,119519],3],[[119520,119539],2],[[119540,119551],3],[[119552,119638],2],[[119639,119647],3],[[119648,119665],2],[[119666,119672],2],[[119673,119807],3],[119808,1,"a"],[119809,1,"b"],[119810,1,"c"],[119811,1,"d"],[119812,1,"e"],[119813,1,"f"],[119814,1,"g"],[119815,1,"h"],[119816,1,"i"],[119817,1,"j"],[119818,1,"k"],[119819,1,"l"],[119820,1,"m"],[119821,1,"n"],[119822,1,"o"],[119823,1,"p"],[119824,1,"q"],[119825,1,"r"],[119826,1,"s"],[119827,1,"t"],[119828,1,"u"],[119829,1,"v"],[119830,1,"w"],[119831,1,"x"],[119832,1,"y"],[119833,1,"z"],[119834,1,"a"],[119835,1,"b"],[119836,1,"c"],[119837,1,"d"],[119838,1,"e"],[119839,1,"f"],[119840,1,"g"],[119841,1,"h"],[119842,1,"i"],[119843,1,"j"],[119844,1,"k"],[119845,1,"l"],[119846,1,"m"],[119847,1,"n"],[119848,1,"o"],[119849,1,"p"],[119850,1,"q"],[119851,1,"r"],[119852,1,"s"],[119853,1,"t"],[119854,1,"u"],[119855,1,"v"],[119856,1,"w"],[119857,1,"x"],[119858,1,"y"],[119859,1,"z"],[119860,1,"a"],[119861,1,"b"],[119862,1,"c"],[119863,1,"d"],[119864,1,"e"],[119865,1,"f"],[119866,1,"g"],[119867,1,"h"],[119868,1,"i"],[119869,1,"j"],[119870,1,"k"],[119871,1,"l"],[119872,1,"m"],[119873,1,"n"],[119874,1,"o"],[119875,1,"p"],[119876,1,"q"],[119877,1,"r"],[119878,1,"s"],[119879,1,"t"],[119880,1,"u"],[119881,1,"v"],[119882,1,"w"],[119883,1,"x"],[119884,1,"y"],[119885,1,"z"],[119886,1,"a"],[119887,1,"b"],[119888,1,"c"],[119889,1,"d"],[119890,1,"e"],[119891,1,"f"],[119892,1,"g"],[119893,3],[119894,1,"i"],[119895,1,"j"],[119896,1,"k"],[119897,1,"l"],[119898,1,"m"],[119899,1,"n"],[119900,1,"o"],[119901,1,"p"],[119902,1,"q"],[119903,1,"r"],[119904,1,"s"],[119905,1,"t"],[119906,1,"u"],[119907,1,"v"],[119908,1,"w"],[119909,1,"x"],[119910,1,"y"],[119911,1,"z"],[119912,1,"a"],[119913,1,"b"],[119914,1,"c"],[119915,1,"d"],[119916,1,"e"],[119917,1,"f"],[119918,1,"g"],[119919,1,"h"],[119920,1,"i"],[119921,1,"j"],[119922,1,"k"],[119923,1,"l"],[119924,1,"m"],[119925,1,"n"],[119926,1,"o"],[119927,1,"p"],[119928,1,"q"],[119929,1,"r"],[119930,1,"s"],[119931,1,"t"],[119932,1,"u"],[119933,1,"v"],[119934,1,"w"],[119935,1,"x"],[119936,1,"y"],[119937,1,"z"],[119938,1,"a"],[119939,1,"b"],[119940,1,"c"],[119941,1,"d"],[119942,1,"e"],[119943,1,"f"],[119944,1,"g"],[119945,1,"h"],[119946,1,"i"],[119947,1,"j"],[119948,1,"k"],[119949,1,"l"],[119950,1,"m"],[119951,1,"n"],[119952,1,"o"],[119953,1,"p"],[119954,1,"q"],[119955,1,"r"],[119956,1,"s"],[119957,1,"t"],[119958,1,"u"],[119959,1,"v"],[119960,1,"w"],[119961,1,"x"],[119962,1,"y"],[119963,1,"z"],[119964,1,"a"],[119965,3],[119966,1,"c"],[119967,1,"d"],[[119968,119969],3],[119970,1,"g"],[[119971,119972],3],[119973,1,"j"],[119974,1,"k"],[[119975,119976],3],[119977,1,"n"],[119978,1,"o"],[119979,1,"p"],[119980,1,"q"],[119981,3],[119982,1,"s"],[119983,1,"t"],[119984,1,"u"],[119985,1,"v"],[119986,1,"w"],[119987,1,"x"],[119988,1,"y"],[119989,1,"z"],[119990,1,"a"],[119991,1,"b"],[119992,1,"c"],[119993,1,"d"],[119994,3],[119995,1,"f"],[119996,3],[119997,1,"h"],[119998,1,"i"],[119999,1,"j"],[120000,1,"k"],[120001,1,"l"],[120002,1,"m"],[120003,1,"n"],[120004,3],[120005,1,"p"],[120006,1,"q"],[120007,1,"r"],[120008,1,"s"],[120009,1,"t"],[120010,1,"u"],[120011,1,"v"],[120012,1,"w"],[120013,1,"x"],[120014,1,"y"],[120015,1,"z"],[120016,1,"a"],[120017,1,"b"],[120018,1,"c"],[120019,1,"d"],[120020,1,"e"],[120021,1,"f"],[120022,1,"g"],[120023,1,"h"],[120024,1,"i"],[120025,1,"j"],[120026,1,"k"],[120027,1,"l"],[120028,1,"m"],[120029,1,"n"],[120030,1,"o"],[120031,1,"p"],[120032,1,"q"],[120033,1,"r"],[120034,1,"s"],[120035,1,"t"],[120036,1,"u"],[120037,1,"v"],[120038,1,"w"],[120039,1,"x"],[120040,1,"y"],[120041,1,"z"],[120042,1,"a"],[120043,1,"b"],[120044,1,"c"],[120045,1,"d"],[120046,1,"e"],[120047,1,"f"],[120048,1,"g"],[120049,1,"h"],[120050,1,"i"],[120051,1,"j"],[120052,1,"k"],[120053,1,"l"],[120054,1,"m"],[120055,1,"n"],[120056,1,"o"],[120057,1,"p"],[120058,1,"q"],[120059,1,"r"],[120060,1,"s"],[120061,1,"t"],[120062,1,"u"],[120063,1,"v"],[120064,1,"w"],[120065,1,"x"],[120066,1,"y"],[120067,1,"z"],[120068,1,"a"],[120069,1,"b"],[120070,3],[120071,1,"d"],[120072,1,"e"],[120073,1,"f"],[120074,1,"g"],[[120075,120076],3],[120077,1,"j"],[120078,1,"k"],[120079,1,"l"],[120080,1,"m"],[120081,1,"n"],[120082,1,"o"],[120083,1,"p"],[120084,1,"q"],[120085,3],[120086,1,"s"],[120087,1,"t"],[120088,1,"u"],[120089,1,"v"],[120090,1,"w"],[120091,1,"x"],[120092,1,"y"],[120093,3],[120094,1,"a"],[120095,1,"b"],[120096,1,"c"],[120097,1,"d"],[120098,1,"e"],[120099,1,"f"],[120100,1,"g"],[120101,1,"h"],[120102,1,"i"],[120103,1,"j"],[120104,1,"k"],[120105,1,"l"],[120106,1,"m"],[120107,1,"n"],[120108,1,"o"],[120109,1,"p"],[120110,1,"q"],[120111,1,"r"],[120112,1,"s"],[120113,1,"t"],[120114,1,"u"],[120115,1,"v"],[120116,1,"w"],[120117,1,"x"],[120118,1,"y"],[120119,1,"z"],[120120,1,"a"],[120121,1,"b"],[120122,3],[120123,1,"d"],[120124,1,"e"],[120125,1,"f"],[120126,1,"g"],[120127,3],[120128,1,"i"],[120129,1,"j"],[120130,1,"k"],[120131,1,"l"],[120132,1,"m"],[120133,3],[120134,1,"o"],[[120135,120137],3],[120138,1,"s"],[120139,1,"t"],[120140,1,"u"],[120141,1,"v"],[120142,1,"w"],[120143,1,"x"],[120144,1,"y"],[120145,3],[120146,1,"a"],[120147,1,"b"],[120148,1,"c"],[120149,1,"d"],[120150,1,"e"],[120151,1,"f"],[120152,1,"g"],[120153,1,"h"],[120154,1,"i"],[120155,1,"j"],[120156,1,"k"],[120157,1,"l"],[120158,1,"m"],[120159,1,"n"],[120160,1,"o"],[120161,1,"p"],[120162,1,"q"],[120163,1,"r"],[120164,1,"s"],[120165,1,"t"],[120166,1,"u"],[120167,1,"v"],[120168,1,"w"],[120169,1,"x"],[120170,1,"y"],[120171,1,"z"],[120172,1,"a"],[120173,1,"b"],[120174,1,"c"],[120175,1,"d"],[120176,1,"e"],[120177,1,"f"],[120178,1,"g"],[120179,1,"h"],[120180,1,"i"],[120181,1,"j"],[120182,1,"k"],[120183,1,"l"],[120184,1,"m"],[120185,1,"n"],[120186,1,"o"],[120187,1,"p"],[120188,1,"q"],[120189,1,"r"],[120190,1,"s"],[120191,1,"t"],[120192,1,"u"],[120193,1,"v"],[120194,1,"w"],[120195,1,"x"],[120196,1,"y"],[120197,1,"z"],[120198,1,"a"],[120199,1,"b"],[120200,1,"c"],[120201,1,"d"],[120202,1,"e"],[120203,1,"f"],[120204,1,"g"],[120205,1,"h"],[120206,1,"i"],[120207,1,"j"],[120208,1,"k"],[120209,1,"l"],[120210,1,"m"],[120211,1,"n"],[120212,1,"o"],[120213,1,"p"],[120214,1,"q"],[120215,1,"r"],[120216,1,"s"],[120217,1,"t"],[120218,1,"u"],[120219,1,"v"],[120220,1,"w"],[120221,1,"x"],[120222,1,"y"],[120223,1,"z"],[120224,1,"a"],[120225,1,"b"],[120226,1,"c"],[120227,1,"d"],[120228,1,"e"],[120229,1,"f"],[120230,1,"g"],[120231,1,"h"],[120232,1,"i"],[120233,1,"j"],[120234,1,"k"],[120235,1,"l"],[120236,1,"m"],[120237,1,"n"],[120238,1,"o"],[120239,1,"p"],[120240,1,"q"],[120241,1,"r"],[120242,1,"s"],[120243,1,"t"],[120244,1,"u"],[120245,1,"v"],[120246,1,"w"],[120247,1,"x"],[120248,1,"y"],[120249,1,"z"],[120250,1,"a"],[120251,1,"b"],[120252,1,"c"],[120253,1,"d"],[120254,1,"e"],[120255,1,"f"],[120256,1,"g"],[120257,1,"h"],[120258,1,"i"],[120259,1,"j"],[120260,1,"k"],[120261,1,"l"],[120262,1,"m"],[120263,1,"n"],[120264,1,"o"],[120265,1,"p"],[120266,1,"q"],[120267,1,"r"],[120268,1,"s"],[120269,1,"t"],[120270,1,"u"],[120271,1,"v"],[120272,1,"w"],[120273,1,"x"],[120274,1,"y"],[120275,1,"z"],[120276,1,"a"],[120277,1,"b"],[120278,1,"c"],[120279,1,"d"],[120280,1,"e"],[120281,1,"f"],[120282,1,"g"],[120283,1,"h"],[120284,1,"i"],[120285,1,"j"],[120286,1,"k"],[120287,1,"l"],[120288,1,"m"],[120289,1,"n"],[120290,1,"o"],[120291,1,"p"],[120292,1,"q"],[120293,1,"r"],[120294,1,"s"],[120295,1,"t"],[120296,1,"u"],[120297,1,"v"],[120298,1,"w"],[120299,1,"x"],[120300,1,"y"],[120301,1,"z"],[120302,1,"a"],[120303,1,"b"],[120304,1,"c"],[120305,1,"d"],[120306,1,"e"],[120307,1,"f"],[120308,1,"g"],[120309,1,"h"],[120310,1,"i"],[120311,1,"j"],[120312,1,"k"],[120313,1,"l"],[120314,1,"m"],[120315,1,"n"],[120316,1,"o"],[120317,1,"p"],[120318,1,"q"],[120319,1,"r"],[120320,1,"s"],[120321,1,"t"],[120322,1,"u"],[120323,1,"v"],[120324,1,"w"],[120325,1,"x"],[120326,1,"y"],[120327,1,"z"],[120328,1,"a"],[120329,1,"b"],[120330,1,"c"],[120331,1,"d"],[120332,1,"e"],[120333,1,"f"],[120334,1,"g"],[120335,1,"h"],[120336,1,"i"],[120337,1,"j"],[120338,1,"k"],[120339,1,"l"],[120340,1,"m"],[120341,1,"n"],[120342,1,"o"],[120343,1,"p"],[120344,1,"q"],[120345,1,"r"],[120346,1,"s"],[120347,1,"t"],[120348,1,"u"],[120349,1,"v"],[120350,1,"w"],[120351,1,"x"],[120352,1,"y"],[120353,1,"z"],[120354,1,"a"],[120355,1,"b"],[120356,1,"c"],[120357,1,"d"],[120358,1,"e"],[120359,1,"f"],[120360,1,"g"],[120361,1,"h"],[120362,1,"i"],[120363,1,"j"],[120364,1,"k"],[120365,1,"l"],[120366,1,"m"],[120367,1,"n"],[120368,1,"o"],[120369,1,"p"],[120370,1,"q"],[120371,1,"r"],[120372,1,"s"],[120373,1,"t"],[120374,1,"u"],[120375,1,"v"],[120376,1,"w"],[120377,1,"x"],[120378,1,"y"],[120379,1,"z"],[120380,1,"a"],[120381,1,"b"],[120382,1,"c"],[120383,1,"d"],[120384,1,"e"],[120385,1,"f"],[120386,1,"g"],[120387,1,"h"],[120388,1,"i"],[120389,1,"j"],[120390,1,"k"],[120391,1,"l"],[120392,1,"m"],[120393,1,"n"],[120394,1,"o"],[120395,1,"p"],[120396,1,"q"],[120397,1,"r"],[120398,1,"s"],[120399,1,"t"],[120400,1,"u"],[120401,1,"v"],[120402,1,"w"],[120403,1,"x"],[120404,1,"y"],[120405,1,"z"],[120406,1,"a"],[120407,1,"b"],[120408,1,"c"],[120409,1,"d"],[120410,1,"e"],[120411,1,"f"],[120412,1,"g"],[120413,1,"h"],[120414,1,"i"],[120415,1,"j"],[120416,1,"k"],[120417,1,"l"],[120418,1,"m"],[120419,1,"n"],[120420,1,"o"],[120421,1,"p"],[120422,1,"q"],[120423,1,"r"],[120424,1,"s"],[120425,1,"t"],[120426,1,"u"],[120427,1,"v"],[120428,1,"w"],[120429,1,"x"],[120430,1,"y"],[120431,1,"z"],[120432,1,"a"],[120433,1,"b"],[120434,1,"c"],[120435,1,"d"],[120436,1,"e"],[120437,1,"f"],[120438,1,"g"],[120439,1,"h"],[120440,1,"i"],[120441,1,"j"],[120442,1,"k"],[120443,1,"l"],[120444,1,"m"],[120445,1,"n"],[120446,1,"o"],[120447,1,"p"],[120448,1,"q"],[120449,1,"r"],[120450,1,"s"],[120451,1,"t"],[120452,1,"u"],[120453,1,"v"],[120454,1,"w"],[120455,1,"x"],[120456,1,"y"],[120457,1,"z"],[120458,1,"a"],[120459,1,"b"],[120460,1,"c"],[120461,1,"d"],[120462,1,"e"],[120463,1,"f"],[120464,1,"g"],[120465,1,"h"],[120466,1,"i"],[120467,1,"j"],[120468,1,"k"],[120469,1,"l"],[120470,1,"m"],[120471,1,"n"],[120472,1,"o"],[120473,1,"p"],[120474,1,"q"],[120475,1,"r"],[120476,1,"s"],[120477,1,"t"],[120478,1,"u"],[120479,1,"v"],[120480,1,"w"],[120481,1,"x"],[120482,1,"y"],[120483,1,"z"],[120484,1,"ı"],[120485,1,"ȷ"],[[120486,120487],3],[120488,1,"α"],[120489,1,"β"],[120490,1,"γ"],[120491,1,"δ"],[120492,1,"ε"],[120493,1,"ζ"],[120494,1,"η"],[120495,1,"θ"],[120496,1,"ι"],[120497,1,"κ"],[120498,1,"λ"],[120499,1,"μ"],[120500,1,"ν"],[120501,1,"ξ"],[120502,1,"ο"],[120503,1,"π"],[120504,1,"ρ"],[120505,1,"θ"],[120506,1,"σ"],[120507,1,"τ"],[120508,1,"υ"],[120509,1,"φ"],[120510,1,"χ"],[120511,1,"ψ"],[120512,1,"ω"],[120513,1,"∇"],[120514,1,"α"],[120515,1,"β"],[120516,1,"γ"],[120517,1,"δ"],[120518,1,"ε"],[120519,1,"ζ"],[120520,1,"η"],[120521,1,"θ"],[120522,1,"ι"],[120523,1,"κ"],[120524,1,"λ"],[120525,1,"μ"],[120526,1,"ν"],[120527,1,"ξ"],[120528,1,"ο"],[120529,1,"π"],[120530,1,"ρ"],[[120531,120532],1,"σ"],[120533,1,"τ"],[120534,1,"υ"],[120535,1,"φ"],[120536,1,"χ"],[120537,1,"ψ"],[120538,1,"ω"],[120539,1,"∂"],[120540,1,"ε"],[120541,1,"θ"],[120542,1,"κ"],[120543,1,"φ"],[120544,1,"ρ"],[120545,1,"π"],[120546,1,"α"],[120547,1,"β"],[120548,1,"γ"],[120549,1,"δ"],[120550,1,"ε"],[120551,1,"ζ"],[120552,1,"η"],[120553,1,"θ"],[120554,1,"ι"],[120555,1,"κ"],[120556,1,"λ"],[120557,1,"μ"],[120558,1,"ν"],[120559,1,"ξ"],[120560,1,"ο"],[120561,1,"π"],[120562,1,"ρ"],[120563,1,"θ"],[120564,1,"σ"],[120565,1,"τ"],[120566,1,"υ"],[120567,1,"φ"],[120568,1,"χ"],[120569,1,"ψ"],[120570,1,"ω"],[120571,1,"∇"],[120572,1,"α"],[120573,1,"β"],[120574,1,"γ"],[120575,1,"δ"],[120576,1,"ε"],[120577,1,"ζ"],[120578,1,"η"],[120579,1,"θ"],[120580,1,"ι"],[120581,1,"κ"],[120582,1,"λ"],[120583,1,"μ"],[120584,1,"ν"],[120585,1,"ξ"],[120586,1,"ο"],[120587,1,"π"],[120588,1,"ρ"],[[120589,120590],1,"σ"],[120591,1,"τ"],[120592,1,"υ"],[120593,1,"φ"],[120594,1,"χ"],[120595,1,"ψ"],[120596,1,"ω"],[120597,1,"∂"],[120598,1,"ε"],[120599,1,"θ"],[120600,1,"κ"],[120601,1,"φ"],[120602,1,"ρ"],[120603,1,"π"],[120604,1,"α"],[120605,1,"β"],[120606,1,"γ"],[120607,1,"δ"],[120608,1,"ε"],[120609,1,"ζ"],[120610,1,"η"],[120611,1,"θ"],[120612,1,"ι"],[120613,1,"κ"],[120614,1,"λ"],[120615,1,"μ"],[120616,1,"ν"],[120617,1,"ξ"],[120618,1,"ο"],[120619,1,"π"],[120620,1,"ρ"],[120621,1,"θ"],[120622,1,"σ"],[120623,1,"τ"],[120624,1,"υ"],[120625,1,"φ"],[120626,1,"χ"],[120627,1,"ψ"],[120628,1,"ω"],[120629,1,"∇"],[120630,1,"α"],[120631,1,"β"],[120632,1,"γ"],[120633,1,"δ"],[120634,1,"ε"],[120635,1,"ζ"],[120636,1,"η"],[120637,1,"θ"],[120638,1,"ι"],[120639,1,"κ"],[120640,1,"λ"],[120641,1,"μ"],[120642,1,"ν"],[120643,1,"ξ"],[120644,1,"ο"],[120645,1,"π"],[120646,1,"ρ"],[[120647,120648],1,"σ"],[120649,1,"τ"],[120650,1,"υ"],[120651,1,"φ"],[120652,1,"χ"],[120653,1,"ψ"],[120654,1,"ω"],[120655,1,"∂"],[120656,1,"ε"],[120657,1,"θ"],[120658,1,"κ"],[120659,1,"φ"],[120660,1,"ρ"],[120661,1,"π"],[120662,1,"α"],[120663,1,"β"],[120664,1,"γ"],[120665,1,"δ"],[120666,1,"ε"],[120667,1,"ζ"],[120668,1,"η"],[120669,1,"θ"],[120670,1,"ι"],[120671,1,"κ"],[120672,1,"λ"],[120673,1,"μ"],[120674,1,"ν"],[120675,1,"ξ"],[120676,1,"ο"],[120677,1,"π"],[120678,1,"ρ"],[120679,1,"θ"],[120680,1,"σ"],[120681,1,"τ"],[120682,1,"υ"],[120683,1,"φ"],[120684,1,"χ"],[120685,1,"ψ"],[120686,1,"ω"],[120687,1,"∇"],[120688,1,"α"],[120689,1,"β"],[120690,1,"γ"],[120691,1,"δ"],[120692,1,"ε"],[120693,1,"ζ"],[120694,1,"η"],[120695,1,"θ"],[120696,1,"ι"],[120697,1,"κ"],[120698,1,"λ"],[120699,1,"μ"],[120700,1,"ν"],[120701,1,"ξ"],[120702,1,"ο"],[120703,1,"π"],[120704,1,"ρ"],[[120705,120706],1,"σ"],[120707,1,"τ"],[120708,1,"υ"],[120709,1,"φ"],[120710,1,"χ"],[120711,1,"ψ"],[120712,1,"ω"],[120713,1,"∂"],[120714,1,"ε"],[120715,1,"θ"],[120716,1,"κ"],[120717,1,"φ"],[120718,1,"ρ"],[120719,1,"π"],[120720,1,"α"],[120721,1,"β"],[120722,1,"γ"],[120723,1,"δ"],[120724,1,"ε"],[120725,1,"ζ"],[120726,1,"η"],[120727,1,"θ"],[120728,1,"ι"],[120729,1,"κ"],[120730,1,"λ"],[120731,1,"μ"],[120732,1,"ν"],[120733,1,"ξ"],[120734,1,"ο"],[120735,1,"π"],[120736,1,"ρ"],[120737,1,"θ"],[120738,1,"σ"],[120739,1,"τ"],[120740,1,"υ"],[120741,1,"φ"],[120742,1,"χ"],[120743,1,"ψ"],[120744,1,"ω"],[120745,1,"∇"],[120746,1,"α"],[120747,1,"β"],[120748,1,"γ"],[120749,1,"δ"],[120750,1,"ε"],[120751,1,"ζ"],[120752,1,"η"],[120753,1,"θ"],[120754,1,"ι"],[120755,1,"κ"],[120756,1,"λ"],[120757,1,"μ"],[120758,1,"ν"],[120759,1,"ξ"],[120760,1,"ο"],[120761,1,"π"],[120762,1,"ρ"],[[120763,120764],1,"σ"],[120765,1,"τ"],[120766,1,"υ"],[120767,1,"φ"],[120768,1,"χ"],[120769,1,"ψ"],[120770,1,"ω"],[120771,1,"∂"],[120772,1,"ε"],[120773,1,"θ"],[120774,1,"κ"],[120775,1,"φ"],[120776,1,"ρ"],[120777,1,"π"],[[120778,120779],1,"ϝ"],[[120780,120781],3],[120782,1,"0"],[120783,1,"1"],[120784,1,"2"],[120785,1,"3"],[120786,1,"4"],[120787,1,"5"],[120788,1,"6"],[120789,1,"7"],[120790,1,"8"],[120791,1,"9"],[120792,1,"0"],[120793,1,"1"],[120794,1,"2"],[120795,1,"3"],[120796,1,"4"],[120797,1,"5"],[120798,1,"6"],[120799,1,"7"],[120800,1,"8"],[120801,1,"9"],[120802,1,"0"],[120803,1,"1"],[120804,1,"2"],[120805,1,"3"],[120806,1,"4"],[120807,1,"5"],[120808,1,"6"],[120809,1,"7"],[120810,1,"8"],[120811,1,"9"],[120812,1,"0"],[120813,1,"1"],[120814,1,"2"],[120815,1,"3"],[120816,1,"4"],[120817,1,"5"],[120818,1,"6"],[120819,1,"7"],[120820,1,"8"],[120821,1,"9"],[120822,1,"0"],[120823,1,"1"],[120824,1,"2"],[120825,1,"3"],[120826,1,"4"],[120827,1,"5"],[120828,1,"6"],[120829,1,"7"],[120830,1,"8"],[120831,1,"9"],[[120832,121343],2],[[121344,121398],2],[[121399,121402],2],[[121403,121452],2],[[121453,121460],2],[121461,2],[[121462,121475],2],[121476,2],[[121477,121483],2],[[121484,121498],3],[[121499,121503],2],[121504,3],[[121505,121519],2],[[121520,122623],3],[[122624,122654],2],[[122655,122660],3],[[122661,122666],2],[[122667,122879],3],[[122880,122886],2],[122887,3],[[122888,122904],2],[[122905,122906],3],[[122907,122913],2],[122914,3],[[122915,122916],2],[122917,3],[[122918,122922],2],[[122923,122927],3],[122928,1,"а"],[122929,1,"б"],[122930,1,"в"],[122931,1,"г"],[122932,1,"д"],[122933,1,"е"],[122934,1,"ж"],[122935,1,"з"],[122936,1,"и"],[122937,1,"к"],[122938,1,"л"],[122939,1,"м"],[122940,1,"о"],[122941,1,"п"],[122942,1,"р"],[122943,1,"с"],[122944,1,"т"],[122945,1,"у"],[122946,1,"ф"],[122947,1,"х"],[122948,1,"ц"],[122949,1,"ч"],[122950,1,"ш"],[122951,1,"ы"],[122952,1,"э"],[122953,1,"ю"],[122954,1,"ꚉ"],[122955,1,"ә"],[122956,1,"і"],[122957,1,"ј"],[122958,1,"ө"],[122959,1,"ү"],[122960,1,"ӏ"],[122961,1,"а"],[122962,1,"б"],[122963,1,"в"],[122964,1,"г"],[122965,1,"д"],[122966,1,"е"],[122967,1,"ж"],[122968,1,"з"],[122969,1,"и"],[122970,1,"к"],[122971,1,"л"],[122972,1,"о"],[122973,1,"п"],[122974,1,"с"],[122975,1,"у"],[122976,1,"ф"],[122977,1,"х"],[122978,1,"ц"],[122979,1,"ч"],[122980,1,"ш"],[122981,1,"ъ"],[122982,1,"ы"],[122983,1,"ґ"],[122984,1,"і"],[122985,1,"ѕ"],[122986,1,"џ"],[122987,1,"ҫ"],[122988,1,"ꙑ"],[122989,1,"ұ"],[[122990,123022],3],[123023,2],[[123024,123135],3],[[123136,123180],2],[[123181,123183],3],[[123184,123197],2],[[123198,123199],3],[[123200,123209],2],[[123210,123213],3],[123214,2],[123215,2],[[123216,123535],3],[[123536,123566],2],[[123567,123583],3],[[123584,123641],2],[[123642,123646],3],[123647,2],[[123648,124111],3],[[124112,124153],2],[[124154,124367],3],[[124368,124410],2],[[124411,124414],3],[124415,2],[[124416,124895],3],[[124896,124902],2],[124903,3],[[124904,124907],2],[124908,3],[[124909,124910],2],[124911,3],[[124912,124926],2],[124927,3],[[124928,125124],2],[[125125,125126],3],[[125127,125135],2],[[125136,125142],2],[[125143,125183],3],[125184,1,"𞤢"],[125185,1,"𞤣"],[125186,1,"𞤤"],[125187,1,"𞤥"],[125188,1,"𞤦"],[125189,1,"𞤧"],[125190,1,"𞤨"],[125191,1,"𞤩"],[125192,1,"𞤪"],[125193,1,"𞤫"],[125194,1,"𞤬"],[125195,1,"𞤭"],[125196,1,"𞤮"],[125197,1,"𞤯"],[125198,1,"𞤰"],[125199,1,"𞤱"],[125200,1,"𞤲"],[125201,1,"𞤳"],[125202,1,"𞤴"],[125203,1,"𞤵"],[125204,1,"𞤶"],[125205,1,"𞤷"],[125206,1,"𞤸"],[125207,1,"𞤹"],[125208,1,"𞤺"],[125209,1,"𞤻"],[125210,1,"𞤼"],[125211,1,"𞤽"],[125212,1,"𞤾"],[125213,1,"𞤿"],[125214,1,"𞥀"],[125215,1,"𞥁"],[125216,1,"𞥂"],[125217,1,"𞥃"],[[125218,125258],2],[125259,2],[[125260,125263],3],[[125264,125273],2],[[125274,125277],3],[[125278,125279],2],[[125280,126064],3],[[126065,126132],2],[[126133,126208],3],[[126209,126269],2],[[126270,126463],3],[126464,1,"ا"],[126465,1,"ب"],[126466,1,"ج"],[126467,1,"د"],[126468,3],[126469,1,"و"],[126470,1,"ز"],[126471,1,"ح"],[126472,1,"ط"],[126473,1,"ي"],[126474,1,"ك"],[126475,1,"ل"],[126476,1,"م"],[126477,1,"ن"],[126478,1,"س"],[126479,1,"ع"],[126480,1,"ف"],[126481,1,"ص"],[126482,1,"ق"],[126483,1,"ر"],[126484,1,"ش"],[126485,1,"ت"],[126486,1,"ث"],[126487,1,"خ"],[126488,1,"ذ"],[126489,1,"ض"],[126490,1,"ظ"],[126491,1,"غ"],[126492,1,"ٮ"],[126493,1,"ں"],[126494,1,"ڡ"],[126495,1,"ٯ"],[126496,3],[126497,1,"ب"],[126498,1,"ج"],[126499,3],[126500,1,"ه"],[[126501,126502],3],[126503,1,"ح"],[126504,3],[126505,1,"ي"],[126506,1,"ك"],[126507,1,"ل"],[126508,1,"م"],[126509,1,"ن"],[126510,1,"س"],[126511,1,"ع"],[126512,1,"ف"],[126513,1,"ص"],[126514,1,"ق"],[126515,3],[126516,1,"ش"],[126517,1,"ت"],[126518,1,"ث"],[126519,1,"خ"],[126520,3],[126521,1,"ض"],[126522,3],[126523,1,"غ"],[[126524,126529],3],[126530,1,"ج"],[[126531,126534],3],[126535,1,"ح"],[126536,3],[126537,1,"ي"],[126538,3],[126539,1,"ل"],[126540,3],[126541,1,"ن"],[126542,1,"س"],[126543,1,"ع"],[126544,3],[126545,1,"ص"],[126546,1,"ق"],[126547,3],[126548,1,"ش"],[[126549,126550],3],[126551,1,"خ"],[126552,3],[126553,1,"ض"],[126554,3],[126555,1,"غ"],[126556,3],[126557,1,"ں"],[126558,3],[126559,1,"ٯ"],[126560,3],[126561,1,"ب"],[126562,1,"ج"],[126563,3],[126564,1,"ه"],[[126565,126566],3],[126567,1,"ح"],[126568,1,"ط"],[126569,1,"ي"],[126570,1,"ك"],[126571,3],[126572,1,"م"],[126573,1,"ن"],[126574,1,"س"],[126575,1,"ع"],[126576,1,"ف"],[126577,1,"ص"],[126578,1,"ق"],[126579,3],[126580,1,"ش"],[126581,1,"ت"],[126582,1,"ث"],[126583,1,"خ"],[126584,3],[126585,1,"ض"],[126586,1,"ظ"],[126587,1,"غ"],[126588,1,"ٮ"],[126589,3],[126590,1,"ڡ"],[126591,3],[126592,1,"ا"],[126593,1,"ب"],[126594,1,"ج"],[126595,1,"د"],[126596,1,"ه"],[126597,1,"و"],[126598,1,"ز"],[126599,1,"ح"],[126600,1,"ط"],[126601,1,"ي"],[126602,3],[126603,1,"ل"],[126604,1,"م"],[126605,1,"ن"],[126606,1,"س"],[126607,1,"ع"],[126608,1,"ف"],[126609,1,"ص"],[126610,1,"ق"],[126611,1,"ر"],[126612,1,"ش"],[126613,1,"ت"],[126614,1,"ث"],[126615,1,"خ"],[126616,1,"ذ"],[126617,1,"ض"],[126618,1,"ظ"],[126619,1,"غ"],[[126620,126624],3],[126625,1,"ب"],[126626,1,"ج"],[126627,1,"د"],[126628,3],[126629,1,"و"],[126630,1,"ز"],[126631,1,"ح"],[126632,1,"ط"],[126633,1,"ي"],[126634,3],[126635,1,"ل"],[126636,1,"م"],[126637,1,"ن"],[126638,1,"س"],[126639,1,"ع"],[126640,1,"ف"],[126641,1,"ص"],[126642,1,"ق"],[126643,1,"ر"],[126644,1,"ش"],[126645,1,"ت"],[126646,1,"ث"],[126647,1,"خ"],[126648,1,"ذ"],[126649,1,"ض"],[126650,1,"ظ"],[126651,1,"غ"],[[126652,126703],3],[[126704,126705],2],[[126706,126975],3],[[126976,127019],2],[[127020,127023],3],[[127024,127123],2],[[127124,127135],3],[[127136,127150],2],[[127151,127152],3],[[127153,127166],2],[127167,2],[127168,3],[[127169,127183],2],[127184,3],[[127185,127199],2],[[127200,127221],2],[[127222,127231],3],[127232,3],[127233,1,"0,"],[127234,1,"1,"],[127235,1,"2,"],[127236,1,"3,"],[127237,1,"4,"],[127238,1,"5,"],[127239,1,"6,"],[127240,1,"7,"],[127241,1,"8,"],[127242,1,"9,"],[[127243,127244],2],[[127245,127247],2],[127248,1,"(a)"],[127249,1,"(b)"],[127250,1,"(c)"],[127251,1,"(d)"],[127252,1,"(e)"],[127253,1,"(f)"],[127254,1,"(g)"],[127255,1,"(h)"],[127256,1,"(i)"],[127257,1,"(j)"],[127258,1,"(k)"],[127259,1,"(l)"],[127260,1,"(m)"],[127261,1,"(n)"],[127262,1,"(o)"],[127263,1,"(p)"],[127264,1,"(q)"],[127265,1,"(r)"],[127266,1,"(s)"],[127267,1,"(t)"],[127268,1,"(u)"],[127269,1,"(v)"],[127270,1,"(w)"],[127271,1,"(x)"],[127272,1,"(y)"],[127273,1,"(z)"],[127274,1,"〔s〕"],[127275,1,"c"],[127276,1,"r"],[127277,1,"cd"],[127278,1,"wz"],[127279,2],[127280,1,"a"],[127281,1,"b"],[127282,1,"c"],[127283,1,"d"],[127284,1,"e"],[127285,1,"f"],[127286,1,"g"],[127287,1,"h"],[127288,1,"i"],[127289,1,"j"],[127290,1,"k"],[127291,1,"l"],[127292,1,"m"],[127293,1,"n"],[127294,1,"o"],[127295,1,"p"],[127296,1,"q"],[127297,1,"r"],[127298,1,"s"],[127299,1,"t"],[127300,1,"u"],[127301,1,"v"],[127302,1,"w"],[127303,1,"x"],[127304,1,"y"],[127305,1,"z"],[127306,1,"hv"],[127307,1,"mv"],[127308,1,"sd"],[127309,1,"ss"],[127310,1,"ppv"],[127311,1,"wc"],[[127312,127318],2],[127319,2],[[127320,127326],2],[127327,2],[[127328,127337],2],[127338,1,"mc"],[127339,1,"md"],[127340,1,"mr"],[[127341,127343],2],[[127344,127352],2],[127353,2],[127354,2],[[127355,127356],2],[[127357,127358],2],[127359,2],[[127360,127369],2],[[127370,127373],2],[[127374,127375],2],[127376,1,"dj"],[[127377,127386],2],[[127387,127404],2],[127405,2],[[127406,127461],3],[[127462,127487],2],[127488,1,"ほか"],[127489,1,"ココ"],[127490,1,"サ"],[[127491,127503],3],[127504,1,"手"],[127505,1,"字"],[127506,1,"双"],[127507,1,"デ"],[127508,1,"二"],[127509,1,"多"],[127510,1,"解"],[127511,1,"天"],[127512,1,"交"],[127513,1,"映"],[127514,1,"無"],[127515,1,"料"],[127516,1,"前"],[127517,1,"後"],[127518,1,"再"],[127519,1,"新"],[127520,1,"初"],[127521,1,"終"],[127522,1,"生"],[127523,1,"販"],[127524,1,"声"],[127525,1,"吹"],[127526,1,"演"],[127527,1,"投"],[127528,1,"捕"],[127529,1,"一"],[127530,1,"三"],[127531,1,"遊"],[127532,1,"左"],[127533,1,"中"],[127534,1,"右"],[127535,1,"指"],[127536,1,"走"],[127537,1,"打"],[127538,1,"禁"],[127539,1,"空"],[127540,1,"合"],[127541,1,"満"],[127542,1,"有"],[127543,1,"月"],[127544,1,"申"],[127545,1,"割"],[127546,1,"営"],[127547,1,"配"],[[127548,127551],3],[127552,1,"〔本〕"],[127553,1,"〔三〕"],[127554,1,"〔二〕"],[127555,1,"〔安〕"],[127556,1,"〔点〕"],[127557,1,"〔打〕"],[127558,1,"〔盗〕"],[127559,1,"〔勝〕"],[127560,1,"〔敗〕"],[[127561,127567],3],[127568,1,"得"],[127569,1,"可"],[[127570,127583],3],[[127584,127589],2],[[127590,127743],3],[[127744,127776],2],[[127777,127788],2],[[127789,127791],2],[[127792,127797],2],[127798,2],[[127799,127868],2],[127869,2],[[127870,127871],2],[[127872,127891],2],[[127892,127903],2],[[127904,127940],2],[127941,2],[[127942,127946],2],[[127947,127950],2],[[127951,127955],2],[[127956,127967],2],[[127968,127984],2],[[127985,127991],2],[[127992,127999],2],[[128000,128062],2],[128063,2],[128064,2],[128065,2],[[128066,128247],2],[128248,2],[[128249,128252],2],[[128253,128254],2],[128255,2],[[128256,128317],2],[[128318,128319],2],[[128320,128323],2],[[128324,128330],2],[[128331,128335],2],[[128336,128359],2],[[128360,128377],2],[128378,2],[[128379,128419],2],[128420,2],[[128421,128506],2],[[128507,128511],2],[128512,2],[[128513,128528],2],[128529,2],[[128530,128532],2],[128533,2],[128534,2],[128535,2],[128536,2],[128537,2],[128538,2],[128539,2],[[128540,128542],2],[128543,2],[[128544,128549],2],[[128550,128551],2],[[128552,128555],2],[128556,2],[128557,2],[[128558,128559],2],[[128560,128563],2],[128564,2],[[128565,128576],2],[[128577,128578],2],[[128579,128580],2],[[128581,128591],2],[[128592,128639],2],[[128640,128709],2],[[128710,128719],2],[128720,2],[[128721,128722],2],[[128723,128724],2],[128725,2],[[128726,128727],2],[[128728,128731],3],[128732,2],[[128733,128735],2],[[128736,128748],2],[[128749,128751],3],[[128752,128755],2],[[128756,128758],2],[[128759,128760],2],[128761,2],[128762,2],[[128763,128764],2],[[128765,128767],3],[[128768,128883],2],[[128884,128886],2],[[128887,128890],3],[[128891,128895],2],[[128896,128980],2],[[128981,128984],2],[128985,2],[[128986,128991],3],[[128992,129003],2],[[129004,129007],3],[129008,2],[[129009,129023],3],[[129024,129035],2],[[129036,129039],3],[[129040,129095],2],[[129096,129103],3],[[129104,129113],2],[[129114,129119],3],[[129120,129159],2],[[129160,129167],3],[[129168,129197],2],[[129198,129199],3],[[129200,129201],2],[[129202,129211],2],[[129212,129215],3],[[129216,129217],2],[[129218,129279],3],[[129280,129291],2],[129292,2],[[129293,129295],2],[[129296,129304],2],[[129305,129310],2],[129311,2],[[129312,129319],2],[[129320,129327],2],[129328,2],[[129329,129330],2],[[129331,129342],2],[129343,2],[[129344,129355],2],[129356,2],[[129357,129359],2],[[129360,129374],2],[[129375,129387],2],[[129388,129392],2],[129393,2],[129394,2],[[129395,129398],2],[[129399,129400],2],[129401,2],[129402,2],[129403,2],[[129404,129407],2],[[129408,129412],2],[[129413,129425],2],[[129426,129431],2],[[129432,129442],2],[[129443,129444],2],[[129445,129450],2],[[129451,129453],2],[[129454,129455],2],[[129456,129465],2],[[129466,129471],2],[129472,2],[[129473,129474],2],[[129475,129482],2],[129483,2],[129484,2],[[129485,129487],2],[[129488,129510],2],[[129511,129535],2],[[129536,129619],2],[[129620,129631],3],[[129632,129645],2],[[129646,129647],3],[[129648,129651],2],[129652,2],[[129653,129655],2],[[129656,129658],2],[[129659,129660],2],[[129661,129663],3],[[129664,129666],2],[[129667,129670],2],[[129671,129672],2],[129673,2],[[129674,129678],3],[129679,2],[[129680,129685],2],[[129686,129704],2],[[129705,129708],2],[[129709,129711],2],[[129712,129718],2],[[129719,129722],2],[[129723,129725],2],[129726,2],[129727,2],[[129728,129730],2],[[129731,129733],2],[129734,2],[[129735,129741],3],[[129742,129743],2],[[129744,129750],2],[[129751,129753],2],[[129754,129755],2],[129756,2],[[129757,129758],3],[129759,2],[[129760,129767],2],[129768,2],[129769,2],[[129770,129775],3],[[129776,129782],2],[[129783,129784],2],[[129785,129791],3],[[129792,129938],2],[129939,3],[[129940,129994],2],[[129995,130031],2],[130032,1,"0"],[130033,1,"1"],[130034,1,"2"],[130035,1,"3"],[130036,1,"4"],[130037,1,"5"],[130038,1,"6"],[130039,1,"7"],[130040,1,"8"],[130041,1,"9"],[[130042,131069],3],[[131070,131071],3],[[131072,173782],2],[[173783,173789],2],[[173790,173791],2],[[173792,173823],3],[[173824,177972],2],[[177973,177976],2],[177977,2],[[177978,177983],3],[[177984,178205],2],[[178206,178207],3],[[178208,183969],2],[[183970,183983],3],[[183984,191456],2],[[191457,191471],3],[[191472,192093],2],[[192094,194559],3],[194560,1,"丽"],[194561,1,"丸"],[194562,1,"乁"],[194563,1,"𠄢"],[194564,1,"你"],[194565,1,"侮"],[194566,1,"侻"],[194567,1,"倂"],[194568,1,"偺"],[194569,1,"備"],[194570,1,"僧"],[194571,1,"像"],[194572,1,"㒞"],[194573,1,"𠘺"],[194574,1,"免"],[194575,1,"兔"],[194576,1,"兤"],[194577,1,"具"],[194578,1,"𠔜"],[194579,1,"㒹"],[194580,1,"內"],[194581,1,"再"],[194582,1,"𠕋"],[194583,1,"冗"],[194584,1,"冤"],[194585,1,"仌"],[194586,1,"冬"],[194587,1,"况"],[194588,1,"𩇟"],[194589,1,"凵"],[194590,1,"刃"],[194591,1,"㓟"],[194592,1,"刻"],[194593,1,"剆"],[194594,1,"割"],[194595,1,"剷"],[194596,1,"㔕"],[194597,1,"勇"],[194598,1,"勉"],[194599,1,"勤"],[194600,1,"勺"],[194601,1,"包"],[194602,1,"匆"],[194603,1,"北"],[194604,1,"卉"],[194605,1,"卑"],[194606,1,"博"],[194607,1,"即"],[194608,1,"卽"],[[194609,194611],1,"卿"],[194612,1,"𠨬"],[194613,1,"灰"],[194614,1,"及"],[194615,1,"叟"],[194616,1,"𠭣"],[194617,1,"叫"],[194618,1,"叱"],[194619,1,"吆"],[194620,1,"咞"],[194621,1,"吸"],[194622,1,"呈"],[194623,1,"周"],[194624,1,"咢"],[194625,1,"哶"],[194626,1,"唐"],[194627,1,"啓"],[194628,1,"啣"],[[194629,194630],1,"善"],[194631,1,"喙"],[194632,1,"喫"],[194633,1,"喳"],[194634,1,"嗂"],[194635,1,"圖"],[194636,1,"嘆"],[194637,1,"圗"],[194638,1,"噑"],[194639,1,"噴"],[194640,1,"切"],[194641,1,"壮"],[194642,1,"城"],[194643,1,"埴"],[194644,1,"堍"],[194645,1,"型"],[194646,1,"堲"],[194647,1,"報"],[194648,1,"墬"],[194649,1,"𡓤"],[194650,1,"売"],[194651,1,"壷"],[194652,1,"夆"],[194653,1,"多"],[194654,1,"夢"],[194655,1,"奢"],[194656,1,"𡚨"],[194657,1,"𡛪"],[194658,1,"姬"],[194659,1,"娛"],[194660,1,"娧"],[194661,1,"姘"],[194662,1,"婦"],[194663,1,"㛮"],[194664,1,"㛼"],[194665,1,"嬈"],[[194666,194667],1,"嬾"],[194668,1,"𡧈"],[194669,1,"寃"],[194670,1,"寘"],[194671,1,"寧"],[194672,1,"寳"],[194673,1,"𡬘"],[194674,1,"寿"],[194675,1,"将"],[194676,1,"当"],[194677,1,"尢"],[194678,1,"㞁"],[194679,1,"屠"],[194680,1,"屮"],[194681,1,"峀"],[194682,1,"岍"],[194683,1,"𡷤"],[194684,1,"嵃"],[194685,1,"𡷦"],[194686,1,"嵮"],[194687,1,"嵫"],[194688,1,"嵼"],[194689,1,"巡"],[194690,1,"巢"],[194691,1,"㠯"],[194692,1,"巽"],[194693,1,"帨"],[194694,1,"帽"],[194695,1,"幩"],[194696,1,"㡢"],[194697,1,"𢆃"],[194698,1,"㡼"],[194699,1,"庰"],[194700,1,"庳"],[194701,1,"庶"],[194702,1,"廊"],[194703,1,"𪎒"],[194704,1,"廾"],[[194705,194706],1,"𢌱"],[194707,1,"舁"],[[194708,194709],1,"弢"],[194710,1,"㣇"],[194711,1,"𣊸"],[194712,1,"𦇚"],[194713,1,"形"],[194714,1,"彫"],[194715,1,"㣣"],[194716,1,"徚"],[194717,1,"忍"],[194718,1,"志"],[194719,1,"忹"],[194720,1,"悁"],[194721,1,"㤺"],[194722,1,"㤜"],[194723,1,"悔"],[194724,1,"𢛔"],[194725,1,"惇"],[194726,1,"慈"],[194727,1,"慌"],[194728,1,"慎"],[194729,1,"慌"],[194730,1,"慺"],[194731,1,"憎"],[194732,1,"憲"],[194733,1,"憤"],[194734,1,"憯"],[194735,1,"懞"],[194736,1,"懲"],[194737,1,"懶"],[194738,1,"成"],[194739,1,"戛"],[194740,1,"扝"],[194741,1,"抱"],[194742,1,"拔"],[194743,1,"捐"],[194744,1,"𢬌"],[194745,1,"挽"],[194746,1,"拼"],[194747,1,"捨"],[194748,1,"掃"],[194749,1,"揤"],[194750,1,"𢯱"],[194751,1,"搢"],[194752,1,"揅"],[194753,1,"掩"],[194754,1,"㨮"],[194755,1,"摩"],[194756,1,"摾"],[194757,1,"撝"],[194758,1,"摷"],[194759,1,"㩬"],[194760,1,"敏"],[194761,1,"敬"],[194762,1,"𣀊"],[194763,1,"旣"],[194764,1,"書"],[194765,1,"晉"],[194766,1,"㬙"],[194767,1,"暑"],[194768,1,"㬈"],[194769,1,"㫤"],[194770,1,"冒"],[194771,1,"冕"],[194772,1,"最"],[194773,1,"暜"],[194774,1,"肭"],[194775,1,"䏙"],[194776,1,"朗"],[194777,1,"望"],[194778,1,"朡"],[194779,1,"杞"],[194780,1,"杓"],[194781,1,"𣏃"],[194782,1,"㭉"],[194783,1,"柺"],[194784,1,"枅"],[194785,1,"桒"],[194786,1,"梅"],[194787,1,"𣑭"],[194788,1,"梎"],[194789,1,"栟"],[194790,1,"椔"],[194791,1,"㮝"],[194792,1,"楂"],[194793,1,"榣"],[194794,1,"槪"],[194795,1,"檨"],[194796,1,"𣚣"],[194797,1,"櫛"],[194798,1,"㰘"],[194799,1,"次"],[194800,1,"𣢧"],[194801,1,"歔"],[194802,1,"㱎"],[194803,1,"歲"],[194804,1,"殟"],[194805,1,"殺"],[194806,1,"殻"],[194807,1,"𣪍"],[194808,1,"𡴋"],[194809,1,"𣫺"],[194810,1,"汎"],[194811,1,"𣲼"],[194812,1,"沿"],[194813,1,"泍"],[194814,1,"汧"],[194815,1,"洖"],[194816,1,"派"],[194817,1,"海"],[194818,1,"流"],[194819,1,"浩"],[194820,1,"浸"],[194821,1,"涅"],[194822,1,"𣴞"],[194823,1,"洴"],[194824,1,"港"],[194825,1,"湮"],[194826,1,"㴳"],[194827,1,"滋"],[194828,1,"滇"],[194829,1,"𣻑"],[194830,1,"淹"],[194831,1,"潮"],[194832,1,"𣽞"],[194833,1,"𣾎"],[194834,1,"濆"],[194835,1,"瀹"],[194836,1,"瀞"],[194837,1,"瀛"],[194838,1,"㶖"],[194839,1,"灊"],[194840,1,"災"],[194841,1,"灷"],[194842,1,"炭"],[194843,1,"𠔥"],[194844,1,"煅"],[194845,1,"𤉣"],[194846,1,"熜"],[194847,1,"𤎫"],[194848,1,"爨"],[194849,1,"爵"],[194850,1,"牐"],[194851,1,"𤘈"],[194852,1,"犀"],[194853,1,"犕"],[194854,1,"𤜵"],[194855,1,"𤠔"],[194856,1,"獺"],[194857,1,"王"],[194858,1,"㺬"],[194859,1,"玥"],[[194860,194861],1,"㺸"],[194862,1,"瑇"],[194863,1,"瑜"],[194864,1,"瑱"],[194865,1,"璅"],[194866,1,"瓊"],[194867,1,"㼛"],[194868,1,"甤"],[194869,1,"𤰶"],[194870,1,"甾"],[194871,1,"𤲒"],[194872,1,"異"],[194873,1,"𢆟"],[194874,1,"瘐"],[194875,1,"𤾡"],[194876,1,"𤾸"],[194877,1,"𥁄"],[194878,1,"㿼"],[194879,1,"䀈"],[194880,1,"直"],[194881,1,"𥃳"],[194882,1,"𥃲"],[194883,1,"𥄙"],[194884,1,"𥄳"],[194885,1,"眞"],[[194886,194887],1,"真"],[194888,1,"睊"],[194889,1,"䀹"],[194890,1,"瞋"],[194891,1,"䁆"],[194892,1,"䂖"],[194893,1,"𥐝"],[194894,1,"硎"],[194895,1,"碌"],[194896,1,"磌"],[194897,1,"䃣"],[194898,1,"𥘦"],[194899,1,"祖"],[194900,1,"𥚚"],[194901,1,"𥛅"],[194902,1,"福"],[194903,1,"秫"],[194904,1,"䄯"],[194905,1,"穀"],[194906,1,"穊"],[194907,1,"穏"],[194908,1,"𥥼"],[[194909,194910],1,"𥪧"],[194911,1,"竮"],[194912,1,"䈂"],[194913,1,"𥮫"],[194914,1,"篆"],[194915,1,"築"],[194916,1,"䈧"],[194917,1,"𥲀"],[194918,1,"糒"],[194919,1,"䊠"],[194920,1,"糨"],[194921,1,"糣"],[194922,1,"紀"],[194923,1,"𥾆"],[194924,1,"絣"],[194925,1,"䌁"],[194926,1,"緇"],[194927,1,"縂"],[194928,1,"繅"],[194929,1,"䌴"],[194930,1,"𦈨"],[194931,1,"𦉇"],[194932,1,"䍙"],[194933,1,"𦋙"],[194934,1,"罺"],[194935,1,"𦌾"],[194936,1,"羕"],[194937,1,"翺"],[194938,1,"者"],[194939,1,"𦓚"],[194940,1,"𦔣"],[194941,1,"聠"],[194942,1,"𦖨"],[194943,1,"聰"],[194944,1,"𣍟"],[194945,1,"䏕"],[194946,1,"育"],[194947,1,"脃"],[194948,1,"䐋"],[194949,1,"脾"],[194950,1,"媵"],[194951,1,"𦞧"],[194952,1,"𦞵"],[194953,1,"𣎓"],[194954,1,"𣎜"],[194955,1,"舁"],[194956,1,"舄"],[194957,1,"辞"],[194958,1,"䑫"],[194959,1,"芑"],[194960,1,"芋"],[194961,1,"芝"],[194962,1,"劳"],[194963,1,"花"],[194964,1,"芳"],[194965,1,"芽"],[194966,1,"苦"],[194967,1,"𦬼"],[194968,1,"若"],[194969,1,"茝"],[194970,1,"荣"],[194971,1,"莭"],[194972,1,"茣"],[194973,1,"莽"],[194974,1,"菧"],[194975,1,"著"],[194976,1,"荓"],[194977,1,"菊"],[194978,1,"菌"],[194979,1,"菜"],[194980,1,"𦰶"],[194981,1,"𦵫"],[194982,1,"𦳕"],[194983,1,"䔫"],[194984,1,"蓱"],[194985,1,"蓳"],[194986,1,"蔖"],[194987,1,"𧏊"],[194988,1,"蕤"],[194989,1,"𦼬"],[194990,1,"䕝"],[194991,1,"䕡"],[194992,1,"𦾱"],[194993,1,"𧃒"],[194994,1,"䕫"],[194995,1,"虐"],[194996,1,"虜"],[194997,1,"虧"],[194998,1,"虩"],[194999,1,"蚩"],[195000,1,"蚈"],[195001,1,"蜎"],[195002,1,"蛢"],[195003,1,"蝹"],[195004,1,"蜨"],[195005,1,"蝫"],[195006,1,"螆"],[195007,1,"䗗"],[195008,1,"蟡"],[195009,1,"蠁"],[195010,1,"䗹"],[195011,1,"衠"],[195012,1,"衣"],[195013,1,"𧙧"],[195014,1,"裗"],[195015,1,"裞"],[195016,1,"䘵"],[195017,1,"裺"],[195018,1,"㒻"],[195019,1,"𧢮"],[195020,1,"𧥦"],[195021,1,"䚾"],[195022,1,"䛇"],[195023,1,"誠"],[195024,1,"諭"],[195025,1,"變"],[195026,1,"豕"],[195027,1,"𧲨"],[195028,1,"貫"],[195029,1,"賁"],[195030,1,"贛"],[195031,1,"起"],[195032,1,"𧼯"],[195033,1,"𠠄"],[195034,1,"跋"],[195035,1,"趼"],[195036,1,"跰"],[195037,1,"𠣞"],[195038,1,"軔"],[195039,1,"輸"],[195040,1,"𨗒"],[195041,1,"𨗭"],[195042,1,"邔"],[195043,1,"郱"],[195044,1,"鄑"],[195045,1,"𨜮"],[195046,1,"鄛"],[195047,1,"鈸"],[195048,1,"鋗"],[195049,1,"鋘"],[195050,1,"鉼"],[195051,1,"鏹"],[195052,1,"鐕"],[195053,1,"𨯺"],[195054,1,"開"],[195055,1,"䦕"],[195056,1,"閷"],[195057,1,"𨵷"],[195058,1,"䧦"],[195059,1,"雃"],[195060,1,"嶲"],[195061,1,"霣"],[195062,1,"𩅅"],[195063,1,"𩈚"],[195064,1,"䩮"],[195065,1,"䩶"],[195066,1,"韠"],[195067,1,"𩐊"],[195068,1,"䪲"],[195069,1,"𩒖"],[[195070,195071],1,"頋"],[195072,1,"頩"],[195073,1,"𩖶"],[195074,1,"飢"],[195075,1,"䬳"],[195076,1,"餩"],[195077,1,"馧"],[195078,1,"駂"],[195079,1,"駾"],[195080,1,"䯎"],[195081,1,"𩬰"],[195082,1,"鬒"],[195083,1,"鱀"],[195084,1,"鳽"],[195085,1,"䳎"],[195086,1,"䳭"],[195087,1,"鵧"],[195088,1,"𪃎"],[195089,1,"䳸"],[195090,1,"𪄅"],[195091,1,"𪈎"],[195092,1,"𪊑"],[195093,1,"麻"],[195094,1,"䵖"],[195095,1,"黹"],[195096,1,"黾"],[195097,1,"鼅"],[195098,1,"鼏"],[195099,1,"鼖"],[195100,1,"鼻"],[195101,1,"𪘀"],[[195102,196605],3],[[196606,196607],3],[[196608,201546],2],[[201547,201551],3],[[201552,205743],2],[[205744,262141],3],[[262142,262143],3],[[262144,327677],3],[[327678,327679],3],[[327680,393213],3],[[393214,393215],3],[[393216,458749],3],[[458750,458751],3],[[458752,524285],3],[[524286,524287],3],[[524288,589821],3],[[589822,589823],3],[[589824,655357],3],[[655358,655359],3],[[655360,720893],3],[[720894,720895],3],[[720896,786429],3],[[786430,786431],3],[[786432,851965],3],[[851966,851967],3],[[851968,917501],3],[[917502,917503],3],[917504,3],[917505,3],[[917506,917535],3],[[917536,917631],3],[[917632,917759],3],[[917760,917999],7],[[918000,983037],3],[[983038,983039],3],[[983040,1048573],3],[[1048574,1048575],3],[[1048576,1114109],3],[[1114110,1114111],3]]'); /***/ }) /******/ }); /************************************************************************/ /******/ // 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; /******/ } /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __nccwpck_require__.m = __webpack_modules__; /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __nccwpck_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __nccwpck_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/create fake namespace object */ /******/ (() => { /******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); /******/ var leafPrototypes; /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 16: return value when it's Promise-like /******/ // mode & 8|1: behave like require /******/ __nccwpck_require__.t = function(value, mode) { /******/ if(mode & 1) value = this(value); /******/ if(mode & 8) return value; /******/ if(typeof value === 'object' && value) { /******/ if((mode & 4) && value.__esModule) return value; /******/ if((mode & 16) && typeof value.then === 'function') return value; /******/ } /******/ var ns = Object.create(null); /******/ __nccwpck_require__.r(ns); /******/ var def = {}; /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; /******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); /******/ } /******/ def['default'] = () => (value); /******/ __nccwpck_require__.d(ns, def); /******/ return ns; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __nccwpck_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__nccwpck_require__.o(definition, key) && !__nccwpck_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/ensure chunk */ /******/ (() => { /******/ __nccwpck_require__.f = {}; /******/ // This file contains only the entry chunk. /******/ // The chunk loading function for additional chunks /******/ __nccwpck_require__.e = (chunkId) => { /******/ return Promise.all(Object.keys(__nccwpck_require__.f).reduce((promises, key) => { /******/ __nccwpck_require__.f[key](chunkId, promises); /******/ return promises; /******/ }, [])); /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/get javascript chunk filename */ /******/ (() => { /******/ // This function allow to reference async chunks /******/ __nccwpck_require__.u = (chunkId) => { /******/ // return url for filenames based on template /******/ return "" + chunkId + ".index.js"; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __nccwpck_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __nccwpck_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/compat */ /******/ /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/"; /******/ /******/ /* webpack/runtime/import chunk loading */ /******/ (() => { /******/ // no baseURI /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // [resolve, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 792: 0 /******/ }; /******/ /******/ var installChunk = (data) => { /******/ var {ids, modules, runtime} = data; /******/ // add "modules" to the modules object, /******/ // then flag all "ids" as loaded and fire callback /******/ var moduleId, chunkId, i = 0; /******/ for(moduleId in modules) { /******/ if(__nccwpck_require__.o(modules, moduleId)) { /******/ __nccwpck_require__.m[moduleId] = modules[moduleId]; /******/ } /******/ } /******/ if(runtime) runtime(__nccwpck_require__); /******/ for(;i < ids.length; i++) { /******/ chunkId = ids[i]; /******/ if(__nccwpck_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { /******/ installedChunks[chunkId][0](); /******/ } /******/ installedChunks[ids[i]] = 0; /******/ } /******/ /******/ } /******/ /******/ __nccwpck_require__.f.j = (chunkId, promises) => { /******/ // import() chunk loading for javascript /******/ var installedChunkData = __nccwpck_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; /******/ if(installedChunkData !== 0) { // 0 means "already installed". /******/ /******/ // a Promise means "currently loading". /******/ if(installedChunkData) { /******/ promises.push(installedChunkData[1]); /******/ } else { /******/ if(true) { // all chunks have JS /******/ // setup Promise in chunk cache /******/ var promise = import("./" + __nccwpck_require__.u(chunkId)).then(installChunk, (e) => { /******/ if(installedChunks[chunkId] !== 0) installedChunks[chunkId] = undefined; /******/ throw e; /******/ }); /******/ var promise = Promise.race([promise, new Promise((resolve) => (installedChunkData = installedChunks[chunkId] = [resolve]))]) /******/ promises.push(installedChunkData[1] = promise); /******/ } /******/ } /******/ } /******/ }; /******/ /******/ // no prefetching /******/ /******/ // no preloaded /******/ /******/ // no external install chunk /******/ /******/ // no on chunks loaded /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // NAMESPACE OBJECT: ./node_modules/@spyglassmc/mcdoc/lib/runtime/attribute/validator.js var validator_namespaceObject = {}; __nccwpck_require__.r(validator_namespaceObject); __nccwpck_require__.d(validator_namespaceObject, { alternatives: () => (alternatives), boolean: () => (validator_boolean), list: () => (validator_list), map: () => (map), number: () => (validator_number), optional: () => (validator_optional), options: () => (options), string: () => (validator_string), tree: () => (tree) }); // EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js var core = __nccwpck_require__(7484); ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/Dev.js var Dev; (function (Dev) { function assertDefined(value) { if (value === undefined) { throw new Error(`'${Dev.stringify(value)}' is 'undefined'`); } } Dev.assertDefined = assertDefined; function assertNever(value) { throw new Error(`'${Dev.stringify(value)}' is not of type 'never'`); } Dev.assertNever = assertNever; function assertTrue(value, message) { if (!value) { throw new Error(`Assertion failed: ${message}. '${Dev.stringify(value)}' should be true.`); } } Dev.assertTrue = assertTrue; /** * @returns An estimate of the memory taken by the given value, assuming objects are stored as array-like structures instead of dictionaries in the V8 engine. */ function estimateMemoryUsage(value) { const ByteToBits = 8; const PointerSize = 8; let ans = 0; const calculatedObjects = new Set(); const stack = [value]; while (stack.length) { const current = stack.pop(); switch (typeof current) { case 'bigint': { const bits = Math.ceil(Math.log2(Number(current))); ans += (2 + Math.ceil(bits / (ByteToBits * PointerSize))) * PointerSize; // https://stackoverflow.com/a/54298760 break; } case 'boolean': ans += PointerSize; // Aggressive alignment estimation. break; case 'number': ans += 8; break; case 'object': ans += PointerSize; // Reference pointer. if (!current || calculatedObjects.has(current)) { break; } ans += PointerSize; // Header pointer. for (const value of Object.values(current)) { stack.push(value); ans += PointerSize; // Aggressive padding estimation. } calculatedObjects.add(current); break; case 'string': ans += current.length * 2; break; case 'symbol': ans += PointerSize; break; default: break; } } return ans; } Dev.estimateMemoryUsage = estimateMemoryUsage; function stringify(value) { if (value && typeof value === 'object') { try { const seen = new Set(); return JSON.stringify(value, (_k, v) => { if (v && typeof v === 'object') { return seen.has(v) ? '[Circular]' : (seen.add(v), v); } else { return v; } }); } catch (ignored) { // Most likely "Maximum callstack size exceeded". // Fall back to a shallow string representation. return `{ ${Object.entries(value).map(([k, v]) => `'${k}': '${String(v)}'`).join(', ')} }`; } } else if (typeof value === 'symbol') { // JavaScript does not convert `Symbol`s to strings implicitly. return String(value); } else { return `${value}`; } } Dev.stringify = stringify; })(Dev || (Dev = {})); //# sourceMappingURL=Dev.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/externals/downloader.js var RemoteUriString; (function (RemoteUriString) { function is(value) { return value.startsWith('http:') || value.startsWith('https:'); } RemoteUriString.is = is; })(RemoteUriString || (RemoteUriString = {})); var ExternalDownloader; (function (ExternalDownloader) { function mock(options) { return new ExternalDownloaderMock(options); } ExternalDownloader.mock = mock; })(ExternalDownloader || (ExternalDownloader = {})); class ExternalDownloaderMock { options; constructor(options) { this.options = options; } async get(uri) { if (!this.options.fixtures[uri]) { throw new Error(`404 not found: ${uri}`); } const fixture = this.options.fixtures[uri]; if (fixture instanceof Uint8Array) { return fixture; } else if (typeof fixture === 'string') { return new TextEncoder().encode(fixture); } else { return new TextEncoder().encode(JSON.stringify(fixture)); } } } //# sourceMappingURL=downloader.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/externals/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/Logger.js var Logger; (function (Logger) { /* istanbul ignore next */ /** * @returns The built-in `console`. * Do **not** use this implementation in language servers, as some clients cannot handle * non-LSP stdout. (https://github.com/SpyglassMC/Spyglass/issues/845) */ function create() { return console; } Logger.create = create; /** * @returns A logger that does nothing. */ function noop() { return new NoopLogger(); } Logger.noop = noop; })(Logger || (Logger = {})); class NoopLogger { error() { } info() { } log() { } warn() { } } //# sourceMappingURL=Logger.js.map // EXTERNAL MODULE: ./node_modules/binary-search/index.js var binary_search = __nccwpck_require__(896); // EXTERNAL MODULE: ./node_modules/rfdc/index.js var rfdc = __nccwpck_require__(8825); // EXTERNAL MODULE: ./node_modules/whatwg-url/index.js var whatwg_url = __nccwpck_require__(8012); ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/util.js // Spyglass uses the URL class provided by the // [spec](https://url.spec.whatwg.org/)-compliant `whatwg-url` package instead // of the broken one shipped with browsers that do not parse non-special scheme // URLs with hosts properly. // // * [Chromium bug](https://issues.chromium.org/issues/40587286) // * [FireFox bug](https://bugzilla.mozilla.org/show_bug.cgi?id=1374505) // // We use the name "URI" instead of "URL" when possible, since it is what // LSP has chosen to use for the string that uniquely identifies a file. const Uri = whatwg_url/* URL */.k; /** * @param getKey A function that takes the actual arguments being passed into the decorated method, and returns anything. * The result of this function will be used as the key to identify the `Promise`. By default the first element in the argument * list will be used. * * This is a decorator for async methods. Decorated methods will return the same `Promise` for * the same key, provided that the previously returned `Promise` is still pending. */ function SingletonPromise(getKey = (args) => args[0]) { return (_target, _key, descripter) => { const promises = new Map(); const decoratedMethod = descripter.value; // The `function` syntax is used to preserve `this` context from the decorated method. descripter.value = function (...args) { const key = getKey(args); if (promises.has(key)) { return promises.get(key); } const ans = decoratedMethod.apply(this, args).then((ans) => (promises.delete(key), ans), (e) => (promises.delete(key), Promise.reject(e))); promises.set(key, ans); return ans; }; return descripter; }; } /** * This is a decorator for methods. Decorated methods will return the same non-`undefined` value no matter what. */ const Singleton = (_target, _key, descripter) => { let value; const decoratedMethod = descripter.value; // The `function` syntax is used to preserve `this` context from the decorated method. descripter.value = function (...args) { return (value ??= decoratedMethod.apply(this, args)); }; return descripter; }; /** * @param getKey A function that takes the actual arguments being passed into the decorated method, and returns anything. * The result of this function will be used as the key to cache the `Timeout`. By default the first element in the argument * list will be used. * * Decorated methods will be scheduled to run after `ms` milliseconds. The timer will reset when the method is called again. */ function Delay(ms, getKey = (args) => args[0]) { return (_target, _key, descripter) => { const timeouts = new Map(); const decoratedMethod = descripter.value; // The `function` syntax is used to preserve `this` context from the decorated method. descripter.value = function (...args) { const key = getKey(args); if (timeouts.has(key)) { clearTimeout(timeouts.get(key)); } timeouts.set(key, setTimeout(() => { timeouts.delete(key); decoratedMethod.apply(this, args); }, ms)); }; return descripter; }; } var ResourceLocation; (function (ResourceLocation) { /** * The prefix for tags. */ ResourceLocation.TagPrefix = '#'; /** * The seperator of namespace and path. */ ResourceLocation.NamespacePathSep = ':'; /** * The seperator between different path segments. */ ResourceLocation.PathSep = '/'; ResourceLocation.DefaultNamespace = 'minecraft'; function lengthen(value) { switch (value.indexOf(ResourceLocation.NamespacePathSep)) { case -1: return `${ResourceLocation.DefaultNamespace}${ResourceLocation.NamespacePathSep}${value}`; case 0: return `${ResourceLocation.DefaultNamespace}${value}`; default: return value; } } ResourceLocation.lengthen = lengthen; function shorten(value) { return value.replace(/^(?:minecraft)?:/, ''); } ResourceLocation.shorten = shorten; })(ResourceLocation || (ResourceLocation = {})); /** * @returns The string value decoded from the buffer according to UTF-8. * Byte order mark is correctly removed. */ function bufferToString(buffer) { const ans = new TextDecoder().decode(buffer); // if (ans.charCodeAt(0) === 0xFEFF) { // return ans.slice(1) // } return ans; } var Arrayable; (function (Arrayable) { function is(value, isT) { return Array.isArray(value) ? value.every((e) => isT(e)) : isT(value); } Arrayable.is = is; function toArray(value) { return Array.isArray(value) ? value : [value]; } Arrayable.toArray = toArray; })(Arrayable || (Arrayable = {})); var TypePredicates; (function (TypePredicates) { function isString(value) { return typeof value === 'string'; } TypePredicates.isString = isString; })(TypePredicates || (TypePredicates = {})); function promisifyAsyncIterable(iterable, joiner) { return (async () => { const chunks = []; for await (const chunk of iterable) { chunks.push(chunk); } return joiner(chunks); })(); } async function parseGzippedJson(externals, buffer) { return JSON.parse(bufferToString(await externals.archive.gunzip(buffer))); } /** * @returns Is Plain Old JavaScript Object (POJO). */ function isPojo(value) { return !!value && typeof value === 'object' && !Array.isArray(value); } function merge(a, b) { const ans = rfdc()(a); for (const [key, value] of Object.entries(b)) { if (isPojo(ans[key]) && isPojo(value)) { ans[key] = merge(ans[key], value); } else if (value === undefined) { delete ans[key]; } else { ans[key] = value; } } return ans; } var Lazy; (function (Lazy) { const LazyDiscriminator = Symbol('LazyDiscriminator'); function create(getter) { return { discriminator: LazyDiscriminator, getter }; } Lazy.create = create; function isComplex(lazy) { return lazy?.discriminator === LazyDiscriminator; } Lazy.isComplex = isComplex; function isUnresolved(lazy) { return isComplex(lazy) && !('value' in lazy); } Lazy.isUnresolved = isUnresolved; function resolve(lazy) { return isUnresolved(lazy) ? (lazy.value = lazy.getter()) : lazy; } Lazy.resolve = resolve; })(Lazy || (Lazy = {})); /** * @param ids An array of block/fluid IDs, with or without the namespace. * @returns A map from state names to the corresponding sets of values. The first element in the value array is the default * value for that state. */ function getStates(category, ids, ctx) { const ans = {}; ids = ids.map(ResourceLocation.lengthen); for (const id of ids) { ctx.symbols.query(ctx.doc, category, id).forEachMember((state, stateQuery) => { const values = Object.keys(stateQuery.visibleMembers); const set = (ans[state] ??= new Set()); const defaultValue = stateQuery.symbol?.relations?.default; if (defaultValue) { set.add(defaultValue.path[defaultValue.path.length - 1]); } for (const value of values) { set.add(value); } }); } return Object.fromEntries(Object.entries(ans).map(([k, v]) => [k, [...v]])); } const binarySearch = binary_search; function isIterable(value) { return !!value[Symbol.iterator]; } // #region ESNext functions polyfill function atArray(array, index) { return index >= 0 ? array?.[index] : array?.[array.length + index]; } function emplaceMap(map, key, handler) { if (map.has(key)) { let value = map.get(key); if (handler.update) { value = handler.update(value, key, map); map.set(key, value); } return value; } else if (handler.insert) { const value = handler.insert(key, map); map.set(key, value); return value; } else { throw new Error(`No key ${key} in map and no insert handler provided`); } } // #endregion /** * @returns If `val` is an non-null object or a callable object (i.e. function). */ function isObject(val) { return typeof val === 'function' || (!!val && typeof val === 'object'); } function normalizeUri(uri) { const obj = new Uri(uri); obj.pathname = obj.pathname.replace(/%3A/gi, ':'); return obj.toString(); } //# sourceMappingURL=util.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/ReadonlyProxy.js var ReadonlyProxy; (function (ReadonlyProxy) { function create(obj) { return new Proxy(obj, new ReadonlyProxyHandler()); } ReadonlyProxy.create = create; })(ReadonlyProxy || (ReadonlyProxy = {})); class ReadonlyProxyHandler { map = new Map(); get(target, p, receiver) { const value = Reflect.get(target, p, receiver); if (p !== 'prototype' && isObject(value)) { return emplaceMap(this.map, p, { insert: () => ReadonlyProxy.create(value) }); } return value; } set(_target, p, _value, _receiver) { throw new TypeError(`Cannot set property '${String(p)}' on a readonly proxy`); } deleteProperty(_target, p) { throw new TypeError(`Cannot delete property '${String(p)}' on a readonly proxy`); } } //# sourceMappingURL=ReadonlyProxy.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/Operations.js class Operations { parent; constructor(parent) { this.parent = parent; } undoOps = []; redoOps = []; addUndoOp(op) { this.undoOps.push(op); this.parent?.addUndoOp(op); } addRedoOp(op) { this.redoOps.push(op); this.parent?.addRedoOp(op); } set(obj, key, value, receiver = obj) { const oldValue = Reflect.get(obj, key, receiver); const op = () => { Reflect.set(obj, key, value, receiver); }; const undoOp = () => { Reflect.set(obj, key, oldValue, receiver); }; this.addRedoOp(op); this.addUndoOp(undoOp); op(); } undo() { for (let i = this.undoOps.length - 1; i >= 0; i--) { this.undoOps[i](); } } redo() { this.redoOps.forEach((op) => op()); } } //# sourceMappingURL=Operations.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/StateProxy.js const BranchOff = Symbol('StateBranchOff'); const Is = Symbol('IsStateProxy'); const Origin = Symbol('OriginState'); const Redo = Symbol('RedoStateChanges'); const Undo = Symbol('UndoStateChanges'); var StateProxy; (function (StateProxy) { function branchOff(proxy) { return proxy[BranchOff](); } StateProxy.branchOff = branchOff; function create(obj) { if (StateProxy.is(obj)) { throw new TypeError('Cannot create a proxy over a proxy. You might want to use branchOff instead.'); } return _createStateProxy(obj, new Operations()); } StateProxy.create = create; function dereference(value) { return StateProxy.is(value) ? value[Origin] : value; } StateProxy.dereference = dereference; function is(obj) { return obj?.[Is]; } StateProxy.is = is; function redoChanges(proxy) { proxy[Redo](); } StateProxy.redoChanges = redoChanges; function undoChanges(proxy) { proxy[Undo](); } StateProxy.undoChanges = undoChanges; })(StateProxy || (StateProxy = {})); class StateProxyHandler { rootOps; map = new Map(); constructor( /** * Shared across all handlers created for the same root state object under the same branch. */ rootOps) { this.rootOps = rootOps; } #branchOff(target) { return _createStateProxy(target, new Operations(this.rootOps)); } get(target, p, receiver) { switch (p) { case BranchOff: return () => this.#branchOff(target); case Is: return true; case Origin: return target; case Redo: return () => this.rootOps.redo(); case Undo: return () => this.rootOps.undo(); } const value = Reflect.get(target, p, receiver); if (p !== 'prototype' && isObject(value)) { return emplaceMap(this.map, p, { insert: () => _createStateProxy(value, this.rootOps) }); } return value; } set(target, p, value, receiver) { if (p === BranchOff || p === Is || p === Origin || p === Redo || p === Undo) { throw new TypeError(`Cannot set ${String(p)}`); } this.rootOps.set(target, p, StateProxy.dereference(value), receiver); return true; } } function _createStateProxy(target, operations) { return new Proxy(target, new StateProxyHandler(operations)); } //# sourceMappingURL=StateProxy.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/TwoWayMap.js class TwoWayMap { _map = new Map(); _reversedMap = new Map(); constructor(values = []) { for (const [k, v] of values) { this._map.set(k, v); this._reversedMap.set(v, k); } } get size() { return this._map.size; } clear() { this._map.clear(); this._reversedMap.clear(); } delete(key) { const value = this._map.get(key); const ans = this._map.delete(key); if (value !== undefined) { this._reversedMap.delete(value); } return ans; } deleteValue(value) { const key = this._reversedMap.get(value); const ans = this._reversedMap.delete(value); if (key !== undefined) { this._map.delete(key); } return ans; } get(key) { return this._map.get(key); } getKey(value) { return this._reversedMap.get(value); } has(key) { return this._map.has(key); } hasValue(value) { return this._reversedMap.has(value); } set(key, value) { this._map.set(key, value); this._reversedMap.set(value, key); return this; } forEach(callbackfn, thisArg) { for (const [key, value] of this._map) { callbackfn.apply(thisArg, [value, key, this]); } } entries() { return this._map.entries(); } keys() { return this._map.keys(); } values() { return this._map.values(); } [Symbol.iterator]() { return this._map.entries(); } [Symbol.toStringTag] = 'TwoWayMap'; } //# sourceMappingURL=TwoWayMap.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/source/Source.js const CRLF = '\r\n'; const CR = '\r'; const LF = '\n'; const Whitespaces = Object.freeze([' ', '\n', '\r', '\t']); class ReadonlySource { string; indexMap; innerCursor = 0; constructor(string, indexMap = []) { this.string = string; this.indexMap = indexMap; } get cursor() { return IndexMap.toOuterOffset(this.indexMap, this.innerCursor); } /** * @param offset The index to offset from cursor. Defaults to 0. * * @returns The range of the specified character. * * @example * getCharRange(-1) // Returns the range of the character before cursor. * getCharRange() // Returns the range of the character at cursor. * getCharRange(1) // Returns the range of the character after cursor. */ getCharRange(offset = 0) { return IndexMap.toOuterRange(this.indexMap, Range.create(this.innerCursor + offset, this.innerCursor + offset + 1)); } /** * Returns a string that helps visualize this `Source`'s index map. * Primarily intended for debugging purposes. */ visualizeIndexMap() { let res = this.string; const adjustments = []; for (const { inner, outer } of this.indexMap) { const innerLength = inner.end - inner.start; const outerLength = outer.end - outer.start; const { char, count } = outerLength > innerLength ? { count: outerLength - innerLength, char: '\u2190', // ← } : { count: outer.start - inner.start, char: '\u2017' }; // ‗ adjustments.push({ idx: inner.start, str: char.repeat(count) }); } for (const { idx, str } of adjustments.reverse()) { res = `${res.slice(0, idx)}${str}${res.slice(idx)}`; } return res; } /** * Peeks a substring from the current cursor. * @param length The length of the substring. Defaults to 1 * @param offset The index to offset from cursor. Defaults to 0 */ peek(length = 1, offset = 0) { return this.string.slice(this.innerCursor + offset, this.innerCursor + offset + length); } canRead(length = 1) { const needed = this.innerCursor + length; const available = this.string.length; return this.innerCursor + length <= this.string.length; } canReadInLine() { return this.canRead() && this.peek() !== CR && this.peek() !== LF; } /** * If the `expectedValue` is right after the cursor, returns `true`. Otherwise returns `false`. * * @param offset Defaults to 0. * * @see {@link Source.trySkip} */ tryPeek(expectedValue, offset = 0) { return this.peek(expectedValue.length, offset) === expectedValue; } tryPeekAfterWhitespace(expectedValue) { const maxOffset = this.string.length - this.innerCursor; let offset = 0; while (offset < maxOffset && Source.isWhitespace(this.peek(1, offset))) { offset++; } return this.tryPeek(expectedValue, offset); } peekUntil(...terminators) { let ans = ''; for (let cursor = this.innerCursor; cursor < this.string.length; cursor++) { const c = this.string.charAt(cursor); if (terminators.includes(c)) { return ans; } else { ans += c; } } return ans; } peekLine() { return this.peekUntil(CR, LF); } peekRemaining(offset = 0) { return this.string.slice(this.innerCursor + offset); } matchPattern(regex, offset = 0) { return regex.test(this.peekRemaining(offset)); } /** * If there is a non-space character between `cursor + offset` (inclusive) and the next newline, returns `true`. Otherwise returns `false`. * * @param offset Defaults to 0. */ hasNonSpaceAheadInLine(offset = 0) { for (let cursor = this.innerCursor + offset; cursor < this.string.length; cursor++) { const c = this.string.charAt(cursor); if (Source.isNewline(c)) { break; } if (!Source.isSpace(c)) { return true; } } return false; } slice(param0, end) { if (typeof param0 === 'number') { const innerStart = IndexMap.toInnerOffset(this.indexMap, param0); const innerEnd = end !== undefined ? IndexMap.toInnerOffset(this.indexMap, end) : undefined; return this.string.slice(innerStart, innerEnd); } const range = IndexMap.toInnerRange(this.indexMap, Range.get(param0)); return this.string.slice(range.start, range.end); } sliceToCursor(start) { const innerStart = IndexMap.toInnerOffset(this.indexMap, start); return this.string.slice(innerStart, this.innerCursor); } } class Source extends ReadonlySource { string; indexMap; constructor(string, indexMap = []) { super(string, indexMap); this.string = string; this.indexMap = indexMap; } get cursor() { return super.cursor; } set cursor(cursor) { this.innerCursor = IndexMap.toInnerOffset(this.indexMap, cursor); } clone() { const ans = new Source(this.string, this.indexMap); ans.innerCursor = this.innerCursor; return ans; } read() { return this.string.charAt(this.innerCursor++); } /** * Skips the current character. * @param step The step to skip. Defaults to 1 */ skip(step = 1) { this.innerCursor += step; return this; } /** * If the `expectedValue` is right after the cursor, skips it and returns `true`. Otherwise returns `false`. * * This is a shortcut for the following piece of code: * ```typescript * declare const src: Source * if (src.peek(expectedValue.length) === expectedValue) { * src.skip(expectedValue.length) * // Do something here. * } * ``` * * @see {@link Source.tryPeek} */ trySkip(expectedValue) { if (this.peek(expectedValue.length) === expectedValue) { this.skip(expectedValue.length); return true; } return false; } /** * Reads until the end of this line. */ readLine() { return this.readUntil(CR, LF); } /** * Skips until the end of this line. */ skipLine() { this.readLine(); return this; } /** * Jumps to the beginning of the next line. */ nextLine() { this.skipLine(); if (this.peek(2) === CRLF) { this.skip(2); } else if (this.peek() === CR || this.peek() === LF) { this.skip(); } return this; } readSpace() { const start = this.innerCursor; this.skipSpace(); return this.string.slice(start, this.innerCursor); } skipSpace() { while (this.canRead() && Source.isSpace(this.peek())) { this.skip(); } return this; } readWhitespace() { const start = this.innerCursor; this.skipWhitespace(); return this.string.slice(start, this.innerCursor); } skipWhitespace() { while (this.canRead() && Source.isWhitespace(this.peek())) { this.skip(); } return this; } readIf(predicate) { let ans = ''; while (this.canRead()) { const c = this.peek(); if (predicate(c)) { this.skip(); ans += c; } else { break; } } return ans; } skipIf(predicate) { this.readIf(predicate); return this; } /** * @param terminators Ending character. Will not be skipped or included in the result. */ readUntil(...terminators) { let ans = ''; while (this.canRead()) { const c = this.peek(); if (terminators.includes(c)) { return ans; } else { ans += c; } this.skip(); } return ans; } /** * @param terminators Ending character. Will not be skipped. */ skipUntilOrEnd(...terminators) { this.readUntil(...terminators); return this; } readUntilLineEnd() { return this.readUntil(CR, LF); } skipUntilLineEnd() { return this.skipUntilOrEnd(CR, LF); } readRemaining() { const start = this.innerCursor; this.innerCursor = this.string.length; return this.string.slice(start); } skipRemaining() { this.readRemaining(); return this; } } (function (Source) { function isDigit(c) { return c >= '0' && c <= '9'; } Source.isDigit = isDigit; function isBrigadierQuote(c) { return c === '"' || c === "'"; } Source.isBrigadierQuote = isBrigadierQuote; function isNewline(c) { return c === '\r\n' || c === '\r' || c === '\n'; } Source.isNewline = isNewline; function isSpace(c) { return c === ' ' || c === '\t'; } Source.isSpace = isSpace; function isWhitespace(c) { return Source.isSpace(c) || Source.isNewline(c); } Source.isWhitespace = isWhitespace; })(Source || (Source = {})); //# sourceMappingURL=Source.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/source/Offset.js var Offset; (function (Offset) { /** * Get an offset from a `OffsetLike`. * * @returns * - `number`: itself. * - `Source`: its `cursor`. */ function get(offset) { if (typeof offset === 'function') { offset = offset(); } if (offset instanceof ReadonlySource) { offset = offset.cursor; } return offset; } Offset.get = get; })(Offset || (Offset = {})); //# sourceMappingURL=Offset.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/source/Range.js var Range; (function (Range) { /** * Gets a range from `RangeLike`. * * @returns * - `Range`: a clone of it. * - `RangeContainer`: a clone of its range. * - `OffsetLike`: a range with both positions set to the offset. */ function get(range) { const evaluated = typeof range === 'function' ? range() : range; if (Range.is(evaluated)) { return Range.create(evaluated.start, evaluated.end); } if (RangeContainer.is(evaluated)) { return Range.create(evaluated.range.start, evaluated.range.end); } return Range.create(evaluated); } Range.get = get; /** * Creates a range from `OffsetLike`. If only `start` is passed in, `end` will be the same value as `start`. */ function create(start, end) { start = Offset.get(start); return { start, end: end !== undefined ? Offset.get(end) : start }; } Range.create = create; /** * Creates a range that covers the area between `from.start` and `to.end`. */ function span(from, to) { return { start: Range.get(from).start, end: Range.get(to).end }; } Range.span = span; function is(obj) { return (!!obj && typeof obj === 'object' && typeof obj.start === 'number' && typeof obj.end === 'number'); } Range.is = is; /** * ```typescript * { start: 0, end: 1 } * ``` */ Range.Beginning = Object.freeze(Range.create(0, 1)); /** * ```typescript * { start: 0, end: Infinity } * ``` */ Range.Full = Object.freeze(Range.create(0, Number.POSITIVE_INFINITY)); function toString(range) { return `[${range.start}, ${range.end})`; } Range.toString = toString; function contains(range, offset, endInclusive = false) { range = get(range); return (range.start <= offset && (endInclusive ? offset <= range.end : offset < range.end)); } Range.contains = contains; function containsRange(a, b, endInclusive = false) { a = get(a); b = get(b); return contains(a, b.start, endInclusive) && contains(a, b.end, true); } Range.containsRange = containsRange; function intersects(a, b) { return Range.contains(a, b.start) || Range.contains(b, a.start); } Range.intersects = intersects; function equals(a, b) { return a.start === b.start && a.end === b.end; } Range.equals = equals; function endsBefore(range, target, endInclusive = false) { return endInclusive ? range.end < Range.get(target).start : range.end <= Range.get(target).start; } Range.endsBefore = endsBefore; function isEmpty(range) { range = get(range); return range.start === range.end; } Range.isEmpty = isEmpty; function length(range) { return range.end - range.start; } Range.length = length; /** * @returns Negative when `a` is before `b`, `0` if they intersect, and positive if it's after. */ function compare(a, b, endInclusive = false) { if (endInclusive ? a.end < b.start : a.end <= b.start) { return -1; } else if (endInclusive ? a.start > b.end : a.start >= b.end) { return 1; } else { return 0; } } Range.compare = compare; /** * @returns Negative when `range` is before `offset`, `0` if it {@link contains} `offset`, and positive if it's after. */ function compareOffset(range, offset, endInclusive = false) { if (endInclusive ? range.end < offset : range.end <= offset) { return -1; } else if (range.start > offset) { return 1; } else { return 0; } } Range.compareOffset = compareOffset; /** * @param startOffset The number to offset the start of the `range`. * @param endOffset The number to offset the end of the `range`. Default: `startOffset`. * @returns A copy of `range`. */ function translate(range, startOffset, endOffset = startOffset) { range = get(range); return { start: range.start + startOffset, end: range.end + endOffset }; } Range.translate = translate; })(Range || (Range = {})); var RangeContainer; (function (RangeContainer) { function is(obj) { return (!!obj && typeof obj === 'object' && Range.is(obj.range)); } RangeContainer.is = is; })(RangeContainer || (RangeContainer = {})); //# sourceMappingURL=Range.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/source/IndexMap.js var IndexMap; (function (IndexMap) { function convertOffset(map, offset, from, to) { let ans = offset; for (const pair of map) { if (Range.contains(pair[from], offset)) { return pair[to].start; } else if (Range.endsBefore(pair[from], offset)) { ans = offset - pair[from].end + pair[to].end; } else { break; } } return ans; } function toInnerOffset(map, offset) { return convertOffset(map, offset, 'outer', 'inner'); } IndexMap.toInnerOffset = toInnerOffset; function toInnerRange(map, outer) { return Range.create(toInnerOffset(map, outer.start), toInnerOffset(map, outer.end)); } IndexMap.toInnerRange = toInnerRange; function toOuterOffset(map, offset) { return convertOffset(map, offset, 'inner', 'outer'); } IndexMap.toOuterOffset = toOuterOffset; function toOuterRange(map, inner) { return Range.create(toOuterOffset(map, inner.start), toOuterOffset(map, inner.end)); } IndexMap.toOuterRange = toOuterRange; })(IndexMap || (IndexMap = {})); //# sourceMappingURL=IndexMap.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/source/Position.js var Position; (function (Position) { function create(param1, param2) { if (typeof param1 === 'object') { return _createFromPartial(param1); } else { return _createFromNumbers(param1, param2); } } Position.create = create; function _createFromPartial(partial) { return { line: partial.line ?? 0, character: partial.character ?? 0 }; } function _createFromNumbers(line, character) { return _createFromPartial({ line, character }); } /** * ```typescript * { line: 0, character: 0 } * ``` */ Position.Beginning = Position.create(0, 0); /** * ```typescript * { line: Infinity, character: Infinity } * ``` */ Position.Infinity = Position.create(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY); function toString(pos) { return `<${pos.line}, ${pos.character}>`; } Position.toString = toString; function isBefore(pos1, pos2) { return (pos1.line < pos2.line || (pos1.line === pos2.line && pos1.character < pos2.character)); } Position.isBefore = isBefore; })(Position || (Position = {})); //# sourceMappingURL=Position.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/source/PositionRange.js var PositionRange; (function (PositionRange) { function create(param1, param2, param3, param4) { if (typeof param1 === 'number') { return { start: Position.create(param1, param2), end: Position.create(param3, param4), }; } else if (param2 !== undefined) { return { start: Position.create(param1), end: Position.create(param2), }; } else { const partial = param1; return { start: Position.create(partial.start ?? {}), end: Position.create(partial.end ?? {}), }; } } PositionRange.create = create; /** * @returns A `PositionRange` converted from a `RangeLike`. */ function from(rangeLike, doc) { const range = Range.get(rangeLike); const ans = { start: doc.positionAt(range.start), end: doc.positionAt(range.end), }; return ans; } PositionRange.from = from; /** * ```typescript * { * start: { line: 0, character: 0 }, * end: { line: 0, character: 1 } * } * ``` */ PositionRange.Beginning = Object.freeze(PositionRange.create(0, 0, 0, 1)); /** * ```typescript * { * start: { line: 0, character: 0 }, * end: { line: Infinity, character: Infinity } * } * ``` */ PositionRange.Full = Object.freeze(PositionRange.create(Position.Beginning, Position.Infinity)); function toString(range) { return `[${Position.toString(range.start)}, ${Position.toString(range.end)})`; } PositionRange.toString = toString; function contains(range, pos) { const { start, end } = range; // Check range of line number. if (pos.line < start.line || pos.line > end.line) { return false; } if (start.line < pos.line && pos.line < end.line) { return true; } // Now `pos` is in the same line as `start` and/or `end`. return ((pos.line === start.line ? pos.character >= start.character : true) && (pos.line === end.line ? pos.character < end.character : true)); } PositionRange.contains = contains; function endsBefore(range, pos) { return Position.isBefore(Position.create(range.end.line, range.end.character - 1), pos); } PositionRange.endsBefore = endsBefore; })(PositionRange || (PositionRange = {})); //# sourceMappingURL=PositionRange.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/source/LanguageError.js var LanguageError; (function (LanguageError) { function create(message, range, severity = 3 /* ErrorSeverity.Error */, info, source) { const ans = { range, message, severity }; if (info) { ans.info = info; } if (source) { ans.source = source; } return ans; } LanguageError.create = create; /** * @returns A {@link PosRangeLanguageError}. */ function withPosRange(error, doc) { return { posRange: PositionRange.from(error.range, doc), message: error.message, severity: error.severity, ...(error.info && { info: error.info }), ...(error.source && { source: error.source }), }; } LanguageError.withPosRange = withPosRange; })(LanguageError || (LanguageError = {})); //# sourceMappingURL=LanguageError.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/source/Location.js var Location; (function (Location) { function get(partial) { return { uri: partial.uri ?? '', range: Range.get(partial.range ?? { start: 0, end: 0 }), posRange: partial.posRange ?? { start: { line: 0, character: 0 }, end: { line: 0, character: 0 } }, }; } Location.get = get; function create(doc, range) { return Location.get({ uri: doc.uri, range, posRange: PositionRange.from(range, doc) }); } Location.create = create; })(Location || (Location = {})); //# sourceMappingURL=Location.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/source/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/AstNode.js var AstNode; (function (AstNode) { /* istanbul ignore next */ function is(obj) { return (!!obj && typeof obj === 'object' && typeof obj.type === 'string' && Range.is(obj.range)); } AstNode.is = is; function setParents(node) { for (const child of node.children ?? []) { child.parent = node; setParents(child); } } AstNode.setParents = setParents; /** * @param endInclusive Defaults to `false`. */ function findChildIndex(node, needle, endInclusive = false) { if (!node.children) { return -1; } const comparator = typeof needle === 'number' ? Range.compareOffset : Range.compare; return binary_search(node.children, needle, (a, b) => comparator(a.range, b, endInclusive)); } AstNode.findChildIndex = findChildIndex; /** * @param endInclusive Defaults to `false`. */ function findChild(node, needle, endInclusive = false) { return node.children?.[findChildIndex(node, needle, endInclusive)]; } AstNode.findChild = findChild; /** * Returns the index of the last child node that ends before the `needle`. * * @param endInclusive Defaults to `false`. */ function findLastChildIndex(node, needle, endInclusive = false) { if (!node.children) { return -1; } let ans = -1; for (const [i, childNode] of node.children.entries()) { if (Range.endsBefore(childNode.range, needle, endInclusive)) { ans = i; } else { break; } } return ans; } AstNode.findLastChildIndex = findLastChildIndex; /** * @param endInclusive Defaults to `false`. */ function findLastChild(node, needle, endInclusive = false) { return node.children?.[findLastChildIndex(node, needle, endInclusive)]; } AstNode.findLastChild = findLastChild; function findDeepestChild({ node, needle, endInclusive = false, predicate = () => true }) { let last; let head = Range.contains(node, needle, endInclusive) ? node : undefined; while (head && predicate(head)) { last = head; head = findChild(head, needle, endInclusive); } return last; } AstNode.findDeepestChild = findDeepestChild; function findShallowestChild({ node, needle, endInclusive = false, predicate = () => true }) { let head = Range.contains(node, needle, endInclusive) ? node : undefined; while (head && !predicate(head)) { head = findChild(head, needle, endInclusive); } return head; } AstNode.findShallowestChild = findShallowestChild; function* getLocalsToRoot(node) { let head = node; while (head) { if (head.locals) { yield head.locals; } head = node.parent; } } AstNode.getLocalsToRoot = getLocalsToRoot; function* getLocalsToLeaves(node) { if (node.locals) { yield node.locals; } for (const child of node.children ?? []) { yield* getLocalsToLeaves(child); } } AstNode.getLocalsToLeaves = getLocalsToLeaves; })(AstNode || (AstNode = {})); //# sourceMappingURL=AstNode.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/BooleanNode.js var BooleanNode; (function (BooleanNode) { /* istanbul ignore next */ function is(obj) { return obj.type === 'boolean'; } BooleanNode.is = is; function mock(range) { return { type: 'boolean', range: Range.get(range) }; } BooleanNode.mock = mock; })(BooleanNode || (BooleanNode = {})); //# sourceMappingURL=BooleanNode.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/CommentNode.js var CommentNode; (function (CommentNode) { function is(obj) { return obj?.type === 'comment'; } CommentNode.is = is; })(CommentNode || (CommentNode = {})); //# sourceMappingURL=CommentNode.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/ErrorNode.js var ErrorNode; (function (ErrorNode) { /* istanbul ignore next */ function is(obj) { return obj.type === 'error'; } ErrorNode.is = is; })(ErrorNode || (ErrorNode = {})); //# sourceMappingURL=ErrorNode.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/FileNode.js var FileNode; (function (FileNode) { function getErrors(node) { return [ ...node.parserErrors, ...(node.binderErrors ?? []), ...(node.checkerErrors ?? []), ...(node.linterErrors ?? []), ]; } FileNode.getErrors = getErrors; })(FileNode || (FileNode = {})); //# sourceMappingURL=FileNode.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/FloatNode.js var FloatNode; (function (FloatNode) { /* istanbul ignore next */ function is(obj) { return obj.type === 'float'; } FloatNode.is = is; function mock(range) { return { type: 'float', range: Range.get(range), value: 0 }; } FloatNode.mock = mock; })(FloatNode || (FloatNode = {})); //# sourceMappingURL=FloatNode.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/IntegerNode.js var IntegerNode; (function (IntegerNode) { function is(obj) { return obj.type === 'integer'; } IntegerNode.is = is; function mock(range) { return { type: 'integer', range: Range.get(range), value: 0 }; } IntegerNode.mock = mock; })(IntegerNode || (IntegerNode = {})); //# sourceMappingURL=IntegerNode.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/ListNode.js var ItemNode; (function (ItemNode) { function is(node) { return node?.type === 'item'; } ItemNode.is = is; })(ItemNode || (ItemNode = {})); //# sourceMappingURL=ListNode.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/LiteralNode.js var LiteralNode; (function (LiteralNode) { /* istanbul ignore next */ function is(obj) { return obj?.type === 'literal'; } LiteralNode.is = is; function mock(range, options) { return { type: 'literal', range: Range.get(range), options, value: '' }; } LiteralNode.mock = mock; })(LiteralNode || (LiteralNode = {})); //# sourceMappingURL=LiteralNode.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/LongNode.js var LongNode; (function (LongNode) { function is(obj) { return obj.type === 'long'; } LongNode.is = is; function mock(range) { return { type: 'long', range: Range.get(range), value: 0n }; } LongNode.mock = mock; })(LongNode || (LongNode = {})); //# sourceMappingURL=LongNode.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/PrefixedNode.js var PrefixedNode; (function (PrefixedNode) { function is(obj) { return obj.type === 'prefixed'; } PrefixedNode.is = is; function mock(range, prefix, child) { return { type: 'prefixed', range: Range.get(range), prefix, children: [ LiteralNode.mock(range, { pool: [prefix] }), child, ], }; } PrefixedNode.mock = mock; })(PrefixedNode || (PrefixedNode = {})); //# sourceMappingURL=PrefixedNode.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/RecordNode.js var PairNode; (function (PairNode) { function is(node) { return node?.type === 'pair'; } PairNode.is = is; })(PairNode || (PairNode = {})); //# sourceMappingURL=RecordNode.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/ResourceLocationNode.js var ResourceLocationNode; (function (ResourceLocationNode) { /** * The prefix for tags. */ const TagPrefix = ResourceLocation.TagPrefix; /** * The seperator of namespace and path. */ const NamespacePathSep = ResourceLocation.NamespacePathSep; /** * The seperator between different path segments. */ const PathSep = ResourceLocation.PathSep; const DefaultNamespace = ResourceLocation.DefaultNamespace; /* istanbul ignore next */ function is(obj) { return (obj?.type === 'resource_location'); } ResourceLocationNode.is = is; function mock(range, options) { return { type: 'resource_location', range: Range.get(range), options }; } ResourceLocationNode.mock = mock; function toString(node, type = 'origin', includesTagPrefix = false) { const path = node.path ? node.path.join(PathSep) : ''; let id; /* * `node.namespace` has four statuses here: * - `minecraft` * - `` (yes, empty string) * - undefined * - any other namespaces. * * Whether `node.namespace !== undefined` or simply `node.namespace` is used in the condition is carefully selected. */ switch (type) { case 'origin': // Use `node.namespace !== undefined`, so that empty namespaces can be correctly restored to string. id = node.namespace !== undefined ? `${node.namespace}${NamespacePathSep}${path}` : path; break; case 'full': // Use `node.namespace` before `||`, so that both undefined and empty value can result in the default namespace. // Use `||` instead of `??`, so that empty namespaces can be converted to the default namespace. id = `${node.namespace || DefaultNamespace}${NamespacePathSep}${path}`; break; case 'short': // Use `node.namespace` before `&&` for the same reason stated above. id = node.namespace && node.namespace !== DefaultNamespace ? `${node.namespace}${NamespacePathSep}${path}` : path; break; } return includesTagPrefix && node.isTag ? `${TagPrefix}${id}` : id; } ResourceLocationNode.toString = toString; })(ResourceLocationNode || (ResourceLocationNode = {})); //# sourceMappingURL=ResourceLocationNode.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/Sequence.js const SequenceUtilDiscriminator = Symbol('SequenceUtilDiscriminator'); var SequenceUtil; (function (SequenceUtil) { function is(obj) { return !!obj && obj[SequenceUtilDiscriminator]; } SequenceUtil.is = is; })(SequenceUtil || (SequenceUtil = {})); //# sourceMappingURL=Sequence.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/StringNode.js const EscapeChars = (/* unused pure expression or super */ null && (['"', "'", '\\', 'b', 'f', 'n', 'r', 's', 't'])); var EscapeChar; (function (EscapeChar) { /* istanbul ignore next */ function is(expected, c) { return expected ? expected.includes(c) : false; } EscapeChar.is = is; })(EscapeChar || (EscapeChar = {})); const EscapeTable = new Map([ ['"', '"'], ["'", "'"], ['\\', '\\'], ['b', '\b'], ['f', '\f'], ['n', '\n'], ['r', '\r'], ['s', ' '], ['t', '\t'], ]); var StringBaseNode; (function (StringBaseNode) { function is(obj) { return Array.isArray(obj?.valueMap) && typeof obj?.options === 'object'; } StringBaseNode.is = is; })(StringBaseNode || (StringBaseNode = {})); var StringNode; (function (StringNode) { /* istanbul ignore next */ function is(obj) { return obj?.type === 'string'; } StringNode.is = is; function mock(range, options) { range = Range.get(range); return { type: 'string', range, options, value: '', valueMap: [{ inner: Range.create(0), outer: Range.create(range.start) }], }; } StringNode.mock = mock; })(StringNode || (StringNode = {})); //# sourceMappingURL=StringNode.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/SymbolNode.js var SymbolNode; (function (SymbolNode) { /* istanbul ignore next */ function is(obj) { return obj?.type === 'symbol'; } SymbolNode.is = is; function mock(range, options) { return { type: 'symbol', range: Range.get(range), options, value: '' }; } SymbolNode.mock = mock; })(SymbolNode || (SymbolNode = {})); //# sourceMappingURL=SymbolNode.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/index.js //# sourceMappingURL=index.js.map // EXTERNAL MODULE: ./node_modules/@spyglassmc/locales/lib/locales/en.js var en = __nccwpck_require__(9272); ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/locales/lib/index.js /* istanbul ignore file */ // @ts-expect-error const Locales = { en: en["default"] }; let language = 'en'; /** * @param key The locale key. * @param params All parameters that will be filled into the locale string. * If a string array is provided as a parameter, it will be converted to * string by the `arrayToMessage` method with `quoted=true, conjunction='or'` arguments. */ function localize(key, ...params) { const value = Locales[language][key] ?? Locales.en[key]; return _resolveLocalePlaceholders(value, params) ?? key; } function localeQuote(content) { return localize('punc.quote', content); } /** * @param locale A case-insensitive language tag following the format of * `\w+(-\w+)*` that should ideally correspond to the file name of one of the * files under `locales/`. Defaults to `en`. * @param dry @internal Don't actually change the locale. * * @returns The locale loaded. */ async function loadLocale(locale = 'en', dry = false) { locale = locale.toLowerCase(); if (locale === language) { return locale; } try { return await _setupLanguage(locale, dry); } catch (e) { // Most likely due to unknown locale. const lastDashIndex = locale.lastIndexOf('-'); if (lastDashIndex === -1) { // The locale has no subtags. No more locales to try. throw e; } // Try again with the rightmost subtag removed. return loadLocale(locale.slice(0, lastDashIndex), dry); } } function _resolveLocalePlaceholders(val, params) { return val?.replace(/%\d+%/g, (match) => { const index = parseInt(match.slice(1, -1)); let param = params[index]; if (typeof param !== 'string' && param?.[Symbol.iterator]) { param = arrayToMessage(param); } return `${param ?? match}`; }); } async function _setupLanguage(code, dry = false) { const locale = await __nccwpck_require__(3161)(`./${code}.js`); if (!dry) { Locales[code] = locale; language = code; } return code; } /** * Convert an array to human-readable message. * @param quoted Whether or not to quote the parts. Defaults to `true` * @param conjunction The conjunction to use. Defaults to `or`. * @returns Human-readable message. * @example // Using English * arrayToMessage([]) // "nothing" * arrayToMessage('foo') // "“foo”" * arrayToMessage(['foo']) // "“foo”" * arrayToMessage(['bar', 'foo']) // "“bar” or “foo”" * arrayToMessage(['bar', 'baz', 'foo']) // "“bar”, “baz”, or “foo”" * @example // Using Locale * arrayToMessage([], false) // "{nothing}" * arrayToMessage(['A'], false) // "A" * arrayToMessage(['A', 'B'], false) // "A{conjunction.or_2}B" * arrayToMessage(['A', 'B', 'C'], false) // "A{conjunction.or_3+_1}B{conjunction.or_3+_2}C" */ function arrayToMessage(param, quoted = true, conjunction = 'or') { const getPart = (str) => (quoted ? localeQuote(str) : str); const arr = (typeof param === 'string' ? [param] : Array.from(param)).map(getPart); switch (arr.length) { case 0: return localize('nothing'); case 1: return arr[0]; case 2: return arr[0] + localize(`conjunction.${conjunction}_2`) + arr[1]; default: return `${arr.slice(0, -1).join(localize(`conjunction.${conjunction}_3+_1`))}${localize(`conjunction.${conjunction}_3+_2`)}${arr[arr.length - 1]}`; } } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/literal.js function literal(...param) { const options = getOptions(param); return (src, ctx) => { const ans = { type: 'literal', range: Range.create(src), options, value: '' }; for (const expected of options.pool) { if (src.trySkip(expected)) { ans.value = expected; ans.range.end = src.cursor; return ans; } } ctx.err.report(localize('expected', options.pool), ans); return ans; }; } function getOptions(param) { let ans; if (typeof param[0] === 'object') { ans = param[0]; } else { ans = { pool: param }; } // Sort the pool from longest to shortest. ans.pool = ans.pool.sort((a, b) => b.length - a.length); return ans; } //# sourceMappingURL=literal.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/symbol/Symbol.js // #region Mcdoc Categories const McdocCategories = Object.freeze(['mcdoc', 'mcdoc/dispatcher']); // #endregion // #region Registry Categories // Data in `java-edition/src/binder/index.ts` may need to be updated when this section is changed. const RegistryCategories = Object.freeze([ 'activity', 'armor_material', // Removed 'attribute', 'block', 'block_entity_type', 'block_predicate_type', 'block_type', 'chunk_status', 'command_argument_type', 'consume_effect_type', 'creative_mode_tab', 'custom_stat', 'data_component_predicate_type', 'data_component_type', 'decorated_pot_pattern', 'decorated_pot_patterns', // Removed 'dialog_action_type', 'dialog_body_type', 'dialog_type', 'enchantment_effect_component_type', 'enchantment_entity_effect_type', 'enchantment_level_based_value_type', 'enchantment_location_based_effect_type', 'enchantment_provider_type', 'enchantment_value_effect_type', 'entity_sub_predicate_type', 'entity_type', 'float_provider_type', 'fluid', 'game_event', 'height_provider_type', 'input_control_type', 'instrument', 'int_provider_type', 'item', 'item_sub_predicate_type', // Removed 'loot_condition_type', 'loot_function_type', 'loot_nbt_provider_type', 'loot_number_provider_type', 'loot_pool_entry_type', 'loot_score_provider_type', 'map_decoration_type', 'memory_module_type', 'menu', 'mob_effect', 'motive', // Removed 'number_format_type', 'particle_type', 'point_of_interest_type', 'pos_rule_test', 'position_source_type', 'potion', 'recipe_book_category', 'recipe_display', 'recipe_serializer', 'recipe_type', 'rule_block_entity_modifier', 'rule_test', 'schedule', 'sensor_type', 'slot_display', 'sound_event', 'spawn_condition_type', 'stat_type', 'test_environment_definition_type', 'test_function', 'test_instance_type', 'trigger_type', 'ticket_type', 'villager_profession', 'villager_type', 'worldgen/biome_source', 'worldgen/block_placer_type', // Removed 'worldgen/block_state_provider_type', 'worldgen/carver', 'worldgen/chunk_generator', 'worldgen/decorator', // Removed 'worldgen/density_function_type', 'worldgen/feature', 'worldgen/feature_size_type', 'worldgen/foliage_placer_type', 'worldgen/material_condition', 'worldgen/material_rule', 'worldgen/placement_modifier_type', 'worldgen/pool_alias_binding', 'worldgen/root_placer_type', 'worldgen/structure_feature', // Removed 'worldgen/structure_piece', 'worldgen/structure_placement', 'worldgen/structure_pool_element', 'worldgen/structure_processor', 'worldgen/structure_type', 'worldgen/surface_builder', // Removed 'worldgen/tree_decorator_type', 'worldgen/trunk_placer_type', ]); // #endregion // #region Data Pack Categories const NormalFileCategories = Object.freeze([ 'advancement', 'banner_pattern', 'cat_variant', 'chat_type', 'chicken_variant', 'cow_variant', 'damage_type', 'dialog', 'dimension', 'dimension_type', 'enchantment', 'enchantment_provider', 'frog_variant', 'function', 'instrument', 'item_modifier', 'jukebox_song', 'loot_table', 'painting_variant', 'pig_variant', 'predicate', 'recipe', 'structure', 'test_environment', 'test_instance', 'trial_spawner', 'trim_material', 'trim_pattern', 'wolf_sound_variant', 'wolf_variant', ]); const WorldgenFileCategories = Object.freeze([ 'worldgen/biome', 'worldgen/configured_carver', 'worldgen/configured_feature', 'worldgen/configured_structure_feature', 'worldgen/configured_surface_builder', 'worldgen/density_function', 'worldgen/flat_level_generator_preset', 'worldgen/multi_noise_biome_source_parameter_list', 'worldgen/noise', 'worldgen/noise_settings', 'worldgen/placed_feature', 'worldgen/processor_list', 'worldgen/structure', 'worldgen/structure_set', 'worldgen/template_pool', 'worldgen/world_preset', ]); const TaggableResourceLocationCategories = Object.freeze([...NormalFileCategories, ...RegistryCategories, ...WorldgenFileCategories]); var TaggableResourceLocationCategory; (function (TaggableResourceLocationCategory) { function is(category) { return TaggableResourceLocationCategories.includes(category); } TaggableResourceLocationCategory.is = is; })(TaggableResourceLocationCategory || (TaggableResourceLocationCategory = {})); const TagFileCategories = Object.freeze(TaggableResourceLocationCategories.map((key) => `tag/${key}`)); const DataFileCategories = Object.freeze([...NormalFileCategories, ...TagFileCategories, ...WorldgenFileCategories]); const DataMiscCategories = Object.freeze([ 'attribute_modifier', 'bossbar', 'jigsaw_block_name', 'random_sequence', 'storage', ]); const DatapackCategories = Object.freeze([ 'attribute_modifier_uuid', 'objective', 'score_holder', 'tag', 'team', ...DataFileCategories, ...DataMiscCategories, ]); // #endregion // #region Resource Pack Categories const AssetsFileCategories = Object.freeze([ 'atlas', 'block_definition', // blockstates 'equipment', 'font', 'font/ttf', 'font/otf', 'font/unihex', 'gpu_warnlist', 'item_definition', // items 'lang', 'lang/deprecated', 'model', 'particle', 'post_effect', 'regional_compliancies', 'shader', 'shader/fragment', 'shader/vertex', 'sound', 'sounds', // sounds.json 'texture', 'texture_meta', // *.png.mcmeta 'waypoint_style', ]); const AssetsMiscCategories = Object.freeze([ 'texture_slot', 'shader_target', 'translation_key', ]); const ResourcepackCategories = Object.freeze([ ...AssetsMiscCategories, ...AssetsFileCategories, ]); // #endregion const FileCategories = Object.freeze([...DataFileCategories, ...AssetsFileCategories]); const AllCategories = Object.freeze([ ...DatapackCategories, ...ResourcepackCategories, ...McdocCategories, ...RegistryCategories, ]); const ResourceLocationCategories = Object.freeze([ 'mcdoc/dispatcher', ...DataMiscCategories, ...AssetsMiscCategories, ...FileCategories, ...RegistryCategories, ]); var ResourceLocationCategory; (function (ResourceLocationCategory) { function is(category) { return ResourceLocationCategories.includes(category); } ResourceLocationCategory.is = is; })(ResourceLocationCategory || (ResourceLocationCategory = {})); var SymbolPath; (function (SymbolPath) { function fromSymbol(symbol) { return symbol ? { category: symbol.category, path: symbol.path } : undefined; } SymbolPath.fromSymbol = fromSymbol; /** * Equivalent {@link SymbolPath}s will always be serialized into the same string value. */ function toString(path) { return JSON.stringify({ category: path.category, path: path.path }); } SymbolPath.toString = toString; function fromString(value) { return JSON.parse(value); } SymbolPath.fromString = fromString; })(SymbolPath || (SymbolPath = {})); class SymbolPathCollector { #set = new Set(); add(path) { if (!path) { return; } this.#set.add(SymbolPath.toString(path)); } has(path) { return this.#set.has(SymbolPath.toString(path)); } collect() { return [...this.#set].map(SymbolPath.fromString); } } const SymbolUsageTypes = Object.freeze(['definition', 'declaration', 'implementation', 'reference', 'typeDefinition']); var SymbolUsageType; (function (SymbolUsageType) { function is(value) { return SymbolUsageTypes.includes(value); } SymbolUsageType.is = is; })(SymbolUsageType || (SymbolUsageType = {})); var Symbol_Symbol; (function (Symbol) { function get(table, category, ...path) { if (isIterable(table)) { for (const t of table) { const result = get(t, category, ...path); if (result) { return result; } } return undefined; } const map = table[category]; for (const p of path) { } return undefined; } Symbol.get = get; })(Symbol_Symbol || (Symbol_Symbol = {})); var SymbolLocation; (function (SymbolLocation) { /* istanbul ignore next */ function create(doc, range, fullRange, contributor, additional) { return { ...Location.create(doc, range), ...(fullRange ? { fullRange: Range.get(fullRange), fullPosRange: PositionRange.from(fullRange, doc) } : {}), ...(contributor ? { contributor } : {}), ...(additional ? additional : {}), }; } SymbolLocation.create = create; })(SymbolLocation || (SymbolLocation = {})); var SymbolTable; (function (SymbolTable) { /** * The passed-in parameter `table` won't be mutated. * * @returns An identical symbol table where each Symbol's `parentMap` and `parentSymbol` properties * are set properly. */ function link(table) { const linkSymbol = (symbol, parentMap, parentSymbol, category, path) => { symbol.category = category; symbol.identifier = path[path.length - 1]; symbol.path = path; symbol.parentMap = parentMap; if (parentSymbol) { symbol.parentSymbol = parentSymbol; } if (symbol.members) { linkSymbolMap(symbol.members, symbol, category, path); } }; const linkSymbolMap = (map, parentSymbol, category, path) => { for (const [identifier, childSymbol] of Object.entries(map)) { linkSymbol(childSymbol, map, parentSymbol, category, [...path, identifier]); } }; const ans = rfdc()(table); for (const [category, map] of Object.entries(ans)) { linkSymbolMap(map, undefined, category, []); } return ans; } SymbolTable.link = link; /** * The passed-in parameter `table` won't be mutated. * * @returns An identical symbol table where each Symbol's `parentMap` and `parentSymbol` properties * are deleted. */ function unlink(table) { const unlinkSymbol = (symbol) => { delete symbol.category; delete symbol.identifier; delete symbol.parentMap; delete symbol.parentSymbol; delete symbol.path; if (symbol.members) { unlinkSymbolMap(symbol.members); } }; const unlinkSymbolMap = (map) => { for (const childSymbol of Object.values(map)) { unlinkSymbol(childSymbol); } }; const ans = rfdc({ circles: true })(table); for (const map of Object.values(ans)) { unlinkSymbolMap(map); } return ans; } SymbolTable.unlink = unlink; /** * @returns A serialized string representation of this symbol table. It can be turned back into * a symbol table through the {@link deserialize} method. */ function serialize(table) { return JSON.stringify(unlink(table)); } SymbolTable.serialize = serialize; /** * @returns The symbol table represented by the string returned by the {@link serialize} method. */ function deserialize(json) { return link(JSON.parse(json)); } SymbolTable.deserialize = deserialize; })(SymbolTable || (SymbolTable = {})); // interface SymbolEvent { // symbol: Symbol, // } // interface SymbolLocationEvent extends SymbolEvent { // type: SymbolUsageType, // location: SymbolLocation, // } // export class CachedSymbolTable extends TypedEmitter<{ // symbolCreated: (e: SymbolEvent) => unknown, // symbolAmended: (e: SymbolEvent) => unknown, // symbolRemoved: (e: SymbolEvent) => unknown, // symbolLocationCreated: (e: SymbolLocationEvent) => unknown, // symbolLocationRemoved: (e: SymbolLocationEvent) => unknown, // }> { // constructor(public readonly table: SymbolTable) { // super() // } // } //# sourceMappingURL=Symbol.js.map ;// CONCATENATED MODULE: ./node_modules/vscode-languageserver-textdocument/lib/esm/main.js /* -------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. * ------------------------------------------------------------------------------------------ */ class FullTextDocument { constructor(uri, languageId, version, content) { this._uri = uri; this._languageId = languageId; this._version = version; this._content = content; this._lineOffsets = undefined; } get uri() { return this._uri; } get languageId() { return this._languageId; } get version() { return this._version; } getText(range) { if (range) { const start = this.offsetAt(range.start); const end = this.offsetAt(range.end); return this._content.substring(start, end); } return this._content; } update(changes, version) { for (const change of changes) { if (FullTextDocument.isIncremental(change)) { // makes sure start is before end const range = getWellformedRange(change.range); // update content const startOffset = this.offsetAt(range.start); const endOffset = this.offsetAt(range.end); this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length); // update the offsets const startLine = Math.max(range.start.line, 0); const endLine = Math.max(range.end.line, 0); let lineOffsets = this._lineOffsets; const addedLineOffsets = computeLineOffsets(change.text, false, startOffset); if (endLine - startLine === addedLineOffsets.length) { for (let i = 0, len = addedLineOffsets.length; i < len; i++) { lineOffsets[i + startLine + 1] = addedLineOffsets[i]; } } else { if (addedLineOffsets.length < 10000) { lineOffsets.splice(startLine + 1, endLine - startLine, ...addedLineOffsets); } else { // avoid too many arguments for splice this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1)); } } const diff = change.text.length - (endOffset - startOffset); if (diff !== 0) { for (let i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) { lineOffsets[i] = lineOffsets[i] + diff; } } } else if (FullTextDocument.isFull(change)) { this._content = change.text; this._lineOffsets = undefined; } else { throw new Error('Unknown change event received'); } } this._version = version; } getLineOffsets() { if (this._lineOffsets === undefined) { this._lineOffsets = computeLineOffsets(this._content, true); } return this._lineOffsets; } positionAt(offset) { offset = Math.max(Math.min(offset, this._content.length), 0); const lineOffsets = this.getLineOffsets(); let low = 0, high = lineOffsets.length; if (high === 0) { return { line: 0, character: offset }; } while (low < high) { const mid = Math.floor((low + high) / 2); if (lineOffsets[mid] > offset) { high = mid; } else { low = mid + 1; } } // low is the least x for which the line offset is larger than the current offset // or array.length if no line offset is larger than the current offset const line = low - 1; offset = this.ensureBeforeEOL(offset, lineOffsets[line]); return { line, character: offset - lineOffsets[line] }; } offsetAt(position) { const lineOffsets = this.getLineOffsets(); if (position.line >= lineOffsets.length) { return this._content.length; } else if (position.line < 0) { return 0; } const lineOffset = lineOffsets[position.line]; if (position.character <= 0) { return lineOffset; } const nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length; const offset = Math.min(lineOffset + position.character, nextLineOffset); return this.ensureBeforeEOL(offset, lineOffset); } ensureBeforeEOL(offset, lineOffset) { while (offset > lineOffset && isEOL(this._content.charCodeAt(offset - 1))) { offset--; } return offset; } get lineCount() { return this.getLineOffsets().length; } static isIncremental(event) { const candidate = event; return candidate !== undefined && candidate !== null && typeof candidate.text === 'string' && candidate.range !== undefined && (candidate.rangeLength === undefined || typeof candidate.rangeLength === 'number'); } static isFull(event) { const candidate = event; return candidate !== undefined && candidate !== null && typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined; } } var TextDocument; (function (TextDocument) { /** * Creates a new text document. * * @param uri The document's uri. * @param languageId The document's language Id. * @param version The document's initial version number. * @param content The document's content. */ function create(uri, languageId, version, content) { return new FullTextDocument(uri, languageId, version, content); } TextDocument.create = create; /** * Updates a TextDocument by modifying its content. * * @param document the document to update. Only documents created by TextDocument.create are valid inputs. * @param changes the changes to apply to the document. * @param version the changes version for the document. * @returns The updated TextDocument. Note: That's the same document instance passed in as first parameter. * */ function update(document, changes, version) { if (document instanceof FullTextDocument) { document.update(changes, version); return document; } else { throw new Error('TextDocument.update: document must be created by TextDocument.create'); } } TextDocument.update = update; function applyEdits(document, edits) { const text = document.getText(); const sortedEdits = mergeSort(edits.map(getWellformedEdit), (a, b) => { const diff = a.range.start.line - b.range.start.line; if (diff === 0) { return a.range.start.character - b.range.start.character; } return diff; }); let lastModifiedOffset = 0; const spans = []; for (const e of sortedEdits) { const startOffset = document.offsetAt(e.range.start); if (startOffset < lastModifiedOffset) { throw new Error('Overlapping edit'); } else if (startOffset > lastModifiedOffset) { spans.push(text.substring(lastModifiedOffset, startOffset)); } if (e.newText.length) { spans.push(e.newText); } lastModifiedOffset = document.offsetAt(e.range.end); } spans.push(text.substr(lastModifiedOffset)); return spans.join(''); } TextDocument.applyEdits = applyEdits; })(TextDocument || (TextDocument = {})); function mergeSort(data, compare) { if (data.length <= 1) { // sorted return data; } const p = (data.length / 2) | 0; const left = data.slice(0, p); const right = data.slice(p); mergeSort(left, compare); mergeSort(right, compare); let leftIdx = 0; let rightIdx = 0; let i = 0; while (leftIdx < left.length && rightIdx < right.length) { const ret = compare(left[leftIdx], right[rightIdx]); if (ret <= 0) { // smaller_equal -> take left to preserve order data[i++] = left[leftIdx++]; } else { // greater -> take right data[i++] = right[rightIdx++]; } } while (leftIdx < left.length) { data[i++] = left[leftIdx++]; } while (rightIdx < right.length) { data[i++] = right[rightIdx++]; } return data; } function computeLineOffsets(text, isAtLineStart, textOffset = 0) { const result = isAtLineStart ? [textOffset] : []; for (let i = 0; i < text.length; i++) { const ch = text.charCodeAt(i); if (isEOL(ch)) { if (ch === 13 /* CharCode.CarriageReturn */ && i + 1 < text.length && text.charCodeAt(i + 1) === 10 /* CharCode.LineFeed */) { i++; } result.push(textOffset + i + 1); } } return result; } function isEOL(char) { return char === 13 /* CharCode.CarriageReturn */ || char === 10 /* CharCode.LineFeed */; } function getWellformedRange(range) { const start = range.start; const end = range.end; if (start.line > end.line || (start.line === end.line && start.character > end.character)) { return { start: end, end: start }; } return range; } function getWellformedEdit(textEdit) { const range = getWellformedRange(textEdit.range); if (range !== textEdit.range) { return { newText: textEdit.newText, range }; } return textEdit; } ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/symbol/SymbolUtil.js var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; class SymbolUtil { #global; #eventEmitter; #eventEmitterConstructor; #trimmableSymbols = new Set(); #cache = Object.create(null); #currentContributor; /** * @internal */ _delayedOps = []; /** * @internal */ _inDelayMode; get global() { return this.#global; } constructor(global, eventEmitterConstructor, /** @internal */ _currentContributor, /** @internal */ _inDelayMode = false) { this.#eventEmitter = new eventEmitterConstructor(); this.#eventEmitterConstructor = eventEmitterConstructor; this.#global = global; this.#currentContributor = _currentContributor; this._inDelayMode = _inDelayMode; this.on('symbolCreated', ({ symbol }) => { this.#trimmableSymbols.add(SymbolPath.toString(symbol)); }).on('symbolRemoved', ({ symbol }) => { this.#trimmableSymbols.delete(SymbolPath.toString(symbol)); }).on('symbolLocationCreated', ({ symbol, location }) => { const cache = (this.#cache[location.contributor ?? 'undefined'] ??= Object.create(null)); const fileSymbols = (cache[location.uri] ??= new Set()); const path = SymbolPath.toString(symbol); fileSymbols.add(path); this.#trimmableSymbols.delete(path); }).on('symbolLocationRemoved', ({ symbol }) => { const path = SymbolPath.toString(symbol); this.#trimmableSymbols.add(path); }); } on(event, callbackFn) { this.#eventEmitter.on(event, callbackFn); return this; } once(event, callbackFn) { this.#eventEmitter.once(event, callbackFn); return this; } emit(event, ...args) { return this.#eventEmitter.emit(event, ...args); } /** * Build the internal cache of the SymbolUtil according to the current global symbol table. */ buildCache() { SymbolUtil.forEachSymbol(this.global, (symbol) => { this.emit('symbolCreated', { symbol }); SymbolUtil.forEachLocationOfSymbol(symbol, ({ type, location }) => { this.emit('symbolLocationCreated', { symbol, type, location }); }); }); } /** * @returns A clone of this SymbolUtil that is in delay mode: changes to the symbol table happened in the clone will * not take effect until the {@link SymbolUtil.applyDelayedEdits} method is called on that clone. * * The clone shares the same reference of the global symbol table and symbol stacks, meaning that after * `applyDelayedEdits` is called, the original SymbolUtil will also be modified. */ clone() { return new SymbolUtil(this.#global, this.#eventEmitterConstructor, this.#currentContributor, true); } /** * Apply edits done during the delay mode. */ applyDelayedEdits() { this._delayedOps.forEach((f) => f()); this._delayedOps = []; this._inDelayMode = false; } contributeAs(contributor, fn) { const originalValue = this.#currentContributor; this.#currentContributor = contributor; try { fn(); } finally { this.#currentContributor = originalValue; } return this; } async contributeAsAsync(contributor, fn) { const originalValue = this.#currentContributor; this.#currentContributor = contributor; try { await fn(); } finally { this.#currentContributor = originalValue; } return this; } /** * @param * - `contributor` - clear symbol locations contributed by this contributor. Pass in `undefined` * to select all symbol locations that don't have a contributor. * - `uri` - clear symbol locations associated with this URI. * - `predicate` - clear symbol locations matching this predicate */ clear({ uri, contributor, predicate = () => true }) { const getCaches = () => { if (contributor) { return this.#cache[contributor] ? [this.#cache[contributor]] : []; } else { return Object.values(this.#cache); } }; const getPaths = () => { const caches = getCaches(); const sets = uri ? caches.map((cache) => cache[uri] ?? new Set()) : caches.map((cache) => Object.values(cache)).flat(); return sets.map((s) => [...s]).flat().map(SymbolPath.fromString); }; const getTables = () => { return uri ? [this.#global] : [this.#global]; }; const paths = getPaths(); const tables = getTables(); for (const table of tables) { for (const path of paths) { const { symbol } = SymbolUtil.lookupTable(table, path.category, path.path); if (!symbol) { continue; } this.removeLocationsFromSymbol(symbol, (data) => (!uri || data.location.uri === uri) && (!contributor || data.location.contributor === contributor) && predicate(data)); } this.trim(table); } } lookup(category, path, node) { while (node) { if (node.locals) { const result = SymbolUtil.lookupTable(node.locals, category, path); if (result.symbol) { return result; } } node = node.parent; } return SymbolUtil.lookupTable(this.global, category, path); } query(doc, category, ...path) { const uri = SymbolUtil.toUri(doc); const { parentSymbol, parentMap, symbol } = this.lookup(category, path, isDocAndNode(doc) ? doc.node : undefined); const visible = symbol ? SymbolUtil.isVisible(symbol, uri) : true; return new SymbolQuery({ category, doc, contributor: this.#currentContributor, map: visible ? parentMap : undefined, parentSymbol, path, symbol: visible ? symbol : undefined, util: this, }); } getVisibleSymbols(category, uri) { const map = this.lookup(category, [], undefined).parentMap ?? undefined; return SymbolUtil.filterVisibleSymbols(uri, map); } static toUri(uri) { if (typeof uri === 'string') { return uri; } if (isDocAndNode(uri)) { return uri.doc.uri; } return uri.uri; } /** * @see {@link SymbolUtil.trimMap} */ trim(table) { const trimSymbol = (symbol) => { if (!symbol) { return; } if (SymbolUtil.isTrimmable(symbol)) { delete symbol.parentMap[symbol.identifier]; this.emit('symbolRemoved', { symbol }); trimSymbol(symbol.parentSymbol); } }; for (const pathString of this.#trimmableSymbols) { const path = SymbolPath.fromString(pathString); const { symbol } = SymbolUtil.lookupTable(table, path.category, path.path); trimSymbol(symbol); } } removeLocationsFromSymbol(symbol, predicate) { for (const type of SymbolUsageTypes) { if (!symbol[type]) { continue; } symbol[type] = symbol[type].reduce((result, location) => { if (predicate({ location, symbol, type })) { this.emit('symbolLocationRemoved', { symbol, type, location }); } else { result.push(location); } return result; }, []); } } enterMap(parentSymbol, map, category, path, identifier, addition, doc, contributor) { let ans = map[identifier]; if (ans) { this.amendSymbol(ans, addition, doc, contributor); } else { ans = this.createSymbol(category, parentSymbol, map, path, identifier, addition, doc, contributor); } this.emit('symbolAmended', { symbol: ans }); return ans; } static lookupTable(table, category, path) { let parentMap = table[category]; let parentSymbol; let symbol; for (let i = 0; i < path.length; i++) { symbol = parentMap?.[path[i]]; if (!symbol) { if (i !== path.length - 1) { parentSymbol = undefined; parentMap = undefined; } break; } if (i === path.length - 1) { break; } parentSymbol = symbol; parentMap = symbol.members; } return { parentSymbol, parentMap, symbol }; } static lookupTables(tables, category, path) { let parentMap; let parentSymbol; // Traverse from the last table to the first one. for (let i = tables.length - 1; i >= 0; i--) { const table = tables[i]; const result = this.lookupTable(table, category, path); if (result.symbol) { return result; } if (!parentSymbol && !parentMap && (result.parentSymbol || result.parentMap)) { parentSymbol = result.parentSymbol; parentMap = result.parentMap; } } return { parentSymbol, parentMap, symbol: undefined }; } createSymbol(category, parentSymbol, parentMap, path, identifier, addition, doc, contributor) { const ans = (parentMap[identifier] = { category, identifier, ...(parentSymbol ? { parentSymbol } : {}), parentMap, path, ...addition.data, }); this.emit('symbolCreated', { symbol: ans }); this.amendSymbolUsage(ans, addition.usage, doc, contributor); return ans; } amendSymbol(symbol, addition, doc, contributor) { this.amendSymbolMetadata(symbol, addition.data); this.amendSymbolUsage(symbol, addition.usage, doc, contributor); } amendSymbolMetadata(symbol, addition) { if (addition) { if ('data' in addition) { symbol.data = addition.data; } if ('desc' in addition) { symbol.desc = addition.desc; } if (addition.relations && Object.keys(addition.relations).length) { symbol.relations ??= {}; for (const relationship of Object.keys(addition.relations)) { symbol.relations[relationship] = addition.relations[relationship]; } } if ('subcategory' in addition) { symbol.subcategory = addition.subcategory; } if ('visibility' in addition) { // Visibility changes are only accepted if the change wouldn't result in the // symbol being stored in a different symbol table. const inGlobalTable = (v) => v === undefined || v === 2 /* SymbolVisibility.Public */ || v === 3 /* SymbolVisibility.Restricted */; if (symbol.visibility === addition.visibility || (inGlobalTable(symbol.visibility) && inGlobalTable(addition.visibility))) { symbol.visibility = addition.visibility; } else { throw new Error(`Cannot change visibility from ${symbol.visibility} to ${addition.visibility}: ${JSON.stringify(SymbolPath.fromSymbol(symbol))}`); } } if (addition.visibilityRestriction?.length) { symbol.visibilityRestriction = (symbol.visibilityRestriction ?? []).concat(addition.visibilityRestriction); } } } amendSymbolUsage(symbol, addition, doc, contributor) { if (addition) { const type = addition.type ?? 'reference'; const arr = (symbol[type] ??= []); const range = Range.get((SymbolAdditionUsageWithNode.is(addition) ? addition.node : addition.range) ?? 0); const location = SymbolLocation.create(doc, range, addition.fullRange, contributor, { accessType: addition.accessType, skipRenaming: addition.skipRenaming, }); if (!doc.uri.startsWith('file:')) { delete location.range; delete location.posRange; delete location.fullRange; delete location.fullPosRange; } arr.push(location); this.emit('symbolLocationCreated', { symbol, type, location }); } } /** * @returns The ultimate symbol being pointed by the passed-in `symbol`'s alias. */ resolveAlias(symbol) { return symbol?.relations?.aliasOf ? this.resolveAlias(this.lookup(symbol.relations.aliasOf.category, symbol.relations.aliasOf.path).symbol) : symbol; } static filterVisibleSymbols(uri, map = {}) { const ans = {}; for (const [identifier, symbol] of Object.entries(map)) { if (SymbolUtil.isVisible(symbol, uri)) { ans[identifier] = symbol; } } return ans; } static isTrimmable(symbol) { return (!Object.keys(symbol.members ?? {}).length && !symbol.declaration?.length && !symbol.definition?.length && !symbol.implementation?.length && !symbol.reference?.length && !symbol.typeDefinition?.length); } static isVisible(symbol, _uri) { switch (symbol.visibility) { case 3 /* SymbolVisibility.Restricted */: return false; // FIXME: check with workspace root URIs. case 0 /* SymbolVisibility.Block */: case 1 /* SymbolVisibility.File */: case 2 /* SymbolVisibility.Public */: default: return true; } } /** * @returns If the symbol has declarations or definitions. */ static isDeclared(symbol) { return !!(symbol?.declaration?.length || symbol?.definition?.length); } /** * @returns If the symbol has definitions, or declarations and implementations. */ static isDefined(symbol) { return !!(symbol?.definition?.length || (symbol?.definition?.length && symbol?.implementation?.length)); } /** * @returns If the symbol has implementations or definitions. */ static isImplemented(symbol) { return !!(symbol?.implementation?.length || symbol?.definition?.length); } /** * @returns If the symbol has references. */ static isReferenced(symbol) { return !!symbol?.reference?.length; } /** * @returns If the symbol has type definitions. */ static isTypeDefined(symbol) { return !!symbol?.typeDefinition?.length; } /** * @throws If the symbol does not have any declarations or definitions. */ static getDeclaredLocation(symbol) { return (symbol.declaration?.[0] ?? symbol.definition?.[0] ?? (() => { throw new Error(`Cannot get declared location of ${JSON.stringify(SymbolPath.fromSymbol(symbol))}`); })()); } static forEachSymbolInMap(map, fn) { for (const symbol of Object.values(map)) { fn(symbol); if (symbol.members) { this.forEachSymbolInMap(symbol.members, fn); } } } static forEachSymbol(table, fn) { for (const map of Object.values(table)) { this.forEachSymbolInMap(map, fn); } } static forEachLocationOfSymbol(symbol, fn) { for (const type of SymbolUsageTypes) { symbol[type]?.forEach((location) => fn({ type, location })); } } static isVisibilityInGlobal(v) { return (v === undefined || v === 2 /* SymbolVisibility.Public */ || v === 3 /* SymbolVisibility.Restricted */); } static areVisibilitiesCompatible(v1, v2) { return ((this.isVisibilityInGlobal(v1) && this.isVisibilityInGlobal(v2)) || (v1 === 0 /* SymbolVisibility.Block */ && v2 === 0 /* SymbolVisibility.Block */) || (v1 === 1 /* SymbolVisibility.File */ && v2 === 1 /* SymbolVisibility.File */)); } } __decorate([ DelayModeSupport() ], SymbolUtil.prototype, "clear", null); __decorate([ DelayModeSupport() ], SymbolUtil.prototype, "trim", null); __decorate([ DelayModeSupport() ], SymbolUtil.prototype, "removeLocationsFromSymbol", null); var SymbolAdditionUsageWithRange; (function (SymbolAdditionUsageWithRange) { /* istanbul ignore next */ function is(usage) { return !!usage?.range; } SymbolAdditionUsageWithRange.is = is; })(SymbolAdditionUsageWithRange || (SymbolAdditionUsageWithRange = {})); var SymbolAdditionUsageWithNode; (function (SymbolAdditionUsageWithNode) { /* istanbul ignore next */ function is(usage) { return !!usage?.node; } SymbolAdditionUsageWithNode.is = is; })(SymbolAdditionUsageWithNode || (SymbolAdditionUsageWithNode = {})); /* istanbul ignore next */ class SymbolQuery { category; path; #doc; #node; /** * If only a string URI (instead of a {@link TextDocument}) is provided when constructing this class. * * If this is `true`, {@link SymbolAdditionUsageWithRange.range} is ignored and treated as `[0, 0)` when entering symbols through this class. */ #createdWithUri; #currentContributor; #hasTriggeredIf = false; /** * The map where the queried symbol is stored. `undefined` if the map hasn't been created yet. */ #map; #parentSymbol; /** * The queried symbol. `undefined` if the symbol hasn't been created yet. */ #symbol; /** * The {@link SymbolUtil} where this query was created. */ util; get symbol() { return this.#symbol; } get visibleMembers() { return SymbolUtil.filterVisibleSymbols(this.#doc.uri, this.path.length === 0 ? this.#map : this.#symbol?.members); } constructor({ category, contributor, doc, map, parentSymbol, path, symbol, util }) { this.category = category; this.path = path; if (typeof doc === 'string') { doc = TextDocument.create(doc, '', 0, ''); this.#createdWithUri = true; } else if (isDocAndNode(doc)) { this.#node = doc.node; doc = doc.doc; } this.#doc = doc; this.#currentContributor = contributor; this.#map = map; this.#parentSymbol = parentSymbol; this.#symbol = symbol; this.util = util; } heyGimmeDaSymbol() { return this.#symbol; } getData(predicate) { const data = this.#symbol?.data; return predicate(data) ? data : undefined; } with(fn) { fn(this); return this; } if(predicate, fn) { if (predicate.call(this, this.#symbol, this)) { fn.call(this, this.#symbol, this); this.#hasTriggeredIf = true; } return this; } /** * Calls `fn` if the queried symbol does not exist. */ ifUnknown(fn) { return this.if((s) => s === undefined, fn); } /** * Calls `fn` if the queried symbol exists (i.e. has any of declarations/definitions/implementations/references/typeDefinitions). */ ifKnown(fn) { return this.if((s) => s !== undefined, fn); } /** * Calls `fn` if the queried symbol has declarations or definitions. */ ifDeclared(fn) { return this.if((s) => SymbolUtil.isDeclared(s), fn); } /** * Calls `fn` if the queried symbol has definitions, or both declarations and implementations. */ ifDefined(fn) { return this.if(SymbolUtil.isDefined, fn); } /** * Calls `fn` if the queried symbol has implementations or definitions. */ ifImplemented(fn) { return this.if(SymbolUtil.isImplemented, fn); } /** * Calls `fn` if the queried symbol has references. */ ifReferenced(fn) { return this.if(SymbolUtil.isReferenced, fn); } /** * Calls `fn` if the queried symbol has type definitions. */ ifTypeDefined(fn) { return this.if(SymbolUtil.isTypeDefined, fn); } /** * Calls `fn` if none of the former `if` conditions are met. */ else(fn) { if (!this.#hasTriggeredIf) { fn.call(this, this.#symbol, this); } return this; } /** * Enters the queried symbol if none of the former `if` conditions are met. */ elseEnter(symbol) { return this.else(() => this.enter(symbol)); } /** * Resolves the queried symbol if it is an alias and if none of the former `if` conditions are met. * * @throws If the current symbol points to an non-existent symbol. */ elseResolveAlias() { return this.else(() => this.resolveAlias()); } _enter(addition) { /** * Get a proper visibility from the addition: * * If the visibility is specified, use it. * * If the visibility is `undefined`, use the visibility of the symbol, or `Public` if unapplicable. */ const getAdditionVisibility = (addition) => { return (addition.data?.visibility ?? this.symbol?.visibility ?? 2 /* SymbolVisibility.Public */); }; const getMap = (addition) => { const additionVisibility = getAdditionVisibility(addition); if (this.#map && SymbolUtil.areVisibilitiesCompatible(additionVisibility, this.#symbol?.visibility)) { return this.#map; } if (this.path.length > 1) { if (this.#parentSymbol) { if (!SymbolUtil.areVisibilitiesCompatible(additionVisibility, this.#parentSymbol.visibility)) { throw new Error(`Cannot enter member “${this.getPath()}” of ${SymbolFormatter.stringifyVisibility(additionVisibility)} visibility to parent of ${SymbolFormatter.stringifyVisibility(this.#parentSymbol.visibility)} visibility`); } return (this.#parentSymbol.members ??= {}); } } else { let table; if (SymbolUtil.isVisibilityInGlobal(additionVisibility)) { table = this.util.global; } else if (additionVisibility === 1 /* SymbolVisibility.File */) { if (!this.#node) { throw new Error(`Cannot enter “${this.getPath()}” with ${SymbolFormatter.stringifyVisibility(additionVisibility)} visibility as no node is supplied`); } let node = this.#node; while (node) { if (node.type === 'file') { table = node.locals; break; } node = node.parent; } if (!table) { throw new Error(`Cannot enter “${this.getPath()}” with ${SymbolFormatter.stringifyVisibility(additionVisibility)} visibility as no file node is supplied`); } } else { if (!this.#node) { throw new Error(`Cannot enter “${this.getPath()}” with ${SymbolFormatter.stringifyVisibility(additionVisibility)} visibility as no node is supplied`); } let node = this.#node; while (node) { if (node.locals) { table = node.locals; break; } node = node.parent; } if (!table) { throw new Error(`Cannot enter “${this.getPath()}” with ${SymbolFormatter.stringifyVisibility(additionVisibility)} visibility as no node with locals is supplied`); } } // TODO: Move part of symbol from global to table. return (table[this.category] ??= {}); } throw new Error(`Cannot create the symbol map for “${this.getPath()}”`); }; // Treat `usage.range` as `[0, 0)` if this class was constructed with a string URI (instead of a `TextDocument`). if (this.#createdWithUri && SymbolAdditionUsageWithRange.is(addition.usage)) { addition.usage.range = Range.create(0, 0); } this.#map = getMap(addition); this.#symbol = this.util.enterMap(this.#parentSymbol, this.#map, this.category, this.path, this.path[this.path.length - 1], addition, this.#doc, this.#currentContributor); if (addition.usage?.node) { addition.usage.node.symbol = this.#symbol; } } /** * Enters the queried symbol. * * @throws If the parent of this symbol doesn't exist either. */ enter(addition) { this._enter(addition); return this; } /** * Amends the queried symbol if the queried symbol exists (i.e. has any of declarations/definitions/implementations/references/typeDefinitions) and is visible at the current scope. * * This is equivalent to calling * ```typescript * query.ifKnown(function () { * this.enter(symbol) * }) * ``` * * Therefore, if the symbol is successfully amended, `elseX` methods afterwards will **not** be executed. */ amend(symbol) { return this.ifKnown(() => this.enter(symbol)); } /** * Resolves this symbol if it exists and is an alias. * * @throws If the current symbol points to an non-existent symbol. The state of this object will not be changed * after the error is thrown. */ resolveAlias() { if (this.#symbol) { const result = this.util.resolveAlias(this.#symbol); if (!result) { throw new Error('The current symbol points to an non-existent symbol.'); } this.#symbol = result; this.#map = result.parentMap; this.#parentSymbol = result.parentSymbol; this.path = result.path; } return this; } member() { // Handle overloads. let doc, identifier, fn; if (arguments.length === 2) { // Ensure the member query result will not unknowingly have a dummy TextDocument passed down from this class. doc = this.#createdWithUri ? this.#doc.uri : this.#doc; identifier = arguments[0]; fn = arguments[1]; } else { doc = arguments[0]; identifier = arguments[1]; fn = arguments[2]; } if (this.#symbol === undefined) { throw new Error(`Tried to query member symbol “${identifier}” from an undefined symbol (path “${this.path.join('.')}”)`); } const memberDoc = typeof doc === 'string' && doc === this.#doc.uri && !this.#createdWithUri ? this.#doc : doc; const memberMap = this.#symbol.members; const memberSymbol = memberMap?.[identifier]; const memberQueryResult = new SymbolQuery({ category: this.category, doc: memberDoc, contributor: this.#currentContributor, map: memberMap, parentSymbol: this.#symbol, path: [...this.path, identifier], symbol: memberSymbol, util: this.util, }); fn(memberQueryResult); return this; } /** * Do something with this query on each value in a given iterable. The query itself will be included * in the callback function as the second parameter. */ onEach(values, fn) { for (const value of values) { fn.call(this, value, this); } return this; } forEachMember(fn) { return this.onEach(Object.keys(this.visibleMembers), (identifier) => this.member(identifier, (query) => fn(identifier, query))); } getPath() { return `${this.category}.${this.path.join('/')}`; } } __decorate([ DelayModeSupport((self) => self.util) ], SymbolQuery.prototype, "_enter", null); /* istanbul ignore next */ /** * A series of methods for converting symbol structures to human-readable outputs. Mostly for debug purposes. */ var SymbolFormatter; (function (SymbolFormatter) { const IndentChar = '+ '; function assertEqual(a, b) { if (a !== b) { throw new Error(`Assertion error: ${a} !== ${b}`); } } function stringifySymbolStack(stack) { return stack.map((table) => stringifySymbolTable(table)).join('\n------------\n'); } SymbolFormatter.stringifySymbolStack = stringifySymbolStack; function stringifySymbolTable(table, indent = '') { const ans = []; for (const category of Object.keys(table)) { const map = table[category]; ans.push([category, stringifySymbolMap(map, `${indent}${IndentChar}`)]); } return (ans.map((v) => `CATEGORY ${v[0]}\n${v[1]}`).join(`\n${indent}------------\n`) || 'EMPTY TABLE'); } SymbolFormatter.stringifySymbolTable = stringifySymbolTable; function stringifySymbolMap(map, indent = '') { if (!map) { return 'undefined'; } const ans = []; for (const identifier of Object.keys(map)) { const symbol = map[identifier]; assertEqual(identifier, symbol.identifier); ans.push(stringifySymbol(symbol, indent)); } return ans.join(`\n${indent}------------\n`); } SymbolFormatter.stringifySymbolMap = stringifySymbolMap; function stringifySymbol(symbol, indent = '') { if (!symbol) { return 'undefined'; } const ans = []; assertEqual(symbol.path[symbol.path.length - 1], symbol.identifier); ans.push(`SYMBOL ${symbol.path.join('.')}` + ` {${symbol.category}${symbol.subcategory ? ` (${symbol.subcategory})` : ''}}` + ` [${stringifyVisibility(symbol.visibility, symbol.visibilityRestriction)}]`); if (symbol.data) { ans.push(`${IndentChar}data: ${JSON.stringify(symbol.data)}`); } if (symbol.desc) { ans.push(`${IndentChar}description: ${symbol.desc}`); } for (const type of SymbolUsageTypes) { if (symbol[type]) { ans.push(`${IndentChar}${type}:\n${symbol[type].map((v) => `${indent}${IndentChar.repeat(2)}${JSON.stringify(v)}`) .join(`\n${indent}${IndentChar.repeat(2)}------------\n`)}`); } } if (symbol.relations) { ans.push(`${IndentChar}relations: ${JSON.stringify(symbol.relations)}`); } if (symbol.members) { ans.push(`${IndentChar}members:\n${stringifySymbolMap(symbol.members, `${indent}${IndentChar.repeat(2)}`)}`); } return ans.map((v) => `${indent}${v}`).join('\n'); } SymbolFormatter.stringifySymbol = stringifySymbol; function stringifyVisibility(visibility, visibilityRestriction) { let stringVisibility; // Const enums cannot be indexed even if `--preserveConstEnums` is on: https://github.com/microsoft/TypeScript/issues/31353 switch (visibility) { case 0 /* SymbolVisibility.Block */: stringVisibility = 'Block'; break; case 1 /* SymbolVisibility.File */: stringVisibility = 'File'; break; case 3 /* SymbolVisibility.Restricted */: stringVisibility = 'Restricted'; break; default: stringVisibility = 'Public'; break; } return `${stringVisibility}${visibilityRestriction ? ` ${visibilityRestriction.map((v) => `“${v}”`).join(', ')}` : ''}`; } SymbolFormatter.stringifyVisibility = stringifyVisibility; function stringifyLookupResult(result) { return `parentSymbol: ${stringifySymbol(result.parentSymbol, IndentChar)} parentMap: ${stringifySymbolMap(result.parentMap, IndentChar)} symbol: ${stringifySymbol(result.symbol, IndentChar)}`; } SymbolFormatter.stringifyLookupResult = stringifyLookupResult; })(SymbolFormatter || (SymbolFormatter = {})); /** * Make a method support delay mode: if the {@link SymbolUtil} is in delay mode, the actual invocation of the method will be * stored to the {@link SymbolUtil._delayedOps} array. * * The decorated method MUST have return type `void`. */ function DelayModeSupport(getUtil = (self) => self) { return (_target, _key, descripter) => { const decoratedMethod = descripter.value; // The `function` syntax is used to preserve `this` context from the decorated method. descripter.value = function (...args) { const util = getUtil(this); if (util._inDelayMode) { util._delayedOps.push(decoratedMethod.bind(this, ...args)); } else { decoratedMethod.apply(this, args); } }; return descripter; }; } function isDocAndNode(doc) { return !!doc.doc; } //# sourceMappingURL=SymbolUtil.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/symbol/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/fileUtil.js var fileUtil; (function (fileUtil) { /** * Get the relative URI of `target` based from `base`. * * @returns The relative URI, or `undefined` if `target` is not under `base`. */ function getRelativeUriFromBase(target, base) { const baseUri = new Uri(base); const targetUri = new Uri(target); if (baseUri.origin !== targetUri.origin) { // Different scheme, hostname, and/or port return undefined; } const baseComponents = baseUri.pathname.split('/').filter((v) => !!v); const targetComponents = targetUri.pathname.split('/').filter((v) => !!v); if (baseComponents.length > targetComponents.length || baseComponents.some((bc, i) => decodeURIComponent(bc) !== decodeURIComponent(targetComponents[i]))) { return undefined; } return targetComponents.slice(baseComponents.length).map(encodeURIComponent).join('/'); } fileUtil.getRelativeUriFromBase = getRelativeUriFromBase; function isSubUriOf(uri, base) { return getRelativeUriFromBase(uri, base) !== undefined; } fileUtil.isSubUriOf = isSubUriOf; /** * @param rootUris The root URIs. Each URI in this array must end with a slash (`/`). * @param uri The target file URI. * @returns The relative path from one of the `roots` to the `uri`, or `undefined` if the `uri` is not under any roots. * The separation used in the relative path is always slash (`/`). * @example * getRels(['file:///root/foo/', 'file:///root/'], 'file:///root/foo/bar/qux.json') * // -> 'bar/qux.json' * // -> 'foo/bar/qux.json' * // -> undefined * * getRels(['file:///root/foo/', 'file:///root/'], 'file:///outsider.json') * // -> undefined */ function* getRels(uri, rootUris) { for (const root of rootUris) { const rel = getRelativeUriFromBase(uri, root); if (rel !== undefined) { yield rel; } } return undefined; } fileUtil.getRels = getRels; /** * @see {@link getRels} * @example * getRel(['file:///root/foo/', 'file:///root/'], 'file:///root/foo/bar/qux.json') // -> 'bar/qux.json' * getRel(['file:///root/foo/', 'file:///root/'], 'file:///outsider.json') // -> undefined */ function getRel(uri, rootUris) { return getRels(uri, rootUris).next().value; } fileUtil.getRel = getRel; function* getRoots(uri, rootUris) { for (const root of rootUris) { const rel = getRelativeUriFromBase(uri, root); if (rel !== undefined) { yield root; } } return undefined; } fileUtil.getRoots = getRoots; function getRoot(uri, rootUris) { return getRoots(uri, rootUris).next().value; } fileUtil.getRoot = getRoot; function isRootUri(uri) { return uri.endsWith('/'); } fileUtil.isRootUri = isRootUri; function ensureEndingSlash(uri) { return isRootUri(uri) ? uri : `${uri}/`; } fileUtil.ensureEndingSlash = ensureEndingSlash; function join(fromUri, toUri) { return (ensureEndingSlash(fromUri) + (toUri.startsWith('/') ? toUri.slice(1) : toUri)); } fileUtil.join = join; function isFileUri(uri) { return uri.startsWith('file:'); } fileUtil.isFileUri = isFileUri; /** * @returns The part from the last `.` to the end of the URI, or `undefined` if no dots exist. No special treatment for leading dots. */ function extname(value) { const i = value.lastIndexOf('.'); return i >= 0 ? value.slice(i) : undefined; } fileUtil.extname = extname; /** * @returns The part from the last `/` to the end of the URI. */ function basename(uri) { const i = uri.lastIndexOf('/'); return i >= 0 ? uri.slice(i + 1) : uri; } fileUtil.basename = basename; /** * @returns The part from the beginning of the URI to the last `/`. */ function dirname(uri) { const i = uri.lastIndexOf('/'); return i >= 0 ? uri.slice(0, i) : uri; } fileUtil.dirname = dirname; /* istanbul ignore next */ function getParentOfFile(externals, path) { return new Uri('.', path); } fileUtil.getParentOfFile = getParentOfFile; /* istanbul ignore next */ /** * @throws * * @param mode Default to `0o777` (`rwxrwxrwx`) */ async function ensureDir(externals, path, mode = 0o777) { try { await externals.fs.mkdir(path, { mode, recursive: true }); } catch (e) { if (!externals.error.isKind(e, 'EEXIST')) { throw e; } } } fileUtil.ensureDir = ensureDir; /* istanbul ignore next */ /** * @throws * * Ensures the parent directory of the path exists. * * @param mode Default to `0o777` (`rwxrwxrwx`) */ async function ensureParentOfFile(externals, path, mode = 0o777) { return ensureDir(externals, getParentOfFile(externals, path), mode); } fileUtil.ensureParentOfFile = ensureParentOfFile; async function chmod(externals, path, mode) { return externals.fs.chmod(path, mode); } fileUtil.chmod = chmod; async function ensureWritable(externals, path) { try { await chmod(externals, path, 0o666); } catch (e) { if (!externals.error.isKind(e, 'ENOENT')) { throw e; } } } fileUtil.ensureWritable = ensureWritable; /** * @returns An array of file URI strings. */ async function getAllFiles(externals, root, depth = Number.POSITIVE_INFINITY) { async function walk(path, level) { if (level > depth) { return []; } const entries = await externals.fs.readdir(path); return (await Promise.all(entries.map(async (e) => { const entryPath = fileUtil.join(path.toString(), e.name); if (e.isDirectory()) { return await walk(entryPath, level + 1); } else if (e.isFile()) { return entryPath; } else { return []; } }))).flat(); } return walk(root, 0); } fileUtil.getAllFiles = getAllFiles; async function markReadOnly(externals, path) { return chmod(externals, path, 0o444); } fileUtil.markReadOnly = markReadOnly; async function unlink(externals, path) { return externals.fs.unlink(path); } fileUtil.unlink = unlink; async function readFile(externals, path) { return externals.fs.readFile(path); } fileUtil.readFile = readFile; /* istanbul ignore next */ /** * @throws * * The directory of the file will be created recursively if it doesn't exist. * * The target file will be given permission `0o666` (`rw-rw-rw-`) before being written into, and changed back to the * specified `mode`. * * * Encoding: `utf-8` * * Mode: `0o666` (`rw-rw-rw-`) * * Flag: `w` */ async function writeFile(externals, path, data, mode = 0o666) { await ensureParentOfFile(externals, path); await ensureWritable(externals, path); return externals.fs.writeFile(path, data, { mode }); } fileUtil.writeFile = writeFile; /* istanbul ignore next */ /** * @throws */ async function readJson(externals, path) { return JSON.parse(bufferToString(await readFile(externals, path))); } fileUtil.readJson = readJson; /* istanbul ignore next */ /** * @throws * * @see {@link writeFile} */ async function writeJson(externals, path, data) { return writeFile(externals, path, JSON.stringify(data)); } fileUtil.writeJson = writeJson; /** * @throws */ async function readGzippedFile(externals, path) { return externals.archive.gunzip(await readFile(externals, path)); } fileUtil.readGzippedFile = readGzippedFile; /** * @throws */ async function writeGzippedFile(externals, path, buffer) { if (typeof buffer === 'string') { buffer = new TextEncoder().encode(buffer); } return writeFile(externals, path, await externals.archive.gzip(buffer)); } fileUtil.writeGzippedFile = writeGzippedFile; /** * @throws */ async function readGzippedJson(externals, path) { return JSON.parse(bufferToString(await readGzippedFile(externals, path))); } fileUtil.readGzippedJson = readGzippedJson; /** * @throws */ async function writeGzippedJson(externals, path, data) { return writeGzippedFile(externals, path, JSON.stringify(data)); } fileUtil.writeGzippedJson = writeGzippedJson; })(fileUtil || (fileUtil = {})); //# sourceMappingURL=fileUtil.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/FileService.js /* istanbul ignore file */ var FileService; (function (FileService) { function create(externals, cacheRoot) { const virtualUrisRoot = fileUtil.ensureEndingSlash(new Uri('virtual-uris/', cacheRoot).toString()); return new FileServiceImpl(externals, virtualUrisRoot); } FileService.create = create; })(FileService || (FileService = {})); class FileServiceImpl { externals; virtualUrisRoot; supporters = new Map(); /** * A two-way map from mapped physical URIs to virtual URIs. */ map = new TwoWayMap(); constructor(externals, virtualUrisRoot) { this.externals = externals; this.virtualUrisRoot = virtualUrisRoot; } register(protocol, supporter, force = false) { if (!force && this.supporters.has(protocol)) { throw new Error(`The protocol “${protocol}” is already associated with another supporter.`); } this.supporters.set(protocol, supporter); } unregister(protocol) { this.supporters.delete(protocol); } /** * @throws If the protocol of `uri` isn't supported. * * @returns The protocol if it's supported. */ getSupportedProtocol(uri) { const protocol = new Uri(uri).protocol; if (!this.supporters.has(protocol)) { throw new Error(`The protocol “${protocol}” is unsupported.`); } return protocol; } /** * @throws */ async hash(uri) { const protocol = this.getSupportedProtocol(uri); return this.supporters.get(protocol).hash(uri); } /** * @throws */ readFile(uri) { const protocol = this.getSupportedProtocol(uri); return this.supporters.get(protocol).readFile(uri); } *listFiles() { for (const supporter of this.supporters.values()) { yield* supporter.listFiles(); } } *listRoots() { for (const supporter of this.supporters.values()) { yield* supporter.listRoots(); } } async mapToDisk(virtualUri) { if (fileUtil.isFileUri(virtualUri)) { return virtualUri; } if (!this.virtualUrisRoot) { return undefined; } try { let mappedUri = this.map.getKey(virtualUri); if (mappedUri === undefined) { mappedUri = `${this.virtualUrisRoot}${await this.externals.crypto.getSha1(virtualUri)}/${fileUtil.basename(virtualUri)}`; // Delete old mapped file if it exists. This makes sure the // readonly permission on the file is not removed by it being // overwritten. try { await fileUtil.unlink(this.externals, mappedUri); } catch (e) { if (!this.externals.error.isKind(e, 'ENOENT')) { throw e; } } const buffer = await this.readFile(virtualUri); await fileUtil.writeFile(this.externals, mappedUri, buffer, 0o444); this.map.set(mappedUri, virtualUri); } return mappedUri; } catch (e) { // Ignored. } return undefined; } mapFromDisk(mappedUri) { if (!this.virtualUrisRoot) { return mappedUri; } return this.map.get(mappedUri) ?? mappedUri; } } class FileUriSupporter { externals; roots; files; protocol = 'file:'; constructor(externals, roots, files) { this.externals = externals; this.roots = roots; this.files = files; } async hash(uri) { return hashFile(this.externals, uri); } readFile(uri) { return this.externals.fs.readFile(uri); } *listFiles() { for (const files of this.files.values()) { yield* files; } } listRoots() { return this.roots; } async mapToDisk(uri) { return uri; } static async create(dependencies, externals, logger) { const roots = []; const files = new Map(); for (let { uri } of dependencies) { try { if (fileUtil.isFileUri(uri) && (await externals.fs.stat(uri)).isDirectory()) { uri = fileUtil.ensureEndingSlash(uri); roots.push(uri); files.set(uri, await fileUtil.getAllFiles(externals, uri)); } } catch (e) { logger.error(`[FileUriSupporter#create] Bad dependency ${uri}`, e); } } return new FileUriSupporter(externals, roots, files); } } class ArchiveUriSupporter { externals; logger; entries; static Protocol = 'archive:'; static SupportedArchiveExtnames = ['.tar', '.tar.bz2', '.tar.gz', '.zip']; protocol = ArchiveUriSupporter.Protocol; /** * @param entries A map from archive names to unzipped entries. */ constructor(externals, logger, entries) { this.externals = externals; this.logger = logger; this.entries = entries; } async hash(uri) { const { archiveName, pathInArchive } = ArchiveUriSupporter.decodeUri(new Uri(uri)); if (!pathInArchive) { // Hash the archive itself. return hashFile(this.externals, archiveName); } else { // Hash the corresponding file. return this.externals.crypto.getSha1(this.getDataInArchive(archiveName, pathInArchive)); } } async readFile(uri) { const { archiveName, pathInArchive } = ArchiveUriSupporter.decodeUri(new Uri(uri)); return this.getDataInArchive(archiveName, pathInArchive); } /** * @throws */ getDataInArchive(archiveName, pathInArchive) { const entries = this.entries.get(archiveName); if (!entries) { throw this.externals.error.createKind('ENOENT', `Archive “${archiveName}” has not been loaded into the memory`); } const entry = entries.get(pathInArchive); if (!entry) { throw this.externals.error.createKind('ENOENT', `Path “${pathInArchive}” does not exist in archive “${archiveName}”`); } if (entry.type !== 'file') { throw this.externals.error.createKind('EISDIR', `Path “${pathInArchive}” in archive “${archiveName}” is not a file`); } return entry.data; } *listFiles() { for (const [archiveName, entries] of this.entries.entries()) { this.logger.info(`[ArchiveUriSupporter#listFiles] Listing ${entries.size} entries from ${archiveName}`); for (const entry of entries.values()) { if (entry.type === 'file') { yield ArchiveUriSupporter.getUri(archiveName, entry.path); } } } } *listRoots() { for (const archiveName of this.entries.keys()) { yield ArchiveUriSupporter.getUri(archiveName); } } static getUri(archiveName, pathInArchive = '') { return `${ArchiveUriSupporter.Protocol}//${archiveName}/${pathInArchive.replace(/\\/g, '/')}`; } /** * @throws When `uri` has the wrong protocol or hostname. */ static decodeUri(uri) { if (uri.protocol !== ArchiveUriSupporter.Protocol) { throw new Error(`Expected protocol “${ArchiveUriSupporter.Protocol}” in ${uri}`); } const path = uri.pathname; if (!path) { throw new Error(`Missing path in archive uri ${uri}`); } return { archiveName: uri.host, pathInArchive: path.charAt(0) === '/' ? path.slice(1) : path }; } static async create(dependencies, externals, logger) { const entries = new Map(); for (const { uri, info } of dependencies) { try { if (uri.startsWith('file:') && ArchiveUriSupporter.SupportedArchiveExtnames.some((ext) => uri.endsWith(ext)) && (await externals.fs.stat(uri)).isFile()) { const archiveName = fileUtil.basename(uri); if (entries.has(archiveName)) { throw new Error(`A different URI with ${archiveName} already exists`); } const files = await externals.archive.decompressBall(await externals.fs.readFile(uri), { stripLevel: typeof info?.startDepth === 'number' ? info.startDepth : 0 }); /// Debug message for #1609 logger.info(`[ArchiveUriSupporter#create] Extracted ${files.length} files from ${archiveName}`); entries.set(archiveName, new Map(files.map((f) => [f.path.replace(/\\/g, '/'), f]))); } } catch (e) { logger.error(`[ArchiveUriSupporter#create] Bad dependency ${uri}`, e); } } return new ArchiveUriSupporter(externals, logger, entries); } } async function hashFile(externals, uri) { return externals.crypto.getSha1(await externals.fs.readFile(uri)); } //# sourceMappingURL=FileService.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/CacheService.js /** * The format version of the cache. Should be increased when any changes that * could invalidate the cache are introduced to the Spyglass codebase. */ const LatestCacheVersion = 6; var Checksums; (function (Checksums) { function create() { return { files: {}, roots: {}, symbolRegistrars: {} }; } Checksums.create = create; })(Checksums || (Checksums = {})); class CacheService { cacheRoot; project; checksums = Checksums.create(); errors = {}; #hasValidatedFiles = false; /** * @param cacheRoot File path to the directory where cache files by Spyglass should be stored. * @param project */ constructor(cacheRoot, project) { this.cacheRoot = cacheRoot; this.project = project; this.project.on('documentUpdated', async ({ doc }) => { if (!this.#hasValidatedFiles // Do not save checksums for file schemes that we cannot map to disk (e.g. 'untitled:' // for untitled files in VS Code) || !(doc.uri.startsWith(ArchiveUriSupporter.Protocol) || doc.uri.startsWith('file:'))) { return; } try { // TODO: Don't update this for every single change. this.checksums.files[doc.uri] = await this.project.externals.crypto.getSha1(doc.getText()); } catch (e) { if (!this.project.externals.error.isKind(e, 'EISDIR')) { this.project.logger.error(`[CacheService#hash-file] ${doc.uri}`); } } }); this.project.on('rootsUpdated', async ({ roots }) => { if (!this.#hasValidatedFiles) { return; } for (const root of roots) { try { this.checksums.roots[root] = await this.project.fs.hash(root); } catch (e) { if (!this.project.externals.error.isKind(e, 'EISDIR')) { this.project.logger.error(`[CacheService#hash-root] ${root}`); } } } }); this.project.on('symbolRegistrarExecuted', ({ id, checksum }) => { if (checksum !== undefined) { this.checksums.symbolRegistrars[id] = checksum; } }); this.project.on('documentErrored', ({ uri, errors }) => { this.errors[uri] = errors; }); } #cacheFilePath; async getCacheFileUri() { if (!this.#cacheFilePath) { const sortedRoots = [...this.project.projectRoots].sort(); const hash = await this.project.externals.crypto.getSha1(sortedRoots.join(':')); this.#cacheFilePath = new Uri(`symbols/${hash}.json.gz`, this.cacheRoot).toString(); } return this.#cacheFilePath; } async load() { const ans = { symbols: {} }; if (this.project.projectRoots.length === 0) { return ans; } const __profiler = this.project.profilers.get('cache#load'); let filePath; try { filePath = await this.getCacheFileUri(); this.project.logger.info(`[CacheService#load] symbolCachePath = ${filePath}`); const cache = (await fileUtil.readGzippedJson(this.project.externals, filePath)); __profiler.task('Read File'); if (cache.version === LatestCacheVersion) { this.checksums = cache.checksums; this.errors = cache.errors; ans.symbols = SymbolTable.link(cache.symbols); __profiler.task('Link Symbols'); } else { this.project.logger.info(`[CacheService#load] Unsupported cache format ${cache.version}; expected ${LatestCacheVersion}`); } } catch (e) { if (!this.project.externals.error.isKind(e, 'ENOENT')) { this.project.logger.error('[CacheService#load] ', e); } } __profiler.finalize(); return ans; } async validate() { const ans = { addedFiles: [], changedFiles: [], removedFiles: [], unchangedFiles: [], }; const unchangedRoots = []; for (const [uri, checksum] of Object.entries(this.checksums.roots)) { try { const hash = await this.project.fs.hash(uri); if (hash === checksum) { unchangedRoots.push(uri); } } catch (e) { if (!this.project.externals.error.isKind(e, 'EISDIR')) { this.project.logger.error(`[CacheService#hash-file] ${uri}`); } // Failed calculating hash. Assume the root has changed. } } for (const [uri, checksum] of Object.entries(this.checksums.files)) { if (unchangedRoots.some((root) => fileUtil.isSubUriOf(uri, root))) { ans.unchangedFiles.push(uri); continue; } if (this.project.shouldExclude(uri)) { ans.removedFiles.push(uri); continue; } try { const hash = await this.project.fs.hash(uri); if (hash === checksum) { ans.unchangedFiles.push(uri); } else { ans.changedFiles.push(uri); } } catch (e) { if (this.project.externals.error.isKind(e, 'ENOENT') || this.project.externals.error.isKind(e, 'EISDIR')) { ans.removedFiles.push(uri); } else { this.project.logger.error(`[CacheService#validate] ${uri}`, e); // Assume the file has changed. ans.changedFiles.push(uri); } } } for (const uri of this.project.getTrackedFiles()) { if (!(uri in this.checksums.files)) { ans.addedFiles.push(uri); } } this.#hasValidatedFiles = true; return ans; } /** * @returns If the cache file was saved successfully. */ async save() { if (this.project.projectRoots.length === 0) { return false; } const __profiler = this.project.profilers.get('cache#save'); let filePath; try { filePath = await this.getCacheFileUri(); const cache = { version: LatestCacheVersion, projectRoots: this.project.projectRoots, checksums: this.checksums, symbols: SymbolTable.unlink(this.project.symbols.global), errors: this.errors, }; __profiler.task('Unlink Symbols'); await fileUtil.writeGzippedJson(this.project.externals, filePath, cache); __profiler.task('Write File').finalize(); return true; } catch (e) { this.project.logger.error(`[CacheService#save] path = ${filePath}`, e); } return false; } async hasFileChangedSinceCache(doc) { return (this.checksums.files[doc.uri] !== (await this.project.externals.crypto.getSha1(doc.getText()))); } reset() { this.#hasValidatedFiles = false; this.checksums = Checksums.create(); this.errors = {}; return { symbols: {} }; } } //# sourceMappingURL=CacheService.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/Config.js var LinterSeverity; (function (LinterSeverity) { function is(value) { return (value === 'hint' || value === 'information' || value === 'warning' || value === 'error'); } LinterSeverity.is = is; function toErrorSeverity(value) { switch (value) { case 'error': return 3 /* ErrorSeverity.Error */; case 'hint': return 0 /* ErrorSeverity.Hint */; case 'information': return 1 /* ErrorSeverity.Information */; case 'warning': return 2 /* ErrorSeverity.Warning */; } } LinterSeverity.toErrorSeverity = toErrorSeverity; })(LinterSeverity || (LinterSeverity = {})); var LinterConfigValue; (function (LinterConfigValue) { function destruct(value) { if (value === null || value === undefined) { return undefined; } if (LinterSeverity.is(value)) { return { ruleSeverity: LinterSeverity.toErrorSeverity(value), ruleValue: true }; } if (Array.isArray(value) && LinterSeverity.is(value[0])) { return { ruleSeverity: LinterSeverity.toErrorSeverity(value[0]), ruleValue: value[1] }; } return { ruleSeverity: 2 /* ErrorSeverity.Warning */, ruleValue: value }; } LinterConfigValue.destruct = destruct; })(LinterConfigValue || (LinterConfigValue = {})); var SymbolLinterConfig; (function (SymbolLinterConfig) { function is(value) { return Arrayable.is(value, Complex.is) || Action.is(value); } SymbolLinterConfig.is = is; let Complex; (function (Complex) { function is(v) { if (!v || typeof v !== 'object') { return false; } const value = v; return ((value.if === undefined || Arrayable.is(value.if, Condition.is)) && (value.then === undefined || Action.is(value.then)) && (value.override === undefined || Arrayable.is(value.override, Complex.is))); } Complex.is = is; })(Complex = SymbolLinterConfig.Complex || (SymbolLinterConfig.Complex = {})); let Condition; (function (Condition) { function is(v) { if (!v || typeof v !== 'object') { return false; } const value = v; return ((value.category === undefined || Arrayable.is(value.category, TypePredicates.isString)) && (value.pattern === undefined || Arrayable.is(value.pattern, TypePredicates.isString)) && (value.excludePattern === undefined || Arrayable.is(value.excludePattern, TypePredicates.isString)) && (value.namespace === undefined || Arrayable.is(value.namespace, TypePredicates.isString)) && (value.excludeNamespace === undefined || Arrayable.is(value.excludeNamespace, TypePredicates.isString))); } Condition.is = is; })(Condition = SymbolLinterConfig.Condition || (SymbolLinterConfig.Condition = {})); let Action; (function (Action) { function isDeclare(value) { return (value !== undefined && ['block', 'file', 'public'].includes(value.declare)); } Action.isDeclare = isDeclare; function isReport(value) { return (value !== undefined && ['inherit', 'hint', 'information', 'warning', 'error'].includes(value.report)); } Action.isReport = isReport; function is(v) { if (!v || typeof v !== 'object') { return false; } const value = v; return isDeclare(value) || isReport(value); } Action.is = is; })(Action = SymbolLinterConfig.Action || (SymbolLinterConfig.Action = {})); })(SymbolLinterConfig || (SymbolLinterConfig = {})); /** * Config which simulates the default vanilla command system. */ const VanillaConfig = { env: { dataSource: 'GitHub', dependencies: ['@vanilla-datapack', '@vanilla-resourcepack', '@vanilla-mcdoc'], exclude: [ '.*/**', '**/node_modules/**', '**/__pycache__/**', ], customResources: {}, feature: { codeActions: true, colors: true, completions: true, documentHighlighting: true, documentLinks: true, foldingRanges: true, formatting: true, hover: true, inlayHint: { enabledNodes: [ 'boolean', 'double', 'float', 'integer', 'long', 'mcfunction:coordinate', 'mcfunction:vector', 'mcfunction:command_child/unknown', ], }, semanticColoring: true, selectionRanges: true, signatures: true, }, gameVersion: 'Auto', language: 'Default', permissionLevel: 2, plugins: [], mcmetaSummaryOverrides: {}, enableMcdocCaching: false, useFilePolling: false, }, format: { blockStateBracketSpacing: { inside: 0 }, blockStateCommaSpacing: { before: 0, after: 1 }, blockStateEqualSpacing: { before: 0, after: 0 }, blockStateTrailingComma: false, eol: 'auto', nbtArrayBracketSpacing: { inside: 0 }, nbtArrayCommaSpacing: { before: 0, after: 1 }, nbtArraySemicolonSpacing: { after: 1 }, nbtArrayTrailingComma: false, nbtByteSuffix: 'b', nbtCompoundBracketSpacing: { inside: 0 }, nbtCompoundColonSpacing: { before: 0, after: 1 }, nbtCompoundCommaSpacing: { before: 0, after: 1 }, nbtCompoundTrailingComma: false, nbtDoubleOmitSuffix: false, nbtDoubleSuffix: 'd', nbtFloatSuffix: 'f', nbtListBracketSpacing: { inside: 0 }, nbtListCommaSpacing: { before: 0, after: 1 }, nbtListTrailingComma: false, nbtLongSuffix: 'L', nbtShortSuffix: 's', selectorBracketSpacing: { inside: 0 }, selectorCommaSpacing: { before: 0, after: 1 }, selectorEqualSpacing: { before: 0, after: 0 }, selectorTrailingComma: false, timeOmitTickUnit: false, }, lint: { blockStateSortKeys: null, nbtCompoundSortKeys: null, selectorSortKeys: null, commandStringQuote: null, nbtKeyQuote: null, nbtPathQuote: null, nbtStringQuote: null, selectorKeyQuote: null, idOmitDefaultNamespace: null, nameOfNbtKey: null, nameOfObjective: null, nameOfScoreHolder: null, nameOfTag: null, nameOfTeam: null, nbtArrayLengthCheck: true, nbtBoolean: null, nbtListLengthCheck: null, nbtTypeCheck: 'loosely', undeclaredSymbol: [ { if: [ { category: RegistryCategories, namespace: 'minecraft' }, { category: [...DataFileCategories, 'bossbar', 'objective', 'team'] }, ], then: { report: 'warning' }, }, { if: { category: ['attribute_modifier', 'attribute_modifier_uuid', 'tag'] }, then: { declare: 'public' }, }, { then: { declare: 'block' }, }, ], }, snippet: { executeIfScoreSet: 'execute if score ${1:score_holder} ${2:objective} = ${1:score_holder} ${2:objective} $0', summonAec: 'summon minecraft:area_effect_cloud ~ ~ ~ {Age: -2147483648, Duration: -1, WaitTime: -2147483648, Tags: ["${1:tag}"]}', }, }; class ConfigService { project; defaultConfig; static ConfigFileNames = Object.freeze(['spyglass.json', '.spyglassrc.json']); #eventEmitter; constructor(project, defaultConfig = VanillaConfig) { this.project = project; this.defaultConfig = defaultConfig; this.#eventEmitter = new project.externals.event.EventEmitter(); const handler = async ({ uri }) => { if (ConfigService.isConfigFile(uri)) { this.emit('changed', { config: await this.load() }); } }; project.on('fileCreated', handler); project.on('fileModified', handler); project.on('fileDeleted', handler); } on(event, callbackFn) { this.#eventEmitter.on(event, callbackFn); return this; } once(event, callbackFn) { this.#eventEmitter.once(event, callbackFn); return this; } emit(event, ...args) { return this.#eventEmitter.emit(event, ...args); } async load() { const overrides = []; for (const projectRoot of this.project.projectRoots) { for (const name of ConfigService.ConfigFileNames) { const uri = projectRoot + name; try { const contents = await this.project.externals.fs.readFile(uri); overrides.push(JSON.parse(bufferToString(contents))); } catch (e) { if (this.project.externals.error.isKind(e, 'ENOENT')) { // File doesn't exist. continue; } this.emit('error', { error: e, uri }); } break; } } return ConfigService.merge(this.defaultConfig, ...overrides); } static isConfigFile(uri) { return ConfigService.ConfigFileNames.some((n) => uri.endsWith(`/${n}`)); } static merge(base, ...overrides) { return overrides.reduce(merge, rfdc()(base)); } } //# sourceMappingURL=Config.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/binder/Binder.js const IsAsync = Symbol('IsAsyncBinder'); var SyncBinder; (function (SyncBinder) { function create(binder) { return binder; } SyncBinder.create = create; function is(binder) { return !binder[IsAsync]; } SyncBinder.is = is; })(SyncBinder || (SyncBinder = {})); var AsyncBinder; (function (AsyncBinder) { function create(binder) { return Object.assign(binder, { [IsAsync]: true }); } AsyncBinder.create = create; function is(binder) { return binder[IsAsync]; } AsyncBinder.is = is; })(AsyncBinder || (AsyncBinder = {})); //# sourceMappingURL=Binder.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/util.js function traversePreOrder(node, shouldContinue, shouldCallFn, fn) { traversePreOrderImpl(node, shouldContinue, shouldCallFn, fn, []); } function traversePreOrderImpl(node, shouldContinue, shouldCallFn, fn, parents) { if (shouldCallFn(node, parents)) { fn(node, parents); } if (!node.children || !shouldContinue(node, parents)) { return; } for (const child of node.children ?? []) { parents.unshift(node); traversePreOrderImpl(child, shouldContinue, shouldCallFn, fn, parents); parents.shift(); } } //# sourceMappingURL=util.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/binder/builtin.js function attempt(binder, node, ctx) { const tempCtx = { ...ctx, err: new ErrorReporter(ctx.err.source), symbols: ctx.symbols.clone(), }; const processAfterBinder = () => { StateProxy.undoChanges(node); const totalErrorSpan = tempCtx.err.errors.map((e) => e.range.end - e.range.start).reduce((a, b) => a + b, 0); return { errorAmount: tempCtx.err.errors.length, totalErrorSpan, updateNodeAndCtx: () => { ctx.err.absorb(tempCtx.err); StateProxy.redoChanges(node); tempCtx.symbols.applyDelayedEdits(); }, }; }; if (SyncBinder.is(binder)) { binder(node, tempCtx); return processAfterBinder(); } else { return (async () => { await binder(node, tempCtx); return processAfterBinder(); })(); } } function any(binders) { if (binders.length === 0) { throw new Error('Expected at least one binder'); } const attemptSorter = (a, b) => a.errorAmount - b.errorAmount || a.totalErrorSpan - b.totalErrorSpan; if (binders.every(SyncBinder.is)) { return SyncBinder.create((node, ctx) => { const attempts = binders.map((binder) => attempt(binder, node, ctx)).sort(attemptSorter); attempts[0].updateNodeAndCtx(); }); } else { return AsyncBinder.create(async (node, ctx) => { const attempts = (await Promise.all(binders.map((binder) => attempt(binder, node, ctx)))) .sort(attemptSorter); attempts[0].updateNodeAndCtx(); }); } } /** * No operation. */ const noop = SyncBinder.create(() => { }); /** * Use the shallowest children that have their own binder to validate. */ const fallback = AsyncBinder.create(async (node, ctx) => { const promises = []; traversePreOrder(node, (node) => !ctx.meta.hasBinder(node.type), (node) => ctx.meta.hasBinder(node.type), (node) => { const binder = ctx.meta.getBinder(node.type); const result = binder(node, ctx); if (result instanceof Promise) { promises.push(result); } }); await Promise.all(promises); }); const fallbackSync = SyncBinder.create((node, ctx) => { traversePreOrder(node, (node) => !ctx.meta.hasBinder(node.type), (node) => ctx.meta.hasBinder(node.type), (node) => { const binder = ctx.meta.getBinder(node.type); if (SyncBinder.is(binder)) { binder(node, ctx); } else { ctx.logger.warn(`[fallbackSync] Trying to run async binder for "${node.type}"`); } }); }); const dispatchSync = SyncBinder.create((node, ctx) => { for (const child of node.children ?? []) { if (ctx.meta.hasBinder(child.type)) { const binder = ctx.meta.getBinder(child.type); binder(child, ctx); } } }); const resourceLocation = SyncBinder.create((node, ctx) => { const raw = ResourceLocationNode.toString(node, 'full'); let sanitizedRaw = ResourceLocation.lengthen(node.options.namespacePathSep === '.' ? raw.replace(/\./g, ResourceLocation.NamespacePathSep) : raw); if (node.options.implicitPath) { const sepIndex = sanitizedRaw.indexOf(ResourceLocation.NamespacePathSep); sanitizedRaw = sanitizedRaw.substring(0, sepIndex + 1) + node.options.implicitPath + sanitizedRaw.substring(sepIndex + 1); } if (node.options.category) { ctx.symbols.query(ctx.doc, node.isTag ? `tag/${node.options.category}` : node.options.category, sanitizedRaw).enter({ usage: { type: node.options.usageType, node, accessType: node.options.accessType }, }); } if (node.options.pool && !node.options.allowUnknown) { if (!node.options.pool.includes(sanitizedRaw)) { ctx.err.report(localize('expected', node.options.pool), node, 3 /* ErrorSeverity.Error */); } return; } }); const symbol = SyncBinder.create((node, ctx) => { if (node.value) { const path = node.options.parentPath ? [...node.options.parentPath, node.value] : [node.value]; ctx.symbols.query(ctx.doc, node.options.category, ...path).enter({ data: { subcategory: node.options.subcategory }, usage: { type: node.options.usageType, node, accessType: node.options.accessType }, }); } }); function registerBinders(meta) { meta.registerBinder('resource_location', resourceLocation); meta.registerBinder('symbol', symbol); } //# sourceMappingURL=builtin.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/binder/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/checker/builtin.js function builtin_attempt(checker, node, ctx) { const tempCtx = { ...ctx, err: new ErrorReporter(ctx.err.source), symbols: ctx.symbols.clone(), }; // FIXME: await checker(node, tempCtx); StateProxy.undoChanges(node); const totalErrorSpan = tempCtx.err.errors.map((e) => e.range.end - e.range.start).reduce((a, b) => a + b, 0); return { errorAmount: tempCtx.err.errors.length, totalErrorSpan, updateNodeAndCtx: () => { ctx.err.absorb(tempCtx.err); StateProxy.redoChanges(node); tempCtx.symbols.applyDelayedEdits(); }, }; } function builtin_any(checkers) { if (checkers.length === 0) { throw new Error('Expected at least one checker'); } return (node, ctx) => { const attempts = checkers.map((checker) => builtin_attempt(checker, node, ctx)).sort((a, b) => a.errorAmount - b.errorAmount || a.totalErrorSpan - b.totalErrorSpan); attempts[0].updateNodeAndCtx(); }; } /** * No operation. */ const builtin_noop = () => { }; /** * Use the shallowest children that have their own checker to validate. */ const builtin_fallback = async (node, ctx) => { const promises = []; traversePreOrder(node, (node) => !ctx.meta.hasChecker(node.type), (node) => ctx.meta.hasChecker(node.type), (node) => { const checker = ctx.meta.getChecker(node.type); const result = checker(node, ctx); if (result instanceof Promise) { promises.push(result); } }); await Promise.all(promises); }; const builtin_fallbackSync = async (node, ctx) => { const promises = []; traversePreOrder(node, (node) => !ctx.meta.hasChecker(node.type), (node) => ctx.meta.hasChecker(node.type), (node) => { const checker = ctx.meta.getChecker(node.type); const result = checker(node, ctx); if (result instanceof Promise) { ctx.logger.warn(`[fallbackSync] Trying to run async checker for "${node.type}"`); } }); await Promise.all(promises); }; const builtin_dispatchSync = (node, ctx) => { for (const child of node.children ?? []) { if (ctx.meta.hasChecker(child.type)) { const checker = ctx.meta.getChecker(child.type); checker(child, ctx); } } }; const builtin_resourceLocation = (node, ctx) => { // const full = ResourceLocationNode.toString(node, 'full') // if (node.options.pool) { // if (!node.options.pool.includes(full)) { // ctx.err.report(localize('expected', node.options.pool), node, ErrorSeverity.Error) // } // return // } }; const builtin_symbol = (_node, _ctx) => { // TODO }; function registerCheckers(meta) { meta.registerChecker('resource_location', builtin_resourceLocation); meta.registerChecker('symbol', builtin_symbol); } //# sourceMappingURL=builtin.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/checker/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/codeActions/builtin.js const codeActions_builtin_fallback = (node, ctx) => { const ans = []; traversePreOrder(node, (node) => Range.containsRange(node.range, ctx.range, true), (node) => ctx.meta.hasCodeActionProvider(node.type), (node) => ans.push(...ctx.meta.getCodeActionProvider(node.type)(node, ctx))); return ans; }; const file = (node, ctx) => { const ans = []; for (const error of FileNode.getErrors(node)) { const action = error.info?.codeAction; if (!action) { continue; } if (!Range.containsRange(error.range, ctx.range, true)) { continue; } ans.push({ ...action, errors: [error], }); } return ans; }; function registerProviders(meta) { meta.registerCodeActionProvider('file', file); } //# sourceMappingURL=builtin.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/codeActions/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/ColorInfoProvider.js var Color; (function (Color) { Color.NamedColors = new Map([ ['aqua', 0x55ffff], ['black', 0x000000], ['blue', 0x5555ff], ['dark_aqua', 0x00aaaa], ['dark_blue', 0x0000aa], ['dark_gray', 0x555555], ['dark_green', 0x00aa00], ['dark_purple', 0xaa00aa], ['dark_red', 0xaa0000], ['gold', 0xffaa00], ['gray', 0xaaaaaa], ['green', 0x55ff55], ['light_purple', 0xff55ff], ['red', 0xff5555], ['white', 0xffffff], ['yellow', 0xffff55], ]); Color.ColorNames = [...Color.NamedColors.keys()]; function fromNamed(value) { const composite = Color.NamedColors.get(value); if (composite === undefined) { return undefined; } return fromCompositeRGB(composite); } Color.fromNamed = fromNamed; /** * @param r A decimal within [0.0, 1.0]. * @param g A decimal within [0.0, 1.0]. * @param b A decimal within [0.0, 1.0]. * @param a A decimal within [0.0, 1.0]. */ function fromDecRGBA(r, g, b, a) { return [r, g, b, a]; } Color.fromDecRGBA = fromDecRGBA; /** * @param r A decimal within [0.0, 1.0]. * @param g A decimal within [0.0, 1.0]. * @param b A decimal within [0.0, 1.0]. */ function fromDecRGB(r, g, b) { return fromDecRGBA(r, g, b, 1.0); } Color.fromDecRGB = fromDecRGB; /** * @param r An integer within [0, 255]. * @param g An integer within [0, 255]. * @param b An integer within [0, 255]. * @param a An integer within [0, 255]. */ function fromIntRGBA(r, g, b, a) { return fromDecRGBA(r / 255, g / 255, b / 255, a / 255); } Color.fromIntRGBA = fromIntRGBA; /** * @param r An integer within [0, 255]. * @param g An integer within [0, 255]. * @param b An integer within [0, 255]. */ function fromIntRGB(r, g, b) { return fromIntRGBA(r, g, b, 255); } Color.fromIntRGB = fromIntRGB; /** * @param value A string in the format `#rrggbb` */ function fromHexRGB(value) { var bigint = parseInt(value.slice(1), 16); var r = (bigint >> 16) & 255; var g = (bigint >> 8) & 255; var b = bigint & 255; return fromIntRGB(r, g, b); } Color.fromHexRGB = fromHexRGB; /** * @param value `R << 16 + G << 8 + B`. */ function fromCompositeRGB(value) { const r = value >> 16 & 0xff; const g = value >> 8 & 0xff; const b = value & 0xff; return fromIntRGB(r, g, b); } Color.fromCompositeRGB = fromCompositeRGB; /** * @param value `A << 24 + R << 16 + G << 8 + B`. */ function fromCompositeARGB(value) { // Cast to signed 32-bit integer value |= 0; const a = (value >>> 24) & 0xff; const r = (value >>> 16) & 0xff; const g = (value >>> 8) & 0xff; const b = value & 0xff; return fromIntRGBA(r, g, b, a); } Color.fromCompositeARGB = fromCompositeARGB; })(Color || (Color = {})); var ColorFormat; (function (ColorFormat) { /** * `1 0.6 0.2 1.0` */ ColorFormat[ColorFormat["DecRGBA"] = 0] = "DecRGBA"; /** * `1 0.6 0.2` */ ColorFormat[ColorFormat["DecRGB"] = 1] = "DecRGB"; /** * `255 153 51 25` */ ColorFormat[ColorFormat["IntRGBA"] = 2] = "IntRGBA"; /** * `255 153 51` */ ColorFormat[ColorFormat["IntRGB"] = 3] = "IntRGB"; /** * `#ff9933ff` */ ColorFormat[ColorFormat["HexRGBA"] = 4] = "HexRGBA"; /** * `#ff9933` */ ColorFormat[ColorFormat["HexRGB"] = 5] = "HexRGB"; /** * `16620441` */ ColorFormat[ColorFormat["CompositeRGB"] = 6] = "CompositeRGB"; /** * `4294945365` */ ColorFormat[ColorFormat["CompositeARGB"] = 7] = "CompositeARGB"; })(ColorFormat || (ColorFormat = {})); var ColorPresentation; (function (ColorPresentation) { function fromColorFormat(format, color, range) { const presentation = colorPresentation(format, color); return { label: presentation, text: presentation, range }; } ColorPresentation.fromColorFormat = fromColorFormat; function colorPresentation(format, color) { const round = (num) => parseFloat(num.toFixed(3)); switch (format) { case ColorFormat.DecRGBA: return color.map((c) => round(c)).join(' '); case ColorFormat.DecRGB: return color.slice(0, 3).map((c) => round(c)).join(' '); case ColorFormat.IntRGBA: return color.map((c) => Math.round(c * 255)).join(' '); case ColorFormat.IntRGB: return color.slice(0, 3).map((c) => Math.round(c * 255)).join(' '); case ColorFormat.HexRGBA: return `#${Math.round((((color[0] * 255) << 24) + ((color[1] * 255) << 16) + color[2] * 255) << (8 + color[3] * 255)).toString(16).padStart(8, '0')}`; case ColorFormat.HexRGB: return `#${Math.round(((color[0] * 255) << 16) + ((color[1] * 255) << 8) + color[2] * 255) .toString(16).padStart(6, '0')}`; case ColorFormat.CompositeRGB: return `${Math.round(((color[0] * 255) << 16) + ((color[1] * 255) << 8) + color[2] * 255)}`; case ColorFormat.CompositeARGB: return `${Number((BigInt(Math.round(color[3] * 255)) << 24n) + (BigInt(Math.round(color[0] * 255)) << 16n) + (BigInt(Math.round(color[1] * 255)) << 8n) + BigInt(Math.round(color[2] * 255))) << 0 // Convert to signed 32-bit integer }`; } } })(ColorPresentation || (ColorPresentation = {})); //# sourceMappingURL=ColorInfoProvider.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/colorizer/Colorizer.js var ColorToken; (function (ColorToken) { /* istanbul ignore next */ function create(range, type, modifiers) { return { range: Range.get(range), type, modifiers }; } ColorToken.create = create; /** * @returns An array of color tokens that cover the whole range of `targetRange`, with gaps in `tokens` filled * with tokens created from the specified `type` and `modifiers`. */ function fillGap(tokens, targetRange, type, modifiers) { const ans = []; let nextStart = Math.min(targetRange.start, tokens[0]?.range.start ?? Infinity); for (const t of tokens) { if (t.range.start > nextStart) { ans.push(ColorToken.create(Range.create(nextStart, t.range.start), type, modifiers)); } ans.push(t); nextStart = t.range.end; } if (nextStart < targetRange.end) { ans.push(ColorToken.create(Range.create(nextStart, targetRange.end), type, modifiers)); } return ans; } ColorToken.fillGap = fillGap; })(ColorToken || (ColorToken = {})); // Built-in LSP semantic tokens: https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#textDocument_semanticTokens /* * Hint: during development, the `Developer: Inspect Editor Tokens and Scopes` command in VS Code helps a lot with deciding on the color for nodes. */ const ColorTokenTypes = Object.freeze([ 'comment', 'enum', 'enumMember', 'escape', 'function', 'keyword', 'modifier', 'number', 'property', 'string', 'struct', 'type', 'variable', // Below are custom types. 'error', 'literal', 'operator', 'resourceLocation', 'vector', ]); const ColorTokenModifiers = Object.freeze([ 'declaration', 'defaultLibrary', 'definition', 'deprecated', 'documentation', 'modification', 'readonly', // Below are custom modifiers. ]); //# sourceMappingURL=Colorizer.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/colorizer/builtin.js /** * Use the shallowest children that have their own colorizers to provide the color tokens. */ const colorizer_builtin_fallback = (node, ctx) => { const ans = []; traversePreOrder(node, (node) => !ctx.meta.hasColorizer(node.type) && (!ctx.range || Range.intersects(node.range, ctx.range)), (node) => ctx.meta.hasColorizer(node.type), (node) => { const colorizer = ctx.meta.getColorizer(node.type); const result = colorizer(node, ctx); ans.push(...result); }); return Object.freeze(ans); }; const builtin_boolean = (node) => { return [ColorToken.create(node, 'literal')]; }; const comment = (node) => { return [ColorToken.create(node, 'comment')]; }; const error = (node) => { // return [ColorToken.create(node, 'error')] return []; }; const builtin_literal = (node) => { return [ColorToken.create(node, node.options.colorTokenType ?? 'literal')]; }; const number = (node) => { return [ColorToken.create(node, 'number')]; }; const colorizer_builtin_resourceLocation = (node, _ctx) => { let type; switch (node.options.category) { case 'function': case 'tag/function': type = 'function'; break; default: type = 'resourceLocation'; break; } return [ColorToken.create(node, type)]; }; const string = (node, ctx) => { if (node.children) { const colorizer = ctx.meta.getColorizer(node.children[0].type); const result = colorizer(node.children[0], ctx); // TODO: Fill the gap between the last token and the ending quote with errors. return ColorToken.fillGap(result, node.range, node.options.colorTokenType ?? 'string'); } else { return [ColorToken.create(node, node.options.colorTokenType ?? 'string')]; } }; const colorizer_builtin_symbol = (node) => { // TODO: Set the modifiers according to `node.symbol`. return [ColorToken.create(node, 'variable')]; }; function registerColorizers(meta) { meta.registerColorizer('boolean', builtin_boolean); meta.registerColorizer('comment', comment); meta.registerColorizer('error', error); meta.registerColorizer('float', number); meta.registerColorizer('integer', number); meta.registerColorizer('long', number); meta.registerColorizer('literal', builtin_literal); meta.registerColorizer('resource_location', colorizer_builtin_resourceLocation); meta.registerColorizer('string', string); meta.registerColorizer('symbol', colorizer_builtin_symbol); } //# sourceMappingURL=builtin.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/colorizer/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/completer/Completer.js var CompletionItem; (function (CompletionItem) { /* istanbul ignore next */ /** * If no `insertText` is provided in `other`, the value of `label` will be escaped for TextMate purposes * (@see {@link escape}) and used as the insert text. * * @example * create('foo', range) // insertText = 'foo' * create('\\ $ }', range) // insertText = '\\\\ \\$ \\}' * create('foo', range, { insertText: '\\ $ }' }) // insertText = '\\ $ }' */ function create(label, range, other) { const shouldEscape = other?.insertText === undefined && needsEscape(label); return { ...other, label, range: Range.get(range), ...(shouldEscape ? { insertText: escape(label) } : {}), }; } CompletionItem.create = create; /** * Returns if `textToInsert` contains any characters that need to be escaped for TextMate (`$`, `\`, or `}`) */ function needsEscape(textToInsert) { return /[\\$}]/.test(textToInsert); } CompletionItem.needsEscape = needsEscape; /** * Escape `$`, `\`, and `}` in `textToInsert` */ function escape(textToInsert) { return textToInsert.replace(/([\\$}])/g, '\\$1'); } CompletionItem.escape = escape; /** * Un-escape `$`, `\`, and `}` in `textToInsert` */ function unescape(textToInsert) { return textToInsert.replace(/\\([\\$}])/g, '$1'); } CompletionItem.unescape = unescape; })(CompletionItem || (CompletionItem = {})); class InsertTextBuilder { #ans = ''; #nextPlaceholder = 1; literal(str) { this.#ans += CompletionItem.escape(str); return this; } placeholder(...defaultValues) { if (defaultValues.length === 0) { this.#ans += `$\{${this.#nextPlaceholder}}`; } else if (defaultValues.length === 1) { this.#ans += `$\{${this.#nextPlaceholder}:${CompletionItem.escape(defaultValues[0])}}`; } else { this.#ans += `$\{${this.#nextPlaceholder}|${defaultValues.map((v) => v.replace(/([\\$},|])/g, '\\$1')).join(',')}|}`; } this.#nextPlaceholder += 1; return this; } exitPlace() { this.#ans += '$0'; return this; } build() { return this.#ans; } if(condition, callback) { if (condition) { callback(this); } return this; } } //# sourceMappingURL=Completer.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/completer/builtin.js /** * Uses the shallowest selected node that has its own completer to provide the completion items. */ const dispatch = (node, ctx) => { const child = AstNode.findShallowestChild({ node: node, needle: ctx.offset, endInclusive: true, predicate: (n) => ctx.meta.hasCompleter(n.type), }); return child ? ctx.meta.getCompleter(child.type)(child, ctx) : []; }; const completer_builtin_fallback = dispatch; const completer_builtin_boolean = (node, ctx) => { return [ CompletionItem.create('false', node, { kind: 21 /* CompletionKind.Constant */ }), CompletionItem.create('true', node, { kind: 21 /* CompletionKind.Constant */ }), ]; }; /** * Dispatches to the corresponding file for the language. */ const builtin_file = (node, ctx) => { const completer = ctx.meta.getCompleterForLanguageID(ctx.doc.languageId); return completer(node.children[0], ctx); }; const completer_builtin_literal = (node) => { const kind = new Map([ ['enum', 13 /* CompletionKind.Enum */], ['enumMember', 20 /* CompletionKind.EnumMember */], ['function', 3 /* CompletionKind.Function */], ['keyword', 14 /* CompletionKind.Keyword */], ['literal', 14 /* CompletionKind.Keyword */], ['number', 21 /* CompletionKind.Constant */], ['operator', 24 /* CompletionKind.Operator */], ['property', 10 /* CompletionKind.Property */], ['resourceLocation', 17 /* CompletionKind.File */], ['variable', 6 /* CompletionKind.Variable */], ]).get(node.options.colorTokenType ?? 'keyword') ?? 14 /* CompletionKind.Keyword */; return (node.options.pool.map((v) => CompletionItem.create(v, node, { kind })) ?? []); }; const completer_builtin_noop = () => []; const prefixed = (node, ctx) => { const child = node.children.find(c => c.type !== 'literal'); if (!child) { return [CompletionItem.create('!', node)]; } const childItems = dispatch(child, ctx); return childItems.map(item => ({ ...item, label: node.prefix + item.label, filterText: node.prefix + (item.filterText ?? item.label), insertText: node.prefix + (item.insertText ?? item.label), })); }; function record(o) { return (node, ctx) => { if (!node.innerRange || !Range.contains(node.innerRange, ctx.offset, true)) { return []; } const completeKeys = (pair) => o.key(node, pair, ctx, pair?.key ?? ctx.offset, false, false, existingKeys); const completePairs = (pair) => o.key(node, pair, ctx, pair ?? ctx.offset, true, hasNextPair || !!pair?.end, existingKeys); const existingKeys = node.children.filter((n) => !!n.key).map((n) => n.key); const index = binary_search(node.children, ctx.offset, (n, o) => n.end ? Range.compareOffset(Range.translate(n, 0, -1), o, true) : Range.compareOffset(n.range, o, true)); const pair = index >= 0 ? node.children[index] : undefined; const hasNextPair = !!node.children.find((n) => n.range.start > ctx.offset); if (!pair) { return completePairs(undefined); } const { key, sep, value } = pair; if (!key && !sep && !value) { return completePairs(undefined); } if ((key && Range.contains(key, ctx.offset, true)) || (sep && ctx.offset <= sep.start)) { // Selected key. if (!value || Range.isEmpty(value.range)) { return completePairs(pair); } return completeKeys(pair); } if (value && ctx.offset < value.range.start) { return o.value(node, pair, ctx, ctx.offset); } if ((value && Range.contains(value, ctx.offset, true)) || (sep && ctx.offset >= sep.end) || (key && ctx.offset > key.range.end)) { // Selected value. return o.value(node, pair, ctx, value ?? ctx.offset); } return []; }; } const completer_builtin_resourceLocation = (node, ctx) => { const config = LinterConfigValue.destruct(ctx.config.lint.idOmitDefaultNamespace); const includeEmptyNamespace = !node.options.requireCanonical && node.namespace === ''; const includeDefaultNamespace = node.options.requireCanonical || config?.ruleValue !== true; const excludeDefaultNamespace = !node.options.requireCanonical && config?.ruleValue !== false; const getPool = (category) => { const symbols = ctx.symbols.getVisibleSymbols(category, ctx.doc.uri); const declarations = Object.entries(symbols).flatMap(([key, symbol]) => SymbolUtil.isDeclared(symbol) ? [key] : []); return optimizePool(declarations); }; const optimizePool = (pool) => { const defaultNsPrefix = ResourceLocation.DefaultNamespace + ResourceLocation.NamespacePathSep; const defaultNsIds = []; const otherIds = []; for (const id of filterPool(pool)) { if (id.startsWith(defaultNsPrefix)) { defaultNsIds.push(id); } else { otherIds.push(id); } } const ans = [ ...otherIds, ...(includeDefaultNamespace ? defaultNsIds : []), ...(excludeDefaultNamespace ? defaultNsIds.map((id) => id.slice(defaultNsPrefix.length)) : []), ...(includeEmptyNamespace ? defaultNsIds.map((id) => id.slice(ResourceLocation.DefaultNamespace.length)) : []), ]; if (node.options.namespacePathSep === '.') { return ans.map((v) => v.replace(ResourceLocation.NamespacePathSep, '.')); } return ans; }; const filterPool = (pool) => { if (!node.options.implicitPath) { return pool; } const ans = []; for (const id of pool) { const sep = id.indexOf(ResourceLocation.NamespacePathSep); const path = id.slice(sep + 1); if (path.startsWith(node.options.implicitPath)) { ans.push(id.slice(0, sep + 1) + path.slice(node.options.implicitPath.length)); } } return ans; }; const pool = node.options.pool ? optimizePool(node.options.pool) : [ ...(!node.options.requireTag ? getPool(node.options.category) : []), ...(node.options.allowTag ? getPool(`tag/${node.options.category}`).map((v) => `${ResourceLocation.TagPrefix}${v}`) : []), ]; const items = pool.map((v) => CompletionItem.create(v, node, { kind: 3 /* CompletionKind.Function */ })); if (node.options.category) { const symbols = ctx.symbols.getVisibleSymbols(node.options.category, ctx.doc.uri); const thisKey = Object.entries(symbols).flatMap(([key, symbol]) => { if ((symbol.declaration?.[0] ?? symbol.definition?.[0])?.uri === ctx.doc.uri) { return [key]; } return []; }); if (thisKey.length > 0) { items.push(CompletionItem.create('THIS', node, { kind: 15 /* CompletionKind.Snippet */, insertText: thisKey[0], detail: thisKey[0], })); } } return items; }; const builtin_string = (node, ctx) => { if (node.children?.length) { return dispatch(node.children[0], ctx).map(item => ({ ...item, filterText: escapeString(item.filterText ?? item.label, node.quote), insertText: escapeString(item.insertText ?? item.label, node.quote), })); } if (node.options.quotes && node.value === '') { return node.options.quotes.map((q) => CompletionItem.create(`${q}${q}`, node, { insertText: `${q}$1${q}`, kind: 12 /* CompletionKind.Value */, })); } return []; }; function escapeString(value, quote) { if (!quote) { return value; } // Un-escape and then re-escape completion value = CompletionItem.unescape(value); value = value.replaceAll('\\', '\\\\').replaceAll(quote, '\\"'); return CompletionItem.escape(value); } const completer_builtin_symbol = (node, ctx) => { const path = node.options.parentPath ?? []; const symbols = ctx.symbols.query(ctx.doc, node.options.category, ...path).visibleMembers; return Object.entries(symbols) .filter(([k, v]) => SymbolUtil.isDeclared(v)) .map(([k, v]) => CompletionItem.create(k, node, { kind: 6 /* CompletionKind.Variable */ })); }; function registerCompleters(meta) { meta.registerCompleter('boolean', completer_builtin_boolean); meta.registerCompleter('comment', completer_builtin_noop); meta.registerCompleter('float', completer_builtin_noop); meta.registerCompleter('integer', completer_builtin_noop); meta.registerCompleter('long', completer_builtin_noop); meta.registerCompleter('literal', completer_builtin_literal); meta.registerCompleter('prefixed', prefixed); meta.registerCompleter('resource_location', completer_builtin_resourceLocation); meta.registerCompleter('string', builtin_string); meta.registerCompleter('symbol', completer_builtin_symbol); } //# sourceMappingURL=builtin.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/completer/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/formatter/builtin.js const formatter_builtin_fallback = (node) => { throw new Error(`No formatter registered for type ${node.type}`); }; const builtin_error = (node) => { return ''; }; const formatter_builtin_file = (node, ctx) => { return node.children.map((child) => { return ctx.meta.getFormatter(child.type)(child, ctx); }).join(''); }; const formatter_builtin_boolean = (node) => { return node.value ? 'true' : 'false'; }; const builtin_comment = (node) => { return node.prefix + node.comment; }; const builtin_float = (node) => { return node.value.toString(); }; const integer = (node) => { return node.value.toFixed(); }; const formatter_builtin_literal = (node) => { return node.value; }; const builtin_long = (node) => { return node.value.toString(); }; const formatter_builtin_resourceLocation = (node) => { return ResourceLocationNode.toString(node, 'origin', true); }; const formatter_builtin_string = (node) => { // FIXME: escape this value according to the node's IndexMap and context return `"${node.value}"`; }; function registerFormatters(meta) { meta.registerFormatter('error', builtin_error); meta.registerFormatter('file', formatter_builtin_file); meta.registerFormatter('boolean', formatter_builtin_boolean); meta.registerFormatter('comment', builtin_comment); meta.registerFormatter('float', builtin_float); meta.registerFormatter('integer', integer); meta.registerFormatter('long', builtin_long); meta.registerFormatter('literal', formatter_builtin_literal); meta.registerFormatter('resource_location', formatter_builtin_resourceLocation); meta.registerFormatter('string', formatter_builtin_string); } //# sourceMappingURL=builtin.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/formatter/Formatter.js function formatterContextIndentation(ctx, additionalLevels = 0) { const total = ctx.indentLevel + additionalLevels; return ctx.insertSpaces ? ' '.repeat(total * ctx.tabSize) : '\t'.repeat(total); } function indentFormatter(ctx, additionalLevels = 1) { return { ...ctx, indentLevel: ctx.indentLevel + additionalLevels, indent(additionalLevels) { return formatterContextIndentation(this, additionalLevels); }, }; } //# sourceMappingURL=Formatter.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/formatter/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/linter/builtin/undeclaredSymbol.js const undeclaredSymbol = (node, ctx) => { if (!node.symbol || SymbolUtil.isDeclared(node.symbol)) { return; } const action = getAction(ctx.ruleValue, node.symbol, ctx); if (SymbolLinterConfig.Action.isDeclare(action)) { ctx.symbols.query({ doc: ctx.doc, node }, node.symbol.category, ...node.symbol.path).amend({ data: { visibility: getVisibility(action.declare) }, usage: { type: 'declaration', node }, }); } if (SymbolLinterConfig.Action.isReport(action)) { const info = {}; const uriBuilder = ctx.meta.getUriBuilder(node.symbol.category); if (uriBuilder) { const uri = uriBuilder(node.symbol.identifier, ctx); if (uri) { info.codeAction = { title: localize('code-action.create-undeclared-file', node.symbol.category, localeQuote(node.symbol.identifier)), changes: [{ type: 'create', uri }], }; } } const severityOverride = action.report === 'inherit' ? undefined : LinterSeverity.toErrorSeverity(action.report); ctx.err.lint(localize('linter.undeclared-symbol.message', node.symbol.category, localeQuote(node.symbol.identifier)), node, info, severityOverride); } }; function getAction(config, symbol, ctx) { if (SymbolLinterConfig.Action.is(config)) { return config; } function test(conditions) { function testSingleCondition(condition) { const resourceLocation = ResourceLocation.lengthen(symbol.identifier); const namespace = resourceLocation.slice(0, resourceLocation.indexOf(ResourceLocation.NamespacePathSep)); return ((condition.category ? Arrayable.toArray(condition.category).includes(symbol.category) : true) && (condition.namespace ? Arrayable.toArray(condition.namespace).includes(namespace) : true) && (condition.excludeNamespace ? !Arrayable.toArray(condition.excludeNamespace).includes(namespace) : true) && (condition.pattern ? Arrayable.toArray(condition.pattern).some((p) => new RegExp(p).test(symbol.identifier)) : true) && (condition.excludePattern ? !Arrayable.toArray(condition.excludePattern).some((p) => new RegExp(p).test(symbol.identifier)) : true)); } try { return Arrayable.toArray(conditions).some(testSingleCondition); } catch (e) { // Illegal RegExp. ctx.logger.error('[undeclaredSymbol#getAction] Likely encountered an illegal regular expression in the config', e); return false; } } function evaluateComplexes(complexes) { for (const complex of Arrayable.toArray(complexes)) { if (complex.if && !test(complex.if)) { continue; } return complex.override ? evaluateComplexes(complex.override) ?? complex.then : complex.then; } return undefined; } return evaluateComplexes(config); } function getVisibility(input) { switch (input) { case 'block': return 0 /* SymbolVisibility.Block */; case 'file': return 1 /* SymbolVisibility.File */; case 'public': return 2 /* SymbolVisibility.Public */; } } //# sourceMappingURL=undeclaredSymbol.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/linter/builtin.js const linter_builtin_noop = () => { }; /** * @param key The name of the key on the {@link AstNode} that contains the value to be validated. */ function nameConvention(key) { return (node, ctx) => { if (typeof node[key] !== 'string') { throw new Error(`Trying to access property "${key}" of node type "${node.type}"`); } const name = node[key]; try { // SECURITY: ReDoS attack. The risk is acceptable at the moment. const regex = new RegExp(ctx.ruleValue); if (!name.match(regex)) { ctx.err.lint(localize('linter.name-convention.illegal', localeQuote(name), localeQuote(ctx.ruleValue)), node); } } catch (e) { ctx.logger.error(`[nameConvention linter] The value “${ctx.ruleValue}” set for rule “${ctx.ruleName}” is not a valid regular expression.`, e); } }; } const quote = (node, ctx) => { const config = ctx.ruleValue; const mustValueBeQuoted = node.options.unquotable ? [...node.value].some((c) => !isAllowedCharacter(c, node.options.unquotable)) : true; const isQuoteRequired = config.always || mustValueBeQuoted; const isQuoteProhibited = config.always === false && !mustValueBeQuoted; const firstChar = ctx.src.slice(node.range.start, node.range.start + 1); const isFirstCharQuote = !!node.options.quotes?.includes(firstChar); if (isQuoteRequired) { if (isFirstCharQuote) { // TODO: Check type config.avoidEscape; config.type; } else { // TODO: Error quote expected } } else if (isQuoteProhibited && isFirstCharQuote) { // TODO: Error no quote expected } }; var configValidator; (function (configValidator) { function getDocLink(name) { return `https://spyglassmc.com/user/lint/${name}`; } function wrapError(name, msg) { return `[Invalid Linter Config] [${name}] ${localize('linter-config-validator.wrapper', msg, getDocLink(name))}`; } function nameConvention(name, val, logger) { if (typeof val !== 'string') { logger.error(wrapError(name, localize('linter-config-validator.name-convention.type'))); return false; } try { // SECURITY: ReDoS attack. The risk is acceptable at the moment. new RegExp(val); } catch (e) { logger.error(wrapError(name, localize('')), e); return false; } return true; } configValidator.nameConvention = nameConvention; function symbolLinterConfig(_name, value, _logger) { return SymbolLinterConfig.is(value); } configValidator.symbolLinterConfig = symbolLinterConfig; })(configValidator || (configValidator = {})); function registerLinters(meta) { meta.registerLinter('nameOfObjective', { configValidator: configValidator.nameConvention, linter: nameConvention('value'), nodePredicate: (n) => n.symbol && n.symbol.category === 'objective', }); meta.registerLinter('nameOfScoreHolder', { configValidator: configValidator.nameConvention, linter: nameConvention('value'), nodePredicate: (n) => n.symbol && n.symbol.category === 'score_holder', }); meta.registerLinter('nameOfTag', { configValidator: configValidator.nameConvention, linter: nameConvention('value'), nodePredicate: (n) => n.symbol && n.symbol.category === 'tag', }); meta.registerLinter('nameOfTeam', { configValidator: configValidator.nameConvention, linter: nameConvention('value'), nodePredicate: (n) => n.symbol && n.symbol.category === 'team', }); meta.registerLinter('undeclaredSymbol', { configValidator: configValidator.symbolLinterConfig, linter: undeclaredSymbol, nodePredicate: (n) => n.symbol && !McdocCategories.includes(n.symbol.category), }); } //# sourceMappingURL=builtin.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/linter/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/ErrorReporter.js class ErrorReporter { source; errors = []; constructor(source) { this.source = source; } /** * Reports a new error. */ report(message, range, severity = 3 /* ErrorSeverity.Error */, info) { if (message.trim() === '') { throw new Error('Tried to report an error with no message'); } this.errors.push(LanguageError.create(message, Range.get(range), severity, info, this.source)); } /** * @returns All reported errors, and then clears the error stack. */ dump() { const ans = Object.freeze(this.errors); this.errors = []; return ans; } /** * Adds all errors from another reporter's error stack to the current reporter. * This method does not affect the passed-in reporter. */ absorb(reporter) { this.errors.push(...reporter.errors); } } class LinterErrorReporter extends ErrorReporter { ruleName; ruleSeverity; constructor(ruleName, ruleSeverity, source) { super(source); this.ruleName = ruleName; this.ruleSeverity = ruleSeverity; } lint(message, range, info, severityOverride) { return this.report(localize('linter.diagnostic-message-wrapper', message, this.ruleName), range, severityOverride ?? this.ruleSeverity, info); } static fromErrorReporter(reporter, ruleName, ruleSeverity) { const ans = new LinterErrorReporter(ruleName, ruleSeverity, reporter.source); ans.errors = reporter.errors; return ans; } } //# sourceMappingURL=ErrorReporter.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/Context.js /* istanbul ignore file */ var ContextBase; (function (ContextBase) { function create(project) { return { fs: project.fs, isDebugging: project.isDebugging, logger: project.logger, meta: project.meta, profilers: project.profilers, roots: project.roots, project: project.ctx, }; } ContextBase.create = create; })(ContextBase || (ContextBase = {})); var ParserContext; (function (ParserContext) { function create(project, opts) { return { ...ContextBase.create(project), config: project.config, doc: opts.doc, err: opts.err ?? new ErrorReporter(project.ctx['errorSource']), }; } ParserContext.create = create; })(ParserContext || (ParserContext = {})); var ProcessorContext; (function (ProcessorContext) { function create(project, opts) { return { ...ContextBase.create(project), config: project.config, doc: opts.doc, src: opts.src ?? new ReadonlySource(opts.doc.getText()), symbols: project.symbols, }; } ProcessorContext.create = create; })(ProcessorContext || (ProcessorContext = {})); var ProcessorWithRangeContext; (function (ProcessorWithRangeContext) { function create(project, opts) { return { ...ProcessorContext.create(project, opts), range: opts.range }; } ProcessorWithRangeContext.create = create; })(ProcessorWithRangeContext || (ProcessorWithRangeContext = {})); var ProcessorWithOffsetContext; (function (ProcessorWithOffsetContext) { function create(project, opts) { return { ...ProcessorContext.create(project, opts), offset: opts.offset }; } ProcessorWithOffsetContext.create = create; })(ProcessorWithOffsetContext || (ProcessorWithOffsetContext = {})); var BinderContext; (function (BinderContext) { function create(project, opts) { return { ...ProcessorContext.create(project, opts), err: opts.err ?? new ErrorReporter(project.ctx['errorSource']), ensureBindingStarted: project.ensureBindingStarted?.bind(project), }; } BinderContext.create = create; })(BinderContext || (BinderContext = {})); var CheckerContext; (function (CheckerContext) { function create(project, opts) { return { ...ProcessorContext.create(project, opts), err: opts.err ?? new ErrorReporter(project.ctx['errorSource']), ensureBindingStarted: project.ensureBindingStarted?.bind(project), }; } CheckerContext.create = create; })(CheckerContext || (CheckerContext = {})); var LinterContext; (function (LinterContext) { function create(project, opts) { return { ...ProcessorContext.create(project, opts), err: opts.err, ruleName: opts.ruleName, ruleValue: opts.ruleValue, }; } LinterContext.create = create; })(LinterContext || (LinterContext = {})); var FormatterContext; (function (FormatterContext) { function create(project, opts) { return { ...ProcessorContext.create(project, opts), ...opts, indentLevel: 0, indent(additionalLevels) { return formatterContextIndentation(this, additionalLevels); }, }; } FormatterContext.create = create; })(FormatterContext || (FormatterContext = {})); var CodeActionProviderContext; (function (CodeActionProviderContext) { function create(project, opts) { return { ...ProcessorContext.create(project, opts), range: opts.range }; } CodeActionProviderContext.create = create; })(CodeActionProviderContext || (CodeActionProviderContext = {})); var ColorizerContext; (function (ColorizerContext) { function create(project, opts) { return ProcessorWithRangeContext.create(project, opts); } ColorizerContext.create = create; })(ColorizerContext || (ColorizerContext = {})); var CompleterContext; (function (CompleterContext) { function create(project, opts) { return { ...ProcessorContext.create(project, opts), offset: opts.offset, triggerCharacter: opts.triggerCharacter, }; } CompleterContext.create = create; })(CompleterContext || (CompleterContext = {})); var SignatureHelpProviderContext; (function (SignatureHelpProviderContext) { function create(project, opts) { return ProcessorWithOffsetContext.create(project, opts); } SignatureHelpProviderContext.create = create; })(SignatureHelpProviderContext || (SignatureHelpProviderContext = {})); var UriBinderContext; (function (UriBinderContext) { function create(project) { return { ...ContextBase.create(project), config: project.config, symbols: project.symbols }; } UriBinderContext.create = create; })(UriBinderContext || (UriBinderContext = {})); var UriPredicateContext; (function (UriPredicateContext) { function create(project) { return { ...ContextBase.create(project) }; } UriPredicateContext.create = create; })(UriPredicateContext || (UriPredicateContext = {})); //# sourceMappingURL=Context.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/Dependency.js var DependencyKey; (function (DependencyKey) { function is(value) { return value.startsWith('@'); } DependencyKey.is = is; })(DependencyKey || (DependencyKey = {})); //# sourceMappingURL=Dependency.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/Downloader.js class Downloader { cacheRoot; externals; logger; #memoryCache = new Map(); constructor(cacheRoot, externals, logger) { this.cacheRoot = cacheRoot; this.externals = externals; this.logger = logger; } async download(job, out = {}) { const { id, cache, uri, options, transformer, ttl } = job; if (ttl && this.#memoryCache.has(uri)) { const memoryCacheEntry = this.#memoryCache.get(uri); const { buffer, time, cacheUri, checksum } = memoryCacheEntry; if (performance.now() <= time + ttl) { this.logger.info(`[Downloader] [${id}] Skipped thanks to valid cache in memory`); out.cacheUri = cacheUri; out.checksum = checksum; return await transformer(buffer); } else { this.#memoryCache.delete(uri); } } let checksum; let cacheUri; let cacheChecksumUri; if (cache) { const { checksumJob, checksumExtension } = cache; out.cacheUri = cacheUri = new Uri(`downloader/${id}`, this.cacheRoot).toString(); cacheChecksumUri = new Uri(`downloader/${id}${checksumExtension}`, this.cacheRoot) .toString(); try { out.checksum = checksum = await this.download({ ...checksumJob, id: id + checksumExtension, }); try { const cacheChecksum = bufferToString(await fileUtil.readFile(this.externals, cacheChecksumUri)).slice(0, -1); // Remove ending newline if (checksum === cacheChecksum) { try { const cachedBuffer = await fileUtil.readFile(this.externals, cacheUri); if (ttl) { this.#memoryCache.set(uri, { buffer: cachedBuffer, cacheUri, checksum, time: performance.now(), }); } const deserializer = cache.deserializer ?? ((b) => b); const ans = await transformer(deserializer(cachedBuffer)); this.logger.info(`[Downloader] [${id}] Skipped downloading thanks to cache ${cacheChecksum} (${cachedBuffer.length} bytes)`); return ans; } catch (e) { this.logger.error(`[Downloader] [${id}] Loading cached file ${cacheUri}`, e); if (this.externals.error.isKind(e, 'ENOENT')) { // Cache checksum exists, but cached file doesn't. // Remove the invalid cache checksum. try { await this.externals.fs.unlink(cacheChecksumUri); } catch (e) { this.logger.error(`[Downloader] [${id}] Removing invalid cache checksum ${cacheChecksumUri}`, e); } } } } } catch (e) { if (!this.externals.error.isKind(e, 'ENOENT')) { this.logger.error(`[Downloader] [${id}] Loading cache checksum ${cacheChecksumUri}`, e); } } } catch (e) { this.logger.error(`[Downloader] [${id}] Fetching latest checksum ${checksumJob.uri}`, e); } } try { const buffer = await this.externals.downloader.get(uri, options); if (ttl) { this.#memoryCache.set(uri, { buffer, time: performance.now() }); } if (cache && cacheUri && cacheChecksumUri) { if (checksum) { try { await fileUtil.writeFile(this.externals, cacheChecksumUri, `${checksum}\n`); } catch (e) { this.logger.error(`[Downloader] [${id}] Saving cache checksum ${cacheChecksumUri}`, e); } } try { const serializer = cache.serializer ?? ((b) => b); await fileUtil.writeFile(this.externals, cacheUri, serializer(buffer)); } catch (e) { this.logger.error(`[Downloader] [${id}] Caching file ${cacheUri}`, e); } } this.logger.info(`[Downloader] [${id}] Downloaded from ${uri} (${buffer.length} bytes)`); return await transformer(buffer); } catch (e) { this.logger.error(`[Downloader] [${id}] Downloading ${uri}`, e); if (cache && cacheUri) { try { const cachedBuffer = await fileUtil.readFile(this.externals, cacheUri); const deserializer = cache.deserializer ?? ((b) => b); const ans = await transformer(deserializer(cachedBuffer)); this.logger.warn(`[Downloader] [${id}] Fell back to cached file ${cacheUri} (${cachedBuffer.length} bytes)`); return ans; } catch (e) { this.logger.error(`[Downloader] [${id}] Fallback: loading cached file ${cacheUri}`, e); } } } return undefined; } } //# sourceMappingURL=Downloader.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/Hover.js var Hover; (function (Hover) { /* istanbul ignore next */ function create(range, markdown) { return { range: Range.get(range), markdown }; } Hover.create = create; })(Hover || (Hover = {})); //# sourceMappingURL=Hover.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/MetaRegistry.js /* istanbul ignore next */ /** * The meta registry of Spyglass. You can register new parsers, processors, and languages here. */ class MetaRegistry { /** * A map from language IDs to language options. */ #languages = new Map(); #binders = new Map(); #checkers = new Map(); #colorizers = new Map(); #codeActionProviders = new Map(); #completers = new Map(); #dependencyProviders = new Map(); #formatters = new Map(); #inlayHintProviders = new Set(); #linters = new Map(); #parsers = new Map(); #signatureHelpProviders = new Set(); #symbolRegistrars = new Map(); #custom = new Map(); #uriBinders = new Set(); #uriBuilders = new Map(); #uriSorter = () => 0; constructor() { registerBinders(this); registerCheckers(this); registerProviders(this); registerColorizers(this); registerCompleters(this); registerFormatters(this); registerLinters(this); } /** * Registers a new language. * @param languageID The language ID. e.g. `"mcfunction"` * @param options The language options for this language. */ registerLanguage(languageID, options) { this.#languages.set(languageID, options); } /** * An array of all registered language IDs. */ getLanguages() { return Array.from(this.#languages.keys()); } getLanguageOptions(language) { return this.#languages.get(language); } /** * An array of characters that trigger a completion request. */ getTriggerCharacters() { return Array.from(this.#languages.values()).flatMap((v) => v.triggerCharacters ?? []); } /** * @param fileExtension The file extension including the leading dot. e.g. `".mcfunction"`. * @returns The language ID registered for the file extension, or `undefined`. */ getLanguageID(fileExtension) { for (const [languageID, { extensions }] of this.#languages) { if (extensions.includes(fileExtension)) { return languageID; } } return undefined; } hasBinder(type) { return this.#binders.has(type); } getBinder(type) { return this.#binders.get(type) ?? fallback; } registerBinder(type, binder) { this.#binders.set(type, binder); } hasChecker(type) { return this.#checkers.has(type); } getChecker(type) { return this.#checkers.get(type) ?? builtin_fallback; } registerChecker(type, checker) { this.#checkers.set(type, checker); } hasCodeActionProvider(type) { return this.#codeActionProviders.has(type); } getCodeActionProvider(type) { return this.#codeActionProviders.get(type) ?? codeActions_builtin_fallback; } registerCodeActionProvider(type, codeActionProvider) { this.#codeActionProviders.set(type, codeActionProvider); } hasColorizer(type) { return this.#colorizers.has(type); } getColorizer(type) { return this.#colorizers.get(type) ?? colorizer_builtin_fallback; } registerColorizer(type, colorizer) { this.#colorizers.set(type, colorizer); } hasCompleter(type) { return this.#completers.has(type); } getCompleter(type) { return this.#completers.get(type) ?? completer_builtin_fallback; } registerCompleter(type, completer) { this.#completers.set(type, completer); } shouldComplete(languageID, triggerCharacter) { const language = this.#languages.get(languageID); return (!triggerCharacter || !!language?.triggerCharacters?.includes(triggerCharacter)); } getCompleterForLanguageID(languageID) { return this.#languages.get(languageID)?.completer ?? completer_builtin_fallback; } getDependencyProvider(key) { return this.#dependencyProviders.get(key); } registerDependencyProvider(key, provider) { this.#dependencyProviders.set(key, provider); } hasFormatter(type) { return this.#formatters.has(type); } getFormatter(type) { return this.#formatters.get(type) ?? formatter_builtin_fallback; } registerFormatter(type, formatter) { this.#formatters.set(type, formatter); } registerInlayHintProvider(provider) { this.#inlayHintProviders.add(provider); } get inlayHintProviders() { return this.#inlayHintProviders; } getLinter(ruleName) { return (this.#linters.get(ruleName) ?? { configValidator: () => false, linter: linter_builtin_noop, nodePredicate: () => false }); } registerLinter(ruleName, options) { this.#linters.set(ruleName, options); } hasParser(id) { return this.#parsers.has(id); } getParser(id) { const ans = this.#parsers.get(id); if (!ans) { throw new Error(`There is no parser '${id}'`); } return ans; } getParserLazily(id) { return Lazy.create(() => this.getParser(id)); } registerParser(id, parser) { this.#parsers.set(id, parser); } /** * @returns The corresponding `Parser` for the language ID. * @throws If there's no such language in the registry. */ getParserForLanguageId(languageID) { if (this.#languages.has(languageID)) { return this.#languages.get(languageID).parser; } throw new Error(`There is no parser registered for language ID '${languageID}'`); } registerSignatureHelpProvider(provider) { this.#signatureHelpProviders.add(provider); } get signatureHelpProviders() { return this.#signatureHelpProviders; } registerSymbolRegistrar(id, registrar) { this.#symbolRegistrars.set(id, registrar); } get symbolRegistrars() { return this.#symbolRegistrars; } registerCustom(group, id, object) { let groupRegistry = this.#custom.get(group); if (!groupRegistry) { groupRegistry = new Map(); this.#custom.set(group, groupRegistry); } groupRegistry.set(id, object); } getCustom(group) { return this.#custom.get(group); } registerUriBinder(uriBinder) { this.#uriBinders.add(uriBinder); } get uriBinders() { return this.#uriBinders; } hasUriBuilder(category) { return this.#uriBuilders.has(category); } getUriBuilder(category) { return this.#uriBuilders.get(category); } registerUriBuilder(category, builder) { this.#uriBuilders.set(category, builder); } setUriSorter(uriSorter) { const nextSorter = this.#uriSorter; this.#uriSorter = (a, b) => uriSorter(a, b, nextSorter); } get uriSorter() { return this.#uriSorter; } } //# sourceMappingURL=MetaRegistry.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/Profiler.js class TopNImpl { id; logger; n; #finalized = false; #startTime; #lastTime; #taskCount = 0; #topTasks = []; #minTime = Infinity; #maxTime = 0; constructor(id, logger, n) { this.id = id; this.logger = logger; this.n = n; this.#startTime = this.#lastTime = performance.now(); } task(name) { if (this.#finalized) { throw new Error('The profiler has already been finalized'); } this.#taskCount++; const time = performance.now(); const duration = time - this.#lastTime; this.#lastTime = time; this.#minTime = Math.min(this.#minTime, duration); this.#maxTime = Math.max(this.#maxTime, duration); this.#topTasks.push([name, duration]); this.#topTasks.sort((a, b) => b[1] - a[1]); if (this.#topTasks.length > this.n) { this.#topTasks = this.#topTasks.slice(0, -1); } return this; } finalize() { this.#finalized = true; const longestTaskNameLength = this.#topTasks.reduce((length, [name]) => Math.max(length, name.length), 0); const totalDuration = this.#lastTime - this.#startTime; this.logger.info(`[Profiler: ${this.id}] == Summary ==`); this.logger.info(`[Profiler: ${this.id}] Total tasks: ${this.#taskCount} done in ${totalDuration} ms`); this.logger.info(`[Profiler: ${this.id}] Min/Avg/Max: ${this.#minTime} / ${totalDuration / this.#taskCount} / ${this.#maxTime} ms`); this.logger.info(`[Profiler: ${this.id}] Top ${Math.min(this.n, this.#topTasks.length)} task(s):`); for (const [name, time] of this.#topTasks) { this.logger.info(`[Profiler: ${this.id}] ${name}${' '.repeat(longestTaskNameLength - name.length)} - ${time} ms (${(time / totalDuration) * 100}%)`); } } } const TotalTaskName = 'Total'; class TotalImpl { id; logger; #finalized = false; #startTime; #lastTime; #tasks = []; #longestTaskNameLength = 0; constructor(id, logger) { this.id = id; this.logger = logger; this.#startTime = this.#lastTime = performance.now(); } task(name) { if (this.#finalized) { throw new Error('The profiler is finalized.'); } const time = performance.now(); const duration = time - this.#lastTime; this.#lastTime = time; this.#tasks.push([name, duration]); this.#longestTaskNameLength = Math.max(this.#longestTaskNameLength, name.length); this.logger.info(`[Profiler: ${this.id}] Done: ${name} in ${duration} ms`); return this; } finalize() { this.#finalized = true; this.#tasks.push([TotalTaskName, this.#lastTime - this.#startTime]); this.#longestTaskNameLength = Math.max(this.#longestTaskNameLength, TotalTaskName.length); this.logger.info(`[Profiler: ${this.id}] == Summary ==`); for (const [name, time] of this.#tasks) { this.logger.info(`[Profiler: ${this.id}] ${name}${' '.repeat(this.#longestTaskNameLength - name.length)} - ${time} ms`); } } } class NoopImpl { task() { return this; } finalize() { } } class ProfilerFactory { logger; #enabledProfilers; constructor(logger, enabledProfilers) { this.logger = logger; this.#enabledProfilers = new Set(enabledProfilers); } get(id, style = 'total', n) { if (this.#enabledProfilers.has(id)) { switch (style) { case 'top-n': return new TopNImpl(id, this.logger, n); case 'total': return new TotalImpl(id, this.logger); default: return Dev.assertNever(style); } } else { return new NoopImpl(); } } static noop() { return new ProfilerFactory(Logger.noop(), []); } } //# sourceMappingURL=Profiler.js.map // EXTERNAL MODULE: ./node_modules/picomatch/index.js var picomatch = __nccwpck_require__(4006); ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/Project.js var Project_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; const CacheAutoSaveInterval = 600_000; // 10 Minutes. /* istanbul ignore next */ /** * Manage all tracked documents and errors. * * The four stages of processing a document: * 1. `read` - read the file from the external file system as a `TextDocument`. * 2. `parse` - Parse the `TextDocument` into an `AstNode`. * 3. `bind` - Bind the `AstNode` and populate both the global symbol table and the local symbol tables on the nodes. * 4. `check` (includes `lint`) - Check the `AstNode` with information from the symbol tables. * * **Caching** * * The global symbol table along with a list of file URIs and checksums is cached in memory and is periodically saved to disk. * * The `TextDocument`s and file `AstNode`s (including their local symbol tables) managed by the client are stored in memory until the client sends a `didClose` notification. * * Some `TextDocument`s may be cached to avoid excessive reading from the file system. * * **INIT and READY** * * When a new instance of the {@link Project} class is constructed, its INIT and READY processes are immediately started in serial. * * During the INIT process of the project, the config and language feature initialization are processed. * The Promise returned by the {@link init} function resolves when the INIT process is complete. * * During the READY process of the project, the whole project is analyzed mainly to populate the global symbol table. * The Promise returned by the {@link ready} function resolves when the READY process is complete. * * The following generally happens during the READY process: * 1. A list of file URIs under the project is obtained. * 2. The global symbol cache, if available, is loaded and validated against the know list of files. * A list of files that need to be (re)processed is returned in this step. * 3. For each files in the new list, the file is read, parsed, bound, and checked. * * **EDITING** * * After the READY process is complete, editing text documents as signaled by the client or the file watcher results in the file being re-processed. */ class Project { static RootSuffix = '/pack.mcmeta'; /** Prevent circular binding. */ #bindingInProgressUris = new Set(); #cacheSaverIntervalId; cacheService; /** URI of files that are currently managed by the language client. */ #clientManagedUris = new Set(); #clientManagedDocAndNodes = new Map(); #configService; #symbolUpToDateUris = new Set(); #eventEmitter; #initializers; #initPromise; #readyPromise; #watchedFiles = new Set(); #watcher; #watcherReady = false; #isReady = false; get isReady() { return this.#isReady; } config; downloader; externals; fs; isDebugging; logger; meta = new MetaRegistry(); profilers; projectRoots; symbols; #dependencyRoots; #dependencyFiles; #roots = []; /** * All tracked root URIs. Each URI in this array is guaranteed to end with a slash (`/`). * * Includes the roots of all dependencies, the project root, and all data pack roots identified * by `pack.mcmeta` files. * * Some URIs in the array may overlap with each other. In such cases, the deeper ones are guaranteed to come * before the shallower ones (e.g. `file:///foo/bar/` will come before `file:///foo/`). */ get roots() { return this.#roots; } #ctx; /** * Arbitrary information that will be included in the `project` property of all `Context`s. */ get ctx() { return this.#ctx; } #cacheRoot; /** * File URI to a directory where all cache files of Spyglass should be stored. */ get cacheRoot() { return this.#cacheRoot; } updateRoots() { const rawRoots = [...this.#dependencyRoots ?? [], ...this.projectRoots]; const ans = new Set(rawRoots); // Identify roots indicated by `pack.mcmeta`. for (const file of this.getTrackedFiles()) { if (file.endsWith(Project.RootSuffix) && rawRoots.some((r) => file.startsWith(r))) { ans.add(file.slice(0, 1 - Project.RootSuffix.length)); } } this.#roots = [...ans].sort((a, b) => b.length - a.length); this.emit('rootsUpdated', { roots: this.#roots }); } on(event, callbackFn) { this.#eventEmitter.on(event, callbackFn); return this; } once(event, callbackFn) { this.#eventEmitter.once(event, callbackFn); return this; } emit(event, ...args) { return this.#eventEmitter.emit(event, ...args); } /** * Get all files that are tracked and supported. * * Files in cached archives may not show up in the result as those files * are not loaded into the memory. */ getTrackedFiles() { const supportedFiles = [...this.#dependencyFiles ?? [], ...this.#watchedFiles]; this.logger.info(`[Project#getTrackedFiles] Listed ${supportedFiles.length} supported files`); return supportedFiles; } constructor({ cacheRoot, defaultConfig, downloader, externals, fs = FileService.create(externals, cacheRoot), initializers = [], isDebugging = false, logger = Logger.create(), profilers = ProfilerFactory.noop(), projectRoots, }) { this.#cacheRoot = cacheRoot; this.#eventEmitter = new externals.event.EventEmitter(); this.externals = externals; this.fs = fs; this.#initializers = initializers; this.isDebugging = isDebugging; this.logger = logger; this.profilers = profilers; this.projectRoots = projectRoots; this.cacheService = new CacheService(cacheRoot, this); this.#configService = new ConfigService(this, defaultConfig); this.downloader = downloader ?? new Downloader(cacheRoot, externals, logger); this.symbols = new SymbolUtil({}, externals.event.EventEmitter); this.#ctx = {}; this.logger.info(`[Project] [init] cacheRoot = ${cacheRoot}`); this.logger.info(`[Project] [init] projectRoots = ${projectRoots.join(' ')}`); this.#configService.on('changed', ({ config }) => { this.config = config; this.logger.info('[Project] [Config] Changed'); }).on('error', ({ error, uri }) => this.logger.error(`[Project] [Config] Failed loading ${uri}`, error)); this.setInitPromise(); this.setReadyPromise(); this.#cacheSaverIntervalId = setInterval(() => this.cacheService.save(), CacheAutoSaveInterval); this.on('documentUpdated', ({ doc, node }) => { // if (!this.#isReady) { // return // } this.emit('documentErrored', { errors: FileNode.getErrors(node).map((e) => LanguageError.withPosRange(e, doc)), uri: doc.uri, version: doc.version, }); }).on('documentRemoved', ({ uri }) => { this.emit('documentErrored', { errors: [], uri }); }).on('fileCreated', async ({ uri }) => { if (uri.endsWith(Project.RootSuffix)) { this.updateRoots(); } this.bindUri(uri); return this.ensureBindingStarted(uri); }).on('fileModified', async ({ uri }) => { this.#symbolUpToDateUris.delete(uri); if (this.isOnlyWatched(uri)) { await this.ensureBindingStarted(uri); } }).on('fileDeleted', ({ uri }) => { if (uri.endsWith(Project.RootSuffix)) { this.updateRoots(); } this.#symbolUpToDateUris.delete(uri); this.symbols.clear({ uri }); this.tryClearingCache(uri); }).on('ready', () => { this.#isReady = true; // Recheck client managed files after the READY process, as they may have incomplete results and are user-facing. const promises = []; for (const { doc, node } of this.#clientManagedDocAndNodes.values()) { promises.push(this.check(doc, node)); } Promise.all(promises).catch(e => this.logger.error('[Project#ready] Error occurred when rechecking client managed files after READY', e)); }); } setInitPromise() { const callIntializers = async () => { const initCtx = { cacheRoot: this.cacheRoot, config: this.config, downloader: this.downloader, externals: this.externals, isDebugging: this.isDebugging, logger: this.logger, meta: this.meta, projectRoots: this.projectRoots, }; const results = await Promise.allSettled(this.#initializers.map((init) => init(initCtx))); let ctx = {}; results.forEach(async (r, i) => { if (r.status === 'rejected') { this.logger.error(`[Project] [callInitializers] [${i}] “${this.#initializers[i].name}”`, r.reason); } else if (r.value) { ctx = { ...ctx, ...r.value }; } }); this.#ctx = ctx; }; const init = async () => { const __profiler = this.profilers.get('project#init'); const { symbols } = await this.cacheService.load(); this.symbols = new SymbolUtil(symbols, this.externals.event.EventEmitter); this.symbols.buildCache(); __profiler.task('Load Cache'); this.config = await this.#configService.load(); __profiler.task('Load Config'); await callIntializers(); __profiler.task('Initialize').finalize(); }; this.#initPromise = init(); } setReadyPromise() { const getDependencies = async () => { const ans = []; for (const dependency of this.config.env.dependencies) { if (DependencyKey.is(dependency)) { const provider = this.meta.getDependencyProvider(dependency); if (provider) { try { ans.push(await provider()); this.logger.info(`[Project] [getDependencies] Executed provider “${dependency}”`); } catch (e) { this.logger.error(`[Project] [getDependencies] Bad provider “${dependency}”`, e); } } else { this.logger.error(`[Project] [getDependencies] Bad dependency “${dependency}”: no associated provider`); } } else { ans.push({ uri: dependency }); } } return ans; }; const listDependencyFiles = async () => { const dependencies = await getDependencies(); const fileUriSupporter = await FileUriSupporter.create(dependencies, this.externals, this.logger); const archiveUriSupporter = await ArchiveUriSupporter.create(dependencies, this.externals, this.logger); this.fs.register('file:', fileUriSupporter, true); this.fs.register(ArchiveUriSupporter.Protocol, archiveUriSupporter, true); }; const listProjectFiles = () => new Promise((resolve) => { if (this.projectRoots.length === 0) { resolve(); return; } this.#watchedFiles.clear(); this.#watcherReady = false; this.#watcher = this.externals.fs.watch(this.projectRoots, { usePolling: this.config.env.useFilePolling, }).once('ready', () => { this.#watcherReady = true; resolve(); }).on('add', (uri) => { if (this.shouldExclude(uri)) { return; } this.#watchedFiles.add(uri); if (this.#watcherReady) { this.emit('fileCreated', { uri }); } }).on('change', (uri) => { if (this.shouldExclude(uri)) { return; } if (this.#watcherReady) { this.emit('fileModified', { uri }); } }).on('unlink', (uri) => { if (this.shouldExclude(uri)) { return; } this.#watchedFiles.delete(uri); if (this.#watcherReady) { this.emit('fileDeleted', { uri }); } }).on('error', (e) => { this.logger.error('[Project] [chokidar]', e); }); }); const ready = async () => { await this.init(); const __profiler = this.profilers.get('project#ready'); await Promise.all([listDependencyFiles(), listProjectFiles()]); this.#dependencyFiles = new Set([...this.fs.listFiles()] .filter((uri) => !this.shouldExclude(uri))); this.#dependencyRoots = new Set(this.fs.listRoots()); this.updateRoots(); __profiler.task('List URIs'); for (const [id, { checksum, registrar }] of this.meta.symbolRegistrars) { const cacheChecksum = this.cacheService.checksums.symbolRegistrars[id]; if (cacheChecksum === undefined || checksum !== cacheChecksum) { this.symbols.clear({ contributor: `symbol_registrar/${id}` }); this.symbols.contributeAs(`symbol_registrar/${id}`, () => { registrar(this.symbols, { logger: this.logger }); }); this.emit('symbolRegistrarExecuted', { id, checksum }); } else { this.logger.info(`[SymbolRegistrar] Skipped “${id}” thanks to cache ${checksum}`); } } __profiler.task('Register Symbols'); for (const [uri, values] of Object.entries(this.cacheService.errors)) { this.emit('documentErrored', { errors: values, uri }); } __profiler.task('Pop Errors'); const { addedFiles, changedFiles, removedFiles } = await this.cacheService.validate(); for (const uri of removedFiles) { this.emit('fileDeleted', { uri }); } __profiler.task('Validate Cache'); if (addedFiles.length > 0) { this.bindUri(addedFiles); } __profiler.task('Bind URIs'); const files = [...addedFiles, ...changedFiles].sort(this.meta.uriSorter); __profiler.task('Sort URIs'); const fileCountByExtension = new Map(); for (const file of files) { const ext = fileUtil.extname(file)?.replace(/^\./, ''); if (ext) { fileCountByExtension.set(ext, (fileCountByExtension.get(ext) ?? 0) + 1); } } this.logger.info(`[Project#ready] == Files to bind ==`); for (const [ext, count] of fileCountByExtension.entries()) { this.logger.info(`[Project#ready] File extension ${ext}: ${count}`); } const __bindProfiler = this.profilers.get('project#ready#bind', 'top-n', 50); for (const uri of files) { await this.ensureBindingStarted(uri); __bindProfiler.task(uri); } __bindProfiler.finalize(); __profiler.task('Bind Files'); __profiler.finalize(); this.emit('ready', {}); }; this.#isReady = false; this.#readyPromise = ready(); } /** * Load the config file and initialize parsers and processors. */ async init() { await this.#initPromise; return this; } /** * Finish the initial run of parsing, binding, and checking the entire project. */ async ready() { await this.#readyPromise; return this; } /** * Behavior of the `Project` instance is undefined after this function has settled. */ async close() { clearInterval(this.#cacheSaverIntervalId); await this.#watcher.close(); await this.cacheService.save(); } async restart() { try { await this.#watcher.close(); this.#bindingInProgressUris.clear(); this.#symbolUpToDateUris.clear(); this.setReadyPromise(); await this.ready(); } catch (e) { this.logger.error('[Project#reset]', e); } } resetCache() { this.logger.info('[Project#resetCache] Initiated...'); // Clear existing errors. for (const uri of Object.keys(this.cacheService.errors)) { this.emit('documentErrored', { errors: [], uri }); } // Reset cache. const { symbols } = this.cacheService.reset(); this.symbols = new SymbolUtil(symbols, this.externals.event.EventEmitter); this.symbols.buildCache(); return this.restart(); } normalizeUri(uri) { return this.fs.mapFromDisk(normalizeUri(uri)); } static TextDocumentCacheMaxLength = 268435456; #textDocumentCache = new Map(); #textDocumentCacheLength = 0; removeCachedTextDocument(uri) { const doc = this.#textDocumentCache.get(uri); if (doc && !(doc instanceof Promise)) { this.#textDocumentCacheLength -= doc.getText().length; } this.#textDocumentCache.delete(uri); } async read(uri) { const createTextDocument = async (uri) => { const languageId = this.guessLanguageID(uri); if (!this.isSupportedLanguage(uri, languageId)) { return undefined; } try { const content = bufferToString(await this.fs.readFile(uri)); return TextDocument.create(uri, languageId, -1, content); } catch (e) { this.logger.warn(`[Project] [read] Failed creating TextDocument for ${uri}`, e); return undefined; } }; const trimCache = () => { const iterator = this.#textDocumentCache.keys(); while (this.#textDocumentCacheLength > Project.TextDocumentCacheMaxLength) { const result = iterator.next(); if (result.done) { throw new Error(`[Project] [read] Cache is too large with length ${this.#textDocumentCacheLength} even though it's empty; make sure to call 'removeCachedTextDocument()' instead of 'this.#textDocumentCache.delete()'`); } this.removeCachedTextDocument(result.value); } }; const getCacheHandlingPromise = async (uri) => { if (this.#textDocumentCache.has(uri)) { const ans = this.#textDocumentCache.get(uri); // Move the entry to the end of the cache. // The goal is that more-frequently-used entries are preferably not trimmed. this.#textDocumentCache.delete(uri); this.#textDocumentCache.set(uri, ans); return ans; } else { const promise = createTextDocument(uri); this.#textDocumentCache.set(uri, promise); // We replace the Promise in the cache with the TextDocument after it resolves, // or removes it from the cache if it resolves to undefined. const doc = await promise; if (this.#textDocumentCache.get(uri) === promise) { // The Promise in the cache is the same as the one we created earlier. // This check is to make sure we don't set a wrong TextDocument to the cache in case the cache was modified elsewhere. if (doc) { this.#textDocumentCache.set(uri, doc); this.#textDocumentCacheLength += doc.getText().length; trimCache(); } else { this.#textDocumentCache.delete(uri); } } return doc; } }; uri = this.normalizeUri(uri); if (this.#clientManagedUris.has(uri)) { const result = this.#clientManagedDocAndNodes.get(uri); if (result) { return result.doc; } throw new Error(`[Project] [read] Client-managed URI ${uri} does not have a TextDocument in the cache`); } return getCacheHandlingPromise(uri); } parse(doc) { const ctx = ParserContext.create(this, { doc }); const parser = ctx.meta.getParserForLanguageId(ctx.doc.languageId); if (!parser) { return { type: 'file', range: Range.create(0), children: [], locals: Object.create(null), parserErrors: [], }; } const src = new Source(doc.getText()); return file_file(parser)(src, ctx); } async bind(doc, node) { if (node.binderErrors) { return; } try { this.#bindingInProgressUris.add(doc.uri); const binder = this.meta.getBinder(node.type); const ctx = BinderContext.create(this, { doc }); ctx.symbols.clear({ contributor: 'binder', uri: doc.uri }); await ctx.symbols.contributeAsAsync('binder', async () => { const proxy = StateProxy.create(node); await binder(proxy, ctx); node.binderErrors = ctx.err.dump(); }); this.#bindingInProgressUris.delete(doc.uri); this.#symbolUpToDateUris.add(doc.uri); } catch (e) { this.logger.error(`[Project] [bind] Failed for ${doc.uri} # ${doc.version}`, e); } } async check(doc, node) { if (node.checkerErrors) { return; } try { const checker = this.meta.getChecker(node.type); const ctx = CheckerContext.create(this, { doc }); ctx.symbols.clear({ contributor: 'checker', uri: doc.uri }); await ctx.symbols.contributeAsAsync('checker', async () => { await checker(StateProxy.create(node), ctx); node.checkerErrors = ctx.err.dump(); this.lint(doc, node); }); } catch (e) { this.logger.error(`[Project] [check] Failed for ${doc.uri} # ${doc.version}`, e); } } lint(doc, node) { if (node.linterErrors) { return; } node.linterErrors = []; try { for (const [ruleName, rawValue] of Object.entries(this.config.lint)) { const result = LinterConfigValue.destruct(rawValue); if (!result) { // Rule is disabled (i.e. set to `null`) in the config. continue; } const { ruleSeverity, ruleValue } = result; const { configValidator, linter, nodePredicate } = this.meta.getLinter(ruleName); if (!configValidator(ruleName, ruleValue, this.logger)) { // Config value is invalid. continue; } const ctx = LinterContext.create(this, { doc, err: new LinterErrorReporter(ruleName, ruleSeverity, this.ctx['errorSource']), ruleName, ruleValue, }); traversePreOrder(node, () => true, () => true, (node) => { if (nodePredicate(node)) { const proxy = StateProxy.create(node); linter(proxy, ctx); } }); node.linterErrors.push(...ctx.err.dump()); } } catch (e) { this.logger.error(`[Project] [lint] Failed for ${doc.uri} # ${doc.version}`, e); } } // @SingletonPromise() async ensureBindingStarted(uri) { uri = this.normalizeUri(uri); if (this.#symbolUpToDateUris.has(uri) || this.#bindingInProgressUris.has(uri)) { return; } this.#bindingInProgressUris.add(uri); const doc = await this.read(uri); if (!doc || !(await this.cacheService.hasFileChangedSinceCache(doc))) { return; } const node = this.parse(doc); await this.bind(doc, node); this.emit('documentUpdated', { doc, node }); } bindUri(param) { const ctx = UriBinderContext.create(this); if (typeof param === 'string') { ctx.symbols.clear({ contributor: 'uri_binder', uri: param }); } ctx.symbols.contributeAs('uri_binder', () => { const uris = Array.isArray(param) ? param : [param]; for (const binder of this.meta.uriBinders) { binder(uris, ctx); } }); } /** * Notify that a new document was opened in the editor. */ async onDidOpen(uri, languageID, version, content) { uri = this.normalizeUri(uri); if (uri.startsWith(ArchiveUriSupporter.Protocol)) { return; // We do not accept `archive:` scheme for client-managed URIs. } if (this.shouldExclude(uri, languageID)) { return; } const doc = TextDocument.create(uri, languageID, version, content); const node = this.parse(doc); this.#clientManagedUris.add(uri); this.#clientManagedDocAndNodes.set(uri, { doc, node }); if (this.#isReady) { await this.bind(doc, node); await this.check(doc, node); } } /** * Notify that an existing document was changed in the editor. * @throws If there is no `TextDocument` corresponding to the URI. */ async onDidChange(uri, changes, version) { uri = this.normalizeUri(uri); this.#symbolUpToDateUris.delete(uri); if (uri.startsWith(ArchiveUriSupporter.Protocol)) { return; // We do not accept `archive:` scheme for client-managed URIs. } const doc = this.#clientManagedDocAndNodes.get(uri)?.doc; if (!doc || this.shouldExclude(uri, doc.languageId)) { // If doc is undefined, it means the document was previously excluded by onDidOpen() // based on the language ID supplied by the client, in which case we should return early. // Otherwise, we perform the shouldExclude() check with the URI and the saved language ID // as usual. return; } TextDocument.update(doc, changes, version); const node = this.parse(doc); this.#clientManagedDocAndNodes.set(uri, { doc, node }); if (this.#isReady) { await this.bind(doc, node); await this.check(doc, node); } } /** * Notify that an existing document was closed in the editor. */ onDidClose(uri) { uri = this.normalizeUri(uri); if (uri.startsWith(ArchiveUriSupporter.Protocol)) { return; // We do not accept `archive:` scheme for client-managed URIs. } this.#clientManagedUris.delete(uri); this.#clientManagedDocAndNodes.delete(uri); this.tryClearingCache(uri); } async ensureClientManagedChecked(uri) { uri = this.normalizeUri(uri); const result = this.#clientManagedDocAndNodes.get(uri); if (result) { const { doc, node } = result; if (this.#isReady) { await this.bind(doc, node); await this.check(doc, node); this.emit('documentUpdated', result); } return result; } return undefined; } getClientManaged(uri) { uri = this.normalizeUri(uri); return this.#clientManagedDocAndNodes.get(uri); } async showCacheRoot() { if (!this.#cacheRoot) { return; } try { await fileUtil.ensureDir(this.externals, this.#cacheRoot); await this.externals.fs.showFile(this.#cacheRoot); } catch (e) { this.logger.error('[Service#showCacheRoot]', e); } } /** * Returns true iff the URI should be excluded from all Spyglass language support. * * @param language Optional. If ommitted, a language will be derived from the URI according to * its file extension. */ shouldExclude(uri, language) { return !this.isSupportedLanguage(uri, language) || this.isUserExcluded(uri); } isSupportedLanguage(uri, language) { language ??= this.guessLanguageID(uri); const languageOptions = this.meta.getLanguageOptions(language); if (!languageOptions) { // Unsupported language. return false; } const { uriPredicate } = languageOptions; return uriPredicate?.(uri, UriPredicateContext.create(this)) ?? true; } /** * Guess a language ID from a URI. The guessed language ID may or may not actually be supported. */ guessLanguageID(uri) { const ext = fileUtil.extname(uri) ?? '.spyglassmc-unknown'; return this.meta.getLanguageID(ext) ?? ext.slice(1); } isUserExcluded(uri) { if (this.config.env.exclude.length === 0) { return false; } for (const rel of fileUtil.getRels(uri, this.projectRoots)) { if (picomatch(this.config.env.exclude, { dot: true, posixSlashes: false })(rel)) { return true; } } return false; } tryClearingCache(uri) { if (this.shouldRemove(uri)) { this.removeCachedTextDocument(uri); this.emit('documentRemoved', { uri }); } } shouldRemove(uri) { return (!this.#clientManagedUris.has(uri) && !this.#dependencyFiles?.has(uri) && !this.#watchedFiles.has(uri)); } isOnlyWatched(uri) { return (this.#watchedFiles.has(uri) && !this.#clientManagedUris.has(uri) && !this.#dependencyFiles?.has(uri)); } } Project_decorate([ SingletonPromise() ], Project.prototype, "bind", null); Project_decorate([ SingletonPromise() ], Project.prototype, "check", null); Project_decorate([ SingletonPromise() ], Project.prototype, "ensureClientManagedChecked", null); //# sourceMappingURL=Project.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/SymbolLocations.js var SymbolLocations; (function (SymbolLocations) { /* istanbul ignore next */ function create(range, locations) { return { range: Range.get(range), locations }; } SymbolLocations.create = create; })(SymbolLocations || (SymbolLocations = {})); //# sourceMappingURL=SymbolLocations.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/Service.js /* istanbul ignore next */ class Service { isDebugging; logger; profilers; project; constructor({ isDebugging = false, logger, profilers = ProfilerFactory.noop(), project }) { this.isDebugging = isDebugging; this.logger = logger; this.profilers = profilers; this.project = new Project({ isDebugging, logger, profilers, ...project }); } debug(message) { if (this.isDebugging) { this.logger.info(`[DEBUG] ${message}`); } } colorize(node, doc, range) { try { this.debug(`Colorizing ${doc.uri} # ${doc.version}`); const colorizer = this.project.meta.getColorizer(node.type); return colorizer(node, ColorizerContext.create(this.project, { doc, range })); } catch (e) { this.logger.error(`[Service] [colorize] Failed for ${doc.uri} # ${doc.version}`, e); } return []; } getCodeActions(node, doc, range) { try { this.debug(`Getting code actions ${doc.uri} # ${doc.version} @ ${Range.toString(range)}`); const codeActionProvider = this.project.meta.getCodeActionProvider(node.type); const ctx = CodeActionProviderContext.create(this.project, { doc, range }); return codeActionProvider(node, ctx); } catch (e) { this.logger.error(`[Service] [getCodeActions] Failed for ${doc.uri} # ${doc.version}`, e); } return []; } getColorInfo(node, doc) { try { this.debug(`Getting color info for ${doc.uri} # ${doc.version}`); const ans = []; traversePreOrder(node, (_) => true, (node) => node.color, (node) => ans.push({ color: Array.isArray(node.color) ? node.color : node.color.value, range: Array.isArray(node.color) ? node.range : node.color.range ?? node.range, })); return ans; } catch (e) { this.logger.error(`[Service] [getColorInfo] Failed for ${doc.uri} # ${doc.version}`, e); } return []; } getColorPresentation(file, doc, range, color) { try { this.debug(`Getting color presentation for ${doc.uri} # ${doc.version} @ ${Range.toString(range)}`); let node = AstNode.findDeepestChild({ node: file, needle: range.start }); while (node) { const nodeColor = node.color; if (nodeColor && !Array.isArray(nodeColor)) { const colorRange = nodeColor.range ?? node.range; return nodeColor.format.map((format) => ColorPresentation.fromColorFormat(format, color, colorRange)); } node = node.parent; } } catch (e) { this.logger.error(`[Service] [getColorPresentation] Failed for ${doc.uri} # ${doc.version}`, e); } return []; } complete(node, doc, offset, triggerCharacter) { try { this.debug(`Getting completion for ${doc.uri} # ${doc.version} @ ${offset}`); const shouldComplete = this.project.meta.shouldComplete(doc.languageId, triggerCharacter); if (shouldComplete) { return builtin_file(node, CompleterContext.create(this.project, { doc, offset, triggerCharacter })); } } catch (e) { this.logger.error(`[Service] [complete] Failed for ${doc.uri} # ${doc.version}`, e); } return []; } dataHackPubify(initialism) { const Secrets = [ // data hack pub // —— Skylinerw, 2020 https://discord.com/channels/154777837382008833/154777837382008833/736313565291741355 ['ata', 'ack', 'ub', 'elper', 'lus'], // Dah Huh Pew Helpa Plush // —— DoubleFelix, 2021 https://discord.com/channels/154777837382008833/154777837382008833/842070090828087308 ['ah', 'uh', 'ew', 'elpa', 'lush'], ]; const secrets = Secrets[Math.floor(Math.random() * Secrets.length)]; // Punctuation should not be treated differently from any other characters, per example: // Hata &ack Sub // —— Skylinerw, 2022 https://discord.com/channels/154777837382008833/734106483104415856/955521761351454741 return [...initialism].map((c, i) => `${c.toUpperCase()}${secrets[i % secrets.length]}`).join(' '); } format(node, doc, tabSize, insertSpaces) { try { this.debug(`Formatting ${doc.uri} # ${doc.version}`); const formatter = this.project.meta.getFormatter(node.type); return formatter(node, FormatterContext.create(this.project, { doc, tabSize, insertSpaces })); } catch (e) { this.logger.error(`[Service] [format] Failed for ${doc.uri} # ${doc.version}`, e); throw e; } } getHover(file, doc, offset) { try { this.debug(`Getting hover for ${doc.uri} # ${doc.version} @ ${offset}`); let node = AstNode.findDeepestChild({ node: file, needle: offset }); while (node) { const symbol = this.project.symbols.resolveAlias(node.symbol); if (symbol) { const hover = `\`\`\`typescript\n(${symbol.category}${symbol.subcategory ? `/${symbol.subcategory}` : ''}) ${symbol.identifier}\n\`\`\`` + (symbol.desc ? `\n******\n${symbol.desc}` : ''); return Hover.create(node.range, hover); } if (node.hover) { return Hover.create(node.range, node.hover); } node = node.parent; } } catch (e) { this.logger.error(`[Service] [getHover] Failed for ${doc.uri} # ${doc.version}`, e); } return undefined; } getInlayHints(node, doc, range) { try { // TODO: `range` argument is not used. this.debug(`Getting inlay hints for ${doc.uri} # ${doc.version}`); const ans = []; const ctx = ProcessorContext.create(this.project, { doc }); for (const provider of this.project.meta.inlayHintProviders) { ans.push(...provider(node, ctx)); } return ans; } catch (e) { this.logger.error(`[Service] [getInlayHints] Failed for ${doc.uri} # ${doc.version}`, e); } return []; } getSignatureHelp(node, doc, offset) { try { this.debug(`Getting signature help for ${doc.uri} # ${doc.version} @ ${offset}`); const ctx = SignatureHelpProviderContext.create(this.project, { doc, offset }); for (const provider of this.project.meta.signatureHelpProviders) { const result = provider(node, ctx); if (result) { return result; } } } catch (e) { this.logger.error(`[Service] [getSignatureHelp] Failed for ${doc.uri} # ${doc.version}`, e); } return undefined; } /** * @param searchedUsages Type of symbol usages that should be included in the result. Defaults to all usages. * @param currentFileOnly Whether only symbol locations in the current file should be returned. * * @returns Symbol locations of the selected symbol at `offset`, or `undefined` if there's no symbol at `offset`. */ async getSymbolLocations(file, doc, offset, searchedUsages = SymbolUsageTypes, currentFileOnly = false) { try { this.debug(`Getting symbol locations of usage '${searchedUsages.join(',')}' for ${doc.uri} # ${doc.version} @ ${offset} with currentFileOnly=${currentFileOnly}`); let node = AstNode.findDeepestChild({ node: file, needle: offset }); while (node) { const symbol = this.project.symbols.resolveAlias(node.symbol); if (symbol) { const rawLocations = []; for (const usage of searchedUsages) { let locs = symbol[usage] ?? []; if (currentFileOnly) { locs = locs.filter((l) => l.uri === doc.uri); } rawLocations.push(...locs); } const locations = []; for (const loc of rawLocations) { const mappedUri = fileUtil.isFileUri(loc.uri) ? loc.uri : await this.project.fs.mapToDisk(loc.uri); if (mappedUri) { locations.push({ ...loc, uri: mappedUri }); } } return SymbolLocations.create(node.range, locations.length ? locations : undefined); } node = node.parent; } } catch (e) { this.logger.error(`[Service] [getSymbolLocations] Failed for ${doc.uri} # ${doc.version}`, e); } return undefined; } } //# sourceMappingURL=Service.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/index.js /* istanbul ignore file */ //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/Parser.js const Parser_Failure = Symbol('Failure'); //# sourceMappingURL=Parser.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/util.js function util_attempt(parser, src, ctx) { const tmpSrc = src.clone(); const tmpCtx = { ...ctx, err: new ErrorReporter(ctx.err.source) }; const result = parser(tmpSrc, tmpCtx); return { result, endCursor: tmpSrc.cursor, errorAmount: tmpCtx.err.errors.length, updateSrcAndCtx: () => { src.innerCursor = tmpSrc.innerCursor; ctx.err.absorb(tmpCtx.err); }, }; } function sequence(parsers, parseGap) { return (src, ctx) => { const ans = { [SequenceUtilDiscriminator]: true, children: [], range: Range.create(src), }; for (const [i, p] of parsers.entries()) { const parser = typeof p === 'function' ? p : p.get(ans); if (parser === undefined) { continue; } if (i > 0 && parseGap) { ans.children.push(...parseGap(src, ctx)); } const result = parser(src, ctx); if (result === Parser_Failure) { return Parser_Failure; } else if (result === undefined) { continue; } else if (SequenceUtil.is(result)) { ans.children.push(...result.children); } else { ans.children.push(result); } } ans.range.end = src.cursor; return ans; }; } function repeat(parser, parseGap) { return (src, ctx) => { const ans = { [SequenceUtilDiscriminator]: true, children: [], range: Range.create(src), }; while (src.canRead()) { if (parseGap) { ans.children.push(...parseGap(src, ctx)); } const { result, updateSrcAndCtx } = util_attempt(parser, src, ctx); if (result === Parser_Failure) { break; } updateSrcAndCtx(); if (SequenceUtil.is(result)) { ans.children.push(...result.children); } else { ans.children.push(result); } } ans.range.end = src.cursor; return ans; }; } function util_any(parsers, out) { return (src, ctx) => { const results = parsers.map((parser, i) => ({ attempt: util_attempt(parser, src, ctx), index: i })).filter(({ attempt }) => attempt.result !== Parser_Failure).sort((a, b) => b.attempt.endCursor - a.attempt.endCursor || a.attempt.errorAmount - b.attempt.errorAmount); if (results.length === 0) { if (out) { out.index = -1; } return Parser_Failure; } results[0].attempt.updateSrcAndCtx(); if (out) { out.index = results[0].index; } return results[0].attempt.result; }; } /** * @returns A parser that fails when the passed-in parser didn't move the cursor at all. */ function failOnEmpty(parser) { return (src, ctx) => { const start = src.cursor; const { endCursor, updateSrcAndCtx, result } = util_attempt(parser, src, ctx); if (endCursor - start > 0) { updateSrcAndCtx(); return result; } return Parser_Failure; }; } /** * @returns A parser that fails when the passed-in parser produced any errors. */ function failOnError(parser) { return (src, ctx) => { const start = src.cursor; const { errorAmount, updateSrcAndCtx, result } = util_attempt(parser, src, ctx); if (!errorAmount) { updateSrcAndCtx(); return result; } return Parser_Failure; }; } function optional(parser) { return ((src, ctx) => { const { result, updateSrcAndCtx } = util_attempt(parser, src, ctx); if (result === Parser_Failure) { return undefined; } else { updateSrcAndCtx(); return result; } }); } function recover(parser, defaultValue) { return (src, ctx) => { const result = parser(src, ctx); if (result === Failure) { const ans = defaultValue(src, ctx); return ans; } return result; }; } function util_select(cases) { return (src, ctx) => { for (const { predicate, prefix, parser, regex } of cases) { if (predicate?.(src) ?? (prefix !== undefined ? src.tryPeek(prefix) : undefined) ?? (regex && src.matchPattern(regex)) ?? true) { const callableParser = typeof parser === 'object' ? parser.get() : parser; return callableParser(src, ctx); } } throw new Error('The select parser util was called with non-exhaustive cases'); }; } function util_map(parser, fn) { return (src, ctx) => { const result = parser(src, ctx); if (result === Parser_Failure) { return Parser_Failure; } const ans = fn(result, src, ctx); return ans; }; } function setType(type, parser) { return util_map(parser, (res) => { const { type: _type, ...restResult } = res; const ans = { type, ...restResult }; delete ans[SequenceUtilDiscriminator]; return ans; }); } function validate(parser, validator, message, severity) { return util_map(parser, (res, src, ctx) => { const isLegal = validator(res, src, ctx); if (!isLegal) { ctx.err.report(message, res.range, severity); } return res; }); } function stopBefore(parser, ...terminators) { const flatTerminators = terminators.flat(); return (src, ctx) => { const tmpSrc = src.clone(); // Cut tmpSrc.string before the nearest terminator. tmpSrc.string = tmpSrc.string.slice(0, flatTerminators.reduce((p, c) => { const index = tmpSrc.string.indexOf(c, tmpSrc.innerCursor); return Math.min(p, index === -1 ? Infinity : index); }, Infinity)); const ans = parser(tmpSrc, ctx); src.cursor = tmpSrc.cursor; return ans; }; } function concatOnTrailingBackslash(parser) { return (src, ctx) => { let wrappedStr = src.sliceToCursor(0); const wrappedSrcCursor = wrappedStr.length; const indexMap = []; while (src.canRead()) { wrappedStr += src.readUntil('\\'); if (!src.canRead()) { break; } // If we get here, then `src.cursor` is at a backslash if (src.hasNonSpaceAheadInLine(1)) { wrappedStr += src.read(); continue; } // Create an index map that skips from the trailing backslash to the // next line's first non-whitespace character const from = src.getCharRange(); src.nextLine(); // Minecraft raises a `Line continuation at end of file` if a backslash // (+ optional whitespace to the next line) is right before the end of the file if (!src.canRead()) { const ans = { type: 'error', range: Range.span(from, src) }; ctx.err.report(localize('parser.line-continuation-end-of-file'), ans); } src.skipSpace(); const to = src.getCharRange(-1); indexMap.push({ inner: Range.create(wrappedStr.length), outer: Range.span(from, to) }); } const wrappedSrc = new Source(wrappedStr, indexMap); wrappedSrc.innerCursor = wrappedSrcCursor; const ans = parser(wrappedSrc, ctx); src.cursor = wrappedSrc.cursor; return ans; }; } function acceptOnly(parser, ...characters) { const set = new Set(characters.flat()); return (src, ctx) => { const tmpSrc = src.clone(); // Cut tmpSrc.string before the nearest unacceptable character. for (let i = tmpSrc.innerCursor; i < tmpSrc.string.length; i++) { if (!set.has(tmpSrc.string.charAt(i))) { tmpSrc.string = tmpSrc.string.slice(0, i); break; } } const ans = parser(tmpSrc, ctx); src.cursor = tmpSrc.cursor; return ans; }; } function acceptIf(parser, predicate) { return ((src, ctx) => { const tmpSrc = src.clone(); // Cut tmpSrc.string before the nearest unacceptable character. for (let i = tmpSrc.innerCursor; i < tmpSrc.string.length; i++) { if (!predicate(tmpSrc.string.charAt(i))) { tmpSrc.string = tmpSrc.string.slice(0, i); break; } } const ans = parser(tmpSrc, ctx); src.innerCursor = tmpSrc.innerCursor; return ans; }); } /** * @returns A parser that dumps any parser errors after it finishes parsing. */ function dumpErrors(parser) { return ((src, ctx) => { const ans = parser(src, ctx); ctx.err.dump(); return ans; }); } //# sourceMappingURL=util.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/boolean.js const boolean_boolean = util_map(literal('false', 'true'), (res) => ({ type: 'boolean', range: res.range, value: res.value === '' ? undefined : res.value === 'true', })); //# sourceMappingURL=boolean.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/comment.js /** * `Failure` when three isn't a comment. */ function comment_comment({ singleLinePrefixes, includesEol }) { return (src, _ctx) => { const start = src.cursor; const ans = { type: 'comment', range: Range.create(start), comment: '', prefix: '', }; for (const prefix of singleLinePrefixes) { if (src.peek(prefix.length) === prefix) { if (includesEol) { src.nextLine(); } else { src.skipLine(); } ans.range.end = src.cursor; ans.comment = src.sliceToCursor(start + prefix.length); ans.prefix = prefix; return ans; } } return Parser_Failure; }; } //# sourceMappingURL=comment.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/error.js /** * Returns an error node containing all the remaining text (including whitespace), * or returns `undefined` if the `Source` has already reached its end. */ const error_error = (src, ctx) => { if (!src.canRead()) { return undefined; } const ans = { type: 'error', range: Range.create(src, () => src.skipRemaining()) }; ctx.err.report(localize('error.unparseable-content'), ans); return ans; }; //# sourceMappingURL=error.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/file.js /** * Dispatches to the corresponding parser for the language. * @throws If there's no parser registered for this language ID. */ function file_file(parser) { return (src, ctx) => { const fullRange = Range.create(src, src.string.length); const ans = { type: 'file', range: fullRange, children: [], locals: Object.create(null), parserErrors: [], }; src.skipWhitespace(); const result = parser(src, ctx); if (result && result !== Parser_Failure) { ans.children.push(result); } if (src.skipWhitespace().canRead()) { ans.children.push(error_error(src, ctx)); } AstNode.setParents(ans); ans.parserErrors = ctx.err.dump(); return ans; }; } //# sourceMappingURL=file.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/float.js const fallbackOnOutOfRange = (ans, _src, ctx, options) => { ctx.err.report(localize('expected', localize('float.between', options.min ?? '-∞', options.max ?? '+∞')), ans, 3 /* ErrorSeverity.Error */); }; function float_float(options) { return (src, ctx) => { const ans = { type: 'float', range: Range.create(src), value: 0 }; if (src.peek() === '-' || src.peek() === '+') { src.skip(); } while (src.canRead() && Source.isDigit(src.peek())) { src.skip(); } if (src.trySkip('.')) { while (src.canRead() && Source.isDigit(src.peek())) { src.skip(); } } if (src.peek().toLowerCase() === 'e') { src.skip(); if (src.peek() === '-' || src.peek() === '+') { src.skip(); } while (src.canRead() && Source.isDigit(src.peek())) { src.skip(); } } ans.range.end = src.cursor; const raw = src.sliceToCursor(ans.range.start); ans.value = parseFloat(raw) || 0; if (!raw) { if (options.failsOnEmpty) { return Parser_Failure; } ctx.err.report(localize('expected', localize('float')), ans); } else if (!options.pattern.test(raw)) { ctx.err.report(localize('parser.float.illegal', options.pattern), ans); } else if ((options.min && ans.value < options.min) || (options.max && ans.value > options.max)) { const onOutOfRange = options.onOutOfRange ?? fallbackOnOutOfRange; onOutOfRange(ans, src, ctx, options); } return ans; }; } //# sourceMappingURL=float.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/integer.js const integer_fallbackOnOutOfRange = (ans, _src, ctx, options) => { ctx.err.report(localize('expected', localize('integer.between', options.min ?? '-∞', options.max ?? '+∞')), ans, 3 /* ErrorSeverity.Error */); }; function integer_integer(options) { return (src, ctx) => { const ans = { type: 'integer', range: Range.create(src), value: 0 }; if (src.peek() === '-' || src.peek() === '+') { src.skip(); } while (src.canRead() && Source.isDigit(src.peek())) { src.skip(); } ans.range.end = src.cursor; const raw = src.sliceToCursor(ans.range.start); const isOnlySign = raw === '-' || raw === '+'; if (!isOnlySign) { ans.value = Number(raw); } if (!raw) { if (options.failsOnEmpty) { return Parser_Failure; } ctx.err.report(localize('expected', localize('integer')), ans); } else if (!options.pattern.test(raw) || isOnlySign) { ctx.err.report(localize('parser.integer.illegal', options.pattern), ans); } else if ((options.min !== undefined && ans.value < options.min) || (options.max !== undefined && ans.value > options.max)) { const onOutOfRange = options.onOutOfRange ?? integer_fallbackOnOutOfRange; onOutOfRange(ans, src, ctx, options); } return ans; }; } //# sourceMappingURL=integer.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/list.js function list({ start, value, sep, trailingSep, end }) { return (src, ctx) => { const ans = { type: 'list', range: Range.create(src), children: [] }; if (src.trySkip(start)) { src.skipWhitespace(); let requiresValueSep = false; let hasValueSep = false; while (src.canRead() && src.peek(end.length) !== end) { const itemStart = src.cursor; let valueNode; // Item sep of the last item. if (requiresValueSep && !hasValueSep) { ctx.err.report(localize('expected', localeQuote(sep)), src); } // Value. src.skipWhitespace(); const { result, endCursor, updateSrcAndCtx } = util_attempt(value, src, ctx); if (result === Parser_Failure || endCursor === src.cursor) { ctx.err.report(localize('expected', localize('parser.list.value')), Range.create(src, () => src.skipUntilOrEnd(sep, end, '\r', '\n'))); } else { updateSrcAndCtx(); valueNode = result; } // Item sep. let sepRange = undefined; src.skipWhitespace(); requiresValueSep = true; if ((hasValueSep = src.peek(sep.length) === sep)) { sepRange = Range.create(src, () => src.skip(sep.length)); } // Create item. ans.children.push({ type: 'item', range: Range.create(itemStart, src), ...(valueNode ? { children: [valueNode] } : {}), value: valueNode, sep: sepRange, }); src.skipWhitespace(); } // Trailing item sep. if (hasValueSep && !trailingSep) { const trailingRange = ans.children[ans.children.length - 1].sep; ctx.err.report(localize('parser.list.trailing-sep'), trailingRange, 3 /* ErrorSeverity.Error */, { codeAction: { title: localize('code-action.remove-trailing-separation'), isPreferred: true, changes: [ { type: 'edit', range: trailingRange, text: '', }, ], }, }); } // End. if (!src.trySkip(end)) { ctx.err.report(localize('expected', localeQuote(end)), src); } } else { ctx.err.report(localize('expected', localeQuote(start)), src); } ans.range.end = src.cursor; return ans; }; } //# sourceMappingURL=list.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/long.js const long_fallbackOnOutOfRange = (ans, _src, ctx, options) => { ctx.err.report(localize('expected', localize('long.between', options.min ?? '-∞', options.max ?? '+∞')), ans, 3 /* ErrorSeverity.Error */); }; function long_long(options) { return (src, ctx) => { const ans = { type: 'long', range: Range.create(src), value: 0n }; if (src.peek() === '-' || src.peek() === '+') { src.skip(); } while (src.canRead() && Source.isDigit(src.peek())) { src.skip(); } ans.range.end = src.cursor; const raw = src.sliceToCursor(ans.range.start); let isOnlySign = false; try { ans.value = BigInt(raw); } catch (_) { // `raw` might be "+" or "-" here. isOnlySign = true; } if (!raw) { if (options.failsOnEmpty) { return Parser_Failure; } ctx.err.report(localize('expected', localize('long')), ans); } else if (!options.pattern.test(raw) || isOnlySign) { ctx.err.report(localize('parser.long.illegal', options.pattern), ans); } else if ((options.min && ans.value < options.min) || (options.max && ans.value > options.max)) { const onOutOfRange = options.onOutOfRange ?? long_fallbackOnOutOfRange; onOutOfRange(ans, src, ctx, options); } return ans; }; } //# sourceMappingURL=long.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/prefixed.js function prefixed_prefixed(options) { return (src, ctx) => { const ans = { type: 'prefixed', range: Range.create(src), prefix: options.prefix, children: [], }; const prefix = literal(options.prefix)(src, ctx); ans.children.push(prefix); ans.range.end = src.cursor; const child = options.child(src, ctx); if (child !== Parser_Failure) { ans.children.push(child); } ans.range.end = src.cursor; return ans; }; } //# sourceMappingURL=prefixed.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/record.js /** * @returns A parser that parses something coming in a key-value pair form. e.g. SNBT objects, entity selector arguments. */ function record_record({ start, pair, end }) { return (src, ctx) => { const ans = { type: 'record', range: Range.create(src), children: [] }; if (src.trySkip(start)) { ans.innerRange = Range.create(src); src.skipWhitespace(); let requiresPairEnd = false; let hasPairEnd = false; while (src.canRead() && src.peek(end.length) !== end) { const pairStart = src.cursor; let key; let value; // Pair end of the last pair. if (requiresPairEnd && !hasPairEnd) { ctx.err.report(localize('expected', localeQuote(pair.end)), src); } // Key. const keyStart = src.cursor; const { result: keyResult, updateSrcAndCtx: updateForKey, endCursor: keyEnd } = util_attempt(pair.key, src, ctx); if (keyResult === Parser_Failure || (keyEnd - keyStart === 0 && ![pair.sep, pair.end, end, '\r', '\n', '\t', ' '].includes(src.peek()))) { ctx.err.report(localize('expected', localize('parser.record.key')), Range.create(src, () => src.skipUntilOrEnd(pair.sep, pair.end, end, '\r', '\n'))); } else { updateForKey(); key = keyResult; } // K-V sep. let sepCharRange = undefined; src.skipWhitespace(); if (src.peek(pair.sep.length) === pair.sep) { sepCharRange = Range.create(src, () => src.skip(pair.sep.length)); } else { ctx.err.report(localize('expected', localeQuote(pair.sep)), src); } // Value. src.skipWhitespace(); const valueParser = typeof pair.value === 'function' ? pair.value : pair.value.get(ans, key); const valueStart = src.cursor; const { result: valueResult, updateSrcAndCtx: updateForValue, endCursor: valueEnd } = util_attempt(valueParser, src, ctx); if (valueResult === Parser_Failure || (valueEnd - valueStart === 0 && ![pair.sep, pair.end, end, '\r', '\n', '\t', ' '].includes(src.peek()))) { ctx.err.report(localize('expected', localize('parser.record.value')), Range.create(src, () => src.skipUntilOrEnd(pair.sep, pair.end, end, '\r', '\n'))); } else { updateForValue(); value = valueResult; } // Pair end. let endCharRange = undefined; src.skipWhitespace(); requiresPairEnd = true; if ((hasPairEnd = src.peek(pair.end.length) === pair.end)) { endCharRange = Range.create(src, () => src.skip(pair.end.length)); } // Create pair. ans.children.push({ type: 'pair', range: Range.create(pairStart, src), ...(key || value ? { children: [key, value].filter((v) => !!v) } : {}), key, sep: sepCharRange, value, end: endCharRange, }); src.skipWhitespace(); } // Trailing pair end. if (hasPairEnd && !pair.trailingEnd) { const trailingRange = ans.children[ans.children.length - 1].end; ctx.err.report(localize('parser.record.trailing-end'), trailingRange, 3 /* ErrorSeverity.Error */, { codeAction: { title: localize('code-action.remove-trailing-separation'), isPreferred: true, changes: [ { type: 'edit', range: trailingRange, text: '', }, ], }, }); } // End. ans.innerRange.end = src.cursor; if (!src.trySkip(end)) { ctx.err.report(localize('expected', localeQuote(end)), src); } } else { ctx.err.report(localize('expected', localeQuote(start)), src); } ans.range.end = src.cursor; return ans; }; } //# sourceMappingURL=record.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/resourceLocation.js const Terminators = new Set([ ' ', '\r', '\n', '=', '~', ',', '"', "'", '{', '}', '[', ']', '(', ')', ';', '|', ]); const LegalResourceLocationCharacters = new Set([ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '_', '-', '.', ]); function resourceLocation_resourceLocation(options) { return (src, ctx) => { const ans = { type: 'resource_location', range: Range.create(src), options, }; if (src.trySkip(ResourceLocation.TagPrefix)) { ans.isTag = true; } const start = src.cursor; while (src.canReadInLine() && !Terminators.has(src.peek())) { src.skip(); } const raw = src.sliceToCursor(start); ans.range.end = src.cursor; if (raw.length === 0) { ctx.err.report(localize('expected', localize('resource-location')), ans); } else { const sepIndex = raw.indexOf(options.namespacePathSep ?? ResourceLocation.NamespacePathSep); if (sepIndex >= 0) { ans.namespace = raw.slice(0, sepIndex); } const rawPath = raw.slice(sepIndex + 1); ans.path = rawPath.split(ResourceLocation.PathSep); // Check characters. /* istanbul ignore next */ const illegalChars = [ ...new Set([ ...[...(ans.namespace ?? [])].filter((c) => !LegalResourceLocationCharacters.has(c)), ...[...rawPath].filter((c) => c !== '/' && !LegalResourceLocationCharacters.has(c)), ]), ]; if (illegalChars.length) { ctx.err.report(localize('parser.resource-location.illegal', arrayToMessage(illegalChars, true, 'and')), ans); } if (ans.isTag && !options.allowTag) { ctx.err.report(localize('parser.resource-location.tag-disallowed'), ans); } if (!ans.isTag && options.requireTag) { ctx.err.report(localize('parser.resource-location.tag-required'), ans); } if (!ans.namespace && options.requireCanonical) { ctx.err.report(localize('parser.resource-location.namespace-expected'), ans, 3 /* ErrorSeverity.Error */, { codeAction: { title: localize('code-action.add-default-namespace'), isPreferred: true, changes: [ { type: 'edit', range: Range.create(start), text: ResourceLocation.DefaultNamespace + ResourceLocation.NamespacePathSep, }, ], }, }); } } return ans; }; } //# sourceMappingURL=resourceLocation.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/string.js function string_string(options) { return (src, ctx) => { const ans = { type: 'string', range: Range.create(src), options, value: '', valueMap: [], }; let start; if (options.quotes?.length && (src.peek() === '"' || src.peek() === "'")) { const currentQuote = src.read(); ans.quote = currentQuote; let cStart = src.cursor; start = cStart; while (src.canRead() && src.peek() !== currentQuote) { const c = src.peek(); if (options.escapable && c === '\\') { src.skip(); const c2 = src.read(); if (c2 === '\\' || c2 === currentQuote || EscapeChar.is(options.escapable.characters, c2)) { ans.valueMap.push({ inner: Range.create(ans.value.length, ans.value.length + 1), outer: Range.create(cStart, src), }); ans.value += EscapeTable.get(c2); } else if (options.escapable.unicode && c2 === 'u') { const hex = src.peek(4); if (/^[0-9a-f]{4}$/i.test(hex)) { src.skip(4); ans.valueMap.push({ inner: Range.create(ans.value.length, ans.value.length + 1), outer: Range.create(cStart, src), }); ans.value += String.fromCharCode(parseInt(hex, 16)); } else { ctx.err.report(localize('parser.string.illegal-unicode-escape'), Range.create(src, src.getCharRange(3).end)); ans.valueMap.push({ inner: Range.create(ans.value.length, ans.value.length + 1), outer: Range.create(cStart, src), }); ans.value += c2; } } else { if (!options.escapable.allowUnknown) { ctx.err.report(localize('parser.string.illegal-escape', localeQuote(c2)), src.getCharRange(-1)); } ans.valueMap.push({ inner: Range.create(ans.value.length, ans.value.length + 1), outer: Range.create(cStart, src), }); ans.value += c2; } cStart = src.cursor; } else { src.skip(); const cEnd = src.cursor; if (cEnd - cStart > 1) { ans.valueMap.push({ inner: Range.create(ans.value.length, ans.value.length + 1), outer: Range.create(cStart, cEnd), }); } ans.value += c; cStart = cEnd; } } if (!src.trySkip(currentQuote)) { ctx.err.report(localize('expected', localeQuote(currentQuote)), src); } if (!options.quotes.includes(currentQuote)) { ctx.err.report(localize('parser.string.illegal-quote', options.quotes), ans); } } else if (options.unquotable) { start = src.cursor; while (src.canRead() && isAllowedCharacter(src.peek(), options.unquotable)) { ans.value += src.read(); } if (!ans.value && !options.unquotable.allowEmpty) { ctx.err.report(localize('expected', localize('string')), src); } } else { start = src.cursor; ctx.err.report(localize('expected', options.quotes), src); } ans.valueMap.unshift({ inner: Range.create(0), outer: Range.create(start) }); if (options.value?.parser) { const valueResult = parseStringValue(options.value.parser, ans.value, ans.valueMap, ctx); /* istanbul ignore else */ if (valueResult !== Parser_Failure) { ans.children = [valueResult]; } } ans.range.end = src.cursor; return ans; }; } function parseStringValue(parser, value, map, ctx) { const valueSrc = new Source(value, map); const valueCtx = { ...ctx, doc: TextDocument.create(ctx.doc.uri, ctx.doc.languageId, ctx.doc.version, value), }; // TODO: Mark trailing string as errors. return parser(valueSrc, valueCtx); } const BrigadierUnquotableCharacters = Object.freeze([ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '_', '.', '+', '-', ]); const BrigadierUnquotableCharacterSet = new Set(BrigadierUnquotableCharacters); const BrigadierUnquotablePattern = /^[0-9A-Za-z_\.\+\-]*$/; const BrigadierUnquotableOption = { allowEmpty: true, allowList: BrigadierUnquotableCharacterSet, }; const BrigadierStringOptions = { escapable: {}, quotes: ['"', "'"], unquotable: BrigadierUnquotableOption, }; const brigadierString = string_string(BrigadierStringOptions); function isAllowedCharacter(c, options) { return options.allowList?.has(c) ?? !options.blockList?.has(c); } //# sourceMappingURL=string.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/symbol.js function symbol_symbol(param) { const options = symbol_getOptions(param); return (src, _ctx) => { const ans = { type: 'symbol', range: Range.create(src), options, value: src.readRemaining(), }; ans.range.end = src.cursor; return ans; }; } function symbol_getOptions(param) { if (typeof param === 'string') { return { category: param }; } else { return param; } } //# sourceMappingURL=symbol.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/index.js /* istanbul ignore file */ //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/node/index.js var ModuleNode; (function (ModuleNode) { function is(node) { return node?.type === 'mcdoc:module'; } ModuleNode.is = is; })(ModuleNode || (ModuleNode = {})); var TopLevelNode; (function (TopLevelNode) { function is(node) { return (CommentNode.is(node) || DispatchStatementNode.is(node) || EnumNode.is(node) || InjectionNode.is(node) || StructNode.is(node) || TypeAliasNode.is(node) || UseStatementNode.is(node)); } TopLevelNode.is = is; })(TopLevelNode || (TopLevelNode = {})); var DispatchStatementNode; (function (DispatchStatementNode) { function destruct(node) { return { attributes: node.children.filter(AttributeNode.is), location: node.children.find(ResourceLocationNode.is), index: node.children.find(IndexBodyNode.is), target: node.children.find(TypeNode.is), typeParams: node.children.find(TypeParamBlockNode.is), }; } DispatchStatementNode.destruct = destruct; function is(node) { return (node?.type === 'mcdoc:dispatch_statement'); } DispatchStatementNode.is = is; })(DispatchStatementNode || (DispatchStatementNode = {})); var node_LiteralNode; (function (LiteralNode) { function is(node) { return node?.type === 'mcdoc:literal'; } LiteralNode.is = is; })(node_LiteralNode || (node_LiteralNode = {})); var IndexBodyNode; (function (IndexBodyNode) { function destruct(node) { return { parallelIndices: node.children.filter(IndexNode.is) }; } IndexBodyNode.destruct = destruct; function is(node) { return node?.type === 'mcdoc:index_body'; } IndexBodyNode.is = is; })(IndexBodyNode || (IndexBodyNode = {})); var IndexNode; (function (IndexNode) { function is(node) { return StaticIndexNode.is(node) || DynamicIndexNode.is(node); } IndexNode.is = is; })(IndexNode || (IndexNode = {})); var StaticIndexNode; (function (StaticIndexNode) { function is(node) { return (node_LiteralNode.is(node) || IdentifierNode.is(node) || StringNode.is(node) || ResourceLocationNode.is(node)); } StaticIndexNode.is = is; })(StaticIndexNode || (StaticIndexNode = {})); var IdentifierNode; (function (IdentifierNode) { function is(node) { return node?.type === 'mcdoc:identifier'; } IdentifierNode.is = is; })(IdentifierNode || (IdentifierNode = {})); var DynamicIndexNode; (function (DynamicIndexNode) { function destruct(node) { return { keys: node.children.filter(AccessorKeyNode.is) }; } DynamicIndexNode.destruct = destruct; function is(node) { return (node?.type === 'mcdoc:dynamic_index'); } DynamicIndexNode.is = is; })(DynamicIndexNode || (DynamicIndexNode = {})); var AccessorKeyNode; (function (AccessorKeyNode) { function is(node) { return (node_LiteralNode.is(node) || IdentifierNode.is(node) || StringNode.is(node)); } AccessorKeyNode.is = is; })(AccessorKeyNode || (AccessorKeyNode = {})); var TypeNode; (function (TypeNode) { function is(node) { return (AnyTypeNode.is(node) || BooleanTypeNode.is(node) || StringTypeNode.is(node) || LiteralTypeNode.is(node) || NumericTypeNode.is(node) || PrimitiveArrayTypeNode.is(node) || ListTypeNode.is(node) || TupleTypeNode.is(node) || EnumNode.is(node) || StructNode.is(node) || ReferenceTypeNode.is(node) || DispatcherTypeNode.is(node) || UnionTypeNode.is(node)); } TypeNode.is = is; })(TypeNode || (TypeNode = {})); var TypeBaseNode; (function (TypeBaseNode) { function destruct(node) { return { appendixes: node.children.filter((n) => IndexBodyNode.is(n) || TypeArgBlockNode.is(n)), attributes: node.children.filter(AttributeNode.is), }; } TypeBaseNode.destruct = destruct; })(TypeBaseNode || (TypeBaseNode = {})); var AttributeNode; (function (AttributeNode) { function destruct(node) { return { name: node.children.find(IdentifierNode.is), value: node.children.find(AttributeValueNode.is), }; } AttributeNode.destruct = destruct; function is(node) { return node?.type === 'mcdoc:attribute'; } AttributeNode.is = is; })(AttributeNode || (AttributeNode = {})); var AttributeValueNode; (function (AttributeValueNode) { function is(node) { return TypeNode.is(node) || AttributeTreeNode.is(node); } AttributeValueNode.is = is; })(AttributeValueNode || (AttributeValueNode = {})); var AttributeTreeNode; (function (AttributeTreeNode) { function destruct(node) { return { positional: node.children.find(AttributeTreePosValuesNode.is), named: node.children.find(AttributeTreeNamedValuesNode.is), }; } AttributeTreeNode.destruct = destruct; function is(node) { return (node?.type === 'mcdoc:attribute/tree'); } AttributeTreeNode.is = is; })(AttributeTreeNode || (AttributeTreeNode = {})); var AttributeTreePosValuesNode; (function (AttributeTreePosValuesNode) { function destruct(node) { return { values: node.children.filter(AttributeValueNode.is) }; } AttributeTreePosValuesNode.destruct = destruct; function is(node) { return (node?.type === 'mcdoc:attribute/tree/pos'); } AttributeTreePosValuesNode.is = is; })(AttributeTreePosValuesNode || (AttributeTreePosValuesNode = {})); var AttributeTreeNamedValuesNode; (function (AttributeTreeNamedValuesNode) { function destruct(node) { const ans = { values: [] }; let key; for (const child of node.children) { if (CommentNode.is(child)) { continue; } if (IdentifierNode.is(child) || StringNode.is(child)) { key = child; } else if (key) { ans.values.push({ key, value: child }); key = undefined; } } return ans; } AttributeTreeNamedValuesNode.destruct = destruct; function is(node) { return (node?.type === 'mcdoc:attribute/tree/named'); } AttributeTreeNamedValuesNode.is = is; })(AttributeTreeNamedValuesNode || (AttributeTreeNamedValuesNode = {})); var TypeArgBlockNode; (function (TypeArgBlockNode) { function destruct(node) { return { args: node.children.filter(TypeNode.is) }; } TypeArgBlockNode.destruct = destruct; function is(node) { return (node?.type === 'mcdoc:type_arg_block'); } TypeArgBlockNode.is = is; })(TypeArgBlockNode || (TypeArgBlockNode = {})); var AnyTypeNode; (function (AnyTypeNode) { function is(node) { return node?.type === 'mcdoc:type/any'; } AnyTypeNode.is = is; })(AnyTypeNode || (AnyTypeNode = {})); var BooleanTypeNode; (function (BooleanTypeNode) { function is(node) { return node?.type === 'mcdoc:type/boolean'; } BooleanTypeNode.is = is; })(BooleanTypeNode || (BooleanTypeNode = {})); var IntRangeNode; (function (IntRangeNode) { function destruct(node) { return destructRangeNode(node); } IntRangeNode.destruct = destruct; function is(node) { return node?.type === 'mcdoc:int_range'; } IntRangeNode.is = is; })(IntRangeNode || (IntRangeNode = {})); var LiteralTypeNode; (function (LiteralTypeNode) { function destruct(node) { return { value: node.children.find(LiteralTypeValueNode.is) }; } LiteralTypeNode.destruct = destruct; function is(node) { return node?.type === 'mcdoc:type/literal'; } LiteralTypeNode.is = is; })(LiteralTypeNode || (LiteralTypeNode = {})); var LiteralTypeValueNode; (function (LiteralTypeValueNode) { function is(node) { return (node_LiteralNode.is(node) || TypedNumberNode.is(node) || StringNode.is(node)); } LiteralTypeValueNode.is = is; })(LiteralTypeValueNode || (LiteralTypeValueNode = {})); var TypedNumberNode; (function (TypedNumberNode) { function destruct(node) { return { value: node.children.find(FloatNode.is) ?? node.children.find(IntegerNode.is), suffix: node.children.find(node_LiteralNode.is), }; } TypedNumberNode.destruct = destruct; function is(node) { return node?.type === 'mcdoc:typed_number'; } TypedNumberNode.is = is; })(TypedNumberNode || (TypedNumberNode = {})); var NumericTypeNode; (function (NumericTypeNode) { function destruct(node) { return { numericKind: node.children.find(node_LiteralNode.is), valueRange: node.children.find(FloatRangeNode.is) || node.children.find(IntRangeNode.is), }; } NumericTypeNode.destruct = destruct; function is(node) { return (node?.type === 'mcdoc:type/numeric_type'); } NumericTypeNode.is = is; })(NumericTypeNode || (NumericTypeNode = {})); const RangeExclusiveChar = '<'; var RangeKind; (function (RangeKind) { function isLeftExclusive(rangeKind) { return (rangeKind & 0b10) !== 0; } RangeKind.isLeftExclusive = isLeftExclusive; function isRightExclusive(rangeKind) { return (rangeKind & 0b01) !== 0; } RangeKind.isRightExclusive = isRightExclusive; })(RangeKind || (RangeKind = {})); function getRangeDelimiter(kind) { const prefix = kind & 0b10 ? RangeExclusiveChar : ''; const suffix = kind & 0b01 ? RangeExclusiveChar : ''; return `${prefix}..${suffix}`; } function destructRangeNode(node) { let kind; let min; let max; if (node.children.length === 1) { // a kind = 0b00; min = max = node.children[0]; } else if (node.children.length === 3) { // a..b kind = getKind(node.children[1]); min = node.children[0]; max = node.children[2]; } else if (node_LiteralNode.is(node.children[0])) { // ..b kind = getKind(node.children[0]); max = node.children[1]; } else { // a.. kind = getKind(node.children[1]); min = node.children[0]; } return { kind, min, max }; function getKind(delimiter) { let ans = 0b00; if (delimiter.value.startsWith(RangeExclusiveChar)) { ans |= 0b10; } if (delimiter.value.endsWith(RangeExclusiveChar)) { ans |= 0b01; } return ans; } } var FloatRangeNode; (function (FloatRangeNode) { function destruct(node) { return destructRangeNode(node); } FloatRangeNode.destruct = destruct; function is(node) { return node?.type === 'mcdoc:float_range'; } FloatRangeNode.is = is; })(FloatRangeNode || (FloatRangeNode = {})); var PrimitiveArrayTypeNode; (function (PrimitiveArrayTypeNode) { function destruct(node) { let lengthRange; let valueRange; let afterBrackets = false; for (const child of node.children) { if (node_LiteralNode.is(child) && child.value === '[]') { afterBrackets = true; } else if (IntRangeNode.is(child)) { if (afterBrackets) { lengthRange = child; } else { valueRange = child; } } } return { arrayKind: node.children.find(node_LiteralNode.is), lengthRange, valueRange }; } PrimitiveArrayTypeNode.destruct = destruct; function is(node) { return (node?.type === 'mcdoc:type/primitive_array'); } PrimitiveArrayTypeNode.is = is; })(PrimitiveArrayTypeNode || (PrimitiveArrayTypeNode = {})); var ListTypeNode; (function (ListTypeNode) { function destruct(node) { return { item: node.children.find(TypeNode.is), lengthRange: node.children.find(IntRangeNode.is), }; } ListTypeNode.destruct = destruct; function is(node) { return node?.type === 'mcdoc:type/list'; } ListTypeNode.is = is; })(ListTypeNode || (ListTypeNode = {})); var StringTypeNode; (function (StringTypeNode) { function destruct(node) { return { lengthRange: node.children.find(IntRangeNode.is) }; } StringTypeNode.destruct = destruct; function is(node) { return node?.type === 'mcdoc:type/string'; } StringTypeNode.is = is; })(StringTypeNode || (StringTypeNode = {})); var TupleTypeNode; (function (TupleTypeNode) { function destruct(node) { return { items: node.children.filter(TypeNode.is) }; } TupleTypeNode.destruct = destruct; function is(node) { return node?.type === 'mcdoc:type/tuple'; } TupleTypeNode.is = is; })(TupleTypeNode || (TupleTypeNode = {})); var EnumNode; (function (EnumNode) { EnumNode.Kinds = new Set(['byte', 'short', 'int', 'long', 'float', 'double', 'string']); function destruct(node) { return { block: node.children.find(EnumBlockNode.is), docComments: node.children.find(DocCommentsNode.is), enumKind: getEnumKind(node), identifier: node.children.find(IdentifierNode.is), keyword: node.children.find(node_LiteralNode.is), }; function getEnumKind(node) { for (const literal of node.children.filter(node_LiteralNode.is)) { if (EnumNode.Kinds.has(literal.value)) { return literal.value; } } return undefined; } } EnumNode.destruct = destruct; function is(node) { return node?.type === 'mcdoc:enum'; } EnumNode.is = is; })(EnumNode || (EnumNode = {})); var DocCommentsNode; (function (DocCommentsNode) { /** * @returns The text content of this doc comment block. */ function asText(node) { if (!node) { return undefined; } let comments = node.children.map((doc) => doc.comment); // If every comment contains a leading space or is empty, stripe the leading spaces off. // e.g. /// This is an example doc comment. // /// // /// Another line. // should be converted to "This is an example doc comment.\n\nAnother line." if (comments.every((s) => s.length === 0 || s.startsWith(' '))) { comments = comments.map((s) => s.slice(1)); } return comments.join('\n'); } DocCommentsNode.asText = asText; function is(node) { return node?.type === 'mcdoc:doc_comments'; } DocCommentsNode.is = is; })(DocCommentsNode || (DocCommentsNode = {})); var EnumBlockNode; (function (EnumBlockNode) { function destruct(node) { return { fields: node.children.filter(EnumFieldNode.is) }; } EnumBlockNode.destruct = destruct; function is(node) { return node?.type === 'mcdoc:enum/block'; } EnumBlockNode.is = is; })(EnumBlockNode || (EnumBlockNode = {})); var EnumFieldNode; (function (EnumFieldNode) { function destruct(node) { return { attributes: node.children.filter(AttributeNode.is), docComments: node.children.find(DocCommentsNode.is), identifier: node.children.find(IdentifierNode.is), value: node.children.find(EnumValueNode.is), }; } EnumFieldNode.destruct = destruct; function is(node) { return node?.type === 'mcdoc:enum/field'; } EnumFieldNode.is = is; })(EnumFieldNode || (EnumFieldNode = {})); var EnumValueNode; (function (EnumValueNode) { function is(node) { return TypedNumberNode.is(node) || StringNode.is(node); } EnumValueNode.is = is; })(EnumValueNode || (EnumValueNode = {})); var PrelimNode; (function (PrelimNode) { function is(node) { return AttributeNode.is(node) || DocCommentsNode.is(node); } PrelimNode.is = is; })(PrelimNode || (PrelimNode = {})); var StructNode; (function (StructNode) { function destruct(node) { return { block: node.children.find(StructBlockNode.is), docComments: node.children.find(DocCommentsNode.is), identifier: node.children.find(IdentifierNode.is), keyword: node.children.find(node_LiteralNode.is), }; } StructNode.destruct = destruct; function is(node) { return node?.type === 'mcdoc:struct'; } StructNode.is = is; })(StructNode || (StructNode = {})); var ReferenceTypeNode; (function (ReferenceTypeNode) { function destruct(node) { return { path: node.children.find(PathNode.is) }; } ReferenceTypeNode.destruct = destruct; function is(node) { return (node?.type === 'mcdoc:type/reference'); } ReferenceTypeNode.is = is; })(ReferenceTypeNode || (ReferenceTypeNode = {})); var TypeParamBlockNode; (function (TypeParamBlockNode) { function destruct(node) { return { params: node.children.filter(TypeParamNode.is) }; } TypeParamBlockNode.destruct = destruct; function is(node) { return (node?.type === 'mcdoc:type_param_block'); } TypeParamBlockNode.is = is; })(TypeParamBlockNode || (TypeParamBlockNode = {})); var TypeParamNode; (function (TypeParamNode) { function destruct(node) { return { // constraint: node.children.find(TypeNode.is), identifier: node.children.find(IdentifierNode.is), }; } TypeParamNode.destruct = destruct; function is(node) { return node?.type === 'mcdoc:type_param'; } TypeParamNode.is = is; })(TypeParamNode || (TypeParamNode = {})); var PathNode; (function (PathNode) { function destruct(node) { const lastChild = atArray(node?.children, -1); return { children: node?.children ?? [], isAbsolute: node?.isAbsolute, lastIdentifier: IdentifierNode.is(lastChild) ? lastChild : undefined, }; } PathNode.destruct = destruct; function is(node) { return node?.type === 'mcdoc:path'; } PathNode.is = is; })(PathNode || (PathNode = {})); var StructBlockNode; (function (StructBlockNode) { function destruct(node) { return { fields: node.children.filter(StructFieldNode.is) }; } StructBlockNode.destruct = destruct; function is(node) { return node?.type === 'mcdoc:struct/block'; } StructBlockNode.is = is; })(StructBlockNode || (StructBlockNode = {})); var StructFieldNode; (function (StructFieldNode) { function is(node) { return StructPairFieldNode.is(node) || StructSpreadFieldNode.is(node); } StructFieldNode.is = is; })(StructFieldNode || (StructFieldNode = {})); var StructPairFieldNode; (function (StructPairFieldNode) { function destruct(node) { return { attributes: node.children.filter(AttributeNode.is), docComments: node.children.find(DocCommentsNode.is), key: node.children.find(StructKeyNode.is), type: node.children.find(TypeNode.is), isOptional: node.isOptional, }; } StructPairFieldNode.destruct = destruct; function is(node) { return (node?.type === 'mcdoc:struct/field/pair'); } StructPairFieldNode.is = is; })(StructPairFieldNode || (StructPairFieldNode = {})); var StructKeyNode; (function (StructKeyNode) { function is(node) { return (StringNode.is(node) || IdentifierNode.is(node) || StructMapKeyNode.is(node)); } StructKeyNode.is = is; })(StructKeyNode || (StructKeyNode = {})); var StructMapKeyNode; (function (StructMapKeyNode) { function destruct(node) { return { type: node.children.find(TypeNode.is) }; } StructMapKeyNode.destruct = destruct; function is(node) { return (node?.type === 'mcdoc:struct/map_key'); } StructMapKeyNode.is = is; })(StructMapKeyNode || (StructMapKeyNode = {})); var StructSpreadFieldNode; (function (StructSpreadFieldNode) { function destruct(node) { return { attributes: node.children.filter(AttributeNode.is), type: node.children.find(TypeNode.is), }; } StructSpreadFieldNode.destruct = destruct; function is(node) { return (node?.type === 'mcdoc:struct/field/spread'); } StructSpreadFieldNode.is = is; })(StructSpreadFieldNode || (StructSpreadFieldNode = {})); var DispatcherTypeNode; (function (DispatcherTypeNode) { function destruct(node) { return { location: node.children.find(ResourceLocationNode.is), index: node.children.find(IndexBodyNode.is), }; } DispatcherTypeNode.destruct = destruct; function is(node) { return (node?.type === 'mcdoc:type/dispatcher'); } DispatcherTypeNode.is = is; })(DispatcherTypeNode || (DispatcherTypeNode = {})); var UnionTypeNode; (function (UnionTypeNode) { function destruct(node) { return { members: node.children.filter(TypeNode.is) }; } UnionTypeNode.destruct = destruct; function is(node) { return node?.type === 'mcdoc:type/union'; } UnionTypeNode.is = is; })(UnionTypeNode || (UnionTypeNode = {})); var InjectionNode; (function (InjectionNode) { function destruct(node) { return { injection: node.children.find(InjectionContentNode.is) }; } InjectionNode.destruct = destruct; function is(node) { return node?.type === 'mcdoc:injection'; } InjectionNode.is = is; })(InjectionNode || (InjectionNode = {})); var InjectionContentNode; (function (InjectionContentNode) { function is(node) { return EnumInjectionNode.is(node) || StructInjectionNode.is(node); } InjectionContentNode.is = is; })(InjectionContentNode || (InjectionContentNode = {})); var EnumInjectionNode; (function (EnumInjectionNode) { function is(node) { return (node?.type === 'mcdoc:injection/enum'); } EnumInjectionNode.is = is; })(EnumInjectionNode || (EnumInjectionNode = {})); var StructInjectionNode; (function (StructInjectionNode) { function is(node) { return (node?.type === 'mcdoc:injection/struct'); } StructInjectionNode.is = is; })(StructInjectionNode || (StructInjectionNode = {})); var TypeAliasNode; (function (TypeAliasNode) { function destruct(node) { return { attributes: node.children.filter(AttributeNode.is), docComments: node.children.find(DocCommentsNode.is), identifier: node.children.find(IdentifierNode.is), keyword: node.children.find(node_LiteralNode.is), typeParams: node.children.find(TypeParamBlockNode.is), rhs: node.children.find(TypeNode.is), }; } TypeAliasNode.destruct = destruct; function is(node) { return node?.type === 'mcdoc:type_alias'; } TypeAliasNode.is = is; })(TypeAliasNode || (TypeAliasNode = {})); var UseStatementNode; (function (UseStatementNode) { function destruct(node) { return { binding: node.children.find(IdentifierNode.is), path: node.children.find(PathNode.is), }; } UseStatementNode.destruct = destruct; function is(node) { return (node?.type === 'mcdoc:use_statement'); } UseStatementNode.is = is; })(UseStatementNode || (UseStatementNode = {})); //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/binder/index.js var ModuleSymbolData; (function (ModuleSymbolData) { function is(data) { return (!!data && typeof data === 'object' && typeof data.nextAnonymousIndex === 'number'); } ModuleSymbolData.is = is; })(ModuleSymbolData || (ModuleSymbolData = {})); var TypeDefSymbolData; (function (TypeDefSymbolData) { function is(data) { return (!!data && typeof data === 'object' && typeof data.typeDef === 'object'); } TypeDefSymbolData.is = is; })(TypeDefSymbolData || (TypeDefSymbolData = {})); const fileModule = AsyncBinder.create(async (node, ctx) => { const moduleIdentifier = uriToIdentifier(ctx.doc.uri, ctx); if (!moduleIdentifier) { ctx.err.report(localize('mcdoc.binder.out-of-root', localeQuote(ctx.doc.uri)), Range.Beginning, 0 /* ErrorSeverity.Hint */); return; } const mcdocCtx = { ...ctx, moduleIdentifier }; return module_(node, mcdocCtx); }); async function module_(node, ctx) { const data = { nextAnonymousIndex: 0 }; ctx.symbols.query({ doc: ctx.doc, node }, 'mcdoc', ctx.moduleIdentifier).amend({ data: { data }, }); hoist(node, { ...ctx, isHoisting: true }); for (const child of node.children) { switch (child.type) { case 'mcdoc:dispatch_statement': await bindDispatchStatement(child, ctx); break; case 'mcdoc:enum': bindEnum(child, ctx); break; case 'mcdoc:injection': await bindInjection(child, ctx); break; case 'mcdoc:struct': await bindStruct(child, ctx); break; case 'mcdoc:type_alias': await bindTypeAlias(child, ctx); break; case 'mcdoc:use_statement': await bindUseStatement(child, ctx); break; } } } /** * Hoist enums, structs, type aliases, and use statements under the module scope. */ function hoist(node, ctx) { traversePreOrder(node, () => true, TopLevelNode.is, (child) => { switch (child.type) { case 'mcdoc:enum': hoistEnum(child); break; case 'mcdoc:struct': hoistStruct(child); break; case 'mcdoc:type_alias': hoistTypeAlias(child); break; case 'mcdoc:use_statement': hoistUseStatement(child); break; } }); function hoistEnum(node) { hoistFor('enum', node, EnumNode.destruct, (n) => ({ typeDef: convertEnum(n, ctx) })); } function hoistStruct(node) { hoistFor('struct', node, StructNode.destruct, (n) => ({ typeDef: convertStruct(n, ctx) })); } function hoistTypeAlias(node) { hoistFor('type_alias', node, TypeAliasNode.destruct, (n) => { const { attributes, rhs, typeParams } = TypeAliasNode.destruct(n); if (!rhs) { return undefined; } const ans = { typeDef: convertType(rhs, ctx) }; if (typeParams) { bindTypeParamBlock(node, typeParams, ans, ctx); } appendAttributes(ans.typeDef, attributes, ctx); return ans; }); } function hoistUseStatement(node) { const { binding, path } = UseStatementNode.destruct(node); if (!path) { return; } const { lastIdentifier } = PathNode.destruct(path); const identifier = binding ?? lastIdentifier; if (!identifier) { return; } // hoistUseStatement associates the AST node with the binding definition in the file symbol table, // which will get overridden by bindUseStatement in the later stage as an reference to the imported symbol in the global symbol table. // This way when the user tries to go to definition on the path in the use statement, // they will go to the definition in the imported file. const target = resolvePath(path, ctx); ctx.symbols.query({ doc: ctx.doc, node }, 'mcdoc', `${ctx.moduleIdentifier}::${identifier.value}`).ifDeclared((symbol) => reportDuplicatedDeclaration(ctx, symbol, identifier)).elseEnter({ data: { subcategory: 'use_statement_binding', visibility: 1 /* SymbolVisibility.File */, data: target ? { target } : undefined, }, usage: { type: 'definition', node: identifier, fullRange: node }, }); } function hoistFor(subcategory, node, destructor, getData) { const { docComments, identifier, keyword } = destructor(node); const name = identifier?.value ?? nextAnonymousIdentifier(node, ctx); ctx.symbols.query({ doc: ctx.doc, node }, 'mcdoc', `${ctx.moduleIdentifier}::${name}`) .ifDeclared((symbol) => reportDuplicatedDeclaration(ctx, symbol, identifier ?? node)) .elseEnter({ data: { data: getData(node), desc: DocCommentsNode.asText(docComments), subcategory }, // If the current syntax structure is named, then the identifier node is entered as a definition; // otherwise, an anonymous identifier is generated for the symbol and the keyword node is entered as a definition. usage: { type: 'definition', node: identifier ?? keyword, fullRange: identifier && node, }, }); } function nextAnonymousIndex(node, ctx) { const data = ctx.symbols.query({ doc: ctx.doc, node }, 'mcdoc', ctx.moduleIdentifier).getData(ModuleSymbolData.is); if (!data) { throw new Error(`No symbol data for module '${ctx.moduleIdentifier}'`); } return data.nextAnonymousIndex++; } function nextAnonymousIdentifier(node, ctx) { return ``; } } /** * Bind the type param block of a parent node, and modifies the `data` argument in-place to change its `typeDef` to be of template kind. */ function bindTypeParamBlock(node, typeParams, data, ctx) { // Type parameters are added as local symbols on the type alias AST node. // Thus we create a new local scope on the type alias statement node first. node.locals = Object.create(null); // They are also added to the type definition. data.typeDef = { kind: 'template', child: data.typeDef, typeParams: [] }; const { params } = TypeParamBlockNode.destruct(typeParams); for (const param of params) { const { identifier: paramIdentifier } = TypeParamNode.destruct(param); if (paramIdentifier.value) { // Add the type parameter as a local symbol. const paramPath = `${ctx.moduleIdentifier}::${paramIdentifier.value}`; ctx.symbols.query({ doc: ctx.doc, node }, 'mcdoc', paramPath).ifDeclared((symbol) => reportDuplicatedDeclaration(ctx, symbol, paramIdentifier)).elseEnter({ data: { visibility: 0 /* SymbolVisibility.Block */ }, usage: { type: 'declaration', node: paramIdentifier, fullRange: param }, }); // Also add it to the type definition. data.typeDef.typeParams.push({ path: paramPath }); } // if (constraint) { // await bindPath(constraint, ctx) // } } } async function bindDispatchStatement(node, ctx) { const { attributes, location, index, target, typeParams } = DispatchStatementNode.destruct(node); if (!(location && index && target)) { return; } const locationStr = ResourceLocationNode.toString(location, 'full'); ctx.symbols.query(ctx.doc, 'mcdoc/dispatcher', locationStr).enter({ usage: { type: 'reference', node: location, fullRange: node }, }); const { parallelIndices } = IndexBodyNode.destruct(index); if (parallelIndices.length) { const data = { typeDef: convertType(target, ctx) }; if (typeParams) { bindTypeParamBlock(node, typeParams, data, ctx); } appendAttributes(data.typeDef, attributes, ctx); for (const key of parallelIndices) { if (DynamicIndexNode.is(key)) { // Ignore dynamic indices in dispatch statements. continue; } ctx.symbols.query(ctx.doc, 'mcdoc/dispatcher', locationStr, asString(key)).ifDeclared((symbol) => reportDuplicatedDeclaration(ctx, symbol, key, { localeString: 'mcdoc.binder.dispatcher-statement.duplicated-key', })).elseEnter({ data: { data }, usage: { type: 'definition', node: key, fullRange: node } }); } } await bindType(target, ctx); } async function bindType(node, ctx) { if (DispatcherTypeNode.is(node)) { await bindDispatcherType(node, ctx); } else if (EnumNode.is(node)) { bindEnum(node, ctx); } else if (ListTypeNode.is(node)) { const { item } = ListTypeNode.destruct(node); await bindType(item, ctx); } else if (ReferenceTypeNode.is(node)) { const { path } = ReferenceTypeNode.destruct(node); await bindPath(path, ctx); } else if (StructNode.is(node)) { await bindStruct(node, ctx); } else if (TupleTypeNode.is(node)) { const { items } = TupleTypeNode.destruct(node); for (const item of items) { await bindType(item, ctx); } } else if (UnionTypeNode.is(node)) { const { members } = UnionTypeNode.destruct(node); for (const member of members) { await bindType(member, ctx); } } const { appendixes } = TypeBaseNode.destruct(node); for (const appendix of appendixes) { if (TypeArgBlockNode.is(appendix)) { const { args } = TypeArgBlockNode.destruct(appendix); for (const arg of args) { await bindType(arg, ctx); } } } } async function bindDispatcherType(node, ctx) { const { index, location } = DispatcherTypeNode.destruct(node); const locationStr = ResourceLocationNode.toString(location, 'full'); ctx.symbols.query(ctx.doc, 'mcdoc/dispatcher', locationStr).enter({ usage: { type: 'reference', node: location, fullRange: node }, }); const { parallelIndices } = IndexBodyNode.destruct(index); for (const key of parallelIndices) { if (DynamicIndexNode.is(key)) { // Although it is technically possible to bind some of the dynamic indices as references // of struct keys, it is rather complicated to do so. We will ignore them for now. continue; } ctx.symbols.query(ctx.doc, 'mcdoc/dispatcher', locationStr, asString(key)).enter({ usage: { type: 'reference', node: key, fullRange: node }, }); } } async function bindPath(node, ctx) { for (const { identifiers, node: identNode, indexRight } of resolvePathByStep(node, ctx, { reportErrors: true, })) { if (!identifiers?.length) { continue; } if (indexRight === 1) { // The second last identifier in a path points to a file module. const referencedModuleFile = pathArrayToString(identifiers); const referencedModuleUri = identifierToUri(referencedModuleFile, ctx); if (!referencedModuleUri) { ctx.err.report(localize('mcdoc.binder.path.unknown-module', localeQuote(referencedModuleFile)), node, 2 /* ErrorSeverity.Warning */); return; } await ctx.ensureBindingStarted(referencedModuleUri); } ctx.symbols.query({ doc: ctx.doc, node: identNode }, 'mcdoc', pathArrayToString(identifiers)) .ifDeclared((_, query) => query.enter({ usage: { type: 'reference', node: identNode, fullRange: node, skipRenaming: node_LiteralNode.is(identNode), }, })).else(() => { if (indexRight === 0) { ctx.err.report(localize('mcdoc.binder.path.unknown-identifier', localeQuote(atArray(identifiers, -1)), localeQuote(pathArrayToString(identifiers.slice(0, -1)))), node, 2 /* ErrorSeverity.Warning */); } }); } } function bindEnum(node, ctx) { const { block, identifier, keyword } = EnumNode.destruct(node); const symbol = identifier?.symbol ?? keyword.symbol; if (symbol?.subcategory !== 'enum') { return; } const query = ctx.symbols.query({ doc: ctx.doc, node }, 'mcdoc', ...symbol.path); Dev.assertDefined(query.symbol); bindEnumBlock(block, ctx, query); } function bindEnumBlock(node, ctx, query, options = {}) { const { fields } = EnumBlockNode.destruct(node); for (const field of fields) { const { identifier } = EnumFieldNode.destruct(field); query.member(identifier.value, (fieldQuery) => fieldQuery.ifDeclared((symbol) => reportDuplicatedDeclaration(ctx, symbol, identifier)) .elseEnter({ usage: { type: 'definition', node: identifier, fullRange: field } })); } } async function bindInjection(node, ctx) { const { injection } = InjectionNode.destruct(node); if (EnumInjectionNode.is(injection)) { // TODO // const { } = EnumInjectionNode.destruct(injection) // bindEnumBlock(block, ctx, query, { extendsTypeDefData: true }) } } async function bindStruct(node, ctx) { const { block, identifier, keyword } = StructNode.destruct(node); const symbol = identifier?.symbol ?? keyword.symbol; if (symbol?.subcategory !== 'struct') { return; } const query = ctx.symbols.query({ doc: ctx.doc, node }, 'mcdoc', ...symbol.path); Dev.assertDefined(query.symbol); await bindStructBlock(block, ctx, query); } async function bindStructBlock(node, ctx, query, options = {}) { const { fields } = StructBlockNode.destruct(node); for (const field of fields) { if (StructPairFieldNode.is(field)) { const { key, type } = StructPairFieldNode.destruct(field); if (!StructMapKeyNode.is(key)) { query.member(key.value, (fieldQuery) => fieldQuery.ifDeclared((symbol) => reportDuplicatedDeclaration(ctx, symbol, key)) .elseEnter({ usage: { type: 'definition', node: key, fullRange: field } })); } await bindType(type, ctx); } else { const { type } = StructSpreadFieldNode.destruct(field); await bindType(type, ctx); } } } async function bindTypeAlias(node, ctx) { const { identifier, rhs, typeParams } = TypeAliasNode.destruct(node); if (!identifier?.value) { return; } if (rhs) { await bindType(rhs, ctx); } } async function bindUseStatement(node, ctx) { const { path } = UseStatementNode.destruct(node); if (!path) { return; } return bindPath(path, ctx); } function registerMcdocBinders(meta) { meta.registerBinder('mcdoc:module', fileModule); } function reportDuplicatedDeclaration(ctx, symbol, range, options = { localeString: 'mcdoc.binder.duplicated-declaration' }) { ctx.err.report(localize(options.localeString, localeQuote(symbol.identifier)), range, 2 /* ErrorSeverity.Warning */, { related: [{ location: SymbolUtil.getDeclaredLocation(symbol), message: localize(`${options.localeString}.related`, localeQuote(symbol.identifier)), }], }); } function* resolvePathByStep(path, ctx, options = {}) { const { children, isAbsolute } = PathNode.destruct(path); let identifiers = isAbsolute ? [] : pathStringToArray(ctx.moduleIdentifier); for (const [i, child] of children.entries()) { const indexRight = children.length - 1 - i; switch (child.type) { case 'mcdoc:identifier': // For a path node with `n` children, the first `n-1` child nodes specify // the path of the module that contains the symbol. They will be pushed // to the `identifiers` array and yielded as-is. The last node, however, // may be created by a use statement and points to a global symbol // in a different file. We will query the symbol table and rewrite // the `identifiers` array to be the target path if needed. identifiers.push(child.value); if (indexRight === 0) { ctx.symbols.query({ doc: ctx.doc, node: child }, 'mcdoc', pathArrayToString(identifiers)).ifDeclared((symbol) => { const data = symbol.data; if (data?.target) { identifiers = [...data.target]; } }); } break; case 'mcdoc:literal': // super if (identifiers.length === 0) { if (options.reportErrors) { ctx.err.report(localize('mcdoc.binder.path.super-from-root'), child); } return; } identifiers.pop(); break; default: Dev.assertNever(child); } yield { identifiers, node: child, index: i, indexRight }; } } function resolvePath(path, ctx, options = {}) { return atArray([...resolvePathByStep(path, ctx, options)], -1)?.identifiers; } function identifierToUri(module, ctx) { return ctx.symbols.global.mcdoc?.[module]?.definition?.[0]?.uri; } function uriToIdentifier(uri, ctx) { return Object.values(ctx.symbols.global.mcdoc ?? {}).find((symbol) => { return (symbol.subcategory === 'module' && symbol.definition?.some((loc) => loc.uri === uri)); })?.identifier; } function pathArrayToString(path) { return path ? `::${path.join('::')}` : undefined; } function pathStringToArray(path) { if (!path.startsWith('::')) { throw new Error('Only absolute paths are supported'); } return path.slice(2).split('::'); } function convertType(node, ctx) { switch (node.type) { case 'mcdoc:enum': return convertEnum(node, ctx); case 'mcdoc:struct': return convertStruct(node, ctx); case 'mcdoc:type/any': return convertAny(node, ctx); case 'mcdoc:type/boolean': return convertBoolean(node, ctx); case 'mcdoc:type/dispatcher': return convertDispatcher(node, ctx); case 'mcdoc:type/list': return convertList(node, ctx); case 'mcdoc:type/literal': return convertLiteral(node, ctx); case 'mcdoc:type/numeric_type': return convertNumericType(node, ctx); case 'mcdoc:type/primitive_array': return convertPrimitiveArray(node, ctx); case 'mcdoc:type/string': return convertString(node, ctx); case 'mcdoc:type/reference': return convertReference(node, ctx); case 'mcdoc:type/tuple': return convertTuple(node, ctx); case 'mcdoc:type/union': return convertUnion(node, ctx); default: return Dev.assertNever(node); } } function wrapType(node, type, ctx, options = {}) { const { attributes, appendixes } = TypeBaseNode.destruct(node); let ans = type; for (const appendix of appendixes) { if (IndexBodyNode.is(appendix)) { if (options.skipFirstIndexBody) { options.skipFirstIndexBody = false; continue; } ans = { kind: 'indexed', child: ans, parallelIndices: convertIndexBody(appendix, ctx) }; } else { ans = { kind: 'concrete', child: ans, typeArgs: convertTypeArgBlock(appendix, ctx) }; } } ans.attributes = convertAttributes(attributes, ctx); return ans; } function appendAttributes(typeDef, attributes, ctx) { const convertedAttributes = convertAttributes(attributes, ctx); if (convertedAttributes) { if (typeDef.attributes) { typeDef.attributes = [...typeDef.attributes, ...convertedAttributes]; } else { typeDef.attributes = convertedAttributes; } } } function convertAttributes(nodes, ctx) { return undefineEmptyArray(nodes.map((n) => convertAttribute(n, ctx))); } function undefineEmptyArray(array) { return array.length ? array : undefined; } function convertAttribute(node, ctx) { const { name, value } = AttributeNode.destruct(node); return { name: name.value, value: value && convertAttributeValue(value, ctx) }; } function convertAttributeValue(node, ctx) { if (node.type === 'mcdoc:attribute/tree') { return { kind: 'tree', values: convertAttributeTree(node, ctx) }; } else { return convertType(node, ctx); } } function convertAttributeTree(node, ctx) { const ans = {}; const { named, positional } = AttributeTreeNode.destruct(node); if (positional) { const { values } = AttributeTreePosValuesNode.destruct(positional); for (const [i, child] of values.entries()) { ans[i] = convertAttributeValue(child, ctx); } } if (named) { const { values } = AttributeTreeNamedValuesNode.destruct(named); for (const { key, value } of values) { ans[key.value] = convertAttributeValue(value, ctx); } } return ans; } function convertIndexBodies(nodes, ctx) { return undefineEmptyArray(nodes.map((n) => convertIndexBody(n, ctx))); } function convertIndexBody(node, ctx) { const { parallelIndices } = IndexBodyNode.destruct(node); return parallelIndices.map((n) => convertIndex(n, ctx)); } function convertIndex(node, ctx) { return StaticIndexNode.is(node) ? convertStaticIndex(node, ctx) : convertDynamicIndex(node, ctx); } function convertStaticIndex(node, ctx) { return { kind: 'static', value: asString(node) }; } function convertDynamicIndex(node, ctx) { const { keys } = DynamicIndexNode.destruct(node); return { kind: 'dynamic', accessor: keys.map(key => { if (node_LiteralNode.is(key) && key.value.startsWith('%')) { return { keyword: key.value.slice(1) }; } return asString(key); }), }; } function convertTypeArgBlock(node, ctx) { const { args } = TypeArgBlockNode.destruct(node); return args.map((a) => convertType(a, ctx)); } function convertEnum(node, ctx) { const { block, enumKind, identifier } = EnumNode.destruct(node); // Return reference if the enum has been hoisted if (identifier && !ctx.isHoisting) { return wrapType(node, { kind: 'reference', path: `${ctx.moduleIdentifier}::${identifier.value}`, }, ctx); } // Shortcut if the typeDef has been added to the enum symbol. const symbol = identifier?.symbol ?? node.symbol; if (symbol && TypeDefSymbolData.is(symbol.data) && symbol.data.typeDef.kind === 'enum') { return symbol.data.typeDef; } return wrapType(node, { kind: 'enum', enumKind, values: convertEnumBlock(block, ctx) }, ctx); } function convertEnumBlock(node, ctx) { const { fields } = EnumBlockNode.destruct(node); return fields.map((n) => convertEnumField(n, ctx)); } function convertEnumField(node, ctx) { const { attributes, docComments, identifier, value } = EnumFieldNode.destruct(node); return { attributes: convertAttributes(attributes, ctx), desc: DocCommentsNode.asText(docComments), identifier: identifier.value, value: convertEnumValue(value, ctx), }; } function convertEnumValue(node, ctx) { if (TypedNumberNode.is(node)) { const { value } = TypedNumberNode.destruct(node); return value.value; } return node.value; } function convertStruct(node, ctx) { const { block, identifier } = StructNode.destruct(node); // Return reference if the struct has been hoisted if (identifier && !ctx.isHoisting) { return wrapType(node, { kind: 'reference', path: `${ctx.moduleIdentifier}::${identifier.value}`, }, ctx); } // Shortcut if the typeDef has been added to the struct symbol. const symbol = identifier?.symbol ?? node.symbol; if (symbol && TypeDefSymbolData.is(symbol.data) && symbol.data.typeDef.kind === 'struct') { return symbol.data.typeDef; } return wrapType(node, { kind: 'struct', fields: convertStructBlock(block, ctx) }, ctx); } function convertStructBlock(node, ctx) { const { fields } = StructBlockNode.destruct(node); return fields.map((n) => convertStructField(n, ctx)); } function convertStructField(node, ctx) { return StructPairFieldNode.is(node) ? convertStructPairField(node, ctx) : convertStructSpreadField(node, ctx); } function convertStructPairField(node, ctx) { const { attributes, docComments, key, type, isOptional } = StructPairFieldNode.destruct(node); return { kind: 'pair', attributes: convertAttributes(attributes, ctx), desc: DocCommentsNode.asText(docComments), key: convertStructKey(key, ctx), type: convertType(type, ctx), optional: isOptional, }; } function convertStructKey(node, ctx) { if (StructMapKeyNode.is(node)) { const { type } = StructMapKeyNode.destruct(node); return convertType(type, ctx); } else { return asString(node); } } function convertStructSpreadField(node, ctx) { const { attributes, type } = StructSpreadFieldNode.destruct(node); return { kind: 'spread', attributes: convertAttributes(attributes, ctx), type: convertType(type, ctx), }; } function convertAny(node, ctx) { return wrapType(node, { kind: 'any' }, ctx); } function convertBoolean(node, ctx) { return wrapType(node, { kind: 'boolean' }, ctx); } function convertDispatcher(node, ctx) { const { index, location } = DispatcherTypeNode.destruct(node); return wrapType(node, { kind: 'dispatcher', parallelIndices: convertIndexBody(index, ctx), registry: ResourceLocationNode.toString(location, 'full'), }, ctx, { skipFirstIndexBody: true }); } function convertList(node, ctx) { const { item, lengthRange } = ListTypeNode.destruct(node); return wrapType(node, { kind: 'list', item: convertType(item, ctx), lengthRange: convertRange(lengthRange, ctx), }, ctx); } function convertRange(node, ctx) { if (!node) { return undefined; } const { kind, min, max } = FloatRangeNode.is(node) ? FloatRangeNode.destruct(node) : IntRangeNode.destruct(node); return { kind, min: min?.value, max: max?.value }; } function convertLiteral(node, ctx) { const { value } = LiteralTypeNode.destruct(node); return wrapType(node, { kind: 'literal', value: convertLiteralValue(value, ctx) }, ctx); } function convertLiteralValue(node, ctx) { if (node_LiteralNode.is(node)) { return { kind: 'boolean', value: node.value === 'true' }; } else if (TypedNumberNode.is(node)) { const { suffix, value } = TypedNumberNode.destruct(node); return { kind: convertLiteralNumberSuffix(suffix, ctx) ?? (value.type === 'integer' ? 'int' : 'double'), value: value.value, }; } else { return { kind: 'string', value: node.value }; } } function convertLiteralNumberSuffix(node, ctx) { const suffix = node?.value; switch (suffix?.toLowerCase()) { case 'b': return 'byte'; case 's': return 'short'; case 'l': return 'long'; case 'f': return 'float'; case 'd': return 'double'; default: return undefined; } } function convertNumericType(node, ctx) { const { numericKind, valueRange } = NumericTypeNode.destruct(node); return wrapType(node, { kind: numericKind.value, valueRange: convertRange(valueRange, ctx), }, ctx); } function convertPrimitiveArray(node, ctx) { const { arrayKind, lengthRange, valueRange } = PrimitiveArrayTypeNode.destruct(node); return wrapType(node, { kind: `${arrayKind.value}_array`, lengthRange: convertRange(lengthRange, ctx), valueRange: convertRange(valueRange, ctx), }, ctx); } function convertString(node, ctx) { const { lengthRange } = StringTypeNode.destruct(node); return wrapType(node, { kind: 'string', lengthRange: convertRange(lengthRange, ctx) }, ctx); } function convertReference(node, ctx) { const { path } = ReferenceTypeNode.destruct(node); return wrapType(node, { kind: 'reference', path: pathArrayToString(resolvePath(path, ctx)) }, ctx); } function convertTuple(node, ctx) { const { items } = TupleTypeNode.destruct(node); return wrapType(node, { kind: 'tuple', items: items.map((n) => convertType(n, ctx)) }, ctx); } function convertUnion(node, ctx) { const { members } = UnionTypeNode.destruct(node); return wrapType(node, { kind: 'union', members: members.map((n) => convertType(n, ctx)) }, ctx); } function asString(node) { if (ResourceLocationNode.is(node)) { return ResourceLocationNode.toString(node, 'short'); } return node.value; } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/colorizer/index.js const identifier = (node) => { return [ColorToken.create(node, 'variable')]; }; const colorizer_literal = (node) => { return [ColorToken.create(node, node.colorTokenType ?? 'literal')]; }; function registerMcdocColorizer(meta) { meta.registerColorizer('mcdoc:literal', colorizer_literal); meta.registerColorizer('mcdoc:identifier', identifier); } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/type/index.js var Attributes; (function (Attributes) { function equals(a, b) { if (a?.length !== b?.length) { return false; } if (!a || !b) { return true; } for (let i = 0; i < a.length; i++) { if (!Attribute.equals(a[i], b[i])) { return false; } } return true; } Attributes.equals = equals; })(Attributes || (Attributes = {})); var Attribute; (function (Attribute) { function equals(a, b) { if (a.name !== b.name) { return false; } if (a.value && b.value) { return AttributeValue.equals(a.value, b.value); } return a.value === b.value; } Attribute.equals = equals; })(Attribute || (Attribute = {})); var AttributeValue; (function (AttributeValue) { function equals(a, b) { if (a.kind !== b.kind) { return false; } if (a.kind === 'tree') { if (Object.keys(a.values).length !== Object.keys(b.values).length) { return false; } for (const kvp of Object.entries(a.values)) { const other = b.values[kvp[0]]; if (!other) { return false; } if (!equals(kvp[1], other)) { return false; } } return true; } else { return McdocType.equals(a, b); } } AttributeValue.equals = equals; })(AttributeValue || (AttributeValue = {})); var NumericRange; (function (NumericRange) { function isInRange(range, val) { const { min = -Infinity, max = Infinity } = range; if (RangeKind.isLeftExclusive(range.kind) ? val <= min : val < min) { return false; } if (RangeKind.isRightExclusive(range.kind) ? val >= max : val > max) { return false; } return true; } NumericRange.isInRange = isInRange; function equals(a, b) { return a.kind === b.kind && a.min === b.min && a.max === b.max; } NumericRange.equals = equals; function intersect(a, b) { const min = a.min !== undefined && b.min !== undefined ? Math.max(a.min, b.min) : a.min !== undefined ? a.min : b.min; const max = a.max !== undefined && b.max !== undefined ? Math.min(a.max, b.max) : a.max !== undefined ? a.max : b.max; let kind = 0b00; if (min === a.min && RangeKind.isLeftExclusive(a.kind)) { kind |= 0b10; } else if (min === b.min && RangeKind.isLeftExclusive(b.kind)) { kind |= 0b10; } if (max === a.max && RangeKind.isRightExclusive(a.kind)) { kind |= 0b01; } else if (max === b.max && RangeKind.isRightExclusive(b.kind)) { kind |= 0b01; } return { kind: kind, min, max }; } NumericRange.intersect = intersect; function toString({ kind, min, max }) { return min === max && kind === 0b00 ? min !== undefined ? `${min}` : getRangeDelimiter(kind) : `${min ?? ''}${getRangeDelimiter(kind)}${max ?? ''}`; } NumericRange.toString = toString; })(NumericRange || (NumericRange = {})); const StaticIndexKeywords = Object.freeze(['fallback', 'none', 'unknown', 'spawnitem', 'blockitem']); var ParallelIndices; (function (ParallelIndices) { function equals(a, b) { if (a.length !== b.length) { return false; } for (let i = 0; i < a.length; i++) { const first = a[i]; const second = b[i]; if (first.kind !== second.kind) { return false; } if (first.kind === 'static') { return first.value !== second.value; } if (first.accessor.length !== second.accessor.length) { return false; } for (let j = 0; j < first.accessor.length; j++) { const firstAcc = first.accessor[j]; const secondAcc = second.accessor[j]; if (typeof firstAcc === 'string' || typeof secondAcc === 'string') { if (firstAcc !== secondAcc) { return false; } } else if (firstAcc.keyword !== secondAcc.keyword) { return false; } } } return true; } ParallelIndices.equals = equals; })(ParallelIndices || (ParallelIndices = {})); const EmptyUnion = Object.freeze({ kind: 'union', members: [] }); function createEmptyUnion(attributes) { return { ...EmptyUnion, // attributes, }; } const NumericTypeIntKinds = Object.freeze(['byte', 'short', 'int', 'long']); const NumericTypeFloatKinds = Object.freeze(['float', 'double']); const NumericTypeKinds = Object.freeze([...NumericTypeIntKinds, ...NumericTypeFloatKinds]); const PrimitiveArrayValueKinds = Object.freeze(['byte', 'int', 'long']); const PrimitiveArrayKinds = Object.freeze(PrimitiveArrayValueKinds.map((kind) => `${kind}_array`)); var McdocType; (function (McdocType) { function equals(a, b) { if (a.kind !== b.kind) { return false; } if (!Attributes.equals(a.attributes, b.attributes)) { return false; } switch (a.kind) { case 'literal': return a.value.kind === b.value.kind && a.value.value === b.value.value; case 'byte': case 'short': case 'int': case 'long': case 'float': case 'double': return a.valueRange === b.valueRange; case 'string': return a.lengthRange === b.lengthRange; case 'byte_array': case 'int_array': case 'long_array': return a.lengthRange === b.lengthRange && a.valueRange === b.valueRange; case 'list': return a.lengthRange === b.lengthRange && equals(a.item, b.item); case 'tuple': if (a.items.length !== b.items.length) { return false; } for (let i = 0; i < a.items.length; i++) { if (!equals(a.items[i], b.items[i])) { return false; } } return true; case 'struct': return a.fields.length === b.fields.length && !a.fields.some(f => { if (f.kind === 'pair') { return !b.fields.some(of => of.kind === 'pair' && f.optional === of.optional && f.deprecated === of.deprecated && Attributes.equals(f.attributes, of.attributes) && (typeof f.key === 'string' || typeof of.key === 'string' ? f.key === of.key : equals(f.key, of.key)) && equals(f.type, of.type)); } return !b.fields.some(of => of.kind === 'spread' && Attributes.equals(f.attributes, of.attributes) && equals(f.type, of.type)); }); case 'union': if (a.members.length !== b.members.length) { return false; } for (let i = 0; i < a.members.length; i++) { if (!equals(a.members[i], b.members[i])) { return false; } } return true; case 'enum': if (a.enumKind !== b.enumKind || a.values.length !== b.values.length) { return false; } for (let i = 0; i < a.values.length; i++) { const first = a.values[i]; const second = b.values[i]; if (first.identifier !== second.identifier || first.value !== second.value || !Attributes.equals(first.attributes, second.attributes)) { return false; } } return true; case 'reference': return a.path === b.path; case 'template': if (a.typeParams.length !== b.typeParams.length) { return false; } for (let i = 0; i < a.typeParams.length; i++) { if (a.typeParams[i].path !== b.typeParams[i].path) { return false; } } return equals(a.child, b.child); case 'concrete': if (a.typeArgs.length !== b.typeArgs.length) { return false; } for (let i = 0; i < a.typeArgs.length; i++) { if (!equals(a.typeArgs[i], b.typeArgs[i])) { return false; } } return equals(a.child, b.child); case 'indexed': if (ParallelIndices.equals(a.parallelIndices, b.parallelIndices)) { return false; } return equals(a.child, b.child); case 'dispatcher': if (a.registry !== b.registry) { return false; } return ParallelIndices.equals(a.parallelIndices, b.parallelIndices); case 'mapped': if (Object.keys(a.mapping).length !== Object.keys(b.mapping).length) { return false; } for (const kvp of Object.entries(a.mapping)) { const other = b.mapping[kvp[0]]; if (!other) { return false; } if (!equals(kvp[1], other)) { return false; } } return equals(a.child, b.child); default: return true; } } McdocType.equals = equals; function toString(type) { const rangeToString = (range) => { return range ? ` @ ${NumericRange.toString(range)}` : ''; }; const indicesToString = (indices) => { const strings = []; for (const index of Arrayable.toArray(indices)) { if (index === undefined) { strings.push('()'); } else { strings.push(index.kind === 'static' ? `[${index.value}]` : `[[${index.accessor.map((v) => (typeof v === 'string' ? v : v.keyword)).join('.')}]]`); } } return `[${strings.join(', ')}]`; }; if (type === undefined) { return ''; } let attributesString = ''; if (type.attributes?.length) { for (const attribute of type.attributes) { attributesString += `#[${attribute.name}${attribute.value ? '=' : ''}] `; } } let typeString; switch (type.kind) { case 'any': case 'boolean': typeString = type.kind; break; case 'byte': typeString = `byte${rangeToString(type.valueRange)}`; break; case 'byte_array': typeString = `byte${rangeToString(type.valueRange)}[]${rangeToString(type.lengthRange)}`; break; case 'concrete': typeString = `${toString(type.child)}${type.typeArgs.length ? `<${type.typeArgs.map(toString).join(', ')}>` : ''}`; break; case 'dispatcher': typeString = `${type.registry ?? 'spyglass:unknown'}[${indicesToString(type.parallelIndices)}]`; break; case 'double': typeString = `double${rangeToString(type.valueRange)}`; break; case 'enum': typeString = ''; break; case 'float': typeString = `float${rangeToString(type.valueRange)}`; break; case 'indexed': typeString = `${toString(type.child)}${indicesToString(type.parallelIndices)}`; break; case 'int': typeString = `int${rangeToString(type.valueRange)}`; break; case 'int_array': typeString = `int${rangeToString(type.valueRange)}[]${rangeToString(type.lengthRange)}`; break; case 'list': typeString = `[${toString(type.item)}]${rangeToString(type.lengthRange)}`; break; case 'literal': typeString = `${type.value.value}`; break; case 'long': typeString = `long${rangeToString(type.valueRange)}`; break; case 'long_array': typeString = `long${rangeToString(type.valueRange)}[]${rangeToString(type.lengthRange)}`; break; case 'mapped': typeString = toString(type.child); break; case 'reference': typeString = type.path ?? ''; break; case 'short': typeString = `short${rangeToString(type.valueRange)}`; break; case 'string': typeString = `string${rangeToString(type.lengthRange)}`; break; case 'struct': typeString = ''; break; case 'template': typeString = `${toString(type.child)}${type.typeParams.length ? `<${type.typeParams.map((v) => `?${v.path}`).join(', ')}>` : ''}`; break; case 'tuple': typeString = `[${type.items.map((v) => toString(v)).join(',')}${type.items.length === 1 ? ',' : ''}]`; break; case 'union': typeString = `(${type.members.map(toString).join(' | ')})`; break; case 'unsafe': typeString = 'unsafe'; break; default: Dev.assertNever(type); } return attributesString + typeString; } McdocType.toString = toString; })(McdocType || (McdocType = {})); //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/parser/index.js /** * @returns A comment parser that accepts normal comments (`//`) and reports an error if it's a doc comment (`///`). * * `Failure` when there isn't a comment. */ const parser_comment = validate(comment_comment({ singleLinePrefixes: new Set(['//']) }), (res, src) => !src.slice(res).startsWith('///'), localize('mcdoc.parser.syntax.doc-comment-unexpected')); /** * @returns A parser that parses the gap between **SYNTAX** rules, which may contains whitespace and regular comments. */ function syntaxGap( /* istanbul ignore next */ delegatesDocComments = false) { return (src, ctx) => { const ans = []; src.skipWhitespace(); while (src.canRead() && src.peek(2) === '//' && (!delegatesDocComments || src.peek(3) !== '///')) { const result = parser_comment(src, ctx); ans.push(result); src.skipWhitespace(); } return ans; }; } function syntax(parsers, delegatesDocComments = false) { return (src, ctx) => { src.skipWhitespace(); const ans = sequence(parsers, syntaxGap(delegatesDocComments))(src, ctx); src.skipWhitespace(); return ans; }; } function syntaxRepeat(parser, delegatesDocComments = false) { return repeat(parser, syntaxGap(delegatesDocComments)); } function parser_literal(literal, options) { return (src, ctx) => { const ans = { type: 'mcdoc:literal', range: Range.create(src), value: '', colorTokenType: options?.colorTokenType, }; ans.value = src.readIf((c) => options?.allowedChars?.has(c) ?? (options?.specialChars?.has(c) || /[a-z]/i.test(c))); ans.range.end = src.cursor; if (Arrayable.toArray(literal).every((l) => l !== ans.value)) { ctx.err.report(localize('expected-got', arrayToMessage(literal), localeQuote(ans.value)), ans); } return ans; }; } function keyword(keyword, options = { colorTokenType: 'keyword' }) { return (src, ctx) => { const result = parser_literal(keyword, options)(src, ctx); if (!Arrayable.toArray(keyword).includes(result.value)) { return Parser_Failure; } return result; }; } function punctuation(punctuation) { return (src, ctx) => { src.skipWhitespace(); if (!src.trySkip(punctuation)) { ctx.err.report(localize('expected-got', localeQuote(punctuation), localeQuote(src.peek())), src); } return undefined; }; } function marker(punctuation) { return (src, _ctx) => { src.skipWhitespace(); if (!src.trySkip(punctuation)) { return Parser_Failure; } return undefined; }; } function resLoc(options) { return validate(resourceLocation_resourceLocation(options), (res) => res.namespace !== undefined, localize('mcdoc.parser.resource-location.colon-expected', localeQuote(ResourceLocation.NamespacePathSep))); } const UnicodeControlCharacters = Object.freeze([ '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0A', '\x0B', '\x0C', '\x0D', '\x0E', '\x0F', '\x7F', ]); const parser_string = stopBefore(string_string({ escapable: { characters: ['b', 'f', 'n', 'r', 't', '\\', '"'], unicode: true }, quotes: ['"'], }), ...UnicodeControlCharacters); const parser_identifier = (src, ctx) => { // https://spyglassmc.com/user/mcdoc/#identifier const IdentifierStart = /^[\p{L}\p{Nl}]$/u; const IdentifierContinue = /^[\p{L}\p{Nl}\u200C\u200D\p{Mn}\p{Mc}\p{Nd}\p{Pc}]$/u; const ReservedWords = new Set([ 'any', 'boolean', 'byte', 'double', 'enum', 'false', 'float', 'int', 'long', 'short', 'string', 'struct', 'super', 'true', ]); const ans = { type: 'mcdoc:identifier', range: Range.create(src), options: { category: 'mcdoc' }, value: '', }; const start = src.innerCursor; if (IdentifierStart.test(src.peek())) { src.skip(); while (IdentifierContinue.test(src.peek())) { src.skip(); } } else { ctx.err.report(localize('expected', localize('mcdoc.node.identifier')), src); } ans.value = src.string.slice(start, src.innerCursor); ans.range.end = src.cursor; if (ReservedWords.has(ans.value)) { ctx.err.report(localize('mcdoc.parser.identifier.reserved-word', localeQuote(ans.value)), ans); } return ans; }; function indexBody(options) { const accessorKey = util_select([ { prefix: '%', parser: parser_literal(['%key', '%parent'], { specialChars: new Set(['%']) }) }, { prefix: '"', parser: parser_string }, { parser: parser_identifier }, ]); const dynamicIndex = setType('mcdoc:dynamic_index', syntax([ punctuation('['), accessorKey, repeat(sequence([marker('.'), accessorKey])), punctuation(']'), ])); const index = util_select([ { prefix: '%', parser: parser_literal(StaticIndexKeywords.map((v) => `%${v}`), { specialChars: new Set(['%']) }), }, { prefix: '"', parser: parser_string }, { prefix: '[', parser: options?.noDynamic ? validate(dynamicIndex, () => false, localize('mcdoc.parser.index-body.dynamic-index-not-allowed')) : dynamicIndex, }, { parser: util_any([ resLoc({ category: 'mcdoc/dispatcher', accessType: options?.accessType }), parser_identifier, ]), }, ]); return setType('mcdoc:index_body', syntax([ punctuation('['), index, syntaxRepeat(syntax([marker(','), failOnEmpty(index)])), optional(marker(',')), punctuation(']'), ])); } const pathSegment = util_select([{ prefix: 'super', parser: parser_literal('super'), }, { parser: parser_identifier }]); const path = (src, ctx) => { let isAbsolute; if (src.trySkip('::')) { isAbsolute = true; } return util_map(sequence([pathSegment, repeat(sequence([marker('::'), pathSegment]))]), (res) => { const ans = { type: 'mcdoc:path', children: res.children, range: res.range, isAbsolute, }; return ans; })(src, ctx); }; const attributeTreePosValues = setType('mcdoc:attribute/tree/pos', syntax([ { get: () => attributeValue }, syntaxRepeat(syntax([marker(','), { get: () => failOnEmpty(attributeValue) }], true), true), ], true)); const attributeNamedValue = syntax([ util_select([{ prefix: '"', parser: parser_string }, { parser: parser_identifier }]), util_select([{ prefix: '=', parser: syntax([punctuation('='), { get: () => attributeValue }], true), }, { parser: { get: () => attributeTree } }]), ], true); const attributeTreeNamedValues = setType('mcdoc:attribute/tree/named', syntax([ attributeNamedValue, syntaxRepeat(syntax([marker(','), failOnEmpty(attributeNamedValue)], true), true), ], true)); const treeBody = util_any([ syntax([attributeTreeNamedValues, optional(marker(','))]), syntax([ attributeTreePosValues, punctuation(','), attributeTreeNamedValues, optional(marker(',')), ]), syntax([attributeTreePosValues, optional(marker(','))]), ]); const AttributeTreeClosure = Object.freeze({ '(': ')', '[': ']', '{': '}' }); const attributeTree = (src, ctx) => { const delim = src.trySkip('(') ? '(' : src.trySkip('[') ? '[' : src.trySkip('{') ? '{' : undefined; if (!delim) { return Parser_Failure; } const res = treeBody(src, ctx); const ans = { type: 'mcdoc:attribute/tree', range: res.range, children: res.children, delim, }; src.trySkip(AttributeTreeClosure[delim]); return ans; }; const attributeValue = util_select([{ predicate: (src) => ['(', '[', '{'].includes(src.peek()), parser: attributeTree, }, { parser: { get: () => type } }]); const attribute = setType('mcdoc:attribute', syntax([ marker('#['), parser_identifier, util_select([{ prefix: '=', parser: syntax([punctuation('='), attributeValue, punctuation(']')], true), }, { predicate: (src) => ['(', '[', '{'].includes(src.peek()), parser: syntax([attributeTree, punctuation(']')], true), }, { parser: punctuation(']') }]), ], true)); const attributes = repeat(attribute); const typeParam = setType('mcdoc:type_param', syntax([ parser_identifier, // optional(syntax([failOnError(literal('extends')), { get: () => type }])), ])); const typeParamBlock = setType('mcdoc:type_param_block', syntax([ punctuation('<'), util_select([{ prefix: '>', parser: punctuation('>') }, { parser: syntax([ typeParam, syntaxRepeat(syntax([marker(','), failOnEmpty(typeParam)])), optional(marker(',')), punctuation('>'), ]), }]), ])); const parser_noop = () => undefined; const docComment = comment_comment({ singleLinePrefixes: new Set(['///']), includesEol: true, }); const docComments = setType('mcdoc:doc_comments', repeat(docComment, (src) => { src.skipWhitespace(); return []; })); const prelim = syntax([ optional(failOnEmpty(docComments)), attributes, ]); const optionalTypeParamBlock = util_select([{ prefix: '<', parser: typeParamBlock, }, { parser: parser_noop }]); const dispatchStatement = setType('mcdoc:dispatch_statement', syntax([ prelim, keyword('dispatch'), resLoc({ category: 'mcdoc/dispatcher', accessType: 1 /* SymbolAccessType.Write */ }), indexBody({ noDynamic: true }), optionalTypeParamBlock, parser_literal('to'), { get: () => type }, ], true)); const enumType = parser_literal([ 'byte', 'short', 'int', 'long', 'string', 'float', 'double', ], { colorTokenType: 'type' }); const parser_float = float_float({ pattern: /^[-+]?(?:[0-9]+(?:[eE][-+]?[0-9]+)?|[0-9]*\.[0-9]+(?:[eE][-+]?[0-9]+)?)$/, }); const parser_integer = integer_integer({ pattern: /^(?:0|[-+]?[1-9][0-9]*)$/, }); const LiteralIntSuffixes = Object.freeze(['b', 's', 'l']); const LiteralIntCaseInsensitiveSuffixes = Object.freeze([...LiteralIntSuffixes, 'B', 'S', 'L']); const LiteralFloatSuffixes = Object.freeze(['f', 'd']); const LiteralFloatCaseInsensitiveSuffixes = Object.freeze([...LiteralFloatSuffixes, 'F', 'D']); const LiteralNumberSuffixes = Object.freeze([...LiteralIntSuffixes, ...LiteralFloatSuffixes]); const LiteralNumberCaseInsensitiveSuffixes = Object.freeze([ ...LiteralNumberSuffixes, ...LiteralIntCaseInsensitiveSuffixes, ...LiteralFloatCaseInsensitiveSuffixes, ]); const typedNumber = setType('mcdoc:typed_number', util_select([{ regex: /^(?:\+|-)?\d+(?!\d|[.dfe])/i, parser: sequence([ parser_integer, optional(keyword(LiteralIntCaseInsensitiveSuffixes, { colorTokenType: 'keyword' })), ]), }, { parser: sequence([ parser_float, optional(keyword(LiteralFloatCaseInsensitiveSuffixes, { colorTokenType: 'keyword' })), ]), }])); const enumValue = util_select([{ prefix: '"', parser: parser_string }, { parser: typedNumber, }]); const enumField = setType('mcdoc:enum/field', syntax([prelim, parser_identifier, punctuation('='), enumValue], true)); const enumBlock = setType('mcdoc:enum/block', syntax([ punctuation('{'), util_select([{ prefix: '}', parser: punctuation('}') }, { parser: syntax([ enumField, syntaxRepeat(syntax([marker(','), failOnEmpty(enumField)], true), true), optional(marker(',')), punctuation('}'), ], true), }]), ], true)); const enum_ = setType('mcdoc:enum', syntax([ prelim, keyword('enum'), punctuation('('), enumType, punctuation(')'), optional(failOnError(parser_identifier)), enumBlock, ], true)); const structMapKey = setType('mcdoc:struct/map_key', syntax([punctuation('['), { get: () => type }, punctuation(']')], true)); const structKey = util_select([{ prefix: '"', parser: parser_string }, { prefix: '[', parser: structMapKey, }, { parser: parser_identifier }]); const structPairField = (src, ctx) => { let isOptional; const result0 = syntax([prelim, structKey], true)(src, ctx); if (src.trySkip('?')) { isOptional = true; } const result1 = syntax([punctuation(':'), { get: () => type }], true)(src, ctx); const ans = { type: 'mcdoc:struct/field/pair', children: [...result0.children, ...result1.children], range: Range.span(result0, result1), isOptional, }; return ans; }; const structSpreadField = setType('mcdoc:struct/field/spread', syntax([attributes, marker('...'), { get: () => type }], true)); const structField = util_any([ structSpreadField, structPairField, ]); const structBlock = setType('mcdoc:struct/block', syntax([ punctuation('{'), util_select([{ prefix: '}', parser: punctuation('}') }, { parser: syntax([ structField, syntaxRepeat(syntax([marker(','), failOnEmpty(structField)], true), true), optional(marker(',')), punctuation('}'), ], true), }]), ], true)); const struct = setType('mcdoc:struct', syntax([prelim, keyword('struct'), optional(failOnEmpty(parser_identifier)), structBlock], true)); const enumInjection = setType('mcdoc:injection/enum', syntax([parser_literal('enum'), punctuation('('), enumType, punctuation(')'), path, enumBlock])); const structInjection = setType('mcdoc:injection/struct', syntax([parser_literal('struct'), path, structBlock])); const injection = setType('mcdoc:injection', syntax([ keyword('inject'), util_select([{ prefix: 'enum', parser: enumInjection }, { parser: structInjection }]), ])); const typeAliasStatement = setType('mcdoc:type_alias', syntax([prelim, keyword('type'), parser_identifier, optionalTypeParamBlock, punctuation('='), { get: () => type, }], true)); const useStatement = setType('mcdoc:use_statement', syntax([ keyword('use'), path, util_select([{ prefix: 'as', parser: syntax([parser_literal('as'), parser_identifier]) }, { parser: parser_noop }]), ], true)); const topLevel = util_any([ parser_comment, dispatchStatement, enum_, injection, struct, typeAliasStatement, useStatement, ]); const parser_module_ = setType('mcdoc:module', syntaxRepeat(topLevel, true)); const typeArgBlock = setType('mcdoc:type_arg_block', syntax([ marker('<'), util_select([{ prefix: '>', parser: punctuation('>') }, { parser: syntax([ { get: () => type }, syntaxRepeat(syntax([marker(','), { get: () => failOnEmpty(type) }], true), true), optional(marker(',')), punctuation('>'), ], true), }]), ])); /* eslint-enable @typescript-eslint/indent */ function typeBase(type, parser) { return setType(type, syntax([ attributes, parser, syntaxRepeat(util_select([{ prefix: '<', parser: typeArgBlock }, { parser: failOnError(indexBody()) }]), true), ], true)); } const anyType = typeBase('mcdoc:type/any', keyword('any', { colorTokenType: 'type' })); const booleanType = typeBase('mcdoc:type/boolean', keyword('boolean', { colorTokenType: 'type' })); function range(type, number) { const delimiterPredicate = (src) => src.tryPeek('..') || src.tryPeek(`${RangeExclusiveChar}..`); const delimiterParser = parser_literal([ '..', `..${RangeExclusiveChar}`, `${RangeExclusiveChar}..`, `${RangeExclusiveChar}..${RangeExclusiveChar}`, ], { allowedChars: new Set(['.', RangeExclusiveChar]) }); return setType(type, util_select([{ predicate: delimiterPredicate, parser: sequence([delimiterParser, number]) }, { parser: sequence([ stopBefore(number, '..'), util_select([{ predicate: delimiterPredicate, parser: sequence([delimiterParser, optional(failOnEmpty(number))]), }, { parser: parser_noop }]), ]), }])); } const intRange = range('mcdoc:int_range', parser_integer); const atIntRange = optional((src, ctx) => { if (!src.trySkip('@')) { return Parser_Failure; } src.skipWhitespace(); return intRange(src, ctx); }); const stringType = typeBase('mcdoc:type/string', syntax([ keyword('string', { colorTokenType: 'type' }), atIntRange, ], true)); const literalType = typeBase('mcdoc:type/literal', util_select([ { predicate: (src) => src.tryPeek('false') || src.tryPeek('true'), parser: keyword(['false', 'true'], { colorTokenType: 'type' }), }, { prefix: '"', parser: failOnEmpty(parser_string) }, { parser: failOnError(typedNumber) }, ])); const floatRange = range('mcdoc:float_range', parser_float); const atFloatRange = optional((src, ctx) => { if (!src.trySkip('@')) { return Parser_Failure; } src.skipWhitespace(); return floatRange(src, ctx); }); const numericType = typeBase('mcdoc:type/numeric_type', util_select([{ predicate: (src) => NumericTypeFloatKinds.some((k) => src.tryPeek(k)), parser: syntax([keyword(NumericTypeFloatKinds, { colorTokenType: 'type' }), atFloatRange], true), }, { parser: syntax([keyword(NumericTypeIntKinds, { colorTokenType: 'type' }), atIntRange], true), }])); const primitiveArrayType = typeBase('mcdoc:type/primitive_array', syntax([ parser_literal(PrimitiveArrayValueKinds), atIntRange, keyword('[]', { allowedChars: new Set(['[', ']']), colorTokenType: 'type' }), atIntRange, ])); const listType = typeBase('mcdoc:type/list', syntax([marker('['), { get: () => type }, punctuation(']'), atIntRange], true)); const tupleType = typeBase('mcdoc:type/tuple', syntax([ marker('['), { get: () => type }, marker(','), util_select([{ prefix: ']', parser: punctuation(']') }, { parser: syntax([ { get: () => type }, syntaxRepeat(syntax([marker(','), { get: () => failOnEmpty(type) }], true), true), optional(marker(',')), punctuation(']'), ], true), }]), ], true)); const dispatcherType = typeBase('mcdoc:type/dispatcher', syntax([failOnError(resLoc({ category: 'mcdoc/dispatcher' })), indexBody()])); const unionType = typeBase('mcdoc:type/union', syntax([ marker('('), util_select([{ prefix: ')', parser: punctuation(')') }, { parser: syntax([ { get: () => type }, syntaxRepeat(syntax([marker('|'), { get: () => failOnEmpty(type) }], true), true), optional(marker('|')), punctuation(')'), ], true), }]), ])); const referenceType = typeBase('mcdoc:type/reference', syntax([path])); const type = util_any([ anyType, booleanType, dispatcherType, enum_, listType, literalType, numericType, primitiveArrayType, stringType, struct, tupleType, unionType, referenceType, ]); //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/formatter/index.js // These formatters operate under the assumption that each AST node's children are in the same order as they appear when formatted. // With the exception of comments, because those can be moved to the parent if they're at odd locations // (for example a comment between the identifier and '{' of a struct will be moved to before the struct). const nodeTypesAllowingComments = new Set([ 'mcdoc:module', 'mcdoc:struct/block', 'mcdoc:enum/block', 'mcdoc:doc_comments', 'mcdoc:type/tuple', 'mcdoc:type/union', ]); const nodeTypesAllowingTrailingComments = new Set([ 'mcdoc:module', 'mcdoc:struct/block', 'mcdoc:enum/block', 'mcdoc:doc_comments', ]); const prelimNodeTypes = new Set([ 'mcdoc:attribute', 'mcdoc:doc_comments', ]); function formatChildren(node, ctx, childFormatInfo, excludeLastChildSuffix = false, onlyFormatPrelimType) { const allowsComments = nodeTypesAllowingComments.has(node.type); const allowsTrailingComments = nodeTypesAllowingTrailingComments.has(node.type); const children = allowsComments ? liftChildComments(node.children) : node.children; const lastNonComment = children.findLastIndex((child) => child.type !== 'comment'); const lastFormattedChild = onlyFormatPrelimType !== undefined ? children.findLastIndex((child) => child.type === onlyFormatPrelimType) // Exclude trailing comments, so trailing comments don't change // whether the node in front of the comments has the suffix : children.findLastIndex((child) => child.type !== 'comment'); const content = children.map((child, i) => { // Only format prelim when it's supposed to be formatted // and don't format other nodes when they're not supposed to be formatted. if (onlyFormatPrelimType !== undefined && child.type !== onlyFormatPrelimType) { return ''; } if (onlyFormatPrelimType === undefined && prelimNodeTypes.has(child.type)) { return ''; } if (child.type === 'comment' && !allowsComments) { // Don't format comments if the type doesn't allow them. // A parent type that does allow comments should have already included them. return ''; } if (i > lastNonComment && !allowsTrailingComments) { // Don't format trailing comments if the type doesn't allow them. // A parent type that does allow comments should have already included them. return ''; } const info = childFormatInfo[child.type]; const value = ctx.meta.getFormatter(child.type)(child, info?.indentSelf ? indentFormatter(ctx) : ctx); const prefix = info?.prefix ?? ''; const hasSuffix = info?.suffix !== undefined && (!excludeLastChildSuffix || lastFormattedChild !== i); const suffix = hasSuffix ? info.suffix : ''; const formatted = `${prefix}${value}${suffix}`; return formatted; }).join(''); return content; } const formatterIgnoreAttributeName = 'formatter_ignore'; function shouldFormatterIgnore(node) { return node.children?.some((child) => { if (child.type !== 'mcdoc:attribute') { return false; } return child.children.some((attributeChild) => { return attributeChild.type === 'mcdoc:identifier' && attributeChild.value === formatterIgnoreAttributeName; }); }) ?? false; } function getUnformatted(node, ctx) { return ctx.doc.getText({ start: ctx.doc.positionAt(node.range.start), end: ctx.doc.positionAt(node.range.end), }); } function hasMultilineChild(node, isRecursiveCall = false, alwaysIncludeComments = false) { if (!node.children) { return false; } for (let i = 0; i < node.children.length; i++) { const child = node.children[i]; if (child.type === 'comment') { if (alwaysIncludeComments) { return true; } if (nodeTypesAllowingComments.has(node.type)) { if (nodeTypesAllowingTrailingComments.has(node.type)) { return true; } // Only return true if there's a non-comment node after the comment, so // the comment isn't moved outside the node. // We only need to check whether i+1 is not a comment instead of checking // all of the nodes after i, because even in the case where i+1 is a comment, // but i+2 is a non-comment, the check will still succeed true in the next iteration. if (i < node.children.length - 1 && node.children[i + 1].type !== 'comment') { return true; } } } if (child.type === 'mcdoc:struct') { return true; } if (child.type === 'mcdoc:enum') { return true; } if (isRecursiveCall && child.type === 'mcdoc:attribute') { // Attributes only count as multiline for a recursive call, because attributes found // during the first call would be put in front of the node and not inside it. return true; } if (hasMultilineChild(child, true, alwaysIncludeComments || i < node.children.length - 1)) { return true; } } return false; } const maxDynamicInlineLength = 80; // Kind of arbitrary function formatDynamicMultiline(node, formatter) { if (hasMultilineChild(node)) { return formatter(true); } const inlineFormat = formatter(false); if (inlineFormat.length > maxDynamicInlineLength) { return formatter(true); } return inlineFormat; } function formatWithPrelim(node, ctx, putAttributesOnSeparateLine, putDocOnSeparateLine, contentFormatter) { if (shouldFormatterIgnore(node)) { return getUnformatted(node, ctx); } function attributeFormatter(doMultiline, attributeCtx) { const childFormatInfo = { 'mcdoc:attribute': { suffix: doMultiline ? `\n${attributeCtx.indent()}` : ' ', }, }; return formatChildren(node, attributeCtx, childFormatInfo, // Last suffix is excluded, because it is specified separately through `putAttributesOnSeparateLine`. // This makes it possible to put all attributes on one line but still add a newline at the end. true, 'mcdoc:attribute'); } const shouldIndentPrelim = !putDocOnSeparateLine && node.children.some((child) => child.type === 'mcdoc:doc_comments'); function processFormattedAttributes(formattedAttributes, areAttributesMultiline) { const formattedDocComments = formatChildren(node, putDocOnSeparateLine ? ctx : indentFormatter(ctx), {}, false, 'mcdoc:doc_comments'); const hasAdditionalIndent = shouldIndentPrelim || (!putAttributesOnSeparateLine && areAttributesMultiline); if (formattedAttributes !== '') { if (hasAdditionalIndent) { formattedAttributes += `\n${ctx.indent(1)}`; } else if (putAttributesOnSeparateLine) { formattedAttributes += `\n${ctx.indent()}`; } else { formattedAttributes += ' '; } } const prelim = (hasAdditionalIndent ? `\n${ctx.indent(1)}` : '') + formattedDocComments + formattedAttributes; const content = contentFormatter(hasAdditionalIndent ? indentFormatter(ctx) : ctx); return prelim + content; } const multilineChild = node.children?.some((child) => { child.type === 'mcdoc:attribute' && hasMultilineChild(child); }); if (multilineChild) { return processFormattedAttributes(attributeFormatter(true, putAttributesOnSeparateLine ? ctx : indentFormatter(ctx)), true); } const inlineAttributes = attributeFormatter(false, ctx); if (inlineAttributes.length > maxDynamicInlineLength) { return processFormattedAttributes(attributeFormatter(true, putAttributesOnSeparateLine ? ctx : indentFormatter(ctx)), true); } return processFormattedAttributes((shouldIndentPrelim ? ctx.indent(1) : '') + inlineAttributes, false); } function liftChildComments(children) { // Get mutable children list so comments from children that don't allow comments can be added to the list. const mutableChildren = [...children]; for (let i = 0; i < mutableChildren.length; i++) { const child = mutableChildren[i]; const { beforeNode, afterNode } = findComments(child); // Add comments and advance i to not iterate over them again mutableChildren.splice(i, 0, ...beforeNode); i += beforeNode.length; mutableChildren.splice(i + 1, 0, ...afterNode); i += afterNode.length; } return mutableChildren; } function findComments(node) { const result = { beforeNode: [], afterNode: [], }; if (!node.children) { return result; } let currentCommentSequence = []; node.children.forEach((child) => { if (child.type === 'comment') { currentCommentSequence.push(child); return; } result.beforeNode.push(...currentCommentSequence); currentCommentSequence = []; const childComments = findComments(child); if (nodeTypesAllowingComments.has(child.type)) { // The child will format its own comments, so we don't need to lift them. // Comments at the end of the child are still lifted for some nodes, because they can't be distinguished from comments // that come after the child. if (!nodeTypesAllowingTrailingComments.has(child.type)) { currentCommentSequence = childComments.afterNode; } return; } result.beforeNode.push(...childComments.beforeNode); currentCommentSequence = childComments.afterNode; }); result.afterNode.push(...currentCommentSequence); return result; } function getTypeNodes(children) { return children.filter((child) => child.type.startsWith('mcdoc:type/') || child.type === 'mcdoc:enum' || child.type === 'mcdoc:struct'); } const formatter_module = (node, ctx) => { const children = liftChildComments(node.children); return children.map((child, i) => { function addNewlineSeparator(formatted) { if (i === children.length - 1) { return formatted; } return `${formatted}\n`; } const formatted = ctx.meta.getFormatter(child.type)(child, ctx); if (shouldFormatterIgnore(child)) { // With formatterIgnore, the whitespace after a node is already included in the string, so no newlines have to be added return formatted; } if (child.type === 'comment') { return `${formatted}\n`; } if (child.type === 'mcdoc:use_statement' && children[i + 1]?.type === 'mcdoc:use_statement') { return `${formatted}\n`; } // With an empty line between nodes // (comments don't have them, because they probably refer to the next child) // (use statements don't have them between each other, because use statements are supposed to be grouped together) return addNewlineSeparator(`${formatted}\n`); }).join(''); }; const formatter_useStatement = (node, ctx) => { const hasAlias = node.children.some((child) => child.type === 'mcdoc:identifier'); return formatChildren(node, ctx, { 'mcdoc:literal': { suffix: ' ' }, 'mcdoc:path': { suffix: hasAlias ? ' ' : '' }, }); }; const formatter_injection = (node, ctx) => { return formatChildren(node, ctx, { 'mcdoc:literal': { suffix: ' ' }, }); }; const formatter_struct = (node, ctx) => { const isTopLevel = node.parent?.type === 'mcdoc:module'; return formatWithPrelim(node, ctx, isTopLevel, isTopLevel, (contentCtx) => { return formatChildren(node, contentCtx, { 'mcdoc:literal': { suffix: ' ' }, 'mcdoc:identifier': { suffix: ' ' }, }); }); }; const formatter_structInjection = (node, ctx) => { return formatChildren(node, ctx, { 'mcdoc:literal': { suffix: ' ' }, 'mcdoc:path': { suffix: ' ' }, }); }; const formatter_structBlock = (node, ctx) => { if (node.children.length === 0) { return '{}'; } const content = formatChildren(node, ctx, { 'comment': { prefix: ctx.indent(1), suffix: '\n', indentSelf: true }, 'mcdoc:struct/field/pair': { suffix: ',\n', indentSelf: true }, 'mcdoc:struct/field/spread': { suffix: ',\n', indentSelf: true }, }); return `{\n${content}${ctx.indent()}}`; }; const formatter_structPairField = (node, ctx) => { const keySuffix = `${node.isOptional ? '?' : ''}: `; return ctx.indent() + formatWithPrelim(node, ctx, true, true, (contentCtx) => { return formatChildren(node, contentCtx, { 'mcdoc:struct/map_key': { suffix: keySuffix }, 'mcdoc:identifier': { suffix: keySuffix }, 'string': { suffix: keySuffix }, }); }); }; const formatter_structMapKey = (node, ctx) => { const typeNode = getTypeNodes(node.children)[0]; return formatChildren(node, ctx, { [typeNode.type]: { prefix: '[', suffix: ']' }, }); }; const formatter_structSpreadField = (node, ctx) => { const typeNode = getTypeNodes(node.children)[0]; return ctx.indent() + formatWithPrelim(node, ctx, true, true, (contentCtx) => { return formatChildren(node, contentCtx, { [typeNode.type]: { prefix: '...' }, }); }); }; const _enum = (node, ctx) => { const isTopLevel = node.parent?.type === 'mcdoc:module'; return formatWithPrelim(node, ctx, isTopLevel, isTopLevel, (contentCtx) => { return node.children.map((child) => { if (child.type === 'comment') { // Don't format comments if the type doesn't allow them. // A parent type that does allow comments should have already included them. return ''; } if (child.type === 'mcdoc:attribute') { // Formatted separately return ''; } const formatted = contentCtx.meta.getFormatter(child.type)(child, contentCtx); if (child.type === 'mcdoc:identifier') { return formatted + ' '; } if (child.type !== 'mcdoc:literal' || child.value === 'enum') { return formatted; } // Add parentheses to type return `(${formatted}) `; }).join(''); }); }; const formatter_enumInjection = (node, ctx) => { return node.children.map((child) => { if (child.type === 'comment') { // Don't format comments if the type doesn't allow them. // A parent type that does allow comments should have already included them. return ''; } const formatted = ctx.meta.getFormatter(child.type)(child, ctx); if (child.type === 'mcdoc:path') { return formatted + ' '; } if (child.type !== 'mcdoc:literal' || child.value === 'enum') { return formatted; } // Add parentheses to type return `(${formatted}) `; }).join(''); }; const formatter_enumBlock = (node, ctx) => { if (node.children.length === 0) { return '{}'; } const content = formatChildren(node, ctx, { 'comment': { prefix: ctx.indent(1), suffix: '\n', indentSelf: true }, 'mcdoc:enum/field': { prefix: ctx.indent(1), suffix: ',\n', indentSelf: true }, }); return `{\n${content}${ctx.indent()}}`; }; const formatter_enumField = (node, ctx) => { return formatWithPrelim(node, ctx, false, true, (contentCtx) => { return formatChildren(node, contentCtx, { 'mcdoc:identifier': { suffix: ' = ' }, }); }); }; const formatter_tupleType = (node, ctx) => { const typeNode = getTypeNodes(node.children); return formatWithPrelim(node, ctx, false, false, (contentCtx) => { return formatDynamicMultiline(node, (doMultiline) => { const childFormatInfo = { 'comment': { prefix: contentCtx.indent(1), suffix: `\n`, }, }; const typeFormatInfo = { prefix: doMultiline ? contentCtx.indent(1) : '', suffix: ',' + (doMultiline ? `\n` : ' '), indentSelf: true, }; for (const child of typeNode) { childFormatInfo[child.type] = typeFormatInfo; } const content = formatChildren(node, contentCtx, childFormatInfo, !doMultiline); return doMultiline ? `[\n${content}${contentCtx.indent()}]` : `[${content}]`; }); }); }; const formatter_unionType = (node, ctx) => { const typeNode = getTypeNodes(node.children); return formatWithPrelim(node, ctx, false, false, (contentCtx) => { return formatDynamicMultiline(node, (doMultiline) => { const childFormatInfo = { 'comment': { prefix: contentCtx.indent(1), suffix: `\n`, }, }; const typeFormatInfo = { prefix: doMultiline ? contentCtx.indent(1) : '', suffix: ' |' + (doMultiline ? `\n` : ' '), indentSelf: true, }; for (const child of typeNode) { childFormatInfo[child.type] = typeFormatInfo; } const content = formatChildren(node, contentCtx, childFormatInfo, !doMultiline); return doMultiline ? `(\n${content}${contentCtx.indent()})` : `(${content})`; }); }); }; const formatter_referenceType = (node, ctx) => { return formatWithPrelim(node, ctx, false, false, (contentCtx) => { return formatChildren(node, contentCtx, {}); }); }; const formatter_path = (node, ctx) => { const formatted = formatChildren(node, ctx, { 'mcdoc:literal': { prefix: '::' }, 'mcdoc:identifier': { prefix: '::' }, }); if (!node.isAbsolute) { return formatted.substring(2); // Remove the leading '::' for relative paths } return formatted; }; const formatter_stringType = (node, ctx) => { return formatWithPrelim(node, ctx, false, false, (contentCtx) => { return formatChildren(node, contentCtx, { 'mcdoc:int_range': { prefix: ' @ ' }, }); }); }; const formatter_primitiveArrayType = (node, ctx) => { return formatWithPrelim(node, ctx, false, false, (contentCtx) => { return formatChildren(node, contentCtx, { 'mcdoc:int_range': { prefix: ' @ ' }, }); }); }; const formatter_listType = (node, ctx) => { const typeNode = getTypeNodes(node.children)[0]; return formatWithPrelim(node, ctx, false, false, (contentCtx) => { return formatChildren(node, contentCtx, { [typeNode.type]: { prefix: '[', suffix: ']' }, 'mcdoc:int_range': { prefix: ' @ ' }, }); }); }; const typeAlias = (node, ctx) => { const typeNode = getTypeNodes(node.children)[0]; return formatWithPrelim(node, ctx, true, true, (contentCtx) => { return formatChildren(node, contentCtx, { [typeNode.type]: { prefix: ' = ' }, 'mcdoc:literal': { suffix: ' ' }, }); }); }; const formatter_dispatcherType = (node, ctx) => { return formatWithPrelim(node, ctx, true, true, (contentCtx) => { return formatChildren(node, contentCtx, {}); }); }; const formatter_dispatchStatement = (node, ctx) => { return formatWithPrelim(node, ctx, true, true, (contentCtx) => { return formatChildren(node, contentCtx, { 'mcdoc:literal': { suffix: ' ' }, 'mcdoc:index_body': { suffix: ' ' }, }); }); }; const formatter_indexBody = (node, ctx) => { return formatDynamicMultiline(node, (doMultiline) => { const indexFormatInfo = { prefix: doMultiline ? ctx.indent(1) : '', suffix: ',' + (doMultiline ? `\n` : ' '), indentSelf: true, }; const content = formatChildren(node, ctx, { 'mcdoc:dynamic_index': indexFormatInfo, 'mcdoc:identifier': indexFormatInfo, 'mcdoc:literal': indexFormatInfo, 'resource_location': indexFormatInfo, 'string': indexFormatInfo, }, !doMultiline); return doMultiline ? `[\n${content}${ctx.indent()}]` : `[${content}]`; }); }; const dynamicIndex = (node, ctx) => { const path = node.children.map((child) => { if (child.type === 'comment') { // Don't format comments if the type doesn't allow them. // A parent type that does allow comments should have already included them. return ''; } return ctx.meta.getFormatter(child.type)(child, ctx); }).join('.'); return `[${path}]`; }; const formatter_attribute = (node, ctx) => { const hasTypeValue = getTypeNodes(node.children).length !== 0; return formatChildren(node, ctx, { 'mcdoc:identifier': { prefix: '#[', suffix: hasTypeValue ? '=' : '' }, }) + ']'; }; const formatter_attributeTree = (node, ctx) => { const content = formatChildren(node, ctx, {}); return `${node.delim}${content}${AttributeTreeClosure[node.delim]}`; }; const formatter_attributeTreePosValues = (node, ctx) => { const typeNode = getTypeNodes(node.children); return formatDynamicMultiline(node, (doMultiline) => { const childFormatInfo = { prefix: doMultiline ? ctx.indent(1) : '', suffix: ',' + (doMultiline ? `\n` : ' '), indentSelf: true, }; const childFormatInfoMap = { 'mcdoc:attribute/tree': childFormatInfo, }; for (const child of typeNode) { childFormatInfoMap[child.type] = childFormatInfo; } const content = formatChildren(node, ctx, childFormatInfoMap, !doMultiline); return doMultiline ? `\n${content}${ctx.indent()}` : content; }); }; const formatter_attributeTreeNamedValues = (node, ctx) => { const typeNode = getTypeNodes(node.children); return formatDynamicMultiline(node, (doMultiline) => { const childFormatInfo = { prefix: '=', suffix: ',' + (doMultiline ? `\n` : ' '), indentSelf: true, }; const childFormatInfoMap = { 'mcdoc:attribute/tree': childFormatInfo, 'mcdoc:identifier': { prefix: doMultiline ? ctx.indent(1) : '' }, 'string': { prefix: doMultiline ? ctx.indent(1) : '' }, }; for (const child of typeNode) { childFormatInfoMap[child.type] = childFormatInfo; } const content = formatChildren(node, ctx, childFormatInfoMap, !doMultiline); return doMultiline ? `\n${content}${ctx.indent()}` : content; }); }; const formatter_typeArgBlock = (node, ctx) => { const typeNode = getTypeNodes(node.children); const childFormatInfo = {}; for (const child of typeNode) { childFormatInfo[child.type] = { suffix: ', ' }; } const content = formatChildren(node, ctx, childFormatInfo, true); return `<${content}>`; }; const formatter_typeParamBlock = (node, ctx) => { const content = formatChildren(node, ctx, { 'mcdoc:type_param': { suffix: ', ' }, }, true); return `<${content}>`; }; const formatter_typeParam = (node, ctx) => { return formatChildren(node, ctx, {}); }; const formatter_literalType = (node, ctx) => { return formatWithPrelim(node, ctx, false, false, (contentCtx) => { return formatChildren(node, contentCtx, {}); }); }; const formatter_typedNumber = (node, ctx) => { return formatChildren(node, ctx, {}); }; const formatter_numericType = (node, ctx) => { return formatWithPrelim(node, ctx, false, false, (contentCtx) => { return formatChildren(node, contentCtx, { 'mcdoc:int_range': { prefix: ' @ ' }, 'mcdoc:float_range': { prefix: ' @ ' }, }); }); }; const formatter_intRange = (node, ctx) => { return formatChildren(node, ctx, {}); }; const formatter_floatRange = (node, ctx) => { return formatChildren(node, ctx, {}); }; const formatter_anyType = (node, ctx) => { return formatWithPrelim(node, ctx, false, false, (contentCtx) => { return formatChildren(node, contentCtx, {}); }); }; const formatter_booleanType = (node, ctx) => { return formatWithPrelim(node, ctx, false, false, (contentCtx) => { return formatChildren(node, contentCtx, {}); }); }; const formatter_literal = (node) => { return node.value; }; const formatter_identifier = (node) => { return node.value; }; const formatter_docComments = (node, ctx) => { if (node.children.length === 0) { return ''; } return formatChildren(node, ctx, { comment: { suffix: ctx.indent() }, // No need to add new lines, because DocCommentNodes include them }); }; function registerMcdocFormatter(meta) { meta.registerFormatter('mcdoc:module', formatter_module); meta.registerFormatter('mcdoc:use_statement', formatter_useStatement); meta.registerFormatter('mcdoc:injection', formatter_injection); meta.registerFormatter('mcdoc:struct', formatter_struct); meta.registerFormatter('mcdoc:injection/struct', formatter_structInjection); meta.registerFormatter('mcdoc:struct/block', formatter_structBlock); meta.registerFormatter('mcdoc:struct/field/pair', formatter_structPairField); meta.registerFormatter('mcdoc:struct/map_key', formatter_structMapKey); meta.registerFormatter('mcdoc:struct/field/spread', formatter_structSpreadField); meta.registerFormatter('mcdoc:enum', _enum); meta.registerFormatter('mcdoc:injection/enum', formatter_enumInjection); meta.registerFormatter('mcdoc:enum/block', formatter_enumBlock); meta.registerFormatter('mcdoc:enum/field', formatter_enumField); meta.registerFormatter('mcdoc:type/tuple', formatter_tupleType); meta.registerFormatter('mcdoc:type/union', formatter_unionType); meta.registerFormatter('mcdoc:type/reference', formatter_referenceType); meta.registerFormatter('mcdoc:path', formatter_path); meta.registerFormatter('mcdoc:type/string', formatter_stringType); meta.registerFormatter('mcdoc:type/primitive_array', formatter_primitiveArrayType); meta.registerFormatter('mcdoc:type/list', formatter_listType); meta.registerFormatter('mcdoc:type_alias', typeAlias); meta.registerFormatter('mcdoc:type/dispatcher', formatter_dispatcherType); meta.registerFormatter('mcdoc:dispatch_statement', formatter_dispatchStatement); meta.registerFormatter('mcdoc:index_body', formatter_indexBody); meta.registerFormatter('mcdoc:dynamic_index', dynamicIndex); meta.registerFormatter('mcdoc:attribute', formatter_attribute); meta.registerFormatter('mcdoc:attribute/tree', formatter_attributeTree); meta.registerFormatter('mcdoc:attribute/tree/pos', formatter_attributeTreePosValues); meta.registerFormatter('mcdoc:attribute/tree/named', formatter_attributeTreeNamedValues); meta.registerFormatter('mcdoc:type_arg_block', formatter_typeArgBlock); meta.registerFormatter('mcdoc:type_param_block', formatter_typeParamBlock); meta.registerFormatter('mcdoc:type_param', formatter_typeParam); meta.registerFormatter('mcdoc:type/literal', formatter_literalType); meta.registerFormatter('mcdoc:typed_number', formatter_typedNumber); meta.registerFormatter('mcdoc:type/numeric_type', formatter_numericType); meta.registerFormatter('mcdoc:int_range', formatter_intRange); meta.registerFormatter('mcdoc:float_range', formatter_floatRange); meta.registerFormatter('mcdoc:type/any', formatter_anyType); meta.registerFormatter('mcdoc:type/boolean', formatter_booleanType); meta.registerFormatter('mcdoc:literal', formatter_literal); meta.registerFormatter('mcdoc:identifier', formatter_identifier); meta.registerFormatter('mcdoc:doc_comments', formatter_docComments); } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/runtime/attribute/validator.js const validator_string = (value) => { if (value === undefined) { return Parser_Failure; } if (value.kind === 'literal' && value.value.kind === 'string') { return value.value.value; } if (value.kind === 'reference' && value.path) { return value.path.replace(/.*::/, ''); } return Parser_Failure; }; const validator_number = (value) => { if (value === undefined) { return Parser_Failure; } if (value.kind === 'literal' && typeof value.value.value === 'number') { return value.value.value; } return Parser_Failure; }; const validator_boolean = (value) => { if (value === undefined) { return Parser_Failure; } if (value.kind === 'literal' && value.value.kind === 'boolean') { return value.value.value; } return Parser_Failure; }; function options(...options) { return (value, ctx) => { const stringValue = validator_string(value, ctx); if (stringValue === Parser_Failure) { return Parser_Failure; } if (options.includes(stringValue)) { return stringValue; } return Parser_Failure; }; } function tree(properties) { return (value, ctx) => { if (value?.kind !== 'tree') { return Parser_Failure; } const result = {}; for (const key in properties) { const validator = properties[key]; const propValue = value.values[key]; const property = validator(propValue, ctx); if (property === Parser_Failure) { return Parser_Failure; } result[key] = property; } return result; }; } function validator_list(itemValidator) { return (value, ctx) => { if (value?.kind !== 'tree') { return Parser_Failure; } const result = []; for (const element of Object.values(value.values)) { const item = itemValidator(element, ctx); if (item === Parser_Failure) { return Parser_Failure; } result.push(item); } return result; }; } function validator_optional(validator) { return (value, ctx) => { const config = validator(value, ctx); return config === Parser_Failure ? undefined : config; }; } function map(validator, mapper) { return (value, ctx) => { const config = validator(value, ctx); return config === Parser_Failure ? Parser_Failure : mapper(config); }; } function alternatives(...validators) { return (value, ctx) => { for (const validator of validators) { const result = validator(value, ctx); if (result !== Parser_Failure) { return result; } } return Parser_Failure; }; } //# sourceMappingURL=validator.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/runtime/attribute/index.js function registerAttribute(meta, name, validator, attribute) { meta.registerCustom('mcdoc:attribute', name, { validator, attribute }); } function getAttribute(meta, name) { return meta.getCustom('mcdoc:attribute')?.get(name); } function handleAttributes(attributes, ctx, fn) { for (const { name, value } of attributes ?? []) { const handler = getAttribute(ctx.meta, name); if (!handler) { continue; } const config = handler.validator(value, ctx); if (config === Parser_Failure) { continue; } fn(handler.attribute, config); } } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/runtime/attribute/builtin.js const idValidator = alternatives(map(validator_string, v => ({ registry: v })), tree({ registry: validator_string, tags: validator_optional(options('allowed', 'implicit', 'required')), definition: validator_optional(validator_boolean), prefix: validator_optional(options('!')), path: validator_optional(validator_string), empty: validator_optional(options('allowed')), exclude: validator_optional(alternatives(map(validator_string, v => [v]), validator_list(validator_string))), }), () => ({})); const matchRegexValidator = alternatives(map(validator_string, v => ({ pattern: v })), tree({ pattern: validator_string, message: validator_optional(validator_string), })); function getResourceLocationOptions({ registry, tags, definition, path }, requireCanonical, ctx, typeDef) { if (!registry) { if (typeDef?.kind === 'enum' && typeDef.enumKind === 'string') { return { pool: typeDef.values.map(v => ResourceLocation.lengthen(`${v.value}`)), allowUnknown: true, // the mcdoc checker will already report errors for this }; } if (typeDef?.kind === 'literal' && typeDef.value.kind === 'string') { return { pool: [ResourceLocation.lengthen(typeDef.value.value)], allowUnknown: true, }; } return { pool: [], allowUnknown: true }; } if (tags === 'implicit') { registry = `tag/${registry}`; } if (tags === 'allowed' || tags === 'required') { return { category: registry, requireCanonical, allowTag: true, requireTag: tags === 'required', implicitPath: path, }; } return { category: registry, requireCanonical, usageType: definition ? 'definition' : 'reference', implicitPath: path, }; } const integerValidator = alternatives(tree({ min: validator_optional(validator_number), max: validator_optional(validator_number), }), () => ({})); function registerBuiltinAttributes(meta) { registerAttribute(meta, 'canonical', () => undefined, { // Has hardcoded behavior in the runtime checker }); registerAttribute(meta, 'dispatcher_key', validator_string, { stringMocker: (config, _, ctx) => { const symbol = ctx.symbols.query(ctx.doc, 'mcdoc/dispatcher', config).symbol; const keys = Object.keys(symbol?.members ?? {}).filter(m => !m.startsWith('%')); return LiteralNode.mock(ctx.offset, { pool: keys }); }, }); registerAttribute(meta, 'divisible_by', validator_number, { checker(config, typeDef) { if (typeDef.kind !== 'literal' || typeDef.value.kind === 'string' || typeDef.value.kind === 'boolean') { return undefined; } const value = typeDef.value.value; return (node, ctx) => { if (value % config !== 0) { ctx.err.report(localize('not-divisible-by', value, config), node, 2 /* core.ErrorSeverity.Warning */); } }; }, }); registerAttribute(meta, 'id', idValidator, { checkInferred: (config, inferred, ctx) => { if (inferred.kind === 'string') { // Internal mcdoc isAssignable check const idAttr = inferred.attributes?.find(a => a.name === 'id'); if (idAttr) { const inferredConfig = idValidator(idAttr.value, ctx); return inferredConfig === Parser_Failure || inferredConfig.prefix === config.prefix; // Prefix doesn't match } } if (inferred.kind !== 'literal' || inferred.value.kind !== 'string') { return true; // Ignore attribute when not a string } if (config.prefix && !inferred.value.value.startsWith(config.prefix)) { return false; // Missing prefix } if (!config.prefix && inferred.value.value.startsWith('!')) { return false; // Unexpected prefix } if (!inferred.value.value.includes(':')) { if (config.prefix) { inferred.value.value = config.prefix + 'minecraft:' + inferred.value.value.slice(config.prefix.length); } else { inferred.value.value = 'minecraft:' + inferred.value.value; } } return true; }, mapType: (config, typeDef, ctx) => { if (typeDef.kind === 'literal' && typeDef.value.kind === 'string') { const value = ResourceLocation.lengthen(typeDef.value.value); return { ...typeDef, value: { kind: 'string', value } }; } if (typeDef.kind === 'enum' && typeDef.enumKind === 'string') { const values = typeDef.values.map(v => ({ ...v, value: ResourceLocation.lengthen(`${v.value}`), })); return { ...typeDef, values }; } return typeDef; }, stringParser: (config, typeDef, ctx) => { const options = getResourceLocationOptions(config, ctx.requireCanonical, ctx, typeDef); if (!options) { return; } const resourceLocation = resourceLocation_resourceLocation(options); return (src, ctx) => { if (config.empty && !src.canRead()) { return string_string({ unquotable: { blockList: new Set(), allowEmpty: true }, })(src, ctx); } if (config.prefix) { return prefixed_prefixed({ prefix: config.prefix, child: resourceLocation })(src, ctx); } const node = resourceLocation(src, ctx); if (config.exclude) { const resourceLocation = ResourceLocationNode.toString(node, 'full'); for (const e of config.exclude ?? []) { const excluded = ResourceLocation.lengthen(e); if (resourceLocation === excluded) { ctx.err.report(localize('not-allowed-here', localeQuote(excluded)), node, 2 /* core.ErrorSeverity.Warning */); } } } return node; }; }, stringMocker: (config, typeDef, ctx) => { const options = getResourceLocationOptions(config, ctx.requireCanonical ?? false, ctx, typeDef); if (!options) { return undefined; } const resourceLocation = ResourceLocationNode.mock(ctx.offset, options); if (config.prefix) { return PrefixedNode.mock(ctx.offset, config.prefix, resourceLocation); } return resourceLocation; }, }); registerAttribute(meta, 'integer', integerValidator, { stringParser: (config) => { return integer_integer({ pattern: /^-?\d+$/, min: config.min, max: config.max }); }, }); registerAttribute(meta, 'color', validator_string, { checkInferred: (config, inferred, ctx) => { if (config === 'hex_rgb' && inferred.kind === 'literal' && inferred.value.kind === 'string') { return inferred.value.value.startsWith('#'); } return true; }, checker: (config, inferred) => { return (node, ctx) => { switch (config) { case 'named': if (inferred.kind !== 'literal' || inferred.value.kind !== 'string') { return; } node.color = Color.fromNamed(inferred.value.value); return; case 'hex_rgb': if (inferred.kind !== 'literal' || inferred.value.kind !== 'string') { return; } let range = node.range; if (StringBaseNode.is(node) && node.quote) { range = Range.translate(range, 1, -1); } if (!inferred.value.value.startsWith('#')) { ctx.err.report(localize('expected', localeQuote('#')), range, 2 /* core.ErrorSeverity.Warning */); return; } node.color = { value: Color.fromHexRGB(inferred.value.value), format: [ColorFormat.HexRGB], range, }; return; case 'composite_rgb': if (inferred.kind !== 'literal' || typeof inferred.value.value !== 'number') { return; } node.color = { value: Color.fromCompositeRGB(inferred.value.value), format: [ColorFormat.CompositeRGB], range: node.range, }; return; case 'composite_argb': if (inferred.kind !== 'literal' || typeof inferred.value.value !== 'number') { return; } node.color = { value: Color.fromCompositeARGB(inferred.value.value), format: [ColorFormat.CompositeARGB], range: node.range, }; return; default: return; } }; }, }); registerAttribute(meta, 'regex_pattern', () => undefined, { checker: (_, typeDef) => { if (typeDef.kind !== 'literal' || typeDef.value.kind !== 'string') { return undefined; } const pattern = typeDef.value.value; return (node, ctx) => { try { RegExp(pattern); } catch (e) { const message = e instanceof Error ? e.message : `${e}`; const error = message .replace(/^Invalid regular expression: /, '') .replace(/^\/.+\/: /, ''); ctx.err.report(localize('invalid-regex-pattern', error), node, 2 /* core.ErrorSeverity.Warning */); } }; }, }); registerAttribute(meta, 'match_regex', matchRegexValidator, { checker: (config, typeDef, _) => { if (typeDef.kind !== 'literal' || typeDef.value.kind !== 'string') { return undefined; } const pattern = config.pattern; const value = typeDef.value.value; return (node, ctx) => { try { const regex = RegExp(pattern); if (!regex.test(value)) { const message = config.message ?? localize('mismatching-regex-pattern', pattern); ctx.err.report(message, node, 2 /* core.ErrorSeverity.Warning */); } } catch (e) { ctx.logger.warn(`Invalid regular expression in "match_regex" mcdoc attribute: ${pattern}`); } }; }, }); } //# sourceMappingURL=builtin.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/common.js function identifierToSeg(identifier) { const ans = identifier.slice(2).split('::'); if (ans.length === 1 && ans[0] === '') { return []; } return ans; } function segToIdentifier(seg) { return `::${seg.join('::')}`; } //# sourceMappingURL=common.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/uri_processors.js const Extension = '.mcdoc'; const McdocRootPrefix = 'mcdoc/'; const uriBinder = (uris, ctx) => { let urisAndRels = []; for (const uri of uris) { if (!uri.endsWith(Extension)) { continue; } let rel = fileUtil.getRel(uri, ctx.roots); if (!rel) { continue; } rel = rel.slice(0, -Extension.length).replace(/(^|\/)mod$/, ''); urisAndRels.push([uri, rel]); } // Now the value of `urisAndRels`: // file:///root/mcdoc/foo/mod.mcdoc -> mcdoc/foo // file:///root/mcdoc/foo/bar.mcdoc -> mcdoc/foo/bar // A special check for the directory named `mcdoc`: // If all files are put under this folder, we will treat that folder as the "root" instead. if (urisAndRels.every(([_, rel]) => rel.startsWith(McdocRootPrefix))) { urisAndRels = urisAndRels.map(([uri, rel]) => [uri, rel.slice(McdocRootPrefix.length)]); } // Now the value of `urisAndRels`: // file:///root/mcdoc/foo/mod.mcdoc -> foo // file:///root/mcdoc/foo/bar.mcdoc -> foo/bar for (const [uri, rel] of urisAndRels) { ctx.symbols.query(uri, 'mcdoc', segToIdentifier(rel.split('/'))).ifKnown(() => { }).elseEnter({ data: { subcategory: 'module' }, usage: { type: 'definition' }, }); } }; const uriSorter = (a, b, next) => { if (a.endsWith(Extension) && !b.endsWith(Extension)) { return -1; } else if (!a.endsWith(Extension) && b.endsWith(Extension)) { return 1; } else { return next(a, b); } }; //# sourceMappingURL=uri_processors.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/runtime/checker/context.js var McdocCheckerContext; (function (McdocCheckerContext) { function create(ctx, options) { return { ...ctx, allowMissingKeys: options.allowMissingKeys ?? false, requireCanonical: options.requireCanonical ?? false, isEquivalent: options.isEquivalent ?? (() => false), getChildren: options.getChildren ?? (() => []), reportError: options.reportError ?? (() => { }), attachTypeInfo: options.attachTypeInfo, nodeAttacher: options.nodeAttacher, stringAttacher: options.stringAttacher, }; } McdocCheckerContext.create = create; })(McdocCheckerContext || (McdocCheckerContext = {})); //# sourceMappingURL=context.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/runtime/checker/error.js var SimpleError; (function (SimpleError) { function is(error) { return error?.kind === 'duplicate_key' || error?.kind === 'unknown_key' || error?.kind === 'expected_key_value_pair' || error?.kind === 'unknown_tuple_element' || error?.kind === 'internal'; } SimpleError.is = is; })(SimpleError || (SimpleError = {})); var UnknownKeyError; (function (UnknownKeyError) { function is(error) { return error?.kind === 'unknown_key'; } UnknownKeyError.is = is; })(UnknownKeyError || (UnknownKeyError = {})); var src_RangeError; (function (RangeError) { function is(error) { return error?.kind === 'invalid_collection_length' || error?.kind === 'invalid_string_length' || error?.kind === 'number_out_of_range'; } RangeError.is = is; })(src_RangeError || (src_RangeError = {})); var MissingKeyError; (function (MissingKeyError) { function is(error) { return error?.kind === 'missing_key'; } MissingKeyError.is = is; })(MissingKeyError || (MissingKeyError = {})); var TypeMismatchError; (function (TypeMismatchError) { function is(error) { return error?.kind === 'type_mismatch'; } TypeMismatchError.is = is; })(TypeMismatchError || (TypeMismatchError = {})); function condenseAndPropagate(definitionGroup, definitionErrors) { const queue = [{ node: definitionGroup, errorsOnLayer: definitionErrors, depth: 0 }]; while (queue.length) { const { node, errorsOnLayer, depth } = queue.shift(); const stillValidDefinitions = []; const { definitions, condensedErrors } = condenseErrorsAndFilterSiblings(errorsOnLayer); stillValidDefinitions.push(...definitions); node.condensedErrors.push(condensedErrors); if (node.validDefinitions.length !== stillValidDefinitions.length) { filterChildDefinitions(node.validDefinitions.filter(d => !stillValidDefinitions.includes(d)), node.runtimeNode.children); node.validDefinitions = stillValidDefinitions; } const parents = node.parents .filter(parent => { const lastDefWithNode = parent.groupNode.validDefinitions .findLast(d => d.children.includes(node)); if (lastDefWithNode !== parent) { // Wait for last definition that leads to this parent return false; } const lastChild = parent.groupNode.validDefinitions .flatMap(d => d.children) .findLast(v => { if (v.condensedErrors.length > depth) { return true; } let children = [v]; for (let i = 0; i < depth; i++) { children = children.flatMap(v => v.validDefinitions).flatMap(v => v.children); } return children.length > 0; }); if (lastChild !== node) { // Wait for all siblings to be evaluated first return false; } return true; }) .map(parent => ({ node: parent.groupNode, depth: depth + 1, errorsOnLayer: parent.groupNode.validDefinitions .flatMap(d => ({ definition: d, errors: d.children .flatMap(c => c.condensedErrors.length > depth ? c.condensedErrors[depth] : []), })), })); queue.push(...parents); } } function filterChildDefinitions(removedDefs, children) { for (const child of children) { for (const childValue of child.possibleValues) { const removedChildDefs = []; for (let i = 0; i < childValue.definitionsByParent.length; i++) { const definitionGroup = childValue.definitionsByParent[i]; definitionGroup.parents = definitionGroup.parents.filter(p => !removedDefs.includes(p)); if (definitionGroup.parents.length === 0) { removedChildDefs.push(...definitionGroup.validDefinitions); childValue.definitionsByParent.splice(i, 1); i--; } } if (removedChildDefs.length > 0) { filterChildDefinitions(removedChildDefs, childValue.children); } } } } function condenseErrorsAndFilterSiblings(definitions) { if (definitions.length === 0) { return { definitions: [], condensedErrors: [] }; } let validDefinitions = definitions; const errors = []; const typeMismatchResult = condense(validDefinitions, TypeMismatchError.is, (a, b) => a.expected.length === b.expected.length && !a.expected.some(d => !b.expected.some(od => McdocType.equals(d, od))), errors => ({ kind: 'type_mismatch', node: errors[0].node, expected: deduplicateGroups(errors.map(e => e.expected), McdocType.equals), })); validDefinitions = typeMismatchResult.filteredDefinitions; errors.push(...typeMismatchResult.condensedErrors); for (const kind of [ 'unknown_key', 'expected_key_value_pair', 'unknown_tuple_element', ]) { const simpleErrorResult = condense(validDefinitions, (e) => e.kind === kind, _ => true); validDefinitions = simpleErrorResult.filteredDefinitions; errors.push(...simpleErrorResult.condensedErrors); } const missingKeyResult = condense(validDefinitions, MissingKeyError.is, (a, b) => !a.keys.some(k => !b.keys.includes(k)), errors => ({ kind: 'missing_key', node: errors[0].node, keys: deduplicateGroups(errors.map(e => e.keys)), })); validDefinitions = missingKeyResult.filteredDefinitions; errors.push(...missingKeyResult.condensedErrors); for (const kind of [ 'invalid_collection_length', 'invalid_string_length', 'number_out_of_range', ]) { const rangeErrorResult = condense(validDefinitions, (e) => e.kind === kind, (a, b) => a.ranges.length === b.ranges.length && !a.ranges.some(r => !b.ranges.some(or => NumericRange.equals(r, or))), // TODO merge overlapping ranges better? errors => ({ kind, node: errors[0].node, ranges: deduplicateGroups(errors.map(e => e.ranges), NumericRange.equals), })); validDefinitions = rangeErrorResult.filteredDefinitions; errors.push(...rangeErrorResult.condensedErrors); } // No condensing needed for duplicate key. If a key is a duplicate in one definition, it really // should have been reported by all of them validDefinitions[0].errors.filter(e => e.kind === 'duplicate_key'); const internalErrorResult = condense(validDefinitions, (e) => e.kind === 'internal', _ => false); validDefinitions = internalErrorResult.filteredDefinitions; errors.push(...internalErrorResult.condensedErrors); return { definitions: validDefinitions.map(d => d.definition), condensedErrors: errors, }; } function condense(validDefinitions, is, equals, combineAlternatives) { // TODO a lot of O(n^2) in this function, may need optimization const errorsOfType = validDefinitions .map(def => ({ def, errors: def.errors.filter(is) })); const definitionsWithoutError = errorsOfType .filter(d => d.errors.length === 0) .map(e => e.def); if (definitionsWithoutError.length > 0) { return { condensedErrors: [], filteredDefinitions: definitionsWithoutError }; } const distinctErrorsPerNode = errorsOfType .flatMap(d => d.errors.map(e => ({ definition: d.def, error: e }))) .reduce((entries, e) => { const entry = entries.find(oe => oe.errors[0].error.node === e.error.node); if (entry) { const error = entry.errors.find(oe => equals(e.error, oe.error)); if (error) { error.definitions.push(e.definition); } else { entry.errors.push({ error: e.error, definitions: [e.definition] }); } } else { entries.push({ errors: [{ error: e.error, definitions: [e.definition] }] }); } return entries; }, []); const distinctErrors = distinctErrorsPerNode.flatMap(e => e.errors); const commonErrors = distinctErrors .filter(e => e.definitions.length === validDefinitions.length) .map(e => e.error); const definitionsWithUncommonErrors = distinctErrors .filter(e => e.definitions.length < validDefinitions.length) .flatMap(e => e.definitions); const definitionsWithOnlyCommonErrors = validDefinitions .filter(d => !definitionsWithUncommonErrors.includes(d)); if (definitionsWithOnlyCommonErrors.length > 0) { return { filteredDefinitions: definitionsWithOnlyCommonErrors, condensedErrors: commonErrors, }; } const combinedErrors = combineAlternatives ? distinctErrorsPerNode .map(e => { const uniqueDefinitions = deduplicateGroups(e.errors.map(e => e.definitions), (a, b) => McdocType.equals(a.definition.typeDef, b.definition.typeDef)); const ans = { definitions: uniqueDefinitions, error: combineAlternatives(e.errors .filter(e => !commonErrors.includes(e.error)) .map(e => e.error)), }; ans.error.nodesWithConflictingErrors = deduplicateGroups(e.errors.map(e => e.error.nodesWithConflictingErrors ?? [])); if (ans.error.nodesWithConflictingErrors.length === 0) { ans.error.nodesWithConflictingErrors = undefined; } return ans; }) : distinctErrorsPerNode.flatMap(e => e.errors .map(ee => ({ definitions: ee.definitions, error: ee.error }))); const conflictingErrors = combinedErrors .filter(e => e.definitions.length < validDefinitions.length); const nodesWithConflictingErrors = conflictingErrors .map(e => e.error.node) .filter((n, i, arr) => arr.indexOf(n) === i); for (const error of conflictingErrors) { error.error.nodesWithConflictingErrors = nodesWithConflictingErrors; } return { filteredDefinitions: validDefinitions, condensedErrors: [...commonErrors, ...combinedErrors.map(e => e.error)], }; } /** * Deduplicates groups assuming: * - There are no duplicates within a group * - A group with 1 element implies there is no duplicated group of length 1 with the same element * * When calling {@link condense}, if a group stems from an error, this should automatically be the * case. */ function deduplicateGroups(definitionGroups, predicate) { const definitions = []; for (let i = 0; i < definitionGroups.length; i++) { const group = definitionGroups[i]; if (group.length === 1) { definitions.push(group[0]); continue; } definitions.push(...group .filter(v => !definitionGroups.some((og, oi) => (oi > i || og.length === 1) && predicate ? og.some(ov => predicate(v, ov)) : og.includes(v)))); } return definitions; } function getDefaultErrorRange(node, error) { const { range } = node.originalNode; if (error === 'missing_key' || error === 'invalid_collection_length') { return { start: range.start, end: range.start + 1 }; } return range; } function getDefaultErrorReporter(ctx, getErrorRange) { return (error) => { const defaultTranslationKey = error.kind.replaceAll('_', '-'); let localizedText; let severity = 3 /* ErrorSeverity.Error */; switch (error.kind) { case 'unknown_tuple_element': localizedText = localize('expected', localize('nothing')); break; case 'unknown_key': if (error.nodesWithConflictingErrors) { localizedText = localize('invalid-key-combination', arrayToMessage(error.nodesWithConflictingErrors.map(n => McdocType.toString(n.inferredType)), true, 'and')); } else { localizedText = localize(defaultTranslationKey, error.node.inferredType.kind === 'literal' ? localeQuote(error.node.inferredType.value.value.toString()) : `<${localize(`mcdoc.type.${error.node.inferredType.kind}`)}>`); severity = 2 /* ErrorSeverity.Warning */; } break; case 'missing_key': if (error.keys.length === 1) { localizedText = localize(defaultTranslationKey, localeQuote(error.keys[0])); } else { localizedText = localize('mcdoc.runtime.checker.some-missing-keys', arrayToMessage(error.keys)); } break; case 'invalid_collection_length': case 'invalid_string_length': case 'number_out_of_range': const baseKey = error.kind === 'invalid_collection_length' ? 'mcdoc.runtime.checker.range.collection' : error.kind === 'invalid_string_length' ? 'mcdoc.runtime.checker.range.string' : 'mcdoc.runtime.checker.range.number'; const rangeMessages = error.ranges.map(r => { const left = r.min !== undefined ? localize(RangeKind.isLeftExclusive(r.kind) ? 'mcdoc.runtime.checker.range.left-exclusive' : 'mcdoc.runtime.checker.range.left-inclusive', r.min) : undefined; const right = r.max !== undefined ? localize(RangeKind.isLeftExclusive(r.kind) ? 'mcdoc.runtime.checker.range.right-exclusive' : 'mcdoc.runtime.checker.range.right-inclusive', r.max) : undefined; if (left !== undefined && right !== undefined) { return localize('mcdoc.runtime.checker.range.concat', left, right); } return left ?? right; }).filter(r => r !== undefined); localizedText = localize('expected', localize(baseKey, arrayToMessage(rangeMessages, false))); break; case 'type_mismatch': localizedText = localize('expected', arrayToMessage(error.expected.map(e => e.kind === 'enum' ? arrayToMessage(e.values.map(v => ResourceLocation.shorten(v.value.toString()))) : e.kind === 'literal' ? localeQuote(e.value.value.toString()) : localize(`mcdoc.type.${e.kind}`)), false)); break; case 'expected_key_value_pair': localizedText = localize(`mcdoc.runtime.checker.${defaultTranslationKey}`); break; case 'internal': return; default: localizedText = localize(defaultTranslationKey); } ctx.err.report(localizedText, getErrorRange(error.node, error.kind), severity); }; } //# sourceMappingURL=error.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/runtime/checker/index.js function reference(node, path, ctx) { typeDefinition(node, { kind: 'reference', path }, ctx); } function dispatcher(node, registry, index, ctx) { const parallelIndices = typeof index === 'string' ? [{ kind: 'static', value: index }] : Array.isArray(index) ? index : [index]; typeDefinition(node, { kind: 'dispatcher', registry, parallelIndices }, ctx); } function isAssignable(assignValue, typeDef, ctx, isEquivalent) { if (assignValue.kind === 'literal' && typeDef.kind === 'literal' && assignValue.value.kind === typeDef.value.kind && !assignValue.attributes && !typeDef.attributes) { return assignValue.value.value === typeDef.value.value; } let ans = true; const newCtx = McdocCheckerContext.create(ctx, { isEquivalent, getChildren: (_, d) => { switch (d.kind) { case 'list': const vals = getPossibleTypes(d.item); return [vals.map(v => ({ originalNode: v, inferredType: v }))]; case 'byte_array': return [[{ originalNode: { kind: 'byte' }, inferredType: { kind: 'byte' } }]]; case 'int_array': return [[{ originalNode: { kind: 'int' }, inferredType: { kind: 'int' } }]]; case 'long_array': return [[{ originalNode: { kind: 'long' }, inferredType: { kind: 'long' } }]]; case 'struct': return d.fields.map(f => { const vals = getPossibleTypes(f.type); return { attributes: f.attributes, key: { originalNode: f.key, inferredType: f.key }, possibleValues: vals.map(v => ({ originalNode: v, inferredType: v })), }; }); case 'tuple': return d.items.map(f => { const vals = getPossibleTypes(f); return vals.map(v => ({ originalNode: v, inferredType: v })); }); default: return []; } }, reportError: () => { ans = false; }, }); const node = { parent: undefined, runtimeKey: undefined, possibleValues: [], }; node.possibleValues = getPossibleTypes(typeDef).map(v => ({ entryNode: node, node: { originalNode: v, inferredType: v }, children: [], definitionsByParent: [], })); // TODO add bail option to allow checking logic to bail on first error typeDefinition(getPossibleTypes(assignValue).map(v => ({ originalNode: v, inferredType: v })), typeDef, newCtx); return ans; } function typeDefinition(runtimeValues, typeDef, ctx) { const rootNode = { parent: undefined, runtimeKey: undefined, possibleValues: [], }; rootNode.possibleValues = runtimeValues.map(n => ({ node: n, entryNode: rootNode, definitionsByParent: [], children: [], })); for (const value of rootNode.possibleValues) { const simplifiedRoot = simplify(typeDef, { ctx, node: value }).typeDef; const validRootDefinitions = simplifiedRoot.kind === 'union' ? simplifiedRoot.members : [simplifiedRoot]; value.definitionsByParent = [{ parents: [], keyDefinition: undefined, runtimeNode: value, originalTypeDef: typeDef, condensedErrors: [], validDefinitions: [], }]; value.definitionsByParent[0].validDefinitions = validRootDefinitions.map(d => ({ groupNode: value.definitionsByParent[0], typeDef: d, children: [], })); } const nodeQueue = [rootNode]; while (nodeQueue.length !== 0) { const node = nodeQueue.shift(); for (const value of node.possibleValues) { const inferredSimplified = simplify(value.node.inferredType, { ctx, node: value }).typeDef; const children = ctx.getChildren(value.node.originalNode, inferredSimplified); const childNodes = children.map(c => { const ans = { parent: value, runtimeKey: !Array.isArray(c) ? c.key : undefined, possibleValues: [], }; ans.possibleValues = (Array.isArray(c) ? c : c.possibleValues).map(v => ({ entryNode: ans, node: v, definitionsByParent: [], condensedErrors: [], children: [], })); return ans; }); for (const definitionGroup of value.definitionsByParent) { const definitionErrors = []; if (definitionGroup.validDefinitions.length === 0) { // nothing can be assigned to an empty union definitionGroup.condensedErrors = [[{ kind: 'type_mismatch', node: value.node, expected: [], }]]; } for (const def of definitionGroup.validDefinitions) { const { errors, childDefinitions } = checkShallowly(value.node, inferredSimplified, children, def.typeDef, ctx); definitionErrors.push({ definition: def, errors }); for (let i = 0; i < childDefinitions.length; i++) { const childDef = childDefinitions[i]; if (!childDef) { continue; } const child = childNodes[i]; const existingDef = child.possibleValues.length > 0 ? child.possibleValues[0].definitionsByParent .find(d => (d.keyDefinition === undefined || childDef.keyType === undefined ? d.keyDefinition === undefined : McdocType.equals(d.keyDefinition, childDef.keyType)) && McdocType.equals(d.originalTypeDef, childDef.type)) : undefined; for (const childValue of child.possibleValues) { if (existingDef) { existingDef.parents.push(def); def.children.push(existingDef); continue; } // TODO We need some sort of map / local cache which keeps track of the original // non-simplified types and see if they have been compared yet. This is needed // for structures that are cyclic, to essentially bail out once we are comparing // the same types again and just collect the errors of the lower depth. // This will currently lead to a stack overflow error when e.g. comparing two // text component definitions const simplified = simplify(childDef.type, { ctx, node: childValue }).typeDef; const childDefinitionGroup = { parents: [def], runtimeNode: childValue, keyDefinition: childDef.keyType, originalTypeDef: childDef.type, validDefinitions: [], condensedErrors: [], desc: childDef.desc, }; childDefinitionGroup.validDefinitions = (simplified.kind === 'union' ? simplified.members : [simplified]) .map(d => ({ groupNode: childDefinitionGroup, typeDef: d, children: [], })); childValue.definitionsByParent.push(childDefinitionGroup); def.children.push(childDefinitionGroup); } } } condenseAndPropagate(definitionGroup, definitionErrors); } value.children = childNodes; nodeQueue.push(...childNodes); } } if (ctx.attachTypeInfo) { for (const node of rootNode.possibleValues) { attachTypeInfo(node, ctx); } } for (const error of rootNode.possibleValues .flatMap(v => v.definitionsByParent) .flatMap(d => d.condensedErrors) .flat()) { if (error) { ctx.reportError(error); } } } function attachTypeInfo(node, ctx) { const definitions = node.definitionsByParent.flatMap(d => d.validDefinitions); if (definitions.length === 1) { const { typeDef, groupNode } = definitions[0]; ctx.attachTypeInfo?.(node.node.originalNode, typeDef, groupNode.desc); handleNodeAttachers(node.node, typeDef, ctx); if (node.entryNode.runtimeKey && groupNode.keyDefinition) { ctx.attachTypeInfo?.(node.entryNode.runtimeKey.originalNode, groupNode.keyDefinition, groupNode.desc); handleNodeAttachers(node.entryNode.runtimeKey, groupNode.keyDefinition, ctx); } } else if (definitions.length > 1) { ctx.attachTypeInfo?.(node.node.originalNode, { kind: 'union', members: definitions.map(d => d.typeDef), }); if (node.entryNode.runtimeKey) { ctx.attachTypeInfo?.(node.entryNode.runtimeKey.originalNode, { kind: 'union', members: node.definitionsByParent .map(d => d.keyDefinition) .filter((d) => d !== undefined), }); } // when there are multiple valid definitions, we don't run any string parsers. } for (const child of node.children.flatMap(c => c.possibleValues)) { attachTypeInfo(child, ctx); } } function handleNodeAttachers(runtimeValue, typeDef, ctx) { const { nodeAttacher, stringAttacher } = ctx; if (!nodeAttacher && !stringAttacher) { return; } handleAttributes(typeDef.attributes, ctx, (handler, config) => { const parser = handler.stringParser?.(config, typeDef, ctx); if (parser && stringAttacher) { stringAttacher(runtimeValue.originalNode, (node) => { const src = new Source(node.value, node.valueMap); const start = src.cursor; const child = parser(src, ctx); if (!child) { ctx.err.report(localize('expected', localize('mcdoc.runtime.checker.value')), Range.create(start, src.skipRemaining())); return; } else if (src.canRead()) { ctx.err.report(localize('mcdoc.runtime.checker.trailing'), Range.create(src.cursor, src.skipRemaining())); } node.children = [child]; }); } const checker = handler.checker?.(config, runtimeValue.inferredType, ctx); if (checker && nodeAttacher) { nodeAttacher(runtimeValue.originalNode, (node) => { checker(node, ctx); }); } }); } function checkShallowly(runtimeNode, simplifiedInferred, children, typeDef, ctx) { const childDefinitions = Array(children.length) .fill(undefined); if (typeDef.kind === 'any' || typeDef.kind === 'unsafe' || simplifiedInferred.kind === 'unsafe') { return { childDefinitions, errors: [] }; } const typeDefValueType = getValueType(typeDef); const runtimeValueType = getValueType(simplifiedInferred); if (runtimeValueType.kind !== typeDefValueType.kind && !ctx.isEquivalent(runtimeValueType, typeDefValueType)) { return { childDefinitions, errors: [{ kind: 'type_mismatch', node: runtimeNode, expected: [typeDef] }], }; } const errors = []; let assignable = true; handleAttributes(typeDef.attributes, ctx, (handler, config) => { if (handler.checkInferred?.(config, simplifiedInferred, ctx) === false) { assignable = false; } }); if (!assignable) { errors.push({ kind: 'internal', node: runtimeNode }); } if ((typeDef.kind === 'literal' && (simplifiedInferred.kind !== 'literal' || typeDef.value.value !== simplifiedInferred.value.value)) // TODO handle enum field attributes || (typeDef.kind === 'enum' && (simplifiedInferred.kind !== 'literal' || !typeDef.values.some(v => v.value === simplifiedInferred.value.value)))) { return { childDefinitions, errors: [{ kind: 'type_mismatch', node: runtimeNode, expected: [typeDef] }], }; } switch (typeDef.kind) { case 'byte': case 'short': case 'int': case 'long': case 'float': case 'double': if (typeDef.valueRange && simplifiedInferred.kind === 'literal' && typeof simplifiedInferred.value.value === 'number' && !NumericRange.isInRange(typeDef.valueRange, simplifiedInferred.value.value)) { errors.push({ kind: 'number_out_of_range', node: runtimeNode, ranges: [typeDef.valueRange], }); } break; case 'string': if (typeDef.lengthRange && simplifiedInferred.kind === 'literal' && simplifiedInferred.value.kind === 'string' && !NumericRange.isInRange(typeDef.lengthRange, [...simplifiedInferred.value.value].length)) { errors.push({ kind: 'invalid_string_length', node: runtimeNode, ranges: [typeDef.lengthRange], }); } break; case 'struct': { const literalKvps = new Map(); const otherKvps = []; for (let i = 0; i < children.length; i++) { const child = children[i]; if (Array.isArray(child)) { continue; } if (child.key.inferredType.kind === 'literal' && child.key.inferredType.value.kind === 'string') { const existing = literalKvps.get(child.key.inferredType.value.value); if (existing) { // duplicate key existing.values.push({ pair: child, index: i }); } else { literalKvps.set(child.key.inferredType.value.value, { values: [{ pair: child, index: i }], definition: undefined, }); } } else { otherKvps.push({ value: child, index: i }); } } const missingKeys = new Set(); for (const pair of typeDef.fields) { const otherKvpMatches = []; let foundMatch = false; if (pair.key.kind === 'literal' && pair.key.value.kind === 'string') { const runtimeChild = literalKvps.get(pair.key.value.value); if (runtimeChild) { foundMatch = true; runtimeChild.definition = { keyType: pair.key, type: pair.type, desc: pair.desc }; } } if (!foundMatch) { for (const kvp of otherKvps) { if (isAssignable(kvp.value.key.inferredType, pair.key, ctx, ctx.isEquivalent)) { foundMatch = true; otherKvpMatches.push(kvp.index); } } for (const kvp of literalKvps.entries()) { if ((!kvp[1].definition || kvp[1].definition.keyType?.kind !== 'literal') && isAssignable({ kind: 'literal', value: { kind: 'string', value: kvp[0] } }, pair.key, ctx, ctx.isEquivalent)) { foundMatch = true; kvp[1].definition = { keyType: pair.key, type: pair.type, desc: pair.desc }; } } } for (const match of otherKvpMatches) { childDefinitions[match] = { keyType: pair.key, type: pair.type, desc: pair.desc }; } if (!foundMatch && !ctx.allowMissingKeys && pair.key.kind === 'literal' && pair.key.value.kind === 'string' && pair.optional !== true) { missingKeys.add(pair.key.value.value); } } errors.push(...Array.from(missingKeys).map(key => ({ kind: 'missing_key', node: runtimeNode, keys: [key], }))); for (const kvp of literalKvps.values()) { for (const value of kvp.values) { childDefinitions[value.index] = kvp.definition; if (kvp.values.length > 1) { errors.push({ kind: 'duplicate_key', node: value.pair.key }); } } } for (let i = 0; i < children.length; i++) { const childDef = childDefinitions[i]; const child = children[i]; if (childDef === undefined) { if (Array.isArray(child)) { // This should never happen errors.push(...child.map(v => ({ kind: 'expected_key_value_pair', node: v, }))); } else { errors.push({ kind: 'unknown_key', node: child.key }); } } } break; } case 'list': case 'byte_array': case 'int_array': case 'long_array': { let itemType; switch (typeDef.kind) { case 'list': itemType = typeDef.item; break; case 'byte_array': itemType = { kind: 'byte', valueRange: typeDef.valueRange }; break; case 'int_array': itemType = { kind: 'int', valueRange: typeDef.valueRange }; break; case 'long_array': itemType = { kind: 'long', valueRange: typeDef.valueRange }; break; } for (let i = 0; i < childDefinitions.length; i++) { childDefinitions[i] = { type: itemType }; } if (typeDef.lengthRange && !NumericRange.isInRange(typeDef.lengthRange, children.length)) { errors.push({ kind: 'invalid_collection_length', node: runtimeNode, ranges: [typeDef.lengthRange], }); } break; } case 'tuple': { for (let i = 0; i < children.length; i++) { const child = children[i]; if (i < typeDef.items.length) { childDefinitions[i] = { type: typeDef.items[i] }; } else { // This really should always be an array, just to handle this gracefully const values = Array.isArray(child) ? child : [...child.possibleValues, child.key]; errors.push(...values.map(v => ({ kind: 'unknown_tuple_element', node: v, }))); } } if (typeDef.items.length > children.length) { errors.push({ kind: 'invalid_collection_length', node: runtimeNode, ranges: [{ kind: 0b00, max: typeDef.items.length, min: typeDef.items.length }], }); } break; } } return { childDefinitions, errors }; } function getPossibleTypes(typeDef) { return typeDef.kind === 'union' ? typeDef.members.flatMap(m => getPossibleTypes(m)) : [typeDef]; } function simplify(typeDef, context) { function wrap(result) { if (!result.typeDef.attributes?.length) { return result; } handleAttributes(typeDef.attributes, context.ctx, (handler, config) => { if (handler.mapType) { result.typeDef = handler.mapType(config, result.typeDef, context.ctx); } }); return result; } switch (typeDef.kind) { case 'reference': return wrap(simplifyReference(typeDef, context)); case 'dispatcher': return wrap(simplifyDispatcher(typeDef, context)); case 'indexed': return wrap(simplifyIndexed(typeDef, context)); case 'union': return wrap(simplifyUnion(typeDef, context)); case 'struct': return wrap(simplifyStruct(typeDef, context)); case 'list': return wrap(simplifyList(typeDef, context)); case 'tuple': return wrap(simplifyTuple(typeDef, context)); case 'enum': return wrap(simplifyEnum(typeDef, context)); case 'concrete': return wrap(simplifyConcrete(typeDef, context)); case 'template': return wrap(simplifyTemplate(typeDef, context)); case 'mapped': return wrap(simplifyMapped(typeDef, context)); default: return wrap({ typeDef }); } } function simplifyReference(typeDef, context) { if (!typeDef.path) { // TODO when does this happen? context.ctx.logger.warn(`Tried to access empty reference`); return { typeDef: { kind: 'union', members: [] } }; } const mapped = context.typeMapping?.[typeDef.path]; if (mapped) { return { typeDef: mapped, dynamicData: true }; } // TODO Probably need to keep original symbol around in some way to support "go to definition" const symbol = context.ctx.symbols.query(context.ctx.doc, 'mcdoc', typeDef.path); const data = symbol.getData(TypeDefSymbolData.is); if (!data?.typeDef) { context.ctx.logger.warn(`Tried to access unknown reference ${typeDef.path}`); return { typeDef: { kind: 'union', members: [] } }; } if (context.ctx.config.env.enableMcdocCaching && data.simplifiedTypeDef) { return { typeDef: data.simplifiedTypeDef }; } const simplifiedResult = simplify(data.typeDef, context); if (typeDef.attributes?.length) { simplifiedResult.typeDef = { ...simplifiedResult.typeDef, attributes: [...typeDef.attributes, ...simplifiedResult.typeDef.attributes ?? []], }; } if (context.ctx.config.env.enableMcdocCaching && !simplifiedResult.dynamicData) { symbol.amend({ data: { data: { ...data, simplifiedTypeDef: simplifiedResult.typeDef, }, }, }); } return simplifiedResult; } function simplifyDispatcher(typeDef, context) { const dispatcherQuery = context.ctx.symbols.query(context.ctx.doc, 'mcdoc/dispatcher', typeDef.registry); const dispatcher = dispatcherQuery.symbol?.members; if (!dispatcher) { context.ctx.logger.warn(`Tried to access unknown dispatcher ${typeDef.registry}`); return { typeDef: { kind: 'union', members: [] } }; } const result = resolveIndices(typeDef.parallelIndices, dispatcher, dispatcherQuery, context); return result; } function simplifyIndexed(typeDef, context) { const childResult = simplify(typeDef.child, { ...context, typeArgs: [], }); const child = childResult.typeDef; if (child.kind !== 'struct') { context.ctx.logger.warn(`Tried to index un-indexable type ${child.kind}`); return { typeDef: { kind: 'union', members: [] }, dynamicData: childResult.dynamicData }; } const symbolMap = {}; for (const field of child.fields) { if (field.key.kind === 'literal' && field.key.value.kind === 'string') { symbolMap[field.key.value.value] = { data: { typeDef: field.type, }, }; } } const simplified = resolveIndices(typeDef.parallelIndices, symbolMap, undefined, context); return { ...simplified, dynamicData: childResult.dynamicData ?? simplified.dynamicData }; } function resolveIndices(parallelIndices, symbolMap, symbolQuery, context) { let dynamicData = false; let values = []; function pushValue(key, data) { if (context.ctx.config.env.enableMcdocCaching && data.simplifiedTypeDef) { if (data.simplifiedTypeDef.kind === 'union') { values.push(...data.simplifiedTypeDef.members); } else { values.push(data.simplifiedTypeDef); } } else { const simplifiedResult = simplify(data.typeDef, context); if (simplifiedResult.dynamicData) { dynamicData = true; } else if (context.ctx.config.env.enableMcdocCaching && symbolQuery) { symbolQuery.member(key, s => s.amend({ data: { data: { ...data, simplifiedTypeDef: simplifiedResult.typeDef } }, })); } if (simplifiedResult.typeDef.kind === 'union') { values.push(...simplifiedResult.typeDef.members); } else { values.push(simplifiedResult.typeDef); } } } let unkownTypeDef = false; function getUnknownTypeDef() { if (unkownTypeDef === false) { const data = symbolMap['%unknown']?.data; unkownTypeDef = TypeDefSymbolData.is(data) ? data : undefined; } return unkownTypeDef; } for (const index of parallelIndices) { let lookup = []; if (index.kind === 'static') { if (index.value === '%fallback') { values = []; for (const [key, value] of Object.entries(symbolMap)) { if (TypeDefSymbolData.is(value.data)) { pushValue(key, value.data); } } break; } if (index.value.startsWith('minecraft:')) { lookup.push(index.value.substring(10)); } else { lookup.push(index.value); } } else { dynamicData = true; let possibilities = context.isMember ? [{ value: context.node, key: context.node.entryNode.runtimeKey }] : [{ value: context.node.entryNode.parent, key: context.node.entryNode.runtimeKey, }]; for (const entry of index.accessor) { if (typeof entry !== 'string' && entry.keyword === 'parent') { possibilities = possibilities.map(n => ({ value: n.value?.entryNode.parent, key: n.value?.entryNode.runtimeKey, })); } else if (typeof entry !== 'string' && entry.keyword === 'key') { possibilities = possibilities.map(p => ({ value: p.key ? { node: p.key, entryNode: { parent: p.value, runtimeKey: p.key } } : undefined, key: undefined, })); break; } else if (typeof entry === 'string') { const newPossibilities = []; for (const node of possibilities) { const possibleChildren = node.value ? context.ctx.getChildren(node.value.node.originalNode, simplify(node.value.node.inferredType, { ...context, node: node.value }) .typeDef).filter(child => { if (!Array.isArray(child)) { return child.key.inferredType.kind === 'literal' && child.key.inferredType.value.kind === 'string' && child.key.inferredType.value.value === entry; } // TODO if it's a list, consider all list items. // This should probably work recursively if we have a list of lists. return false; }) // We don't consider arrays yet, see above. .flatMap(c => c.possibleValues.map(v => ({ value: { node: v, entryNode: { parent: node.value, runtimeKey: c.key }, }, key: undefined, }))) : [{ value: undefined, key: undefined }]; newPossibilities.push(...possibleChildren); } possibilities = newPossibilities; } else { lookup.push('%none'); break; } } for (const value of possibilities.map(p => p.value?.node)) { if (value?.inferredType.kind === 'literal' && value.inferredType.value.kind === 'string') { const ans = value.inferredType.value.value; if (ans.startsWith('minecraft:')) { lookup.push(ans.substring(10)); } else { lookup.push(ans); } } else { lookup.push('%none'); } } } if (lookup.length === 0) { lookup = ['%none']; } const currentValues = lookup.map(v => { const data = symbolMap[v]?.data; return { value: v, data: TypeDefSymbolData.is(data) ? data : getUnknownTypeDef() }; }); const missing = currentValues.find(v => !v.data); if (missing) { // fallback case return { typeDef: { kind: 'any' }, dynamicData }; } else { for (const entry of currentValues) { pushValue(entry.value, entry.data); } } } if (values.length === 1) { return { typeDef: values[0], dynamicData }; } return { typeDef: { kind: 'union', members: values }, dynamicData }; } function simplifyUnion(typeDef, context) { let dynamicData = false; let validMembers = typeDef.members .filter(member => { let keep = true; handleAttributes(member.attributes, context.ctx, (handler, config) => { if (!keep || !handler.filterElement) { return; } if (!handler.filterElement(config, context.ctx)) { keep = false; } }); return keep; }); const filterCanonical = context.ctx.requireCanonical && validMembers.some(m => m.attributes?.some(a => a.name === 'canonical')); if (filterCanonical) { validMembers = typeDef.members.filter(member => member.attributes?.some(a => a.name === 'canonical')); } if (validMembers.length === 1) { return simplify(validMembers[0], context); } const members = []; for (const member of validMembers) { const { typeDef: simplified, dynamicData: memberDynamic } = simplify(member, context); if (memberDynamic) { dynamicData = true; } if (simplified.kind === 'union') { members.push(...simplified.members); } else { members.push(simplified); } } if (members.length === 1) { return { typeDef: members[0], dynamicData }; } return { typeDef: { kind: 'union', members }, dynamicData }; } function simplifyStruct(typeDef, context) { const fields = []; let dynamicData = false; function addField(key, field) { handleAttributes(field.attributes, context.ctx, (handler, config) => { if (handler.mapField) { field = handler.mapField(config, field, context.ctx); } }); if (typeof key === 'string') { fields.push({ ...field, key: { kind: 'literal', value: { kind: 'string', value: key } }, }); } else if (key.kind === 'union') { key.members.forEach(m => addField(m, { ...field, optional: true })); } else { fields.push({ ...field, key }); } } for (const field of typeDef.fields) { let keep = true; handleAttributes(field.attributes, context.ctx, (handler, config) => { if (keep && handler.filterElement?.(config, context.ctx) === false) { keep = false; } }); if (!keep) { continue; } if (field.kind === 'pair') { // Don't simplify the value here, simplify is shallow and needs a runtime value to work // properly, so the values should only be simplified once they were assigned to a // runtime value. let structKey; if (typeof field.key === 'string') { structKey = field.key; } else { const simplifiedKeyResult = simplify(field.key, { ...context, isMember: true, typeArgs: [], }); if (simplifiedKeyResult.dynamicData) { dynamicData = true; } structKey = simplifiedKeyResult.typeDef; } let mappedField; if (context.typeMapping) { mappedField = { ...field, type: { kind: 'mapped', child: field.type, mapping: context.typeMapping, }, }; // Don't cache mapped field data // TODO find a better way to handle mapped types with caching dynamicData = true; } else { mappedField = field; } addField(structKey, mappedField); } else { const simplifiedSpread = simplify(field.type, { ...context, isMember: true, typeArgs: [], }); if (simplifiedSpread.dynamicData) { dynamicData = true; } if (simplifiedSpread.typeDef.kind === 'any') { fields.push({ kind: 'pair', key: { kind: 'any' }, type: { kind: 'any' } }); } else if (simplifiedSpread.typeDef.kind === 'struct') { fields.push(...simplifiedSpread.typeDef.fields); } } } return { typeDef: { kind: 'struct', fields }, dynamicData, }; } function simplifyList(typeDef, context) { if (!context.typeMapping) { return { typeDef }; } return { typeDef: { ...typeDef, item: { kind: 'mapped', child: typeDef.item, mapping: context.typeMapping }, }, // Don't cache mapped field data // TODO find a better way to handle mapped types with caching dynamicData: true, }; } function simplifyTuple(typeDef, context) { if (!context.typeMapping) { return { typeDef }; } return { typeDef: { ...typeDef, items: typeDef.items.map(item => ({ kind: 'mapped', child: item, mapping: context.typeMapping, })), }, // Don't cache mapped field data // TODO find a better way to handle mapped types with caching dynamicData: true, }; } function simplifyEnum(typeDef, context) { const filteredValues = typeDef.values.filter(value => { let keep = true; handleAttributes(value.attributes, context.ctx, (handler, config) => { if (!keep || !handler.filterElement) { return; } if (!handler.filterElement(config, context.ctx)) { keep = false; } }); return keep; }); return { typeDef: { ...typeDef, enumKind: typeDef.enumKind ?? 'int', values: filteredValues } }; } function simplifyConcrete(typeDef, context) { let dynamicData = false; const simplifiedArgs = typeDef.typeArgs.map(arg => { const ans = simplify(arg, context); if (ans.dynamicData) { dynamicData = true; } return ans.typeDef; }); const result = simplify(typeDef.child, { ...context, typeArgs: simplifiedArgs }); return { typeDef: result.typeDef, dynamicData: dynamicData || result.dynamicData }; } function simplifyTemplate(typeDef, context) { if (context.typeArgs?.length !== typeDef.typeParams.length) { context.ctx.logger.warn(`Expected ${typeDef.typeParams.length} mcdoc type args for ${McdocType.toString(typeDef.child)}, but got ${context.typeArgs?.length ?? 0}`); } const mapping = Object.fromEntries(typeDef.typeParams.map((param, i) => { const arg = context.typeArgs?.[i] ?? { kind: 'union', members: [] }; return [param.path, arg]; })); return simplify(typeDef.child, { ...context, typeArgs: [], typeMapping: mapping }); } function simplifyMapped(typeDef, context) { let dynamicData = false; // Mapped types that were created in simplify are always simplified // types already, in which case this will be a cheap operation, but // this is necessary for type safety const simplifiedMapping = Object.fromEntries(Object.entries(typeDef.mapping).map(([path, param]) => { const ans = simplify(param, context); if (ans.dynamicData) { dynamicData = true; } return [path, ans.typeDef]; })); const ans = simplify(typeDef.child, { ...context, typeMapping: simplifiedMapping }); return { typeDef: ans.typeDef, dynamicData: dynamicData || ans.dynamicData }; } function getValueType(type) { switch (type.kind) { case 'literal': return { kind: type.value.kind }; case 'enum': return { kind: type.enumKind }; default: return type; } } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/runtime/completer/index.js function getFields(typeDef, ctx) { switch (typeDef.kind) { case 'union': const allFields = new Map(); for (const member of typeDef.members) { for (const field of getFields(member, ctx)) { allFields.set(field.key, field); } } return [...allFields.values()]; case 'struct': return typeDef.fields.flatMap(field => { if (typeof field.key === 'string') { return [{ key: field.key, field }]; } if (field.key.kind === 'string' || (field.key.kind === 'literal' && field.key.value.kind === 'string') || (field.key.kind === 'enum' && field.key.enumKind === 'string')) { const ans = getStringCompletions(field.key, ctx); if (ans.length > 0) { return ans.map(c => ({ key: c.value, field })); } } if (field.key.kind === 'literal') { return [{ key: `${field.key.value.value}`, field }]; } if (field.key.kind === 'string') { return getStringCompletions(field.key, ctx) .map(c => ({ key: c.value, field })); } return getValues(field.key, ctx) .map(c => ({ key: c.value, field })); }); default: return []; } } // TODO: only accept SimplifiedMcdocType here function getValues(typeDef, ctx) { if (typeDef.kind === 'string' || (typeDef.kind === 'literal' && typeDef.value.kind === 'string') || (typeDef.kind === 'enum' && typeDef.enumKind === 'string')) { const ans = getStringCompletions(typeDef, ctx); if (ans.length > 0) { return ans; } } switch (typeDef.kind) { case 'union': const allValues = new Map(); for (const member of typeDef.members) { for (const value of getValues(member, ctx)) { allValues.set(value.value, value); } } return [...allValues.values()]; case 'reference': // TODO: de-duplicate this logic from the runtime simplifier if (!typeDef.path) { return []; } const symbol = ctx.symbols.query(ctx.doc, 'mcdoc', typeDef.path); const def = symbol.getData(TypeDefSymbolData.is)?.typeDef; if (!def) { return []; } if (typeDef.attributes?.length) { return getValues({ ...def, attributes: [...typeDef.attributes, ...def.attributes ?? []], }, ctx); } return getValues(def, ctx); case 'literal': return [{ value: `${typeDef.value.value}`, kind: typeDef.value.kind }]; case 'boolean': return ['false', 'true'].map(v => ({ value: v, kind: 'boolean' })); case 'enum': // TODO: de-duplicate this logic from the runtime simplifier const filteredValues = typeDef.values.filter(value => { let keep = true; handleAttributes(value.attributes, ctx, (handler, config) => { if (!keep || !handler.filterElement) { return; } if (!handler.filterElement(config, ctx)) { keep = false; } }); return keep; }); return filteredValues.map(v => ({ value: `${v.value}`, detail: v.identifier, kind: typeDef.enumKind ?? 'string', documentation: v.desc, })); case 'byte': case 'short': case 'int': case 'long': case 'float': case 'double': return getNumericCompletions(typeDef, ctx); default: return []; } } function getStringCompletions(typeDef, ctx) { const ans = []; handleAttributes(typeDef.attributes, ctx, (handler, config) => { const mock = handler.stringMocker?.(config, typeDef, ctx); if (!mock) { return; } const items = ctx.meta.getCompleter(mock.type)(mock, ctx); ans.push(...items.map(item => ({ value: item.label, kind: 'string', labelSuffix: item.labelSuffix, detail: item.detail, completionKind: item.kind, insertText: item.insertText, sortText: item.sortText, }))); }); if (ans.length === 0 && typeDef.kind === 'literal') { ans.push({ value: `${typeDef.value.value}`, kind: 'string' }); } return ans; } function getNumericCompletions(typeDef, ctx) { const ans = []; handleAttributes(typeDef.attributes, ctx, (handler, config) => { const items = handler.numericCompleter?.(config, ctx); if (!items) { return; } ans.push(...items.map(item => ({ value: item.label, kind: typeDef.kind, labelSuffix: item.labelSuffix, detail: item.detail, completionKind: item.kind, insertText: item.insertText, sortText: item.sortText, }))); }); return ans; } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/runtime/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/index.js /* istanbul ignore next */ const initialize = ({ meta }) => { meta.registerLanguage('mcdoc', { extensions: ['.mcdoc'], parser: parser_module_ }); registerBuiltinAttributes(meta); meta.registerUriBinder(uriBinder); meta.setUriSorter(uriSorter); registerMcdocBinders(meta); registerMcdocColorizer(meta); registerMcdocFormatter(meta); }; //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/parser/boolean.js const parser_boolean_boolean = (src, _ctx) => { const start = src.cursor; if (src.trySkip('false')) { return { type: 'json:boolean', range: Range.create(start, src), value: false }; } if (src.trySkip('true')) { return { type: 'json:boolean', range: Range.create(start, src), value: true }; } return Parser_Failure; }; //# sourceMappingURL=boolean.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/parser/null.js const null_ = (src, ctx) => { const start = src.cursor; if (src.trySkip('null')) { return { type: 'json:null', range: Range.create(start, src) }; } return Parser_Failure; }; //# sourceMappingURL=null.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/parser/number.js const number_number = (src, ctx) => { const value = util_select([{ regex: /^-?(?:0|[1-9]\d*)(?!\d|[.eE])/, parser: long_long({ pattern: /^-?(?:0|[1-9]\d*)$/ }), }, { parser: float_float({ // Regex form of the chart from https://www.json.org. pattern: /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][-+]?\d+)?$/, }), }])(src, ctx); return { type: 'json:number', children: [value], value, range: value.range }; }; //# sourceMappingURL=number.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/parser/string.js const JsonStringOptions = { escapable: { characters: ['b', 'f', 'n', 'r', 't'], unicode: true }, quotes: ['"'], }; const parser_string_string = (src, ctx) => setType('json:string', string_string(JsonStringOptions))(src, ctx); //# sourceMappingURL=string.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/parser/object.js const object = (src, ctx) => setType('json:object', record_record({ start: '{', pair: { key: parser_string_string, sep: ':', value: entry, end: ',', trailingEnd: false }, end: '}', }))(src, ctx); //# sourceMappingURL=object.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/parser/entry.js const LegalNumberStart = new Set(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-']); const entry = (src, ctx) => util_select([ { predicate: (src) => src.tryPeek('['), parser: array }, { predicate: (src) => src.tryPeek('false') || src.tryPeek('true'), parser: parser_boolean_boolean }, { predicate: (src) => src.tryPeek('null'), parser: null_ }, { predicate: (src) => LegalNumberStart.has(src.peek()), parser: number_number }, { predicate: (src) => src.tryPeek('{'), parser: object, }, { parser: parser_string_string }, ])(src, ctx); //# sourceMappingURL=entry.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/parser/array.js const array = (ctx, src) => setType('json:array', list({ start: '[', value: entry, sep: ',', trailingSep: false, end: ']' }))(ctx, src); //# sourceMappingURL=array.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/parser/file.js const parser_file_file = util_map(dumpErrors(entry), (res) => ({ type: 'json:file', range: res.range, children: [res] })); //# sourceMappingURL=file.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/parser/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/node/index.js var JsonFileNode; (function (JsonFileNode) { /* istanbul ignore next */ function is(obj) { return obj?.type === 'json:file'; } JsonFileNode.is = is; })(JsonFileNode || (JsonFileNode = {})); var JsonNode; (function (JsonNode) { function is(node) { return (JsonObjectNode.is(node) || JsonArrayNode.is(node) || JsonStringNode.is(node) || JsonNumberNode.is(node) || JsonBooleanNode.is(node) || JsonNullNode.is(node)); } JsonNode.is = is; })(JsonNode || (JsonNode = {})); var JsonObjectNode; (function (JsonObjectNode) { /* istanbul ignore next */ function is(obj) { return obj?.type === 'json:object'; } JsonObjectNode.is = is; function mock(range) { return { type: 'json:object', range: Range.get(range), children: [] }; } JsonObjectNode.mock = mock; })(JsonObjectNode || (JsonObjectNode = {})); var JsonPairNode; (function (JsonPairNode) { /* istanbul ignore next */ function is(obj) { return obj.type === 'pair'; } JsonPairNode.is = is; })(JsonPairNode || (JsonPairNode = {})); var JsonArrayNode; (function (JsonArrayNode) { function is(obj) { return obj?.type === 'json:array'; } JsonArrayNode.is = is; function mock(range) { return { type: 'json:array', range: Range.get(range), children: [] }; } JsonArrayNode.mock = mock; })(JsonArrayNode || (JsonArrayNode = {})); var JsonStringNode; (function (JsonStringNode) { /* istanbul ignore next */ function is(obj) { return obj?.type === 'json:string'; } JsonStringNode.is = is; function mock(range) { return { ...StringNode.mock(range, JsonStringOptions), type: 'json:string' }; } JsonStringNode.mock = mock; })(JsonStringNode || (JsonStringNode = {})); var JsonNumberNode; (function (JsonNumberNode) { /* istanbul ignore next */ function is(obj) { return obj.type === 'json:number'; } JsonNumberNode.is = is; })(JsonNumberNode || (JsonNumberNode = {})); var JsonBooleanNode; (function (JsonBooleanNode) { /* istanbul ignore next */ function is(obj) { return obj.type === 'json:boolean'; } JsonBooleanNode.is = is; })(JsonBooleanNode || (JsonBooleanNode = {})); var JsonNullNode; (function (JsonNullNode) { /* istanbul ignore next */ function is(obj) { return obj.type === 'json:null'; } JsonNullNode.is = is; })(JsonNullNode || (JsonNullNode = {})); var TypedJsonNode; (function (TypedJsonNode) { /* istanbul ignore next */ function is(obj) { return obj.type === 'json:typed'; } TypedJsonNode.is = is; })(TypedJsonNode || (TypedJsonNode = {})); //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/checker/index.js const typed = (node, ctx) => { index(node.targetType)(node.children[0], ctx); }; function register(meta) { meta.registerChecker('json:typed', typed); } function index(type, options) { return (node, ctx) => { typeDefinition([{ originalNode: node, inferredType: inferType(node) }], type, McdocCheckerContext.create(ctx, { isEquivalent: (inferred, def) => { switch (inferred.kind) { case 'list': return ['list', 'byte_array', 'int_array', 'long_array', 'tuple'].includes(def.kind); case 'struct': return def.kind === 'struct'; case 'byte': case 'short': case 'int': case 'long': return ['byte', 'short', 'int', 'long', 'float', 'double'].includes(def.kind); case 'float': case 'double': return ['float', 'double'].includes(def.kind); default: return false; } }, getChildren: node => { if (node.type === 'json:array') { return node.children.filter(n => n.value).map(n => [{ originalNode: n.value, inferredType: inferType(n.value) }]); } if (node.type === 'json:object') { return node.children.filter(kvp => kvp.key).map(kvp => ({ key: { originalNode: kvp.key, inferredType: inferType(kvp.key) }, possibleValues: kvp.value ? [{ originalNode: kvp.value, inferredType: inferType(kvp.value) }] : [], })); } return []; }, reportError: err => { if (err.kind === 'duplicate_key' && options?.discardDuplicateKeyErrors) { return; } getDefaultErrorReporter(ctx, (getDefaultErrorRange))(err); }, attachTypeInfo: (node, definition, desc = '') => { node.typeDef = definition; // TODO: improve hover info // TODO some sort of shared default implementaion between JSON and SNBT (DRY) if (node.parent && JsonPairNode?.is(node.parent)) { if (node.parent.key?.typeDef && node.parent.value?.typeDef) { const valueString = McdocType.toString(node.parent.value.typeDef); let keyString = McdocType.toString(node.parent.key.typeDef); if (node.parent.key.typeDef.kind !== 'literal') { keyString = `[${keyString}]`; } const hover = `\`\`\`typescript\n${keyString}: ${valueString}\n\`\`\`\n${desc}`; node.parent.key.hover = hover; if (node.parent.value.type !== 'json:array' && node.parent.value.type !== 'json:object') { node.parent.value.hover = `\`\`\`typescript\n${valueString}\n\`\`\`\n${desc}`; } } } else if (node.type !== 'json:array' && node.type !== 'json:object') { node.hover = `\`\`\`typescript\n${McdocType.toString(definition)}\n\`\`\`\n${desc}`; } }, nodeAttacher: (node, attacher) => attacher(node), stringAttacher: (node, attacher) => { if (!JsonStringNode.is(node)) { return; } attacher(node); if (node.children) { AstNode.setParents(node); // Because the runtime checker happens after binding, we need to manually call this fallbackSync(node, ctx); builtin_fallbackSync(node, ctx); } }, })); }; } function inferType(node) { switch (node.type) { case 'json:boolean': return { kind: 'literal', value: { kind: 'boolean', value: node.value } }; case 'json:number': return { kind: 'literal', value: { kind: node.value.type, value: Number(node.value.value) }, }; case 'json:null': return { kind: 'any' }; // null is always invalid? case 'json:string': return { kind: 'literal', value: { kind: 'string', value: node.value } }; case 'json:array': return { kind: 'list', item: { kind: 'any' } }; case 'json:object': return { kind: 'struct', fields: [] }; } } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/colorizer/index.js const colorizer_boolean = (node) => { return [ColorToken.create(node, 'literal')]; }; const colorizer_null_ = (node) => { return [ColorToken.create(node, 'literal')]; }; const colorizer_object = (node, ctx) => { const ans = []; for (const pair of node.children) { if (pair.key) { ans.push(ColorToken.create(pair.key, 'property')); } if (pair.value) { const colorizer = ctx.meta.getColorizer(pair.value.type); ans.push(...colorizer(pair.value, ctx)); } } return ans; }; const colorizer_string = (node, ctx) => { if (node.children && node.children?.length > 0) { const child = node.children[0]; const colorizer = ctx.meta.getColorizer(child.type); return colorizer(child, ctx); } return string(node, ctx); }; function colorizer_register(meta) { meta.registerColorizer('json:boolean', colorizer_boolean); meta.registerColorizer('json:null', colorizer_null_); meta.registerColorizer('json:number', number); meta.registerColorizer('json:object', colorizer_object); meta.registerColorizer('json:string', colorizer_string); } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/completer/index.js const completer_array = (node, ctx) => { const index = binarySearch(node.children, ctx.offset, (n, o) => { return Range.compareOffset(n.range, o, true); }); const item = index >= 0 ? node.children[index] : undefined; if (item?.value) { return ctx.meta.getCompleter(item.value.type)(item.value, ctx); } if (node.typeDef?.kind === 'list') { const completions = completer_getValues(node.typeDef.item, ctx.offset, ctx); if (ctx.offset < (node.children[node.children.length - 1]?.range.start ?? 0)) { return completions.map(c => ({ ...c, insertText: c.insertText + ',' })); } return completions; } return []; }; const completer_object = record({ key: (record, pair, ctx, range, iv, ipe, exitingKeys) => { if (!record.typeDef) { return []; } const keySet = new Set(exitingKeys.map(n => n.value)); return getFields(record.typeDef, ctx) .filter(({ key }) => !keySet.has(key)) .map(({ key, field }) => CompletionItem.create(key, pair?.key ?? range, { kind: 5 /* core.CompletionKind.Field */, detail: McdocType.toString(field.type), documentation: field.desc, deprecated: field.deprecated, sortText: field.optional ? '$b' : '$a', // sort above hardcoded $schema filterText: `"${key}"`, insertText: `"${key}"${iv ? ': ' : ''}${ipe ? '$1,' : ''}`, })); }, value: (record, pair, ctx, range) => { if (pair.value) { return ctx.meta.getCompleter(pair.value.type)(pair.value, ctx); } if (pair.key && record.typeDef) { const pairKey = pair.key.value; const field = getFields(record.typeDef, ctx) .find(({ key }) => key === pairKey) ?.field.type; if (field) { return completer_getValues(field, range, ctx); } } return []; }, }); const primitive = (node, ctx) => { const insideRange = Range.contains(node, ctx.offset, true); if (node.type === 'json:string' && node.children?.length && insideRange) { const childItems = builtin_string(node, ctx); if (childItems.length > 0) { return childItems; } } if (!node.typeDef) { return []; } return completer_getValues(node.typeDef, insideRange ? node : ctx.offset, ctx); }; function completer_getValues(typeDef, range, ctx) { return getValues(typeDef, ctx) .map(({ value, labelSuffix, detail, documentation, kind, completionKind, insertText, sortText }) => CompletionItem.create(value, range, { kind: completionKind ?? 12 /* core.CompletionKind.Value */, labelSuffix, detail, documentation, filterText: kind === 'string' ? `"${value}"` : value, insertText: kind === 'string' ? `"${insertText ?? value}"` : insertText ?? value, sortText, })); } function completer_register(meta) { meta.registerCompleter('json:array', completer_array); meta.registerCompleter('json:boolean', primitive); meta.registerCompleter('json:number', primitive); meta.registerCompleter('json:null', primitive); meta.registerCompleter('json:object', completer_object); meta.registerCompleter('json:string', primitive); } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/formatter/index.js const formatter_file = (node, ctx) => { const child = node.children[0]; return ctx.meta.getFormatter(child.type)(child, ctx); }; const formatter_array = (node, ctx) => { if (node.children.length === 0) { return '[]'; } const values = node.children.map((child) => { const value = child.value && ctx.meta.getFormatter(child.value.type)(child.value, indentFormatter(ctx)); return `${ctx.indent(1)}${value ?? ''}`; }); return `[\n${values.join(',\n')}\n${ctx.indent()}]`; }; const formatter_object = (node, ctx) => { if (node.children.length === 0) { return '{}'; } const fields = node.children.map((child) => { const key = child.key && formatter_string(child.key, ctx); const value = child.value && ctx.meta.getFormatter(child.value.type)(child.value, indentFormatter(ctx)); return `${ctx.indent(1)}${key ?? ''}: ${value ?? ''}`; }); return `{\n${fields.join(',\n')}\n${ctx.indent()}}`; }; const formatter_number = (node, ctx) => { return ctx.meta.getFormatter(node.value.type)(node.value, ctx); }; const formatter_string = (node, ctx) => { // TODO: Use core.formatter.string when it correctly escapes the string return JSON.stringify(node.value); }; function formatter_register(meta) { meta.registerFormatter('json:file', formatter_file); meta.registerFormatter('json:array', formatter_array); meta.registerFormatter('json:boolean', formatter_builtin_boolean); meta.registerFormatter('json:null', () => 'null'); meta.registerFormatter('json:number', formatter_number); meta.registerFormatter('json:object', formatter_object); meta.registerFormatter('json:string', formatter_string); } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/index.js /* istanbul ignore file */ /** * @param jsonUriPredicate If provided, JSON file URIs must pass this predicate for them to be of * proper `json` language. */ function getInitializer(jsonUriPredicate) { return ({ meta }) => { meta.registerLanguage('json', { extensions: ['.json'], uriPredicate: jsonUriPredicate, triggerCharacters: ['\n', ':', '"'], parser: parser_file_file, }); meta.registerLanguage('mcmeta', { extensions: ['.mcmeta'], triggerCharacters: ['\n', ':', '"'], parser: parser_file_file, }); meta.registerParser('json:entry', entry); register(meta); colorizer_register(meta); completer_register(meta); formatter_register(meta); }; } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/node/index.js var NbtNode; (function (NbtNode) { /* istanbul ignore next */ function is(node) { return (NbtPrimitiveNode.is(node) || NbtCompoundNode.is(node) || NbtCollectionNode.is(node)); } NbtNode.is = is; })(NbtNode || (NbtNode = {})); var NbtPrimitiveNode; (function (NbtPrimitiveNode) { /* istanbul ignore next */ function is(node) { return NbtNumberNode.is(node) || NbtStringNode.is(node); } NbtPrimitiveNode.is = is; })(NbtPrimitiveNode || (NbtPrimitiveNode = {})); var NbtStringNode; (function (NbtStringNode) { /* istanbul ignore next */ function is(obj) { return obj?.type === 'nbt:string'; } NbtStringNode.is = is; })(NbtStringNode || (NbtStringNode = {})); var NbtNumberNode; (function (NbtNumberNode) { /* istanbul ignore next */ function is(node) { return NbtIntegerAlikeNode.is(node) || NbtFloatAlikeNode.is(node); } NbtNumberNode.is = is; })(NbtNumberNode || (NbtNumberNode = {})); var NbtIntegerAlikeNode; (function (NbtIntegerAlikeNode) { /* istanbul ignore next */ function is(node) { return (NbtByteNode.is(node) || NbtShortNode.is(node) || NbtIntNode.is(node) || NbtLongNode.is(node)); } NbtIntegerAlikeNode.is = is; })(NbtIntegerAlikeNode || (NbtIntegerAlikeNode = {})); var NbtByteNode; (function (NbtByteNode) { /* istanbul ignore next */ function is(node) { return node?.type === 'nbt:byte'; } NbtByteNode.is = is; })(NbtByteNode || (NbtByteNode = {})); var NbtShortNode; (function (NbtShortNode) { /* istanbul ignore next */ function is(node) { return node?.type === 'nbt:short'; } NbtShortNode.is = is; })(NbtShortNode || (NbtShortNode = {})); var NbtIntNode; (function (NbtIntNode) { /* istanbul ignore next */ function is(node) { return node?.type === 'nbt:int'; } NbtIntNode.is = is; })(NbtIntNode || (NbtIntNode = {})); var NbtLongNode; (function (NbtLongNode) { /* istanbul ignore next */ function is(node) { return node?.type === 'nbt:long'; } NbtLongNode.is = is; })(NbtLongNode || (NbtLongNode = {})); var NbtFloatAlikeNode; (function (NbtFloatAlikeNode) { /* istanbul ignore next */ function is(node) { return NbtFloatNode.is(node) || NbtDoubleNode.is(node); } NbtFloatAlikeNode.is = is; })(NbtFloatAlikeNode || (NbtFloatAlikeNode = {})); var NbtFloatNode; (function (NbtFloatNode) { /* istanbul ignore next */ function is(node) { return node?.type === 'nbt:float'; } NbtFloatNode.is = is; })(NbtFloatNode || (NbtFloatNode = {})); var NbtDoubleNode; (function (NbtDoubleNode) { /* istanbul ignore next */ function is(node) { return node?.type === 'nbt:double'; } NbtDoubleNode.is = is; })(NbtDoubleNode || (NbtDoubleNode = {})); var NbtCompoundNode; (function (NbtCompoundNode) { /* istanbul ignore next */ function is(node) { return node?.type === 'nbt:compound'; } NbtCompoundNode.is = is; })(NbtCompoundNode || (NbtCompoundNode = {})); var NbtCollectionNode; (function (NbtCollectionNode) { /* istanbul ignore next */ function is(node) { return NbtListNode.is(node) || NbtPrimitiveArrayNode.is(node); } NbtCollectionNode.is = is; })(NbtCollectionNode || (NbtCollectionNode = {})); var NbtListNode; (function (NbtListNode) { /* istanbul ignore next */ function is(node) { return node?.type === 'nbt:list'; } NbtListNode.is = is; })(NbtListNode || (NbtListNode = {})); var NbtPrimitiveArrayNode; (function (NbtPrimitiveArrayNode) { /* istanbul ignore next */ function is(node) { return (NbtByteArrayNode.is(node) || NbtIntArrayNode.is(node) || NbtLongArrayNode.is(node)); } NbtPrimitiveArrayNode.is = is; })(NbtPrimitiveArrayNode || (NbtPrimitiveArrayNode = {})); var NbtByteArrayNode; (function (NbtByteArrayNode) { /* istanbul ignore next */ function is(node) { return node?.type === 'nbt:byte_array'; } NbtByteArrayNode.is = is; })(NbtByteArrayNode || (NbtByteArrayNode = {})); var NbtIntArrayNode; (function (NbtIntArrayNode) { /* istanbul ignore next */ function is(node) { return node?.type === 'nbt:int_array'; } NbtIntArrayNode.is = is; })(NbtIntArrayNode || (NbtIntArrayNode = {})); var NbtLongArrayNode; (function (NbtLongArrayNode) { /* istanbul ignore next */ function is(node) { return node?.type === 'nbt:long_array'; } NbtLongArrayNode.is = is; })(NbtLongArrayNode || (NbtLongArrayNode = {})); var NbtPathNode; (function (NbtPathNode) { /* istanbul ignore next */ function is(node) { return node?.type === 'nbt:path'; } NbtPathNode.is = is; })(NbtPathNode || (NbtPathNode = {})); var NbtPathKeyNode; (function (NbtPathKeyNode) { /* istanbul ignore next */ function is(node) { return node?.type === 'nbt:path/key'; } NbtPathKeyNode.is = is; })(NbtPathKeyNode || (NbtPathKeyNode = {})); var NbtPathFilterNode; (function (NbtPathFilterNode) { /* istanbul ignore next */ function is(node) { return node?.type === 'nbt:path/filter'; } NbtPathFilterNode.is = is; })(NbtPathFilterNode || (NbtPathFilterNode = {})); var NbtPathIndexNode; (function (NbtPathIndexNode) { /* istanbul ignore next */ function is(node) { return node?.type === 'nbt:path/index'; } NbtPathIndexNode.is = is; })(NbtPathIndexNode || (NbtPathIndexNode = {})); var TypedNbtNode; (function (TypedNbtNode) { /* istanbul ignore next */ function is(node) { return node?.type === 'nbt:typed'; } TypedNbtNode.is = is; })(TypedNbtNode || (TypedNbtNode = {})); //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/checker/mcdocUtil.js const BlockItems = { // Coral fans. 'minecraft:brain_coral_fan': ['minecraft:brain_coral_fan', 'minecraft:brain_coral_wall_fan'], 'minecraft:bubble_coral_fan': ['minecraft:bubble_coral_fan', 'minecraft:bubble_coral_wall_fan'], 'minecraft:fire_coral_fan': ['minecraft:fire_coral_fan', 'minecraft:fire_coral_wall_fan'], 'minecraft:horn_coral_fan': ['minecraft:horn_coral_fan', 'minecraft:horn_coral_wall_fan'], 'minecraft:tube_coral_fan': ['minecraft:tube_coral_fan', 'minecraft:tube_coral_wall_fan'], // Heads and skulls. 'minecraft:creeper_head': ['minecraft:creeper_head', 'minecraft:creeper_wall_head'], 'minecraft:dragon_head': ['minecraft:dragon_head', 'minecraft:dragon_wall_head'], 'minecraft:player_head': ['minecraft:player_head', 'minecraft:player_wall_head'], 'minecraft:skeleton_skull': ['minecraft:skeleton_skull', 'minecraft:skeleton_wall_skull'], 'minecraft:wither_skeleton_skull': [ 'minecraft:wither_skeleton_skull', 'minecraft:wither_skeleton_wall_skull', ], // Dead coral fans. 'minecraft:dead_brain_coral_fan': [ 'minecraft:dead_brain_coral_fan', 'minecraft:dead_brain_coral_wall_fan', ], 'minecraft:dead_bubble_coral_fan': [ 'minecraft:dead_bubble_coral_fan', 'minecraft:dead_bubble_coral_wall_fan', ], 'minecraft:dead_fire_coral_fan': [ 'minecraft:dead_fire_coral_fan', 'minecraft:dead_fire_coral_wall_fan', ], 'minecraft:dead_horn_coral_fan': [ 'minecraft:dead_horn_coral_fan', 'minecraft:dead_horn_coral_wall_fan', ], 'minecraft:dead_tube_coral_fan': [ 'minecraft:dead_tube_coral_fan', 'minecraft:dead_tube_coral_wall_fan', ], // Torches. 'minecraft:torch': ['minecraft:torch', 'minecraft:wall_torch'], 'minecraft:soul_torch': ['minecraft:soul_torch', 'minecraft:soul_wall_torch'], 'minecraft:redstone_torch': ['minecraft:redstone_torch', 'minecraft:redstone_wall_torch'], 'minecraft:beetroot_seeds': ['minecraft:beetroots'], 'minecraft:carrot': ['minecraft:carrots'], 'minecraft:cocoa_beans': ['minecraft:cocoa'], 'minecraft:glow_berries': ['minecraft:cave_vines'], 'minecraft:melon_seeds': ['minecraft:melon_stem'], 'minecraft:potato': ['minecraft:potatoes'], 'minecraft:pumpkin_seeds': ['minecraft:pumpkin_stem'], 'minecraft:redstone': ['minecraft:redstone_wire'], 'minecraft:string': ['minecraft:tripwire'], 'minecraft:sweat_berries': ['minecraft:sweat_berry_bush'], 'minecraft:wheat_seeds': ['minecraft:wheat'], }; function getBlocksFromItem(item) { return BlockItems[item]; } function getEntityFromItem(item) { if (item === 'minecraft:armor_stand') { return item; } const result = item.match(/^minecraft:([a-z0-9_]+)_spawn_egg$/); if (result) { return `minecraft:${result[1]}`; } return undefined; } //# sourceMappingURL=mcdocUtil.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/checker/index.js const checker_typed = (node, ctx) => { checker_typeDefinition(node.targetType)(node.children[0], ctx); }; function checker_register(meta) { meta.registerChecker('nbt:typed', checker_typed); } /** * @param id If the registry is under the `custom` namespace, `id` can only be a string. Otherwise it can be a string, string array, or `undefined`. * If set to `undefined` or an empty array, all mcdoc compound definitions for this registry will be merged for checking, and unknown keys are allowed. */ function checker_index(registry, id, options = {}) { switch (registry) { case 'custom:blockitemstates': const blockIds = getBlocksFromItem(id); return blockIds ? blockStates(blockIds, options) : builtin_noop; case 'custom:blockstates': return blockStates([id], options); case 'custom:spawnitemtag': const entityId = getEntityFromItem(id); return entityId ? checker_index('minecraft:entity', entityId, options) : builtin_noop; default: const typeDef = { kind: 'dispatcher', registry, parallelIndices: getIndices(id), }; return (node, ctx) => { checker_typeDefinition(typeDef, options)(node, ctx); }; } } function getIndices(id) { if (typeof id === 'string') { return [{ kind: 'static', value: id }]; } else if (id === undefined || id.length === 0) { return [{ kind: 'static', value: '%fallback' }]; } else { return id.map(i => ({ kind: 'static', value: i })); } } /** * @param identifier An identifier of mcdoc compound definition. e.g. `::minecraft::util::invitem::InventoryItem` */ function checker_typeDefinition(typeDef, options = {}) { return (node, ctx) => { typeDefinition([{ originalNode: node, inferredType: checker_inferType(node) }], typeDef, McdocCheckerContext.create(ctx, { allowMissingKeys: options.isPredicate || options.isMerge, requireCanonical: options.isPredicate, isEquivalent: (inferred, def) => { if (def.kind === 'boolean') { // TODO: this should check whether the value is 0 or 1 return inferred.kind === 'byte'; } if (inferred.kind === 'list') { return def.kind === 'list' || def.kind === 'tuple'; } if (options.isPredicate) { return inferred.kind === def.kind; } switch (inferred.kind) { case 'struct': return def.kind === 'struct'; case 'byte': case 'short': case 'int': case 'long': return ['byte', 'short', 'int', 'long', 'float', 'double'].includes(def.kind); case 'float': case 'double': return ['float', 'double'].includes(def.kind); default: return false; } }, getChildren: node => { const { type } = node; if (type === 'nbt:list' || type === 'nbt:byte_array' || type === 'nbt:int_array' || type === 'nbt:long_array') { return node.children.filter(n => n.value).map(n => [{ originalNode: n.value, inferredType: checker_inferType(n.value) }]); } if (type === 'nbt:compound') { return node.children.filter(kvp => kvp.key).map(kvp => ({ key: { originalNode: kvp.key, inferredType: checker_inferType(kvp.key) }, possibleValues: kvp.value ? [{ originalNode: kvp.value, inferredType: checker_inferType(kvp.value) }] : [], })); } return []; }, reportError: (error) => { if (options.isPredicate && error.kind === 'invalid_collection_length') { return; } getDefaultErrorReporter(ctx, (getDefaultErrorRange))(error); }, attachTypeInfo: (node, definition, desc = '') => { node.typeDef = definition; node.requireCanonical = options.isPredicate; // TODO: improve hover info if (node.parent && PairNode?.is(node.parent) && NbtNode.is(node.parent.key) && NbtNode.is(node.parent.value)) { if (node.parent.key?.typeDef && node.parent.value?.typeDef) { const valueString = McdocType.toString(node.parent.value.typeDef); let keyString = McdocType.toString(node.parent.key.typeDef); if (node.parent.key.typeDef.kind !== 'literal') { keyString = `[${keyString}]`; } node.parent.key.hover = `\`\`\`typescript\n${keyString}: ${valueString}\n\`\`\`\n${desc}`; if (NbtPrimitiveNode.is(node.parent.value)) { node.parent.value.hover = `\`\`\`typescript\n${valueString}\n\`\`\`\n${desc}`; } } } else if (NbtPrimitiveNode.is(node)) { node.hover = `\`\`\`typescript\n${McdocType.toString(definition)}\n\`\`\`\n${desc}`; } }, nodeAttacher: (node, attacher) => attacher(node), stringAttacher: (node, attacher) => { if (!NbtStringNode.is(node)) { return; } attacher(node); if (node.children) { AstNode.setParents(node); // Because the runtime checker happens after binding, we need to manually call this fallbackSync(node, ctx); builtin_fallbackSync(node, ctx); } }, })); }; } function checker_inferType(node) { switch (node.type) { case 'nbt:byte': return { kind: 'literal', value: { kind: 'byte', value: node.value } }; case 'nbt:double': return { kind: 'literal', value: { kind: 'double', value: node.value } }; case 'nbt:float': return { kind: 'literal', value: { kind: 'float', value: node.value } }; case 'nbt:long': return { kind: 'literal', // TODO: this should NOT change type from `bigint` to `number` value: { kind: 'long', value: Number(node.value) }, }; case 'nbt:int': return { kind: 'literal', value: { kind: 'int', value: node.value } }; case 'nbt:short': return { kind: 'literal', value: { kind: 'short', value: node.value } }; case 'nbt:string': return { kind: 'literal', value: { kind: 'string', value: node.value } }; case 'nbt:list': return { kind: 'list', item: { kind: 'any' } }; case 'nbt:compound': return { kind: 'struct', fields: [] }; case 'nbt:byte_array': return { kind: 'byte_array' }; case 'nbt:long_array': return { kind: 'long_array' }; case 'nbt:int_array': return { kind: 'int_array' }; } } function blockStates(blocks, _options = {}) { return (node, ctx) => { if (!NbtCompoundNode.is(node)) { return; } const states = getStates('block', blocks, ctx); for (const { key: keyNode, value: valueNode } of node.children) { if (!keyNode || !valueNode) { continue; } // Type check. if (valueNode.type === 'nbt:byte' && (ctx.src.slice(valueNode.range).toLowerCase() === 'false' || ctx.src.slice(valueNode.range).toLowerCase() === 'true')) { ctx.err.report(localize('nbt.checker.block-states.fake-boolean'), valueNode, 2 /* core.ErrorSeverity.Warning */); continue; } else if (valueNode.type !== 'nbt:string' && valueNode.type !== 'nbt:int') { ctx.err.report(localize('nbt.checker.block-states.unexpected-value-type'), valueNode, 2 /* core.ErrorSeverity.Warning */); continue; } if (Object.keys(states).includes(keyNode.value)) { // The current state exists. Check the value. const stateValues = states[keyNode.value]; if (!stateValues.includes(valueNode.value.toString())) { ctx.err.report(localize('expected-got', stateValues, localeQuote(valueNode.value.toString())), valueNode, 2 /* core.ErrorSeverity.Warning */); } } else { // The current state doesn't exist. ctx.err.report(localize('nbt.checker.block-states.unknown-state', localeQuote(keyNode.value), blocks), keyNode, 2 /* core.ErrorSeverity.Warning */); } } }; } // TODO: check nbt index nodes and nbt compound nodes function checker_path(registry, id) { return (node, ctx) => { // TODO: support dispatcher const typeDef = { kind: 'dispatcher', registry, parallelIndices: getIndices(id), }; // Create a linked list representation const leaf = { type: 'leaf', range: Range.create(node.range.end) }; let link = { path: node, node: leaf }; for (let i = node.children.length - 1; i >= 0; i -= 1) { link = { path: node, node: node.children[i], next: link }; } let prev = link; while (prev.next) { prev.next.prev = prev; prev = prev.next; } typeDefinition([{ originalNode: link, inferredType: inferPath(link) }], typeDef, McdocCheckerContext.create(ctx, { allowMissingKeys: true, requireCanonical: true, isEquivalent: (inferred, def) => { switch (inferred.kind) { case 'list': case 'byte_array': case 'int_array': case 'long_array': return ['list', 'tuple', 'byte_array', 'int_array', 'long_array'].includes(def.kind); default: return false; } }, getChildren: (link) => { while (link.next && link.node.type !== 'leaf' && NbtPathFilterNode.is(link.node)) { link = link.next; } if (!link.next || link.node.type === 'leaf') { return []; } if (NbtPathIndexNode.is(link.node)) { return [[{ originalNode: link.next, inferredType: inferPath(link.next) }]]; } if (NbtPathKeyNode.is(link.node)) { return [{ key: { originalNode: link, inferredType: { kind: 'literal', value: { kind: 'string', value: link.node.children[0].value }, }, }, possibleValues: [{ originalNode: link.next, inferredType: inferPath(link.next), }], }]; } // Never reachable return []; }, reportError: (error) => { if (error.kind === 'invalid_collection_length') { return; } getDefaultErrorReporter(ctx, ({ originalNode: link }) => link.node.range)(error); }, attachTypeInfo: (link, definition, desc = '') => { if (definition.kind === 'literal' && !definition.attributes?.length) { return; } if (link.node.type === 'leaf') { link.path.endTypeDef = definition; } else { link.node.typeDef = definition; } // TODO: improve hover info if (NbtPathKeyNode.is(link.prev?.node)) { link.prev.node.hover = `\`\`\`typescript\n${link.prev.node.children[0].value}: ${McdocType.toString(definition)}\n\`\`\`\n${desc}`; } }, nodeAttacher: (link, attacher) => { if (link.node.type !== 'leaf') { attacher(link.node); } }, stringAttacher: (link, attacher) => { if (!NbtPathKeyNode.is(link.node)) { return; } attacher(link.node.children[0]); if (link.node.children[0].children) { AstNode.setParents(link.node.children[0]); // Because the runtime checker happens after binding, we need to manually call this fallbackSync(link.node.children[0], ctx); builtin_fallbackSync(link.node.children[0], ctx); } }, })); }; } function inferPath(link) { if (link.node.type === 'leaf') { return { kind: 'unsafe' }; } if (NbtPathIndexNode.is(link.node)) { return { kind: 'list', item: { kind: 'any' } }; } return { kind: 'struct', fields: [] }; } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/colorizer/index.js function lib_colorizer_register(meta) { meta.registerColorizer('nbt:string', string); meta.registerColorizer('nbt:byte', number); meta.registerColorizer('nbt:short', number); meta.registerColorizer('nbt:int', number); meta.registerColorizer('nbt:long', number); meta.registerColorizer('nbt:float', number); meta.registerColorizer('nbt:double', number); } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/completer/index.js const collection = (node, ctx) => { const index = binarySearch(node.children, ctx.offset, (n, o) => { return Range.compareOffset(n.range, o, true); }); const item = index >= 0 ? node.children[index] : undefined; if (item?.value) { return ctx.meta.getCompleter(item.value.type)(item.value, ctx); } if (node.typeDef?.kind === 'list') { const completions = lib_completer_getValues(node.typeDef.item, ctx.offset, { ...ctx, requireCanonical: node.requireCanonical, }); if (ctx.offset < (node.children[node.children.length - 1]?.range.start ?? 0)) { return completions.map(c => ({ ...c, insertText: c.insertText + ',' })); } return completions; } return []; }; const compound = record({ key: (record, pair, ctx, range, iv, ipe, exitingKeys) => { if (!record.typeDef) { return []; } const keySet = new Set(exitingKeys.map(n => n.value)); return getFields(record.typeDef, { ...ctx, requireCanonical: record.requireCanonical }) .filter(({ key }) => !keySet.has(key)) .map(({ key, field }) => CompletionItem.create(key, pair?.key ?? range, { kind: 5 /* core.CompletionKind.Field */, detail: McdocType.toString(field.type), documentation: field.desc, deprecated: field.deprecated, sortText: field.optional ? '$b' : '$a', // sort above hardcoded $schema filterText: formatKey(key, pair?.key?.quote), insertText: `${formatKey(key, pair?.key?.quote)}${iv ? ':' : ''}${ipe ? '$1,' : ''}`, })); }, value: (record, pair, ctx, range) => { if (pair.value) { return ctx.meta.getCompleter(pair.value.type)(pair.value, ctx); } if (pair.key && record.typeDef) { const pairKey = pair.key.value; const field = getFields(record.typeDef, ctx) .find(({ key }) => key === pairKey) ?.field.type; if (field) { return lib_completer_getValues(field, range, { ...ctx, requireCanonical: record.requireCanonical, }); } } return []; }, }); const completer_primitive = (node, ctx) => { const insideRange = Range.contains(node, ctx.offset, true); if (node.type === 'nbt:string' && node.children?.length && insideRange) { const childItems = builtin_string(node, ctx); if (childItems.length > 0) { return childItems; } } if (!node.typeDef) { return []; } return lib_completer_getValues(node.typeDef, insideRange ? node : ctx.offset, { ...ctx, requireCanonical: node.requireCanonical, }); }; const completer_path = (node, ctx) => { const index = binarySearch(node.children, ctx.offset, (n, o) => { return Range.compareOffset(n.range, o, true); }); const item = index >= 0 ? node.children[index] : undefined; if (item) { return ctx.meta.getCompleter(item.type)(item, ctx); } if (!node.endTypeDef) { return []; } return getPathKeys(node.endTypeDef, ctx.offset, undefined, ctx); }; const pathKey = (node, ctx) => { if (!node.typeDef) { return []; } const child = node.children[0]; if (child.children?.length) { return dispatch(child.children[0], ctx); } return getPathKeys(node.typeDef, node, child.quote, ctx); }; function getPathKeys(typeDef, range, quote, ctx) { return getFields(typeDef, { ...ctx, requireCanonical: true }) .map(({ key, field }) => CompletionItem.create(key, range, { kind: 5 /* core.CompletionKind.Field */, detail: McdocType.toString(field.type), documentation: field.desc, deprecated: field.deprecated, sortText: field.optional ? '$b' : '$a', // sort above hardcoded $schema filterText: formatKey(key, quote), insertText: formatKey(key, quote), })); } function lib_completer_getValues(typeDef, range, ctx) { return getValues(typeDef, ctx) .map(({ value, labelSuffix, detail, documentation, kind, completionKind, insertText, sortText }) => CompletionItem.create(value, range, { kind: completionKind ?? 12 /* core.CompletionKind.Value */, labelSuffix, detail, documentation, filterText: formatValue(value, kind), insertText: formatValue(insertText ?? value, kind), sortText, })); } function formatKey(key, quote) { if (!quote && BrigadierUnquotablePattern.test(key)) { return key; } const q = quote ?? '"'; return q + escapeString(key, q) + q; } function formatValue(value, kind) { switch (kind) { case 'string': return `"${escapeString(value, '"')}"`; case 'byte': return `${value}b`; case 'short': return `${value}s`; case 'long': return `${value}L`; case 'float': return `${value}f`; default: return value; } } function lib_completer_register(meta) { meta.registerCompleter('nbt:byte', completer_primitive); meta.registerCompleter('nbt:byte_array', collection); meta.registerCompleter('nbt:compound', compound); meta.registerCompleter('nbt:double', completer_primitive); meta.registerCompleter('nbt:int', completer_primitive); meta.registerCompleter('nbt:int_array', collection); meta.registerCompleter('nbt:list', collection); meta.registerCompleter('nbt:long', completer_primitive); meta.registerCompleter('nbt:long_array', collection); meta.registerCompleter('nbt:string', completer_primitive); meta.registerCompleter('nbt:short', completer_primitive); meta.registerCompleter('nbt:float', completer_primitive); meta.registerCompleter('nbt:path', completer_path); meta.registerCompleter('nbt:path/key', pathKey); } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/util.js function localizeTag(type) { return localize(`nbt.node.${type.replace(/^nbt:/, '')}`); } function newSyntax(ctx) { // TODO: don't have this inline java-edition version check const release = ctx.project['loadedVersion']; return !release || Number(release.slice(2)) >= Number('1.21.5'.slice(2)); } //# sourceMappingURL=util.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/parser/primitive.js const FloatMaximum = (2 - 2 ** -23) * 2 ** 127; const NumeralPatterns = [ { pattern: /^[-+]?(?:0|[1-9][0-9]*)b$/i, type: 'nbt:byte', hasSuffix: true, group: 2 /* Group.IntegerAlike */, min: -128, max: 127, }, { pattern: /^[-+]?(?:0|[1-9][0-9]*)s$/i, type: 'nbt:short', hasSuffix: true, group: 2 /* Group.IntegerAlike */, min: -32768, max: 32767, }, { pattern: /^[-+]?(?:0|[1-9][0-9]*)$/, type: 'nbt:int', hasSuffix: false, group: 2 /* Group.IntegerAlike */, min: -2147483648, max: 2147483647, }, { pattern: /^[-+]?(?:0|[1-9][0-9]*)l$/i, type: 'nbt:long', hasSuffix: true, group: 3 /* Group.LongAlike */, min: -9223372036854775808n, max: 9223372036854775807n, }, { pattern: /^[-+]?(?:[0-9]+\.?|[0-9]*\.[0-9]+)(?:e[-+]?[0-9]+)?f$/i, type: 'nbt:float', hasSuffix: true, group: 1 /* Group.FloatAlike */, min: -FloatMaximum, max: FloatMaximum, }, { pattern: /^[-+]?(?:[0-9]+\.|[0-9]*\.[0-9]+)(?:e[-+]?[0-9]+)?$/i, type: 'nbt:double', hasSuffix: false, group: 1 /* Group.FloatAlike */, min: -Number.MAX_VALUE, max: Number.MAX_VALUE, }, { pattern: /^[-+]?(?:[0-9]+\.?|[0-9]*\.[0-9]+)(?:e[-+]?[0-9]+)?d$/i, type: 'nbt:double', hasSuffix: true, group: 1 /* Group.FloatAlike */, min: -Number.MAX_VALUE, max: Number.MAX_VALUE, }, { pattern: /^true$/i, type: 'nbt:byte', value: 1, group: 0 /* Group.Boolean */ }, { pattern: /^false$/i, type: 'nbt:byte', value: 0, group: 0 /* Group.Boolean */ }, ]; const NbtStringOptions = { escapable: { characters: ['b', 'f', 'n', 'r', 's', 't'], unicode: true }, quotes: ['"', "'"], unquotable: BrigadierUnquotableOption, }; const primitive_string = (src, ctx) => { const options = newSyntax(ctx) ? NbtStringOptions : BrigadierStringOptions; return setType('nbt:string', string_string(options))(src, ctx); }; const primitive_primitive = (src, ctx) => { if (Source.isBrigadierQuote(src.peek())) { return primitive_string(src, ctx); } const { result: unquotedResult, updateSrcAndCtx: updateUnquoted } = util_attempt(primitive_string, src, ctx); for (const e of NumeralPatterns) { if (e.pattern.test(unquotedResult.value)) { if (e.group === 0 /* Group.Boolean */) { const ans = { type: 'nbt:byte', range: unquotedResult.range, value: e.value, }; updateUnquoted(); return ans; } let isOutOfRange = false; const onOutOfRange = () => (isOutOfRange = true); const numeralParser = e.group === 2 /* Group.IntegerAlike */ // As we already checked the format of the value with `e.pattern` in the if-block, there is no need to check // it again here in the parser, therefore we just pass in a simple /./ regex. ? integer_integer({ pattern: /./, min: e.min, max: e.max, onOutOfRange }) : e.group === 3 /* Group.LongAlike */ ? long_long({ pattern: /./, min: e.min, max: e.max, onOutOfRange }) : float_float({ pattern: /./, min: e.min, max: e.max, onOutOfRange }); const { result: numeralResult, updateSrcAndCtx: updateNumeral } = util_attempt(numeralParser, src, ctx); if (isOutOfRange) { ctx.err.report(localize('nbt.parser.number.out-of-range', localizeTag(e.type), localize('nbt.node.string'), e.min, e.max), unquotedResult, 2 /* core.ErrorSeverity.Warning */); break; } updateNumeral(); if (e.hasSuffix) { src.skip(); numeralResult.range.end++; } return { ...numeralResult, type: e.type }; } } updateUnquoted(); return unquotedResult; }; //# sourceMappingURL=primitive.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/parser/collection.js const collection_list = (src, ctx) => { const parser = list({ start: '[', value: entry_entry, sep: ',', trailingSep: true, end: ']', }); const ans = parser(src, ctx); ans.type = 'nbt:list'; ans.valueType = ans.children[0]?.value?.type; // Check if every element is of the same type. if (ans.valueType && !newSyntax(ctx)) { for (const { value } of ans.children) { if (value && value.type !== ans.valueType) { ctx.err.report(localize('expected-got', localizeTag(ans.valueType), localizeTag(value.type)), value); } } } return ans; }; const byteArray = (src, ctx) => { const parser = list({ start: '[B;', value: primitive_primitive, sep: ',', trailingSep: true, end: ']', }); const ans = parser(src, ctx); ans.type = 'nbt:byte_array'; // Check if every element is of the required type. for (const { value } of ans.children) { if (value && value.type !== 'nbt:byte') { ctx.err.report(localize('expected-got', localize('nbt.node.byte'), localizeTag(value.type)), value); } } return ans; }; const intArray = (src, ctx) => { const parser = list({ start: '[I;', value: primitive_primitive, sep: ',', trailingSep: true, end: ']', }); const ans = parser(src, ctx); ans.type = 'nbt:int_array'; // Check if every element is of the required type. for (const { value } of ans.children) { if (value && value.type !== 'nbt:int') { ctx.err.report(localize('expected-got', localize('nbt.node.int'), localizeTag(value.type)), value); } } return ans; }; const longArray = (src, ctx) => { const parser = list({ start: '[L;', value: primitive_primitive, sep: ',', trailingSep: true, end: ']', }); const ans = parser(src, ctx); ans.type = 'nbt:long_array'; // Check if every element is of the required type. for (const { value } of ans.children) { if (value && value.type !== 'nbt:long') { ctx.err.report(localize('expected-got', localize('nbt.node.long'), localizeTag(value.type)), value); } } return ans; }; //# sourceMappingURL=collection.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/parser/compound.js const compound_compound = (src, ctx) => { return setType('nbt:compound', record_record({ start: '{', pair: { key: failOnEmpty(setType('nbt:string', string_string({ ...BrigadierStringOptions, colorTokenType: 'property' }))), sep: ':', value: entry_entry, end: ',', trailingEnd: true, }, end: '}', }))(src, ctx); }; //# sourceMappingURL=compound.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/parser/entry.js const entry_entry = (src, ctx) => failOnEmpty(util_select([ { predicate: (src) => src.tryPeek('[B;'), parser: byteArray }, { predicate: (src) => src.tryPeek('[I;'), parser: intArray, }, { predicate: (src) => src.tryPeek('[L;'), parser: longArray }, { predicate: (src) => src.tryPeek('['), parser: collection_list }, { predicate: (src) => src.tryPeek('{'), parser: compound_compound }, { parser: primitive_primitive }, ]))(src, ctx); //# sourceMappingURL=entry.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/parser/path.js const path_path = (src, ctx) => { const ans = { type: 'nbt:path', children: [], range: Range.create(src) }; let expectedParts = ['filter', 'key']; let currentPart = nextPart(src); let cursor; while (cursor !== src.cursor) { if (!expectedParts.includes(currentPart)) { ctx.err.report(localize('expected-got', arrayToMessage(expectedParts.map(localizePart), false, 'or'), localizePart(currentPart)), src); } if (currentPart === 'end') { break; } cursor = src.cursor; expectedParts = PartParsers[currentPart](ans.children, src, ctx); currentPart = nextPart(src); } ans.range.end = src.cursor; return ans; }; const filter = (children, src, ctx) => { const node = compound_compound(src, ctx); children.push({ type: 'nbt:path/filter', range: node.range, children: [node], }); return src.trySkip('.') ? ['key'] : ['end']; }; const path_index = (children, src, ctx) => { const node = { type: 'nbt:path/index', children: undefined, range: Range.create(src), }; if (!src.trySkip('[')) { throw new Error(`NBT path index parser called at illegal position: “${src.peek()}” at ${src.cursor}`); } src.skipSpace(); const c = src.peek(); if (c === '{') { node.children = [compound_compound(src, ctx)]; } else if (c !== ']') { node.children = [integer_integer({ pattern: /^-?\d+$/ })(src, ctx)]; } src.skipSpace(); if (!src.trySkip(']')) { ctx.err.report(localize('expected-got', localeQuote(']'), localeQuote(src.peek())), src); } node.range.end = src.cursor; children.push(node); return src.trySkip('.') ? ['index', 'key'] : ['end', 'index']; }; const key = (children, src, ctx) => { const node = setType('nbt:string', string_string({ colorTokenType: 'property', escapable: {}, // Single quotes supported since 1.20 Pre-release 2 (roughly pack format 15) // https://bugs.mojang.com/browse/MC-175504 quotes: ['"', "'"], unquotable: { blockList: new Set(['\n', '\r', '\t', ' ', '"', '[', ']', '.', '{', '}']) }, }))(src, ctx); children.push({ type: 'nbt:path/key', range: node.range, children: [node], }); return src.trySkip('.') ? ['index', 'key'] : ['end', 'filter', 'index']; }; function nextPart(src) { switch (src.peek()) { case '': case ' ': case '\n': case '\r': return 'end'; case '{': return 'filter'; case '[': return 'index'; default: return 'key'; } } function localizePart(part) { return localize(`nbt.node.path.${part}`); } const PartParsers = { filter, index: path_index, key }; //# sourceMappingURL=path.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/mcdocAttributes.js const nbtValidator = (value) => { if (!value || value?.kind === 'tree') { return Parser_Failure; } return value; }; function registerMcdocAttributes(meta) { registerAttribute(meta, 'nbt', nbtValidator, { stringParser: (config) => makeInfallible(util_map(entry_entry, res => ({ type: 'nbt:typed', range: res.range, children: [res], targetType: config, })), localize('nbt.node')), }); registerAttribute(meta, 'nbt_path', nbtValidator, { stringParser: () => makeInfallible(path_path, localize('nbt.path')), }); } function makeInfallible(parser, message) { return (src, ctx) => { const start = src.cursor; const res = parser(src, ctx); if (res === Parser_Failure) { ctx.err.report(localize('expected', message), Range.create(start, src.skipRemaining())); return undefined; } return res; }; } //# sourceMappingURL=mcdocAttributes.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/parser/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/index.js /* istanbul ignore next */ const lib_initialize = ({ meta }) => { meta.registerLanguage('snbt', { extensions: ['.snbt'], parser: entry_entry, }); meta.registerLanguage('nbt', { extensions: ['.nbt'], }); meta.registerParser('nbt:entry', entry_entry); meta.registerParser('nbt:compound', compound_compound); meta.registerParser('nbt:path', path_path); checker_register(meta); lib_colorizer_register(meta); lib_completer_register(meta); registerMcdocAttributes(meta); }; //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/dependency/common.js var ReleaseVersion; (function (ReleaseVersion) { /** * @returns * * `-1` if `a` is older than `b`. * * `0` if `a` is the same as `b`. * * `1` if `a` is newer than `b`. */ function cmp(a, b) { return Math.sign(Number(a.slice(2)) - Number(b.slice(2))); } ReleaseVersion.cmp = cmp; /** * @returns `true` if `version` is newer than `since` (inclusive) and older * than `until` (exclusive) */ function isBetween(version, since, until) { return cmp(version, since) >= 0 && cmp(version, until) < 0; } ReleaseVersion.isBetween = isBetween; })(ReleaseVersion || (ReleaseVersion = {})); var PackMcmeta; (function (PackMcmeta) { function readPackFormat(data) { const supported = data?.pack?.supported_formats; if (Array.isArray(supported) && supported.length === 2 && typeof supported[1] === 'number') { return supported[1]; } if (typeof supported === 'object' && typeof supported?.max_inclusive === 'number') { return supported.max_inclusive; } const format = data?.pack?.pack_format; if (typeof format === 'number') { return format; } throw new Error('“pack.pack_format” is not a number'); } PackMcmeta.readPackFormat = readPackFormat; async function getType(packRoot, externals) { const dir = await externals.fs.readdir(packRoot); const isResourcePack = dir.some(e => e.isDirectory() && e.name === 'assets') && !dir.some(e => e.isDirectory() && e.name === 'data'); return isResourcePack ? 'assets' : 'data'; } PackMcmeta.getType = getType; })(PackMcmeta || (PackMcmeta = {})); //# sourceMappingURL=common.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/dependency/mcmeta.js // DOCS: Update this when a new snapshot cycle begins const NEXT_RELEASE_VERSION = '1.21.9'; /** * @param inputVersion {@link core.Config.env.gameVersion} */ function resolveConfiguredVersion(inputVersion, versions, packs, logger) { function findReleaseTarget(version) { if (version.release_target) { return version.release_target; } if (version.type === 'release') { return version.id; } const index = versions.findIndex((v) => v.id === version.id); for (let i = index; i >= 0; i -= 1) { if (versions[i].type === 'release') { return versions[i].id; } } return NEXT_RELEASE_VERSION; } function toVersionInfo(version) { version = version ?? versions[0]; return { id: version.id, name: version.name, release: findReleaseTarget(version), isLatest: version === versions[0], }; } if (versions.length === 0) { throw new Error('mcmeta version list is empty'); } // This should never happen, but for some reason happens sometimes // https://github.com/SpyglassMC/Spyglass/issues/1621 if (inputVersion === undefined) { logger.warn('[resolveConfiguredVersion] Input version was undefined! Falling back to "auto"'); inputVersion = 'auto'; } inputVersion = inputVersion.toLowerCase(); versions = versions.sort((a, b) => b.data_version - a.data_version); const latestRelease = versions.find((v) => v.type === 'release'); if (inputVersion === 'auto') { if (packs.length === 0) { // Fall back to the latest release if pack mcmeta is not available logger.info(`[resolveConfiguredVersion] No pack format detected, selecting latest release ${latestRelease?.id}`); return toVersionInfo(latestRelease); } packs.sort((a, b) => b.format - a.format); const maxData = packs.filter(p => p.type === 'data')[0]; const maxAssets = packs.filter(p => p.type === 'assets')[0]; // Look for versions from recent to oldest, picking the most recent release that matches let oldestRelease = versions[0]; const releases = versions.filter(v => v.type === 'release'); for (const version of releases) { // If we already passed the pack format, use the oldest release so far if (maxData && maxData.format > version.data_pack_version) { logger.info(`[resolveConfiguredVersion] Detected data pack format ${maxData.format} in ${maxData.packRoot}, selecting version ${oldestRelease.id}`); return toVersionInfo(oldestRelease); } if (maxAssets && maxAssets.format > version.resource_pack_version) { logger.info(`[resolveConfiguredVersion] Detected resource pack format ${maxAssets.format} in ${maxAssets.packRoot}, selecting version ${oldestRelease.id}`); return toVersionInfo(oldestRelease); } if (maxData && maxData.format === version.data_pack_version) { logger.info(`[resolveConfiguredVersion] Detected data pack format ${maxData.format} in ${maxData.packRoot}, selecting version ${version.id}`); return toVersionInfo(version); } if (maxAssets && maxAssets.format === version.resource_pack_version) { logger.info(`[resolveConfiguredVersion] Detected resource pack format ${maxAssets.format} in ${maxAssets.packRoot}, selecting version ${version.id}`); return toVersionInfo(version); } oldestRelease = version; } // If the pack format is still lower, use the oldest known release version logger.info(`[resolveConfiguredVersion] Detected pack format too low, selecting oldest supported release ${oldestRelease?.id}`); return toVersionInfo(oldestRelease); } else if (inputVersion === 'latest release') { logger.info(`[resolveConfiguredVersion] Using config "${inputVersion}", selecting version ${latestRelease?.id}`); return toVersionInfo(latestRelease); } else if (inputVersion === 'latest snapshot') { logger.info(`[resolveConfiguredVersion] Using config "${inputVersion}", selecting version ${versions[0]?.id}`); return toVersionInfo(versions[0]); } const configVersion = versions.find((v) => inputVersion === v.id.toLowerCase() || inputVersion === v.name.toLowerCase()); logger.info(`[resolveConfiguredVersion] Using config "${inputVersion}", selecting version ${configVersion?.id}`); return toVersionInfo(configVersion); } const DataSources = { fastly: 'https://fastly.jsdelivr.net/gh/${user}/${repo}@${tag}/${path}', github: 'https://raw.githubusercontent.com/${user}/${repo}/${tag}/${path}', jsdelivr: 'https://cdn.jsdelivr.net/gh/${user}/${repo}@${tag}/${path}', }; function getMcmetaSummaryUris(version, isLatest, source) { const tag = isLatest ? 'summary' : `${version}-summary`; function getUri(path) { const template = DataSources[source.toLowerCase()] ?? source; const ans = template.replace(/\${user}/g, 'misode').replace(/\${repo}/g, 'mcmeta').replace(/\${tag}/g, tag).replace(/\${path}/g, path); if (!RemoteUriString.is(ans)) { throw new Error(`Expected a remote URI from data source template but got ${ans}`); } return ans; } return { blocks: getUri('blocks/data.json.gz'), commands: getUri('commands/data.json.gz'), registries: getUri('registries/data.json.gz'), }; } function symbolRegistrar(summary, release) { const McmetaSummaryUri = 'mcmeta://summary/registries.json'; /** * Add states of blocks or fluids to the symbol table. */ function addStatesSymbols(category, states, symbols) { const capitalizedCategory = `${category[0].toUpperCase()}${category.slice(1)}`; for (const [id, [properties, defaults]] of Object.entries(states)) { const uri = McmetaSummaryUri; symbols.query(uri, category, ResourceLocation.lengthen(id)).onEach(Object.entries(properties), ([state, values], blockQuery) => { const defaultValue = defaults[state]; blockQuery.member(`${uri}#${capitalizedCategory}_states`, state, (stateQuery) => { stateQuery.enter({ data: { subcategory: 'state' }, usage: { type: 'declaration' }, }).onEach(values, (value) => { stateQuery.member(value, (valueQuery) => { valueQuery.enter({ data: { subcategory: 'state_value' }, usage: { type: 'declaration' }, }); if (value === defaultValue) { stateQuery.amend({ data: { relations: { default: { category, path: valueQuery.path } } }, }); } }); }); }); }); } const stateTypes = { block: summary.blocks, fluid: summary.fluids }; for (const [type, states] of Object.entries(stateTypes)) { symbols.query(McmetaSummaryUri, 'mcdoc/dispatcher', `mcdoc:${type}_states`) .enter({ usage: { type: 'declaration' } }) .onEach(Object.entries(states), ([id, [properties]], query) => { const data = { typeDef: { kind: 'struct', fields: Object.entries(properties).map(([propKey, propValues]) => ({ kind: 'pair', key: propKey, optional: true, type: { kind: 'union', members: propValues.map(value => ({ kind: 'literal', value: { kind: 'string', value }, })), }, })), }, }; query.member(id, (stateQuery) => { stateQuery.enter({ data: { data }, usage: { type: 'declaration' }, }); }); }); symbols.query(McmetaSummaryUri, 'mcdoc/dispatcher', `mcdoc:${type}_state_keys`) .enter({ usage: { type: 'declaration' } }) .onEach(Object.entries(states), ([id, [properties]], query) => { const data = { typeDef: { kind: 'union', members: Object.keys(properties).map(propKey => ({ kind: 'literal', value: { kind: 'string', value: propKey }, })), }, }; query.member(id, (stateQuery) => { stateQuery.enter({ data: { data }, usage: { type: 'declaration' }, }); }); }); } } function addRegistriesSymbols(registries, symbols) { function isCategory(str) { return (FileCategories.includes(str) || RegistryCategories.includes(str)); } for (const [registryId, registry] of Object.entries(registries)) { if (isCategory(registryId)) { for (const entryId of registry) { symbols.query(McmetaSummaryUri, registryId, ResourceLocation.lengthen(entryId)) .enter({ usage: { type: 'declaration' } }); } } } } function addBuiltinSymbols(symbols) { if (ReleaseVersion.cmp(release, '1.21.2') < 0) { symbols.query(McmetaSummaryUri, 'loot_table', 'minecraft:empty') .enter({ usage: { type: 'declaration' } }); } symbols.query(McmetaSummaryUri, 'model', 'minecraft:builtin/generated') .enter({ usage: { type: 'declaration' } }); if (ReleaseVersion.cmp(release, '1.21.4') < 0) { symbols.query(McmetaSummaryUri, 'model', 'minecraft:builtin/entity') .enter({ usage: { type: 'declaration' } }); } } return (symbols) => { addRegistriesSymbols(summary.registries, symbols); addStatesSymbols('block', summary.blocks, symbols); addStatesSymbols('fluid', summary.fluids, symbols); addBuiltinSymbols(symbols); }; } const Fluids = { flowing_lava: [{ falling: ['false', 'true'], level: ['1', '2', '3', '4', '5', '6', '7', '8'] }, { falling: 'false', level: '1', }], flowing_water: [ { falling: ['false', 'true'], level: ['1', '2', '3', '4', '5', '6', '7', '8'] }, { falling: 'false', level: '1' }, ], lava: [{ falling: ['false', 'true'] }, { falling: 'false' }], water: [{ falling: ['false', 'true'] }, { falling: 'false' }], }; // #endregion //# sourceMappingURL=mcmeta.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/dependency/index.js // Memory cache TTL in milliseconds const DownloaderTtl = 15_000; /* istanbul ignore next */ /** * Return the deserialized [`versions.json`][versions.json]. * * [versions.json]: https://github.com/misode/mcmeta/blob/summary/versions/data.json */ async function getVersions(externals, downloader) { return downloader.download({ id: 'mc-je/versions.json.gz', uri: 'https://raw.githubusercontent.com/misode/mcmeta/summary/versions/data.json.gz', transformer: (buffer) => parseGzippedJson(externals, buffer), cache: getCacheOptionsBasedOnGitHubCommitSha('misode', 'mcmeta', 'refs/heads/summary'), ttl: DownloaderTtl, }); } /* istanbul ignore next */ /** * Get vanilla resources, including block definitions, fluid definitions, command tree, and registries. * * @throws Network/file system errors. */ async function getMcmetaSummary(externals, downloader, logger, version, isLatest, source, overridePaths = {}) { const ref = getGitRef({ defaultBranch: 'summary', getTag: (v) => `${v}-summary`, isLatest, version, }); const uris = getMcmetaSummaryUris(version, isLatest, source); let checksum; async function handleOverride(currentValue, overrideConfig) { if (overrideConfig) { try { const override = (await fileUtil.readJson(externals, overrideConfig.path)); if (overrideConfig.replace) { return override; } else { return merge(currentValue, override); } } catch (e) { logger.error(`[je] [mcmeta-overrides] Failed loading customized mcmeta summary file “${overrideConfig.path}”`, e); } } return currentValue; } const getResource = async (type, overrideConfig) => { const out = {}; const data = await downloader.download({ id: `mc-je/${version}/${type}.json.gz`, uri: uris[type], transformer: (buffer) => parseGzippedJson(externals, buffer), cache: getCacheOptionsBasedOnGitHubCommitSha('misode', 'mcmeta', ref), ttl: DownloaderTtl, }, out); checksum ||= out.checksum; return handleOverride(data, overrideConfig); }; const [blocks, commands, fluids, registries] = [ await getResource('blocks', overridePaths.blocks), await getResource('commands', overridePaths.commands), await handleOverride(Fluids, overridePaths.fluids), await getResource('registries', overridePaths.registries), ]; return { blocks, commands, fluids, registries, checksum }; } function getGitRef({ defaultBranch, getTag, isLatest, version }) { return isLatest ? `refs/heads/${defaultBranch}` : `refs/tags/${getTag(version)}`; } const GitHubApiDownloadOptions = { headers: { Accept: 'application/vnd.github.v3+json', 'User-Agent': 'SpyglassMC' }, }; function getCacheOptionsBasedOnGitHubCommitSha(owner, repo, ref) { return { checksumExtension: '.commit-sha', checksumJob: { uri: `https://api.github.com/repos/${owner}/${repo}/git/${ref}`, transformer: (buffer) => { const response = JSON.parse(bufferToString(buffer)); if (Array.isArray(response)) { return response[0].object.sha; } else if (response.message === undefined) { return response.object.sha; } else { throw new Error(response.message); } }, options: GitHubApiDownloadOptions, ttl: DownloaderTtl, }, }; } /** * Download data from a GitHub repository with tags corresponding to Minecraft versions. * The downloaded data will be cached based on the commit SHA of the respective tag. * * If `isLatest` if `true`, instead of finding the tag corresponding to the given version, the default branch will be used. * * @returns The URI to the `.tar.gz` file. */ async function downloadGitHubRepo({ defaultBranch, downloader, getTag, repo, isLatest, owner, version, suffix }) { const ref = getGitRef({ defaultBranch, getTag, isLatest, version }); const out = {}; await downloader.download({ id: `mc-je/${version}/${repo}${suffix ?? ''}.tar.gz`, uri: `https://api.github.com/repos/${owner}/${repo}/tarball/${ref}`, transformer: (b) => b, cache: getCacheOptionsBasedOnGitHubCommitSha(owner, repo, ref), options: GitHubApiDownloadOptions, ttl: DownloaderTtl, }, out); return out.cacheUri; } /* istanbul ignore next */ /** * @throws Network/file system errors. * * @returns * - `startDepth`: The amount of level to skip when unzipping the tarball. * - `uri`: URI to the `.tar.gz` file. */ async function getVanillaDatapack(downloader, version, isLatest) { const uri = await downloadGitHubRepo({ defaultBranch: 'data', downloader, getTag: (v) => `${v}-data`, owner: 'misode', repo: 'mcmeta', isLatest, version, }); return { info: { startDepth: 1 }, uri }; } /* istanbul ignore next */ /** * @throws Network/file system errors. * * @returns * - `startDepth`: The amount of level to skip when unzipping the tarball. * - `uri`: URI to the `.tar.gz` file. */ async function getVanillaResourcepack(downloader, version, isLatest) { const uri = await downloadGitHubRepo({ defaultBranch: 'assets-tiny', downloader, getTag: (v) => `${v}-assets-tiny`, owner: 'misode', repo: 'mcmeta', isLatest, version, suffix: '-assets', }); return { info: { startDepth: 1 }, uri }; } /** * @throws Network/file system errors. * * @returns * - `startDepth`: The amount of level to skip when unzipping the tarball. * - `uri`: URI to the `.tar.gz` file. */ async function getVanillaMcdoc(downloader) { const owner = 'SpyglassMC'; const repo = 'vanilla-mcdoc'; const ref = 'refs/heads/main'; const out = {}; await downloader.download({ id: 'mc-je/vanilla-mcdoc.tar.gz', uri: `https://api.github.com/repos/${owner}/${repo}/tarball/${ref}`, transformer: (b) => b, cache: getCacheOptionsBasedOnGitHubCommitSha(owner, repo, ref), options: GitHubApiDownloadOptions, ttl: DownloaderTtl, }, out); return { info: { startDepth: 1 }, uri: out.cacheUri }; } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/binder/index.js const Resources = new Map(); function resource(path, resource = {}) { const previous = Resources.get(path) ?? []; Resources.set(path, [ ...previous, { path, category: resource.category ?? path, ext: resource.ext ?? '.json', pack: resource.pack ?? 'data', ...resource, }, ]); } // Pre-1.21 data pack plurals resource('advancements', { category: 'advancement', until: '1.21' }); resource('functions', { category: 'function', until: '1.21', ext: '.mcfunction' }); resource('item_modifiers', { category: 'item_modifier', since: '1.17', until: '1.21' }); resource('loot_tables', { category: 'loot_table', until: '1.21' }); resource('predicates', { category: 'predicate', until: '1.21' }); resource('recipes', { category: 'recipe', until: '1.21' }); resource('structures', { category: 'structure', until: '1.21', ext: '.nbt' }); resource('tags/blocks', { category: 'tag/block', until: '1.21' }); resource('tags/entity_types', { category: 'tag/entity_type', until: '1.21' }); resource('tags/fluids', { category: 'tag/fluid', until: '1.21' }); resource('tags/functions', { category: 'tag/function', until: '1.21' }); resource('tags/game_events', { category: 'tag/game_event', since: '1.17', until: '1.21' }); resource('tags/items', { category: 'tag/item', until: '1.21' }); // Post-1.21 data pack non-plurals resource('advancement', { since: '1.21' }); resource('function', { since: '1.21', ext: '.mcfunction' }); resource('item_modifier', { since: '1.21' }); resource('loot_table', { since: '1.21' }); resource('predicate', { since: '1.21' }); resource('recipe', { since: '1.21' }); resource('structure', { since: '1.21', ext: '.nbt' }); resource('tags/block', { category: 'tag/block', since: '1.21' }); resource('tags/entity_type', { category: 'tag/entity_type', since: '1.21' }); resource('tags/fluid', { category: 'tag/fluid', since: '1.21' }); resource('tags/function', { category: 'tag/function', since: '1.21' }); resource('tags/game_event', { category: 'tag/game_event', since: '1.21' }); resource('tags/item', { category: 'tag/item', since: '1.21' }); // Data pack resource('banner_pattern', { since: '1.20.5' }); resource('cat_variant', { since: '1.21.5' }); resource('chat_type', { since: '1.19' }); resource('chicken_variant', { since: '1.21.5' }); resource('cow_variant', { since: '1.21.5' }); resource('damage_type', { since: '1.19.4' }); resource('dialog', { since: '1.21.6' }); resource('enchantment', { since: '1.21' }); resource('enchantment_provider', { since: '1.21' }); resource('frog_variant', { since: '1.21.5' }); resource('instrument', { since: '1.21.2' }); resource('jukebox_song', { since: '1.21' }); resource('painting_variant', { since: '1.21' }); resource('pig_variant', { since: '1.21.5' }); resource('test_instance', { since: '1.21.5' }); resource('test_environment', { since: '1.21.5' }); resource('trial_spawner', { since: '1.21.2' }); resource('trim_pattern', { since: '1.19.4' }); resource('trim_material', { since: '1.19.4' }); resource('wolf_sound_variant', { since: '1.21.5' }); resource('wolf_variant', { since: '1.20.5' }); // Worldgen resource('dimension', { since: '1.16' }); resource('dimension_type', { since: '1.16' }); resource('worldgen/biome', { since: '1.16.2' }); resource('worldgen/configured_carver', { since: '1.16.2' }); resource('worldgen/configured_feature', { since: '1.16.2' }); resource('worldgen/configured_structure_feature', { since: '1.16.2', until: '1.19' }); resource('worldgen/density_function', { since: '1.18.2' }); resource('worldgen/flat_level_generator_preset', { since: '1.19' }); resource('worldgen/multi_noise_biome_source_parameter_list', { since: '1.19.4' }); resource('worldgen/noise', { since: '1.18' }); resource('worldgen/noise_settings', { since: '1.16.2' }); resource('worldgen/placed_feature', { since: '1.18' }); resource('worldgen/processor_list', { since: '1.16.2' }); resource('worldgen/configured_surface_builder', { since: '1.16.2', until: '1.18' }); resource('worldgen/structure', { since: '1.19' }); resource('worldgen/structure_set', { since: '1.18.2' }); resource('worldgen/template_pool', { since: '1.16.2' }); resource('worldgen/world_preset', { since: '1.19' }); // Tags const NonTaggableRegistries = new Set([ // Legacy plural paths 'block', 'fluid', 'function', 'game_event', 'item', // Removed before 1.18 'worldgen/block_placer_type', 'worldgen/surface_builder', ]); for (const registry of TaggableResourceLocationCategories) { if (NonTaggableRegistries.has(registry)) { continue; } resource(`tags/${registry}`, { category: `tag/${registry}`, since: '1.18' }); } // Resource pack resource('atlases', { pack: 'assets', category: 'atlas', since: '1.19.3' }); resource('blockstates', { pack: 'assets', category: 'block_definition' }); resource('equipment', { pack: 'assets', since: '1.21.4' }); resource('font', { pack: 'assets', since: '1.16' }); resource('font', { pack: 'assets', category: 'font/ttf', since: '1.16', ext: '.ttf' }); resource('font', { pack: 'assets', category: 'font/otf', since: '1.16', ext: '.otf' }); resource('font', { pack: 'assets', category: 'font/unihex', since: '1.20', ext: '.zip' }); resource('items', { pack: 'assets', category: 'item_definition', since: '1.21.4' }); resource('lang', { pack: 'assets' }); resource('models', { pack: 'assets', category: 'model' }); resource('models/equipment', { pack: 'assets', category: 'equipment', since: '1.21.2', until: '1.21.4', }); resource('particles', { pack: 'assets', category: 'particle' }); resource('post_effect', { pack: 'assets', since: '1.21.2' }); resource('shaders/post', { pack: 'assets', category: 'post_effect', until: '1.21.2' }); resource('shaders', { pack: 'assets', category: 'shader' }); resource('shaders', { pack: 'assets', category: 'shader/fragment', ext: '.fsh' }); resource('shaders', { pack: 'assets', category: 'shader/vertex', ext: '.vsh' }); resource('sounds', { pack: 'assets', category: 'sound', ext: '.ogg' }); resource('textures', { pack: 'assets', category: 'texture', ext: '.png' }); resource('textures', { pack: 'assets', category: 'texture_meta', ext: '.png.mcmeta' }); resource('waypoint_style', { pack: 'assets', since: '1.21.6' }); resource('lang', { pack: 'assets', category: 'lang/deprecated', identifier: 'deprecated' }); resource('', { pack: 'assets', category: 'sounds', identifier: 'sounds' }); resource('', { pack: 'assets', category: 'regional_compliancies', identifier: 'regional_compliancies', }); resource('', { pack: 'assets', category: 'gpu_warnlist', identifier: 'gpu_warnlist' }); function* getResources() { for (const resources of Resources.values()) { yield* resources; } return undefined; } function* getRels(uri, rootUris) { yield* fileUtil.getRels(uri, rootUris); const parts = uri.split('/'); for (let i = parts.length - 2; i >= 0; i--) { if (parts[i] === 'data' || parts[i] === 'assets') { yield parts.slice(i).join('/'); } } return undefined; } function* getRoots(uri, rootUris) { yield* fileUtil.getRoots(uri, rootUris); const parts = uri.split('/'); for (let i = parts.length - 2; i >= 0; i--) { if (parts[i] === 'data' || parts[i] === 'assets') { yield `${parts.slice(0, i).join('/')}/`; } } return undefined; } function getCandidateResourcesForRel(rel) { const parts = rel.split('/'); if (parts.length < 3) { return []; } const [pack, namespace, ...rest] = parts; if (pack !== 'data' && pack !== 'assets') { return []; } const candidateResources = []; if (rest.length === 1) { const resources = Resources.get(''); for (const res of resources ?? []) { if (res.pack !== pack) { continue; } let identifier = rest[0]; if (!identifier.endsWith(res.ext)) { continue; } identifier = identifier.slice(0, -res.ext.length); if (res.identifier && identifier !== res.identifier) { continue; } candidateResources.push({ ...res, namespace, identifier }); } } for (let i = 1; i < rest.length; i += 1) { const resources = Resources.get(rest.slice(0, i).join('/')); for (const res of resources ?? []) { if (res.pack !== pack) { continue; } let identifier = rest.slice(i).join('/'); if (!identifier.endsWith(res.ext)) { continue; } identifier = identifier.slice(0, -res.ext.length); if (res.identifier && identifier !== res.identifier) { continue; } candidateResources.push({ ...res, namespace, identifier }); } } return candidateResources; } function dissectUri(uri, ctx) { const rels = getRels(uri, ctx.roots); const release = ctx.project['loadedVersion']; if (!release) { return undefined; } for (const rel of rels) { const candidateResources = getCandidateResourcesForRel(rel); if (candidateResources.length === 0) { continue; } // Finding the last, because that will be the deepest match let res = candidateResources.findLast((res) => matchVersion(release, res.since, res.until)); if (res !== undefined) { return { ok: true, ...res, expected: undefined }; } // Try to find the expected path that matches the current version res = candidateResources[candidateResources.length - 1]; let expected = undefined; for (const [path, others] of Resources) { for (const other of others) { if (other.category !== res.category) { continue; } if (matchVersion(release, other.since, other.until)) { expected = path; break; } } } return { ok: false, ...res, expected }; } return undefined; } const binder_uriBinder = (uris, ctx) => { for (const uri of uris) { const parts = dissectUri(uri, ctx); if (parts) { ctx.symbols.query(uri, parts.category, `${parts.namespace}:${parts.identifier}`).enter({ usage: { type: 'definition' }, }); } } }; function registerCustomResources(config) { for (const [path, res] of Object.entries(config.env.customResources)) { resource(path, { ...res, category: res.category }); } } function matchVersion(target, since, until) { if (since && ReleaseVersion.cmp(target, since) < 0) { return false; } if (until && ReleaseVersion.cmp(until, target) <= 0) { return false; } return true; } function reportDissectError(realPath, expectedPath, ctx) { const release = ctx.project['loadedVersion']; if (!release) { return; } if (expectedPath) { ctx.err.report(localize('java-edition.binder.wrong-folder', localeQuote(realPath), release, localeQuote(expectedPath)), Range.Beginning, 0 /* ErrorSeverity.Hint */); } else { ctx.err.report(localize('java-edition.binder.wrong-version', localeQuote(realPath), release), Range.Beginning, 0 /* ErrorSeverity.Hint */); } } function uriBuilder(resources) { return (identifier, ctx) => { const root = getRoots(ctx.doc.uri, ctx.roots).next().value; if (!root) { return undefined; } const release = ctx.project['loadedVersion']; if (!release) { return undefined; } const resource = resources.find(r => matchVersion(release, r.since, r.until)); if (!resource) { return undefined; } const sepIndex = identifier.indexOf(':'); const namespace = sepIndex > 0 ? identifier.slice(0, sepIndex) : 'minecraft'; const path = identifier.slice(sepIndex + 1); return `${root}${resource.pack}/${namespace}/${resource.path}/${path}${resource.ext}`; }; } function registerUriBuilders(meta) { const resourcesByCategory = new Map(); for (const resource of getResources()) { resourcesByCategory.set(resource.category, [ ...resourcesByCategory.get(resource.category) ?? [], resource, ]); } for (const [category, resources] of resourcesByCategory.entries()) { meta.registerUriBuilder(category, uriBuilder(resources)); } } /** * Returns true for JSON file URIs that belong to any known resource category. No version check is * performed as we would like to provide errors even for files in the wrong folder or files for the * wrong version. */ const jsonUriPredicate = (uri, ctx) => { const rels = [...getRels(uri, ctx.roots)]; return rels.some((rel) => getCandidateResourcesForRel(rel).length > 0); }; //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/json/binder/index.js function bindDeprecated(node, ctx) { const renamed = node.children.find(p => p.key?.value === 'renamed')?.value; if (JsonObjectNode.is(renamed)) { for (const pair of renamed.children) { if (JsonStringNode.is(pair.value)) { const range = Range.translate(pair.value.range, 1, -1); ctx.symbols.query(ctx.doc, 'translation_key', pair.value.value) .enter({ usage: { type: 'definition', range, fullRange: pair }, }); } } } } function bindLanguage(node, ctx) { const isEnglish = ctx.doc.uri.endsWith('/en_us.json'); for (const pair of node.children) { if (pair.key) { const desc = JsonStringNode.is(pair.value) ? pair.value.value : undefined; const range = Range.translate(pair.key.range, 1, -1); ctx.symbols.query(ctx.doc, 'translation_key', pair.key.value) .enter({ data: { desc: isEnglish ? desc : undefined }, usage: { type: 'definition', range, fullRange: pair }, }); } } } const binder_file = (node, ctx) => { if (ctx.doc.uri.match(/\/lang\/[a-z_]+.json$/)) { const child = node.children[0]; if (JsonObjectNode.is(child)) { if (ctx.doc.uri.endsWith('/deprecated.json')) { bindDeprecated(child, ctx); } else { bindLanguage(child, ctx); } } } }; function binder_register(meta) { meta.registerBinder('json:file', binder_file); } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/json/checker/index.js function createTagDefinition(registry) { const id = { kind: 'tree', values: { registry: { kind: 'literal', value: { kind: 'string', value: registry } }, tags: { kind: 'literal', value: { kind: 'string', value: 'allowed' } }, }, }; return { kind: 'concrete', child: { kind: 'reference', path: '::java::data::tag::Tag' }, typeArgs: [{ kind: 'string', attributes: [{ name: 'id', value: id }] }], }; } const checker_file = (node, ctx) => { const child = node.children[0]; if (ctx.doc.uri.endsWith('/pack.mcmeta')) { const type = { kind: 'reference', path: '::java::pack::Pack' }; return index(type)(child, ctx); } const parts = dissectUri(ctx.doc.uri, ctx); if (parts?.ok) { if (parts.category.startsWith('tag/')) { const type = createTagDefinition(parts.category.slice(4)); return index(type)(child, ctx); } const type = { kind: 'dispatcher', registry: 'minecraft:resource', parallelIndices: [{ kind: 'static', value: parts.category }], }; return index(type, { discardDuplicateKeyErrors: true })(child, ctx); } else if (parts?.ok === false) { reportDissectError(parts.path, parts.expected, ctx); } }; function json_checker_register(meta) { meta.registerChecker('json:file', checker_file); } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/json/completer/index.js const textureSlot = (node, ctx) => { const slot = node.slot ?? SymbolNode.mock(node, { category: 'texture_slot', usageType: node.kind === 'definition' ? 'definition' : 'reference', }); const slotItems = completer_builtin_symbol(slot, ctx); if (node.kind === 'definition') { return slotItems; } if (node.kind === 'reference') { return slotItems.map(item => ({ ...item, range: node.range, label: '#' + item.label, insertText: '#' + (item.insertText ?? item.label), })); } const id = node.id ?? ResourceLocationNode.mock(node, { category: 'texture' }); return completer_builtin_resourceLocation(id, ctx); }; function json_completer_register(meta) { meta.registerCompleter('java_edition:texture_slot', textureSlot); } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/json/parser/index.js function textureSlotParser(kind) { return (src, ctx) => { const start = src.cursor; const ans = { type: 'java_edition:texture_slot', range: Range.create(start), kind, children: [], }; if (kind === 'definition') { const slot = symbol_symbol({ category: 'texture_slot', usageType: 'definition' })(src, ctx); ans.children.push(slot); ans.slot = slot; } else if (src.tryPeek('#')) { ans.children.push(literal('#')(src, ctx)); const slot = symbol_symbol({ category: 'texture_slot', usageType: 'reference' })(src, ctx); ans.children.push(slot); ans.slot = slot; } else if (kind === 'reference') { ctx.err.report(localize('expected', localeQuote('#')), src); } else { const id = resourceLocation_resourceLocation({ category: 'texture', usageType: 'reference' })(src, ctx); ans.children.push(id); ans.id = id; } ans.range = Range.create(start, src); return ans; }; } const translationValueParser = (src, ctx) => { const start = src.cursor; const ans = { type: 'java_edition:translation_value', range: Range.create(start), children: [], value: '', }; while (src.canRead()) { src.skipUntilOrEnd('%'); const argStart = src.cursor; if (src.trySkip('%')) { if (src.trySkip('%')) { const token = src.sliceToCursor(argStart); ans.children.push({ type: 'literal', range: Range.create(argStart, src), options: { pool: [token], colorTokenType: 'escape' }, value: token, }); continue; } let hasInteger = false; while (src.canRead() && Source.isDigit(src.peek())) { src.skip(); hasInteger = true; } if (hasInteger && !src.trySkip('$')) { ctx.err.report(localize('java-edition.translation-value.percent-escape-hint', localize('expected', localeQuote('$'))), src); } if (!src.trySkip('s')) { ctx.err.report(localize('java-edition.translation-value.percent-escape-hint', localize('expected', localeQuote('s'))), src); } const token = src.sliceToCursor(argStart); ans.children.push({ type: 'literal', range: Range.create(argStart, src), options: { pool: [token] }, value: token, }); } } ans.value = src.sliceToCursor(start); ans.range = Range.create(start, src); return ans; }; //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/json/mcdocAttributes.js const validator = validator_namespaceObject; const criterionValidator = validator.alternatives(validator.tree({ definition: validator.boolean, }), () => ({ definition: false })); const textureSlotValidator = validator.alternatives(validator.tree({ kind: validator.options('definition', 'value', 'reference'), }), () => ({ kind: 'value' })); const translationKeyValidator = validator.alternatives(validator.tree({ definition: validator.boolean, }), () => ({ definition: false })); function mcdocAttributes_registerMcdocAttributes(meta) { registerAttribute(meta, 'criterion', criterionValidator, { stringParser: (config, _, ctx) => { const parts = dissectUri(ctx.doc.uri, ctx); if (!parts || !parts.ok || parts.category !== 'advancement') { return undefined; } return symbol_symbol({ category: 'advancement', subcategory: 'criterion', parentPath: [`${parts.namespace}:${parts.identifier}`], usageType: config.definition ? 'definition' : 'reference', }); }, stringMocker: (config, _, ctx) => { const parts = dissectUri(ctx.doc.uri, ctx); if (!parts || !parts.ok || parts.category !== 'advancement') { return undefined; } return SymbolNode.mock(ctx.offset, { category: 'advancement', subcategory: 'criterion', parentPath: [`${parts.namespace}:${parts.identifier}`], }); }, }); registerAttribute(meta, 'texture_slot', textureSlotValidator, { stringParser: (config, _, ctx) => { return textureSlotParser(config.kind); }, stringMocker: (config, _, ctx) => { return { type: 'java_edition:texture_slot', range: Range.create(ctx.offset), kind: config.kind, children: [], }; }, }); registerAttribute(meta, 'translation_key', translationKeyValidator, { stringParser: (config, _, ctx) => { return symbol_symbol({ category: 'translation_key', usageType: config.definition ? 'definition' : 'reference', }); }, stringMocker: (config, _, ctx) => { return SymbolNode.mock(ctx.offset, { category: 'translation_key', usageType: config.definition ? 'definition' : 'reference', }); }, }); registerAttribute(meta, 'translation_value', () => undefined, { stringParser: () => translationValueParser, }); } //# sourceMappingURL=mcdocAttributes.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/json/index.js /* istanbul ignore file */ const json_initialize = (ctx) => { mcdocAttributes_registerMcdocAttributes(ctx.meta); binder_register(ctx.meta); json_checker_register(ctx.meta); json_completer_register(ctx.meta); }; //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcdocAttributes.js const mcdocAttributes_validator = validator_namespaceObject; const gameRuleValidator = mcdocAttributes_validator.tree({ type: mcdocAttributes_validator.options('boolean', 'int'), }); function lib_mcdocAttributes_registerMcdocAttributes(meta, commands, release) { registerAttribute(meta, 'since', mcdocAttributes_validator.string, { filterElement: (config, ctx) => { if (!config.startsWith('1.')) { ctx.logger.warn(`Invalid mcdoc attribute for "since": ${config}`); return true; } return ReleaseVersion.cmp(release, config) >= 0; }, }); registerAttribute(meta, 'until', mcdocAttributes_validator.string, { filterElement: (config, ctx) => { if (!config.startsWith('1.')) { ctx.logger.warn(`Invalid mcdoc attribute for "until": ${config}`); return true; } return ReleaseVersion.cmp(release, config) < 0; }, }); registerAttribute(meta, 'deprecated', mcdocAttributes_validator.optional(mcdocAttributes_validator.string), { mapField: (config, field, ctx) => { if (config === undefined) { return { ...field, deprecated: true }; } if (!config.startsWith('1.')) { ctx.logger.warn(`Invalid mcdoc attribute for "deprecated": ${config}`); return field; } if (ReleaseVersion.cmp(release, config) >= 0) { return { ...field, deprecated: true }; } return field; }, }); const gameRuleNode = commands.children.gamerule?.children; if (gameRuleNode) { const [boolGameRules, intGameRules] = ['brigadier:bool', 'brigadier:integer'].map((type) => Object.entries(gameRuleNode).flatMap(([key, node]) => node.children?.value?.type === 'argument' && node.children.value.parser === type ? [key] : [])); registerAttribute(meta, 'game_rule', gameRuleValidator, { stringParser: (config, _, ctx) => { return literal({ pool: config.type === 'boolean' ? boolGameRules : intGameRules, colorTokenType: 'string', }); }, stringMocker: (config, _, ctx) => { return LiteralNode.mock(ctx.offset, { pool: config.type === 'boolean' ? boolGameRules : intGameRules, }); }, }); } } function registerPackFormatAttribute(meta, versions, packs) { const dataFormats = new Map(); const assetsFormats = new Map(); if (versions[0]?.type !== 'release') { dataFormats.set(versions[0].data_pack_version, [NEXT_RELEASE_VERSION]); assetsFormats.set(versions[0].resource_pack_version, [NEXT_RELEASE_VERSION]); } for (const version of versions) { if (version.type === 'release') { dataFormats.set(version.data_pack_version, [ ...dataFormats.get(version.data_pack_version) ?? [], version.id, ]); assetsFormats.set(version.resource_pack_version, [ ...assetsFormats.get(version.resource_pack_version) ?? [], version.id, ]); } } function getFormats(packMcmetaUri) { const thisPack = packs.find(p => fileUtil.isSubUriOf(packMcmetaUri, p.packRoot)); return thisPack?.type === 'assets' ? assetsFormats : dataFormats; } registerAttribute(meta, 'pack_format', () => undefined, { numericCompleter: (_, ctx) => { return [...getFormats(ctx.doc.uri).entries()].map(([k, v], i) => ({ range: Range.create(ctx.offset), label: `${k}`, labelSuffix: ` (${v[0]})`, sortText: `${i}`.padStart(4, '0'), })); }, }); } //# sourceMappingURL=mcdocAttributes.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/colorizer/macro.js const macro = (node, ctx) => { const tokens = []; for (const child of node.children) { if (child.type === 'mcfunction:macro/prefix') { tokens.push(ColorToken.create(child.range, 'literal')); } else if (child.type === 'mcfunction:macro/other') { tokens.push(ColorToken.create(child.range, 'string')); } else { const { start, end } = child.range; // $( tokens.push(ColorToken.create(Range.create(start, start + 2), 'literal')); // Key tokens.push(ColorToken.create(Range.create(start + 2, end - 1), 'property')); // ) tokens.push(ColorToken.create(Range.create(end - 1, end), 'literal')); } } return tokens; }; //# sourceMappingURL=macro.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/colorizer/index.js function mcfunction_lib_colorizer_register(meta) { meta.registerColorizer('mcfunction:command_child/literal', builtin_literal); meta.registerColorizer('mcfunction:command_child/trailing', error); meta.registerColorizer('mcfunction:macro', macro); } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/node/command.js var CommandNode; (function (CommandNode) { /* istanbul ignore next */ function is(node) { return node?.type === 'mcfunction:command'; } CommandNode.is = is; function mock(range, options = {}) { return { type: 'mcfunction:command', range: Range.get(range), children: [], options }; } CommandNode.mock = mock; })(CommandNode || (CommandNode = {})); var CommandChildNode; (function (CommandChildNode) { function is(node) { return node.type === 'mcfunction:command_child'; } CommandChildNode.is = is; })(CommandChildNode || (CommandChildNode = {})); var LiteralCommandChildNode; (function (LiteralCommandChildNode) { function is(node) { return (node?.type === 'mcfunction:command_child/literal'); } LiteralCommandChildNode.is = is; })(LiteralCommandChildNode || (LiteralCommandChildNode = {})); //# sourceMappingURL=command.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/node/entry.js var McfunctionNode; (function (McfunctionNode) { /* istanbul ignore next */ function is(node) { return node?.type === 'mcfunction:entry'; } McfunctionNode.is = is; })(McfunctionNode || (McfunctionNode = {})); //# sourceMappingURL=entry.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/node/macro.js var MacroNode; (function (MacroNode) { /* istanbul ignore next */ function is(obj) { return obj?.type === 'mcfunction:macro'; } MacroNode.is = is; function mock(range) { return { type: 'mcfunction:macro', range: Range.get(range), children: [] }; } MacroNode.mock = mock; })(MacroNode || (MacroNode = {})); //# sourceMappingURL=macro.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/node/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/tree/util.js function redirect(rootTreeNode, path) { return path.reduce((p, c) => p?.children?.[c], rootTreeNode); } function resolveParentTreeNode(parentTreeNode, rootTreeNode, parentPath) { if (parentTreeNode?.redirect) { return { treeNode: redirect(rootTreeNode, parentTreeNode.redirect), path: [...parentTreeNode.redirect], }; } else if (parentTreeNode && !parentTreeNode.children && !parentTreeNode.executable) { // The `execute.run` literal tree node doesn't have any property. // We should use children from the root tree node in this case. return { treeNode: rootTreeNode, path: [] }; } else { return { treeNode: parentTreeNode, path: parentPath }; } } /** * Categorize command tree children to literal entries and argument entries. */ function categorizeTreeChildren(children) { const ans = { literalTreeNodes: [], argumentTreeNodes: [], }; for (const e of Object.entries(children)) { /* istanbul ignore else */ if (e[1].type === 'literal') { ans.literalTreeNodes.push(e); } else if (e[1].type === 'argument') { ans.argumentTreeNodes.push(e); } } return ans; } //# sourceMappingURL=util.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/completer/index.js /** * @param getMockNodes A function that returns a mock AST Node from given {@link ArgumentTreeNode}. These mock nodes * will be used for completing the argument. */ function completer_entry(tree, getMockNodes) { return (node, ctx) => { const childNode = AstNode.findChild(node, ctx.offset, true); if (CommandNode.is(childNode)) { return command(tree, getMockNodes)(childNode ?? CommandNode.mock(ctx.offset), ctx); } else { return []; } }; } function command(tree, getMockNodes) { return (node, ctx) => { const index = AstNode.findChildIndex(node, ctx.offset, true); const selectedChildNode = node.children[index] ?.children[0]; if (selectedChildNode) { return dispatch(selectedChildNode, ctx); } const lastChildNode = AstNode.findLastChild(node, ctx.offset); if (!lastChildNode) { return Object.keys(tree.children ?? {}).map((v) => CompletionItem.create(v, ctx.offset, { kind: 14 /* core.CompletionKind.Keyword */ })); } const treePath = lastChildNode.path; const { treeNode: parentTreeNode } = resolveParentTreeNode(redirect(tree, treePath), tree); if (!parentTreeNode?.children) { return []; } const { literalTreeNodes, argumentTreeNodes } = categorizeTreeChildren(parentTreeNode.children); const lastIndex = node.children.indexOf(lastChildNode); const prevNodes = node.children.slice(0, lastIndex + 1); return [ ...literalTreeNodes.map(([name]) => CompletionItem.create(name, ctx.offset, { kind: 14 /* core.CompletionKind.Keyword */ })), ...argumentTreeNodes.flatMap(([_name, treeNode]) => Arrayable.toArray(getMockNodes(treeNode, prevNodes, ctx)).flatMap((n) => dispatch(n, ctx))), ]; }; } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/parser/argument.js function argumentTreeNodeToString(name, treeNode) { const parserName = treeNode.parser.slice(treeNode.parser.indexOf(':') + 1); return `<${name}: ${parserName}>`; } //# sourceMappingURL=argument.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/parser/common.js /** * A parser that takes a continuous sequence of spaces and tabs, and marks an error if it is not a single space. * * @returns The accepted spaces and tabs. */ const common_sep = (src, ctx) => { const start = src.cursor; const ans = src.readSpace(); if (ans !== ' ') { ctx.err.report(localize('expected', localize('mcfunction.parser.sep', localeQuote(' '))), Range.create(start, src)); } return ans; }; //# sourceMappingURL=common.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/parser/literal.js function literal_literal(names, isRoot = false) { const options = { pool: names, colorTokenType: isRoot ? 'keyword' : 'literal', }; return (src, ctx) => { const start = src.cursor; const value = src.readUntil(' ', '\r', '\n'); if (!value.length) { return Parser_Failure; } const ans = { type: 'mcfunction:command_child/literal', range: Range.create(start, src), options, value, }; if (!names.includes(value)) { ctx.err.report(localize('expected', names), ans); } return ans; }; } //# sourceMappingURL=literal.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/parser/command.js /** * @returns A parser that always takes a whole line (excluding line turn characters) and tries to parse it as a command. */ function command_command(tree, argument, options = {}) { return (src, ctx) => { const ans = { type: 'mcfunction:command', range: Range.create(src), children: [], options, }; const start = src.cursor; const innerStart = src.innerCursor; if (src.trySkip('/')) { ans.slash = Range.create(start, src.cursor); if (!options.slash) { ctx.err.report(localize('mcfunction.parser.leading-slash.unexpected'), ans.slash, 3 /* core.ErrorSeverity.Error */, { codeAction: { title: localize('code-action.remove-leading-slash'), isPreferred: true, changes: [ { type: 'edit', range: ans.slash, text: '', }, ], }, }); } } else if (options.slash === 'required') { ctx.err.report(localize('expected', localize('mcfunction.parser.leading-slash')), Range.create(start, start + 1), 3 /* core.ErrorSeverity.Error */, { codeAction: { title: localize('code-action.add-leading-slash'), isPreferred: true, changes: [ { type: 'edit', range: Range.create(start), text: '/', }, ], }, }); } command_dispatch(ans.children, src, ctx, [], tree, tree, argument); if (src.canReadInLine()) { // There is trailing string after the command. const node = trailing(src, ctx); ans.children.push({ type: 'mcfunction:command_child', range: node.range, children: [node], path: [], }); } ans.range.end = src.cursor; if (options.maxLength) { const commandLength = src.innerCursor - innerStart; if (commandLength > options.maxLength) { ctx.err.report(localize('mcfunction.parser.command-too-long', commandLength, options.maxLength), ans); } } return ans; }; } /** * Dispatch and parse based on the specified command tree node's children. * * @param ans An array where child nodes will be pushed into. */ function command_dispatch(ans, src, ctx, path, rootTreeNode, parentTreeNode, argument) { // Convention: suffix `Node` is for AST nodes; `TreeNode` is for command tree nodes. function _dispatch(path, parentTreeNode) { const { treeNode: parent, path: resolvedPath } = resolveParentTreeNode(parentTreeNode, rootTreeNode, path); path = resolvedPath; const children = parent?.children; if (!children) { return false; } const { literalTreeNodes, argumentTreeNodes } = categorizeTreeChildren(children); const argumentParsers = argumentTreeNodes.map(([name, treeNode]) => ({ name, parser: argument(treeNode, ans) ?? unknown(treeNode) })); const literalParser = literalTreeNodes.length ? literal_literal(literalTreeNodes.map(([name, _treeNode]) => name), parent.type === 'root') : undefined; const parsers = [ ...(literalParser ? [literalParser] : []), ...argumentParsers.map((v) => v.parser), ]; const out = { index: 0 }; if (parsers.length === 0) { return false; } const parser = parsers.length > 1 ? util_any(parsers, out) : parsers[0]; const result = parser(src, ctx); if (result !== Parser_Failure) { const takenName = argumentParsers[out.index - (literalParser ? 1 : 0)]?.name ?? result.value; const childPath = [...path, takenName]; ans.push({ type: 'mcfunction:command_child', range: result.range, children: [result], path: childPath, }); const childTreeNode = children[takenName]; if (!childTreeNode) { return false; } const requiredPermissionLevel = childTreeNode.permission ?? 2; if (ctx.config.env.permissionLevel < requiredPermissionLevel) { ctx.err.report(localize('mcfunction.parser.no-permission', requiredPermissionLevel, ctx.config.env.permissionLevel), result); } if (result.type === 'mcfunction:command_child/unknown') { // Encountered an unsupported parser. Stop parsing this command. return false; } if (src.canReadInLine()) { // Skip command argument separation (a space). common_sep(src, ctx); return { childPath, childTreeNode }; } else { // End-of-command. if (!childTreeNode.executable) { ctx.err.report(localize('mcfunction.parser.eoc-unexpected'), src); } } } else { // Failed to parse as any arguments. ctx.err.report(localize('expected', treeNodeChildrenToString(children)), Range.create(src)); } return false; } let result = _dispatch(path, parentTreeNode); while (result) { result = _dispatch(result.childPath, result.childTreeNode); } } function unknown(treeNode) { return (src, ctx) => { const start = src.cursor; const value = src.readUntilLineEnd(); const range = Range.create(start, src); ctx.err.report(localize('mcfunction.parser.unknown-parser', localeQuote(treeNode.parser)), range, 0 /* core.ErrorSeverity.Hint */); return { type: 'mcfunction:command_child/unknown', range, value }; }; } const trailing = (src, ctx) => { const start = src.cursor; const value = src.readUntilLineEnd(); const range = Range.create(start, src); ctx.err.report(localize('mcfunction.parser.trailing', localeQuote(value)), range); return { type: 'mcfunction:command_child/trailing', range, value }; }; function wrapWithBrackets(syntax, executable) { return executable ? `[${syntax}]` : syntax; } function treeNodeChildrenToStringArray(children, executable = false) { const entries = Object.entries(children).map(([name, treeNode]) => wrapWithBrackets(treeNodeToString(name, treeNode), executable)); return entries; } function treeNodeChildrenToString(children) { const entries = treeNodeChildrenToStringArray(children); return entries.length > 5 ? `${entries.slice(0, 3).join('|')}|...|${entries.slice(-2).join('|')}` : entries.join('|'); } function treeNodeToString(name, treeNode) { if (treeNode.type === 'argument') { return argumentTreeNodeToString(name, treeNode); } else { return name; } } //# sourceMappingURL=command.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/parser/macro.js /** * Parse a macro line. * @param hasPrefix When false, don't look for a starting '$'. */ function macro_macro(hasPrefix = true) { return (src, ctx) => { const ans = { type: 'mcfunction:macro', range: Range.create(src.cursor), children: [], }; let start = src.cursor; let hasMacroArgs = false; if (hasPrefix) { // Skip the starting '$' if (src.trySkip('$')) { ans.children.push({ type: 'mcfunction:macro/prefix', range: Range.create(start, src), }); start = src.cursor; } else { ctx.err.report(localize('expected', localeQuote('$')), ans); } } while (src.canReadInLine()) { src.skipUntilOrEnd(LF, CR, '$'); if (src.peek(2) === '$(') { hasMacroArgs = true; // Add the other stuff before this macro key const other = src.sliceToCursor(start); if (other.length > 0) { ans.children.push({ type: 'mcfunction:macro/other', range: Range.create(start, src), value: other, }); start = src.cursor; } // Parse the macro key const key = validateMacroArgument(src, ctx, start); ans.children.push({ type: 'mcfunction:macro/argument', range: Range.create(start, src.cursor), value: key, }); start = src.cursor; } else { if (src.peek() === '$') { src.skip(); } if (!src.canReadInLine()) { // No more macro arguments, add the remaining other stuff ans.children.push({ type: 'mcfunction:macro/other', range: Range.create(start, src), value: src.sliceToCursor(start), }); } } } // A line with no macro arguments is invalid if (!hasMacroArgs) { ctx.err.report(localize('expected', localize('mcfunction.parser.macro.at-least-one')), Range.create(start, src)); } ans.range.end = src.cursor; return ans; }; } /** * Error checking for a macro argument/key. */ function validateMacroArgument(src, ctx, start) { src.skip(2); const keyStart = src.cursor; src.skipUntilOrEnd(LF, CR, ')'); if (src.peek() !== ')') { // Macro key was not closed ctx.err.report(localize('expected', localeQuote(')')), Range.create(keyStart, src.cursor)); } else if (src.cursor <= keyStart) { // Encountered $() ctx.err.report(localize('expected', localize('mcfunction.parser.macro.key')), Range.create(start, src.cursor + 1)); } const key = src.sliceToCursor(keyStart); const matchedInvalid = key.replace(/[a-zA-Z0-9_]*/, ''); if (matchedInvalid.length > 0) { ctx.err.report(localize('mcfunction.parser.macro.illegal-key', matchedInvalid.charAt(0)), Range.create(keyStart, src.cursor)); } src.skip(); return key; } //# sourceMappingURL=macro.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/parser/entry.js function mcfunction(commandTree, argument, options) { return (src, ctx) => { const ans = { type: 'mcfunction:entry', range: Range.create(src), children: [], }; while (src.skipWhitespace().canReadInLine()) { let result; if (src.peek() === '#') { result = entry_comment(src, ctx); } else if (src.peek() === '$') { const start = src.cursor; if (options.macros) { result = macro_macro()(src, ctx); } else { src.skipLine(); ans.range.end = src.cursor; result = { type: 'error', range: Range.create(start, src), }; ctx.err.report(localize('mcfunction.parser.macro.disallowed'), result); } } else { result = command_command(commandTree, argument, options.commandOptions)(src, ctx); } ans.children.push(result); src.nextLine(); } ans.range.end = src.cursor; return ans; }; } const entry_comment = comment_comment({ singleLinePrefixes: new Set(['#']) }); const parser_entry_entry = (commandTree, argument, options = {}) => { const parser = mcfunction(commandTree, argument, options); return options.lineContinuation ? concatOnTrailingBackslash(parser) : parser; }; //# sourceMappingURL=entry.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/parser/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/tree/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/index.js /* istanbul ignore next */ const mcfunction_lib_initialize = ({ meta }) => { mcfunction_lib_colorizer_register(meta); meta.registerCompleter('mcfunction:command_child/literal', completer_builtin_literal); }; //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/common/index.js /** * @returns An array of URIs corresponding to the specified resource. */ function getUris(category, id, ctx) { return (ctx.symbols.query(ctx.doc, category, ResourceLocation.lengthen(id)).symbol ?.definition?.map((v) => v.uri) ?? []); } function getTagValues(category, id, ctx) { const resolveValueNode = (node) => JsonStringNode.is(node) ? node.value : node.children.find((n) => n.key?.value === 'id').value.value; const set = getUris(category, id, ctx).reduce((ans, uri) => { // const result = ctx.getDocAndNode(uri) const result = undefined; // FIXME: Use global symbol table to get the result if (!result || result.node.parserErrors.length || result.node.checkerErrors?.length) { return ans; } // No errors in the node. We can assume it is a semantically correct tag file. const rootNode = result.node.children[0]; const replaceNode = rootNode.children.find((n) => n.key?.value === 'replace')?.value; const valuesNode = rootNode.children.find((n) => n.key?.value === 'values') ?.value; const replace = replaceNode?.value; const values = valuesNode.children.map((n) => ResourceLocation.lengthen(resolveValueNode(n.value))); if (replace) { ans = new Set(); } for (const value of values) { ans.add(value); } return ans; }, new Set()); return [...set]; } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/node/argument.js var BlockStatesNode; (function (BlockStatesNode) { /* istanbul ignore next */ function is(node) { return node.type === 'mcfunction:block/states'; } BlockStatesNode.is = is; })(BlockStatesNode || (BlockStatesNode = {})); var BlockNode; (function (BlockNode) { function is(node) { return node?.type === 'mcfunction:block'; } BlockNode.is = is; function mock(range, isPredicate) { const id = ResourceLocationNode.mock(range, { category: 'block', allowTag: isPredicate }); return { type: 'mcfunction:block', range: Range.get(range), children: [id], id, isPredicate: false, }; } BlockNode.mock = mock; })(BlockNode || (BlockNode = {})); const CoordinateNotations = (/* unused pure expression or super */ null && (['', '~', '^'])); var CoordinateNode; (function (CoordinateNode) { function mock(range) { return { type: 'mcfunction:coordinate', range: Range.get(range), notation: '', value: 0 }; } CoordinateNode.mock = mock; /** * @returns A number in the range `[-180.0, 180.0)`. */ function toDegree(node) { // TODO: For relative coordinates, const value = (node.value + baseCoordinate) % 360 const value = node.value % 360; return value >= 180 ? value - 360 : value < -180 ? value + 360 : value; } CoordinateNode.toDegree = toDegree; })(CoordinateNode || (CoordinateNode = {})); var EntitySelectorArgumentsNode; (function (EntitySelectorArgumentsNode) { /* istanbul ignore next */ function is(node) { return (node.type === 'mcfunction:entity_selector/arguments'); } EntitySelectorArgumentsNode.is = is; })(EntitySelectorArgumentsNode || (EntitySelectorArgumentsNode = {})); const EntitySelectorVariables = ['a', 'e', 'p', 'r', 's', 'n']; var EntitySelectorVariable; (function (EntitySelectorVariable) { /* istanbul ignore next */ function is(value) { return EntitySelectorVariables.includes(value); } EntitySelectorVariable.is = is; })(EntitySelectorVariable || (EntitySelectorVariable = {})); const EntitySelectorAtVariables = EntitySelectorVariables.map((v) => `@${v}`); var EntitySelectorAtVariable; (function (EntitySelectorAtVariable) { /* istanbul ignore next */ function is(value) { return EntitySelectorAtVariables.includes(value); } EntitySelectorAtVariable.is = is; /** * Should be used to get a list of available selectors for the current version. */ function filterAvailable(ctx) { const release = ctx.project['loadedVersion']; return EntitySelectorAtVariables.filter(variable => !(variable === '@n' && release && ReleaseVersion.cmp(release, '1.21') < 0)); } EntitySelectorAtVariable.filterAvailable = filterAvailable; })(EntitySelectorAtVariable || (EntitySelectorAtVariable = {})); var EntitySelectorNode; (function (EntitySelectorNode) { /* istanbul ignore next */ function is(node) { return (node?.type === 'mcfunction:entity_selector'); } EntitySelectorNode.is = is; function mock(range, options) { const literal = LiteralNode.mock(range, options); return { type: 'mcfunction:entity_selector', range: Range.get(range), children: [literal], variable: 'e', }; } EntitySelectorNode.mock = mock; EntitySelectorNode.ArgumentKeys = new Set([ 'advancements', 'distance', 'gamemode', 'level', 'limit', 'name', 'nbt', 'predicate', 'scores', 'sort', 'tag', 'team', 'type', 'x', 'y', 'z', 'dx', 'dy', 'dz', 'x_rotation', 'y_rotation', ]); function canKeyExist(selector, argument, key) { const hasKey = (key) => !!argument.children.find((p) => p.key?.value === key); const hasNonInvertedKey = (key) => !!argument.children.find((p) => p.key?.value === key && !p.value?.inverted); switch (key) { case 'advancements': case 'distance': case 'level': case 'scores': case 'x': case 'y': case 'z': case 'dx': case 'dy': case 'dz': case 'x_rotation': case 'y_rotation': return hasKey(key) ? 1 /* Result.Duplicated */ : 0 /* Result.Ok */; case 'gamemode': case 'name': case 'team': return hasNonInvertedKey(key) ? 1 /* Result.Duplicated */ : 0 /* Result.Ok */; case 'limit': case 'sort': return selector.currentEntity ? 2 /* Result.NotApplicable */ : hasKey(key) ? 1 /* Result.Duplicated */ : 0 /* Result.Ok */; case 'type': return selector.typeLimited ? hasKey(key) ? 1 /* Result.Duplicated */ : 2 /* Result.NotApplicable */ : 0 /* Result.Ok */; } return 0 /* Result.Ok */; } EntitySelectorNode.canKeyExist = canKeyExist; })(EntitySelectorNode || (EntitySelectorNode = {})); var EntityNode; (function (EntityNode) { function is(node) { return node?.type === 'mcfunction:entity'; } EntityNode.is = is; })(EntityNode || (EntityNode = {})); var ItemStackNode; (function (ItemStackNode) { function is(node) { return node?.type === 'mcfunction:item_stack'; } ItemStackNode.is = is; function mock(range) { const id = ResourceLocationNode.mock(range, { category: 'item' }); return { type: 'mcfunction:item_stack', range: Range.get(range), children: [id], id }; } ItemStackNode.mock = mock; })(ItemStackNode || (ItemStackNode = {})); var ComponentListNode; (function (ComponentListNode) { function is(node) { return node.type === 'mcfunction:component_list'; } ComponentListNode.is = is; })(ComponentListNode || (ComponentListNode = {})); var ComponentNode; (function (ComponentNode) { function is(node) { return node.type === 'mcfunction:component'; } ComponentNode.is = is; })(ComponentNode || (ComponentNode = {})); var ComponentRemovalNode; (function (ComponentRemovalNode) { function is(node) { return node.type === 'mcfunction:component_removal'; } ComponentRemovalNode.is = is; })(ComponentRemovalNode || (ComponentRemovalNode = {})); var ItemPredicateNode; (function (ItemPredicateNode) { function is(node) { return node?.type === 'mcfunction:item_predicate'; } ItemPredicateNode.is = is; function mock(range) { const id = ResourceLocationNode.mock(range, { category: 'item', allowTag: true }); return { type: 'mcfunction:item_predicate', range: Range.get(range), children: [id], id }; } ItemPredicateNode.mock = mock; })(ItemPredicateNode || (ItemPredicateNode = {})); var ComponentTestsNode; (function (ComponentTestsNode) { function is(node) { return node.type === 'mcfunction:component_tests'; } ComponentTestsNode.is = is; })(ComponentTestsNode || (ComponentTestsNode = {})); var ComponentTestsAnyOfNode; (function (ComponentTestsAnyOfNode) { function is(node) { return node.type === 'mcfunction:component_tests_any_of'; } ComponentTestsAnyOfNode.is = is; })(ComponentTestsAnyOfNode || (ComponentTestsAnyOfNode = {})); var ComponentTestsAllOfNode; (function (ComponentTestsAllOfNode) { function is(node) { return node.type === 'mcfunction:component_tests_all_of'; } ComponentTestsAllOfNode.is = is; })(ComponentTestsAllOfNode || (ComponentTestsAllOfNode = {})); var ComponentTestExactNode; (function (ComponentTestExactNode) { function is(node) { return node.type === 'mcfunction:component_test_exact'; } ComponentTestExactNode.is = is; })(ComponentTestExactNode || (ComponentTestExactNode = {})); var ComponentTestExistsNode; (function (ComponentTestExistsNode) { function is(node) { return node.type === 'mcfunction:component_test_exists'; } ComponentTestExistsNode.is = is; })(ComponentTestExistsNode || (ComponentTestExistsNode = {})); var ComponentTestSubpredicateNode; (function (ComponentTestSubpredicateNode) { function is(node) { return node.type === 'mcfunction:component_test_sub_predicate'; } ComponentTestSubpredicateNode.is = is; })(ComponentTestSubpredicateNode || (ComponentTestSubpredicateNode = {})); var argument_IntRangeNode; (function (IntRangeNode) { function mock(range) { return { type: 'mcfunction:int_range', range: Range.get(range), children: [], value: [undefined, undefined], }; } IntRangeNode.mock = mock; })(argument_IntRangeNode || (argument_IntRangeNode = {})); var argument_NbtNode; (function (NbtNode) { /* istanbul ignore next */ function is(node) { return node.type === 'mcfunction:nbt'; } NbtNode.is = is; })(argument_NbtNode || (argument_NbtNode = {})); var argument_NbtPathNode; (function (NbtPathNode) { /* istanbul ignore next */ function is(node) { return node.type === 'mcfunction:nbt_path'; } NbtPathNode.is = is; })(argument_NbtPathNode || (argument_NbtPathNode = {})); var NbtResourceNode; (function (NbtResourceNode) { /* istanbul ignore next */ function is(node) { return node.type === 'mcfunction:nbt_resource'; } NbtResourceNode.is = is; })(NbtResourceNode || (NbtResourceNode = {})); var ObjectiveCriteriaNode; (function (ObjectiveCriteriaNode) { ObjectiveCriteriaNode.SimpleValues = [ 'air', 'armor', 'deathCount', 'dummy', 'food', 'health', 'level', 'playerKillCount', 'totalKillCount', 'trigger', 'xp', ...Color.ColorNames.map((n) => `killedByTeam.${n}`), ...Color.ColorNames.map((n) => `teamkill.${n}`), ]; ObjectiveCriteriaNode.ComplexCategories = new Map([ ['broken', 'item'], ['crafted', 'item'], ['custom', 'custom_stat'], ['dropped', 'item'], ['killed', 'entity_type'], ['killed_by', 'entity_type'], ['mined', 'block'], ['picked_up', 'item'], ['used', 'item'], ]); ObjectiveCriteriaNode.ComplexSep = ':'; function mock(range) { return { type: 'mcfunction:objective_criteria', range: Range.get(range) }; } ObjectiveCriteriaNode.mock = mock; })(ObjectiveCriteriaNode || (ObjectiveCriteriaNode = {})); var ParticleNode; (function (ParticleNode) { // until 1.20.5 const SpecialTypes = new Set([ 'block', 'block_marker', 'dust', 'dust_color_transition', 'falling_dust', 'item', 'sculk_charge', 'shriek', 'vibration', ]); function isSpecialType(type) { return SpecialTypes.has(type); } ParticleNode.isSpecialType = isSpecialType; // since 1.20.5 const OptionTypes = new Set([ ...SpecialTypes, 'block_crumble', 'dust_pillar', 'entity_effect', 'trail', ]); function requiresOptions(type) { return OptionTypes.has(type); } ParticleNode.requiresOptions = requiresOptions; function is(node) { return node?.type === 'mcfunction:particle'; } ParticleNode.is = is; function mock(range) { const id = ResourceLocationNode.mock(range, { category: 'particle_type' }); return { type: 'mcfunction:particle', range: Range.get(range), children: [id], id }; } ParticleNode.mock = mock; })(ParticleNode || (ParticleNode = {})); var ScoreHolderNode; (function (ScoreHolderNode) { function mock(range) { const fakeName = SymbolNode.mock(range, { category: 'score_holder' }); return { type: 'mcfunction:score_holder', range: Range.get(range), children: [fakeName], fakeName, }; } ScoreHolderNode.mock = mock; })(ScoreHolderNode || (ScoreHolderNode = {})); var TimeNode; (function (TimeNode) { TimeNode.UnitToTicks = new Map([['', 1], ['t', 1], ['s', 20], ['d', 24000]]); TimeNode.Units = [...TimeNode.UnitToTicks.keys()]; })(TimeNode || (TimeNode = {})); var VectorNode; (function (VectorNode) { function mock(range, options) { return { type: 'mcfunction:vector', range: Range.get(range), children: [], options, system: 0 /* CoordinateSystem.World */, }; } VectorNode.mock = mock; })(VectorNode || (VectorNode = {})); //# sourceMappingURL=argument.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/node/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/checker/index.js const checker_entry = (node, ctx) => { const parts = dissectUri(ctx.doc.uri, ctx); if (parts?.ok === false) { reportDissectError(parts.path, parts.expected, ctx); } builtin_dispatchSync(node, ctx); }; const checker_command = (node, ctx) => { rootCommand(node.children, 0, ctx); }; function getEarlierNode(nodes, before, name) { if (name === undefined) { return undefined; } for (let i = before - 1; i > 0; i -= 1) { if (nodes[i].path[nodes[i].path.length - 1] === name) { return nodes[i].children[0]; } } return undefined; } const rootCommand = (nodes, index, ctx) => { for (let i = 0; i < nodes.length; i += 1) { const node = nodes[i].children[0]; if (BlockNode.is(node)) { block(node, ctx); } else if (EntityNode.is(node)) { entity(node, ctx); } else if (ItemPredicateNode.is(node)) { itemPredicate(node, ctx); } else if (ItemStackNode.is(node)) { itemStack(node, ctx); } else if (ParticleNode.is(node)) { particle(node, ctx); } else if (NbtResourceNode.is(node)) { nbtResource(node, ctx); } else if (TypedJsonNode.is(node)) { typed(node, ctx); } else if (TypedNbtNode.is(node)) { checker_typed(node, ctx); } else if (argument_NbtNode.is(node) && node.properties) { const dispatchedBy = getEarlierNode(nodes, i, node.properties.dispatchedBy); const indexedBy = getEarlierNode(nodes, i, node.properties.indexedBy); nbtChecker(dispatchedBy, indexedBy)(node, ctx); } else if (argument_NbtPathNode.is(node) && node.properties) { const dispatchedBy = getEarlierNode(nodes, i, node.properties.dispatchedBy); nbtPathChecker(dispatchedBy)(node, ctx); } } }; // #region Checkers for argument nodes const block = (node, ctx) => { if (!node.nbt) { return; } const type = ResourceLocationNode.toString(node.id, 'full'); checker_index('minecraft:block', type, { isPredicate: node.isPredicate })(node.nbt, ctx); }; const entity = (node, ctx) => { for (const pair of node.selector?.arguments?.children ?? []) { if (pair.key?.value !== 'nbt' || !pair.value) { continue; } const types = getTypesFromEntity(node, ctx); if (!NbtCompoundNode.is(pair.value.value)) { continue; } checker_index('minecraft:entity', types, { isPredicate: true })(pair.value.value, ctx); } }; const itemPredicate = (node, ctx) => { if (node.nbt) { const type = ResourceLocationNode.toString(node.id, 'full'); checker_index('minecraft:item', type, { isPredicate: true })(node.nbt, ctx); } if (!node.tests?.children) { return; } const anyOfTest = node.tests.children[0]; for (const allOfTest of anyOfTest.children) { for (const test of allOfTest.children) { const key = ResourceLocationNode.toString(test.key, 'full'); // count is a special case that's only valid in item predicate arguments, not json // note: basically all errors checked here are otherwise accepted by vanilla, but it's good to report them if (key === 'minecraft:count' && !ComponentTestExistsNode.is(test) && test.value) { const validInt = { kind: 'int', valueRange: { kind: 0b00, min: 0 } }; const type = { kind: 'union', members: [ validInt, { kind: 'struct', fields: [ { kind: 'pair', key: 'min', optional: true, type: validInt }, { kind: 'pair', key: 'max', optional: true, type: validInt }, ], }, ], }; checker_typeDefinition(type)(test.value, ctx); } else if (ComponentTestExactNode.is(test) && test.value) { checker_index('minecraft:data_component', key)(test.value, ctx); } else if (ComponentTestSubpredicateNode.is(test) && test.value) { checker_index('minecraft:data_component_predicate', key)(test.value, ctx); } } } }; const itemStack = (node, ctx) => { const itemId = ResourceLocationNode.toString(node.id, 'full'); if (node.nbt) { checker_index('minecraft:item', itemId)(node.nbt, ctx); } if (!node.components) { return; } const groupedComponents = new Map(); for (const child of node.components.children) { if (!child.key) { continue; } const componentId = ResourceLocationNode.toString(child.key, 'full'); if (!groupedComponents.has(componentId)) { groupedComponents.set(componentId, []); } groupedComponents.get(componentId).push(child.key); if (child.type === 'mcfunction:component' && child.value) { checker_index('minecraft:data_component', componentId)(child.value, ctx); } } for (const [_, group] of groupedComponents) { if (group.length > 1) { for (const node of group) { ctx.err.report(localize('mcfunction.parser.duplicate-components'), node.range, 2 /* core.ErrorSeverity.Warning */); } } } }; const nbtResource = (node, ctx) => { const type = { kind: 'dispatcher', registry: 'minecraft:resource', parallelIndices: [{ kind: 'static', value: ResourceLocation.lengthen(node.category) }], }; checker_typeDefinition(type)(node.children[0], ctx); }; function nbtChecker(dispatchedBy, indexedBy) { return (node, ctx) => { if (!node.properties) { return; } const tag = node.children[0]; if (indexedBy) { if (argument_NbtPathNode.is(indexedBy)) { const indexedByTypedef = indexedBy.children[0].endTypeDef; const typeDef = indexedByTypedef && node.properties.isListIndex ? getListLikeChild(indexedByTypedef) : indexedByTypedef; if (typeDef) { checker_typeDefinition(typeDef, node.properties)(tag, ctx); } } return; } switch (node.properties.dispatcher) { case 'minecraft:entity': if (NbtCompoundNode.is(tag)) { const types = (EntityNode.is(dispatchedBy) || ResourceLocationNode.is(dispatchedBy)) ? getTypesFromEntity(dispatchedBy, ctx) : undefined; checker_index('minecraft:entity', types, { isPredicate: node.properties.isPredicate, isMerge: node.properties.isMerge, })(tag, ctx); } break; case 'minecraft:block': if (NbtCompoundNode.is(tag)) { checker_index('minecraft:block', undefined, { isPredicate: node.properties.isPredicate, isMerge: node.properties.isMerge, })(tag, ctx); } break; case 'minecraft:storage': if (NbtCompoundNode.is(tag)) { const storage = ResourceLocationNode.is(dispatchedBy) ? ResourceLocationNode.toString(dispatchedBy) : undefined; checker_index('minecraft:storage', storage, { isPredicate: node.properties.isPredicate, isMerge: node.properties.isMerge, })(tag, ctx); } break; } }; } function getListLikeChild(typeDef) { switch (typeDef.kind) { case 'list': return typeDef.item; case 'byte_array': return { kind: 'byte' }; case 'int_array': return { kind: 'int' }; case 'long_array': return { kind: 'long' }; case 'union': const members = typeDef.members .map(m => getListLikeChild(m)) .filter((m) => m !== undefined); if (members.length === 0) { return undefined; } if (members.length === 1) { return members[0]; } return { kind: 'union', members }; default: return undefined; } } function nbtPathChecker(dispatchedBy) { return (node, ctx) => { if (!node.properties) { return; } const path = node.children[0]; switch (node.properties.dispatcher) { case 'minecraft:entity': const types = (EntityNode.is(dispatchedBy) || ResourceLocationNode.is(dispatchedBy)) ? getTypesFromEntity(dispatchedBy, ctx) : undefined; checker_path('minecraft:entity', types)(path, ctx); break; case 'minecraft:block': checker_path('minecraft:block', undefined)(path, ctx); break; case 'minecraft:storage': const storage = ResourceLocationNode.is(dispatchedBy) ? ResourceLocationNode.toString(dispatchedBy) : undefined; checker_path('minecraft:storage', storage)(path, ctx); break; } }; } const particle = (node, ctx) => { const id = ResourceLocationNode.toString(node.id, 'short'); const release = ctx.project['loadedVersion']; if (release && ReleaseVersion.cmp(release, '1.20.5') < 0) { return; } const options = node.children?.find(NbtCompoundNode.is); if (options) { // Even if particle isn't explicitly marked as requiring options, // run the type checker anyways to allow an empty compound checker_index('minecraft:particle', ResourceLocation.lengthen(id))(options, ctx); } else if (ParticleNode.requiresOptions(id)) { ctx.err.report(localize('expected', localize('nbt.node.compound')), Range.create(node.id.range.end, node.id.range.end + 1)); } }; // #endregion function getTypesFromEntity(entity, ctx) { if (ResourceLocationNode.is(entity)) { const value = ResourceLocationNode.toString(entity, 'full', true); if (value.startsWith(ResourceLocation.TagPrefix)) { return getTagValues('tag/entity_type', value.slice(1), ctx); } else { return [value]; } } else if (entity.playerName !== undefined || entity.selector?.playersOnly) { return ['minecraft:player']; } else if (entity.selector) { const argumentsNode = entity.selector.arguments; if (!argumentsNode) { return undefined; } let types = undefined; for (const pairNode of argumentsNode.children) { if (pairNode.key?.value !== 'type') { continue; } const valueNode = pairNode.value; if (!valueNode || valueNode.inverted) { continue; } const value = ResourceLocationNode.toString(valueNode.value, 'full', true); if (value.startsWith(ResourceLocation.TagPrefix)) { const tagValues = getTagValues('tag/entity_type', value.slice(1), ctx); if (types === undefined) { types = tagValues.map(ResourceLocation.lengthen); } else { types = types.filter((t) => tagValues.includes(t)); } } else { types = [value]; } } return types; } return undefined; } function mcfunction_checker_register(meta) { meta.registerChecker('mcfunction:entry', checker_entry); meta.registerChecker('mcfunction:command', checker_command); meta.registerChecker('mcfunction:block', block); meta.registerChecker('mcfunction:entity', entity); meta.registerChecker('mcfunction:item_stack', itemStack); meta.registerChecker('mcfunction:item_predicate', itemPredicate); meta.registerChecker('mcfunction:particle', particle); } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/colorizer/index.js const objectiveCriterion = (node) => [ColorToken.create(node, 'type')]; const vector = (node) => { return [ColorToken.create(node, 'vector')]; }; function mcfunction_colorizer_register(meta) { meta.registerColorizer('mcfunction:coordinate', number); meta.registerColorizer('mcfunction:vector', vector); meta.registerColorizer('mcfunction:objective_criteria', objectiveCriterion); } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/common/index.js const ColorArgumentValues = [...Color.ColorNames, 'reset']; const EntityAnchorArgumentValues = ['feet', 'eyes']; const GamemodeArgumentValues = ['adventure', 'survival', 'creative', 'spectator']; function getItemSlotArgumentValues(ctx) { const release = ctx.project['loadedVersion']; const output = [ ...[...Array(54).keys()].map((n) => `container.${n}`), ...[...Array(27).keys()].map((n) => `enderchest.${n}`), ...[...Array(15).keys()].map((n) => `horse.${n}`), ...[...Array(9).keys()].map((n) => `hotbar.${n}`), ...[...Array(27).keys()].map((n) => `inventory.${n}`), ...[...Array(8).keys()].map((n) => `villager.${n}`), 'armor.chest', 'armor.feet', 'armor.head', 'armor.legs', 'horse.chest', 'weapon', 'weapon.mainhand', 'weapon.offhand', ]; if (ReleaseVersion.cmp(release, '1.20.5') >= 0) { output.push(...[...Array(4).keys()].map((n) => `player.crafting.${n}`), 'armor.body', 'contents', 'player.cursor'); } else { output.push('horse.armor'); } if (ReleaseVersion.cmp(release, '1.21.5') >= 0) { output.push('saddle'); } else { output.push('horse.saddle'); } return output; } // Only exists since 1.20.5 function getItemSlotsArgumentValues(ctx) { return [ ...getItemSlotArgumentValues(ctx), 'armor.*', 'container.*', 'enderchest.*', 'horse.*', 'hotbar.*', 'inventory.*', 'player.crafting.*', 'villager.*', 'weapon.*', ]; } const OperationArgumentValues = ['=', '+=', '-=', '*=', '/=', '%=', '<', '>', '><']; function getScoreboardSlotArgumentValues(ctx) { const release = ctx.project['loadedVersion']; return [ ReleaseVersion.cmp(release, '1.20.2') < 0 ? 'belowName' : 'below_name', 'list', 'sidebar', ...Color.ColorNames.map((n) => `sidebar.team.${n}`), ]; } const SwizzleArgumentValues = [ 'x', 'xy', 'xz', 'xyz', 'xzy', 'y', 'yx', 'yz', 'yxz', 'yzx', 'z', 'zx', 'zy', 'zxy', 'zyx', ]; const HeightmapValues = [ 'motion_blocking', 'motion_blocking_no_leaves', 'ocean_floor', 'world_surface', ]; const RotationValues = ['none', 'clockwise_90', '180', 'counterclockwise_90']; const MirrorValues = ['none', 'left_right', 'front_back']; //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/completer/argument.js const getMockNodes = (rawTreeNode, prevNodes, ctx) => { const range = ctx.offset; const treeNode = rawTreeNode; switch (treeNode.parser) { case 'brigadier:bool': return BooleanNode.mock(range); case 'brigadier:double': case 'brigadier:float': case 'brigadier:integer': case 'brigadier:long': case 'minecraft:float_range': case 'minecraft:message': case 'minecraft:time': case 'minecraft:uuid': return []; case 'brigadier:string': return treeNode.properties.type === 'phrase' ? StringNode.mock(range, BrigadierStringOptions) : []; case 'minecraft:angle': return CoordinateNode.mock(range); case 'minecraft:block_pos': return VectorNode.mock(range, { dimension: 3, integersOnly: true }); case 'minecraft:block_predicate': return BlockNode.mock(range, true); case 'minecraft:block_state': return BlockNode.mock(range, false); case 'minecraft:color': return LiteralNode.mock(range, { pool: ColorArgumentValues }); case 'minecraft:column_pos': return VectorNode.mock(range, { dimension: 2, integersOnly: true }); case 'minecraft:component': return [ JsonArrayNode.mock(range), JsonObjectNode.mock(range), JsonStringNode.mock(range), ]; case 'minecraft:dialog': return ResourceLocationNode.mock(range, { category: 'dialog' }); case 'minecraft:dimension': return ResourceLocationNode.mock(range, { category: 'dimension' }); case 'minecraft:entity': case 'minecraft:game_profile': return EntitySelectorNode.mock(range, { pool: EntitySelectorAtVariable.filterAvailable(ctx), }); case 'minecraft:heightmap': return LiteralNode.mock(range, { pool: HeightmapValues }); case 'minecraft:entity_anchor': return LiteralNode.mock(range, { pool: EntityAnchorArgumentValues }); case 'minecraft:entity_summon': return ResourceLocationNode.mock(range, { category: 'entity_type' }); case 'minecraft:function': return ResourceLocationNode.mock(range, { category: 'function' }); case 'minecraft:gamemode': return LiteralNode.mock(range, { pool: GamemodeArgumentValues }); case 'minecraft:int_range': return argument_IntRangeNode.mock(range); case 'minecraft:item_enchantment': return ResourceLocationNode.mock(range, { category: 'enchantment' }); case 'minecraft:item_predicate': return ItemPredicateNode.mock(range); case 'minecraft:item_slot': return LiteralNode.mock(range, { pool: getItemSlotArgumentValues(ctx) }); case 'minecraft:item_slots': return LiteralNode.mock(range, { pool: getItemSlotsArgumentValues(ctx) }); case 'minecraft:item_stack': return ItemStackNode.mock(range); case 'minecraft:loot_modifier': return ResourceLocationNode.mock(range, { category: 'item_modifier' }); case 'minecraft:loot_predicate': return ResourceLocationNode.mock(range, { category: 'predicate' }); case 'minecraft:loot_table': return ResourceLocationNode.mock(range, { category: 'loot_table' }); case 'minecraft:mob_effect': return ResourceLocationNode.mock(range, { category: 'mob_effect' }); case 'minecraft:objective': return SymbolNode.mock(range, { category: 'objective' }); case 'minecraft:objective_criteria': return ObjectiveCriteriaNode.mock(range); case 'minecraft:operation': return LiteralNode.mock(range, { pool: OperationArgumentValues, colorTokenType: 'operator', }); case 'minecraft:particle': return ParticleNode.mock(range); case 'minecraft:resource': case 'minecraft:resource_key': case 'minecraft:resource_or_tag': case 'minecraft:resource_or_tag_key': const allowTag = treeNode.parser === 'minecraft:resource_or_tag' || treeNode.parser === 'minecraft:resource_or_tag_key'; return ResourceLocationNode.mock(range, { category: ResourceLocation.shorten(treeNode.properties.registry), allowTag, }); case 'minecraft:resource_location': return ResourceLocationNode.mock(range, treeNode.properties ?? { pool: [], allowUnknown: true }); case 'minecraft:rotation': return VectorNode.mock(range, { dimension: 2, noLocal: true }); case 'minecraft:scoreboard_slot': return LiteralNode.mock(range, { pool: getScoreboardSlotArgumentValues(ctx) }); case 'minecraft:score_holder': return ScoreHolderNode.mock(range); case 'minecraft:style': return JsonObjectNode.mock(range); case 'minecraft:swizzle': return LiteralNode.mock(range, { pool: SwizzleArgumentValues }); case 'minecraft:team': return SymbolNode.mock(range, { category: 'team' }); case 'minecraft:template_mirror': return LiteralNode.mock(range, { pool: MirrorValues }); case 'minecraft:template_rotation': return LiteralNode.mock(range, { pool: RotationValues }); case 'minecraft:vec2': return VectorNode.mock(range, { dimension: 2, integersOnly: true }); case 'minecraft:vec3': return VectorNode.mock(range, { dimension: 3 }); case 'spyglassmc:criterion': const advancementNode = prevNodes.length > 0 ? prevNodes[prevNodes.length - 1].children[0] : undefined; if (ResourceLocationNode.is(advancementNode)) { return SymbolNode.mock(range, { category: 'advancement', subcategory: 'criterion', parentPath: [ResourceLocationNode.toString(advancementNode, 'full')], }); } return []; case 'spyglassmc:tag': return SymbolNode.mock(range, { category: 'tag' }); // ==== Unimplemented ==== case 'minecraft:nbt_compound_tag': case 'minecraft:nbt_path': case 'minecraft:nbt_tag': default: // Unknown parser. return []; } }; const argument_block = (node, ctx) => { const ans = []; if (Range.contains(node.id, ctx.offset, true)) { ans.push(...completer_builtin_resourceLocation(node.id, ctx)); } if (node.states?.innerRange && Range.contains(node.states.innerRange, ctx.offset, true)) { ans.push(...argument_blockStates(node.states, ctx)); } if (node.nbt?.innerRange && Range.contains(node.nbt.innerRange, ctx.offset, true)) { ans.push(...dispatch(node.nbt, ctx)); } return ans; }; const argument_blockStates = (node, ctx) => { if (!BlockNode.is(node.parent)) { return []; } const idNode = node.parent.id; const id = ResourceLocationNode.toString(idNode, 'full'); const blocks = idNode.isTag ? getTagValues('tag/block', id, ctx) : [id]; const states = getStates('block', blocks, ctx); return record({ key: (_record, pair, _ctx, range, insertValue, insertComma, existingKeys) => { return Object.keys(states).filter((k) => pair?.key?.value === k || !existingKeys.some((ek) => ek.value === k)).map((k) => CompletionItem.create(k, range, { kind: 10 /* CompletionKind.Property */, detail: localize('mcfunction.completer.block.states.default-value', localeQuote(states[k][0])), insertText: new InsertTextBuilder().literal(k).if(insertValue, (b) => b.literal('=').placeholder(...states[k])).if(insertComma, (b) => b.literal(',')).build(), })); }, value: (_record, pair, ctx) => { if (pair.key && states[pair.key.value]) { return states[pair.key.value].map((v) => CompletionItem.create(v, pair.value ?? ctx.offset, { kind: 12 /* CompletionKind.Value */ })); } return []; }, })(node, ctx); }; const componentList = (node, ctx) => { if (!node.innerRange || !Range.contains(node.innerRange, ctx.offset, true)) { return []; } const completeKey = (key) => { const id = key ?? ResourceLocationNode.mock(key ?? ctx.offset, { category: 'data_component_type' }); return completer_builtin_resourceLocation(id, ctx); }; const index = binarySearch(node.children, ctx.offset, (n, o) => Range.compareOffset(n.range, o, true)); const child = index >= 0 ? node.children[index] : undefined; if (!child) { return [ ...completer_builtin_literal(LiteralNode.mock(ctx.offset, { pool: ['!'] }), ctx), ...completeKey(undefined), ]; } if (child.type === 'mcfunction:component_removal') { return completeKey(child.key); } if ((child.key && Range.contains(child.key, ctx.offset, true))) { return completeKey(child.key); } if (child.value && Range.contains(child.value, ctx.offset, true)) { return dispatch(child.value, ctx); } return []; }; const componentTests = (node, ctx) => { // TODO: improve this completer const test = AstNode.findShallowestChild({ node: node, needle: ctx.offset, endInclusive: true, predicate: (n) => ComponentTestExactNode.is(n) || ComponentTestSubpredicateNode.is(n), }); if (test && ComponentTestExactNode.is(test) && test.value) { return dispatch(test.value, ctx); } else if (test && ComponentTestSubpredicateNode.is(test) && test.value) { return dispatch(test.value, ctx); } return []; }; const coordinate = (node, _ctx) => { return [CompletionItem.create('~', node)]; }; const argument_itemStack = (node, ctx) => { const ans = []; if (Range.contains(node.id, ctx.offset, true)) { ans.push(...completer_builtin_resourceLocation(node.id, ctx)); } if (node.components && Range.contains(node.components, ctx.offset, true)) { ans.push(...componentList(node.components, ctx)); } if (node.nbt && Range.contains(node.nbt, ctx.offset, true)) { ans.push(...dispatch(node.nbt, ctx)); } return ans; }; const argument_itemPredicate = (node, ctx) => { const ans = []; if (Range.contains(node.id, ctx.offset, true)) { ans.push(CompletionItem.create('*', node, { sortText: '##' })); if (node.id.type === 'resource_location') { ans.push(...completer_builtin_resourceLocation(node.id, ctx)); } } if (node.tests && Range.contains(node.tests, ctx.offset, true)) { ans.push(...componentTests(node.tests, ctx)); } if (node.nbt && Range.contains(node.nbt, ctx.offset, true)) { ans.push(...dispatch(node.nbt, ctx)); } return ans; }; const objectiveCriteria = (node, ctx) => { const ans = ObjectiveCriteriaNode.SimpleValues.map((v) => CompletionItem.create(v, node)); if (!node.children?.[0] || Range.contains(node.children[0], ctx.offset, true)) { ans.push(...completer_builtin_resourceLocation(node.children?.[0] ?? ResourceLocationNode.mock(node, { category: 'stat_type', namespacePathSep: '.' }), ctx)); } if (node.children?.[1] && Range.contains(node.children[1], ctx.offset, true)) { ans.push(...completer_builtin_resourceLocation(node.children[1], ctx)); } return ans; }; const argument_particle = (node, ctx) => { const child = AstNode.findChild(node, ctx.offset, true); if (child) { return dispatch(child, ctx); } const release = ctx.project['loadedVersion']; if (!release || ReleaseVersion.cmp(release, '1.20.5') >= 0) { return []; } const id = ResourceLocationNode.toString(node.id, 'short'); const map = { block: [BlockNode.mock(ctx.offset, false)], block_marker: [BlockNode.mock(ctx.offset, false)], dust: [VectorNode.mock(ctx.offset, { dimension: 3 }), FloatNode.mock(ctx.offset)], dust_color_transition: [ VectorNode.mock(ctx.offset, { dimension: 3 }), FloatNode.mock(ctx.offset), VectorNode.mock(ctx.offset, { dimension: 3 }), ], falling_dust: [BlockNode.mock(ctx.offset, false)], item: [ItemStackNode.mock(ctx.offset)], sculk_charge: [FloatNode.mock(ctx.offset)], shriek: [IntegerNode.mock(ctx.offset)], vibration: [ VectorNode.mock(ctx.offset, { dimension: 3 }), VectorNode.mock(ctx.offset, { dimension: 3 }), IntegerNode.mock(ctx.offset), ], }; if (ParticleNode.isSpecialType(id)) { const numParamsBefore = node.children?.slice(1).filter((n) => n.range.end < ctx.offset).length ?? 0; const mock = map[id][numParamsBefore]; if (mock) { return dispatch(mock, ctx); } } return []; }; const scoreHolder = (node, ctx) => { let ans; if (node.selector && Range.contains(node.selector, ctx.offset, true)) { ans = selector(node.selector, ctx); if (Range.contains(node.children[0], ctx.offset, true)) { ans.push(...completer_builtin_symbol(SymbolNode.mock(node, { category: 'score_holder' }), ctx)); } } else { ans = completer_builtin_symbol(node.fakeName ?? SymbolNode.mock(node, { category: 'score_holder' }), ctx); ans.push(...completer_builtin_literal(LiteralNode.mock(node, { pool: ['*'] }), ctx), ...selector(EntitySelectorNode.mock(node, { pool: EntitySelectorAtVariable.filterAvailable(ctx) }), ctx)); } return ans; }; const selector = (node, ctx) => { if (Range.contains(node.children[0], ctx.offset, true)) { return completer_builtin_literal(node.children[0], ctx); } if (node.arguments?.innerRange && Range.contains(node.arguments.innerRange, ctx.offset, true)) { return selectorArguments(node.arguments, ctx); } return []; }; const selectorArguments = (node, ctx) => { const selector = node.parent; if (!EntitySelectorNode.is(selector)) { return []; } return record({ key: (record, pair, _ctx, range, insertValue, insertComma) => { return [...EntitySelectorNode.ArgumentKeys].filter((k) => EntitySelectorNode.canKeyExist(selector, record, k) === 0 /* EntitySelectorNode.Result.Ok */).map((k) => CompletionItem.create(k, range, { kind: 10 /* CompletionKind.Property */, insertText: new InsertTextBuilder().literal(k).if(insertValue, (b) => b.literal('=').placeholder()) // TODO .if(insertComma, (b) => b.literal(',')).build(), })); }, value: (_record, pair, ctx) => { if (pair.value) { return dispatch(pair.value, ctx); } return []; }, })(node, ctx); }; const argument_intRange = (node, _ctx) => { return [ CompletionItem.create('-2147483648..2147483647', node, { kind: 21 /* CompletionKind.Constant */ }), ]; }; const argument_vector = (node, _ctx) => { const createCompletion = (coordinate, sortText) => CompletionItem.create(new Array(node.options.dimension).fill(coordinate).join(' '), node, { sortText, }); const ans = []; ans.push(createCompletion('~', 'a')); if (!node.options.noLocal) { ans.push(createCompletion('^', 'b')); } ans.push(createCompletion('0.0', 'c')); return ans; }; function argument_register(meta) { meta.registerCompleter('mcfunction:block', argument_block); meta.registerCompleter('mcfunction:component_list', componentList); meta.registerCompleter('mcfunction:component_tests', componentTests); meta.registerCompleter('mcfunction:coordinate', coordinate); meta.registerCompleter('mcfunction:entity_selector', selector); meta.registerCompleter('mcfunction:entity_selector/arguments', selectorArguments); meta.registerCompleter('mcfunction:int_range', argument_intRange); meta.registerCompleter('mcfunction:item_stack', argument_itemStack); meta.registerCompleter('mcfunction:item_predicate', argument_itemPredicate); meta.registerCompleter('mcfunction:objective_criteria', objectiveCriteria); meta.registerCompleter('mcfunction:particle', argument_particle); meta.registerCompleter('mcfunction:score_holder', scoreHolder); meta.registerCompleter('mcfunction:vector', argument_vector); } //# sourceMappingURL=argument.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/completer/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/inlayHintProvider.js const inlayHintProvider = (node, ctx) => { if (node.children[0]?.type !== 'mcfunction:entry') { return []; } const ans = []; traversePreOrder(node, (_) => true, CommandChildNode.is, (n) => { const node = n; const config = ctx.config.env.feature.inlayHint; if (config === true || (typeof config === 'object' && config.enabledNodes.includes(node.children[0].type))) { ans.push({ offset: node.range.start, label: `${node.path[node.path.length - 1]}:`, paddingRight: true, }); } }); return ans; }; //# sourceMappingURL=inlayHintProvider.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/parser/argument.js const IntegerPattern = /^-?\d+$/; /** * A combination of: * - https://github.com/Mojang/brigadier/blob/cf754c4ef654160dca946889c11941634c5db3d5/src/main/java/com/mojang/brigadier/StringReader.java#L137 * - https://docs.oracle.com/javase/7/docs/api/java/lang/Double.html#valueOf(java.lang.String) * * i.e. Only `[0-9\.\-]` is allowed in the number, and its format must follow The Java™ Language Specification. * * i.e. * ``` * [NegativeSign] Digits [`.`] [Digits] | * [NegativeSign] `.` Digits * ``` */ const FloatPattern = /^-?(?:\d+\.?\d*|\.\d+)$/; const DoubleMax = Number.MAX_VALUE; const DoubleMin = -DoubleMax; const FloatMax = (2 - 2 ** -23) * 2 ** 127; const FloatMin = -FloatMax; const IntegerMax = 2 ** 31 - 1; const IntegerMin = -(2 ** 31); const LongMax = 9223372036854775807n; const LongMin = -9223372036854775808n; const FakeNameMaxLength = 40; const ObjectiveMaxLength = 16; const PlayerNameMaxLength = 16; function shouldValidateLength(ctx) { const release = ctx.project['loadedVersion']; return !release || ReleaseVersion.cmp(release, '1.18') < 0; } function shouldUseOldItemStackFormat(ctx) { const release = ctx.project['loadedVersion']; return !release || ReleaseVersion.cmp(release, '1.20.5') < 0; } /** * @returns The parser for the specified argument tree node. All argument parsers used in the `mcfunction` package * fail on empty input. */ const argument = (rawTreeNode, prevNodes) => { const treeNode = rawTreeNode; const wrap = (parser) => failOnEmpty(stopBefore(parser, '\r', '\n')); switch (treeNode.parser) { case 'brigadier:bool': return wrap(boolean_boolean); case 'brigadier:double': return wrap(argument_double(treeNode.properties?.min, treeNode.properties?.max)); case 'brigadier:float': return wrap(argument_float(treeNode.properties?.min, treeNode.properties?.max)); case 'brigadier:integer': return wrap(argument_integer(treeNode.properties?.min, treeNode.properties?.max)); case 'brigadier:long': return wrap(argument_long(treeNode.properties?.min, treeNode.properties?.max)); case 'brigadier:string': switch (treeNode.properties.type) { case 'word': return wrap(unquotedString); case 'phrase': return wrap(brigadierString); case 'greedy': default: return wrap(greedyString); } case 'minecraft:angle': return wrap(validate(argument_coordinate(), (res) => res.notation !== '^', localize('mcfunction.parser.vector.local-disallowed'))); case 'minecraft:block_pos': return wrap(parser_argument_vector({ dimension: 3, integersOnly: true })); case 'minecraft:block_predicate': return wrap(blockPredicate); case 'minecraft:block_state': return wrap(blockState); case 'minecraft:color': return wrap(util_map(commandLiteral({ pool: ColorArgumentValues }), (res) => ({ ...res, color: Color.NamedColors.has(res.value) ? Color.fromCompositeRGB(Color.NamedColors.get(res.value)) : undefined, }))); case 'minecraft:column_pos': return wrap(parser_argument_vector({ dimension: 2, integersOnly: true })); case 'minecraft:component': return wrap(typeRefParser('::java::server::util::text::Text')); case 'minecraft:dialog': return wrap(resourceOrInline('dialog')); case 'minecraft:dimension': return wrap(resourceLocation_resourceLocation({ category: 'dimension' })); case 'minecraft:entity': return wrap(argument_entity(treeNode.properties.amount, treeNode.properties.type)); case 'minecraft:entity_anchor': return wrap(commandLiteral({ pool: EntityAnchorArgumentValues })); case 'minecraft:entity_summon': return wrap(resourceLocation_resourceLocation({ category: 'entity_type' })); case 'minecraft:float_range': return wrap(argument_range('float', treeNode.properties?.min, treeNode.properties?.max, treeNode.properties?.minSpan, treeNode.properties?.maxSpan)); case 'minecraft:function': return wrap(resourceLocation_resourceLocation({ category: 'function', allowTag: true })); case 'minecraft:gamemode': return wrap(commandLiteral({ pool: GamemodeArgumentValues })); case 'minecraft:game_profile': return wrap(argument_entity('multiple', 'players')); case 'minecraft:heightmap': return wrap(commandLiteral({ pool: HeightmapValues })); case 'minecraft:int_range': return wrap(argument_range('integer', treeNode.properties?.min, treeNode.properties?.max, treeNode.properties?.minSpan, treeNode.properties?.maxSpan)); case 'minecraft:item_enchantment': return wrap(resourceLocation_resourceLocation({ category: 'enchantment' })); case 'minecraft:item_predicate': return wrap(parser_argument_itemPredicate); case 'minecraft:item_slot': return wrap((src, ctx) => { return commandLiteral({ pool: getItemSlotArgumentValues(ctx) })(src, ctx); }); case 'minecraft:item_slots': return wrap((src, ctx) => { return commandLiteral({ pool: getItemSlotsArgumentValues(ctx) })(src, ctx); }); case 'minecraft:item_stack': return wrap(parser_argument_itemStack); case 'minecraft:loot_modifier': return wrap(resourceOrInline('item_modifier')); case 'minecraft:loot_predicate': return wrap(resourceOrInline('predicate')); case 'minecraft:loot_table': return wrap(resourceOrInline('loot_table')); case 'minecraft:message': return wrap(message); case 'minecraft:mob_effect': return wrap(resourceLocation_resourceLocation({ category: 'mob_effect' })); case 'minecraft:nbt_compound_tag': return wrap(nbtDispatchedParser(compound_compound, treeNode.properties)); case 'minecraft:nbt_path': return wrap(nbtPathParser(path_path, treeNode.properties)); case 'minecraft:nbt_tag': return wrap(nbtDispatchedParser(entry_entry, treeNode.properties)); case 'minecraft:objective': return wrap(objective(SymbolUsageType.is(treeNode.properties?.usageType) ? treeNode.properties?.usageType : undefined)); case 'minecraft:objective_criteria': return wrap(argument_objectiveCriteria); case 'minecraft:operation': return wrap(commandLiteral({ pool: OperationArgumentValues, colorTokenType: 'operator' })); case 'minecraft:particle': return wrap(parser_argument_particle); case 'minecraft:resource': case 'minecraft:resource_key': case 'minecraft:resource_or_tag': case 'minecraft:resource_or_tag_key': const allowTag = treeNode.parser === 'minecraft:resource_or_tag' || treeNode.parser === 'minecraft:resource_or_tag_key'; return wrap(resourceLocation_resourceLocation({ category: ResourceLocation.shorten(treeNode.properties.registry), allowTag, })); case 'minecraft:resource_location': return wrap(resourceLocation_resourceLocation(treeNode.properties ?? { pool: [], allowUnknown: true })); case 'minecraft:resource_selector': return wrap(resourceSelector(treeNode.properties.registry)); case 'minecraft:rotation': return wrap(parser_argument_vector({ dimension: 2, noLocal: true })); case 'minecraft:score_holder': return wrap(argument_scoreHolder(treeNode.properties.usageType, treeNode.properties.amount)); case 'minecraft:scoreboard_slot': // `BELOWNAME` and `sidebar.team.r--.+++e----__d` are also legal slots. // But I do not want to spend time supporting them. return wrap((src, ctx) => { return commandLiteral({ pool: getScoreboardSlotArgumentValues(ctx) })(src, ctx); }); case 'minecraft:style': return wrap(typeRefParser('::java::server::util::text::TextStyle')); case 'minecraft:swizzle': return wrap(commandLiteral({ pool: SwizzleArgumentValues })); case 'minecraft:team': return wrap(team(SymbolUsageType.is(treeNode.properties?.usageType) ? treeNode.properties?.usageType : undefined)); case 'minecraft:template_mirror': return wrap(commandLiteral({ pool: MirrorValues })); case 'minecraft:template_rotation': return wrap(commandLiteral({ pool: RotationValues })); case 'minecraft:time': return wrap(time); case 'minecraft:uuid': return wrap(uuid); case 'minecraft:vec2': return wrap(parser_argument_vector({ dimension: 2, noLocal: true })); case 'minecraft:vec3': return wrap(parser_argument_vector({ dimension: 3 })); case 'spyglassmc:criterion': const advancementNode = prevNodes.length > 0 ? prevNodes[prevNodes.length - 1].children[0] : undefined; if (ResourceLocationNode.is(advancementNode)) { return wrap(criterion(ResourceLocationNode.toString(advancementNode, 'full'), SymbolUsageType.is(treeNode.properties?.usageType) ? treeNode.properties?.usageType : undefined)); } return wrap(greedyString); case 'spyglassmc:tag': return wrap(tag(SymbolUsageType.is(treeNode.properties?.usageType) ? treeNode.properties?.usageType : undefined)); default: // Unknown parser. return undefined; } }; function parser_argument_block(isPredicate) { return util_map(sequence([ resourceLocation_resourceLocation({ category: 'block', allowTag: isPredicate }), optional(util_map(failOnEmpty(record_record({ start: '[', pair: { key: string_string({ ...BrigadierStringOptions, colorTokenType: 'property', }), sep: '=', value: brigadierString, end: ',', trailingEnd: true, }, end: ']', })), (res) => ({ ...res, type: 'mcfunction:block/states' }))), optional(failOnEmpty(compound_compound)), ]), (res) => { const ans = { type: 'mcfunction:block', range: res.range, children: res.children, id: res.children.find(ResourceLocationNode.is), states: res.children.find(BlockStatesNode.is), nbt: res.children.find(NbtCompoundNode.is), isPredicate, }; return ans; }); } const blockState = parser_argument_block(false); const blockPredicate = parser_argument_block(true); function argument_double(min = DoubleMin, max = DoubleMax) { return float_float({ pattern: FloatPattern, min, max }); } function argument_float(min = FloatMin, max = FloatMax) { return float_float({ pattern: FloatPattern, min, max }); } function argument_integer(min = IntegerMin, max = IntegerMax) { return integer_integer({ pattern: IntegerPattern, min, max }); } function argument_long(min, max) { return long_long({ pattern: IntegerPattern, min: BigInt(min ?? LongMin), max: BigInt(max ?? LongMax), }); } function argument_coordinate(integerOnly = false) { return (src, ctx) => { const ans = { type: 'mcfunction:coordinate', notation: '', range: Range.create(src), value: 0, }; if (src.trySkip('^')) { ans.notation = '^'; } else if (src.trySkip('~')) { ans.notation = '~'; } if ((src.canReadInLine() && src.peek() !== ' ') || ans.notation === '') { const result = (integerOnly && ans.notation === '' ? argument_integer : argument_double)()(src, ctx); ans.value = Number(result.value); } ans.range.end = src.cursor; return ans; }; } function criterion(advancement, usageType, terminators = []) { return unquotableSymbol({ category: 'advancement', subcategory: 'criterion', parentPath: [advancement], usageType }, terminators); } function argument_entity(amount, type) { return util_map(util_select([{ predicate: (src) => src.peek() === '@', parser: argument_selector() }, { parser: util_any([ failOnError(uuid), validateLength(brigadierString, PlayerNameMaxLength, 'mcfunction.parser.entity-selector.player-name.too-long'), ]), }]), (res, _src, ctx) => { const ans = { type: 'mcfunction:entity', range: res.range, children: [res] }; if (StringNode.is(res)) { ans.playerName = res; } else if (EntitySelectorNode.is(res)) { ans.selector = res; } else { ans.uuid = res; } if (amount === 'single' && ans.selector && !ans.selector.single) { ctx.err.report(localize('mcfunction.parser.entity-selector.multiple-disallowed'), ans); } if (type === 'players' && (ans.uuid || (ans.selector && !ans.selector.playersOnly && !ans.selector.currentEntity))) { ctx.err.report(localize('mcfunction.parser.entity-selector.entities-disallowed'), ans); } return ans; }); } const greedyString = string_string({ unquotable: { blockList: new Set(['\n', '\r']) }, }); const parser_argument_itemStack = (src, ctx) => { const oldFormat = shouldUseOldItemStackFormat(ctx); return util_map(sequence([ resourceLocation_resourceLocation({ category: 'item' }), oldFormat ? optional(failOnEmpty(compound_compound)) : optional(failOnEmpty(components)), ]), (res) => { const ans = { type: 'mcfunction:item_stack', range: res.range, children: res.children, id: res.children.find(ResourceLocationNode.is), components: res.children.find(ComponentListNode.is), nbt: res.children.find(NbtCompoundNode.is), }; return ans; })(src, ctx); }; const parser_argument_itemPredicate = (src, ctx) => { const oldFormat = shouldUseOldItemStackFormat(ctx); return util_map(sequence([ oldFormat ? resourceLocation_resourceLocation({ category: 'item', allowTag: true }) : util_any([ resourceLocation_resourceLocation({ category: 'item', allowTag: true }), literal('*'), ]), oldFormat ? optional(failOnEmpty(compound_compound)) : optional(argument_componentTests), ]), (res) => { const ans = { type: 'mcfunction:item_predicate', range: res.range, children: res.children, id: (res.children.find(ResourceLocationNode.is) || res.children.find(LiteralNode.is)), tests: res.children.find(ComponentTestsNode.is), nbt: res.children.find(NbtCompoundNode.is), }; return ans; })(src, ctx); }; function typeRefParser(typeRef) { return (src, ctx) => { const release = ctx.project['loadedVersion']; if (!release || ReleaseVersion.cmp(release, '1.21.5') < 0) { return jsonParser(typeRef)(src, ctx); } return nbtParser(typeRef)(src, ctx); }; } function jsonParser(typeRef) { return util_map(entry, (res) => ({ type: 'json:typed', range: res.range, children: [res], targetType: { kind: 'reference', path: typeRef }, })); } function nbtParser(typeRef) { return util_map(entry_entry, (res) => ({ type: 'nbt:typed', range: res.range, children: [res], targetType: { kind: 'reference', path: typeRef }, })); } function commandLiteral(options) { return (src, ctx) => { const ans = literal(options)(src, ctx); if (ans.value.length === 0) { ans.value = src.readUntil(...Whitespaces); ans.range = Range.create(ans.range.start, src); } return ans; }; } const message = (src, ctx) => { const ans = { type: 'mcfunction:message', range: Range.create(src), children: [], }; while (src.canReadInLine()) { if (EntitySelectorAtVariable.is(src.peek(2))) { ans.children.push(argument_selector(true)(src, ctx)); } else { ans.children.push(stopBefore(greedyString, ...EntitySelectorAtVariable.filterAvailable(ctx))(src, ctx)); } } return ans; }; function nbtDispatchedParser(parser, properties) { return util_map(parser, (res) => { const ans = { type: 'mcfunction:nbt', range: res.range, children: [res], properties }; return ans; }); } function nbtPathParser(parser, properties) { return util_map(parser, (res) => { const ans = { type: 'mcfunction:nbt_path', range: res.range, children: [res], properties, }; return ans; }); } const parser_argument_particle = (src, ctx) => { const release = ctx.project['loadedVersion']; if (!release || ReleaseVersion.cmp(release, '1.20.5') >= 0) { return util_map(sequence([ resourceLocation_resourceLocation({ category: 'particle_type' }), optional(failOnEmpty(compound_compound)), ]), (res) => { const ans = { type: 'mcfunction:particle', range: res.range, children: res.children, id: res.children.find(ResourceLocationNode.is), }; return ans; })(src, ctx); } const sep = util_map(common_sep, () => []); const vec = parser_argument_vector({ dimension: 3 }); const color = util_map(vec, (res) => ({ ...res, color: res.children.length === 3 ? { value: Color.fromDecRGB(res.children[0].value, res.children[1].value, res.children[2].value), format: [ColorFormat.DecRGB], } : undefined, })); const map = { block: blockState, block_marker: blockState, dust: sequence([color, argument_float()], sep), dust_color_transition: sequence([color, argument_float(), color], sep), falling_dust: blockState, item: parser_argument_itemStack, sculk_charge: argument_float(), shriek: argument_integer(), vibration: sequence([vec, argument_integer()], sep), }; return util_map(sequence([resourceLocation_resourceLocation({ category: 'particle_type' }), { get: (res) => { return map[ResourceLocationNode.toString(res.children[0], 'short')]; }, }], sep), (res) => { const ans = { type: 'mcfunction:particle', range: res.range, children: res.children, id: res.children.find(ResourceLocationNode.is), }; return ans; })(src, ctx); }; function argument_range(type, min, max, minSpan, maxSpan, cycleable) { const number = type === 'float' ? argument_float(min, max) : argument_integer(min, max); const low = failOnEmpty(stopBefore(number, '..')); const sep = failOnEmpty(literal({ pool: ['..'], colorTokenType: 'keyword' })); const high = failOnEmpty(number); return util_map(util_any([ /* exactly */ sequence([low]), /* atLeast */ sequence([low, sep]), /* atMost */ sequence([sep, high]), /* between */ sequence([low, sep, high]), ]), (res, _src, ctx) => { const valueNodes = type === 'float' ? res.children.filter(FloatNode.is) : res.children.filter(IntegerNode.is); const sepNode = res.children.find(LiteralNode.is); const ans = { type: type === 'float' ? 'mcfunction:float_range' : 'mcfunction:int_range', range: res.range, children: res.children, value: sepNode ? valueNodes.length === 2 ? [valueNodes[0].value, valueNodes[1].value] : Range.endsBefore(valueNodes[0].range, sepNode.range.start) ? [valueNodes[0].value, undefined] : [undefined, valueNodes[0].value] : [valueNodes[0].value, valueNodes[0].value], }; if (!cycleable && ans.value[0] !== undefined && ans.value[1] !== undefined && ans.value[0] > ans.value[1]) { ctx.err.report(localize('mcfunction.parser.range.min>max', ans.value[0], ans.value[1]), res); } else if (minSpan !== undefined || maxSpan !== undefined) { const span = ans.value[0] !== undefined && ans.value[1] !== undefined ? Math.abs(ans.value[0] - ans.value[1]) : (ans.value[0] ?? ans.value[1] ?? Infinity); if (minSpan !== undefined && span < minSpan) { ctx.err.report(localize('mcfunction.parser.range.span-too-small', span, minSpan), res); } else if (maxSpan !== undefined && span > maxSpan) { ctx.err.report(localize('mcfunction.parser.range.span-too-large', span, maxSpan), res); } } return ans; }); } function resourceOrInline(category) { return util_select([{ predicate: (src) => LegalResourceLocationCharacters.has(src.peek()), parser: resourceLocation_resourceLocation({ category }), }, { parser: util_map(entry_entry, (res) => { const ans = { type: 'mcfunction:nbt_resource', range: res.range, children: [res], category, }; return ans; }), }]); } const LegalResourceSelectorCharacters = new Set([ ...LegalResourceLocationCharacters, ':', '/', '*', '?', ]); function resourceSelector(registry) { return string_string({ colorTokenType: 'resourceLocation', unquotable: { allowList: LegalResourceSelectorCharacters }, }); } function selectorPrefix(ignoreInvalidPrefix) { return (src, ctx) => { const start = src.cursor; let value; if (ignoreInvalidPrefix) { value = src.peek(2); src.skip(2); } else { value = src.readUntil(' ', '\r', '\n', '['); } const allowedVariables = EntitySelectorAtVariable.filterAvailable(ctx); const ans = { type: 'literal', range: Range.create(start, src), options: { pool: allowedVariables }, value, }; if (!allowedVariables.includes(value) && !ignoreInvalidPrefix) { ctx.err.report(localize('mcfunction.parser.entity-selector.invalid', ans.value), ans); } return ans; }; } /** * Failure when not beginning with `@[parse]` */ function argument_selector(ignoreInvalidPrefix = false) { let chunkLimited; let currentEntity; let dimensionLimited; let playersOnly; let predicates; let single; let typeLimited; return util_map(sequence([failOnEmpty(selectorPrefix(ignoreInvalidPrefix)), { get: (res) => { const variable = LiteralNode.is(res.children?.[0]) ? res.children[0].value : undefined; currentEntity = variable ? variable === '@s' : undefined; playersOnly = variable ? variable === '@p' || variable === '@a' || variable === '@r' : undefined; predicates = variable === '@e' ? ['Entity::isAlive'] : undefined; single = variable ? ['@p', '@r', '@s', '@n'].includes(variable) : undefined; typeLimited = playersOnly; function invertable(parser) { return util_map(sequence([ optional(failOnEmpty(literal({ pool: ['!'], colorTokenType: 'keyword' }))), (src) => { src.skipSpace(); return undefined; }, parser, ]), (res) => { const ans = { type: 'mcfunction:entity_selector/arguments/value/invertable', range: res.range, children: res.children, inverted: !!res.children.find((n) => LiteralNode.is(n) && n.value === '!'), value: res.children.find((n) => !LiteralNode.is(n) || n.value !== '!'), }; return ans; }); } return optional(util_map(failOnEmpty(record_record({ start: '[', pair: { key: string_string({ ...BrigadierStringOptions, value: { parser: literal({ pool: [...EntitySelectorNode.ArgumentKeys], colorTokenType: 'property', }), type: 'literal', }, }), sep: '=', value: { get: (record, key) => { const hasKey = (key) => !!record.children.find((p) => p.key?.value === key); const hasNonInvertedKey = (key) => !!record.children.find((p) => p.key?.value === key && !p.value?.inverted); switch (key?.value) { case 'advancements': return util_map(record_record({ start: '{', pair: { key: resourceLocation_resourceLocation({ category: 'advancement', }), sep: '=', value: { get: (_, key) => util_select([{ predicate: (src) => src.peek() === '{', parser: util_map(record_record({ start: '{', pair: { key: key ? criterion(ResourceLocationNode .toString(key, 'full'), 'reference', ['}', ',', '=']) : unquotedString, sep: '=', value: boolean_boolean, end: ',', trailingEnd: true, }, end: '}', }), (res) => { const ans = { ...res, type: 'mcfunction:entity_selector/arguments/advancements/criteria', }; return ans; }), }, { parser: boolean_boolean }]), }, end: ',', trailingEnd: true, }, end: '}', }), (res, _, ctx) => { if (hasKey(key.value)) { ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); } const ans = { ...res, type: 'mcfunction:entity_selector/arguments/advancements', }; return ans; }); case 'distance': return util_map(argument_range('float', 0), (res, _, ctx) => { dimensionLimited = true; // x, y, z, dx, dy, dz take precedence over distance, so we use ??= instead of = to ensure it won't override the result. chunkLimited ??= !playersOnly && res.value[1] !== undefined; if (hasKey(key.value)) { ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); } return res; }); case 'gamemode': return util_map(invertable(string_string({ unquotable: BrigadierUnquotableOption, value: { type: 'literal', parser: literal(...GamemodeArgumentValues), }, })), (res, _, ctx) => { playersOnly = true; if (res.inverted ? hasNonInvertedKey(key.value) : hasKey(key.value)) { ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); } return res; }); case 'limit': return util_map(argument_integer(0), (res, _, ctx) => { single = res.value <= 1; if (hasKey(key.value)) { ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); } if (currentEntity) { ctx.err.report(localize('mcfunction.parser.entity-selector.arguments.not-applicable', localeQuote(key.value)), key); } return res; }); case 'level': return util_map(argument_range('integer', 0), (res, _, ctx) => { playersOnly = true; if (hasKey(key.value)) { ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); } return res; }); case 'name': return util_map(invertable(brigadierString), (res, _, ctx) => { if (res.inverted ? hasNonInvertedKey(key.value) : hasKey(key.value)) { ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); } return res; }); case 'nbt': return invertable(compound_compound); case 'predicate': return invertable(resourceLocation_resourceLocation({ category: 'predicate' })); case 'scores': return util_map(record_record({ start: '{', pair: { key: objective('reference', [ '[', '=', ',', ']', '{', '}', ]), sep: '=', value: argument_range('integer'), end: ',', trailingEnd: true, }, end: '}', }), (res, _, ctx) => { if (hasKey(key.value)) { ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); } const ans = { ...res, type: 'mcfunction:entity_selector/arguments/scores', }; return ans; }); case 'sort': return util_map(string_string({ unquotable: BrigadierUnquotableOption, value: { type: 'literal', parser: literal('arbitrary', 'furthest', 'nearest', 'random'), }, }), (res, _, ctx) => { if (hasKey(key.value)) { ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); } if (currentEntity) { ctx.err.report(localize('mcfunction.parser.entity-selector.arguments.not-applicable', localeQuote(key.value)), key); } return res; }); case 'tag': return invertable(tag('reference', ['[', '=', ',', ']', '{', '}'])); case 'team': return util_map(invertable(team('reference', ['[', '=', ',', ']', '{', '}'])), (res, _, ctx) => { if (res.inverted ? hasNonInvertedKey(key.value) : hasKey(key.value)) { ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); } return res; }); case 'type': return util_map(invertable(resourceLocation_resourceLocation({ category: 'entity_type', allowTag: true, })), (res, _, ctx) => { if (typeLimited) { if (hasKey(key.value)) { ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); } else { ctx.err.report(localize('mcfunction.parser.entity-selector.arguments.not-applicable', localeQuote(key.value)), key); } } else if (!res.inverted && !res.value.isTag) { typeLimited = true; if (ResourceLocationNode.toString(res.value, 'short') === 'player') { playersOnly = true; } } return res; }); case 'x': case 'y': case 'z': return util_map(argument_double(), (res, _, ctx) => { dimensionLimited = true; if (hasKey(key.value)) { ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); } return res; }); case 'dx': case 'dy': case 'dz': return util_map(argument_double(), (res, _, ctx) => { dimensionLimited = true; chunkLimited = !playersOnly; if (hasKey(key.value)) { ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); } return res; }); case 'x_rotation': case 'y_rotation': return util_map(argument_range('float', undefined, undefined, undefined, undefined, true), (res, _, ctx) => { if (hasKey(key.value)) { ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); } return res; }); case undefined: // The key is empty. Let's just fail the value as well. return () => Parser_Failure; default: // The key is unknown. return (_src, ctx) => { ctx.err.report(localize('mcfunction.parser.entity-selector.arguments.unknown', localeQuote(key.value)), key); return Parser_Failure; }; } }, }, end: ',', trailingEnd: true, }, end: ']', })), (res) => { const ans = { ...res, type: 'mcfunction:entity_selector/arguments', }; return ans; })); }, }]), (res) => { const ans = { type: 'mcfunction:entity_selector', range: res.range, children: res.children, variable: res.children.find(LiteralNode.is).value.slice(1), arguments: res.children.find(EntitySelectorArgumentsNode.is), chunkLimited, currentEntity, dimensionLimited, playersOnly, predicates, single, typeLimited, }; ans.hover = getEntitySelectorHover(ans); return ans; }); } // This is more like a proof-of-concept. // Might not make into the actual release. function getEntitySelectorHover(node) { const grades = new Map([ [0, '🤢'], // Bad [1, '😅'], // Normal [2, 'Good'], // Good [3, 'Great'], // Great [4, '😌👌'], // Excellent ]); let ans; if (node.currentEntity) { ans = `**Performance**: ${grades.get(4)} - \`currentEntity\`: \`${node.currentEntity}\``; } else { const amountOfTrue = [node.chunkLimited, node.dimensionLimited, node.playersOnly, node.typeLimited].filter((v) => v).length; ans = `**Performance**: ${grades.get(amountOfTrue)} - \`chunkLimited\`: \`${!!node.chunkLimited}\` - \`dimensionLimited\`: \`${!!node.dimensionLimited}\` - \`playersOnly\`: \`${!!node.playersOnly}\` - \`typeLimited\`: \`${!!node.typeLimited}\``; } if (node.predicates?.length) { ans += ` ------ **Predicates**: ${node.predicates.map((p) => `- \`${p}\``).join('\n')}`; } return ans; } function scoreHolderFakeName(usageType) { return validateLength(argument_symbol({ category: 'score_holder', usageType }), FakeNameMaxLength, 'mcfunction.parser.score_holder.fake-name.too-long'); } function argument_scoreHolder(usageType, amount) { return util_map(util_select([ { predicate: (src) => src.peek() === '*' && (!src.canRead(2) || src.matchPattern(/^\s/, 1)), parser: literal('*'), }, { prefix: '@', parser: argument_selector() }, { parser: scoreHolderFakeName(usageType) }, ]), (res, _src, ctx) => { const ans = { type: 'mcfunction:score_holder', range: res.range, children: [res], }; if (SymbolNode.is(res)) { ans.fakeName = res; } else if (EntitySelectorNode.is(res)) { ans.selector = res; } else { ans.wildcard = res; } if (amount === 'single' && ans.selector && !ans.selector.single) { ctx.err.report(localize('mcfunction.parser.entity-selector.multiple-disallowed'), ans); } return ans; }); } function argument_symbol(options, terminators = []) { return stopBefore(symbol_symbol(options), Whitespaces, terminators); } function objective(usageType, terminators = []) { return validateLength(unquotableSymbol({ category: 'objective', usageType }, terminators), ObjectiveMaxLength, 'mcfunction.parser.objective.too-long'); } const argument_objectiveCriteria = util_map(util_any([ sequence([ stopBefore(resourceLocation_resourceLocation({ category: 'stat_type', namespacePathSep: '.' }), ':'), failOnEmpty(literal(':')), { get: (res) => { if (ResourceLocationNode.is(res.children[0])) { const category = ObjectiveCriteriaNode.ComplexCategories.get(ResourceLocationNode.toString(res.children[0], 'short')); if (category) { return resourceLocation_resourceLocation({ category, namespacePathSep: '.' }); } } return resourceLocation_resourceLocation({ pool: [], allowUnknown: true, namespacePathSep: '.' }); }, }, ]), literal(...ObjectiveCriteriaNode.SimpleValues), ]), (res) => { const ans = { type: 'mcfunction:objective_criteria', range: res.range }; if (LiteralNode.is(res)) { ans.simpleValue = res.value; } else { ans.children = res.children.filter(ResourceLocationNode.is); } return ans; }); function tag(usageType, terminators = []) { return unquotableSymbol({ category: 'tag', usageType }, terminators); } function team(usageType, terminators = []) { return unquotableSymbol({ category: 'team', usageType }, terminators); } function unquotableSymbol(options, terminators) { return validateUnquotable(argument_symbol(options, terminators)); } const time = util_map(sequence([ argument_float(0, undefined), optional(failOnEmpty(literal(...TimeNode.Units))), ]), (res) => { const valueNode = res.children.find(FloatNode.is); const unitNode = res.children.find(LiteralNode.is); const ans = { type: 'mcfunction:time', range: res.range, children: res.children, value: valueNode.value, unit: unitNode?.value, }; return ans; }); const unquotedString = string_string({ unquotable: BrigadierUnquotableOption, }); const UuidPattern = /^[0-9a-f]+-[0-9a-f]+-[0-9a-f]+-[0-9a-f]+-[0-9a-f]+$/i; const uuid = (src, ctx) => { const ans = { type: 'mcfunction:uuid', range: Range.create(src), bits: [0n, 0n] }; const raw = src.readUntil(' ', '\r', '\n', '\r'); /** * According to the implementation of Minecraft's UUID parser and Java's `UUID#fromString` method, * only strings that don't have five parts and strings where any part exceed the maximum Long value are * considered invalid. * * http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/default/src/share/classes/java/util/UUID.java */ let isLegal = false; if (raw.match(UuidPattern)) { try { const parts = raw.split('-').map((p) => BigInt(`0x${p}`)); if (parts.every((p) => p <= LongMax)) { isLegal = true; ans.bits[0] = BigInt.asIntN(64, (parts[0] << 32n) | (parts[1] << 16n) | parts[2]); ans.bits[1] = BigInt.asIntN(64, (parts[3] << 48n) | parts[4]); } } catch { // Ignored. } } ans.range.end = src.cursor; if (!isLegal) { ctx.err.report(localize('mcfunction.parser.uuid.invalid'), ans); } return ans; }; function validateLength(parser, maxLength, localeKey) { return (src, ctx) => { if (!shouldValidateLength(ctx)) { return parser(src, ctx); } return util_map(parser, (res, _src, ctx) => { if (res.value.length > maxLength) { ctx.err.report(localize(localeKey, maxLength), res); } return res; })(src, ctx); }; } function validateUnquotable(parser) { return util_map(parser, (res, _src, ctx) => { if (!res.value.match(BrigadierUnquotablePattern)) { ctx.err.report(localize('parser.string.illegal-brigadier', localeQuote(res.value)), res); } return res; }); } function parser_argument_vector(options) { return (src, ctx) => { const ans = { type: 'mcfunction:vector', range: Range.create(src), children: [], options, system: 0 /* CoordinateSystem.World */, }; if (src.peek() === '^') { ans.system = 1 /* CoordinateSystem.Local */; } for (let i = 0; i < options.dimension; i++) { if (i > 0) { common_sep(src, ctx); } const coord = options.integersOnly ? argument_coordinate(options.integersOnly)(src, ctx) : argument_coordinate(options.integersOnly)(src, ctx); ans.children.push(coord); if ((ans.system === 1 /* CoordinateSystem.Local */) !== (coord.notation === '^')) { ctx.err.report(localize('mcfunction.parser.vector.mixed'), coord); } } if (options.noLocal && ans.system === 1 /* CoordinateSystem.Local */) { ctx.err.report(localize('mcfunction.parser.vector.local-disallowed'), ans); } ans.range.end = src.cursor; return ans; }; } const components = (src, ctx) => { const release = ctx.project['loadedVersion']; const allowComponentRemoval = !release || ReleaseVersion.cmp(release, '1.21') >= 0; const ans = { type: 'mcfunction:component_list', range: Range.create(src), children: [], }; if (!src.trySkip('[')) { return Parser_Failure; } ans.innerRange = Range.create(src); src.skipWhitespace(); while (src.canRead() && src.peek() !== ']') { const start = src.cursor; if (allowComponentRemoval && src.tryPeek('!')) { const prefix = literal('!')(src, ctx); src.skipWhitespace(); const key = resourceLocation_resourceLocation({ category: 'data_component_type' })(src, ctx); ans.children.push({ type: 'mcfunction:component_removal', range: Range.create(start, src), children: [prefix, key], prefix, key, }); src.skipWhitespace(); } else { const key = resourceLocation_resourceLocation({ category: 'data_component_type' })(src, ctx); src.skipWhitespace(); literal('=')(src, ctx); src.skipWhitespace(); const value = entry_entry(src, ctx); if (value === Parser_Failure) { ctx.err.report(localize('expected', localize('parser.record.value')), Range.create(src, () => src.skipUntilOrEnd(',', ']', '\r', '\n'))); ans.children.push({ type: 'mcfunction:component', range: Range.create(start, src), children: [key], key, value: undefined, }); } else { ans.children.push({ type: 'mcfunction:component', range: Range.create(start, src), children: [key, value], key, value, }); } src.skipWhitespace(); } if (src.trySkip(',')) { src.skipWhitespace(); if (src.peek() === ']') { break; } } else { break; } } src.skipWhitespace(); ans.innerRange.end = src.cursor; literal(']')(src, ctx); ans.range.end = src.cursor; return ans; }; const componentTest = (src, ctx) => { const start = src.cursor; src.skipWhitespace(); const negated = src.trySkip('!'); src.skipWhitespace(); const key = resourceLocation_resourceLocation({ category: 'data_component_type' })(src, ctx); src.skipWhitespace(); if (ResourceLocationNode.toString(key, 'full') === 'minecraft:count') { key.options.category = undefined; key.options.pool = ['minecraft:count']; } if (src.trySkip('=')) { src.skipWhitespace(); const ans = { type: 'mcfunction:component_test_exact', range: Range.create(start, src), children: [key], key, negated, }; const value = entry_entry(src, ctx); if (value === Parser_Failure) { ctx.err.report(localize('expected', localize('nbt.node')), src); src.skipUntilOrEnd(',', '|', ']'); } else { ans.children.push(value); ans.value = value; } src.skipWhitespace(); ans.range.end = src.cursor; return ans; } if (src.trySkip('~')) { src.skipWhitespace(); if (key.options.category !== undefined) { const release = ctx.project['loadedVersion']; if (release && ReleaseVersion.cmp(release, '1.21.5') < 0) { key.options.category = 'item_sub_predicate_type'; } else { key.options.category = 'data_component_predicate_type'; } } const ans = { type: 'mcfunction:component_test_sub_predicate', range: Range.create(start, src), children: [key], key, negated, }; const predicate = entry_entry(src, ctx); if (predicate === Parser_Failure) { ctx.err.report(localize('expected', localize('nbt.node')), src); src.skipUntilOrEnd(',', '|', ']'); } else { ans.children.push(predicate); ans.value = predicate; } src.skipWhitespace(); ans.range.end = src.cursor; return ans; } const ans = { type: 'mcfunction:component_test_exists', range: Range.create(start, src), children: [key], key, negated, }; return ans; }; const componentTestsAllOf = (src, ctx) => { const ans = { type: 'mcfunction:component_tests_all_of', range: Range.create(src), children: [], }; while (src.canRead()) { src.skipWhitespace(); const testNode = componentTest(src, ctx); ans.children.push(testNode); src.skipWhitespace(); if (src.peek() === ',') { src.skip(); } else if (src.peek() === '|' || src.peek() === ']') { break; } else { ctx.err.report(localize('expected', localeQuote(']')), src); src.skipUntilOrEnd(',', '|', ']'); } } ans.range.end = src.cursor; return ans; }; const componentTestsAnyOf = (src, ctx) => { const ans = { type: 'mcfunction:component_tests_any_of', range: Range.create(src), children: [], }; while (src.canRead()) { src.skipWhitespace(); const allOfNode = componentTestsAllOf(src, ctx); ans.children.push(allOfNode); src.skipWhitespace(); if (src.peek() === '|') { src.skip(); } else if (src.peek() === ']') { break; } else { ctx.err.report(localize('expected', localeQuote(']')), src); src.skipUntilOrEnd('|', ']'); } } ans.range.end = src.cursor; return ans; }; const argument_componentTests = (src, ctx) => { const ans = { type: 'mcfunction:component_tests', range: Range.create(src), }; if (!src.trySkip('[')) { return Parser_Failure; } src.skipWhitespace(); const tests = optional(failOnEmpty(componentTestsAnyOf))(src, ctx); if (tests) { ans.children = [tests]; } src.skipWhitespace(); literal(']')(src, ctx); ans.range.end = src.cursor; return ans; }; //# sourceMappingURL=argument.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/parser/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/mcdocAttributes.js const mcfunction_mcdocAttributes_validator = validator_namespaceObject; const commandValidator = mcfunction_mcdocAttributes_validator.alternatives(mcfunction_mcdocAttributes_validator.tree({ slash: mcfunction_mcdocAttributes_validator.optional(mcfunction_mcdocAttributes_validator.options('allowed', 'required', 'chat')), macro: mcfunction_mcdocAttributes_validator.optional(mcfunction_mcdocAttributes_validator.options('implicit')), max_length: mcfunction_mcdocAttributes_validator.optional(mcfunction_mcdocAttributes_validator.number), empty: mcfunction_mcdocAttributes_validator.optional(mcfunction_mcdocAttributes_validator.options('allowed')), incomplete: mcfunction_mcdocAttributes_validator.optional(mcfunction_mcdocAttributes_validator.options('allowed')), }), () => ({})); const entityValidator = mcfunction_mcdocAttributes_validator.alternatives(mcfunction_mcdocAttributes_validator.tree({ amount: mcfunction_mcdocAttributes_validator.options('multiple', 'single'), type: mcfunction_mcdocAttributes_validator.options('entities', 'players'), }), () => ({ amount: 'multiple', type: 'entities' })); const scoreHolderValidator = mcfunction_mcdocAttributes_validator.alternatives(mcfunction_mcdocAttributes_validator.tree({ amount: mcfunction_mcdocAttributes_validator.options('multiple', 'single'), }), () => ({ amount: 'multiple' })); function mcfunction_mcdocAttributes_registerMcdocAttributes(meta, rootTreeNode) { registerAttribute(meta, 'command', commandValidator, { // TODO: fix completer inside commands stringParser: ({ slash, macro, max_length, empty, incomplete }) => { return (src, ctx) => { if (macro) { return macro_macro(false)(src, ctx); } if ((empty && !src.canRead()) || (slash === 'chat' && src.peek() !== '/')) { return string_string({ unquotable: { blockList: new Set(), allowEmpty: true }, })(src, ctx); } const tmpCtx = { ...ctx, err: new ErrorReporter(ctx.err.source) }; const result = command_command(rootTreeNode, argument, { slash: slash === 'chat' ? 'allowed' : slash, maxLength: max_length, })(src, tmpCtx); if (incomplete) { tmpCtx.err.errors = tmpCtx.err.errors.filter(e => e.range.end < result.range.end); } ctx.err.absorb(tmpCtx.err); return result; }; }, }); registerAttribute(meta, 'text_component', () => undefined, { stringParser: () => mcdocAttributes_makeInfallible(util_map(entry, (res) => ({ type: 'json:typed', range: res.range, children: [res], targetType: { kind: 'reference', path: '::java::server::util::text::Text' }, })), localize('text-component')), }); registerAttribute(meta, 'objective', () => undefined, { stringParser: () => objective('reference'), stringMocker: (_, __, ctx) => SymbolNode.mock(ctx.offset, { category: 'objective' }), }); registerAttribute(meta, 'team', () => undefined, { stringParser: () => team('reference'), stringMocker: (_, __, ctx) => SymbolNode.mock(ctx.offset, { category: 'team' }), }); registerAttribute(meta, 'score_holder', scoreHolderValidator, { stringParser: (config) => mcdocAttributes_makeInfallible(argument_scoreHolder('reference', config.amount), localize('score-holder')), stringMocker: (_, __, ctx) => ScoreHolderNode.mock(ctx.offset), }); registerAttribute(meta, 'tag', () => undefined, { stringParser: () => tag('reference'), stringMocker: (_, __, ctx) => SymbolNode.mock(ctx.offset, { category: 'tag' }), }); registerAttribute(meta, 'block_predicate', () => undefined, { stringParser: () => blockPredicate, stringMocker: (_, __, ctx) => BlockNode.mock(ctx.offset, true), }); registerAttribute(meta, 'entity', entityValidator, { stringParser: (config) => mcdocAttributes_makeInfallible(argument_entity(config.amount, config.type), localize('selector')), stringMocker: (_, __, ctx) => EntitySelectorNode.mock(ctx.offset, { pool: EntitySelectorAtVariable.filterAvailable(ctx), }), }); registerAttribute(meta, 'item_slots', () => undefined, { stringParser: (_, __, ctx) => literal({ pool: getItemSlotsArgumentValues(ctx) }), stringMocker: (_, __, ctx) => LiteralNode.mock(ctx.offset, { pool: getItemSlotsArgumentValues(ctx) }), }); registerAttribute(meta, 'uuid', () => undefined, { stringParser: () => uuid, }); } function mcdocAttributes_makeInfallible(parser, message) { return (src, ctx) => { const start = src.cursor; const res = parser(src, ctx); if (res === Parser_Failure) { ctx.err.report(localize('expected', message), Range.create(start, src.skipRemaining())); return undefined; } return res; }; } //# sourceMappingURL=mcdocAttributes.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/signatureHelpProvider.js /** * Only command options that can be satisfied by the current command node will be listed in `signatures`. * Only parameters at and immediately after the `offset` will be listed in `parameters`. */ function signatureHelpProvider(rootTreeNode) { return (fileNode, ctx) => { if (fileNode.children[0]?.type !== 'mcfunction:entry') { // Not mcfunction. return undefined; } const node = getSelectedCommandNode(fileNode, ctx.offset); if (!CommandNode.is(node)) { // Not a command node. return undefined; } const argumentNodes = node ? node.children : []; const options = signatureHelpProvider_getOptions(rootTreeNode, argumentNodes); if (options.length === 0) { // Not matching any syntax at all. return undefined; } let selectedIndex = 0; for (const child of argumentNodes) { if (ctx.offset > child.range.end) { selectedIndex += 1; } else { break; } } if (selectedIndex >= options[0].length) { // No matching syntax for the selected argument node. return undefined; } const ans = { activeSignature: 0, signatures: [] }; ans.signatures = options.map((v) => { const part1 = v[selectedIndex]; const part2 = selectedIndex + 1 < v.length ? ` ${v[selectedIndex + 1]}` : ''; const label = `${part1}${part2}`; return { label, activeParameter: 0, // documentation: localize('mcfunction.signature-help.command-documentation', v[0]), parameters: [{ label: [0, part1.length] }, { label: [part1.length, label.length] }], }; }); return ans; }; } function getSelectedCommandNode(fileNode, offset) { return AstNode.findChild(fileNode.children[0], offset, true); } function signatureHelpProvider_getOptions(rootTreeNode, argumentNodes) { const current = []; let treeNode = rootTreeNode; for (const argumentNode of argumentNodes) { const name = argumentNode.path[argumentNode.path.length - 1]; if (!name) { break; } treeNode = resolveParentTreeNode(treeNode, rootTreeNode).treeNode?.children?.[name]; if (!treeNode) { break; } current.push(treeNodeToString(name, treeNode)); } if (treeNode) { treeNode = resolveParentTreeNode(treeNode, rootTreeNode).treeNode; if (treeNode?.children) { return treeNodeChildrenToStringArray(treeNode.children, treeNode.executable).map((v) => [...current, v]); } } return current.length ? [current] : []; } //# sourceMappingURL=signatureHelpProvider.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/tree/patch.js function getPatch(release) { return { children: { advancement: { children: { grant: AdvancementTargets, revoke: AdvancementTargets, }, }, ...(ReleaseVersion.cmp(release, '1.16') >= 0 ? { attribute: { children: { target: { children: { attribute: { properties: { category: 'attribute', }, children: { modifier: { children: { add: { children: { id: { properties: { category: 'attribute_modifier', }, }, uuid: { properties: { category: 'attribute_modifier_uuid', }, }, }, }, remove: { children: { id: { properties: { category: 'attribute_modifier', }, }, uuid: { properties: { category: 'attribute_modifier_uuid', }, }, }, }, value: { children: { get: { children: { id: { properties: { category: 'attribute_modifier', }, }, uuid: { properties: { category: 'attribute_modifier_uuid', }, }, }, }, }, }, }, }, }, }, }, }, }, }, } : {}), ban: { permission: 3, }, 'ban-ip': { permission: 3, }, banlist: { permission: 3, }, bossbar: { children: { add: { children: { id: { properties: { category: 'bossbar', usageType: 'definition', }, }, }, }, get: { children: { id: { properties: { category: 'bossbar', }, }, }, }, remove: { children: { id: { properties: { category: 'bossbar', }, }, }, }, set: { children: { id: { properties: { category: 'bossbar', accessType: 1 /* SymbolAccessType.Write */, }, }, }, }, }, }, data: { children: { get: getDataPatch('target', 'path'), merge: getDataPatch('target', 'nbt', { isMerge: true, vaultAccessType: 1 /* SymbolAccessType.Write */, }), modify: getDataPatch('target', 'targetPath', { nbtAccessType: 1 /* SymbolAccessType.Write */, vaultAccessType: 1 /* SymbolAccessType.Write */, children: (type) => ({ append: getDataModifySource(type, { isListIndex: true, }), insert: { children: { index: getDataModifySource(type, { isListIndex: true, }), }, }, merge: getDataModifySource(type, { isMerge: true, }), prepend: getDataModifySource(type, { isListIndex: true, }), set: getDataModifySource(type), }), }), remove: getDataPatch('target', 'path', { nbtAccessType: 1 /* SymbolAccessType.Write */, vaultAccessType: 1 /* SymbolAccessType.Write */, }), }, }, datapack: { children: { ...(ReleaseVersion.cmp(release, '1.21.6') >= 0 ? { // Added in 21w15a (1.21.6, pack format 72) create: { permission: 4, }, } : {}), }, }, debug: { permission: 3, }, deop: { permission: 3, }, execute: { children: { if: ExecuteCondition, store: { children: { result: ExecuteStoreTarget, success: ExecuteStoreTarget, }, }, unless: ExecuteCondition, }, }, function: { children: { name: { ...(ReleaseVersion.cmp(release, '1.20.2') >= 0 ? { children: { // Added in 23w31a (1.20.2, pack format 16) arguments: { properties: { dispatcher: 'minecraft:macro_function', dispatchedBy: 'name', }, }, with: getDataPatch('source', 'path'), }, } : {}), }, }, }, ...(ReleaseVersion.cmp(release, '1.17') >= 0 ? { // Added in 20w46a (1.17, pack format 7) item: { children: { replace: { children: { block: { children: { pos: { children: { slot: { children: { from: { children: { block: { children: { source: { children: { sourceSlot: { children: { modifier: { properties: { category: 'item_modifier', }, }, }, }, }, }, }, }, entity: { children: { source: { children: { sourceSlot: { children: { modifier: { properties: { category: 'item_modifier', }, }, }, }, }, }, }, }, }, }, }, }, }, }, }, }, entity: { children: { targets: { children: { slot: { children: { from: { children: { block: { children: { source: { children: { sourceSlot: { children: { modifier: { properties: { category: 'item_modifier', }, }, }, }, }, }, }, }, entity: { children: { source: { children: { sourceSlot: { children: { modifier: { properties: { category: 'item_modifier', }, }, }, }, }, }, }, }, }, }, }, }, }, }, }, }, }, }, modify: { children: { block: { children: { pos: { children: { slot: { children: { modifier: { properties: { category: 'item_modifier', }, }, }, }, }, }, }, }, entity: { children: { targets: { children: { slot: { children: { modifier: { properties: { category: 'item_modifier', }, }, }, }, }, }, }, }, }, }, }, }, } : {}), help: { permission: 0, }, ...(ReleaseVersion.cmp(release, '1.18') >= 0 ? { // Added in 21w37a (1.18, pack format 8) jfr: { permission: 4, }, } : {}), kick: { permission: 3, }, list: { permission: 0, }, ...(ReleaseVersion.isBetween(release, '1.16', '1.19') ? { // Added in 20w06a (1.16, pack format 5) // Removed in 22w19a (1.19, pack format 10) locatebiome: { children: { biome: { properties: { category: 'worldgen/biome', // Allowed in 1.18.2-pre1 (1.18.2, pack format 9) allowTag: ReleaseVersion.cmp(release, '1.18.2') >= 0, }, }, }, }, } : {}), loot: { children: { give: { children: { players: LootSource, }, }, insert: { children: { targetPos: LootSource, }, }, replace: { children: { block: { children: { targetPos: { children: { slot: { children: { ...LootSource.children, count: LootSource, }, }, }, }, }, }, entity: { children: { entities: { children: { slot: { children: { ...LootSource.children, count: LootSource, }, }, }, }, }, }, }, }, spawn: { children: { targetPos: LootSource, }, }, }, }, me: { permission: 0, }, msg: { permission: 0, }, op: { permission: 3, }, pardon: { permission: 3, }, 'pardon-ip': { permission: 3, }, ...(ReleaseVersion.cmp(release, '1.17') >= 0 ? { // Added in 1.17 Pre-release 1 (1.17, pack format 7) perf: { permission: 4, }, } : {}), ...(ReleaseVersion.cmp(release, '1.19') >= 0 ? { // Added in 22w18a (1.19, pack format 10) place: { children: { jigsaw: { children: { pool: { children: { target: { properties: { category: 'jigsaw_block_name', allowUnknown: true, }, }, }, }, }, }, template: { children: { template: { properties: { category: 'structure', }, }, }, }, }, }, } : {}), playsound: Sound, publish: { permission: 4, }, ...(ReleaseVersion.cmp(release, '1.20.2') >= 0 ? { // Added in 23w31a (1.20.2, pack format 16) random: { children: { reset: { children: { sequence: { properties: { category: 'random_sequence', allowUnknown: true, }, }, }, }, roll: { children: { range: { properties: { minSpan: 1, maxSpan: 2147483646, }, children: { sequence: { properties: { category: 'random_sequence', allowUnknown: true, }, }, }, }, }, }, value: { children: { range: { properties: { minSpan: 1, maxSpan: 2147483646, }, children: { sequence: { properties: { category: 'random_sequence', allowUnknown: true, }, }, }, }, }, }, }, }, } : {}), recipe: { children: { give: RecipeTargets, take: RecipeTargets, }, }, 'save-all': { permission: 4, }, 'save-off': { permission: 4, }, 'save-on': { permission: 4, }, schedule: { children: { clear: { children: { function: { parser: 'minecraft:function', properties: undefined, }, }, }, }, }, scoreboard: { children: { objectives: { children: { add: { children: { objective: { parser: 'minecraft:objective', properties: { usageType: 'definition', }, }, }, }, }, }, players: { children: { add: ObjectiveWriteTargets, operation: ObjectiveWriteTargets, remove: ObjectiveWriteTargets, reset: ObjectiveWriteTargets, set: ObjectiveWriteTargets, }, }, }, }, setidletimeout: { permission: 3, }, stop: { permission: 4, }, stopsound: { children: { targets: { children: { '*': Sound, ambient: Sound, block: Sound, hostile: Sound, master: Sound, music: Sound, neutral: Sound, player: Sound, record: Sound, voice: Sound, weather: Sound, }, }, }, }, summon: { children: { entity: { children: { pos: { children: { nbt: { properties: { dispatcher: 'minecraft:entity', dispatchedBy: 'entity', }, }, }, }, }, }, }, }, tag: { children: { targets: { children: { add: { children: { name: { parser: 'spyglassmc:tag', }, }, }, remove: { children: { name: { parser: 'spyglassmc:tag', }, }, }, }, }, }, }, team: { children: { add: { children: { team: { parser: 'minecraft:team', properties: { usageType: 'definition', }, }, }, }, }, }, teammsg: { permission: 0, }, /** * Original command syntax: * 1. `teleport ` * 2. `teleport ` * 3. `teleport <...arguments>` * * It is impossible for Spyglass to differentiate between (1) and (3) when it encounters a single entity * at the position of the first argument, due to its lack of ability to backtrack. * * Therefore, we have compromised to patch the trees to something like this: * - `teleport ` * - `teleport [<...arguments>]` * * Diff: * - Removed (1) `teleport `. * - Marked `<...arguments>` in (3) as optional. * * The downside of this patch is that entity selectors tracking multiple entities can now be used as the * `` argument. We will see how this work. */ teleport: { children: { destination: undefined, targets: { executable: true, }, }, }, tell: { permission: 0, }, ...(ReleaseVersion.cmp(release, '1.20.3') >= 0 ? { // Added in 23w43a (1.20.3, pack format 22) tick: { permission: 3, }, } : {}), tm: { permission: 0, }, ...(ReleaseVersion.cmp(release, '1.20.5') >= 0 ? { // Added in 24w04a (1.20.5, pack format 29) transfer: { permission: 3, }, } : {}), trigger: { permission: 0, children: { objective: { properties: { category: 'objective', accessType: 1 /* SymbolAccessType.Write */, }, }, }, }, w: { permission: 0, }, whitelist: { permission: 3, }, }, }; } const AdvancementTargets = Object.freeze({ children: { targets: { children: { from: { children: { advancement: { properties: { category: 'advancement', }, }, }, }, only: { children: { advancement: { properties: { category: 'advancement', }, children: { criterion: { parser: 'spyglassmc:criterion', properties: { usageType: 'reference', }, }, }, }, }, }, through: { children: { advancement: { properties: { category: 'advancement', }, }, }, }, until: { children: { advancement: { properties: { category: 'advancement', }, }, }, }, }, }, }, }); /** * Return the command tree patch for anything related to data sources as used in * `data`, `execute if` and `execute store` commands. * * A **vault** refers to a block, an entity, or a storage that contains NBT data. * * e.g., in a syntax like * `block |entity |storage ) `, the * `` and `` arguments identify a vault, and the * `` argument is an NBT path that points to data in the vault. * * @param vaultKey Key of the argument identifying a vault. This argument should * be a vec3, an entity, or a storage resource location. * @param nbtKey Key of the argument containing an NBT tag or an NBT path. * @param nbtAccessType Access type for the NBT argument. This is only * meaningful for NBT paths and should be enforced by the * NBT path checker. * Note this usually match `vaultAccessType`. The only case * where they don't match is in `data merge`, where the * vault is being written to while the NBT argument is * being read from. * @default {@link SymbolAccessType.Read} * @param vaultAccessType Access type for the vault. This is only meaningful for * storage vaults and should be enforced by the resource * location checker. * @see {@link nbtAccessType} * @default {@link SymbolAccessType.Read} * @param children Optional patch for children after the NBT argument. */ function getDataPatch(vaultKey, nbtKey, { children, isPredicate = false, isMerge = false, nbtAccessType = 0 /* SymbolAccessType.Read */, vaultAccessType = 0 /* SymbolAccessType.Read */, } = {}) { return Object.freeze({ children: { block: { children: { [`${vaultKey}Pos`]: { children: { [nbtKey]: { properties: { dispatcher: 'minecraft:block', dispatchedBy: `${vaultKey}Pos`, accessType: nbtAccessType, isPredicate, isMerge, }, ...children ? { children: children('block') } : {}, }, }, }, }, }, entity: { children: { [vaultKey]: { children: { [nbtKey]: { properties: { dispatcher: 'minecraft:entity', dispatchedBy: vaultKey, accessType: nbtAccessType, isPredicate, isMerge, }, ...children ? { children: children('entity') } : {}, }, }, }, }, }, storage: { children: { [vaultKey]: { properties: { category: 'storage', accessType: vaultAccessType, usageType: 'definition', }, children: { [nbtKey]: { properties: { dispatcher: 'minecraft:storage', dispatchedBy: vaultKey, accessType: nbtAccessType, isPredicate, isMerge, }, ...children ? { children: children('storage') } : {}, }, }, }, }, }, }, }); } const getDataModifySource = (type, { isMerge = false, isListIndex = false, } = {}) => Object.freeze({ children: { from: getDataPatch('source', 'sourcePath'), string: getDataPatch('source', 'sourcePath'), value: { children: { value: { properties: { dispatcher: `minecraft:${type}`, dispatchedBy: type === 'block' ? 'targetPos' : 'target', indexedBy: 'targetPath', isMerge, isListIndex, }, }, }, }, }, }); const ExecuteCondition = Object.freeze({ children: { data: getDataPatch('source', 'path', { isPredicate: true, }), predicate: { children: { predicate: { properties: { category: 'predicate', }, }, }, }, }, }); const ExecuteStoreTarget = Object.freeze({ children: { ...getDataPatch('target', 'path', { nbtAccessType: 1 /* SymbolAccessType.Write */, vaultAccessType: 1 /* SymbolAccessType.Write */, }) .children, bossbar: { children: { id: { properties: { category: 'bossbar', accessType: 1 /* SymbolAccessType.Write */, }, }, }, }, score: { children: { targets: { properties: { usageType: 'definition', }, children: { objective: { properties: { accessType: 1 /* SymbolAccessType.Write */, }, }, }, }, }, }, }, }); const LootSource = Object.freeze({ children: { fish: { children: { loot_table: { properties: { category: 'loot_table', }, }, }, }, loot: { children: { loot_table: { properties: { category: 'loot_table', }, }, }, }, }, }); const ObjectiveWriteTargets = Object.freeze({ children: { targets: { properties: { usageType: 'definition', }, children: { objective: { properties: { accessType: 1 /* SymbolAccessType.Write */, }, }, }, }, }, }); const RecipeTargets = Object.freeze({ children: { targets: { children: { recipe: { properties: { category: 'recipe', }, }, }, }, }, }); const Sound = Object.freeze({ children: { sound: { properties: { category: 'sound_event', }, }, }, }); //# sourceMappingURL=patch.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/tree/patchValidator.js /** * A set of parsers that must be patched with a `properties` field. */ const PatchRequiredParsers = new Set([ 'minecraft:nbt_compound_tag', 'minecraft:nbt_path', 'minecraft:nbt_tag', 'minecraft:resource_location', 'minecraft:uuid', ]); /** * Validate that parsers requiring patches have been patched in the tree. */ function validatePatchedTree(tree, logger) { walk(tree, []); function walk(node, path) { if (node.type === 'argument' && PatchRequiredParsers.has(node.parser) && !node.properties) { logger.warn(`[validatePatchedTree] Patch required: ${node.parser} at ${path.join('.')}`); } for (const [key, value] of Object.entries(node.children ?? {})) { walk(value, [...path, key]); } } } //# sourceMappingURL=patchValidator.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/index.js /* istanbul ignore next */ const mcfunction_initialize = (ctx, commands, releaseVersion) => { const { meta } = ctx; registerCustomResources(ctx.config); const tree = merge(commands, getPatch(releaseVersion)); if (ctx.isDebugging) { validatePatchedTree(tree, ctx.logger); } mcfunction_lib_initialize(ctx); const mcfunctionOptions = { lineContinuation: ReleaseVersion.cmp(releaseVersion, '1.20.2') >= 0, macros: ReleaseVersion.cmp(releaseVersion, '1.20.2') >= 0, commandOptions: ReleaseVersion.cmp(releaseVersion, '1.20.5') >= 0 ? { maxLength: 2_000_000 } : {}, }; meta.registerLanguage('mcfunction', { extensions: ['.mcfunction'], parser: parser_entry_entry(tree, argument, mcfunctionOptions), completer: completer_entry(tree, getMockNodes), triggerCharacters: [' ', '[', '=', '!', ',', '{', ':', '/', '.', '"', "'"], }); meta.registerParser('mcfunction:block_predicate', blockPredicate); meta.registerParser('mcfunction:particle', parser_argument_particle); meta.registerParser('mcfunction:tag', tag()); meta.registerParser('mcfunction:team', team()); meta.registerParser('mcfunction:command', command_command(tree, argument)); mcfunction_mcdocAttributes_registerMcdocAttributes(meta, tree); mcfunction_checker_register(meta); mcfunction_colorizer_register(meta); argument_register(meta); meta.registerInlayHintProvider(inlayHintProvider); meta.registerSignatureHelpProvider(signatureHelpProvider(tree)); }; //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/index.js const java_edition_lib_initialize = async (ctx) => { const { config, downloader, externals, logger, meta, projectRoots } = ctx; async function readPackFormat(uri) { try { const data = await fileUtil.readJson(externals, uri); return PackMcmeta.readPackFormat(data); } catch (e) { if (!externals.error.isKind(e, 'ENOENT')) { // `pack.mcmeta` exists but broken. Log an error. logger.error(`[je.initialize] Failed loading pack.mcmeta ${uri}`, e); } } return undefined; } async function findPackMcmetas() { const searchedUris = new Set(); const packs = []; for (let depth = 0; depth <= 2; depth += 1) { for (const projectRoot of projectRoots) { const files = await fileUtil.getAllFiles(externals, projectRoot, depth + 1); for (const uri of files.filter(uri => uri.endsWith('/pack.mcmeta'))) { if (searchedUris.has(uri)) { continue; } searchedUris.add(uri); const packRoot = fileUtil.dirname(uri); const [format, type] = await Promise.all([ readPackFormat(uri), PackMcmeta.getType(packRoot, externals), ]); if (format !== undefined) { packs.push({ type, packRoot, format }); } } } } return packs; } meta.registerUriBinder(binder_uriBinder); registerUriBuilders(meta); const [versions, packs] = await Promise.all([ getVersions(ctx.externals, ctx.downloader), findPackMcmetas(), ]); if (!versions) { ctx.logger.error('[je-initialize] Failed loading game version list. Expect everything to be broken.'); return; } const version = resolveConfiguredVersion(config.env.gameVersion, versions, packs, logger); const release = version.release; meta.registerDependencyProvider('@vanilla-datapack', () => getVanillaDatapack(downloader, version.id, version.isLatest)); meta.registerDependencyProvider('@vanilla-resourcepack', () => getVanillaResourcepack(downloader, version.id, version.isLatest)); meta.registerDependencyProvider('@vanilla-mcdoc', () => getVanillaMcdoc(downloader)); const summary = await getMcmetaSummary(ctx.externals, downloader, logger, version.id, version.isLatest, config.env.dataSource, config.env.mcmetaSummaryOverrides); if (!summary.blocks || !summary.commands || !summary.fluids || !summary.registries) { ctx.logger.error('[je-initialize] Failed loading mcmeta summaries. Expect everything to be broken.'); return; } meta.registerSymbolRegistrar('mcmeta-summary', { checksum: `${summary.checksum}_v3`, registrar: symbolRegistrar(summary, release), }); meta.registerLinter('nameOfNbtKey', { configValidator: configValidator.nameConvention, linter: nameConvention('value'), nodePredicate: (n) => // nbt compound keys without mcdoc definition. (!n.symbol && n.parent?.parent?.type === 'nbt:compound' && PairNode.is(n.parent) && n.type === 'string' && n.parent.key === n) // nbt path keys without mcdoc definition. || (!n.symbol && n.parent?.type === 'nbt:path' && n.type === 'string') // mcdoc compound key definition outside of `::minecraft` modules. || (StructFieldNode.is(n.parent) && StructKeyNode.is(n) && !n.symbol?.path[0]?.startsWith('::minecraft')), }); lib_mcdocAttributes_registerMcdocAttributes(meta, summary.commands, release); registerPackFormatAttribute(meta, versions, packs); meta.registerLanguage('zip', { extensions: ['.zip'] }); meta.registerLanguage('png', { extensions: ['.png'] }); meta.registerLanguage('ogg', { extensions: ['.ogg'] }); meta.registerLanguage('ttf', { extensions: ['.ttf'] }); meta.registerLanguage('otf', { extensions: ['.otf'] }); meta.registerLanguage('fsh', { extensions: ['.fsh'] }); meta.registerLanguage('vsh', { extensions: ['.vsh'] }); getInitializer(jsonUriPredicate)(ctx); json_initialize(ctx); mcfunction_initialize(ctx, summary.commands, release); lib_initialize(ctx); return { loadedVersion: release, errorSource: release }; }; //# sourceMappingURL=index.js.map // EXTERNAL MODULE: ./node_modules/chokidar/index.js var chokidar = __nccwpck_require__(5315); // EXTERNAL MODULE: ./node_modules/decompress/index.js var decompress = __nccwpck_require__(6591); // EXTERNAL MODULE: ./node_modules/follow-redirects/index.js var follow_redirects = __nccwpck_require__(1573); ;// CONCATENATED MODULE: external "node:buffer" const external_node_buffer_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:buffer"); ;// CONCATENATED MODULE: external "node:child_process" const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:child_process"); // EXTERNAL MODULE: external "node:crypto" var external_node_crypto_ = __nccwpck_require__(7598); // EXTERNAL MODULE: external "node:events" var external_node_events_ = __nccwpck_require__(8474); ;// CONCATENATED MODULE: external "node:fs" const external_node_fs_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs"); var external_node_fs_namespaceObject_0 = /*#__PURE__*/__nccwpck_require__.t(external_node_fs_namespaceObject, 2); ;// CONCATENATED MODULE: external "node:process" const external_node_process_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:process"); ;// CONCATENATED MODULE: external "node:url" const external_node_url_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:url"); // EXTERNAL MODULE: external "node:util" var external_node_util_ = __nccwpck_require__(7975); ;// CONCATENATED MODULE: external "node:zlib" const external_node_zlib_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:zlib"); ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/externals/NodeJsExternals.js // https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/60592 const { http, https } = follow_redirects; const gunzip = (0,external_node_util_.promisify)(external_node_zlib_namespaceObject.gunzip); const gzip = (0,external_node_util_.promisify)(external_node_zlib_namespaceObject.gzip); class NodeJsExternalDownloader { get(uri, options = {}) { const protocol = new Uri(uri).protocol; return new Promise((resolve, reject) => { const backend = protocol === 'http:' ? http : https; backend.get(uri, options, (res) => { if (res.statusCode !== 200) { reject(new Error(`Status code ${res.statusCode}: ${res.statusMessage}`)); } else { resolve(promisifyAsyncIterable(res, (chunks) => external_node_buffer_namespaceObject.Buffer.concat(chunks))); } }).on('error', (e) => { reject(e); }); }); } } const NodeJsExternals = { archive: { decompressBall(buffer, options) { if (buffer instanceof external_node_buffer_namespaceObject.Buffer) { return decompress(buffer, { strip: options?.stripLevel }); } throw new TypeError(`The 'buffer' argument for 'decompressBall' on Node.js must be an instance of 'Buffer'. Got '${buffer}' instead.`); }, gunzip(buffer) { return gunzip(buffer); }, gzip(buffer) { return gzip(buffer); }, }, crypto: { async getSha1(data) { const hash = external_node_crypto_.createHash('sha1'); hash.update(data); return hash.digest('hex'); }, }, downloader: new NodeJsExternalDownloader(), error: { createKind(kind, message) { const error = new Error(message); error.code = kind; return error; }, isKind(e, kind) { return e instanceof Error && e.code === kind; }, }, event: { EventEmitter: external_node_events_.EventEmitter }, fs: { chmod(location, mode) { return external_node_fs_namespaceObject.promises.chmod(toFsPathLike(location), mode); }, async mkdir(location, options) { return void (await external_node_fs_namespaceObject.promises.mkdir(toFsPathLike(location), options)); }, readdir(location) { return external_node_fs_namespaceObject.promises.readdir(toFsPathLike(location), { encoding: 'utf-8', withFileTypes: true }); }, readFile(location) { return external_node_fs_namespaceObject.promises.readFile(toFsPathLike(location)); }, async showFile(location) { const execFile = (0,external_node_util_.promisify)(external_node_child_process_namespaceObject.execFile); let command; switch (external_node_process_namespaceObject.platform) { case 'darwin': command = 'open'; break; case 'win32': command = 'explorer'; break; default: command = 'xdg-open'; break; } return void (await execFile(command, [toPath(location)])); }, stat(location) { return external_node_fs_namespaceObject.promises.stat(toFsPathLike(location)); }, unlink(location) { return external_node_fs_namespaceObject.promises.unlink(toFsPathLike(location)); }, watch(locations, { usePolling = false } = {}) { return new ChokidarWatcherWrapper(chokidar.watch(locations.map(toPath), { usePolling, disableGlobbing: true, })); }, writeFile(location, data, options) { return external_node_fs_namespaceObject.promises.writeFile(toFsPathLike(location), data, options); }, }, }; Object.freeze(NodeJsExternals); /** * @returns A {@link fs.PathLike}. */ function toFsPathLike(path) { if (path instanceof Uri) { // Convert WHATWG URL to string so that it will be converted // to Node.js URL by the next if-block. path = path.toString(); } if (typeof path === 'string' && path.startsWith('file:')) { return new external_node_url_namespaceObject.URL(path); } return path; } function toPath(path) { if (typeof path === 'string' && !path.startsWith('file:')) { return path; } return uriToPath(path); } const uriToPath = (uri) => external_node_url_namespaceObject.fileURLToPath(uri instanceof Uri ? new external_node_url_namespaceObject.URL(uri.toString()) : uri); const uriFromPath = (path) => external_node_url_namespaceObject.pathToFileURL(path).toString(); class ChokidarWatcherWrapper extends external_node_events_.EventEmitter { #watcher; constructor(watcher) { super(); this.#watcher = watcher .on('ready', () => this.emit('ready')) .on('add', (path) => this.emit('add', uriFromPath(path))) .on('change', (path) => this.emit('change', uriFromPath(path))) .on('unlink', (path) => this.emit('unlink', uriFromPath(path))) .on('error', (e) => this.emit('error', e)); } close() { return this.#watcher.close(); } } //# sourceMappingURL=NodeJsExternals.js.map ;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/nodejs.js //# sourceMappingURL=nodejs.js.map // EXTERNAL MODULE: external "path" var external_path_ = __nccwpck_require__(6928); var external_path_default = /*#__PURE__*/__nccwpck_require__.n(external_path_); ;// CONCATENATED MODULE: ./node_modules/@isaacs/balanced-match/dist/esm/index.js const balanced = (a, b, str) => { const ma = a instanceof RegExp ? maybeMatch(a, str) : a; const mb = b instanceof RegExp ? maybeMatch(b, str) : b; const r = ma !== null && mb != null && esm_range(ma, mb, str); return (r && { start: r[0], end: r[1], pre: str.slice(0, r[0]), body: str.slice(r[0] + ma.length, r[1]), post: str.slice(r[1] + mb.length), }); }; const maybeMatch = (reg, str) => { const m = str.match(reg); return m ? m[0] : null; }; const esm_range = (a, b, str) => { let begs, beg, left, right = undefined, result; let ai = str.indexOf(a); let bi = str.indexOf(b, ai + 1); let i = ai; if (ai >= 0 && bi > 0) { if (a === b) { return [ai, bi]; } begs = []; left = str.length; while (i >= 0 && !result) { if (i === ai) { begs.push(i); ai = str.indexOf(a, i + 1); } else if (begs.length === 1) { const r = begs.pop(); if (r !== undefined) result = [r, bi]; } else { beg = begs.pop(); if (beg !== undefined && beg < left) { left = beg; right = bi; } bi = str.indexOf(b, i + 1); } i = ai < bi && ai >= 0 ? ai : bi; } if (begs.length && right !== undefined) { result = [left, right]; } } return result; }; //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@isaacs/brace-expansion/dist/esm/index.js const escSlash = '\0SLASH' + Math.random() + '\0'; const escOpen = '\0OPEN' + Math.random() + '\0'; const escClose = '\0CLOSE' + Math.random() + '\0'; const escComma = '\0COMMA' + Math.random() + '\0'; const escPeriod = '\0PERIOD' + Math.random() + '\0'; const escSlashPattern = new RegExp(escSlash, 'g'); const escOpenPattern = new RegExp(escOpen, 'g'); const escClosePattern = new RegExp(escClose, 'g'); const escCommaPattern = new RegExp(escComma, 'g'); const escPeriodPattern = new RegExp(escPeriod, 'g'); const slashPattern = /\\\\/g; const openPattern = /\\{/g; const closePattern = /\\}/g; const commaPattern = /\\,/g; const periodPattern = /\\./g; function numeric(str) { return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0); } function escapeBraces(str) { return str .replace(slashPattern, escSlash) .replace(openPattern, escOpen) .replace(closePattern, escClose) .replace(commaPattern, escComma) .replace(periodPattern, escPeriod); } function unescapeBraces(str) { return str .replace(escSlashPattern, '\\') .replace(escOpenPattern, '{') .replace(escClosePattern, '}') .replace(escCommaPattern, ',') .replace(escPeriodPattern, '.'); } /** * Basically just str.split(","), but handling cases * where we have nested braced sections, which should be * treated as individual members, like {a,{b,c},d} */ function parseCommaParts(str) { if (!str) { return ['']; } const parts = []; const m = balanced('{', '}', str); if (!m) { return str.split(','); } const { pre, body, post } = m; const p = pre.split(','); p[p.length - 1] += '{' + body + '}'; const postParts = parseCommaParts(post); if (post.length) { ; p[p.length - 1] += postParts.shift(); p.push.apply(p, postParts); } parts.push.apply(parts, p); return parts; } function expand(str) { if (!str) { return []; } // I don't know why Bash 4.3 does this, but it does. // Anything starting with {} will have the first two bytes preserved // but *only* at the top level, so {},a}b will not expand to anything, // but a{},b}c will be expanded to [a}c,abc]. // One could argue that this is a bug in Bash, but since the goal of // this module is to match Bash's rules, we escape a leading {} if (str.slice(0, 2) === '{}') { str = '\\{\\}' + str.slice(2); } return expand_(escapeBraces(str), true).map(unescapeBraces); } function embrace(str) { return '{' + str + '}'; } function isPadded(el) { return /^-?0\d/.test(el); } function lte(i, y) { return i <= y; } function gte(i, y) { return i >= y; } function expand_(str, isTop) { /** @type {string[]} */ const expansions = []; const m = balanced('{', '}', str); if (!m) return [str]; // no need to expand pre, since it is guaranteed to be free of brace-sets const pre = m.pre; const post = m.post.length ? expand_(m.post, false) : ['']; if (/\$$/.test(m.pre)) { for (let k = 0; k < post.length; k++) { const expansion = pre + '{' + m.body + '}' + post[k]; expansions.push(expansion); } } else { const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); const isSequence = isNumericSequence || isAlphaSequence; const isOptions = m.body.indexOf(',') >= 0; if (!isSequence && !isOptions) { // {a},b} if (m.post.match(/,(?!,).*\}/)) { str = m.pre + '{' + m.body + escClose + m.post; return expand_(str); } return [str]; } let n; if (isSequence) { n = m.body.split(/\.\./); } else { n = parseCommaParts(m.body); if (n.length === 1 && n[0] !== undefined) { // x{{a,b}}y ==> x{a}y x{b}y n = expand_(n[0], false).map(embrace); //XXX is this necessary? Can't seem to hit it in tests. /* c8 ignore start */ if (n.length === 1) { return post.map(p => m.pre + n[0] + p); } /* c8 ignore stop */ } } // at this point, n is the parts, and we know it's not a comma set // with a single entry. let N; if (isSequence && n[0] !== undefined && n[1] !== undefined) { const x = numeric(n[0]); const y = numeric(n[1]); const width = Math.max(n[0].length, n[1].length); let incr = n.length === 3 && n[2] !== undefined ? Math.abs(numeric(n[2])) : 1; let test = lte; const reverse = y < x; if (reverse) { incr *= -1; test = gte; } const pad = n.some(isPadded); N = []; for (let i = x; test(i, y); i += incr) { let c; if (isAlphaSequence) { c = String.fromCharCode(i); if (c === '\\') { c = ''; } } else { c = String(i); if (pad) { const need = width - c.length; if (need > 0) { const z = new Array(need + 1).join('0'); if (i < 0) { c = '-' + z + c.slice(1); } else { c = z + c; } } } } N.push(c); } } else { N = []; for (let j = 0; j < n.length; j++) { N.push.apply(N, expand_(n[j], false)); } } for (let j = 0; j < N.length; j++) { for (let k = 0; k < post.length; k++) { const expansion = pre + N[j] + post[k]; if (!isTop || isSequence || expansion) { expansions.push(expansion); } } } } return expansions; } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/minimatch/dist/esm/assert-valid-pattern.js const MAX_PATTERN_LENGTH = 1024 * 64; const assertValidPattern = (pattern) => { if (typeof pattern !== 'string') { throw new TypeError('invalid pattern'); } if (pattern.length > MAX_PATTERN_LENGTH) { throw new TypeError('pattern is too long'); } }; //# sourceMappingURL=assert-valid-pattern.js.map ;// CONCATENATED MODULE: ./node_modules/minimatch/dist/esm/brace-expressions.js // translate the various posix character classes into unicode properties // this works across all unicode locales // { : [, /u flag required, negated] const posixClasses = { '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true], '[:alpha:]': ['\\p{L}\\p{Nl}', true], '[:ascii:]': ['\\x' + '00-\\x' + '7f', false], '[:blank:]': ['\\p{Zs}\\t', true], '[:cntrl:]': ['\\p{Cc}', true], '[:digit:]': ['\\p{Nd}', true], '[:graph:]': ['\\p{Z}\\p{C}', true, true], '[:lower:]': ['\\p{Ll}', true], '[:print:]': ['\\p{C}', true], '[:punct:]': ['\\p{P}', true], '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true], '[:upper:]': ['\\p{Lu}', true], '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true], '[:xdigit:]': ['A-Fa-f0-9', false], }; // only need to escape a few things inside of brace expressions // escapes: [ \ ] - const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&'); // escape all regexp magic characters const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); // everything has already been escaped, we just have to join const rangesToString = (ranges) => ranges.join(''); // takes a glob string at a posix brace expression, and returns // an equivalent regular expression source, and boolean indicating // whether the /u flag needs to be applied, and the number of chars // consumed to parse the character class. // This also removes out of order ranges, and returns ($.) if the // entire class just no good. const parseClass = (glob, position) => { const pos = position; /* c8 ignore start */ if (glob.charAt(pos) !== '[') { throw new Error('not in a brace expression'); } /* c8 ignore stop */ const ranges = []; const negs = []; let i = pos + 1; let sawStart = false; let uflag = false; let escaping = false; let negate = false; let endPos = pos; let rangeStart = ''; WHILE: while (i < glob.length) { const c = glob.charAt(i); if ((c === '!' || c === '^') && i === pos + 1) { negate = true; i++; continue; } if (c === ']' && sawStart && !escaping) { endPos = i + 1; break; } sawStart = true; if (c === '\\') { if (!escaping) { escaping = true; i++; continue; } // escaped \ char, fall through and treat like normal char } if (c === '[' && !escaping) { // either a posix class, a collation equivalent, or just a [ for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) { if (glob.startsWith(cls, i)) { // invalid, [a-[] is fine, but not [a-[:alpha]] if (rangeStart) { return ['$.', false, glob.length - pos, true]; } i += cls.length; if (neg) negs.push(unip); else ranges.push(unip); uflag = uflag || u; continue WHILE; } } } // now it's just a normal character, effectively escaping = false; if (rangeStart) { // throw this range away if it's not valid, but others // can still match. if (c > rangeStart) { ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c)); } else if (c === rangeStart) { ranges.push(braceEscape(c)); } rangeStart = ''; i++; continue; } // now might be the start of a range. // can be either c-d or c-] or c] or c] at this point if (glob.startsWith('-]', i + 1)) { ranges.push(braceEscape(c + '-')); i += 2; continue; } if (glob.startsWith('-', i + 1)) { rangeStart = c; i += 2; continue; } // not the start of a range, just a single character ranges.push(braceEscape(c)); i++; } if (endPos < i) { // didn't see the end of the class, not a valid class, // but might still be valid as a literal match. return ['', false, 0, false]; } // if we got no ranges and no negates, then we have a range that // cannot possibly match anything, and that poisons the whole glob if (!ranges.length && !negs.length) { return ['$.', false, glob.length - pos, true]; } // if we got one positive range, and it's a single character, then that's // not actually a magic pattern, it's just that one literal character. // we should not treat that as "magic", we should just return the literal // character. [_] is a perfectly valid way to escape glob magic chars. if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) { const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]; return [regexpEscape(r), false, endPos - pos, false]; } const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'; const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'; const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')' : ranges.length ? sranges : snegs; return [comb, uflag, endPos - pos, true]; }; //# sourceMappingURL=brace-expressions.js.map ;// CONCATENATED MODULE: ./node_modules/minimatch/dist/esm/unescape.js /** * Un-escape a string that has been escaped with {@link escape}. * * If the {@link windowsPathsNoEscape} option is used, then square-brace * escapes are removed, but not backslash escapes. For example, it will turn * the string `'[*]'` into `*`, but it will not turn `'\\*'` into `'*'`, * becuase `\` is a path separator in `windowsPathsNoEscape` mode. * * When `windowsPathsNoEscape` is not set, then both brace escapes and * backslash escapes are removed. * * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped * or unescaped. */ const unescape_unescape = (s, { windowsPathsNoEscape = false, } = {}) => { return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, '$1') : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2').replace(/\\([^\/])/g, '$1'); }; //# sourceMappingURL=unescape.js.map ;// CONCATENATED MODULE: ./node_modules/minimatch/dist/esm/ast.js // parse a single path portion const types = new Set(['!', '?', '+', '*', '@']); const isExtglobType = (c) => types.has(c); // Patterns that get prepended to bind to the start of either the // entire string, or just a single path portion, to prevent dots // and/or traversal patterns, when needed. // Exts don't need the ^ or / bit, because the root binds that already. const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))'; const startNoDot = '(?!\\.)'; // characters that indicate a start of pattern needs the "no dots" bit, // because a dot *might* be matched. ( is not in the list, because in // the case of a child extglob, it will handle the prevention itself. const addPatternStart = new Set(['[', '.']); // cases where traversal is A-OK, no dot prevention needed const justDots = new Set(['..', '.']); const reSpecials = new Set('().*{}+?[]^$\\!'); const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); // any single thing other than / const qmark = '[^/]'; // * => any number of characters const star = qmark + '*?'; // use + when we need to ensure that *something* matches, because the * is // the only thing in the path portion. const starNoEmpty = qmark + '+?'; // remove the \ chars that we added if we end up doing a nonmagic compare // const deslash = (s: string) => s.replace(/\\(.)/g, '$1') class AST { type; #root; #hasMagic; #uflag = false; #parts = []; #parent; #parentIndex; #negs; #filledNegs = false; #options; #toString; // set to true if it's an extglob with no children // (which really means one child of '') #emptyExt = false; constructor(type, parent, options = {}) { this.type = type; // extglobs are inherently magical if (type) this.#hasMagic = true; this.#parent = parent; this.#root = this.#parent ? this.#parent.#root : this; this.#options = this.#root === this ? options : this.#root.#options; this.#negs = this.#root === this ? [] : this.#root.#negs; if (type === '!' && !this.#root.#filledNegs) this.#negs.push(this); this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0; } get hasMagic() { /* c8 ignore start */ if (this.#hasMagic !== undefined) return this.#hasMagic; /* c8 ignore stop */ for (const p of this.#parts) { if (typeof p === 'string') continue; if (p.type || p.hasMagic) return (this.#hasMagic = true); } // note: will be undefined until we generate the regexp src and find out return this.#hasMagic; } // reconstructs the pattern toString() { if (this.#toString !== undefined) return this.#toString; if (!this.type) { return (this.#toString = this.#parts.map(p => String(p)).join('')); } else { return (this.#toString = this.type + '(' + this.#parts.map(p => String(p)).join('|') + ')'); } } #fillNegs() { /* c8 ignore start */ if (this !== this.#root) throw new Error('should only call on root'); if (this.#filledNegs) return this; /* c8 ignore stop */ // call toString() once to fill this out this.toString(); this.#filledNegs = true; let n; while ((n = this.#negs.pop())) { if (n.type !== '!') continue; // walk up the tree, appending everthing that comes AFTER parentIndex let p = n; let pp = p.#parent; while (pp) { for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) { for (const part of n.#parts) { /* c8 ignore start */ if (typeof part === 'string') { throw new Error('string part in extglob AST??'); } /* c8 ignore stop */ part.copyIn(pp.#parts[i]); } } p = pp; pp = p.#parent; } } return this; } push(...parts) { for (const p of parts) { if (p === '') continue; /* c8 ignore start */ if (typeof p !== 'string' && !(p instanceof AST && p.#parent === this)) { throw new Error('invalid part: ' + p); } /* c8 ignore stop */ this.#parts.push(p); } } toJSON() { const ret = this.type === null ? this.#parts.slice().map(p => (typeof p === 'string' ? p : p.toJSON())) : [this.type, ...this.#parts.map(p => p.toJSON())]; if (this.isStart() && !this.type) ret.unshift([]); if (this.isEnd() && (this === this.#root || (this.#root.#filledNegs && this.#parent?.type === '!'))) { ret.push({}); } return ret; } isStart() { if (this.#root === this) return true; // if (this.type) return !!this.#parent?.isStart() if (!this.#parent?.isStart()) return false; if (this.#parentIndex === 0) return true; // if everything AHEAD of this is a negation, then it's still the "start" const p = this.#parent; for (let i = 0; i < this.#parentIndex; i++) { const pp = p.#parts[i]; if (!(pp instanceof AST && pp.type === '!')) { return false; } } return true; } isEnd() { if (this.#root === this) return true; if (this.#parent?.type === '!') return true; if (!this.#parent?.isEnd()) return false; if (!this.type) return this.#parent?.isEnd(); // if not root, it'll always have a parent /* c8 ignore start */ const pl = this.#parent ? this.#parent.#parts.length : 0; /* c8 ignore stop */ return this.#parentIndex === pl - 1; } copyIn(part) { if (typeof part === 'string') this.push(part); else this.push(part.clone(this)); } clone(parent) { const c = new AST(this.type, parent); for (const p of this.#parts) { c.copyIn(p); } return c; } static #parseAST(str, ast, pos, opt) { let escaping = false; let inBrace = false; let braceStart = -1; let braceNeg = false; if (ast.type === null) { // outside of a extglob, append until we find a start let i = pos; let acc = ''; while (i < str.length) { const c = str.charAt(i++); // still accumulate escapes at this point, but we do ignore // starts that are escaped if (escaping || c === '\\') { escaping = !escaping; acc += c; continue; } if (inBrace) { if (i === braceStart + 1) { if (c === '^' || c === '!') { braceNeg = true; } } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { inBrace = false; } acc += c; continue; } else if (c === '[') { inBrace = true; braceStart = i; braceNeg = false; acc += c; continue; } if (!opt.noext && isExtglobType(c) && str.charAt(i) === '(') { ast.push(acc); acc = ''; const ext = new AST(c, ast); i = AST.#parseAST(str, ext, i, opt); ast.push(ext); continue; } acc += c; } ast.push(acc); return i; } // some kind of extglob, pos is at the ( // find the next | or ) let i = pos + 1; let part = new AST(null, ast); const parts = []; let acc = ''; while (i < str.length) { const c = str.charAt(i++); // still accumulate escapes at this point, but we do ignore // starts that are escaped if (escaping || c === '\\') { escaping = !escaping; acc += c; continue; } if (inBrace) { if (i === braceStart + 1) { if (c === '^' || c === '!') { braceNeg = true; } } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { inBrace = false; } acc += c; continue; } else if (c === '[') { inBrace = true; braceStart = i; braceNeg = false; acc += c; continue; } if (isExtglobType(c) && str.charAt(i) === '(') { part.push(acc); acc = ''; const ext = new AST(c, part); part.push(ext); i = AST.#parseAST(str, ext, i, opt); continue; } if (c === '|') { part.push(acc); acc = ''; parts.push(part); part = new AST(null, ast); continue; } if (c === ')') { if (acc === '' && ast.#parts.length === 0) { ast.#emptyExt = true; } part.push(acc); acc = ''; ast.push(...parts, part); return i; } acc += c; } // unfinished extglob // if we got here, it was a malformed extglob! not an extglob, but // maybe something else in there. ast.type = null; ast.#hasMagic = undefined; ast.#parts = [str.substring(pos - 1)]; return i; } static fromGlob(pattern, options = {}) { const ast = new AST(null, undefined, options); AST.#parseAST(pattern, ast, 0, options); return ast; } // returns the regular expression if there's magic, or the unescaped // string if not. toMMPattern() { // should only be called on root /* c8 ignore start */ if (this !== this.#root) return this.#root.toMMPattern(); /* c8 ignore stop */ const glob = this.toString(); const [re, body, hasMagic, uflag] = this.toRegExpSource(); // if we're in nocase mode, and not nocaseMagicOnly, then we do // still need a regular expression if we have to case-insensitively // match capital/lowercase characters. const anyMagic = hasMagic || this.#hasMagic || (this.#options.nocase && !this.#options.nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase()); if (!anyMagic) { return body; } const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : ''); return Object.assign(new RegExp(`^${re}$`, flags), { _src: re, _glob: glob, }); } get options() { return this.#options; } // returns the string match, the regexp source, whether there's magic // in the regexp (so a regular expression is required) and whether or // not the uflag is needed for the regular expression (for posix classes) // TODO: instead of injecting the start/end at this point, just return // the BODY of the regexp, along with the start/end portions suitable // for binding the start/end in either a joined full-path makeRe context // (where we bind to (^|/), or a standalone matchPart context (where // we bind to ^, and not /). Otherwise slashes get duped! // // In part-matching mode, the start is: // - if not isStart: nothing // - if traversal possible, but not allowed: ^(?!\.\.?$) // - if dots allowed or not possible: ^ // - if dots possible and not allowed: ^(?!\.) // end is: // - if not isEnd(): nothing // - else: $ // // In full-path matching mode, we put the slash at the START of the // pattern, so start is: // - if first pattern: same as part-matching mode // - if not isStart(): nothing // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/)) // - if dots allowed or not possible: / // - if dots possible and not allowed: /(?!\.) // end is: // - if last pattern, same as part-matching mode // - else nothing // // Always put the (?:$|/) on negated tails, though, because that has to be // there to bind the end of the negated pattern portion, and it's easier to // just stick it in now rather than try to inject it later in the middle of // the pattern. // // We can just always return the same end, and leave it up to the caller // to know whether it's going to be used joined or in parts. // And, if the start is adjusted slightly, can do the same there: // - if not isStart: nothing // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$) // - if dots allowed or not possible: (?:/|^) // - if dots possible and not allowed: (?:/|^)(?!\.) // // But it's better to have a simpler binding without a conditional, for // performance, so probably better to return both start options. // // Then the caller just ignores the end if it's not the first pattern, // and the start always gets applied. // // But that's always going to be $ if it's the ending pattern, or nothing, // so the caller can just attach $ at the end of the pattern when building. // // So the todo is: // - better detect what kind of start is needed // - return both flavors of starting pattern // - attach $ at the end of the pattern when creating the actual RegExp // // Ah, but wait, no, that all only applies to the root when the first pattern // is not an extglob. If the first pattern IS an extglob, then we need all // that dot prevention biz to live in the extglob portions, because eg // +(*|.x*) can match .xy but not .yx. // // So, return the two flavors if it's #root and the first child is not an // AST, otherwise leave it to the child AST to handle it, and there, // use the (?:^|/) style of start binding. // // Even simplified further: // - Since the start for a join is eg /(?!\.) and the start for a part // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root // or start or whatever) and prepend ^ or / at the Regexp construction. toRegExpSource(allowDot) { const dot = allowDot ?? !!this.#options.dot; if (this.#root === this) this.#fillNegs(); if (!this.type) { const noEmpty = this.isStart() && this.isEnd(); const src = this.#parts .map(p => { const [re, _, hasMagic, uflag] = typeof p === 'string' ? AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot); this.#hasMagic = this.#hasMagic || hasMagic; this.#uflag = this.#uflag || uflag; return re; }) .join(''); let start = ''; if (this.isStart()) { if (typeof this.#parts[0] === 'string') { // this is the string that will match the start of the pattern, // so we need to protect against dots and such. // '.' and '..' cannot match unless the pattern is that exactly, // even if it starts with . or dot:true is set. const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]); if (!dotTravAllowed) { const aps = addPatternStart; // check if we have a possibility of matching . or .., // and prevent that. const needNoTrav = // dots are allowed, and the pattern starts with [ or . (dot && aps.has(src.charAt(0))) || // the pattern starts with \., and then [ or . (src.startsWith('\\.') && aps.has(src.charAt(2))) || // the pattern starts with \.\., and then [ or . (src.startsWith('\\.\\.') && aps.has(src.charAt(4))); // no need to prevent dots if it can't match a dot, or if a // sub-pattern will be preventing it anyway. const needNoDot = !dot && !allowDot && aps.has(src.charAt(0)); start = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : ''; } } } // append the "end of path portion" pattern to negation tails let end = ''; if (this.isEnd() && this.#root.#filledNegs && this.#parent?.type === '!') { end = '(?:$|\\/)'; } const final = start + src + end; return [ final, unescape_unescape(src), (this.#hasMagic = !!this.#hasMagic), this.#uflag, ]; } // We need to calculate the body *twice* if it's a repeat pattern // at the start, once in nodot mode, then again in dot mode, so a // pattern like *(?) can match 'x.y' const repeated = this.type === '*' || this.type === '+'; // some kind of extglob const start = this.type === '!' ? '(?:(?!(?:' : '(?:'; let body = this.#partsToRegExp(dot); if (this.isStart() && this.isEnd() && !body && this.type !== '!') { // invalid extglob, has to at least be *something* present, if it's // the entire path portion. const s = this.toString(); this.#parts = [s]; this.type = null; this.#hasMagic = undefined; return [s, unescape_unescape(this.toString()), false, false]; } // XXX abstract out this map method let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? '' : this.#partsToRegExp(true); if (bodyDotAllowed === body) { bodyDotAllowed = ''; } if (bodyDotAllowed) { body = `(?:${body})(?:${bodyDotAllowed})*?`; } // an empty !() is exactly equivalent to a starNoEmpty let final = ''; if (this.type === '!' && this.#emptyExt) { final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty; } else { const close = this.type === '!' ? // !() must match something,but !(x) can match '' '))' + (this.isStart() && !dot && !allowDot ? startNoDot : '') + star + ')' : this.type === '@' ? ')' : this.type === '?' ? ')?' : this.type === '+' && bodyDotAllowed ? ')' : this.type === '*' && bodyDotAllowed ? `)?` : `)${this.type}`; final = start + body + close; } return [ final, unescape_unescape(body), (this.#hasMagic = !!this.#hasMagic), this.#uflag, ]; } #partsToRegExp(dot) { return this.#parts .map(p => { // extglob ASTs should only contain parent ASTs /* c8 ignore start */ if (typeof p === 'string') { throw new Error('string type in extglob ast??'); } /* c8 ignore stop */ // can ignore hasMagic, because extglobs are already always magic const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot); this.#uflag = this.#uflag || uflag; return re; }) .filter(p => !(this.isStart() && this.isEnd()) || !!p) .join('|'); } static #parseGlob(glob, hasMagic, noEmpty = false) { let escaping = false; let re = ''; let uflag = false; for (let i = 0; i < glob.length; i++) { const c = glob.charAt(i); if (escaping) { escaping = false; re += (reSpecials.has(c) ? '\\' : '') + c; continue; } if (c === '\\') { if (i === glob.length - 1) { re += '\\\\'; } else { escaping = true; } continue; } if (c === '[') { const [src, needUflag, consumed, magic] = parseClass(glob, i); if (consumed) { re += src; uflag = uflag || needUflag; i += consumed - 1; hasMagic = hasMagic || magic; continue; } } if (c === '*') { if (noEmpty && glob === '*') re += starNoEmpty; else re += star; hasMagic = true; continue; } if (c === '?') { re += qmark; hasMagic = true; continue; } re += regExpEscape(c); } return [re, unescape_unescape(glob), !!hasMagic, uflag]; } } //# sourceMappingURL=ast.js.map ;// CONCATENATED MODULE: ./node_modules/minimatch/dist/esm/escape.js /** * Escape all magic characters in a glob pattern. * * If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape} * option is used, then characters are escaped by wrapping in `[]`, because * a magic character wrapped in a character class can only be satisfied by * that exact character. In this mode, `\` is _not_ escaped, because it is * not interpreted as a magic character, but instead as a path separator. */ const escape_escape = (s, { windowsPathsNoEscape = false, } = {}) => { // don't need to escape +@! because we escape the parens // that make those magic, and escaping ! as [!] isn't valid, // because [!]] is a valid glob class meaning not ']'. return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, '[$&]') : s.replace(/[?*()[\]\\]/g, '\\$&'); }; //# sourceMappingURL=escape.js.map ;// CONCATENATED MODULE: ./node_modules/minimatch/dist/esm/index.js const minimatch = (p, pattern, options = {}) => { assertValidPattern(pattern); // shortcut: comments match nothing. if (!options.nocomment && pattern.charAt(0) === '#') { return false; } return new Minimatch(pattern, options).match(p); }; // Optimized checking for the most common glob patterns. const starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/; const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext); const starDotExtTestDot = (ext) => (f) => f.endsWith(ext); const starDotExtTestNocase = (ext) => { ext = ext.toLowerCase(); return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext); }; const starDotExtTestNocaseDot = (ext) => { ext = ext.toLowerCase(); return (f) => f.toLowerCase().endsWith(ext); }; const starDotStarRE = /^\*+\.\*+$/; const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.'); const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.'); const dotStarRE = /^\.\*+$/; const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.'); const starRE = /^\*+$/; const starTest = (f) => f.length !== 0 && !f.startsWith('.'); const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..'; const qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/; const qmarksTestNocase = ([$0, ext = '']) => { const noext = qmarksTestNoExt([$0]); if (!ext) return noext; ext = ext.toLowerCase(); return (f) => noext(f) && f.toLowerCase().endsWith(ext); }; const qmarksTestNocaseDot = ([$0, ext = '']) => { const noext = qmarksTestNoExtDot([$0]); if (!ext) return noext; ext = ext.toLowerCase(); return (f) => noext(f) && f.toLowerCase().endsWith(ext); }; const qmarksTestDot = ([$0, ext = '']) => { const noext = qmarksTestNoExtDot([$0]); return !ext ? noext : (f) => noext(f) && f.endsWith(ext); }; const qmarksTest = ([$0, ext = '']) => { const noext = qmarksTestNoExt([$0]); return !ext ? noext : (f) => noext(f) && f.endsWith(ext); }; const qmarksTestNoExt = ([$0]) => { const len = $0.length; return (f) => f.length === len && !f.startsWith('.'); }; const qmarksTestNoExtDot = ([$0]) => { const len = $0.length; return (f) => f.length === len && f !== '.' && f !== '..'; }; /* c8 ignore start */ const defaultPlatform = (typeof process === 'object' && process ? (typeof process.env === 'object' && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__) || process.platform : 'posix'); const esm_path = { win32: { sep: '\\' }, posix: { sep: '/' }, }; /* c8 ignore stop */ const sep = defaultPlatform === 'win32' ? esm_path.win32.sep : esm_path.posix.sep; minimatch.sep = sep; const GLOBSTAR = Symbol('globstar **'); minimatch.GLOBSTAR = GLOBSTAR; // any single thing other than / // don't need to escape / when using new RegExp() const esm_qmark = '[^/]'; // * => any number of characters const esm_star = esm_qmark + '*?'; // ** when dots are allowed. Anything goes, except .. and . // not (^ or / followed by one or two dots followed by $ or /), // followed by anything, any number of times. const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?'; // not a ^ or / followed by a dot, // followed by anything, any number of times. const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?'; const esm_filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options); minimatch.filter = esm_filter; const ext = (a, b = {}) => Object.assign({}, a, b); const defaults = (def) => { if (!def || typeof def !== 'object' || !Object.keys(def).length) { return minimatch; } const orig = minimatch; const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options)); return Object.assign(m, { Minimatch: class Minimatch extends orig.Minimatch { constructor(pattern, options = {}) { super(pattern, ext(def, options)); } static defaults(options) { return orig.defaults(ext(def, options)).Minimatch; } }, AST: class AST extends orig.AST { /* c8 ignore start */ constructor(type, parent, options = {}) { super(type, parent, ext(def, options)); } /* c8 ignore stop */ static fromGlob(pattern, options = {}) { return orig.AST.fromGlob(pattern, ext(def, options)); } }, unescape: (s, options = {}) => orig.unescape(s, ext(def, options)), escape: (s, options = {}) => orig.escape(s, ext(def, options)), filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)), defaults: (options) => orig.defaults(ext(def, options)), makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)), braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)), match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)), sep: orig.sep, GLOBSTAR: GLOBSTAR, }); }; minimatch.defaults = defaults; // Brace expansion: // a{b,c}d -> abd acd // a{b,}c -> abc ac // a{0..3}d -> a0d a1d a2d a3d // a{b,c{d,e}f}g -> abg acdfg acefg // a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg // // Invalid sets are not expanded. // a{2..}b -> a{2..}b // a{b}c -> a{b}c const braceExpand = (pattern, options = {}) => { assertValidPattern(pattern); // Thanks to Yeting Li for // improving this regexp to avoid a ReDOS vulnerability. if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { // shortcut. no need to expand. return [pattern]; } return expand(pattern); }; minimatch.braceExpand = braceExpand; // parse a component of the expanded set. // At this point, no pattern may contain "/" in it // so we're going to return a 2d array, where each entry is the full // pattern, split on '/', and then turned into a regular expression. // A regexp is made at the end which joins each array with an // escaped /, and another full one which joins each regexp with |. // // Following the lead of Bash 4.1, note that "**" only has special meaning // when it is the *only* thing in a path portion. Otherwise, any series // of * is equivalent to a single *. Globstar behavior is enabled by // default, and can be disabled by setting options.noglobstar. const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe(); minimatch.makeRe = makeRe; const match = (list, pattern, options = {}) => { const mm = new Minimatch(pattern, options); list = list.filter(f => mm.match(f)); if (mm.options.nonull && !list.length) { list.push(pattern); } return list; }; minimatch.match = match; // replace stuff like \* with * const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/; const esm_regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); class Minimatch { options; set; pattern; windowsPathsNoEscape; nonegate; negate; comment; empty; preserveMultipleSlashes; partial; globSet; globParts; nocase; isWindows; platform; windowsNoMagicRoot; regexp; constructor(pattern, options = {}) { assertValidPattern(pattern); options = options || {}; this.options = options; this.pattern = pattern; this.platform = options.platform || defaultPlatform; this.isWindows = this.platform === 'win32'; this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false; if (this.windowsPathsNoEscape) { this.pattern = this.pattern.replace(/\\/g, '/'); } this.preserveMultipleSlashes = !!options.preserveMultipleSlashes; this.regexp = null; this.negate = false; this.nonegate = !!options.nonegate; this.comment = false; this.empty = false; this.partial = !!options.partial; this.nocase = !!this.options.nocase; this.windowsNoMagicRoot = options.windowsNoMagicRoot !== undefined ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase); this.globSet = []; this.globParts = []; this.set = []; // make the set of regexps etc. this.make(); } hasMagic() { if (this.options.magicalBraces && this.set.length > 1) { return true; } for (const pattern of this.set) { for (const part of pattern) { if (typeof part !== 'string') return true; } } return false; } debug(..._) { } make() { const pattern = this.pattern; const options = this.options; // empty patterns and comments match nothing. if (!options.nocomment && pattern.charAt(0) === '#') { this.comment = true; return; } if (!pattern) { this.empty = true; return; } // step 1: figure out negation, etc. this.parseNegate(); // step 2: expand braces this.globSet = [...new Set(this.braceExpand())]; if (options.debug) { this.debug = (...args) => console.error(...args); } this.debug(this.pattern, this.globSet); // step 3: now we have a set, so turn each one into a series of // path-portion matching patterns. // These will be regexps, except in the case of "**", which is // set to the GLOBSTAR object for globstar behavior, // and will not contain any / characters // // First, we preprocess to make the glob pattern sets a bit simpler // and deduped. There are some perf-killing patterns that can cause // problems with a glob walk, but we can simplify them down a bit. const rawGlobParts = this.globSet.map(s => this.slashSplit(s)); this.globParts = this.preprocess(rawGlobParts); this.debug(this.pattern, this.globParts); // glob --> regexps let set = this.globParts.map((s, _, __) => { if (this.isWindows && this.windowsNoMagicRoot) { // check if it's a drive or unc path. const isUNC = s[0] === '' && s[1] === '' && (s[2] === '?' || !globMagic.test(s[2])) && !globMagic.test(s[3]); const isDrive = /^[a-z]:/i.test(s[0]); if (isUNC) { return [...s.slice(0, 4), ...s.slice(4).map(ss => this.parse(ss))]; } else if (isDrive) { return [s[0], ...s.slice(1).map(ss => this.parse(ss))]; } } return s.map(ss => this.parse(ss)); }); this.debug(this.pattern, set); // filter out everything that didn't compile properly. this.set = set.filter(s => s.indexOf(false) === -1); // do not treat the ? in UNC paths as magic if (this.isWindows) { for (let i = 0; i < this.set.length; i++) { const p = this.set[i]; if (p[0] === '' && p[1] === '' && this.globParts[i][2] === '?' && typeof p[3] === 'string' && /^[a-z]:$/i.test(p[3])) { p[2] = '?'; } } } this.debug(this.pattern, this.set); } // various transforms to equivalent pattern sets that are // faster to process in a filesystem walk. The goal is to // eliminate what we can, and push all ** patterns as far // to the right as possible, even if it increases the number // of patterns that we have to process. preprocess(globParts) { // if we're not in globstar mode, then turn all ** into * if (this.options.noglobstar) { for (let i = 0; i < globParts.length; i++) { for (let j = 0; j < globParts[i].length; j++) { if (globParts[i][j] === '**') { globParts[i][j] = '*'; } } } } const { optimizationLevel = 1 } = this.options; if (optimizationLevel >= 2) { // aggressive optimization for the purpose of fs walking globParts = this.firstPhasePreProcess(globParts); globParts = this.secondPhasePreProcess(globParts); } else if (optimizationLevel >= 1) { // just basic optimizations to remove some .. parts globParts = this.levelOneOptimize(globParts); } else { // just collapse multiple ** portions into one globParts = this.adjascentGlobstarOptimize(globParts); } return globParts; } // just get rid of adjascent ** portions adjascentGlobstarOptimize(globParts) { return globParts.map(parts => { let gs = -1; while (-1 !== (gs = parts.indexOf('**', gs + 1))) { let i = gs; while (parts[i + 1] === '**') { i++; } if (i !== gs) { parts.splice(gs, i - gs); } } return parts; }); } // get rid of adjascent ** and resolve .. portions levelOneOptimize(globParts) { return globParts.map(parts => { parts = parts.reduce((set, part) => { const prev = set[set.length - 1]; if (part === '**' && prev === '**') { return set; } if (part === '..') { if (prev && prev !== '..' && prev !== '.' && prev !== '**') { set.pop(); return set; } } set.push(part); return set; }, []); return parts.length === 0 ? [''] : parts; }); } levelTwoFileOptimize(parts) { if (!Array.isArray(parts)) { parts = this.slashSplit(parts); } let didSomething = false; do { didSomething = false; //
// -> 
/
            if (!this.preserveMultipleSlashes) {
                for (let i = 1; i < parts.length - 1; i++) {
                    const p = parts[i];
                    // don't squeeze out UNC patterns
                    if (i === 1 && p === '' && parts[0] === '')
                        continue;
                    if (p === '.' || p === '') {
                        didSomething = true;
                        parts.splice(i, 1);
                        i--;
                    }
                }
                if (parts[0] === '.' &&
                    parts.length === 2 &&
                    (parts[1] === '.' || parts[1] === '')) {
                    didSomething = true;
                    parts.pop();
                }
            }
            // 
/

/../ ->

/
            let dd = 0;
            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
                const p = parts[dd - 1];
                if (p && p !== '.' && p !== '..' && p !== '**') {
                    didSomething = true;
                    parts.splice(dd - 1, 2);
                    dd -= 2;
                }
            }
        } while (didSomething);
        return parts.length === 0 ? [''] : parts;
    }
    // First phase: single-pattern processing
    // 
 is 1 or more portions
    //  is 1 or more portions
    // 

is any portion other than ., .., '', or ** // is . or '' // // **/.. is *brutal* for filesystem walking performance, because // it effectively resets the recursive walk each time it occurs, // and ** cannot be reduced out by a .. pattern part like a regexp // or most strings (other than .., ., and '') can be. // //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/} //

// -> 
/
    // 
/

/../ ->

/
    // **/**/ -> **/
    //
    // **/*/ -> */**/ <== not valid because ** doesn't follow
    // this WOULD be allowed if ** did follow symlinks, or * didn't
    firstPhasePreProcess(globParts) {
        let didSomething = false;
        do {
            didSomething = false;
            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/} for (let parts of globParts) { let gs = -1; while (-1 !== (gs = parts.indexOf('**', gs + 1))) { let gss = gs; while (parts[gss + 1] === '**') { //

/**/**/ -> 
/**/
                        gss++;
                    }
                    // eg, if gs is 2 and gss is 4, that means we have 3 **
                    // parts, and can remove 2 of them.
                    if (gss > gs) {
                        parts.splice(gs + 1, gss - gs);
                    }
                    let next = parts[gs + 1];
                    const p = parts[gs + 2];
                    const p2 = parts[gs + 3];
                    if (next !== '..')
                        continue;
                    if (!p ||
                        p === '.' ||
                        p === '..' ||
                        !p2 ||
                        p2 === '.' ||
                        p2 === '..') {
                        continue;
                    }
                    didSomething = true;
                    // edit parts in place, and push the new one
                    parts.splice(gs, 1);
                    const other = parts.slice(0);
                    other[gs] = '**';
                    globParts.push(other);
                    gs--;
                }
                // 
// -> 
/
                if (!this.preserveMultipleSlashes) {
                    for (let i = 1; i < parts.length - 1; i++) {
                        const p = parts[i];
                        // don't squeeze out UNC patterns
                        if (i === 1 && p === '' && parts[0] === '')
                            continue;
                        if (p === '.' || p === '') {
                            didSomething = true;
                            parts.splice(i, 1);
                            i--;
                        }
                    }
                    if (parts[0] === '.' &&
                        parts.length === 2 &&
                        (parts[1] === '.' || parts[1] === '')) {
                        didSomething = true;
                        parts.pop();
                    }
                }
                // 
/

/../ ->

/
                let dd = 0;
                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
                    const p = parts[dd - 1];
                    if (p && p !== '.' && p !== '..' && p !== '**') {
                        didSomething = true;
                        const needDot = dd === 1 && parts[dd + 1] === '**';
                        const splin = needDot ? ['.'] : [];
                        parts.splice(dd - 1, 2, ...splin);
                        if (parts.length === 0)
                            parts.push('');
                        dd -= 2;
                    }
                }
            }
        } while (didSomething);
        return globParts;
    }
    // second phase: multi-pattern dedupes
    // {
/*/,
/

/} ->

/*/
    // {
/,
/} -> 
/
    // {
/**/,
/} -> 
/**/
    //
    // {
/**/,
/**/

/} ->

/**/
    // ^-- not valid because ** doens't follow symlinks
    secondPhasePreProcess(globParts) {
        for (let i = 0; i < globParts.length - 1; i++) {
            for (let j = i + 1; j < globParts.length; j++) {
                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
                if (matched) {
                    globParts[i] = [];
                    globParts[j] = matched;
                    break;
                }
            }
        }
        return globParts.filter(gs => gs.length);
    }
    partsMatch(a, b, emptyGSMatch = false) {
        let ai = 0;
        let bi = 0;
        let result = [];
        let which = '';
        while (ai < a.length && bi < b.length) {
            if (a[ai] === b[bi]) {
                result.push(which === 'b' ? b[bi] : a[ai]);
                ai++;
                bi++;
            }
            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
                result.push(a[ai]);
                ai++;
            }
            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
                result.push(b[bi]);
                bi++;
            }
            else if (a[ai] === '*' &&
                b[bi] &&
                (this.options.dot || !b[bi].startsWith('.')) &&
                b[bi] !== '**') {
                if (which === 'b')
                    return false;
                which = 'a';
                result.push(a[ai]);
                ai++;
                bi++;
            }
            else if (b[bi] === '*' &&
                a[ai] &&
                (this.options.dot || !a[ai].startsWith('.')) &&
                a[ai] !== '**') {
                if (which === 'a')
                    return false;
                which = 'b';
                result.push(b[bi]);
                ai++;
                bi++;
            }
            else {
                return false;
            }
        }
        // if we fall out of the loop, it means they two are identical
        // as long as their lengths match
        return a.length === b.length && result;
    }
    parseNegate() {
        if (this.nonegate)
            return;
        const pattern = this.pattern;
        let negate = false;
        let negateOffset = 0;
        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
            negate = !negate;
            negateOffset++;
        }
        if (negateOffset)
            this.pattern = pattern.slice(negateOffset);
        this.negate = negate;
    }
    // set partial to true to test if, for example,
    // "/a/b" matches the start of "/*/b/*/d"
    // Partial means, if you run out of file before you run
    // out of pattern, then that's fine, as long as all
    // the parts match.
    matchOne(file, pattern, partial = false) {
        const options = this.options;
        // UNC paths like //?/X:/... can match X:/... and vice versa
        // Drive letters in absolute drive or unc paths are always compared
        // case-insensitively.
        if (this.isWindows) {
            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
            const fileUNC = !fileDrive &&
                file[0] === '' &&
                file[1] === '' &&
                file[2] === '?' &&
                /^[a-z]:$/i.test(file[3]);
            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
            const patternUNC = !patternDrive &&
                pattern[0] === '' &&
                pattern[1] === '' &&
                pattern[2] === '?' &&
                typeof pattern[3] === 'string' &&
                /^[a-z]:$/i.test(pattern[3]);
            const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined;
            const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined;
            if (typeof fdi === 'number' && typeof pdi === 'number') {
                const [fd, pd] = [file[fdi], pattern[pdi]];
                if (fd.toLowerCase() === pd.toLowerCase()) {
                    pattern[pdi] = fd;
                    if (pdi > fdi) {
                        pattern = pattern.slice(pdi);
                    }
                    else if (fdi > pdi) {
                        file = file.slice(fdi);
                    }
                }
            }
        }
        // resolve and reduce . and .. portions in the file as well.
        // dont' need to do the second phase, because it's only one string[]
        const { optimizationLevel = 1 } = this.options;
        if (optimizationLevel >= 2) {
            file = this.levelTwoFileOptimize(file);
        }
        this.debug('matchOne', this, { file, pattern });
        this.debug('matchOne', file.length, pattern.length);
        for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
            this.debug('matchOne loop');
            var p = pattern[pi];
            var f = file[fi];
            this.debug(pattern, p, f);
            // should be impossible.
            // some invalid regexp stuff in the set.
            /* c8 ignore start */
            if (p === false) {
                return false;
            }
            /* c8 ignore stop */
            if (p === GLOBSTAR) {
                this.debug('GLOBSTAR', [pattern, p, f]);
                // "**"
                // a/**/b/**/c would match the following:
                // a/b/x/y/z/c
                // a/x/y/z/b/c
                // a/b/x/b/x/c
                // a/b/c
                // To do this, take the rest of the pattern after
                // the **, and see if it would match the file remainder.
                // If so, return success.
                // If not, the ** "swallows" a segment, and try again.
                // This is recursively awful.
                //
                // a/**/b/**/c matching a/b/x/y/z/c
                // - a matches a
                // - doublestar
                //   - matchOne(b/x/y/z/c, b/**/c)
                //     - b matches b
                //     - doublestar
                //       - matchOne(x/y/z/c, c) -> no
                //       - matchOne(y/z/c, c) -> no
                //       - matchOne(z/c, c) -> no
                //       - matchOne(c, c) yes, hit
                var fr = fi;
                var pr = pi + 1;
                if (pr === pl) {
                    this.debug('** at the end');
                    // a ** at the end will just swallow the rest.
                    // We have found a match.
                    // however, it will not swallow /.x, unless
                    // options.dot is set.
                    // . and .. are *never* matched by **, for explosively
                    // exponential reasons.
                    for (; fi < fl; fi++) {
                        if (file[fi] === '.' ||
                            file[fi] === '..' ||
                            (!options.dot && file[fi].charAt(0) === '.'))
                            return false;
                    }
                    return true;
                }
                // ok, let's see if we can swallow whatever we can.
                while (fr < fl) {
                    var swallowee = file[fr];
                    this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);
                    // XXX remove this slice.  Just pass the start index.
                    if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
                        this.debug('globstar found match!', fr, fl, swallowee);
                        // found a match.
                        return true;
                    }
                    else {
                        // can't swallow "." or ".." ever.
                        // can only swallow ".foo" when explicitly asked.
                        if (swallowee === '.' ||
                            swallowee === '..' ||
                            (!options.dot && swallowee.charAt(0) === '.')) {
                            this.debug('dot detected!', file, fr, pattern, pr);
                            break;
                        }
                        // ** swallows a segment, and continue.
                        this.debug('globstar swallow a segment, and continue');
                        fr++;
                    }
                }
                // no match was found.
                // However, in partial mode, we can't say this is necessarily over.
                /* c8 ignore start */
                if (partial) {
                    // ran out of file
                    this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
                    if (fr === fl) {
                        return true;
                    }
                }
                /* c8 ignore stop */
                return false;
            }
            // something other than **
            // non-magic patterns just have to match exactly
            // patterns with magic have been turned into regexps.
            let hit;
            if (typeof p === 'string') {
                hit = f === p;
                this.debug('string match', p, f, hit);
            }
            else {
                hit = p.test(f);
                this.debug('pattern match', p, f, hit);
            }
            if (!hit)
                return false;
        }
        // Note: ending in / means that we'll get a final ""
        // at the end of the pattern.  This can only match a
        // corresponding "" at the end of the file.
        // If the file ends in /, then it can only match a
        // a pattern that ends in /, unless the pattern just
        // doesn't have any more for it. But, a/b/ should *not*
        // match "a/b/*", even though "" matches against the
        // [^/]*? pattern, except in partial mode, where it might
        // simply not be reached yet.
        // However, a/b/ should still satisfy a/*
        // now either we fell off the end of the pattern, or we're done.
        if (fi === fl && pi === pl) {
            // ran out of pattern and filename at the same time.
            // an exact hit!
            return true;
        }
        else if (fi === fl) {
            // ran out of file, but still had pattern left.
            // this is ok if we're doing the match as part of
            // a glob fs traversal.
            return partial;
        }
        else if (pi === pl) {
            // ran out of pattern, still have file left.
            // this is only acceptable if we're on the very last
            // empty segment of a file with a trailing slash.
            // a/* should match a/b/
            return fi === fl - 1 && file[fi] === '';
            /* c8 ignore start */
        }
        else {
            // should be unreachable.
            throw new Error('wtf?');
        }
        /* c8 ignore stop */
    }
    braceExpand() {
        return braceExpand(this.pattern, this.options);
    }
    parse(pattern) {
        assertValidPattern(pattern);
        const options = this.options;
        // shortcuts
        if (pattern === '**')
            return GLOBSTAR;
        if (pattern === '')
            return '';
        // far and away, the most common glob pattern parts are
        // *, *.*, and *.  Add a fast check method for those.
        let m;
        let fastTest = null;
        if ((m = pattern.match(starRE))) {
            fastTest = options.dot ? starTestDot : starTest;
        }
        else if ((m = pattern.match(starDotExtRE))) {
            fastTest = (options.nocase
                ? options.dot
                    ? starDotExtTestNocaseDot
                    : starDotExtTestNocase
                : options.dot
                    ? starDotExtTestDot
                    : starDotExtTest)(m[1]);
        }
        else if ((m = pattern.match(qmarksRE))) {
            fastTest = (options.nocase
                ? options.dot
                    ? qmarksTestNocaseDot
                    : qmarksTestNocase
                : options.dot
                    ? qmarksTestDot
                    : qmarksTest)(m);
        }
        else if ((m = pattern.match(starDotStarRE))) {
            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
        }
        else if ((m = pattern.match(dotStarRE))) {
            fastTest = dotStarTest;
        }
        const re = AST.fromGlob(pattern, this.options).toMMPattern();
        if (fastTest && typeof re === 'object') {
            // Avoids overriding in frozen environments
            Reflect.defineProperty(re, 'test', { value: fastTest });
        }
        return re;
    }
    makeRe() {
        if (this.regexp || this.regexp === false)
            return this.regexp;
        // at this point, this.set is a 2d array of partial
        // pattern strings, or "**".
        //
        // It's better to use .match().  This function shouldn't
        // be used, really, but it's pretty convenient sometimes,
        // when you just want to work with a regex.
        const set = this.set;
        if (!set.length) {
            this.regexp = false;
            return this.regexp;
        }
        const options = this.options;
        const twoStar = options.noglobstar
            ? esm_star
            : options.dot
                ? twoStarDot
                : twoStarNoDot;
        const flags = new Set(options.nocase ? ['i'] : []);
        // regexpify non-globstar patterns
        // if ** is only item, then we just do one twoStar
        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
        // if ** is last, append (\/twoStar|) to previous
        // if ** is in the middle, append (\/|\/twoStar\/) to previous
        // then filter out GLOBSTAR symbols
        let re = set
            .map(pattern => {
            const pp = pattern.map(p => {
                if (p instanceof RegExp) {
                    for (const f of p.flags.split(''))
                        flags.add(f);
                }
                return typeof p === 'string'
                    ? esm_regExpEscape(p)
                    : p === GLOBSTAR
                        ? GLOBSTAR
                        : p._src;
            });
            pp.forEach((p, i) => {
                const next = pp[i + 1];
                const prev = pp[i - 1];
                if (p !== GLOBSTAR || prev === GLOBSTAR) {
                    return;
                }
                if (prev === undefined) {
                    if (next !== undefined && next !== GLOBSTAR) {
                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
                    }
                    else {
                        pp[i] = twoStar;
                    }
                }
                else if (next === undefined) {
                    pp[i - 1] = prev + '(?:\\/|' + twoStar + ')?';
                }
                else if (next !== GLOBSTAR) {
                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
                    pp[i + 1] = GLOBSTAR;
                }
            });
            return pp.filter(p => p !== GLOBSTAR).join('/');
        })
            .join('|');
        // need to wrap in parens if we had more than one thing with |,
        // otherwise only the first will be anchored to ^ and the last to $
        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
        // must match entire pattern
        // ending in a * or ** will make it less strict.
        re = '^' + open + re + close + '$';
        // can match anything, as long as it's not this.
        if (this.negate)
            re = '^(?!' + re + ').+$';
        try {
            this.regexp = new RegExp(re, [...flags].join(''));
            /* c8 ignore start */
        }
        catch (ex) {
            // should be impossible
            this.regexp = false;
        }
        /* c8 ignore stop */
        return this.regexp;
    }
    slashSplit(p) {
        // if p starts with // on windows, we preserve that
        // so that UNC paths aren't broken.  Otherwise, any number of
        // / characters are coalesced into one, unless
        // preserveMultipleSlashes is set to true.
        if (this.preserveMultipleSlashes) {
            return p.split('/');
        }
        else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
            // add an extra '' for the one we lose
            return ['', ...p.split(/\/+/)];
        }
        else {
            return p.split(/\/+/);
        }
    }
    match(f, partial = this.partial) {
        this.debug('match', f, this.pattern);
        // short-circuit in the case of busted things.
        // comments, etc.
        if (this.comment) {
            return false;
        }
        if (this.empty) {
            return f === '';
        }
        if (f === '/' && partial) {
            return true;
        }
        const options = this.options;
        // windows: need to use /, not \
        if (this.isWindows) {
            f = f.split('\\').join('/');
        }
        // treat the test path as a set of pathparts.
        const ff = this.slashSplit(f);
        this.debug(this.pattern, 'split', ff);
        // just ONE of the pattern sets in this.set needs to match
        // in order for it to be valid.  If negating, then just one
        // match means that we have failed.
        // Either way, return on the first hit.
        const set = this.set;
        this.debug(this.pattern, 'set', set);
        // Find the basename of the path by looking for the last non-empty segment
        let filename = ff[ff.length - 1];
        if (!filename) {
            for (let i = ff.length - 2; !filename && i >= 0; i--) {
                filename = ff[i];
            }
        }
        for (let i = 0; i < set.length; i++) {
            const pattern = set[i];
            let file = ff;
            if (options.matchBase && pattern.length === 1) {
                file = [filename];
            }
            const hit = this.matchOne(file, pattern, partial);
            if (hit) {
                if (options.flipNegate) {
                    return true;
                }
                return !this.negate;
            }
        }
        // didn't get any hits.  this is success if it's a negative
        // pattern, failure otherwise.
        if (options.flipNegate) {
            return false;
        }
        return this.negate;
    }
    static defaults(def) {
        return minimatch.defaults(def).Minimatch;
    }
}
/* c8 ignore start */



/* c8 ignore stop */
minimatch.AST = AST;
minimatch.Minimatch = Minimatch;
minimatch.escape = escape_escape;
minimatch.unescape = unescape_unescape;
//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ./node_modules/lru-cache/dist/esm/index.js
/**
 * @module LRUCache
 */
const defaultPerf = (typeof performance === 'object' &&
    performance &&
    typeof performance.now === 'function') ?
    performance
    : Date;
const warned = new Set();
/* c8 ignore start */
const PROCESS = (typeof process === 'object' && !!process ?
    process
    : {});
/* c8 ignore start */
const emitWarning = (msg, type, code, fn) => {
    typeof PROCESS.emitWarning === 'function' ?
        PROCESS.emitWarning(msg, type, code, fn)
        : console.error(`[${code}] ${type}: ${msg}`);
};
let AC = globalThis.AbortController;
let AS = globalThis.AbortSignal;
/* c8 ignore start */
if (typeof AC === 'undefined') {
    //@ts-ignore
    AS = class AbortSignal {
        onabort;
        _onabort = [];
        reason;
        aborted = false;
        addEventListener(_, fn) {
            this._onabort.push(fn);
        }
    };
    //@ts-ignore
    AC = class AbortController {
        constructor() {
            warnACPolyfill();
        }
        signal = new AS();
        abort(reason) {
            if (this.signal.aborted)
                return;
            //@ts-ignore
            this.signal.reason = reason;
            //@ts-ignore
            this.signal.aborted = true;
            //@ts-ignore
            for (const fn of this.signal._onabort) {
                fn(reason);
            }
            this.signal.onabort?.(reason);
        }
    };
    let printACPolyfillWarning = PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1';
    const warnACPolyfill = () => {
        if (!printACPolyfillWarning)
            return;
        printACPolyfillWarning = false;
        emitWarning('AbortController is not defined. If using lru-cache in ' +
            'node 14, load an AbortController polyfill from the ' +
            '`node-abort-controller` package. A minimal polyfill is ' +
            'provided for use by LRUCache.fetch(), but it should not be ' +
            'relied upon in other contexts (eg, passing it to other APIs that ' +
            'use AbortController/AbortSignal might have undesirable effects). ' +
            'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.', 'NO_ABORT_CONTROLLER', 'ENOTSUP', warnACPolyfill);
    };
}
/* c8 ignore stop */
const shouldWarn = (code) => !warned.has(code);
const TYPE = Symbol('type');
const isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n);
/* c8 ignore start */
// This is a little bit ridiculous, tbh.
// The maximum array length is 2^32-1 or thereabouts on most JS impls.
// And well before that point, you're caching the entire world, I mean,
// that's ~32GB of just integers for the next/prev links, plus whatever
// else to hold that many keys and values.  Just filling the memory with
// zeroes at init time is brutal when you get that big.
// But why not be complete?
// Maybe in the future, these limits will have expanded.
const getUintArray = (max) => !isPosInt(max) ? null
    : max <= Math.pow(2, 8) ? Uint8Array
        : max <= Math.pow(2, 16) ? Uint16Array
            : max <= Math.pow(2, 32) ? Uint32Array
                : max <= Number.MAX_SAFE_INTEGER ? ZeroArray
                    : null;
/* c8 ignore stop */
class ZeroArray extends Array {
    constructor(size) {
        super(size);
        this.fill(0);
    }
}
class Stack {
    heap;
    length;
    // private constructor
    static #constructing = false;
    static create(max) {
        const HeapCls = getUintArray(max);
        if (!HeapCls)
            return [];
        Stack.#constructing = true;
        const s = new Stack(max, HeapCls);
        Stack.#constructing = false;
        return s;
    }
    constructor(max, HeapCls) {
        /* c8 ignore start */
        if (!Stack.#constructing) {
            throw new TypeError('instantiate Stack using Stack.create(n)');
        }
        /* c8 ignore stop */
        this.heap = new HeapCls(max);
        this.length = 0;
    }
    push(n) {
        this.heap[this.length++] = n;
    }
    pop() {
        return this.heap[--this.length];
    }
}
/**
 * Default export, the thing you're using this module to get.
 *
 * The `K` and `V` types define the key and value types, respectively. The
 * optional `FC` type defines the type of the `context` object passed to
 * `cache.fetch()` and `cache.memo()`.
 *
 * Keys and values **must not** be `null` or `undefined`.
 *
 * All properties from the options object (with the exception of `max`,
 * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are
 * added as normal public members. (The listed options are read-only getters.)
 *
 * Changing any of these will alter the defaults for subsequent method calls.
 */
class LRUCache {
    // options that cannot be changed without disaster
    #max;
    #maxSize;
    #dispose;
    #onInsert;
    #disposeAfter;
    #fetchMethod;
    #memoMethod;
    #perf;
    /**
     * {@link LRUCache.OptionsBase.perf}
     */
    get perf() {
        return this.#perf;
    }
    /**
     * {@link LRUCache.OptionsBase.ttl}
     */
    ttl;
    /**
     * {@link LRUCache.OptionsBase.ttlResolution}
     */
    ttlResolution;
    /**
     * {@link LRUCache.OptionsBase.ttlAutopurge}
     */
    ttlAutopurge;
    /**
     * {@link LRUCache.OptionsBase.updateAgeOnGet}
     */
    updateAgeOnGet;
    /**
     * {@link LRUCache.OptionsBase.updateAgeOnHas}
     */
    updateAgeOnHas;
    /**
     * {@link LRUCache.OptionsBase.allowStale}
     */
    allowStale;
    /**
     * {@link LRUCache.OptionsBase.noDisposeOnSet}
     */
    noDisposeOnSet;
    /**
     * {@link LRUCache.OptionsBase.noUpdateTTL}
     */
    noUpdateTTL;
    /**
     * {@link LRUCache.OptionsBase.maxEntrySize}
     */
    maxEntrySize;
    /**
     * {@link LRUCache.OptionsBase.sizeCalculation}
     */
    sizeCalculation;
    /**
     * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}
     */
    noDeleteOnFetchRejection;
    /**
     * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}
     */
    noDeleteOnStaleGet;
    /**
     * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}
     */
    allowStaleOnFetchAbort;
    /**
     * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}
     */
    allowStaleOnFetchRejection;
    /**
     * {@link LRUCache.OptionsBase.ignoreFetchAbort}
     */
    ignoreFetchAbort;
    // computed properties
    #size;
    #calculatedSize;
    #keyMap;
    #keyList;
    #valList;
    #next;
    #prev;
    #head;
    #tail;
    #free;
    #disposed;
    #sizes;
    #starts;
    #ttls;
    #hasDispose;
    #hasFetchMethod;
    #hasDisposeAfter;
    #hasOnInsert;
    /**
     * Do not call this method unless you need to inspect the
     * inner workings of the cache.  If anything returned by this
     * object is modified in any way, strange breakage may occur.
     *
     * These fields are private for a reason!
     *
     * @internal
     */
    static unsafeExposeInternals(c) {
        return {
            // properties
            starts: c.#starts,
            ttls: c.#ttls,
            sizes: c.#sizes,
            keyMap: c.#keyMap,
            keyList: c.#keyList,
            valList: c.#valList,
            next: c.#next,
            prev: c.#prev,
            get head() {
                return c.#head;
            },
            get tail() {
                return c.#tail;
            },
            free: c.#free,
            // methods
            isBackgroundFetch: (p) => c.#isBackgroundFetch(p),
            backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context),
            moveToTail: (index) => c.#moveToTail(index),
            indexes: (options) => c.#indexes(options),
            rindexes: (options) => c.#rindexes(options),
            isStale: (index) => c.#isStale(index),
        };
    }
    // Protected read-only members
    /**
     * {@link LRUCache.OptionsBase.max} (read-only)
     */
    get max() {
        return this.#max;
    }
    /**
     * {@link LRUCache.OptionsBase.maxSize} (read-only)
     */
    get maxSize() {
        return this.#maxSize;
    }
    /**
     * The total computed size of items in the cache (read-only)
     */
    get calculatedSize() {
        return this.#calculatedSize;
    }
    /**
     * The number of items stored in the cache (read-only)
     */
    get size() {
        return this.#size;
    }
    /**
     * {@link LRUCache.OptionsBase.fetchMethod} (read-only)
     */
    get fetchMethod() {
        return this.#fetchMethod;
    }
    get memoMethod() {
        return this.#memoMethod;
    }
    /**
     * {@link LRUCache.OptionsBase.dispose} (read-only)
     */
    get dispose() {
        return this.#dispose;
    }
    /**
     * {@link LRUCache.OptionsBase.onInsert} (read-only)
     */
    get onInsert() {
        return this.#onInsert;
    }
    /**
     * {@link LRUCache.OptionsBase.disposeAfter} (read-only)
     */
    get disposeAfter() {
        return this.#disposeAfter;
    }
    constructor(options) {
        const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, perf, } = options;
        if (perf !== undefined) {
            if (typeof perf?.now !== 'function') {
                throw new TypeError('perf option must have a now() method if specified');
            }
        }
        this.#perf = perf ?? defaultPerf;
        if (max !== 0 && !isPosInt(max)) {
            throw new TypeError('max option must be a nonnegative integer');
        }
        const UintArray = max ? getUintArray(max) : Array;
        if (!UintArray) {
            throw new Error('invalid max value: ' + max);
        }
        this.#max = max;
        this.#maxSize = maxSize;
        this.maxEntrySize = maxEntrySize || this.#maxSize;
        this.sizeCalculation = sizeCalculation;
        if (this.sizeCalculation) {
            if (!this.#maxSize && !this.maxEntrySize) {
                throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize');
            }
            if (typeof this.sizeCalculation !== 'function') {
                throw new TypeError('sizeCalculation set to non-function');
            }
        }
        if (memoMethod !== undefined &&
            typeof memoMethod !== 'function') {
            throw new TypeError('memoMethod must be a function if defined');
        }
        this.#memoMethod = memoMethod;
        if (fetchMethod !== undefined &&
            typeof fetchMethod !== 'function') {
            throw new TypeError('fetchMethod must be a function if specified');
        }
        this.#fetchMethod = fetchMethod;
        this.#hasFetchMethod = !!fetchMethod;
        this.#keyMap = new Map();
        this.#keyList = new Array(max).fill(undefined);
        this.#valList = new Array(max).fill(undefined);
        this.#next = new UintArray(max);
        this.#prev = new UintArray(max);
        this.#head = 0;
        this.#tail = 0;
        this.#free = Stack.create(max);
        this.#size = 0;
        this.#calculatedSize = 0;
        if (typeof dispose === 'function') {
            this.#dispose = dispose;
        }
        if (typeof onInsert === 'function') {
            this.#onInsert = onInsert;
        }
        if (typeof disposeAfter === 'function') {
            this.#disposeAfter = disposeAfter;
            this.#disposed = [];
        }
        else {
            this.#disposeAfter = undefined;
            this.#disposed = undefined;
        }
        this.#hasDispose = !!this.#dispose;
        this.#hasOnInsert = !!this.#onInsert;
        this.#hasDisposeAfter = !!this.#disposeAfter;
        this.noDisposeOnSet = !!noDisposeOnSet;
        this.noUpdateTTL = !!noUpdateTTL;
        this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;
        this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;
        this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;
        this.ignoreFetchAbort = !!ignoreFetchAbort;
        // NB: maxEntrySize is set to maxSize if it's set
        if (this.maxEntrySize !== 0) {
            if (this.#maxSize !== 0) {
                if (!isPosInt(this.#maxSize)) {
                    throw new TypeError('maxSize must be a positive integer if specified');
                }
            }
            if (!isPosInt(this.maxEntrySize)) {
                throw new TypeError('maxEntrySize must be a positive integer if specified');
            }
            this.#initializeSizeTracking();
        }
        this.allowStale = !!allowStale;
        this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;
        this.updateAgeOnGet = !!updateAgeOnGet;
        this.updateAgeOnHas = !!updateAgeOnHas;
        this.ttlResolution =
            isPosInt(ttlResolution) || ttlResolution === 0 ?
                ttlResolution
                : 1;
        this.ttlAutopurge = !!ttlAutopurge;
        this.ttl = ttl || 0;
        if (this.ttl) {
            if (!isPosInt(this.ttl)) {
                throw new TypeError('ttl must be a positive integer if specified');
            }
            this.#initializeTTLTracking();
        }
        // do not allow completely unbounded caches
        if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {
            throw new TypeError('At least one of max, maxSize, or ttl is required');
        }
        if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {
            const code = 'LRU_CACHE_UNBOUNDED';
            if (shouldWarn(code)) {
                warned.add(code);
                const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' +
                    'result in unbounded memory consumption.';
                emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache);
            }
        }
    }
    /**
     * Return the number of ms left in the item's TTL. If item is not in cache,
     * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.
     */
    getRemainingTTL(key) {
        return this.#keyMap.has(key) ? Infinity : 0;
    }
    #initializeTTLTracking() {
        const ttls = new ZeroArray(this.#max);
        const starts = new ZeroArray(this.#max);
        this.#ttls = ttls;
        this.#starts = starts;
        this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {
            starts[index] = ttl !== 0 ? start : 0;
            ttls[index] = ttl;
            if (ttl !== 0 && this.ttlAutopurge) {
                const t = setTimeout(() => {
                    if (this.#isStale(index)) {
                        this.#delete(this.#keyList[index], 'expire');
                    }
                }, ttl + 1);
                // unref() not supported on all platforms
                /* c8 ignore start */
                if (t.unref) {
                    t.unref();
                }
                /* c8 ignore stop */
            }
        };
        this.#updateItemAge = index => {
            starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0;
        };
        this.#statusTTL = (status, index) => {
            if (ttls[index]) {
                const ttl = ttls[index];
                const start = starts[index];
                /* c8 ignore next */
                if (!ttl || !start)
                    return;
                status.ttl = ttl;
                status.start = start;
                status.now = cachedNow || getNow();
                const age = status.now - start;
                status.remainingTTL = ttl - age;
            }
        };
        // debounce calls to perf.now() to 1s so we're not hitting
        // that costly call repeatedly.
        let cachedNow = 0;
        const getNow = () => {
            const n = this.#perf.now();
            if (this.ttlResolution > 0) {
                cachedNow = n;
                const t = setTimeout(() => (cachedNow = 0), this.ttlResolution);
                // not available on all platforms
                /* c8 ignore start */
                if (t.unref) {
                    t.unref();
                }
                /* c8 ignore stop */
            }
            return n;
        };
        this.getRemainingTTL = key => {
            const index = this.#keyMap.get(key);
            if (index === undefined) {
                return 0;
            }
            const ttl = ttls[index];
            const start = starts[index];
            if (!ttl || !start) {
                return Infinity;
            }
            const age = (cachedNow || getNow()) - start;
            return ttl - age;
        };
        this.#isStale = index => {
            const s = starts[index];
            const t = ttls[index];
            return !!t && !!s && (cachedNow || getNow()) - s > t;
        };
    }
    // conditionally set private methods related to TTL
    #updateItemAge = () => { };
    #statusTTL = () => { };
    #setItemTTL = () => { };
    /* c8 ignore stop */
    #isStale = () => false;
    #initializeSizeTracking() {
        const sizes = new ZeroArray(this.#max);
        this.#calculatedSize = 0;
        this.#sizes = sizes;
        this.#removeItemSize = index => {
            this.#calculatedSize -= sizes[index];
            sizes[index] = 0;
        };
        this.#requireSize = (k, v, size, sizeCalculation) => {
            // provisionally accept background fetches.
            // actual value size will be checked when they return.
            if (this.#isBackgroundFetch(v)) {
                return 0;
            }
            if (!isPosInt(size)) {
                if (sizeCalculation) {
                    if (typeof sizeCalculation !== 'function') {
                        throw new TypeError('sizeCalculation must be a function');
                    }
                    size = sizeCalculation(v, k);
                    if (!isPosInt(size)) {
                        throw new TypeError('sizeCalculation return invalid (expect positive integer)');
                    }
                }
                else {
                    throw new TypeError('invalid size value (must be positive integer). ' +
                        'When maxSize or maxEntrySize is used, sizeCalculation ' +
                        'or size must be set.');
                }
            }
            return size;
        };
        this.#addItemSize = (index, size, status) => {
            sizes[index] = size;
            if (this.#maxSize) {
                const maxSize = this.#maxSize - sizes[index];
                while (this.#calculatedSize > maxSize) {
                    this.#evict(true);
                }
            }
            this.#calculatedSize += sizes[index];
            if (status) {
                status.entrySize = size;
                status.totalCalculatedSize = this.#calculatedSize;
            }
        };
    }
    #removeItemSize = _i => { };
    #addItemSize = (_i, _s, _st) => { };
    #requireSize = (_k, _v, size, sizeCalculation) => {
        if (size || sizeCalculation) {
            throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache');
        }
        return 0;
    };
    *#indexes({ allowStale = this.allowStale } = {}) {
        if (this.#size) {
            for (let i = this.#tail; true;) {
                if (!this.#isValidIndex(i)) {
                    break;
                }
                if (allowStale || !this.#isStale(i)) {
                    yield i;
                }
                if (i === this.#head) {
                    break;
                }
                else {
                    i = this.#prev[i];
                }
            }
        }
    }
    *#rindexes({ allowStale = this.allowStale } = {}) {
        if (this.#size) {
            for (let i = this.#head; true;) {
                if (!this.#isValidIndex(i)) {
                    break;
                }
                if (allowStale || !this.#isStale(i)) {
                    yield i;
                }
                if (i === this.#tail) {
                    break;
                }
                else {
                    i = this.#next[i];
                }
            }
        }
    }
    #isValidIndex(index) {
        return (index !== undefined &&
            this.#keyMap.get(this.#keyList[index]) === index);
    }
    /**
     * Return a generator yielding `[key, value]` pairs,
     * in order from most recently used to least recently used.
     */
    *entries() {
        for (const i of this.#indexes()) {
            if (this.#valList[i] !== undefined &&
                this.#keyList[i] !== undefined &&
                !this.#isBackgroundFetch(this.#valList[i])) {
                yield [this.#keyList[i], this.#valList[i]];
            }
        }
    }
    /**
     * Inverse order version of {@link LRUCache.entries}
     *
     * Return a generator yielding `[key, value]` pairs,
     * in order from least recently used to most recently used.
     */
    *rentries() {
        for (const i of this.#rindexes()) {
            if (this.#valList[i] !== undefined &&
                this.#keyList[i] !== undefined &&
                !this.#isBackgroundFetch(this.#valList[i])) {
                yield [this.#keyList[i], this.#valList[i]];
            }
        }
    }
    /**
     * Return a generator yielding the keys in the cache,
     * in order from most recently used to least recently used.
     */
    *keys() {
        for (const i of this.#indexes()) {
            const k = this.#keyList[i];
            if (k !== undefined &&
                !this.#isBackgroundFetch(this.#valList[i])) {
                yield k;
            }
        }
    }
    /**
     * Inverse order version of {@link LRUCache.keys}
     *
     * Return a generator yielding the keys in the cache,
     * in order from least recently used to most recently used.
     */
    *rkeys() {
        for (const i of this.#rindexes()) {
            const k = this.#keyList[i];
            if (k !== undefined &&
                !this.#isBackgroundFetch(this.#valList[i])) {
                yield k;
            }
        }
    }
    /**
     * Return a generator yielding the values in the cache,
     * in order from most recently used to least recently used.
     */
    *values() {
        for (const i of this.#indexes()) {
            const v = this.#valList[i];
            if (v !== undefined &&
                !this.#isBackgroundFetch(this.#valList[i])) {
                yield this.#valList[i];
            }
        }
    }
    /**
     * Inverse order version of {@link LRUCache.values}
     *
     * Return a generator yielding the values in the cache,
     * in order from least recently used to most recently used.
     */
    *rvalues() {
        for (const i of this.#rindexes()) {
            const v = this.#valList[i];
            if (v !== undefined &&
                !this.#isBackgroundFetch(this.#valList[i])) {
                yield this.#valList[i];
            }
        }
    }
    /**
     * Iterating over the cache itself yields the same results as
     * {@link LRUCache.entries}
     */
    [Symbol.iterator]() {
        return this.entries();
    }
    /**
     * A String value that is used in the creation of the default string
     * description of an object. Called by the built-in method
     * `Object.prototype.toString`.
     */
    [Symbol.toStringTag] = 'LRUCache';
    /**
     * Find a value for which the supplied fn method returns a truthy value,
     * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.
     */
    find(fn, getOptions = {}) {
        for (const i of this.#indexes()) {
            const v = this.#valList[i];
            const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
            if (value === undefined)
                continue;
            if (fn(value, this.#keyList[i], this)) {
                return this.get(this.#keyList[i], getOptions);
            }
        }
    }
    /**
     * Call the supplied function on each item in the cache, in order from most
     * recently used to least recently used.
     *
     * `fn` is called as `fn(value, key, cache)`.
     *
     * If `thisp` is provided, function will be called in the `this`-context of
     * the provided object, or the cache if no `thisp` object is provided.
     *
     * Does not update age or recenty of use, or iterate over stale values.
     */
    forEach(fn, thisp = this) {
        for (const i of this.#indexes()) {
            const v = this.#valList[i];
            const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
            if (value === undefined)
                continue;
            fn.call(thisp, value, this.#keyList[i], this);
        }
    }
    /**
     * The same as {@link LRUCache.forEach} but items are iterated over in
     * reverse order.  (ie, less recently used items are iterated over first.)
     */
    rforEach(fn, thisp = this) {
        for (const i of this.#rindexes()) {
            const v = this.#valList[i];
            const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
            if (value === undefined)
                continue;
            fn.call(thisp, value, this.#keyList[i], this);
        }
    }
    /**
     * Delete any stale entries. Returns true if anything was removed,
     * false otherwise.
     */
    purgeStale() {
        let deleted = false;
        for (const i of this.#rindexes({ allowStale: true })) {
            if (this.#isStale(i)) {
                this.#delete(this.#keyList[i], 'expire');
                deleted = true;
            }
        }
        return deleted;
    }
    /**
     * Get the extended info about a given entry, to get its value, size, and
     * TTL info simultaneously. Returns `undefined` if the key is not present.
     *
     * Unlike {@link LRUCache#dump}, which is designed to be portable and survive
     * serialization, the `start` value is always the current timestamp, and the
     * `ttl` is a calculated remaining time to live (negative if expired).
     *
     * Always returns stale values, if their info is found in the cache, so be
     * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})
     * if relevant.
     */
    info(key) {
        const i = this.#keyMap.get(key);
        if (i === undefined)
            return undefined;
        const v = this.#valList[i];
        /* c8 ignore start - this isn't tested for the info function,
         * but it's the same logic as found in other places. */
        const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
        if (value === undefined)
            return undefined;
        /* c8 ignore end */
        const entry = { value };
        if (this.#ttls && this.#starts) {
            const ttl = this.#ttls[i];
            const start = this.#starts[i];
            if (ttl && start) {
                const remain = ttl - (this.#perf.now() - start);
                entry.ttl = remain;
                entry.start = Date.now();
            }
        }
        if (this.#sizes) {
            entry.size = this.#sizes[i];
        }
        return entry;
    }
    /**
     * Return an array of [key, {@link LRUCache.Entry}] tuples which can be
     * passed to {@link LRUCache#load}.
     *
     * The `start` fields are calculated relative to a portable `Date.now()`
     * timestamp, even if `performance.now()` is available.
     *
     * Stale entries are always included in the `dump`, even if
     * {@link LRUCache.OptionsBase.allowStale} is false.
     *
     * Note: this returns an actual array, not a generator, so it can be more
     * easily passed around.
     */
    dump() {
        const arr = [];
        for (const i of this.#indexes({ allowStale: true })) {
            const key = this.#keyList[i];
            const v = this.#valList[i];
            const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
            if (value === undefined || key === undefined)
                continue;
            const entry = { value };
            if (this.#ttls && this.#starts) {
                entry.ttl = this.#ttls[i];
                // always dump the start relative to a portable timestamp
                // it's ok for this to be a bit slow, it's a rare operation.
                const age = this.#perf.now() - this.#starts[i];
                entry.start = Math.floor(Date.now() - age);
            }
            if (this.#sizes) {
                entry.size = this.#sizes[i];
            }
            arr.unshift([key, entry]);
        }
        return arr;
    }
    /**
     * Reset the cache and load in the items in entries in the order listed.
     *
     * The shape of the resulting cache may be different if the same options are
     * not used in both caches.
     *
     * The `start` fields are assumed to be calculated relative to a portable
     * `Date.now()` timestamp, even if `performance.now()` is available.
     */
    load(arr) {
        this.clear();
        for (const [key, entry] of arr) {
            if (entry.start) {
                // entry.start is a portable timestamp, but we may be using
                // node's performance.now(), so calculate the offset, so that
                // we get the intended remaining TTL, no matter how long it's
                // been on ice.
                //
                // it's ok for this to be a bit slow, it's a rare operation.
                const age = Date.now() - entry.start;
                entry.start = this.#perf.now() - age;
            }
            this.set(key, entry.value, entry);
        }
    }
    /**
     * Add a value to the cache.
     *
     * Note: if `undefined` is specified as a value, this is an alias for
     * {@link LRUCache#delete}
     *
     * Fields on the {@link LRUCache.SetOptions} options param will override
     * their corresponding values in the constructor options for the scope
     * of this single `set()` operation.
     *
     * If `start` is provided, then that will set the effective start
     * time for the TTL calculation. Note that this must be a previous
     * value of `performance.now()` if supported, or a previous value of
     * `Date.now()` if not.
     *
     * Options object may also include `size`, which will prevent
     * calling the `sizeCalculation` function and just use the specified
     * number if it is a positive integer, and `noDisposeOnSet` which
     * will prevent calling a `dispose` function in the case of
     * overwrites.
     *
     * If the `size` (or return value of `sizeCalculation`) for a given
     * entry is greater than `maxEntrySize`, then the item will not be
     * added to the cache.
     *
     * Will update the recency of the entry.
     *
     * If the value is `undefined`, then this is an alias for
     * `cache.delete(key)`. `undefined` is never stored in the cache.
     */
    set(k, v, setOptions = {}) {
        if (v === undefined) {
            this.delete(k);
            return this;
        }
        const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions;
        let { noUpdateTTL = this.noUpdateTTL } = setOptions;
        const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation);
        // if the item doesn't fit, don't do anything
        // NB: maxEntrySize set to maxSize by default
        if (this.maxEntrySize && size > this.maxEntrySize) {
            if (status) {
                status.set = 'miss';
                status.maxEntrySizeExceeded = true;
            }
            // have to delete, in case something is there already.
            this.#delete(k, 'set');
            return this;
        }
        let index = this.#size === 0 ? undefined : this.#keyMap.get(k);
        if (index === undefined) {
            // addition
            index = (this.#size === 0 ? this.#tail
                : this.#free.length !== 0 ? this.#free.pop()
                    : this.#size === this.#max ? this.#evict(false)
                        : this.#size);
            this.#keyList[index] = k;
            this.#valList[index] = v;
            this.#keyMap.set(k, index);
            this.#next[this.#tail] = index;
            this.#prev[index] = this.#tail;
            this.#tail = index;
            this.#size++;
            this.#addItemSize(index, size, status);
            if (status)
                status.set = 'add';
            noUpdateTTL = false;
            if (this.#hasOnInsert) {
                this.#onInsert?.(v, k, 'add');
            }
        }
        else {
            // update
            this.#moveToTail(index);
            const oldVal = this.#valList[index];
            if (v !== oldVal) {
                if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {
                    oldVal.__abortController.abort(new Error('replaced'));
                    const { __staleWhileFetching: s } = oldVal;
                    if (s !== undefined && !noDisposeOnSet) {
                        if (this.#hasDispose) {
                            this.#dispose?.(s, k, 'set');
                        }
                        if (this.#hasDisposeAfter) {
                            this.#disposed?.push([s, k, 'set']);
                        }
                    }
                }
                else if (!noDisposeOnSet) {
                    if (this.#hasDispose) {
                        this.#dispose?.(oldVal, k, 'set');
                    }
                    if (this.#hasDisposeAfter) {
                        this.#disposed?.push([oldVal, k, 'set']);
                    }
                }
                this.#removeItemSize(index);
                this.#addItemSize(index, size, status);
                this.#valList[index] = v;
                if (status) {
                    status.set = 'replace';
                    const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ?
                        oldVal.__staleWhileFetching
                        : oldVal;
                    if (oldValue !== undefined)
                        status.oldValue = oldValue;
                }
            }
            else if (status) {
                status.set = 'update';
            }
            if (this.#hasOnInsert) {
                this.onInsert?.(v, k, v === oldVal ? 'update' : 'replace');
            }
        }
        if (ttl !== 0 && !this.#ttls) {
            this.#initializeTTLTracking();
        }
        if (this.#ttls) {
            if (!noUpdateTTL) {
                this.#setItemTTL(index, ttl, start);
            }
            if (status)
                this.#statusTTL(status, index);
        }
        if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {
            const dt = this.#disposed;
            let task;
            while ((task = dt?.shift())) {
                this.#disposeAfter?.(...task);
            }
        }
        return this;
    }
    /**
     * Evict the least recently used item, returning its value or
     * `undefined` if cache is empty.
     */
    pop() {
        try {
            while (this.#size) {
                const val = this.#valList[this.#head];
                this.#evict(true);
                if (this.#isBackgroundFetch(val)) {
                    if (val.__staleWhileFetching) {
                        return val.__staleWhileFetching;
                    }
                }
                else if (val !== undefined) {
                    return val;
                }
            }
        }
        finally {
            if (this.#hasDisposeAfter && this.#disposed) {
                const dt = this.#disposed;
                let task;
                while ((task = dt?.shift())) {
                    this.#disposeAfter?.(...task);
                }
            }
        }
    }
    #evict(free) {
        const head = this.#head;
        const k = this.#keyList[head];
        const v = this.#valList[head];
        if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {
            v.__abortController.abort(new Error('evicted'));
        }
        else if (this.#hasDispose || this.#hasDisposeAfter) {
            if (this.#hasDispose) {
                this.#dispose?.(v, k, 'evict');
            }
            if (this.#hasDisposeAfter) {
                this.#disposed?.push([v, k, 'evict']);
            }
        }
        this.#removeItemSize(head);
        // if we aren't about to use the index, then null these out
        if (free) {
            this.#keyList[head] = undefined;
            this.#valList[head] = undefined;
            this.#free.push(head);
        }
        if (this.#size === 1) {
            this.#head = this.#tail = 0;
            this.#free.length = 0;
        }
        else {
            this.#head = this.#next[head];
        }
        this.#keyMap.delete(k);
        this.#size--;
        return head;
    }
    /**
     * Check if a key is in the cache, without updating the recency of use.
     * Will return false if the item is stale, even though it is technically
     * in the cache.
     *
     * Check if a key is in the cache, without updating the recency of
     * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set
     * to `true` in either the options or the constructor.
     *
     * Will return `false` if the item is stale, even though it is technically in
     * the cache. The difference can be determined (if it matters) by using a
     * `status` argument, and inspecting the `has` field.
     *
     * Will not update item age unless
     * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.
     */
    has(k, hasOptions = {}) {
        const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;
        const index = this.#keyMap.get(k);
        if (index !== undefined) {
            const v = this.#valList[index];
            if (this.#isBackgroundFetch(v) &&
                v.__staleWhileFetching === undefined) {
                return false;
            }
            if (!this.#isStale(index)) {
                if (updateAgeOnHas) {
                    this.#updateItemAge(index);
                }
                if (status) {
                    status.has = 'hit';
                    this.#statusTTL(status, index);
                }
                return true;
            }
            else if (status) {
                status.has = 'stale';
                this.#statusTTL(status, index);
            }
        }
        else if (status) {
            status.has = 'miss';
        }
        return false;
    }
    /**
     * Like {@link LRUCache#get} but doesn't update recency or delete stale
     * items.
     *
     * Returns `undefined` if the item is stale, unless
     * {@link LRUCache.OptionsBase.allowStale} is set.
     */
    peek(k, peekOptions = {}) {
        const { allowStale = this.allowStale } = peekOptions;
        const index = this.#keyMap.get(k);
        if (index === undefined ||
            (!allowStale && this.#isStale(index))) {
            return;
        }
        const v = this.#valList[index];
        // either stale and allowed, or forcing a refresh of non-stale value
        return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
    }
    #backgroundFetch(k, index, options, context) {
        const v = index === undefined ? undefined : this.#valList[index];
        if (this.#isBackgroundFetch(v)) {
            return v;
        }
        const ac = new AC();
        const { signal } = options;
        // when/if our AC signals, then stop listening to theirs.
        signal?.addEventListener('abort', () => ac.abort(signal.reason), {
            signal: ac.signal,
        });
        const fetchOpts = {
            signal: ac.signal,
            options,
            context,
        };
        const cb = (v, updateCache = false) => {
            const { aborted } = ac.signal;
            const ignoreAbort = options.ignoreFetchAbort && v !== undefined;
            if (options.status) {
                if (aborted && !updateCache) {
                    options.status.fetchAborted = true;
                    options.status.fetchError = ac.signal.reason;
                    if (ignoreAbort)
                        options.status.fetchAbortIgnored = true;
                }
                else {
                    options.status.fetchResolved = true;
                }
            }
            if (aborted && !ignoreAbort && !updateCache) {
                return fetchFail(ac.signal.reason);
            }
            // either we didn't abort, and are still here, or we did, and ignored
            const bf = p;
            if (this.#valList[index] === p) {
                if (v === undefined) {
                    if (bf.__staleWhileFetching !== undefined) {
                        this.#valList[index] = bf.__staleWhileFetching;
                    }
                    else {
                        this.#delete(k, 'fetch');
                    }
                }
                else {
                    if (options.status)
                        options.status.fetchUpdated = true;
                    this.set(k, v, fetchOpts.options);
                }
            }
            return v;
        };
        const eb = (er) => {
            if (options.status) {
                options.status.fetchRejected = true;
                options.status.fetchError = er;
            }
            return fetchFail(er);
        };
        const fetchFail = (er) => {
            const { aborted } = ac.signal;
            const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;
            const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
            const noDelete = allowStale || options.noDeleteOnFetchRejection;
            const bf = p;
            if (this.#valList[index] === p) {
                // if we allow stale on fetch rejections, then we need to ensure that
                // the stale value is not removed from the cache when the fetch fails.
                const del = !noDelete || bf.__staleWhileFetching === undefined;
                if (del) {
                    this.#delete(k, 'fetch');
                }
                else if (!allowStaleAborted) {
                    // still replace the *promise* with the stale value,
                    // since we are done with the promise at this point.
                    // leave it untouched if we're still waiting for an
                    // aborted background fetch that hasn't yet returned.
                    this.#valList[index] = bf.__staleWhileFetching;
                }
            }
            if (allowStale) {
                if (options.status && bf.__staleWhileFetching !== undefined) {
                    options.status.returnedStale = true;
                }
                return bf.__staleWhileFetching;
            }
            else if (bf.__returned === bf) {
                throw er;
            }
        };
        const pcall = (res, rej) => {
            const fmp = this.#fetchMethod?.(k, v, fetchOpts);
            if (fmp && fmp instanceof Promise) {
                fmp.then(v => res(v === undefined ? undefined : v), rej);
            }
            // ignored, we go until we finish, regardless.
            // defer check until we are actually aborting,
            // so fetchMethod can override.
            ac.signal.addEventListener('abort', () => {
                if (!options.ignoreFetchAbort ||
                    options.allowStaleOnFetchAbort) {
                    res(undefined);
                    // when it eventually resolves, update the cache.
                    if (options.allowStaleOnFetchAbort) {
                        res = v => cb(v, true);
                    }
                }
            });
        };
        if (options.status)
            options.status.fetchDispatched = true;
        const p = new Promise(pcall).then(cb, eb);
        const bf = Object.assign(p, {
            __abortController: ac,
            __staleWhileFetching: v,
            __returned: undefined,
        });
        if (index === undefined) {
            // internal, don't expose status.
            this.set(k, bf, { ...fetchOpts.options, status: undefined });
            index = this.#keyMap.get(k);
        }
        else {
            this.#valList[index] = bf;
        }
        return bf;
    }
    #isBackgroundFetch(p) {
        if (!this.#hasFetchMethod)
            return false;
        const b = p;
        return (!!b &&
            b instanceof Promise &&
            b.hasOwnProperty('__staleWhileFetching') &&
            b.__abortController instanceof AC);
    }
    async fetch(k, fetchOptions = {}) {
        const { 
        // get options
        allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, 
        // set options
        ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, 
        // fetch exclusive options
        noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions;
        if (!this.#hasFetchMethod) {
            if (status)
                status.fetch = 'get';
            return this.get(k, {
                allowStale,
                updateAgeOnGet,
                noDeleteOnStaleGet,
                status,
            });
        }
        const options = {
            allowStale,
            updateAgeOnGet,
            noDeleteOnStaleGet,
            ttl,
            noDisposeOnSet,
            size,
            sizeCalculation,
            noUpdateTTL,
            noDeleteOnFetchRejection,
            allowStaleOnFetchRejection,
            allowStaleOnFetchAbort,
            ignoreFetchAbort,
            status,
            signal,
        };
        let index = this.#keyMap.get(k);
        if (index === undefined) {
            if (status)
                status.fetch = 'miss';
            const p = this.#backgroundFetch(k, index, options, context);
            return (p.__returned = p);
        }
        else {
            // in cache, maybe already fetching
            const v = this.#valList[index];
            if (this.#isBackgroundFetch(v)) {
                const stale = allowStale && v.__staleWhileFetching !== undefined;
                if (status) {
                    status.fetch = 'inflight';
                    if (stale)
                        status.returnedStale = true;
                }
                return stale ? v.__staleWhileFetching : (v.__returned = v);
            }
            // if we force a refresh, that means do NOT serve the cached value,
            // unless we are already in the process of refreshing the cache.
            const isStale = this.#isStale(index);
            if (!forceRefresh && !isStale) {
                if (status)
                    status.fetch = 'hit';
                this.#moveToTail(index);
                if (updateAgeOnGet) {
                    this.#updateItemAge(index);
                }
                if (status)
                    this.#statusTTL(status, index);
                return v;
            }
            // ok, it is stale or a forced refresh, and not already fetching.
            // refresh the cache.
            const p = this.#backgroundFetch(k, index, options, context);
            const hasStale = p.__staleWhileFetching !== undefined;
            const staleVal = hasStale && allowStale;
            if (status) {
                status.fetch = isStale ? 'stale' : 'refresh';
                if (staleVal && isStale)
                    status.returnedStale = true;
            }
            return staleVal ? p.__staleWhileFetching : (p.__returned = p);
        }
    }
    async forceFetch(k, fetchOptions = {}) {
        const v = await this.fetch(k, fetchOptions);
        if (v === undefined)
            throw new Error('fetch() returned undefined');
        return v;
    }
    memo(k, memoOptions = {}) {
        const memoMethod = this.#memoMethod;
        if (!memoMethod) {
            throw new Error('no memoMethod provided to constructor');
        }
        const { context, forceRefresh, ...options } = memoOptions;
        const v = this.get(k, options);
        if (!forceRefresh && v !== undefined)
            return v;
        const vv = memoMethod(k, v, {
            options,
            context,
        });
        this.set(k, vv, options);
        return vv;
    }
    /**
     * Return a value from the cache. Will update the recency of the cache
     * entry found.
     *
     * If the key is not found, get() will return `undefined`.
     */
    get(k, getOptions = {}) {
        const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions;
        const index = this.#keyMap.get(k);
        if (index !== undefined) {
            const value = this.#valList[index];
            const fetching = this.#isBackgroundFetch(value);
            if (status)
                this.#statusTTL(status, index);
            if (this.#isStale(index)) {
                if (status)
                    status.get = 'stale';
                // delete only if not an in-flight background fetch
                if (!fetching) {
                    if (!noDeleteOnStaleGet) {
                        this.#delete(k, 'expire');
                    }
                    if (status && allowStale)
                        status.returnedStale = true;
                    return allowStale ? value : undefined;
                }
                else {
                    if (status &&
                        allowStale &&
                        value.__staleWhileFetching !== undefined) {
                        status.returnedStale = true;
                    }
                    return allowStale ? value.__staleWhileFetching : undefined;
                }
            }
            else {
                if (status)
                    status.get = 'hit';
                // if we're currently fetching it, we don't actually have it yet
                // it's not stale, which means this isn't a staleWhileRefetching.
                // If it's not stale, and fetching, AND has a __staleWhileFetching
                // value, then that means the user fetched with {forceRefresh:true},
                // so it's safe to return that value.
                if (fetching) {
                    return value.__staleWhileFetching;
                }
                this.#moveToTail(index);
                if (updateAgeOnGet) {
                    this.#updateItemAge(index);
                }
                return value;
            }
        }
        else if (status) {
            status.get = 'miss';
        }
    }
    #connect(p, n) {
        this.#prev[n] = p;
        this.#next[p] = n;
    }
    #moveToTail(index) {
        // if tail already, nothing to do
        // if head, move head to next[index]
        // else
        //   move next[prev[index]] to next[index] (head has no prev)
        //   move prev[next[index]] to prev[index]
        // prev[index] = tail
        // next[tail] = index
        // tail = index
        if (index !== this.#tail) {
            if (index === this.#head) {
                this.#head = this.#next[index];
            }
            else {
                this.#connect(this.#prev[index], this.#next[index]);
            }
            this.#connect(this.#tail, index);
            this.#tail = index;
        }
    }
    /**
     * Deletes a key out of the cache.
     *
     * Returns true if the key was deleted, false otherwise.
     */
    delete(k) {
        return this.#delete(k, 'delete');
    }
    #delete(k, reason) {
        let deleted = false;
        if (this.#size !== 0) {
            const index = this.#keyMap.get(k);
            if (index !== undefined) {
                deleted = true;
                if (this.#size === 1) {
                    this.#clear(reason);
                }
                else {
                    this.#removeItemSize(index);
                    const v = this.#valList[index];
                    if (this.#isBackgroundFetch(v)) {
                        v.__abortController.abort(new Error('deleted'));
                    }
                    else if (this.#hasDispose || this.#hasDisposeAfter) {
                        if (this.#hasDispose) {
                            this.#dispose?.(v, k, reason);
                        }
                        if (this.#hasDisposeAfter) {
                            this.#disposed?.push([v, k, reason]);
                        }
                    }
                    this.#keyMap.delete(k);
                    this.#keyList[index] = undefined;
                    this.#valList[index] = undefined;
                    if (index === this.#tail) {
                        this.#tail = this.#prev[index];
                    }
                    else if (index === this.#head) {
                        this.#head = this.#next[index];
                    }
                    else {
                        const pi = this.#prev[index];
                        this.#next[pi] = this.#next[index];
                        const ni = this.#next[index];
                        this.#prev[ni] = this.#prev[index];
                    }
                    this.#size--;
                    this.#free.push(index);
                }
            }
        }
        if (this.#hasDisposeAfter && this.#disposed?.length) {
            const dt = this.#disposed;
            let task;
            while ((task = dt?.shift())) {
                this.#disposeAfter?.(...task);
            }
        }
        return deleted;
    }
    /**
     * Clear the cache entirely, throwing away all values.
     */
    clear() {
        return this.#clear('delete');
    }
    #clear(reason) {
        for (const index of this.#rindexes({ allowStale: true })) {
            const v = this.#valList[index];
            if (this.#isBackgroundFetch(v)) {
                v.__abortController.abort(new Error('deleted'));
            }
            else {
                const k = this.#keyList[index];
                if (this.#hasDispose) {
                    this.#dispose?.(v, k, reason);
                }
                if (this.#hasDisposeAfter) {
                    this.#disposed?.push([v, k, reason]);
                }
            }
        }
        this.#keyMap.clear();
        this.#valList.fill(undefined);
        this.#keyList.fill(undefined);
        if (this.#ttls && this.#starts) {
            this.#ttls.fill(0);
            this.#starts.fill(0);
        }
        if (this.#sizes) {
            this.#sizes.fill(0);
        }
        this.#head = 0;
        this.#tail = 0;
        this.#free.length = 0;
        this.#calculatedSize = 0;
        this.#size = 0;
        if (this.#hasDisposeAfter && this.#disposed) {
            const dt = this.#disposed;
            let task;
            while ((task = dt?.shift())) {
                this.#disposeAfter?.(...task);
            }
        }
    }
}
//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: external "node:path"
const external_node_path_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path");
// EXTERNAL MODULE: external "fs"
var external_fs_ = __nccwpck_require__(9896);
var external_fs_default = /*#__PURE__*/__nccwpck_require__.n(external_fs_);
;// CONCATENATED MODULE: external "node:fs/promises"
const promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs/promises");
// EXTERNAL MODULE: external "node:stream"
var external_node_stream_ = __nccwpck_require__(7075);
;// CONCATENATED MODULE: external "node:string_decoder"
const external_node_string_decoder_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:string_decoder");
;// CONCATENATED MODULE: ./node_modules/minipass/dist/esm/index.js
const proc = typeof process === 'object' && process
    ? process
    : {
        stdout: null,
        stderr: null,
    };



/**
 * Return true if the argument is a Minipass stream, Node stream, or something
 * else that Minipass can interact with.
 */
const isStream = (s) => !!s &&
    typeof s === 'object' &&
    (s instanceof Minipass ||
        s instanceof external_node_stream_ ||
        isReadable(s) ||
        isWritable(s));
/**
 * Return true if the argument is a valid {@link Minipass.Readable}
 */
const isReadable = (s) => !!s &&
    typeof s === 'object' &&
    s instanceof external_node_events_.EventEmitter &&
    typeof s.pipe === 'function' &&
    // node core Writable streams have a pipe() method, but it throws
    s.pipe !== external_node_stream_.Writable.prototype.pipe;
/**
 * Return true if the argument is a valid {@link Minipass.Writable}
 */
const isWritable = (s) => !!s &&
    typeof s === 'object' &&
    s instanceof external_node_events_.EventEmitter &&
    typeof s.write === 'function' &&
    typeof s.end === 'function';
const EOF = Symbol('EOF');
const MAYBE_EMIT_END = Symbol('maybeEmitEnd');
const EMITTED_END = Symbol('emittedEnd');
const EMITTING_END = Symbol('emittingEnd');
const EMITTED_ERROR = Symbol('emittedError');
const CLOSED = Symbol('closed');
const READ = Symbol('read');
const FLUSH = Symbol('flush');
const FLUSHCHUNK = Symbol('flushChunk');
const ENCODING = Symbol('encoding');
const DECODER = Symbol('decoder');
const FLOWING = Symbol('flowing');
const PAUSED = Symbol('paused');
const RESUME = Symbol('resume');
const BUFFER = Symbol('buffer');
const PIPES = Symbol('pipes');
const BUFFERLENGTH = Symbol('bufferLength');
const BUFFERPUSH = Symbol('bufferPush');
const BUFFERSHIFT = Symbol('bufferShift');
const OBJECTMODE = Symbol('objectMode');
// internal event when stream is destroyed
const DESTROYED = Symbol('destroyed');
// internal event when stream has an error
const ERROR = Symbol('error');
const EMITDATA = Symbol('emitData');
const EMITEND = Symbol('emitEnd');
const EMITEND2 = Symbol('emitEnd2');
const ASYNC = Symbol('async');
const ABORT = Symbol('abort');
const ABORTED = Symbol('aborted');
const SIGNAL = Symbol('signal');
const DATALISTENERS = Symbol('dataListeners');
const DISCARDED = Symbol('discarded');
const defer = (fn) => Promise.resolve().then(fn);
const nodefer = (fn) => fn();
const isEndish = (ev) => ev === 'end' || ev === 'finish' || ev === 'prefinish';
const isArrayBufferLike = (b) => b instanceof ArrayBuffer ||
    (!!b &&
        typeof b === 'object' &&
        b.constructor &&
        b.constructor.name === 'ArrayBuffer' &&
        b.byteLength >= 0);
const isArrayBufferView = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b);
/**
 * Internal class representing a pipe to a destination stream.
 *
 * @internal
 */
class Pipe {
    src;
    dest;
    opts;
    ondrain;
    constructor(src, dest, opts) {
        this.src = src;
        this.dest = dest;
        this.opts = opts;
        this.ondrain = () => src[RESUME]();
        this.dest.on('drain', this.ondrain);
    }
    unpipe() {
        this.dest.removeListener('drain', this.ondrain);
    }
    // only here for the prototype
    /* c8 ignore start */
    proxyErrors(_er) { }
    /* c8 ignore stop */
    end() {
        this.unpipe();
        if (this.opts.end)
            this.dest.end();
    }
}
/**
 * Internal class representing a pipe to a destination stream where
 * errors are proxied.
 *
 * @internal
 */
class PipeProxyErrors extends Pipe {
    unpipe() {
        this.src.removeListener('error', this.proxyErrors);
        super.unpipe();
    }
    constructor(src, dest, opts) {
        super(src, dest, opts);
        this.proxyErrors = er => dest.emit('error', er);
        src.on('error', this.proxyErrors);
    }
}
const isObjectModeOptions = (o) => !!o.objectMode;
const isEncodingOptions = (o) => !o.objectMode && !!o.encoding && o.encoding !== 'buffer';
/**
 * Main export, the Minipass class
 *
 * `RType` is the type of data emitted, defaults to Buffer
 *
 * `WType` is the type of data to be written, if RType is buffer or string,
 * then any {@link Minipass.ContiguousData} is allowed.
 *
 * `Events` is the set of event handler signatures that this object
 * will emit, see {@link Minipass.Events}
 */
class Minipass extends external_node_events_.EventEmitter {
    [FLOWING] = false;
    [PAUSED] = false;
    [PIPES] = [];
    [BUFFER] = [];
    [OBJECTMODE];
    [ENCODING];
    [ASYNC];
    [DECODER];
    [EOF] = false;
    [EMITTED_END] = false;
    [EMITTING_END] = false;
    [CLOSED] = false;
    [EMITTED_ERROR] = null;
    [BUFFERLENGTH] = 0;
    [DESTROYED] = false;
    [SIGNAL];
    [ABORTED] = false;
    [DATALISTENERS] = 0;
    [DISCARDED] = false;
    /**
     * true if the stream can be written
     */
    writable = true;
    /**
     * true if the stream can be read
     */
    readable = true;
    /**
     * If `RType` is Buffer, then options do not need to be provided.
     * Otherwise, an options object must be provided to specify either
     * {@link Minipass.SharedOptions.objectMode} or
     * {@link Minipass.SharedOptions.encoding}, as appropriate.
     */
    constructor(...args) {
        const options = (args[0] ||
            {});
        super();
        if (options.objectMode && typeof options.encoding === 'string') {
            throw new TypeError('Encoding and objectMode may not be used together');
        }
        if (isObjectModeOptions(options)) {
            this[OBJECTMODE] = true;
            this[ENCODING] = null;
        }
        else if (isEncodingOptions(options)) {
            this[ENCODING] = options.encoding;
            this[OBJECTMODE] = false;
        }
        else {
            this[OBJECTMODE] = false;
            this[ENCODING] = null;
        }
        this[ASYNC] = !!options.async;
        this[DECODER] = this[ENCODING]
            ? new external_node_string_decoder_namespaceObject.StringDecoder(this[ENCODING])
            : null;
        //@ts-ignore - private option for debugging and testing
        if (options && options.debugExposeBuffer === true) {
            Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] });
        }
        //@ts-ignore - private option for debugging and testing
        if (options && options.debugExposePipes === true) {
            Object.defineProperty(this, 'pipes', { get: () => this[PIPES] });
        }
        const { signal } = options;
        if (signal) {
            this[SIGNAL] = signal;
            if (signal.aborted) {
                this[ABORT]();
            }
            else {
                signal.addEventListener('abort', () => this[ABORT]());
            }
        }
    }
    /**
     * The amount of data stored in the buffer waiting to be read.
     *
     * For Buffer strings, this will be the total byte length.
     * For string encoding streams, this will be the string character length,
     * according to JavaScript's `string.length` logic.
     * For objectMode streams, this is a count of the items waiting to be
     * emitted.
     */
    get bufferLength() {
        return this[BUFFERLENGTH];
    }
    /**
     * The `BufferEncoding` currently in use, or `null`
     */
    get encoding() {
        return this[ENCODING];
    }
    /**
     * @deprecated - This is a read only property
     */
    set encoding(_enc) {
        throw new Error('Encoding must be set at instantiation time');
    }
    /**
     * @deprecated - Encoding may only be set at instantiation time
     */
    setEncoding(_enc) {
        throw new Error('Encoding must be set at instantiation time');
    }
    /**
     * True if this is an objectMode stream
     */
    get objectMode() {
        return this[OBJECTMODE];
    }
    /**
     * @deprecated - This is a read-only property
     */
    set objectMode(_om) {
        throw new Error('objectMode must be set at instantiation time');
    }
    /**
     * true if this is an async stream
     */
    get ['async']() {
        return this[ASYNC];
    }
    /**
     * Set to true to make this stream async.
     *
     * Once set, it cannot be unset, as this would potentially cause incorrect
     * behavior.  Ie, a sync stream can be made async, but an async stream
     * cannot be safely made sync.
     */
    set ['async'](a) {
        this[ASYNC] = this[ASYNC] || !!a;
    }
    // drop everything and get out of the flow completely
    [ABORT]() {
        this[ABORTED] = true;
        this.emit('abort', this[SIGNAL]?.reason);
        this.destroy(this[SIGNAL]?.reason);
    }
    /**
     * True if the stream has been aborted.
     */
    get aborted() {
        return this[ABORTED];
    }
    /**
     * No-op setter. Stream aborted status is set via the AbortSignal provided
     * in the constructor options.
     */
    set aborted(_) { }
    write(chunk, encoding, cb) {
        if (this[ABORTED])
            return false;
        if (this[EOF])
            throw new Error('write after end');
        if (this[DESTROYED]) {
            this.emit('error', Object.assign(new Error('Cannot call write after a stream was destroyed'), { code: 'ERR_STREAM_DESTROYED' }));
            return true;
        }
        if (typeof encoding === 'function') {
            cb = encoding;
            encoding = 'utf8';
        }
        if (!encoding)
            encoding = 'utf8';
        const fn = this[ASYNC] ? defer : nodefer;
        // convert array buffers and typed array views into buffers
        // at some point in the future, we may want to do the opposite!
        // leave strings and buffers as-is
        // anything is only allowed if in object mode, so throw
        if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) {
            if (isArrayBufferView(chunk)) {
                //@ts-ignore - sinful unsafe type changing
                chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength);
            }
            else if (isArrayBufferLike(chunk)) {
                //@ts-ignore - sinful unsafe type changing
                chunk = Buffer.from(chunk);
            }
            else if (typeof chunk !== 'string') {
                throw new Error('Non-contiguous data written to non-objectMode stream');
            }
        }
        // handle object mode up front, since it's simpler
        // this yields better performance, fewer checks later.
        if (this[OBJECTMODE]) {
            // maybe impossible?
            /* c8 ignore start */
            if (this[FLOWING] && this[BUFFERLENGTH] !== 0)
                this[FLUSH](true);
            /* c8 ignore stop */
            if (this[FLOWING])
                this.emit('data', chunk);
            else
                this[BUFFERPUSH](chunk);
            if (this[BUFFERLENGTH] !== 0)
                this.emit('readable');
            if (cb)
                fn(cb);
            return this[FLOWING];
        }
        // at this point the chunk is a buffer or string
        // don't buffer it up or send it to the decoder
        if (!chunk.length) {
            if (this[BUFFERLENGTH] !== 0)
                this.emit('readable');
            if (cb)
                fn(cb);
            return this[FLOWING];
        }
        // fast-path writing strings of same encoding to a stream with
        // an empty buffer, skipping the buffer/decoder dance
        if (typeof chunk === 'string' &&
            // unless it is a string already ready for us to use
            !(encoding === this[ENCODING] && !this[DECODER]?.lastNeed)) {
            //@ts-ignore - sinful unsafe type change
            chunk = Buffer.from(chunk, encoding);
        }
        if (Buffer.isBuffer(chunk) && this[ENCODING]) {
            //@ts-ignore - sinful unsafe type change
            chunk = this[DECODER].write(chunk);
        }
        // Note: flushing CAN potentially switch us into not-flowing mode
        if (this[FLOWING] && this[BUFFERLENGTH] !== 0)
            this[FLUSH](true);
        if (this[FLOWING])
            this.emit('data', chunk);
        else
            this[BUFFERPUSH](chunk);
        if (this[BUFFERLENGTH] !== 0)
            this.emit('readable');
        if (cb)
            fn(cb);
        return this[FLOWING];
    }
    /**
     * Low-level explicit read method.
     *
     * In objectMode, the argument is ignored, and one item is returned if
     * available.
     *
     * `n` is the number of bytes (or in the case of encoding streams,
     * characters) to consume. If `n` is not provided, then the entire buffer
     * is returned, or `null` is returned if no data is available.
     *
     * If `n` is greater that the amount of data in the internal buffer,
     * then `null` is returned.
     */
    read(n) {
        if (this[DESTROYED])
            return null;
        this[DISCARDED] = false;
        if (this[BUFFERLENGTH] === 0 ||
            n === 0 ||
            (n && n > this[BUFFERLENGTH])) {
            this[MAYBE_EMIT_END]();
            return null;
        }
        if (this[OBJECTMODE])
            n = null;
        if (this[BUFFER].length > 1 && !this[OBJECTMODE]) {
            // not object mode, so if we have an encoding, then RType is string
            // otherwise, must be Buffer
            this[BUFFER] = [
                (this[ENCODING]
                    ? this[BUFFER].join('')
                    : Buffer.concat(this[BUFFER], this[BUFFERLENGTH])),
            ];
        }
        const ret = this[READ](n || null, this[BUFFER][0]);
        this[MAYBE_EMIT_END]();
        return ret;
    }
    [READ](n, chunk) {
        if (this[OBJECTMODE])
            this[BUFFERSHIFT]();
        else {
            const c = chunk;
            if (n === c.length || n === null)
                this[BUFFERSHIFT]();
            else if (typeof c === 'string') {
                this[BUFFER][0] = c.slice(n);
                chunk = c.slice(0, n);
                this[BUFFERLENGTH] -= n;
            }
            else {
                this[BUFFER][0] = c.subarray(n);
                chunk = c.subarray(0, n);
                this[BUFFERLENGTH] -= n;
            }
        }
        this.emit('data', chunk);
        if (!this[BUFFER].length && !this[EOF])
            this.emit('drain');
        return chunk;
    }
    end(chunk, encoding, cb) {
        if (typeof chunk === 'function') {
            cb = chunk;
            chunk = undefined;
        }
        if (typeof encoding === 'function') {
            cb = encoding;
            encoding = 'utf8';
        }
        if (chunk !== undefined)
            this.write(chunk, encoding);
        if (cb)
            this.once('end', cb);
        this[EOF] = true;
        this.writable = false;
        // if we haven't written anything, then go ahead and emit,
        // even if we're not reading.
        // we'll re-emit if a new 'end' listener is added anyway.
        // This makes MP more suitable to write-only use cases.
        if (this[FLOWING] || !this[PAUSED])
            this[MAYBE_EMIT_END]();
        return this;
    }
    // don't let the internal resume be overwritten
    [RESUME]() {
        if (this[DESTROYED])
            return;
        if (!this[DATALISTENERS] && !this[PIPES].length) {
            this[DISCARDED] = true;
        }
        this[PAUSED] = false;
        this[FLOWING] = true;
        this.emit('resume');
        if (this[BUFFER].length)
            this[FLUSH]();
        else if (this[EOF])
            this[MAYBE_EMIT_END]();
        else
            this.emit('drain');
    }
    /**
     * Resume the stream if it is currently in a paused state
     *
     * If called when there are no pipe destinations or `data` event listeners,
     * this will place the stream in a "discarded" state, where all data will
     * be thrown away. The discarded state is removed if a pipe destination or
     * data handler is added, if pause() is called, or if any synchronous or
     * asynchronous iteration is started.
     */
    resume() {
        return this[RESUME]();
    }
    /**
     * Pause the stream
     */
    pause() {
        this[FLOWING] = false;
        this[PAUSED] = true;
        this[DISCARDED] = false;
    }
    /**
     * true if the stream has been forcibly destroyed
     */
    get destroyed() {
        return this[DESTROYED];
    }
    /**
     * true if the stream is currently in a flowing state, meaning that
     * any writes will be immediately emitted.
     */
    get flowing() {
        return this[FLOWING];
    }
    /**
     * true if the stream is currently in a paused state
     */
    get paused() {
        return this[PAUSED];
    }
    [BUFFERPUSH](chunk) {
        if (this[OBJECTMODE])
            this[BUFFERLENGTH] += 1;
        else
            this[BUFFERLENGTH] += chunk.length;
        this[BUFFER].push(chunk);
    }
    [BUFFERSHIFT]() {
        if (this[OBJECTMODE])
            this[BUFFERLENGTH] -= 1;
        else
            this[BUFFERLENGTH] -= this[BUFFER][0].length;
        return this[BUFFER].shift();
    }
    [FLUSH](noDrain = false) {
        do { } while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) &&
            this[BUFFER].length);
        if (!noDrain && !this[BUFFER].length && !this[EOF])
            this.emit('drain');
    }
    [FLUSHCHUNK](chunk) {
        this.emit('data', chunk);
        return this[FLOWING];
    }
    /**
     * Pipe all data emitted by this stream into the destination provided.
     *
     * Triggers the flow of data.
     */
    pipe(dest, opts) {
        if (this[DESTROYED])
            return dest;
        this[DISCARDED] = false;
        const ended = this[EMITTED_END];
        opts = opts || {};
        if (dest === proc.stdout || dest === proc.stderr)
            opts.end = false;
        else
            opts.end = opts.end !== false;
        opts.proxyErrors = !!opts.proxyErrors;
        // piping an ended stream ends immediately
        if (ended) {
            if (opts.end)
                dest.end();
        }
        else {
            // "as" here just ignores the WType, which pipes don't care about,
            // since they're only consuming from us, and writing to the dest
            this[PIPES].push(!opts.proxyErrors
                ? new Pipe(this, dest, opts)
                : new PipeProxyErrors(this, dest, opts));
            if (this[ASYNC])
                defer(() => this[RESUME]());
            else
                this[RESUME]();
        }
        return dest;
    }
    /**
     * Fully unhook a piped destination stream.
     *
     * If the destination stream was the only consumer of this stream (ie,
     * there are no other piped destinations or `'data'` event listeners)
     * then the flow of data will stop until there is another consumer or
     * {@link Minipass#resume} is explicitly called.
     */
    unpipe(dest) {
        const p = this[PIPES].find(p => p.dest === dest);
        if (p) {
            if (this[PIPES].length === 1) {
                if (this[FLOWING] && this[DATALISTENERS] === 0) {
                    this[FLOWING] = false;
                }
                this[PIPES] = [];
            }
            else
                this[PIPES].splice(this[PIPES].indexOf(p), 1);
            p.unpipe();
        }
    }
    /**
     * Alias for {@link Minipass#on}
     */
    addListener(ev, handler) {
        return this.on(ev, handler);
    }
    /**
     * Mostly identical to `EventEmitter.on`, with the following
     * behavior differences to prevent data loss and unnecessary hangs:
     *
     * - Adding a 'data' event handler will trigger the flow of data
     *
     * - Adding a 'readable' event handler when there is data waiting to be read
     *   will cause 'readable' to be emitted immediately.
     *
     * - Adding an 'endish' event handler ('end', 'finish', etc.) which has
     *   already passed will cause the event to be emitted immediately and all
     *   handlers removed.
     *
     * - Adding an 'error' event handler after an error has been emitted will
     *   cause the event to be re-emitted immediately with the error previously
     *   raised.
     */
    on(ev, handler) {
        const ret = super.on(ev, handler);
        if (ev === 'data') {
            this[DISCARDED] = false;
            this[DATALISTENERS]++;
            if (!this[PIPES].length && !this[FLOWING]) {
                this[RESUME]();
            }
        }
        else if (ev === 'readable' && this[BUFFERLENGTH] !== 0) {
            super.emit('readable');
        }
        else if (isEndish(ev) && this[EMITTED_END]) {
            super.emit(ev);
            this.removeAllListeners(ev);
        }
        else if (ev === 'error' && this[EMITTED_ERROR]) {
            const h = handler;
            if (this[ASYNC])
                defer(() => h.call(this, this[EMITTED_ERROR]));
            else
                h.call(this, this[EMITTED_ERROR]);
        }
        return ret;
    }
    /**
     * Alias for {@link Minipass#off}
     */
    removeListener(ev, handler) {
        return this.off(ev, handler);
    }
    /**
     * Mostly identical to `EventEmitter.off`
     *
     * If a 'data' event handler is removed, and it was the last consumer
     * (ie, there are no pipe destinations or other 'data' event listeners),
     * then the flow of data will stop until there is another consumer or
     * {@link Minipass#resume} is explicitly called.
     */
    off(ev, handler) {
        const ret = super.off(ev, handler);
        // if we previously had listeners, and now we don't, and we don't
        // have any pipes, then stop the flow, unless it's been explicitly
        // put in a discarded flowing state via stream.resume().
        if (ev === 'data') {
            this[DATALISTENERS] = this.listeners('data').length;
            if (this[DATALISTENERS] === 0 &&
                !this[DISCARDED] &&
                !this[PIPES].length) {
                this[FLOWING] = false;
            }
        }
        return ret;
    }
    /**
     * Mostly identical to `EventEmitter.removeAllListeners`
     *
     * If all 'data' event handlers are removed, and they were the last consumer
     * (ie, there are no pipe destinations), then the flow of data will stop
     * until there is another consumer or {@link Minipass#resume} is explicitly
     * called.
     */
    removeAllListeners(ev) {
        const ret = super.removeAllListeners(ev);
        if (ev === 'data' || ev === undefined) {
            this[DATALISTENERS] = 0;
            if (!this[DISCARDED] && !this[PIPES].length) {
                this[FLOWING] = false;
            }
        }
        return ret;
    }
    /**
     * true if the 'end' event has been emitted
     */
    get emittedEnd() {
        return this[EMITTED_END];
    }
    [MAYBE_EMIT_END]() {
        if (!this[EMITTING_END] &&
            !this[EMITTED_END] &&
            !this[DESTROYED] &&
            this[BUFFER].length === 0 &&
            this[EOF]) {
            this[EMITTING_END] = true;
            this.emit('end');
            this.emit('prefinish');
            this.emit('finish');
            if (this[CLOSED])
                this.emit('close');
            this[EMITTING_END] = false;
        }
    }
    /**
     * Mostly identical to `EventEmitter.emit`, with the following
     * behavior differences to prevent data loss and unnecessary hangs:
     *
     * If the stream has been destroyed, and the event is something other
     * than 'close' or 'error', then `false` is returned and no handlers
     * are called.
     *
     * If the event is 'end', and has already been emitted, then the event
     * is ignored. If the stream is in a paused or non-flowing state, then
     * the event will be deferred until data flow resumes. If the stream is
     * async, then handlers will be called on the next tick rather than
     * immediately.
     *
     * If the event is 'close', and 'end' has not yet been emitted, then
     * the event will be deferred until after 'end' is emitted.
     *
     * If the event is 'error', and an AbortSignal was provided for the stream,
     * and there are no listeners, then the event is ignored, matching the
     * behavior of node core streams in the presense of an AbortSignal.
     *
     * If the event is 'finish' or 'prefinish', then all listeners will be
     * removed after emitting the event, to prevent double-firing.
     */
    emit(ev, ...args) {
        const data = args[0];
        // error and close are only events allowed after calling destroy()
        if (ev !== 'error' &&
            ev !== 'close' &&
            ev !== DESTROYED &&
            this[DESTROYED]) {
            return false;
        }
        else if (ev === 'data') {
            return !this[OBJECTMODE] && !data
                ? false
                : this[ASYNC]
                    ? (defer(() => this[EMITDATA](data)), true)
                    : this[EMITDATA](data);
        }
        else if (ev === 'end') {
            return this[EMITEND]();
        }
        else if (ev === 'close') {
            this[CLOSED] = true;
            // don't emit close before 'end' and 'finish'
            if (!this[EMITTED_END] && !this[DESTROYED])
                return false;
            const ret = super.emit('close');
            this.removeAllListeners('close');
            return ret;
        }
        else if (ev === 'error') {
            this[EMITTED_ERROR] = data;
            super.emit(ERROR, data);
            const ret = !this[SIGNAL] || this.listeners('error').length
                ? super.emit('error', data)
                : false;
            this[MAYBE_EMIT_END]();
            return ret;
        }
        else if (ev === 'resume') {
            const ret = super.emit('resume');
            this[MAYBE_EMIT_END]();
            return ret;
        }
        else if (ev === 'finish' || ev === 'prefinish') {
            const ret = super.emit(ev);
            this.removeAllListeners(ev);
            return ret;
        }
        // Some other unknown event
        const ret = super.emit(ev, ...args);
        this[MAYBE_EMIT_END]();
        return ret;
    }
    [EMITDATA](data) {
        for (const p of this[PIPES]) {
            if (p.dest.write(data) === false)
                this.pause();
        }
        const ret = this[DISCARDED] ? false : super.emit('data', data);
        this[MAYBE_EMIT_END]();
        return ret;
    }
    [EMITEND]() {
        if (this[EMITTED_END])
            return false;
        this[EMITTED_END] = true;
        this.readable = false;
        return this[ASYNC]
            ? (defer(() => this[EMITEND2]()), true)
            : this[EMITEND2]();
    }
    [EMITEND2]() {
        if (this[DECODER]) {
            const data = this[DECODER].end();
            if (data) {
                for (const p of this[PIPES]) {
                    p.dest.write(data);
                }
                if (!this[DISCARDED])
                    super.emit('data', data);
            }
        }
        for (const p of this[PIPES]) {
            p.end();
        }
        const ret = super.emit('end');
        this.removeAllListeners('end');
        return ret;
    }
    /**
     * Return a Promise that resolves to an array of all emitted data once
     * the stream ends.
     */
    async collect() {
        const buf = Object.assign([], {
            dataLength: 0,
        });
        if (!this[OBJECTMODE])
            buf.dataLength = 0;
        // set the promise first, in case an error is raised
        // by triggering the flow here.
        const p = this.promise();
        this.on('data', c => {
            buf.push(c);
            if (!this[OBJECTMODE])
                buf.dataLength += c.length;
        });
        await p;
        return buf;
    }
    /**
     * Return a Promise that resolves to the concatenation of all emitted data
     * once the stream ends.
     *
     * Not allowed on objectMode streams.
     */
    async concat() {
        if (this[OBJECTMODE]) {
            throw new Error('cannot concat in objectMode');
        }
        const buf = await this.collect();
        return (this[ENCODING]
            ? buf.join('')
            : Buffer.concat(buf, buf.dataLength));
    }
    /**
     * Return a void Promise that resolves once the stream ends.
     */
    async promise() {
        return new Promise((resolve, reject) => {
            this.on(DESTROYED, () => reject(new Error('stream destroyed')));
            this.on('error', er => reject(er));
            this.on('end', () => resolve());
        });
    }
    /**
     * Asynchronous `for await of` iteration.
     *
     * This will continue emitting all chunks until the stream terminates.
     */
    [Symbol.asyncIterator]() {
        // set this up front, in case the consumer doesn't call next()
        // right away.
        this[DISCARDED] = false;
        let stopped = false;
        const stop = async () => {
            this.pause();
            stopped = true;
            return { value: undefined, done: true };
        };
        const next = () => {
            if (stopped)
                return stop();
            const res = this.read();
            if (res !== null)
                return Promise.resolve({ done: false, value: res });
            if (this[EOF])
                return stop();
            let resolve;
            let reject;
            const onerr = (er) => {
                this.off('data', ondata);
                this.off('end', onend);
                this.off(DESTROYED, ondestroy);
                stop();
                reject(er);
            };
            const ondata = (value) => {
                this.off('error', onerr);
                this.off('end', onend);
                this.off(DESTROYED, ondestroy);
                this.pause();
                resolve({ value, done: !!this[EOF] });
            };
            const onend = () => {
                this.off('error', onerr);
                this.off('data', ondata);
                this.off(DESTROYED, ondestroy);
                stop();
                resolve({ done: true, value: undefined });
            };
            const ondestroy = () => onerr(new Error('stream destroyed'));
            return new Promise((res, rej) => {
                reject = rej;
                resolve = res;
                this.once(DESTROYED, ondestroy);
                this.once('error', onerr);
                this.once('end', onend);
                this.once('data', ondata);
            });
        };
        return {
            next,
            throw: stop,
            return: stop,
            [Symbol.asyncIterator]() {
                return this;
            },
        };
    }
    /**
     * Synchronous `for of` iteration.
     *
     * The iteration will terminate when the internal buffer runs out, even
     * if the stream has not yet terminated.
     */
    [Symbol.iterator]() {
        // set this up front, in case the consumer doesn't call next()
        // right away.
        this[DISCARDED] = false;
        let stopped = false;
        const stop = () => {
            this.pause();
            this.off(ERROR, stop);
            this.off(DESTROYED, stop);
            this.off('end', stop);
            stopped = true;
            return { done: true, value: undefined };
        };
        const next = () => {
            if (stopped)
                return stop();
            const value = this.read();
            return value === null ? stop() : { done: false, value };
        };
        this.once('end', stop);
        this.once(ERROR, stop);
        this.once(DESTROYED, stop);
        return {
            next,
            throw: stop,
            return: stop,
            [Symbol.iterator]() {
                return this;
            },
        };
    }
    /**
     * Destroy a stream, preventing it from being used for any further purpose.
     *
     * If the stream has a `close()` method, then it will be called on
     * destruction.
     *
     * After destruction, any attempt to write data, read data, or emit most
     * events will be ignored.
     *
     * If an error argument is provided, then it will be emitted in an
     * 'error' event.
     */
    destroy(er) {
        if (this[DESTROYED]) {
            if (er)
                this.emit('error', er);
            else
                this.emit(DESTROYED);
            return this;
        }
        this[DESTROYED] = true;
        this[DISCARDED] = true;
        // throw away all buffered data, it's never coming out
        this[BUFFER].length = 0;
        this[BUFFERLENGTH] = 0;
        const wc = this;
        if (typeof wc.close === 'function' && !this[CLOSED])
            wc.close();
        if (er)
            this.emit('error', er);
        // if no error to emit, still reject pending promises
        else
            this.emit(DESTROYED);
        return this;
    }
    /**
     * Alias for {@link isStream}
     *
     * Former export location, maintained for backwards compatibility.
     *
     * @deprecated
     */
    static get isStream() {
        return isStream;
    }
}
//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ./node_modules/path-scurry/dist/esm/index.js





const realpathSync = external_fs_.realpathSync.native;
// TODO: test perf of fs/promises realpath vs realpathCB,
// since the promises one uses realpath.native


const defaultFS = {
    lstatSync: external_fs_.lstatSync,
    readdir: external_fs_.readdir,
    readdirSync: external_fs_.readdirSync,
    readlinkSync: external_fs_.readlinkSync,
    realpathSync,
    promises: {
        lstat: promises_namespaceObject.lstat,
        readdir: promises_namespaceObject.readdir,
        readlink: promises_namespaceObject.readlink,
        realpath: promises_namespaceObject.realpath,
    },
};
// if they just gave us require('fs') then use our default
const fsFromOption = (fsOption) => !fsOption || fsOption === defaultFS || fsOption === external_node_fs_namespaceObject_0 ?
    defaultFS
    : {
        ...defaultFS,
        ...fsOption,
        promises: {
            ...defaultFS.promises,
            ...(fsOption.promises || {}),
        },
    };
// turn something like //?/c:/ into c:\
const uncDriveRegexp = /^\\\\\?\\([a-z]:)\\?$/i;
const uncToDrive = (rootPath) => rootPath.replace(/\//g, '\\').replace(uncDriveRegexp, '$1\\');
// windows paths are separated by either / or \
const eitherSep = /[\\\/]/;
const UNKNOWN = 0; // may not even exist, for all we know
const IFIFO = 0b0001;
const IFCHR = 0b0010;
const IFDIR = 0b0100;
const IFBLK = 0b0110;
const IFREG = 0b1000;
const IFLNK = 0b1010;
const IFSOCK = 0b1100;
const IFMT = 0b1111;
// mask to unset low 4 bits
const IFMT_UNKNOWN = ~IFMT;
// set after successfully calling readdir() and getting entries.
const READDIR_CALLED = 0b0000_0001_0000;
// set after a successful lstat()
const LSTAT_CALLED = 0b0000_0010_0000;
// set if an entry (or one of its parents) is definitely not a dir
const ENOTDIR = 0b0000_0100_0000;
// set if an entry (or one of its parents) does not exist
// (can also be set on lstat errors like EACCES or ENAMETOOLONG)
const ENOENT = 0b0000_1000_0000;
// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK
// set if we fail to readlink
const ENOREADLINK = 0b0001_0000_0000;
// set if we know realpath() will fail
const ENOREALPATH = 0b0010_0000_0000;
const ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH;
const TYPEMASK = 0b0011_1111_1111;
const entToType = (s) => s.isFile() ? IFREG
    : s.isDirectory() ? IFDIR
        : s.isSymbolicLink() ? IFLNK
            : s.isCharacterDevice() ? IFCHR
                : s.isBlockDevice() ? IFBLK
                    : s.isSocket() ? IFSOCK
                        : s.isFIFO() ? IFIFO
                            : UNKNOWN;
// normalize unicode path names
const normalizeCache = new Map();
const normalize = (s) => {
    const c = normalizeCache.get(s);
    if (c)
        return c;
    const n = s.normalize('NFKD');
    normalizeCache.set(s, n);
    return n;
};
const normalizeNocaseCache = new Map();
const normalizeNocase = (s) => {
    const c = normalizeNocaseCache.get(s);
    if (c)
        return c;
    const n = normalize(s.toLowerCase());
    normalizeNocaseCache.set(s, n);
    return n;
};
/**
 * An LRUCache for storing resolved path strings or Path objects.
 * @internal
 */
class ResolveCache extends LRUCache {
    constructor() {
        super({ max: 256 });
    }
}
// In order to prevent blowing out the js heap by allocating hundreds of
// thousands of Path entries when walking extremely large trees, the "children"
// in this tree are represented by storing an array of Path entries in an
// LRUCache, indexed by the parent.  At any time, Path.children() may return an
// empty array, indicating that it doesn't know about any of its children, and
// thus has to rebuild that cache.  This is fine, it just means that we don't
// benefit as much from having the cached entries, but huge directory walks
// don't blow out the stack, and smaller ones are still as fast as possible.
//
//It does impose some complexity when building up the readdir data, because we
//need to pass a reference to the children array that we started with.
/**
 * an LRUCache for storing child entries.
 * @internal
 */
class ChildrenCache extends LRUCache {
    constructor(maxSize = 16 * 1024) {
        super({
            maxSize,
            // parent + children
            sizeCalculation: a => a.length + 1,
        });
    }
}
const setAsCwd = Symbol('PathScurry setAsCwd');
/**
 * Path objects are sort of like a super-powered
 * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}
 *
 * Each one represents a single filesystem entry on disk, which may or may not
 * exist. It includes methods for reading various types of information via
 * lstat, readlink, and readdir, and caches all information to the greatest
 * degree possible.
 *
 * Note that fs operations that would normally throw will instead return an
 * "empty" value. This is in order to prevent excessive overhead from error
 * stack traces.
 */
class PathBase {
    /**
     * the basename of this path
     *
     * **Important**: *always* test the path name against any test string
     * usingthe {@link isNamed} method, and not by directly comparing this
     * string. Otherwise, unicode path strings that the system sees as identical
     * will not be properly treated as the same path, leading to incorrect
     * behavior and possible security issues.
     */
    name;
    /**
     * the Path entry corresponding to the path root.
     *
     * @internal
     */
    root;
    /**
     * All roots found within the current PathScurry family
     *
     * @internal
     */
    roots;
    /**
     * a reference to the parent path, or undefined in the case of root entries
     *
     * @internal
     */
    parent;
    /**
     * boolean indicating whether paths are compared case-insensitively
     * @internal
     */
    nocase;
    /**
     * boolean indicating that this path is the current working directory
     * of the PathScurry collection that contains it.
     */
    isCWD = false;
    // potential default fs override
    #fs;
    // Stats fields
    #dev;
    get dev() {
        return this.#dev;
    }
    #mode;
    get mode() {
        return this.#mode;
    }
    #nlink;
    get nlink() {
        return this.#nlink;
    }
    #uid;
    get uid() {
        return this.#uid;
    }
    #gid;
    get gid() {
        return this.#gid;
    }
    #rdev;
    get rdev() {
        return this.#rdev;
    }
    #blksize;
    get blksize() {
        return this.#blksize;
    }
    #ino;
    get ino() {
        return this.#ino;
    }
    #size;
    get size() {
        return this.#size;
    }
    #blocks;
    get blocks() {
        return this.#blocks;
    }
    #atimeMs;
    get atimeMs() {
        return this.#atimeMs;
    }
    #mtimeMs;
    get mtimeMs() {
        return this.#mtimeMs;
    }
    #ctimeMs;
    get ctimeMs() {
        return this.#ctimeMs;
    }
    #birthtimeMs;
    get birthtimeMs() {
        return this.#birthtimeMs;
    }
    #atime;
    get atime() {
        return this.#atime;
    }
    #mtime;
    get mtime() {
        return this.#mtime;
    }
    #ctime;
    get ctime() {
        return this.#ctime;
    }
    #birthtime;
    get birthtime() {
        return this.#birthtime;
    }
    #matchName;
    #depth;
    #fullpath;
    #fullpathPosix;
    #relative;
    #relativePosix;
    #type;
    #children;
    #linkTarget;
    #realpath;
    /**
     * This property is for compatibility with the Dirent class as of
     * Node v20, where Dirent['parentPath'] refers to the path of the
     * directory that was passed to readdir. For root entries, it's the path
     * to the entry itself.
     */
    get parentPath() {
        return (this.parent || this).fullpath();
    }
    /**
     * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,
     * this property refers to the *parent* path, not the path object itself.
     *
     * @deprecated
     */
    get path() {
        return this.parentPath;
    }
    /**
     * Do not create new Path objects directly.  They should always be accessed
     * via the PathScurry class or other methods on the Path class.
     *
     * @internal
     */
    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
        this.name = name;
        this.#matchName = nocase ? normalizeNocase(name) : normalize(name);
        this.#type = type & TYPEMASK;
        this.nocase = nocase;
        this.roots = roots;
        this.root = root || this;
        this.#children = children;
        this.#fullpath = opts.fullpath;
        this.#relative = opts.relative;
        this.#relativePosix = opts.relativePosix;
        this.parent = opts.parent;
        if (this.parent) {
            this.#fs = this.parent.#fs;
        }
        else {
            this.#fs = fsFromOption(opts.fs);
        }
    }
    /**
     * Returns the depth of the Path object from its root.
     *
     * For example, a path at `/foo/bar` would have a depth of 2.
     */
    depth() {
        if (this.#depth !== undefined)
            return this.#depth;
        if (!this.parent)
            return (this.#depth = 0);
        return (this.#depth = this.parent.depth() + 1);
    }
    /**
     * @internal
     */
    childrenCache() {
        return this.#children;
    }
    /**
     * Get the Path object referenced by the string path, resolved from this Path
     */
    resolve(path) {
        if (!path) {
            return this;
        }
        const rootPath = this.getRootString(path);
        const dir = path.substring(rootPath.length);
        const dirParts = dir.split(this.splitSep);
        const result = rootPath ?
            this.getRoot(rootPath).#resolveParts(dirParts)
            : this.#resolveParts(dirParts);
        return result;
    }
    #resolveParts(dirParts) {
        let p = this;
        for (const part of dirParts) {
            p = p.child(part);
        }
        return p;
    }
    /**
     * Returns the cached children Path objects, if still available.  If they
     * have fallen out of the cache, then returns an empty array, and resets the
     * READDIR_CALLED bit, so that future calls to readdir() will require an fs
     * lookup.
     *
     * @internal
     */
    children() {
        const cached = this.#children.get(this);
        if (cached) {
            return cached;
        }
        const children = Object.assign([], { provisional: 0 });
        this.#children.set(this, children);
        this.#type &= ~READDIR_CALLED;
        return children;
    }
    /**
     * Resolves a path portion and returns or creates the child Path.
     *
     * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is
     * `'..'`.
     *
     * This should not be called directly.  If `pathPart` contains any path
     * separators, it will lead to unsafe undefined behavior.
     *
     * Use `Path.resolve()` instead.
     *
     * @internal
     */
    child(pathPart, opts) {
        if (pathPart === '' || pathPart === '.') {
            return this;
        }
        if (pathPart === '..') {
            return this.parent || this;
        }
        // find the child
        const children = this.children();
        const name = this.nocase ? normalizeNocase(pathPart) : normalize(pathPart);
        for (const p of children) {
            if (p.#matchName === name) {
                return p;
            }
        }
        // didn't find it, create provisional child, since it might not
        // actually exist.  If we know the parent isn't a dir, then
        // in fact it CAN'T exist.
        const s = this.parent ? this.sep : '';
        const fullpath = this.#fullpath ? this.#fullpath + s + pathPart : undefined;
        const pchild = this.newChild(pathPart, UNKNOWN, {
            ...opts,
            parent: this,
            fullpath,
        });
        if (!this.canReaddir()) {
            pchild.#type |= ENOENT;
        }
        // don't have to update provisional, because if we have real children,
        // then provisional is set to children.length, otherwise a lower number
        children.push(pchild);
        return pchild;
    }
    /**
     * The relative path from the cwd. If it does not share an ancestor with
     * the cwd, then this ends up being equivalent to the fullpath()
     */
    relative() {
        if (this.isCWD)
            return '';
        if (this.#relative !== undefined) {
            return this.#relative;
        }
        const name = this.name;
        const p = this.parent;
        if (!p) {
            return (this.#relative = this.name);
        }
        const pv = p.relative();
        return pv + (!pv || !p.parent ? '' : this.sep) + name;
    }
    /**
     * The relative path from the cwd, using / as the path separator.
     * If it does not share an ancestor with
     * the cwd, then this ends up being equivalent to the fullpathPosix()
     * On posix systems, this is identical to relative().
     */
    relativePosix() {
        if (this.sep === '/')
            return this.relative();
        if (this.isCWD)
            return '';
        if (this.#relativePosix !== undefined)
            return this.#relativePosix;
        const name = this.name;
        const p = this.parent;
        if (!p) {
            return (this.#relativePosix = this.fullpathPosix());
        }
        const pv = p.relativePosix();
        return pv + (!pv || !p.parent ? '' : '/') + name;
    }
    /**
     * The fully resolved path string for this Path entry
     */
    fullpath() {
        if (this.#fullpath !== undefined) {
            return this.#fullpath;
        }
        const name = this.name;
        const p = this.parent;
        if (!p) {
            return (this.#fullpath = this.name);
        }
        const pv = p.fullpath();
        const fp = pv + (!p.parent ? '' : this.sep) + name;
        return (this.#fullpath = fp);
    }
    /**
     * On platforms other than windows, this is identical to fullpath.
     *
     * On windows, this is overridden to return the forward-slash form of the
     * full UNC path.
     */
    fullpathPosix() {
        if (this.#fullpathPosix !== undefined)
            return this.#fullpathPosix;
        if (this.sep === '/')
            return (this.#fullpathPosix = this.fullpath());
        if (!this.parent) {
            const p = this.fullpath().replace(/\\/g, '/');
            if (/^[a-z]:\//i.test(p)) {
                return (this.#fullpathPosix = `//?/${p}`);
            }
            else {
                return (this.#fullpathPosix = p);
            }
        }
        const p = this.parent;
        const pfpp = p.fullpathPosix();
        const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name;
        return (this.#fullpathPosix = fpp);
    }
    /**
     * Is the Path of an unknown type?
     *
     * Note that we might know *something* about it if there has been a previous
     * filesystem operation, for example that it does not exist, or is not a
     * link, or whether it has child entries.
     */
    isUnknown() {
        return (this.#type & IFMT) === UNKNOWN;
    }
    isType(type) {
        return this[`is${type}`]();
    }
    getType() {
        return (this.isUnknown() ? 'Unknown'
            : this.isDirectory() ? 'Directory'
                : this.isFile() ? 'File'
                    : this.isSymbolicLink() ? 'SymbolicLink'
                        : this.isFIFO() ? 'FIFO'
                            : this.isCharacterDevice() ? 'CharacterDevice'
                                : this.isBlockDevice() ? 'BlockDevice'
                                    : /* c8 ignore start */ this.isSocket() ? 'Socket'
                                        : 'Unknown');
        /* c8 ignore stop */
    }
    /**
     * Is the Path a regular file?
     */
    isFile() {
        return (this.#type & IFMT) === IFREG;
    }
    /**
     * Is the Path a directory?
     */
    isDirectory() {
        return (this.#type & IFMT) === IFDIR;
    }
    /**
     * Is the path a character device?
     */
    isCharacterDevice() {
        return (this.#type & IFMT) === IFCHR;
    }
    /**
     * Is the path a block device?
     */
    isBlockDevice() {
        return (this.#type & IFMT) === IFBLK;
    }
    /**
     * Is the path a FIFO pipe?
     */
    isFIFO() {
        return (this.#type & IFMT) === IFIFO;
    }
    /**
     * Is the path a socket?
     */
    isSocket() {
        return (this.#type & IFMT) === IFSOCK;
    }
    /**
     * Is the path a symbolic link?
     */
    isSymbolicLink() {
        return (this.#type & IFLNK) === IFLNK;
    }
    /**
     * Return the entry if it has been subject of a successful lstat, or
     * undefined otherwise.
     *
     * Does not read the filesystem, so an undefined result *could* simply
     * mean that we haven't called lstat on it.
     */
    lstatCached() {
        return this.#type & LSTAT_CALLED ? this : undefined;
    }
    /**
     * Return the cached link target if the entry has been the subject of a
     * successful readlink, or undefined otherwise.
     *
     * Does not read the filesystem, so an undefined result *could* just mean we
     * don't have any cached data. Only use it if you are very sure that a
     * readlink() has been called at some point.
     */
    readlinkCached() {
        return this.#linkTarget;
    }
    /**
     * Returns the cached realpath target if the entry has been the subject
     * of a successful realpath, or undefined otherwise.
     *
     * Does not read the filesystem, so an undefined result *could* just mean we
     * don't have any cached data. Only use it if you are very sure that a
     * realpath() has been called at some point.
     */
    realpathCached() {
        return this.#realpath;
    }
    /**
     * Returns the cached child Path entries array if the entry has been the
     * subject of a successful readdir(), or [] otherwise.
     *
     * Does not read the filesystem, so an empty array *could* just mean we
     * don't have any cached data. Only use it if you are very sure that a
     * readdir() has been called recently enough to still be valid.
     */
    readdirCached() {
        const children = this.children();
        return children.slice(0, children.provisional);
    }
    /**
     * Return true if it's worth trying to readlink.  Ie, we don't (yet) have
     * any indication that readlink will definitely fail.
     *
     * Returns false if the path is known to not be a symlink, if a previous
     * readlink failed, or if the entry does not exist.
     */
    canReadlink() {
        if (this.#linkTarget)
            return true;
        if (!this.parent)
            return false;
        // cases where it cannot possibly succeed
        const ifmt = this.#type & IFMT;
        return !((ifmt !== UNKNOWN && ifmt !== IFLNK) ||
            this.#type & ENOREADLINK ||
            this.#type & ENOENT);
    }
    /**
     * Return true if readdir has previously been successfully called on this
     * path, indicating that cachedReaddir() is likely valid.
     */
    calledReaddir() {
        return !!(this.#type & READDIR_CALLED);
    }
    /**
     * Returns true if the path is known to not exist. That is, a previous lstat
     * or readdir failed to verify its existence when that would have been
     * expected, or a parent entry was marked either enoent or enotdir.
     */
    isENOENT() {
        return !!(this.#type & ENOENT);
    }
    /**
     * Return true if the path is a match for the given path name.  This handles
     * case sensitivity and unicode normalization.
     *
     * Note: even on case-sensitive systems, it is **not** safe to test the
     * equality of the `.name` property to determine whether a given pathname
     * matches, due to unicode normalization mismatches.
     *
     * Always use this method instead of testing the `path.name` property
     * directly.
     */
    isNamed(n) {
        return !this.nocase ?
            this.#matchName === normalize(n)
            : this.#matchName === normalizeNocase(n);
    }
    /**
     * Return the Path object corresponding to the target of a symbolic link.
     *
     * If the Path is not a symbolic link, or if the readlink call fails for any
     * reason, `undefined` is returned.
     *
     * Result is cached, and thus may be outdated if the filesystem is mutated.
     */
    async readlink() {
        const target = this.#linkTarget;
        if (target) {
            return target;
        }
        if (!this.canReadlink()) {
            return undefined;
        }
        /* c8 ignore start */
        // already covered by the canReadlink test, here for ts grumples
        if (!this.parent) {
            return undefined;
        }
        /* c8 ignore stop */
        try {
            const read = await this.#fs.promises.readlink(this.fullpath());
            const linkTarget = (await this.parent.realpath())?.resolve(read);
            if (linkTarget) {
                return (this.#linkTarget = linkTarget);
            }
        }
        catch (er) {
            this.#readlinkFail(er.code);
            return undefined;
        }
    }
    /**
     * Synchronous {@link PathBase.readlink}
     */
    readlinkSync() {
        const target = this.#linkTarget;
        if (target) {
            return target;
        }
        if (!this.canReadlink()) {
            return undefined;
        }
        /* c8 ignore start */
        // already covered by the canReadlink test, here for ts grumples
        if (!this.parent) {
            return undefined;
        }
        /* c8 ignore stop */
        try {
            const read = this.#fs.readlinkSync(this.fullpath());
            const linkTarget = this.parent.realpathSync()?.resolve(read);
            if (linkTarget) {
                return (this.#linkTarget = linkTarget);
            }
        }
        catch (er) {
            this.#readlinkFail(er.code);
            return undefined;
        }
    }
    #readdirSuccess(children) {
        // succeeded, mark readdir called bit
        this.#type |= READDIR_CALLED;
        // mark all remaining provisional children as ENOENT
        for (let p = children.provisional; p < children.length; p++) {
            const c = children[p];
            if (c)
                c.#markENOENT();
        }
    }
    #markENOENT() {
        // mark as UNKNOWN and ENOENT
        if (this.#type & ENOENT)
            return;
        this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN;
        this.#markChildrenENOENT();
    }
    #markChildrenENOENT() {
        // all children are provisional and do not exist
        const children = this.children();
        children.provisional = 0;
        for (const p of children) {
            p.#markENOENT();
        }
    }
    #markENOREALPATH() {
        this.#type |= ENOREALPATH;
        this.#markENOTDIR();
    }
    // save the information when we know the entry is not a dir
    #markENOTDIR() {
        // entry is not a directory, so any children can't exist.
        // this *should* be impossible, since any children created
        // after it's been marked ENOTDIR should be marked ENOENT,
        // so it won't even get to this point.
        /* c8 ignore start */
        if (this.#type & ENOTDIR)
            return;
        /* c8 ignore stop */
        let t = this.#type;
        // this could happen if we stat a dir, then delete it,
        // then try to read it or one of its children.
        if ((t & IFMT) === IFDIR)
            t &= IFMT_UNKNOWN;
        this.#type = t | ENOTDIR;
        this.#markChildrenENOENT();
    }
    #readdirFail(code = '') {
        // markENOTDIR and markENOENT also set provisional=0
        if (code === 'ENOTDIR' || code === 'EPERM') {
            this.#markENOTDIR();
        }
        else if (code === 'ENOENT') {
            this.#markENOENT();
        }
        else {
            this.children().provisional = 0;
        }
    }
    #lstatFail(code = '') {
        // Windows just raises ENOENT in this case, disable for win CI
        /* c8 ignore start */
        if (code === 'ENOTDIR') {
            // already know it has a parent by this point
            const p = this.parent;
            p.#markENOTDIR();
        }
        else if (code === 'ENOENT') {
            /* c8 ignore stop */
            this.#markENOENT();
        }
    }
    #readlinkFail(code = '') {
        let ter = this.#type;
        ter |= ENOREADLINK;
        if (code === 'ENOENT')
            ter |= ENOENT;
        // windows gets a weird error when you try to readlink a file
        if (code === 'EINVAL' || code === 'UNKNOWN') {
            // exists, but not a symlink, we don't know WHAT it is, so remove
            // all IFMT bits.
            ter &= IFMT_UNKNOWN;
        }
        this.#type = ter;
        // windows just gets ENOENT in this case.  We do cover the case,
        // just disabled because it's impossible on Windows CI
        /* c8 ignore start */
        if (code === 'ENOTDIR' && this.parent) {
            this.parent.#markENOTDIR();
        }
        /* c8 ignore stop */
    }
    #readdirAddChild(e, c) {
        return (this.#readdirMaybePromoteChild(e, c) ||
            this.#readdirAddNewChild(e, c));
    }
    #readdirAddNewChild(e, c) {
        // alloc new entry at head, so it's never provisional
        const type = entToType(e);
        const child = this.newChild(e.name, type, { parent: this });
        const ifmt = child.#type & IFMT;
        if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) {
            child.#type |= ENOTDIR;
        }
        c.unshift(child);
        c.provisional++;
        return child;
    }
    #readdirMaybePromoteChild(e, c) {
        for (let p = c.provisional; p < c.length; p++) {
            const pchild = c[p];
            const name = this.nocase ? normalizeNocase(e.name) : normalize(e.name);
            if (name !== pchild.#matchName) {
                continue;
            }
            return this.#readdirPromoteChild(e, pchild, p, c);
        }
    }
    #readdirPromoteChild(e, p, index, c) {
        const v = p.name;
        // retain any other flags, but set ifmt from dirent
        p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e);
        // case sensitivity fixing when we learn the true name.
        if (v !== e.name)
            p.name = e.name;
        // just advance provisional index (potentially off the list),
        // otherwise we have to splice/pop it out and re-insert at head
        if (index !== c.provisional) {
            if (index === c.length - 1)
                c.pop();
            else
                c.splice(index, 1);
            c.unshift(p);
        }
        c.provisional++;
        return p;
    }
    /**
     * Call lstat() on this Path, and update all known information that can be
     * determined.
     *
     * Note that unlike `fs.lstat()`, the returned value does not contain some
     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
     * information is required, you will need to call `fs.lstat` yourself.
     *
     * If the Path refers to a nonexistent file, or if the lstat call fails for
     * any reason, `undefined` is returned.  Otherwise the updated Path object is
     * returned.
     *
     * Results are cached, and thus may be out of date if the filesystem is
     * mutated.
     */
    async lstat() {
        if ((this.#type & ENOENT) === 0) {
            try {
                this.#applyStat(await this.#fs.promises.lstat(this.fullpath()));
                return this;
            }
            catch (er) {
                this.#lstatFail(er.code);
            }
        }
    }
    /**
     * synchronous {@link PathBase.lstat}
     */
    lstatSync() {
        if ((this.#type & ENOENT) === 0) {
            try {
                this.#applyStat(this.#fs.lstatSync(this.fullpath()));
                return this;
            }
            catch (er) {
                this.#lstatFail(er.code);
            }
        }
    }
    #applyStat(st) {
        const { atime, atimeMs, birthtime, birthtimeMs, blksize, blocks, ctime, ctimeMs, dev, gid, ino, mode, mtime, mtimeMs, nlink, rdev, size, uid, } = st;
        this.#atime = atime;
        this.#atimeMs = atimeMs;
        this.#birthtime = birthtime;
        this.#birthtimeMs = birthtimeMs;
        this.#blksize = blksize;
        this.#blocks = blocks;
        this.#ctime = ctime;
        this.#ctimeMs = ctimeMs;
        this.#dev = dev;
        this.#gid = gid;
        this.#ino = ino;
        this.#mode = mode;
        this.#mtime = mtime;
        this.#mtimeMs = mtimeMs;
        this.#nlink = nlink;
        this.#rdev = rdev;
        this.#size = size;
        this.#uid = uid;
        const ifmt = entToType(st);
        // retain any other flags, but set the ifmt
        this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED;
        if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) {
            this.#type |= ENOTDIR;
        }
    }
    #onReaddirCB = [];
    #readdirCBInFlight = false;
    #callOnReaddirCB(children) {
        this.#readdirCBInFlight = false;
        const cbs = this.#onReaddirCB.slice();
        this.#onReaddirCB.length = 0;
        cbs.forEach(cb => cb(null, children));
    }
    /**
     * Standard node-style callback interface to get list of directory entries.
     *
     * If the Path cannot or does not contain any children, then an empty array
     * is returned.
     *
     * Results are cached, and thus may be out of date if the filesystem is
     * mutated.
     *
     * @param cb The callback called with (er, entries).  Note that the `er`
     * param is somewhat extraneous, as all readdir() errors are handled and
     * simply result in an empty set of entries being returned.
     * @param allowZalgo Boolean indicating that immediately known results should
     * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release
     * zalgo at your peril, the dark pony lord is devious and unforgiving.
     */
    readdirCB(cb, allowZalgo = false) {
        if (!this.canReaddir()) {
            if (allowZalgo)
                cb(null, []);
            else
                queueMicrotask(() => cb(null, []));
            return;
        }
        const children = this.children();
        if (this.calledReaddir()) {
            const c = children.slice(0, children.provisional);
            if (allowZalgo)
                cb(null, c);
            else
                queueMicrotask(() => cb(null, c));
            return;
        }
        // don't have to worry about zalgo at this point.
        this.#onReaddirCB.push(cb);
        if (this.#readdirCBInFlight) {
            return;
        }
        this.#readdirCBInFlight = true;
        // else read the directory, fill up children
        // de-provisionalize any provisional children.
        const fullpath = this.fullpath();
        this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => {
            if (er) {
                this.#readdirFail(er.code);
                children.provisional = 0;
            }
            else {
                // if we didn't get an error, we always get entries.
                //@ts-ignore
                for (const e of entries) {
                    this.#readdirAddChild(e, children);
                }
                this.#readdirSuccess(children);
            }
            this.#callOnReaddirCB(children.slice(0, children.provisional));
            return;
        });
    }
    #asyncReaddirInFlight;
    /**
     * Return an array of known child entries.
     *
     * If the Path cannot or does not contain any children, then an empty array
     * is returned.
     *
     * Results are cached, and thus may be out of date if the filesystem is
     * mutated.
     */
    async readdir() {
        if (!this.canReaddir()) {
            return [];
        }
        const children = this.children();
        if (this.calledReaddir()) {
            return children.slice(0, children.provisional);
        }
        // else read the directory, fill up children
        // de-provisionalize any provisional children.
        const fullpath = this.fullpath();
        if (this.#asyncReaddirInFlight) {
            await this.#asyncReaddirInFlight;
        }
        else {
            /* c8 ignore start */
            let resolve = () => { };
            /* c8 ignore stop */
            this.#asyncReaddirInFlight = new Promise(res => (resolve = res));
            try {
                for (const e of await this.#fs.promises.readdir(fullpath, {
                    withFileTypes: true,
                })) {
                    this.#readdirAddChild(e, children);
                }
                this.#readdirSuccess(children);
            }
            catch (er) {
                this.#readdirFail(er.code);
                children.provisional = 0;
            }
            this.#asyncReaddirInFlight = undefined;
            resolve();
        }
        return children.slice(0, children.provisional);
    }
    /**
     * synchronous {@link PathBase.readdir}
     */
    readdirSync() {
        if (!this.canReaddir()) {
            return [];
        }
        const children = this.children();
        if (this.calledReaddir()) {
            return children.slice(0, children.provisional);
        }
        // else read the directory, fill up children
        // de-provisionalize any provisional children.
        const fullpath = this.fullpath();
        try {
            for (const e of this.#fs.readdirSync(fullpath, {
                withFileTypes: true,
            })) {
                this.#readdirAddChild(e, children);
            }
            this.#readdirSuccess(children);
        }
        catch (er) {
            this.#readdirFail(er.code);
            children.provisional = 0;
        }
        return children.slice(0, children.provisional);
    }
    canReaddir() {
        if (this.#type & ENOCHILD)
            return false;
        const ifmt = IFMT & this.#type;
        // we always set ENOTDIR when setting IFMT, so should be impossible
        /* c8 ignore start */
        if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) {
            return false;
        }
        /* c8 ignore stop */
        return true;
    }
    shouldWalk(dirs, walkFilter) {
        return ((this.#type & IFDIR) === IFDIR &&
            !(this.#type & ENOCHILD) &&
            !dirs.has(this) &&
            (!walkFilter || walkFilter(this)));
    }
    /**
     * Return the Path object corresponding to path as resolved
     * by realpath(3).
     *
     * If the realpath call fails for any reason, `undefined` is returned.
     *
     * Result is cached, and thus may be outdated if the filesystem is mutated.
     * On success, returns a Path object.
     */
    async realpath() {
        if (this.#realpath)
            return this.#realpath;
        if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)
            return undefined;
        try {
            const rp = await this.#fs.promises.realpath(this.fullpath());
            return (this.#realpath = this.resolve(rp));
        }
        catch (_) {
            this.#markENOREALPATH();
        }
    }
    /**
     * Synchronous {@link realpath}
     */
    realpathSync() {
        if (this.#realpath)
            return this.#realpath;
        if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)
            return undefined;
        try {
            const rp = this.#fs.realpathSync(this.fullpath());
            return (this.#realpath = this.resolve(rp));
        }
        catch (_) {
            this.#markENOREALPATH();
        }
    }
    /**
     * Internal method to mark this Path object as the scurry cwd,
     * called by {@link PathScurry#chdir}
     *
     * @internal
     */
    [setAsCwd](oldCwd) {
        if (oldCwd === this)
            return;
        oldCwd.isCWD = false;
        this.isCWD = true;
        const changed = new Set([]);
        let rp = [];
        let p = this;
        while (p && p.parent) {
            changed.add(p);
            p.#relative = rp.join(this.sep);
            p.#relativePosix = rp.join('/');
            p = p.parent;
            rp.push('..');
        }
        // now un-memoize parents of old cwd
        p = oldCwd;
        while (p && p.parent && !changed.has(p)) {
            p.#relative = undefined;
            p.#relativePosix = undefined;
            p = p.parent;
        }
    }
}
/**
 * Path class used on win32 systems
 *
 * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'`
 * as the path separator for parsing paths.
 */
class PathWin32 extends PathBase {
    /**
     * Separator for generating path strings.
     */
    sep = '\\';
    /**
     * Separator for parsing path strings.
     */
    splitSep = eitherSep;
    /**
     * Do not create new Path objects directly.  They should always be accessed
     * via the PathScurry class or other methods on the Path class.
     *
     * @internal
     */
    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
        super(name, type, root, roots, nocase, children, opts);
    }
    /**
     * @internal
     */
    newChild(name, type = UNKNOWN, opts = {}) {
        return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
    }
    /**
     * @internal
     */
    getRootString(path) {
        return external_node_path_namespaceObject.win32.parse(path).root;
    }
    /**
     * @internal
     */
    getRoot(rootPath) {
        rootPath = uncToDrive(rootPath.toUpperCase());
        if (rootPath === this.root.name) {
            return this.root;
        }
        // ok, not that one, check if it matches another we know about
        for (const [compare, root] of Object.entries(this.roots)) {
            if (this.sameRoot(rootPath, compare)) {
                return (this.roots[rootPath] = root);
            }
        }
        // otherwise, have to create a new one.
        return (this.roots[rootPath] = new PathScurryWin32(rootPath, this).root);
    }
    /**
     * @internal
     */
    sameRoot(rootPath, compare = this.root.name) {
        // windows can (rarely) have case-sensitive filesystem, but
        // UNC and drive letters are always case-insensitive, and canonically
        // represented uppercase.
        rootPath = rootPath
            .toUpperCase()
            .replace(/\//g, '\\')
            .replace(uncDriveRegexp, '$1\\');
        return rootPath === compare;
    }
}
/**
 * Path class used on all posix systems.
 *
 * Uses `'/'` as the path separator.
 */
class PathPosix extends PathBase {
    /**
     * separator for parsing path strings
     */
    splitSep = '/';
    /**
     * separator for generating path strings
     */
    sep = '/';
    /**
     * Do not create new Path objects directly.  They should always be accessed
     * via the PathScurry class or other methods on the Path class.
     *
     * @internal
     */
    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
        super(name, type, root, roots, nocase, children, opts);
    }
    /**
     * @internal
     */
    getRootString(path) {
        return path.startsWith('/') ? '/' : '';
    }
    /**
     * @internal
     */
    getRoot(_rootPath) {
        return this.root;
    }
    /**
     * @internal
     */
    newChild(name, type = UNKNOWN, opts = {}) {
        return new PathPosix(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
    }
}
/**
 * The base class for all PathScurry classes, providing the interface for path
 * resolution and filesystem operations.
 *
 * Typically, you should *not* instantiate this class directly, but rather one
 * of the platform-specific classes, or the exported {@link PathScurry} which
 * defaults to the current platform.
 */
class PathScurryBase {
    /**
     * The root Path entry for the current working directory of this Scurry
     */
    root;
    /**
     * The string path for the root of this Scurry's current working directory
     */
    rootPath;
    /**
     * A collection of all roots encountered, referenced by rootPath
     */
    roots;
    /**
     * The Path entry corresponding to this PathScurry's current working directory.
     */
    cwd;
    #resolveCache;
    #resolvePosixCache;
    #children;
    /**
     * Perform path comparisons case-insensitively.
     *
     * Defaults true on Darwin and Windows systems, false elsewhere.
     */
    nocase;
    #fs;
    /**
     * This class should not be instantiated directly.
     *
     * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry
     *
     * @internal
     */
    constructor(cwd = process.cwd(), pathImpl, sep, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS, } = {}) {
        this.#fs = fsFromOption(fs);
        if (cwd instanceof URL || cwd.startsWith('file://')) {
            cwd = (0,external_node_url_namespaceObject.fileURLToPath)(cwd);
        }
        // resolve and split root, and then add to the store.
        // this is the only time we call path.resolve()
        const cwdPath = pathImpl.resolve(cwd);
        this.roots = Object.create(null);
        this.rootPath = this.parseRootPath(cwdPath);
        this.#resolveCache = new ResolveCache();
        this.#resolvePosixCache = new ResolveCache();
        this.#children = new ChildrenCache(childrenCacheSize);
        const split = cwdPath.substring(this.rootPath.length).split(sep);
        // resolve('/') leaves '', splits to [''], we don't want that.
        if (split.length === 1 && !split[0]) {
            split.pop();
        }
        /* c8 ignore start */
        if (nocase === undefined) {
            throw new TypeError('must provide nocase setting to PathScurryBase ctor');
        }
        /* c8 ignore stop */
        this.nocase = nocase;
        this.root = this.newRoot(this.#fs);
        this.roots[this.rootPath] = this.root;
        let prev = this.root;
        let len = split.length - 1;
        const joinSep = pathImpl.sep;
        let abs = this.rootPath;
        let sawFirst = false;
        for (const part of split) {
            const l = len--;
            prev = prev.child(part, {
                relative: new Array(l).fill('..').join(joinSep),
                relativePosix: new Array(l).fill('..').join('/'),
                fullpath: (abs += (sawFirst ? '' : joinSep) + part),
            });
            sawFirst = true;
        }
        this.cwd = prev;
    }
    /**
     * Get the depth of a provided path, string, or the cwd
     */
    depth(path = this.cwd) {
        if (typeof path === 'string') {
            path = this.cwd.resolve(path);
        }
        return path.depth();
    }
    /**
     * Return the cache of child entries.  Exposed so subclasses can create
     * child Path objects in a platform-specific way.
     *
     * @internal
     */
    childrenCache() {
        return this.#children;
    }
    /**
     * Resolve one or more path strings to a resolved string
     *
     * Same interface as require('path').resolve.
     *
     * Much faster than path.resolve() when called multiple times for the same
     * path, because the resolved Path objects are cached.  Much slower
     * otherwise.
     */
    resolve(...paths) {
        // first figure out the minimum number of paths we have to test
        // we always start at cwd, but any absolutes will bump the start
        let r = '';
        for (let i = paths.length - 1; i >= 0; i--) {
            const p = paths[i];
            if (!p || p === '.')
                continue;
            r = r ? `${p}/${r}` : p;
            if (this.isAbsolute(p)) {
                break;
            }
        }
        const cached = this.#resolveCache.get(r);
        if (cached !== undefined) {
            return cached;
        }
        const result = this.cwd.resolve(r).fullpath();
        this.#resolveCache.set(r, result);
        return result;
    }
    /**
     * Resolve one or more path strings to a resolved string, returning
     * the posix path.  Identical to .resolve() on posix systems, but on
     * windows will return a forward-slash separated UNC path.
     *
     * Same interface as require('path').resolve.
     *
     * Much faster than path.resolve() when called multiple times for the same
     * path, because the resolved Path objects are cached.  Much slower
     * otherwise.
     */
    resolvePosix(...paths) {
        // first figure out the minimum number of paths we have to test
        // we always start at cwd, but any absolutes will bump the start
        let r = '';
        for (let i = paths.length - 1; i >= 0; i--) {
            const p = paths[i];
            if (!p || p === '.')
                continue;
            r = r ? `${p}/${r}` : p;
            if (this.isAbsolute(p)) {
                break;
            }
        }
        const cached = this.#resolvePosixCache.get(r);
        if (cached !== undefined) {
            return cached;
        }
        const result = this.cwd.resolve(r).fullpathPosix();
        this.#resolvePosixCache.set(r, result);
        return result;
    }
    /**
     * find the relative path from the cwd to the supplied path string or entry
     */
    relative(entry = this.cwd) {
        if (typeof entry === 'string') {
            entry = this.cwd.resolve(entry);
        }
        return entry.relative();
    }
    /**
     * find the relative path from the cwd to the supplied path string or
     * entry, using / as the path delimiter, even on Windows.
     */
    relativePosix(entry = this.cwd) {
        if (typeof entry === 'string') {
            entry = this.cwd.resolve(entry);
        }
        return entry.relativePosix();
    }
    /**
     * Return the basename for the provided string or Path object
     */
    basename(entry = this.cwd) {
        if (typeof entry === 'string') {
            entry = this.cwd.resolve(entry);
        }
        return entry.name;
    }
    /**
     * Return the dirname for the provided string or Path object
     */
    dirname(entry = this.cwd) {
        if (typeof entry === 'string') {
            entry = this.cwd.resolve(entry);
        }
        return (entry.parent || entry).fullpath();
    }
    async readdir(entry = this.cwd, opts = {
        withFileTypes: true,
    }) {
        if (typeof entry === 'string') {
            entry = this.cwd.resolve(entry);
        }
        else if (!(entry instanceof PathBase)) {
            opts = entry;
            entry = this.cwd;
        }
        const { withFileTypes } = opts;
        if (!entry.canReaddir()) {
            return [];
        }
        else {
            const p = await entry.readdir();
            return withFileTypes ? p : p.map(e => e.name);
        }
    }
    readdirSync(entry = this.cwd, opts = {
        withFileTypes: true,
    }) {
        if (typeof entry === 'string') {
            entry = this.cwd.resolve(entry);
        }
        else if (!(entry instanceof PathBase)) {
            opts = entry;
            entry = this.cwd;
        }
        const { withFileTypes = true } = opts;
        if (!entry.canReaddir()) {
            return [];
        }
        else if (withFileTypes) {
            return entry.readdirSync();
        }
        else {
            return entry.readdirSync().map(e => e.name);
        }
    }
    /**
     * Call lstat() on the string or Path object, and update all known
     * information that can be determined.
     *
     * Note that unlike `fs.lstat()`, the returned value does not contain some
     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
     * information is required, you will need to call `fs.lstat` yourself.
     *
     * If the Path refers to a nonexistent file, or if the lstat call fails for
     * any reason, `undefined` is returned.  Otherwise the updated Path object is
     * returned.
     *
     * Results are cached, and thus may be out of date if the filesystem is
     * mutated.
     */
    async lstat(entry = this.cwd) {
        if (typeof entry === 'string') {
            entry = this.cwd.resolve(entry);
        }
        return entry.lstat();
    }
    /**
     * synchronous {@link PathScurryBase.lstat}
     */
    lstatSync(entry = this.cwd) {
        if (typeof entry === 'string') {
            entry = this.cwd.resolve(entry);
        }
        return entry.lstatSync();
    }
    async readlink(entry = this.cwd, { withFileTypes } = {
        withFileTypes: false,
    }) {
        if (typeof entry === 'string') {
            entry = this.cwd.resolve(entry);
        }
        else if (!(entry instanceof PathBase)) {
            withFileTypes = entry.withFileTypes;
            entry = this.cwd;
        }
        const e = await entry.readlink();
        return withFileTypes ? e : e?.fullpath();
    }
    readlinkSync(entry = this.cwd, { withFileTypes } = {
        withFileTypes: false,
    }) {
        if (typeof entry === 'string') {
            entry = this.cwd.resolve(entry);
        }
        else if (!(entry instanceof PathBase)) {
            withFileTypes = entry.withFileTypes;
            entry = this.cwd;
        }
        const e = entry.readlinkSync();
        return withFileTypes ? e : e?.fullpath();
    }
    async realpath(entry = this.cwd, { withFileTypes } = {
        withFileTypes: false,
    }) {
        if (typeof entry === 'string') {
            entry = this.cwd.resolve(entry);
        }
        else if (!(entry instanceof PathBase)) {
            withFileTypes = entry.withFileTypes;
            entry = this.cwd;
        }
        const e = await entry.realpath();
        return withFileTypes ? e : e?.fullpath();
    }
    realpathSync(entry = this.cwd, { withFileTypes } = {
        withFileTypes: false,
    }) {
        if (typeof entry === 'string') {
            entry = this.cwd.resolve(entry);
        }
        else if (!(entry instanceof PathBase)) {
            withFileTypes = entry.withFileTypes;
            entry = this.cwd;
        }
        const e = entry.realpathSync();
        return withFileTypes ? e : e?.fullpath();
    }
    async walk(entry = this.cwd, opts = {}) {
        if (typeof entry === 'string') {
            entry = this.cwd.resolve(entry);
        }
        else if (!(entry instanceof PathBase)) {
            opts = entry;
            entry = this.cwd;
        }
        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
        const results = [];
        if (!filter || filter(entry)) {
            results.push(withFileTypes ? entry : entry.fullpath());
        }
        const dirs = new Set();
        const walk = (dir, cb) => {
            dirs.add(dir);
            dir.readdirCB((er, entries) => {
                /* c8 ignore start */
                if (er) {
                    return cb(er);
                }
                /* c8 ignore stop */
                let len = entries.length;
                if (!len)
                    return cb();
                const next = () => {
                    if (--len === 0) {
                        cb();
                    }
                };
                for (const e of entries) {
                    if (!filter || filter(e)) {
                        results.push(withFileTypes ? e : e.fullpath());
                    }
                    if (follow && e.isSymbolicLink()) {
                        e.realpath()
                            .then(r => (r?.isUnknown() ? r.lstat() : r))
                            .then(r => r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next());
                    }
                    else {
                        if (e.shouldWalk(dirs, walkFilter)) {
                            walk(e, next);
                        }
                        else {
                            next();
                        }
                    }
                }
            }, true); // zalgooooooo
        };
        const start = entry;
        return new Promise((res, rej) => {
            walk(start, er => {
                /* c8 ignore start */
                if (er)
                    return rej(er);
                /* c8 ignore stop */
                res(results);
            });
        });
    }
    walkSync(entry = this.cwd, opts = {}) {
        if (typeof entry === 'string') {
            entry = this.cwd.resolve(entry);
        }
        else if (!(entry instanceof PathBase)) {
            opts = entry;
            entry = this.cwd;
        }
        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
        const results = [];
        if (!filter || filter(entry)) {
            results.push(withFileTypes ? entry : entry.fullpath());
        }
        const dirs = new Set([entry]);
        for (const dir of dirs) {
            const entries = dir.readdirSync();
            for (const e of entries) {
                if (!filter || filter(e)) {
                    results.push(withFileTypes ? e : e.fullpath());
                }
                let r = e;
                if (e.isSymbolicLink()) {
                    if (!(follow && (r = e.realpathSync())))
                        continue;
                    if (r.isUnknown())
                        r.lstatSync();
                }
                if (r.shouldWalk(dirs, walkFilter)) {
                    dirs.add(r);
                }
            }
        }
        return results;
    }
    /**
     * Support for `for await`
     *
     * Alias for {@link PathScurryBase.iterate}
     *
     * Note: As of Node 19, this is very slow, compared to other methods of
     * walking.  Consider using {@link PathScurryBase.stream} if memory overhead
     * and backpressure are concerns, or {@link PathScurryBase.walk} if not.
     */
    [Symbol.asyncIterator]() {
        return this.iterate();
    }
    iterate(entry = this.cwd, options = {}) {
        // iterating async over the stream is significantly more performant,
        // especially in the warm-cache scenario, because it buffers up directory
        // entries in the background instead of waiting for a yield for each one.
        if (typeof entry === 'string') {
            entry = this.cwd.resolve(entry);
        }
        else if (!(entry instanceof PathBase)) {
            options = entry;
            entry = this.cwd;
        }
        return this.stream(entry, options)[Symbol.asyncIterator]();
    }
    /**
     * Iterating over a PathScurry performs a synchronous walk.
     *
     * Alias for {@link PathScurryBase.iterateSync}
     */
    [Symbol.iterator]() {
        return this.iterateSync();
    }
    *iterateSync(entry = this.cwd, opts = {}) {
        if (typeof entry === 'string') {
            entry = this.cwd.resolve(entry);
        }
        else if (!(entry instanceof PathBase)) {
            opts = entry;
            entry = this.cwd;
        }
        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
        if (!filter || filter(entry)) {
            yield withFileTypes ? entry : entry.fullpath();
        }
        const dirs = new Set([entry]);
        for (const dir of dirs) {
            const entries = dir.readdirSync();
            for (const e of entries) {
                if (!filter || filter(e)) {
                    yield withFileTypes ? e : e.fullpath();
                }
                let r = e;
                if (e.isSymbolicLink()) {
                    if (!(follow && (r = e.realpathSync())))
                        continue;
                    if (r.isUnknown())
                        r.lstatSync();
                }
                if (r.shouldWalk(dirs, walkFilter)) {
                    dirs.add(r);
                }
            }
        }
    }
    stream(entry = this.cwd, opts = {}) {
        if (typeof entry === 'string') {
            entry = this.cwd.resolve(entry);
        }
        else if (!(entry instanceof PathBase)) {
            opts = entry;
            entry = this.cwd;
        }
        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
        const results = new Minipass({ objectMode: true });
        if (!filter || filter(entry)) {
            results.write(withFileTypes ? entry : entry.fullpath());
        }
        const dirs = new Set();
        const queue = [entry];
        let processing = 0;
        const process = () => {
            let paused = false;
            while (!paused) {
                const dir = queue.shift();
                if (!dir) {
                    if (processing === 0)
                        results.end();
                    return;
                }
                processing++;
                dirs.add(dir);
                const onReaddir = (er, entries, didRealpaths = false) => {
                    /* c8 ignore start */
                    if (er)
                        return results.emit('error', er);
                    /* c8 ignore stop */
                    if (follow && !didRealpaths) {
                        const promises = [];
                        for (const e of entries) {
                            if (e.isSymbolicLink()) {
                                promises.push(e
                                    .realpath()
                                    .then((r) => r?.isUnknown() ? r.lstat() : r));
                            }
                        }
                        if (promises.length) {
                            Promise.all(promises).then(() => onReaddir(null, entries, true));
                            return;
                        }
                    }
                    for (const e of entries) {
                        if (e && (!filter || filter(e))) {
                            if (!results.write(withFileTypes ? e : e.fullpath())) {
                                paused = true;
                            }
                        }
                    }
                    processing--;
                    for (const e of entries) {
                        const r = e.realpathCached() || e;
                        if (r.shouldWalk(dirs, walkFilter)) {
                            queue.push(r);
                        }
                    }
                    if (paused && !results.flowing) {
                        results.once('drain', process);
                    }
                    else if (!sync) {
                        process();
                    }
                };
                // zalgo containment
                let sync = true;
                dir.readdirCB(onReaddir, true);
                sync = false;
            }
        };
        process();
        return results;
    }
    streamSync(entry = this.cwd, opts = {}) {
        if (typeof entry === 'string') {
            entry = this.cwd.resolve(entry);
        }
        else if (!(entry instanceof PathBase)) {
            opts = entry;
            entry = this.cwd;
        }
        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
        const results = new Minipass({ objectMode: true });
        const dirs = new Set();
        if (!filter || filter(entry)) {
            results.write(withFileTypes ? entry : entry.fullpath());
        }
        const queue = [entry];
        let processing = 0;
        const process = () => {
            let paused = false;
            while (!paused) {
                const dir = queue.shift();
                if (!dir) {
                    if (processing === 0)
                        results.end();
                    return;
                }
                processing++;
                dirs.add(dir);
                const entries = dir.readdirSync();
                for (const e of entries) {
                    if (!filter || filter(e)) {
                        if (!results.write(withFileTypes ? e : e.fullpath())) {
                            paused = true;
                        }
                    }
                }
                processing--;
                for (const e of entries) {
                    let r = e;
                    if (e.isSymbolicLink()) {
                        if (!(follow && (r = e.realpathSync())))
                            continue;
                        if (r.isUnknown())
                            r.lstatSync();
                    }
                    if (r.shouldWalk(dirs, walkFilter)) {
                        queue.push(r);
                    }
                }
            }
            if (paused && !results.flowing)
                results.once('drain', process);
        };
        process();
        return results;
    }
    chdir(path = this.cwd) {
        const oldCwd = this.cwd;
        this.cwd = typeof path === 'string' ? this.cwd.resolve(path) : path;
        this.cwd[setAsCwd](oldCwd);
    }
}
/**
 * Windows implementation of {@link PathScurryBase}
 *
 * Defaults to case insensitve, uses `'\\'` to generate path strings.  Uses
 * {@link PathWin32} for Path objects.
 */
class PathScurryWin32 extends PathScurryBase {
    /**
     * separator for generating path strings
     */
    sep = '\\';
    constructor(cwd = process.cwd(), opts = {}) {
        const { nocase = true } = opts;
        super(cwd, external_node_path_namespaceObject.win32, '\\', { ...opts, nocase });
        this.nocase = nocase;
        for (let p = this.cwd; p; p = p.parent) {
            p.nocase = this.nocase;
        }
    }
    /**
     * @internal
     */
    parseRootPath(dir) {
        // if the path starts with a single separator, it's not a UNC, and we'll
        // just get separator as the root, and driveFromUNC will return \
        // In that case, mount \ on the root from the cwd.
        return external_node_path_namespaceObject.win32.parse(dir).root.toUpperCase();
    }
    /**
     * @internal
     */
    newRoot(fs) {
        return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
    }
    /**
     * Return true if the provided path string is an absolute path
     */
    isAbsolute(p) {
        return (p.startsWith('/') || p.startsWith('\\') || /^[a-z]:(\/|\\)/i.test(p));
    }
}
/**
 * {@link PathScurryBase} implementation for all posix systems other than Darwin.
 *
 * Defaults to case-sensitive matching, uses `'/'` to generate path strings.
 *
 * Uses {@link PathPosix} for Path objects.
 */
class PathScurryPosix extends PathScurryBase {
    /**
     * separator for generating path strings
     */
    sep = '/';
    constructor(cwd = process.cwd(), opts = {}) {
        const { nocase = false } = opts;
        super(cwd, external_node_path_namespaceObject.posix, '/', { ...opts, nocase });
        this.nocase = nocase;
    }
    /**
     * @internal
     */
    parseRootPath(_dir) {
        return '/';
    }
    /**
     * @internal
     */
    newRoot(fs) {
        return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
    }
    /**
     * Return true if the provided path string is an absolute path
     */
    isAbsolute(p) {
        return p.startsWith('/');
    }
}
/**
 * {@link PathScurryBase} implementation for Darwin (macOS) systems.
 *
 * Defaults to case-insensitive matching, uses `'/'` for generating path
 * strings.
 *
 * Uses {@link PathPosix} for Path objects.
 */
class PathScurryDarwin extends PathScurryPosix {
    constructor(cwd = process.cwd(), opts = {}) {
        const { nocase = true } = opts;
        super(cwd, { ...opts, nocase });
    }
}
/**
 * Default {@link PathBase} implementation for the current platform.
 *
 * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.
 */
const Path = process.platform === 'win32' ? PathWin32 : PathPosix;
/**
 * Default {@link PathScurryBase} implementation for the current platform.
 *
 * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on
 * Darwin (macOS) systems, {@link PathScurryPosix} on all others.
 */
const PathScurry = process.platform === 'win32' ? PathScurryWin32
    : process.platform === 'darwin' ? PathScurryDarwin
        : PathScurryPosix;
//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ./node_modules/glob/dist/esm/pattern.js
// this is just a very light wrapper around 2 arrays with an offset index

const isPatternList = (pl) => pl.length >= 1;
const isGlobList = (gl) => gl.length >= 1;
/**
 * An immutable-ish view on an array of glob parts and their parsed
 * results
 */
class Pattern {
    #patternList;
    #globList;
    #index;
    length;
    #platform;
    #rest;
    #globString;
    #isDrive;
    #isUNC;
    #isAbsolute;
    #followGlobstar = true;
    constructor(patternList, globList, index, platform) {
        if (!isPatternList(patternList)) {
            throw new TypeError('empty pattern list');
        }
        if (!isGlobList(globList)) {
            throw new TypeError('empty glob list');
        }
        if (globList.length !== patternList.length) {
            throw new TypeError('mismatched pattern list and glob list lengths');
        }
        this.length = patternList.length;
        if (index < 0 || index >= this.length) {
            throw new TypeError('index out of range');
        }
        this.#patternList = patternList;
        this.#globList = globList;
        this.#index = index;
        this.#platform = platform;
        // normalize root entries of absolute patterns on initial creation.
        if (this.#index === 0) {
            // c: => ['c:/']
            // C:/ => ['C:/']
            // C:/x => ['C:/', 'x']
            // //host/share => ['//host/share/']
            // //host/share/ => ['//host/share/']
            // //host/share/x => ['//host/share/', 'x']
            // /etc => ['/', 'etc']
            // / => ['/']
            if (this.isUNC()) {
                // '' / '' / 'host' / 'share'
                const [p0, p1, p2, p3, ...prest] = this.#patternList;
                const [g0, g1, g2, g3, ...grest] = this.#globList;
                if (prest[0] === '') {
                    // ends in /
                    prest.shift();
                    grest.shift();
                }
                const p = [p0, p1, p2, p3, ''].join('/');
                const g = [g0, g1, g2, g3, ''].join('/');
                this.#patternList = [p, ...prest];
                this.#globList = [g, ...grest];
                this.length = this.#patternList.length;
            }
            else if (this.isDrive() || this.isAbsolute()) {
                const [p1, ...prest] = this.#patternList;
                const [g1, ...grest] = this.#globList;
                if (prest[0] === '') {
                    // ends in /
                    prest.shift();
                    grest.shift();
                }
                const p = p1 + '/';
                const g = g1 + '/';
                this.#patternList = [p, ...prest];
                this.#globList = [g, ...grest];
                this.length = this.#patternList.length;
            }
        }
    }
    /**
     * The first entry in the parsed list of patterns
     */
    pattern() {
        return this.#patternList[this.#index];
    }
    /**
     * true of if pattern() returns a string
     */
    isString() {
        return typeof this.#patternList[this.#index] === 'string';
    }
    /**
     * true of if pattern() returns GLOBSTAR
     */
    isGlobstar() {
        return this.#patternList[this.#index] === GLOBSTAR;
    }
    /**
     * true if pattern() returns a regexp
     */
    isRegExp() {
        return this.#patternList[this.#index] instanceof RegExp;
    }
    /**
     * The /-joined set of glob parts that make up this pattern
     */
    globString() {
        return (this.#globString =
            this.#globString ||
                (this.#index === 0 ?
                    this.isAbsolute() ?
                        this.#globList[0] + this.#globList.slice(1).join('/')
                        : this.#globList.join('/')
                    : this.#globList.slice(this.#index).join('/')));
    }
    /**
     * true if there are more pattern parts after this one
     */
    hasMore() {
        return this.length > this.#index + 1;
    }
    /**
     * The rest of the pattern after this part, or null if this is the end
     */
    rest() {
        if (this.#rest !== undefined)
            return this.#rest;
        if (!this.hasMore())
            return (this.#rest = null);
        this.#rest = new Pattern(this.#patternList, this.#globList, this.#index + 1, this.#platform);
        this.#rest.#isAbsolute = this.#isAbsolute;
        this.#rest.#isUNC = this.#isUNC;
        this.#rest.#isDrive = this.#isDrive;
        return this.#rest;
    }
    /**
     * true if the pattern represents a //unc/path/ on windows
     */
    isUNC() {
        const pl = this.#patternList;
        return this.#isUNC !== undefined ?
            this.#isUNC
            : (this.#isUNC =
                this.#platform === 'win32' &&
                    this.#index === 0 &&
                    pl[0] === '' &&
                    pl[1] === '' &&
                    typeof pl[2] === 'string' &&
                    !!pl[2] &&
                    typeof pl[3] === 'string' &&
                    !!pl[3]);
    }
    // pattern like C:/...
    // split = ['C:', ...]
    // XXX: would be nice to handle patterns like `c:*` to test the cwd
    // in c: for *, but I don't know of a way to even figure out what that
    // cwd is without actually chdir'ing into it?
    /**
     * True if the pattern starts with a drive letter on Windows
     */
    isDrive() {
        const pl = this.#patternList;
        return this.#isDrive !== undefined ?
            this.#isDrive
            : (this.#isDrive =
                this.#platform === 'win32' &&
                    this.#index === 0 &&
                    this.length > 1 &&
                    typeof pl[0] === 'string' &&
                    /^[a-z]:$/i.test(pl[0]));
    }
    // pattern = '/' or '/...' or '/x/...'
    // split = ['', ''] or ['', ...] or ['', 'x', ...]
    // Drive and UNC both considered absolute on windows
    /**
     * True if the pattern is rooted on an absolute path
     */
    isAbsolute() {
        const pl = this.#patternList;
        return this.#isAbsolute !== undefined ?
            this.#isAbsolute
            : (this.#isAbsolute =
                (pl[0] === '' && pl.length > 1) ||
                    this.isDrive() ||
                    this.isUNC());
    }
    /**
     * consume the root of the pattern, and return it
     */
    root() {
        const p = this.#patternList[0];
        return (typeof p === 'string' && this.isAbsolute() && this.#index === 0) ?
            p
            : '';
    }
    /**
     * Check to see if the current globstar pattern is allowed to follow
     * a symbolic link.
     */
    checkFollowGlobstar() {
        return !(this.#index === 0 ||
            !this.isGlobstar() ||
            !this.#followGlobstar);
    }
    /**
     * Mark that the current globstar pattern is following a symbolic link
     */
    markFollowGlobstar() {
        if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)
            return false;
        this.#followGlobstar = false;
        return true;
    }
}
//# sourceMappingURL=pattern.js.map
;// CONCATENATED MODULE: ./node_modules/glob/dist/esm/ignore.js
// give it a pattern, and it'll be able to tell you if
// a given path should be ignored.
// Ignoring a path ignores its children if the pattern ends in /**
// Ignores are always parsed in dot:true mode


const ignore_defaultPlatform = (typeof process === 'object' &&
    process &&
    typeof process.platform === 'string') ?
    process.platform
    : 'linux';
/**
 * Class used to process ignored patterns
 */
class Ignore {
    relative;
    relativeChildren;
    absolute;
    absoluteChildren;
    platform;
    mmopts;
    constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = ignore_defaultPlatform, }) {
        this.relative = [];
        this.absolute = [];
        this.relativeChildren = [];
        this.absoluteChildren = [];
        this.platform = platform;
        this.mmopts = {
            dot: true,
            nobrace,
            nocase,
            noext,
            noglobstar,
            optimizationLevel: 2,
            platform,
            nocomment: true,
            nonegate: true,
        };
        for (const ign of ignored)
            this.add(ign);
    }
    add(ign) {
        // this is a little weird, but it gives us a clean set of optimized
        // minimatch matchers, without getting tripped up if one of them
        // ends in /** inside a brace section, and it's only inefficient at
        // the start of the walk, not along it.
        // It'd be nice if the Pattern class just had a .test() method, but
        // handling globstars is a bit of a pita, and that code already lives
        // in minimatch anyway.
        // Another way would be if maybe Minimatch could take its set/globParts
        // as an option, and then we could at least just use Pattern to test
        // for absolute-ness.
        // Yet another way, Minimatch could take an array of glob strings, and
        // a cwd option, and do the right thing.
        const mm = new Minimatch(ign, this.mmopts);
        for (let i = 0; i < mm.set.length; i++) {
            const parsed = mm.set[i];
            const globParts = mm.globParts[i];
            /* c8 ignore start */
            if (!parsed || !globParts) {
                throw new Error('invalid pattern object');
            }
            // strip off leading ./ portions
            // https://github.com/isaacs/node-glob/issues/570
            while (parsed[0] === '.' && globParts[0] === '.') {
                parsed.shift();
                globParts.shift();
            }
            /* c8 ignore stop */
            const p = new Pattern(parsed, globParts, 0, this.platform);
            const m = new Minimatch(p.globString(), this.mmopts);
            const children = globParts[globParts.length - 1] === '**';
            const absolute = p.isAbsolute();
            if (absolute)
                this.absolute.push(m);
            else
                this.relative.push(m);
            if (children) {
                if (absolute)
                    this.absoluteChildren.push(m);
                else
                    this.relativeChildren.push(m);
            }
        }
    }
    ignored(p) {
        const fullpath = p.fullpath();
        const fullpaths = `${fullpath}/`;
        const relative = p.relative() || '.';
        const relatives = `${relative}/`;
        for (const m of this.relative) {
            if (m.match(relative) || m.match(relatives))
                return true;
        }
        for (const m of this.absolute) {
            if (m.match(fullpath) || m.match(fullpaths))
                return true;
        }
        return false;
    }
    childrenIgnored(p) {
        const fullpath = p.fullpath() + '/';
        const relative = (p.relative() || '.') + '/';
        for (const m of this.relativeChildren) {
            if (m.match(relative))
                return true;
        }
        for (const m of this.absoluteChildren) {
            if (m.match(fullpath))
                return true;
        }
        return false;
    }
}
//# sourceMappingURL=ignore.js.map
;// CONCATENATED MODULE: ./node_modules/glob/dist/esm/processor.js
// synchronous utility for filtering entries and calculating subwalks

/**
 * A cache of which patterns have been processed for a given Path
 */
class HasWalkedCache {
    store;
    constructor(store = new Map()) {
        this.store = store;
    }
    copy() {
        return new HasWalkedCache(new Map(this.store));
    }
    hasWalked(target, pattern) {
        return this.store.get(target.fullpath())?.has(pattern.globString());
    }
    storeWalked(target, pattern) {
        const fullpath = target.fullpath();
        const cached = this.store.get(fullpath);
        if (cached)
            cached.add(pattern.globString());
        else
            this.store.set(fullpath, new Set([pattern.globString()]));
    }
}
/**
 * A record of which paths have been matched in a given walk step,
 * and whether they only are considered a match if they are a directory,
 * and whether their absolute or relative path should be returned.
 */
class MatchRecord {
    store = new Map();
    add(target, absolute, ifDir) {
        const n = (absolute ? 2 : 0) | (ifDir ? 1 : 0);
        const current = this.store.get(target);
        this.store.set(target, current === undefined ? n : n & current);
    }
    // match, absolute, ifdir
    entries() {
        return [...this.store.entries()].map(([path, n]) => [
            path,
            !!(n & 2),
            !!(n & 1),
        ]);
    }
}
/**
 * A collection of patterns that must be processed in a subsequent step
 * for a given path.
 */
class SubWalks {
    store = new Map();
    add(target, pattern) {
        if (!target.canReaddir()) {
            return;
        }
        const subs = this.store.get(target);
        if (subs) {
            if (!subs.find(p => p.globString() === pattern.globString())) {
                subs.push(pattern);
            }
        }
        else
            this.store.set(target, [pattern]);
    }
    get(target) {
        const subs = this.store.get(target);
        /* c8 ignore start */
        if (!subs) {
            throw new Error('attempting to walk unknown path');
        }
        /* c8 ignore stop */
        return subs;
    }
    entries() {
        return this.keys().map(k => [k, this.store.get(k)]);
    }
    keys() {
        return [...this.store.keys()].filter(t => t.canReaddir());
    }
}
/**
 * The class that processes patterns for a given path.
 *
 * Handles child entry filtering, and determining whether a path's
 * directory contents must be read.
 */
class Processor {
    hasWalkedCache;
    matches = new MatchRecord();
    subwalks = new SubWalks();
    patterns;
    follow;
    dot;
    opts;
    constructor(opts, hasWalkedCache) {
        this.opts = opts;
        this.follow = !!opts.follow;
        this.dot = !!opts.dot;
        this.hasWalkedCache =
            hasWalkedCache ? hasWalkedCache.copy() : new HasWalkedCache();
    }
    processPatterns(target, patterns) {
        this.patterns = patterns;
        const processingSet = patterns.map(p => [target, p]);
        // map of paths to the magic-starting subwalks they need to walk
        // first item in patterns is the filter
        for (let [t, pattern] of processingSet) {
            this.hasWalkedCache.storeWalked(t, pattern);
            const root = pattern.root();
            const absolute = pattern.isAbsolute() && this.opts.absolute !== false;
            // start absolute patterns at root
            if (root) {
                t = t.resolve(root === '/' && this.opts.root !== undefined ?
                    this.opts.root
                    : root);
                const rest = pattern.rest();
                if (!rest) {
                    this.matches.add(t, true, false);
                    continue;
                }
                else {
                    pattern = rest;
                }
            }
            if (t.isENOENT())
                continue;
            let p;
            let rest;
            let changed = false;
            while (typeof (p = pattern.pattern()) === 'string' &&
                (rest = pattern.rest())) {
                const c = t.resolve(p);
                t = c;
                pattern = rest;
                changed = true;
            }
            p = pattern.pattern();
            rest = pattern.rest();
            if (changed) {
                if (this.hasWalkedCache.hasWalked(t, pattern))
                    continue;
                this.hasWalkedCache.storeWalked(t, pattern);
            }
            // now we have either a final string for a known entry,
            // more strings for an unknown entry,
            // or a pattern starting with magic, mounted on t.
            if (typeof p === 'string') {
                // must not be final entry, otherwise we would have
                // concatenated it earlier.
                const ifDir = p === '..' || p === '' || p === '.';
                this.matches.add(t.resolve(p), absolute, ifDir);
                continue;
            }
            else if (p === GLOBSTAR) {
                // if no rest, match and subwalk pattern
                // if rest, process rest and subwalk pattern
                // if it's a symlink, but we didn't get here by way of a
                // globstar match (meaning it's the first time THIS globstar
                // has traversed a symlink), then we follow it. Otherwise, stop.
                if (!t.isSymbolicLink() ||
                    this.follow ||
                    pattern.checkFollowGlobstar()) {
                    this.subwalks.add(t, pattern);
                }
                const rp = rest?.pattern();
                const rrest = rest?.rest();
                if (!rest || ((rp === '' || rp === '.') && !rrest)) {
                    // only HAS to be a dir if it ends in **/ or **/.
                    // but ending in ** will match files as well.
                    this.matches.add(t, absolute, rp === '' || rp === '.');
                }
                else {
                    if (rp === '..') {
                        // this would mean you're matching **/.. at the fs root,
                        // and no thanks, I'm not gonna test that specific case.
                        /* c8 ignore start */
                        const tp = t.parent || t;
                        /* c8 ignore stop */
                        if (!rrest)
                            this.matches.add(tp, absolute, true);
                        else if (!this.hasWalkedCache.hasWalked(tp, rrest)) {
                            this.subwalks.add(tp, rrest);
                        }
                    }
                }
            }
            else if (p instanceof RegExp) {
                this.subwalks.add(t, pattern);
            }
        }
        return this;
    }
    subwalkTargets() {
        return this.subwalks.keys();
    }
    child() {
        return new Processor(this.opts, this.hasWalkedCache);
    }
    // return a new Processor containing the subwalks for each
    // child entry, and a set of matches, and
    // a hasWalkedCache that's a copy of this one
    // then we're going to call
    filterEntries(parent, entries) {
        const patterns = this.subwalks.get(parent);
        // put matches and entry walks into the results processor
        const results = this.child();
        for (const e of entries) {
            for (const pattern of patterns) {
                const absolute = pattern.isAbsolute();
                const p = pattern.pattern();
                const rest = pattern.rest();
                if (p === GLOBSTAR) {
                    results.testGlobstar(e, pattern, rest, absolute);
                }
                else if (p instanceof RegExp) {
                    results.testRegExp(e, p, rest, absolute);
                }
                else {
                    results.testString(e, p, rest, absolute);
                }
            }
        }
        return results;
    }
    testGlobstar(e, pattern, rest, absolute) {
        if (this.dot || !e.name.startsWith('.')) {
            if (!pattern.hasMore()) {
                this.matches.add(e, absolute, false);
            }
            if (e.canReaddir()) {
                // if we're in follow mode or it's not a symlink, just keep
                // testing the same pattern. If there's more after the globstar,
                // then this symlink consumes the globstar. If not, then we can
                // follow at most ONE symlink along the way, so we mark it, which
                // also checks to ensure that it wasn't already marked.
                if (this.follow || !e.isSymbolicLink()) {
                    this.subwalks.add(e, pattern);
                }
                else if (e.isSymbolicLink()) {
                    if (rest && pattern.checkFollowGlobstar()) {
                        this.subwalks.add(e, rest);
                    }
                    else if (pattern.markFollowGlobstar()) {
                        this.subwalks.add(e, pattern);
                    }
                }
            }
        }
        // if the NEXT thing matches this entry, then also add
        // the rest.
        if (rest) {
            const rp = rest.pattern();
            if (typeof rp === 'string' &&
                // dots and empty were handled already
                rp !== '..' &&
                rp !== '' &&
                rp !== '.') {
                this.testString(e, rp, rest.rest(), absolute);
            }
            else if (rp === '..') {
                /* c8 ignore start */
                const ep = e.parent || e;
                /* c8 ignore stop */
                this.subwalks.add(ep, rest);
            }
            else if (rp instanceof RegExp) {
                this.testRegExp(e, rp, rest.rest(), absolute);
            }
        }
    }
    testRegExp(e, p, rest, absolute) {
        if (!p.test(e.name))
            return;
        if (!rest) {
            this.matches.add(e, absolute, false);
        }
        else {
            this.subwalks.add(e, rest);
        }
    }
    testString(e, p, rest, absolute) {
        // should never happen?
        if (!e.isNamed(p))
            return;
        if (!rest) {
            this.matches.add(e, absolute, false);
        }
        else {
            this.subwalks.add(e, rest);
        }
    }
}
//# sourceMappingURL=processor.js.map
;// CONCATENATED MODULE: ./node_modules/glob/dist/esm/walker.js
/**
 * Single-use utility classes to provide functionality to the {@link Glob}
 * methods.
 *
 * @module
 */



const makeIgnore = (ignore, opts) => typeof ignore === 'string' ? new Ignore([ignore], opts)
    : Array.isArray(ignore) ? new Ignore(ignore, opts)
        : ignore;
/**
 * basic walking utilities that all the glob walker types use
 */
class GlobUtil {
    path;
    patterns;
    opts;
    seen = new Set();
    paused = false;
    aborted = false;
    #onResume = [];
    #ignore;
    #sep;
    signal;
    maxDepth;
    includeChildMatches;
    constructor(patterns, path, opts) {
        this.patterns = patterns;
        this.path = path;
        this.opts = opts;
        this.#sep = !opts.posix && opts.platform === 'win32' ? '\\' : '/';
        this.includeChildMatches = opts.includeChildMatches !== false;
        if (opts.ignore || !this.includeChildMatches) {
            this.#ignore = makeIgnore(opts.ignore ?? [], opts);
            if (!this.includeChildMatches &&
                typeof this.#ignore.add !== 'function') {
                const m = 'cannot ignore child matches, ignore lacks add() method.';
                throw new Error(m);
            }
        }
        // ignore, always set with maxDepth, but it's optional on the
        // GlobOptions type
        /* c8 ignore start */
        this.maxDepth = opts.maxDepth || Infinity;
        /* c8 ignore stop */
        if (opts.signal) {
            this.signal = opts.signal;
            this.signal.addEventListener('abort', () => {
                this.#onResume.length = 0;
            });
        }
    }
    #ignored(path) {
        return this.seen.has(path) || !!this.#ignore?.ignored?.(path);
    }
    #childrenIgnored(path) {
        return !!this.#ignore?.childrenIgnored?.(path);
    }
    // backpressure mechanism
    pause() {
        this.paused = true;
    }
    resume() {
        /* c8 ignore start */
        if (this.signal?.aborted)
            return;
        /* c8 ignore stop */
        this.paused = false;
        let fn = undefined;
        while (!this.paused && (fn = this.#onResume.shift())) {
            fn();
        }
    }
    onResume(fn) {
        if (this.signal?.aborted)
            return;
        /* c8 ignore start */
        if (!this.paused) {
            fn();
        }
        else {
            /* c8 ignore stop */
            this.#onResume.push(fn);
        }
    }
    // do the requisite realpath/stat checking, and return the path
    // to add or undefined to filter it out.
    async matchCheck(e, ifDir) {
        if (ifDir && this.opts.nodir)
            return undefined;
        let rpc;
        if (this.opts.realpath) {
            rpc = e.realpathCached() || (await e.realpath());
            if (!rpc)
                return undefined;
            e = rpc;
        }
        const needStat = e.isUnknown() || this.opts.stat;
        const s = needStat ? await e.lstat() : e;
        if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {
            const target = await s.realpath();
            /* c8 ignore start */
            if (target && (target.isUnknown() || this.opts.stat)) {
                await target.lstat();
            }
            /* c8 ignore stop */
        }
        return this.matchCheckTest(s, ifDir);
    }
    matchCheckTest(e, ifDir) {
        return (e &&
            (this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&
            (!ifDir || e.canReaddir()) &&
            (!this.opts.nodir || !e.isDirectory()) &&
            (!this.opts.nodir ||
                !this.opts.follow ||
                !e.isSymbolicLink() ||
                !e.realpathCached()?.isDirectory()) &&
            !this.#ignored(e)) ?
            e
            : undefined;
    }
    matchCheckSync(e, ifDir) {
        if (ifDir && this.opts.nodir)
            return undefined;
        let rpc;
        if (this.opts.realpath) {
            rpc = e.realpathCached() || e.realpathSync();
            if (!rpc)
                return undefined;
            e = rpc;
        }
        const needStat = e.isUnknown() || this.opts.stat;
        const s = needStat ? e.lstatSync() : e;
        if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {
            const target = s.realpathSync();
            if (target && (target?.isUnknown() || this.opts.stat)) {
                target.lstatSync();
            }
        }
        return this.matchCheckTest(s, ifDir);
    }
    matchFinish(e, absolute) {
        if (this.#ignored(e))
            return;
        // we know we have an ignore if this is false, but TS doesn't
        if (!this.includeChildMatches && this.#ignore?.add) {
            const ign = `${e.relativePosix()}/**`;
            this.#ignore.add(ign);
        }
        const abs = this.opts.absolute === undefined ? absolute : this.opts.absolute;
        this.seen.add(e);
        const mark = this.opts.mark && e.isDirectory() ? this.#sep : '';
        // ok, we have what we need!
        if (this.opts.withFileTypes) {
            this.matchEmit(e);
        }
        else if (abs) {
            const abs = this.opts.posix ? e.fullpathPosix() : e.fullpath();
            this.matchEmit(abs + mark);
        }
        else {
            const rel = this.opts.posix ? e.relativePosix() : e.relative();
            const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) ?
                '.' + this.#sep
                : '';
            this.matchEmit(!rel ? '.' + mark : pre + rel + mark);
        }
    }
    async match(e, absolute, ifDir) {
        const p = await this.matchCheck(e, ifDir);
        if (p)
            this.matchFinish(p, absolute);
    }
    matchSync(e, absolute, ifDir) {
        const p = this.matchCheckSync(e, ifDir);
        if (p)
            this.matchFinish(p, absolute);
    }
    walkCB(target, patterns, cb) {
        /* c8 ignore start */
        if (this.signal?.aborted)
            cb();
        /* c8 ignore stop */
        this.walkCB2(target, patterns, new Processor(this.opts), cb);
    }
    walkCB2(target, patterns, processor, cb) {
        if (this.#childrenIgnored(target))
            return cb();
        if (this.signal?.aborted)
            cb();
        if (this.paused) {
            this.onResume(() => this.walkCB2(target, patterns, processor, cb));
            return;
        }
        processor.processPatterns(target, patterns);
        // done processing.  all of the above is sync, can be abstracted out.
        // subwalks is a map of paths to the entry filters they need
        // matches is a map of paths to [absolute, ifDir] tuples.
        let tasks = 1;
        const next = () => {
            if (--tasks === 0)
                cb();
        };
        for (const [m, absolute, ifDir] of processor.matches.entries()) {
            if (this.#ignored(m))
                continue;
            tasks++;
            this.match(m, absolute, ifDir).then(() => next());
        }
        for (const t of processor.subwalkTargets()) {
            if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
                continue;
            }
            tasks++;
            const childrenCached = t.readdirCached();
            if (t.calledReaddir())
                this.walkCB3(t, childrenCached, processor, next);
            else {
                t.readdirCB((_, entries) => this.walkCB3(t, entries, processor, next), true);
            }
        }
        next();
    }
    walkCB3(target, entries, processor, cb) {
        processor = processor.filterEntries(target, entries);
        let tasks = 1;
        const next = () => {
            if (--tasks === 0)
                cb();
        };
        for (const [m, absolute, ifDir] of processor.matches.entries()) {
            if (this.#ignored(m))
                continue;
            tasks++;
            this.match(m, absolute, ifDir).then(() => next());
        }
        for (const [target, patterns] of processor.subwalks.entries()) {
            tasks++;
            this.walkCB2(target, patterns, processor.child(), next);
        }
        next();
    }
    walkCBSync(target, patterns, cb) {
        /* c8 ignore start */
        if (this.signal?.aborted)
            cb();
        /* c8 ignore stop */
        this.walkCB2Sync(target, patterns, new Processor(this.opts), cb);
    }
    walkCB2Sync(target, patterns, processor, cb) {
        if (this.#childrenIgnored(target))
            return cb();
        if (this.signal?.aborted)
            cb();
        if (this.paused) {
            this.onResume(() => this.walkCB2Sync(target, patterns, processor, cb));
            return;
        }
        processor.processPatterns(target, patterns);
        // done processing.  all of the above is sync, can be abstracted out.
        // subwalks is a map of paths to the entry filters they need
        // matches is a map of paths to [absolute, ifDir] tuples.
        let tasks = 1;
        const next = () => {
            if (--tasks === 0)
                cb();
        };
        for (const [m, absolute, ifDir] of processor.matches.entries()) {
            if (this.#ignored(m))
                continue;
            this.matchSync(m, absolute, ifDir);
        }
        for (const t of processor.subwalkTargets()) {
            if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
                continue;
            }
            tasks++;
            const children = t.readdirSync();
            this.walkCB3Sync(t, children, processor, next);
        }
        next();
    }
    walkCB3Sync(target, entries, processor, cb) {
        processor = processor.filterEntries(target, entries);
        let tasks = 1;
        const next = () => {
            if (--tasks === 0)
                cb();
        };
        for (const [m, absolute, ifDir] of processor.matches.entries()) {
            if (this.#ignored(m))
                continue;
            this.matchSync(m, absolute, ifDir);
        }
        for (const [target, patterns] of processor.subwalks.entries()) {
            tasks++;
            this.walkCB2Sync(target, patterns, processor.child(), next);
        }
        next();
    }
}
class GlobWalker extends GlobUtil {
    matches = new Set();
    constructor(patterns, path, opts) {
        super(patterns, path, opts);
    }
    matchEmit(e) {
        this.matches.add(e);
    }
    async walk() {
        if (this.signal?.aborted)
            throw this.signal.reason;
        if (this.path.isUnknown()) {
            await this.path.lstat();
        }
        await new Promise((res, rej) => {
            this.walkCB(this.path, this.patterns, () => {
                if (this.signal?.aborted) {
                    rej(this.signal.reason);
                }
                else {
                    res(this.matches);
                }
            });
        });
        return this.matches;
    }
    walkSync() {
        if (this.signal?.aborted)
            throw this.signal.reason;
        if (this.path.isUnknown()) {
            this.path.lstatSync();
        }
        // nothing for the callback to do, because this never pauses
        this.walkCBSync(this.path, this.patterns, () => {
            if (this.signal?.aborted)
                throw this.signal.reason;
        });
        return this.matches;
    }
}
class GlobStream extends GlobUtil {
    results;
    constructor(patterns, path, opts) {
        super(patterns, path, opts);
        this.results = new Minipass({
            signal: this.signal,
            objectMode: true,
        });
        this.results.on('drain', () => this.resume());
        this.results.on('resume', () => this.resume());
    }
    matchEmit(e) {
        this.results.write(e);
        if (!this.results.flowing)
            this.pause();
    }
    stream() {
        const target = this.path;
        if (target.isUnknown()) {
            target.lstat().then(() => {
                this.walkCB(target, this.patterns, () => this.results.end());
            });
        }
        else {
            this.walkCB(target, this.patterns, () => this.results.end());
        }
        return this.results;
    }
    streamSync() {
        if (this.path.isUnknown()) {
            this.path.lstatSync();
        }
        this.walkCBSync(this.path, this.patterns, () => this.results.end());
        return this.results;
    }
}
//# sourceMappingURL=walker.js.map
;// CONCATENATED MODULE: ./node_modules/glob/dist/esm/glob.js





// if no process global, just call it linux.
// so we default to case-sensitive, / separators
const glob_defaultPlatform = (typeof process === 'object' &&
    process &&
    typeof process.platform === 'string') ?
    process.platform
    : 'linux';
/**
 * An object that can perform glob pattern traversals.
 */
class Glob {
    absolute;
    cwd;
    root;
    dot;
    dotRelative;
    follow;
    ignore;
    magicalBraces;
    mark;
    matchBase;
    maxDepth;
    nobrace;
    nocase;
    nodir;
    noext;
    noglobstar;
    pattern;
    platform;
    realpath;
    scurry;
    stat;
    signal;
    windowsPathsNoEscape;
    withFileTypes;
    includeChildMatches;
    /**
     * The options provided to the constructor.
     */
    opts;
    /**
     * An array of parsed immutable {@link Pattern} objects.
     */
    patterns;
    /**
     * All options are stored as properties on the `Glob` object.
     *
     * See {@link GlobOptions} for full options descriptions.
     *
     * Note that a previous `Glob` object can be passed as the
     * `GlobOptions` to another `Glob` instantiation to re-use settings
     * and caches with a new pattern.
     *
     * Traversal functions can be called multiple times to run the walk
     * again.
     */
    constructor(pattern, opts) {
        /* c8 ignore start */
        if (!opts)
            throw new TypeError('glob options required');
        /* c8 ignore stop */
        this.withFileTypes = !!opts.withFileTypes;
        this.signal = opts.signal;
        this.follow = !!opts.follow;
        this.dot = !!opts.dot;
        this.dotRelative = !!opts.dotRelative;
        this.nodir = !!opts.nodir;
        this.mark = !!opts.mark;
        if (!opts.cwd) {
            this.cwd = '';
        }
        else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {
            opts.cwd = (0,external_node_url_namespaceObject.fileURLToPath)(opts.cwd);
        }
        this.cwd = opts.cwd || '';
        this.root = opts.root;
        this.magicalBraces = !!opts.magicalBraces;
        this.nobrace = !!opts.nobrace;
        this.noext = !!opts.noext;
        this.realpath = !!opts.realpath;
        this.absolute = opts.absolute;
        this.includeChildMatches = opts.includeChildMatches !== false;
        this.noglobstar = !!opts.noglobstar;
        this.matchBase = !!opts.matchBase;
        this.maxDepth =
            typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity;
        this.stat = !!opts.stat;
        this.ignore = opts.ignore;
        if (this.withFileTypes && this.absolute !== undefined) {
            throw new Error('cannot set absolute and withFileTypes:true');
        }
        if (typeof pattern === 'string') {
            pattern = [pattern];
        }
        this.windowsPathsNoEscape =
            !!opts.windowsPathsNoEscape ||
                opts.allowWindowsEscape ===
                    false;
        if (this.windowsPathsNoEscape) {
            pattern = pattern.map(p => p.replace(/\\/g, '/'));
        }
        if (this.matchBase) {
            if (opts.noglobstar) {
                throw new TypeError('base matching requires globstar');
            }
            pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`));
        }
        this.pattern = pattern;
        this.platform = opts.platform || glob_defaultPlatform;
        this.opts = { ...opts, platform: this.platform };
        if (opts.scurry) {
            this.scurry = opts.scurry;
            if (opts.nocase !== undefined &&
                opts.nocase !== opts.scurry.nocase) {
                throw new Error('nocase option contradicts provided scurry option');
            }
        }
        else {
            const Scurry = opts.platform === 'win32' ? PathScurryWin32
                : opts.platform === 'darwin' ? PathScurryDarwin
                    : opts.platform ? PathScurryPosix
                        : PathScurry;
            this.scurry = new Scurry(this.cwd, {
                nocase: opts.nocase,
                fs: opts.fs,
            });
        }
        this.nocase = this.scurry.nocase;
        // If you do nocase:true on a case-sensitive file system, then
        // we need to use regexps instead of strings for non-magic
        // path portions, because statting `aBc` won't return results
        // for the file `AbC` for example.
        const nocaseMagicOnly = this.platform === 'darwin' || this.platform === 'win32';
        const mmo = {
            // default nocase based on platform
            ...opts,
            dot: this.dot,
            matchBase: this.matchBase,
            nobrace: this.nobrace,
            nocase: this.nocase,
            nocaseMagicOnly,
            nocomment: true,
            noext: this.noext,
            nonegate: true,
            optimizationLevel: 2,
            platform: this.platform,
            windowsPathsNoEscape: this.windowsPathsNoEscape,
            debug: !!this.opts.debug,
        };
        const mms = this.pattern.map(p => new Minimatch(p, mmo));
        const [matchSet, globParts] = mms.reduce((set, m) => {
            set[0].push(...m.set);
            set[1].push(...m.globParts);
            return set;
        }, [[], []]);
        this.patterns = matchSet.map((set, i) => {
            const g = globParts[i];
            /* c8 ignore start */
            if (!g)
                throw new Error('invalid pattern object');
            /* c8 ignore stop */
            return new Pattern(set, g, 0, this.platform);
        });
    }
    async walk() {
        // Walkers always return array of Path objects, so we just have to
        // coerce them into the right shape.  It will have already called
        // realpath() if the option was set to do so, so we know that's cached.
        // start out knowing the cwd, at least
        return [
            ...(await new GlobWalker(this.patterns, this.scurry.cwd, {
                ...this.opts,
                maxDepth: this.maxDepth !== Infinity ?
                    this.maxDepth + this.scurry.cwd.depth()
                    : Infinity,
                platform: this.platform,
                nocase: this.nocase,
                includeChildMatches: this.includeChildMatches,
            }).walk()),
        ];
    }
    walkSync() {
        return [
            ...new GlobWalker(this.patterns, this.scurry.cwd, {
                ...this.opts,
                maxDepth: this.maxDepth !== Infinity ?
                    this.maxDepth + this.scurry.cwd.depth()
                    : Infinity,
                platform: this.platform,
                nocase: this.nocase,
                includeChildMatches: this.includeChildMatches,
            }).walkSync(),
        ];
    }
    stream() {
        return new GlobStream(this.patterns, this.scurry.cwd, {
            ...this.opts,
            maxDepth: this.maxDepth !== Infinity ?
                this.maxDepth + this.scurry.cwd.depth()
                : Infinity,
            platform: this.platform,
            nocase: this.nocase,
            includeChildMatches: this.includeChildMatches,
        }).stream();
    }
    streamSync() {
        return new GlobStream(this.patterns, this.scurry.cwd, {
            ...this.opts,
            maxDepth: this.maxDepth !== Infinity ?
                this.maxDepth + this.scurry.cwd.depth()
                : Infinity,
            platform: this.platform,
            nocase: this.nocase,
            includeChildMatches: this.includeChildMatches,
        }).streamSync();
    }
    /**
     * Default sync iteration function. Returns a Generator that
     * iterates over the results.
     */
    iterateSync() {
        return this.streamSync()[Symbol.iterator]();
    }
    [Symbol.iterator]() {
        return this.iterateSync();
    }
    /**
     * Default async iteration function. Returns an AsyncGenerator that
     * iterates over the results.
     */
    iterate() {
        return this.stream()[Symbol.asyncIterator]();
    }
    [Symbol.asyncIterator]() {
        return this.iterate();
    }
}
//# sourceMappingURL=glob.js.map
;// CONCATENATED MODULE: ./node_modules/glob/dist/esm/has-magic.js

/**
 * Return true if the patterns provided contain any magic glob characters,
 * given the options provided.
 *
 * Brace expansion is not considered "magic" unless the `magicalBraces` option
 * is set, as brace expansion just turns one string into an array of strings.
 * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and
 * `'xby'` both do not contain any magic glob characters, and it's treated the
 * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`
 * is in the options, brace expansion _is_ treated as a pattern having magic.
 */
const hasMagic = (pattern, options = {}) => {
    if (!Array.isArray(pattern)) {
        pattern = [pattern];
    }
    for (const p of pattern) {
        if (new Minimatch(p, options).hasMagic())
            return true;
    }
    return false;
};
//# sourceMappingURL=has-magic.js.map
;// CONCATENATED MODULE: ./node_modules/glob/dist/esm/index.js







function globStreamSync(pattern, options = {}) {
    return new Glob(pattern, options).streamSync();
}
function globStream(pattern, options = {}) {
    return new Glob(pattern, options).stream();
}
function globSync(pattern, options = {}) {
    return new Glob(pattern, options).walkSync();
}
async function glob_(pattern, options = {}) {
    return new Glob(pattern, options).walk();
}
function globIterateSync(pattern, options = {}) {
    return new Glob(pattern, options).iterateSync();
}
function globIterate(pattern, options = {}) {
    return new Glob(pattern, options).iterate();
}
// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc
const streamSync = globStreamSync;
const stream = Object.assign(globStream, { sync: globStreamSync });
const iterateSync = globIterateSync;
const iterate = Object.assign(globIterate, {
    sync: globIterateSync,
});
const sync = Object.assign(globSync, {
    stream: globStreamSync,
    iterate: globIterateSync,
});
const glob = Object.assign(glob_, {
    glob: glob_,
    globSync,
    sync,
    globStream,
    stream,
    globStreamSync,
    streamSync,
    globIterate,
    iterate,
    globIterateSync,
    iterateSync,
    Glob: Glob,
    hasMagic: hasMagic,
    escape: escape_escape,
    unescape: unescape_unescape,
});
glob.glob = glob;
//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ./src/check_datapack.ts








class ActionLogger {
    error(data, ...args) {
        core.error(data);
    }
    info(data, ...args) {
        core.info(data);
    }
    log(data, ...args) {
        core.debug(data);
    }
    warn(data, ...args) {
        core.warning(data);
    }
}
class CustomService extends Service {
    rootDir;
    options;
    constructor(rootDir, version, options) {
        rootDir = external_path_default().resolve(rootDir);
        core.info(`rootDir = ${rootDir}`);
        core.info(`version = ${version}`);
        const fullRootDir = fileUtil.ensureEndingSlash("file://" + rootDir);
        const config = {
            env: {
                gameVersion: version,
                feature: {
                    codeActions: false,
                    colors: false,
                    completions: false,
                    documentHighlighting: false,
                    documentLinks: false,
                    foldingRanges: false,
                    formatting: false,
                    hover: false,
                    inlayHint: {
                        enabledNodes: []
                    },
                    semanticColoring: false,
                    selectionRanges: false,
                    signatures: false
                }
            }
        };
        super({
            logger: new ActionLogger(),
            profilers: new ProfilerFactory(console, [
                'cache#load',
                'cache#save',
                'project#init',
                'project#ready',
            ]),
            project: {
                cacheRoot: 'file:///tmp/.cache/',
                defaultConfig: ConfigService.merge(VanillaConfig, config),
                externals: NodeJsExternals,
                initializers: [initialize, java_edition_lib_initialize],
                projectRoots: [fullRootDir],
            },
        });
        this.rootDir = rootDir;
        this.options = options;
    }
    async shutdown() {
        core.startGroup("Shutdown");
        await this.project.close();
        core.endGroup();
    }
    listFilesByExtension(extension) {
        return glob(external_path_default().join(this.rootDir, `**/*.${extension}`));
    }
    makeFileUrl(path) {
        return "file://" + path;
    }
    getFileContent(path) {
        return external_fs_default().readFileSync(path, {
            encoding: "utf-8"
        });
    }
    getLineAndColumn(pos, content) {
        const before = content.slice(0, pos);
        const line = before.split("\n").length;
        const col = pos - before.lastIndexOf("\n");
        return { line, col };
    }
    getErrorProperties(error, path, content) {
        const { line: startLine, col: startColumn } = this.getLineAndColumn(error.range.start, content);
        const { line: endLine, col: endColumn } = this.getLineAndColumn(error.range.end, content);
        return {
            file: path,
            startLine, startColumn,
            endLine, endColumn
        };
    }
    async checkFile(path, lang) {
        const url = this.makeFileUrl(path);
        const content = this.getFileContent(path);
        this.project.onDidOpen(url, lang, 0, content);
        const docAndNode = this.project.getClientManaged(url);
        if (!docAndNode) {
            core.error(`File ${path} is not loaded`);
            return false;
        }
        const { node } = docAndNode;
        const errors = FileNode.getErrors(node);
        if (errors.length !== 0) {
            const msg = `${errors.length} error${errors.length > 1 ? "s" : ""} in ${path}`;
            if (this.options.verbose) {
                core.startGroup(msg);
                for (const err of errors) {
                    core.error(err.message, this.getErrorProperties(err, path, content));
                }
                core.endGroup();
            }
            else {
                core.error(msg);
            }
            return false;
        }
        return true;
    }
    async checkAllFiles() {
        const jsonFiles = await this.listFilesByExtension("json");
        const funcFiles = await this.listFilesByExtension("mcfunction");
        core.info("Files to check:" + "\n" +
            `- JSON: ${jsonFiles.length}` + "\n" +
            `- Function: ${funcFiles.length}`);
        let success = true;
        for (const jsonFile of jsonFiles) {
            if (!(await this.checkFile(jsonFile, "json"))) {
                success = false;
                if (!this.options.reportAllErrors) {
                    return false;
                }
            }
        }
        for (const funcFile of funcFiles) {
            if (!(await this.checkFile(funcFile, "mcfunction"))) {
                success = false;
                if (!this.options.reportAllErrors) {
                    return false;
                }
            }
        }
        return success;
    }
}
async function checkDatapack(rootDir, version, reportAll, verbose) {
    core.startGroup("Initialization");
    const service = new CustomService(rootDir, version, {
        reportAllErrors: reportAll,
        verbose: verbose
    });
    await service.project.ready();
    core.endGroup();
    const success = await service.checkAllFiles();
    if (!success) {
        core.setFailed("Some files contain errors");
    }
    await service.shutdown();
}

;// CONCATENATED MODULE: ./src/index.ts


async function run() {
    try {
        const rootDir = core.getInput("rootDir");
        const version = core.getInput("version");
        const reportAll = core.getBooleanInput("reportAllErrors");
        const verbose = core.getBooleanInput("verbose");
        await checkDatapack(rootDir, version, reportAll, verbose);
    }
    catch (error) {
        if (error instanceof Error) {
            core.setFailed(error.message);
        }
    }
}
run();