diff --git a/action-src/package.json b/action-src/package.json index eda3dc3d1..199993a6f 100644 --- a/action-src/package.json +++ b/action-src/package.json @@ -27,8 +27,8 @@ "@octokit/core": "^4.2.4", "@octokit/plugin-rest-endpoint-methods": "7.1.3", "@octokit/rest": "^19.0.13", - "cspell": "^6.31.3", - "cspell-glob": "^6.31.3", + "cspell": "^7.0.0", + "cspell-glob": "^7.0.0", "esbuild": "^0.19.2", "vscode-uri": "^3.0.7" } diff --git a/action/lib/main_root.js b/action/lib/main_root.js index 134ad9c9e..af30e109b 100644 --- a/action/lib/main_root.js +++ b/action/lib/main_root.js @@ -11,9 +11,9 @@ var __esm = (fn, res) => function __init() { var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); +var __export = (target, all3) => { + for (var name in all3) + __defProp(target, name, { get: all3[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { @@ -99,11 +99,11 @@ var require_command = __commonJS({ }; Object.defineProperty(exports, "__esModule", { value: true }); exports.issue = exports.issueCommand = void 0; - var os = __importStar(require("os")); + var os5 = __importStar(require("os")); var utils_1 = require_utils(); function issueCommand2(command, properties, message) { const cmd = new Command(command, properties, message); - process.stdout.write(cmd.toString() + os.EOL); + process.stdout.write(cmd.toString() + os5.EOL); } exports.issueCommand = issueCommand2; function issue(name, message = "") { @@ -124,13 +124,13 @@ var require_command = __commonJS({ let cmdStr = CMD_STRING + this.command; if (this.properties && Object.keys(this.properties).length > 0) { cmdStr += " "; - let first = true; + let first3 = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { const val = this.properties[key]; if (val) { - if (first) { - first = false; + if (first3) { + first3 = false; } else { cmdStr += ","; } @@ -311,7 +311,7 @@ function stringToBytes(str) { } return bytes; } -function v35_default(name, version3, hashfunc) { +function v35_default(name, version4, hashfunc) { function generateUUID(value, namespace, buf, offset) { if (typeof value === "string") { value = stringToBytes(value); @@ -326,7 +326,7 @@ function v35_default(name, version3, hashfunc) { bytes.set(namespace); bytes.set(value, namespace.length); bytes = hashfunc(bytes); - bytes[6] = bytes[6] & 15 | version3; + bytes[6] = bytes[6] & 15 | version4; bytes[8] = bytes[8] & 63 | 128; if (buf) { offset = offset || 0; @@ -519,8 +519,8 @@ var require_file_command = __commonJS({ }; Object.defineProperty(exports, "__esModule", { value: true }); exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; - var fs6 = __importStar(require("fs")); - var os = __importStar(require("os")); + var fs9 = __importStar(require("fs")); + var os5 = __importStar(require("os")); var uuid_1 = (init_esm_node(), __toCommonJS(esm_node_exports)); var utils_1 = require_utils(); function issueFileCommand(command, message) { @@ -528,10 +528,10 @@ var require_file_command = __commonJS({ if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); } - if (!fs6.existsSync(filePath)) { + if (!fs9.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs6.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, { + fs9.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os5.EOL}`, { encoding: "utf8" }); } @@ -545,7 +545,7 @@ var require_file_command = __commonJS({ 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}`; + return `${key}<<${delimiter}${os5.EOL}${convertedValue}${os5.EOL}${delimiter}`; } exports.prepareKeyValueMessage = prepareKeyValueMessage; } @@ -572,7 +572,7 @@ var require_proxy = __commonJS({ if (proxyVar) { try { return new URL(proxyVar); - } catch (_a) { + } catch (_a2) { if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) return new URL(`http://${proxyVar}`); } @@ -629,7 +629,7 @@ var require_tunnel = __commonJS({ var http = require("http"); var https = require("https"); var events = require("events"); - var assert7 = require("assert"); + var assert20 = require("assert"); var util = require("util"); exports.httpOverHttp = httpOverHttp; exports.httpsOverHttp = httpsOverHttp; @@ -820,9 +820,9 @@ var require_tunnel = __commonJS({ 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]; + var keys2 = Object.keys(overrides); + for (var j = 0, keyLen = keys2.length; j < keyLen; ++j) { + var k = keys2[j]; if (overrides[k] !== void 0) { target[k] = overrides[k]; } @@ -891,11 +891,11 @@ var require_lib = __commonJS({ }; var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve10) { - resolve10(value); + return value instanceof P ? value : new P(function(resolve13) { + resolve13(value); }); } - return new (P || (P = Promise))(function(resolve10, reject) { + return new (P || (P = Promise))(function(resolve13, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -911,7 +911,7 @@ var require_lib = __commonJS({ } } function step(result) { - result.done ? resolve10(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve13(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -996,26 +996,26 @@ var require_lib = __commonJS({ } readBody() { return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve10) => __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve13) => __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", () => { - resolve10(output.toString()); + resolve13(output.toString()); }); })); }); } readBodyBuffer() { return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve10) => __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve13) => __awaiter(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); }); this.message.on("end", () => { - resolve10(Buffer.concat(chunks)); + resolve13(Buffer.concat(chunks)); }); })); }); @@ -1224,14 +1224,14 @@ var require_lib = __commonJS({ */ requestRaw(info3, data) { return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve10, reject) => { + return new Promise((resolve13, reject) => { function callbackForResult(err, res) { if (err) { reject(err); } else if (!res) { reject(new Error("Unknown error")); } else { - resolve10(res); + resolve13(res); } } this.requestRawWithCallback(info3, data, callbackForResult); @@ -1387,12 +1387,12 @@ var require_lib = __commonJS({ return __awaiter(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve10) => setTimeout(() => resolve10(), ms)); + return new Promise((resolve13) => setTimeout(() => resolve13(), ms)); }); } _processResponse(res, options) { return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve10, reject) => __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve13, reject) => __awaiter(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -1400,7 +1400,7 @@ var require_lib = __commonJS({ headers: {} }; if (statusCode === HttpCodes.NotFound) { - resolve10(response); + resolve13(response); } function dateTimeDeserializer(key, value) { if (typeof value === "string") { @@ -1439,7 +1439,7 @@ var require_lib = __commonJS({ err.result = response.result; reject(err); } else { - resolve10(response); + resolve13(response); } })); }); @@ -1456,11 +1456,11 @@ var require_auth = __commonJS({ "use strict"; var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve10) { - resolve10(value); + return value instanceof P ? value : new P(function(resolve13) { + resolve13(value); }); } - return new (P || (P = Promise))(function(resolve10, reject) { + return new (P || (P = Promise))(function(resolve13, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -1476,7 +1476,7 @@ var require_auth = __commonJS({ } } function step(result) { - result.done ? resolve10(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve13(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -1560,11 +1560,11 @@ var require_oidc_utils = __commonJS({ "use strict"; var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve10) { - resolve10(value); + return value instanceof P ? value : new P(function(resolve13) { + resolve13(value); }); } - return new (P || (P = Promise))(function(resolve10, reject) { + return new (P || (P = Promise))(function(resolve13, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -1580,7 +1580,7 @@ var require_oidc_utils = __commonJS({ } } function step(result) { - result.done ? resolve10(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve13(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -1613,7 +1613,7 @@ var require_oidc_utils = __commonJS({ return runtimeUrl; } static getCall(id_token_url) { - var _a; + var _a2; return __awaiter(this, void 0, void 0, function* () { const httpclient = _OidcClient.createHttpClient(); const res = yield httpclient.getJson(id_token_url).catch((error2) => { @@ -1623,7 +1623,7 @@ var require_oidc_utils = __commonJS({ Error Message: ${error2.result.message}`); }); - const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + const id_token = (_a2 = res.result) === null || _a2 === void 0 ? void 0 : _a2.value; if (!id_token) { throw new Error("Response json body do not have ID Token field"); } @@ -1658,11 +1658,11 @@ var require_summary = __commonJS({ "use strict"; var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve10) { - resolve10(value); + return value instanceof P ? value : new P(function(resolve13) { + resolve13(value); }); } - return new (P || (P = Promise))(function(resolve10, reject) { + return new (P || (P = Promise))(function(resolve13, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -1678,7 +1678,7 @@ var require_summary = __commonJS({ } } function step(result) { - result.done ? resolve10(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve13(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -1711,7 +1711,7 @@ var require_summary = __commonJS({ } try { yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); - } catch (_a) { + } catch (_a2) { throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); } this._filePath = pathFromEnv; @@ -1980,7 +1980,7 @@ var require_path_utils = __commonJS({ }; Object.defineProperty(exports, "__esModule", { value: true }); exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; - var path16 = __importStar(require("path")); + var path26 = __importStar(require("path")); function toPosixPath(pth) { return pth.replace(/[\\]/g, "/"); } @@ -1990,7 +1990,7 @@ var require_path_utils = __commonJS({ } exports.toWin32Path = toWin32Path; function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path16.sep); + return pth.replace(/[/\\]/g, path26.sep); } exports.toPlatformPath = toPlatformPath; } @@ -2030,11 +2030,11 @@ var require_core = __commonJS({ }; var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { - return value instanceof P ? value : new P(function(resolve10) { - resolve10(value); + return value instanceof P ? value : new P(function(resolve13) { + resolve13(value); }); } - return new (P || (P = Promise))(function(resolve10, reject) { + return new (P || (P = Promise))(function(resolve13, reject) { function fulfilled(value) { try { step(generator.next(value)); @@ -2050,7 +2050,7 @@ var require_core = __commonJS({ } } function step(result) { - result.done ? resolve10(result.value) : adopt(result.value).then(fulfilled, rejected); + result.done ? resolve13(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); @@ -2060,8 +2060,8 @@ var require_core = __commonJS({ var command_1 = require_command(); var file_command_1 = require_file_command(); var utils_1 = require_utils(); - var os = __importStar(require("os")); - var path16 = __importStar(require("path")); + var os5 = __importStar(require("os")); + var path26 = __importStar(require("path")); var oidc_utils_1 = require_oidc_utils(); var ExitCode; (function(ExitCode2) { @@ -2089,7 +2089,7 @@ var require_core = __commonJS({ } else { command_1.issueCommand("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path16.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path26.delimiter}${process.env["PATH"]}`; } exports.addPath = addPath; function getInput3(name, options) { @@ -2128,7 +2128,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); if (filePath) { return file_command_1.issueFileCommand("OUTPUT", file_command_1.prepareKeyValueMessage(name, value)); } - process.stdout.write(os.EOL); + process.stdout.write(os5.EOL); command_1.issueCommand("set-output", { name }, utils_1.toCommandValue(value)); } exports.setOutput = setOutput2; @@ -2162,7 +2162,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } exports.notice = notice; function info3(message) { - process.stdout.write(message + os.EOL); + process.stdout.write(message + os5.EOL); } exports.info = info3; function startGroup(name) { @@ -2238,14 +2238,14 @@ var require_context = __commonJS({ * Hydrate the context from the environment */ constructor() { - var _a, _b, _c; + var _a2, _b, _c; this.payload = {}; if (process.env.GITHUB_EVENT_PATH) { if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) { this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: "utf8" })); } else { - const path16 = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path16} does not exist${os_1.EOL}`); + const path26 = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path26} does not exist${os_1.EOL}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; @@ -2257,7 +2257,7 @@ var require_context = __commonJS({ this.job = process.env.GITHUB_JOB; this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10); this.runId = parseInt(process.env.GITHUB_RUN_ID, 10); - this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`; + this.apiUrl = (_a2 = process.env.GITHUB_API_URL) !== null && _a2 !== void 0 ? _a2 : `https://api.github.com`; this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`; this.graphqlUrl = (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`; } @@ -2569,7 +2569,7 @@ var require_dist_node2 = __commonJS({ } return obj; } - function merge(defaults, route, options) { + function merge4(defaults, route, options) { if (typeof route === "string") { let [method, url] = route.split(" "); options = Object.assign(url ? { @@ -2642,7 +2642,7 @@ var require_dist_node2 = __commonJS({ return value; } } - function isDefined2(value) { + function isDefined8(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -2650,7 +2650,7 @@ var require_dist_node2 = __commonJS({ } function getValues(context, operator, key, modifier) { var value = context[key], result = []; - if (isDefined2(value) && value !== "") { + if (isDefined8(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -2660,12 +2660,12 @@ var require_dist_node2 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined2).forEach(function(value2) { + value.filter(isDefined8).forEach(function(value2) { result.push(encodeValue(operator, value2, isKeyOperator(operator) ? key : "")); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined2(value[k])) { + if (isDefined8(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -2673,12 +2673,12 @@ var require_dist_node2 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined2).forEach(function(value2) { + value.filter(isDefined8).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined2(value[k])) { + if (isDefined8(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -2693,7 +2693,7 @@ var require_dist_node2 = __commonJS({ } } else { if (operator === ";") { - if (isDefined2(value)) { + if (isDefined8(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -2704,14 +2704,14 @@ var require_dist_node2 = __commonJS({ } return result; } - function parseUrl(template2) { + function parseUrl(template3) { return { - expand: expand.bind(null, template2) + expand: expand.bind(null, template3) }; } - function expand(template2, context) { + function expand(template3, context) { var operators2 = ["+", "#", ".", "/", ";", "?", "&"]; - return template2.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function(_, expression, literal) { + return template3.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function(_, expression, literal) { if (expression) { let operator = ""; const values = []; @@ -2739,7 +2739,7 @@ var require_dist_node2 = __commonJS({ } }); } - function parse3(options) { + function parse4(options) { let method = options.method.toUpperCase(); let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}"); let headers = Object.assign({}, options.headers); @@ -2760,8 +2760,8 @@ var require_dist_node2 = __commonJS({ if (options.mediaType.previews.length) { const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || []; headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => { - const format5 = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; - return `application/vnd.github.${preview}-preview${format5}`; + const format6 = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; + return `application/vnd.github.${preview}-preview${format6}`; }).join(","); } } @@ -2795,16 +2795,16 @@ var require_dist_node2 = __commonJS({ } : null); } function endpointWithDefaults(defaults, route, options) { - return parse3(merge(defaults, route, options)); + return parse4(merge4(defaults, route, options)); } function withDefaults(oldDefaults, newDefaults) { - const DEFAULTS2 = merge(oldDefaults, newDefaults); + const DEFAULTS2 = merge4(oldDefaults, newDefaults); const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2); return Object.assign(endpoint2, { DEFAULTS: DEFAULTS2, defaults: withDefaults.bind(null, DEFAULTS2), - merge: merge.bind(null, DEFAULTS2), - parse: parse3 + merge: merge4.bind(null, DEFAULTS2), + parse: parse4 }); } var VERSION = "6.0.12"; @@ -2988,9 +2988,9 @@ var require_utils3 = __commonJS({ "node_modules/whatwg-url/lib/utils.js"(exports, module2) { "use strict"; module2.exports.mixin = function mixin(target, source) { - const keys = Object.getOwnPropertyNames(source); - for (let i = 0; i < keys.length; ++i) { - Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i])); + const keys2 = Object.getOwnPropertyNames(source); + for (let i = 0; i < keys2.length; ++i) { + Object.defineProperty(target, keys2[i], Object.getOwnPropertyDescriptor(source, keys2[i])); } }; module2.exports.wrapperSymbol = Symbol("wrapper"); @@ -3021,7 +3021,7 @@ var require_tr46 = __commonJS({ TRANSITIONAL: 0, NONTRANSITIONAL: 1 }; - function normalize(str) { + function normalize3(str) { return str.split("\0").map(function(s) { return s.normalize("NFC"); }).join("\0"); @@ -3101,7 +3101,7 @@ var require_tr46 = __commonJS({ processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL; } var error2 = false; - if (normalize(label) !== label || label[3] === "-" && label[4] === "-" || label[0] === "-" || label[label.length - 1] === "-" || label.indexOf(".") !== -1 || label.search(combiningMarksRegex) === 0) { + if (normalize3(label) !== label || label[3] === "-" && label[4] === "-" || label[0] === "-" || label[label.length - 1] === "-" || label.indexOf(".") !== -1 || label.search(combiningMarksRegex) === 0) { error2 = true; } var len = countSymbols(label); @@ -3119,7 +3119,7 @@ var require_tr46 = __commonJS({ } function processing(domain_name, useSTD3, processing_option) { var result = mapChars(domain_name, useSTD3, processing_option); - result.string = normalize(result.string); + result.string = normalize3(result.string); var labels = result.string.split("."); for (var i = 0; i < labels.length; ++i) { try { @@ -3192,8 +3192,8 @@ var require_url_state_machine = __commonJS({ function countSymbols(str) { return punycode.ucs2.decode(str).length; } - function at(input, idx) { - const c = input[idx]; + function at(input, idx2) { + const c = input[idx2]; return isNaN(c) ? void 0 : String.fromCodePoint(c); } function isASCIIDigit(c) { @@ -3563,14 +3563,14 @@ var require_url_state_machine = __commonJS({ return url.replace(/\u0009|\u000A|\u000D/g, ""); } function shortenPath(url) { - const path16 = url.path; - if (path16.length === 0) { + const path26 = url.path; + if (path26.length === 0) { return; } - if (url.scheme === "file" && path16.length === 1 && isNormalizedWindowsDriveLetter(path16[0])) { + if (url.scheme === "file" && path26.length === 1 && isNormalizedWindowsDriveLetter(path26[0])) { return; } - path16.pop(); + path26.pop(); } function includesCredentials(url) { return url.username !== "" || url.password !== ""; @@ -4861,11 +4861,11 @@ var require_lib3 = __commonJS({ json: { enumerable: true }, text: { enumerable: true } }); - Body.mixIn = function(proto) { + Body.mixIn = function(proto2) { for (const name of Object.getOwnPropertyNames(Body.prototype)) { - if (!(name in proto)) { + if (!(name in proto2)) { const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); - Object.defineProperty(proto, name, desc); + Object.defineProperty(proto2, name, desc); } } }; @@ -4894,7 +4894,7 @@ var require_lib3 = __commonJS({ let accum = []; let accumBytes = 0; let abort = false; - return new Body.Promise(function(resolve10, reject) { + return new Body.Promise(function(resolve13, reject) { let resTimeout; if (_this4.timeout) { resTimeout = setTimeout(function() { @@ -4928,7 +4928,7 @@ var require_lib3 = __commonJS({ } clearTimeout(resTimeout); try { - resolve10(Buffer.concat(accum, accumBytes)); + resolve13(Buffer.concat(accum, accumBytes)); } catch (err) { reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, "system", err)); } @@ -5066,9 +5066,9 @@ var require_lib3 = __commonJS({ throw new TypeError(`${value} is not a legal HTTP header value`); } } - function find(map, name) { + function find(map3, name) { name = name.toLowerCase(); - for (const key in map) { + for (const key in map3) { if (key.toLowerCase() === name) { return key; } @@ -5275,8 +5275,8 @@ var require_lib3 = __commonJS({ }); function getHeaders(headers) { let kind = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "key+value"; - const keys = Object.keys(headers[MAP]).sort(); - return keys.map(kind === "key" ? function(k) { + const keys2 = Object.keys(headers[MAP]).sort(); + return keys2.map(kind === "key" ? function(k) { return k.toLowerCase(); } : kind === "value" ? function(k) { return headers[MAP][k].join(", "); @@ -5444,8 +5444,8 @@ var require_lib3 = __commonJS({ return typeof input === "object" && typeof input[INTERNALS$2] === "object"; } function isAbortSignal(signal) { - const proto = signal && typeof signal === "object" && Object.getPrototypeOf(signal); - return !!(proto && proto.constructor.name === "AbortSignal"); + const proto2 = signal && typeof signal === "object" && Object.getPrototypeOf(signal); + return !!(proto2 && proto2.constructor.name === "AbortSignal"); } var Request = class _Request { constructor(input) { @@ -5608,7 +5608,7 @@ var require_lib3 = __commonJS({ throw new Error("native promise missing, set fetch.Promise to your favorite alternative"); } Body.Promise = fetch2.Promise; - return new fetch2.Promise(function(resolve10, reject) { + return new fetch2.Promise(function(resolve13, reject) { const request = new Request(url, opts); const options = getNodeRequestOptions(request); const send = (options.protocol === "https:" ? https : http).request; @@ -5743,7 +5743,7 @@ var require_lib3 = __commonJS({ requestOpts.body = void 0; requestOpts.headers.delete("content-length"); } - resolve10(fetch2(new Request(locationURL, requestOpts))); + resolve13(fetch2(new Request(locationURL, requestOpts))); finalize(); return; } @@ -5765,7 +5765,7 @@ var require_lib3 = __commonJS({ const codings = headers.get("Content-Encoding"); if (!request.compress || request.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) { response = new Response(body, response_options); - resolve10(response); + resolve13(response); return; } const zlibOptions = { @@ -5775,7 +5775,7 @@ var require_lib3 = __commonJS({ if (codings == "gzip" || codings == "x-gzip") { body = body.pipe(zlib.createGunzip(zlibOptions)); response = new Response(body, response_options); - resolve10(response); + resolve13(response); return; } if (codings == "deflate" || codings == "x-deflate") { @@ -5787,12 +5787,12 @@ var require_lib3 = __commonJS({ body = body.pipe(zlib.createInflateRaw()); } response = new Response(body, response_options); - resolve10(response); + resolve13(response); }); raw.on("end", function() { if (!response) { response = new Response(body, response_options); - resolve10(response); + resolve13(response); } }); return; @@ -5800,11 +5800,11 @@ var require_lib3 = __commonJS({ if (codings == "br" && typeof zlib.createBrotliDecompress === "function") { body = body.pipe(zlib.createBrotliDecompress()); response = new Response(body, response_options); - resolve10(response); + resolve13(response); return; } response = new Response(body, response_options); - resolve10(response); + resolve13(response); }); writeToStream(req, request); }); @@ -6432,10 +6432,10 @@ var require_dist_node8 = __commonJS({ * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...) */ static plugin(...newPlugins) { - var _a; + var _a2; const currentPlugins = this.plugins; - const NewOctokit = (_a = class extends this { - }, _a.plugins = currentPlugins.concat(newPlugins.filter((plugin) => !currentPlugins.includes(plugin))), _a); + const NewOctokit = (_a2 = class extends this { + }, _a2.plugins = currentPlugins.concat(newPlugins.filter((plugin) => !currentPlugins.includes(plugin))), _a2); return NewOctokit; } }; @@ -6451,7 +6451,7 @@ var require_dist_node9 = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); + var keys2 = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { @@ -6459,9 +6459,9 @@ var require_dist_node9 = __commonJS({ return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } - keys.push.apply(keys, symbols); + keys2.push.apply(keys2, symbols); } - return keys; + return keys2; } function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { @@ -7526,14 +7526,14 @@ var require_dist_node10 = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); var VERSION = "2.21.3"; function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); + var keys2 = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function(sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; - })), keys.push.apply(keys, symbols); + })), keys2.push.apply(keys2, symbols); } - return keys; + return keys2; } function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { @@ -7710,22 +7710,22 @@ var require_utils4 = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0; var Context2 = __importStar(require_context()); - var Utils = __importStar(require_utils2()); + var Utils2 = __importStar(require_utils2()); var core_1 = require_dist_node8(); var plugin_rest_endpoint_methods_1 = require_dist_node9(); var plugin_paginate_rest_1 = require_dist_node10(); exports.context = new Context2.Context(); - var baseUrl = Utils.getApiBaseUrl(); + var baseUrl = Utils2.getApiBaseUrl(); exports.defaults = { baseUrl, request: { - agent: Utils.getProxyAgent(baseUrl) + agent: Utils2.getProxyAgent(baseUrl) } }; exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults); function getOctokitOptions(token, options) { const opts = Object.assign({}, options || {}); - const auth = Utils.getAuthString(token, opts); + const auth = Utils2.getAuthString(token, opts); if (auth) { opts.auth = auth; } @@ -7794,12 +7794,12 @@ var require_utils5 = __commonJS({ return false; }; exports.find = (node, type) => node.nodes.find((node2) => node2.type === type); - exports.exceedsLimit = (min, max, step = 1, limit) => { + exports.exceedsLimit = (min3, max4, step = 1, limit) => { if (limit === false) return false; - if (!exports.isInteger(min) || !exports.isInteger(max)) + if (!exports.isInteger(min3) || !exports.isInteger(max4)) return false; - return (Number(max) - Number(min)) / Number(step) >= limit; + return (Number(max4) - Number(min3)) / Number(step) >= limit; }; exports.escapeNode = (block, n = 0, type) => { let node = block.nodes[n]; @@ -7916,14 +7916,14 @@ var require_to_regex_range = __commonJS({ "node_modules/to-regex-range/index.js"(exports, module2) { "use strict"; var isNumber = require_is_number(); - var toRegexRange = (min, max, options) => { - if (isNumber(min) === false) { + var toRegexRange = (min3, max4, options) => { + if (isNumber(min3) === false) { throw new TypeError("toRegexRange: expected the first argument to be a number"); } - if (max === void 0 || min === max) { - return String(min); + if (max4 === void 0 || min3 === max4) { + return String(min3); } - if (isNumber(max) === false) { + if (isNumber(max4) === false) { throw new TypeError("toRegexRange: expected the second argument to be a number."); } let opts = { relaxZeros: true, ...options }; @@ -7934,14 +7934,14 @@ var require_to_regex_range = __commonJS({ let shorthand = String(opts.shorthand); let capture = String(opts.capture); let wrap = String(opts.wrap); - let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap; + let cacheKey = min3 + ":" + max4 + "=" + 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); + let a = Math.min(min3, max4); + let b = Math.max(min3, max4); if (Math.abs(a - b) === 1) { - let result = min + "|" + max; + let result = min3 + "|" + max4; if (opts.capture) { return `(${result})`; } @@ -7950,8 +7950,8 @@ var require_to_regex_range = __commonJS({ } return `(?:${result})`; } - let isPadded = hasPadding(min) || hasPadding(max); - let state = { min, max, a, b }; + let isPadded = hasPadding(min3) || hasPadding(max4); + let state = { min: min3, max: max4, a, b }; let positives = []; let negatives = []; if (isPadded) { @@ -7984,24 +7984,24 @@ var require_to_regex_range = __commonJS({ let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); return subpatterns.join("|"); } - function splitToRanges(min, max) { + function splitToRanges(min3, max4) { let nines = 1; let zeros = 1; - let stop = countNines(min, nines); - let stops = /* @__PURE__ */ new Set([max]); - while (min <= stop && stop <= max) { + let stop = countNines(min3, nines); + let stops = /* @__PURE__ */ new Set([max4]); + while (min3 <= stop && stop <= max4) { stops.add(stop); nines += 1; - stop = countNines(min, nines); + stop = countNines(min3, nines); } - stop = countZeros(max + 1, zeros) - 1; - while (min < stop && stop <= max) { + stop = countZeros(max4 + 1, zeros) - 1; + while (min3 < stop && stop <= max4) { stops.add(stop); zeros += 1; - stop = countZeros(max + 1, zeros) - 1; + stop = countZeros(max4 + 1, zeros) - 1; } stops = [...stops]; - stops.sort(compare2); + stops.sort(compare4); return stops; } function rangeToPattern(start, stop, options) { @@ -8011,7 +8011,7 @@ var require_to_regex_range = __commonJS({ let zipped = zip(start, stop); let digits = zipped.length; let pattern = ""; - let count = 0; + let count3 = 0; for (let i = 0; i < digits; i++) { let [startDigit, stopDigit] = zipped[i]; if (startDigit === stopDigit) { @@ -8019,22 +8019,22 @@ var require_to_regex_range = __commonJS({ } else if (startDigit !== "0" || stopDigit !== "9") { pattern += toCharacterClass(startDigit, stopDigit, options); } else { - count++; + count3++; } } - if (count) { + if (count3) { pattern += options.shorthand === true ? "\\d" : "[0-9]"; } - return { pattern, count: [count], digits }; + return { pattern, count: [count3], digits }; } - function splitToPatterns(min, max, tok, options) { - let ranges = splitToRanges(min, max); + function splitToPatterns(min3, max4, tok, options) { + let ranges = splitToRanges(min3, max4); let tokens = []; - let start = min; + let start = min3; let prev; for (let i = 0; i < ranges.length; i++) { - let max2 = ranges[i]; - let obj = rangeToPattern(String(start), String(max2), options); + let max5 = ranges[i]; + let obj = rangeToPattern(String(start), String(max5), options); let zeros = ""; if (!tok.isPadded && prev && prev.pattern === obj.pattern) { if (prev.count.length > 1) { @@ -8042,15 +8042,15 @@ var require_to_regex_range = __commonJS({ } prev.count.push(obj.count[0]); prev.string = prev.pattern + toQuantifier(prev.count); - start = max2 + 1; + start = max5 + 1; continue; } if (tok.isPadded) { - zeros = padZeros(max2, tok, options); + zeros = padZeros(max5, tok, options); } obj.string = zeros + obj.pattern + toQuantifier(obj.count); tokens.push(obj); - start = max2 + 1; + start = max5 + 1; prev = obj; } return tokens; @@ -8074,14 +8074,14 @@ var require_to_regex_range = __commonJS({ arr.push([a[i], b[i]]); return arr; } - function compare2(a, b) { + function compare4(a, b) { return a > b ? 1 : b > a ? -1 : 0; } function contains2(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 countNines(min3, len) { + return Number(String(min3).slice(0, -len) + "9".repeat(len)); } function countZeros(integer, zeros) { return integer - integer % Math.pow(10, zeros); @@ -8130,7 +8130,7 @@ var require_fill_range = __commonJS({ var util = require("util"); var toRegexRange = require_to_regex_range(); var isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val); - var transform = (toNumber) => { + var transform2 = (toNumber) => { return (value) => toNumber === true ? Number(value) : String(value); }; var isValidValue = (value) => { @@ -8251,7 +8251,7 @@ var require_fill_range = __commonJS({ let padded = zeros(startString) || zeros(endString) || zeros(stepString); let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; let toNumber = padded === false && stringify2(start, end, options) === false; - let format5 = options.transform || transform(toNumber); + let format6 = options.transform || transform2(toNumber); if (options.toRegex && step === 1) { return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); } @@ -8263,7 +8263,7 @@ var require_fill_range = __commonJS({ if (options.toRegex === true && step > 1) { push(a); } else { - range.push(pad(format5(a, index), maxLen, toNumber)); + range.push(pad(format6(a, index), maxLen, toNumber)); } a = descending ? a - step : a + step; index++; @@ -8277,19 +8277,19 @@ var require_fill_range = __commonJS({ if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) { return invalidRange(start, end, options); } - let format5 = options.transform || ((val) => String.fromCharCode(val)); + let format6 = 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); + let min3 = Math.min(a, b); + let max4 = Math.max(a, b); if (options.toRegex && step === 1) { - return toRange(min, max, false, options); + return toRange(min3, max4, false, options); } let range = []; let index = 0; while (descending ? a >= b : a <= b) { - range.push(format5(a, index)); + range.push(format6(a, index)); a = descending ? a - step : a + step; index++; } @@ -8336,7 +8336,7 @@ var require_compile = __commonJS({ var fill = require_fill_range(); var utils = require_utils5(); var compile = (ast, options = {}) => { - let walk = (node, parent = {}) => { + let walk4 = (node, parent = {}) => { let invalidBlock = utils.isInvalidBrace(parent); let invalidNode = node.invalid === true && options.escapeInvalid === true; let invalid = invalidBlock === true || invalidNode === true; @@ -8369,12 +8369,12 @@ var require_compile = __commonJS({ } if (node.nodes) { for (let child of node.nodes) { - output += walk(child, node); + output += walk4(child, node); } } return output; }; - return walk(ast); + return walk4(ast); }; module2.exports = compile; } @@ -8413,7 +8413,7 @@ var require_expand = __commonJS({ }; var expand = (ast, options = {}) => { let rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit; - let walk = (node, parent = {}) => { + let walk4 = (node, parent = {}) => { node.queue = []; let p = parent; let q = parent.queue; @@ -8466,12 +8466,12 @@ var require_expand = __commonJS({ continue; } if (child.nodes) { - walk(child, node); + walk4(child, node); } } return queue; }; - return utils.flatten(walk(ast)); + return utils.flatten(walk4(ast)); }; module2.exports = expand; } @@ -8612,14 +8612,14 @@ var require_parse = __commonJS({ CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_NOBREAK_SPACE } = require_constants(); - var parse3 = (input, options = {}) => { + var parse4 = (input, options = {}) => { if (typeof input !== "string") { throw new TypeError("Expected a string"); } let opts = options || {}; - let 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})`); + let max4 = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + if (input.length > max4) { + throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max4})`); } let ast = { type: "root", input, nodes: [] }; let stack = [ast]; @@ -8818,7 +8818,7 @@ var require_parse = __commonJS({ push({ type: "eos" }); return ast; }; - module2.exports = parse3; + module2.exports = parse4; } }); @@ -8829,7 +8829,7 @@ var require_braces = __commonJS({ var stringify2 = require_stringify(); var compile = require_compile(); var expand = require_expand(); - var parse3 = require_parse(); + var parse4 = require_parse(); var braces = (input, options = {}) => { let output = []; if (Array.isArray(input)) { @@ -8849,7 +8849,7 @@ var require_braces = __commonJS({ } return output; }; - braces.parse = (input, options = {}) => parse3(input, options); + braces.parse = (input, options = {}) => parse4(input, options); braces.stringify = (input, options = {}) => { if (typeof input === "string") { return stringify2(braces.parse(input, options), options); @@ -8889,7 +8889,7 @@ var require_braces = __commonJS({ var require_constants2 = __commonJS({ "node_modules/picomatch/lib/constants.js"(exports, module2) { "use strict"; - var path16 = require("path"); + var path26 = require("path"); var WIN_SLASH = "\\\\/"; var WIN_NO_SLASH = `[^${WIN_SLASH}]`; var DOT_LITERAL = "\\."; @@ -9059,7 +9059,7 @@ var require_constants2 = __commonJS({ /* | */ CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ - SEP: path16.sep, + SEP: path26.sep, /** * Create EXTGLOB_CHARS */ @@ -9086,7 +9086,7 @@ var require_constants2 = __commonJS({ var require_utils6 = __commonJS({ "node_modules/picomatch/lib/utils.js"(exports) { "use strict"; - var path16 = require("path"); + var path26 = require("path"); var win32 = process.platform === "win32"; var { REGEX_BACKSLASH, @@ -9100,8 +9100,8 @@ var require_utils6 = __commonJS({ 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; + return str.replace(REGEX_REMOVE_BACKSLASH, (match2) => { + return match2 === "\\" ? "" : match2; }); }; exports.supportsLookbehinds = () => { @@ -9115,15 +9115,15 @@ var require_utils6 = __commonJS({ if (options && typeof options.windows === "boolean") { return options.windows; } - return win32 === true || path16.sep === "\\"; + return win32 === true || path26.sep === "\\"; }; exports.escapeLast = (input, char, lastIdx) => { - const idx = input.lastIndexOf(char, lastIdx); - if (idx === -1) + const idx2 = input.lastIndexOf(char, lastIdx); + if (idx2 === -1) return input; - if (input[idx - 1] === "\\") - return exports.escapeLast(input, char, idx - 1); - return `${input.slice(0, idx)}\\${input.slice(idx)}`; + if (input[idx2 - 1] === "\\") + return exports.escapeLast(input, char, idx2 - 1); + return `${input.slice(0, idx2)}\\${input.slice(idx2)}`; }; exports.removePrefix = (input, state = {}) => { let output = input; @@ -9190,7 +9190,7 @@ var require_scan = __commonJS({ token.depth = token.isGlobstar ? Infinity : 1; } }; - var scan = (input, options) => { + var scan3 = (input, options) => { const opts = options || {}; const length = input.length - 1; const scanToEnd = opts.parts === true || opts.scanToEnd === true; @@ -9441,21 +9441,21 @@ var require_scan = __commonJS({ } if (opts.parts === true || opts.tokens === true) { let prevIndex; - for (let idx = 0; idx < slashes.length; idx++) { + for (let idx2 = 0; idx2 < slashes.length; idx2++) { const n = prevIndex ? prevIndex + 1 : start; - const i = slashes[idx]; + const i = slashes[idx2]; const value = input.slice(n, i); if (opts.tokens) { - if (idx === 0 && start !== 0) { - tokens[idx].isPrefix = true; - tokens[idx].value = prefix; + if (idx2 === 0 && start !== 0) { + tokens[idx2].isPrefix = true; + tokens[idx2].value = prefix; } else { - tokens[idx].value = value; + tokens[idx2].value = value; } - depth(tokens[idx]); - state.maxDepth += tokens[idx].depth; + depth(tokens[idx2]); + state.maxDepth += tokens[idx2].depth; } - if (idx !== 0 || value !== "") { + if (idx2 !== 0 || value !== "") { parts.push(value); } prevIndex = i; @@ -9474,7 +9474,7 @@ var require_scan = __commonJS({ } return state; }; - module2.exports = scan; + module2.exports = scan3; } }); @@ -9491,7 +9491,7 @@ var require_parse2 = __commonJS({ REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants; - var expandRange = (args, options) => { + var expandRange2 = (args, options) => { if (typeof options.expandRange === "function") { return options.expandRange(...args, options); } @@ -9507,16 +9507,16 @@ var require_parse2 = __commonJS({ var syntaxError = (type, char) => { return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; }; - var parse3 = (input, options) => { + var parse4 = (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; + const max4 = 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}`); + if (len > max4) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max4}`); } const bos = { type: "bos", value: "", output: opts.prepend || "" }; const tokens = [bos]; @@ -9587,13 +9587,13 @@ var require_parse2 = __commonJS({ consume(token.value); }; const negate = () => { - let count = 1; + let count3 = 1; while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) { advance(); state.start++; - count++; + count3++; } - if (count % 2 === 0) { + if (count3 % 2 === 0) { return false; } state.negated = true; @@ -9657,7 +9657,7 @@ var require_parse2 = __commonJS({ output = token.close = `)$))${extglobStar}`; } if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { - const expression = parse3(rest, { ...options, fastpaths: false }).output; + const expression = parse4(rest, { ...options, fastpaths: false }).output; output = token.close = `)${expression})${extglobStar})`; } if (token.prev.type === "bos") { @@ -9669,26 +9669,26 @@ var require_parse2 = __commonJS({ }; 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 === "\\") { + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first3, rest, index) => { + if (first3 === "\\") { backslashes = true; return m; } - if (first === "?") { + if (first3 === "?") { if (esc) { - return esc + first + (rest ? QMARK.repeat(rest.length) : ""); + return esc + first3 + (rest ? QMARK.repeat(rest.length) : ""); } if (index === 0) { return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ""); } return QMARK.repeat(chars.length); } - if (first === ".") { + if (first3 === ".") { return DOT_LITERAL.repeat(chars.length); } - if (first === "*") { + if (first3 === "*") { if (esc) { - return esc + first + (rest ? star : ""); + return esc + first3 + (rest ? star : ""); } return star; } @@ -9728,10 +9728,10 @@ var require_parse2 = __commonJS({ push({ type: "text", value }); continue; } - const match = /^\\+/.exec(remaining()); + const match2 = /^\\+/.exec(remaining()); let slashes = 0; - if (match && match[0].length > 2) { - slashes = match[0].length; + if (match2 && match2[0].length > 2) { + slashes = match2[0].length; state.index += slashes; if (slashes % 2 !== 0) { value += "\\"; @@ -9753,9 +9753,9 @@ var require_parse2 = __commonJS({ if (inner.includes("[")) { prev.posix = true; if (inner.includes(":")) { - const idx = prev.value.lastIndexOf("["); - const pre = prev.value.slice(0, idx); - const rest2 = prev.value.slice(idx + 2); + const idx2 = prev.value.lastIndexOf("["); + const pre = prev.value.slice(0, idx2); + const rest2 = prev.value.slice(idx2 + 2); const posix3 = POSIX_REGEX_SOURCE[rest2]; if (posix3) { prev.value = pre + posix3; @@ -9890,7 +9890,7 @@ var require_parse2 = __commonJS({ range.unshift(arr[i].value); } } - output = expandRange(range, opts); + output = expandRange2(range, opts); state.backtrack = true; } if (brace.comma !== true && brace.dots !== true) { @@ -10020,10 +10020,10 @@ var require_parse2 = __commonJS({ if (value === "$" || value === "^") { value = `\\${value}`; } - const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); - if (match) { - value += match[0]; - state.index += match[0].length; + const match2 = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match2) { + value += match2[0]; + state.index += match2[0].length; } push({ type: "text", value }); continue; @@ -10186,12 +10186,12 @@ var require_parse2 = __commonJS({ } return state; }; - parse3.fastpaths = (input, options) => { + parse4.fastpaths = (input, options) => { const opts = { ...options }; - const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const max4 = 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}`); + if (len > max4) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max4}`); } input = REPLACEMENTS[input] || input; const win32 = utils.isWindows(options); @@ -10238,13 +10238,13 @@ var require_parse2 = __commonJS({ case "**/.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; default: { - const match = /^(.*?)\.(\w+)$/.exec(str); - if (!match) + const match2 = /^(.*?)\.(\w+)$/.exec(str); + if (!match2) return; - const source2 = create(match[1]); + const source2 = create(match2[1]); if (!source2) return; - return source2 + DOT_LITERAL + match[2]; + return source2 + DOT_LITERAL + match2[2]; } } }; @@ -10255,7 +10255,7 @@ var require_parse2 = __commonJS({ } return source; }; - module2.exports = parse3; + module2.exports = parse4; } }); @@ -10263,9 +10263,9 @@ var require_parse2 = __commonJS({ var require_picomatch = __commonJS({ "node_modules/picomatch/lib/picomatch.js"(exports, module2) { "use strict"; - var path16 = require("path"); - var scan = require_scan(); - var parse3 = require_parse2(); + var path26 = require("path"); + var scan3 = require_scan(); + var parse4 = require_parse2(); var utils = require_utils6(); var constants = require_constants2(); var isObject = (val) => val && typeof val === "object" && !Array.isArray(val); @@ -10297,8 +10297,8 @@ var require_picomatch = __commonJS({ isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); } const matcher = (input, returnObject = false) => { - const { isMatch, match, output } = picomatch.test(input, regex, options, { glob: glob2, posix: posix3 }); - const result = { glob: glob2, state, regex, posix: posix3, input, output, match, isMatch }; + const { isMatch, match: match2, output } = picomatch.test(input, regex, options, { glob: glob2, posix: posix3 }); + const result = { glob: glob2, state, regex, posix: posix3, input, output, match: match2, isMatch }; if (typeof opts.onResult === "function") { opts.onResult(result); } @@ -10331,33 +10331,33 @@ var require_picomatch = __commonJS({ return { isMatch: false, output: "" }; } const opts = options || {}; - const format5 = opts.format || (posix3 ? utils.toPosixSlashes : null); - let match = input === glob2; - let output = match && format5 ? format5(input) : input; - if (match === false) { - output = format5 ? format5(input) : input; - match = output === glob2; - } - if (match === false || opts.capture === true) { + const format6 = opts.format || (posix3 ? utils.toPosixSlashes : null); + let match2 = input === glob2; + let output = match2 && format6 ? format6(input) : input; + if (match2 === false) { + output = format6 ? format6(input) : input; + match2 = output === glob2; + } + if (match2 === false || opts.capture === true) { if (opts.matchBase === true || opts.basename === true) { - match = picomatch.matchBase(input, regex, options, posix3); + match2 = picomatch.matchBase(input, regex, options, posix3); } else { - match = regex.exec(output); + match2 = regex.exec(output); } } - return { isMatch: Boolean(match), match, output }; + return { isMatch: Boolean(match2), match: match2, output }; }; picomatch.matchBase = (input, glob2, options, posix3 = utils.isWindows(options)) => { const regex = glob2 instanceof RegExp ? glob2 : picomatch.makeRe(glob2, options); - return regex.test(path16.basename(input)); + return regex.test(path26.basename(input)); }; picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); picomatch.parse = (pattern, options) => { if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options)); - return parse3(pattern, { ...options, fastpaths: false }); + return parse4(pattern, { ...options, fastpaths: false }); }; - picomatch.scan = (input, options) => scan(input, options); + picomatch.scan = (input, options) => scan3(input, options); picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { if (returnOutput === true) { return state.output; @@ -10381,10 +10381,10 @@ var require_picomatch = __commonJS({ } let parsed = { negated: false, fastpaths: true }; if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) { - parsed.output = parse3.fastpaths(input, options); + parsed.output = parse4.fastpaths(input, options); } if (!parsed.output) { - parsed = parse3(input, options); + parsed = parse4(input, options); } return picomatch.compileRe(parsed, options, returnOutput, returnState); }; @@ -10440,8 +10440,8 @@ var require_micromatch = __commonJS({ negatives++; for (let item of list) { let matched = isMatch(item, true); - let match = negated ? !matched.isMatch : matched.isMatch; - if (!match) + let match2 = negated ? !matched.isMatch : matched.isMatch; + if (!match2) continue; if (negated) { omit.add(matched.output); @@ -10505,9 +10505,9 @@ var require_micromatch = __commonJS({ if (!utils.isObject(obj)) { throw new TypeError("Expected the first argument to be an object"); } - let keys = micromatch(Object.keys(obj), patterns, options); + let keys2 = micromatch(Object.keys(obj), patterns, options); let res = {}; - for (let key of keys) + for (let key of keys2) res[key] = obj[key]; return res; }; @@ -10540,9 +10540,9 @@ var require_micromatch = __commonJS({ micromatch.capture = (glob2, input, options) => { let posix3 = utils.isWindows(options); let regex = picomatch.makeRe(String(glob2), { ...options, capture: true }); - let match = regex.exec(posix3 ? utils.toPosixSlashes(input) : input); - if (match) { - return match.slice(1).map((v) => v === void 0 ? "" : v); + let match2 = regex.exec(posix3 ? utils.toPosixSlashes(input) : input); + if (match2) { + return match2.slice(1).map((v) => v === void 0 ? "" : v); } }; micromatch.makeRe = (...args) => picomatch.makeRe(...args); @@ -10581,9 +10581,9 @@ var require_dist_node11 = __commonJS({ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropNames2 = Object.getOwnPropertyNames; var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); + var __export2 = (target, all3) => { + for (var name in all3) + __defProp2(target, name, { get: all3[name], enumerable: true }); }; var __copyProps2 = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { @@ -12952,9 +12952,9 @@ var require_umd = __commonJS({ } }); -// node_modules/cspell-glob/dist/cjs/globHelper.js -var require_globHelper = __commonJS({ - "node_modules/cspell-glob/dist/cjs/globHelper.js"(exports) { +// node_modules/cspell-lib/dist/lib-cjs/vscodeUri.cjs +var require_vscodeUri = __commonJS({ + "node_modules/cspell-lib/dist/lib-cjs/vscodeUri.cjs"(exports) { "use strict"; var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { if (k2 === void 0) @@ -12989,718 +12989,9 @@ var require_globHelper = __commonJS({ return result; }; Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.normalizeGlobToRoot = exports.normalizeGlobPattern = exports.normalizeGlobPatterns = exports.isGlobPatternNormalized = exports.isGlobPatternWithRoot = exports.isGlobPatternWithOptionalRoot = exports.doesRootContainPath = exports.fileOrGlobToGlob = void 0; - var Path3 = __importStar(require("path")); - var { posix: posix3 } = Path3; - var relRegExp2 = /^\.[\\/]/; - var isGlobalPatternRegExp2 = /^!*[*]{2}/; - function fileOrGlobToGlob2(fileOrGlob, root, path16 = Path3) { - const pathToGlob = path16.sep === "\\" ? (p) => p.replace(/\\/g, "/") : (p) => p; - const isGlobalPattern = false; - if (isGlobPatternWithOptionalRoot2(fileOrGlob)) { - const useRoot = fileOrGlob.root ?? root; - const isGlobalPattern2 = isGlobPatternWithRoot2(fileOrGlob) ? fileOrGlob.isGlobalPattern : isGlobalGlob2(fileOrGlob.glob); - return { ...fileOrGlob, root: useRoot, isGlobalPattern: isGlobalPattern2 }; - } - if (doesRootContainPath2(root, fileOrGlob, path16) || relRegExp2.test(fileOrGlob)) { - const rel = path16.relative(root, path16.resolve(root, fileOrGlob)); - return { glob: pathToGlob(rel), root, isGlobalPattern }; - } - return { glob: pathToGlob(fileOrGlob), root, isGlobalPattern }; - } - exports.fileOrGlobToGlob = fileOrGlobToGlob2; - function doesRootContainPath2(root, child, path16) { - if (child.startsWith(root)) - return true; - const rel = path16.relative(root, child); - return !rel || rel !== child && !rel.startsWith("..") && !path16.isAbsolute(rel); - } - exports.doesRootContainPath = doesRootContainPath2; - function isGlobPatternWithOptionalRoot2(g) { - return typeof g !== "string" && typeof g.glob === "string"; - } - exports.isGlobPatternWithOptionalRoot = isGlobPatternWithOptionalRoot2; - function isGlobPatternWithRoot2(g) { - return typeof g.root === "string" && "isGlobalPattern" in g; - } - exports.isGlobPatternWithRoot = isGlobPatternWithRoot2; - function isGlobPatternNormalized2(g) { - if (!isGlobPatternWithOptionalRoot2(g)) - return false; - if (!isGlobPatternWithRoot2(g)) - return false; - const gr = g; - return "rawGlob" in gr && "rawRoot" in gr && typeof gr.rawGlob === "string"; - } - exports.isGlobPatternNormalized = isGlobPatternNormalized2; - function normalizePattern2(pattern, nested) { - pattern = pattern.replace(/^(!!)+/, ""); - const isNeg = pattern.startsWith("!"); - const prefix = isNeg ? "!" : ""; - pattern = isNeg ? pattern.slice(1) : pattern; - const patterns = nested ? normalizePatternNested2(pattern) : normalizePatternGeneral2(pattern); - return patterns.map((p) => prefix + p); - } - function normalizePatternNested2(pattern) { - if (!pattern.includes("/")) { - if (pattern === "**") - return ["**"]; - return ["**/" + pattern, "**/" + pattern + "/**"]; - } - const hasLeadingSlash = pattern.startsWith("/"); - pattern = hasLeadingSlash ? pattern.slice(1) : pattern; - if (pattern.endsWith("/")) { - return hasLeadingSlash || pattern.slice(0, -1).includes("/") ? [pattern + "**/*"] : ["**/" + pattern + "**/*"]; - } - if (pattern.endsWith("**")) { - return [pattern]; - } - return [pattern, pattern + "/**"]; - } - function normalizePatternGeneral2(pattern) { - pattern = pattern.startsWith("/") ? pattern.slice(1) : pattern; - pattern = pattern.endsWith("/") ? pattern + "**/*" : pattern; - return [pattern]; - } - function normalizeGlobPatterns2(patterns, options) { - function* normalize() { - for (const glob2 of patterns) { - if (isGlobPatternNormalized2(glob2)) { - yield glob2; - continue; - } - yield* normalizeGlobPattern2(glob2, options); - } - } - return [...normalize()]; - } - exports.normalizeGlobPatterns = normalizeGlobPatterns2; - function normalizeGlobPattern2(g, options) { - const { root, nodePath: path16 = Path3, nested, cwd = Path3.resolve() } = options; - g = !isGlobPatternWithOptionalRoot2(g) ? { glob: g } : g; - const gr = { ...g, root: g.root ?? root }; - const rawRoot = gr.root; - const rawGlob = g.glob; - gr.glob = gr.glob.trim(); - if (gr.glob.startsWith("${cwd}")) { - gr.glob = gr.glob.replace("${cwd}", ""); - gr.root = "${cwd}"; - } - if (gr.root.startsWith("${cwd}")) { - gr.root = path16.resolve(gr.root.replace("${cwd}", cwd)); - } - const isGlobalPattern = isGlobalGlob2(gr.glob); - gr.root = path16.resolve(root, path16.normalize(gr.root)); - const globs = normalizePattern2(gr.glob, nested); - return globs.map((glob2) => ({ ...gr, glob: glob2, rawGlob, rawRoot, isGlobalPattern })); - } - exports.normalizeGlobPattern = normalizeGlobPattern2; - function normalizeGlobToRoot2(glob2, root, path16) { - function relToGlob(relativePath2) { - return path16.sep === "\\" ? relativePath2.replace(/\\/g, "/") : relativePath2; - } - if (glob2.root === root) { - return glob2; - } - const relFromRootToGlob = path16.relative(root, glob2.root); - if (!relFromRootToGlob) { - return glob2; - } - if (glob2.isGlobalPattern) { - return { ...glob2, root }; - } - const relFromGlobToRoot = path16.relative(glob2.root, root); - const globIsUnderRoot = relFromRootToGlob[0] !== "." && !path16.isAbsolute(relFromRootToGlob); - const rootIsUnderGlob = relFromGlobToRoot[0] !== "." && !path16.isAbsolute(relFromGlobToRoot); - if (!globIsUnderRoot && !rootIsUnderGlob) { - return glob2; - } - const isNeg = glob2.glob.startsWith("!"); - const g = isNeg ? glob2.glob.slice(1) : glob2.glob; - const prefix = isNeg ? "!" : ""; - if (globIsUnderRoot) { - const relGlob2 = relToGlob(relFromRootToGlob); - return { - ...glob2, - glob: prefix + posix3.join(relGlob2, g), - root - }; - } - const relGlob = relToGlob(relFromGlobToRoot) + "/"; - const rebasedGlob = rebaseGlob2(g, relGlob); - return rebasedGlob ? { ...glob2, glob: prefix + rebasedGlob, root } : glob2; - } - exports.normalizeGlobToRoot = normalizeGlobToRoot2; - function rebaseGlob2(glob2, rebaseTo) { - if (!rebaseTo || rebaseTo === "/") - return glob2; - if (glob2.startsWith("**")) - return glob2; - rebaseTo = rebaseTo.endsWith("/") ? rebaseTo : rebaseTo + "/"; - if (glob2.startsWith(rebaseTo)) { - return glob2.slice(rebaseTo.length); - } - const relParts = rebaseTo.split("/"); - const globParts = glob2.split("/"); - for (let i = 0; i < relParts.length && i < globParts.length; ++i) { - const relSeg = relParts[i]; - const globSeg = globParts[i]; - if (!relSeg || globSeg === "**") { - return globParts.slice(i).join("/"); - } - if (relSeg !== globSeg && globSeg !== "*") { - break; - } - } - return void 0; - } - function trimGlob(glob2) { - glob2 = glob2.replace(/(?= 0 && glob2[i] in spaces) { - --i; - } - if (glob2[i] === "\\" && i < lenMin1) { - ++i; - } - ++i; - return i ? glob2.slice(0, i) : ""; - } - function trimGlobLeft(glob2) { - let i = 0; - while (i < glob2.length && glob2[i] in spaces) { - ++i; - } - return glob2.slice(i); - } - function isGlobalGlob2(glob2) { - return isGlobalPatternRegExp2.test(glob2); - } - exports.__testing__ = { - rebaseGlob: rebaseGlob2, - trimGlob, - isGlobalGlob: isGlobalGlob2 - }; - } -}); - -// node_modules/cspell-glob/dist/cjs/GlobMatcher.js -var require_GlobMatcher = __commonJS({ - "node_modules/cspell-glob/dist/cjs/GlobMatcher.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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 __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.GlobMatcher = void 0; - var micromatch_1 = __importDefault(require_micromatch()); - var Path3 = __importStar(require("path")); - var globHelper_js_1 = require_globHelper(); - var GlobMatcher2 = class { - constructor(patterns, rootOrOptions, _nodePath) { - _nodePath = _nodePath ?? Path3; - const options = typeof rootOrOptions === "string" ? { root: rootOrOptions } : rootOrOptions ?? {}; - const { mode = "exclude" } = options; - const isExcludeMode = mode !== "include"; - _nodePath = options.nodePath ?? _nodePath; - const { root = _nodePath.resolve(), dot = isExcludeMode, nodePath = _nodePath, nested = isExcludeMode, cwd = process.cwd(), nobrace } = options; - const normalizedRoot = nodePath.resolve(nodePath.normalize(root)); - this.options = { root: normalizedRoot, dot, nodePath, nested, mode, nobrace, cwd }; - patterns = Array.isArray(patterns) ? patterns : typeof patterns === "string" ? patterns.split(/\r?\n/g) : [patterns]; - const globPatterns = (0, globHelper_js_1.normalizeGlobPatterns)(patterns, this.options); - this.patternsNormalizedToRoot = globPatterns.map((g) => (0, globHelper_js_1.normalizeGlobToRoot)(g, normalizedRoot, nodePath)).filter((g) => nodePath.relative(g.root, normalizedRoot) === ""); - this.patterns = globPatterns; - this.root = normalizedRoot; - this.path = nodePath; - this.dot = dot; - this.matchEx = buildMatcherFn2(this.patterns, this.options); - } - /** - * Check to see if a filename matches any of the globs. - * If filename is relative, it is considered relative to the root. - * If filename is absolute and contained within the root, it will be made relative before being tested for a glob match. - * If filename is absolute and not contained within the root, it will be tested as is. - * @param filename full path of the file to check. - */ - match(filename) { - return this.matchEx(filename).matched; - } - }; - exports.GlobMatcher = GlobMatcher2; - function buildMatcherFn2(patterns, options) { - const { nodePath: path16, dot, nobrace } = options; - const makeReOptions = { dot, nobrace }; - const rules = patterns.map((pattern, index) => ({ pattern, index })).filter((r) => !!r.pattern.glob).filter((r) => !r.pattern.glob.startsWith("#")).map(({ pattern, index }) => { - const matchNeg = pattern.glob.match(/^!/); - const glob2 = pattern.glob.replace(/^!/, ""); - const isNeg = matchNeg && matchNeg[0].length & 1 && true || false; - const reg = micromatch_1.default.makeRe(glob2, makeReOptions); - const fn2 = (filename) => { - const match = filename.match(reg); - return !!match; - }; - return { pattern, index, isNeg, fn: fn2, reg }; - }); - const negRules = rules.filter((r) => r.isNeg); - const posRules = rules.filter((r) => !r.isNeg); - const fn = (filename) => { - filename = path16.resolve(path16.normalize(filename)); - function testRules(rules2, matched) { - for (const rule of rules2) { - const pattern = rule.pattern; - const root = pattern.root; - const isRelPat = !pattern.isGlobalPattern; - if (isRelPat && !(0, globHelper_js_1.doesRootContainPath)(root, filename, path16)) { - continue; - } - const relName = isRelPat ? path16.relative(root, filename) : filename; - const fname = path16.sep === "\\" ? relName.replace(/\\/g, "/") : relName; - if (rule.fn(fname)) { - return { - matched, - glob: pattern.glob, - root, - pattern, - index: rule.index, - isNeg: rule.isNeg - }; - } - } - } - return testRules(negRules, false) || testRules(posRules, true) || { matched: false }; - }; - return fn; - } - } -}); - -// node_modules/cspell-glob/dist/cjs/GlobMatcherTypes.js -var require_GlobMatcherTypes = __commonJS({ - "node_modules/cspell-glob/dist/cjs/GlobMatcherTypes.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - } -}); - -// node_modules/cspell-glob/dist/cjs/index.js -var require_cjs = __commonJS({ - "node_modules/cspell-glob/dist/cjs/index.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __exportStar = exports && exports.__exportStar || function(m, exports2) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) - __createBinding(exports2, m, p); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.GlobMatcher = exports.normalizeGlobPatterns = exports.isGlobPatternWithRoot = exports.isGlobPatternWithOptionalRoot = exports.isGlobPatternNormalized = exports.fileOrGlobToGlob = void 0; - var globHelper_js_1 = require_globHelper(); - Object.defineProperty(exports, "fileOrGlobToGlob", { enumerable: true, get: function() { - return globHelper_js_1.fileOrGlobToGlob; - } }); - Object.defineProperty(exports, "isGlobPatternNormalized", { enumerable: true, get: function() { - return globHelper_js_1.isGlobPatternNormalized; - } }); - Object.defineProperty(exports, "isGlobPatternWithOptionalRoot", { enumerable: true, get: function() { - return globHelper_js_1.isGlobPatternWithOptionalRoot; - } }); - Object.defineProperty(exports, "isGlobPatternWithRoot", { enumerable: true, get: function() { - return globHelper_js_1.isGlobPatternWithRoot; - } }); - Object.defineProperty(exports, "normalizeGlobPatterns", { enumerable: true, get: function() { - return globHelper_js_1.normalizeGlobPatterns; - } }); - var GlobMatcher_js_1 = require_GlobMatcher(); - Object.defineProperty(exports, "GlobMatcher", { enumerable: true, get: function() { - return GlobMatcher_js_1.GlobMatcher; - } }); - __exportStar(require_GlobMatcherTypes(), exports); - } -}); - -// node_modules/cspell-lib/dist/cjs/util/Uri.js -var require_Uri = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/Uri.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.from = exports.resolvePath = exports.joinPath = exports.extname = exports.dirname = exports.basename = exports.isUri = exports.normalizeDriveLetter = exports.parse = exports.file = exports.fromStdinFilePath = exports.fromFilePath = exports.uriToFilePath = exports.toUri = void 0; - var assert_1 = __importDefault(require("assert")); - var vscode_uri_1 = require_umd(); - var isFile = /^(?:[a-zA-Z]:|[/\\])/; - var isPossibleUri = /\w:\/\//; - var isUrl = /^(file:|stdin:|https?:|s?ftp:)/; - var STDIN_PROTOCOL = "stdin:"; - function toUri(uriOrFile) { - if (UriImpl.isUri(uriOrFile)) - return uriOrFile; - if (vscode_uri_1.URI.isUri(uriOrFile)) - return UriImpl.from(uriOrFile); - if (uriOrFile instanceof URL) - return UriImpl.parse(uriOrFile.toString()); - if (isUrlLike2(uriOrFile)) - return UriImpl.parse(uriOrFile.href); - if (isUri(uriOrFile)) - return UriImpl.from(uriOrFile); - if (isUrl.test(uriOrFile)) - return UriImpl.parse(uriOrFile); - return isFile.test(uriOrFile) && !isPossibleUri.test(uriOrFile) ? UriImpl.file(normalizeDriveLetter(uriOrFile)) : UriImpl.parse(uriOrFile); - } - exports.toUri = toUri; - var hasDriveLetter = /^[A-Z]:/i; - function uriToFilePath(uri) { - const adj = uri.scheme === "stdin" ? { scheme: "file" } : {}; - return normalizeDriveLetter(vscode_uri_1.URI.from(UriImpl.from(uri, adj)).fsPath); - } - exports.uriToFilePath = uriToFilePath; - function fromFilePath(file) { - return UriImpl.file(file); - } - exports.fromFilePath = fromFilePath; - function fromStdinFilePath(path16) { - return UriImpl.stdin(path16); - } - exports.fromStdinFilePath = fromStdinFilePath; - exports.file = fromFilePath; - function parse3(uri) { - return UriImpl.parse(uri); - } - exports.parse = parse3; - function normalizeDriveLetter(path16) { - return hasDriveLetter.test(path16) ? path16[0].toLowerCase() + path16.slice(1) : path16; - } - exports.normalizeDriveLetter = normalizeDriveLetter; - function isUrlLike2(url) { - return !!url && typeof url === "object" && typeof url.href === "string" || false; - } - function isUri(uri) { - if (!uri || typeof uri !== "object") - return false; - if (UriImpl.isUri(uri)) - return true; - if (vscode_uri_1.URI.isUri(uri)) - return true; - const u = uri; - return typeof u.path === "string" && typeof u.scheme === "string"; - } - exports.isUri = isUri; - function basename3(uri) { - return vscode_uri_1.Utils.basename(vscode_uri_1.URI.from(uri)); - } - exports.basename = basename3; - function dirname6(uri) { - return UriImpl.from(vscode_uri_1.Utils.dirname(vscode_uri_1.URI.from(uri))); - } - exports.dirname = dirname6; - function extname(uri) { - return vscode_uri_1.Utils.extname(vscode_uri_1.URI.from(uri)); - } - exports.extname = extname; - function joinPath(uri, ...paths) { - return UriImpl.from(vscode_uri_1.Utils.joinPath(vscode_uri_1.URI.from(uri), ...paths)); - } - exports.joinPath = joinPath; - function resolvePath2(uri, ...paths) { - return UriImpl.from(vscode_uri_1.Utils.resolvePath(vscode_uri_1.URI.from(uri), ...paths)); - } - exports.resolvePath = resolvePath2; - function from(uri, ...parts) { - return UriImpl.from(uri, ...parts); - } - exports.from = from; - var keys = ["scheme", "authority", "path", "query", "fragment"]; - var UriImpl = class _UriImpl { - constructor(uri) { - this.scheme = uri.scheme || ""; - uri.authority && (this.authority = uri.authority); - this.path = uri.path || ""; - uri.query && (this.query = uri.query); - uri.fragment && (this.fragment = uri.fragment); - } - toString() { - const path16 = this.path; - const base = `${this.scheme}://${this.authority || ""}${path16}`; - const query = this.query && `?${this.query}` || ""; - const fragment = this.fragment && `#${this.fragment}` || ""; - const url = base + query + fragment; - return encodeURI(url); - } - toJson() { - const { scheme, authority, path: path16, query, fragment } = this; - return { scheme, authority, path: path16, query, fragment }; - } - with(change) { - const { scheme, authority, path: path16, query, fragment } = this; - const u = { scheme, authority, path: path16, query, fragment }; - for (const key of keys) { - if (change[key] && typeof change[key] === "string") { - u[key] = change[key]; - } - } - return new _UriImpl(u); - } - static isUri(uri) { - return uri instanceof _UriImpl; - } - static from(uri, ...parts) { - let u = new _UriImpl(uri); - for (const part of parts) { - u = u.with(part); - } - return u; - } - static parse(uri) { - if (uri.startsWith(STDIN_PROTOCOL)) { - return _UriImpl.from(parseStdinUri(uri)); - } - const u = vscode_uri_1.URI.parse(uri); - return _UriImpl.from(u); - } - static file(filename) { - return _UriImpl.from(vscode_uri_1.URI.file(normalizeFilePath(filename))); - } - static stdin(filePath = "") { - return _UriImpl.from(_UriImpl.file(filePath), { scheme: "stdin" }); - } - }; - function normalizeFilePath(path16) { - return normalizeDriveLetter(path16.replace(/\\/g, "/")); - } - function parseStdinUri(uri) { - (0, assert_1.default)(uri.startsWith(STDIN_PROTOCOL)); - const idxSlash = STDIN_PROTOCOL.length; - let idxSlashEnd = idxSlash; - for (; uri[idxSlashEnd] === "/"; ++idxSlashEnd) { - } - const pathStart = idxSlashEnd; - const iH = uri.indexOf("#", pathStart); - const idxHash = iH > 0 ? iH : uri.length; - const iQ = uri.indexOf("?", pathStart); - const idxQ = iQ > 0 && iQ < idxHash ? iQ : idxHash; - const pathEnd = idxQ; - const path16 = uri.slice(pathStart, pathEnd); - const query = idxQ < idxHash ? uri.slice(idxQ + 1, idxHash) : ""; - const hash = uri.slice(idxHash + 1); - const pathPrefix = idxSlashEnd - idxSlash > 2 ? "/" : ""; - return { - scheme: "stdin", - path: pathPrefix + normalizeFilePath(decodeURI(path16)), - query: decodeURI(query), - fragment: decodeURI(hash) - }; - } - exports.__testing__ = { - UriImpl, - normalizeFilePath - }; - } -}); - -// node_modules/cspell-lib/dist/cjs/exclusionHelper.js -var require_exclusionHelper = __commonJS({ - "node_modules/cspell-lib/dist/cjs/exclusionHelper.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.generateExclusionFunctionForFiles = exports.generateExclusionFunctionForUri = exports.extractGlobsFromExcludeFilesGlobMap = void 0; - var cspell_glob_1 = require_cjs(); - var Uri_js_1 = require_Uri(); - var defaultAllowedSchemes = /* @__PURE__ */ new Set(["file", "untitled"]); - function extractGlobsFromExcludeFilesGlobMap(globMap) { - const globs = Object.getOwnPropertyNames(globMap).filter((glob2) => globMap[glob2]); - return globs; - } - exports.extractGlobsFromExcludeFilesGlobMap = extractGlobsFromExcludeFilesGlobMap; - var leadingGlobPattern = /^\*\*\/([^/*{}]+)$/; - function adjustGlobPatternForBackwardsCompatibility(g) { - return g.replace(leadingGlobPattern, "**/{$1,$1/**}"); - } - function adjustGlobPatternsForBackwardsCompatibility(globs) { - return globs.map((g) => { - if (typeof g === "string") { - return adjustGlobPatternForBackwardsCompatibility(g); - } - return { ...g, glob: adjustGlobPatternForBackwardsCompatibility(g.glob) }; - }); - } - function generateExclusionFunctionForUri(globs, root, allowedSchemes = defaultAllowedSchemes) { - const adjustedGlobs = adjustGlobPatternsForBackwardsCompatibility(globs); - const matchFn = generateExclusionFunctionForFiles(adjustedGlobs, root); - function testUri(uri) { - if (!allowedSchemes.has(uri.scheme)) { - return true; - } - return matchFn(uri.scheme === "file" || uri.scheme === "stdin" ? (0, Uri_js_1.uriToFilePath)(uri) : uri.path); - } - function testUriPath(uriPath) { - const uri = (0, Uri_js_1.toUri)(uriPath); - return testUri(uri); - } - return testUriPath; - } - exports.generateExclusionFunctionForUri = generateExclusionFunctionForUri; - function generateExclusionFunctionForFiles(globs, root) { - const matcher = new cspell_glob_1.GlobMatcher(globs, { root, dot: true }); - return (file) => matcher.match(file); - } - exports.generateExclusionFunctionForFiles = generateExclusionFunctionForFiles; - } -}); - -// node_modules/cspell-lib/dist/cjs/util/util.js -var require_util = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/util.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isRecordEqual = exports.doSetsIntersect = exports.isArrayEqual = exports.asyncIterableToArray = exports.isDefined = exports.scanMap = exports.clean = exports.unique = exports.uniqueFilterFnGenerator = exports.uniqueFn = void 0; - exports.uniqueFn = uniqueFilterFnGenerator2; - function uniqueFilterFnGenerator2(extractFn) { - const values = /* @__PURE__ */ new Set(); - const extractor = extractFn || ((a) => a); - return (v) => { - const vv = extractor(v); - const ret = !values.has(vv); - values.add(vv); - return ret; - }; - } - exports.uniqueFilterFnGenerator = uniqueFilterFnGenerator2; - function unique(src) { - return [...new Set(src)]; - } - exports.unique = unique; - function clean2(src) { - const r = src; - for (const key of Object.keys(r)) { - if (r[key] === void 0 || r[key] === null) { - delete r[key]; - } - } - return r; - } - exports.clean = clean2; - function scanMap(accFn, init) { - let acc = init; - let first = true; - return function(value) { - if (first && acc === void 0) { - first = false; - acc = value; - return acc; - } - acc = accFn(acc, value); - return acc; - }; - } - exports.scanMap = scanMap; - function isDefined2(v) { - return v !== void 0; - } - exports.isDefined = isDefined2; - async function asyncIterableToArray2(iter) { - const acc = []; - for await (const t of iter) { - acc.push(t); - } - return acc; - } - exports.asyncIterableToArray = asyncIterableToArray2; - function isArrayEqual(a, b) { - if (a === b) - return true; - let isMatch = a.length === b.length; - for (let i = 0; i < a.length && isMatch; ++i) { - isMatch = a[i] === b[i]; - } - return isMatch; - } - exports.isArrayEqual = isArrayEqual; - function doSetsIntersect(a, b) { - function compare2(a2, b2) { - for (const item of a2) { - if (b2.has(item)) - return true; - } - return false; - } - return a.size <= b.size ? compare2(a, b) : compare2(b, a); - } - exports.doSetsIntersect = doSetsIntersect; - function isRecordEqual(a, b) { - if (a === b) - return true; - if (a === void 0 || b === void 0) - return false; - for (const key of Object.keys(a)) { - if (a[key] !== b[key]) - return false; - } - for (const key of Object.keys(b)) { - if (a[key] !== b[key]) - return false; - } - return true; - } - exports.isRecordEqual = isRecordEqual; + exports.Utils = exports.URI = void 0; + var vscodeUriPkg = __importStar(require_umd()); + exports.URI = vscodeUriPkg.URI, exports.Utils = vscodeUriPkg.Utils; } }); @@ -13751,7 +13042,7 @@ var require_esprima = __commonJS({ var jsx_parser_1 = __webpack_require__(3); var parser_1 = __webpack_require__(8); var tokenizer_1 = __webpack_require__(15); - function parse3(code, options, delegate) { + function parse4(code, options, delegate) { var commentHandler = null; var proxyDelegate = function(node, metadata) { if (delegate) { @@ -13777,36 +13068,36 @@ var require_esprima = __commonJS({ if (options && typeof options.sourceType === "string") { isModule = options.sourceType === "module"; } - var parser; + var parser2; if (options && typeof options.jsx === "boolean" && options.jsx) { - parser = new jsx_parser_1.JSXParser(code, options, parserDelegate); + parser2 = new jsx_parser_1.JSXParser(code, options, parserDelegate); } else { - parser = new parser_1.Parser(code, options, parserDelegate); + parser2 = new parser_1.Parser(code, options, parserDelegate); } - var program = isModule ? parser.parseModule() : parser.parseScript(); + var program = isModule ? parser2.parseModule() : parser2.parseScript(); var ast = program; if (collectComment && commentHandler) { ast.comments = commentHandler.comments; } - if (parser.config.tokens) { - ast.tokens = parser.tokens; + if (parser2.config.tokens) { + ast.tokens = parser2.tokens; } - if (parser.config.tolerant) { - ast.errors = parser.errorHandler.errors; + if (parser2.config.tolerant) { + ast.errors = parser2.errorHandler.errors; } return ast; } - exports2.parse = parse3; + exports2.parse = parse4; function parseModule(code, options, delegate) { var parsingOptions = options || {}; parsingOptions.sourceType = "module"; - return parse3(code, parsingOptions, delegate); + return parse4(code, parsingOptions, delegate); } exports2.parseModule = parseModule; function parseScript(code, options, delegate) { var parsingOptions = options || {}; parsingOptions.sourceType = "script"; - return parse3(code, parsingOptions, delegate); + return parse4(code, parsingOptions, delegate); } exports2.parseScript = parseScript; function tokenize(code, options, delegate) { @@ -13902,8 +13193,8 @@ var require_esprima = __commonJS({ } } if (target) { - var count = target.leadingComments ? target.leadingComments.length : 0; - for (var i = count - 1; i >= 0; --i) { + var count3 = target.leadingComments ? target.leadingComments.length : 0; + for (var i = count3 - 1; i >= 0; --i) { var comment = target.leadingComments[i]; if (comment.range[1] <= metadata.start.offset) { leadingComments.unshift(comment); @@ -14083,7 +13374,7 @@ var require_esprima = __commonJS({ var character_1 = __webpack_require__(4); var JSXNode = __webpack_require__(5); var jsx_syntax_1 = __webpack_require__(6); - var Node = __webpack_require__(7); + var Node2 = __webpack_require__(7); var parser_1 = __webpack_require__(8); var token_1 = __webpack_require__(13); var xhtml_entities_1 = __webpack_require__(14); @@ -14399,7 +13690,7 @@ var require_esprima = __commonJS({ this.throwUnexpectedToken(token); } var raw = this.getTokenRaw(token); - return this.finalize(node, new Node.Literal(token.value, raw)); + return this.finalize(node, new Node2.Literal(token.value, raw)); }; JSXParser2.prototype.parseJSXExpressionAttribute = function() { var node = this.createJSXNode(); @@ -15425,7 +14716,7 @@ var require_esprima = __commonJS({ var assert_1 = __webpack_require__(9); var error_handler_1 = __webpack_require__(10); var messages_1 = __webpack_require__(11); - var Node = __webpack_require__(7); + var Node2 = __webpack_require__(7); var scanner_1 = __webpack_require__(12); var syntax_1 = __webpack_require__(2); var token_1 = __webpack_require__(13); @@ -15527,9 +14818,9 @@ var require_esprima = __commonJS({ values[_i - 1] = arguments[_i]; } var args = Array.prototype.slice.call(arguments, 1); - var msg = messageFormat.replace(/%(\d)/g, function(whole, idx) { - assert_1.assert(idx < args.length, "Message reference must be in range"); - return args[idx]; + var msg = messageFormat.replace(/%(\d)/g, function(whole, idx2) { + assert_1.assert(idx2 < args.length, "Message reference must be in range"); + return args[idx2]; }); var index = this.lastMarker.index; var line = this.lastMarker.line; @@ -15542,9 +14833,9 @@ var require_esprima = __commonJS({ values[_i - 1] = arguments[_i]; } var args = Array.prototype.slice.call(arguments, 1); - var msg = messageFormat.replace(/%(\d)/g, function(whole, idx) { - assert_1.assert(idx < args.length, "Message reference must be in range"); - return args[idx]; + var msg = messageFormat.replace(/%(\d)/g, function(whole, idx2) { + assert_1.assert(idx2 < args.length, "Message reference must be in range"); + return args[idx2]; }); var index = this.lastMarker.index; var line = this.scanner.lineNumber; @@ -15842,7 +15133,7 @@ var require_esprima = __commonJS({ if ((this.context.isModule || this.context.await) && this.lookahead.value === "await") { this.tolerateUnexpectedToken(this.lookahead); } - expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node.Identifier(this.nextToken().value)); + expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node2.Identifier(this.nextToken().value)); break; case 6: case 8: @@ -15853,21 +15144,21 @@ var require_esprima = __commonJS({ this.context.isBindingElement = false; token = this.nextToken(); raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.Literal(token.value, raw)); + expr = this.finalize(node, new Node2.Literal(token.value, raw)); break; case 1: this.context.isAssignmentTarget = false; this.context.isBindingElement = false; token = this.nextToken(); raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.Literal(token.value === "true", raw)); + expr = this.finalize(node, new Node2.Literal(token.value === "true", raw)); break; case 5: this.context.isAssignmentTarget = false; this.context.isBindingElement = false; token = this.nextToken(); raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.Literal(null, raw)); + expr = this.finalize(node, new Node2.Literal(null, raw)); break; case 10: expr = this.parseTemplateLiteral(); @@ -15891,7 +15182,7 @@ var require_esprima = __commonJS({ this.scanner.index = this.startMarker.index; token = this.nextRegexToken(); raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.RegexLiteral(token.regex, raw, token.pattern, token.flags)); + expr = this.finalize(node, new Node2.RegexLiteral(token.regex, raw, token.pattern, token.flags)); break; default: expr = this.throwUnexpectedToken(this.nextToken()); @@ -15901,7 +15192,7 @@ var require_esprima = __commonJS({ if (!this.context.strict && this.context.allowYield && this.matchKeyword("yield")) { expr = this.parseIdentifierName(); } else if (!this.context.strict && this.matchKeyword("let")) { - expr = this.finalize(node, new Node.Identifier(this.nextToken().value)); + expr = this.finalize(node, new Node2.Identifier(this.nextToken().value)); } else { this.context.isAssignmentTarget = false; this.context.isBindingElement = false; @@ -15909,7 +15200,7 @@ var require_esprima = __commonJS({ expr = this.parseFunctionExpression(); } else if (this.matchKeyword("this")) { this.nextToken(); - expr = this.finalize(node, new Node.ThisExpression()); + expr = this.finalize(node, new Node2.ThisExpression()); } else if (this.matchKeyword("class")) { expr = this.parseClassExpression(); } else { @@ -15926,7 +15217,7 @@ var require_esprima = __commonJS({ var node = this.createNode(); this.expect("..."); var arg = this.inheritCoverGrammar(this.parseAssignmentExpression); - return this.finalize(node, new Node.SpreadElement(arg)); + return this.finalize(node, new Node2.SpreadElement(arg)); }; Parser2.prototype.parseArrayInitializer = function() { var node = this.createNode(); @@ -15952,7 +15243,7 @@ var require_esprima = __commonJS({ } } this.expect("]"); - return this.finalize(node, new Node.ArrayExpression(elements)); + return this.finalize(node, new Node2.ArrayExpression(elements)); }; Parser2.prototype.parsePropertyMethod = function(params) { this.context.isAssignmentTarget = false; @@ -15979,7 +15270,7 @@ var require_esprima = __commonJS({ var params = this.parseFormalParameters(); var method = this.parsePropertyMethod(params); this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); + return this.finalize(node, new Node2.FunctionExpression(null, params.params, method, isGenerator)); }; Parser2.prototype.parsePropertyMethodAsyncFunction = function() { var node = this.createNode(); @@ -15991,7 +15282,7 @@ var require_esprima = __commonJS({ var method = this.parsePropertyMethod(params); this.context.allowYield = previousAllowYield; this.context.await = previousAwait; - return this.finalize(node, new Node.AsyncFunctionExpression(null, params.params, method)); + return this.finalize(node, new Node2.AsyncFunctionExpression(null, params.params, method)); }; Parser2.prototype.parseObjectPropertyKey = function() { var node = this.createNode(); @@ -16004,13 +15295,13 @@ var require_esprima = __commonJS({ this.tolerateUnexpectedToken(token, messages_1.Messages.StrictOctalLiteral); } var raw = this.getTokenRaw(token); - key = this.finalize(node, new Node.Literal(token.value, raw)); + key = this.finalize(node, new Node2.Literal(token.value, raw)); break; case 3: case 1: case 5: case 4: - key = this.finalize(node, new Node.Identifier(token.value)); + key = this.finalize(node, new Node2.Identifier(token.value)); break; case 7: if (token.value === "[") { @@ -16043,7 +15334,7 @@ var require_esprima = __commonJS({ this.nextToken(); computed = this.match("["); isAsync = !this.hasLineTerminator && id === "async" && !this.match(":") && !this.match("(") && !this.match("*") && !this.match(","); - key = isAsync ? this.parseObjectPropertyKey() : this.finalize(node, new Node.Identifier(id)); + key = isAsync ? this.parseObjectPropertyKey() : this.finalize(node, new Node2.Identifier(id)); } else if (this.match("*")) { this.nextToken(); } else { @@ -16086,13 +15377,13 @@ var require_esprima = __commonJS({ value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); method = true; } else if (token.type === 3) { - var id = this.finalize(node, new Node.Identifier(token.value)); + var id = this.finalize(node, new Node2.Identifier(token.value)); if (this.match("=")) { this.context.firstCoverInitializedNameError = this.lookahead; this.nextToken(); shorthand = true; var init = this.isolateCoverGrammar(this.parseAssignmentExpression); - value = this.finalize(node, new Node.AssignmentPattern(id, init)); + value = this.finalize(node, new Node2.AssignmentPattern(id, init)); } else { shorthand = true; value = id; @@ -16101,7 +15392,7 @@ var require_esprima = __commonJS({ this.throwUnexpectedToken(this.nextToken()); } } - return this.finalize(node, new Node.Property(kind, key, computed, value, method, shorthand)); + return this.finalize(node, new Node2.Property(kind, key, computed, value, method, shorthand)); }; Parser2.prototype.parseObjectInitializer = function() { var node = this.createNode(); @@ -16115,7 +15406,7 @@ var require_esprima = __commonJS({ } } this.expect("}"); - return this.finalize(node, new Node.ObjectExpression(properties)); + return this.finalize(node, new Node2.ObjectExpression(properties)); }; Parser2.prototype.parseTemplateHead = function() { assert_1.assert(this.lookahead.head, "Template literal must start with a template head"); @@ -16123,7 +15414,7 @@ var require_esprima = __commonJS({ var token = this.nextToken(); var raw = token.value; var cooked = token.cooked; - return this.finalize(node, new Node.TemplateElement({ raw, cooked }, token.tail)); + return this.finalize(node, new Node2.TemplateElement({ raw, cooked }, token.tail)); }; Parser2.prototype.parseTemplateElement = function() { if (this.lookahead.type !== 10) { @@ -16133,7 +15424,7 @@ var require_esprima = __commonJS({ var token = this.nextToken(); var raw = token.value; var cooked = token.cooked; - return this.finalize(node, new Node.TemplateElement({ raw, cooked }, token.tail)); + return this.finalize(node, new Node2.TemplateElement({ raw, cooked }, token.tail)); }; Parser2.prototype.parseTemplateLiteral = function() { var node = this.createNode(); @@ -16146,7 +15437,7 @@ var require_esprima = __commonJS({ quasi = this.parseTemplateElement(); quasis.push(quasi); } - return this.finalize(node, new Node.TemplateLiteral(quasis, expressions)); + return this.finalize(node, new Node2.TemplateLiteral(quasis, expressions)); }; Parser2.prototype.reinterpretExpressionAsPattern = function(expr) { switch (expr.type) { @@ -16260,7 +15551,7 @@ var require_esprima = __commonJS({ } } if (!arrow) { - expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); + expr = this.finalize(this.startNode(startToken), new Node2.SequenceExpression(expressions)); } } if (!arrow) { @@ -16327,7 +15618,7 @@ var require_esprima = __commonJS({ if (!this.isIdentifierName(token)) { this.throwUnexpectedToken(token); } - return this.finalize(node, new Node.Identifier(token.value)); + return this.finalize(node, new Node2.Identifier(token.value)); }; Parser2.prototype.parseNewExpression = function() { var node = this.createNode(); @@ -16338,14 +15629,14 @@ var require_esprima = __commonJS({ this.nextToken(); if (this.lookahead.type === 3 && this.context.inFunctionBody && this.lookahead.value === "target") { var property = this.parseIdentifierName(); - expr = new Node.MetaProperty(id, property); + expr = new Node2.MetaProperty(id, property); } else { this.throwUnexpectedToken(this.lookahead); } } else { var callee = this.isolateCoverGrammar(this.parseLeftHandSideExpression); var args = this.match("(") ? this.parseArguments() : []; - expr = new Node.NewExpression(callee, args); + expr = new Node2.NewExpression(callee, args); this.context.isAssignmentTarget = false; this.context.isBindingElement = false; } @@ -16384,7 +15675,7 @@ var require_esprima = __commonJS({ if (this.matchKeyword("super") && this.context.inFunctionBody) { expr = this.createNode(); this.nextToken(); - expr = this.finalize(expr, new Node.Super()); + expr = this.finalize(expr, new Node2.Super()); if (!this.match("(") && !this.match(".") && !this.match("[")) { this.throwUnexpectedToken(this.lookahead); } @@ -16397,13 +15688,13 @@ var require_esprima = __commonJS({ this.context.isAssignmentTarget = true; this.expect("."); var property = this.parseIdentifierName(); - expr = this.finalize(this.startNode(startToken), new Node.StaticMemberExpression(expr, property)); + expr = this.finalize(this.startNode(startToken), new Node2.StaticMemberExpression(expr, property)); } else if (this.match("(")) { var asyncArrow = maybeAsync && startToken.lineNumber === this.lookahead.lineNumber; this.context.isBindingElement = false; this.context.isAssignmentTarget = false; var args = asyncArrow ? this.parseAsyncArguments() : this.parseArguments(); - expr = this.finalize(this.startNode(startToken), new Node.CallExpression(expr, args)); + expr = this.finalize(this.startNode(startToken), new Node2.CallExpression(expr, args)); if (asyncArrow && this.match("=>")) { for (var i = 0; i < args.length; ++i) { this.reinterpretExpressionAsPattern(args[i]); @@ -16420,10 +15711,10 @@ var require_esprima = __commonJS({ this.expect("["); var property = this.isolateCoverGrammar(this.parseExpression); this.expect("]"); - expr = this.finalize(this.startNode(startToken), new Node.ComputedMemberExpression(expr, property)); + expr = this.finalize(this.startNode(startToken), new Node2.ComputedMemberExpression(expr, property)); } else if (this.lookahead.type === 10 && this.lookahead.head) { var quasi = this.parseTemplateLiteral(); - expr = this.finalize(this.startNode(startToken), new Node.TaggedTemplateExpression(expr, quasi)); + expr = this.finalize(this.startNode(startToken), new Node2.TaggedTemplateExpression(expr, quasi)); } else { break; } @@ -16437,7 +15728,7 @@ var require_esprima = __commonJS({ if (!this.match("[") && !this.match(".")) { this.throwUnexpectedToken(this.lookahead); } - return this.finalize(node, new Node.Super()); + return this.finalize(node, new Node2.Super()); }; Parser2.prototype.parseLeftHandSideExpression = function() { assert_1.assert(this.context.allowIn, "callee of new expression always allow in keyword."); @@ -16450,16 +15741,16 @@ var require_esprima = __commonJS({ this.expect("["); var property = this.isolateCoverGrammar(this.parseExpression); this.expect("]"); - expr = this.finalize(node, new Node.ComputedMemberExpression(expr, property)); + expr = this.finalize(node, new Node2.ComputedMemberExpression(expr, property)); } else if (this.match(".")) { this.context.isBindingElement = false; this.context.isAssignmentTarget = true; this.expect("."); var property = this.parseIdentifierName(); - expr = this.finalize(node, new Node.StaticMemberExpression(expr, property)); + expr = this.finalize(node, new Node2.StaticMemberExpression(expr, property)); } else if (this.lookahead.type === 10 && this.lookahead.head) { var quasi = this.parseTemplateLiteral(); - expr = this.finalize(node, new Node.TaggedTemplateExpression(expr, quasi)); + expr = this.finalize(node, new Node2.TaggedTemplateExpression(expr, quasi)); } else { break; } @@ -16480,7 +15771,7 @@ var require_esprima = __commonJS({ this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); } var prefix = true; - expr = this.finalize(node, new Node.UpdateExpression(token.value, expr, prefix)); + expr = this.finalize(node, new Node2.UpdateExpression(token.value, expr, prefix)); this.context.isAssignmentTarget = false; this.context.isBindingElement = false; } else { @@ -16497,7 +15788,7 @@ var require_esprima = __commonJS({ this.context.isBindingElement = false; var operator = this.nextToken().value; var prefix = false; - expr = this.finalize(this.startNode(startToken), new Node.UpdateExpression(operator, expr, prefix)); + expr = this.finalize(this.startNode(startToken), new Node2.UpdateExpression(operator, expr, prefix)); } } } @@ -16507,7 +15798,7 @@ var require_esprima = __commonJS({ var node = this.createNode(); this.nextToken(); var argument = this.parseUnaryExpression(); - return this.finalize(node, new Node.AwaitExpression(argument)); + return this.finalize(node, new Node2.AwaitExpression(argument)); }; Parser2.prototype.parseUnaryExpression = function() { var expr; @@ -16515,7 +15806,7 @@ var require_esprima = __commonJS({ var node = this.startNode(this.lookahead); var token = this.nextToken(); expr = this.inheritCoverGrammar(this.parseUnaryExpression); - expr = this.finalize(node, new Node.UnaryExpression(token.value, expr)); + expr = this.finalize(node, new Node2.UnaryExpression(token.value, expr)); if (this.context.strict && expr.operator === "delete" && expr.argument.type === syntax_1.Syntax.Identifier) { this.tolerateError(messages_1.Messages.StrictDelete); } @@ -16537,7 +15828,7 @@ var require_esprima = __commonJS({ this.context.isBindingElement = false; var left = expr; var right = this.isolateCoverGrammar(this.parseExponentiationExpression); - expr = this.finalize(this.startNode(startToken), new Node.BinaryExpression("**", left, right)); + expr = this.finalize(this.startNode(startToken), new Node2.BinaryExpression("**", left, right)); } return expr; }; @@ -16579,7 +15870,7 @@ var require_esprima = __commonJS({ left = stack.pop(); markers.pop(); var node = this.startNode(markers[markers.length - 1]); - stack.push(this.finalize(node, new Node.BinaryExpression(operator, left, right))); + stack.push(this.finalize(node, new Node2.BinaryExpression(operator, left, right))); } stack.push(this.nextToken().value); precedences.push(prec); @@ -16594,7 +15885,7 @@ var require_esprima = __commonJS({ var lastLineStart = lastMarker && lastMarker.lineStart; var node = this.startNode(marker, lastLineStart); var operator = stack[i - 1]; - expr = this.finalize(node, new Node.BinaryExpression(operator, stack[i - 2], expr)); + expr = this.finalize(node, new Node2.BinaryExpression(operator, stack[i - 2], expr)); i -= 2; lastMarker = marker; } @@ -16612,7 +15903,7 @@ var require_esprima = __commonJS({ this.context.allowIn = previousAllowIn; this.expect(":"); var alternate = this.isolateCoverGrammar(this.parseAssignmentExpression); - expr = this.finalize(this.startNode(startToken), new Node.ConditionalExpression(expr, consequent, alternate)); + expr = this.finalize(this.startNode(startToken), new Node2.ConditionalExpression(expr, consequent, alternate)); this.context.isAssignmentTarget = false; this.context.isBindingElement = false; } @@ -16644,7 +15935,7 @@ var require_esprima = __commonJS({ default: break; } - options.simple = options.simple && param instanceof Node.Identifier; + options.simple = options.simple && param instanceof Node2.Identifier; }; Parser2.prototype.reinterpretAsCoverFormalsList = function(expr) { var params = [expr]; @@ -16756,7 +16047,7 @@ var require_esprima = __commonJS({ if (this.context.strict && list.stricted) { this.tolerateUnexpectedToken(list.stricted, list.message); } - expr = isAsync ? this.finalize(node, new Node.AsyncArrowFunctionExpression(list.params, body, expression)) : this.finalize(node, new Node.ArrowFunctionExpression(list.params, body, expression)); + expr = isAsync ? this.finalize(node, new Node2.AsyncArrowFunctionExpression(list.params, body, expression)) : this.finalize(node, new Node2.ArrowFunctionExpression(list.params, body, expression)); this.context.strict = previousStrict; this.context.allowStrictDirective = previousAllowStrictDirective; this.context.allowYield = previousAllowYield; @@ -16785,7 +16076,7 @@ var require_esprima = __commonJS({ token = this.nextToken(); var operator = token.value; var right = this.isolateCoverGrammar(this.parseAssignmentExpression); - expr = this.finalize(this.startNode(startToken), new Node.AssignmentExpression(operator, expr, right)); + expr = this.finalize(this.startNode(startToken), new Node2.AssignmentExpression(operator, expr, right)); this.context.firstCoverInitializedNameError = null; } } @@ -16805,7 +16096,7 @@ var require_esprima = __commonJS({ this.nextToken(); expressions.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); } - expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); + expr = this.finalize(this.startNode(startToken), new Node2.SequenceExpression(expressions)); } return expr; }; @@ -16859,7 +16150,7 @@ var require_esprima = __commonJS({ block.push(this.parseStatementListItem()); } this.expect("}"); - return this.finalize(node, new Node.BlockStatement(block)); + return this.finalize(node, new Node2.BlockStatement(block)); }; Parser2.prototype.parseLexicalBinding = function(kind, options) { var node = this.createNode(); @@ -16884,7 +16175,7 @@ var require_esprima = __commonJS({ this.expect("="); init = this.isolateCoverGrammar(this.parseAssignmentExpression); } - return this.finalize(node, new Node.VariableDeclarator(id, init)); + return this.finalize(node, new Node2.VariableDeclarator(id, init)); }; Parser2.prototype.parseBindingList = function(kind, options) { var list = [this.parseLexicalBinding(kind, options)]; @@ -16907,13 +16198,13 @@ var require_esprima = __commonJS({ assert_1.assert(kind === "let" || kind === "const", "Lexical declaration must be either let or const"); var declarations = this.parseBindingList(kind, options); this.consumeSemicolon(); - return this.finalize(node, new Node.VariableDeclaration(declarations, kind)); + return this.finalize(node, new Node2.VariableDeclaration(declarations, kind)); }; Parser2.prototype.parseBindingRestElement = function(params, kind) { var node = this.createNode(); this.expect("..."); var arg = this.parsePattern(params, kind); - return this.finalize(node, new Node.RestElement(arg)); + return this.finalize(node, new Node2.RestElement(arg)); }; Parser2.prototype.parseArrayPattern = function(params, kind) { var node = this.createNode(); @@ -16936,7 +16227,7 @@ var require_esprima = __commonJS({ } } this.expect("]"); - return this.finalize(node, new Node.ArrayPattern(elements)); + return this.finalize(node, new Node2.ArrayPattern(elements)); }; Parser2.prototype.parsePropertyPattern = function(params, kind) { var node = this.createNode(); @@ -16948,13 +16239,13 @@ var require_esprima = __commonJS({ if (this.lookahead.type === 3) { var keyToken = this.lookahead; key = this.parseVariableIdentifier(); - var init = this.finalize(node, new Node.Identifier(keyToken.value)); + var init = this.finalize(node, new Node2.Identifier(keyToken.value)); if (this.match("=")) { params.push(keyToken); shorthand = true; this.nextToken(); var expr = this.parseAssignmentExpression(); - value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init, expr)); + value = this.finalize(this.startNode(keyToken), new Node2.AssignmentPattern(init, expr)); } else if (!this.match(":")) { params.push(keyToken); shorthand = true; @@ -16969,7 +16260,7 @@ var require_esprima = __commonJS({ this.expect(":"); value = this.parsePatternWithDefault(params, kind); } - return this.finalize(node, new Node.Property("init", key, computed, value, method, shorthand)); + return this.finalize(node, new Node2.Property("init", key, computed, value, method, shorthand)); }; Parser2.prototype.parseObjectPattern = function(params, kind) { var node = this.createNode(); @@ -16982,7 +16273,7 @@ var require_esprima = __commonJS({ } } this.expect("}"); - return this.finalize(node, new Node.ObjectPattern(properties)); + return this.finalize(node, new Node2.ObjectPattern(properties)); }; Parser2.prototype.parsePattern = function(params, kind) { var pattern; @@ -17008,7 +16299,7 @@ var require_esprima = __commonJS({ this.context.allowYield = true; var right = this.isolateCoverGrammar(this.parseAssignmentExpression); this.context.allowYield = previousAllowYield; - pattern = this.finalize(this.startNode(startToken), new Node.AssignmentPattern(pattern, right)); + pattern = this.finalize(this.startNode(startToken), new Node2.AssignmentPattern(pattern, right)); } return pattern; }; @@ -17032,7 +16323,7 @@ var require_esprima = __commonJS({ } else if ((this.context.isModule || this.context.await) && token.type === 3 && token.value === "await") { this.tolerateUnexpectedToken(token); } - return this.finalize(node, new Node.Identifier(token.value)); + return this.finalize(node, new Node2.Identifier(token.value)); }; Parser2.prototype.parseVariableDeclaration = function(options) { var node = this.createNode(); @@ -17050,7 +16341,7 @@ var require_esprima = __commonJS({ } else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) { this.expect("="); } - return this.finalize(node, new Node.VariableDeclarator(id, init)); + return this.finalize(node, new Node2.VariableDeclarator(id, init)); }; Parser2.prototype.parseVariableDeclarationList = function(options) { var opt = { inFor: options.inFor }; @@ -17067,18 +16358,18 @@ var require_esprima = __commonJS({ this.expectKeyword("var"); var declarations = this.parseVariableDeclarationList({ inFor: false }); this.consumeSemicolon(); - return this.finalize(node, new Node.VariableDeclaration(declarations, "var")); + return this.finalize(node, new Node2.VariableDeclaration(declarations, "var")); }; Parser2.prototype.parseEmptyStatement = function() { var node = this.createNode(); this.expect(";"); - return this.finalize(node, new Node.EmptyStatement()); + return this.finalize(node, new Node2.EmptyStatement()); }; Parser2.prototype.parseExpressionStatement = function() { var node = this.createNode(); var expr = this.parseExpression(); this.consumeSemicolon(); - return this.finalize(node, new Node.ExpressionStatement(expr)); + return this.finalize(node, new Node2.ExpressionStatement(expr)); }; Parser2.prototype.parseIfClause = function() { if (this.context.strict && this.matchKeyword("function")) { @@ -17095,7 +16386,7 @@ var require_esprima = __commonJS({ var test = this.parseExpression(); if (!this.match(")") && this.config.tolerant) { this.tolerateUnexpectedToken(this.nextToken()); - consequent = this.finalize(this.createNode(), new Node.EmptyStatement()); + consequent = this.finalize(this.createNode(), new Node2.EmptyStatement()); } else { this.expect(")"); consequent = this.parseIfClause(); @@ -17104,7 +16395,7 @@ var require_esprima = __commonJS({ alternate = this.parseIfClause(); } } - return this.finalize(node, new Node.IfStatement(test, consequent, alternate)); + return this.finalize(node, new Node2.IfStatement(test, consequent, alternate)); }; Parser2.prototype.parseDoWhileStatement = function() { var node = this.createNode(); @@ -17124,7 +16415,7 @@ var require_esprima = __commonJS({ this.nextToken(); } } - return this.finalize(node, new Node.DoWhileStatement(body, test)); + return this.finalize(node, new Node2.DoWhileStatement(body, test)); }; Parser2.prototype.parseWhileStatement = function() { var node = this.createNode(); @@ -17134,7 +16425,7 @@ var require_esprima = __commonJS({ var test = this.parseExpression(); if (!this.match(")") && this.config.tolerant) { this.tolerateUnexpectedToken(this.nextToken()); - body = this.finalize(this.createNode(), new Node.EmptyStatement()); + body = this.finalize(this.createNode(), new Node2.EmptyStatement()); } else { this.expect(")"); var previousInIteration = this.context.inIteration; @@ -17142,7 +16433,7 @@ var require_esprima = __commonJS({ body = this.parseStatement(); this.context.inIteration = previousInIteration; } - return this.finalize(node, new Node.WhileStatement(test, body)); + return this.finalize(node, new Node2.WhileStatement(test, body)); }; Parser2.prototype.parseForStatement = function() { var init = null; @@ -17168,27 +16459,27 @@ var require_esprima = __commonJS({ if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) { this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, "for-in"); } - init = this.finalize(init, new Node.VariableDeclaration(declarations, "var")); + init = this.finalize(init, new Node2.VariableDeclaration(declarations, "var")); this.nextToken(); left = init; right = this.parseExpression(); init = null; } else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) { - init = this.finalize(init, new Node.VariableDeclaration(declarations, "var")); + init = this.finalize(init, new Node2.VariableDeclaration(declarations, "var")); this.nextToken(); left = init; right = this.parseAssignmentExpression(); init = null; forIn = false; } else { - init = this.finalize(init, new Node.VariableDeclaration(declarations, "var")); + init = this.finalize(init, new Node2.VariableDeclaration(declarations, "var")); this.expect(";"); } } else if (this.matchKeyword("const") || this.matchKeyword("let")) { init = this.createNode(); var kind = this.nextToken().value; if (!this.context.strict && this.lookahead.value === "in") { - init = this.finalize(init, new Node.Identifier(kind)); + init = this.finalize(init, new Node2.Identifier(kind)); this.nextToken(); left = init; right = this.parseExpression(); @@ -17199,13 +16490,13 @@ var require_esprima = __commonJS({ var declarations = this.parseBindingList(kind, { inFor: true }); this.context.allowIn = previousAllowIn; if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword("in")) { - init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); + init = this.finalize(init, new Node2.VariableDeclaration(declarations, kind)); this.nextToken(); left = init; right = this.parseExpression(); init = null; } else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) { - init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); + init = this.finalize(init, new Node2.VariableDeclaration(declarations, kind)); this.nextToken(); left = init; right = this.parseAssignmentExpression(); @@ -17213,7 +16504,7 @@ var require_esprima = __commonJS({ forIn = false; } else { this.consumeSemicolon(); - init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); + init = this.finalize(init, new Node2.VariableDeclaration(declarations, kind)); } } } else { @@ -17248,7 +16539,7 @@ var require_esprima = __commonJS({ this.nextToken(); initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); } - init = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq)); + init = this.finalize(this.startNode(initStartToken), new Node2.SequenceExpression(initSeq)); } this.expect(";"); } @@ -17266,7 +16557,7 @@ var require_esprima = __commonJS({ var body; if (!this.match(")") && this.config.tolerant) { this.tolerateUnexpectedToken(this.nextToken()); - body = this.finalize(this.createNode(), new Node.EmptyStatement()); + body = this.finalize(this.createNode(), new Node2.EmptyStatement()); } else { this.expect(")"); var previousInIteration = this.context.inIteration; @@ -17274,7 +16565,7 @@ var require_esprima = __commonJS({ body = this.isolateCoverGrammar(this.parseStatement); this.context.inIteration = previousInIteration; } - return typeof left === "undefined" ? this.finalize(node, new Node.ForStatement(init, test, update, body)) : forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) : this.finalize(node, new Node.ForOfStatement(left, right, body)); + return typeof left === "undefined" ? this.finalize(node, new Node2.ForStatement(init, test, update, body)) : forIn ? this.finalize(node, new Node2.ForInStatement(left, right, body)) : this.finalize(node, new Node2.ForOfStatement(left, right, body)); }; Parser2.prototype.parseContinueStatement = function() { var node = this.createNode(); @@ -17292,7 +16583,7 @@ var require_esprima = __commonJS({ if (label === null && !this.context.inIteration) { this.throwError(messages_1.Messages.IllegalContinue); } - return this.finalize(node, new Node.ContinueStatement(label)); + return this.finalize(node, new Node2.ContinueStatement(label)); }; Parser2.prototype.parseBreakStatement = function() { var node = this.createNode(); @@ -17310,7 +16601,7 @@ var require_esprima = __commonJS({ if (label === null && !this.context.inIteration && !this.context.inSwitch) { this.throwError(messages_1.Messages.IllegalBreak); } - return this.finalize(node, new Node.BreakStatement(label)); + return this.finalize(node, new Node2.BreakStatement(label)); }; Parser2.prototype.parseReturnStatement = function() { if (!this.context.inFunctionBody) { @@ -17321,7 +16612,7 @@ var require_esprima = __commonJS({ var hasArgument = !this.match(";") && !this.match("}") && !this.hasLineTerminator && this.lookahead.type !== 2 || this.lookahead.type === 8 || this.lookahead.type === 10; var argument = hasArgument ? this.parseExpression() : null; this.consumeSemicolon(); - return this.finalize(node, new Node.ReturnStatement(argument)); + return this.finalize(node, new Node2.ReturnStatement(argument)); }; Parser2.prototype.parseWithStatement = function() { if (this.context.strict) { @@ -17334,12 +16625,12 @@ var require_esprima = __commonJS({ var object = this.parseExpression(); if (!this.match(")") && this.config.tolerant) { this.tolerateUnexpectedToken(this.nextToken()); - body = this.finalize(this.createNode(), new Node.EmptyStatement()); + body = this.finalize(this.createNode(), new Node2.EmptyStatement()); } else { this.expect(")"); body = this.parseStatement(); } - return this.finalize(node, new Node.WithStatement(object, body)); + return this.finalize(node, new Node2.WithStatement(object, body)); }; Parser2.prototype.parseSwitchCase = function() { var node = this.createNode(); @@ -17359,7 +16650,7 @@ var require_esprima = __commonJS({ } consequent.push(this.parseStatementListItem()); } - return this.finalize(node, new Node.SwitchCase(test, consequent)); + return this.finalize(node, new Node2.SwitchCase(test, consequent)); }; Parser2.prototype.parseSwitchStatement = function() { var node = this.createNode(); @@ -17387,7 +16678,7 @@ var require_esprima = __commonJS({ } this.expect("}"); this.context.inSwitch = previousInSwitch; - return this.finalize(node, new Node.SwitchStatement(discriminant, cases)); + return this.finalize(node, new Node2.SwitchStatement(discriminant, cases)); }; Parser2.prototype.parseLabelledStatement = function() { var node = this.createNode(); @@ -17418,10 +16709,10 @@ var require_esprima = __commonJS({ body = this.parseStatement(); } delete this.context.labelSet[key]; - statement = new Node.LabeledStatement(id, body); + statement = new Node2.LabeledStatement(id, body); } else { this.consumeSemicolon(); - statement = new Node.ExpressionStatement(expr); + statement = new Node2.ExpressionStatement(expr); } return this.finalize(node, statement); }; @@ -17433,7 +16724,7 @@ var require_esprima = __commonJS({ } var argument = this.parseExpression(); this.consumeSemicolon(); - return this.finalize(node, new Node.ThrowStatement(argument)); + return this.finalize(node, new Node2.ThrowStatement(argument)); }; Parser2.prototype.parseCatchClause = function() { var node = this.createNode(); @@ -17459,7 +16750,7 @@ var require_esprima = __commonJS({ } this.expect(")"); var body = this.parseBlock(); - return this.finalize(node, new Node.CatchClause(param, body)); + return this.finalize(node, new Node2.CatchClause(param, body)); }; Parser2.prototype.parseFinallyClause = function() { this.expectKeyword("finally"); @@ -17474,13 +16765,13 @@ var require_esprima = __commonJS({ if (!handler && !finalizer) { this.throwError(messages_1.Messages.NoCatchOrFinally); } - return this.finalize(node, new Node.TryStatement(block, handler, finalizer)); + return this.finalize(node, new Node2.TryStatement(block, handler, finalizer)); }; Parser2.prototype.parseDebuggerStatement = function() { var node = this.createNode(); this.expectKeyword("debugger"); this.consumeSemicolon(); - return this.finalize(node, new Node.DebuggerStatement()); + return this.finalize(node, new Node2.DebuggerStatement()); }; Parser2.prototype.parseStatement = function() { var statement; @@ -17585,7 +16876,7 @@ var require_esprima = __commonJS({ this.context.inIteration = previousInIteration; this.context.inSwitch = previousInSwitch; this.context.inFunctionBody = previousInFunctionBody; - return this.finalize(node, new Node.BlockStatement(body)); + return this.finalize(node, new Node2.BlockStatement(body)); }; Parser2.prototype.validateParam = function(options, param, name) { var key = "$" + name; @@ -17626,7 +16917,7 @@ var require_esprima = __commonJS({ if (!this.match(")")) { this.throwError(messages_1.Messages.ParameterAfterRestParameter); } - return this.finalize(node, new Node.RestElement(arg)); + return this.finalize(node, new Node2.RestElement(arg)); }; Parser2.prototype.parseFormalParameter = function(options) { var params = []; @@ -17634,7 +16925,7 @@ var require_esprima = __commonJS({ for (var i = 0; i < params.length; i++) { this.validateParam(options, params[i], params[i].value); } - options.simple = options.simple && param instanceof Node.Identifier; + options.simple = options.simple && param instanceof Node2.Identifier; options.params.push(param); }; Parser2.prototype.parseFormalParameters = function(firstRestricted) { @@ -17668,15 +16959,15 @@ var require_esprima = __commonJS({ }; }; Parser2.prototype.matchAsyncFunction = function() { - var match = this.matchContextualKeyword("async"); - if (match) { + var match2 = this.matchContextualKeyword("async"); + if (match2) { var state = this.scanner.saveState(); this.scanner.scanComments(); var next = this.scanner.lex(); this.scanner.restoreState(state); - match = state.lineNumber === next.lineNumber && next.type === 4 && next.value === "function"; + match2 = state.lineNumber === next.lineNumber && next.type === 4 && next.value === "function"; } - return match; + return match2; }; Parser2.prototype.parseFunctionDeclaration = function(identifierIsOptional) { var node = this.createNode(); @@ -17734,7 +17025,7 @@ var require_esprima = __commonJS({ this.context.allowStrictDirective = previousAllowStrictDirective; this.context.await = previousAllowAwait; this.context.allowYield = previousAllowYield; - return isAsync ? this.finalize(node, new Node.AsyncFunctionDeclaration(id, params, body)) : this.finalize(node, new Node.FunctionDeclaration(id, params, body, isGenerator)); + return isAsync ? this.finalize(node, new Node2.AsyncFunctionDeclaration(id, params, body)) : this.finalize(node, new Node2.FunctionDeclaration(id, params, body, isGenerator)); }; Parser2.prototype.parseFunctionExpression = function() { var node = this.createNode(); @@ -17792,7 +17083,7 @@ var require_esprima = __commonJS({ this.context.allowStrictDirective = previousAllowStrictDirective; this.context.await = previousAllowAwait; this.context.allowYield = previousAllowYield; - return isAsync ? this.finalize(node, new Node.AsyncFunctionExpression(id, params, body)) : this.finalize(node, new Node.FunctionExpression(id, params, body, isGenerator)); + return isAsync ? this.finalize(node, new Node2.AsyncFunctionExpression(id, params, body)) : this.finalize(node, new Node2.FunctionExpression(id, params, body, isGenerator)); }; Parser2.prototype.parseDirective = function() { var token = this.lookahead; @@ -17800,7 +17091,7 @@ var require_esprima = __commonJS({ var expr = this.parseExpression(); var directive = expr.type === syntax_1.Syntax.Literal ? this.getTokenRaw(token).slice(1, -1) : null; this.consumeSemicolon(); - return this.finalize(node, directive ? new Node.Directive(expr, directive) : new Node.ExpressionStatement(expr)); + return this.finalize(node, directive ? new Node2.Directive(expr, directive) : new Node2.ExpressionStatement(expr)); }; Parser2.prototype.parseDirectivePrologues = function() { var firstRestricted = null; @@ -17859,7 +17150,7 @@ var require_esprima = __commonJS({ } var method = this.parsePropertyMethod(formalParameters); this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); + return this.finalize(node, new Node2.FunctionExpression(null, formalParameters.params, method, isGenerator)); }; Parser2.prototype.parseSetterMethod = function() { var node = this.createNode(); @@ -17869,12 +17160,12 @@ var require_esprima = __commonJS({ var formalParameters = this.parseFormalParameters(); if (formalParameters.params.length !== 1) { this.tolerateError(messages_1.Messages.BadSetterArity); - } else if (formalParameters.params[0] instanceof Node.RestElement) { + } else if (formalParameters.params[0] instanceof Node2.RestElement) { this.tolerateError(messages_1.Messages.BadSetterRestParameter); } var method = this.parsePropertyMethod(formalParameters); this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); + return this.finalize(node, new Node2.FunctionExpression(null, formalParameters.params, method, isGenerator)); }; Parser2.prototype.parseGeneratorMethod = function() { var node = this.createNode(); @@ -17885,7 +17176,7 @@ var require_esprima = __commonJS({ this.context.allowYield = false; var method = this.parsePropertyMethod(params); this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); + return this.finalize(node, new Node2.FunctionExpression(null, params.params, method, isGenerator)); }; Parser2.prototype.isStartOfExpression = function() { var start = true; @@ -17919,7 +17210,7 @@ var require_esprima = __commonJS({ } this.context.allowYield = previousAllowYield; } - return this.finalize(node, new Node.YieldExpression(argument, delegate)); + return this.finalize(node, new Node2.YieldExpression(argument, delegate)); }; Parser2.prototype.parseClassElement = function(hasConstructor) { var token = this.lookahead; @@ -18007,7 +17298,7 @@ var require_esprima = __commonJS({ kind = "constructor"; } } - return this.finalize(node, new Node.MethodDefinition(key, computed, value, kind, isStatic)); + return this.finalize(node, new Node2.MethodDefinition(key, computed, value, kind, isStatic)); }; Parser2.prototype.parseClassElementList = function() { var body = []; @@ -18026,7 +17317,7 @@ var require_esprima = __commonJS({ Parser2.prototype.parseClassBody = function() { var node = this.createNode(); var elementList = this.parseClassElementList(); - return this.finalize(node, new Node.ClassBody(elementList)); + return this.finalize(node, new Node2.ClassBody(elementList)); }; Parser2.prototype.parseClassDeclaration = function(identifierIsOptional) { var node = this.createNode(); @@ -18041,7 +17332,7 @@ var require_esprima = __commonJS({ } var classBody = this.parseClassBody(); this.context.strict = previousStrict; - return this.finalize(node, new Node.ClassDeclaration(id, superClass, classBody)); + return this.finalize(node, new Node2.ClassDeclaration(id, superClass, classBody)); }; Parser2.prototype.parseClassExpression = function() { var node = this.createNode(); @@ -18056,7 +17347,7 @@ var require_esprima = __commonJS({ } var classBody = this.parseClassBody(); this.context.strict = previousStrict; - return this.finalize(node, new Node.ClassExpression(id, superClass, classBody)); + return this.finalize(node, new Node2.ClassExpression(id, superClass, classBody)); }; Parser2.prototype.parseModule = function() { this.context.strict = true; @@ -18067,7 +17358,7 @@ var require_esprima = __commonJS({ while (this.lookahead.type !== 2) { body.push(this.parseStatementListItem()); } - return this.finalize(node, new Node.Module(body)); + return this.finalize(node, new Node2.Module(body)); }; Parser2.prototype.parseScript = function() { var node = this.createNode(); @@ -18075,7 +17366,7 @@ var require_esprima = __commonJS({ while (this.lookahead.type !== 2) { body.push(this.parseStatementListItem()); } - return this.finalize(node, new Node.Script(body)); + return this.finalize(node, new Node2.Script(body)); }; Parser2.prototype.parseModuleSpecifier = function() { var node = this.createNode(); @@ -18084,7 +17375,7 @@ var require_esprima = __commonJS({ } var token = this.nextToken(); var raw = this.getTokenRaw(token); - return this.finalize(node, new Node.Literal(token.value, raw)); + return this.finalize(node, new Node2.Literal(token.value, raw)); }; Parser2.prototype.parseImportSpecifier = function() { var node = this.createNode(); @@ -18107,7 +17398,7 @@ var require_esprima = __commonJS({ this.throwUnexpectedToken(this.nextToken()); } } - return this.finalize(node, new Node.ImportSpecifier(local, imported)); + return this.finalize(node, new Node2.ImportSpecifier(local, imported)); }; Parser2.prototype.parseNamedImports = function() { this.expect("{"); @@ -18124,7 +17415,7 @@ var require_esprima = __commonJS({ Parser2.prototype.parseImportDefaultSpecifier = function() { var node = this.createNode(); var local = this.parseIdentifierName(); - return this.finalize(node, new Node.ImportDefaultSpecifier(local)); + return this.finalize(node, new Node2.ImportDefaultSpecifier(local)); }; Parser2.prototype.parseImportNamespaceSpecifier = function() { var node = this.createNode(); @@ -18134,7 +17425,7 @@ var require_esprima = __commonJS({ } this.nextToken(); var local = this.parseIdentifierName(); - return this.finalize(node, new Node.ImportNamespaceSpecifier(local)); + return this.finalize(node, new Node2.ImportNamespaceSpecifier(local)); }; Parser2.prototype.parseImportDeclaration = function() { if (this.context.inFunctionBody) { @@ -18174,7 +17465,7 @@ var require_esprima = __commonJS({ src = this.parseModuleSpecifier(); } this.consumeSemicolon(); - return this.finalize(node, new Node.ImportDeclaration(specifiers, src)); + return this.finalize(node, new Node2.ImportDeclaration(specifiers, src)); }; Parser2.prototype.parseExportSpecifier = function() { var node = this.createNode(); @@ -18184,7 +17475,7 @@ var require_esprima = __commonJS({ this.nextToken(); exported = this.parseIdentifierName(); } - return this.finalize(node, new Node.ExportSpecifier(local, exported)); + return this.finalize(node, new Node2.ExportSpecifier(local, exported)); }; Parser2.prototype.parseExportDeclaration = function() { if (this.context.inFunctionBody) { @@ -18197,20 +17488,20 @@ var require_esprima = __commonJS({ this.nextToken(); if (this.matchKeyword("function")) { var declaration = this.parseFunctionDeclaration(true); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + exportDeclaration = this.finalize(node, new Node2.ExportDefaultDeclaration(declaration)); } else if (this.matchKeyword("class")) { var declaration = this.parseClassDeclaration(true); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + exportDeclaration = this.finalize(node, new Node2.ExportDefaultDeclaration(declaration)); } else if (this.matchContextualKeyword("async")) { var declaration = this.matchAsyncFunction() ? this.parseFunctionDeclaration(true) : this.parseAssignmentExpression(); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + exportDeclaration = this.finalize(node, new Node2.ExportDefaultDeclaration(declaration)); } else { if (this.matchContextualKeyword("from")) { this.throwError(messages_1.Messages.UnexpectedToken, this.lookahead.value); } var declaration = this.match("{") ? this.parseObjectInitializer() : this.match("[") ? this.parseArrayInitializer() : this.parseAssignmentExpression(); this.consumeSemicolon(); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + exportDeclaration = this.finalize(node, new Node2.ExportDefaultDeclaration(declaration)); } } else if (this.match("*")) { this.nextToken(); @@ -18221,7 +17512,7 @@ var require_esprima = __commonJS({ this.nextToken(); var src = this.parseModuleSpecifier(); this.consumeSemicolon(); - exportDeclaration = this.finalize(node, new Node.ExportAllDeclaration(src)); + exportDeclaration = this.finalize(node, new Node2.ExportAllDeclaration(src)); } else if (this.lookahead.type === 4) { var declaration = void 0; switch (this.lookahead.value) { @@ -18237,10 +17528,10 @@ var require_esprima = __commonJS({ default: this.throwUnexpectedToken(this.lookahead); } - exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); + exportDeclaration = this.finalize(node, new Node2.ExportNamedDeclaration(declaration, [], null)); } else if (this.matchAsyncFunction()) { var declaration = this.parseFunctionDeclaration(); - exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); + exportDeclaration = this.finalize(node, new Node2.ExportNamedDeclaration(declaration, [], null)); } else { var specifiers = []; var source = null; @@ -18264,7 +17555,7 @@ var require_esprima = __commonJS({ } else { this.consumeSemicolon(); } - exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(null, specifiers, source)); + exportDeclaration = this.finalize(node, new Node2.ExportNamedDeclaration(null, specifiers, source)); } return exportDeclaration; }; @@ -18277,12 +17568,12 @@ var require_esprima = __commonJS({ function(module3, exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - function assert7(condition, message) { + function assert20(condition, message) { if (!condition) { throw new Error("ASSERT: " + message); } } - exports2.assert = assert7; + exports2.assert = assert20; }, /* 10 */ /***/ @@ -18693,8 +17984,8 @@ var require_esprima = __commonJS({ if (cp >= 55296 && cp <= 56319) { var second = this.source.charCodeAt(i + 1); if (second >= 56320 && second <= 57343) { - var first = cp; - cp = (first - 55296) * 1024 + second - 56320 + 65536; + var first3 = cp; + cp = (first3 - 55296) * 1024 + second - 56320 + 65536; } } return cp; @@ -19941,15 +19232,15 @@ var require_esprima = __commonJS({ }); // node_modules/core-util-is/lib/util.js -var require_util2 = __commonJS({ +var require_util = __commonJS({ "node_modules/core-util-is/lib/util.js"(exports) { - function isArray(arg) { + function isArray2(arg) { if (Array.isArray) { return Array.isArray(arg); } return objectToString(arg) === "[object Array]"; } - exports.isArray = isArray; + exports.isArray = isArray2; function isBoolean(arg) { return typeof arg === "boolean"; } @@ -19966,10 +19257,10 @@ var require_util2 = __commonJS({ return typeof arg === "number"; } exports.isNumber = isNumber; - function isString2(arg) { + function isString3(arg) { return typeof arg === "string"; } - exports.isString = isString2; + exports.isString = isString3; function isSymbol(arg) { return typeof arg === "symbol"; } @@ -19990,10 +19281,10 @@ var require_util2 = __commonJS({ return objectToString(d) === "[object Date]"; } exports.isDate = isDate; - function isError4(e) { + function isError6(e) { return objectToString(e) === "[object Error]" || e instanceof Error; } - exports.isError = isError4; + exports.isError = isError6; function isFunction(arg) { return typeof arg === "function"; } @@ -20069,19 +19360,19 @@ var require_src = __commonJS({ } return n + r; } - function makeAscendingRun(array, lo, hi, compare2) { + function makeAscendingRun(array, lo, hi, compare4) { let runHi = lo + 1; if (runHi === hi) { return 1; } - if (compare2(array[runHi++], array[lo]) < 0) { - while (runHi < hi && compare2(array[runHi], array[runHi - 1]) < 0) { + if (compare4(array[runHi++], array[lo]) < 0) { + while (runHi < hi && compare4(array[runHi], array[runHi - 1]) < 0) { runHi++; } reverseRun(array, lo, runHi); reverseRun(results, lo, runHi); } else { - while (runHi < hi && compare2(array[runHi], array[runHi - 1]) >= 0) { + while (runHi < hi && compare4(array[runHi], array[runHi - 1]) >= 0) { runHi++; } } @@ -20095,7 +19386,7 @@ var require_src = __commonJS({ array[hi--] = t; } } - function binaryInsertionSort(array, lo, hi, start, compare2) { + function binaryInsertionSort(array, lo, hi, start, compare4) { if (start === lo) { start++; } @@ -20106,7 +19397,7 @@ var require_src = __commonJS({ let right = start; while (left < right) { const mid = left + right >>> 1; - if (compare2(pivot, array[mid]) < 0) { + if (compare4(pivot, array[mid]) < 0) { right = mid; } else { left = mid + 1; @@ -20135,13 +19426,13 @@ var require_src = __commonJS({ results[left] = pivotIndex; } } - function gallopLeft(value, array, start, length, hint, compare2) { + function gallopLeft(value, array, start, length, hint, compare4) { let lastOffset = 0; let maxOffset = 0; let offset = 1; - if (compare2(value, array[start + hint]) > 0) { + if (compare4(value, array[start + hint]) > 0) { maxOffset = length - hint; - while (offset < maxOffset && compare2(value, array[start + hint + offset]) > 0) { + while (offset < maxOffset && compare4(value, array[start + hint + offset]) > 0) { lastOffset = offset; offset = (offset << 1) + 1; if (offset <= 0) { @@ -20155,7 +19446,7 @@ var require_src = __commonJS({ offset += hint; } else { maxOffset = hint + 1; - while (offset < maxOffset && compare2(value, array[start + hint - offset]) <= 0) { + while (offset < maxOffset && compare4(value, array[start + hint - offset]) <= 0) { lastOffset = offset; offset = (offset << 1) + 1; if (offset <= 0) { @@ -20172,7 +19463,7 @@ var require_src = __commonJS({ lastOffset++; while (lastOffset < offset) { const m = lastOffset + (offset - lastOffset >>> 1); - if (compare2(value, array[start + m]) > 0) { + if (compare4(value, array[start + m]) > 0) { lastOffset = m + 1; } else { offset = m; @@ -20180,13 +19471,13 @@ var require_src = __commonJS({ } return offset; } - function gallopRight(value, array, start, length, hint, compare2) { + function gallopRight(value, array, start, length, hint, compare4) { let lastOffset = 0; let maxOffset = 0; let offset = 1; - if (compare2(value, array[start + hint]) < 0) { + if (compare4(value, array[start + hint]) < 0) { maxOffset = hint + 1; - while (offset < maxOffset && compare2(value, array[start + hint - offset]) < 0) { + while (offset < maxOffset && compare4(value, array[start + hint - offset]) < 0) { lastOffset = offset; offset = (offset << 1) + 1; if (offset <= 0) { @@ -20201,7 +19492,7 @@ var require_src = __commonJS({ offset = hint - tmp; } else { maxOffset = length - hint; - while (offset < maxOffset && compare2(value, array[start + hint + offset]) >= 0) { + while (offset < maxOffset && compare4(value, array[start + hint + offset]) >= 0) { lastOffset = offset; offset = (offset << 1) + 1; if (offset <= 0) { @@ -20217,7 +19508,7 @@ var require_src = __commonJS({ lastOffset++; while (lastOffset < offset) { const m = lastOffset + (offset - lastOffset >>> 1); - if (compare2(value, array[start + m]) < 0) { + if (compare4(value, array[start + m]) < 0) { offset = m; } else { lastOffset = m + 1; @@ -20226,9 +19517,9 @@ var require_src = __commonJS({ return offset; } var TimSort = class { - constructor(array, compare2) { + constructor(array, compare4) { this.array = array; - this.compare = compare2; + this.compare = compare4; const { length } = array; this.length = length; this.minGallop = DEFAULT_MIN_GALLOPING; @@ -20288,7 +19579,7 @@ var require_src = __commonJS({ * @param {number} i - Index of the run to merge in TimSort's stack. */ mergeAt(i) { - const { compare: compare2 } = this; + const { compare: compare4 } = this; const { array } = this; let start1 = this.runStart[i]; let length1 = this.runLength[i]; @@ -20300,7 +19591,7 @@ var require_src = __commonJS({ this.runLength[i + 1] = this.runLength[i + 2]; } this.stackSize--; - const k = gallopRight(array[start2], array, start1, length1, 0, compare2); + const k = gallopRight(array[start2], array, start1, length1, 0, compare4); start1 += k; length1 -= k; if (length1 === 0) { @@ -20312,7 +19603,7 @@ var require_src = __commonJS({ start2, length2, length2 - 1, - compare2 + compare4 ); if (length2 === 0) { return; @@ -20337,7 +19628,7 @@ var require_src = __commonJS({ * @param {number} length2 - Length of run2. */ mergeLow(start1, length1, start2, length2) { - const { compare: compare2 } = this; + const { compare: compare4 } = this; const { array } = this; const { tmp } = this; const { tmpIndex } = this; @@ -20372,15 +19663,15 @@ var require_src = __commonJS({ let { minGallop } = this; while (true) { let count1 = 0; - let count2 = 0; + let count22 = 0; let exit = false; do { - if (compare2(array[cursor2], tmp[cursor1]) < 0) { + if (compare4(array[cursor2], tmp[cursor1]) < 0) { array[dest] = array[cursor2]; results[dest] = results[cursor2]; dest++; cursor2++; - count2++; + count22++; count1 = 0; if (--length2 === 0) { exit = true; @@ -20392,18 +19683,18 @@ var require_src = __commonJS({ dest++; cursor1++; count1++; - count2 = 0; + count22 = 0; if (--length1 === 1) { exit = true; break; } } - } while ((count1 | count2) < minGallop); + } while ((count1 | count22) < minGallop); if (exit) { break; } do { - count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare2); + count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare4); if (count1 !== 0) { for (i = 0; i < count1; i++) { array[dest + i] = tmp[cursor1 + i]; @@ -20425,15 +19716,15 @@ var require_src = __commonJS({ exit = true; break; } - count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare2); - if (count2 !== 0) { - for (i = 0; i < count2; i++) { + count22 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare4); + if (count22 !== 0) { + for (i = 0; i < count22; i++) { array[dest + i] = array[cursor2 + i]; results[dest + i] = results[cursor2 + i]; } - dest += count2; - cursor2 += count2; - length2 -= count2; + dest += count22; + cursor2 += count22; + length2 -= count22; if (length2 === 0) { exit = true; break; @@ -20448,7 +19739,7 @@ var require_src = __commonJS({ break; } minGallop--; - } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING); + } while (count1 >= DEFAULT_MIN_GALLOPING || count22 >= DEFAULT_MIN_GALLOPING); if (exit) { break; } @@ -20491,7 +19782,7 @@ var require_src = __commonJS({ * @param {number} length2 - Length of run2. */ mergeHigh(start1, length1, start2, length2) { - const { compare: compare2 } = this; + const { compare: compare4 } = this; const { array } = this; const { tmp } = this; const { tmpIndex } = this; @@ -20533,16 +19824,16 @@ var require_src = __commonJS({ let { minGallop } = this; while (true) { let count1 = 0; - let count2 = 0; + let count22 = 0; let exit = false; do { - if (compare2(tmp[cursor2], array[cursor1]) < 0) { + if (compare4(tmp[cursor2], array[cursor1]) < 0) { array[dest] = array[cursor1]; results[dest] = results[cursor1]; dest--; cursor1--; count1++; - count2 = 0; + count22 = 0; if (--length1 === 0) { exit = true; break; @@ -20552,14 +19843,14 @@ var require_src = __commonJS({ results[dest] = tmpIndex[cursor2]; dest--; cursor2--; - count2++; + count22++; count1 = 0; if (--length2 === 1) { exit = true; break; } } - } while ((count1 | count2) < minGallop); + } while ((count1 | count22) < minGallop); if (exit) { break; } @@ -20570,7 +19861,7 @@ var require_src = __commonJS({ start1, length1, length1 - 1, - compare2 + compare4 ); if (count1 !== 0) { dest -= count1; @@ -20595,21 +19886,21 @@ var require_src = __commonJS({ exit = true; break; } - count2 = length2 - gallopLeft( + count22 = length2 - gallopLeft( array[cursor1], tmp, 0, length2, length2 - 1, - compare2 + compare4 ); - if (count2 !== 0) { - dest -= count2; - cursor2 -= count2; - length2 -= count2; + if (count22 !== 0) { + dest -= count22; + cursor2 -= count22; + length2 -= count22; customDest = dest + 1; customCursor = cursor2 + 1; - for (i = 0; i < count2; i++) { + for (i = 0; i < count22; i++) { array[customDest + i] = tmp[customCursor + i]; results[customDest + i] = tmpIndex[customCursor + i]; } @@ -20627,7 +19918,7 @@ var require_src = __commonJS({ break; } minGallop--; - } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING); + } while (count1 >= DEFAULT_MIN_GALLOPING || count22 >= DEFAULT_MIN_GALLOPING); if (exit) { break; } @@ -20662,7 +19953,7 @@ var require_src = __commonJS({ } } }; - function sort(array, compare2, lo, hi) { + function sort(array, compare4, lo, hi) { if (!Array.isArray(array)) { throw new TypeError( `The "array" argument must be an array. Received ${array}` @@ -20674,12 +19965,12 @@ var require_src = __commonJS({ while (i < length) { results[i] = i++; } - if (!compare2) { - compare2 = alphabeticalCompare; - } else if (typeof compare2 !== "function") { + if (!compare4) { + compare4 = alphabeticalCompare; + } else if (typeof compare4 !== "function") { hi = lo; - lo = compare2; - compare2 = alphabeticalCompare; + lo = compare4; + compare4 = alphabeticalCompare; } if (!lo) { lo = 0; @@ -20693,20 +19984,20 @@ var require_src = __commonJS({ } let runLength = 0; if (remaining < DEFAULT_MIN_MERGE) { - runLength = makeAscendingRun(array, lo, hi, compare2); - binaryInsertionSort(array, lo, hi, lo + runLength, compare2); + runLength = makeAscendingRun(array, lo, hi, compare4); + binaryInsertionSort(array, lo, hi, lo + runLength, compare4); return results; } - const ts = new TimSort(array, compare2); + const ts = new TimSort(array, compare4); const minRun = minRunLength(remaining); do { - runLength = makeAscendingRun(array, lo, hi, compare2); + runLength = makeAscendingRun(array, lo, hi, compare4); if (runLength < minRun) { let force = remaining; if (force > minRun) { force = minRun; } - binaryInsertionSort(array, lo, lo + force, lo + runLength, compare2); + binaryInsertionSort(array, lo, lo + force, lo + runLength, compare4); runLength = force; } ts.pushRun(lo, runLength); @@ -20738,10 +20029,10 @@ var require_common = __commonJS({ var hasOwnProperty2 = require_has_own_prop(); var { isObject, - isArray, - isString: isString2, + isArray: isArray2, + isString: isString3, isNumber - } = require_util2(); + } = require_util(); var PREFIX_BEFORE = "before"; var PREFIX_AFTER_PROP = "after-prop"; var PREFIX_AFTER_COLON = "after-colon"; @@ -20823,9 +20114,9 @@ var require_common = __commonJS({ } }); }; - var assign = (target, source, keys) => { - keys.forEach((key) => { - if (!isString2(key) && !isNumber(key)) { + var assign2 = (target, source, keys2) => { + keys2.forEach((key) => { + if (!isString3(key) && !isNumber(key)) { return; } if (!hasOwnProperty2(source, key)) { @@ -20859,22 +20150,22 @@ var require_common = __commonJS({ copy_comments, swap_comments, assign_non_prop_comments, - assign(target, source, keys) { + assign(target, source, keys2) { if (!isObject(target)) { throw new TypeError("Cannot convert undefined or null to object"); } if (!isObject(source)) { return target; } - if (keys === UNDEFINED) { - keys = Object.keys(source); + if (keys2 === UNDEFINED) { + keys2 = Object.keys(source); assign_non_prop_comments(target, source); - } else if (!isArray(keys)) { + } else if (!isArray2(keys2)) { throw new TypeError("keys must be array or undefined"); - } else if (keys.length === 0) { + } else if (keys2.length === 0) { assign_non_prop_comments(target, source); } - return assign(target, source, keys); + return assign2(target, source, keys2); } }; } @@ -20883,7 +20174,7 @@ var require_common = __commonJS({ // node_modules/comment-json/src/array.js var require_array = __commonJS({ "node_modules/comment-json/src/array.js"(exports, module2) { - var { isArray } = require_util2(); + var { isArray: isArray2 } = require_util(); var { sort } = require_src(); var { SYMBOL_PREFIXES, @@ -20895,24 +20186,24 @@ var require_array = __commonJS({ var reverse_comments = (array) => { const { length } = array; let i = 0; - const max = length / 2; - for (; i < max; i++) { + const max4 = length / 2; + for (; i < max4; i++) { swap_comments(array, i, length - i - 1); } }; var move_comment = (target, source, i, offset, remove) => { copy_comments(target, source, i + offset, i, remove); }; - var move_comments = (target, source, start, count, offset, remove) => { + var move_comments = (target, source, start, count3, offset, remove) => { if (offset > 0) { - let i2 = count; + let i2 = count3; while (i2-- > 0) { move_comment(target, source, start + i2, offset, remove); } return; } let i = 0; - while (i < count) { + while (i < count3) { const ii = i++; move_comment(target, source, start + ii, offset, remove); } @@ -20923,10 +20214,10 @@ var require_array = __commonJS({ delete array[prop]; }); }; - var get_mapped = (map, key) => { + var get_mapped = (map3, key) => { let mapped = key; - while (mapped in map) { - mapped = map[mapped]; + while (mapped in map3) { + mapped = map3[mapped]; } return mapped; }; @@ -20953,8 +20244,8 @@ var require_array = __commonJS({ } = items; const offset = item_length - deleteCount; const start = begin + deleteCount; - const count = length - start; - move_comments(this, this, start, count, offset, true); + const count3 = length - start; + move_comments(this, this, start, count3, offset, true); return ret; } slice(...args) { @@ -21014,7 +20305,7 @@ var require_array = __commonJS({ move_comments(ret, this, 0, this.length, 0); items.forEach((item) => { const prev = length; - length += isArray(item) ? item.length : 1; + length += isArray2(item) ? item.length : 1; if (!(item instanceof _CommentArray)) { return; } @@ -21027,16 +20318,16 @@ var require_array = __commonJS({ this, ...args.slice(0, 1) ); - const map = /* @__PURE__ */ Object.create(null); + const map3 = /* @__PURE__ */ Object.create(null); result.forEach((source_index, index) => { if (source_index === index) { return; } - const real_source_index = get_mapped(map, source_index); + const real_source_index = get_mapped(map3, source_index); if (real_source_index === index) { return; } - map[index] = real_source_index; + map3[index] = real_source_index; swap_comments(this, index, real_source_index); }); return this; @@ -21091,20 +20382,20 @@ var require_parse3 = __commonJS({ var current = null; var index; var reviver = null; - var clean2 = () => { + var clean6 = () => { previous_props.length = previous_hosts.length = 0; last = null; last_prop = UNDEFINED; }; var free = () => { - clean2(); + clean6(); tokens.length = 0; unassigned_comments = comments_host = tokens = last = current = reviver = null; }; var symbolFor = (prefix) => Symbol.for( last_prop !== UNDEFINED ? prefix + COLON + last_prop : prefix ); - var transform = (k, v) => reviver ? reviver(k, v) : v; + var transform2 = (k, v) => reviver ? reviver(k, v) : v; var unexpected = () => { const error2 = new SyntaxError(`Unexpected token ${current.value.slice(0, 1)}`); Object.assign(error2, current.loc.start); @@ -21232,7 +20523,7 @@ var require_parse3 = __commonJS({ expect(COLON); next(); parse_comments(PREFIX_AFTER_COLON); - obj[name] = transform(name, walk()); + obj[name] = transform2(name, walk4()); parse_comments(); } if (started) { @@ -21268,7 +20559,7 @@ var require_parse3 = __commonJS({ started = true; set_prop(i); assign_comments(PREFIX_BEFORE); - array[i] = transform(i, walk()); + array[i] = transform2(i, walk4()); i++; parse_comments(); } @@ -21284,7 +20575,7 @@ var require_parse3 = __commonJS({ restore_prop(); return array; }; - function walk() { + function walk4() { let tt = type(); if (tt === CURLY_BRACKET_OPEN) { next(); @@ -21313,8 +20604,8 @@ var require_parse3 = __commonJS({ } } var isObject = (subject) => Object(subject) === subject; - var parse3 = (code, rev, no_comments) => { - clean2(); + var parse4 = (code, rev, no_comments) => { + clean6(); tokens = tokenize(code); reviver = rev; remove_comments = no_comments; @@ -21325,7 +20616,7 @@ var require_parse3 = __commonJS({ next(); set_comments_host({}); parse_comments(PREFIX_BEFORE_ALL); - let result = walk(); + let result = walk4(); parse_comments(PREFIX_AFTER_ALL); if (current) { unexpected(); @@ -21337,12 +20628,12 @@ var require_parse3 = __commonJS({ assign_non_prop_comments(result, comments_host); } restore_comments_host(); - result = transform("", result); + result = transform2("", result); free(); return result; }; module2.exports = { - parse: parse3, + parse: parse4, tokenize }; } @@ -21353,7 +20644,7 @@ var require_repeat_string = __commonJS({ "node_modules/repeat-string/index.js"(exports, module2) { "use strict"; var res = ""; - var cache; + var cache2; module2.exports = repeat; function repeat(str, num) { if (typeof str !== "string") { @@ -21363,14 +20654,14 @@ var require_repeat_string = __commonJS({ return str; if (num === 2) return str + str; - var max = str.length * num; - if (cache !== str || typeof cache === "undefined") { - cache = str; + var max4 = str.length * num; + if (cache2 !== str || typeof cache2 === "undefined") { + cache2 = str; res = ""; - } else if (res.length >= max) { - return res.substr(0, max); + } else if (res.length >= max4) { + return res.substr(0, max4); } - while (max > res.length && num > 1) { + while (max4 > res.length && num > 1) { if (num & 1) { res += str; } @@ -21378,7 +20669,7 @@ var require_repeat_string = __commonJS({ str += str; } res += str; - res = res.substr(0, max); + res = res.substr(0, max4); return res; } } @@ -21388,12 +20679,12 @@ var require_repeat_string = __commonJS({ var require_stringify2 = __commonJS({ "node_modules/comment-json/src/stringify.js"(exports, module2) { var { - isArray, + isArray: isArray2, isObject, isFunction, isNumber, - isString: isString2 - } = require_util2(); + isString: isString3 + } = require_util(); var repeat = require_repeat_string(); var { PREFIX_BEFORE_ALL, @@ -21414,7 +20705,7 @@ var require_stringify2 = __commonJS({ } = require_common(); var ESCAPABLE = /[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; var SPACE = " "; - var LF = "\n"; + var LF2 = "\n"; var STR_NULL = "null"; var BEFORE = (prop) => `${PREFIX_BEFORE}:${prop}`; var AFTER_PROP = (prop) => `${PREFIX_AFTER_PROP}:${prop}`; @@ -21453,22 +20744,22 @@ var require_stringify2 = __commonJS({ type, value }) => { - const delimiter = inline ? SPACE : LF + deeper_gap; + const delimiter = inline ? SPACE : LF2 + deeper_gap; is_line_comment = type === "LineComment"; return prev + delimiter + comment_stringify(value, is_line_comment); }, EMPTY); - return display_block || is_line_comment ? str + LF + deeper_gap : str; + return display_block || is_line_comment ? str + LF2 + deeper_gap : str; }; var replacer = null; var indent = EMPTY; - var clean2 = () => { + var clean6 = () => { replacer = null; indent = EMPTY; }; - var join2 = (one, two, gap) => one ? two ? one + two.trim() + LF + gap : one.trimRight() + LF + gap : two ? two.trimRight() + LF + gap : EMPTY; + var join3 = (one, two, gap) => one ? two ? one + two.trim() + LF2 + gap : one.trimRight() + LF2 + gap : two ? two.trimRight() + LF2 + gap : EMPTY; var join_content = (inside, value, gap) => { const comment = process_comments(value, PREFIX_BEFORE, gap + indent, true); - return join2(comment, inside, gap); + return join3(comment, inside, gap); }; var array_stringify = (value, gap) => { const deeper_gap = gap + indent; @@ -21479,17 +20770,17 @@ var require_stringify2 = __commonJS({ if (i !== 0) { inside += COMMA; } - const before = join2( + const before = join3( after_comma, process_comments(value, BEFORE(i), deeper_gap), deeper_gap ); - inside += before || LF + deeper_gap; + inside += before || LF2 + deeper_gap; inside += stringify2(i, value, deeper_gap) || STR_NULL; inside += process_comments(value, AFTER_VALUE(i), deeper_gap); after_comma = process_comments(value, AFTER(i), deeper_gap); } - inside += join2( + inside += join3( after_comma, process_comments(value, PREFIX_AFTER, deeper_gap), deeper_gap @@ -21503,28 +20794,28 @@ var require_stringify2 = __commonJS({ const deeper_gap = gap + indent; let inside = EMPTY; let after_comma = EMPTY; - let first = true; - const keys = isArray(replacer) ? replacer : Object.keys(value); + let first3 = true; + const keys2 = isArray2(replacer) ? replacer : Object.keys(value); const iteratee = (key) => { const sv = stringify2(key, value, deeper_gap); if (sv === UNDEFINED) { return; } - if (!first) { + if (!first3) { inside += COMMA; } - first = false; - const before = join2( + first3 = false; + const before = join3( after_comma, process_comments(value, BEFORE(key), deeper_gap), deeper_gap ); - inside += before || LF + deeper_gap; + inside += before || LF2 + deeper_gap; inside += quote(key) + process_comments(value, AFTER_PROP(key), deeper_gap) + COLON + process_comments(value, AFTER_COLON(key), deeper_gap) + SPACE + sv + process_comments(value, AFTER_VALUE(key), deeper_gap); after_comma = process_comments(value, AFTER(key), deeper_gap); }; - keys.forEach(iteratee); - inside += join2( + keys2.forEach(iteratee); + inside += join3( after_comma, process_comments(value, PREFIX_AFTER, deeper_gap), deeper_gap @@ -21548,11 +20839,11 @@ var require_stringify2 = __commonJS({ case "null": return String(value); case "object": - return isArray(value) ? array_stringify(value, gap) : object_stringify(value, gap); + return isArray2(value) ? array_stringify(value, gap) : object_stringify(value, gap); default: } } - var get_indent = (space) => isString2(space) ? space : isNumber(space) ? repeat(SPACE, space) : EMPTY; + var get_indent = (space) => isString3(space) ? space : isNumber(space) ? repeat(SPACE, space) : EMPTY; var { toString } = Object.prototype; var PRIMITIVE_OBJECT_TYPES = [ "[object Number]", @@ -21571,13 +20862,13 @@ var require_stringify2 = __commonJS({ if (!indent_) { return JSON.stringify(value, replacer_); } - if (!isFunction(replacer_) && !isArray(replacer_)) { + if (!isFunction(replacer_) && !isArray2(replacer_)) { replacer_ = null; } replacer = replacer_; indent = indent_; const str = is_primitive_object(value) ? JSON.stringify(value) : stringify2("", { "": value }, EMPTY); - clean2(); + clean6(); return isObject(value) ? process_comments(value, PREFIX_BEFORE_ALL, EMPTY).trimLeft() + str + process_comments(value, PREFIX_AFTER_ALL, EMPTY).trimRight() : str; }; } @@ -21586,16 +20877,16 @@ var require_stringify2 = __commonJS({ // node_modules/comment-json/src/index.js var require_src2 = __commonJS({ "node_modules/comment-json/src/index.js"(exports, module2) { - var { parse: parse3, tokenize } = require_parse3(); + var { parse: parse4, tokenize } = require_parse3(); var stringify2 = require_stringify2(); var { CommentArray } = require_array(); - var { assign } = require_common(); + var { assign: assign2 } = require_common(); module2.exports = { - parse: parse3, + parse: parse4, stringify: stringify2, tokenize, CommentArray, - assign + assign: assign2 }; } }); @@ -21609,22 +20900,22 @@ var require_cacheWrapper = __commonJS({ }); exports.cacheWrapper = cacheWrapper; exports.cacheWrapperSync = cacheWrapperSync; - async function cacheWrapper(cache, key, fn) { - const cached = cache.get(key); + async function cacheWrapper(cache2, key, fn) { + const cached = cache2.get(key); if (cached !== void 0) { return cached; } const result = await fn(); - cache.set(key, result); + cache2.set(key, result); return result; } - function cacheWrapperSync(cache, key, fn) { - const cached = cache.get(key); + function cacheWrapperSync(cache2, key, fn) { + const cached = cache2.get(key); if (cached !== void 0) { return cached; } const result = fn(); - cache.set(key, result); + cache2.set(key, result); return result; } } @@ -21634,10 +20925,10 @@ var require_cacheWrapper = __commonJS({ var require_resolve_from = __commonJS({ "node_modules/import-fresh/node_modules/resolve-from/index.js"(exports, module2) { "use strict"; - var path16 = require("path"); + var path26 = require("path"); var Module = require("module"); - var fs6 = require("fs"); - var resolveFrom = (fromDir, moduleId, silent) => { + var fs9 = require("fs"); + var resolveFrom2 = (fromDir, moduleId, silent) => { if (typeof fromDir !== "string") { throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDir}\``); } @@ -21645,17 +20936,17 @@ var require_resolve_from = __commonJS({ throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``); } try { - fromDir = fs6.realpathSync(fromDir); + fromDir = fs9.realpathSync(fromDir); } catch (err) { if (err.code === "ENOENT") { - fromDir = path16.resolve(fromDir); + fromDir = path26.resolve(fromDir); } else if (silent) { return null; } else { throw err; } } - const fromFile = path16.join(fromDir, "noop.js"); + const fromFile = path26.join(fromDir, "noop.js"); const resolveFileName = () => Module._resolveFilename(moduleId, { id: fromFile, filename: fromFile, @@ -21670,8 +20961,8 @@ var require_resolve_from = __commonJS({ } return resolveFileName(); }; - module2.exports = (fromDir, moduleId) => resolveFrom(fromDir, moduleId); - module2.exports.silent = (fromDir, moduleId) => resolveFrom(fromDir, moduleId, true); + module2.exports = (fromDir, moduleId) => resolveFrom2(fromDir, moduleId); + module2.exports.silent = (fromDir, moduleId) => resolveFrom2(fromDir, moduleId, true); } }); @@ -21727,16 +21018,16 @@ var require_parent_module = __commonJS({ var require_import_fresh = __commonJS({ "node_modules/import-fresh/index.js"(exports, module2) { "use strict"; - var path16 = require("path"); - var resolveFrom = require_resolve_from(); + var path26 = require("path"); + var resolveFrom2 = require_resolve_from(); var parentModule = require_parent_module(); module2.exports = (moduleId) => { if (typeof moduleId !== "string") { throw new TypeError("Expected a string"); } const parentPath = parentModule(__filename); - const cwd = parentPath ? path16.dirname(parentPath) : __dirname; - const filePath = resolveFrom(cwd, moduleId); + const cwd = parentPath ? path26.dirname(parentPath) : __dirname; + const filePath = resolveFrom2(cwd, moduleId); const oldModule = require.cache[filePath]; if (oldModule && oldModule.parent) { let i = oldModule.parent.children.length; @@ -21933,7 +21224,7 @@ var require_json_parse_even_better_errors = __commonJS({ var kNewline = Symbol.for("newline"); var formatRE = /^\s*[{\[]((?:\r?\n)+)([\s\t]*)/; var emptyRE = /^(?:\{\}|\[\])((?:\r?\n)+)?$/; - var parseJson = (txt, reviver, context) => { + var parseJson2 = (txt, reviver, context) => { const parseText = stripBOM(txt); context = context || 20; try { @@ -21954,13 +21245,13 @@ var require_json_parse_even_better_errors = __commonJS({ systemError: e }); } - throw new JSONParseError(e, parseText, context, parseJson); + throw new JSONParseError(e, parseText, context, parseJson2); } }; var stripBOM = (txt) => String(txt).replace(/^\uFEFF/, ""); - module2.exports = parseJson; - parseJson.JSONParseError = JSONParseError; - parseJson.noExceptions = (txt, reviver) => { + module2.exports = parseJson2; + parseJson2.JSONParseError = JSONParseError; + parseJson2.noExceptions = (txt, reviver) => { try { return JSON.parse(stripBOM(txt), reviver); } catch (e) { @@ -21975,7 +21266,7 @@ var require_build = __commonJS({ "use strict"; exports.__esModule = true; exports.LinesAndColumns = void 0; - var LF = "\n"; + var LF2 = "\n"; var CR = "\r"; var LinesAndColumns = ( /** @class */ @@ -21985,14 +21276,14 @@ var require_build = __commonJS({ var offsets = [0]; for (var offset = 0; offset < string.length; ) { switch (string[offset]) { - case LF: - offset += LF.length; + case LF2: + offset += LF2.length; offsets.push(offset); break; case CR: offset += CR.length; - if (string[offset] === LF) { - offset += LF.length; + if (string[offset] === LF2) { + offset += LF2.length; } offsets.push(offset); break; @@ -22045,23 +21336,23 @@ var require_js_tokens = __commonJS({ value: true }); exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g; - exports.matchToToken = function(match) { - var token = { type: "invalid", value: match[0], closed: void 0 }; - if (match[1]) - token.type = "string", token.closed = !!(match[3] || match[4]); - else if (match[5]) + exports.matchToToken = function(match2) { + var token = { type: "invalid", value: match2[0], closed: void 0 }; + if (match2[1]) + token.type = "string", token.closed = !!(match2[3] || match2[4]); + else if (match2[5]) token.type = "comment"; - else if (match[6]) - token.type = "comment", token.closed = !!match[7]; - else if (match[8]) + else if (match2[6]) + token.type = "comment", token.closed = !!match2[7]; + else if (match2[8]) token.type = "regex"; - else if (match[9]) + else if (match2[9]) token.type = "number"; - else if (match[10]) + else if (match2[10]) token.type = "name"; - else if (match[11]) + else if (match2[11]) token.type = "punctuator"; - else if (match[12]) + else if (match2[12]) token.type = "whitespace"; return token; }; @@ -22265,9 +21556,9 @@ var require_escape_string_regexp = __commonJS({ } }); -// node_modules/@babel/highlight/node_modules/color-name/index.js +// node_modules/color-name/index.js var require_color_name = __commonJS({ - "node_modules/@babel/highlight/node_modules/color-name/index.js"(exports, module2) { + "node_modules/color-name/index.js"(exports, module2) { "use strict"; module2.exports = { "aliceblue": [240, 248, 255], @@ -22422,9 +21713,9 @@ var require_color_name = __commonJS({ } }); -// node_modules/@babel/highlight/node_modules/color-convert/conversions.js +// node_modules/color-convert/conversions.js var require_conversions = __commonJS({ - "node_modules/@babel/highlight/node_modules/color-convert/conversions.js"(exports, module2) { + "node_modules/color-convert/conversions.js"(exports, module2) { var cssKeywords = require_color_name(); var reverseKeywords = {}; for (key in cssKeywords) { @@ -22476,32 +21767,32 @@ var require_conversions = __commonJS({ var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; - var min = Math.min(r, g, b); - var max = Math.max(r, g, b); - var delta = max - min; + var min3 = Math.min(r, g, b); + var max4 = Math.max(r, g, b); + var delta = max4 - min3; var h; var s; var l; - if (max === min) { + if (max4 === min3) { h = 0; - } else if (r === max) { + } else if (r === max4) { h = (g - b) / delta; - } else if (g === max) { + } else if (g === max4) { h = 2 + (b - r) / delta; - } else if (b === max) { + } else if (b === max4) { h = 4 + (r - g) / delta; } h = Math.min(h * 60, 360); if (h < 0) { h += 360; } - l = (min + max) / 2; - if (max === min) { + l = (min3 + max4) / 2; + if (max4 === min3) { s = 0; } else if (l <= 0.5) { - s = delta / (max + min); + s = delta / (max4 + min3); } else { - s = delta / (2 - max - min); + s = delta / (2 - max4 - min3); } return [h, s * 100, l * 100]; }; @@ -22944,12 +22235,12 @@ var require_conversions = __commonJS({ return "000000".substring(string.length) + string; }; convert.hex.rgb = function(args) { - var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); - if (!match) { + var match2 = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + if (!match2) { return [0, 0, 0]; } - var colorString = match[0]; - if (match[0].length === 3) { + var colorString = match2[0]; + if (match2[0].length === 3) { colorString = colorString.split("").map(function(char) { return char + char; }).join(""); @@ -22964,21 +22255,21 @@ var require_conversions = __commonJS({ var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; - var max = Math.max(Math.max(r, g), b); - var min = Math.min(Math.min(r, g), b); - var chroma = max - min; + var max4 = Math.max(Math.max(r, g), b); + var min3 = Math.min(Math.min(r, g), b); + var chroma = max4 - min3; var grayscale; var hue; if (chroma < 1) { - grayscale = min / (1 - chroma); + grayscale = min3 / (1 - chroma); } else { grayscale = 0; } if (chroma <= 0) { hue = 0; - } else if (max === r) { + } else if (max4 === r) { hue = (g - b) / chroma % 6; - } else if (max === g) { + } else if (max4 === g) { hue = 2 + (b - r) / chroma; } else { hue = 4 + (r - g) / chroma + 4; @@ -23135,9 +22426,9 @@ var require_conversions = __commonJS({ } }); -// node_modules/@babel/highlight/node_modules/color-convert/route.js +// node_modules/color-convert/route.js var require_route = __commonJS({ - "node_modules/@babel/highlight/node_modules/color-convert/route.js"(exports, module2) { + "node_modules/color-convert/route.js"(exports, module2) { var conversions = require_conversions(); function buildGraph() { var graph = {}; @@ -23177,15 +22468,15 @@ var require_route = __commonJS({ }; } function wrapConversion(toModel, graph) { - var path16 = [graph[toModel].parent, toModel]; + var path26 = [graph[toModel].parent, toModel]; var fn = conversions[graph[toModel].parent][toModel]; var cur = graph[toModel].parent; while (graph[cur].parent) { - path16.unshift(graph[cur].parent); + path26.unshift(graph[cur].parent); fn = link(conversions[graph[cur].parent][cur], fn); cur = graph[cur].parent; } - fn.conversion = path16; + fn.conversion = path26; return fn; } module2.exports = function(fromModel) { @@ -23205,9 +22496,9 @@ var require_route = __commonJS({ } }); -// node_modules/@babel/highlight/node_modules/color-convert/index.js +// node_modules/color-convert/index.js var require_color_convert = __commonJS({ - "node_modules/@babel/highlight/node_modules/color-convert/index.js"(exports, module2) { + "node_modules/color-convert/index.js"(exports, module2) { var conversions = require_conversions(); var route = require_route(); var convert = {}; @@ -23264,26 +22555,26 @@ var require_color_convert = __commonJS({ } }); -// node_modules/@babel/highlight/node_modules/ansi-styles/index.js +// node_modules/ansi-styles/index.js var require_ansi_styles = __commonJS({ - "node_modules/@babel/highlight/node_modules/ansi-styles/index.js"(exports, module2) { + "node_modules/ansi-styles/index.js"(exports, module2) { "use strict"; var colorConvert = require_color_convert(); - var wrapAnsi16 = (fn, offset) => function() { + var wrapAnsi162 = (fn, offset) => function() { const code = fn.apply(colorConvert, arguments); return `\x1B[${code + offset}m`; }; - var wrapAnsi256 = (fn, offset) => function() { + var wrapAnsi2562 = (fn, offset) => function() { const code = fn.apply(colorConvert, arguments); return `\x1B[${38 + offset};5;${code}m`; }; - var wrapAnsi16m = (fn, offset) => function() { + var wrapAnsi16m2 = (fn, offset) => function() { const rgb = fn.apply(colorConvert, arguments); return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; }; - function assembleStyles() { - const codes2 = /* @__PURE__ */ new Map(); - const styles = { + function assembleStyles2() { + const codes3 = /* @__PURE__ */ new Map(); + const styles3 = { modifier: { reset: [0, 0], // 21 isn't widely supported and 22 does the same thing @@ -23334,48 +22625,48 @@ var require_ansi_styles = __commonJS({ bgWhiteBright: [107, 49] } }; - styles.color.grey = styles.color.gray; - for (const groupName of Object.keys(styles)) { - const group = styles[groupName]; + styles3.color.grey = styles3.color.gray; + for (const groupName of Object.keys(styles3)) { + const group = styles3[groupName]; for (const styleName of Object.keys(group)) { const style = group[styleName]; - styles[styleName] = { + styles3[styleName] = { open: `\x1B[${style[0]}m`, close: `\x1B[${style[1]}m` }; - group[styleName] = styles[styleName]; - codes2.set(style[0], style[1]); + group[styleName] = styles3[styleName]; + codes3.set(style[0], style[1]); } - Object.defineProperty(styles, groupName, { + Object.defineProperty(styles3, groupName, { value: group, enumerable: false }); - Object.defineProperty(styles, "codes", { - value: codes2, + Object.defineProperty(styles3, "codes", { + value: codes3, enumerable: false }); } const ansi2ansi = (n) => n; const rgb2rgb = (r, g, b) => [r, g, b]; - styles.color.close = "\x1B[39m"; - styles.bgColor.close = "\x1B[49m"; - styles.color.ansi = { - ansi: wrapAnsi16(ansi2ansi, 0) + styles3.color.close = "\x1B[39m"; + styles3.bgColor.close = "\x1B[49m"; + styles3.color.ansi = { + ansi: wrapAnsi162(ansi2ansi, 0) }; - styles.color.ansi256 = { - ansi256: wrapAnsi256(ansi2ansi, 0) + styles3.color.ansi256 = { + ansi256: wrapAnsi2562(ansi2ansi, 0) }; - styles.color.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 0) + styles3.color.ansi16m = { + rgb: wrapAnsi16m2(rgb2rgb, 0) }; - styles.bgColor.ansi = { - ansi: wrapAnsi16(ansi2ansi, 10) + styles3.bgColor.ansi = { + ansi: wrapAnsi162(ansi2ansi, 10) }; - styles.bgColor.ansi256 = { - ansi256: wrapAnsi256(ansi2ansi, 10) + styles3.bgColor.ansi256 = { + ansi256: wrapAnsi2562(ansi2ansi, 10) }; - styles.bgColor.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 10) + styles3.bgColor.ansi16m = { + rgb: wrapAnsi16m2(rgb2rgb, 10) }; for (let key of Object.keys(colorConvert)) { if (typeof colorConvert[key] !== "object") { @@ -23386,30 +22677,30 @@ var require_ansi_styles = __commonJS({ key = "ansi"; } if ("ansi16" in suite) { - styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); - styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); + styles3.color.ansi[key] = wrapAnsi162(suite.ansi16, 0); + styles3.bgColor.ansi[key] = wrapAnsi162(suite.ansi16, 10); } if ("ansi256" in suite) { - styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); - styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); + styles3.color.ansi256[key] = wrapAnsi2562(suite.ansi256, 0); + styles3.bgColor.ansi256[key] = wrapAnsi2562(suite.ansi256, 10); } if ("rgb" in suite) { - styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); - styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); + styles3.color.ansi16m[key] = wrapAnsi16m2(suite.rgb, 0); + styles3.bgColor.ansi16m[key] = wrapAnsi16m2(suite.rgb, 10); } } - return styles; + return styles3; } Object.defineProperty(module2, "exports", { enumerable: true, - get: assembleStyles + get: assembleStyles2 }); } }); -// node_modules/@babel/highlight/node_modules/has-flag/index.js +// node_modules/has-flag/index.js var require_has_flag = __commonJS({ - "node_modules/@babel/highlight/node_modules/has-flag/index.js"(exports, module2) { + "node_modules/has-flag/index.js"(exports, module2) { "use strict"; module2.exports = (flag, argv) => { argv = argv || process.argv; @@ -23421,23 +22712,23 @@ var require_has_flag = __commonJS({ } }); -// node_modules/@babel/highlight/node_modules/supports-color/index.js +// node_modules/supports-color/index.js var require_supports_color = __commonJS({ - "node_modules/@babel/highlight/node_modules/supports-color/index.js"(exports, module2) { + "node_modules/supports-color/index.js"(exports, module2) { "use strict"; - var os = require("os"); - var hasFlag = require_has_flag(); - var env = process.env; + var os5 = require("os"); + var hasFlag2 = require_has_flag(); + var env3 = process.env; var forceColor; - if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) { + if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false")) { forceColor = false; - } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { + } else if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) { forceColor = true; } - if ("FORCE_COLOR" in env) { - forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; + if ("FORCE_COLOR" in env3) { + forceColor = env3.FORCE_COLOR.length === 0 || parseInt(env3.FORCE_COLOR, 10) !== 0; } - function translateLevel(level) { + function translateLevel2(level) { if (level === 0) { return false; } @@ -23448,65 +22739,65 @@ var require_supports_color = __commonJS({ has16m: level >= 3 }; } - function supportsColor(stream) { + function supportsColor2(stream) { if (forceColor === false) { return 0; } - if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { + if (hasFlag2("color=16m") || hasFlag2("color=full") || hasFlag2("color=truecolor")) { return 3; } - if (hasFlag("color=256")) { + if (hasFlag2("color=256")) { return 2; } if (stream && !stream.isTTY && forceColor !== true) { return 0; } - const min = forceColor ? 1 : 0; + const min3 = forceColor ? 1 : 0; if (process.platform === "win32") { - const osRelease = os.release().split("."); + const osRelease = os5.release().split("."); if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } return 1; } - if ("CI" in env) { - if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env) || env.CI_NAME === "codeship") { + if ("CI" in env3) { + if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env3) || env3.CI_NAME === "codeship") { return 1; } - return min; + return min3; } - if ("TEAMCITY_VERSION" in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + if ("TEAMCITY_VERSION" in env3) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env3.TEAMCITY_VERSION) ? 1 : 0; } - if (env.COLORTERM === "truecolor") { + if (env3.COLORTERM === "truecolor") { return 3; } - if ("TERM_PROGRAM" in env) { - const version3 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch (env.TERM_PROGRAM) { + if ("TERM_PROGRAM" in env3) { + const version4 = parseInt((env3.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + switch (env3.TERM_PROGRAM) { case "iTerm.app": - return version3 >= 3 ? 3 : 2; + return version4 >= 3 ? 3 : 2; case "Apple_Terminal": return 2; } } - if (/-256(color)?$/i.test(env.TERM)) { + if (/-256(color)?$/i.test(env3.TERM)) { return 2; } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env3.TERM)) { return 1; } - if ("COLORTERM" in env) { + if ("COLORTERM" in env3) { return 1; } - if (env.TERM === "dumb") { - return min; + if (env3.TERM === "dumb") { + return min3; } - return min; + return min3; } function getSupportLevel(stream) { - const level = supportsColor(stream); - return translateLevel(level); + const level = supportsColor2(stream); + return translateLevel2(level); } module2.exports = { supportsColor: getSupportLevel, @@ -23520,11 +22811,11 @@ var require_supports_color = __commonJS({ var require_templates = __commonJS({ "node_modules/@babel/highlight/node_modules/chalk/templates.js"(exports, module2) { "use strict"; - var TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; - var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; - var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; - var ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi; - var ESCAPES = /* @__PURE__ */ new Map([ + var TEMPLATE_REGEX2 = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; + var STYLE_REGEX2 = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; + var STRING_REGEX2 = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; + var ESCAPE_REGEX2 = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi; + var ESCAPES2 = /* @__PURE__ */ new Map([ ["n", "\n"], ["r", "\r"], ["t", " "], @@ -23536,35 +22827,35 @@ var require_templates = __commonJS({ ["e", "\x1B"], ["a", "\x07"] ]); - function unescape2(c) { + function unescape3(c) { if (c[0] === "u" && c.length === 5 || c[0] === "x" && c.length === 3) { return String.fromCharCode(parseInt(c.slice(1), 16)); } - return ESCAPES.get(c) || c; + return ESCAPES2.get(c) || c; } - function parseArguments(name, args) { + function parseArguments2(name, args) { const results = []; const chunks = args.trim().split(/\s*,\s*/g); let matches; for (const chunk of chunks) { if (!isNaN(chunk)) { results.push(Number(chunk)); - } else if (matches = chunk.match(STRING_REGEX)) { - results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape2(escape) : chr)); + } else if (matches = chunk.match(STRING_REGEX2)) { + results.push(matches[2].replace(ESCAPE_REGEX2, (m, escape, chr) => escape ? unescape3(escape) : chr)); } else { throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); } } return results; } - function parseStyle(style) { - STYLE_REGEX.lastIndex = 0; + function parseStyle2(style) { + STYLE_REGEX2.lastIndex = 0; const results = []; let matches; - while ((matches = STYLE_REGEX.exec(style)) !== null) { + while ((matches = STYLE_REGEX2.exec(style)) !== null) { const name = matches[1]; if (matches[2]) { - const args = parseArguments(name, matches[2]); + const args = parseArguments2(name, matches[2]); results.push([name].concat(args)); } else { results.push([name]); @@ -23572,14 +22863,14 @@ var require_templates = __commonJS({ } return results; } - function buildStyle(chalk3, styles) { + function buildStyle(chalk2, styles3) { const enabled = {}; - for (const layer of styles) { + for (const layer of styles3) { for (const style of layer.styles) { enabled[style[0]] = layer.inverse ? null : style.slice(1); } } - let current = chalk3; + let current = chalk2; for (const styleName of Object.keys(enabled)) { if (Array.isArray(enabled[styleName])) { if (!(styleName in current)) { @@ -23594,32 +22885,32 @@ var require_templates = __commonJS({ } return current; } - module2.exports = (chalk3, tmp) => { - const styles = []; + module2.exports = (chalk2, tmp) => { + const styles3 = []; const chunks = []; let chunk = []; - tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => { + tmp.replace(TEMPLATE_REGEX2, (m, escapeChar, inverse, style, close, chr) => { if (escapeChar) { - chunk.push(unescape2(escapeChar)); + chunk.push(unescape3(escapeChar)); } else if (style) { const str = chunk.join(""); chunk = []; - chunks.push(styles.length === 0 ? str : buildStyle(chalk3, styles)(str)); - styles.push({ inverse, styles: parseStyle(style) }); + chunks.push(styles3.length === 0 ? str : buildStyle(chalk2, styles3)(str)); + styles3.push({ inverse, styles: parseStyle2(style) }); } else if (close) { - if (styles.length === 0) { + if (styles3.length === 0) { throw new Error("Found extraneous } in Chalk template literal"); } - chunks.push(buildStyle(chalk3, styles)(chunk.join(""))); + chunks.push(buildStyle(chalk2, styles3)(chunk.join(""))); chunk = []; - styles.pop(); + styles3.pop(); } else { chunk.push(chr); } }); chunks.push(chunk.join("")); - if (styles.length > 0) { - const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`; + if (styles3.length > 0) { + const errMsg = `Chalk template literal is missing ${styles3.length} closing bracket${styles3.length === 1 ? "" : "s"} (\`}\`)`; throw new Error(errMsg); } return chunks.join(""); @@ -23632,102 +22923,102 @@ var require_chalk = __commonJS({ "node_modules/@babel/highlight/node_modules/chalk/index.js"(exports, module2) { "use strict"; var escapeStringRegexp = require_escape_string_regexp(); - var ansiStyles = require_ansi_styles(); - var stdoutColor = require_supports_color().stdout; - var template2 = require_templates(); + var ansiStyles2 = require_ansi_styles(); + var stdoutColor2 = require_supports_color().stdout; + var template3 = require_templates(); var isSimpleWindowsTerm = process.platform === "win32" && !(process.env.TERM || "").toLowerCase().startsWith("xterm"); - var levelMapping = ["ansi", "ansi", "ansi256", "ansi16m"]; + var levelMapping2 = ["ansi", "ansi", "ansi256", "ansi16m"]; var skipModels = /* @__PURE__ */ new Set(["gray"]); - var styles = /* @__PURE__ */ Object.create(null); - function applyOptions(obj, options) { + var styles3 = /* @__PURE__ */ Object.create(null); + function applyOptions2(obj, options) { options = options || {}; - const scLevel = stdoutColor ? stdoutColor.level : 0; + const scLevel = stdoutColor2 ? stdoutColor2.level : 0; obj.level = options.level === void 0 ? scLevel : options.level; obj.enabled = "enabled" in options ? options.enabled : obj.level > 0; } function Chalk(options) { if (!this || !(this instanceof Chalk) || this.template) { - const chalk3 = {}; - applyOptions(chalk3, options); - chalk3.template = function() { + const chalk2 = {}; + applyOptions2(chalk2, options); + chalk2.template = function() { const args = [].slice.call(arguments); - return chalkTag.apply(null, [chalk3.template].concat(args)); + return chalkTag.apply(null, [chalk2.template].concat(args)); }; - Object.setPrototypeOf(chalk3, Chalk.prototype); - Object.setPrototypeOf(chalk3.template, chalk3); - chalk3.template.constructor = Chalk; - return chalk3.template; + Object.setPrototypeOf(chalk2, Chalk.prototype); + Object.setPrototypeOf(chalk2.template, chalk2); + chalk2.template.constructor = Chalk; + return chalk2.template; } - applyOptions(this, options); + applyOptions2(this, options); } if (isSimpleWindowsTerm) { - ansiStyles.blue.open = "\x1B[94m"; + ansiStyles2.blue.open = "\x1B[94m"; } - for (const key of Object.keys(ansiStyles)) { - ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), "g"); - styles[key] = { + for (const key of Object.keys(ansiStyles2)) { + ansiStyles2[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles2[key].close), "g"); + styles3[key] = { get() { - const codes2 = ansiStyles[key]; - return build.call(this, this._styles ? this._styles.concat(codes2) : [codes2], this._empty, key); + const codes3 = ansiStyles2[key]; + return build.call(this, this._styles ? this._styles.concat(codes3) : [codes3], this._empty, key); } }; } - styles.visible = { + styles3.visible = { get() { return build.call(this, this._styles || [], true, "visible"); } }; - ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), "g"); - for (const model of Object.keys(ansiStyles.color.ansi)) { + ansiStyles2.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles2.color.close), "g"); + for (const model of Object.keys(ansiStyles2.color.ansi)) { if (skipModels.has(model)) { continue; } - styles[model] = { + styles3[model] = { get() { const level = this.level; return function() { - const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); - const codes2 = { + const open = ansiStyles2.color[levelMapping2[level]][model].apply(null, arguments); + const codes3 = { open, - close: ansiStyles.color.close, - closeRe: ansiStyles.color.closeRe + close: ansiStyles2.color.close, + closeRe: ansiStyles2.color.closeRe }; - return build.call(this, this._styles ? this._styles.concat(codes2) : [codes2], this._empty, model); + return build.call(this, this._styles ? this._styles.concat(codes3) : [codes3], this._empty, model); }; } }; } - ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), "g"); - for (const model of Object.keys(ansiStyles.bgColor.ansi)) { + ansiStyles2.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles2.bgColor.close), "g"); + for (const model of Object.keys(ansiStyles2.bgColor.ansi)) { if (skipModels.has(model)) { continue; } const bgModel = "bg" + model[0].toUpperCase() + model.slice(1); - styles[bgModel] = { + styles3[bgModel] = { get() { const level = this.level; return function() { - const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); - const codes2 = { + const open = ansiStyles2.bgColor[levelMapping2[level]][model].apply(null, arguments); + const codes3 = { open, - close: ansiStyles.bgColor.close, - closeRe: ansiStyles.bgColor.closeRe + close: ansiStyles2.bgColor.close, + closeRe: ansiStyles2.bgColor.closeRe }; - return build.call(this, this._styles ? this._styles.concat(codes2) : [codes2], this._empty, model); + return build.call(this, this._styles ? this._styles.concat(codes3) : [codes3], this._empty, model); }; } }; } - var proto = Object.defineProperties(() => { - }, styles); + var proto2 = Object.defineProperties(() => { + }, styles3); function build(_styles, _empty, key) { - const builder = function() { - return applyStyle.apply(builder, arguments); + const builder2 = function() { + return applyStyle2.apply(builder2, arguments); }; - builder._styles = _styles; - builder._empty = _empty; + builder2._styles = _styles; + builder2._empty = _empty; const self = this; - Object.defineProperty(builder, "level", { + Object.defineProperty(builder2, "level", { enumerable: true, get() { return self.level; @@ -23736,7 +23027,7 @@ var require_chalk = __commonJS({ self.level = level; } }); - Object.defineProperty(builder, "enabled", { + Object.defineProperty(builder2, "enabled", { enumerable: true, get() { return self.enabled; @@ -23745,11 +23036,11 @@ var require_chalk = __commonJS({ self.enabled = enabled; } }); - builder.hasGrey = this.hasGrey || key === "gray" || key === "grey"; - builder.__proto__ = proto; - return builder; + builder2.hasGrey = this.hasGrey || key === "gray" || key === "grey"; + builder2.__proto__ = proto2; + return builder2; } - function applyStyle() { + function applyStyle2() { const args = arguments; const argsLen = args.length; let str = String(arguments[0]); @@ -23764,18 +23055,18 @@ var require_chalk = __commonJS({ if (!this.enabled || this.level <= 0 || !str) { return this._empty ? "" : str; } - const originalDim = ansiStyles.dim.open; + const originalDim = ansiStyles2.dim.open; if (isSimpleWindowsTerm && this.hasGrey) { - ansiStyles.dim.open = ""; + ansiStyles2.dim.open = ""; } for (const code of this._styles.slice().reverse()) { str = code.open + str.replace(code.closeRe, code.open) + code.close; str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); } - ansiStyles.dim.open = originalDim; + ansiStyles2.dim.open = originalDim; return str; } - function chalkTag(chalk3, strings) { + function chalkTag(chalk2, strings) { if (!Array.isArray(strings)) { return [].slice.call(arguments, 1).join(" "); } @@ -23785,11 +23076,11 @@ var require_chalk = __commonJS({ parts.push(String(args[i - 1]).replace(/[{}\\]/g, "\\$&")); parts.push(String(strings.raw[i])); } - return template2(chalk3, parts.join("")); + return template3(chalk2, parts.join("")); } - Object.defineProperties(Chalk.prototype, styles); + Object.defineProperties(Chalk.prototype, styles3); module2.exports = Chalk(); - module2.exports.supportsColor = stdoutColor; + module2.exports.supportsColor = stdoutColor2; module2.exports.default = module2.exports; } }); @@ -23806,19 +23097,19 @@ var require_lib5 = __commonJS({ var _jsTokens = require_js_tokens(); var _helperValidatorIdentifier = require_lib4(); var _chalk2 = require_chalk(); - var chalk3 = _chalk2; + var chalk2 = _chalk2; var sometimesKeywords = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]); - function getDefs(chalk4) { + function getDefs(chalk3) { return { - keyword: chalk4.cyan, - capitalized: chalk4.yellow, - jsxIdentifier: chalk4.yellow, - punctuator: chalk4.yellow, - number: chalk4.magenta, - string: chalk4.green, - regex: chalk4.magenta, - comment: chalk4.grey, - invalid: chalk4.white.bgRed.bold + keyword: chalk3.cyan, + capitalized: chalk3.yellow, + jsxIdentifier: chalk3.yellow, + punctuator: chalk3.yellow, + number: chalk3.magenta, + string: chalk3.green, + regex: chalk3.magenta, + comment: chalk3.grey, + invalid: chalk3.white.bgRed.bold }; } var NEWLINE = /\r\n|[\n\r\u2028\u2029]/; @@ -23847,11 +23138,11 @@ var require_lib5 = __commonJS({ return token.type; }; tokenize = function* (text) { - let match; - while (match = _jsTokens.default.exec(text)) { - const token = _jsTokens.matchToToken(match); + let match2; + while (match2 = _jsTokens.default.exec(text)) { + const token = _jsTokens.matchToToken(match2); yield { - type: getTokenType(token, match.index, text), + type: getTokenType(token, match2.index, text), value: token.value }; } @@ -23873,19 +23164,19 @@ var require_lib5 = __commonJS({ return highlighted; } function shouldHighlight(options) { - return !!chalk3.supportsColor || options.forceColor; + return !!chalk2.supportsColor || options.forceColor; } var chalkWithForcedColor = void 0; function getChalk(forceColor) { if (forceColor) { var _chalkWithForcedColor; - (_chalkWithForcedColor = chalkWithForcedColor) != null ? _chalkWithForcedColor : chalkWithForcedColor = new chalk3.constructor({ + (_chalkWithForcedColor = chalkWithForcedColor) != null ? _chalkWithForcedColor : chalkWithForcedColor = new chalk2.constructor({ enabled: true, level: 1 }); return chalkWithForcedColor; } - return chalk3; + return chalk2; } { { @@ -23903,2070 +23194,819 @@ var require_lib5 = __commonJS({ } }); -// node_modules/@babel/code-frame/node_modules/color-name/index.js -var require_color_name2 = __commonJS({ - "node_modules/@babel/code-frame/node_modules/color-name/index.js"(exports, module2) { +// node_modules/@babel/code-frame/node_modules/chalk/templates.js +var require_templates2 = __commonJS({ + "node_modules/@babel/code-frame/node_modules/chalk/templates.js"(exports, module2) { "use strict"; - module2.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] - }; - } -}); - -// node_modules/@babel/code-frame/node_modules/color-convert/conversions.js -var require_conversions2 = __commonJS({ - "node_modules/@babel/code-frame/node_modules/color-convert/conversions.js"(exports, module2) { - var cssKeywords = require_color_name2(); - var reverseKeywords = {}; - for (key in cssKeywords) { - if (cssKeywords.hasOwnProperty(key)) { - reverseKeywords[cssKeywords[key]] = key; + var TEMPLATE_REGEX2 = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; + var STYLE_REGEX2 = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; + var STRING_REGEX2 = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; + var ESCAPE_REGEX2 = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi; + var ESCAPES2 = /* @__PURE__ */ new Map([ + ["n", "\n"], + ["r", "\r"], + ["t", " "], + ["b", "\b"], + ["f", "\f"], + ["v", "\v"], + ["0", "\0"], + ["\\", "\\"], + ["e", "\x1B"], + ["a", "\x07"] + ]); + function unescape3(c) { + if (c[0] === "u" && c.length === 5 || c[0] === "x" && c.length === 3) { + return String.fromCharCode(parseInt(c.slice(1), 16)); } + return ESCAPES2.get(c) || c; } - var key; - var convert = module2.exports = { - rgb: { channels: 3, labels: "rgb" }, - hsl: { channels: 3, labels: "hsl" }, - hsv: { channels: 3, labels: "hsv" }, - hwb: { channels: 3, labels: "hwb" }, - cmyk: { channels: 4, labels: "cmyk" }, - xyz: { channels: 3, labels: "xyz" }, - lab: { channels: 3, labels: "lab" }, - lch: { channels: 3, labels: "lch" }, - hex: { channels: 1, labels: ["hex"] }, - keyword: { channels: 1, labels: ["keyword"] }, - ansi16: { channels: 1, labels: ["ansi16"] }, - ansi256: { channels: 1, labels: ["ansi256"] }, - hcg: { channels: 3, labels: ["h", "c", "g"] }, - apple: { channels: 3, labels: ["r16", "g16", "b16"] }, - gray: { channels: 1, labels: ["gray"] } - }; - for (model in convert) { - if (convert.hasOwnProperty(model)) { - if (!("channels" in convert[model])) { - throw new Error("missing channels property: " + model); - } - if (!("labels" in convert[model])) { - throw new Error("missing channel labels property: " + model); + function parseArguments2(name, args) { + const results = []; + const chunks = args.trim().split(/\s*,\s*/g); + let matches; + for (const chunk of chunks) { + if (!isNaN(chunk)) { + results.push(Number(chunk)); + } else if (matches = chunk.match(STRING_REGEX2)) { + results.push(matches[2].replace(ESCAPE_REGEX2, (m, escape, chr) => escape ? unescape3(escape) : chr)); + } else { + throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); } - if (convert[model].labels.length !== convert[model].channels) { - throw new Error("channel and label counts mismatch: " + model); + } + return results; + } + function parseStyle2(style) { + STYLE_REGEX2.lastIndex = 0; + const results = []; + let matches; + while ((matches = STYLE_REGEX2.exec(style)) !== null) { + const name = matches[1]; + if (matches[2]) { + const args = parseArguments2(name, matches[2]); + results.push([name].concat(args)); + } else { + results.push([name]); } - channels = convert[model].channels; - labels = convert[model].labels; - delete convert[model].channels; - delete convert[model].labels; - Object.defineProperty(convert[model], "channels", { value: channels }); - Object.defineProperty(convert[model], "labels", { value: labels }); } + return results; } - var channels; - var labels; - var model; - convert.rgb.hsl = function(rgb) { - var r = rgb[0] / 255; - var g = rgb[1] / 255; - var b = rgb[2] / 255; - var min = Math.min(r, g, b); - var max = Math.max(r, g, b); - var delta = max - min; - var h; - var s; - var l; - if (max === min) { - h = 0; - } else if (r === max) { - h = (g - b) / delta; - } else if (g === max) { - h = 2 + (b - r) / delta; - } else if (b === max) { - h = 4 + (r - g) / delta; + function buildStyle(chalk2, styles3) { + const enabled = {}; + for (const layer of styles3) { + for (const style of layer.styles) { + enabled[style[0]] = layer.inverse ? null : style.slice(1); + } } - h = Math.min(h * 60, 360); - if (h < 0) { - h += 360; + let current = chalk2; + for (const styleName of Object.keys(enabled)) { + if (Array.isArray(enabled[styleName])) { + if (!(styleName in current)) { + throw new Error(`Unknown Chalk style: ${styleName}`); + } + if (enabled[styleName].length > 0) { + current = current[styleName].apply(current, enabled[styleName]); + } else { + current = current[styleName]; + } + } } - l = (min + max) / 2; - if (max === min) { - s = 0; - } else if (l <= 0.5) { - s = delta / (max + min); - } else { - s = delta / (2 - max - min); + return current; + } + module2.exports = (chalk2, tmp) => { + const styles3 = []; + const chunks = []; + let chunk = []; + tmp.replace(TEMPLATE_REGEX2, (m, escapeChar, inverse, style, close, chr) => { + if (escapeChar) { + chunk.push(unescape3(escapeChar)); + } else if (style) { + const str = chunk.join(""); + chunk = []; + chunks.push(styles3.length === 0 ? str : buildStyle(chalk2, styles3)(str)); + styles3.push({ inverse, styles: parseStyle2(style) }); + } else if (close) { + if (styles3.length === 0) { + throw new Error("Found extraneous } in Chalk template literal"); + } + chunks.push(buildStyle(chalk2, styles3)(chunk.join(""))); + chunk = []; + styles3.pop(); + } else { + chunk.push(chr); + } + }); + chunks.push(chunk.join("")); + if (styles3.length > 0) { + const errMsg = `Chalk template literal is missing ${styles3.length} closing bracket${styles3.length === 1 ? "" : "s"} (\`}\`)`; + throw new Error(errMsg); } - return [h, s * 100, l * 100]; + return chunks.join(""); }; - convert.rgb.hsv = function(rgb) { - var rdif; - var gdif; - var bdif; - var h; - var s; - var r = rgb[0] / 255; - var g = rgb[1] / 255; - var b = rgb[2] / 255; - var v = Math.max(r, g, b); - var diff = v - Math.min(r, g, b); - var diffc = function(c) { - return (v - c) / 6 / diff + 1 / 2; - }; - if (diff === 0) { - h = s = 0; - } else { - s = diff / v; - rdif = diffc(r); - gdif = diffc(g); - bdif = diffc(b); - if (r === v) { - h = bdif - gdif; - } else if (g === v) { - h = 1 / 3 + rdif - bdif; - } else if (b === v) { - h = 2 / 3 + gdif - rdif; - } - if (h < 0) { - h += 1; - } else if (h > 1) { - h -= 1; - } - } - return [ - h * 360, - s * 100, - v * 100 - ]; - }; - convert.rgb.hwb = function(rgb) { - var r = rgb[0]; - var g = rgb[1]; - var b = rgb[2]; - var h = convert.rgb.hsl(rgb)[0]; - var w = 1 / 255 * Math.min(r, Math.min(g, b)); - b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); - return [h, w * 100, b * 100]; - }; - convert.rgb.cmyk = function(rgb) { - var r = rgb[0] / 255; - var g = rgb[1] / 255; - var b = rgb[2] / 255; - var c; - var m; - var y; - var k; - k = Math.min(1 - r, 1 - g, 1 - b); - c = (1 - r - k) / (1 - k) || 0; - m = (1 - g - k) / (1 - k) || 0; - y = (1 - b - k) / (1 - k) || 0; - return [c * 100, m * 100, y * 100, k * 100]; - }; - function comparativeDistance(x, y) { - return Math.pow(x[0] - y[0], 2) + Math.pow(x[1] - y[1], 2) + Math.pow(x[2] - y[2], 2); + } +}); + +// node_modules/@babel/code-frame/node_modules/chalk/index.js +var require_chalk2 = __commonJS({ + "node_modules/@babel/code-frame/node_modules/chalk/index.js"(exports, module2) { + "use strict"; + var escapeStringRegexp = require_escape_string_regexp(); + var ansiStyles2 = require_ansi_styles(); + var stdoutColor2 = require_supports_color().stdout; + var template3 = require_templates2(); + var isSimpleWindowsTerm = process.platform === "win32" && !(process.env.TERM || "").toLowerCase().startsWith("xterm"); + var levelMapping2 = ["ansi", "ansi", "ansi256", "ansi16m"]; + var skipModels = /* @__PURE__ */ new Set(["gray"]); + var styles3 = /* @__PURE__ */ Object.create(null); + function applyOptions2(obj, options) { + options = options || {}; + const scLevel = stdoutColor2 ? stdoutColor2.level : 0; + obj.level = options.level === void 0 ? scLevel : options.level; + obj.enabled = "enabled" in options ? options.enabled : obj.level > 0; } - convert.rgb.keyword = function(rgb) { - var reversed = reverseKeywords[rgb]; - if (reversed) { - return reversed; + function Chalk(options) { + if (!this || !(this instanceof Chalk) || this.template) { + const chalk2 = {}; + applyOptions2(chalk2, options); + chalk2.template = function() { + const args = [].slice.call(arguments); + return chalkTag.apply(null, [chalk2.template].concat(args)); + }; + Object.setPrototypeOf(chalk2, Chalk.prototype); + Object.setPrototypeOf(chalk2.template, chalk2); + chalk2.template.constructor = Chalk; + return chalk2.template; } - var currentClosestDistance = Infinity; - var currentClosestKeyword; - for (var keyword in cssKeywords) { - if (cssKeywords.hasOwnProperty(keyword)) { - var value = cssKeywords[keyword]; - var distance = comparativeDistance(rgb, value); - if (distance < currentClosestDistance) { - currentClosestDistance = distance; - currentClosestKeyword = keyword; - } + applyOptions2(this, options); + } + if (isSimpleWindowsTerm) { + ansiStyles2.blue.open = "\x1B[94m"; + } + for (const key of Object.keys(ansiStyles2)) { + ansiStyles2[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles2[key].close), "g"); + styles3[key] = { + get() { + const codes3 = ansiStyles2[key]; + return build.call(this, this._styles ? this._styles.concat(codes3) : [codes3], this._empty, key); } + }; + } + styles3.visible = { + get() { + return build.call(this, this._styles || [], true, "visible"); } - return currentClosestKeyword; - }; - convert.keyword.rgb = function(keyword) { - return cssKeywords[keyword]; - }; - convert.rgb.xyz = function(rgb) { - var r = rgb[0] / 255; - var g = rgb[1] / 255; - var b = rgb[2] / 255; - r = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92; - g = g > 0.04045 ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92; - b = b > 0.04045 ? Math.pow((b + 0.055) / 1.055, 2.4) : b / 12.92; - var x = r * 0.4124 + g * 0.3576 + b * 0.1805; - var y = r * 0.2126 + g * 0.7152 + b * 0.0722; - var z = r * 0.0193 + g * 0.1192 + b * 0.9505; - return [x * 100, y * 100, z * 100]; - }; - convert.rgb.lab = function(rgb) { - var xyz = convert.rgb.xyz(rgb); - var x = xyz[0]; - var y = xyz[1]; - var z = xyz[2]; - var l; - var a; - var b; - x /= 95.047; - y /= 100; - z /= 108.883; - x = x > 8856e-6 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116; - y = y > 8856e-6 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116; - z = z > 8856e-6 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116; - l = 116 * y - 16; - a = 500 * (x - y); - b = 200 * (y - z); - return [l, a, b]; }; - convert.hsl.rgb = function(hsl) { - var h = hsl[0] / 360; - var s = hsl[1] / 100; - var l = hsl[2] / 100; - var t1; - var t2; - var t3; - var rgb; - var val; - if (s === 0) { - val = l * 255; - return [val, val, val]; + ansiStyles2.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles2.color.close), "g"); + for (const model of Object.keys(ansiStyles2.color.ansi)) { + if (skipModels.has(model)) { + continue; } - if (l < 0.5) { - t2 = l * (1 + s); - } else { - t2 = l + s - l * s; + styles3[model] = { + get() { + const level = this.level; + return function() { + const open = ansiStyles2.color[levelMapping2[level]][model].apply(null, arguments); + const codes3 = { + open, + close: ansiStyles2.color.close, + closeRe: ansiStyles2.color.closeRe + }; + return build.call(this, this._styles ? this._styles.concat(codes3) : [codes3], this._empty, model); + }; + } + }; + } + ansiStyles2.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles2.bgColor.close), "g"); + for (const model of Object.keys(ansiStyles2.bgColor.ansi)) { + if (skipModels.has(model)) { + continue; } - t1 = 2 * l - t2; - rgb = [0, 0, 0]; - for (var i = 0; i < 3; i++) { - t3 = h + 1 / 3 * -(i - 1); - if (t3 < 0) { - t3++; + const bgModel = "bg" + model[0].toUpperCase() + model.slice(1); + styles3[bgModel] = { + get() { + const level = this.level; + return function() { + const open = ansiStyles2.bgColor[levelMapping2[level]][model].apply(null, arguments); + const codes3 = { + open, + close: ansiStyles2.bgColor.close, + closeRe: ansiStyles2.bgColor.closeRe + }; + return build.call(this, this._styles ? this._styles.concat(codes3) : [codes3], this._empty, model); + }; } - if (t3 > 1) { - t3--; + }; + } + var proto2 = Object.defineProperties(() => { + }, styles3); + function build(_styles, _empty, key) { + const builder2 = function() { + return applyStyle2.apply(builder2, arguments); + }; + builder2._styles = _styles; + builder2._empty = _empty; + const self = this; + Object.defineProperty(builder2, "level", { + enumerable: true, + get() { + return self.level; + }, + set(level) { + self.level = level; } - if (6 * t3 < 1) { - val = t1 + (t2 - t1) * 6 * t3; - } else if (2 * t3 < 1) { - val = t2; - } else if (3 * t3 < 2) { - val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; - } else { - val = t1; + }); + Object.defineProperty(builder2, "enabled", { + enumerable: true, + get() { + return self.enabled; + }, + set(enabled) { + self.enabled = enabled; } - rgb[i] = val * 255; + }); + builder2.hasGrey = this.hasGrey || key === "gray" || key === "grey"; + builder2.__proto__ = proto2; + return builder2; + } + function applyStyle2() { + const args = arguments; + const argsLen = args.length; + let str = String(arguments[0]); + if (argsLen === 0) { + return ""; } - return rgb; - }; - convert.hsl.hsv = function(hsl) { - var h = hsl[0]; - var s = hsl[1] / 100; - var l = hsl[2] / 100; - var smin = s; - var lmin = Math.max(l, 0.01); - var sv; - var v; - l *= 2; - s *= l <= 1 ? l : 2 - l; - smin *= lmin <= 1 ? lmin : 2 - lmin; - v = (l + s) / 2; - sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s); - return [h, sv * 100, v * 100]; - }; - convert.hsv.rgb = function(hsv) { - var h = hsv[0] / 60; - var s = hsv[1] / 100; - var v = hsv[2] / 100; - var hi = Math.floor(h) % 6; - var f = h - Math.floor(h); - var p = 255 * v * (1 - s); - var q = 255 * v * (1 - s * f); - var t = 255 * v * (1 - s * (1 - f)); - v *= 255; - switch (hi) { - case 0: - return [v, t, p]; - case 1: - return [q, v, p]; - case 2: - return [p, v, t]; - case 3: - return [p, q, v]; - case 4: - return [t, p, v]; - case 5: - return [v, p, q]; + if (argsLen > 1) { + for (let a = 1; a < argsLen; a++) { + str += " " + args[a]; + } } - }; - convert.hsv.hsl = function(hsv) { - var h = hsv[0]; - var s = hsv[1] / 100; - var v = hsv[2] / 100; - var vmin = Math.max(v, 0.01); - var lmin; - var sl; - var l; - l = (2 - s) * v; - lmin = (2 - s) * vmin; - sl = s * vmin; - sl /= lmin <= 1 ? lmin : 2 - lmin; - sl = sl || 0; - l /= 2; - return [h, sl * 100, l * 100]; - }; - convert.hwb.rgb = function(hwb) { - var h = hwb[0] / 360; - var wh = hwb[1] / 100; - var bl = hwb[2] / 100; - var ratio = wh + bl; - var i; - var v; - var f; - var n; - if (ratio > 1) { - wh /= ratio; - bl /= ratio; + if (!this.enabled || this.level <= 0 || !str) { + return this._empty ? "" : str; } - i = Math.floor(6 * h); - v = 1 - bl; - f = 6 * h - i; - if ((i & 1) !== 0) { - f = 1 - f; + const originalDim = ansiStyles2.dim.open; + if (isSimpleWindowsTerm && this.hasGrey) { + ansiStyles2.dim.open = ""; } - n = wh + f * (v - wh); - var r; - var g; - var b; - switch (i) { - default: - case 6: - case 0: - r = v; - g = n; - b = wh; - break; - case 1: - r = n; - g = v; - b = wh; - break; - case 2: - r = wh; - g = v; - b = n; - break; - case 3: - r = wh; - g = n; - b = v; - break; - case 4: - r = n; - g = wh; - b = v; - break; - case 5: - r = v; - g = wh; - b = n; - break; + for (const code of this._styles.slice().reverse()) { + str = code.open + str.replace(code.closeRe, code.open) + code.close; + str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); } - return [r * 255, g * 255, b * 255]; - }; - convert.cmyk.rgb = function(cmyk) { - var c = cmyk[0] / 100; - var m = cmyk[1] / 100; - var y = cmyk[2] / 100; - var k = cmyk[3] / 100; - var r; - var g; - var b; - r = 1 - Math.min(1, c * (1 - k) + k); - g = 1 - Math.min(1, m * (1 - k) + k); - b = 1 - Math.min(1, y * (1 - k) + k); - return [r * 255, g * 255, b * 255]; - }; - convert.xyz.rgb = function(xyz) { - var x = xyz[0] / 100; - var y = xyz[1] / 100; - var z = xyz[2] / 100; - var r; - var g; - var b; - r = x * 3.2406 + y * -1.5372 + z * -0.4986; - g = x * -0.9689 + y * 1.8758 + z * 0.0415; - b = x * 0.0557 + y * -0.204 + z * 1.057; - r = r > 31308e-7 ? 1.055 * Math.pow(r, 1 / 2.4) - 0.055 : r * 12.92; - g = g > 31308e-7 ? 1.055 * Math.pow(g, 1 / 2.4) - 0.055 : g * 12.92; - b = b > 31308e-7 ? 1.055 * Math.pow(b, 1 / 2.4) - 0.055 : b * 12.92; - r = Math.min(Math.max(0, r), 1); - g = Math.min(Math.max(0, g), 1); - b = Math.min(Math.max(0, b), 1); - return [r * 255, g * 255, b * 255]; - }; - convert.xyz.lab = function(xyz) { - var x = xyz[0]; - var y = xyz[1]; - var z = xyz[2]; - var l; - var a; - var b; - x /= 95.047; - y /= 100; - z /= 108.883; - x = x > 8856e-6 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116; - y = y > 8856e-6 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116; - z = z > 8856e-6 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116; - l = 116 * y - 16; - a = 500 * (x - y); - b = 200 * (y - z); - return [l, a, b]; - }; - convert.lab.xyz = function(lab) { - var l = lab[0]; - var a = lab[1]; - var b = lab[2]; - var x; - var y; - var z; - y = (l + 16) / 116; - x = a / 500 + y; - z = y - b / 200; - var y2 = Math.pow(y, 3); - var x2 = Math.pow(x, 3); - var z2 = Math.pow(z, 3); - y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787; - x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787; - z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787; - x *= 95.047; - y *= 100; - z *= 108.883; - return [x, y, z]; - }; - convert.lab.lch = function(lab) { - var l = lab[0]; - var a = lab[1]; - var b = lab[2]; - var hr; - var h; - var c; - hr = Math.atan2(b, a); - h = hr * 360 / 2 / Math.PI; - if (h < 0) { - h += 360; + ansiStyles2.dim.open = originalDim; + return str; + } + function chalkTag(chalk2, strings) { + if (!Array.isArray(strings)) { + return [].slice.call(arguments, 1).join(" "); } - c = Math.sqrt(a * a + b * b); - return [l, c, h]; - }; - convert.lch.lab = function(lch) { - var l = lch[0]; - var c = lch[1]; - var h = lch[2]; - var a; - var b; - var hr; - hr = h / 360 * 2 * Math.PI; - a = c * Math.cos(hr); - b = c * Math.sin(hr); - return [l, a, b]; - }; - convert.rgb.ansi16 = function(args) { - var r = args[0]; - var g = args[1]; - var b = args[2]; - var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; - value = Math.round(value / 50); - if (value === 0) { - return 30; + const args = [].slice.call(arguments, 2); + const parts = [strings.raw[0]]; + for (let i = 1; i < strings.length; i++) { + parts.push(String(args[i - 1]).replace(/[{}\\]/g, "\\$&")); + parts.push(String(strings.raw[i])); } - var ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255)); - if (value === 2) { - ansi += 60; + return template3(chalk2, parts.join("")); + } + Object.defineProperties(Chalk.prototype, styles3); + module2.exports = Chalk(); + module2.exports.supportsColor = stdoutColor2; + module2.exports.default = module2.exports; + } +}); + +// node_modules/@babel/code-frame/lib/index.js +var require_lib6 = __commonJS({ + "node_modules/@babel/code-frame/lib/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.codeFrameColumns = codeFrameColumns; + exports.default = _default; + var _highlight = require_lib5(); + var _chalk2 = require_chalk2(); + var chalk2 = _chalk2; + var chalkWithForcedColor = void 0; + function getChalk(forceColor) { + if (forceColor) { + var _chalkWithForcedColor; + (_chalkWithForcedColor = chalkWithForcedColor) != null ? _chalkWithForcedColor : chalkWithForcedColor = new chalk2.constructor({ + enabled: true, + level: 1 + }); + return chalkWithForcedColor; } - return ansi; - }; - convert.hsv.ansi16 = function(args) { - return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); - }; - convert.rgb.ansi256 = function(args) { - var r = args[0]; - var g = args[1]; - var b = args[2]; - if (r === g && g === b) { - if (r < 8) { - return 16; - } - if (r > 248) { - return 231; - } - return Math.round((r - 8) / 247 * 24) + 232; + return chalk2; + } + var deprecationWarningShown = false; + function getDefs(chalk3) { + return { + gutter: chalk3.grey, + marker: chalk3.red.bold, + message: chalk3.red.bold + }; + } + var NEWLINE = /\r\n|[\n\r\u2028\u2029]/; + function getMarkerLines(loc, source, opts) { + const startLoc = Object.assign({ + column: 0, + line: -1 + }, loc.start); + const endLoc = Object.assign({}, startLoc, loc.end); + const { + linesAbove = 2, + linesBelow = 3 + } = opts || {}; + const startLine = startLoc.line; + const startColumn = startLoc.column; + const endLine = endLoc.line; + const endColumn = endLoc.column; + let start = Math.max(startLine - (linesAbove + 1), 0); + let end = Math.min(source.length, endLine + linesBelow); + if (startLine === -1) { + start = 0; } - var ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5); - return ansi; - }; - convert.ansi16.rgb = function(args) { - var color = args % 10; - if (color === 0 || color === 7) { - if (args > 50) { - color += 3.5; - } - color = color / 10.5 * 255; - return [color, color, color]; - } - var mult = (~~(args > 50) + 1) * 0.5; - var r = (color & 1) * mult * 255; - var g = (color >> 1 & 1) * mult * 255; - var b = (color >> 2 & 1) * mult * 255; - return [r, g, b]; - }; - convert.ansi256.rgb = function(args) { - if (args >= 232) { - var c = (args - 232) * 10 + 8; - return [c, c, c]; - } - args -= 16; - var rem; - var r = Math.floor(args / 36) / 5 * 255; - var g = Math.floor((rem = args % 36) / 6) / 5 * 255; - var b = rem % 6 / 5 * 255; - return [r, g, b]; - }; - convert.rgb.hex = function(args) { - var integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255); - var string = integer.toString(16).toUpperCase(); - return "000000".substring(string.length) + string; - }; - convert.hex.rgb = function(args) { - var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); - if (!match) { - return [0, 0, 0]; - } - var colorString = match[0]; - if (match[0].length === 3) { - colorString = colorString.split("").map(function(char) { - return char + char; - }).join(""); + if (endLine === -1) { + end = source.length; } - var integer = parseInt(colorString, 16); - var r = integer >> 16 & 255; - var g = integer >> 8 & 255; - var b = integer & 255; - return [r, g, b]; - }; - convert.rgb.hcg = function(rgb) { - var r = rgb[0] / 255; - var g = rgb[1] / 255; - var b = rgb[2] / 255; - var max = Math.max(Math.max(r, g), b); - var min = Math.min(Math.min(r, g), b); - var chroma = max - min; - var grayscale; - var hue; - if (chroma < 1) { - grayscale = min / (1 - chroma); + const lineDiff = endLine - startLine; + const markerLines = {}; + if (lineDiff) { + for (let i = 0; i <= lineDiff; i++) { + const lineNumber = i + startLine; + if (!startColumn) { + markerLines[lineNumber] = true; + } else if (i === 0) { + const sourceLength = source[lineNumber - 1].length; + markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1]; + } else if (i === lineDiff) { + markerLines[lineNumber] = [0, endColumn]; + } else { + const sourceLength = source[lineNumber - i].length; + markerLines[lineNumber] = [0, sourceLength]; + } + } } else { - grayscale = 0; + if (startColumn === endColumn) { + if (startColumn) { + markerLines[startLine] = [startColumn, 0]; + } else { + markerLines[startLine] = true; + } + } else { + markerLines[startLine] = [startColumn, endColumn - startColumn]; + } } - if (chroma <= 0) { - hue = 0; - } else if (max === r) { - hue = (g - b) / chroma % 6; - } else if (max === g) { - hue = 2 + (b - r) / chroma; - } else { - hue = 4 + (r - g) / chroma + 4; + return { + start, + end, + markerLines + }; + } + function codeFrameColumns(rawLines, loc, opts = {}) { + const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts); + const chalk3 = getChalk(opts.forceColor); + const defs = getDefs(chalk3); + const maybeHighlight = (chalkFn, string) => { + return highlighted ? chalkFn(string) : string; + }; + const lines = rawLines.split(NEWLINE); + const { + start, + end, + markerLines + } = getMarkerLines(loc, lines, opts); + const hasColumns = loc.start && typeof loc.start.column === "number"; + const numberMaxWidth = String(end).length; + const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines; + let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => { + const number = start + 1 + index; + const paddedNumber = ` ${number}`.slice(-numberMaxWidth); + const gutter = ` ${paddedNumber} |`; + const hasMarker = markerLines[number]; + const lastMarkerLine = !markerLines[number + 1]; + if (hasMarker) { + let markerLine = ""; + if (Array.isArray(hasMarker)) { + const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " "); + const numberOfMarkers = hasMarker[1] || 1; + markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), " ", markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join(""); + if (lastMarkerLine && opts.message) { + markerLine += " " + maybeHighlight(defs.message, opts.message); + } + } + return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line.length > 0 ? ` ${line}` : "", markerLine].join(""); + } else { + return ` ${maybeHighlight(defs.gutter, gutter)}${line.length > 0 ? ` ${line}` : ""}`; + } + }).join("\n"); + if (opts.message && !hasColumns) { + frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message} +${frame}`; } - hue /= 6; - hue %= 1; - return [hue * 360, chroma * 100, grayscale * 100]; - }; - convert.hsl.hcg = function(hsl) { - var s = hsl[1] / 100; - var l = hsl[2] / 100; - var c = 1; - var f = 0; - if (l < 0.5) { - c = 2 * s * l; + if (highlighted) { + return chalk3.reset(frame); } else { - c = 2 * s * (1 - l); - } - if (c < 1) { - f = (l - 0.5 * c) / (1 - c); - } - return [hsl[0], c * 100, f * 100]; - }; - convert.hsv.hcg = function(hsv) { - var s = hsv[1] / 100; - var v = hsv[2] / 100; - var c = s * v; - var f = 0; - if (c < 1) { - f = (v - c) / (1 - c); - } - return [hsv[0], c * 100, f * 100]; - }; - convert.hcg.rgb = function(hcg) { - var h = hcg[0] / 360; - var c = hcg[1] / 100; - var g = hcg[2] / 100; - if (c === 0) { - return [g * 255, g * 255, g * 255]; - } - var pure = [0, 0, 0]; - var hi = h % 1 * 6; - var v = hi % 1; - var w = 1 - v; - var mg = 0; - switch (Math.floor(hi)) { - case 0: - pure[0] = 1; - pure[1] = v; - pure[2] = 0; - break; - case 1: - pure[0] = w; - pure[1] = 1; - pure[2] = 0; - break; - case 2: - pure[0] = 0; - pure[1] = 1; - pure[2] = v; - break; - case 3: - pure[0] = 0; - pure[1] = w; - pure[2] = 1; - break; - case 4: - pure[0] = v; - pure[1] = 0; - pure[2] = 1; - break; - default: - pure[0] = 1; - pure[1] = 0; - pure[2] = w; + return frame; } - mg = (1 - c) * g; - return [ - (c * pure[0] + mg) * 255, - (c * pure[1] + mg) * 255, - (c * pure[2] + mg) * 255 - ]; - }; - convert.hcg.hsv = function(hcg) { - var c = hcg[1] / 100; - var g = hcg[2] / 100; - var v = c + g * (1 - c); - var f = 0; - if (v > 0) { - f = c / v; + } + function _default(rawLines, lineNumber, colNumber, opts = {}) { + if (!deprecationWarningShown) { + deprecationWarningShown = true; + const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`."; + if (process.emitWarning) { + process.emitWarning(message, "DeprecationWarning"); + } else { + const deprecationError = new Error(message); + deprecationError.name = "DeprecationWarning"; + console.warn(new Error(message)); + } } - return [hcg[0], f * 100, v * 100]; - }; - convert.hcg.hsl = function(hcg) { - var c = hcg[1] / 100; - var g = hcg[2] / 100; - var l = g * (1 - c) + 0.5 * c; - var s = 0; - if (l > 0 && l < 0.5) { - s = c / (2 * l); - } else if (l >= 0.5 && l < 1) { - s = c / (2 * (1 - l)); + colNumber = Math.max(colNumber, 0); + const location = { + start: { + column: colNumber, + line: lineNumber + } + }; + return codeFrameColumns(rawLines, location, opts); + } + } +}); + +// node_modules/parse-json/index.js +var require_parse_json = __commonJS({ + "node_modules/parse-json/index.js"(exports, module2) { + "use strict"; + var errorEx = require_error_ex(); + var fallback = require_json_parse_even_better_errors(); + var { default: LinesAndColumns } = require_build(); + var { codeFrameColumns } = require_lib6(); + var JSONError = errorEx("JSONError", { + fileName: errorEx.append("in %s"), + codeFrame: errorEx.append("\n\n%s\n") + }); + var parseJson2 = (string, reviver, filename) => { + if (typeof reviver === "string") { + filename = reviver; + reviver = null; } - return [hcg[0], s * 100, l * 100]; - }; - convert.hcg.hwb = function(hcg) { - var c = hcg[1] / 100; - var g = hcg[2] / 100; - var v = c + g * (1 - c); - return [hcg[0], (v - c) * 100, (1 - v) * 100]; - }; - convert.hwb.hcg = function(hwb) { - var w = hwb[1] / 100; - var b = hwb[2] / 100; - var v = 1 - b; - var c = v - w; - var g = 0; - if (c < 1) { - g = (v - c) / (1 - c); + try { + try { + return JSON.parse(string, reviver); + } catch (error2) { + fallback(string, reviver); + throw error2; + } + } catch (error2) { + error2.message = error2.message.replace(/\n/g, ""); + const indexMatch = error2.message.match(/in JSON at position (\d+) while parsing/); + const jsonError = new JSONError(error2); + if (filename) { + jsonError.fileName = filename; + } + if (indexMatch && indexMatch.length > 0) { + const lines = new LinesAndColumns(string); + const index = Number(indexMatch[1]); + const location = lines.locationForIndex(index); + const codeFrame = codeFrameColumns( + string, + { start: { line: location.line + 1, column: location.column + 1 } }, + { highlightCode: true } + ); + jsonError.codeFrame = codeFrame; + } + throw jsonError; } - return [hwb[0], c * 100, g * 100]; - }; - convert.apple.rgb = function(apple) { - return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255]; - }; - convert.rgb.apple = function(rgb) { - return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535]; - }; - convert.gray.rgb = function(args) { - return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; - }; - convert.gray.hsl = convert.gray.hsv = function(args) { - return [0, 0, args[0]]; - }; - convert.gray.hwb = function(gray) { - return [0, 100, gray[0]]; - }; - convert.gray.cmyk = function(gray) { - return [0, 0, 0, gray[0]]; - }; - convert.gray.lab = function(gray) { - return [gray[0], 0, 0]; - }; - convert.gray.hex = function(gray) { - var val = Math.round(gray[0] / 100 * 255) & 255; - var integer = (val << 16) + (val << 8) + val; - var string = integer.toString(16).toUpperCase(); - return "000000".substring(string.length) + string; - }; - convert.rgb.gray = function(rgb) { - var val = (rgb[0] + rgb[1] + rgb[2]) / 3; - return [val / 255 * 100]; }; + parseJson2.JSONError = JSONError; + module2.exports = parseJson2; } }); -// node_modules/@babel/code-frame/node_modules/color-convert/route.js -var require_route2 = __commonJS({ - "node_modules/@babel/code-frame/node_modules/color-convert/route.js"(exports, module2) { - var conversions = require_conversions2(); - function buildGraph() { - var graph = {}; - var models = Object.keys(conversions); - for (var len = models.length, i = 0; i < len; i++) { - graph[models[i]] = { - // http://jsperf.com/1-vs-infinity - // micro-opt, but this is simple. - distance: -1, - parent: null - }; - } - return graph; +// node_modules/js-yaml/lib/common.js +var require_common2 = __commonJS({ + "node_modules/js-yaml/lib/common.js"(exports, module2) { + "use strict"; + function isNothing(subject) { + return typeof subject === "undefined" || subject === null; } - function deriveBFS(fromModel) { - var graph = buildGraph(); - var queue = [fromModel]; - graph[fromModel].distance = 0; - while (queue.length) { - var current = queue.pop(); - var adjacents = Object.keys(conversions[current]); - for (var len = adjacents.length, i = 0; i < len; i++) { - var adjacent = adjacents[i]; - var node = graph[adjacent]; - if (node.distance === -1) { - node.distance = graph[current].distance + 1; - node.parent = current; - queue.unshift(adjacent); - } - } - } - return graph; + function isObject(subject) { + return typeof subject === "object" && subject !== null; } - function link(from, to) { - return function(args) { - return to(from(args)); - }; + function toArray3(sequence) { + if (Array.isArray(sequence)) + return sequence; + else if (isNothing(sequence)) + return []; + return [sequence]; } - function wrapConversion(toModel, graph) { - var path16 = [graph[toModel].parent, toModel]; - var fn = conversions[graph[toModel].parent][toModel]; - var cur = graph[toModel].parent; - while (graph[cur].parent) { - path16.unshift(graph[cur].parent); - fn = link(conversions[graph[cur].parent][cur], fn); - cur = graph[cur].parent; + function extend(target, source) { + var index, length, key, sourceKeys; + if (source) { + sourceKeys = Object.keys(source); + for (index = 0, length = sourceKeys.length; index < length; index += 1) { + key = sourceKeys[index]; + target[key] = source[key]; + } } - fn.conversion = path16; - return fn; + return target; } - module2.exports = function(fromModel) { - var graph = deriveBFS(fromModel); - var conversion = {}; - var models = Object.keys(graph); - for (var len = models.length, i = 0; i < len; i++) { - var toModel = models[i]; - var node = graph[toModel]; - if (node.parent === null) { - continue; - } - conversion[toModel] = wrapConversion(toModel, graph); + function repeat(string, count3) { + var result = "", cycle; + for (cycle = 0; cycle < count3; cycle += 1) { + result += string; } - return conversion; - }; + return result; + } + function isNegativeZero(number) { + return number === 0 && Number.NEGATIVE_INFINITY === 1 / number; + } + module2.exports.isNothing = isNothing; + module2.exports.isObject = isObject; + module2.exports.toArray = toArray3; + module2.exports.repeat = repeat; + module2.exports.isNegativeZero = isNegativeZero; + module2.exports.extend = extend; } }); -// node_modules/@babel/code-frame/node_modules/color-convert/index.js -var require_color_convert2 = __commonJS({ - "node_modules/@babel/code-frame/node_modules/color-convert/index.js"(exports, module2) { - var conversions = require_conversions2(); - var route = require_route2(); - var convert = {}; - var models = Object.keys(conversions); - function wrapRaw(fn) { - var wrappedFn = function(args) { - if (args === void 0 || args === null) { - return args; - } - if (arguments.length > 1) { - args = Array.prototype.slice.call(arguments); - } - return fn(args); - }; - if ("conversion" in fn) { - wrappedFn.conversion = fn.conversion; +// node_modules/js-yaml/lib/exception.js +var require_exception = __commonJS({ + "node_modules/js-yaml/lib/exception.js"(exports, module2) { + "use strict"; + function formatError(exception, compact) { + var where = "", message = exception.reason || "(unknown reason)"; + if (!exception.mark) + return message; + if (exception.mark.name) { + where += 'in "' + exception.mark.name + '" '; } - return wrappedFn; + where += "(" + (exception.mark.line + 1) + ":" + (exception.mark.column + 1) + ")"; + if (!compact && exception.mark.snippet) { + where += "\n\n" + exception.mark.snippet; + } + return message + " " + where; } - function wrapRounded(fn) { - var wrappedFn = function(args) { - if (args === void 0 || args === null) { - return args; - } - if (arguments.length > 1) { - args = Array.prototype.slice.call(arguments); - } - var result = fn(args); - if (typeof result === "object") { - for (var len = result.length, i = 0; i < len; i++) { - result[i] = Math.round(result[i]); - } - } - return result; - }; - if ("conversion" in fn) { - wrappedFn.conversion = fn.conversion; + function YAMLException(reason, mark) { + Error.call(this); + this.name = "YAMLException"; + this.reason = reason; + this.mark = mark; + this.message = formatError(this, false); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = new Error().stack || ""; } - return wrappedFn; } - models.forEach(function(fromModel) { - convert[fromModel] = {}; - Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels }); - Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels }); - var routes = route(fromModel); - var routeModels = Object.keys(routes); - routeModels.forEach(function(toModel) { - var fn = routes[toModel]; - convert[fromModel][toModel] = wrapRounded(fn); - convert[fromModel][toModel].raw = wrapRaw(fn); - }); - }); - module2.exports = convert; + YAMLException.prototype = Object.create(Error.prototype); + YAMLException.prototype.constructor = YAMLException; + YAMLException.prototype.toString = function toString(compact) { + return this.name + ": " + formatError(this, compact); + }; + module2.exports = YAMLException; } }); -// node_modules/@babel/code-frame/node_modules/ansi-styles/index.js -var require_ansi_styles2 = __commonJS({ - "node_modules/@babel/code-frame/node_modules/ansi-styles/index.js"(exports, module2) { +// node_modules/js-yaml/lib/snippet.js +var require_snippet = __commonJS({ + "node_modules/js-yaml/lib/snippet.js"(exports, module2) { "use strict"; - var colorConvert = require_color_convert2(); - var wrapAnsi16 = (fn, offset) => function() { - const code = fn.apply(colorConvert, arguments); - return `\x1B[${code + offset}m`; - }; - var wrapAnsi256 = (fn, offset) => function() { - const code = fn.apply(colorConvert, arguments); - return `\x1B[${38 + offset};5;${code}m`; - }; - var wrapAnsi16m = (fn, offset) => function() { - const rgb = fn.apply(colorConvert, arguments); - return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; - }; - function assembleStyles() { - const codes2 = /* @__PURE__ */ new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - gray: [90, 39], - // Bright color - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - styles.color.grey = styles.color.gray; - for (const groupName of Object.keys(styles)) { - const group = styles[groupName]; - for (const styleName of Object.keys(group)) { - const style = group[styleName]; - styles[styleName] = { - open: `\x1B[${style[0]}m`, - close: `\x1B[${style[1]}m` - }; - group[styleName] = styles[styleName]; - codes2.set(style[0], style[1]); - } - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - Object.defineProperty(styles, "codes", { - value: codes2, - enumerable: false - }); - } - const ansi2ansi = (n) => n; - const rgb2rgb = (r, g, b) => [r, g, b]; - styles.color.close = "\x1B[39m"; - styles.bgColor.close = "\x1B[49m"; - styles.color.ansi = { - ansi: wrapAnsi16(ansi2ansi, 0) - }; - styles.color.ansi256 = { - ansi256: wrapAnsi256(ansi2ansi, 0) - }; - styles.color.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 0) - }; - styles.bgColor.ansi = { - ansi: wrapAnsi16(ansi2ansi, 10) - }; - styles.bgColor.ansi256 = { - ansi256: wrapAnsi256(ansi2ansi, 10) - }; - styles.bgColor.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 10) - }; - for (let key of Object.keys(colorConvert)) { - if (typeof colorConvert[key] !== "object") { - continue; - } - const suite = colorConvert[key]; - if (key === "ansi16") { - key = "ansi"; - } - if ("ansi16" in suite) { - styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); - styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); - } - if ("ansi256" in suite) { - styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); - styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); - } - if ("rgb" in suite) { - styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); - styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); - } + var common = require_common2(); + function getLine(buffer, lineStart, lineEnd, position, maxLineLength) { + var head = ""; + var tail = ""; + var maxHalfLength = Math.floor(maxLineLength / 2) - 1; + if (position - lineStart > maxHalfLength) { + head = " ... "; + lineStart = position - maxHalfLength + head.length; } - return styles; - } - Object.defineProperty(module2, "exports", { - enumerable: true, - get: assembleStyles - }); - } -}); - -// node_modules/@babel/code-frame/node_modules/has-flag/index.js -var require_has_flag2 = __commonJS({ - "node_modules/@babel/code-frame/node_modules/has-flag/index.js"(exports, module2) { - "use strict"; - module2.exports = (flag, argv) => { - argv = argv || process.argv; - const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; - const pos = argv.indexOf(prefix + flag); - const terminatorPos = argv.indexOf("--"); - return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); - }; - } -}); - -// node_modules/@babel/code-frame/node_modules/supports-color/index.js -var require_supports_color2 = __commonJS({ - "node_modules/@babel/code-frame/node_modules/supports-color/index.js"(exports, module2) { - "use strict"; - var os = require("os"); - var hasFlag = require_has_flag2(); - var env = process.env; - var forceColor; - if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) { - forceColor = false; - } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { - forceColor = true; - } - if ("FORCE_COLOR" in env) { - forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; - } - function translateLevel(level) { - if (level === 0) { - return false; + if (lineEnd - position > maxHalfLength) { + tail = " ..."; + lineEnd = position + maxHalfLength - tail.length; } return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 + str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "\u2192") + tail, + pos: position - lineStart + head.length + // relative position }; } - function supportsColor(stream) { - if (forceColor === false) { - return 0; - } - if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { - return 3; - } - if (hasFlag("color=256")) { - return 2; - } - if (stream && !stream.isTTY && forceColor !== true) { - return 0; - } - const min = forceColor ? 1 : 0; - if (process.platform === "win32") { - const osRelease = os.release().split("."); - if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - return 1; - } - if ("CI" in env) { - if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env) || env.CI_NAME === "codeship") { - return 1; - } - return min; - } - if ("TEAMCITY_VERSION" in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - if (env.COLORTERM === "truecolor") { - return 3; - } - if ("TERM_PROGRAM" in env) { - const version3 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch (env.TERM_PROGRAM) { - case "iTerm.app": - return version3 >= 3 ? 3 : 2; - case "Apple_Terminal": - return 2; + function padStart(string, max4) { + return common.repeat(" ", max4 - string.length) + string; + } + function makeSnippet(mark, options) { + options = Object.create(options || null); + if (!mark.buffer) + return null; + if (!options.maxLength) + options.maxLength = 79; + if (typeof options.indent !== "number") + options.indent = 1; + if (typeof options.linesBefore !== "number") + options.linesBefore = 3; + if (typeof options.linesAfter !== "number") + options.linesAfter = 2; + var re = /\r?\n|\r|\0/g; + var lineStarts = [0]; + var lineEnds = []; + var match2; + var foundLineNo = -1; + while (match2 = re.exec(mark.buffer)) { + lineEnds.push(match2.index); + lineStarts.push(match2.index + match2[0].length); + if (mark.position <= match2.index && foundLineNo < 0) { + foundLineNo = lineStarts.length - 2; } } - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } - if ("COLORTERM" in env) { - return 1; + if (foundLineNo < 0) + foundLineNo = lineStarts.length - 1; + var result = "", i, line; + var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length; + var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3); + for (i = 1; i <= options.linesBefore; i++) { + if (foundLineNo - i < 0) + break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo - i], + lineEnds[foundLineNo - i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), + maxLineLength + ); + result = common.repeat(" ", options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line.str + "\n" + result; } - if (env.TERM === "dumb") { - return min; + line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); + result += common.repeat(" ", options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n"; + result += common.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n"; + for (i = 1; i <= options.linesAfter; i++) { + if (foundLineNo + i >= lineEnds.length) + break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo + i], + lineEnds[foundLineNo + i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), + maxLineLength + ); + result += common.repeat(" ", options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line.str + "\n"; } - return min; - } - function getSupportLevel(stream) { - const level = supportsColor(stream); - return translateLevel(level); + return result.replace(/\n$/, ""); } - module2.exports = { - supportsColor: getSupportLevel, - stdout: getSupportLevel(process.stdout), - stderr: getSupportLevel(process.stderr) - }; + module2.exports = makeSnippet; } }); -// node_modules/@babel/code-frame/node_modules/chalk/templates.js -var require_templates2 = __commonJS({ - "node_modules/@babel/code-frame/node_modules/chalk/templates.js"(exports, module2) { +// node_modules/js-yaml/lib/type.js +var require_type = __commonJS({ + "node_modules/js-yaml/lib/type.js"(exports, module2) { "use strict"; - var TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; - var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; - var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; - var ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi; - var ESCAPES = /* @__PURE__ */ new Map([ - ["n", "\n"], - ["r", "\r"], - ["t", " "], - ["b", "\b"], - ["f", "\f"], - ["v", "\v"], - ["0", "\0"], - ["\\", "\\"], - ["e", "\x1B"], - ["a", "\x07"] - ]); - function unescape2(c) { - if (c[0] === "u" && c.length === 5 || c[0] === "x" && c.length === 3) { - return String.fromCharCode(parseInt(c.slice(1), 16)); - } - return ESCAPES.get(c) || c; - } - function parseArguments(name, args) { - const results = []; - const chunks = args.trim().split(/\s*,\s*/g); - let matches; - for (const chunk of chunks) { - if (!isNaN(chunk)) { - results.push(Number(chunk)); - } else if (matches = chunk.match(STRING_REGEX)) { - results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape2(escape) : chr)); - } else { - throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); - } - } - return results; - } - function parseStyle(style) { - STYLE_REGEX.lastIndex = 0; - const results = []; - let matches; - while ((matches = STYLE_REGEX.exec(style)) !== null) { - const name = matches[1]; - if (matches[2]) { - const args = parseArguments(name, matches[2]); - results.push([name].concat(args)); - } else { - results.push([name]); - } - } - return results; - } - function buildStyle(chalk3, styles) { - const enabled = {}; - for (const layer of styles) { - for (const style of layer.styles) { - enabled[style[0]] = layer.inverse ? null : style.slice(1); - } - } - let current = chalk3; - for (const styleName of Object.keys(enabled)) { - if (Array.isArray(enabled[styleName])) { - if (!(styleName in current)) { - throw new Error(`Unknown Chalk style: ${styleName}`); - } - if (enabled[styleName].length > 0) { - current = current[styleName].apply(current, enabled[styleName]); - } else { - current = current[styleName]; - } - } + var YAMLException = require_exception(); + var TYPE_CONSTRUCTOR_OPTIONS = [ + "kind", + "multi", + "resolve", + "construct", + "instanceOf", + "predicate", + "represent", + "representName", + "defaultStyle", + "styleAliases" + ]; + var YAML_NODE_KINDS = [ + "scalar", + "sequence", + "mapping" + ]; + function compileStyleAliases(map3) { + var result = {}; + if (map3 !== null) { + Object.keys(map3).forEach(function(style) { + map3[style].forEach(function(alias) { + result[String(alias)] = style; + }); + }); } - return current; + return result; } - module2.exports = (chalk3, tmp) => { - const styles = []; - const chunks = []; - let chunk = []; - tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => { - if (escapeChar) { - chunk.push(unescape2(escapeChar)); - } else if (style) { - const str = chunk.join(""); - chunk = []; - chunks.push(styles.length === 0 ? str : buildStyle(chalk3, styles)(str)); - styles.push({ inverse, styles: parseStyle(style) }); - } else if (close) { - if (styles.length === 0) { - throw new Error("Found extraneous } in Chalk template literal"); - } - chunks.push(buildStyle(chalk3, styles)(chunk.join(""))); - chunk = []; - styles.pop(); - } else { - chunk.push(chr); + function Type(tag, options) { + options = options || {}; + Object.keys(options).forEach(function(name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); } }); - chunks.push(chunk.join("")); - if (styles.length > 0) { - const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`; - throw new Error(errMsg); + this.options = options; + this.tag = tag; + this.kind = options["kind"] || null; + this.resolve = options["resolve"] || function() { + return true; + }; + this.construct = options["construct"] || function(data) { + return data; + }; + this.instanceOf = options["instanceOf"] || null; + this.predicate = options["predicate"] || null; + this.represent = options["represent"] || null; + this.representName = options["representName"] || null; + this.defaultStyle = options["defaultStyle"] || null; + this.multi = options["multi"] || false; + this.styleAliases = compileStyleAliases(options["styleAliases"] || null); + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); } - return chunks.join(""); - }; + } + module2.exports = Type; } }); -// node_modules/@babel/code-frame/node_modules/chalk/index.js -var require_chalk2 = __commonJS({ - "node_modules/@babel/code-frame/node_modules/chalk/index.js"(exports, module2) { +// node_modules/js-yaml/lib/schema.js +var require_schema = __commonJS({ + "node_modules/js-yaml/lib/schema.js"(exports, module2) { "use strict"; - var escapeStringRegexp = require_escape_string_regexp(); - var ansiStyles = require_ansi_styles2(); - var stdoutColor = require_supports_color2().stdout; - var template2 = require_templates2(); - var isSimpleWindowsTerm = process.platform === "win32" && !(process.env.TERM || "").toLowerCase().startsWith("xterm"); - var levelMapping = ["ansi", "ansi", "ansi256", "ansi16m"]; - var skipModels = /* @__PURE__ */ new Set(["gray"]); - var styles = /* @__PURE__ */ Object.create(null); - function applyOptions(obj, options) { - options = options || {}; - const scLevel = stdoutColor ? stdoutColor.level : 0; - obj.level = options.level === void 0 ? scLevel : options.level; - obj.enabled = "enabled" in options ? options.enabled : obj.level > 0; - } - function Chalk(options) { - if (!this || !(this instanceof Chalk) || this.template) { - const chalk3 = {}; - applyOptions(chalk3, options); - chalk3.template = function() { - const args = [].slice.call(arguments); - return chalkTag.apply(null, [chalk3.template].concat(args)); - }; - Object.setPrototypeOf(chalk3, Chalk.prototype); - Object.setPrototypeOf(chalk3.template, chalk3); - chalk3.template.constructor = Chalk; - return chalk3.template; - } - applyOptions(this, options); - } - if (isSimpleWindowsTerm) { - ansiStyles.blue.open = "\x1B[94m"; + var YAMLException = require_exception(); + var Type = require_type(); + function compileList(schema, name) { + var result = []; + schema[name].forEach(function(currentType) { + var newIndex = result.length; + result.forEach(function(previousType, previousIndex) { + if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) { + newIndex = previousIndex; + } + }); + result[newIndex] = currentType; + }); + return result; } - for (const key of Object.keys(ansiStyles)) { - ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), "g"); - styles[key] = { - get() { - const codes2 = ansiStyles[key]; - return build.call(this, this._styles ? this._styles.concat(codes2) : [codes2], this._empty, key); + function compileMap() { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] + } + }, index, length; + function collectType(type) { + if (type.multi) { + result.multi[type.kind].push(type); + result.multi["fallback"].push(type); + } else { + result[type.kind][type.tag] = result["fallback"][type.tag] = type; } - }; - } - styles.visible = { - get() { - return build.call(this, this._styles || [], true, "visible"); } - }; - ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), "g"); - for (const model of Object.keys(ansiStyles.color.ansi)) { - if (skipModels.has(model)) { - continue; + for (index = 0, length = arguments.length; index < length; index += 1) { + arguments[index].forEach(collectType); } - styles[model] = { - get() { - const level = this.level; - return function() { - const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); - const codes2 = { - open, - close: ansiStyles.color.close, - closeRe: ansiStyles.color.closeRe - }; - return build.call(this, this._styles ? this._styles.concat(codes2) : [codes2], this._empty, model); - }; - } - }; + return result; } - ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), "g"); - for (const model of Object.keys(ansiStyles.bgColor.ansi)) { - if (skipModels.has(model)) { - continue; + function Schema(definition) { + return this.extend(definition); + } + Schema.prototype.extend = function extend(definition) { + var implicit = []; + var explicit = []; + if (definition instanceof Type) { + explicit.push(definition); + } else if (Array.isArray(definition)) { + explicit = explicit.concat(definition); + } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { + if (definition.implicit) + implicit = implicit.concat(definition.implicit); + if (definition.explicit) + explicit = explicit.concat(definition.explicit); + } else { + throw new YAMLException("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })"); } - const bgModel = "bg" + model[0].toUpperCase() + model.slice(1); - styles[bgModel] = { - get() { - const level = this.level; - return function() { - const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); - const codes2 = { - open, - close: ansiStyles.bgColor.close, - closeRe: ansiStyles.bgColor.closeRe - }; - return build.call(this, this._styles ? this._styles.concat(codes2) : [codes2], this._empty, model); - }; + implicit.forEach(function(type) { + if (!(type instanceof Type)) { + throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object."); } - }; - } - var proto = Object.defineProperties(() => { - }, styles); - function build(_styles, _empty, key) { - const builder = function() { - return applyStyle.apply(builder, arguments); - }; - builder._styles = _styles; - builder._empty = _empty; - const self = this; - Object.defineProperty(builder, "level", { - enumerable: true, - get() { - return self.level; - }, - set(level) { - self.level = level; + if (type.loadKind && type.loadKind !== "scalar") { + throw new YAMLException("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported."); } - }); - Object.defineProperty(builder, "enabled", { - enumerable: true, - get() { - return self.enabled; - }, - set(enabled) { - self.enabled = enabled; + if (type.multi) { + throw new YAMLException("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit."); } }); - builder.hasGrey = this.hasGrey || key === "gray" || key === "grey"; - builder.__proto__ = proto; - return builder; - } - function applyStyle() { - const args = arguments; - const argsLen = args.length; - let str = String(arguments[0]); - if (argsLen === 0) { - return ""; - } - if (argsLen > 1) { - for (let a = 1; a < argsLen; a++) { - str += " " + args[a]; + explicit.forEach(function(type) { + if (!(type instanceof Type)) { + throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object."); } - } - if (!this.enabled || this.level <= 0 || !str) { - return this._empty ? "" : str; - } - const originalDim = ansiStyles.dim.open; - if (isSimpleWindowsTerm && this.hasGrey) { - ansiStyles.dim.open = ""; - } - for (const code of this._styles.slice().reverse()) { - str = code.open + str.replace(code.closeRe, code.open) + code.close; - str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); - } - ansiStyles.dim.open = originalDim; - return str; - } - function chalkTag(chalk3, strings) { - if (!Array.isArray(strings)) { - return [].slice.call(arguments, 1).join(" "); - } - const args = [].slice.call(arguments, 2); - const parts = [strings.raw[0]]; - for (let i = 1; i < strings.length; i++) { - parts.push(String(args[i - 1]).replace(/[{}\\]/g, "\\$&")); - parts.push(String(strings.raw[i])); - } - return template2(chalk3, parts.join("")); - } - Object.defineProperties(Chalk.prototype, styles); - module2.exports = Chalk(); - module2.exports.supportsColor = stdoutColor; - module2.exports.default = module2.exports; - } -}); - -// node_modules/@babel/code-frame/lib/index.js -var require_lib6 = __commonJS({ - "node_modules/@babel/code-frame/lib/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.codeFrameColumns = codeFrameColumns; - exports.default = _default; - var _highlight = require_lib5(); - var _chalk2 = require_chalk2(); - var chalk3 = _chalk2; - var chalkWithForcedColor = void 0; - function getChalk(forceColor) { - if (forceColor) { - var _chalkWithForcedColor; - (_chalkWithForcedColor = chalkWithForcedColor) != null ? _chalkWithForcedColor : chalkWithForcedColor = new chalk3.constructor({ - enabled: true, - level: 1 - }); - return chalkWithForcedColor; - } - return chalk3; - } - var deprecationWarningShown = false; - function getDefs(chalk4) { - return { - gutter: chalk4.grey, - marker: chalk4.red.bold, - message: chalk4.red.bold - }; - } - var NEWLINE = /\r\n|[\n\r\u2028\u2029]/; - function getMarkerLines(loc, source, opts) { - const startLoc = Object.assign({ - column: 0, - line: -1 - }, loc.start); - const endLoc = Object.assign({}, startLoc, loc.end); - const { - linesAbove = 2, - linesBelow = 3 - } = opts || {}; - const startLine = startLoc.line; - const startColumn = startLoc.column; - const endLine = endLoc.line; - const endColumn = endLoc.column; - let start = Math.max(startLine - (linesAbove + 1), 0); - let end = Math.min(source.length, endLine + linesBelow); - if (startLine === -1) { - start = 0; - } - if (endLine === -1) { - end = source.length; - } - const lineDiff = endLine - startLine; - const markerLines = {}; - if (lineDiff) { - for (let i = 0; i <= lineDiff; i++) { - const lineNumber = i + startLine; - if (!startColumn) { - markerLines[lineNumber] = true; - } else if (i === 0) { - const sourceLength = source[lineNumber - 1].length; - markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1]; - } else if (i === lineDiff) { - markerLines[lineNumber] = [0, endColumn]; - } else { - const sourceLength = source[lineNumber - i].length; - markerLines[lineNumber] = [0, sourceLength]; - } - } - } else { - if (startColumn === endColumn) { - if (startColumn) { - markerLines[startLine] = [startColumn, 0]; - } else { - markerLines[startLine] = true; - } - } else { - markerLines[startLine] = [startColumn, endColumn - startColumn]; - } - } - return { - start, - end, - markerLines - }; - } - function codeFrameColumns(rawLines, loc, opts = {}) { - const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts); - const chalk4 = getChalk(opts.forceColor); - const defs = getDefs(chalk4); - const maybeHighlight = (chalkFn, string) => { - return highlighted ? chalkFn(string) : string; - }; - const lines = rawLines.split(NEWLINE); - const { - start, - end, - markerLines - } = getMarkerLines(loc, lines, opts); - const hasColumns = loc.start && typeof loc.start.column === "number"; - const numberMaxWidth = String(end).length; - const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines; - let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => { - const number = start + 1 + index; - const paddedNumber = ` ${number}`.slice(-numberMaxWidth); - const gutter = ` ${paddedNumber} |`; - const hasMarker = markerLines[number]; - const lastMarkerLine = !markerLines[number + 1]; - if (hasMarker) { - let markerLine = ""; - if (Array.isArray(hasMarker)) { - const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " "); - const numberOfMarkers = hasMarker[1] || 1; - markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), " ", markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join(""); - if (lastMarkerLine && opts.message) { - markerLine += " " + maybeHighlight(defs.message, opts.message); - } - } - return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line.length > 0 ? ` ${line}` : "", markerLine].join(""); - } else { - return ` ${maybeHighlight(defs.gutter, gutter)}${line.length > 0 ? ` ${line}` : ""}`; - } - }).join("\n"); - if (opts.message && !hasColumns) { - frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message} -${frame}`; - } - if (highlighted) { - return chalk4.reset(frame); - } else { - return frame; - } - } - function _default(rawLines, lineNumber, colNumber, opts = {}) { - if (!deprecationWarningShown) { - deprecationWarningShown = true; - const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`."; - if (process.emitWarning) { - process.emitWarning(message, "DeprecationWarning"); - } else { - const deprecationError = new Error(message); - deprecationError.name = "DeprecationWarning"; - console.warn(new Error(message)); - } - } - colNumber = Math.max(colNumber, 0); - const location = { - start: { - column: colNumber, - line: lineNumber - } - }; - return codeFrameColumns(rawLines, location, opts); - } - } -}); - -// node_modules/parse-json/index.js -var require_parse_json = __commonJS({ - "node_modules/parse-json/index.js"(exports, module2) { - "use strict"; - var errorEx = require_error_ex(); - var fallback = require_json_parse_even_better_errors(); - var { default: LinesAndColumns } = require_build(); - var { codeFrameColumns } = require_lib6(); - var JSONError = errorEx("JSONError", { - fileName: errorEx.append("in %s"), - codeFrame: errorEx.append("\n\n%s\n") - }); - var parseJson = (string, reviver, filename) => { - if (typeof reviver === "string") { - filename = reviver; - reviver = null; - } - try { - try { - return JSON.parse(string, reviver); - } catch (error2) { - fallback(string, reviver); - throw error2; - } - } catch (error2) { - error2.message = error2.message.replace(/\n/g, ""); - const indexMatch = error2.message.match(/in JSON at position (\d+) while parsing/); - const jsonError = new JSONError(error2); - if (filename) { - jsonError.fileName = filename; - } - if (indexMatch && indexMatch.length > 0) { - const lines = new LinesAndColumns(string); - const index = Number(indexMatch[1]); - const location = lines.locationForIndex(index); - const codeFrame = codeFrameColumns( - string, - { start: { line: location.line + 1, column: location.column + 1 } }, - { highlightCode: true } - ); - jsonError.codeFrame = codeFrame; - } - throw jsonError; - } - }; - parseJson.JSONError = JSONError; - module2.exports = parseJson; - } -}); - -// node_modules/js-yaml/lib/common.js -var require_common2 = __commonJS({ - "node_modules/js-yaml/lib/common.js"(exports, module2) { - "use strict"; - function isNothing(subject) { - return typeof subject === "undefined" || subject === null; - } - function isObject(subject) { - return typeof subject === "object" && subject !== null; - } - function toArray3(sequence) { - if (Array.isArray(sequence)) - return sequence; - else if (isNothing(sequence)) - return []; - return [sequence]; - } - function extend(target, source) { - var index, length, key, sourceKeys; - if (source) { - sourceKeys = Object.keys(source); - for (index = 0, length = sourceKeys.length; index < length; index += 1) { - key = sourceKeys[index]; - target[key] = source[key]; - } - } - return target; - } - function repeat(string, count) { - var result = "", cycle; - for (cycle = 0; cycle < count; cycle += 1) { - result += string; - } - return result; - } - function isNegativeZero(number) { - return number === 0 && Number.NEGATIVE_INFINITY === 1 / number; - } - module2.exports.isNothing = isNothing; - module2.exports.isObject = isObject; - module2.exports.toArray = toArray3; - module2.exports.repeat = repeat; - module2.exports.isNegativeZero = isNegativeZero; - module2.exports.extend = extend; - } -}); - -// node_modules/js-yaml/lib/exception.js -var require_exception = __commonJS({ - "node_modules/js-yaml/lib/exception.js"(exports, module2) { - "use strict"; - function formatError(exception, compact) { - var where = "", message = exception.reason || "(unknown reason)"; - if (!exception.mark) - return message; - if (exception.mark.name) { - where += 'in "' + exception.mark.name + '" '; - } - where += "(" + (exception.mark.line + 1) + ":" + (exception.mark.column + 1) + ")"; - if (!compact && exception.mark.snippet) { - where += "\n\n" + exception.mark.snippet; - } - return message + " " + where; - } - function YAMLException(reason, mark) { - Error.call(this); - this.name = "YAMLException"; - this.reason = reason; - this.mark = mark; - this.message = formatError(this, false); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } else { - this.stack = new Error().stack || ""; - } - } - YAMLException.prototype = Object.create(Error.prototype); - YAMLException.prototype.constructor = YAMLException; - YAMLException.prototype.toString = function toString(compact) { - return this.name + ": " + formatError(this, compact); - }; - module2.exports = YAMLException; - } -}); - -// node_modules/js-yaml/lib/snippet.js -var require_snippet = __commonJS({ - "node_modules/js-yaml/lib/snippet.js"(exports, module2) { - "use strict"; - var common = require_common2(); - function getLine(buffer, lineStart, lineEnd, position, maxLineLength) { - var head = ""; - var tail = ""; - var maxHalfLength = Math.floor(maxLineLength / 2) - 1; - if (position - lineStart > maxHalfLength) { - head = " ... "; - lineStart = position - maxHalfLength + head.length; - } - if (lineEnd - position > maxHalfLength) { - tail = " ..."; - lineEnd = position + maxHalfLength - tail.length; - } - return { - str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "\u2192") + tail, - pos: position - lineStart + head.length - // relative position - }; - } - function padStart(string, max) { - return common.repeat(" ", max - string.length) + string; - } - function makeSnippet(mark, options) { - options = Object.create(options || null); - if (!mark.buffer) - return null; - if (!options.maxLength) - options.maxLength = 79; - if (typeof options.indent !== "number") - options.indent = 1; - if (typeof options.linesBefore !== "number") - options.linesBefore = 3; - if (typeof options.linesAfter !== "number") - options.linesAfter = 2; - var re = /\r?\n|\r|\0/g; - var lineStarts = [0]; - var lineEnds = []; - var match; - var foundLineNo = -1; - while (match = re.exec(mark.buffer)) { - lineEnds.push(match.index); - lineStarts.push(match.index + match[0].length); - if (mark.position <= match.index && foundLineNo < 0) { - foundLineNo = lineStarts.length - 2; - } - } - if (foundLineNo < 0) - foundLineNo = lineStarts.length - 1; - var result = "", i, line; - var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length; - var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3); - for (i = 1; i <= options.linesBefore; i++) { - if (foundLineNo - i < 0) - break; - line = getLine( - mark.buffer, - lineStarts[foundLineNo - i], - lineEnds[foundLineNo - i], - mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), - maxLineLength - ); - result = common.repeat(" ", options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line.str + "\n" + result; - } - line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); - result += common.repeat(" ", options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n"; - result += common.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n"; - for (i = 1; i <= options.linesAfter; i++) { - if (foundLineNo + i >= lineEnds.length) - break; - line = getLine( - mark.buffer, - lineStarts[foundLineNo + i], - lineEnds[foundLineNo + i], - mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), - maxLineLength - ); - result += common.repeat(" ", options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line.str + "\n"; - } - return result.replace(/\n$/, ""); - } - module2.exports = makeSnippet; - } -}); - -// node_modules/js-yaml/lib/type.js -var require_type = __commonJS({ - "node_modules/js-yaml/lib/type.js"(exports, module2) { - "use strict"; - var YAMLException = require_exception(); - var TYPE_CONSTRUCTOR_OPTIONS = [ - "kind", - "multi", - "resolve", - "construct", - "instanceOf", - "predicate", - "represent", - "representName", - "defaultStyle", - "styleAliases" - ]; - var YAML_NODE_KINDS = [ - "scalar", - "sequence", - "mapping" - ]; - function compileStyleAliases(map) { - var result = {}; - if (map !== null) { - Object.keys(map).forEach(function(style) { - map[style].forEach(function(alias) { - result[String(alias)] = style; - }); - }); - } - return result; - } - function Type(tag, options) { - options = options || {}; - Object.keys(options).forEach(function(name) { - if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { - throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); - } - }); - this.options = options; - this.tag = tag; - this.kind = options["kind"] || null; - this.resolve = options["resolve"] || function() { - return true; - }; - this.construct = options["construct"] || function(data) { - return data; - }; - this.instanceOf = options["instanceOf"] || null; - this.predicate = options["predicate"] || null; - this.represent = options["represent"] || null; - this.representName = options["representName"] || null; - this.defaultStyle = options["defaultStyle"] || null; - this.multi = options["multi"] || false; - this.styleAliases = compileStyleAliases(options["styleAliases"] || null); - if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { - throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); - } - } - module2.exports = Type; - } -}); - -// node_modules/js-yaml/lib/schema.js -var require_schema = __commonJS({ - "node_modules/js-yaml/lib/schema.js"(exports, module2) { - "use strict"; - var YAMLException = require_exception(); - var Type = require_type(); - function compileList(schema, name) { - var result = []; - schema[name].forEach(function(currentType) { - var newIndex = result.length; - result.forEach(function(previousType, previousIndex) { - if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) { - newIndex = previousIndex; - } - }); - result[newIndex] = currentType; - }); - return result; - } - function compileMap() { - var result = { - scalar: {}, - sequence: {}, - mapping: {}, - fallback: {}, - multi: { - scalar: [], - sequence: [], - mapping: [], - fallback: [] - } - }, index, length; - function collectType(type) { - if (type.multi) { - result.multi[type.kind].push(type); - result.multi["fallback"].push(type); - } else { - result[type.kind][type.tag] = result["fallback"][type.tag] = type; - } - } - for (index = 0, length = arguments.length; index < length; index += 1) { - arguments[index].forEach(collectType); - } - return result; - } - function Schema(definition) { - return this.extend(definition); - } - Schema.prototype.extend = function extend(definition) { - var implicit = []; - var explicit = []; - if (definition instanceof Type) { - explicit.push(definition); - } else if (Array.isArray(definition)) { - explicit = explicit.concat(definition); - } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { - if (definition.implicit) - implicit = implicit.concat(definition.implicit); - if (definition.explicit) - explicit = explicit.concat(definition.explicit); - } else { - throw new YAMLException("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })"); - } - implicit.forEach(function(type) { - if (!(type instanceof Type)) { - throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object."); - } - if (type.loadKind && type.loadKind !== "scalar") { - throw new YAMLException("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported."); - } - if (type.multi) { - throw new YAMLException("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit."); - } - }); - explicit.forEach(function(type) { - if (!(type instanceof Type)) { - throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object."); - } - }); - var result = Object.create(Schema.prototype); - result.implicit = (this.implicit || []).concat(implicit); - result.explicit = (this.explicit || []).concat(explicit); - result.compiledImplicit = compileList(result, "implicit"); - result.compiledExplicit = compileList(result, "explicit"); - result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); - return result; - }; - module2.exports = Schema; + }); + var result = Object.create(Schema.prototype); + result.implicit = (this.implicit || []).concat(implicit); + result.explicit = (this.explicit || []).concat(explicit); + result.compiledImplicit = compileList(result, "implicit"); + result.compiledExplicit = compileList(result, "explicit"); + result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); + return result; + }; + module2.exports = Schema; } }); @@ -26035,8 +24075,8 @@ var require_null = __commonJS({ function resolveYamlNull(data) { if (data === null) return true; - var max = data.length; - return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL"); + var max4 = data.length; + return max4 === 1 && data === "~" || max4 === 4 && (data === "null" || data === "Null" || data === "NULL"); } function constructYamlNull() { return null; @@ -26079,8 +24119,8 @@ var require_bool = __commonJS({ function resolveYamlBoolean(data) { if (data === null) return false; - var max = data.length; - return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE"); + var max4 = data.length; + return max4 === 4 && (data === "true" || data === "True" || data === "TRUE") || max4 === 5 && (data === "false" || data === "False" || data === "FALSE"); } function constructYamlBoolean(data) { return data === "true" || data === "True" || data === "TRUE"; @@ -26127,20 +24167,20 @@ var require_int = __commonJS({ function resolveYamlInteger(data) { if (data === null) return false; - var max = data.length, index = 0, hasDigits = false, ch; - if (!max) + var max4 = data.length, index = 0, hasDigits = false, ch; + if (!max4) return false; ch = data[index]; if (ch === "-" || ch === "+") { ch = data[++index]; } if (ch === "0") { - if (index + 1 === max) + if (index + 1 === max4) return true; ch = data[++index]; if (ch === "b") { index++; - for (; index < max; index++) { + for (; index < max4; index++) { ch = data[index]; if (ch === "_") continue; @@ -26152,7 +24192,7 @@ var require_int = __commonJS({ } if (ch === "x") { index++; - for (; index < max; index++) { + for (; index < max4; index++) { ch = data[index]; if (ch === "_") continue; @@ -26164,7 +24204,7 @@ var require_int = __commonJS({ } if (ch === "o") { index++; - for (; index < max; index++) { + for (; index < max4; index++) { ch = data[index]; if (ch === "_") continue; @@ -26177,7 +24217,7 @@ var require_int = __commonJS({ } if (ch === "_") return false; - for (; index < max; index++) { + for (; index < max4; index++) { ch = data[index]; if (ch === "_") continue; @@ -26376,33 +24416,33 @@ var require_timestamp = __commonJS({ return false; } function constructYamlTimestamp(data) { - var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; - match = YAML_DATE_REGEXP.exec(data); - if (match === null) - match = YAML_TIMESTAMP_REGEXP.exec(data); - if (match === null) + var match2, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; + match2 = YAML_DATE_REGEXP.exec(data); + if (match2 === null) + match2 = YAML_TIMESTAMP_REGEXP.exec(data); + if (match2 === null) throw new Error("Date resolve error"); - year = +match[1]; - month = +match[2] - 1; - day = +match[3]; - if (!match[4]) { + year = +match2[1]; + month = +match2[2] - 1; + day = +match2[3]; + if (!match2[4]) { return new Date(Date.UTC(year, month, day)); } - hour = +match[4]; - minute = +match[5]; - second = +match[6]; - if (match[7]) { - fraction = match[7].slice(0, 3); + hour = +match2[4]; + minute = +match2[5]; + second = +match2[6]; + if (match2[7]) { + fraction = match2[7].slice(0, 3); while (fraction.length < 3) { fraction += "0"; } fraction = +fraction; } - if (match[9]) { - tz_hour = +match[10]; - tz_minute = +(match[11] || 0); + if (match2[9]) { + tz_hour = +match2[10]; + tz_minute = +(match2[11] || 0); delta = (tz_hour * 60 + tz_minute) * 6e4; - if (match[9] === "-") + if (match2[9] === "-") delta = -delta; } date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); @@ -26447,9 +24487,9 @@ var require_binary = __commonJS({ function resolveYamlBinary(data) { if (data === null) return false; - var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; - for (idx = 0; idx < max; idx++) { - code = map.indexOf(data.charAt(idx)); + var code, idx2, bitlen = 0, max4 = data.length, map3 = BASE64_MAP; + for (idx2 = 0; idx2 < max4; idx2++) { + code = map3.indexOf(data.charAt(idx2)); if (code > 64) continue; if (code < 0) @@ -26459,16 +24499,16 @@ var require_binary = __commonJS({ return bitlen % 8 === 0; } function constructYamlBinary(data) { - var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map = BASE64_MAP, bits = 0, result = []; - for (idx = 0; idx < max; idx++) { - if (idx % 4 === 0 && idx) { + var idx2, tailbits, input = data.replace(/[\r\n=]/g, ""), max4 = input.length, map3 = BASE64_MAP, bits = 0, result = []; + for (idx2 = 0; idx2 < max4; idx2++) { + if (idx2 % 4 === 0 && idx2) { result.push(bits >> 16 & 255); result.push(bits >> 8 & 255); result.push(bits & 255); } - bits = bits << 6 | map.indexOf(input.charAt(idx)); + bits = bits << 6 | map3.indexOf(input.charAt(idx2)); } - tailbits = max % 4 * 6; + tailbits = max4 % 4 * 6; if (tailbits === 0) { result.push(bits >> 16 & 255); result.push(bits >> 8 & 255); @@ -26482,32 +24522,32 @@ var require_binary = __commonJS({ return new Uint8Array(result); } function representYamlBinary(object) { - var result = "", bits = 0, idx, tail, max = object.length, map = BASE64_MAP; - for (idx = 0; idx < max; idx++) { - if (idx % 3 === 0 && idx) { - result += map[bits >> 18 & 63]; - result += map[bits >> 12 & 63]; - result += map[bits >> 6 & 63]; - result += map[bits & 63]; + var result = "", bits = 0, idx2, tail, max4 = object.length, map3 = BASE64_MAP; + for (idx2 = 0; idx2 < max4; idx2++) { + if (idx2 % 3 === 0 && idx2) { + result += map3[bits >> 18 & 63]; + result += map3[bits >> 12 & 63]; + result += map3[bits >> 6 & 63]; + result += map3[bits & 63]; } - bits = (bits << 8) + object[idx]; + bits = (bits << 8) + object[idx2]; } - tail = max % 3; + tail = max4 % 3; if (tail === 0) { - result += map[bits >> 18 & 63]; - result += map[bits >> 12 & 63]; - result += map[bits >> 6 & 63]; - result += map[bits & 63]; + result += map3[bits >> 18 & 63]; + result += map3[bits >> 12 & 63]; + result += map3[bits >> 6 & 63]; + result += map3[bits & 63]; } else if (tail === 2) { - result += map[bits >> 10 & 63]; - result += map[bits >> 4 & 63]; - result += map[bits << 2 & 63]; - result += map[64]; + result += map3[bits >> 10 & 63]; + result += map3[bits >> 4 & 63]; + result += map3[bits << 2 & 63]; + result += map3[64]; } else if (tail === 1) { - result += map[bits >> 2 & 63]; - result += map[bits << 4 & 63]; - result += map[64]; - result += map[64]; + result += map3[bits >> 2 & 63]; + result += map3[bits << 4 & 63]; + result += map3[64]; + result += map3[64]; } return result; } @@ -26577,28 +24617,28 @@ var require_pairs = __commonJS({ function resolveYamlPairs(data) { if (data === null) return true; - var index, length, pair, keys, result, object = data; + var index, length, pair, keys2, result, object = data; result = new Array(object.length); for (index = 0, length = object.length; index < length; index += 1) { pair = object[index]; if (_toString.call(pair) !== "[object Object]") return false; - keys = Object.keys(pair); - if (keys.length !== 1) + keys2 = Object.keys(pair); + if (keys2.length !== 1) return false; - result[index] = [keys[0], pair[keys[0]]]; + result[index] = [keys2[0], pair[keys2[0]]]; } return true; } function constructYamlPairs(data) { if (data === null) return []; - var index, length, pair, keys, result, object = data; + var index, length, pair, keys2, result, object = data; result = new Array(object.length); for (index = 0, length = object.length; index < length; index += 1) { pair = object[index]; - keys = Object.keys(pair); - result[index] = [keys[0], pair[keys[0]]]; + keys2 = Object.keys(pair); + result[index] = [keys2[0], pair[keys2[0]]]; } return result; } @@ -26782,19 +24822,19 @@ var require_loader = __commonJS({ } var directiveHandlers = { YAML: function handleYamlDirective(state, name, args) { - var match, major, minor; + var match2, major, minor; if (state.version !== null) { throwError(state, "duplication of %YAML directive"); } if (args.length !== 1) { throwError(state, "YAML directive accepts exactly one argument"); } - match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); - if (match === null) { + match2 = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + if (match2 === null) { throwError(state, "ill-formed argument of the YAML directive"); } - major = parseInt(match[1], 10); - minor = parseInt(match[2], 10); + major = parseInt(match2[1], 10); + minor = parseInt(match2[2], 10); if (major !== 1) { throwError(state, "unacceptable YAML version of the document"); } @@ -26969,11 +25009,11 @@ var require_loader = __commonJS({ } return false; } - function writeFoldedLines(state, count) { - if (count === 1) { + function writeFoldedLines(state, count3) { + if (count3 === 1) { state.result += " "; - } else if (count > 1) { - state.result += common.repeat("\n", count - 1); + } else if (count3 > 1) { + state.result += common.repeat("\n", count3 - 1); } } function readPlainScalar(state, nodeIndent, withinFlowCollection) { @@ -27697,7 +25737,7 @@ var require_loader = __commonJS({ } return state.tag !== null || state.anchor !== null || hasContent; } - function readDocument(state) { + function readDocument2(state) { var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch; state.version = null; state.checkLineBreaks = state.legacy; @@ -27795,7 +25835,7 @@ var require_loader = __commonJS({ state.position += 1; } while (state.position < state.length - 1) { - readDocument(state); + readDocument2(state); } return state.documents; } @@ -27812,7 +25852,7 @@ var require_loader = __commonJS({ iterator(documents[index]); } } - function load(input, options) { + function load2(input, options) { var documents = loadDocuments(input, options); if (documents.length === 0) { return void 0; @@ -27822,7 +25862,7 @@ var require_loader = __commonJS({ throw new YAMLException("expected a single document in the stream, but found more"); } module2.exports.loadAll = loadAll; - module2.exports.load = load; + module2.exports.load = load2; } }); @@ -27895,15 +25935,15 @@ var require_dumper = __commonJS({ "OFF" ]; var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; - function compileStyleMap(schema, map) { - var result, keys, index, length, tag, style, type; - if (map === null) + function compileStyleMap(schema, map3) { + var result, keys2, index, length, tag, style, type; + if (map3 === null) return {}; result = {}; - keys = Object.keys(map); - for (index = 0, length = keys.length; index < length; index += 1) { - tag = keys[index]; - style = String(map[tag]); + keys2 = Object.keys(map3); + for (index = 0, length = keys2.length; index < length; index += 1) { + tag = keys2[index]; + style = String(map3[tag]); if (tag.slice(0, 2) === "!!") { tag = "tag:yaml.org,2002:" + tag.slice(2); } @@ -28013,14 +26053,14 @@ var require_dumper = __commonJS({ return !isWhitespace(c) && c !== CHAR_COLON; } function codePointAt(string, pos) { - var first = string.charCodeAt(pos), second; - if (first >= 55296 && first <= 56319 && pos + 1 < string.length) { + var first3 = string.charCodeAt(pos), second; + if (first3 >= 55296 && first3 <= 56319 && pos + 1 < string.length) { second = string.charCodeAt(pos + 1); if (second >= 56320 && second <= 57343) { - return (first - 55296) * 1024 + second - 56320 + 65536; + return (first3 - 55296) * 1024 + second - 56320 + 65536; } } - return first; + return first3; } function needIndentIndicator(string) { var leadingSpaceRe = /^\n* /; @@ -28142,9 +26182,9 @@ var require_dumper = __commonJS({ }(); var prevMoreIndented = string[0] === "\n" || string[0] === " "; var moreIndented; - var match; - while (match = lineRe.exec(string)) { - var prefix = match[1], line = match[2]; + var match2; + while (match2 = lineRe.exec(string)) { + var prefix = match2[1], line = match2[2]; moreIndented = line[0] === " "; result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width); prevMoreIndented = moreIndented; @@ -28155,11 +26195,11 @@ var require_dumper = __commonJS({ if (line === "" || line[0] === " ") return line; var breakRe = / [^ ]/g; - var match; + var match2; var start = 0, end, curr = 0, next = 0; var result = ""; - while (match = breakRe.exec(line)) { - next = match.index; + while (match2 = breakRe.exec(line)) { + next = match2.index; if (next - start > width) { end = curr > start ? curr : next; result += "\n" + line.slice(start, end); @@ -28470,7 +26510,7 @@ var require_dumper = __commonJS({ var require_js_yaml = __commonJS({ "node_modules/js-yaml/index.js"(exports, module2) { "use strict"; - var loader = require_loader(); + var loader2 = require_loader(); var dumper = require_dumper(); function renamed(from, to) { return function() { @@ -28483,8 +26523,8 @@ var require_js_yaml = __commonJS({ module2.exports.JSON_SCHEMA = require_json(); module2.exports.CORE_SCHEMA = require_core2(); module2.exports.DEFAULT_SCHEMA = require_default(); - module2.exports.load = loader.load; - module2.exports.loadAll = loader.loadAll; + module2.exports.load = loader2.load; + module2.exports.loadAll = loader2.loadAll; module2.exports.dump = dumper.dump; module2.exports.YAMLException = require_exception(); module2.exports.types = { @@ -28516,21 +26556,21 @@ var require_loaders = __commonJS({ value: true }); exports.loaders = void 0; - var importFresh; + var importFresh2; var loadJs = function loadJs2(filepath) { - if (importFresh === void 0) { - importFresh = require_import_fresh(); + if (importFresh2 === void 0) { + importFresh2 = require_import_fresh(); } - const result = importFresh(filepath); + const result = importFresh2(filepath); return result; }; - var parseJson; + var parseJson2; var loadJson = function loadJson2(filepath, content) { - if (parseJson === void 0) { - parseJson = require_parse_json(); + if (parseJson2 === void 0) { + parseJson2 = require_parse_json(); } try { - const result = parseJson(content); + const result = parseJson2(content); return result; } catch (error2) { error2.message = `JSON Error in ${filepath}: @@ -28552,12 +26592,12 @@ ${error2.message}`; throw error2; } }; - var loaders = { + var loaders2 = { loadJs, loadJson, loadYaml }; - exports.loaders = loaders; + exports.loaders = loaders2; } }); @@ -28569,11 +26609,11 @@ var require_getPropertyByPath = __commonJS({ value: true }); exports.getPropertyByPath = getPropertyByPath; - function getPropertyByPath(source, path16) { - if (typeof path16 === "string" && Object.prototype.hasOwnProperty.call(source, path16)) { - return source[path16]; + function getPropertyByPath(source, path26) { + if (typeof path26 === "string" && Object.prototype.hasOwnProperty.call(source, path26)) { + return source[path26]; } - const parsedPath = typeof path16 === "string" ? path16.split(".") : path16; + const parsedPath = typeof path26 === "string" ? path26.split(".") : path26; return parsedPath.reduce((previous, key) => { if (previous === void 0) { return previous; @@ -28626,12 +26666,12 @@ var require_ExplorerBase = __commonJS({ const config = this.config; config.searchPlaces.forEach((place) => { const loaderKey = _path.default.extname(place) || "noExt"; - const loader = config.loaders[loaderKey]; - if (!loader) { + const loader2 = config.loaders[loaderKey]; + if (!loader2) { throw new Error(`No loader specified for ${getExtensionDescription(place)}, so searchPlaces item "${place}" is invalid`); } - if (typeof loader !== "function") { - throw new Error(`loader for ${getExtensionDescription(place)} is not a function (type provided: "${typeof loader}"), so searchPlaces item "${place}" is invalid`); + if (typeof loader2 !== "function") { + throw new Error(`loader for ${getExtensionDescription(place)} is not a function (type provided: "${typeof loader2}"), so searchPlaces item "${place}" is invalid`); } }); } @@ -28659,15 +26699,15 @@ var require_ExplorerBase = __commonJS({ } getLoaderEntryForFile(filepath) { if (_path.default.basename(filepath) === "package.json") { - const loader2 = this.loadPackageProp.bind(this); - return loader2; + const loader3 = this.loadPackageProp.bind(this); + return loader3; } const loaderKey = _path.default.extname(filepath) || "noExt"; - const loader = this.config.loaders[loaderKey]; - if (!loader) { + const loader2 = this.config.loaders[loaderKey]; + if (!loader2) { throw new Error(`No loader specified for ${getExtensionDescription(filepath)}`); } - return loader; + return loader2; } loadedContentToCosmiconfigResult(filepath, loadedContent) { if (loadedContent === null) { @@ -28706,14 +26746,14 @@ var require_ExplorerBase = __commonJS({ var require_path_type = __commonJS({ "node_modules/path-type/index.js"(exports) { "use strict"; - var { promisify: promisify3 } = require("util"); - var fs6 = require("fs"); + var { promisify: promisify4 } = require("util"); + var fs9 = require("fs"); async function isType(fsStatType, statsMethodName, filePath) { if (typeof filePath !== "string") { throw new TypeError(`Expected a string, got ${typeof filePath}`); } try { - const stats = await promisify3(fs6[fsStatType])(filePath); + const stats = await promisify4(fs9[fsStatType])(filePath); return stats[statsMethodName](); } catch (error2) { if (error2.code === "ENOENT") { @@ -28727,7 +26767,7 @@ var require_path_type = __commonJS({ throw new TypeError(`Expected a string, got ${typeof filePath}`); } try { - return fs6[fsStatType](filePath)[statsMethodName](); + return fs9[fsStatType](filePath)[statsMethodName](); } catch (error2) { if (error2.code === "ENOENT") { return false; @@ -28784,24 +26824,24 @@ var require_readFile = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); - exports.readFile = readFile4; - exports.readFileSync = readFileSync5; + exports.readFile = readFile3; + exports.readFileSync = readFileSync3; var _fs = _interopRequireDefault(require("fs")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } async function fsReadFileAsync(pathname, encoding) { - return new Promise((resolve10, reject) => { + return new Promise((resolve13, reject) => { _fs.default.readFile(pathname, encoding, (error2, contents) => { if (error2) { reject(error2); return; } - resolve10(contents); + resolve13(contents); }); }); } - async function readFile4(filepath, options = {}) { + async function readFile3(filepath, options = {}) { const throwNotFound = options.throwNotFound === true; try { const content = await fsReadFileAsync(filepath, "utf8"); @@ -28813,7 +26853,7 @@ var require_readFile = __commonJS({ throw error2; } } - function readFileSync5(filepath, options = {}) { + function readFileSync3(filepath, options = {}) { const throwNotFound = options.throwNotFound === true; try { const content = _fs.default.readFileSync(filepath, "utf8"); @@ -28891,9 +26931,9 @@ var require_Explorer = __commonJS({ if (content.trim() === "") { return void 0; } - const loader = this.getLoaderEntryForFile(filepath); + const loader2 = this.getLoaderEntryForFile(filepath); try { - return await loader(filepath, content); + return await loader2(filepath, content); } catch (e) { e.filepath = filepath; throw e; @@ -28988,9 +27028,9 @@ var require_ExplorerSync = __commonJS({ if (content.trim() === "") { return void 0; } - const loader = this.getLoaderEntryForFile(filepath); + const loader2 = this.getLoaderEntryForFile(filepath); try { - return loader(filepath, content); + return loader2(filepath, content); } catch (e) { e.filepath = filepath; throw e; @@ -29039,8 +27079,8 @@ var require_dist = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); - exports.cosmiconfig = cosmiconfig; - exports.cosmiconfigSync = cosmiconfigSync; + exports.cosmiconfig = cosmiconfig2; + exports.cosmiconfigSync = cosmiconfigSync2; exports.defaultLoaders = void 0; var _os = _interopRequireDefault(require("os")); var _Explorer = require_Explorer(); @@ -29050,7 +27090,7 @@ var require_dist = __commonJS({ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - function cosmiconfig(moduleName, options = {}) { + function cosmiconfig2(moduleName, options = {}) { const normalizedOptions = normalizeOptions(moduleName, options); const explorer = new _Explorer.Explorer(normalizedOptions); return { @@ -29061,7 +27101,7 @@ var require_dist = __commonJS({ clearCaches: explorer.clearCaches.bind(explorer) }; } - function cosmiconfigSync(moduleName, options = {}) { + function cosmiconfigSync2(moduleName, options = {}) { const normalizedOptions = normalizeOptions(moduleName, options); const explorerSync = new _ExplorerSync.ExplorerSync(normalizedOptions); return { @@ -29107,1627 +27147,14 @@ var require_dist = __commonJS({ } }); -// node_modules/cspell-io/dist/cjs/async/asyncIterable.js -var require_asyncIterable = __commonJS({ - "node_modules/cspell-io/dist/cjs/async/asyncIterable.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toArray = void 0; - async function toArray3(asyncIterable) { - const data = []; - for await (const item of asyncIterable) { - data.push(item); - } - return data; - } - exports.toArray = toArray3; - } -}); - -// node_modules/@cspell/cspell-service-bus/dist/cjs/errors.js -var require_errors = __commonJS({ - "node_modules/@cspell/cspell-service-bus/dist/cjs/errors.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ErrorDuplicateSubsystem = exports.UnhandledHandlerError = exports.ErrorServiceRequestDepthExceeded = exports.ErrorUnhandledRequest = void 0; - var ErrorUnhandledRequest2 = class extends Error { - constructor(request) { - super(`Unhandled Request: ${request.type}`); - this.request = request; - } - }; - exports.ErrorUnhandledRequest = ErrorUnhandledRequest2; - var ErrorServiceRequestDepthExceeded2 = class extends Error { - constructor(request, depth) { - super(`Service Request Depth ${depth} Exceeded: ${request.type}`); - this.request = request; - this.depth = depth; - } - }; - exports.ErrorServiceRequestDepthExceeded = ErrorServiceRequestDepthExceeded2; - var UnhandledHandlerError2 = class extends Error { - constructor(handlerName, handlerDescription, cause) { - super(`Unhandled Error in Handler: ${handlerName}`); - this.handlerName = handlerName; - this.handlerDescription = handlerDescription; - this.cause = cause; - } - }; - exports.UnhandledHandlerError = UnhandledHandlerError2; - var ErrorDuplicateSubsystem = class extends Error { - constructor(subsystemName) { - super(`Duplicate subsystem: ${subsystemName}`); - this.subsystemName = subsystemName; - } - }; - exports.ErrorDuplicateSubsystem = ErrorDuplicateSubsystem; - } -}); - -// node_modules/@cspell/cspell-service-bus/dist/cjs/request.js -var require_request = __commonJS({ - "node_modules/@cspell/cspell-service-bus/dist/cjs/request.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.isInstanceOfFn = exports.isServiceResponseFailure = exports.isServiceResponseSuccess = exports.createResponseFail = exports.createResponse = exports.ServiceRequestCls = void 0; - var BaseServiceRequest2 = class { - constructor(type, params) { - this.type = type; - this.params = params; - } - }; - var ServiceRequestCls2 = class extends BaseServiceRequest2 { - constructor(type, params) { - super(type, params); - } - }; - exports.ServiceRequestCls = ServiceRequestCls2; - function createResponse2(value, _req) { - return { value }; - } - exports.createResponse = createResponse2; - function createResponseFail2(_request, error2) { - return { error: error2 }; - } - exports.createResponseFail = createResponseFail2; - function isServiceResponseSuccess2(res) { - return "value" in res && res.error === void 0; - } - exports.isServiceResponseSuccess = isServiceResponseSuccess2; - function isServiceResponseFailure2(res) { - return res.error !== void 0; - } - exports.isServiceResponseFailure = isServiceResponseFailure2; - function isInstanceOfFn(constructor) { - return (t) => t instanceof constructor; - } - exports.isInstanceOfFn = isInstanceOfFn; - exports.__testing__ = { - BaseServiceRequest: BaseServiceRequest2 - }; - } -}); - -// node_modules/@cspell/cspell-service-bus/dist/cjs/bus.js -var require_bus = __commonJS({ - "node_modules/@cspell/cspell-service-bus/dist/cjs/bus.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createServiceBus = exports.ServiceBus = void 0; - var errors_js_1 = require_errors(); - var request_js_1 = require_request(); - var MAX_DEPTH2 = 10; - var ServiceBus2 = class { - constructor(handlers = []) { - this.handlers = []; - handlers.forEach((h) => this.addHandler(h)); - } - addHandler(handler, name = "anonymous", description) { - const h = typeof handler === "function" ? { fn: handler, name, description } : handler; - const { fn, name: _name, description: _description } = h; - this.handlers.push({ fn, name: _name, description: _description }); - return this; - } - dispatch(request) { - let depth = 0; - const dispatcher = { dispatch }; - const handler = this.reduceHandlers(this.handlers, request, dispatcher, this.defaultHandler); - function dispatch(request2) { - ++depth; - if (depth >= MAX_DEPTH2) { - return (0, request_js_1.createResponseFail)(request2, new errors_js_1.ErrorServiceRequestDepthExceeded(request2, depth)); - } - const response = handler(request2); - --depth; - return response; - } - return dispatch(request); - } - defaultHandler(request) { - return (0, request_js_1.createResponseFail)(request, new errors_js_1.ErrorUnhandledRequest(request)); - } - reduceHandlers(handlers, request, dispatcher, defaultHandler) { - const _handlers = handlers.map((m) => ({ ...m, fn: m.fn(dispatcher) })); - const handler = _handlers.reduce((next, h) => { - const fn = h.fn(next); - return (req) => { - try { - return fn(req); - } catch (e) { - return (0, request_js_1.createResponseFail)(request, new errors_js_1.UnhandledHandlerError(h.name, h.description, e)); - } - }; - }, defaultHandler); - return handler; - } - }; - exports.ServiceBus = ServiceBus2; - function createServiceBus2(handlers = []) { - return new ServiceBus2(handlers); - } - exports.createServiceBus = createServiceBus2; - } -}); - -// node_modules/@cspell/cspell-service-bus/dist/cjs/createRequestHandler.js -var require_createRequestHandler = __commonJS({ - "node_modules/@cspell/cspell-service-bus/dist/cjs/createRequestHandler.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createIsRequestHandler = exports.createIsRequestHandlerFn = exports.createRequestHandler = void 0; - function createRequestHandler2(requestDef, fn, name, description) { - return createIsRequestHandler2(requestDef.is, fn, name ?? requestDef.type, description); - } - exports.createRequestHandler = createRequestHandler2; - function createIsRequestHandlerFn2(isA, fn) { - return (dispatcher) => (next) => (request) => isA(request) ? fn(request, next, dispatcher) : next(request); - } - exports.createIsRequestHandlerFn = createIsRequestHandlerFn2; - function createIsRequestHandler2(isA, fn, name, description) { - return { - fn: createIsRequestHandlerFn2(isA, fn), - name, - description - }; - } - exports.createIsRequestHandler = createIsRequestHandler2; - } -}); - -// node_modules/@cspell/cspell-service-bus/dist/cjs/requestFactory.js -var require_requestFactory = __commonJS({ - "node_modules/@cspell/cspell-service-bus/dist/cjs/requestFactory.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.requestFactory = void 0; - var createRequestHandler_js_1 = require_createRequestHandler(); - var request_js_1 = require_request(); - function requestFactory2(requestType) { - class RequestClass extends request_js_1.ServiceRequestCls { - constructor(params) { - super(requestType, params); - } - static is(req) { - return req instanceof RequestClass && req.type === requestType; - } - static create(params) { - return new RequestClass(params); - } - static createRequestHandler(fn, name, description) { - return (0, createRequestHandler_js_1.createRequestHandler)(RequestClass, fn, name, description); - } - } - RequestClass.type = requestType; - return RequestClass; - } - exports.requestFactory = requestFactory2; - } -}); - -// node_modules/@cspell/cspell-service-bus/dist/cjs/index.js -var require_cjs2 = __commonJS({ - "node_modules/@cspell/cspell-service-bus/dist/cjs/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.requestFactory = exports.ServiceRequestCls = exports.isServiceResponseSuccess = exports.isServiceResponseFailure = exports.createResponseFail = exports.createResponse = exports.createRequestHandler = exports.createIsRequestHandler = exports.ServiceBus = exports.createServiceBus = void 0; - var bus_js_1 = require_bus(); - Object.defineProperty(exports, "createServiceBus", { enumerable: true, get: function() { - return bus_js_1.createServiceBus; - } }); - Object.defineProperty(exports, "ServiceBus", { enumerable: true, get: function() { - return bus_js_1.ServiceBus; - } }); - var createRequestHandler_js_1 = require_createRequestHandler(); - Object.defineProperty(exports, "createIsRequestHandler", { enumerable: true, get: function() { - return createRequestHandler_js_1.createIsRequestHandler; - } }); - Object.defineProperty(exports, "createRequestHandler", { enumerable: true, get: function() { - return createRequestHandler_js_1.createRequestHandler; - } }); - var request_js_1 = require_request(); - Object.defineProperty(exports, "createResponse", { enumerable: true, get: function() { - return request_js_1.createResponse; - } }); - Object.defineProperty(exports, "createResponseFail", { enumerable: true, get: function() { - return request_js_1.createResponseFail; - } }); - Object.defineProperty(exports, "isServiceResponseFailure", { enumerable: true, get: function() { - return request_js_1.isServiceResponseFailure; - } }); - Object.defineProperty(exports, "isServiceResponseSuccess", { enumerable: true, get: function() { - return request_js_1.isServiceResponseSuccess; - } }); - Object.defineProperty(exports, "ServiceRequestCls", { enumerable: true, get: function() { - return request_js_1.ServiceRequestCls; - } }); - var requestFactory_js_1 = require_requestFactory(); - Object.defineProperty(exports, "requestFactory", { enumerable: true, get: function() { - return requestFactory_js_1.requestFactory; - } }); - } -}); - -// node_modules/cspell-io/dist/cjs/common/stat.js -var require_stat = __commonJS({ - "node_modules/cspell-io/dist/cjs/common/stat.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.compareStats = void 0; - function compareStats2(left, right) { - if (left === right) - return 0; - if (left.eTag || right.eTag) - return left.eTag === right.eTag ? 0 : (left.eTag || "") < (right.eTag || "") ? -1 : 1; - const diff = left.size - right.size || left.mtimeMs - right.mtimeMs; - return diff < 0 ? -1 : diff > 0 ? 1 : 0; - } - exports.compareStats = compareStats2; - } -}); - -// node_modules/cspell-io/dist/cjs/errors/ErrorNotImplemented.js -var require_ErrorNotImplemented = __commonJS({ - "node_modules/cspell-io/dist/cjs/errors/ErrorNotImplemented.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ErrorNotImplemented = void 0; - var ErrorNotImplemented2 = class extends Error { - constructor(method) { - super(`Method ${method} is not supported.`); - this.method = method; - } - }; - exports.ErrorNotImplemented = ErrorNotImplemented2; - } -}); - -// node_modules/cspell-io/dist/cjs/common/encode-decode.js -var require_encode_decode = __commonJS({ - "node_modules/cspell-io/dist/cjs/common/encode-decode.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.calcEncodingFromBom = exports.encodeUtf16BE = exports.encodeUtf16LE = exports.encodeString = exports.swapBytes = exports.swapBytesInPlace = exports.decode = exports.decodeUtf16BE = exports.decodeUtf16LE = void 0; - var BOM_BE2 = 65279; - var BOM_LE2 = 65534; - function decodeUtf16LE2(buf) { - const bom = buf[0] << 8 | buf[1]; - buf = bom === BOM_LE2 ? buf.subarray(2) : buf; - return buf.toString("utf16le"); - } - exports.decodeUtf16LE = decodeUtf16LE2; - function decodeUtf16BE2(buf) { - return decodeUtf16LE2(swapBytes2(buf)); - } - exports.decodeUtf16BE = decodeUtf16BE2; - function decode2(buf, encoding) { - switch (encoding) { - case "utf16be": - return decodeUtf16BE2(buf); - case "utf16le": - return decodeUtf16LE2(buf); - } - if (buf.length < 2 || encoding && !encoding.startsWith("utf")) - return buf.toString(encoding); - const bom = buf[0] << 8 | buf[1]; - if (bom === BOM_BE2 || buf[0] === 0 && buf[1] !== 0) - return decodeUtf16BE2(buf); - if (bom === BOM_LE2 || buf[0] !== 0 && buf[1] === 0) - return decodeUtf16LE2(buf); - return buf.toString(encoding); - } - exports.decode = decode2; - function swapBytesInPlace2(buf) { - for (let i = 0; i < buf.length - 1; i += 2) { - const v = buf[i]; - buf[i] = buf[i + 1]; - buf[i + 1] = v; - } - return buf; - } - exports.swapBytesInPlace = swapBytesInPlace2; - function swapBytes2(buf) { - const tBuf = Buffer.from(buf); - return swapBytesInPlace2(tBuf); - } - exports.swapBytes = swapBytes2; - function encodeString2(str, encoding, bom) { - switch (encoding) { - case "utf16be": - return encodeUtf16BE(str, bom); - case "utf16le": - return encodeUtf16LE(str, bom); - } - return Buffer.from(str, encoding); - } - exports.encodeString = encodeString2; - function encodeUtf16LE(str, bom = true) { - const buf = Buffer.from(str, "utf16le"); - if (bom) { - const target = Buffer.alloc(buf.length + 2); - target.writeUint16LE(BOM_BE2); - buf.copy(target, 2); - return target; - } - return buf; - } - exports.encodeUtf16LE = encodeUtf16LE; - function encodeUtf16BE(str, bom = true) { - return swapBytesInPlace2(encodeUtf16LE(str, bom)); - } - exports.encodeUtf16BE = encodeUtf16BE; - function calcEncodingFromBom2(buf) { - if (buf.length < 2) - return void 0; - switch (buf[0] << 8 | buf[1]) { - case BOM_BE2: - return "utf16be"; - case BOM_LE2: - return "utf16le"; - } - return void 0; - } - exports.calcEncodingFromBom = calcEncodingFromBom2; - } -}); - -// node_modules/cspell-io/dist/cjs/errors/error.js -var require_error = __commonJS({ - "node_modules/cspell-io/dist/cjs/errors/error.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toError = void 0; - function toError4(e) { - if (e instanceof Error) - return e; - if (typeof e === "object" && e && typeof e.message === "string") { - return e; - } - return Error(e && e.toString()); - } - exports.toError = toError4; - } -}); - -// node_modules/cspell-io/dist/cjs/errors/index.js -var require_errors2 = __commonJS({ - "node_modules/cspell-io/dist/cjs/errors/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ErrorNotImplemented = exports.toError = void 0; - var error_js_1 = require_error(); - Object.defineProperty(exports, "toError", { enumerable: true, get: function() { - return error_js_1.toError; - } }); - var ErrorNotImplemented_js_1 = require_ErrorNotImplemented(); - Object.defineProperty(exports, "ErrorNotImplemented", { enumerable: true, get: function() { - return ErrorNotImplemented_js_1.ErrorNotImplemented; - } }); - } -}); - -// node_modules/cspell-io/dist/cjs/node/file/util.js -var require_util3 = __commonJS({ - "node_modules/cspell-io/dist/cjs/node/file/util.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.basename = exports.urlDirname = exports.urlBasename = exports.toURL = exports.isFileURL = exports.isSupportedURL = exports.isUrlLike = exports.isZipped = void 0; - var url_1 = require("url"); - var isZippedRegExp = /\.gz($|[?#])/i; - var isURLRegExp2 = /^(\w{2,64}:\/\/|data:)/i; - var supportedProtocols = { "file:": true, "http:": true, "https:": true }; - function isZipped2(filename) { - const path16 = typeof filename === "string" ? filename : filename.pathname; - return isZippedRegExp.test(path16); - } - exports.isZipped = isZipped2; - function isUrlLike2(filename) { - return filename instanceof URL || isURLRegExp2.test(filename); - } - exports.isUrlLike = isUrlLike2; - function isSupportedURL2(url) { - return !!supportedProtocols[url.protocol]; - } - exports.isSupportedURL = isSupportedURL2; - function isFileURL2(url) { - return url.protocol === "file:"; - } - exports.isFileURL = isFileURL2; - function toURL2(filename) { - return filename instanceof URL || typeof filename !== "string" ? filename : isUrlLike2(filename) ? new URL(filename) : (0, url_1.pathToFileURL)(filename); - } - exports.toURL = toURL2; - var regMatchFilename2 = /filename=([^;,]*)/; - function urlBasename2(url) { - function guessDataUrlName(header) { - const filenameMatch = header.match(regMatchFilename2); - if (filenameMatch) - return filenameMatch[1]; - const mime = header.split(";", 1)[0]; - return mime.replace(/\W/g, "."); - } - if (typeof url === "string" && url.startsWith("data:")) { - return guessDataUrlName(url.split(",", 1)[0].split(":", 2)[1]); - } - url = toURL2(url); - if (url.protocol === "data:") { - return guessDataUrlName(url.pathname.split(",", 1)[0]); - } - return basename3(url.pathname); - } - exports.urlBasename = urlBasename2; - function urlDirname2(url) { - if (typeof url === "string" && url.startsWith("data:")) { - return toURL2("data:"); - } - url = toURL2(url); - if (url.protocol === "data:") { - return toURL2("data:"); - } - return new URL(url.pathname.endsWith("/") ? ".." : ".", url); - } - exports.urlDirname = urlDirname2; - function basename3(path16) { - path16 = path16.endsWith("/") ? path16.slice(0, path16.length - 1) : path16; - const idx = path16.lastIndexOf("/"); - return idx >= 0 ? path16.slice(idx + 1) || "" : path16; - } - exports.basename = basename3; - } -}); - -// node_modules/cspell-io/dist/cjs/node/dataUrl.js -var require_dataUrl = __commonJS({ - "node_modules/cspell-io/dist/cjs/node/dataUrl.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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.guessMimeType = exports.encodeDataUrlFromFile = exports.decodeDataUrl = exports.toDataUrl = exports.encodeDataUrl = void 0; - var fs_1 = require("fs"); - var fsPath = __importStar(require("path")); - var util_js_1 = require_util3(); - function encodeDataUrl2(data, mediaType, attributes) { - if (typeof data === "string") - return encodeString2(data, mediaType, attributes); - const attribs = encodeAttributes(attributes || []); - return `data:${mediaType}${attribs};base64,${data.toString("base64url")}`; - } - exports.encodeDataUrl = encodeDataUrl2; - function toDataUrl2(data, mediaType, attributes) { - return new URL(encodeDataUrl2(data, mediaType, attributes)); - } - exports.toDataUrl = toDataUrl2; - function encodeString2(data, mediaType, attributes) { - mediaType = mediaType || "text/plain"; - attributes = attributes || []; - const asUrlComp = encodeURIComponent(data); - const asBase64 = Buffer.from(data).toString("base64url"); - const useBase64 = asBase64.length < asUrlComp.length - 7; - const encoded = useBase64 ? asBase64 : asUrlComp; - const attribMap = new Map([["charset", "utf8"]].concat([...attributes])); - attribMap.set("charset", "utf8"); - const attribs = encodeAttributes(attribMap); - return `data:${mediaType}${attribs}${useBase64 ? ";base64" : ""},${encoded}`; - } - function encodeAttributes(attributes) { - return [...attributes].map(([key, value]) => `;${key}=${encodeURIComponent(value)}`).join(""); - } - var dataUrlRegExHead2 = /^data:(?[^;,]*)(?(?:;[^=]+=[^;,]*)*)(?;base64)?$/; - function decodeDataUrl2(url) { - url = url.toString(); - const [head, encodedData] = url.split(",", 2); - if (!head || encodedData === void 0) - throw Error("Not a data url"); - const match = head.match(dataUrlRegExHead2); - if (!match || !match.groups) - throw Error("Not a data url"); - const mediaType = match.groups["mediaType"] || ""; - const rawAttributes = (match.groups["attributes"] || "").split(";").filter((a) => !!a).map((entry) => entry.split("=", 2)).map(([key, value]) => [key, decodeURIComponent(value)]); - const attributes = new Map(rawAttributes); - const encoding = attributes.get("charset"); - const isBase64 = !!match.groups["base64"]; - const data = isBase64 ? Buffer.from(encodedData, "base64url") : Buffer.from(decodeURIComponent(encodedData)); - return { mediaType, data, encoding, attributes }; - } - exports.decodeDataUrl = decodeDataUrl2; - async function encodeDataUrlFromFile(path16, mediaType, attributes) { - const url = (0, util_js_1.toURL)(path16); - const filename = fsPath.basename(url.pathname); - const guess = guessMimeType(filename); - mediaType = mediaType || guess?.mimeType || "text/plain"; - const _attributes = new Map(attributes || []); - filename && _attributes.set("filename", filename); - const content = guess?.encoding ? await fs_1.promises.readFile(url, guess?.encoding) : await fs_1.promises.readFile(url); - return encodeDataUrl2(content, mediaType, _attributes); - } - exports.encodeDataUrlFromFile = encodeDataUrlFromFile; - function guessMimeType(filename) { - if (filename.endsWith(".trie")) - return { mimeType: "application/vnd.cspell.dictionary+trie", encoding: "utf-8" }; - if (filename.endsWith(".trie.gz")) - return { mimeType: "application/vnd.cspell.dictionary+trie.gz" }; - if (filename.endsWith(".txt")) - return { mimeType: "text/plain", encoding: "utf-8" }; - if (filename.endsWith(".gz")) - return { mimeType: "application/gzip" }; - if (filename.endsWith(".json")) - return { mimeType: "application/json", encoding: "utf-8" }; - if (filename.endsWith(".yaml") || filename.endsWith(".yml")) - return { mimeType: "application/x-yaml", encoding: "utf-8" }; - return void 0; - } - exports.guessMimeType = guessMimeType; - } -}); - -// node_modules/cspell-io/dist/cjs/node/file/FetchError.js -var require_FetchError = __commonJS({ - "node_modules/cspell-io/dist/cjs/node/file/FetchError.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.FetchUrlError = void 0; - var FetchUrlError2 = class _FetchUrlError extends Error { - constructor(message, code, status, url) { - super(message); - this.code = code; - this.status = status; - this.url = url; - this.name = "FetchUrlError"; - } - static create(url, status, message) { - if (status === 404) - return new _FetchUrlError(message || "URL not found.", "ENOENT", status, url); - if (status >= 400 && status < 500) - return new _FetchUrlError(message || "Permission denied.", "EACCES", status, url); - return new _FetchUrlError(message || "Fatal Error", "ECONNREFUSED", status, url); - } - }; - exports.FetchUrlError = FetchUrlError2; - } -}); - -// node_modules/cspell-io/dist/cjs/node/file/fetch.js -var require_fetch = __commonJS({ - "node_modules/cspell-io/dist/cjs/node/file/fetch.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fetchURL = exports.fetchHead = exports.fetch = void 0; - var node_fetch_1 = __importDefault(require_lib3()); - var FetchError_js_1 = require_FetchError(); - exports.fetch = node_fetch_1.default; - async function fetchHead2(request) { - const r = await (0, exports.fetch)(request, { method: "HEAD" }); - return r.headers; - } - exports.fetchHead = fetchHead2; - async function fetchURL2(url) { - const response = await (0, exports.fetch)(url); - if (!response.ok) { - throw FetchError_js_1.FetchUrlError.create(url, response.status); - } - return Buffer.from(await response.arrayBuffer()); - } - exports.fetchURL = fetchURL2; - } -}); - -// node_modules/cspell-io/dist/cjs/node/file/stat.js -var require_stat2 = __commonJS({ - "node_modules/cspell-io/dist/cjs/node/file/stat.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getStatHttp = exports.getStatSync = exports.getStat = void 0; - var fs_1 = require("fs"); - var util_1 = require("util"); - var fetch_js_1 = require_fetch(); - var util_js_1 = require_util3(); - async function getStat3(filenameOrUri) { - if ((0, util_js_1.isUrlLike)(filenameOrUri)) { - const url = (0, util_js_1.toURL)(filenameOrUri); - if (!(0, util_js_1.isFileURL)(url)) { - try { - return await getStatHttp2(url); - } catch (e) { - return toError4(e); - } - } - } - return fs_1.promises.stat(filenameOrUri).catch((e) => toError4(e)); - } - exports.getStat = getStat3; - function getStatSync3(uri) { - try { - return (0, fs_1.statSync)(uri); - } catch (e) { - return toError4(e); - } - } - exports.getStatSync = getStatSync3; - async function getStatHttp2(url) { - const headers = await (0, fetch_js_1.fetchHead)(url); - const eTag = headers.get("etag") || void 0; - const guessSize = Number.parseInt(headers.get("content-length") || "0", 10); - return { - size: eTag ? -1 : guessSize, - mtimeMs: 0, - eTag - }; - } - exports.getStatHttp = getStatHttp2; - function toError4(e) { - if (isErrnoException(e) || e instanceof Error) - return e; - return new Error((0, util_1.format)(e)); - } - function isErrnoException(e) { - if (!e || typeof e !== "object") - return false; - const err = e; - return err.message !== void 0 && err.name !== void 0; - } - } -}); - -// node_modules/cspell-io/dist/cjs/requests/RequestFsReadBinaryFile.js -var require_RequestFsReadBinaryFile = __commonJS({ - "node_modules/cspell-io/dist/cjs/requests/RequestFsReadBinaryFile.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RequestFsReadBinaryFileSync = exports.RequestFsReadBinaryFile = void 0; - var cspell_service_bus_1 = require_cjs2(); - var RequestType6 = "fs:readBinaryFile"; - exports.RequestFsReadBinaryFile = (0, cspell_service_bus_1.requestFactory)(RequestType6); - var RequestTypeSync2 = "fs:readBinaryFileSync"; - exports.RequestFsReadBinaryFileSync = (0, cspell_service_bus_1.requestFactory)(RequestTypeSync2); - } -}); - -// node_modules/cspell-io/dist/cjs/requests/RequestFsReadFile.js -var require_RequestFsReadFile = __commonJS({ - "node_modules/cspell-io/dist/cjs/requests/RequestFsReadFile.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RequestFsReadFile = void 0; - var cspell_service_bus_1 = require_cjs2(); - var RequestType6 = "fs:readFile"; - exports.RequestFsReadFile = (0, cspell_service_bus_1.requestFactory)(RequestType6); - } -}); - -// node_modules/cspell-io/dist/cjs/requests/RequestFsReadFileSync.js -var require_RequestFsReadFileSync = __commonJS({ - "node_modules/cspell-io/dist/cjs/requests/RequestFsReadFileSync.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RequestFsReadFileSync = void 0; - var cspell_service_bus_1 = require_cjs2(); - var RequestType6 = "fs:readFileSync"; - exports.RequestFsReadFileSync = (0, cspell_service_bus_1.requestFactory)(RequestType6); - } -}); - -// node_modules/cspell-io/dist/cjs/requests/RequestFsStat.js -var require_RequestFsStat = __commonJS({ - "node_modules/cspell-io/dist/cjs/requests/RequestFsStat.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RequestFsStatSync = exports.RequestFsStat = void 0; - var cspell_service_bus_1 = require_cjs2(); - var RequestTypeStat2 = "fs:stat"; - exports.RequestFsStat = (0, cspell_service_bus_1.requestFactory)(RequestTypeStat2); - var RequestTypeStatSync2 = "fs:statSync"; - exports.RequestFsStatSync = (0, cspell_service_bus_1.requestFactory)(RequestTypeStatSync2); - } -}); - -// node_modules/cspell-io/dist/cjs/requests/RequestFsWriteFile.js -var require_RequestFsWriteFile = __commonJS({ - "node_modules/cspell-io/dist/cjs/requests/RequestFsWriteFile.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RequestFsWriteFile = void 0; - var cspell_service_bus_1 = require_cjs2(); - var RequestType6 = "fs:writeFile"; - exports.RequestFsWriteFile = (0, cspell_service_bus_1.requestFactory)(RequestType6); - } -}); - -// node_modules/cspell-io/dist/cjs/requests/RequestZlibInflate.js -var require_RequestZlibInflate = __commonJS({ - "node_modules/cspell-io/dist/cjs/requests/RequestZlibInflate.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RequestZlibInflate = void 0; - var cspell_service_bus_1 = require_cjs2(); - var RequestType6 = "zlib:inflate"; - exports.RequestZlibInflate = (0, cspell_service_bus_1.requestFactory)(RequestType6); - } -}); - -// node_modules/cspell-io/dist/cjs/requests/index.js -var require_requests = __commonJS({ - "node_modules/cspell-io/dist/cjs/requests/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RequestZlibInflate = exports.RequestFsWriteFile = exports.RequestFsStatSync = exports.RequestFsStat = exports.RequestFsReadFileSync = exports.RequestFsReadFile = exports.RequestFsReadBinaryFileSync = exports.RequestFsReadBinaryFile = void 0; - var RequestFsReadBinaryFile_js_1 = require_RequestFsReadBinaryFile(); - Object.defineProperty(exports, "RequestFsReadBinaryFile", { enumerable: true, get: function() { - return RequestFsReadBinaryFile_js_1.RequestFsReadBinaryFile; - } }); - Object.defineProperty(exports, "RequestFsReadBinaryFileSync", { enumerable: true, get: function() { - return RequestFsReadBinaryFile_js_1.RequestFsReadBinaryFileSync; - } }); - var RequestFsReadFile_js_1 = require_RequestFsReadFile(); - Object.defineProperty(exports, "RequestFsReadFile", { enumerable: true, get: function() { - return RequestFsReadFile_js_1.RequestFsReadFile; - } }); - var RequestFsReadFileSync_js_1 = require_RequestFsReadFileSync(); - Object.defineProperty(exports, "RequestFsReadFileSync", { enumerable: true, get: function() { - return RequestFsReadFileSync_js_1.RequestFsReadFileSync; - } }); - var RequestFsStat_js_1 = require_RequestFsStat(); - Object.defineProperty(exports, "RequestFsStat", { enumerable: true, get: function() { - return RequestFsStat_js_1.RequestFsStat; - } }); - Object.defineProperty(exports, "RequestFsStatSync", { enumerable: true, get: function() { - return RequestFsStat_js_1.RequestFsStatSync; - } }); - var RequestFsWriteFile_js_1 = require_RequestFsWriteFile(); - Object.defineProperty(exports, "RequestFsWriteFile", { enumerable: true, get: function() { - return RequestFsWriteFile_js_1.RequestFsWriteFile; - } }); - var RequestZlibInflate_js_1 = require_RequestZlibInflate(); - Object.defineProperty(exports, "RequestZlibInflate", { enumerable: true, get: function() { - return RequestZlibInflate_js_1.RequestZlibInflate; - } }); - } -}); - -// node_modules/cspell-io/dist/cjs/handlers/node/file.js -var require_file = __commonJS({ - "node_modules/cspell-io/dist/cjs/handlers/node/file.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.registerHandlers = void 0; - var cspell_service_bus_1 = require_cjs2(); - var assert_1 = __importDefault(require("assert")); - var fs_1 = require("fs"); - var url_1 = require("url"); - var zlib_1 = require("zlib"); - var encode_decode_js_1 = require_encode_decode(); - var index_js_1 = require_errors2(); - var dataUrl_js_1 = require_dataUrl(); - var fetch_js_1 = require_fetch(); - var stat_js_1 = require_stat2(); - var index_js_2 = require_requests(); - var isGzFileRegExp2 = /\.gz($|[?#])/; - function isGzFile2(url) { - return isGzFileRegExp2.test(url.pathname); - } - var handleRequestFsReadBinaryFile2 = index_js_2.RequestFsReadBinaryFile.createRequestHandler(({ params }) => (0, cspell_service_bus_1.createResponse)(fs_1.promises.readFile((0, url_1.fileURLToPath)(params.url)).then((content) => ({ url: params.url, content }))), void 0, "Node: Read Binary File."); - var handleRequestFsReadBinaryFileSync2 = index_js_2.RequestFsReadBinaryFileSync.createRequestHandler(({ params }) => (0, cspell_service_bus_1.createResponse)({ url: params.url, content: (0, fs_1.readFileSync)((0, url_1.fileURLToPath)(params.url)) }), void 0, "Node: Sync Read Binary File."); - var handleRequestFsReadFile2 = index_js_2.RequestFsReadFile.createRequestHandler((req, _, dispatcher) => { - const { url, encoding } = req.params; - const res = dispatcher.dispatch(index_js_2.RequestFsReadBinaryFile.create({ url })); - if (!(0, cspell_service_bus_1.isServiceResponseSuccess)(res)) { - (0, assert_1.default)((0, cspell_service_bus_1.isServiceResponseFailure)(res)); - return (0, cspell_service_bus_1.createResponseFail)(req, res.error); - } - return (0, cspell_service_bus_1.createResponse)(res.value.then((res2) => ({ - url, - content: bufferToText2(res2.content, encoding), - baseFilename: res2.baseFilename - }))); - }, void 0, "Node: Read Text File."); - var handleRequestFsReadFileSync2 = index_js_2.RequestFsReadFileSync.createRequestHandler((req, _, dispatcher) => { - const { url, encoding } = req.params; - const res = dispatcher.dispatch(index_js_2.RequestFsReadBinaryFileSync.create({ url })); - if (!(0, cspell_service_bus_1.isServiceResponseSuccess)(res)) { - (0, assert_1.default)((0, cspell_service_bus_1.isServiceResponseFailure)(res)); - return (0, cspell_service_bus_1.createResponseFail)(req, res.error); - } - return (0, cspell_service_bus_1.createResponse)({ - ...res.value, - content: bufferToText2(res.value.content, encoding) - }); - }, void 0, "Node: Sync Read Text File."); - var handleRequestZlibInflate2 = index_js_2.RequestZlibInflate.createRequestHandler(({ params }) => (0, cspell_service_bus_1.createResponse)((0, zlib_1.gunzipSync)(params.data).toString("utf-8")), void 0, "Node: gz deflate."); - var supportedFetchProtocols2 = { "http:": true, "https:": true }; - var handleRequestFsReadBinaryFileHttp2 = index_js_2.RequestFsReadBinaryFile.createRequestHandler((req, next) => { - const { url } = req.params; - if (!(url.protocol in supportedFetchProtocols2)) - return next(req); - return (0, cspell_service_bus_1.createResponse)((0, fetch_js_1.fetchURL)(url).then((content) => ({ url, content }))); - }, void 0, "Node: Read Http(s) file."); - var handleRequestFsReadBinaryFileSyncData2 = index_js_2.RequestFsReadBinaryFileSync.createRequestHandler((req, next) => { - const { url } = req.params; - if (url.protocol !== "data:") - return next(req); - const data = (0, dataUrl_js_1.decodeDataUrl)(url); - return (0, cspell_service_bus_1.createResponse)({ url, content: data.data, baseFilename: data.attributes.get("filename") }); - }, void 0, "Node: Read data: urls."); - var handleRequestFsReadBinaryFileData2 = index_js_2.RequestFsReadBinaryFile.createRequestHandler((req, next, dispatcher) => { - const { url } = req.params; - if (url.protocol !== "data:") - return next(req); - const res = dispatcher.dispatch(index_js_2.RequestFsReadBinaryFileSync.create(req.params)); - if (!(0, cspell_service_bus_1.isServiceResponseSuccess)(res)) - return res; - return (0, cspell_service_bus_1.createResponse)(Promise.resolve(res.value)); - }, void 0, "Node: Read data: urls."); - function bufferToText2(buf, encoding) { - return buf[0] === 31 && buf[1] === 139 ? (0, encode_decode_js_1.decode)((0, zlib_1.gunzipSync)(buf), encoding) : (0, encode_decode_js_1.decode)(buf, encoding); - } - var handleRequestFsStat2 = index_js_2.RequestFsStat.createRequestHandler(({ params }) => (0, cspell_service_bus_1.createResponse)(fs_1.promises.stat((0, url_1.fileURLToPath)(params.url))), void 0, "Node: fs.stat."); - var handleRequestFsStatSync2 = index_js_2.RequestFsStatSync.createRequestHandler((req) => { - const { params } = req; - try { - return (0, cspell_service_bus_1.createResponse)((0, fs_1.statSync)((0, url_1.fileURLToPath)(params.url))); - } catch (e) { - return (0, cspell_service_bus_1.createResponseFail)(req, (0, index_js_1.toError)(e)); - } - }, void 0, "Node: fs.stat."); - var handleRequestFsStatHttp2 = index_js_2.RequestFsStat.createRequestHandler((req, next) => { - const { url } = req.params; - if (!(url.protocol in supportedFetchProtocols2)) - return next(req); - return (0, cspell_service_bus_1.createResponse)((0, stat_js_1.getStatHttp)(url)); - }, void 0, "Node: http get stat"); - var handleRequestFsWriteFile2 = index_js_2.RequestFsWriteFile.createRequestHandler(({ params }) => (0, cspell_service_bus_1.createResponse)(fs_1.promises.writeFile(params.url, params.content)), void 0, "Node: fs.writeFile"); - var handleRequestFsWriteFileGz2 = index_js_2.RequestFsWriteFile.createRequestHandler((req, next) => { - const { url, content } = req.params; - if (!isGzFile2(url)) - return next(req); - return (0, cspell_service_bus_1.createResponse)(fs_1.promises.writeFile(url, (0, zlib_1.gzipSync)(content))); - }, void 0, "Node: http get stat"); - function registerHandlers2(serviceBus) { - const handlers = [ - handleRequestFsWriteFile2, - handleRequestFsWriteFileGz2, - handleRequestFsReadBinaryFile2, - handleRequestFsReadBinaryFileSync2, - handleRequestFsReadBinaryFileHttp2, - handleRequestFsReadBinaryFileData2, - handleRequestFsReadBinaryFileSyncData2, - handleRequestFsReadFile2, - handleRequestFsReadFileSync2, - handleRequestZlibInflate2, - handleRequestFsStatSync2, - handleRequestFsStat2, - handleRequestFsStatHttp2 - ]; - handlers.forEach((handler) => serviceBus.addHandler(handler)); - } - exports.registerHandlers = registerHandlers2; - } -}); - -// node_modules/cspell-io/dist/cjs/CSpellIONode.js -var require_CSpellIONode = __commonJS({ - "node_modules/cspell-io/dist/cjs/CSpellIONode.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getDefaultCSpellIO = exports.CSpellIONode = void 0; - var cspell_service_bus_1 = require_cjs2(); - var stat_js_1 = require_stat(); - var ErrorNotImplemented_js_1 = require_ErrorNotImplemented(); - var file_js_1 = require_file(); - var util_js_1 = require_util3(); - var index_js_1 = require_requests(); - var defaultCSpellIONode2 = void 0; - var CSpellIONode2 = class { - constructor(serviceBus = new cspell_service_bus_1.ServiceBus()) { - this.serviceBus = serviceBus; - (0, file_js_1.registerHandlers)(serviceBus); - } - readFile(uriOrFilename, encoding = "utf8") { - const url = (0, util_js_1.toURL)(uriOrFilename); - const res = this.serviceBus.dispatch(index_js_1.RequestFsReadFile.create({ url, encoding })); - if (!(0, cspell_service_bus_1.isServiceResponseSuccess)(res)) { - throw genError2(res.error, "readFile"); - } - return res.value; - } - readFileSync(uriOrFilename, encoding = "utf8") { - const url = (0, util_js_1.toURL)(uriOrFilename); - const res = this.serviceBus.dispatch(index_js_1.RequestFsReadFileSync.create({ url, encoding })); - if (!(0, cspell_service_bus_1.isServiceResponseSuccess)(res)) { - throw genError2(res.error, "readFileSync"); - } - return res.value; - } - writeFile(uriOrFilename, content) { - const url = (0, util_js_1.toURL)(uriOrFilename); - const res = this.serviceBus.dispatch(index_js_1.RequestFsWriteFile.create({ url, content })); - if (!(0, cspell_service_bus_1.isServiceResponseSuccess)(res)) { - throw genError2(res.error, "writeFile"); - } - return res.value; - } - getStat(uriOrFilename) { - const url = (0, util_js_1.toURL)(uriOrFilename); - const res = this.serviceBus.dispatch(index_js_1.RequestFsStat.create({ url })); - if (!(0, cspell_service_bus_1.isServiceResponseSuccess)(res)) { - throw genError2(res.error, "getStat"); - } - return res.value; - } - getStatSync(uriOrFilename) { - const url = (0, util_js_1.toURL)(uriOrFilename); - const res = this.serviceBus.dispatch(index_js_1.RequestFsStatSync.create({ url })); - if (!(0, cspell_service_bus_1.isServiceResponseSuccess)(res)) { - throw genError2(res.error, "getStatSync"); - } - return res.value; - } - compareStats(left, right) { - return (0, stat_js_1.compareStats)(left, right); - } - toURL(uriOrFilename) { - return (0, util_js_1.toURL)(uriOrFilename); - } - uriBasename(uriOrFilename) { - return (0, util_js_1.urlBasename)(uriOrFilename); - } - uriDirname(uriOrFilename) { - return (0, util_js_1.urlDirname)(uriOrFilename); - } - }; - exports.CSpellIONode = CSpellIONode2; - function genError2(err, alt) { - return err || new ErrorNotImplemented_js_1.ErrorNotImplemented(alt); - } - function getDefaultCSpellIO2() { - if (defaultCSpellIONode2) - return defaultCSpellIONode2; - const cspellIO = new CSpellIONode2(); - defaultCSpellIONode2 = cspellIO; - return cspellIO; - } - exports.getDefaultCSpellIO = getDefaultCSpellIO2; - } -}); - -// node_modules/cspell-io/dist/cjs/common/transformers.js -var require_transformers = __commonJS({ - "node_modules/cspell-io/dist/cjs/common/transformers.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.encoderTransformer = exports.createDecoderTransformer = void 0; - var encode_decode_js_1 = require_encode_decode(); - function createDecoderTransformer2(encoding) { - function standardDecoder(buf) { - return (0, encode_decode_js_1.decode)(buf, encoding); - } - let decoder = void 0; - if (encoding && !encoding.startsWith("utf")) - return decoderNonUtf; - return decoderUtf; - async function* decoderNonUtf(iterable) { - for await (const buf of iterable) { - yield typeof buf === "string" ? buf : (0, encode_decode_js_1.decode)(buf, encoding); - } - } - async function* decoderUtf(iterable) { - for await (const sb of iterable) { - if (typeof sb === "string") { - yield sb; - continue; - } - if (sb.length < 2) { - yield standardDecoder(sb); - continue; - } - if (decoder) { - yield decoder(sb); - continue; - } - decoder = standardDecoder; - const _encoding = (0, encode_decode_js_1.calcEncodingFromBom)(sb); - if (_encoding === "utf16le") { - decoder = encode_decode_js_1.decodeUtf16LE; - yield decoder(sb.subarray(2)); - continue; - } - if (_encoding === "utf16be") { - decoder = encode_decode_js_1.decodeUtf16BE; - yield decoder(sb.subarray(2)); - continue; - } - yield decoder(sb); - } - } - } - exports.createDecoderTransformer = createDecoderTransformer2; - function encoderTransformer2(iterable, encoding) { - return isAsyncIterable3(iterable) ? encoderAsyncIterable(iterable, encoding) : encoderIterable(iterable, encoding); - } - exports.encoderTransformer = encoderTransformer2; - function* encoderIterable(iterable, encoding) { - let useBom = true; - for (const chunk of iterable) { - yield (0, encode_decode_js_1.encodeString)(chunk, encoding, useBom); - useBom = false; - } - } - async function* encoderAsyncIterable(iterable, encoding) { - let useBom = true; - for await (const chunk of iterable) { - yield (0, encode_decode_js_1.encodeString)(chunk, encoding, useBom); - useBom = false; - } - } - function isAsyncIterable3(v) { - return v && typeof v === "object" && !!v[Symbol.asyncIterator]; - } - } -}); - -// node_modules/cspell-io/dist/cjs/node/file/fileReader.js -var require_fileReader = __commonJS({ - "node_modules/cspell-io/dist/cjs/node/file/fileReader.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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.readFileSync = exports.readFile = void 0; - var fs6 = __importStar(require("fs")); - var Stream3 = __importStar(require("stream")); - var url_1 = require("url"); - var util_1 = require("util"); - var zlib = __importStar(require("zlib")); - var encode_decode_js_1 = require_encode_decode(); - var transformers_js_1 = require_transformers(); - var fetch_js_1 = require_fetch(); - var FetchError_js_1 = require_FetchError(); - var util_js_1 = require_util3(); - var defaultEncoding = "utf8"; - var pipeline5 = (0, util_1.promisify)(Stream3.pipeline); - async function readFile4(filename, encoding) { - const url = (0, util_js_1.toURL)(filename); - if (!(0, util_js_1.isSupportedURL)(url)) { - throw new Error("Unsupported network protocol"); - } - return (0, util_js_1.isFileURL)(url) ? _readFile(url, encoding) : _fetchURL(url, encoding); - } - exports.readFile = readFile4; - function _readFile(url, encoding) { - const filename = (0, url_1.fileURLToPath)(url); - return _read(() => fs6.createReadStream(filename), (0, util_js_1.isZipped)(filename), encoding); - } - async function _fetchURL(url, encoding) { - const response = await (0, fetch_js_1.fetch)(url); - if (!response.ok) { - throw FetchError_js_1.FetchUrlError.create(url, response.status); - } - return _read(() => response.body, (0, util_js_1.isZipped)(url), encoding); - } - async function _read(getStream, isZipped2, encoding) { - const stream = getStream(); - const decoder = (0, transformers_js_1.createDecoderTransformer)(encoding); - const collector = createCollector(encoding || defaultEncoding); - return isZipped2 ? pipeline5(stream, zlib.createGunzip(), decoder, collector) : pipeline5(stream, decoder, collector); - } - function readFileSync5(filename, encoding) { - const rawData = fs6.readFileSync(filename); - const data = (0, util_js_1.isZipped)(filename) ? zlib.gunzipSync(rawData) : rawData; - return !encoding || encoding.startsWith("utf") ? (0, encode_decode_js_1.decode)(data) : data.toString(encoding); - } - exports.readFileSync = readFileSync5; - function createCollector(encoding) { - async function collect(iterable) { - const buf = []; - for await (const sb of iterable) { - buf.push(typeof sb === "string" ? sb : sb.toString(encoding)); - } - return buf.join(""); - } - return collect; - } - } -}); - -// node_modules/cspell-io/dist/cjs/node/file/fileWriter.js -var require_fileWriter = __commonJS({ - "node_modules/cspell-io/dist/cjs/node/file/fileWriter.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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.writeToFileIterable = exports.writeToFile = void 0; - var fs6 = __importStar(require("fs")); - var Stream3 = __importStar(require("stream")); - var util_1 = require("util"); - var zlib = __importStar(require("zlib")); - var transformers_js_1 = require_transformers(); - var pipeline5 = (0, util_1.promisify)(Stream3.pipeline); - function writeToFile2(filename, data, encoding) { - return writeToFileIterable2(filename, typeof data === "string" ? [data] : data, encoding); - } - exports.writeToFile = writeToFile2; - function writeToFileIterable2(filename, data, encoding) { - const stream = Stream3.Readable.from((0, transformers_js_1.encoderTransformer)(data, encoding)); - const zip = filename.match(/\.gz$/) ? zlib.createGzip() : new Stream3.PassThrough(); - return pipeline5(stream, zip, fs6.createWriteStream(filename)); - } - exports.writeToFileIterable = writeToFileIterable2; - } -}); - -// node_modules/cspell-io/dist/cjs/node/file/index.js -var require_file2 = __commonJS({ - "node_modules/cspell-io/dist/cjs/node/file/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getStatSync = exports.getStat = exports.writeToFileIterable = exports.writeToFile = exports.readFileSync = exports.readFile = void 0; - var fileReader_js_1 = require_fileReader(); - Object.defineProperty(exports, "readFile", { enumerable: true, get: function() { - return fileReader_js_1.readFile; - } }); - Object.defineProperty(exports, "readFileSync", { enumerable: true, get: function() { - return fileReader_js_1.readFileSync; - } }); - var fileWriter_js_1 = require_fileWriter(); - Object.defineProperty(exports, "writeToFile", { enumerable: true, get: function() { - return fileWriter_js_1.writeToFile; - } }); - Object.defineProperty(exports, "writeToFileIterable", { enumerable: true, get: function() { - return fileWriter_js_1.writeToFileIterable; - } }); - var stat_js_1 = require_stat2(); - Object.defineProperty(exports, "getStat", { enumerable: true, get: function() { - return stat_js_1.getStat; - } }); - Object.defineProperty(exports, "getStatSync", { enumerable: true, get: function() { - return stat_js_1.getStatSync; - } }); - } -}); - -// node_modules/cspell-io/dist/cjs/file/file.js -var require_file3 = __commonJS({ - "node_modules/cspell-io/dist/cjs/file/file.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getStatSync = exports.getStat = exports.readFileSync = exports.readFile = void 0; - var CSpellIONode_js_1 = require_CSpellIONode(); - var index_js_1 = require_errors2(); - var readFile4 = function(filename, encoding) { - return (0, CSpellIONode_js_1.getDefaultCSpellIO)().readFile(filename, encoding).then((fr) => fr.content); - }; - exports.readFile = readFile4; - var readFileSync5 = function(filename, encoding) { - return (0, CSpellIONode_js_1.getDefaultCSpellIO)().readFileSync(filename, encoding).content; - }; - exports.readFileSync = readFileSync5; - var getStat3 = function(filenameOrUri) { - return (0, CSpellIONode_js_1.getDefaultCSpellIO)().getStat(filenameOrUri).catch(index_js_1.toError); - }; - exports.getStat = getStat3; - var getStatSync3 = function(filenameOrUri) { - try { - return (0, CSpellIONode_js_1.getDefaultCSpellIO)().getStatSync(filenameOrUri); - } catch (e) { - return (0, index_js_1.toError)(e); - } - }; - exports.getStatSync = getStatSync3; - } -}); - -// node_modules/cspell-io/dist/cjs/file/index.js -var require_file4 = __commonJS({ - "node_modules/cspell-io/dist/cjs/file/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.readFileSync = exports.readFile = exports.getStatSync = exports.getStat = exports.writeToFileIterableP = exports.writeToFileIterable = exports.writeToFile = void 0; - var index_js_1 = require_file2(); - Object.defineProperty(exports, "writeToFile", { enumerable: true, get: function() { - return index_js_1.writeToFile; - } }); - Object.defineProperty(exports, "writeToFileIterable", { enumerable: true, get: function() { - return index_js_1.writeToFileIterable; - } }); - Object.defineProperty(exports, "writeToFileIterableP", { enumerable: true, get: function() { - return index_js_1.writeToFileIterable; - } }); - var file_js_1 = require_file3(); - Object.defineProperty(exports, "getStat", { enumerable: true, get: function() { - return file_js_1.getStat; - } }); - Object.defineProperty(exports, "getStatSync", { enumerable: true, get: function() { - return file_js_1.getStatSync; - } }); - Object.defineProperty(exports, "readFile", { enumerable: true, get: function() { - return file_js_1.readFile; - } }); - Object.defineProperty(exports, "readFileSync", { enumerable: true, get: function() { - return file_js_1.readFileSync; - } }); - } -}); - -// node_modules/cspell-io/dist/cjs/index.js -var require_cjs3 = __commonJS({ - "node_modules/cspell-io/dist/cjs/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toDataUrl = exports.encodeDataUrl = exports.writeToFileIterableP = exports.writeToFileIterable = exports.writeToFile = exports.readFileSync = exports.readFile = exports.getStatSync = exports.getStat = exports.getDefaultCSpellIO = exports.CSpellIONode = exports.asyncIterableToArray = void 0; - var asyncIterable_js_1 = require_asyncIterable(); - Object.defineProperty(exports, "asyncIterableToArray", { enumerable: true, get: function() { - return asyncIterable_js_1.toArray; - } }); - var CSpellIONode_js_1 = require_CSpellIONode(); - Object.defineProperty(exports, "CSpellIONode", { enumerable: true, get: function() { - return CSpellIONode_js_1.CSpellIONode; - } }); - Object.defineProperty(exports, "getDefaultCSpellIO", { enumerable: true, get: function() { - return CSpellIONode_js_1.getDefaultCSpellIO; - } }); - var index_js_1 = require_file4(); - Object.defineProperty(exports, "getStat", { enumerable: true, get: function() { - return index_js_1.getStat; - } }); - Object.defineProperty(exports, "getStatSync", { enumerable: true, get: function() { - return index_js_1.getStatSync; - } }); - Object.defineProperty(exports, "readFile", { enumerable: true, get: function() { - return index_js_1.readFile; - } }); - Object.defineProperty(exports, "readFileSync", { enumerable: true, get: function() { - return index_js_1.readFileSync; - } }); - Object.defineProperty(exports, "writeToFile", { enumerable: true, get: function() { - return index_js_1.writeToFile; - } }); - Object.defineProperty(exports, "writeToFileIterable", { enumerable: true, get: function() { - return index_js_1.writeToFileIterable; - } }); - Object.defineProperty(exports, "writeToFileIterableP", { enumerable: true, get: function() { - return index_js_1.writeToFileIterableP; - } }); - var dataUrl_js_1 = require_dataUrl(); - Object.defineProperty(exports, "encodeDataUrl", { enumerable: true, get: function() { - return dataUrl_js_1.encodeDataUrl; - } }); - Object.defineProperty(exports, "toDataUrl", { enumerable: true, get: function() { - return dataUrl_js_1.toDataUrl; - } }); - } -}); - -// node_modules/cspell-lib/dist/cjs/Models/CSpellSettingsInternalDef.js -var require_CSpellSettingsInternalDef = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Models/CSpellSettingsInternalDef.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isDictionaryDefinitionInlineInternal = exports.isCSpellSettingsInternal = exports.createCSpellSettingsInternal = exports.cleanCSpellSettingsInternal = exports.SymbolCSpellSettingsInternal = void 0; - var util_js_1 = require_util(); - exports.SymbolCSpellSettingsInternal = Symbol("CSpellSettingsInternal"); - function cleanCSpellSettingsInternal(parts = {}) { - const csi = (0, util_js_1.clean)(parts); - Object.assign(csi, { [exports.SymbolCSpellSettingsInternal]: true }); - return csi; - } - exports.cleanCSpellSettingsInternal = cleanCSpellSettingsInternal; - function createCSpellSettingsInternal(parts = {}) { - return (0, util_js_1.clean)({ - ...parts, - [exports.SymbolCSpellSettingsInternal]: true - }); - } - exports.createCSpellSettingsInternal = createCSpellSettingsInternal; - function isCSpellSettingsInternal(cs) { - return !!cs[exports.SymbolCSpellSettingsInternal]; - } - exports.isCSpellSettingsInternal = isCSpellSettingsInternal; - function isDictionaryDefinitionInlineInternal(def) { - if (def.path) - return false; - const defInline = def; - return !!(defInline.words || defInline.flagWords || defInline.ignoreWords || defInline.suggestWords); - } - exports.isDictionaryDefinitionInlineInternal = isDictionaryDefinitionInlineInternal; - } -}); - -// node_modules/cspell-lib/dist/cjs/util/AutoResolveLRUCache.js -var require_AutoResolveLRUCache = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/AutoResolveLRUCache.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AutoResolveLastNCalls = exports.assertValidateLL = exports.AutoResolveLRUCache = void 0; - var assert_1 = __importDefault(require("assert")); - var util_js_1 = require_util(); - var AutoResolveLRUCache = class { - constructor(maxSize, isEqual) { - this.maxSize = maxSize; - this.isEqual = isEqual; - this.list = {}; - this.count = 0; - this._misses = 0; - this._hits = 0; - this._added = 0; - this._removed = 0; - (0, assert_1.default)(maxSize > 0); - } - get(params, fn) { - const isEqual = this.isEqual; - for (let n = this.list.n; n; n = n.n) { - if (isEqual(n.value.p, params)) { - this.addToHead(n); - ++this._hits; - return n.value.r; - } - } - ++this._misses; - if (!fn) - return void 0; - const value = { - p: params, - r: fn(params) - }; - this.addToHead({ value, n: void 0, p: void 0 }); - return value.r; - } - get size() { - return this.count; - } - get hits() { - return this._hits; - } - get misses() { - return this._misses; - } - get added() { - return this._added; - } - get removed() { - return this._removed; - } - clear() { - this._added = 0; - this._hits = 0; - this._misses = 0; - this._removed = 0; - this.list.n = void 0; - this.list.p = void 0; - this.count = 0; - } - addToHead(n) { - if (!this.list.n) { - this.list.n = n; - this.list.p = n; - n.n = void 0; - n.p = void 0; - this.count = 1; - this._added = 1; - return; - } - if (this.list.n === n) - return; - if (this.list.p === n) { - this.list.p = n.p; - } - const isNew = !n.n && !n.p; - n.p && (n.p.n = n.n); - n.n && (n.n.p = n.p); - n.p = void 0; - n.n = this.list.n; - n.n && (n.n.p = n); - this.list.n = n; - const add = isNew && 1 || 0; - this._added += add; - this.count += add; - if (this.count > this.maxSize) { - const prev = this.list.p?.p; - (0, assert_1.default)(prev); - prev.n = void 0; - this.list.p = prev; - ++this._removed; - --this.count; - } - } - stats() { - return { size: this.count, hits: this.hits, misses: this.misses, added: this.added, removed: this.removed }; - } - toJSON() { - return this.stats(); - } - static assertValid(cache) { - assertValidateLL(cache.list); - } - }; - exports.AutoResolveLRUCache = AutoResolveLRUCache; - function assertValidateLL(list) { - if (!list.n && !list.p) - return; - (0, assert_1.default)(list.n, "Bad Next"); - (0, assert_1.default)(list.p, "Bad Prev"); - const visited = /* @__PURE__ */ new Set(); - let n = list; - for (; n.n; n = n.n) { - (0, assert_1.default)(!visited.has(n.n), "Circular"); - visited.add(n.n); - } - (0, assert_1.default)(list.p === n, "Tail matches"); - visited.clear(); - n = list; - for (; n.p; n = n.p) { - (0, assert_1.default)(!visited.has(n.p), "Circular"); - visited.add(n.p); - } - (0, assert_1.default)(list.n === n, "Head matches"); - } - exports.assertValidateLL = assertValidateLL; - var AutoResolveLastNCalls = class extends AutoResolveLRUCache { - constructor(maxSize) { - super(maxSize, util_js_1.isArrayEqual); - } - }; - exports.AutoResolveLastNCalls = AutoResolveLastNCalls; - } -}); - -// node_modules/cspell-lib/dist/cjs/util/logger.js -var require_logger = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/logger.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getLogger = exports.setLogger = exports.log = exports.logWarning = exports.logError = void 0; - var _logger = console; - function logError(...args) { - _logger.error(...args); - } - exports.logError = logError; - function logWarning(...args) { - _logger.warn(...args); - } - exports.logWarning = logWarning; - function log(...args) { - _logger.log(...args); - } - exports.log = log; - function setLogger2(logger) { - const oldLogger = _logger; - _logger = logger; - return oldLogger; - } - exports.setLogger = setLogger2; - function getLogger() { - return _logger; - } - exports.getLogger = getLogger; - } -}); - // node_modules/resolve-from/index.js var require_resolve_from2 = __commonJS({ "node_modules/resolve-from/index.js"(exports, module2) { "use strict"; - var path16 = require("path"); + var path26 = require("path"); var Module = require("module"); - var fs6 = require("fs"); - var resolveFrom = (fromDirectory, moduleId, silent) => { + var fs9 = require("fs"); + var resolveFrom2 = (fromDirectory, moduleId, silent) => { if (typeof fromDirectory !== "string") { throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDirectory}\``); } @@ -30735,17 +27162,17 @@ var require_resolve_from2 = __commonJS({ throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``); } try { - fromDirectory = fs6.realpathSync(fromDirectory); + fromDirectory = fs9.realpathSync(fromDirectory); } catch (error2) { if (error2.code === "ENOENT") { - fromDirectory = path16.resolve(fromDirectory); + fromDirectory = path26.resolve(fromDirectory); } else if (silent) { return; } else { throw error2; } } - const fromFile = path16.join(fromDirectory, "noop.js"); + const fromFile = path26.join(fromDirectory, "noop.js"); const resolveFileName = () => Module._resolveFilename(moduleId, { id: fromFile, filename: fromFile, @@ -30760,8 +27187,8 @@ var require_resolve_from2 = __commonJS({ } return resolveFileName(); }; - module2.exports = (fromDirectory, moduleId) => resolveFrom(fromDirectory, moduleId); - module2.exports.silent = (fromDirectory, moduleId) => resolveFrom(fromDirectory, moduleId, true); + module2.exports = (fromDirectory, moduleId) => resolveFrom2(fromDirectory, moduleId); + module2.exports.silent = (fromDirectory, moduleId) => resolveFrom2(fromDirectory, moduleId, true); } }); @@ -30826,11 +27253,11 @@ var require_ini = __commonJS({ lines.forEach(function(line, _, __) { if (!line || line.match(/^\s*[;#]/)) return; - var match = line.match(re); - if (!match) + var match2 = line.match(re); + if (!match2) return; - if (match[1] !== void 0) { - section = unsafe(match[1]); + if (match2[1] !== void 0) { + section = unsafe(match2[1]); if (section === "__proto__") { p = {}; return; @@ -30838,10 +27265,10 @@ var require_ini = __commonJS({ p = out[section] = out[section] || {}; return; } - var key = unsafe(match[2]); + var key = unsafe(match2[2]); if (key === "__proto__") return; - var value = match[3] ? unsafe(match[4]) : true; + var value = match2[3] ? unsafe(match2[4]) : true; switch (value) { case "true": case "false": @@ -30931,13 +27358,13 @@ var require_ini = __commonJS({ var require_global_dirs = __commonJS({ "node_modules/global-dirs/index.js"(exports) { "use strict"; - var path16 = require("path"); - var os = require("os"); - var fs6 = require("fs"); + var path26 = require("path"); + var os5 = require("os"); + var fs9 = require("fs"); var ini = require_ini(); var readRc = (fp) => { try { - return ini.parse(fs6.readFileSync(fp, "utf8")).prefix; + return ini.parse(fs9.readFileSync(fp, "utf8")).prefix; } catch (err) { } }; @@ -30946,60 +27373,60 @@ var require_global_dirs = __commonJS({ return process.env.PREFIX; } if (process.platform === "win32") { - return path16.dirname(process.execPath); + return path26.dirname(process.execPath); } - return path16.dirname(path16.dirname(process.execPath)); + return path26.dirname(path26.dirname(process.execPath)); })(); var getNpmPrefix = () => { if (process.env.PREFIX) { return process.env.PREFIX; } - const homePrefix = readRc(path16.join(os.homedir(), ".npmrc")); + const homePrefix = readRc(path26.join(os5.homedir(), ".npmrc")); if (homePrefix) { return homePrefix; } - const globalConfigPrefix = readRc(path16.resolve(defaultNpmPrefix, "etc", "npmrc")); + const globalConfigPrefix = readRc(path26.resolve(defaultNpmPrefix, "etc", "npmrc")); if (globalConfigPrefix) { return globalConfigPrefix; } if (process.platform === "win32" && process.env.APPDATA) { - const prefix = path16.join(process.env.APPDATA, "npm"); - if (fs6.existsSync(prefix)) { + const prefix = path26.join(process.env.APPDATA, "npm"); + if (fs9.existsSync(prefix)) { return prefix; } } return defaultNpmPrefix; }; - var npmPrefix = path16.resolve(getNpmPrefix()); + var npmPrefix = path26.resolve(getNpmPrefix()); var getYarnPrefix = () => { if (process.env.PREFIX) { return process.env.PREFIX; } if (process.platform === "win32" && process.env.LOCALAPPDATA) { - const prefix = path16.join(process.env.LOCALAPPDATA, "Yarn"); - if (fs6.existsSync(prefix)) { + const prefix = path26.join(process.env.LOCALAPPDATA, "Yarn"); + if (fs9.existsSync(prefix)) { return prefix; } } - const configPrefix = path16.join(os.homedir(), ".config/yarn"); - if (fs6.existsSync(configPrefix)) { + const configPrefix = path26.join(os5.homedir(), ".config/yarn"); + if (fs9.existsSync(configPrefix)) { return configPrefix; } - const homePrefix = path16.join(os.homedir(), ".yarn-config"); - if (fs6.existsSync(homePrefix)) { + const homePrefix = path26.join(os5.homedir(), ".yarn-config"); + if (fs9.existsSync(homePrefix)) { return homePrefix; } return npmPrefix; }; exports.npm = {}; exports.npm.prefix = npmPrefix; - exports.npm.packages = path16.join(npmPrefix, process.platform === "win32" ? "node_modules" : "lib/node_modules"); - exports.npm.binaries = process.platform === "win32" ? npmPrefix : path16.join(npmPrefix, "bin"); - var yarnPrefix = path16.resolve(getYarnPrefix()); + exports.npm.packages = path26.join(npmPrefix, process.platform === "win32" ? "node_modules" : "lib/node_modules"); + exports.npm.binaries = process.platform === "win32" ? npmPrefix : path26.join(npmPrefix, "bin"); + var yarnPrefix = path26.resolve(getYarnPrefix()); exports.yarn = {}; exports.yarn.prefix = yarnPrefix; - exports.yarn.packages = path16.join(yarnPrefix, process.platform === "win32" ? "config/global/node_modules" : "global/node_modules"); - exports.yarn.binaries = path16.join(exports.yarn.packages, ".bin"); + exports.yarn.packages = path26.join(yarnPrefix, process.platform === "win32" ? "config/global/node_modules" : "global/node_modules"); + exports.yarn.binaries = path26.join(exports.yarn.packages, ".bin"); } }); @@ -31007,19 +27434,19 @@ var require_global_dirs = __commonJS({ var require_resolve_global = __commonJS({ "node_modules/resolve-global/index.js"(exports, module2) { "use strict"; - var path16 = require("path"); + var path26 = require("path"); var globalDirs = require_global_dirs(); - var resolveGlobal = (moduleId) => { + var resolveGlobal2 = (moduleId) => { try { - return require.resolve(path16.join(globalDirs.yarn.packages, moduleId)); + return require.resolve(path26.join(globalDirs.yarn.packages, moduleId)); } catch (_) { - return require.resolve(path16.join(globalDirs.npm.packages, moduleId)); + return require.resolve(path26.join(globalDirs.npm.packages, moduleId)); } }; - module2.exports = resolveGlobal; + module2.exports = resolveGlobal2; module2.exports.silent = (moduleId) => { try { - return resolveGlobal(moduleId); + return resolveGlobal2(moduleId); } catch (_) { return void 0; } @@ -31027,18833 +27454,8443 @@ var require_resolve_global = __commonJS({ } }); -// node_modules/cspell-lib/dist/cjs/util/resolveFile.js -var require_resolveFile = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/resolveFile.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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 __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; +// node_modules/graceful-fs/polyfills.js +var require_polyfills = __commonJS({ + "node_modules/graceful-fs/polyfills.js"(exports, module2) { + var constants = require("constants"); + 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; }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.resolveFile = void 0; - var fs6 = __importStar(require("fs")); - var os = __importStar(require("os")); - var path16 = __importStar(require("path")); - var resolve_from_1 = __importDefault(require_resolve_from2()); - var resolve_global_1 = __importDefault(require_resolve_global()); - var testNodeModules = /^node_modules\//; - function resolveFile(filename, relativeTo) { - filename = filename.replace(/^~/, os.homedir()); - const steps = [ - { filename, fn: tryUrl }, - { filename, fn: tryNodeResolve }, - { filename: path16.resolve(relativeTo, filename), fn: tryResolveExists }, - { filename: path16.resolve(filename), fn: tryResolveExists }, - { filename, fn: tryNodeResolveDefaultPaths }, - { filename, fn: tryResolveFrom }, - { filename: filename.replace(testNodeModules, ""), fn: tryResolveFrom }, - { filename, fn: tryResolveGlobal } - ]; - for (const step of steps) { - const r = step.fn(step.filename, relativeTo); - if (r.found) - return r; - } - return { filename: path16.resolve(relativeTo, filename), relativeTo, found: false }; + try { + process.cwd(); + } catch (er) { } - exports.resolveFile = resolveFile; - var isUrlRegExp = /^\w+:\/\//i; - function tryUrl(filename, relativeTo) { - if (isUrlRegExp.test(filename)) { - return { filename, relativeTo: void 0, found: true }; - } - if (isUrlRegExp.test(relativeTo)) { - const url = new URL(filename, relativeTo); - return { filename: url.href, relativeTo, found: true }; - } - return { filename, relativeTo: void 0, found: false }; + if (typeof process.chdir === "function") { + chdir = process.chdir; + process.chdir = function(d) { + cwd = null; + chdir.call(process, d); + }; + if (Object.setPrototypeOf) + Object.setPrototypeOf(process.chdir, chdir); } - function tryNodeResolveDefaultPaths(filename) { - try { - const r = require.resolve(filename); - return { filename: r, relativeTo: void 0, found: true }; - } catch (_) { - return { filename, relativeTo: void 0, found: false }; + var chdir; + module2.exports = patch; + function patch(fs9) { + if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs9); + } + if (!fs9.lutimes) { + patchLutimes(fs9); + } + fs9.chown = chownFix(fs9.chown); + fs9.fchown = chownFix(fs9.fchown); + fs9.lchown = chownFix(fs9.lchown); + fs9.chmod = chmodFix(fs9.chmod); + fs9.fchmod = chmodFix(fs9.fchmod); + fs9.lchmod = chmodFix(fs9.lchmod); + fs9.chownSync = chownFixSync(fs9.chownSync); + fs9.fchownSync = chownFixSync(fs9.fchownSync); + fs9.lchownSync = chownFixSync(fs9.lchownSync); + fs9.chmodSync = chmodFixSync(fs9.chmodSync); + fs9.fchmodSync = chmodFixSync(fs9.fchmodSync); + fs9.lchmodSync = chmodFixSync(fs9.lchmodSync); + fs9.stat = statFix(fs9.stat); + fs9.fstat = statFix(fs9.fstat); + fs9.lstat = statFix(fs9.lstat); + fs9.statSync = statFixSync(fs9.statSync); + fs9.fstatSync = statFixSync(fs9.fstatSync); + fs9.lstatSync = statFixSync(fs9.lstatSync); + if (fs9.chmod && !fs9.lchmod) { + fs9.lchmod = function(path26, mode, cb) { + if (cb) + process.nextTick(cb); + }; + fs9.lchmodSync = function() { + }; } - } - function tryNodeResolve(filename, relativeTo) { - const home = os.homedir(); - function calcPaths(p) { - const paths2 = [p]; - if (filename.startsWith(".") && (filename.startsWith("./") || filename.startsWith("." + path16.sep) || filename.startsWith(".."))) { - return paths2; - } - for (; p && path16.dirname(p) !== p && p !== home; p = path16.dirname(p)) { - paths2.push(p); - } - return paths2; + if (fs9.chown && !fs9.lchown) { + fs9.lchown = function(path26, uid, gid, cb) { + if (cb) + process.nextTick(cb); + }; + fs9.lchownSync = function() { + }; } - const paths = calcPaths(path16.resolve(relativeTo)); - try { - const r = require.resolve(filename, { paths }); - return { filename: r, relativeTo, found: true }; - } catch (_) { - return { filename, relativeTo, found: false }; + if (platform === "win32") { + fs9.rename = typeof fs9.rename !== "function" ? fs9.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 < 6e4) { + setTimeout(function() { + fs9.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; + }(fs9.rename); } - } - function tryResolveGlobal(filename) { - const r = resolve_global_1.default.silent(filename); - return { filename: r || filename, relativeTo: void 0, found: !!r }; - } - function tryResolveExists(filename) { - return { filename, relativeTo: void 0, found: fs6.existsSync(filename) }; - } - function tryResolveFrom(filename, relativeTo) { - try { - return { filename: (0, resolve_from_1.default)(relativeTo, filename), relativeTo, found: true }; - } catch (error2) { - return { filename, relativeTo, found: false }; + fs9.read = typeof fs9.read !== "function" ? fs9.read : function(fs$read) { + function read2(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(fs9, fd, buffer, offset, length, position, callback); + } + callback_.apply(this, arguments); + }; + } + return fs$read.call(fs9, fd, buffer, offset, length, position, callback); + } + if (Object.setPrototypeOf) + Object.setPrototypeOf(read2, fs$read); + return read2; + }(fs9.read); + fs9.readSync = typeof fs9.readSync !== "function" ? fs9.readSync : function(fs$readSync) { + return function(fd, buffer, offset, length, position) { + var eagCounter = 0; + while (true) { + try { + return fs$readSync.call(fs9, fd, buffer, offset, length, position); + } catch (er) { + if (er.code === "EAGAIN" && eagCounter < 10) { + eagCounter++; + continue; + } + throw er; + } + } + }; + }(fs9.readSync); + function patchLchmod(fs10) { + fs10.lchmod = function(path26, mode, callback) { + fs10.open( + path26, + constants.O_WRONLY | constants.O_SYMLINK, + mode, + function(err, fd) { + if (err) { + if (callback) + callback(err); + return; + } + fs10.fchmod(fd, mode, function(err2) { + fs10.close(fd, function(err22) { + if (callback) + callback(err2 || err22); + }); + }); + } + ); + }; + fs10.lchmodSync = function(path26, mode) { + var fd = fs10.openSync(path26, constants.O_WRONLY | constants.O_SYMLINK, mode); + var threw = true; + var ret; + try { + ret = fs10.fchmodSync(fd, mode); + threw = false; + } finally { + if (threw) { + try { + fs10.closeSync(fd); + } catch (er) { + } + } else { + fs10.closeSync(fd); + } + } + return ret; + }; } - } - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/constants.js -var require_constants3 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/constants.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ENV_CSPELL_GLOB_ROOT = exports.currentSettingsFileVersion = exports.configSettingsFileVersion0_2 = exports.configSettingsFileVersion0_1 = void 0; - exports.configSettingsFileVersion0_1 = "0.1"; - exports.configSettingsFileVersion0_2 = "0.2"; - exports.currentSettingsFileVersion = exports.configSettingsFileVersion0_2; - exports.ENV_CSPELL_GLOB_ROOT = "CSPELL_GLOB_ROOT"; - } -}); - -// node_modules/cspell-lib/dist/cjs/util/AutoResolve.js -var require_AutoResolve = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/AutoResolve.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createAutoResolveWeakCache = exports.AutoResolveWeakCache = exports.autoResolveWeak = exports.createAutoResolveCache = exports.AutoResolveCache = exports.autoResolve = void 0; - function autoResolve(map, key, resolve10) { - const found = map.get(key); - if (found !== void 0 || map.has(key)) - return found; - const value = resolve10(key); - map.set(key, value); - return value; - } - exports.autoResolve = autoResolve; - var AutoResolveCache = class { - constructor() { - this.map = /* @__PURE__ */ new Map(); + function patchLutimes(fs10) { + if (constants.hasOwnProperty("O_SYMLINK") && fs10.futimes) { + fs10.lutimes = function(path26, at, mt, cb) { + fs10.open(path26, constants.O_SYMLINK, function(er, fd) { + if (er) { + if (cb) + cb(er); + return; + } + fs10.futimes(fd, at, mt, function(er2) { + fs10.close(fd, function(er22) { + if (cb) + cb(er2 || er22); + }); + }); + }); + }; + fs10.lutimesSync = function(path26, at, mt) { + var fd = fs10.openSync(path26, constants.O_SYMLINK); + var ret; + var threw = true; + try { + ret = fs10.futimesSync(fd, at, mt); + threw = false; + } finally { + if (threw) { + try { + fs10.closeSync(fd); + } catch (er) { + } + } else { + fs10.closeSync(fd); + } + } + return ret; + }; + } else if (fs10.futimes) { + fs10.lutimes = function(_a2, _b, _c, cb) { + if (cb) + process.nextTick(cb); + }; + fs10.lutimesSync = function() { + }; + } } - get(k, resolve10) { - return resolve10 ? autoResolve(this.map, k, resolve10) : this.map.get(k); + function chmodFix(orig) { + if (!orig) + return orig; + return function(target, mode, cb) { + return orig.call(fs9, target, mode, function(er) { + if (chownErOk(er)) + er = null; + if (cb) + cb.apply(this, arguments); + }); + }; } - has(k) { - return this.map.has(k); + function chmodFixSync(orig) { + if (!orig) + return orig; + return function(target, mode) { + try { + return orig.call(fs9, target, mode); + } catch (er) { + if (!chownErOk(er)) + throw er; + } + }; } - set(k, v) { - this.map.set(k, v); - return this; + function chownFix(orig) { + if (!orig) + return orig; + return function(target, uid, gid, cb) { + return orig.call(fs9, target, uid, gid, function(er) { + if (chownErOk(er)) + er = null; + if (cb) + cb.apply(this, arguments); + }); + }; } - }; - exports.AutoResolveCache = AutoResolveCache; - function createAutoResolveCache() { - return new AutoResolveCache(); - } - exports.createAutoResolveCache = createAutoResolveCache; - function autoResolveWeak(map, key, resolve10) { - const found = map.get(key); - if (found !== void 0 || map.has(key)) - return found; - const value = resolve10(key); - map.set(key, value); - return value; - } - exports.autoResolveWeak = autoResolveWeak; - var AutoResolveWeakCache = class { - constructor() { - this.map = /* @__PURE__ */ new WeakMap(); + function chownFixSync(orig) { + if (!orig) + return orig; + return function(target, uid, gid) { + try { + return orig.call(fs9, target, uid, gid); + } catch (er) { + if (!chownErOk(er)) + throw er; + } + }; } - get(k, resolve10) { - return resolve10 ? autoResolveWeak(this.map, k, resolve10) : this.map.get(k); + function statFix(orig) { + if (!orig) + return orig; + 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 += 4294967296; + if (stats.gid < 0) + stats.gid += 4294967296; + } + if (cb) + cb.apply(this, arguments); + } + return options ? orig.call(fs9, target, options, callback) : orig.call(fs9, target, callback); + }; } - has(k) { - return this.map.has(k); + function statFixSync(orig) { + if (!orig) + return orig; + return function(target, options) { + var stats = options ? orig.call(fs9, target, options) : orig.call(fs9, target); + if (stats) { + if (stats.uid < 0) + stats.uid += 4294967296; + if (stats.gid < 0) + stats.gid += 4294967296; + } + return stats; + }; } - set(k, v) { - this.map.set(k, v); - return this; + 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; } - }; - exports.AutoResolveWeakCache = AutoResolveWeakCache; - function createAutoResolveWeakCache() { - return new AutoResolveWeakCache(); } - exports.createAutoResolveWeakCache = createAutoResolveWeakCache; } }); -// node_modules/gensequence/dist/util/util.js -var require_util4 = __commonJS({ - "node_modules/gensequence/dist/util/util.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toIterableIterator = exports.toIterator = void 0; - function toIterator(values) { - let iter; - const rangeIterator = { - next: function() { - if (!iter) { - iter = values[Symbol.iterator](); +// node_modules/graceful-fs/legacy-streams.js +var require_legacy_streams = __commonJS({ + "node_modules/graceful-fs/legacy-streams.js"(exports, module2) { + var Stream3 = require("stream").Stream; + module2.exports = legacy; + function legacy(fs9) { + return { + ReadStream, + WriteStream + }; + function ReadStream(path26, options) { + if (!(this instanceof ReadStream)) + return new ReadStream(path26, options); + Stream3.call(this); + var self = this; + this.path = path26; + this.fd = null; + this.readable = true; + this.paused = false; + this.flags = "r"; + this.mode = 438; + this.bufferSize = 64 * 1024; + options = options || {}; + var keys2 = Object.keys(options); + for (var index = 0, length = keys2.length; index < length; index++) { + var key = keys2[index]; + this[key] = options[key]; + } + if (this.encoding) + this.setEncoding(this.encoding); + if (this.start !== void 0) { + if ("number" !== typeof this.start) { + throw TypeError("start must be a Number"); + } + if (this.end === void 0) { + 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"); } - return iter.next(); + this.pos = this.start; } - }; - return rangeIterator; - } - exports.toIterator = toIterator; - function* toIterableIterator(i) { - yield* i; - } - exports.toIterableIterator = toIterableIterator; - } -}); - -// node_modules/gensequence/dist/operators/operatorsBase.js -var require_operatorsBase = __commonJS({ - "node_modules/gensequence/dist/operators/operatorsBase.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.scanMap = exports.isAsyncIterableIterator = exports.isAsyncIterable = exports.makeAsyncIterable = exports.isIterableIterator = exports.isIterable = exports.makeIterable = exports.reduceAsyncForAsyncIterator = exports.reduceAsync = exports.reduce = exports.min = exports.max = exports.forEach = exports.first = exports.count = exports.any = exports.all = exports.scan = exports.map = exports.combine = exports.concatMap = exports.concat = exports.take = exports.skip = exports.filter = void 0; - function* filter(i, fnFilter) { - for (const v of i) { - if (fnFilter(v)) { - yield v; + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; } + fs9.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(); + }); } - } - exports.filter = filter; - function* skip(i, n) { - let a = 0; - for (const t of i) { - if (a >= n) { - yield t; + function WriteStream(path26, options) { + if (!(this instanceof WriteStream)) + return new WriteStream(path26, options); + Stream3.call(this); + this.path = path26; + this.fd = null; + this.writable = true; + this.flags = "w"; + this.encoding = "binary"; + this.mode = 438; + this.bytesWritten = 0; + options = options || {}; + var keys2 = Object.keys(options); + for (var index = 0, length = keys2.length; index < length; index++) { + var key = keys2[index]; + this[key] = options[key]; } - a += 1; - } - } - exports.skip = skip; - function* take(i, n) { - let a = 0; - if (n) { - for (const t of i) { - if (a >= n) { - break; + if (this.start !== void 0) { + if ("number" !== typeof this.start) { + throw TypeError("start must be a Number"); + } + if (this.start < 0) { + throw new Error("start must be >= zero"); } - yield t; - a += 1; + this.pos = this.start; + } + this.busy = false; + this._queue = []; + if (this.fd === null) { + this._open = fs9.open; + this._queue.push([this._open, this.path, this.flags, this.mode, void 0]); + this.flush(); } } } - exports.take = take; - function* concat(i, j) { - yield* i; - yield* j; + } +}); + +// node_modules/graceful-fs/clone.js +var require_clone = __commonJS({ + "node_modules/graceful-fs/clone.js"(exports, module2) { + "use strict"; + module2.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 = /* @__PURE__ */ Object.create(null); + Object.getOwnPropertyNames(obj).forEach(function(key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)); + }); + return copy; } - exports.concat = concat; - function* concatMap(i, fn) { - for (const t of i) { - yield* fn(t); - } + } +}); + +// node_modules/graceful-fs/graceful-fs.js +var require_graceful_fs = __commonJS({ + "node_modules/graceful-fs/graceful-fs.js"(exports, module2) { + var fs9 = require("fs"); + var polyfills = require_polyfills(); + var legacy = require_legacy_streams(); + var clone = require_clone(); + var util = require("util"); + var gracefulQueue; + var previousSymbol; + if (typeof Symbol === "function" && typeof Symbol.for === "function") { + gracefulQueue = Symbol.for("graceful-fs.queue"); + previousSymbol = Symbol.for("graceful-fs.previous"); + } else { + gracefulQueue = "___graceful-fs.queue"; + previousSymbol = "___graceful-fs.previous"; } - exports.concatMap = concatMap; - function* combine(i, j, fnMap) { - const jit = j[Symbol.iterator](); - for (const r of i) { - const s = jit.next().value; - yield fnMap(r, s); - } + function noop() { } - exports.combine = combine; - function map(i, fnMap) { - function* fn(i2, fnMap2) { - for (const v of i2) { - yield fnMap2(v); + function publishQueue(context, queue2) { + Object.defineProperty(context, gracefulQueue, { + get: function() { + return queue2; } - } - return fn(i, fnMap); + }); } - exports.map = map; - function* scan(i, fnReduce, initValue) { - let index = 0; - if (initValue === void 0) { - index = 1; - const iter = i[Symbol.iterator](); - let r = iter.next(); - if (!r.done) - yield r.value; - initValue = r.value; - i = makeIterable(iter); - } - let prevValue = initValue; - for (const t of i) { - const nextValue = fnReduce(prevValue, t, index); - yield nextValue; - prevValue = nextValue; - index += 1; - } - } - exports.scan = scan; - function all(i, fn) { - for (const t of i) { - if (!fn(t)) { - return false; + 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); + }; + if (!fs9[gracefulQueue]) { + queue = global[gracefulQueue] || []; + publishQueue(fs9, queue); + fs9.close = function(fs$close) { + function close(fd, cb) { + return fs$close.call(fs9, fd, function(err) { + if (!err) { + resetQueue(); + } + if (typeof cb === "function") + cb.apply(this, arguments); + }); } - } - return true; - } - exports.all = all; - function any(i, fn) { - for (const t of i) { - if (fn(t)) { - return true; + Object.defineProperty(close, previousSymbol, { + value: fs$close + }); + return close; + }(fs9.close); + fs9.closeSync = function(fs$closeSync) { + function closeSync(fd) { + fs$closeSync.apply(fs9, arguments); + resetQueue(); } + Object.defineProperty(closeSync, previousSymbol, { + value: fs$closeSync + }); + return closeSync; + }(fs9.closeSync); + if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) { + process.on("exit", function() { + debug(fs9[gracefulQueue]); + require("assert").equal(fs9[gracefulQueue].length, 0); + }); } - return false; } - exports.any = any; - function count(i) { - return reduce2(i, (p) => p + 1, 0); - } - exports.count = count; - function first(i, fn, defaultValue) { - fn = fn || (() => true); - for (const t of i) { - if (fn(t)) { - return t; + var queue; + if (!global[gracefulQueue]) { + publishQueue(global, fs9[gracefulQueue]); + } + module2.exports = patch(clone(fs9)); + if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs9.__patched) { + module2.exports = patch(fs9); + fs9.__patched = true; + } + function patch(fs10) { + polyfills(fs10); + fs10.gracefulify = patch; + fs10.createReadStream = createReadStream; + fs10.createWriteStream = createWriteStream; + var fs$readFile = fs10.readFile; + fs10.readFile = readFile3; + function readFile3(path26, options, cb) { + if (typeof options === "function") + cb = options, options = null; + return go$readFile(path26, options, cb); + function go$readFile(path27, options2, cb2, startTime) { + return fs$readFile(path27, options2, function(err) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$readFile, [path27, options2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); } } - return defaultValue; - } - exports.first = first; - function forEach(i, fn) { - let index = 0; - for (const t of i) { - fn(t, index); - index += 1; - } - } - exports.forEach = forEach; - function max(i, selector = (t) => t) { - return reduce2(i, (p, c) => selector(c) > selector(p) ? c : p, void 0); - } - exports.max = max; - function min(i, selector = (t) => t) { - return reduce2(i, (p, c) => selector(c) < selector(p) ? c : p, void 0); - } - exports.min = min; - function reduce2(i, fnReduce, initialValue) { - const iter = makeIterable(i[Symbol.iterator]()); - let index = 0; - if (initialValue === void 0) { - index = 1; - const r = iter.next(); - initialValue = r.value; - } - let prevValue = initialValue; - for (const t of iter) { - const nextValue = fnReduce(prevValue, t, index); - prevValue = nextValue; - index += 1; - } - return prevValue; - } - exports.reduce = reduce2; - async function reduceAsync2(i, fnReduce, initialValue) { - const iter = makeIterable(i[Symbol.iterator]()); - let index = 0; - if (initialValue === void 0) { - index = 1; - const r = iter.next(); - initialValue = r.value; - } - let previousValue = await initialValue; - for (const p of iter) { - const t = await p; - const nextValue = await fnReduce(previousValue, t, index); - previousValue = nextValue; - index += 1; - } - return previousValue; - } - exports.reduceAsync = reduceAsync2; - async function reduceAsyncForAsyncIterator(i, fnReduce, initialValue) { - const iter = makeAsyncIterable(i[Symbol.asyncIterator]()); - let index = 0; - if (initialValue === void 0) { - index = 1; - const r = await iter.next(); - initialValue = r.value; - } - let previousValue = await initialValue; - for await (const t of iter) { - const nextValue = await fnReduce(previousValue, t, index); - previousValue = nextValue; - index += 1; - } - return previousValue; - } - exports.reduceAsyncForAsyncIterator = reduceAsyncForAsyncIterator; - function makeIterable(i) { - function* fromIterator(i2) { - for (let r = i2.next(); !r.done; r = i2.next()) { - yield r.value; + var fs$writeFile = fs10.writeFile; + fs10.writeFile = writeFile; + function writeFile(path26, data, options, cb) { + if (typeof options === "function") + cb = options, options = null; + return go$writeFile(path26, data, options, cb); + function go$writeFile(path27, data2, options2, cb2, startTime) { + return fs$writeFile(path27, data2, options2, function(err) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$writeFile, [path27, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); } } - function* fromIterable(i2) { - yield* i2; - } - return isIterable2(i) ? isIterableIterator(i) ? i : fromIterable(i) : fromIterator(i); - } - exports.makeIterable = makeIterable; - function isIterable2(i) { - return !!i[Symbol.iterator]; - } - exports.isIterable = isIterable2; - function isIterableIterator(i) { - return typeof i.next == "function"; - } - exports.isIterableIterator = isIterableIterator; - function makeAsyncIterable(i) { - async function* fromIterable(i2) { - for (const v of i2) { - yield v; + var fs$appendFile = fs10.appendFile; + if (fs$appendFile) + fs10.appendFile = appendFile; + function appendFile(path26, data, options, cb) { + if (typeof options === "function") + cb = options, options = null; + return go$appendFile(path26, data, options, cb); + function go$appendFile(path27, data2, options2, cb2, startTime) { + return fs$appendFile(path27, data2, options2, function(err) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$appendFile, [path27, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); } } - async function* fromIterator(i2) { - for (let r = await i2.next(); !r.done; r = await i2.next()) { - yield r.value; + var fs$copyFile = fs10.copyFile; + if (fs$copyFile) + fs10.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(src2, dest2, flags2, cb2, startTime) { + return fs$copyFile(src2, dest2, flags2, function(err) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); } } - async function* fromAsyncIterable(i2) { - yield* i2; - } - return isAsyncIterable3(i) ? isAsyncIterableIterator(i) ? i : fromAsyncIterable(i) : isIterable2(i) ? fromIterable(i) : fromIterator(i); - } - exports.makeAsyncIterable = makeAsyncIterable; - function isAsyncIterable3(i) { - return !!i[Symbol.asyncIterator]; - } - exports.isAsyncIterable = isAsyncIterable3; - function isAsyncIterableIterator(i) { - return typeof i.next == "function"; - } - exports.isAsyncIterableIterator = isAsyncIterableIterator; - function scanMap(accFn, init) { - let acc = init; - let first2 = true; - return function(value) { - if (first2 && acc === void 0) { - first2 = false; - acc = value; - return acc; - } - acc = accFn(acc, value); - return acc; - }; - } - exports.scanMap = scanMap; - } -}); - -// node_modules/gensequence/dist/operators/operators.js -var require_operators = __commonJS({ - "node_modules/gensequence/dist/operators/operators.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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.pipe = exports.reduceAsyncForAsyncIterator = exports.reduceAsync = exports.reduce = exports.min = exports.max = exports.forEach = exports.first = exports.count = exports.any = exports.all = exports.scan = exports.map = exports.combine = exports.concatMap = exports.concat = exports.take = exports.skip = exports.filter = void 0; - var op = __importStar(require_operatorsBase()); - function filter(fnFilter) { - return (i) => op.filter(i, fnFilter); - } - exports.filter = filter; - function skip(n) { - return (i) => op.skip(i, n); - } - exports.skip = skip; - function take(n) { - return (i) => op.take(i, n); - } - exports.take = take; - function concat(j) { - return (i) => op.concat(i, j); - } - exports.concat = concat; - function concatMap(fn) { - return (i) => op.concatMap(i, fn); - } - exports.concatMap = concatMap; - function combine(fnMap, j) { - return (i) => op.combine(i, j, fnMap); - } - exports.combine = combine; - function map(fnMap) { - return (i) => op.map(i, fnMap); - } - exports.map = map; - function scan(fnReduce, initValue) { - return (i) => op.scan(i, fnReduce, initValue); - } - exports.scan = scan; - function all(fn) { - return (i) => op.all(i, fn); - } - exports.all = all; - function any(fn) { - return (i) => op.any(i, fn); - } - exports.any = any; - function count() { - return (i) => op.count(i); - } - exports.count = count; - function first(fn, defaultValue) { - return (i) => op.first(i, fn, defaultValue); - } - exports.first = first; - function forEach(fn) { - return (i) => op.forEach(i, fn); - } - exports.forEach = forEach; - function max(selector) { - return (i) => op.max(i, selector); - } - exports.max = max; - function min(selector) { - return (i) => op.min(i, selector); - } - exports.min = min; - function reduce2(fnReduce, initialValue) { - return (i) => op.reduce(i, fnReduce, initialValue); - } - exports.reduce = reduce2; - function reduceAsync2(fnReduceAsync, initialValue) { - return (i) => op.reduceAsync(i, fnReduceAsync, initialValue); - } - exports.reduceAsync = reduceAsync2; - function reduceAsyncForAsyncIterator(fnReduceAsync, initialValue) { - return (i) => op.reduceAsyncForAsyncIterator(i, fnReduceAsync, initialValue); - } - exports.reduceAsyncForAsyncIterator = reduceAsyncForAsyncIterator; - function pipe(...fns) { - return (i) => { - for (const fn of fns) { - i = fn ? fn(i) : i; - } - return i; - }; - } - exports.pipe = pipe; - } -}); - -// node_modules/gensequence/dist/operators/index.js -var require_operators2 = __commonJS({ - "node_modules/gensequence/dist/operators/index.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __exportStar = exports && exports.__exportStar || function(m, exports2) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) - __createBinding(exports2, m, p); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - __exportStar(require_operators(), exports); - } -}); - -// node_modules/gensequence/dist/ImplSequence.js -var require_ImplSequence = __commonJS({ - "node_modules/gensequence/dist/ImplSequence.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ImplSequence = void 0; - var index_js_1 = require_operators2(); - var util_js_1 = require_util4(); - var ImplSequence = class _ImplSequence { - constructor(i) { - this.i = i; - } - get iter() { - return typeof this.i === "function" ? this.i() : this.i; - } - get iterator() { - if (!this._iterator) { - this._iterator = this.iter[Symbol.iterator](); + var fs$readdir = fs10.readdir; + fs10.readdir = readdir; + var noReaddirOptionVersions = /^v[0-5]\./; + function readdir(path26, options, cb) { + if (typeof options === "function") + cb = options, options = null; + var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path27, options2, cb2, startTime) { + return fs$readdir(path27, fs$readdirCallback( + path27, + options2, + cb2, + startTime + )); + } : function go$readdir2(path27, options2, cb2, startTime) { + return fs$readdir(path27, options2, fs$readdirCallback( + path27, + options2, + cb2, + startTime + )); + }; + return go$readdir(path26, options, cb); + function fs$readdirCallback(path27, options2, cb2, startTime) { + return function(err, files) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([ + go$readdir, + [path27, options2, cb2], + err, + startTime || Date.now(), + Date.now() + ]); + else { + if (files && files.sort) + files.sort(); + if (typeof cb2 === "function") + cb2.call(this, err, files); + } + }; } - return this._iterator; - } - inject(fn) { - const iter = this.i; - return () => fn(typeof iter === "function" ? iter() : iter); - } - chain(fn) { - return new _ImplSequence(this.inject(fn)); - } - [Symbol.iterator]() { - return this.iter[Symbol.iterator](); - } - next() { - return this.iterator.next(); - } - //// Filters - filter(fnFilter) { - return this.chain((0, index_js_1.filter)(fnFilter)); - } - skip(n) { - return this.chain((0, index_js_1.skip)(n)); - } - take(n) { - return this.chain((0, index_js_1.take)(n)); } - //// Extenders - concat(j) { - return this.chain((0, index_js_1.concat)(j)); - } - concatMap(fn) { - return this.chain((0, index_js_1.concatMap)(fn)); - } - //// Mappers - combine(fn, j) { - return this.chain((0, index_js_1.combine)(fn, j)); - } - map(fn) { - return this.chain((0, index_js_1.map)(fn)); - } - scan(fnReduce, initValue) { - return this.chain((0, index_js_1.scan)(fnReduce, initValue)); - } - pipe(...fns) { - if (!fns.length) - return this; - return this.chain(index_js_1.pipe.apply(null, fns)); - } - // Reducers - all(fnFilter) { - return (0, index_js_1.all)(fnFilter)(this.iter); - } - any(fnFilter) { - return (0, index_js_1.any)(fnFilter)(this.iter); - } - count() { - return (0, index_js_1.count)()(this.iter); - } - first(fnFilter, defaultValue) { - return (0, index_js_1.first)(fnFilter, defaultValue)(this.iter); - } - forEach(fn) { - return (0, index_js_1.forEach)(fn)(this.iter); - } - max(fnSelector) { - return (0, index_js_1.max)(fnSelector)(this.iter); - } - min(fnSelector) { - return (0, index_js_1.min)(fnSelector)(this.iter); - } - reduce(fnReduce, initValue) { - return (0, index_js_1.reduce)(fnReduce, initValue)(this.iter); - } - reduceAsync(fnReduceAsync, initialValue) { - return (0, index_js_1.reduceAsync)(fnReduceAsync, initialValue)(this.iter); + if (process.version.substr(0, 4) === "v0.8") { + var legStreams = legacy(fs10); + ReadStream = legStreams.ReadStream; + WriteStream = legStreams.WriteStream; } - reduceToSequence(fnReduce, initialValue) { - return this.chain((0, index_js_1.reduce)(fnReduce, initialValue)); + var fs$ReadStream = fs10.ReadStream; + if (fs$ReadStream) { + ReadStream.prototype = Object.create(fs$ReadStream.prototype); + ReadStream.prototype.open = ReadStream$open; } - //// Cast - toArray() { - return [...this.iter]; + var fs$WriteStream = fs10.WriteStream; + if (fs$WriteStream) { + WriteStream.prototype = Object.create(fs$WriteStream.prototype); + WriteStream.prototype.open = WriteStream$open; } - toIterable() { - return (0, util_js_1.toIterableIterator)(this.iter); + Object.defineProperty(fs10, "ReadStream", { + get: function() { + return ReadStream; + }, + set: function(val) { + ReadStream = val; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(fs10, "WriteStream", { + get: function() { + return WriteStream; + }, + set: function(val) { + WriteStream = val; + }, + enumerable: true, + configurable: true + }); + var FileReadStream = ReadStream; + Object.defineProperty(fs10, "FileReadStream", { + get: function() { + return FileReadStream; + }, + set: function(val) { + FileReadStream = val; + }, + enumerable: true, + configurable: true + }); + var FileWriteStream = WriteStream; + Object.defineProperty(fs10, "FileWriteStream", { + get: function() { + return FileWriteStream; + }, + set: function(val) { + FileWriteStream = val; + }, + enumerable: true, + configurable: true + }); + function ReadStream(path26, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this; + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments); } - }; - exports.ImplSequence = ImplSequence; - } -}); - -// node_modules/gensequence/dist/GenSequence.js -var require_GenSequence = __commonJS({ - "node_modules/gensequence/dist/GenSequence.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.sequenceFromRegExpMatch = exports.sequenceFromObject = exports.objectToSequence = exports.objectIterator = exports.toIterator = exports.GenSequence = exports.genSequence = exports.toIterableIterator = void 0; - var util_js_1 = require_util4(); - var ImplSequence_js_1 = require_ImplSequence(); - var util_js_2 = require_util4(); - Object.defineProperty(exports, "toIterableIterator", { enumerable: true, get: function() { - return util_js_2.toIterableIterator; - } }); - function genSequence(i) { - return new ImplSequence_js_1.ImplSequence(i); - } - exports.genSequence = genSequence; - exports.GenSequence = { - genSequence, - sequenceFromRegExpMatch, - sequenceFromObject - }; - exports.toIterator = util_js_1.toIterableIterator; - function* objectIterator(t) { - const keys = new Set(Object.keys(t)); - for (const k in t) { - if (keys.has(k)) { - yield [k, t[k]]; - } - } - } - exports.objectIterator = objectIterator; - function objectToSequence(t) { - return sequenceFromObject(t); - } - exports.objectToSequence = objectToSequence; - function sequenceFromObject(t) { - return genSequence(() => objectIterator(t)); - } - exports.sequenceFromObject = sequenceFromObject; - function sequenceFromRegExpMatch(pattern, text) { - function* doMatch() { - const regex = new RegExp(pattern); - let match; - let lastIndex = void 0; - while (match = regex.exec(text)) { - if (match.index === lastIndex) { - break; + 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(); } - lastIndex = match.index; - yield match; - } - } - return genSequence(() => doMatch()); - } - exports.sequenceFromRegExpMatch = sequenceFromRegExpMatch; - exports.default = genSequence; - } -}); - -// node_modules/gensequence/dist/ImplAsyncSequence.js -var require_ImplAsyncSequence = __commonJS({ - "node_modules/gensequence/dist/ImplAsyncSequence.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ImplAsyncSequence = void 0; - var index_js_1 = require_operators2(); - var ImplAsyncSequence = class { - constructor(i) { - this.i = i; - } - get iter() { - return typeof this.i === "function" ? this.i() : this.i; - } - [Symbol.asyncIterator]() { - return this.iter[Symbol.asyncIterator](); - } - reduceAsync(fnReduceAsync, initialValue) { - return (0, index_js_1.reduceAsyncForAsyncIterator)(fnReduceAsync, initialValue)(this.iter); - } - }; - exports.ImplAsyncSequence = ImplAsyncSequence; - } -}); - -// node_modules/gensequence/dist/AsyncGenSequence.js -var require_AsyncGenSequence = __commonJS({ - "node_modules/gensequence/dist/AsyncGenSequence.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.asyncGenSequence = void 0; - var ImplAsyncSequence_js_1 = require_ImplAsyncSequence(); - function asyncGenSequence(i) { - return new ImplAsyncSequence_js_1.ImplAsyncSequence(i); - } - exports.asyncGenSequence = asyncGenSequence; - } -}); - -// node_modules/gensequence/dist/ImplSequenceBuilder.js -var require_ImplSequenceBuilder = __commonJS({ - "node_modules/gensequence/dist/ImplSequenceBuilder.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ImplSequenceBuilder = void 0; - var index_js_1 = require_operators2(); - var ImplSequence_js_1 = require_ImplSequence(); - var ImplSequenceBuilder = class _ImplSequenceBuilder { - constructor(operators2 = []) { - this.operators = []; - this.operators = operators2; - } - build(i) { - return new ImplSequence_js_1.ImplSequence(i).pipe(index_js_1.pipe.apply(null, this.operators)); - } - pipe(...fns) { - return new _ImplSequenceBuilder([...this.operators, ...fns]); - } - //// Filters - /** keep values where the fnFilter(t) returns true */ - filter(fnFilter) { - return this.pipe((0, index_js_1.filter)(fnFilter)); - } - skip(n) { - return this.pipe((0, index_js_1.skip)(n)); - } - take(n) { - return this.pipe((0, index_js_1.take)(n)); - } - //// Extenders - concat(j) { - return this.pipe((0, index_js_1.concat)(j)); - } - concatMap(fn) { - return this.pipe((0, index_js_1.concatMap)(fn)); - } - //// Mappers - combine(fn, j) { - return this.pipe((0, index_js_1.combine)(fn, j)); - } - /** map values from type T to type U */ - map(fnMap) { - return this.pipe((0, index_js_1.map)(fnMap)); + }); } - scan(fnReduce, initialValue) { - return this.pipe((0, index_js_1.scan)(fnReduce, initialValue)); + function WriteStream(path26, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this; + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments); } - }; - exports.ImplSequenceBuilder = ImplSequenceBuilder; - } -}); - -// node_modules/gensequence/dist/builder.js -var require_builder = __commonJS({ - "node_modules/gensequence/dist/builder.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.builder = void 0; - var ImplSequenceBuilder_js_1 = require_ImplSequenceBuilder(); - var index_js_1 = require_operators2(); - function makeBuilder(fn) { - return new ImplSequenceBuilder_js_1.ImplSequenceBuilder([fn]); - } - exports.builder = Object.freeze({ - pipe: (fn) => { - return makeBuilder(fn); - }, - //// Filters - /** keep values where the fnFilter(t) returns true */ - filter: (fnFilter) => { - return makeBuilder((0, index_js_1.filter)(fnFilter)); - }, - skip: (n) => { - return makeBuilder((0, index_js_1.skip)(n)); - }, - take: (n) => { - return makeBuilder((0, index_js_1.take)(n)); - }, - //// Extenders - concat: (j) => { - return makeBuilder((0, index_js_1.concat)(j)); - }, - concatMap: (fn) => { - return makeBuilder((0, index_js_1.concatMap)(fn)); - }, - //// Mappers - combine: (fn, j) => { - return makeBuilder((0, index_js_1.combine)(fn, j)); - }, - /** map values from type T to type U */ - map: (fnMap) => { - return makeBuilder((0, index_js_1.map)(fnMap)); - }, - scan: (fnReduce, initialValue) => { - return makeBuilder((0, index_js_1.scan)(fnReduce, initialValue)); + 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); + } + }); } - }); - } -}); - -// node_modules/gensequence/dist/index.js -var require_dist2 = __commonJS({ - "node_modules/gensequence/dist/index.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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]; - } }; + function createReadStream(path26, options) { + return new fs10.ReadStream(path26, options); } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __exportStar = exports && exports.__exportStar || function(m, exports2) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) - __createBinding(exports2, m, p); - }; - var __importStar = exports && exports.__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); + function createWriteStream(path26, options) { + return new fs10.WriteStream(path26, options); } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.operators = void 0; - __exportStar(require_GenSequence(), exports); - __exportStar(require_AsyncGenSequence(), exports); - __exportStar(require_builder(), exports); - var _operators = __importStar(require_operators2()); - exports.operators = _operators; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/TrieNode.js -var require_TrieNode = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/TrieNode.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ChildMap = exports.FLAG_WORD = void 0; - exports.FLAG_WORD = 1; - var ChildMap = class extends Map { - }; - exports.ChildMap = ChildMap; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/constants.js -var require_constants4 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/constants.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultTrieOptions = exports.IDENTITY_PREFIX = exports.LINE_COMMENT = exports.FORBID_PREFIX = exports.CASE_INSENSITIVE_PREFIX = exports.OPTIONAL_COMPOUND_FIX = exports.COMPOUND_FIX = void 0; - exports.COMPOUND_FIX = "+"; - exports.OPTIONAL_COMPOUND_FIX = "*"; - exports.CASE_INSENSITIVE_PREFIX = "~"; - exports.FORBID_PREFIX = "!"; - exports.LINE_COMMENT = "#"; - exports.IDENTITY_PREFIX = "="; - exports.defaultTrieOptions = Object.freeze({ - compoundCharacter: exports.COMPOUND_FIX, - forbiddenWordPrefix: exports.FORBID_PREFIX, - stripCaseAndAccentsPrefix: exports.CASE_INSENSITIVE_PREFIX - }); - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/mergeDefaults.js -var require_mergeDefaults = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/mergeDefaults.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.mergeDefaults = void 0; - function mergeDefaults(value, defaultValue) { - const result = { ...defaultValue }; - if (value) { - for (const [k, v] of Object.entries(value)) { - if (k in result) { - result[k] = v ?? result[k]; - } + var fs$open = fs10.open; + fs10.open = open; + function open(path26, flags, mode, cb) { + if (typeof mode === "function") + cb = mode, mode = null; + return go$open(path26, flags, mode, cb); + function go$open(path27, flags2, mode2, cb2, startTime) { + return fs$open(path27, flags2, mode2, function(err, fd) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$open, [path27, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); } } - return result; + return fs10; } - exports.mergeDefaults = mergeDefaults; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/mergeOptionalWithDefaults.js -var require_mergeOptionalWithDefaults = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/mergeOptionalWithDefaults.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.mergeOptionalWithDefaults = void 0; - var constants_js_1 = require_constants4(); - var mergeDefaults_js_1 = require_mergeDefaults(); - function mergeOptionalWithDefaults(options) { - return (0, mergeDefaults_js_1.mergeDefaults)(options, constants_js_1.defaultTrieOptions); + function enqueue(elem) { + debug("ENQUEUE", elem[0].name, elem[1]); + fs9[gracefulQueue].push(elem); + retry(); } - exports.mergeOptionalWithDefaults = mergeOptionalWithDefaults; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/walker/walkerTypes.js -var require_walkerTypes = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/walker/walkerTypes.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.CompoundWordsMethod = exports.WORD_SEPARATOR = exports.JOIN_SEPARATOR = void 0; - exports.JOIN_SEPARATOR = "+"; - exports.WORD_SEPARATOR = " "; - var CompoundWordsMethod; - (function(CompoundWordsMethod2) { - CompoundWordsMethod2[CompoundWordsMethod2["NONE"] = 0] = "NONE"; - CompoundWordsMethod2[CompoundWordsMethod2["SEPARATE_WORDS"] = 1] = "SEPARATE_WORDS"; - CompoundWordsMethod2[CompoundWordsMethod2["JOIN_WORDS"] = 2] = "JOIN_WORDS"; - })(CompoundWordsMethod || (exports.CompoundWordsMethod = CompoundWordsMethod = {})); - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/walker/walker.js -var require_walker = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/walker/walker.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.walker = void 0; - var walkerTypes_js_1 = require_walkerTypes(); - function* walker(root, compoundingMethod = walkerTypes_js_1.CompoundWordsMethod.NONE) { - const roots = { - [walkerTypes_js_1.CompoundWordsMethod.NONE]: [], - [walkerTypes_js_1.CompoundWordsMethod.JOIN_WORDS]: [[walkerTypes_js_1.JOIN_SEPARATOR, root]], - [walkerTypes_js_1.CompoundWordsMethod.SEPARATE_WORDS]: [[walkerTypes_js_1.WORD_SEPARATOR, root]] - }; - function* children(n) { - if (n.c) { - yield* n.c; - } - if (n.f) { - yield* roots[compoundingMethod]; - } - } - let depth = 0; - const stack = []; - stack[depth] = { t: "", c: children(root) }; - let ir; - while (depth >= 0) { - let baseText = stack[depth].t; - while (!(ir = stack[depth].c.next()).done) { - const [char, node] = ir.value; - const text = baseText + char; - const goDeeper = yield { text, node, depth }; - if (goDeeper || goDeeper === void 0) { - depth++; - baseText = text; - stack[depth] = { t: text, c: children(node) }; - } + var retryTimer; + function resetQueue() { + var now = Date.now(); + for (var i = 0; i < fs9[gracefulQueue].length; ++i) { + if (fs9[gracefulQueue][i].length > 2) { + fs9[gracefulQueue][i][3] = now; + fs9[gracefulQueue][i][4] = now; } - depth -= 1; } + retry(); } - exports.walker = walker; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/trie-util.js -var require_trie_util = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/trie-util.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.trieNodeToRoot = exports.isCircular = exports.countWords = exports.countNodes = exports.findNode = exports.has = exports.createTriFromList = exports.createTrieRoot = exports.iteratorTrieWords = exports.iterateTrie = exports.walk = exports.orderTrie = exports.isWordTerminationNode = exports.insert = void 0; - var gensequence_1 = require_dist2(); - var TrieNode_js_1 = require_TrieNode(); - var mergeOptionalWithDefaults_js_1 = require_mergeOptionalWithDefaults(); - var walker_js_1 = require_walker(); - function insert(text, node = {}) { - if (text.length) { - const head = text[0]; - const tail = text.slice(1); - node.c = node.c || new TrieNode_js_1.ChildMap(); - node.c.set(head, insert(tail, node.c.get(head))); - } else { - node.f = (node.f || 0) | TrieNode_js_1.FLAG_WORD; - } - return node; - } - exports.insert = insert; - function isWordTerminationNode(node) { - return ((node.f || 0) & TrieNode_js_1.FLAG_WORD) === TrieNode_js_1.FLAG_WORD; - } - exports.isWordTerminationNode = isWordTerminationNode; - function orderTrie(node) { - if (!node.c) + function retry() { + clearTimeout(retryTimer); + retryTimer = void 0; + if (fs9[gracefulQueue].length === 0) return; - const nodes = [...node.c].sort(([a], [b]) => a < b ? -1 : 1); - node.c = new Map(nodes); - for (const n of node.c) { - orderTrie(n[1]); - } - } - exports.orderTrie = orderTrie; - function walk(node) { - return (0, gensequence_1.genSequence)((0, walker_js_1.walker)(node)); - } - exports.walk = walk; - exports.iterateTrie = walk; - function iteratorTrieWords(node) { - return walk(node).filter((r) => isWordTerminationNode(r.node)).map((r) => r.text); - } - exports.iteratorTrieWords = iteratorTrieWords; - function createTrieRoot(options) { - const fullOptions = (0, mergeOptionalWithDefaults_js_1.mergeOptionalWithDefaults)(options); - return { - ...fullOptions, - c: /* @__PURE__ */ new Map() - }; - } - exports.createTrieRoot = createTrieRoot; - function createTriFromList(words, options) { - const root = createTrieRoot(options); - for (const word of words) { - if (word.length) { - insert(word, root); - } - } - return root; - } - exports.createTriFromList = createTriFromList; - function has(node, word) { - let h = word.slice(0, 1); - let t = word.slice(1); - while (node.c && node.c.has(h)) { - node = node.c.get(h); - h = t.slice(0, 1); - t = t.slice(1); - } - return !h.length && !!((node.f || 0) & TrieNode_js_1.FLAG_WORD); - } - exports.has = has; - function findNode(node, prefix) { - let h = prefix.slice(0, 1); - let t = prefix.slice(1); - let n = node; - while (h.length && n && n.c) { - n = n.c.get(h); - h = t.slice(0, 1); - t = t.slice(1); + var elem = fs9[gracefulQueue].shift(); + var fn = elem[0]; + var args = elem[1]; + var err = elem[2]; + var startTime = elem[3]; + var lastTime = elem[4]; + if (startTime === void 0) { + debug("RETRY", fn.name, args); + fn.apply(null, args); + } else if (Date.now() - startTime >= 6e4) { + debug("TIMEOUT", fn.name, args); + var cb = args.pop(); + if (typeof cb === "function") + cb.call(null, err); + } else { + var sinceAttempt = Date.now() - lastTime; + var sinceStart = Math.max(lastTime - startTime, 1); + var desiredDelay = Math.min(sinceStart * 1.2, 100); + if (sinceAttempt >= desiredDelay) { + debug("RETRY", fn.name, args); + fn.apply(null, args.concat([startTime])); + } else { + fs9[gracefulQueue].push(elem); + } } - return n; - } - exports.findNode = findNode; - function countNodes(root) { - const seen = /* @__PURE__ */ new Set(); - function walk2(n) { - if (seen.has(n)) - return; - seen.add(n); - if (n.c) { - [...n.c.values()].forEach((n2) => walk2(n2)); - } - } - walk2(root); - return seen.size; - } - exports.countNodes = countNodes; - function countWords(root) { - const visited = /* @__PURE__ */ new Map(); - function walk2(n) { - if (visited.has(n)) { - return visited.get(n); - } - let cnt = n.f ? 1 : 0; - visited.set(n, cnt); - if (!n.c) { - return cnt; - } - for (const c of n.c.values()) { - cnt += walk2(c); - } - visited.set(n, cnt); - return cnt; - } - return walk2(root); - } - exports.countWords = countWords; - function isCircular(root) { - const seen = /* @__PURE__ */ new Set(); - const inStack = /* @__PURE__ */ new Set(); - function walk2(n) { - if (seen.has(n)) - return { isCircular: false, allSeen: true }; - if (inStack.has(n)) - return { isCircular: true, allSeen: false }; - inStack.add(n); - let r = { isCircular: false, allSeen: true }; - if (n.c) { - r = [...n.c.values()].reduce((acc, n2) => { - if (acc.isCircular) - return acc; - const r2 = walk2(n2); - r2.allSeen = r2.allSeen && acc.allSeen; - return r2; - }, r); - } - if (r.allSeen) { - seen.add(n); - } - inStack.delete(n); - return r; + if (retryTimer === void 0) { + retryTimer = setTimeout(retry, 0); } - return walk2(root).isCircular; } - exports.isCircular = isCircular; - function trieNodeToRoot(node, options) { - const newOptions = (0, mergeOptionalWithDefaults_js_1.mergeOptionalWithDefaults)(options); - return { - ...newOptions, - c: node.c || /* @__PURE__ */ new Map() - }; - } - exports.trieNodeToRoot = trieNodeToRoot; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/consolidate.js -var require_consolidate = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/consolidate.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.consolidate = void 0; - var trie_util_js_1 = require_trie_util(); - var TrieNode_js_1 = require_TrieNode(); - function consolidate(root) { - let count = 0; - const signatures = /* @__PURE__ */ new Map(); - const cached = /* @__PURE__ */ new Map(); - const knownMap = /* @__PURE__ */ new Map(); - function signature(n) { - const isWord = n.f ? "*" : ""; - const ref = n.c ? JSON.stringify([...n.c.entries()].map(([k, n2]) => [k, cached.get(n2)])) : ""; - return isWord + ref; - } - function findEow(n) { - if (n.f && !n.c) - return n; - let r; - if (n.c) { - for (const c of n.c.values()) { - r = findEow(c); - if (r) - break; - } +// node_modules/imurmurhash/imurmurhash.js +var require_imurmurhash = __commonJS({ + "node_modules/imurmurhash/imurmurhash.js"(exports, module2) { + (function() { + var cache2; + function MurmurHash3(key, seed) { + var m = this instanceof MurmurHash3 ? this : cache2; + m.reset(seed); + if (typeof key === "string" && key.length > 0) { + m.hash(key); } - return r; - } - function compareMaps(a, b) { - for (const e of a) { - if (b.get(e[0]) !== e[1]) - return false; + if (m !== this) { + return m; } - return a.length === b.size; } - function deepCopy(n) { - const k = knownMap.get(n); - if (k) { - return k; + ; + MurmurHash3.prototype.hash = function(key) { + var h1, k1, i, top, len; + len = key.length; + this.len += len; + k1 = this.k1; + i = 0; + switch (this.rem) { + case 0: + k1 ^= len > i ? key.charCodeAt(i++) & 65535 : 0; + case 1: + k1 ^= len > i ? (key.charCodeAt(i++) & 65535) << 8 : 0; + case 2: + k1 ^= len > i ? (key.charCodeAt(i++) & 65535) << 16 : 0; + case 3: + k1 ^= len > i ? (key.charCodeAt(i) & 255) << 24 : 0; + k1 ^= len > i ? (key.charCodeAt(i++) & 65280) >> 8 : 0; } - const orig = n; - if (n.c) { - const children = [...n.c].map((c) => [c[0], deepCopy(c[1])]); - if (!compareMaps(children, n.c)) { - n = { f: n.f, c: new Map(children) }; + this.rem = len + this.rem & 3; + len -= this.rem; + if (len > 0) { + h1 = this.h1; + while (1) { + k1 = k1 * 11601 + (k1 & 65535) * 3432906752 & 4294967295; + k1 = k1 << 15 | k1 >>> 17; + k1 = k1 * 13715 + (k1 & 65535) * 461832192 & 4294967295; + h1 ^= k1; + h1 = h1 << 13 | h1 >>> 19; + h1 = h1 * 5 + 3864292196 & 4294967295; + if (i >= len) { + break; + } + k1 = key.charCodeAt(i++) & 65535 ^ (key.charCodeAt(i++) & 65535) << 8 ^ (key.charCodeAt(i++) & 65535) << 16; + top = key.charCodeAt(i++); + k1 ^= (top & 255) << 24 ^ (top & 65280) >> 8; } + k1 = 0; + switch (this.rem) { + case 3: + k1 ^= (key.charCodeAt(i + 2) & 65535) << 16; + case 2: + k1 ^= (key.charCodeAt(i + 1) & 65535) << 8; + case 1: + k1 ^= key.charCodeAt(i) & 65535; + } + this.h1 = h1; } - const sig = signature(n); - const ref = signatures.get(sig); - if (ref) { - knownMap.set(orig, ref); - return ref; - } - Object.freeze(n); - signatures.set(sig, n); - cached.set(n, count++); - knownMap.set(orig, n); - return n; - } - function process4(n) { - if (cached.has(n)) { - return n; - } - if (Object.isFrozen(n)) { - return knownMap.get(n) || deepCopy(n); - } - if (n.c) { - const children = [...n.c].sort((a, b) => a[0] < b[0] ? -1 : 1).map((c) => [c[0], process4(c[1])]); - n.c = new Map(children); - } - const sig = signature(n); - const ref = signatures.get(sig); - if (ref) { - return ref; - } - signatures.set(sig, n); - cached.set(n, count++); - return n; - } - const eow = findEow(root) || { f: TrieNode_js_1.FLAG_WORD, c: void 0 }; - signatures.set(signature(eow), eow); - cached.set(eow, count++); - return (0, trie_util_js_1.trieNodeToRoot)(process4(root), root); - } - exports.consolidate = consolidate; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/PairingHeap.js -var require_PairingHeap = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/PairingHeap.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.heapMethods = exports.PairingHeap = void 0; - var PairingHeap = class { - constructor(compare2) { - this.compare = compare2; - this._size = 0; - } - add(v) { - this._heap = insert(this.compare, this._heap, v); - ++this._size; + this.k1 = k1; return this; - } - dequeue() { - const n = this.next(); - if (n.done) - return void 0; - return n.value; - } - concat(i) { - for (const v of i) { - this.add(v); + }; + MurmurHash3.prototype.result = function() { + var k1, h1; + k1 = this.k1; + h1 = this.h1; + if (k1 > 0) { + k1 = k1 * 11601 + (k1 & 65535) * 3432906752 & 4294967295; + k1 = k1 << 15 | k1 >>> 17; + k1 = k1 * 13715 + (k1 & 65535) * 461832192 & 4294967295; + h1 ^= k1; } + h1 ^= this.len; + h1 ^= h1 >>> 16; + h1 = h1 * 51819 + (h1 & 65535) * 2246770688 & 4294967295; + h1 ^= h1 >>> 13; + h1 = h1 * 44597 + (h1 & 65535) * 3266445312 & 4294967295; + h1 ^= h1 >>> 16; + return h1 >>> 0; + }; + MurmurHash3.prototype.reset = function(seed) { + this.h1 = typeof seed === "number" ? seed : 0; + this.rem = this.k1 = this.len = 0; return this; - } - next() { - if (!this._heap) { - return { value: void 0, done: true }; - } - const value = this._heap.v; - --this._size; - this._heap = removeHead(this.compare, this._heap); - return { value }; - } - peek() { - return this._heap?.v; - } - [Symbol.iterator]() { - return this; - } - get length() { - return this._size; - } - }; - exports.PairingHeap = PairingHeap; - function removeHead(compare2, heap) { - if (!heap || !heap.c) - return void 0; - return mergeSiblings(compare2, heap.c); - } - function insert(compare2, heap, v) { - const n = { - v, - s: void 0, - c: void 0 }; - if (!heap || compare2(v, heap.v) <= 0) { - n.c = heap; - return n; + cache2 = new MurmurHash3(); + if (typeof module2 != "undefined") { + module2.exports = MurmurHash3; + } else { + this.MurmurHash3 = MurmurHash3; } - n.s = heap.c; - heap.c = n; - return heap; + })(); + } +}); + +// node_modules/signal-exit/signals.js +var require_signals = __commonJS({ + "node_modules/signal-exit/signals.js"(exports, module2) { + module2.exports = [ + "SIGABRT", + "SIGALRM", + "SIGHUP", + "SIGINT", + "SIGTERM" + ]; + if (process.platform !== "win32") { + module2.exports.push( + "SIGVTALRM", + "SIGXCPU", + "SIGXFSZ", + "SIGUSR2", + "SIGTRAP", + "SIGSYS", + "SIGQUIT", + "SIGIOT" + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ); } - function merge(compare2, a, b) { - if (compare2(a.v, b.v) <= 0) { - a.s = void 0; - b.s = a.c; - a.c = b; - return a; - } - b.s = void 0; - a.s = b.c; - b.c = a; - return b; + if (process.platform === "linux") { + module2.exports.push( + "SIGIO", + "SIGPOLL", + "SIGPWR", + "SIGSTKFLT", + "SIGUNUSED" + ); } - function mergeSiblings(compare2, n) { - if (!n.s) - return n; - const s = n.s; - const ss = s.s; - const m = merge(compare2, n, s); - return ss ? merge(compare2, m, mergeSiblings(compare2, ss)) : m; - } - exports.heapMethods = { - insert, - merge, - mergeSiblings - }; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/distance/distanceAStarWeighted.js -var require_distanceAStarWeighted = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/distance/distanceAStarWeighted.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; +// node_modules/signal-exit/index.js +var require_signal_exit = __commonJS({ + "node_modules/signal-exit/index.js"(exports, module2) { + var process6 = global.process; + var processOk = function(process7) { + return process7 && typeof process7 === "object" && typeof process7.removeListener === "function" && typeof process7.emit === "function" && typeof process7.reallyExit === "function" && typeof process7.listeners === "function" && typeof process7.kill === "function" && typeof process7.pid === "number" && typeof process7.on === "function"; }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.distanceAStarWeightedEx = exports.distanceAStarWeighted = void 0; - var assert_1 = __importDefault(require("assert")); - var PairingHeap_js_1 = require_PairingHeap(); - function distanceAStarWeighted(wordA, wordB, map, cost = 100) { - const best = _distanceAStarWeightedEx(wordA, wordB, map, cost); - const penalty = map.calcAdjustment(wordB); - return best.c + best.p + penalty; - } - exports.distanceAStarWeighted = distanceAStarWeighted; - function distanceAStarWeightedEx(wordA, wordB, map, cost = 100) { - const best = _distanceAStarWeightedEx(wordA, wordB, map, cost); - const aa = "^" + wordA + "$"; - const bb = "^" + wordB + "$"; - const penalty = map.calcAdjustment(wordB); - const result = { - a: aa, - b: bb, - cost: best.c + best.p + penalty, - penalty, - segments: [] + if (!processOk(process6)) { + module2.exports = function() { + return function() { + }; }; - const segments = result.segments; - for (let n = best; n.f; n = n.f) { - const f = n.f; - const a = aa.slice(f.ai, n.ai); - const b = bb.slice(f.bi, n.bi); - const c = n.c - f.c; - const p = n.p - f.p; - segments.push({ a, b, c, p }); - } - segments.reverse(); - return result; - } - exports.distanceAStarWeightedEx = distanceAStarWeightedEx; - function _distanceAStarWeightedEx(wordA, wordB, map, cost = 100) { - const a = "^" + wordA + "$"; - const b = "^" + wordB + "$"; - const aN = a.length; - const bN = b.length; - const candidates = new CandidatePool(aN, bN); - candidates.add({ ai: 0, bi: 0, c: 0, p: 0, f: void 0 }); - function opSub(n) { - const { ai, bi, c, p } = n; - if (ai < aN && bi < bN) { - const cc = a[ai] === b[bi] ? c : c + cost; - candidates.add({ ai: ai + 1, bi: bi + 1, c: cc, p, f: n }); - } - } - function opIns(n) { - const { ai, bi, c, p } = n; - if (bi < bN) { - candidates.add({ ai, bi: bi + 1, c: c + cost, p, f: n }); - } - } - function opDel(n) { - const { ai, bi, c, p } = n; - if (ai < aN) { - candidates.add({ ai: ai + 1, bi, c: c + cost, p, f: n }); - } - } - function opSwap(n) { - const { ai, bi, c, p } = n; - if (a[ai] === b[bi + 1] && a[ai + 1] === b[bi]) { - candidates.add({ ai: ai + 2, bi: bi + 2, c: c + cost, p, f: n }); - } - } - function opMap2(n) { - const { ai, bi, c, p } = n; - const pos = { a, b, ai, bi, c, p }; - const costCalculations = [map.calcInsDelCosts(pos), map.calcSwapCosts(pos), map.calcReplaceCosts(pos)]; - costCalculations.forEach((iter) => { - for (const nn of iter) { - candidates.add({ ...nn, f: n }); - } - }); + } else { + assert20 = require("assert"); + signals = require_signals(); + isWin = /^win/i.test(process6.platform); + EE = require("events"); + if (typeof EE !== "function") { + EE = EE.EventEmitter; } - let best; - while (best = candidates.next()) { - if (best.ai === aN && best.bi === bN) - break; - opSwap(best); - opIns(best); - opDel(best); - opMap2(best); - opSub(best); - } - (0, assert_1.default)(best); - return best; - } - var CandidatePool = class { - constructor(aN, bN) { - this.aN = aN; - this.bN = bN; - this.pool = new PairingHeap_js_1.PairingHeap(compare2); - this.grid = []; + if (process6.__signal_exit_emitter__) { + emitter = process6.__signal_exit_emitter__; + } else { + emitter = process6.__signal_exit_emitter__ = new EE(); + emitter.count = 0; + emitter.emitted = {}; } - next() { - let n; - while (n = this.pool.dequeue()) { - if (!n.d) - return n; - } - return void 0; + if (!emitter.infinite) { + emitter.setMaxListeners(Infinity); + emitter.infinite = true; } - add(n) { - const i = idx(n.ai, n.bi, this.bN); - const g = this.grid[i]; - if (!g) { - this.grid[i] = n; - this.pool.add(n); + module2.exports = function(cb, opts) { + if (!processOk(global.process)) { + return function() { + }; + } + assert20.equal(typeof cb, "function", "a callback must be provided for exit handler"); + if (loaded === false) { + load2(); + } + var ev = "exit"; + if (opts && opts.alwaysLast) { + ev = "afterexit"; + } + var remove = function() { + emitter.removeListener(ev, cb); + if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) { + unload(); + } + }; + emitter.on(ev, cb); + return remove; + }; + unload = function unload2() { + if (!loaded || !processOk(global.process)) { + return; + } + loaded = false; + signals.forEach(function(sig) { + try { + process6.removeListener(sig, sigListeners[sig]); + } catch (er) { + } + }); + process6.emit = originalProcessEmit; + process6.reallyExit = originalProcessReallyExit; + emitter.count -= 1; + }; + module2.exports.unload = unload; + emit = function emit2(event, code, signal) { + if (emitter.emitted[event]) { return; } - if (g.c <= n.c) + emitter.emitted[event] = true; + emitter.emit(event, code, signal); + }; + sigListeners = {}; + signals.forEach(function(sig) { + sigListeners[sig] = function listener() { + if (!processOk(global.process)) { + return; + } + var listeners = process6.listeners(sig); + if (listeners.length === emitter.count) { + unload(); + emit("exit", null, sig); + emit("afterexit", null, sig); + if (isWin && sig === "SIGHUP") { + sig = "SIGINT"; + } + process6.kill(process6.pid, sig); + } + }; + }); + module2.exports.signals = function() { + return signals; + }; + loaded = false; + load2 = function load3() { + if (loaded || !processOk(global.process)) { return; - g.d = true; - this.grid[i] = n; - this.pool.add(n); - } - }; - function idx(r, c, cols) { - return r * cols + c; - } - function compare2(a, b) { - return a.c - b.c || b.ai + b.bi - a.ai - a.bi; + } + loaded = true; + emitter.count += 1; + signals = signals.filter(function(sig) { + try { + process6.on(sig, sigListeners[sig]); + return true; + } catch (er) { + return false; + } + }); + process6.emit = processEmit; + process6.reallyExit = processReallyExit; + }; + module2.exports.load = load2; + originalProcessReallyExit = process6.reallyExit; + processReallyExit = function processReallyExit2(code) { + if (!processOk(global.process)) { + return; + } + process6.exitCode = code || /* istanbul ignore next */ + 0; + emit("exit", process6.exitCode, null); + emit("afterexit", process6.exitCode, null); + originalProcessReallyExit.call(process6, process6.exitCode); + }; + originalProcessEmit = process6.emit; + processEmit = function processEmit2(ev, arg) { + if (ev === "exit" && processOk(global.process)) { + if (arg !== void 0) { + process6.exitCode = arg; + } + var ret = originalProcessEmit.apply(this, arguments); + emit("exit", process6.exitCode, null); + emit("afterexit", process6.exitCode, null); + return ret; + } else { + return originalProcessEmit.apply(this, arguments); + } + }; } + var assert20; + var signals; + var isWin; + var EE; + var emitter; + var unload; + var emit; + var sigListeners; + var loaded; + var load2; + var originalProcessReallyExit; + var processReallyExit; + var originalProcessEmit; + var processEmit; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/distance/levenshtein.js -var require_levenshtein = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/distance/levenshtein.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.levenshteinDistance = void 0; - function levenshteinDistance(a, b) { - const aa = " " + a; - const bb = " " + b; - const nA = a.length + 1; - const nB = b.length + 1; - const firstRow = []; - for (let i = 0; i <= nA; ++i) { - firstRow[i] = i; - } - const matrix = [firstRow, [1].concat(firstRow), [2, 1].concat(firstRow)]; - let ppRow = matrix[0]; - let pRow = matrix[1]; - for (let j = 2; j <= nB; ++j) { - const row = matrix[j % 3]; - row[0] = pRow[0] + 1; - row[1] = pRow[1] + 1; - const bp = bb[j - 1]; - const bc = bb[j]; - let ap = aa[0]; - for (let i = 2, i1 = 1; i <= nA; i1 = i, ++i) { - const ac = aa[i]; - const c = pRow[i1] + (ac == bc ? 0 : 1); - const ct = ac == bp && ap == bc ? ppRow[i1 - 1] + 1 : c; - row[i] = Math.min( - c, - // substitute - ct, - // transpose - pRow[i] + 1, - // insert - row[i1] + 1 - // delete - ); - ap = ac; - } - ppRow = pRow; - pRow = row; - } - return pRow[nA]; +// node_modules/is-typedarray/index.js +var require_is_typedarray = __commonJS({ + "node_modules/is-typedarray/index.js"(exports, module2) { + module2.exports = isTypedArray; + isTypedArray.strict = isStrictTypedArray; + isTypedArray.loose = isLooseTypedArray; + var toString = Object.prototype.toString; + var names = { + "[object Int8Array]": true, + "[object Int16Array]": true, + "[object Int32Array]": true, + "[object Uint8Array]": true, + "[object Uint8ClampedArray]": true, + "[object Uint16Array]": true, + "[object Uint32Array]": true, + "[object Float32Array]": true, + "[object Float64Array]": true + }; + function isTypedArray(arr) { + return isStrictTypedArray(arr) || isLooseTypedArray(arr); + } + function isStrictTypedArray(arr) { + return arr instanceof Int8Array || arr instanceof Int16Array || arr instanceof Int32Array || arr instanceof Uint8Array || arr instanceof Uint8ClampedArray || arr instanceof Uint16Array || arr instanceof Uint32Array || arr instanceof Float32Array || arr instanceof Float64Array; + } + function isLooseTypedArray(arr) { + return names[toString.call(arr)]; } - exports.levenshteinDistance = levenshteinDistance; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/suggestions/constants.js -var require_constants5 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/suggestions/constants.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DEFAULT_COMPOUNDED_WORD_SEPARATOR = void 0; - exports.DEFAULT_COMPOUNDED_WORD_SEPARATOR = "\u2219"; +// node_modules/typedarray-to-buffer/index.js +var require_typedarray_to_buffer = __commonJS({ + "node_modules/typedarray-to-buffer/index.js"(exports, module2) { + var isTypedArray = require_is_typedarray().strict; + module2.exports = function typedarrayToBuffer(arr) { + if (isTypedArray(arr)) { + var buf = Buffer.from(arr.buffer); + if (arr.byteLength !== arr.buffer.byteLength) { + buf = buf.slice(arr.byteOffset, arr.byteOffset + arr.byteLength); + } + return buf; + } else { + return Buffer.from(arr); + } + }; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/distance/weightedMaps.js -var require_weightedMaps = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/distance/weightedMaps.js"(exports) { +// node_modules/write-file-atomic/index.js +var require_write_file_atomic = __commonJS({ + "node_modules/write-file-atomic/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.lookupReplaceCost = exports.prettyPrintWeightMap = exports.prettyPrintSwap = exports.prettyPrintReplace = exports.splitMapSubstrings = exports.splitMapSubstringsIterable = exports.addDefsToWeightMap = exports.addAdjustment = exports.addDefToWeightMap = exports.createWeightMap = void 0; - var constants_js_1 = require_constants5(); - var matchPossibleWordSeparators = /[+∙•・●]/g; - function createWeightMap(...defs) { - const map = _createWeightMap(); - addDefsToWeightMap(map, defs); - return map; - } - exports.createWeightMap = createWeightMap; - function addDefToWeightMap(map, ...defs) { - return addDefsToWeightMap(map, defs); - } - exports.addDefToWeightMap = addDefToWeightMap; - function addAdjustment(map, ...adjustments) { - for (const adj of adjustments) { - map.adjustments.set(adj.id, adj); - } - return map; - } - exports.addAdjustment = addAdjustment; - function addDefsToWeightMap(map, defs) { - function addSet(set, def) { - addSetToTrieCost(map.insDel, set, def.insDel, def.penalty); - addSetToTrieTrieCost(map.replace, set, def.replace, def.penalty); - addSetToTrieTrieCost(map.swap, set, def.swap, def.penalty); - } - for (const _def of defs) { - const def = normalizeDef(_def); - const mapSets = splitMap(def); - mapSets.forEach((s) => addSet(s, def)); - } - return map; - } - exports.addDefsToWeightMap = addDefsToWeightMap; - function _createWeightMap() { - return new _WeightedMap(); - } - function lowest(a, b) { - if (a === void 0) - return b; - if (b === void 0) - return a; - return a <= b ? a : b; - } - function highest(a, b) { - if (a === void 0) - return b; - if (b === void 0) - return a; - return a >= b ? a : b; - } - function normalize(s) { - const f = /* @__PURE__ */ new Set([s]); - f.add(s.normalize("NFC")); - f.add(s.normalize("NFD")); - return f; - } - function* splitMapSubstringsIterable(map) { - let seq = ""; - let mode = 0; - for (const char of map) { - if (mode && char === ")") { - yield* normalize(seq); - mode = 0; - continue; - } - if (mode) { - seq += char; - continue; - } - if (char === "(") { - mode = 1; - seq = ""; - continue; - } - yield* normalize(char); + module2.exports = writeFile; + module2.exports.sync = writeFileSync; + module2.exports._getTmpname = getTmpname; + module2.exports._cleanupOnExit = cleanupOnExit; + var fs9 = require("fs"); + var MurmurHash3 = require_imurmurhash(); + var onExit = require_signal_exit(); + var path26 = require("path"); + var isTypedArray = require_is_typedarray(); + var typedArrayToBuffer = require_typedarray_to_buffer(); + var { promisify: promisify4 } = require("util"); + var activeFiles = {}; + var threadId = function getId() { + try { + const workerThreads = require("worker_threads"); + return workerThreads.threadId; + } catch (e) { + return 0; } + }(); + var invocations = 0; + function getTmpname(filename) { + return filename + "." + MurmurHash3(__filename).hash(String(process.pid)).hash(String(threadId)).hash(String(++invocations)).result(); } - exports.splitMapSubstringsIterable = splitMapSubstringsIterable; - function splitMapSubstrings(map) { - return [...splitMapSubstringsIterable(map)]; + function cleanupOnExit(tmpfile) { + return () => { + try { + fs9.unlinkSync(typeof tmpfile === "function" ? tmpfile() : tmpfile); + } catch (_) { + } + }; } - exports.splitMapSubstrings = splitMapSubstrings; - function splitMap(def) { - const { map } = def; - const sets = map.split("|"); - return sets.map(splitMapSubstrings).filter((s) => s.length > 0); + function serializeActiveFile(absoluteName) { + return new Promise((resolve13) => { + if (!activeFiles[absoluteName]) + activeFiles[absoluteName] = []; + activeFiles[absoluteName].push(resolve13); + if (activeFiles[absoluteName].length === 1) + resolve13(); + }); } - function addToTrieCost(trie, str, cost, penalties) { - if (!str) - return; - let t = trie; - for (const c of str) { - const n = t.n = t.n || /* @__PURE__ */ Object.create(null); - t = n[c] = n[c] || /* @__PURE__ */ Object.create(null); + function isChownErrOk(err) { + if (err.code === "ENOSYS") { + return true; } - t.c = lowest(t.c, cost); - t.p = highest(t.p, penalties); - } - function addToTrieTrieCost(trie, left, right, cost, penalties) { - let t = trie; - for (const c of left) { - const n = t.n = t.n || /* @__PURE__ */ Object.create(null); - t = n[c] = n[c] || /* @__PURE__ */ Object.create(null); + const nonroot = !process.getuid || process.getuid() !== 0; + if (nonroot) { + if (err.code === "EINVAL" || err.code === "EPERM") { + return true; + } } - const trieCost = t.t = t.t || /* @__PURE__ */ Object.create(null); - addToTrieCost(trieCost, right, cost, penalties); + return false; } - function addSetToTrieCost(trie, set, cost, penalties) { - if (cost === void 0) - return; - for (const str of set) { - addToTrieCost(trie, str, cost, penalties); + async function writeFileAsync(filename, data, options = {}) { + if (typeof options === "string") { + options = { encoding: options }; } - } - function addSetToTrieTrieCost(trie, set, cost, penalties) { - if (cost === void 0) - return; - for (const left of set) { - for (const right of set) { - if (left === right) - continue; - addToTrieTrieCost(trie, left, right, cost, penalties); + let fd; + let tmpfile; + const removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile)); + const absoluteName = path26.resolve(filename); + try { + await serializeActiveFile(absoluteName); + const truename = await promisify4(fs9.realpath)(filename).catch(() => filename); + tmpfile = getTmpname(truename); + if (!options.mode || !options.chown) { + const stats = await promisify4(fs9.stat)(truename).catch(() => { + }); + if (stats) { + if (options.mode == null) { + options.mode = stats.mode; + } + if (options.chown == null && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid }; + } + } + } + fd = await promisify4(fs9.open)(tmpfile, "w", options.mode); + if (options.tmpfileCreated) { + await options.tmpfileCreated(tmpfile); + } + if (isTypedArray(data)) { + data = typedArrayToBuffer(data); + } + if (Buffer.isBuffer(data)) { + await promisify4(fs9.write)(fd, data, 0, data.length, 0); + } else if (data != null) { + await promisify4(fs9.write)(fd, String(data), 0, String(options.encoding || "utf8")); + } + if (options.fsync !== false) { + await promisify4(fs9.fsync)(fd); + } + await promisify4(fs9.close)(fd); + fd = null; + if (options.chown) { + await promisify4(fs9.chown)(tmpfile, options.chown.uid, options.chown.gid).catch((err) => { + if (!isChownErrOk(err)) { + throw err; + } + }); + } + if (options.mode) { + await promisify4(fs9.chmod)(tmpfile, options.mode).catch((err) => { + if (!isChownErrOk(err)) { + throw err; + } + }); + } + await promisify4(fs9.rename)(tmpfile, truename); + } finally { + if (fd) { + await promisify4(fs9.close)(fd).catch( + /* istanbul ignore next */ + () => { + } + ); } + removeOnExitHandler(); + await promisify4(fs9.unlink)(tmpfile).catch(() => { + }); + activeFiles[absoluteName].shift(); + if (activeFiles[absoluteName].length > 0) { + activeFiles[absoluteName][0](); + } else + delete activeFiles[absoluteName]; } } - function* searchTrieNodes(trie, str, i) { - const len = str.length; - for (let n = trie.n; i < len && n; ) { - const t = n[str[i]]; - if (!t) - return; - ++i; - yield { i, t }; - n = t.n; + function writeFile(filename, data, options, callback) { + if (options instanceof Function) { + callback = options; + options = {}; } - } - function* walkTrieNodes(t, s) { - if (!t) - return; - yield { s, t }; - if (!t.n) - return; - for (const [k, v] of Object.entries(t.n)) { - yield* walkTrieNodes(v, s + k); + const promise = writeFileAsync(filename, data, options); + if (callback) { + promise.then(callback, callback); } + return promise; } - function* walkTrieCost(trie) { - for (const { s, t } of walkTrieNodes(trie, "")) { - if (t.c) { - yield { s, c: t.c, p: t.p }; - } + function writeFileSync(filename, data, options) { + if (typeof options === "string") + options = { encoding: options }; + else if (!options) + options = {}; + try { + filename = fs9.realpathSync(filename); + } catch (ex) { } - } - function* walkTrieTrieCost(trie) { - for (const { s: a, t } of walkTrieNodes(trie, "")) { - if (t.t) { - for (const { s: b, c, p } of walkTrieCost(t.t)) { - yield { a, b, c, p }; + const tmpfile = getTmpname(filename); + if (!options.mode || !options.chown) { + try { + const stats = fs9.statSync(filename); + options = Object.assign({}, options); + if (!options.mode) { + options.mode = stats.mode; } + if (!options.chown && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid }; + } + } catch (ex) { } } - } - function* findTrieCostPrefixes(trie, str, i) { - for (const n of searchTrieNodes(trie, str, i)) { - const { c, p } = n.t; - if (c !== void 0) { - yield { i: n.i, c, p: p || 0 }; - } - } - } - function* findTrieTrieCostPrefixes(trie, str, i) { - for (const n of searchTrieNodes(trie, str, i)) { - const t = n.t.t; - if (t !== void 0) { - yield { i: n.i, t }; + let fd; + const cleanup = cleanupOnExit(tmpfile); + const removeOnExitHandler = onExit(cleanup); + let threw = true; + try { + fd = fs9.openSync(tmpfile, "w", options.mode || 438); + if (options.tmpfileCreated) { + options.tmpfileCreated(tmpfile); } - } - } - var _WeightedMap = class { - constructor() { - this.insDel = {}; - this.replace = {}; - this.swap = {}; - this.adjustments = /* @__PURE__ */ new Map(); - } - *calcInsDelCosts(pos) { - const { a, ai, b, bi, c, p } = pos; - for (const del of findTrieCostPrefixes(this.insDel, a, ai)) { - yield { a, b, ai: del.i, bi, c: c + del.c, p: p + del.p }; + if (isTypedArray(data)) { + data = typedArrayToBuffer(data); } - for (const ins of findTrieCostPrefixes(this.insDel, b, bi)) { - yield { a, b, ai, bi: ins.i, c: c + ins.c, p: p + ins.p }; + if (Buffer.isBuffer(data)) { + fs9.writeSync(fd, data, 0, data.length, 0); + } else if (data != null) { + fs9.writeSync(fd, String(data), 0, String(options.encoding || "utf8")); } - } - *calcReplaceCosts(pos) { - const { a, ai, b, bi, c, p } = pos; - for (const del of findTrieTrieCostPrefixes(this.replace, a, ai)) { - for (const ins of findTrieCostPrefixes(del.t, b, bi)) { - yield { a, b, ai: del.i, bi: ins.i, c: c + ins.c, p: p + ins.p }; - } + if (options.fsync !== false) { + fs9.fsyncSync(fd); } - } - *calcSwapCosts(pos) { - const { a, ai, b, bi, c, p } = pos; - const swap = this.swap; - for (const left of findTrieTrieCostPrefixes(swap, a, ai)) { - for (const right of findTrieCostPrefixes(left.t, a, left.i)) { - const sw = a.slice(left.i, right.i) + a.slice(ai, left.i); - if (b.slice(bi).startsWith(sw)) { - const len = sw.length; - yield { a, b, ai: ai + len, bi: bi + len, c: c + right.c, p: p + right.p }; + fs9.closeSync(fd); + fd = null; + if (options.chown) { + try { + fs9.chownSync(tmpfile, options.chown.uid, options.chown.gid); + } catch (err) { + if (!isChownErrOk(err)) { + throw err; } } } - } - calcAdjustment(word) { - let penalty = 0; - for (const adj of this.adjustments.values()) { - if (adj.regexp.global) { - for (const _m of word.matchAll(adj.regexp)) { - penalty += adj.penalty; + if (options.mode) { + try { + fs9.chmodSync(tmpfile, options.mode); + } catch (err) { + if (!isChownErrOk(err)) { + throw err; } - } else if (adj.regexp.test(word)) { - penalty += adj.penalty; } } - return penalty; - } - }; - function prettyPrintInsDel(trie, pfx = "", indent = " ") { - function* walk() { - for (const { s, c, p } of walkTrieCost(trie)) { - const pm = p ? ` + ${p}` : ""; - yield indent + `(${s}) = ${c}${pm}`; - } - } - return ["InsDel:", ...[...walk()].sort()].map((line) => pfx + line + "\n").join(""); - } - function prettyPrintReplace(trie, pfx = "", indent = " ") { - function* walk() { - for (const { a, b, c, p } of walkTrieTrieCost(trie)) { - const pm = p ? ` + ${p}` : ""; - yield indent + `(${a}) -> (${b}) = ${c}${pm}`; + fs9.renameSync(tmpfile, filename); + threw = false; + } finally { + if (fd) { + try { + fs9.closeSync(fd); + } catch (ex) { + } } - } - return ["Replace:", ...[...walk()].sort()].map((line) => pfx + line + "\n").join(""); - } - exports.prettyPrintReplace = prettyPrintReplace; - function prettyPrintSwap(trie, pfx = "", indent = " ") { - function* walk() { - for (const { a, b, c, p } of walkTrieTrieCost(trie)) { - const pm = p ? ` + ${p}` : ""; - yield indent + `(${a}) <-> (${b}) = ${c}${pm}`; + removeOnExitHandler(); + if (threw) { + cleanup(); } } - return ["Swap:", ...[...walk()].sort()].map((line) => pfx + line + "\n").join(""); - } - exports.prettyPrintSwap = prettyPrintSwap; - function prettyPrintWeightMap(map) { - return [prettyPrintInsDel(map.insDel), prettyPrintReplace(map.replace), prettyPrintSwap(map.swap)].join("\n"); - } - exports.prettyPrintWeightMap = prettyPrintWeightMap; - function lookupReplaceCost(map, a, b) { - const trie = map.replace; - let tt = trie; - for (let ai = 0; ai < a.length && tt; ++ai) { - tt = tt.n?.[a[ai]]; - } - if (!tt) - return void 0; - let t = tt.t; - for (let bi = 0; bi < b.length && t; ++bi) { - t = t.n?.[b[bi]]; - } - return t?.c; - } - exports.lookupReplaceCost = lookupReplaceCost; - function normalizeDef(def) { - const { map, ...rest } = def; - return { ...rest, map: normalizeMap(map) }; - } - function normalizeMap(map) { - return map.replace(matchPossibleWordSeparators, constants_js_1.DEFAULT_COMPOUNDED_WORD_SEPARATOR); - } - exports.__testing__ = { - findTrieCostPrefixes, - findTrieTrieCostPrefixes, - normalizeDef, - splitMap, - splitMapSubstrings - }; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/distance/distance.js -var require_distance = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/distance/distance.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.updatedWeightedMap = exports.createWeightedMap = exports.editDistanceWeighted = exports.editDistance = void 0; - var distanceAStarWeighted_js_1 = require_distanceAStarWeighted(); - var levenshtein_js_1 = require_levenshtein(); - var weightedMaps_js_1 = require_weightedMaps(); - var defaultCost = 100; - function editDistance(wordA, wordB, editCost = defaultCost) { - return (0, levenshtein_js_1.levenshteinDistance)(wordA, wordB) * editCost; - } - exports.editDistance = editDistance; - function editDistanceWeighted(wordA, wordB, weights, editCost = defaultCost) { - return (0, distanceAStarWeighted_js_1.distanceAStarWeighted)(wordA, wordB, weights, editCost); - } - exports.editDistanceWeighted = editDistanceWeighted; - function createWeightedMap(defs) { - return (0, weightedMaps_js_1.createWeightMap)(...defs); } - exports.createWeightedMap = createWeightedMap; - function updatedWeightedMap(weightedMap, def) { - (0, weightedMaps_js_1.addDefToWeightMap)(weightedMap, def); - } - exports.updatedWeightedMap = updatedWeightedMap; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/distance/index.js -var require_distance2 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/distance/index.js"(exports) { +// node_modules/is-obj/index.js +var require_is_obj = __commonJS({ + "node_modules/is-obj/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.editDistanceWeighted = exports.editDistance = exports.createWeightedMap = void 0; - var distance_js_1 = require_distance(); - Object.defineProperty(exports, "createWeightedMap", { enumerable: true, get: function() { - return distance_js_1.createWeightedMap; - } }); - Object.defineProperty(exports, "editDistance", { enumerable: true, get: function() { - return distance_js_1.editDistance; - } }); - Object.defineProperty(exports, "editDistanceWeighted", { enumerable: true, get: function() { - return distance_js_1.editDistanceWeighted; - } }); + module2.exports = (value) => { + const type = typeof value; + return value !== null && (type === "object" || type === "function"); + }; } }); -// node_modules/@cspell/cspell-pipe/dist/cjs/helpers/distribute.js -var require_distribute = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/helpers/distribute.js"(exports) { +// node_modules/dot-prop/index.js +var require_dot_prop = __commonJS({ + "node_modules/dot-prop/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toDistributableIterable = exports.toDistributableIterableSync = void 0; - function toDistributableIterableSync(iterable) { - let lastValue; - let iter; - function getNext() { - if (lastValue && lastValue.done) { - return { ...lastValue }; - } - iter = iter || iterable[Symbol.iterator](); - lastValue = iter.next(); - return lastValue; - } - function* iterableFn() { - let next; - while (!(next = getNext()).done) { - yield next.value; + var isObj = require_is_obj(); + var disallowedKeys = /* @__PURE__ */ new Set([ + "__proto__", + "prototype", + "constructor" + ]); + var isValidPath = (pathSegments) => !pathSegments.some((segment) => disallowedKeys.has(segment)); + function getPathSegments(path26) { + const pathArray = path26.split("."); + const parts = []; + for (let i = 0; i < pathArray.length; i++) { + let p = pathArray[i]; + while (p[p.length - 1] === "\\" && pathArray[i + 1] !== void 0) { + p = p.slice(0, -1) + "."; + p += pathArray[++i]; } + parts.push(p); } - return { - [Symbol.iterator]: iterableFn - }; - } - exports.toDistributableIterableSync = toDistributableIterableSync; - exports.toDistributableIterable = toDistributableIterableSync; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/helpers/interleave.js -var require_interleave = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/helpers/interleave.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.interleave = void 0; - function* interleave2(a, b) { - const ai = a[Symbol.iterator](); - const bi = b[Symbol.iterator](); - for (let aNext = ai.next(); !aNext.done; aNext = ai.next()) { - yield aNext.value; - const bNext = bi.next(); - if (bNext.done) - break; - yield bNext.value; - } - for (let aNext = ai.next(); !aNext.done; aNext = ai.next()) { - yield aNext.value; - } - for (let bNext = bi.next(); !bNext.done; bNext = bi.next()) { - yield bNext.value; - } - } - exports.interleave = interleave2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/helpers/iteratorToIterable.js -var require_iteratorToIterable = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/helpers/iteratorToIterable.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.asyncIteratorToAsyncIterable = exports.iteratorToIterable = void 0; - function* iteratorToIterable2(iterator) { - let n; - while (!(n = iterator.next()).done) { - yield n.value; - } - } - exports.iteratorToIterable = iteratorToIterable2; - async function* asyncIteratorToAsyncIterable2(iterator) { - let n; - while (!(n = await iterator.next()).done) { - yield n.value; + if (!isValidPath(parts)) { + return []; } + return parts; } - exports.asyncIteratorToAsyncIterable = asyncIteratorToAsyncIterable2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/helpers/util.js -var require_util5 = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/helpers/util.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isAsyncIterable = exports.toPipeFn = void 0; - function toPipeFn2(syncFn, asyncFn) { - function _(i) { - return isAsyncIterable3(i) ? asyncFn(i) : syncFn(i); - } - return _; - } - exports.toPipeFn = toPipeFn2; - function isAsyncIterable3(i) { - return typeof i[Symbol.asyncIterator] === "function"; - } - exports.isAsyncIterable = isAsyncIterable3; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/helpers/toArray.js -var require_toArray = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/helpers/toArray.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toArrayAsync = exports.toArraySync = exports.toArray = void 0; - var util_js_1 = require_util5(); - function toArray3(i) { - return (0, util_js_1.isAsyncIterable)(i) ? toArrayAsync2(i) : toArraySync2(i); - } - exports.toArray = toArray3; - function toArraySync2(iter) { - return [...iter]; - } - exports.toArraySync = toArraySync2; - async function toArrayAsync2(iter) { - const collection = []; - for await (const i of iter) { - collection.push(i); + module2.exports = { + get(object, path26, value) { + if (!isObj(object) || typeof path26 !== "string") { + return value === void 0 ? object : value; + } + const pathArray = getPathSegments(path26); + if (pathArray.length === 0) { + return; + } + for (let i = 0; i < pathArray.length; i++) { + object = object[pathArray[i]]; + if (object === void 0 || object === null) { + if (i !== pathArray.length - 1) { + return value; + } + break; + } + } + return object === void 0 ? value : object; + }, + set(object, path26, value) { + if (!isObj(object) || typeof path26 !== "string") { + return object; + } + const root = object; + const pathArray = getPathSegments(path26); + for (let i = 0; i < pathArray.length; i++) { + const p = pathArray[i]; + if (!isObj(object[p])) { + object[p] = {}; + } + if (i === pathArray.length - 1) { + object[p] = value; + } + object = object[p]; + } + return root; + }, + delete(object, path26) { + if (!isObj(object) || typeof path26 !== "string") { + return false; + } + const pathArray = getPathSegments(path26); + for (let i = 0; i < pathArray.length; i++) { + const p = pathArray[i]; + if (i === pathArray.length - 1) { + delete object[p]; + return true; + } + object = object[p]; + if (!isObj(object)) { + return false; + } + } + }, + has(object, path26) { + if (!isObj(object) || typeof path26 !== "string") { + return false; + } + const pathArray = getPathSegments(path26); + if (pathArray.length === 0) { + return false; + } + for (let i = 0; i < pathArray.length; i++) { + if (isObj(object)) { + if (!(pathArray[i] in object)) { + return false; + } + object = object[pathArray[i]]; + } else { + return false; + } + } + return true; } - return collection; - } - exports.toArrayAsync = toArrayAsync2; + }; } }); -// node_modules/@cspell/cspell-pipe/dist/cjs/helpers/toAsyncIterable.js -var require_toAsyncIterable = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/helpers/toAsyncIterable.js"(exports) { +// node_modules/clear-module/node_modules/parent-module/index.js +var require_parent_module2 = __commonJS({ + "node_modules/clear-module/node_modules/parent-module/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toAsyncIterable = exports.mergeAsyncIterables = void 0; - async function* mergeAsyncIterables2(iter, ...rest) { - for await (const i of [iter, ...rest]) { - yield* i; + var callsites = require_callsites(); + module2.exports = (filePath) => { + const stacks = callsites(); + if (!filePath) { + return stacks[2].getFileName(); } - } - exports.mergeAsyncIterables = mergeAsyncIterables2; - exports.toAsyncIterable = mergeAsyncIterables2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/helpers/index.js -var require_helpers = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/helpers/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isAsyncIterable = exports.toAsyncIterable = exports.toArray = exports.iteratorToIterable = exports.asyncIteratorToAsyncIterable = exports.interleave = exports.toDistributableIterable = void 0; - var distribute_js_1 = require_distribute(); - Object.defineProperty(exports, "toDistributableIterable", { enumerable: true, get: function() { - return distribute_js_1.toDistributableIterable; - } }); - var interleave_js_1 = require_interleave(); - Object.defineProperty(exports, "interleave", { enumerable: true, get: function() { - return interleave_js_1.interleave; - } }); - var iteratorToIterable_js_1 = require_iteratorToIterable(); - Object.defineProperty(exports, "asyncIteratorToAsyncIterable", { enumerable: true, get: function() { - return iteratorToIterable_js_1.asyncIteratorToAsyncIterable; - } }); - Object.defineProperty(exports, "iteratorToIterable", { enumerable: true, get: function() { - return iteratorToIterable_js_1.iteratorToIterable; - } }); - var toArray_js_1 = require_toArray(); - Object.defineProperty(exports, "toArray", { enumerable: true, get: function() { - return toArray_js_1.toArray; - } }); - var toAsyncIterable_js_1 = require_toAsyncIterable(); - Object.defineProperty(exports, "toAsyncIterable", { enumerable: true, get: function() { - return toAsyncIterable_js_1.toAsyncIterable; - } }); - var util_js_1 = require_util5(); - Object.defineProperty(exports, "isAsyncIterable", { enumerable: true, get: function() { - return util_js_1.isAsyncIterable; - } }); - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/append.js -var require_append = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/append.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opAppend = exports.opAppendSync = exports.opAppendAsync = void 0; - var index_js_1 = require_helpers(); - function opAppendAsync2(...iterablesToAppend) { - async function* fn(iter) { - yield* iter; - for (const i of iterablesToAppend) { - yield* i; + let hasSeenValue = false; + stacks.shift(); + for (const stack of stacks) { + const parentFilePath = stack.getFileName(); + if (typeof parentFilePath !== "string") { + continue; } - } - return fn; - } - exports.opAppendAsync = opAppendAsync2; - function opAppendSync2(...iterablesToAppend) { - function* fn(iter) { - yield* iter; - for (const i of iterablesToAppend) { - yield* i; + if (parentFilePath === filePath) { + hasSeenValue = true; + continue; + } + if (parentFilePath === "module.js") { + continue; + } + if (hasSeenValue && parentFilePath !== filePath) { + return parentFilePath; } } - return fn; - } - exports.opAppendSync = opAppendSync2; - function opAppend2(...iterablesToAppend) { - function _(i) { - return (0, index_js_1.isAsyncIterable)(i) ? opAppendAsync2(...iterablesToAppend)(i) : opAppendSync2(...iterablesToAppend)(i); - } - return _; - } - exports.opAppend = opAppend2; + }; } }); -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/await.js -var require_await = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/await.js"(exports) { +// node_modules/clear-module/index.js +var require_clear_module = __commonJS({ + "node_modules/clear-module/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opAwaitAsync = void 0; - async function* _asyncAwait2(iter) { - for await (const v of iter) { - yield v; + var path26 = require("path"); + var resolveFrom2 = require_resolve_from2(); + var parentModule = require_parent_module2(); + var resolve13 = (moduleId) => { + try { + return resolveFrom2(path26.dirname(parentModule(__filename)), moduleId); + } catch (_) { } - } - function opAwaitAsync2() { - return _asyncAwait2; - } - exports.opAwaitAsync = opAwaitAsync2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/combine.js -var require_combine = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/combine.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opCombineSync = exports.opCombineAsync = void 0; - function opCombineAsync2(...fns) { - function combine(iter) { - for (const fn of fns) { - iter = fn(iter); - } - return iter; + }; + var clear = (moduleId) => { + if (typeof moduleId !== "string") { + throw new TypeError(`Expected a \`string\`, got \`${typeof moduleId}\``); } - return combine; - } - exports.opCombineAsync = opCombineAsync2; - function opCombineSync2(...fns) { - function combine(iter) { - for (const fn of fns) { - iter = fn(iter); - } - return iter; + const filePath = resolve13(moduleId); + if (!filePath) { + return; } - return combine; - } - exports.opCombineSync = opCombineSync2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/concatMap.js -var require_concatMap = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/concatMap.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opConcatMap = exports.opConcatMapSync = exports.opConcatMapAsync = void 0; - var util_js_1 = require_util5(); - function opConcatMapAsync2(mapFn) { - async function* fn(iter) { - for await (const v of iter) { - yield* mapFn(v); + if (require.cache[filePath] && require.cache[filePath].parent) { + let i = require.cache[filePath].parent.children.length; + while (i--) { + if (require.cache[filePath].parent.children[i].id === filePath) { + require.cache[filePath].parent.children.splice(i, 1); + } } } - return fn; - } - exports.opConcatMapAsync = opConcatMapAsync2; - function opConcatMapSync2(mapFn) { - function* fn(iter) { - for (const v of iter) { - yield* mapFn(v); + if (require.cache[filePath]) { + const children = require.cache[filePath].children.map((child) => child.id); + delete require.cache[filePath]; + for (const id of children) { + clear(id); } } - return fn; - } - exports.opConcatMapSync = opConcatMapSync2; - var opConcatMap2 = (fn) => (0, util_js_1.toPipeFn)(opConcatMapSync2(fn), opConcatMapAsync2(fn)); - exports.opConcatMap = opConcatMap2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/filter.js -var require_filter = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/filter.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opFilter = exports.opFilterSync = exports.opFilterAsync = void 0; - var util_js_1 = require_util5(); - function opFilterAsync3(filterFn) { - async function* fn(iter) { - for await (const v of iter) { - const pass = await filterFn(v); - if (pass) - yield v; - } + }; + clear.all = () => { + const directory = path26.dirname(parentModule(__filename)); + for (const moduleId of Object.keys(require.cache)) { + delete require.cache[resolveFrom2(directory, moduleId)]; } - return fn; - } - exports.opFilterAsync = opFilterAsync3; - function opFilterSync2(filterFn) { - function* fn(iter) { - for (const v of iter) { - if (filterFn(v)) - yield v; + }; + clear.match = (regex) => { + for (const moduleId of Object.keys(require.cache)) { + if (regex.test(moduleId)) { + clear(moduleId); } } - return fn; - } - exports.opFilterSync = opFilterSync2; - function opFilter2(fn) { - const asyncFn = opFilterAsync3(fn); - const syncFn = opFilterSync2(fn); - function _(i) { - return (0, util_js_1.isAsyncIterable)(i) ? asyncFn(i) : syncFn(i); + }; + clear.single = (moduleId) => { + if (typeof moduleId !== "string") { + throw new TypeError(`Expected a \`string\`, got \`${typeof moduleId}\``); } - return _; - } - exports.opFilter = opFilter2; + delete require.cache[resolve13(moduleId)]; + }; + module2.exports = clear; } }); -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/first.js -var require_first = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/first.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opFirst = exports.opFirstSync = exports.opFirstAsync = void 0; - var util_js_1 = require_util5(); - function opFirstAsync2(firstFn) { - async function* fn(iter) { - for await (const v of iter) { - const pass = await firstFn(v); - if (pass) { - yield v; - break; +// node_modules/vscode-languageserver-textdocument/lib/umd/main.js +var require_main = __commonJS({ + "node_modules/vscode-languageserver-textdocument/lib/umd/main.js"(exports, module2) { + var __spreadArray = exports && exports.__spreadArray || function(to, from, pack) { + if (pack || arguments.length === 2) + for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) + ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; } } + return to.concat(ar || Array.prototype.slice.call(from)); + }; + (function(factory) { + if (typeof module2 === "object" && typeof module2.exports === "object") { + var v = factory(require, exports); + if (v !== void 0) + module2.exports = v; + } else if (typeof define === "function" && define.amd) { + define(["require", "exports"], factory); } - return fn; - } - exports.opFirstAsync = opFirstAsync2; - function opFirstSync2(firstFn) { - function* fn(iter) { - for (const v of iter) { - if (firstFn(v)) { - yield v; - break; + })(function(require2, exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.TextDocument = void 0; + var FullTextDocument = ( + /** @class */ + function() { + function FullTextDocument2(uri, languageId, version4, content) { + this._uri = uri; + this._languageId = languageId; + this._version = version4; + this._content = content; + this._lineOffsets = void 0; + } + Object.defineProperty(FullTextDocument2.prototype, "uri", { + get: function() { + return this._uri; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(FullTextDocument2.prototype, "languageId", { + get: function() { + return this._languageId; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(FullTextDocument2.prototype, "version", { + get: function() { + return this._version; + }, + enumerable: false, + configurable: true + }); + FullTextDocument2.prototype.getText = function(range) { + if (range) { + var start = this.offsetAt(range.start); + var end = this.offsetAt(range.end); + return this._content.substring(start, end); + } + return this._content; + }; + FullTextDocument2.prototype.update = function(changes, version4) { + for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) { + var change = changes_1[_i]; + if (FullTextDocument2.isIncremental(change)) { + var range = getWellformedRange(change.range); + var startOffset = this.offsetAt(range.start); + var endOffset = this.offsetAt(range.end); + this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length); + var startLine = Math.max(range.start.line, 0); + var endLine = Math.max(range.end.line, 0); + var lineOffsets = this._lineOffsets; + var addedLineOffsets = computeLineOffsets(change.text, false, startOffset); + if (endLine - startLine === addedLineOffsets.length) { + for (var i = 0, len = addedLineOffsets.length; i < len; i++) { + lineOffsets[i + startLine + 1] = addedLineOffsets[i]; + } + } else { + if (addedLineOffsets.length < 1e4) { + lineOffsets.splice.apply(lineOffsets, __spreadArray([startLine + 1, endLine - startLine], addedLineOffsets, false)); + } else { + this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1)); + } + } + var diff = change.text.length - (endOffset - startOffset); + if (diff !== 0) { + for (var i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) { + lineOffsets[i] = lineOffsets[i] + diff; + } + } + } else if (FullTextDocument2.isFull(change)) { + this._content = change.text; + this._lineOffsets = void 0; + } else { + throw new Error("Unknown change event received"); + } + } + this._version = version4; + }; + FullTextDocument2.prototype.getLineOffsets = function() { + if (this._lineOffsets === void 0) { + this._lineOffsets = computeLineOffsets(this._content, true); + } + return this._lineOffsets; + }; + FullTextDocument2.prototype.positionAt = function(offset) { + offset = Math.max(Math.min(offset, this._content.length), 0); + var lineOffsets = this.getLineOffsets(); + var low = 0, high = lineOffsets.length; + if (high === 0) { + return { line: 0, character: offset }; + } + while (low < high) { + var mid = Math.floor((low + high) / 2); + if (lineOffsets[mid] > offset) { + high = mid; + } else { + low = mid + 1; + } + } + var line = low - 1; + return { line, character: offset - lineOffsets[line] }; + }; + FullTextDocument2.prototype.offsetAt = function(position) { + var lineOffsets = this.getLineOffsets(); + if (position.line >= lineOffsets.length) { + return this._content.length; + } else if (position.line < 0) { + return 0; + } + var lineOffset = lineOffsets[position.line]; + var nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length; + return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); + }; + Object.defineProperty(FullTextDocument2.prototype, "lineCount", { + get: function() { + return this.getLineOffsets().length; + }, + enumerable: false, + configurable: true + }); + FullTextDocument2.isIncremental = function(event) { + var candidate = event; + return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range !== void 0 && (candidate.rangeLength === void 0 || typeof candidate.rangeLength === "number"); + }; + FullTextDocument2.isFull = function(event) { + var candidate = event; + return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range === void 0 && candidate.rangeLength === void 0; + }; + return FullTextDocument2; + }() + ); + var TextDocument; + (function(TextDocument2) { + function create(uri, languageId, version4, content) { + return new FullTextDocument(uri, languageId, version4, content); + } + TextDocument2.create = create; + function update(document, changes, version4) { + if (document instanceof FullTextDocument) { + document.update(changes, version4); + return document; + } else { + throw new Error("TextDocument.update: document must be created by TextDocument.create"); } } - } - return fn; - } - exports.opFirstSync = opFirstSync2; - function opFirst2(fn) { - const asyncFn = opFirstAsync2(fn); - const syncFn = opFirstSync2(fn); - function _(i) { - return (0, util_js_1.isAsyncIterable)(i) ? asyncFn(i) : syncFn(i); - } - return _; - } - exports.opFirst = opFirst2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/flatten.js -var require_flatten = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/flatten.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opFlatten = exports.opFlattenSync = exports.opFlattenAsync = void 0; - var util_js_1 = require_util5(); - function opFlattenAsync2() { - async function* fn(iter) { - for await (const v of iter) { - yield* v; + TextDocument2.update = update; + function applyEdits2(document, edits) { + var text = document.getText(); + var sortedEdits = mergeSort(edits.map(getWellformedEdit), function(a, b) { + var diff = a.range.start.line - b.range.start.line; + if (diff === 0) { + return a.range.start.character - b.range.start.character; + } + return diff; + }); + var lastModifiedOffset = 0; + var spans = []; + for (var _i = 0, sortedEdits_1 = sortedEdits; _i < sortedEdits_1.length; _i++) { + var e = sortedEdits_1[_i]; + var 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(""); + } + TextDocument2.applyEdits = applyEdits2; + })(TextDocument = exports2.TextDocument || (exports2.TextDocument = {})); + function mergeSort(data, compare4) { + if (data.length <= 1) { + return data; + } + var p = data.length / 2 | 0; + var left = data.slice(0, p); + var right = data.slice(p); + mergeSort(left, compare4); + mergeSort(right, compare4); + var leftIdx = 0; + var rightIdx = 0; + var i = 0; + while (leftIdx < left.length && rightIdx < right.length) { + var ret = compare4(left[leftIdx], right[rightIdx]); + if (ret <= 0) { + data[i++] = left[leftIdx++]; + } else { + data[i++] = right[rightIdx++]; + } + } + while (leftIdx < left.length) { + data[i++] = left[leftIdx++]; + } + while (rightIdx < right.length) { + data[i++] = right[rightIdx++]; } + return data; } - return fn; - } - exports.opFlattenAsync = opFlattenAsync2; - function opFlattenSync2() { - function* fn(iter) { - for (const v of iter) { - yield* v; + function computeLineOffsets(text, isAtLineStart, textOffset2) { + if (textOffset2 === void 0) { + textOffset2 = 0; + } + var result = isAtLineStart ? [textOffset2] : []; + for (var i = 0; i < text.length; i++) { + var ch = text.charCodeAt(i); + if (ch === 13 || ch === 10) { + if (ch === 13 && i + 1 < text.length && text.charCodeAt(i + 1) === 10) { + i++; + } + result.push(textOffset2 + i + 1); + } } + return result; } - return fn; - } - exports.opFlattenSync = opFlattenSync2; - var opFlatten2 = () => (0, util_js_1.toPipeFn)(opFlattenSync2(), opFlattenAsync2()); - exports.opFlatten = opFlatten2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/joinStrings.js -var require_joinStrings = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/joinStrings.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opJoinStrings = exports.opJoinStringsSync = exports.opJoinStringsAsync = void 0; - var toArray_js_1 = require_toArray(); - var util_js_1 = require_util5(); - function opJoinStringsAsync2(joinCharacter = ",") { - async function* fn(iter) { - for await (const v of iter) { - const a = await (0, toArray_js_1.toArray)(v); - yield a.join(joinCharacter); + function getWellformedRange(range) { + var start = range.start; + var end = range.end; + if (start.line > end.line || start.line === end.line && start.character > end.character) { + return { start: end, end: start }; } + return range; } - return fn; - } - exports.opJoinStringsAsync = opJoinStringsAsync2; - function opJoinStringsSync2(joinCharacter = ",") { - function* fn(iter) { - for (const v of iter) { - const a = (0, toArray_js_1.toArray)(v); - yield a.join(joinCharacter); + function getWellformedEdit(textEdit) { + var range = getWellformedRange(textEdit.range); + if (range !== textEdit.range) { + return { newText: textEdit.newText, range }; } + return textEdit; } - return fn; - } - exports.opJoinStringsSync = opJoinStringsSync2; - var opJoinStrings2 = (joinCharacter) => (0, util_js_1.toPipeFn)(opJoinStringsSync2(joinCharacter), opJoinStringsAsync2(joinCharacter)); - exports.opJoinStrings = opJoinStrings2; + }); } }); -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/last.js -var require_last = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/last.js"(exports) { +// node_modules/cspell-lib/dist/lib-cjs/pkg-info.cjs +var require_pkg_info = __commonJS({ + "node_modules/cspell-lib/dist/lib-cjs/pkg-info.cjs"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.opLast = exports.opLastSync = exports.opLastAsync = void 0; - var util_js_1 = require_util5(); - var symNotFound2 = Symbol("LastNotFound"); - function opLastAsync2(lastFn) { - async function* fn(iter) { - let last = symNotFound2; - for await (const v of iter) { - const pass = await lastFn(v); - if (pass) { - last = v; - } - } - if (last !== symNotFound2) - yield last; - } - return fn; - } - exports.opLastAsync = opLastAsync2; - function opLastSync2(lastFn) { - function* fn(iter) { - let last = symNotFound2; - for (const v of iter) { - if (lastFn(v)) { - last = v; - } - } - if (last !== symNotFound2) - yield last; - } - return fn; - } - exports.opLastSync = opLastSync2; - function opLast2(fn) { - const asyncFn = opLastAsync2(fn); - const syncFn = opLastSync2(fn); - function _(i) { - return (0, util_js_1.isAsyncIterable)(i) ? asyncFn(i) : syncFn(i); - } - return _; - } - exports.opLast = opLast2; + exports.srcDirectory = void 0; + exports.srcDirectory = __dirname; } }); -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/map.js -var require_map2 = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/map.js"(exports) { +// node_modules/cspell-lib/dist/lib-cjs/index.cjs +var require_lib_cjs = __commonJS({ + "node_modules/cspell-lib/dist/lib-cjs/index.cjs"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.opMap = exports.opMapSync = exports.opMapAsync = void 0; - var util_js_1 = require_util5(); - function opMapAsync2(mapFn) { - async function* fn(iter) { - for await (const v of iter) { - yield mapFn(v); - } - } - return fn; - } - exports.opMapAsync = opMapAsync2; - function opMapSync2(mapFn) { - function* fn(iter) { - for (const v of iter) { - yield mapFn(v); - } - } - return fn; - } - exports.opMapSync = opMapSync2; - var opMap2 = (fn) => (0, util_js_1.toPipeFn)(opMapSync2(fn), opMapAsync2(fn)); - exports.opMap = opMap2; + exports.srcDirectory = void 0; + var pkg_info_cjs_1 = require_pkg_info(); + Object.defineProperty(exports, "srcDirectory", { enumerable: true, get: function() { + return pkg_info_cjs_1.srcDirectory; + } }); } }); -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/reduce.js -var require_reduce = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/reduce.js"(exports) { +// node_modules/cspell-dictionary/node_modules/fast-equals/dist/fast-equals.cjs.js +var require_fast_equals_cjs = __commonJS({ + "node_modules/cspell-dictionary/node_modules/fast-equals/dist/fast-equals.cjs.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.opReduceSync = exports.opReduceAsync = void 0; - var index_js_1 = require_helpers(); - function opReduceAsync2(reduceFn, initialValue) { - async function* reduce2(head, tail) { - for await (const v of tail) { - head = reduceFn(head, v); - } - yield head; - } - async function* fn(iter) { - const ht = initialValue === void 0 ? await headTailAsync2(iter) : { head: await initialValue, tail: iter }; - if (!ht) - return; - yield* reduce2(ht.head, ht.tail); - } - return fn; + function createDefaultIsNestedEqual(comparator) { + return function isEqual(a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, meta) { + return comparator(a, b, meta); + }; } - exports.opReduceAsync = opReduceAsync2; - function opReduceSync2(reduceFn, initialValue) { - function* reduce2(head, tail) { - for (const v of tail) { - head = reduceFn(head, v); + function createIsCircular(areItemsEqual) { + return function isCircular2(a, b, isEqual, cache2) { + if (!a || !b || typeof a !== "object" || typeof b !== "object") { + return areItemsEqual(a, b, isEqual, cache2); + } + var cachedA = cache2.get(a); + var cachedB = cache2.get(b); + if (cachedA && cachedB) { + return cachedA === b && cachedB === a; } - yield head; + cache2.set(a, b); + cache2.set(b, a); + var result = areItemsEqual(a, b, isEqual, cache2); + cache2.delete(a); + cache2.delete(b); + return result; + }; + } + function merge4(a, b) { + var merged = {}; + for (var key in a) { + merged[key] = a[key]; } - function* fn(iter) { - const ht = initialValue === void 0 ? headTail2(iter) : { head: initialValue, tail: iter }; - if (!ht) - return; - yield* reduce2(ht.head, ht.tail); + for (var key in b) { + merged[key] = b[key]; } - return fn; + return merged; } - exports.opReduceSync = opReduceSync2; - function headTail2(iter) { - const iterator = iter[Symbol.iterator](); - const first = iterator.next(); - if (first.done) - return void 0; - return { head: first.value, tail: (0, index_js_1.iteratorToIterable)(iterator) }; + function isPlainObject(value) { + return value.constructor === Object || value.constructor == null; } - async function headTailAsync2(iter) { - const iterator = isIterable2(iter) ? iter[Symbol.iterator]() : iter[Symbol.asyncIterator](); - const first = await iterator.next(); - if (first.done) - return void 0; - return { head: first.value, tail: (0, index_js_1.asyncIteratorToAsyncIterable)(iterator) }; + function isPromiseLike(value) { + return typeof value.then === "function"; } - function isIterable2(i) { - return typeof i[Symbol.iterator] === "function"; + function sameValueZeroEqual(a, b) { + return a === b || a !== a && b !== b; } - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/skip.js -var require_skip = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/skip.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opSkip = exports.opSkipSync = exports.opSkipAsync = void 0; - var util_js_1 = require_util5(); - function opSkipAsync2(count) { - async function* fn(iter) { - for await (const v of iter) { - if (count > 0) { - --count; - continue; - } - yield v; + var ARGUMENTS_TAG = "[object Arguments]"; + var BOOLEAN_TAG = "[object Boolean]"; + var DATE_TAG = "[object Date]"; + var REG_EXP_TAG = "[object RegExp]"; + var MAP_TAG = "[object Map]"; + var NUMBER_TAG = "[object Number]"; + var OBJECT_TAG = "[object Object]"; + var SET_TAG = "[object Set]"; + var STRING_TAG = "[object String]"; + var toString = Object.prototype.toString; + function createComparator(_a2) { + var areArraysEqual2 = _a2.areArraysEqual, areDatesEqual2 = _a2.areDatesEqual, areMapsEqual2 = _a2.areMapsEqual, areObjectsEqual2 = _a2.areObjectsEqual, areRegExpsEqual2 = _a2.areRegExpsEqual, areSetsEqual2 = _a2.areSetsEqual, createIsNestedEqual = _a2.createIsNestedEqual; + var isEqual = createIsNestedEqual(comparator); + function comparator(a, b, meta) { + if (a === b) { + return true; } - } - return fn; - } - exports.opSkipAsync = opSkipAsync2; - function opSkipSync2(count) { - function* fn(iter) { - for (const v of iter) { - if (count > 0) { - --count; - continue; - } - yield v; + if (!a || !b || typeof a !== "object" || typeof b !== "object") { + return a !== a && b !== b; } - } - return fn; - } - exports.opSkipSync = opSkipSync2; - var opSkip2 = (count) => (0, util_js_1.toPipeFn)(opSkipSync2(count), opSkipAsync2(count)); - exports.opSkip = opSkip2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/take.js -var require_take = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/take.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opTake = exports.opTakeSync = exports.opTakeAsync = void 0; - var util_js_1 = require_util5(); - function opTakeAsync2(count) { - async function* fn(iter) { - if (count <= 0) - return; - for await (const v of iter) { - yield v; - if (--count <= 0) - return; + if (isPlainObject(a) && isPlainObject(b)) { + return areObjectsEqual2(a, b, isEqual, meta); } - } - return fn; - } - exports.opTakeAsync = opTakeAsync2; - function opTakeSync2(count) { - function* fn(iter) { - if (count <= 0) - return; - for (const v of iter) { - yield v; - if (--count <= 0) - return; + var aArray = Array.isArray(a); + var bArray = Array.isArray(b); + if (aArray || bArray) { + return aArray === bArray && areArraysEqual2(a, b, isEqual, meta); + } + var aTag = toString.call(a); + if (aTag !== toString.call(b)) { + return false; + } + if (aTag === DATE_TAG) { + return areDatesEqual2(a, b, isEqual, meta); + } + if (aTag === REG_EXP_TAG) { + return areRegExpsEqual2(a, b, isEqual, meta); } + if (aTag === MAP_TAG) { + return areMapsEqual2(a, b, isEqual, meta); + } + if (aTag === SET_TAG) { + return areSetsEqual2(a, b, isEqual, meta); + } + if (aTag === OBJECT_TAG || aTag === ARGUMENTS_TAG) { + return isPromiseLike(a) || isPromiseLike(b) ? false : areObjectsEqual2(a, b, isEqual, meta); + } + if (aTag === BOOLEAN_TAG || aTag === NUMBER_TAG || aTag === STRING_TAG) { + return sameValueZeroEqual(a.valueOf(), b.valueOf()); + } + return false; } - return fn; + return comparator; } - exports.opTakeSync = opTakeSync2; - var opTake2 = (count) => (0, util_js_1.toPipeFn)(opTakeSync2(count), opTakeAsync2(count)); - exports.opTake = opTake2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/tap.js -var require_tap = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/tap.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opTap = exports.opTapSync = exports.opTapAsync = void 0; - var util_js_1 = require_util5(); - function opTapAsync2(tapFn) { - async function* fn(iter) { - for await (const v of iter) { - tapFn(v); - yield v; + function areArraysEqual(a, b, isEqual, meta) { + var index = a.length; + if (b.length !== index) { + return false; + } + while (index-- > 0) { + if (!isEqual(a[index], b[index], index, index, a, b, meta)) { + return false; } } - return fn; + return true; } - exports.opTapAsync = opTapAsync2; - function opTapSync2(tapFn) { - function* fn(iter) { - for (const v of iter) { - tapFn(v); - yield v; - } + var areArraysEqualCircular = createIsCircular(areArraysEqual); + function areDatesEqual(a, b) { + return sameValueZeroEqual(a.valueOf(), b.valueOf()); + } + function areMapsEqual(a, b, isEqual, meta) { + var isValueEqual = a.size === b.size; + if (!isValueEqual) { + return false; } - return fn; + if (!a.size) { + return true; + } + var matchedIndices = {}; + var indexA = 0; + a.forEach(function(aValue, aKey) { + if (!isValueEqual) { + return; + } + var hasMatch = false; + var matchIndexB = 0; + b.forEach(function(bValue, bKey) { + if (!hasMatch && !matchedIndices[matchIndexB] && (hasMatch = isEqual(aKey, bKey, indexA, matchIndexB, a, b, meta) && isEqual(aValue, bValue, aKey, bKey, a, b, meta))) { + matchedIndices[matchIndexB] = true; + } + matchIndexB++; + }); + indexA++; + isValueEqual = hasMatch; + }); + return isValueEqual; } - exports.opTapSync = opTapSync2; - var opTap2 = (fn) => (0, util_js_1.toPipeFn)(opTapSync2(fn), opTapAsync2(fn)); - exports.opTap = opTap2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/unique.js -var require_unique = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/unique.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opUnique = exports.opUniqueSync = exports.opUniqueAsync = void 0; - var util_js_1 = require_util5(); - function opUniqueAsync2(k) { - function fnK(k2) { - async function* fn2(iter) { - const s = /* @__PURE__ */ new Set(); - for await (const v of iter) { - const kk = k2(v); - if (s.has(kk)) - continue; - s.add(kk); - yield v; + var areMapsEqualCircular = createIsCircular(areMapsEqual); + var OWNER = "_owner"; + var hasOwnProperty2 = Object.prototype.hasOwnProperty; + function areObjectsEqual(a, b, isEqual, meta) { + var keysA = Object.keys(a); + var index = keysA.length; + if (Object.keys(b).length !== index) { + return false; + } + var key; + while (index-- > 0) { + key = keysA[index]; + if (key === OWNER) { + var reactElementA = !!a.$$typeof; + var reactElementB = !!b.$$typeof; + if ((reactElementA || reactElementB) && reactElementA !== reactElementB) { + return false; } } - return fn2; - } - async function* fn(iter) { - const s = /* @__PURE__ */ new Set(); - for await (const v of iter) { - if (s.has(v)) - continue; - s.add(v); - yield v; + if (!hasOwnProperty2.call(b, key) || !isEqual(a[key], b[key], key, key, a, b, meta)) { + return false; } } - return k ? fnK(k) : fn; + return true; } - exports.opUniqueAsync = opUniqueAsync2; - function opUniqueSync2(k) { - function fnK(key) { - function* fn2(iter) { - const s = /* @__PURE__ */ new Set(); - for (const v of iter) { - const kk = key(v); - if (s.has(kk)) - continue; - s.add(kk); - yield v; - } - } - return fn2; + var areObjectsEqualCircular = createIsCircular(areObjectsEqual); + function areRegExpsEqual(a, b) { + return a.source === b.source && a.flags === b.flags; + } + function areSetsEqual(a, b, isEqual, meta) { + var isValueEqual = a.size === b.size; + if (!isValueEqual) { + return false; } - function* fn(iter) { - const s = /* @__PURE__ */ new Set(); - for (const v of iter) { - if (s.has(v)) - continue; - s.add(v); - yield v; + if (!a.size) { + return true; + } + var matchedIndices = {}; + a.forEach(function(aValue, aKey) { + if (!isValueEqual) { + return; } + var hasMatch = false; + var matchIndex = 0; + b.forEach(function(bValue, bKey) { + if (!hasMatch && !matchedIndices[matchIndex] && (hasMatch = isEqual(aValue, bValue, aKey, bKey, a, b, meta))) { + matchedIndices[matchIndex] = true; + } + matchIndex++; + }); + isValueEqual = hasMatch; + }); + return isValueEqual; + } + var areSetsEqualCircular = createIsCircular(areSetsEqual); + var DEFAULT_CONFIG = Object.freeze({ + areArraysEqual, + areDatesEqual, + areMapsEqual, + areObjectsEqual, + areRegExpsEqual, + areSetsEqual, + createIsNestedEqual: createDefaultIsNestedEqual + }); + var DEFAULT_CIRCULAR_CONFIG = Object.freeze({ + areArraysEqual: areArraysEqualCircular, + areDatesEqual, + areMapsEqual: areMapsEqualCircular, + areObjectsEqual: areObjectsEqualCircular, + areRegExpsEqual, + areSetsEqual: areSetsEqualCircular, + createIsNestedEqual: createDefaultIsNestedEqual + }); + var isDeepEqual = createComparator(DEFAULT_CONFIG); + function deepEqual2(a, b) { + return isDeepEqual(a, b, void 0); + } + var isShallowEqual = createComparator(merge4(DEFAULT_CONFIG, { createIsNestedEqual: function() { + return sameValueZeroEqual; + } })); + function shallowEqual(a, b) { + return isShallowEqual(a, b, void 0); + } + var isCircularDeepEqual = createComparator(DEFAULT_CIRCULAR_CONFIG); + function circularDeepEqual(a, b) { + return isCircularDeepEqual(a, b, /* @__PURE__ */ new WeakMap()); + } + var isCircularShallowEqual = createComparator(merge4(DEFAULT_CIRCULAR_CONFIG, { + createIsNestedEqual: function() { + return sameValueZeroEqual; } - return k ? fnK(k) : fn; + })); + function circularShallowEqual(a, b) { + return isCircularShallowEqual(a, b, /* @__PURE__ */ new WeakMap()); } - exports.opUniqueSync = opUniqueSync2; - var opUnique2 = (getKey) => (0, util_js_1.toPipeFn)(opUniqueSync2(getKey), opUniqueAsync2(getKey)); - exports.opUnique = opUnique2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/operators/index.js -var require_operators3 = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/operators/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.opUniqueSync = exports.opUniqueAsync = exports.opUnique = exports.opTapSync = exports.opTapAsync = exports.opTap = exports.opTakeSync = exports.opTakeAsync = exports.opTake = exports.opSkipSync = exports.opSkipAsync = exports.opSkip = exports.opReduceSync = exports.opReduceAsync = exports.opMapSync = exports.opMapAsync = exports.opMap = exports.opLastSync = exports.opLastAsync = exports.opLast = exports.opJoinStringsSync = exports.opJoinStringsAsync = exports.opJoinStrings = exports.opFlattenSync = exports.opFlattenAsync = exports.opFlatten = exports.opFirstSync = exports.opFirstAsync = exports.opFirst = exports.opFilterSync = exports.opFilterAsync = exports.opFilter = exports.opConcatMapSync = exports.opConcatMapAsync = exports.opConcatMap = exports.opCombineSync = exports.opCombineAsync = exports.opAwaitAsync = exports.opAppendSync = exports.opAppendAsync = exports.opAppend = void 0; - var append_js_1 = require_append(); - Object.defineProperty(exports, "opAppend", { enumerable: true, get: function() { - return append_js_1.opAppend; - } }); - Object.defineProperty(exports, "opAppendAsync", { enumerable: true, get: function() { - return append_js_1.opAppendAsync; - } }); - Object.defineProperty(exports, "opAppendSync", { enumerable: true, get: function() { - return append_js_1.opAppendSync; - } }); - var await_js_1 = require_await(); - Object.defineProperty(exports, "opAwaitAsync", { enumerable: true, get: function() { - return await_js_1.opAwaitAsync; - } }); - var combine_js_1 = require_combine(); - Object.defineProperty(exports, "opCombineAsync", { enumerable: true, get: function() { - return combine_js_1.opCombineAsync; - } }); - Object.defineProperty(exports, "opCombineSync", { enumerable: true, get: function() { - return combine_js_1.opCombineSync; - } }); - var concatMap_js_1 = require_concatMap(); - Object.defineProperty(exports, "opConcatMap", { enumerable: true, get: function() { - return concatMap_js_1.opConcatMap; - } }); - Object.defineProperty(exports, "opConcatMapAsync", { enumerable: true, get: function() { - return concatMap_js_1.opConcatMapAsync; - } }); - Object.defineProperty(exports, "opConcatMapSync", { enumerable: true, get: function() { - return concatMap_js_1.opConcatMapSync; - } }); - var filter_js_1 = require_filter(); - Object.defineProperty(exports, "opFilter", { enumerable: true, get: function() { - return filter_js_1.opFilter; - } }); - Object.defineProperty(exports, "opFilterAsync", { enumerable: true, get: function() { - return filter_js_1.opFilterAsync; - } }); - Object.defineProperty(exports, "opFilterSync", { enumerable: true, get: function() { - return filter_js_1.opFilterSync; - } }); - var first_js_1 = require_first(); - Object.defineProperty(exports, "opFirst", { enumerable: true, get: function() { - return first_js_1.opFirst; - } }); - Object.defineProperty(exports, "opFirstAsync", { enumerable: true, get: function() { - return first_js_1.opFirstAsync; - } }); - Object.defineProperty(exports, "opFirstSync", { enumerable: true, get: function() { - return first_js_1.opFirstSync; - } }); - var flatten_js_1 = require_flatten(); - Object.defineProperty(exports, "opFlatten", { enumerable: true, get: function() { - return flatten_js_1.opFlatten; - } }); - Object.defineProperty(exports, "opFlattenAsync", { enumerable: true, get: function() { - return flatten_js_1.opFlattenAsync; - } }); - Object.defineProperty(exports, "opFlattenSync", { enumerable: true, get: function() { - return flatten_js_1.opFlattenSync; - } }); - var joinStrings_js_1 = require_joinStrings(); - Object.defineProperty(exports, "opJoinStrings", { enumerable: true, get: function() { - return joinStrings_js_1.opJoinStrings; - } }); - Object.defineProperty(exports, "opJoinStringsAsync", { enumerable: true, get: function() { - return joinStrings_js_1.opJoinStringsAsync; - } }); - Object.defineProperty(exports, "opJoinStringsSync", { enumerable: true, get: function() { - return joinStrings_js_1.opJoinStringsSync; - } }); - var last_js_1 = require_last(); - Object.defineProperty(exports, "opLast", { enumerable: true, get: function() { - return last_js_1.opLast; - } }); - Object.defineProperty(exports, "opLastAsync", { enumerable: true, get: function() { - return last_js_1.opLastAsync; - } }); - Object.defineProperty(exports, "opLastSync", { enumerable: true, get: function() { - return last_js_1.opLastSync; - } }); - var map_js_1 = require_map2(); - Object.defineProperty(exports, "opMap", { enumerable: true, get: function() { - return map_js_1.opMap; - } }); - Object.defineProperty(exports, "opMapAsync", { enumerable: true, get: function() { - return map_js_1.opMapAsync; - } }); - Object.defineProperty(exports, "opMapSync", { enumerable: true, get: function() { - return map_js_1.opMapSync; - } }); - var reduce_js_1 = require_reduce(); - Object.defineProperty(exports, "opReduceAsync", { enumerable: true, get: function() { - return reduce_js_1.opReduceAsync; - } }); - Object.defineProperty(exports, "opReduceSync", { enumerable: true, get: function() { - return reduce_js_1.opReduceSync; - } }); - var skip_js_1 = require_skip(); - Object.defineProperty(exports, "opSkip", { enumerable: true, get: function() { - return skip_js_1.opSkip; - } }); - Object.defineProperty(exports, "opSkipAsync", { enumerable: true, get: function() { - return skip_js_1.opSkipAsync; - } }); - Object.defineProperty(exports, "opSkipSync", { enumerable: true, get: function() { - return skip_js_1.opSkipSync; - } }); - var take_js_1 = require_take(); - Object.defineProperty(exports, "opTake", { enumerable: true, get: function() { - return take_js_1.opTake; - } }); - Object.defineProperty(exports, "opTakeAsync", { enumerable: true, get: function() { - return take_js_1.opTakeAsync; - } }); - Object.defineProperty(exports, "opTakeSync", { enumerable: true, get: function() { - return take_js_1.opTakeSync; - } }); - var tap_js_1 = require_tap(); - Object.defineProperty(exports, "opTap", { enumerable: true, get: function() { - return tap_js_1.opTap; - } }); - Object.defineProperty(exports, "opTapAsync", { enumerable: true, get: function() { - return tap_js_1.opTapAsync; - } }); - Object.defineProperty(exports, "opTapSync", { enumerable: true, get: function() { - return tap_js_1.opTapSync; - } }); - var unique_js_1 = require_unique(); - Object.defineProperty(exports, "opUnique", { enumerable: true, get: function() { - return unique_js_1.opUnique; - } }); - Object.defineProperty(exports, "opUniqueAsync", { enumerable: true, get: function() { - return unique_js_1.opUniqueAsync; - } }); - Object.defineProperty(exports, "opUniqueSync", { enumerable: true, get: function() { - return unique_js_1.opUniqueSync; - } }); - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/pipe.js -var require_pipe = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/pipe.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.pipeSync = exports.pipeAsync = void 0; - var index_js_1 = require_helpers(); - var index_js_2 = require_operators3(); - function pipeAsync2(i, ...fns) { - const iter = (0, index_js_1.toAsyncIterable)(i); - return (0, index_js_2.opCombineAsync)(...fns)(iter); + function createCustomEqual(getComparatorOptions) { + return createComparator(merge4(DEFAULT_CONFIG, getComparatorOptions(DEFAULT_CONFIG))); } - exports.pipeAsync = pipeAsync2; - function pipeSync2(i, ...fns) { - return (0, index_js_2.opCombineSync)(...fns)(i); + function createCustomCircularEqual(getComparatorOptions) { + var comparator = createComparator(merge4(DEFAULT_CIRCULAR_CONFIG, getComparatorOptions(DEFAULT_CIRCULAR_CONFIG))); + return function(a, b, meta) { + if (meta === void 0) { + meta = /* @__PURE__ */ new WeakMap(); + } + return comparator(a, b, meta); + }; } - exports.pipeSync = pipeSync2; - } -}); - -// node_modules/@cspell/cspell-pipe/dist/cjs/reduce.js -var require_reduce2 = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/reduce.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.reduce = exports.reduceAsync = exports.reduceSync = void 0; - var index_js_1 = require_helpers(); - var toArray_js_1 = require_toArray(); - var index_js_2 = require_operators3(); - var pipe_js_1 = require_pipe(); - function reduceSync2(iter, reduceFn, initialValue) { - const i = initialValue === void 0 ? (0, pipe_js_1.pipeSync)(iter, (0, index_js_2.opReduceSync)(reduceFn)) : (0, pipe_js_1.pipeSync)(iter, (0, index_js_2.opReduceSync)(reduceFn, initialValue)); - return [...i][0]; - } - exports.reduceSync = reduceSync2; - async function reduceAsync2(iter, reduceFn, initialValue) { - const i = initialValue === void 0 ? (0, pipe_js_1.pipeAsync)(iter, (0, index_js_2.opReduceAsync)(reduceFn)) : (0, pipe_js_1.pipeAsync)(iter, (0, index_js_2.opReduceAsync)(reduceFn, initialValue)); - const arr = await (0, toArray_js_1.toArrayAsync)(i); - return arr[0]; - } - exports.reduceAsync = reduceAsync2; - function reduce2(iter, reduceFn, initialValue) { - return (0, index_js_1.isAsyncIterable)(iter) ? reduceAsync2(iter, reduceFn, initialValue) : reduceSync2(iter, reduceFn, initialValue); - } - exports.reduce = reduce2; + exports.circularDeepEqual = circularDeepEqual; + exports.circularShallowEqual = circularShallowEqual; + exports.createCustomCircularEqual = createCustomCircularEqual; + exports.createCustomEqual = createCustomEqual; + exports.deepEqual = deepEqual2; + exports.sameValueZeroEqual = sameValueZeroEqual; + exports.shallowEqual = shallowEqual; } }); -// node_modules/@cspell/cspell-pipe/dist/cjs/index.js -var require_cjs4 = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/index.js"(exports) { +// node_modules/cspell/dist/lib/uri.cjs +var require_uri = __commonJS({ + "node_modules/cspell/dist/lib/uri.cjs"(exports) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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.helpers = exports.operators = exports.reduceSync = exports.reduceAsync = exports.reduce = exports.pipeSync = exports.pipeAsync = exports.opUnique = exports.opTap = exports.opTake = exports.opSkip = exports.opMap = exports.opLast = exports.opJoinStrings = exports.opFlatten = exports.opFirst = exports.opFilter = exports.opConcatMap = exports.opAwaitAsync = exports.opAppend = exports.toDistributableIterable = exports.toAsyncIterable = exports.toArray = exports.isAsyncIterable = exports.interleave = void 0; - var _helpers = __importStar(require_helpers()); - var _operators = __importStar(require_operators3()); - var index_js_1 = require_helpers(); - Object.defineProperty(exports, "interleave", { enumerable: true, get: function() { - return index_js_1.interleave; - } }); - Object.defineProperty(exports, "isAsyncIterable", { enumerable: true, get: function() { - return index_js_1.isAsyncIterable; - } }); - Object.defineProperty(exports, "toArray", { enumerable: true, get: function() { - return index_js_1.toArray; - } }); - Object.defineProperty(exports, "toAsyncIterable", { enumerable: true, get: function() { - return index_js_1.toAsyncIterable; - } }); - Object.defineProperty(exports, "toDistributableIterable", { enumerable: true, get: function() { - return index_js_1.toDistributableIterable; - } }); - var index_js_2 = require_operators3(); - Object.defineProperty(exports, "opAppend", { enumerable: true, get: function() { - return index_js_2.opAppend; - } }); - Object.defineProperty(exports, "opAwaitAsync", { enumerable: true, get: function() { - return index_js_2.opAwaitAsync; - } }); - Object.defineProperty(exports, "opConcatMap", { enumerable: true, get: function() { - return index_js_2.opConcatMap; - } }); - Object.defineProperty(exports, "opFilter", { enumerable: true, get: function() { - return index_js_2.opFilter; - } }); - Object.defineProperty(exports, "opFirst", { enumerable: true, get: function() { - return index_js_2.opFirst; - } }); - Object.defineProperty(exports, "opFlatten", { enumerable: true, get: function() { - return index_js_2.opFlatten; - } }); - Object.defineProperty(exports, "opJoinStrings", { enumerable: true, get: function() { - return index_js_2.opJoinStrings; - } }); - Object.defineProperty(exports, "opLast", { enumerable: true, get: function() { - return index_js_2.opLast; - } }); - Object.defineProperty(exports, "opMap", { enumerable: true, get: function() { - return index_js_2.opMap; - } }); - Object.defineProperty(exports, "opSkip", { enumerable: true, get: function() { - return index_js_2.opSkip; - } }); - Object.defineProperty(exports, "opTake", { enumerable: true, get: function() { - return index_js_2.opTake; - } }); - Object.defineProperty(exports, "opTap", { enumerable: true, get: function() { - return index_js_2.opTap; - } }); - Object.defineProperty(exports, "opUnique", { enumerable: true, get: function() { - return index_js_2.opUnique; - } }); - var pipe_js_1 = require_pipe(); - Object.defineProperty(exports, "pipeAsync", { enumerable: true, get: function() { - return pipe_js_1.pipeAsync; - } }); - Object.defineProperty(exports, "pipeSync", { enumerable: true, get: function() { - return pipe_js_1.pipeSync; - } }); - var reduce_js_1 = require_reduce2(); - Object.defineProperty(exports, "reduce", { enumerable: true, get: function() { - return reduce_js_1.reduce; - } }); - Object.defineProperty(exports, "reduceAsync", { enumerable: true, get: function() { - return reduce_js_1.reduceAsync; + exports.Utils = exports.URI = void 0; + var vscode_uri_1 = require_umd(); + Object.defineProperty(exports, "URI", { enumerable: true, get: function() { + return vscode_uri_1.URI; } }); - Object.defineProperty(exports, "reduceSync", { enumerable: true, get: function() { - return reduce_js_1.reduceSync; + Object.defineProperty(exports, "Utils", { enumerable: true, get: function() { + return vscode_uri_1.Utils; } }); - exports.operators = _operators; - exports.helpers = _helpers; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/convertToTrieRefNodes.js -var require_convertToTrieRefNodes = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/convertToTrieRefNodes.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.convertToTrieRefNodes = void 0; - var gensequence_1 = require_dist2(); - var TrieNode_js_1 = require_TrieNode(); - var MinReferenceCount = 3; - function convertToTrieRefNodes(root) { - const eow = { f: TrieNode_js_1.FLAG_WORD, c: void 0 }; - const tallies = /* @__PURE__ */ new Map([[eow, 0]]); - let count = 0; - const cached = /* @__PURE__ */ new Map(); - const rollupTally = /* @__PURE__ */ new Map(); - function tally(n) { - if (n.f && !n.c) { - tallies.set(eow, (tallies.get(eow) || 0) + 1); - return; - } - const t = tallies.get(n); - if (t) { - tallies.set(n, t + 1); - return; - } - tallies.set(n, 1); - for (const c of n.c?.values() || []) { - tally(c); - } +// node_modules/yocto-queue/index.js +var require_yocto_queue = __commonJS({ + "node_modules/yocto-queue/index.js"(exports, module2) { + var Node2 = class { + /// value; + /// next; + constructor(value) { + this.value = value; + this.next = void 0; } - function rollup(n) { - const c = rollupTally.get(n); - if (c) { - return c; - } - if (!n.c) { - const sum2 = tallies.get(eow) || 0; - rollupTally.set(n, sum2); - return sum2; - } - const sum = [...n.c.values()].reduce((acc, v) => acc + rollup(v), tallies.get(n) || 0); - rollupTally.set(n, sum); - return sum; + }; + var Queue2 = class { + // TODO: Use private class fields when targeting Node.js 12. + // #_head; + // #_tail; + // #_size; + constructor() { + this.clear(); } - function* walkByTallies(tallies2) { - const nodes = [...(0, gensequence_1.genSequence)(tallies2).filter((a) => a[1] >= MinReferenceCount)].sort((a, b) => b[1] - a[1]); - for (const [n] of nodes) { - yield* walkByRollup(n); + enqueue(value) { + const node = new Node2(value); + if (this._head) { + this._tail.next = node; + this._tail = node; + } else { + this._head = node; + this._tail = node; } + this._size++; } - function* walkByRollup(n) { - if (cached.has(n)) - return; - if (n.f && !n.c) { - cached.set(n, cached.get(eow)); + dequeue() { + const current = this._head; + if (!current) { return; } - const children = [...n.c?.values() || []].sort((a, b) => (rollupTally.get(b) || 0) - (rollupTally.get(a) || 0)); - for (const c of children) { - yield* walkByRollup(c); - } - cached.set(n, count++); - yield convert(n); + this._head = this._head.next; + this._size--; + return current.value; } - function convert(n) { - const { f, c } = n; - const r = c ? [...c].sort((a, b) => a[0] < b[0] ? -1 : 1).map(([s, n2]) => [s, cached.get(n2)]) : void 0; - const rn = r ? f ? { f, r } : { r } : { f }; - return rn; + clear() { + this._head = void 0; + this._tail = void 0; + this._size = 0; } - function* walk(root2) { - cached.set(eow, count++); - yield convert(eow); - yield* walkByTallies(tallies); - yield* walkByRollup(root2); + get size() { + return this._size; } - tally(root); - rollup(root); - return walk(root); - } - exports.convertToTrieRefNodes = convertToTrieRefNodes; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/io/importExportV1.js -var require_importExportV1 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/io/importExportV1.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.importTrie = exports.serializeTrie = exports.DATA = void 0; - var gensequence_1 = require_dist2(); - var convertToTrieRefNodes_js_1 = require_convertToTrieRefNodes(); - var trie_util_js_1 = require_trie_util(); - var TrieNode_js_1 = require_TrieNode(); - var EOW = "*"; - exports.DATA = EOW; - function toReferences(node) { - return (0, gensequence_1.genSequence)((0, convertToTrieRefNodes_js_1.convertToTrieRefNodes)(node)); - } - var regExpEscapeChars = /([[\]\\,:{}*])/g; - var regExTrailingComma = /,(\}|\n)/g; - function escapeChar(char) { - return char.replace(regExpEscapeChars, "\\$1"); - } - function trieToExportString(node, base) { - function* walk(node2) { - if (node2.f) { - yield EOW; - } - if (node2.r) { - const refs = [...node2.r].sort((a, b) => a[0] < b[0] ? -1 : 1); - for (const n of refs) { - const [c, r] = n; - const ref = r ? r.toString(base) : ""; - yield escapeChar(c) + ref + ","; - } + *[Symbol.iterator]() { + let current = this._head; + while (current) { + yield current.value; + current = current.next; } } - return (0, gensequence_1.genSequence)(walk(node)); - } - function generateHeader(base, comment) { - const header = ["#!/usr/bin/env cspell-trie reader", "TrieXv1", "base=" + base].concat(comment ? comment.split("\n").map((a) => "# " + a) : []).concat(["# Data:"]); - return (0, gensequence_1.genSequence)(header).map((a) => a + "\n"); - } - function serializeTrie(root, options = 16) { - options = typeof options === "number" ? { base: options } : options; - const { base = 16, comment = "" } = options; - const radix = base > 36 ? 36 : base < 10 ? 10 : base; - const rows = toReferences(root).map((node) => { - const row = [...trieToExportString(node, radix), "\n"].join("").replace(regExTrailingComma, "$1"); - return row; - }); - return generateHeader(radix, comment).concat(rows); - } - exports.serializeTrie = serializeTrie; - function* toIterableIterator(iter) { - yield* iter; - } - function importTrie(linesX) { - let radix = 16; - const comment = /^\s*#/; - const iter = toIterableIterator(linesX); - function parseHeaderRows(headerRows) { - const header = headerRows.slice(0, 2).join("\n"); - const headerReg = /^TrieXv1\nbase=(\d+)$/; - if (!headerReg.test(header)) - throw new Error("Unknown file format"); - radix = Number.parseInt(header.replace(headerReg, "$1"), 10); - } - function readHeader(iter2) { - const headerRows = []; - while (true) { - const next = iter2.next(); - if (next.done) { - break; - } - const line = next.value.trim(); - if (!line || comment.test(line)) { - continue; - } - if (line === exports.DATA) { - break; - } - headerRows.push(line); - } - parseHeaderRows(headerRows); - } - const regNotEscapedCommas = /(^|[^\\]),/g; - const regUnescapeCommas = /__COMMA__/g; - const regUnescape = /[\\](.)/g; - const flagsWord = { f: TrieNode_js_1.FLAG_WORD }; - function splitLine(line) { - const pattern = "$1__COMMA__"; - return line.replace(regNotEscapedCommas, pattern).split(regUnescapeCommas).map((a) => a.replace(regUnescape, "$1")); - } - function decodeLine(line, nodes) { - const isWord = line[0] === EOW; - line = isWord ? line.slice(1) : line; - const flags = isWord ? flagsWord : {}; - const children = splitLine(line).filter((a) => !!a).map((a) => [a[0], Number.parseInt(a.slice(1) || "0", radix)]).map(([k, i]) => [k, nodes[i]]); - const cNode = children.length ? { c: new TrieNode_js_1.ChildMap(children) } : {}; - return { ...cNode, ...flags }; - } - readHeader(iter); - const n = (0, gensequence_1.genSequence)([exports.DATA]).concat(iter).map((a) => a.replace(/\r?\n/, "")).filter((a) => !!a).reduce((acc, line) => { - const { lines, nodes } = acc; - const root = decodeLine(line, nodes); - nodes[lines] = root; - return { lines: lines + 1, root, nodes }; - }, { lines: 0, nodes: [], root: {} }); - return (0, trie_util_js_1.trieNodeToRoot)(n.root, {}); - } - exports.importTrie = importTrie; + }; + module2.exports = Queue2; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/io/importExportV2.js -var require_importExportV2 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/io/importExportV2.js"(exports) { +// node_modules/p-limit/index.js +var require_p_limit = __commonJS({ + "node_modules/p-limit/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.importTrie = exports.serializeTrie = exports.DATA = void 0; - var gensequence_1 = require_dist2(); - var trie_util_js_1 = require_trie_util(); - var TrieNode_js_1 = require_TrieNode(); - var EOW = "*"; - exports.DATA = "__DATA__"; - function leaves(node) { - function toRefNode(node2, k) { - const refNode = node2; - refNode.s = refNode.s ?? k; - return refNode; - } - function* walk(node2, k, p) { - const ref = toRefNode(node2, k); - if (!ref.c) { - yield { n: ref, p }; - } else { - for (const n of ref.c) { - yield* walk(n[1], n[0], ref); - } - } + var Queue2 = require_yocto_queue(); + var pLimit2 = (concurrency) => { + if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { + throw new TypeError("Expected `concurrency` to be a number from 1 and up"); } - return (0, gensequence_1.genSequence)(walk(node, "")); - } - function flattenToReferences(node) { - function* walk() { - let iterations = 100; - let processed = 0; - let index = 0; - do { - processed = 0; - const signatureMap = /* @__PURE__ */ new Map(); - for (const leaf of leaves(node)) { - const h = signature(leaf.n); - let m = signatureMap.get(h); - if (m === void 0) { - yield leaf.n; - m = index; - signatureMap.set(h, m); - index += 1; - } - if (leaf.p && leaf.p.c) { - leaf.p.r = leaf.p.r || []; - leaf.p.r.push(m); - leaf.p.c.delete(leaf.n.s); - if (!leaf.p.c.size) { - delete leaf.p.c; - } - } - processed += 1; - } - iterations -= 1; - } while (processed && iterations && node.c); - yield node; - } - return (0, gensequence_1.genSequence)(walk()); - } - function signature(node) { - const flags = node.f ? EOW : ""; - const refs = node.r ? node.r.sort((a, b) => a - b).join(",") : ""; - return node.s + flags + refs; - } - function toLine(node, base) { - const flags = node.f ? EOW : ""; - const refs = node.r ? node.r.sort((a, b) => a - b).map((r) => r.toString(base)).join(",") : ""; - return node.s + flags + refs; - } - function generateHeader(base, comment) { - const header = ["#!/usr/bin/env cspell-trie reader", "TrieXv2", "base=" + base].concat(comment ? comment.split("\n").map((a) => "# " + a) : []).concat(["# Data:", exports.DATA]); - return (0, gensequence_1.genSequence)(header); - } - function serializeTrie(root, options = 16) { - options = typeof options === "number" ? { base: options } : options; - const { base = 16, comment = "" } = options; - const radix = base > 36 ? 36 : base < 10 ? 10 : base; - const rootRef = { ...root, s: "^" }; - const rows = flattenToReferences(rootRef).map((n) => toLine(n, base)); - return generateHeader(radix, comment).concat(rows).map((a) => a + "\n"); - } - exports.serializeTrie = serializeTrie; - function* toIterableIterator(iter) { - yield* iter; - } - function importTrie(linesX) { - let radix = 16; - const comment = /^\s*#/; - const iter = toIterableIterator(linesX); - function parseHeaderRows(headerRows) { - const header = headerRows.slice(0, 2).join("\n"); - const headerReg = /^TrieXv2\nbase=(\d+)$/; - if (!headerReg.test(header)) - throw new Error("Unknown file format"); - radix = Number.parseInt(header.replace(headerReg, "$1"), 10); - } - function readHeader(iter2) { - const headerRows = []; - while (true) { - const next = iter2.next(); - if (next.done) { - break; - } - const line = next.value.trim(); - if (!line || comment.test(line)) { - continue; + const queue = new Queue2(); + let activeCount = 0; + const next = () => { + activeCount--; + if (queue.size > 0) { + queue.dequeue()(); + } + }; + const run2 = async (fn, resolve13, ...args) => { + activeCount++; + const result = (async () => fn(...args))(); + resolve13(result); + try { + await result; + } catch { + } + next(); + }; + const enqueue = (fn, resolve13, ...args) => { + queue.enqueue(run2.bind(null, fn, resolve13, ...args)); + (async () => { + await Promise.resolve(); + if (activeCount < concurrency && queue.size > 0) { + queue.dequeue()(); } - if (line === exports.DATA) { - break; + })(); + }; + const generator = (fn, ...args) => new Promise((resolve13) => { + enqueue(fn, resolve13, ...args); + }); + Object.defineProperties(generator, { + activeCount: { + get: () => activeCount + }, + pendingCount: { + get: () => queue.size + }, + clearQueue: { + value: () => { + queue.clear(); } - headerRows.push(line); } - parseHeaderRows(headerRows); - } - function parseLine(line, base) { - const isWord = line[1] === EOW; - const refOffset = isWord ? 2 : 1; - const refs = line.slice(refOffset).split(",").filter((a) => !!a).map((r) => parseInt(r, base)); - return { - letter: line[0], - isWord, - refs - }; - } - const flagsWord = { f: TrieNode_js_1.FLAG_WORD }; - function decodeLine(line, nodes) { - const { letter, isWord, refs } = parseLine(line, radix); - const flags = isWord ? flagsWord : {}; - const children = refs.map((r) => nodes[r]).sort((a, b) => a.s < b.s ? -1 : 1).map((n2) => [n2.s, n2]); - const cNode = children.length ? { c: new TrieNode_js_1.ChildMap(children) } : {}; - return { s: letter, ...cNode, ...flags }; - } - readHeader(iter); - const n = (0, gensequence_1.genSequence)(iter).map((a) => a.replace(/\r?\n/, "")).filter((a) => !!a).reduce((acc, line) => { - const { nodes } = acc; - const root = decodeLine(line, nodes); - nodes.push(root); - return { root, nodes }; - }, { nodes: [], root: { s: "", c: /* @__PURE__ */ new Map() } }); - return (0, trie_util_js_1.trieNodeToRoot)(n.root, {}); - } - exports.importTrie = importTrie; + }); + return generator; + }; + module2.exports = pLimit2; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/bufferLines.js -var require_bufferLines = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/bufferLines.js"(exports) { +// node_modules/p-locate/index.js +var require_p_locate = __commonJS({ + "node_modules/p-locate/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.bufferLines = exports.buffer = void 0; - function* buffer(iter, bufferSize) { - const buffer2 = []; - for (const s of iter) { - buffer2.push(s); - if (buffer2.length >= bufferSize) { - yield buffer2; - buffer2.length = 0; - } + var pLimit2 = require_p_limit(); + var EndError2 = class extends Error { + constructor(value) { + super(); + this.value = value; } - if (buffer2.length) { - yield buffer2; - buffer2.length = 0; + }; + var testElement2 = async (element, tester) => tester(await element); + var finder2 = async (element) => { + const values = await Promise.all(element); + if (values[1] === true) { + throw new EndError2(values[0]); } - } - exports.buffer = buffer; - function* bufferLines(iter, bufferSize, eol) { - if (eol) { - for (const s of buffer(iter, bufferSize)) { - yield s.join("") + eol; - } - } else { - for (const s of buffer(iter, bufferSize)) { - yield s.join(""); + return false; + }; + var pLocate2 = async (iterable, tester, options) => { + options = { + concurrency: Infinity, + preserveOrder: true, + ...options + }; + const limit = pLimit2(options.concurrency); + const items = [...iterable].map((element) => [element, limit(testElement2, element, tester)]); + const checkLimit = pLimit2(options.preserveOrder ? 1 : Infinity); + try { + await Promise.all(items.map((element) => checkLimit(finder2, element))); + } catch (error2) { + if (error2 instanceof EndError2) { + return error2.value; } + throw error2; } - } - exports.bufferLines = bufferLines; + }; + module2.exports = pLocate2; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/io/importExportV3.js -var require_importExportV3 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/io/importExportV3.js"(exports) { +// node_modules/locate-path/index.js +var require_locate_path = __commonJS({ + "node_modules/locate-path/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.importTrie = exports.serializeTrie = exports.DATA = void 0; - var gensequence_1 = require_dist2(); - var trie_util_js_1 = require_trie_util(); - var TrieNode_js_1 = require_TrieNode(); - var bufferLines_js_1 = require_bufferLines(); - var EOW = "$"; - var BACK = "<"; - var EOL = "\n"; - var LF = "\r"; - var REF = "#"; - var EOR = ";"; - var ESCAPE = "\\"; - var specialCharacters = new Set([EOW, BACK, EOL, REF, EOR, ESCAPE, LF].concat("0123456789".split("")).concat("`~!@#$%^&*()_-+=[]{};:'\"<>,./?\\|".split(""))); - var specialCharacterMap = /* @__PURE__ */ new Map([ - ["\n", "\\n"], - ["\r", "\\r"], - ["\\", "\\\\"] - ]); - var characterMap = new Map([...specialCharacterMap].map((a) => [a[1], a[0]])); - var specialPrefix = stringToCharSet("~!"); - var WORDS_PER_LINE = 20; - exports.DATA = "__DATA__"; - function generateHeader(base, comment) { - const header = ["#!/usr/bin/env cspell-trie reader", "TrieXv3", "base=" + base].concat(comment ? comment.split("\n").map((a) => "# " + a) : []).concat(["# Data:", exports.DATA]); - return (0, gensequence_1.genSequence)(header).map((a) => a + "\n"); - } - function serializeTrie(root, options = 16) { - options = typeof options === "number" ? { base: options, addLineBreaksToImproveDiffs: false } : options; - const { base = 16, comment = "", addLineBreaksToImproveDiffs: addBreaks = true } = options; - const radix = base > 36 ? 36 : base < 10 ? 10 : base; - const cache = /* @__PURE__ */ new Map(); - const cacheShouldRef = /* @__PURE__ */ new Map(); - let count = 0; - const backBuffer = { last: "", count: 0, words: 0, eol: false }; - const optimizeSimpleReferences = options.optimizeSimpleReferences ?? false; - const wordChars = []; - function ref(n) { - return "#" + n.toString(radix) + ";"; - } - function escape(s) { - return specialCharacters.has(s) ? ESCAPE + (specialCharacterMap.get(s) || s) : s; - } - function* flush() { - while (backBuffer.count) { - const n = Math.min(9, backBuffer.count); - yield n > 1 ? backBuffer.last + n : backBuffer.last; - backBuffer.last = BACK; - backBuffer.count -= n; - } - if (backBuffer.eol) { - yield EOL; - backBuffer.eol = false; - backBuffer.words = 0; - } - } - function* emit(s) { - switch (s) { - case EOW: - yield* flush(); - backBuffer.last = EOW; - backBuffer.count = 0; - backBuffer.words++; - break; - case BACK: - backBuffer.count++; - break; - case EOL: - backBuffer.eol = true; - break; - default: - if (backBuffer.words >= WORDS_PER_LINE) { - backBuffer.eol = true; - } - yield* flush(); - if (s.startsWith(REF)) { - backBuffer.words++; - } - yield s; - } - } - function* walk(node, depth) { - const r = cache.get(node); - if (r !== void 0 && (!optimizeSimpleReferences || !shouldSimpleRef(node))) { - yield* emit(ref(r)); - return; - } - if (node.c) { - if (addBreaks && depth > 0 && depth <= 2) { - yield* emit(EOL); - } - cache.set(node, count++); - const c = [...node.c].sort((a, b) => a[0] < b[0] ? -1 : 1); - for (const [s, n] of c) { - wordChars[depth] = s; - yield* emit(escape(s)); - yield* walk(n, depth + 1); - yield* emit(BACK); - if (depth === 0) - yield* emit(EOL); - } - } - if (node.f) { - yield* emit(EOW); - } - if (addBreaks && (depth === 2 || depth === 3 && wordChars[0] in specialPrefix)) { - yield* emit(EOL); - } - } - function* serialize(node) { - yield* walk(node, 0); - yield* flush(); + var path26 = require("path"); + var fs9 = require("fs"); + var { promisify: promisify4 } = require("util"); + var pLocate2 = require_p_locate(); + var fsStat = promisify4(fs9.stat); + var fsLStat = promisify4(fs9.lstat); + var typeMappings2 = { + directory: "isDirectory", + file: "isFile" + }; + function checkType2({ type }) { + if (type in typeMappings2) { + return; } - function _calcShouldSimpleRef(node) { - if (node.c?.size !== 1) + throw new Error(`Invalid type specified: ${type}`); + } + var matchType2 = (type, stat2) => type === void 0 || stat2[typeMappings2[type]](); + module2.exports = async (paths, options) => { + options = { + cwd: process.cwd(), + type: "file", + allowSymlinks: true, + ...options + }; + checkType2(options); + const statFn = options.allowSymlinks ? fsStat : fsLStat; + return pLocate2(paths, async (path_) => { + try { + const stat2 = await statFn(path26.resolve(options.cwd, path_)); + return matchType2(options.type, stat2); + } catch { return false; - const [n] = [...node.c.values()]; - return !!n.f && (n.c === void 0 || n.c.size === 0); - } - function shouldSimpleRef(node) { - const r = cacheShouldRef.get(node); - if (r !== void 0) - return r; - const rr = _calcShouldSimpleRef(node); - cacheShouldRef.set(node, rr); - return rr; - } - return generateHeader(radix, comment).concat((0, bufferLines_js_1.bufferLines)(serialize(root), 1200, "")); - } - exports.serializeTrie = serializeTrie; - function* toIterableIterator(iter) { - yield* iter; - } - function importTrie(linesX) { - linesX = typeof linesX === "string" ? linesX.split(/^/m) : linesX; - const root = (0, trie_util_js_1.trieNodeToRoot)({}, {}); - let radix = 16; - const comment = /^\s*#/; - const iter = toIterableIterator(linesX); - function parseHeaderRows(headerRows) { - const header = headerRows.slice(0, 2).join("\n"); - const headerReg = /^TrieXv3\nbase=(\d+)$/; - if (!headerReg.test(header)) - throw new Error("Unknown file format"); - radix = Number.parseInt(header.replace(headerReg, "$1"), 10); - } - function readHeader(iter2) { - const headerRows = []; - while (true) { - const next = iter2.next(); - if (next.done) { - break; - } - const line = next.value.trim().replace(/\r|\n/g, ""); - if (!line || comment.test(line)) { - continue; - } - if (line === exports.DATA) { - break; - } - headerRows.push(line); } - parseHeaderRows(headerRows); - } - readHeader(iter); - const n = (0, gensequence_1.genSequence)(iter).concatMap((a) => a.split("")).reduce(parseStream(radix), { - nodes: [root], - root, - stack: [{ node: root, s: "" }], - parser: void 0 - }); - return n.root; - } - exports.importTrie = importTrie; - function parseStream(radix) { - const eow = Object.freeze({ f: 1 }); - function parseReference(acc, _) { - let ref = ""; - function parser(acc2, s) { - if (s === EOR) { - const { root, nodes: nodes2, stack } = acc2; - const r = parseInt(ref, radix); - const top = stack[stack.length - 1]; - const p = stack[stack.length - 2].node; - p.c?.set(top.s, nodes2[r]); - return { root, nodes: nodes2, stack, parser: void 0 }; - } - ref = ref + s; - return acc2; - } - const { nodes } = acc; - nodes.pop(); - return { ...acc, nodes, parser }; - } - function parseEscapeCharacter(acc, _) { - let prev = ""; - const parser = function(acc2, s) { - if (prev) { - s = characterMap.get(prev + s) || s; - return parseCharacter({ ...acc2, parser: void 0 }, s); - } - if (s === ESCAPE) { - prev = s; - return acc2; + }, options); + }; + module2.exports.sync = (paths, options) => { + options = { + cwd: process.cwd(), + allowSymlinks: true, + type: "file", + ...options + }; + checkType2(options); + const statFn = options.allowSymlinks ? fs9.statSync : fs9.lstatSync; + for (const path_ of paths) { + try { + const stat2 = statFn(path26.resolve(options.cwd, path_)); + if (matchType2(options.type, stat2)) { + return path_; } - return parseCharacter({ ...acc2, parser: void 0 }, s); - }; - return { ...acc, parser }; - } - function parseCharacter(acc, s) { - const parser = void 0; - const { root, nodes, stack } = acc; - const top = stack[stack.length - 1]; - const node = top.node; - node.c = node.c ?? /* @__PURE__ */ new Map(); - const n = { f: void 0, c: void 0, n: nodes.length }; - node.c.set(s, n); - stack.push({ node: n, s }); - nodes.push(n); - return { root, nodes, stack, parser }; - } - function parseEOW(acc, _) { - const parser = parseBack; - const { root, nodes, stack } = acc; - const top = stack[stack.length - 1]; - const node = top.node; - node.f = TrieNode_js_1.FLAG_WORD; - if (!node.c) { - top.node = eow; - const p = stack[stack.length - 2].node; - p.c?.set(top.s, eow); - nodes.pop(); - } - stack.pop(); - return { root, nodes, stack, parser }; - } - const charactersBack = new Set((BACK + "23456789").split("")); - function parseBack(acc, s) { - if (!charactersBack.has(s)) { - return parserMain({ ...acc, parser: void 0 }, s); - } - let n = s === BACK ? 1 : parseInt(s, 10) - 1; - const { stack } = acc; - while (n-- > 0) { - stack.pop(); + } catch { } - return { ...acc, parser: parseBack }; - } - function parseIgnore(acc, _) { - return acc; - } - const parsers = /* @__PURE__ */ new Map([ - [EOW, parseEOW], - [BACK, parseBack], - [REF, parseReference], - [ESCAPE, parseEscapeCharacter], - [EOL, parseIgnore], - [LF, parseIgnore] - ]); - function parserMain(acc, s) { - const parser = acc.parser ?? parsers.get(s) ?? parseCharacter; - return parser(acc, s); - } - return parserMain; - } - function stringToCharSet(values) { - const set = /* @__PURE__ */ Object.create(null); - const len = values.length; - for (let i = 0; i < len; ++i) { - set[values[i]] = true; } - return set; - } + }; } }); -// node_modules/@cspell/cspell-pipe/dist/cjs/sync/index.js -var require_sync = __commonJS({ - "node_modules/@cspell/cspell-pipe/dist/cjs/sync/index.js"(exports) { +// node_modules/path-exists/index.js +var require_path_exists = __commonJS({ + "node_modules/path-exists/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.reduce = exports.pipeSync = exports.pipe = exports.opUnique = exports.opTap = exports.opTake = exports.opSkip = exports.opReduce = exports.opMap = exports.opLast = exports.opJoinStrings = exports.opFlatten = exports.opFirst = exports.opFilter = exports.opConcatMap = exports.opCombine = exports.opAppend = exports.toArray = void 0; - var toArray_js_1 = require_toArray(); - Object.defineProperty(exports, "toArray", { enumerable: true, get: function() { - return toArray_js_1.toArraySync; - } }); - var index_js_1 = require_operators3(); - Object.defineProperty(exports, "opAppend", { enumerable: true, get: function() { - return index_js_1.opAppendSync; - } }); - Object.defineProperty(exports, "opCombine", { enumerable: true, get: function() { - return index_js_1.opCombineSync; - } }); - Object.defineProperty(exports, "opConcatMap", { enumerable: true, get: function() { - return index_js_1.opConcatMapSync; - } }); - Object.defineProperty(exports, "opFilter", { enumerable: true, get: function() { - return index_js_1.opFilterSync; - } }); - Object.defineProperty(exports, "opFirst", { enumerable: true, get: function() { - return index_js_1.opFirstSync; - } }); - Object.defineProperty(exports, "opFlatten", { enumerable: true, get: function() { - return index_js_1.opFlattenSync; - } }); - Object.defineProperty(exports, "opJoinStrings", { enumerable: true, get: function() { - return index_js_1.opJoinStringsSync; - } }); - Object.defineProperty(exports, "opLast", { enumerable: true, get: function() { - return index_js_1.opLastSync; - } }); - Object.defineProperty(exports, "opMap", { enumerable: true, get: function() { - return index_js_1.opMapSync; - } }); - Object.defineProperty(exports, "opReduce", { enumerable: true, get: function() { - return index_js_1.opReduceSync; - } }); - Object.defineProperty(exports, "opSkip", { enumerable: true, get: function() { - return index_js_1.opSkipSync; - } }); - Object.defineProperty(exports, "opTake", { enumerable: true, get: function() { - return index_js_1.opTakeSync; - } }); - Object.defineProperty(exports, "opTap", { enumerable: true, get: function() { - return index_js_1.opTapSync; - } }); - Object.defineProperty(exports, "opUnique", { enumerable: true, get: function() { - return index_js_1.opUniqueSync; - } }); - var pipe_js_1 = require_pipe(); - Object.defineProperty(exports, "pipe", { enumerable: true, get: function() { - return pipe_js_1.pipeSync; - } }); - Object.defineProperty(exports, "pipeSync", { enumerable: true, get: function() { - return pipe_js_1.pipeSync; - } }); - var reduce_js_1 = require_reduce2(); - Object.defineProperty(exports, "reduce", { enumerable: true, get: function() { - return reduce_js_1.reduceSync; - } }); + var fs9 = require("fs"); + var { promisify: promisify4 } = require("util"); + var pAccess = promisify4(fs9.access); + module2.exports = async (path26) => { + try { + await pAccess(path26); + return true; + } catch (_) { + return false; + } + }; + module2.exports.sync = (path26) => { + try { + fs9.accessSync(path26); + return true; + } catch (_) { + return false; + } + }; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/io/importExportV4.js -var require_importExportV4 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/io/importExportV4.js"(exports) { +// node_modules/find-up/index.js +var require_find_up = __commonJS({ + "node_modules/find-up/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.importTrie = exports.serializeTrie = exports.DATA = void 0; - var sync_1 = require_sync(); - var gensequence_1 = require_dist2(); - var trie_util_js_1 = require_trie_util(); - var TrieNode_js_1 = require_TrieNode(); - var bufferLines_js_1 = require_bufferLines(); - var EOW = "$"; - var BACK = "<"; - var EOL = "\n"; - var LF = "\r"; - var REF = "#"; - var REF_REL = "@"; - var EOR = ";"; - var ESCAPE = "\\"; - var REF_INDEX_BEGIN = "["; - var REF_INDEX_END = "]"; - var INLINE_DATA_COMMENT_LINE = "/"; - var specialCharacters = stringToCharSet([EOW, BACK, EOL, REF, REF_REL, EOR, ESCAPE, LF, REF_INDEX_BEGIN, REF_INDEX_END, INLINE_DATA_COMMENT_LINE].concat("0123456789".split("")).concat("`~!@#$%^&*()_-+=[]{};:'\"<>,./?\\|".split("")).join("")); - var SPECIAL_CHARACTERS_MAP = [ - ["\n", "\\n"], - ["\r", "\\r"], - ["\\", "\\\\"] - ]; - var specialCharacterMap = stringToCharMap(SPECIAL_CHARACTERS_MAP); - var characterMap = stringToCharMap(SPECIAL_CHARACTERS_MAP.map((a) => [a[1], a[0]])); - var specialPrefix = stringToCharSet("~!"); - var WORDS_PER_LINE = 20; - exports.DATA = "__DATA__"; - function generateHeader(base, comment) { - const comments = comment.split("\n").map((a) => "# " + a.trimEnd()).join("\n"); - return `#!/usr/bin/env cspell-trie reader -TrieXv4 -base=${base} -${comments} -# Data: -${exports.DATA} -`; - } - function serializeTrie(root, options = 16) { - options = typeof options === "number" ? { base: options } : options; - const { base = 10, comment = "" } = options; - const radix = base > 36 ? 36 : base < 10 ? 10 : base; - const cache = /* @__PURE__ */ new Map(); - const refMap = buildReferenceMap(root, base); - const nodeToIndexMap = new Map(refMap.refCounts.map(([node], index) => [node, index])); - let count = 0; - const backBuffer = { last: "", count: 0, words: 0, eol: false }; - const wordChars = []; - function ref(n, idx) { - const r = idx === void 0 || n < idx ? REF + n.toString(radix) : REF_REL + idx.toString(radix); - return radix === 10 ? r : r + ";"; - } - function escape(s) { - return s in specialCharacters ? ESCAPE + (specialCharacterMap[s] || s) : s; - } - function* flush() { - while (backBuffer.count) { - const n = Math.min(9, backBuffer.count); - yield n > 1 ? backBuffer.last + n : backBuffer.last; - backBuffer.last = BACK; - backBuffer.count -= n; - } - if (backBuffer.eol) { - yield EOL; - backBuffer.eol = false; - backBuffer.words = 0; - } - } - function* emit(s) { - switch (s) { - case EOW: - yield* flush(); - backBuffer.last = EOW; - backBuffer.count = 0; - backBuffer.words++; - break; - case BACK: - backBuffer.count++; - break; - case EOL: - backBuffer.eol = true; - break; - default: - if (backBuffer.words >= WORDS_PER_LINE) { - backBuffer.eol = true; - } - yield* flush(); - if (s.startsWith(REF) || s.startsWith(REF_REL)) { - backBuffer.words++; - } - yield s; - } - } - const comment_begin = `${EOL}${INLINE_DATA_COMMENT_LINE}* `; - const comment_end = ` *${INLINE_DATA_COMMENT_LINE}${EOL}`; - function* walk(node, depth) { - const nodeNumber = cache.get(node); - const refIndex = nodeToIndexMap.get(node); - if (nodeNumber !== void 0) { - yield* emit(ref(nodeNumber, refIndex)); - return; - } - if (node.c) { - if (depth > 0 && depth <= 2) { - const chars = wordChars.slice(0, depth).map(escape).join(""); - yield* emit(comment_begin + chars + comment_end); - } - cache.set(node, count++); - const c = [...node.c].sort((a, b) => a[0] < b[0] ? -1 : 1); - for (const [s, n] of c) { - wordChars[depth] = s; - yield* emit(escape(s)); - yield* walk(n, depth + 1); - yield* emit(BACK); - if (depth === 0) - yield* emit(EOL); - } - } - if (node.f) { - yield* emit(EOW); + var path26 = require("path"); + var locatePath2 = require_locate_path(); + var pathExists2 = require_path_exists(); + var stop = Symbol("findUp.stop"); + module2.exports = async (name, options = {}) => { + let directory = path26.resolve(options.cwd || ""); + const { root } = path26.parse(directory); + const paths = [].concat(name); + const runMatcher = async (locateOptions) => { + if (typeof name !== "function") { + return locatePath2(paths, locateOptions); } - if (depth === 2 || depth === 3 && wordChars[0] in specialPrefix) { - yield* emit(EOL); + const foundPath = await name(locateOptions.cwd); + if (typeof foundPath === "string") { + return locatePath2([foundPath], locateOptions); } - } - function* serialize(node) { - yield* walk(node, 0); - yield* flush(); - } - const lines = [...(0, bufferLines_js_1.bufferLines)(serialize(root), 1e3, "")]; - const resolvedReferences = refMap.refCounts.map(([node]) => cache.get(node) || 0); - const reference = "[\n" + resolvedReferences.map((n) => n.toString(radix)).join(",").replace(/.{110,130}[,]/g, "$&\n") + "\n]\n"; - return (0, gensequence_1.genSequence)([generateHeader(radix, comment), reference]).concat(lines); - } - exports.serializeTrie = serializeTrie; - function buildReferenceMap(root, base) { - const refCount = /* @__PURE__ */ new Map(); - let nodeCount = 0; - function walk(node) { - const ref = refCount.get(node); - if (ref) { - ref.c++; + return foundPath; + }; + while (true) { + const foundPath = await runMatcher({ ...options, cwd: directory }); + if (foundPath === stop) { return; } - refCount.set(node, { c: 1, n: nodeCount++ }); - if (!node.c) + if (foundPath) { + return path26.resolve(directory, foundPath); + } + if (directory === root) { return; - for (const child of node.c.values()) { - walk(child); - } - } - walk(root); - const refCountAndNode = [ - ...(0, sync_1.pipe)(refCount, (0, sync_1.opFilter)(([_, ref]) => ref.c >= 2)) - ].sort((a, b) => b[1].c - a[1].c || a[1].n - b[1].n); - let adj = 0; - const baseLogScale = 1 / Math.log(base); - const refs = refCountAndNode.filter(([_, ref], idx) => { - const i = idx - adj; - const charsIdx = Math.ceil(Math.log(i) * baseLogScale); - const charsNode = Math.ceil(Math.log(ref.n) * baseLogScale); - const savings = ref.c * (charsNode - charsIdx) - charsIdx; - const keep = savings > 0; - adj += keep ? 0 : 1; - return keep; - }).map(([n, ref]) => [n, ref.c]); - return { refCounts: refs }; - } - function importTrie(linesX) { - linesX = typeof linesX === "string" ? linesX.split(/^/m) : linesX; - let radix = 10; - const comment = /^\s*#/; - const iter = tapIterable((0, sync_1.pipe)(linesX, (0, sync_1.opConcatMap)((a) => a.split(/^/m)))); - function parseHeaderRows(headerRows) { - const header = headerRows.slice(0, 2).join("\n"); - const headerReg = /^TrieXv[34]\nbase=(\d+)$/; - if (!headerReg.test(header)) - throw new Error("Unknown file format"); - radix = Number.parseInt(header.replace(headerReg, "$1"), 10); - } - function readHeader(iter2) { - const headerRows = []; - for (const value of iter2) { - const line = value.trim(); - if (!line || comment.test(line)) - continue; - if (line === exports.DATA) - break; - headerRows.push(line); - } - parseHeaderRows(headerRows); - } - readHeader(iter); - const root = parseStream(radix, iter); - return root; - } - exports.importTrie = importTrie; - var numbersSet = stringToCharSet("0123456789"); - function parseStream(radix, iter) { - const eow = Object.freeze({ f: 1 }); - let refIndex = []; - const root = (0, trie_util_js_1.trieNodeToRoot)({}, {}); - function parseReference(acc, s) { - const isIndexRef = s === REF_REL; - let ref = ""; - function parser(acc2, s2) { - if (s2 === EOR || radix === 10 && !(s2 in numbersSet)) { - const { root: root2, nodes: nodes2, stack } = acc2; - const r = parseInt(ref, radix); - const top = stack[stack.length - 1]; - const p = stack[stack.length - 2].node; - const n = isIndexRef ? refIndex[r] : r; - p.c?.set(top.s, nodes2[n]); - const rr = { root: root2, nodes: nodes2, stack, parser: void 0 }; - return s2 === EOR ? rr : parserMain(rr, s2); - } - ref = ref + s2; - return acc2; - } - const { nodes } = acc; - nodes.pop(); - return { ...acc, nodes, parser }; - } - function parseEscapeCharacter(acc, _) { - let prev = ""; - const parser = function(acc2, s) { - if (prev) { - s = characterMap[prev + s] || s; - return parseCharacter({ ...acc2, parser: void 0 }, s); - } - if (s === ESCAPE) { - prev = s; - return acc2; - } - return parseCharacter({ ...acc2, parser: void 0 }, s); - }; - return { ...acc, parser }; - } - function parseComment(acc, s) { - const endOfComment = s; - let isEscaped = false; - function parser(acc2, s2) { - if (isEscaped) { - isEscaped = false; - return acc2; - } - if (s2 === ESCAPE) { - isEscaped = true; - return acc2; - } - if (s2 === endOfComment) { - return { ...acc2, parser: void 0 }; - } - return acc2; } - return { ...acc, parser }; + directory = path26.dirname(directory); } - function parseCharacter(acc, s) { - const parser = void 0; - const { root: root2, nodes, stack } = acc; - const top = stack[stack.length - 1]; - const node = top.node; - node.c = node.c ?? /* @__PURE__ */ new Map(); - const n = { f: void 0, c: void 0, n: nodes.length }; - node.c.set(s, n); - stack.push({ node: n, s }); - nodes.push(n); - return { root: root2, nodes, stack, parser }; - } - function parseEOW(acc, _) { - const parser = parseBack; - const { root: root2, nodes, stack } = acc; - const top = stack[stack.length - 1]; - const node = top.node; - node.f = TrieNode_js_1.FLAG_WORD; - if (!node.c) { - top.node = eow; - const p = stack[stack.length - 2].node; - p.c?.set(top.s, eow); - nodes.pop(); + }; + module2.exports.sync = (name, options = {}) => { + let directory = path26.resolve(options.cwd || ""); + const { root } = path26.parse(directory); + const paths = [].concat(name); + const runMatcher = (locateOptions) => { + if (typeof name !== "function") { + return locatePath2.sync(paths, locateOptions); } - stack.pop(); - return { root: root2, nodes, stack, parser }; - } - const charactersBack = stringToCharSet(BACK + "23456789"); - function parseBack(acc, s) { - if (!(s in charactersBack)) { - return parserMain({ ...acc, parser: void 0 }, s); - } - let n = s === BACK ? 1 : parseInt(s, 10) - 1; - const { stack } = acc; - while (n-- > 0) { - stack.pop(); - } - return { ...acc, parser: parseBack }; - } - function parseIgnore(acc, _) { - return acc; - } - const parsers = createStringLookupMap([ - [EOW, parseEOW], - [BACK, parseBack], - [REF, parseReference], - [REF_REL, parseReference], - [ESCAPE, parseEscapeCharacter], - [EOL, parseIgnore], - [LF, parseIgnore], - [INLINE_DATA_COMMENT_LINE, parseComment] - ]); - function parserMain(acc, s) { - const parser = acc.parser ?? parsers[s] ?? parseCharacter; - return parser(acc, s); - } - const charsetSpaces = stringToCharSet(" \r\n "); - function parseReferenceIndex(acc, s) { - let json = ""; - function parserStart(acc2, s2) { - if (s2 === REF_INDEX_BEGIN) { - json = json + s2; - return { ...acc2, parser }; - } - if (s2 in charsetSpaces) { - return acc2; - } - return parserMain({ ...acc2, parser: void 0 }, s2); + const foundPath = name(locateOptions.cwd); + if (typeof foundPath === "string") { + return locatePath2.sync([foundPath], locateOptions); } - function parser(acc2, s2) { - json = json + s2; - if (s2 === REF_INDEX_END) { - refIndex = json.replace(/[\s[\]]/g, "").split(",").map((n) => parseInt(n, radix)); - return { ...acc2, parser: void 0 }; - } - return acc2; + return foundPath; + }; + while (true) { + const foundPath = runMatcher({ ...options, cwd: directory }); + if (foundPath === stop) { + return; } - return parserStart({ ...acc, parser: parserStart }, s); - } - (0, gensequence_1.genSequence)(iter).concatMap((a) => a.split("")).reduce(parserMain, { - nodes: [root], - root, - stack: [{ node: root, s: "" }], - parser: parseReferenceIndex - }); - return root; - } - function stringToCharSet(values) { - const set = /* @__PURE__ */ Object.create(null); - const len = values.length; - for (let i = 0; i < len; ++i) { - set[values[i]] = true; - } - return set; - } - function stringToCharMap(values) { - return createStringLookupMap(values); - } - function createStringLookupMap(values) { - const map = /* @__PURE__ */ Object.create(null); - const len = values.length; - for (let i = 0; i < len; ++i) { - map[values[i][0]] = values[i][1]; - } - return map; - } - function tapIterable(iterable) { - let lastValue; - let iter; - function getNext() { - if (lastValue && lastValue.done) { - return { ...lastValue }; + if (foundPath) { + return path26.resolve(directory, foundPath); } - iter = iter || iterable[Symbol.iterator](); - lastValue = iter.next(); - return lastValue; - } - function* iterableFn() { - let next; - while (!(next = getNext()).done) { - yield next.value; + if (directory === root) { + return; } + directory = path26.dirname(directory); } - return { - [Symbol.iterator]: iterableFn - }; - } - exports.__testing__ = { - buildReferenceMap }; + module2.exports.exists = pathExists2; + module2.exports.sync.exists = pathExists2.sync; + module2.exports.stop = stop; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/io/importExport.js -var require_importExport = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/io/importExport.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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.importTrie = exports.serializeTrie = void 0; - var cspell_pipe_1 = require_cjs4(); - var gensequence_1 = require_dist2(); - var iv1 = __importStar(require_importExportV1()); - var iv2 = __importStar(require_importExportV2()); - var iv3 = __importStar(require_importExportV3()); - var iv4 = __importStar(require_importExportV4()); - var serializers = [ - iv1.serializeTrie, - iv1.serializeTrie, - iv2.serializeTrie, - iv3.serializeTrie, - iv4.serializeTrie - ]; - var deserializers = [iv1.importTrie, iv1.importTrie, iv2.importTrie, iv3.importTrie, iv4.importTrie]; - var DEFAULT_VERSION = 3; - function serializeTrie(root, options = 16) { - const version3 = typeof options !== "number" && options.version ? options.version : DEFAULT_VERSION; - const method = serializers[version3]; - if (!method) { - throw new Error(`Unknown version: ${version3}`); - } - return method(root, options); - } - exports.serializeTrie = serializeTrie; - function importTrie(lines) { - function parseHeaderRows(headerRows) { - const header = headerRows.join("\n"); - const headerReg = /^\s*TrieXv(\d+)/m; - const match = header.match(headerReg); - if (!match) - throw new Error("Unknown file format"); - return parseInt(match[1], 10); - } - function readHeader(iter) { - const headerRows = []; - for (const entry of iter) { - const line = entry.trim(); - headerRows.push(line); - if (line === iv1.DATA || line === iv2.DATA) { - break; - } +// node_modules/cspell/package.json +var require_package = __commonJS({ + "node_modules/cspell/package.json"(exports, module2) { + module2.exports = { + name: "cspell", + version: "7.0.0", + description: "A Spelling Checker for Code!", + funding: "https://github.com/streetsidesoftware/cspell?sponsor=1", + bin: { + cspell: "bin.mjs", + "cspell-esm": "bin.mjs" + }, + type: "module", + types: "dist/esm/index.d.mts", + module: "dist/esm/index.mjs", + exports: { + ".": { + import: "./dist/esm/index.mjs" + }, + "./app": { + import: "./dist/esm/app.mjs" + }, + "./bin": { + import: "./bin.mjs" + }, + "./bin.mjs": { + import: "./bin.mjs" + }, + "./application": { + import: "./dist/esm/application.mjs" } - return headerRows; - } - const input = (0, cspell_pipe_1.toDistributableIterable)(lines); - const headerLines = readHeader(input); - const version3 = parseHeaderRows(headerLines); - const stream = (0, gensequence_1.genSequence)(headerLines).concat(input); - const method = deserializers[version3]; - if (!method) { - throw new Error(`Unsupported version: ${version3}`); - } - return method(stream); - } - exports.importTrie = importTrie; + }, + files: [ + "bin.mjs", + "dist", + "!dist/esm/**/*.js", + "!dist/esm/**/*.ts", + "!**/*.tsbuildInfo", + "!**/__mocks__", + "!**/test/**", + "!**/*.test.*", + "!**/*.spec.*", + "!**/*.map" + ], + scripts: { + clean: 'shx rm -rf dist temp coverage "*.tsbuildInfo"', + build: "tsc -b . && ts2mjs dist/esm && pnpm run build:api", + "build:api": "rollup -c rollup.config.mjs", + "build:esm": "tsc -b tsconfig.esm.json", + "build:esm:ts2mjs": "tsc -b tsconfig.esm.json && ts2mjs dist/esm", + "build:lib": "tsc -b src/lib/tsconfig.json", + "build:readme": "pnpm build:readme:help", + "build:readme:help": "pnpm build:readme:help:lint && pnpm build:readme:help:trace && inject-markdown README.md && prettier -w README.md", + "build:readme:help:lint": "./bin.mjs lint --help > static/help-lint.txt", + "build:readme:help:trace": "./bin.mjs trace --help > static/help-trace.txt", + "clean-build": "pnpm run clean && pnpm run build", + coverage: "pnpm coverage:vitest && pnpm coverage:fix", + "coverage:vitest": "vitest run --coverage", + "coverage:fix": 'nyc report --temp-dir "$(pwd)/coverage" --reporter lcov --report-dir "$(pwd)/coverage" --cwd ../..', + "test:watch": "vitest", + test: "vitest run", + watch: "tsc -b . -w", + compile: "tsc -p .", + "test-watch": "vitest", + prepublishOnly: "pnpm run clean-build", + "test:update-snapshot": "vitest run --update" + }, + repository: { + type: "git", + url: "git+https://github.com/streetsidesoftware/cspell.git" + }, + keywords: [ + "spell", + "checker", + "code", + "camel", + "case", + "spelling", + "spell checker", + "spelling checker", + "lint" + ], + author: "Jason Dent", + license: "MIT", + bugs: { + url: "https://github.com/streetsidesoftware/cspell/issues" + }, + homepage: "https://streetsidesoftware.github.io/cspell/", + dependencies: { + "@cspell/cspell-json-reporter": "7.0.0", + "@cspell/cspell-pipe": "7.0.0", + "@cspell/cspell-types": "7.0.0", + "@cspell/dynamic-import": "7.0.0", + chalk: "^5.3.0", + "chalk-template": "^1.1.0", + commander: "^10.0.1", + "cspell-gitignore": "7.0.0", + "cspell-glob": "7.0.0", + "cspell-io": "7.0.0", + "cspell-lib": "7.0.0", + "fast-glob": "^3.3.1", + "fast-json-stable-stringify": "^2.1.0", + "file-entry-cache": "^6.0.1", + "get-stdin": "^9.0.0", + semver: "^7.5.4", + "strip-ansi": "^7.1.0", + "vscode-uri": "^3.0.7" + }, + engines: { + node: ">=16" + }, + devDependencies: { + "@types/file-entry-cache": "^5.0.2", + "@types/glob": "^8.1.0", + "@types/micromatch": "^4.0.2", + "@types/semver": "^7.5.0", + micromatch: "^4.0.5", + minimatch: "^9.0.3" + }, + gitHead: "52960d5ed75655978f9b633f44fd106937a63cd7" + }; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/models/locale/knownLocales.js -var require_knownLocales = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/models/locale/knownLocales.js"(exports) { +// node_modules/cspell/dist/lib/pkgInfo.cjs +var require_pkgInfo = __commonJS({ + "node_modules/cspell/dist/lib/pkgInfo.cjs"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.codes = void 0; - exports.codes = [ - // ['code', 'language'[', ''locale']], - ["af", "Afrikaans"], - ["af-NA", "Afrikaans", "Namibia"], - ["af-ZA", "Afrikaans", "South Africa"], - ["ak", "Akan"], - ["ak-GH", "Akan", "Ghana"], - ["am", "Amharic"], - ["am-ET", "Amharic", "Ethiopia"], - ["ar", "Arabic"], - ["ar-1", "Arabic"], - ["ar-AE", "Arabic", "United Arab Emirates"], - ["ar-BH", "Arabic", "Bahrain"], - ["ar-DJ", "Arabic", "Djibouti"], - ["ar-DZ", "Arabic", "Algeria"], - ["ar-EG", "Arabic", "Egypt"], - ["ar-EH", "Arabic"], - ["ar-ER", "Arabic", "Eritrea"], - ["ar-IL", "Arabic", "Israel"], - ["ar-IQ", "Arabic", "Iraq"], - ["ar-JO", "Arabic", "Jordan"], - ["ar-KM", "Arabic", "Comoros"], - ["ar-KW", "Arabic", "Kuwait"], - ["ar-LB", "Arabic", "Lebanon"], - ["ar-LY", "Arabic", "Libya"], - ["ar-MA", "Arabic", "Morocco"], - ["ar-MR", "Arabic", "Mauritania"], - ["ar-OM", "Arabic", "Oman"], - ["ar-PS", "Arabic"], - ["ar-QA", "Arabic", "Qatar"], - ["ar-SA", "Arabic", "Saudi Arabia"], - ["ar-SD", "Arabic", "Sudan"], - ["ar-SO", "Arabic", "Somalia"], - ["ar-SS", "Arabic"], - ["ar-SY", "Arabic", "Syria"], - ["ar-TD", "Arabic", "Chad"], - ["ar-TN", "Arabic", "Tunisia"], - ["ar-YE", "Arabic", "Yemen"], - ["as", "Assamese"], - ["as-IN", "Assamese", "India"], - ["az", "Azerbaijani"], - ["az-AZ", "Azerbaijani", "Azerbaijan"], - ["be", "Belarusian"], - ["be-BY", "Belarusian", "Belarus"], - ["bg", "Bulgarian"], - ["bg-BG", "Bulgarian", "Bulgaria"], - ["bm", "Bambara"], - ["bm-ML", "Bambara", "Mali"], - ["bn", "Bengali"], - ["bn-BD", "Bengali", "Bangladesh"], - ["bn-IN", "Bengali", "India"], - ["bo", "Tibetan"], - ["bo-CN", "Tibetan", "China"], - ["bo-IN", "Tibetan", "India"], - ["br", "Breton"], - ["br-FR", "Breton", "France"], - ["bs", "Bosnian"], - ["bs-BA", "Bosnian", "Bosnia and Herzegovina"], - ["ca", "Catalan"], - ["ca-AD", "Catalan", "Andorra"], - ["ca-ES", "Catalan", "Spain"], - ["ca-FR", "Catalan", "France"], - ["ca-IT", "Catalan", "Italy"], - ["ce", "Chechen"], - ["ce-RU", "Chechen", "Russia"], - ["cs", "Czech"], - ["cs-CZ", "Czech", "Czech Republic"], - ["cu", "Old Slavonic"], - ["cu-RU", "Old Slavonic", "Russia"], - ["cy", "Welsh"], - ["cy-GB", "Welsh", "United Kingdom"], - ["da", "Danish"], - ["da-DK", "Danish", "Denmark"], - ["da-GL", "Danish", "Greenland"], - ["de", "German"], - ["de-AT", "German", "Austria"], - ["de-BE", "German", "Belgium"], - ["de-CH", "German", "Switzerland"], - ["de-DE", "German", "Germany"], - ["de-IT", "German", "Italy"], - ["de-LI", "German", "Liechtenstein"], - ["de-LU", "German", "Luxembourg"], - ["dz", "Dzongkha"], - ["dz-BT", "Dzongkha", "Bhutan"], - ["ee", "Ewe"], - ["ee-GH", "Ewe", "Ghana"], - ["ee-TG", "Ewe", "Togo"], - ["el", "Greek", "Modern (1453-)"], - ["el-CY", "Greek", "Cyprus"], - ["el-GR", "Greek", "Greece"], - ["en", "English"], - ["en-AG", "English", "Antigua and Barbuda"], - ["en-AI", "English", "Anguilla"], - ["en-AS", "English", "American Samoa"], - ["en-AT", "English", "Austria"], - ["en-AU", "English", "Australia"], - ["en-BB", "English", "Barbados"], - ["en-BE", "English", "Belgium"], - ["en-BI", "English", "Burundi"], - ["en-BM", "English", "Bermuda"], - ["en-BS", "English", "Bahamas"], - ["en-BW", "English", "Botswana"], - ["en-BZ", "English", "Belize"], - ["en-CA", "English", "Canada"], - ["en-CC", "English", "Cocos (Keeling) Islands"], - ["en-CH", "English", "Switzerland"], - ["en-CK", "English", "Cook Islands"], - ["en-CM", "English", "Cameroon"], - ["en-CX", "English", "Christmas Island"], - ["en-CY", "English", "Cyprus"], - ["en-DE", "English", "Germany"], - ["en-DG", "English"], - ["en-DK", "English", "Denmark"], - ["en-DM", "English", "Dominica"], - ["en-ER", "English", "Eritrea"], - ["en-FI", "English", "Finland"], - ["en-FJ", "English", "Fiji"], - ["en-FK", "English", "Falkland Islands (Islas Malvinas)"], - ["en-FM", "English", "Micronesia"], - ["en-GB", "English", "United Kingdom"], - ["en-GD", "English", "Grenada"], - ["en-GG", "English", "Guernsey"], - ["en-GH", "English", "Ghana"], - ["en-GI", "English", "Gibraltar"], - ["en-GM", "English", "Gambia"], - ["en-GU", "English", "Guam"], - ["en-GY", "English", "Guyana"], - ["en-HK", "English", "Hong Kong"], - ["en-IE", "English", "Ireland"], - ["en-IL", "English", "Israel"], - ["en-IM", "English", "Isle of Man"], - ["en-IN", "English", "India"], - ["en-IO", "English", "British Indian Ocean Territory"], - ["en-JE", "English", "Jersey"], - ["en-JM", "English", "Jamaica"], - ["en-KE", "English", "Kenya"], - ["en-KI", "English", "Kiribati"], - ["en-KN", "English", "Saint Kitts and Nevis"], - ["en-KY", "English", "Cayman Islands"], - ["en-LC", "English", "Saint Lucia"], - ["en-LR", "English", "Liberia"], - ["en-LS", "English", "Lesotho"], - ["en-MG", "English", "Madagascar"], - ["en-MH", "English", "Marshall Islands"], - ["en-MO", "English", "Macau"], - ["en-MP", "English", "Northern Mariana Islands"], - ["en-MS", "English", "Montserrat"], - ["en-MT", "English", "Malta"], - ["en-MU", "English", "Mauritius"], - ["en-MW", "English", "Malawi"], - ["en-MY", "English", "Malaysia"], - ["en-NA", "English", "Namibia"], - ["en-NF", "English", "Norfolk Island"], - ["en-NG", "English", "Nigeria"], - ["en-NL", "English", "Netherlands"], - ["en-NR", "English", "Nauru"], - ["en-NU", "English", "Niue"], - ["en-NZ", "English", "New Zealand"], - ["en-PG", "English", "Papua New Guinea"], - ["en-PH", "English", "Philippines"], - ["en-PK", "English", "Pakistan"], - ["en-PN", "English", "Pitcairn Islands"], - ["en-PR", "English", "Puerto Rico"], - ["en-PW", "English", "Palau"], - ["en-RW", "English", "Rwanda"], - ["en-SB", "English", "Solomon Islands"], - ["en-SC", "English", "Seychelles"], - ["en-SD", "English", "Sudan"], - ["en-SE", "English", "Sweden"], - ["en-SG", "English", "Singapore"], - ["en-SH", "English", "Saint Helena"], - ["en-SI", "English", "Slovenia"], - ["en-SL", "English", "Sierra Leone"], - ["en-SS", "English"], - ["en-SX", "English"], - ["en-SZ", "English", "Swaziland"], - ["en-TC", "English", "Turks and Caicos Islands"], - ["en-TK", "English", "Tokelau"], - ["en-TO", "English", "Tonga"], - ["en-TT", "English", "Trinidad and Tobago"], - ["en-TV", "English", "Tuvalu"], - ["en-TZ", "English", "Tanzania"], - ["en-UG", "English", "Uganda"], - ["en-UM", "English", "Baker Island"], - ["en-US", "English", "United States"], - ["en-VC", "English", "Saint Vincent and the Grenadines"], - ["en-VG", "English", "British Virgin Islands"], - ["en-VI", "English", "U.S. Virgin Islands"], - ["en-VU", "English", "Vanuatu"], - ["en-WS", "English", "Samoa"], - ["en-ZA", "English", "South Africa"], - ["en-ZM", "English", "Zambia"], - ["en-ZW", "English", "Zimbabwe"], - ["eo", "Esperanto"], - ["es", "Spanish"], - ["es-AR", "Spanish", "Argentina"], - ["es-BO", "Spanish", "Bolivia"], - ["es-BR", "Spanish", "Brazil"], - ["es-BZ", "Spanish", "Belize"], - ["es-CL", "Spanish", "Chile"], - ["es-CO", "Spanish", "Colombia"], - ["es-CR", "Spanish", "Costa Rica"], - ["es-CU", "Spanish", "Cuba"], - ["es-DO", "Spanish", "Dominican Republic"], - ["es-EA", "Spanish"], - ["es-EC", "Spanish", "Ecuador"], - ["es-ES", "Spanish", "Spain"], - ["es-GQ", "Spanish", "Equatorial Guinea"], - ["es-GT", "Spanish", "Guatemala"], - ["es-HN", "Spanish", "Honduras"], - ["es-IC", "Spanish"], - ["es-MX", "Spanish", "Mexico"], - ["es-NI", "Spanish", "Nicaragua"], - ["es-PA", "Spanish", "Panama"], - ["es-PE", "Spanish", "Peru"], - ["es-PH", "Spanish", "Philippines"], - ["es-PR", "Spanish", "Puerto Rico"], - ["es-PY", "Spanish", "Paraguay"], - ["es-SV", "Spanish", "El Salvador"], - ["es-US", "Spanish", "United States"], - ["es-UY", "Spanish", "Uruguay"], - ["es-VE", "Spanish", "Venezuela"], - ["et", "Estonian"], - ["et-EE", "Estonian", "Estonia"], - ["eu", "Basque"], - ["eu-ES", "Basque", "Spain"], - ["fa", "Persian"], - ["fa-AF", "Persian", "Afghanistan"], - ["fa-IR", "Persian", "Iran"], - ["ff", "Fulah"], - ["ff-CM", "Fulah", "Cameroon"], - ["ff-GN", "Fulah", "Guinea"], - ["ff-MR", "Fulah", "Mauritania"], - ["ff-SN", "Fulah", "Senegal"], - ["fi", "Finnish"], - ["fi-FI", "Finnish", "Finland"], - ["fo", "Faroese"], - ["fo-DK", "Faroese", "Denmark"], - ["fo-FO", "Faroese", "Faroe Islands"], - ["fr", "French"], - ["fr-BE", "French", "Belgium"], - ["fr-BF", "French", "Burkina Faso"], - ["fr-BI", "French", "Burundi"], - ["fr-BJ", "French", "Benin"], - ["fr-BL", "French"], - ["fr-CA", "French", "Canada"], - ["fr-CD", "French", "Congo"], - ["fr-CF", "French", "Central African Republic"], - ["fr-CG", "French", "Congo"], - ["fr-CH", "French", "Switzerland"], - ["fr-CI", "French, Cote d'Ivoire (Ivory Coast)"], - ["fr-CM", "French", "Cameroon"], - ["fr-DJ", "French", "Djibouti"], - ["fr-DZ", "French", "Algeria"], - ["fr-FR", "French", "France"], - ["fr-GA", "French", "Gabon"], - ["fr-GF", "French", "French Guiana"], - ["fr-GN", "French", "Guinea"], - ["fr-GP", "French", "Saint Barthelemy"], - ["fr-GQ", "French", "Equatorial Guinea"], - ["fr-HT", "French", "Haiti"], - ["fr-KM", "French", "Comoros"], - ["fr-LU", "French", "Luxembourg"], - ["fr-MA", "French", "Morocco"], - ["fr-MC", "French", "Monaco"], - ["fr-MF", "French"], - ["fr-MG", "French", "Madagascar"], - ["fr-ML", "French", "Mali"], - ["fr-MQ", "French", "Martinique"], - ["fr-MR", "French", "Mauritania"], - ["fr-MU", "French", "Mauritius"], - ["fr-NC", "French", "New Caledonia"], - ["fr-NE", "French", "Niger"], - ["fr-PF", "French", "French Polynesia"], - ["fr-PM", "French", "Saint Pierre and Miquelon"], - ["fr-RE", "French", "Reunion"], - ["fr-RW", "French", "Rwanda"], - ["fr-SC", "French", "Seychelles"], - ["fr-SN", "French", "Senegal"], - ["fr-SY", "French", "Syria"], - ["fr-TD", "French", "Chad"], - ["fr-TG", "French", "Togo"], - ["fr-TN", "French", "Tunisia"], - ["fr-VU", "French", "Vanuatu"], - ["fr-WF", "French", "Wallis and Futuna"], - ["fr-YT", "French", "Mayotte"], - ["fy", "Western Frisian"], - ["fy-NL", "Western Frisian", "Netherlands"], - ["ga", "Irish"], - ["ga-IE", "Irish", "Ireland"], - ["gd", "Gaelic"], - ["gd-GB", "Gaelic", "United Kingdom"], - ["gl", "Galician"], - ["gl-ES", "Galician", "Spain"], - ["gu", "Gujarati"], - ["gu-IN", "Gujarati", "India"], - ["gv", "Manx"], - ["gv-IM", "Manx", "Isle of Man"], - ["ha", "Hausa"], - ["ha-GH", "Hausa", "Ghana"], - ["ha-NE", "Hausa", "Niger"], - ["ha-NG", "Hausa", "Nigeria"], - ["he", "Hebrew"], - ["he-IL", "Hebrew", "Israel"], - ["hi", "Hindi"], - ["hi-IN", "Hindi", "India"], - ["hr", "Croatian"], - ["hr-BA", "Croatian", "Bosnia and Herzegovina"], - ["hr-HR", "Croatian", "Croatia"], - ["hu", "Hungarian"], - ["hu-HU", "Hungarian", "Hungary"], - ["hy", "Armenian"], - ["hy-AM", "Armenian", "Armenia"], - ["id", "Indonesian"], - ["id-ID", "Indonesian", "Indonesia"], - ["ig", "Igbo"], - ["ig-NG", "Igbo", "Nigeria"], - ["ii", "Sichuan Yi"], - ["ii-CN", "Sichuan Yi", "China"], - ["is", "Icelandic"], - ["is-IS", "Icelandic", "Iceland"], - ["it", "Italian"], - ["it-CH", "Italian", "Switzerland"], - ["it-IT", "Italian", "Italy"], - ["it-SM", "Italian", "San Marino"], - ["it-VA", "Italian", "Vatican City"], - ["ja", "Japanese"], - ["ja-JP", "Japanese", "Japan"], - ["ka", "Georgian"], - ["ka-GE", "Georgian", "Georgia"], - ["ki", "Kikuyu"], - ["ki-KE", "Kikuyu", "Kenya"], - ["kk", "Kazakh"], - ["kk-KZ", "Kazakh", "Kazakhstan"], - ["kl", "Kalaallisut"], - ["kl-GL", "Kalaallisut", "Greenland"], - ["km", "Central Khmer"], - ["km-KH", "Central Khmer", "Cambodia"], - ["kn", "Kannada"], - ["kn-IN", "Kannada", "India"], - ["ko", "Korean"], - ["ko-KP", "Korean", "Korea"], - ["ko-KR", "Korean", "Korea"], - ["ks", "Kashmiri"], - ["ks-IN", "Kashmiri", "India"], - ["kw", "Cornish"], - ["kw-GB", "Cornish", "United Kingdom"], - ["ky", "Kirghiz"], - ["ky-KG", "Kirghiz", "Kyrgyzstan"], - ["lb", "Luxembourgish"], - ["lb-LU", "Luxembourgish", "Luxembourg"], - ["lg", "Ganda"], - ["lg-UG", "Ganda", "Uganda"], - ["ln", "Lingala"], - ["ln-AO", "Lingala", "Angola"], - ["ln-CD", "Lingala", "Congo"], - ["ln-CF", "Lingala", "Central African Republic"], - ["ln-CG", "Lingala", "Congo"], - ["lo", "Lao"], - ["lo-LA", "Lao", "Laos"], - ["lt", "Lithuanian"], - ["lt-LT", "Lithuanian", "Lithuania"], - ["lu", "Luba-Katanga"], - ["lu-CD", "Luba-Katanga", "Congo"], - ["lv", "Latvian"], - ["lv-LV", "Latvian", "Latvia"], - ["mg", "Malagasy"], - ["mg-MG", "Malagasy", "Madagascar"], - ["mk", "Macedonian"], - ["mk-MK", "Macedonian", "Macedonia"], - ["ml", "Malayalam"], - ["ml-IN", "Malayalam", "India"], - ["mn", "Mongolian"], - ["mn-MN", "Mongolian", "Mongolia"], - ["mr", "Marathi"], - ["mr-IN", "Marathi", "India"], - ["ms", "Malay"], - ["ms-BN", "Malay", "Brunei"], - ["ms-MY", "Malay", "Malaysia"], - ["ms-SG", "Malay", "Singapore"], - ["mt", "Maltese"], - ["mt-MT", "Maltese", "Malta"], - ["my", "Burmese"], - ["my-MM", "Burmese", "Myanmar (Burma)"], - ["nb", "Bokm\xE5l Norwegian"], - ["nb-NO", "Bokm\xE5l Norwegian", "Norway"], - ["nb-SJ", "Bokm\xE5l Norwegian", "Svalbard"], - ["nd", "Ndebele, North"], - ["nd-ZW", "Ndebele, North", "Zimbabwe"], - ["ne", "Nepali"], - ["ne-IN", "Nepali", "India"], - ["ne-NP", "Nepali", "Nepal"], - ["nl", "Dutch"], - ["nl-AW", "Dutch", "Aruba"], - ["nl-BE", "Dutch", "Belgium"], - ["nl-BQ", "Dutch"], - ["nl-CW", "Dutch"], - ["nl-NL", "Dutch", "Netherlands"], - ["nl-SR", "Dutch", "Suriname"], - ["nl-SX", "Dutch"], - ["nn", "Norwegian Nynorsk"], - ["nn-NO", "Norwegian Nynorsk", "Norway"], - ["om", "Oromo"], - ["om-ET", "Oromo", "Ethiopia"], - ["om-KE", "Oromo", "Kenya"], - ["or", "Oriya"], - ["or-IN", "Oriya", "India"], - ["os", "Ossetian"], - ["os-GE", "Ossetian", "Georgia"], - ["os-RU", "Ossetian", "Russia"], - ["pa", "Panjabi"], - ["pa-IN", "Panjabi", "India"], - ["pa-PK", "Panjabi", "Pakistan"], - ["pl", "Polish"], - ["pl-PL", "Polish", "Poland"], - ["ps", "Pushto"], - ["ps-AF", "Pushto", "Afghanistan"], - ["pt", "Portuguese"], - ["pt-AO", "Portuguese", "Angola"], - ["pt-BR", "Portuguese", "Brazil"], - ["pt-CH", "Portuguese", "Switzerland"], - ["pt-CV", "Portuguese", "Cape Verde"], - ["pt-GQ", "Portuguese", "Equatorial Guinea"], - ["pt-GW", "Portuguese", "Guinea-Bissau"], - ["pt-LU", "Portuguese", "Luxembourg"], - ["pt-MO", "Portuguese", "Macau"], - ["pt-MZ", "Portuguese", "Mozambique"], - ["pt-PT", "Portuguese", "Portugal"], - ["pt-ST", "Portuguese", "Sao Tome and Principe"], - ["pt-TL", "Portuguese", "Timor-Leste (East Timor)"], - ["qu", "Quechua"], - ["qu-BO", "Quechua", "Bolivia"], - ["qu-EC", "Quechua", "Ecuador"], - ["qu-PE", "Quechua", "Peru"], - ["rm", "Romansh"], - ["rm-CH", "Romansh", "Switzerland"], - ["rn", "Rundi"], - ["rn-BI", "Rundi", "Burundi"], - ["ro", "Romanian"], - ["ro-MD", "Romanian", "Moldova"], - ["ro-RO", "Romanian", "Romania"], - ["ru", "Russian"], - ["ru-BY", "Russian", "Belarus"], - ["ru-KG", "Russian", "Kyrgyzstan"], - ["ru-KZ", "Russian", "Kazakhstan"], - ["ru-MD", "Russian", "Moldova"], - ["ru-RU", "Russian", "Russia"], - ["ru-UA", "Russian", "Ukraine"], - ["rw", "Kinyarwanda"], - ["rw-RW", "Kinyarwanda", "Rwanda"], - ["se", "Northern Sami"], - ["se-FI", "Northern Sami", "Finland"], - ["se-NO", "Northern Sami", "Norway"], - ["se-SE", "Northern Sami", "Sweden"], - ["sg", "Sango"], - ["sg-CF", "Sango", "Central African Republic"], - ["si", "Sinhala"], - ["si-LK", "Sinhala", "Sri Lanka"], - ["sk", "Slovak"], - ["sk-SK", "Slovak", "Slovakia"], - ["sl", "Slovenian"], - ["sl-SI", "Slovenian", "Slovenia"], - ["sn", "Shona"], - ["sn-ZW", "Shona", "Zimbabwe"], - ["so", "Somali"], - ["so-DJ", "Somali", "Djibouti"], - ["so-ET", "Somali", "Ethiopia"], - ["so-KE", "Somali", "Kenya"], - ["so-SO", "Somali", "Somalia"], - ["sq", "Albanian"], - ["sq-AL", "Albanian", "Albania"], - ["sq-MK", "Albanian", "Macedonia"], - ["sq-XK", "Albanian"], - ["sr", "Serbian"], - ["sr-BA", "Serbian", "Bosnia and Herzegovina"], - ["sr-ME", "Serbian", "Montenegro"], - ["sr-RS", "Serbian", "Serbia"], - ["sr-XK", "Serbian"], - ["sv", "Swedish"], - ["sv-AX", "Swedish", "Aland"], - ["sv-FI", "Swedish", "Finland"], - ["sv-SE", "Swedish", "Sweden"], - ["sw", "Swahili"], - ["sw-CD", "Swahili", "Congo"], - ["sw-KE", "Swahili", "Kenya"], - ["sw-TZ", "Swahili", "Tanzania"], - ["sw-UG", "Swahili", "Uganda"], - ["ta", "Tamil"], - ["ta-IN", "Tamil", "India"], - ["ta-LK", "Tamil", "Sri Lanka"], - ["ta-MY", "Tamil", "Malaysia"], - ["ta-SG", "Tamil", "Singapore"], - ["te", "Telugu"], - ["te-IN", "Telugu", "India"], - ["th", "Thai"], - ["th-TH", "Thai", "Thailand"], - ["ti", "Tigrinya"], - ["ti-ER", "Tigrinya", "Eritrea"], - ["ti-ET", "Tigrinya", "Ethiopia"], - ["tk", "Turkmen"], - ["tk-TM", "Turkmen", "Turkmenistan"], - ["to", "Tonga (Tonga Islands)"], - ["to-TO", "Tonga (Tonga Islands)", "Tonga"], - ["tr", "Turkish"], - ["tr-CY", "Turkish", "Cyprus"], - ["tr-TR", "Turkish", "Turkey"], - ["ug", "Uighur"], - ["ug-CN", "Uighur", "China"], - ["uk", "Ukrainian"], - ["uk-UA", "Ukrainian", "Ukraine"], - ["ur", "Urdu"], - ["ur-IN", "Urdu", "India"], - ["ur-PK", "Urdu", "Pakistan"], - ["uz", "Uzbek"], - ["uz-AF", "Uzbek", "Afghanistan"], - ["uz-UZ", "Uzbek", "Uzbekistan"], - ["vi", "Vietnamese"], - ["vi-VN", "Vietnamese", "Vietnam"], - ["vo", "Volap\xFCk"], - ["yi", "Yiddish"], - ["yi-1", "Yiddish"], - ["yo", "Yoruba"], - ["yo-BJ", "Yoruba", "Benin"], - ["yo-NG", "Yoruba", "Nigeria"], - ["zh", "Chinese"], - ["zh-CN", "Chinese", "China"], - ["zh-HK", "Chinese", "Hong Kong"], - ["zh-MO", "Chinese", "Macau"], - ["zh-SG", "Chinese", "Singapore"], - ["zh-TW", "Chinese", "China"], - ["zu", "Zulu"], - ["zu-ZA", "Zulu", "South Africa"] - ]; + exports.npmPackage = exports.pkgDir = void 0; + var path_1 = require("path"); + exports.pkgDir = (0, path_1.join)(__dirname, "../.."); + exports.npmPackage = require_package(); } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/models/locale/locale.js -var require_locale = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/models/locale/locale.js"(exports) { +// node_modules/fast-glob/out/utils/array.js +var require_array2 = __commonJS({ + "node_modules/fast-glob/out/utils/array.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseLocale = exports.lookupLocaleInfo = exports.isStandardLocale = exports.normalizeLocale = exports.Locale = void 0; - var knownLocales_js_1 = require_knownLocales(); - var codesByLocale; - var Locale = class { - constructor(locale) { - this._raw = locale; - this._locale = normalizeLocale(locale); - } - get locale() { - return this._locale; - } - localInfo() { - return lookupLocaleInfo(this._locale); - } - isValid() { - return isStandardLocale(this._locale); - } - toJSON() { - return this.locale; - } - toString() { - return this.locale; - } - }; - exports.Locale = Locale; - var regExTwoLetter = /^[a-z]{2}$/i; - var regExLocaleWithCountry = /^([a-z]{2})[_-]?([a-z]{2,3})$/i; - var regExValidLocale = /^([a-z]{2})(?:-([A-Z]{2,3}))?$/; - function normalizeLocale(locale) { - locale = locale.trim(); - if (regExTwoLetter.test(locale)) - return locale.toLowerCase(); - const m = locale.match(regExLocaleWithCountry); - if (!m) - return locale; - const lang = m[1].toLowerCase(); - const variant = m[2].toUpperCase(); - return `${lang}-${variant}`; - } - exports.normalizeLocale = normalizeLocale; - function isStandardLocale(locale) { - return regExValidLocale.test(locale); - } - exports.isStandardLocale = isStandardLocale; - function lookupLocaleInfo(locale) { - codesByLocale = codesByLocale || buildLocaleLookup(); - return codesByLocale.get(locale); - } - exports.lookupLocaleInfo = lookupLocaleInfo; - function buildLocaleLookup() { - const info3 = knownLocales_js_1.codes.map(([locale, language, country]) => ({ locale, language, country })); - return new Map(info3.map((i) => [i.locale, i])); - } - function createLocale(locale) { - return new Locale(locale); + exports.splitWhen = exports.flatten = void 0; + function flatten(items) { + return items.reduce((collection, item) => [].concat(collection, item), []); } - function parseLocale(locales) { - locales = typeof locales === "string" ? locales.split(",") : locales; - return locales.map(createLocale); + exports.flatten = flatten; + function splitWhen(items, predicate) { + const result = [[]]; + let groupIndex = 0; + for (const item of items) { + if (predicate(item)) { + groupIndex++; + result[groupIndex] = []; + } else { + result[groupIndex].push(item); + } + } + return result; } - exports.parseLocale = parseLocale; + exports.splitWhen = splitWhen; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/models/locale/index.js -var require_locale2 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/models/locale/index.js"(exports) { +// node_modules/fast-glob/out/utils/errno.js +var require_errno = __commonJS({ + "node_modules/fast-glob/out/utils/errno.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseLocale = exports.Locale = void 0; - var locale_js_1 = require_locale(); - Object.defineProperty(exports, "Locale", { enumerable: true, get: function() { - return locale_js_1.Locale; - } }); - Object.defineProperty(exports, "parseLocale", { enumerable: true, get: function() { - return locale_js_1.parseLocale; - } }); + exports.isEnoentCodeError = void 0; + function isEnoentCodeError(error2) { + return error2.code === "ENOENT"; + } + exports.isEnoentCodeError = isEnoentCodeError; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/util.js -var require_util6 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/util.js"(exports) { +// node_modules/fast-glob/out/utils/fs.js +var require_fs = __commonJS({ + "node_modules/fast-glob/out/utils/fs.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.isArrayEqual = exports.replaceAllFactory = exports.regexQuote = exports.replaceAll = exports.flatten = exports.unique = exports.clean = exports.cleanCopy = exports.isDefined = void 0; - function isDefined2(a) { - return a !== void 0; - } - exports.isDefined = isDefined2; - function cleanCopy(t) { - const r = { ...t }; - return clean2(r); - } - exports.cleanCopy = cleanCopy; - function clean2(t) { - for (const prop in t) { - if (t[prop] === void 0) { - delete t[prop]; - } - } - return t; - } - exports.clean = clean2; - function unique(a) { - return [...new Set(a)]; - } - exports.unique = unique; - function* flatten(i) { - for (const v of i) { - yield* v; - } - } - exports.flatten = flatten; - function replaceAll(text, match, withText) { - const fn = replaceAllFactory(match, withText); - return fn(text); - } - exports.replaceAll = replaceAll; - function regexQuote(text) { - return text.replace(/([[\]\-+(){},|*.\\])/g, "\\$1"); - } - exports.regexQuote = regexQuote; - function replaceAllFactory(match, replaceWithText) { - const r = RegExp(regexQuote(match), "g"); - return (text) => text.replace(r, replaceWithText); - } - exports.replaceAllFactory = replaceAllFactory; - function isArrayEqual(a, b) { - if (a === b) - return true; - let isMatch = a.length === b.length; - const len = a.length; - for (let i = 0; isMatch && i < len; ++i) { - isMatch = a[i] === b[i]; + exports.createDirentFromStats = void 0; + var DirentFromStats = class { + constructor(name, stats) { + this.name = name; + this.isBlockDevice = stats.isBlockDevice.bind(stats); + this.isCharacterDevice = stats.isCharacterDevice.bind(stats); + this.isDirectory = stats.isDirectory.bind(stats); + this.isFIFO = stats.isFIFO.bind(stats); + this.isFile = stats.isFile.bind(stats); + this.isSocket = stats.isSocket.bind(stats); + this.isSymbolicLink = stats.isSymbolicLink.bind(stats); } - return isMatch; + }; + function createDirentFromStats(name, stats) { + return new DirentFromStats(name, stats); } - exports.isArrayEqual = isArrayEqual; + exports.createDirentFromStats = createDirentFromStats; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/mappers/mapCosts.js -var require_mapCosts = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/mappers/mapCosts.js"(exports) { +// node_modules/fast-glob/out/utils/path.js +var require_path = __commonJS({ + "node_modules/fast-glob/out/utils/path.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.mapEditCosts = exports.mapHunspellCosts = void 0; - var util_js_1 = require_util6(); - var defaultEditCosts = { - accentCosts: 1, - baseCost: 100, - capsCosts: 1, - firstLetterPenalty: 4, - nonAlphabetCosts: 110 - }; - var defaultHunspellCosts = { - ...defaultEditCosts, - ioConvertCost: 30, - keyboardCost: 99, - mapCost: 25, - replaceCosts: 75, - tryCharCost: 100 - }; - function mapHunspellCosts(costs = {}) { - return { ...defaultHunspellCosts, ...(0, util_js_1.cleanCopy)(costs) }; + exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0; + var os5 = require("os"); + var path26 = require("path"); + var IS_WINDOWS_PLATFORM = os5.platform() === "win32"; + var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; + var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g; + var WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([(){}]|^!|[!+@](?=\())/g; + var DOS_DEVICE_PATH_RE = /^\\\\([.?])/; + var WINDOWS_BACKSLASHES_RE = /\\(?![!()+@{}])/g; + function unixify(filepath) { + return filepath.replace(/\\/g, "/"); } - exports.mapHunspellCosts = mapHunspellCosts; - function mapEditCosts(costs = {}) { - return { ...defaultEditCosts, ...(0, util_js_1.cleanCopy)(costs) }; + exports.unixify = unixify; + function makeAbsolute(cwd, filepath) { + return path26.resolve(cwd, filepath); } - exports.mapEditCosts = mapEditCosts; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/text.js -var require_text = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/text.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.stripNonAccents = exports.stripAccents = exports.accentForms = exports.caseForms = exports.expandRange = exports.expandCharacterSet = void 0; - function expandCharacterSet(line, rangeChar = "-") { - const charSet = /* @__PURE__ */ new Set(); - let mode = 0; - let prev = ""; - for (const char of line) { - if (mode) { - expandRange(prev, char).forEach((a) => charSet.add(a)); - mode = 0; - } - if (char === rangeChar) { - if (prev) { - mode = 1; - continue; - } + exports.makeAbsolute = makeAbsolute; + function removeLeadingDotSegment(entry) { + if (entry.charAt(0) === ".") { + const secondCharactery = entry.charAt(1); + if (secondCharactery === "/" || secondCharactery === "\\") { + return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT); } - charSet.add(char); - prev = char; } - if (mode) - charSet.add(rangeChar); - return charSet; - } - exports.expandCharacterSet = expandCharacterSet; - function expandRange(a, b) { - const values = []; - const end = b.codePointAt(0); - const begin = a.codePointAt(0); - if (!(begin && end)) - return values; - for (let i = begin; i <= end; ++i) { - values.push(String.fromCodePoint(i)); - } - return values; + return entry; } - exports.expandRange = expandRange; - function caseForms(letter, locale) { - const forms = /* @__PURE__ */ new Set([letter]); - function tryCases(s) { - forms.add(s.toLocaleLowerCase(locale)); - forms.add(s.toLocaleUpperCase(locale)); - } - tryCases(letter); - [...forms].forEach(tryCases); - return [...forms].filter((a) => !!a); + exports.removeLeadingDotSegment = removeLeadingDotSegment; + exports.escape = IS_WINDOWS_PLATFORM ? escapeWindowsPath : escapePosixPath; + function escapeWindowsPath(pattern) { + return pattern.replace(WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2"); } - exports.caseForms = caseForms; - function accentForms(letter) { - const forms = /* @__PURE__ */ new Set([letter, letter.normalize("NFC"), letter.normalize("NFD")]); - return forms; + exports.escapeWindowsPath = escapeWindowsPath; + function escapePosixPath(pattern) { + return pattern.replace(POSIX_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2"); } - exports.accentForms = accentForms; - function stripAccents(characters) { - return characters.normalize("NFD").replace(/\p{M}/gu, ""); + exports.escapePosixPath = escapePosixPath; + exports.convertPathToPattern = IS_WINDOWS_PLATFORM ? convertWindowsPathToPattern : convertPosixPathToPattern; + function convertWindowsPathToPattern(filepath) { + return escapeWindowsPath(filepath).replace(DOS_DEVICE_PATH_RE, "//$1").replace(WINDOWS_BACKSLASHES_RE, "/"); } - exports.stripAccents = stripAccents; - function stripNonAccents(characters) { - return characters.normalize("NFD").replace(/[^\p{M}]/gu, ""); + exports.convertWindowsPathToPattern = convertWindowsPathToPattern; + function convertPosixPathToPattern(filepath) { + return escapePosixPath(filepath); } - exports.stripNonAccents = stripNonAccents; + exports.convertPosixPathToPattern = convertPosixPathToPattern; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/mappers/joinLetters.js -var require_joinLetters = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/mappers/joinLetters.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.joinLetters = void 0; - function joinLetters(letters) { - const v = [...letters]; - return v.map((a) => a.length > 1 || !a.length ? `(${a})` : a).join(""); - } - exports.joinLetters = joinLetters; +// node_modules/is-extglob/index.js +var require_is_extglob = __commonJS({ + "node_modules/is-extglob/index.js"(exports, module2) { + module2.exports = function isExtglob(str) { + if (typeof str !== "string" || str === "") { + return false; + } + var match2; + while (match2 = /(\\).|([@?!+*]\(.*\))/g.exec(str)) { + if (match2[2]) + return true; + str = str.slice(match2.index + match2[0].length); + } + return false; + }; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/mappers/mapToSuggestionCostDef.js -var require_mapToSuggestionCostDef = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/mappers/mapToSuggestionCostDef.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.splitMap = exports.calcCostsForAccentedLetters = exports.parseAccents = exports.calcFirstCharacterReplace = exports.calcFirstCharacterReplaceDefs = exports.parseAlphabetCaps = exports.parseAlphabet = void 0; - var sync_1 = require_sync(); - var text_js_1 = require_text(); - var util_js_1 = require_util6(); - var joinLetters_js_1 = require_joinLetters(); - function parseAlphabet(cs, locale, editCost) { - const { cost, penalty } = cs; - const characters = (0, text_js_1.expandCharacterSet)(cs.characters); - const charForms = [ - ...(0, sync_1.pipe)(characters, (0, sync_1.opMap)((c) => (0, text_js_1.caseForms)(c, locale).sort())) - ]; - const alphabet = (0, joinLetters_js_1.joinLetters)([ - ...(0, sync_1.pipe)(charForms, (0, sync_1.opFlatten)(), (0, sync_1.opMap)((letter) => (0, text_js_1.accentForms)(letter)), (0, sync_1.opFlatten)(), (0, sync_1.opUnique)()) - ].sort()); - const sugAlpha = (0, util_js_1.clean)({ - map: alphabet, - replace: cost, - insDel: cost, - swap: cost, - penalty - }); - return [ - sugAlpha, - parseAlphabetCaps(cs.characters, locale, editCost), - ...calcCostsForAccentedLetters(alphabet, locale, editCost) - ]; - } - exports.parseAlphabet = parseAlphabet; - function parseAlphabetCaps(alphabet, locale, editCost) { - const characters = (0, text_js_1.expandCharacterSet)(alphabet); - const charForms = [ - ...(0, sync_1.pipe)(characters, (0, sync_1.opMap)((c) => (0, text_js_1.caseForms)(c, locale).sort())) - ]; - const caps = charForms.map((a) => (0, joinLetters_js_1.joinLetters)(a)).join("|"); - const sugCaps = { - map: caps, - replace: editCost.capsCosts - }; - return sugCaps; - } - exports.parseAlphabetCaps = parseAlphabetCaps; - function calcFirstCharacterReplaceDefs(alphabets, editCost) { - return alphabets.map((cs) => calcFirstCharacterReplace(cs, editCost)); - } - exports.calcFirstCharacterReplaceDefs = calcFirstCharacterReplaceDefs; - function calcFirstCharacterReplace(cs, editCost) { - const mapOfFirstLetters = [ - ...(0, sync_1.pipe)((0, text_js_1.expandCharacterSet)(cs.characters), (0, sync_1.opUnique)(), (0, sync_1.opMap)((letter) => `(^${letter})`)) - ].sort().join("") + "(^)"; - const penalty = editCost.firstLetterPenalty; - const cost = cs.cost - penalty; - return { - map: mapOfFirstLetters, - replace: cost, - penalty: penalty * 2 - }; - } - exports.calcFirstCharacterReplace = calcFirstCharacterReplace; - function parseAccents(cs, _editCost) { - const { cost, penalty } = cs; - const accents = (0, joinLetters_js_1.joinLetters)([ - ...(0, sync_1.pipe)((0, text_js_1.expandCharacterSet)(cs.characters), (0, sync_1.opMap)((char) => (0, text_js_1.stripNonAccents)(char))) - ]); - if (!accents) - return void 0; - return (0, util_js_1.clean)({ - map: accents, - replace: cost, - insDel: cost, - penalty - }); - } - exports.parseAccents = parseAccents; - function calcCostsForAccentedLetters(simpleMap, locale, costs) { - const charactersWithAccents = [ - ...(0, sync_1.pipe)(splitMap(simpleMap), (0, sync_1.opMap)((char) => (0, text_js_1.caseForms)(char, locale)), (0, sync_1.opFlatten)(), (0, sync_1.opMap)((char) => [...(0, text_js_1.accentForms)(char)]), (0, sync_1.opFilter)((forms) => forms.length > 1)) - ]; - const characters = (0, sync_1.pipe)(charactersWithAccents, (0, sync_1.opMap)((forms) => /* @__PURE__ */ new Set([...forms, ...forms.map((char) => (0, text_js_1.stripAccents)(char))])), (0, sync_1.opMap)((forms) => [...forms].sort()), (0, sync_1.opFilter)((forms) => forms.length > 1), (0, sync_1.opMap)(joinLetters_js_1.joinLetters), (0, sync_1.opUnique)()); - const replaceAccentMap = [...characters].join("|"); - const cost = costs.accentCosts; - const costToReplaceAccent = !replaceAccentMap ? [] : [{ map: replaceAccentMap, replace: cost }]; - const normalizeMap = charactersWithAccents.map((a) => a.sort()).map(joinLetters_js_1.joinLetters).join("|"); - const costToNormalizeAccent = !normalizeMap ? [] : [{ map: normalizeMap, replace: 0 }]; - return [...costToReplaceAccent, ...costToNormalizeAccent]; - } - exports.calcCostsForAccentedLetters = calcCostsForAccentedLetters; - function* splitMap(map) { - let seq = ""; - let mode = 0; - for (const char of map) { - if (mode && char === ")") { - yield seq; - mode = 0; - continue; - } - if (mode) { - seq += char; - continue; +// node_modules/is-glob/index.js +var require_is_glob = __commonJS({ + "node_modules/is-glob/index.js"(exports, module2) { + var isExtglob = require_is_extglob(); + 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 (char === "(") { - mode = 1; - seq = ""; - continue; + 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++; } - yield char; - } - } - exports.splitMap = splitMap; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/mappers/mapHunspellInformation.js -var require_mapHunspellInformation = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/mappers/mapHunspellInformation.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.hunspellInformationToSuggestionCostDef = void 0; - var sync_1 = require_sync(); - var text_js_1 = require_text(); - var util_js_1 = require_util6(); - var joinLetters_js_1 = require_joinLetters(); - var mapCosts_js_1 = require_mapCosts(); - var mapToSuggestionCostDef_js_1 = require_mapToSuggestionCostDef(); - function hunspellInformationToSuggestionCostDef(hunInfo, locales) { - const costs = calcCosts(hunInfo.costs, locales); - const operations = [ - affKey, - affKeyCaps, - affMap, - affMapAccents, - affMapCaps, - affNoTry, - affRepConv, - affTry, - affTryAccents, - affTryFirstCharacterReplace - ]; - function parseAff(aff, costs2) { - const regSupportedAff = /^(?:MAP|KEY|TRY|NO-TRY|ICONV|OCONV|REP)\s/; - const rejectAff = /^(?:MAP|KEY|TRY|ICONV|OCONV|REP)\s+\d+$/; - const lines = aff.split("\n").map((a) => a.replace(/#.*/, "")).map((a) => a.trim()).filter((a) => regSupportedAff.test(a)).filter((a) => !rejectAff.test(a)); - const defs = (0, sync_1.pipe)(lines, (0, sync_1.opMap)((line) => (0, sync_1.pipe)(operations, (0, sync_1.opMap)((fn) => fn(line, costs2)), (0, sync_1.opMap)(asArrayOf), (0, sync_1.opFlatten)())), (0, sync_1.opFlatten)(), (0, sync_1.opFilter)(util_js_1.isDefined)); - return [...defs]; - } - return parseAff(hunInfo.aff, costs); - } - exports.hunspellInformationToSuggestionCostDef = hunspellInformationToSuggestionCostDef; - function calcCosts(costs = {}, locale) { - const useLocale = locale?.length ? locale.map((loc) => loc.locale) : void 0; - const hunCosts = (0, mapCosts_js_1.mapHunspellCosts)(costs); - const c = { - ...hunCosts, - locale: useLocale - }; - return c; - } - var regExpMap = /^(?:MAP)\s+(\S+)$/; - function affMap(line, costs) { - const m = line.match(regExpMap); - if (!m) - return void 0; - const map = m[1]; - const cost = costs.mapCost; - return { - map, - replace: cost, - swap: cost - }; - } - var regExpTry = /^(?:TRY)\s+(\S+)$/; - function affTry(line, costs) { - const m = line.match(regExpTry); - if (!m) - return void 0; - const cost = costs.tryCharCost; - const tryChars = m[1]; - const characters = tryChars; - return (0, mapToSuggestionCostDef_js_1.parseAlphabet)({ - characters, - cost - }, costs.locale, costs); - } - function affTryFirstCharacterReplace(line, costs) { - const m = line.match(regExpTry); - if (!m) - return void 0; - const characters = m[1]; - const cost = costs.tryCharCost; - return (0, mapToSuggestionCostDef_js_1.calcFirstCharacterReplace)({ - characters, - cost - }, costs); - } - var regExpNoTry = /^NO-TRY\s+(\S+)$/; - function affNoTry(line, costs) { - const m = line.match(regExpNoTry); - if (!m) - return void 0; - const map = m[1]; - return { - map, - insDel: Math.max(costs.nonAlphabetCosts - costs.tryCharCost, 0), - penalty: costs.nonAlphabetCosts + costs.tryCharCost - }; - } - var regExpRepConv = /^(?:REP|(?:I|O)CONV)\s+(\S+)\s+(\S+)$/; - function affRepConv(line, costs) { - const m = line.match(regExpRepConv); - if (!m) - return void 0; - const cost = line.startsWith("REP") ? costs.replaceCosts : costs.ioConvertCost; - const from = m[1]; - let into = m[2]; - into = into.replace(/^0$/, ""); - if (from.startsWith("^") && !into.startsWith("^")) { - into = "^" + into; - } - if (from.endsWith("$") && !into.endsWith("$")) { - into = into + "$"; } - return { - map: (0, joinLetters_js_1.joinLetters)([from, into]), - replace: cost - }; - } - var regExpKey = /^(?:KEY)\s+(\S+)$/; - function affKey(line, costs) { - const m = line.match(regExpKey); - if (!m) - return void 0; - const kbd = m[1]; - const pairs = [...(0, mapToSuggestionCostDef_js_1.splitMap)(kbd)].map(reducer((p, v) => ({ a: p.b, b: v }), { a: "|", b: "|" })).filter((ab) => ab.a !== "|" && ab.b !== "|").map(({ a, b }) => (0, joinLetters_js_1.joinLetters)([a, b])); - const pairsUpper = pairs.map((p) => p.toLocaleUpperCase(costs.locale)); - const map = (0, util_js_1.unique)(pairs.concat(pairsUpper)).join("|"); - const cost = costs.keyboardCost; - return { - map, - replace: cost, - swap: cost - }; - } - function affKeyCaps(line, costs) { - const m = line.match(regExpKey); - if (!m) - return void 0; - return parseCaps(m[1], costs); - } - function affMapCaps(line, costs) { - const m = line.match(regExpMap); - if (!m) - return void 0; - return parseCaps(m[1], costs); - } - function affTryAccents(line, costs) { - const m = line.match(regExpTry); - if (!m) - return void 0; - return (0, mapToSuggestionCostDef_js_1.calcCostsForAccentedLetters)(m[1], costs.locale, costs); - } - function affMapAccents(line, costs) { - const m = line.match(regExpMap); - if (!m) - return void 0; - return (0, mapToSuggestionCostDef_js_1.calcCostsForAccentedLetters)(m[1], costs.locale, costs); - } - function parseCaps(value, costs) { - const locale = costs.locale; - const letters = [...(0, mapToSuggestionCostDef_js_1.splitMap)(value)].filter((a) => a !== "|"); - const withCases = letters.map((s) => (0, text_js_1.caseForms)(s, locale)).filter((forms) => forms.length > 1).map(joinLetters_js_1.joinLetters); - const map = (0, util_js_1.unique)(withCases).join("|"); - const cost = costs.capsCosts; - if (!map) - return void 0; - return { - map, - replace: cost - }; - } - function reducer(fn, initialVal) { - let acc = initialVal; - return (val, i) => acc = fn(acc, val, i); - } - function asArrayOf(v) { - return Array.isArray(v) ? v : [v]; - } - exports.__testing__ = { - affKey, - affKeyCaps, - affMap, - affMapAccents, - affMapCaps, - affNoTry, - affRepConv, - affTry, - affTryAccents, - affTryFirstCharacterReplace, - calcCosts, - split: mapToSuggestionCostDef_js_1.splitMap + return false; }; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/mappers/mapDictionaryInfo.js -var require_mapDictionaryInfo = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/mappers/mapDictionaryInfo.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.mapDictionaryInformationToAdjustment = exports.mapDictionaryInformation = void 0; - var sync_1 = require_sync(); - var index_js_1 = require_locale2(); - var util_js_1 = require_util6(); - var mapCosts_js_1 = require_mapCosts(); - var mapHunspellInformation_js_1 = require_mapHunspellInformation(); - var mapToSuggestionCostDef_js_1 = require_mapToSuggestionCostDef(); - function mapDictionaryInformation(dictInfo) { - const _locale = dictInfo.locale; - const locale = _locale ? (0, index_js_1.parseLocale)(_locale).filter((loc) => loc.isValid()) : void 0; - const locales = locale?.map((loc) => loc.locale); - const costs = (0, mapCosts_js_1.mapEditCosts)(dictInfo.costs); - const defsEC = dictInfo.suggestionEditCosts || []; - const defsHI = dictInfo.hunspellInformation ? (0, mapHunspellInformation_js_1.hunspellInformationToSuggestionCostDef)(dictInfo.hunspellInformation, locale) : []; - return [ - ...defsEC, - ...processAlphabet(dictInfo.alphabet, locales, costs), - ...processAccents(dictInfo.accents, costs), - ...defsHI - ]; - } - exports.mapDictionaryInformation = mapDictionaryInformation; - function processAlphabet(alphabet, locale, editCost) { - const csAlphabet = toCharSets(alphabet, "a-zA-Z", editCost.baseCost); - return [ - ...(0, sync_1.pipeSync)(csAlphabet, (0, sync_1.opMap)((cs) => (0, mapToSuggestionCostDef_js_1.parseAlphabet)(cs, locale, editCost)), (0, sync_1.opFlatten)()), - ...(0, mapToSuggestionCostDef_js_1.calcFirstCharacterReplaceDefs)(csAlphabet, editCost) - ]; - } - function toCharSets(cs, defaultValue, cost, penalty) { - cs = cs ?? defaultValue; - if (!cs) - return []; - if (typeof cs === "string") { - cs = [ - { - characters: cs, - cost + 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++; + } } - if (penalty !== void 0) { - cs.forEach((cs2) => cs2.penalty = penalty); + return false; + }; + module2.exports = function isGlob(str, options) { + if (typeof str !== "string" || str === "") { + return false; } - return cs; - } - function processAccents(accents, editCost) { - const cs = toCharSets(accents, "\u0300-\u0341", editCost.accentCosts); - return cs.map((cs2) => (0, mapToSuggestionCostDef_js_1.parseAccents)(cs2, editCost)).filter(util_js_1.isDefined); - } - function mapDictionaryInformationToAdjustment(dictInfo) { - if (!dictInfo.adjustments) - return []; - return dictInfo.adjustments.map(mapAdjustment); - } - exports.mapDictionaryInformationToAdjustment = mapDictionaryInformationToAdjustment; - function mapAdjustment(adj) { - const { id, regexp, penalty } = adj; - return { - id, - regexp: new RegExp(regexp), - penalty - }; - } - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/mappers/mapDictionaryInfoToWeightMap.js -var require_mapDictionaryInfoToWeightMap = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/mappers/mapDictionaryInfoToWeightMap.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.mapDictionaryInformationToWeightMap = void 0; - var weightedMaps_js_1 = require_weightedMaps(); - var mapDictionaryInfo_js_1 = require_mapDictionaryInfo(); - var defaultDefs = [ - { - map: "1234567890-.", - insDel: 1, - penalty: 200 + if (isExtglob(str)) { + return true; } - ]; - var defaultAdjustments = [ - { - id: "compound-case-change", - regexp: /\p{Ll}∙\p{Lu}/gu, - penalty: 1e3 - }, - { - id: "short-compounds-1", - regexp: /^[^∙]{0,2}(?=∙)|∙[^∙]{0,2}(?=∙|$)/gm, - penalty: 100 - }, - { - id: "short-compounds-3", - regexp: /^[^∙]{3}(?=∙)|∙[^∙]{3}(?=∙|$)/gm, - penalty: 50 + var check = strictCheck; + if (options && options.strict === false) { + check = relaxedCheck; } - ]; - function mapDictionaryInformationToWeightMap(dictInfo) { - const defs = (0, mapDictionaryInfo_js_1.mapDictionaryInformation)(dictInfo).concat(defaultDefs); - const adjustments = (0, mapDictionaryInfo_js_1.mapDictionaryInformationToAdjustment)(dictInfo); - const map = (0, weightedMaps_js_1.createWeightMap)(...defs); - (0, weightedMaps_js_1.addAdjustment)(map, ...defaultAdjustments, ...adjustments); - return map; - } - exports.mapDictionaryInformationToWeightMap = mapDictionaryInformationToWeightMap; - exports.__testing__ = {}; + return check(str); + }; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/memorizeLastCall.js -var require_memorizeLastCall = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/memorizeLastCall.js"(exports) { +// node_modules/glob-parent/index.js +var require_glob_parent = __commonJS({ + "node_modules/glob-parent/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.memorizeLastCall = void 0; - var SymEmpty = Symbol("memorizeLastCall"); - function memorizeLastCall(fn) { - let lastP = void 0; - let lastR = SymEmpty; - function calc(p) { - if (lastR !== SymEmpty && lastP === p) - return lastR; - lastP = p; - lastR = fn(p); - return lastR; - } - return calc; - } - exports.memorizeLastCall = memorizeLastCall; + var isGlob = require_is_glob(); + var pathPosixDirname = require("path").posix.dirname; + var isWin32 = require("os").platform() === "win32"; + var slash = "/"; + var backslash = /\\/g; + var enclosure = /[\{\[].*[\}\]]$/; + var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; + var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; + module2.exports = function globParent(str, opts) { + var options = Object.assign({ flipBackslashes: true }, opts); + if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { + str = str.replace(backslash, slash); + } + if (enclosure.test(str)) { + str += slash; + } + str += "a"; + do { + str = pathPosixDirname(str); + } while (isGlob(str) || globby.test(str)); + return str.replace(escaped, "$1"); + }; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/find.js -var require_find = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/find.js"(exports) { +// node_modules/fast-glob/out/utils/pattern.js +var require_pattern = __commonJS({ + "node_modules/fast-glob/out/utils/pattern.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.createFindOptions = exports.isForbiddenWord = exports.isEndOfWordNode = exports.findWordExact = exports.findCompoundNode = exports.findLegacyCompound = exports.findWordNode = exports.findWord = void 0; - var constants_js_1 = require_constants4(); - var TrieNode_js_1 = require_TrieNode(); - var memorizeLastCall_js_1 = require_memorizeLastCall(); - var mergeDefaults_js_1 = require_mergeDefaults(); - var defaultLegacyMinCompoundLength = 3; - var _defaultFindOptions = { - matchCase: false, - compoundMode: "compound", - forbidPrefix: constants_js_1.FORBID_PREFIX, - compoundFix: constants_js_1.COMPOUND_FIX, - caseInsensitivePrefix: constants_js_1.CASE_INSENSITIVE_PREFIX, - legacyMinCompoundLength: defaultLegacyMinCompoundLength - }; - var arrayCompoundModes = ["none", "compound", "legacy"]; - var knownCompoundModes = new Map(arrayCompoundModes.map((a) => [a, a])); - function findWord(root, word, options) { - return _findWord(root, word, (0, exports.createFindOptions)(options)); - } - exports.findWord = findWord; - function findWordNode(root, word, options) { - return _findWordNode(root, word, (0, exports.createFindOptions)(options)); - } - exports.findWordNode = findWordNode; - function _findWord(root, word, options) { - const { node: _, ...result } = _findWordNode(root, word, options); - return result; + exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0; + var path26 = require("path"); + var globParent = require_glob_parent(); + var micromatch = require_micromatch(); + var GLOBSTAR = "**"; + var ESCAPE_SYMBOL = "\\"; + var COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/; + var REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/; + var REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/; + var GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/; + var BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./; + var DOUBLE_SLASH_RE = /(?!^)\/{2,}/g; + function isStaticPattern(pattern, options = {}) { + return !isDynamicPattern(pattern, options); } - function _findWordNode(root, word, options) { - const compoundMode = knownCompoundModes.get(options.compoundMode) || _defaultFindOptions.compoundMode; - const compoundPrefix = options.compoundMode === "compound" ? root.compoundCharacter ?? options.compoundFix : ""; - const ignoreCasePrefix = options.matchCase ? "" : root.stripCaseAndAccentsPrefix ?? options.caseInsensitivePrefix; - function __findCompound() { - const f = findCompoundWord(root, word, compoundPrefix, ignoreCasePrefix); - const result = { ...f }; - if (f.found !== false && f.compoundUsed) { - const r = !f.caseMatched ? walk(root, options.caseInsensitivePrefix) : root; - result.forbidden = isForbiddenWord(r, word, options.forbidPrefix); - } - return result; + exports.isStaticPattern = isStaticPattern; + function isDynamicPattern(pattern, options = {}) { + if (pattern === "") { + return false; } - function __findExact() { - const n = walk(root, word); - const isFound = isEndOfWordNode(n); - const result = { - found: isFound && word, - compoundUsed: false, - forbidden: isForbiddenWord(root, word, options.forbidPrefix), - node: n, - caseMatched: true - }; - return result; + if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) { + return true; } - switch (compoundMode) { - case "none": - return options.matchCase ? __findExact() : __findCompound(); - case "compound": - return __findCompound(); - case "legacy": - return findLegacyCompound(root, word, options); + if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) { + return true; } - } - function findLegacyCompound(root, word, options) { - const roots = [root]; - if (!options.matchCase) { - roots.push(walk(root, options.caseInsensitivePrefix)); + if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) { + return true; + } + if (options.braceExpansion !== false && hasBraceExpansion(pattern)) { + return true; } - return findLegacyCompoundNode(roots, word, options.legacyMinCompoundLength); + return false; } - exports.findLegacyCompound = findLegacyCompound; - function findCompoundNode(root, word, compoundCharacter, ignoreCasePrefix) { - const stack = [ - // { n: root, compoundPrefix: '', cr: undefined, caseMatched: true }, - { n: root, compoundPrefix: ignoreCasePrefix, cr: void 0, caseMatched: true } - ]; - const compoundPrefix = compoundCharacter || ignoreCasePrefix; - const possibleCompoundPrefix = ignoreCasePrefix && compoundCharacter ? ignoreCasePrefix + compoundCharacter : ""; - const w = word.normalize(); - function determineRoot(s) { - const prefix = s.compoundPrefix; - let r = root; - let i2; - for (i2 = 0; i2 < prefix.length && r; ++i2) { - r = r.c?.get(prefix[i2]); - } - const caseMatched2 = s.caseMatched && prefix[0] !== ignoreCasePrefix; - return { - n: s.n, - compoundPrefix: prefix === compoundPrefix ? possibleCompoundPrefix : "", - cr: r, - caseMatched: caseMatched2 - }; + exports.isDynamicPattern = isDynamicPattern; + function hasBraceExpansion(pattern) { + const openingBraceIndex = pattern.indexOf("{"); + if (openingBraceIndex === -1) { + return false; } - let compoundUsed = false; - let caseMatched = true; - let i = 0; - let node; - while (true) { - const s = stack[i]; - const h = w[i++]; - const n = s.cr || s.n; - const c = n?.c?.get(h); - if (c && i < word.length) { - caseMatched = s.caseMatched; - stack[i] = { n: c, compoundPrefix, cr: void 0, caseMatched }; - } else if (!c || !c.f) { - node = node || c; - while (--i > 0 && (!stack[i].compoundPrefix || !stack[i].n?.c?.has(compoundCharacter))) { - } - if (i >= 0 && stack[i].compoundPrefix) { - compoundUsed = i > 0; - const r = determineRoot(stack[i]); - stack[i] = r; - if (!r.cr) { - break; - } - if (!i && !r.caseMatched) { - if (w !== w.toLowerCase()) { - break; - } - } - } else { - break; - } - } else { - node = c; - caseMatched = s.caseMatched; - break; - } + const closingBraceIndex = pattern.indexOf("}", openingBraceIndex + 1); + if (closingBraceIndex === -1) { + return false; } - const found = i && i === word.length && word || false; - const result = { found, compoundUsed, node, forbidden: void 0, caseMatched }; - return result; + const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex); + return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent); } - exports.findCompoundNode = findCompoundNode; - function findCompoundWord(root, word, compoundCharacter, ignoreCasePrefix) { - const { found, compoundUsed, node, caseMatched } = findCompoundNode(root, word, compoundCharacter, ignoreCasePrefix); - if (!node || !node.f) { - return { found: false, compoundUsed, node, forbidden: void 0, caseMatched }; - } - return { found, compoundUsed, node, forbidden: void 0, caseMatched }; + function convertToPositivePattern(pattern) { + return isNegativePattern(pattern) ? pattern.slice(1) : pattern; } - function findWordExact(root, word) { - return isEndOfWordNode(walk(root, word)); + exports.convertToPositivePattern = convertToPositivePattern; + function convertToNegativePattern(pattern) { + return "!" + pattern; } - exports.findWordExact = findWordExact; - function isEndOfWordNode(n) { - return n?.f === TrieNode_js_1.FLAG_WORD; + exports.convertToNegativePattern = convertToNegativePattern; + function isNegativePattern(pattern) { + return pattern.startsWith("!") && pattern[1] !== "("; } - exports.isEndOfWordNode = isEndOfWordNode; - function walk(root, word) { - const w = word; - let n = root; - let i = 0; - while (n && i < word.length) { - const h = w[i++]; - n = n.c?.get(h); + exports.isNegativePattern = isNegativePattern; + function isPositivePattern(pattern) { + return !isNegativePattern(pattern); + } + exports.isPositivePattern = isPositivePattern; + function getNegativePatterns(patterns) { + return patterns.filter(isNegativePattern); + } + exports.getNegativePatterns = getNegativePatterns; + function getPositivePatterns(patterns) { + return patterns.filter(isPositivePattern); + } + exports.getPositivePatterns = getPositivePatterns; + function getPatternsInsideCurrentDirectory(patterns) { + return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern)); + } + exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory; + function getPatternsOutsideCurrentDirectory(patterns) { + return patterns.filter(isPatternRelatedToParentDirectory); + } + exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory; + function isPatternRelatedToParentDirectory(pattern) { + return pattern.startsWith("..") || pattern.startsWith("./.."); + } + exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory; + function getBaseDirectory(pattern) { + return globParent(pattern, { flipBackslashes: false }); + } + exports.getBaseDirectory = getBaseDirectory; + function hasGlobStar(pattern) { + return pattern.includes(GLOBSTAR); + } + exports.hasGlobStar = hasGlobStar; + function endsWithSlashGlobStar(pattern) { + return pattern.endsWith("/" + GLOBSTAR); + } + exports.endsWithSlashGlobStar = endsWithSlashGlobStar; + function isAffectDepthOfReadingPattern(pattern) { + const basename7 = path26.basename(pattern); + return endsWithSlashGlobStar(pattern) || isStaticPattern(basename7); + } + exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; + function expandPatternsWithBraceExpansion(patterns) { + return patterns.reduce((collection, pattern) => { + return collection.concat(expandBraceExpansion(pattern)); + }, []); + } + exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion; + function expandBraceExpansion(pattern) { + const patterns = micromatch.braces(pattern, { expand: true, nodupes: true }); + patterns.sort((a, b) => a.length - b.length); + return patterns.filter((pattern2) => pattern2 !== ""); + } + exports.expandBraceExpansion = expandBraceExpansion; + function getPatternParts(pattern, options) { + let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true })); + if (parts.length === 0) { + parts = [pattern]; } - return n; + if (parts[0].startsWith("/")) { + parts[0] = parts[0].slice(1); + parts.unshift(""); + } + return parts; } - function findLegacyCompoundNode(roots, word, minCompoundLength) { - const root = roots[0]; - const numRoots = roots.length; - const stack = [ - { n: root, usedRoots: 1, subLength: 0, isCompound: false, cr: void 0, caseMatched: true } - ]; - const w = word; - const wLen = w.length; - let compoundUsed = false; - let caseMatched = true; - let i = 0; - let node; - while (true) { - const s = stack[i]; - const h = w[i++]; - const n = s.cr || s.n; - const c = n?.c?.get(h); - if (c && i < wLen) { - stack[i] = { - n: c, - usedRoots: 0, - subLength: s.subLength + 1, - isCompound: s.isCompound, - cr: void 0, - caseMatched: s.caseMatched - }; - } else if (!c || !c.f || c.f && s.subLength < minCompoundLength - 1) { - while (--i > 0) { - const s2 = stack[i]; - if (s2.usedRoots < numRoots && s2.n?.f && (s2.subLength >= minCompoundLength || !s2.subLength) && wLen - i >= minCompoundLength) { - break; + exports.getPatternParts = getPatternParts; + function makeRe(pattern, options) { + return micromatch.makeRe(pattern, options); + } + exports.makeRe = makeRe; + function convertPatternsToRe(patterns, options) { + return patterns.map((pattern) => makeRe(pattern, options)); + } + exports.convertPatternsToRe = convertPatternsToRe; + function matchAny(entry, patternsRe) { + return patternsRe.some((patternRe) => patternRe.test(entry)); + } + exports.matchAny = matchAny; + function removeDuplicateSlashes(pattern) { + return pattern.replace(DOUBLE_SLASH_RE, "/"); + } + exports.removeDuplicateSlashes = removeDuplicateSlashes; + } +}); + +// node_modules/merge2/index.js +var require_merge2 = __commonJS({ + "node_modules/merge2/index.js"(exports, module2) { + "use strict"; + var Stream3 = require("stream"); + var PassThrough2 = Stream3.PassThrough; + var slice = Array.prototype.slice; + module2.exports = merge22; + function merge22() { + const streamsQueue = []; + const args = slice.call(arguments); + let merging = false; + let options = args[args.length - 1]; + if (options && !Array.isArray(options) && options.pipe == null) { + args.pop(); + } else { + options = {}; + } + const doEnd = options.end !== false; + const doPipeError = options.pipeError === true; + if (options.objectMode == null) { + options.objectMode = true; + } + if (options.highWaterMark == null) { + options.highWaterMark = 64 * 1024; + } + const mergedStream = PassThrough2(options); + function addStream() { + for (let i = 0, len = arguments.length; i < len; i++) { + streamsQueue.push(pauseStreams(arguments[i], options)); + } + mergeStream(); + return this; + } + function mergeStream() { + if (merging) { + return; + } + merging = true; + let streams = streamsQueue.shift(); + if (!streams) { + process.nextTick(endStream); + return; + } + if (!Array.isArray(streams)) { + streams = [streams]; + } + let pipesCount = streams.length + 1; + function next() { + if (--pipesCount > 0) { + return; + } + merging = false; + mergeStream(); + } + function pipe2(stream) { + function onend() { + stream.removeListener("merge2UnpipeEnd", onend); + stream.removeListener("end", onend); + if (doPipeError) { + stream.removeListener("error", onerror); } + next(); } - if (i > 0 || stack[i].usedRoots < numRoots) { - compoundUsed = i > 0; - const s2 = stack[i]; - s2.cr = roots[s2.usedRoots++]; - s2.subLength = 0; - s2.isCompound = compoundUsed; - s2.caseMatched = s2.caseMatched && s2.usedRoots <= 1; - } else { - break; + function onerror(err) { + mergedStream.emit("error", err); } - } else { - node = c; - caseMatched = s.caseMatched; - break; + if (stream._readableState.endEmitted) { + return next(); + } + stream.on("merge2UnpipeEnd", onend); + stream.on("end", onend); + if (doPipeError) { + stream.on("error", onerror); + } + stream.pipe(mergedStream, { end: false }); + stream.resume(); + } + for (let i = 0; i < streams.length; i++) { + pipe2(streams[i]); } + next(); } - function extractWord() { - if (!word || i < word.length) - return false; - const letters = []; - let subLen = 0; - for (let j = 0; j < i; ++j) { - const { subLength } = stack[j]; - if (subLength < subLen) { - letters.push("+"); - } - letters.push(word[j]); - subLen = subLength; + function endStream() { + merging = false; + mergedStream.emit("queueDrain"); + if (doEnd) { + mergedStream.end(); } - return letters.join(""); } - const found = extractWord(); - const result = { found, compoundUsed, node, forbidden: void 0, caseMatched }; - return result; - } - function findLegacyCompoundWord(roots, word, minCompoundLength) { - const { found, compoundUsed, caseMatched } = findLegacyCompoundNode(roots, word, minCompoundLength); - return { found, compoundUsed, caseMatched }; - } - function isForbiddenWord(root, word, forbiddenPrefix) { - return findWordExact(root?.c?.get(forbiddenPrefix), word); + mergedStream.setMaxListeners(0); + mergedStream.add = addStream; + mergedStream.on("unpipe", function(stream) { + stream.emit("merge2UnpipeEnd"); + }); + if (args.length) { + addStream.apply(null, args); + } + return mergedStream; } - exports.isForbiddenWord = isForbiddenWord; - exports.createFindOptions = (0, memorizeLastCall_js_1.memorizeLastCall)(_createFindOptions); - function _createFindOptions(options) { - return (0, mergeDefaults_js_1.mergeDefaults)(options, _defaultFindOptions); + function pauseStreams(streams, options) { + if (!Array.isArray(streams)) { + if (!streams._readableState && streams.pipe) { + streams = streams.pipe(PassThrough2(options)); + } + if (!streams._readableState || !streams.pause || !streams.pipe) { + throw new Error("Only readable stream can be merged."); + } + streams.pause(); + } else { + for (let i = 0, len = streams.length; i < len; i++) { + streams[i] = pauseStreams(streams[i], options); + } + } + return streams; } - exports.__testing__ = { - findLegacyCompoundWord - }; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/clean.js -var require_clean = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/clean.js"(exports) { +// node_modules/fast-glob/out/utils/stream.js +var require_stream = __commonJS({ + "node_modules/fast-glob/out/utils/stream.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.clean = void 0; - function clean2(t) { - const copy = { ...t }; - for (const key of Object.keys(copy)) { - if (copy[key] === void 0) { - delete copy[key]; - } - } - return copy; + exports.merge = void 0; + var merge22 = require_merge2(); + function merge4(streams) { + const mergedStream = merge22(streams); + streams.forEach((stream) => { + stream.once("error", (error2) => mergedStream.emit("error", error2)); + }); + mergedStream.once("close", () => propagateCloseEventToSources(streams)); + mergedStream.once("end", () => propagateCloseEventToSources(streams)); + return mergedStream; + } + exports.merge = merge4; + function propagateCloseEventToSources(streams) { + streams.forEach((stream) => stream.emit("close")); } - exports.clean = clean2; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/isDefined.js -var require_isDefined = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/isDefined.js"(exports) { +// node_modules/fast-glob/out/utils/string.js +var require_string = __commonJS({ + "node_modules/fast-glob/out/utils/string.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.isDefined = void 0; - function isDefined2(t) { - return t !== void 0; + exports.isEmpty = exports.isString = void 0; + function isString3(input) { + return typeof input === "string"; } - exports.isDefined = isDefined2; + exports.isString = isString3; + function isEmpty2(input) { + return input === ""; + } + exports.isEmpty = isEmpty2; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/walker/hintedWalker.js -var require_hintedWalker = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/walker/hintedWalker.js"(exports) { +// node_modules/fast-glob/out/utils/index.js +var require_utils7 = __commonJS({ + "node_modules/fast-glob/out/utils/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.hintedWalker = void 0; - var isDefined_js_1 = require_isDefined(); - var walkerTypes_js_1 = require_walkerTypes(); - function hintedWalker(root, ignoreCase, hint, compoundingMethod, emitWordSeparator) { - return hintedWalkerNext(root, ignoreCase, hint, compoundingMethod, emitWordSeparator); - } - exports.hintedWalker = hintedWalker; - function* hintedWalkerNext(root, ignoreCase, hint, compoundingMethod, emitWordSeparator = "") { - const _compoundingMethod = compoundingMethod ?? walkerTypes_js_1.CompoundWordsMethod.NONE; - const compoundCharacter = root.compoundCharacter; - const noCaseCharacter = root.stripCaseAndAccentsPrefix; - const rawRoots = [root, ignoreCase ? root.c.get(noCaseCharacter) : void 0].filter(isDefined_js_1.isDefined); - const specialRootsPrefix = existMap([compoundCharacter, noCaseCharacter, root.forbiddenWordPrefix]); - function filterRoot(root2) { - const children2 = root2.c?.entries(); - const c = children2 && [...children2].filter(([v]) => !(v in specialRootsPrefix)); - return { - c: c && new Map(c) - }; - } - const roots = rawRoots.map(filterRoot); - const compoundRoots = rawRoots.map((r) => r.c?.get(compoundCharacter)).filter(isDefined_js_1.isDefined); - const setOfCompoundRoots = new Set(compoundRoots); - const rootsForCompoundMethods = roots.concat(compoundRoots); - const compoundMethodRoots = { - [walkerTypes_js_1.CompoundWordsMethod.NONE]: [], - [walkerTypes_js_1.CompoundWordsMethod.JOIN_WORDS]: [...rootsForCompoundMethods.map((r) => [walkerTypes_js_1.JOIN_SEPARATOR, r])], - [walkerTypes_js_1.CompoundWordsMethod.SEPARATE_WORDS]: [...rootsForCompoundMethods.map((r) => [walkerTypes_js_1.WORD_SEPARATOR, r])] - }; - function* children(n, hintOffset) { - if (n.c) { - const h = hint.slice(hintOffset, hintOffset + 3) + hint.slice(Math.max(0, hintOffset - 2), hintOffset); - const hints = new Set(h); - const c = n.c; - yield* [...hints].filter((a) => c.has(a)).map((letter) => ({ - letter, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - node: c.get(letter), - hintOffset: hintOffset + 1 - })); - hints.add(compoundCharacter); - yield* [...c].filter((a) => !hints.has(a[0])).map(([letter, node]) => ({ - letter, - node, - hintOffset: hintOffset + 1 - })); - if (c.has(compoundCharacter) && !setOfCompoundRoots.has(n)) { - for (const compoundRoot of compoundRoots) { - for (const child of children(compoundRoot, hintOffset)) { - const { letter, node, hintOffset: hintOffset2 } = child; - yield { letter: emitWordSeparator + letter, node, hintOffset: hintOffset2 }; - } - } - } - } - if (n.f) { - yield* [...compoundMethodRoots[_compoundingMethod]].map(([letter, node]) => ({ - letter, - node, - hintOffset - })); - } - } - for (const root2 of roots) { - let depth = 0; - const stack = []; - const stackText = [""]; - stack[depth] = children(root2, depth); - let ir; - while (depth >= 0) { - while (!(ir = stack[depth].next()).done) { - const { letter: char, node, hintOffset } = ir.value; - const text = stackText[depth] + char; - const hinting = yield { text, node, depth }; - if (hinting && hinting.goDeeper) { - depth++; - stackText[depth] = text; - stack[depth] = children(node, hintOffset); - } - } - depth -= 1; - } - } - } - function existMap(values) { - const m = /* @__PURE__ */ Object.create(null); - for (const v of values) { - m[v] = true; - } - return m; - } - exports.__testing__ = { - hintedWalkerNext - }; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/walker/index.js -var require_walker2 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/walker/index.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __exportStar = exports && exports.__exportStar || function(m, exports2) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) - __createBinding(exports2, m, p); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.hintedWalker = void 0; - var hintedWalker_js_1 = require_hintedWalker(); - Object.defineProperty(exports, "hintedWalker", { enumerable: true, get: function() { - return hintedWalker_js_1.hintedWalker; - } }); - __exportStar(require_walker(), exports); - __exportStar(require_walkerTypes(), exports); + exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0; + var array = require_array2(); + exports.array = array; + var errno = require_errno(); + exports.errno = errno; + var fs9 = require_fs(); + exports.fs = fs9; + var path26 = require_path(); + exports.path = path26; + var pattern = require_pattern(); + exports.pattern = pattern; + var stream = require_stream(); + exports.stream = stream; + var string = require_string(); + exports.string = string; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/suggestions/genSuggestionsOptions.js -var require_genSuggestionsOptions = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/suggestions/genSuggestionsOptions.js"(exports) { +// node_modules/fast-glob/out/managers/tasks.js +var require_tasks = __commonJS({ + "node_modules/fast-glob/out/managers/tasks.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.createSuggestionOptions = exports.defaultSuggestionOptions = exports.defaultGenSuggestionOptions = void 0; - var index_js_1 = require_walker2(); - exports.defaultGenSuggestionOptions = { - compoundMethod: index_js_1.CompoundWordsMethod.NONE, - ignoreCase: true, - changeLimit: 5 - }; - exports.defaultSuggestionOptions = { - ...exports.defaultGenSuggestionOptions, - numSuggestions: 8, - includeTies: true, - timeout: 5e3 - }; - var keyMapOfGenSuggestionOptionsStrict = { - changeLimit: "changeLimit", - compoundMethod: "compoundMethod", - ignoreCase: "ignoreCase", - compoundSeparator: "compoundSeparator" - }; - var keyMapOfSuggestionOptionsStrict = { - ...keyMapOfGenSuggestionOptionsStrict, - filter: "filter", - includeTies: "includeTies", - numSuggestions: "numSuggestions", - timeout: "timeout", - weightMap: "weightMap" - }; - function createSuggestionOptions(...opts) { - const options = { ...exports.defaultSuggestionOptions }; - const keys = Object.keys(keyMapOfSuggestionOptionsStrict); - for (const opt of opts) { - for (const key of keys) { - assign(options, opt, key); - } + exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0; + var utils = require_utils7(); + function generate(input, settings) { + const patterns = processPatterns(input, settings); + const ignore = processPatterns(settings.ignore, settings); + const positivePatterns = getPositivePatterns(patterns); + const negativePatterns = getNegativePatternsAsPositive(patterns, ignore); + const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings)); + const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings)); + const staticTasks = convertPatternsToTasks( + staticPatterns, + negativePatterns, + /* dynamic */ + false + ); + const dynamicTasks = convertPatternsToTasks( + dynamicPatterns, + negativePatterns, + /* dynamic */ + true + ); + return staticTasks.concat(dynamicTasks); + } + exports.generate = generate; + function processPatterns(input, settings) { + let patterns = input; + if (settings.braceExpansion) { + patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns); } - return options; + if (settings.baseNameMatch) { + patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`); + } + return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern)); } - exports.createSuggestionOptions = createSuggestionOptions; - function assign(dest, src, k) { - dest[k] = src[k] ?? dest[k]; + function convertPatternsToTasks(positive, negative, dynamic) { + const tasks = []; + const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive); + const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive); + const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory); + const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory); + tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic)); + if ("." in insideCurrentDirectoryGroup) { + tasks.push(convertPatternGroupToTask(".", patternsInsideCurrentDirectory, negative, dynamic)); + } else { + tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic)); + } + return tasks; } - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/suggestions/orthography.js -var require_orthography = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/suggestions/orthography.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.visualLetterMaskMap = exports.visualLetterGroups = exports.compare = void 0; - var intl = new Intl.Collator("en", { sensitivity: "base" }); - exports.compare = intl.compare; - exports.visualLetterGroups = [ - // cspell:disable - forms("\u01CE\xE0\xE5\xC4\xC0A\xE3\xE2\xE1\u01DF\u1EB7\u1EAF\u1EA5\u0100\u0101\u0103\u0105a\xE4\xE6\u0250\u0251\u03B1\u0430\u1FB3") + "\u1FB3", - forms("Bb\u1E03\u0432\u044A\u044C"), - forms("\u010B\u010C\u010Dc\u0109\xE7C\xC7\u0107\u010A\u0421\u0441\u03C2"), - forms("\u1E0E\u1E0B\u1E0F\u1E11\u010F\u0111\u1E0DDd"), - forms("\u0113\xEB\xC8\xCA\xCB\u1EC1\xE9\xE8\u1EBF\u1EC7\u0115eE\u0112\u0117\u0119\u011B\xEA\u0259\u025B\u0451\u0401\u0435\u0292"), - forms("f\u1E1FF"), - forms("\u0121\u0120\u011E\u01E7\u011D\u0123Gg\u0263"), - forms("\u0127\u0126\u0125\u1E25Hh\u1E24\u021F\u043D"), - forms("I\u012F\xEF\u0130\xCE\xCD\u012Bi\xCC\xEC\xED\xEE\u0131\u026A\u0268\u0457\u038A\u0399"), - forms("jJ\u0135"), - forms("\u0137Kk\u03BA\u043A\u045C"), - forms("\u1E37\u0142\u013E\u013CLl\u013A\u1E36\u03AF\u03B9"), - forms("M\u1E43\u1E41m"), - forms("n\u0146\xD1N\u1E47\u0148\u0147\xF1\u0144\u014B\u045D\u0438\u0439"), - forms("\xD2O\xF8\u022D\u014C\u014D\u0151\u1ECFo\xD6\xF2\u0231\u022F\xF3\xF4\xF5\xF6\u01A1\u0254\u03CC\u03B4\u043E"), - forms("P\u1E57p\u0440\u0420\u03C1"), - forms("Qq"), - forms("\u0159R\u1E5Br\u0155\u0157\u0453\u0433\u044F"), - forms("\u1E63\u0161\u0218\u1E62sS\u0160\u1E61\u015E\u015D\u015B\u0219\u0283\u03A3"), - forms("t\u021B\u021A\u0165T\u1E6D\u1E6C\u1E6B"), - forms("\xDC\xFC\xFB\u016A\u01B0\u016F\u016B\u0171\xFA\xDB\u016D\xD9\xF9u\u0173U"), - forms("Vv\u03BD"), - forms("\u0175wW\u1E83\u1E85\u1E81\u03C9\u0448"), - forms("xX\u0445"), - forms("\xFF\xFDY\u0177y\xDD\u1EF3\u0423\u045E\u0443"), - forms("Z\u1E93\u017E\u017D\u017C\u017B\u017Az") - // cspell:enable - ]; - function forms(letters) { - const n = letters.normalize("NFC").replace(/\p{M}/gu, ""); - const na = n.normalize("NFD").replace(/\p{M}/gu, ""); - const s = new Set(n + n.toLowerCase() + n.toUpperCase() + na + na.toLowerCase() + na.toUpperCase()); - return [...s].join(""); + exports.convertPatternsToTasks = convertPatternsToTasks; + function getPositivePatterns(patterns) { + return utils.pattern.getPositivePatterns(patterns); } - exports.visualLetterMaskMap = calcVisualLetterMasks(exports.visualLetterGroups); - function calcVisualLetterMasks(groups) { - const map = /* @__PURE__ */ Object.create(null); - for (let i = 0; i < groups.length; ++i) { - const m = 1 << i; - const g = groups[i]; - for (const c of g) { - map[c] = (map[c] || 0) | m; - } - } - return map; + exports.getPositivePatterns = getPositivePatterns; + function getNegativePatternsAsPositive(patterns, ignore) { + const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore); + const positive = negative.map(utils.pattern.convertToPositivePattern); + return positive; } - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/timer.js -var require_timer = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/timer.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.polyHrTime = exports.toMilliseconds = exports.createTimer = void 0; - var _hrTime = process?.hrtime || polyHrTime; - function createTimer(hrTimeFn = _hrTime) { - let start = hrTimeFn(); - return { - start() { - start = hrTimeFn(); - }, - elapsed() { - return toMilliseconds(hrTimeFn(start)); + exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive; + function groupPatternsByBaseDirectory(patterns) { + const group = {}; + return patterns.reduce((collection, pattern) => { + const base = utils.pattern.getBaseDirectory(pattern); + if (base in collection) { + collection[base].push(pattern); + } else { + collection[base] = [pattern]; } - }; + return collection; + }, group); } - exports.createTimer = createTimer; - function toMilliseconds(t) { - return (t[0] + t[1] * 1e-9) * 1e3; + exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; + function convertPatternGroupsToTasks(positive, negative, dynamic) { + return Object.keys(positive).map((base) => { + return convertPatternGroupToTask(base, positive[base], negative, dynamic); + }); } - exports.toMilliseconds = toMilliseconds; - function polyHrTime(time) { - const now = Date.now() - (time ? toMilliseconds(time) : 0); - const inSeconds = now * 1e-3; - const s = Math.floor(inSeconds); - const n = (inSeconds - s) * 1e9; - return [s, n]; + exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks; + function convertPatternGroupToTask(base, positive, negative, dynamic) { + return { + dynamic, + positive, + negative, + base, + patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern)) + }; } - exports.polyHrTime = polyHrTime; + exports.convertPatternGroupToTask = convertPatternGroupToTask; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/suggestions/suggestCollector.js -var require_suggestCollector = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/suggestions/suggestCollector.js"(exports) { +// node_modules/@nodelib/fs.stat/out/providers/async.js +var require_async = __commonJS({ + "node_modules/@nodelib/fs.stat/out/providers/async.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.isSuggestionResult = exports.impersonateCollector = exports.suggestionCollector = exports.defaultSuggestionCollectorOptions = exports.compSuggestionResults = void 0; - var index_js_1 = require_distance2(); - var weightedMaps_js_1 = require_weightedMaps(); - var timer_js_1 = require_timer(); - var util_js_1 = require_util6(); - var index_js_2 = require_walker2(); - var constants_js_1 = require_constants5(); - var defaultMaxNumberSuggestions = 10; - var BASE_COST = 100; - var MAX_NUM_CHANGES = 5; - var MAX_COST_SCALE = 0.5; - var MAX_ALLOWED_COST_SCALE = 1.03 * MAX_COST_SCALE; - var collator = new Intl.Collator(); - var regexSeparator = new RegExp(`[${(0, util_js_1.regexQuote)(index_js_2.WORD_SEPARATOR)}]`, "g"); - var wordLengthCost = [0, 50, 25, 5, 0]; - var EXTRA_WORD_COST = 5; - var DEFAULT_COLLECTOR_TIMEOUT = 1e3; - var symStopProcessing = Symbol("Collector Stop Processing"); - function compSuggestionResults(a, b) { - const aPref = a.isPreferred && -1 || 0; - const bPref = b.isPreferred && -1 || 0; - return aPref - bPref || a.cost - b.cost || a.word.length - b.word.length || collator.compare(a.word, b.word); - } - exports.compSuggestionResults = compSuggestionResults; - exports.defaultSuggestionCollectorOptions = Object.freeze({ - numSuggestions: defaultMaxNumberSuggestions, - filter: () => true, - changeLimit: MAX_NUM_CHANGES, - includeTies: false, - ignoreCase: true, - timeout: DEFAULT_COLLECTOR_TIMEOUT, - weightMap: void 0, - compoundSeparator: "", - compoundMethod: void 0 - }); - function suggestionCollector(wordToMatch, options) { - const { filter = () => true, changeLimit = MAX_NUM_CHANGES, includeTies = false, ignoreCase = true, timeout = DEFAULT_COLLECTOR_TIMEOUT, weightMap, compoundSeparator = exports.defaultSuggestionCollectorOptions.compoundSeparator } = options; - const numSuggestions = Math.max(options.numSuggestions, 0) || 0; - const numSugToHold = weightMap ? numSuggestions * 2 : numSuggestions; - const sugs = /* @__PURE__ */ new Map(); - let maxCost = BASE_COST * Math.min(wordToMatch.length * MAX_ALLOWED_COST_SCALE, changeLimit); - const useSeparator = compoundSeparator || (weightMap ? constants_js_1.DEFAULT_COMPOUNDED_WORD_SEPARATOR : exports.defaultSuggestionCollectorOptions.compoundSeparator); - const fnCleanWord = !useSeparator || useSeparator === compoundSeparator ? (w) => w : (0, util_js_1.replaceAllFactory)(useSeparator, ""); - if (useSeparator && weightMap) { - (0, weightedMaps_js_1.addDefToWeightMap)(weightMap, { map: useSeparator, insDel: 50 }); - } - const genSuggestionOptions = (0, util_js_1.clean)({ - changeLimit, - ignoreCase, - compoundMethod: options.compoundMethod, - compoundSeparator: useSeparator - }); - let timeRemaining = timeout; - function dropMax() { - if (sugs.size < 2 || !numSuggestions) { - sugs.clear(); + exports.read = void 0; + function read2(path26, settings, callback) { + settings.fs.lstat(path26, (lstatError, lstat) => { + if (lstatError !== null) { + callFailureCallback(callback, lstatError); return; } - const sorted = [...sugs.values()].sort(compSuggestionResults); - let i = numSugToHold - 1; - maxCost = sorted[i].cost; - for (; i < sorted.length && sorted[i].cost <= maxCost; ++i) { - } - for (; i < sorted.length; ++i) { - sugs.delete(sorted[i].word); - } - } - function adjustCost(sug) { - if (sug.isPreferred) - return sug; - const words = sug.word.split(regexSeparator); - const extraCost = words.map((w) => wordLengthCost[w.length] || 0).reduce((a, b) => a + b, 0) + (words.length - 1) * EXTRA_WORD_COST; - return { word: sug.word, cost: sug.cost + extraCost }; - } - function collectSuggestion(suggestion) { - const { word, cost, isPreferred } = adjustCost(suggestion); - if (cost <= maxCost && filter(suggestion.word, cost)) { - const known = sugs.get(word); - if (known) { - known.cost = Math.min(known.cost, cost); - known.isPreferred = known.isPreferred || isPreferred; - } else { - sugs.set(word, { word, cost, isPreferred }); - if (cost < maxCost && sugs.size > numSugToHold) { - dropMax(); - } - } - } - return maxCost; - } - function collect(src, timeout2, filter2) { - let stop = false; - timeout2 = timeout2 ?? timeRemaining; - timeout2 = Math.min(timeout2, timeRemaining); - if (timeout2 < 0) + if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { + callSuccessCallback(callback, lstat); return; - const timer = (0, timer_js_1.createTimer)(); - let ir; - while (!(ir = src.next(stop || maxCost)).done) { - if (timer.elapsed() > timeout2) { - stop = symStopProcessing; - } - const { value } = ir; - if (!value) - continue; - if (isSuggestionResult(value)) { - if (!filter2 || filter2(value.word, value.cost)) { - collectSuggestion(value); + } + settings.fs.stat(path26, (statError, stat2) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + callFailureCallback(callback, statError); + return; } - continue; + callSuccessCallback(callback, lstat); + return; } - } - timeRemaining -= timer.elapsed(); - } - function cleanCompoundResult(sr) { - const { word, cost } = sr; - const cWord = fnCleanWord(word); - if (cWord !== word) { - return { - word: cWord, - cost, - compoundWord: word, - isPreferred: void 0 - }; - } - return { ...sr }; - } - function suggestions() { - if (numSuggestions < 1 || !sugs.size) - return []; - const NF = "NFD"; - const nWordToMatch = wordToMatch.normalize(NF); - const rawValues = [...sugs.values()]; - const values = weightMap ? rawValues.map(({ word, cost, isPreferred }) => ({ - word, - cost: isPreferred ? cost : (0, index_js_1.editDistanceWeighted)(nWordToMatch, word.normalize(NF), weightMap, 110), - isPreferred - })) : rawValues; - const sorted = values.sort(compSuggestionResults).map(cleanCompoundResult); - let i = Math.min(sorted.length, numSuggestions) - 1; - const limit = includeTies ? sorted.length : Math.min(sorted.length, numSuggestions); - const iCost = sorted[i].cost; - const maxCost2 = Math.min(iCost, weightMap ? changeLimit * BASE_COST - 1 : iCost); - for (i = 1; i < limit && sorted[i].cost <= maxCost2; ++i) { - } - sorted.length = i; - return sorted; - } - const collector = { - collect, - add: function(suggestion) { - collectSuggestion(suggestion); - return this; - }, - get suggestions() { - return suggestions(); - }, - get maxCost() { - return maxCost; - }, - get word() { - return wordToMatch; - }, - get maxNumSuggestions() { - return numSuggestions; - }, - get changeLimit() { - return changeLimit; - }, - includesTies: includeTies, - ignoreCase, - symbolStopProcessing: symStopProcessing, - genSuggestionOptions - }; - return collector; + if (settings.markSymbolicLink) { + stat2.isSymbolicLink = () => true; + } + callSuccessCallback(callback, stat2); + }); + }); } - exports.suggestionCollector = suggestionCollector; - function impersonateCollector(collector, word) { - const r = Object.create(collector); - Object.defineProperty(r, "word", { value: word, writable: false }); - return r; + exports.read = read2; + function callFailureCallback(callback, error2) { + callback(error2); } - exports.impersonateCollector = impersonateCollector; - function isSuggestionResult(s) { - const r = s; - return r?.cost !== void 0 && r.word != void 0; + function callSuccessCallback(callback, result) { + callback(null, result); } - exports.isSuggestionResult = isSuggestionResult; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/suggestions/suggest.js -var require_suggest = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/suggestions/suggest.js"(exports) { +// node_modules/@nodelib/fs.stat/out/providers/sync.js +var require_sync = __commonJS({ + "node_modules/@nodelib/fs.stat/out/providers/sync.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.genCompoundableSuggestions = exports.genSuggestions = exports.suggest = void 0; - var trie_util_js_1 = require_trie_util(); - var clean_js_1 = require_clean(); - var index_js_1 = require_walker2(); - var genSuggestionsOptions_js_1 = require_genSuggestionsOptions(); - var orthography_js_1 = require_orthography(); - var suggestCollector_js_1 = require_suggestCollector(); - var baseCost = 100; - var swapCost = 75; - var postSwapCost = swapCost - baseCost; - var insertSpaceCost = -1; - var mapSubCost = 1; - var maxCostScale = 0.5; - var discourageInsertCost = baseCost; - var setOfSeparators = /* @__PURE__ */ new Set([index_js_1.JOIN_SEPARATOR, index_js_1.WORD_SEPARATOR]); - function suggest(root, word, options = {}) { - const opts = (0, genSuggestionsOptions_js_1.createSuggestionOptions)(options); - const collectorOpts = (0, clean_js_1.clean)(opts); - const collector = (0, suggestCollector_js_1.suggestionCollector)(word, collectorOpts); - collector.collect(genSuggestions(root, word, { ...opts, ...collector.genSuggestionOptions })); - return collector.suggestions; - } - exports.suggest = suggest; - function* genSuggestions(root, word, options = {}) { - const roots = Array.isArray(root) ? root : [root]; - for (const r of roots) { - yield* genCompoundableSuggestions(r, word, options); - } - return void 0; - } - exports.genSuggestions = genSuggestions; - function* genCompoundableSuggestions(root, word, options = {}) { - const { compoundMethod = index_js_1.CompoundWordsMethod.NONE, changeLimit, ignoreCase } = (0, genSuggestionsOptions_js_1.createSuggestionOptions)(options); - const history = []; - const historyTags = /* @__PURE__ */ new Map(); - const bc = baseCost; - const psc = postSwapCost; - const matrix = [[]]; - const stack = []; - const x = " " + word; - const mx = x.length - 1; - const specialInsCosts = Object.assign(/* @__PURE__ */ Object.create(null), { - [index_js_1.WORD_SEPARATOR]: insertSpaceCost, - [index_js_1.JOIN_SEPARATOR]: insertSpaceCost - }); - const specialSubCosts = Object.assign(/* @__PURE__ */ Object.create(null), { - "-": discourageInsertCost - }); - let stopNow = false; - let costLimit = bc * Math.min(word.length * maxCostScale, changeLimit); - function updateCostLimit(maxCost) { - switch (typeof maxCost) { - case "number": - costLimit = maxCost; - break; - case "symbol": - stopNow = true; - break; - } + exports.read = void 0; + function read2(path26, settings) { + const lstat = settings.fs.lstatSync(path26); + if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { + return lstat; } - const a = 0; - let b = 0; - for (let i = 0, c = 0; i <= mx && c <= costLimit; ++i) { - c = i * baseCost; - matrix[0][i] = c; - b = i; - } - stack[0] = { a, b }; - const hint = word; - const iWalk = (0, index_js_1.hintedWalker)(root, ignoreCase, hint, compoundMethod, options.compoundSeparator); - let goDeeper = true; - for (let r = iWalk.next({ goDeeper }); !stopNow && !r.done; r = iWalk.next({ goDeeper })) { - const { text, node, depth } = r.value; - let { a: a2, b: b2 } = stack[depth]; - const w = text.slice(-1); - const wG = orthography_js_1.visualLetterMaskMap[w] || 0; - if (setOfSeparators.has(w)) { - const mxRange = matrix[depth].slice(a2, b2 + 1); - const mxMin = Math.min(...mxRange); - const tag = [a2].concat(mxRange.map((c2) => c2 - mxMin)).join(); - const ht = historyTags.get(tag); - if (ht && ht.m <= mxMin) { - goDeeper = false; - const { i: i2, w: w2, m } = ht; - if (i2 >= history.length) { - continue; - } - const r2 = history[i2]; - if (r2.word.slice(0, w2.length) !== w2) { - continue; - } - const dc = mxMin - m; - for (let p = i2; p < history.length; ++p) { - const { word: word2, cost: hCost } = history[p]; - const fix = word2.slice(0, w2.length); - if (fix !== w2) { - break; - } - const cost2 = hCost + dc; - if (cost2 <= costLimit) { - const suffix = word2.slice(w2.length); - const emit = text + suffix; - updateCostLimit(yield { word: emit, cost: cost2 }); - } - } - continue; - } else { - historyTags.set(tag, { w: text, i: history.length, m: mxMin }); - } - } - const d = depth + 1; - const lastSugLetter = d > 1 ? text[d - 2] : ""; - const c = bc - d + (specialSubCosts[w] || 0); - const ci = c + (specialInsCosts[w] || 0); - matrix[d] = matrix[d] || []; - matrix[d][a2] = matrix[d - 1][a2] + ci + d - a2; - let lastLetter = x[a2]; - let min = matrix[d][a2]; - let i; - for (i = a2 + 1; i <= b2; ++i) { - const curLetter = x[i]; - const cG = orthography_js_1.visualLetterMaskMap[curLetter] || 0; - const subCost = w === curLetter ? 0 : wG & cG ? mapSubCost : curLetter === lastSugLetter ? w === lastLetter ? psc : c : c; - const e = Math.min( - matrix[d - 1][i - 1] + subCost, - // substitute - matrix[d - 1][i] + ci, - // insert - matrix[d][i - 1] + c - // delete - ); - min = Math.min(min, e); - matrix[d][i] = e; - lastLetter = curLetter; - } - const { b: bb } = stack[d - 1]; - while (b2 < mx) { - b2 += 1; - i = b2; - const curLetter = x[i]; - const cG = orthography_js_1.visualLetterMaskMap[curLetter] || 0; - const subCost = w === curLetter ? 0 : wG & cG ? mapSubCost : curLetter === lastSugLetter ? w === lastLetter ? psc : c : c; - const j = Math.min(bb, i - 1); - const e = Math.min( - matrix[d - 1][j] + subCost, - // substitute - matrix[d][i - 1] + c - // delete - ); - min = Math.min(min, e); - matrix[d][i] = e; - lastLetter = curLetter; - if (e > costLimit) - break; - } - for (; b2 > a2 && matrix[d][b2] > costLimit; b2 -= 1) { - } - for (; a2 < b2 && matrix[d][a2] > costLimit; a2 += 1) { + try { + const stat2 = settings.fs.statSync(path26); + if (settings.markSymbolicLink) { + stat2.isSymbolicLink = () => true; } - b2 = Math.min(b2 + 1, mx); - stack[d] = { a: a2, b: b2 }; - const cost = matrix[d][b2]; - if (node.f && (0, trie_util_js_1.isWordTerminationNode)(node) && cost <= costLimit) { - const r2 = { word: text, cost }; - history.push(r2); - updateCostLimit(yield r2); - } else { - updateCostLimit(yield void 0); + return stat2; + } catch (error2) { + if (!settings.throwErrorOnBrokenSymbolicLink) { + return lstat; } - goDeeper = min <= costLimit; + throw error2; } - return void 0; } - exports.genCompoundableSuggestions = genCompoundableSuggestions; - } -}); - -// node_modules/cspell-trie-lib/dist/cjs/lib/suggest.js -var require_suggest2 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/suggest.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.suggest = exports.genSuggestions = exports.genCompoundableSuggestions = void 0; - var suggest_js_1 = require_suggest(); - Object.defineProperty(exports, "genCompoundableSuggestions", { enumerable: true, get: function() { - return suggest_js_1.genCompoundableSuggestions; - } }); - Object.defineProperty(exports, "genSuggestions", { enumerable: true, get: function() { - return suggest_js_1.genSuggestions; - } }); - Object.defineProperty(exports, "suggest", { enumerable: true, get: function() { - return suggest_js_1.suggest; - } }); + exports.read = read2; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/trie.js -var require_trie = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/trie.js"(exports) { +// node_modules/@nodelib/fs.stat/out/adapters/fs.js +var require_fs2 = __commonJS({ + "node_modules/@nodelib/fs.stat/out/adapters/fs.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.Trie = exports.FORBID = exports.NORMALIZED = exports.OPTIONAL_COMPOUND = exports.COMPOUND = exports.OPTIONAL_COMPOUND_FIX = exports.FORBID_PREFIX = exports.defaultTrieOptions = exports.COMPOUND_FIX = exports.CASE_INSENSITIVE_PREFIX = void 0; - var gensequence_1 = require_dist2(); - var constants_js_1 = require_constants4(); - var find_js_1 = require_find(); - var suggest_js_1 = require_suggest2(); - var trie_util_js_1 = require_trie_util(); - var clean_js_1 = require_clean(); - var mergeOptionalWithDefaults_js_1 = require_mergeOptionalWithDefaults(); - var util_js_1 = require_util6(); - var index_js_1 = require_walker2(); - var constants_js_2 = require_constants4(); - Object.defineProperty(exports, "CASE_INSENSITIVE_PREFIX", { enumerable: true, get: function() { - return constants_js_2.CASE_INSENSITIVE_PREFIX; - } }); - Object.defineProperty(exports, "COMPOUND_FIX", { enumerable: true, get: function() { - return constants_js_2.COMPOUND_FIX; - } }); - Object.defineProperty(exports, "defaultTrieOptions", { enumerable: true, get: function() { - return constants_js_2.defaultTrieOptions; - } }); - Object.defineProperty(exports, "FORBID_PREFIX", { enumerable: true, get: function() { - return constants_js_2.FORBID_PREFIX; - } }); - Object.defineProperty(exports, "OPTIONAL_COMPOUND_FIX", { enumerable: true, get: function() { - return constants_js_2.OPTIONAL_COMPOUND_FIX; - } }); - exports.COMPOUND = constants_js_1.COMPOUND_FIX; - exports.OPTIONAL_COMPOUND = constants_js_1.OPTIONAL_COMPOUND_FIX; - exports.NORMALIZED = constants_js_1.CASE_INSENSITIVE_PREFIX; - exports.FORBID = constants_js_1.FORBID_PREFIX; - var defaultLegacyMinCompoundLength = 3; - var Trie = class _Trie { - constructor(root, count) { - this.root = root; - this.count = count; - this.lastCreateFindOptionsMatchCaseMap = /* @__PURE__ */ new Map(); - this._options = (0, mergeOptionalWithDefaults_js_1.mergeOptionalWithDefaults)(root); - this.isLegacy = this.calcIsLegacy(); - this.hasForbidden = !!root.c.get(root.forbiddenWordPrefix); - this._findOptionsDefaults = { - caseInsensitivePrefix: this._options.stripCaseAndAccentsPrefix, - compoundFix: this._options.compoundCharacter, - forbidPrefix: this._options.forbiddenWordPrefix - }; - this._findOptionsExact = this.createFindOptions({ compoundMode: "none" }); - } - /** - * Number of words in the Trie - */ - size() { - this.count = this.count ?? (0, trie_util_js_1.countWords)(this.root); - return this.count; - } - isSizeKnown() { - return this.count !== void 0; - } - get options() { - return this._options; - } - /** - * @param text - text to find in the Trie - * @param minCompoundLength - deprecated - allows words to be glued together - */ - find(text, minCompoundLength = false) { - const minLength = !minCompoundLength ? void 0 : minCompoundLength === true ? defaultLegacyMinCompoundLength : minCompoundLength; - const options = this.createFindOptions({ - compoundMode: minLength ? "legacy" : "compound", - legacyMinCompoundLength: minLength - }); - return (0, find_js_1.findWordNode)(this.root, text, options).node; - } - /** - * - * @param text - text to search for - * @param minCompoundLength - minimum word compound length - * @deprecated - this method is no longer needed since compounding can be explicitly defined by the dictionary words. - */ - findCompound(text, minCompoundLength = defaultLegacyMinCompoundLength) { - const options = this.createFindOptions({ legacyMinCompoundLength: minCompoundLength }); - const r = (0, find_js_1.findLegacyCompound)(this.root, text, options); - return r.node; - } - findExact(text) { - return (0, find_js_1.findWordNode)(this.root, text, this._findOptionsExact).node; - } - has(word, minLegacyCompoundLength) { - if (this.hasWord(word, false)) - return true; - if (minLegacyCompoundLength) { - const f = this.findWord(word, { useLegacyWordCompounds: minLegacyCompoundLength }); - return !!f.found; - } - return false; - } - /** - * Determine if a word is in the dictionary. - * @param word - the exact word to search for - must be normalized. - * @param caseSensitive - false means also searching a dictionary where the words were normalized to lower case and accents removed. - * @returns true if the word was found and is not forbidden. - */ - hasWord(word, caseSensitive) { - const f = this.findWord(word, { caseSensitive }); - return !!f.found && !f.forbidden; - } - findWord(word, options) { - if (options?.useLegacyWordCompounds) { - const len = options.useLegacyWordCompounds !== true ? options.useLegacyWordCompounds : defaultLegacyMinCompoundLength; - const findOptions2 = this.createFindOptions({ - legacyMinCompoundLength: len, - matchCase: options.caseSensitive - }); - return (0, find_js_1.findLegacyCompound)(this.root, word, findOptions2); - } - const findOptions = this.createFindOptionsMatchCase(options?.caseSensitive); - return (0, find_js_1.findWord)(this.root, word, findOptions); - } - /** - * Determine if a word is in the forbidden word list. - * @param word the word to lookup. - */ - isForbiddenWord(word) { - return this.hasForbidden && (0, find_js_1.isForbiddenWord)(this.root, word, this.options.forbiddenWordPrefix); - } - /** - * Provides an ordered sequence of words with the prefix of text. - */ - completeWord(text) { - const n = this.find(text); - const compoundChar = this.options.compoundCharacter; - const subNodes = (0, trie_util_js_1.iteratorTrieWords)(n || {}).filter((w) => w[w.length - 1] !== compoundChar).map((suffix) => text + suffix); - return (0, gensequence_1.genSequence)(n && (0, trie_util_js_1.isWordTerminationNode)(n) ? [text] : []).concat(subNodes); - } - /** - * Suggest spellings for `text`. The results are sorted by edit distance with changes near the beginning of a word having a greater impact. - * @param text - the text to search for - * @param maxNumSuggestions - the maximum number of suggestions to return. - * @param compoundMethod - Use to control splitting words. - * @param numChanges - the maximum number of changes allowed to text. This is an approximate value, since some changes cost less than others. - * the lower the value, the faster results are returned. Values less than 4 are best. - */ - suggest(text, options) { - return this.suggestWithCost(text, options).map((a) => a.word); - } - /** - * Suggest spellings for `text`. The results are sorted by edit distance with changes near the beginning of a word having a greater impact. - * The results include the word and adjusted edit cost. This is useful for merging results from multiple tries. - */ - suggestWithCost(text, options) { - const sep4 = options.compoundSeparator; - const adjWord = sep4 ? (0, util_js_1.replaceAllFactory)(sep4, "") : (a) => a; - const optFilter = options.filter; - const filter = optFilter ? (word, cost) => { - const w = adjWord(word); - return !this.isForbiddenWord(w) && optFilter(w, cost); - } : (word) => !this.isForbiddenWord(adjWord(word)); - const opts = { ...options, filter }; - return (0, suggest_js_1.suggest)(this.root, text, opts); - } - /** - * genSuggestions will generate suggestions and send them to `collector`. `collector` is responsible for returning the max acceptable cost. - * Costs are measured in weighted changes. A cost of 100 is the same as 1 edit. Some edits are considered cheaper. - * Returning a MaxCost < 0 will effectively cause the search for suggestions to stop. - */ - genSuggestions(collector, compoundMethod) { - const filter = (word) => !this.isForbiddenWord(word); - const options = (0, clean_js_1.clean)({ compoundMethod, ...collector.genSuggestionOptions }); - const suggestions = (0, suggest_js_1.genSuggestions)(this.root, collector.word, options); - collector.collect(suggestions, void 0, filter); - } - /** - * Returns an iterator that can be used to get all words in the trie. For some dictionaries, this can result in millions of words. - */ - words() { - return (0, trie_util_js_1.iteratorTrieWords)(this.root); - } - /** - * Allows iteration over the entire tree. - * On the returned Iterator, calling .next(goDeeper: boolean), allows for controlling the depth. - */ - iterate() { - return (0, index_js_1.walker)(this.root); - } - insert(word) { - (0, trie_util_js_1.insert)(word, this.root); - return this; - } - calcIsLegacy() { - const c = this.root.c; - return !(c?.get(this._options.compoundCharacter) || c?.get(this._options.stripCaseAndAccentsPrefix) || c?.get(this._options.forbiddenWordPrefix)); - } - static create(words, options) { - const root = (0, trie_util_js_1.createTriFromList)(words, options); - (0, trie_util_js_1.orderTrie)(root); - return new _Trie(root, void 0); - } - createFindOptions(options = {}) { - const findOptions = (0, find_js_1.createFindOptions)({ - ...this._findOptionsDefaults, - ...options - }); - return findOptions; - } - createFindOptionsMatchCase(matchCase) { - const f = this.lastCreateFindOptionsMatchCaseMap.get(matchCase); - if (f !== void 0) - return f; - const findOptions = this.createFindOptions({ matchCase }); - this.lastCreateFindOptionsMatchCaseMap.set(matchCase, findOptions); - return findOptions; - } + exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; + var fs9 = require("fs"); + exports.FILE_SYSTEM_ADAPTER = { + lstat: fs9.lstat, + stat: fs9.stat, + lstatSync: fs9.lstatSync, + statSync: fs9.statSync }; - exports.Trie = Trie; + function createFileSystemAdapter(fsMethods) { + if (fsMethods === void 0) { + return exports.FILE_SYSTEM_ADAPTER; + } + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); + } + exports.createFileSystemAdapter = createFileSystemAdapter; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/secondChanceCache.js -var require_secondChanceCache = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/secondChanceCache.js"(exports) { +// node_modules/@nodelib/fs.stat/out/settings.js +var require_settings = __commonJS({ + "node_modules/@nodelib/fs.stat/out/settings.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.SecondChanceCache = void 0; - var SecondChanceCache = class { - constructor(maxL0Size) { - this.maxL0Size = maxL0Size; - this.map0 = /* @__PURE__ */ new Map(); - this.map1 = /* @__PURE__ */ new Map(); - } - has(key) { - if (this.map0.has(key)) - return true; - if (this.map1.has(key)) { - this.set(key, this.get1(key)); - return true; - } - return false; - } - get(key) { - return this.map0.get(key) ?? this.get1(key); - } - set(key, value) { - if (this.map0.size >= this.maxL0Size && !this.map0.has(key)) { - this.map1 = this.map0; - this.map0 = /* @__PURE__ */ new Map(); - } - this.map0.set(key, value); - return this; - } - get size() { - return this.map0.size + this.map1.size; - } - get size0() { - return this.map0.size; - } - get size1() { - return this.map1.size; - } - clear() { - this.map0.clear(); - this.map1.clear(); - return this; - } - get1(key) { - if (this.map1.has(key)) { - const v = this.map1.get(key); - this.map1.delete(key); - this.set(key, v); - return v; - } - return void 0; + var fs9 = require_fs2(); + var Settings = class { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true); + this.fs = fs9.createFileSystemAdapter(this._options.fs); + this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); } - toArray() { - return [...this.map1, ...this.map0]; + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; } }; - exports.SecondChanceCache = SecondChanceCache; + exports.default = Settings; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/TrieBuilder.js -var require_TrieBuilder = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/TrieBuilder.js"(exports) { +// node_modules/@nodelib/fs.stat/out/index.js +var require_out = __commonJS({ + "node_modules/@nodelib/fs.stat/out/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.TrieBuilder = exports.buildTrieFast = exports.buildTrie = void 0; - var consolidate_js_1 = require_consolidate(); - var trie_js_1 = require_trie(); - var trie_util_js_1 = require_trie_util(); - var mergeOptionalWithDefaults_js_1 = require_mergeOptionalWithDefaults(); - var secondChanceCache_js_1 = require_secondChanceCache(); - function buildTrie(words, trieOptions) { - return new TrieBuilder(words, trieOptions).build(); - } - exports.buildTrie = buildTrie; - function buildTrieFast(words, trieOptions) { - const root = (0, trie_util_js_1.createTriFromList)(words, trieOptions); - return new trie_js_1.Trie(root, void 0); - } - exports.buildTrieFast = buildTrieFast; - var MAX_NUM_SIGS = 1e5; - var MAX_TRANSFORMS = 1e6; - var MAX_CACHE_SIZE = 1e6; - var TrieBuilder = class { - constructor(words, trieOptions) { - this.count = 0; - this.signatures = new secondChanceCache_js_1.SecondChanceCache(MAX_NUM_SIGS); - this.cached = new secondChanceCache_js_1.SecondChanceCache(MAX_CACHE_SIZE); - this.transforms = new secondChanceCache_js_1.SecondChanceCache(MAX_TRANSFORMS); - this._eow = Object.freeze({ f: 1 }); - this.lastPath = [{ s: "", n: { f: void 0, c: void 0 } }]; - this.tails = /* @__PURE__ */ new Map([["", this._eow]]); - this._canBeCached(this._eow); - this.signatures.set(this.signature(this._eow), this._eow); - this.cached.set(this._eow, this.count++); - this.trieOptions = Object.freeze((0, mergeOptionalWithDefaults_js_1.mergeOptionalWithDefaults)(trieOptions)); - if (words) { - this.insert(words); - } - } - set _root(n) { - this.lastPath[0].n = n; - } - get _root() { - return (0, trie_util_js_1.trieNodeToRoot)(this.lastPath[0].n, this.trieOptions); - } - signature(n) { - const isWord = n.f ? "*" : ""; - const ref = n.c ? JSON.stringify([...n.c.entries()].map(([k, n2]) => [k, this.cached.get(n2)])) : ""; - return isWord + ref; - } - _canBeCached(n) { - if (!n.c) - return true; - for (const v of n.c) { - if (!this.cached.has(v[1])) - return false; - } - return true; - } - tryCacheFrozen(n) { - if (this.cached.has(n)) { - return n; - } - this.cached.set(n, this.count++); - return n; - } - freeze(n) { - if (Object.isFrozen(n)) - return n; - if (n.c) { - const c = [...n.c].sort((a, b) => a[0] < b[0] ? -1 : 1).map(([k, n2]) => [k, this.freeze(n2)]); - n.c = new Map(c); - Object.freeze(n.c); - } - return Object.freeze(n); - } - tryToCache(n) { - if (!this._canBeCached(n)) { - return n; - } - const sig = this.signature(n); - const ref = this.signatures.get(sig); - if (ref !== void 0) { - return this.tryCacheFrozen(ref); - } - this.signatures.set(sig, this.freeze(n)); - return n; - } - storeTransform(src, s, result) { - if (!Object.isFrozen(result) || !Object.isFrozen(src)) - return; - const t = this.transforms.get(src) ?? /* @__PURE__ */ new Map(); - t.set(s, result); - this.transforms.set(src, t); - } - addChild(node, head, child) { - if (node.c?.get(head) !== child) { - if (!node.c || Object.isFrozen(node)) { - node = { ...node, c: new Map(node.c ?? []) }; - } - node.c?.set(head, child); - } - return Object.isFrozen(child) ? this.tryToCache(node) : node; - } - buildTail(s) { - const v = this.tails.get(s); - if (v) - return v; - const head = s[0]; - const tail = s.slice(1); - const t = this.tails.get(tail); - const c = t || this.buildTail(tail); - const n = this.addChild({ f: void 0, c: void 0 }, head, c); - if (!t) { - return n; - } - const cachedNode = this.tryCacheFrozen(Object.freeze(n)); - this.tails.set(s, cachedNode); - return cachedNode; - } - _insert(node, s, d) { - const orig = node; - if (Object.isFrozen(node)) { - const n = this.transforms.get(node)?.get(s); - if (n) { - return this.tryCacheFrozen(n); - } - } - if (!s) { - if (!node.c) { - return this._eow; - } else { - node = copyIfFrozen(node); - node.f = this._eow.f; - return node; - } - } - const head = s[0]; - const tail = s.slice(1); - const cNode = node.c?.get(head); - const child = cNode ? this._insert(cNode, tail, d + 1) : this.buildTail(tail); - node = this.addChild(node, head, child); - this.storeTransform(orig, s, node); - this.lastPath[d] = { s: head, n: child }; - return node; - } - insertWord(word) { - let d = 1; - for (const s of word.split("")) { - const p = this.lastPath[d]; - if (p?.s !== s) - break; - d++; - } - if (word.length < d) { - d = word.length; - } - this.lastPath.length = d; - d -= 1; - const { n } = this.lastPath[d]; - const tail = word.slice(d); - this.lastPath[d].n = this._insert(n, tail, d + 1); - while (d > 0) { - const { s, n: n2 } = this.lastPath[d]; - d -= 1; - const parent = this.lastPath[d]; - const pn = parent.n; - parent.n = this.addChild(pn, s, n2); - if (pn === parent.n) - break; - const tail2 = word.slice(d); - this.storeTransform(pn, tail2, parent.n); - } - } - insert(words) { - for (const w of words) { - w && this.insertWord(w); - } + exports.statSync = exports.stat = exports.Settings = void 0; + var async = require_async(); + var sync = require_sync(); + var settings_1 = require_settings(); + exports.Settings = settings_1.default; + function stat2(path26, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === "function") { + async.read(path26, getSettings2(), optionsOrSettingsOrCallback); + return; } - /** - * Resets the builder - */ - reset() { - this._root = (0, trie_util_js_1.createTrieRoot)(this.trieOptions); - this.cached.clear(); - this.signatures.clear(); - this.signatures.set(this.signature(this._eow), this._eow); - this.count = 0; - this.cached.set(this._eow, this.count++); - } - build(consolidateSuffixes = false) { - const root = this._root; - this.reset(); - return new trie_js_1.Trie(consolidateSuffixes ? (0, consolidate_js_1.consolidate)(root) : root); + async.read(path26, getSettings2(optionsOrSettingsOrCallback), callback); + } + exports.stat = stat2; + function statSync3(path26, optionsOrSettings) { + const settings = getSettings2(optionsOrSettings); + return sync.read(path26, settings); + } + exports.statSync = statSync3; + function getSettings2(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; } - }; - exports.TrieBuilder = TrieBuilder; - function copyIfFrozen(n) { - if (!Object.isFrozen(n)) - return n; - const c = n.c ? new Map(n.c) : void 0; - return { f: n.f, c }; + return new settings_1.default(settingsOrOptions); } } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/utils/normalizeWord.js -var require_normalizeWord = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/utils/normalizeWord.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.normalizeWordForCaseInsensitive = exports.normalizeWordToLowercase = exports.normalizeWord = void 0; - var normalizeWord = (text) => text.normalize(); - exports.normalizeWord = normalizeWord; - var normalizeWordToLowercase = (text) => text.toLowerCase().normalize("NFD").replace(/\p{M}/gu, ""); - exports.normalizeWordToLowercase = normalizeWordToLowercase; - var normalizeWordForCaseInsensitive = (text) => { - const t = text.toLowerCase(); - return [t, t.normalize("NFD").replace(/\p{M}/gu, "")]; - }; - exports.normalizeWordForCaseInsensitive = normalizeWordForCaseInsensitive; +// node_modules/queue-microtask/index.js +var require_queue_microtask = __commonJS({ + "node_modules/queue-microtask/index.js"(exports, module2) { + var promise; + module2.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => { + throw err; + }, 0)); } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/SimpleDictionaryParser.js -var require_SimpleDictionaryParser = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/SimpleDictionaryParser.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.parseDictionary = exports.parseLinesToDictionary = exports.parseDictionaryLines = exports.createDictionaryLineParserMapper = exports.setOfCSpellDirectiveFlags = exports.cSpellToolDirective = exports.defaultParseDictionaryOptions = void 0; - var sync_1 = require_sync(); - var constants_js_1 = require_constants4(); - var TrieBuilder_js_1 = require_TrieBuilder(); - var normalizeWord_js_1 = require_normalizeWord(); - var RegExpSplit = /[\s,;]/g; - var _defaultOptions = { - commentCharacter: constants_js_1.LINE_COMMENT, - optionalCompoundCharacter: constants_js_1.OPTIONAL_COMPOUND_FIX, - compoundCharacter: constants_js_1.COMPOUND_FIX, - forbiddenPrefix: constants_js_1.FORBID_PREFIX, - caseInsensitivePrefix: constants_js_1.CASE_INSENSITIVE_PREFIX, - keepExactPrefix: constants_js_1.IDENTITY_PREFIX, - stripCaseAndAccents: true, - stripCaseAndAccentsKeepDuplicate: false, - stripCaseAndAccentsOnForbidden: false, - split: false, - splitKeepBoth: false, - splitSeparator: RegExpSplit - }; - exports.defaultParseDictionaryOptions = Object.freeze(_defaultOptions); - exports.cSpellToolDirective = "cspell-dictionary:"; - exports.setOfCSpellDirectiveFlags = ["no-split", "split", "generate-alternatives", "no-generate-alternatives"]; - function createDictionaryLineParserMapper(options) { - const _options = options || _defaultOptions; - const { commentCharacter = _defaultOptions.commentCharacter, optionalCompoundCharacter: optionalCompound = _defaultOptions.optionalCompoundCharacter, compoundCharacter: compound = _defaultOptions.compoundCharacter, caseInsensitivePrefix: ignoreCase = _defaultOptions.caseInsensitivePrefix, forbiddenPrefix: forbidden = _defaultOptions.forbiddenPrefix, keepExactPrefix: keepCase = _defaultOptions.keepExactPrefix, splitSeparator = _defaultOptions.splitSeparator, splitKeepBoth = _defaultOptions.splitKeepBoth, stripCaseAndAccentsKeepDuplicate = _defaultOptions.stripCaseAndAccentsKeepDuplicate, stripCaseAndAccentsOnForbidden = _defaultOptions.stripCaseAndAccentsOnForbidden } = _options; - let { stripCaseAndAccents = _defaultOptions.stripCaseAndAccents, split = _defaultOptions.split } = _options; - function isString2(line) { - return typeof line === "string"; - } - function trim(line) { - return line.trim(); - } - function removeComments(line) { - const idx = line.indexOf(commentCharacter); - if (idx < 0) - return line; - const idxDirective = line.indexOf(exports.cSpellToolDirective, idx); - if (idxDirective >= 0) { - const flags = line.slice(idxDirective).split(/[\s,;]/g).map((s) => s.trim()).filter((a) => !!a); - for (const flag of flags) { - switch (flag) { - case "split": - split = true; - break; - case "no-split": - split = false; - break; - case "no-generate-alternatives": - stripCaseAndAccents = false; - break; - case "generate-alternatives": - stripCaseAndAccents = true; - break; - } - } - } - return line.slice(0, idx).trim(); - } - function filterEmptyLines(line) { - return !!line; - } - function* mapOptionalPrefix(line) { - if (line[0] === optionalCompound) { - const t = line.slice(1); - yield t; - yield compound + t; - } else { - yield line; - } - } - function* mapOptionalSuffix(line) { - if (line.slice(-1) === optionalCompound) { - const t = line.slice(0, -1); - yield t; - yield t + compound; - } else { - yield line; - } - } - const doNotNormalizePrefix = /* @__PURE__ */ Object.create(null); - [ignoreCase, keepCase, '"'].forEach((prefix) => doNotNormalizePrefix[prefix] = true); - if (!stripCaseAndAccentsOnForbidden) { - doNotNormalizePrefix[forbidden] = true; - } - function removeDoublePrefix(w) { - return w.startsWith(ignoreCase + ignoreCase) ? w.slice(1) : w; - } - function stripKeepCasePrefixAndQuotes(word) { - word = word.replace(/"(.*?)"/g, "$1"); - return word[0] === keepCase ? word.slice(1) : word; - } - function _normalize(word) { - return (0, normalizeWord_js_1.normalizeWord)(stripKeepCasePrefixAndQuotes(word)); - } - function* mapNormalize(word) { - const nWord = _normalize(word); - const forms = /* @__PURE__ */ new Set(); - forms.add(nWord); - if (stripCaseAndAccents && !(word[0] in doNotNormalizePrefix)) { - for (const n of (0, normalizeWord_js_1.normalizeWordForCaseInsensitive)(nWord)) { - (stripCaseAndAccentsKeepDuplicate || n !== nWord) && forms.add(ignoreCase + n); - } - } - yield* forms; +// node_modules/run-parallel/index.js +var require_run_parallel = __commonJS({ + "node_modules/run-parallel/index.js"(exports, module2) { + module2.exports = runParallel; + var queueMicrotask2 = require_queue_microtask(); + function runParallel(tasks, cb) { + let results, pending, keys2; + let isSync = true; + if (Array.isArray(tasks)) { + results = []; + pending = tasks.length; + } else { + keys2 = Object.keys(tasks); + results = {}; + pending = keys2.length; } - function* splitWords(lines) { - for (const line of lines) { - if (split) { - const lineEscaped = line.indexOf('"') >= 0 ? line.replace(/".*?"/g, (quoted) => " " + quoted.replace(/(\s)/g, "\\$1") + " ") : line; - const words = splitLine(lineEscaped, splitSeparator); - yield* words.map((escaped) => escaped.replace(/\\/g, "")); - if (!splitKeepBoth) - continue; - } - yield line; + function done(err) { + function end() { + if (cb) + cb(err, results); + cb = null; } + if (isSync) + queueMicrotask2(end); + else + end(); } - function* splitLines(paragraphs) { - for (const paragraph of paragraphs) { - yield* paragraph.split("\n"); + function each(i, err, result) { + results[i] = result; + if (--pending === 0 || err) { + done(err); } } - const processLines = (0, sync_1.opCombine)((0, sync_1.opFilter)(isString2), splitLines, (0, sync_1.opMap)(removeComments), splitWords, (0, sync_1.opMap)(trim), (0, sync_1.opFilter)(filterEmptyLines), (0, sync_1.opConcatMap)(mapOptionalPrefix), (0, sync_1.opConcatMap)(mapOptionalSuffix), (0, sync_1.opConcatMap)(mapNormalize), (0, sync_1.opMap)(removeDoublePrefix)); - return processLines; - } - exports.createDictionaryLineParserMapper = createDictionaryLineParserMapper; - function parseDictionaryLines(lines, options) { - return createDictionaryLineParserMapper(options)(typeof lines === "string" ? [lines] : lines); - } - exports.parseDictionaryLines = parseDictionaryLines; - function parseLinesToDictionary(lines, options) { - const _options = mergeOptions(_defaultOptions, options); - const dictLines = parseDictionaryLines(lines, _options); - return (0, TrieBuilder_js_1.buildTrieFast)([...new Set(dictLines)].sort(), { - compoundCharacter: _options.compoundCharacter, - forbiddenWordPrefix: _options.forbiddenPrefix, - stripCaseAndAccentsPrefix: _options.caseInsensitivePrefix - }); - } - exports.parseLinesToDictionary = parseLinesToDictionary; - function parseDictionary(text, options) { - return parseLinesToDictionary(text.split("\n"), options); - } - exports.parseDictionary = parseDictionary; - function mergeOptions(base, ...partials) { - const opt = { ...base }; - for (const p of partials) { - if (!p) - continue; - Object.assign(opt, p); + if (!pending) { + done(null); + } else if (keys2) { + keys2.forEach(function(key) { + tasks[key](function(err, result) { + each(key, err, result); + }); + }); + } else { + tasks.forEach(function(task, i) { + task(function(err, result) { + each(i, err, result); + }); + }); } - return opt; - } - var RegExpToEncode = /\\([\s,;])/g; - var RegExpDecode = /<<(%[\da-f]{2})>>/gi; - function encodeLine(line) { - return line.replace(RegExpToEncode, (_, v) => "<<" + encodeURIComponent(v) + ">>"); - } - function decodeLine(line) { - return line.replace(RegExpDecode, (_, v) => "\\" + decodeURIComponent(v)); - } - function splitLine(line, regExp) { - return encodeLine(line).split(regExp).map((line2) => decodeLine(line2)); + isSync = false; } - exports.__testing__ = { - splitLine - }; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/suggestCollector.js -var require_suggestCollector2 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/suggestCollector.js"(exports) { +// node_modules/@nodelib/fs.scandir/out/constants.js +var require_constants3 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/constants.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.suggestionCollector = exports.isSuggestionResult = exports.impersonateCollector = exports.defaultSuggestionCollectorOptions = exports.compSuggestionResults = void 0; - var suggestCollector_js_1 = require_suggestCollector(); - Object.defineProperty(exports, "compSuggestionResults", { enumerable: true, get: function() { - return suggestCollector_js_1.compSuggestionResults; - } }); - Object.defineProperty(exports, "defaultSuggestionCollectorOptions", { enumerable: true, get: function() { - return suggestCollector_js_1.defaultSuggestionCollectorOptions; - } }); - Object.defineProperty(exports, "impersonateCollector", { enumerable: true, get: function() { - return suggestCollector_js_1.impersonateCollector; - } }); - Object.defineProperty(exports, "isSuggestionResult", { enumerable: true, get: function() { - return suggestCollector_js_1.isSuggestionResult; - } }); - Object.defineProperty(exports, "suggestionCollector", { enumerable: true, get: function() { - return suggestCollector_js_1.suggestionCollector; - } }); + exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0; + var NODE_PROCESS_VERSION_PARTS = process.versions.node.split("."); + if (NODE_PROCESS_VERSION_PARTS[0] === void 0 || NODE_PROCESS_VERSION_PARTS[1] === void 0) { + throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`); + } + var MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10); + var MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10); + var SUPPORTED_MAJOR_VERSION = 10; + var SUPPORTED_MINOR_VERSION = 10; + var IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION; + var IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION; + exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR; } }); -// node_modules/cspell-trie-lib/dist/cjs/lib/index.js -var require_lib7 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/lib/index.js"(exports) { +// node_modules/@nodelib/fs.scandir/out/utils/fs.js +var require_fs3 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/utils/fs.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.hintedWalker = exports.CompoundWordsMethod = exports.expandCharacterSet = exports.normalizeWordToLowercase = exports.normalizeWordForCaseInsensitive = exports.normalizeWord = exports.mergeOptionalWithDefaults = exports.mergeDefaults = exports.isDefined = exports.FLAG_WORD = exports.ChildMap = exports.TrieBuilder = exports.buildTrieFast = exports.buildTrie = exports.walk = exports.trieNodeToRoot = exports.orderTrie = exports.iteratorTrieWords = exports.iterateTrie = exports.isWordTerminationNode = exports.isCircular = exports.insert = exports.has = exports.findNode = exports.createTriFromList = exports.createTrieRoot = exports.countWords = exports.countNodes = exports.Trie = exports.OPTIONAL_COMPOUND_FIX = exports.OPTIONAL_COMPOUND = exports.NORMALIZED = exports.FORBID_PREFIX = exports.FORBID = exports.defaultTrieOptions = exports.COMPOUND_FIX = exports.COMPOUND = exports.CASE_INSENSITIVE_PREFIX = exports.suggestionCollector = exports.impersonateCollector = exports.parseDictionaryLines = exports.parseDictionary = exports.createDictionaryLineParser = exports.mapDictionaryInformationToWeightMap = exports.serializeTrie = exports.importTrie = exports.editDistanceWeighted = exports.editDistance = exports.createWeightedMap = exports.consolidate = void 0; - exports.WORD_SEPARATOR = exports.walker = exports.JOIN_SEPARATOR = void 0; - var consolidate_js_1 = require_consolidate(); - Object.defineProperty(exports, "consolidate", { enumerable: true, get: function() { - return consolidate_js_1.consolidate; - } }); - var index_js_1 = require_distance2(); - Object.defineProperty(exports, "createWeightedMap", { enumerable: true, get: function() { - return index_js_1.createWeightedMap; - } }); - Object.defineProperty(exports, "editDistance", { enumerable: true, get: function() { - return index_js_1.editDistance; - } }); - Object.defineProperty(exports, "editDistanceWeighted", { enumerable: true, get: function() { - return index_js_1.editDistanceWeighted; - } }); - var importExport_js_1 = require_importExport(); - Object.defineProperty(exports, "importTrie", { enumerable: true, get: function() { - return importExport_js_1.importTrie; - } }); - Object.defineProperty(exports, "serializeTrie", { enumerable: true, get: function() { - return importExport_js_1.serializeTrie; - } }); - var mapDictionaryInfoToWeightMap_js_1 = require_mapDictionaryInfoToWeightMap(); - Object.defineProperty(exports, "mapDictionaryInformationToWeightMap", { enumerable: true, get: function() { - return mapDictionaryInfoToWeightMap_js_1.mapDictionaryInformationToWeightMap; - } }); - var SimpleDictionaryParser_js_1 = require_SimpleDictionaryParser(); - Object.defineProperty(exports, "createDictionaryLineParser", { enumerable: true, get: function() { - return SimpleDictionaryParser_js_1.createDictionaryLineParserMapper; - } }); - Object.defineProperty(exports, "parseDictionary", { enumerable: true, get: function() { - return SimpleDictionaryParser_js_1.parseDictionary; - } }); - Object.defineProperty(exports, "parseDictionaryLines", { enumerable: true, get: function() { - return SimpleDictionaryParser_js_1.parseDictionaryLines; - } }); - var suggestCollector_js_1 = require_suggestCollector2(); - Object.defineProperty(exports, "impersonateCollector", { enumerable: true, get: function() { - return suggestCollector_js_1.impersonateCollector; - } }); - Object.defineProperty(exports, "suggestionCollector", { enumerable: true, get: function() { - return suggestCollector_js_1.suggestionCollector; - } }); - var trie_js_1 = require_trie(); - Object.defineProperty(exports, "CASE_INSENSITIVE_PREFIX", { enumerable: true, get: function() { - return trie_js_1.CASE_INSENSITIVE_PREFIX; - } }); - Object.defineProperty(exports, "COMPOUND", { enumerable: true, get: function() { - return trie_js_1.COMPOUND; - } }); - Object.defineProperty(exports, "COMPOUND_FIX", { enumerable: true, get: function() { - return trie_js_1.COMPOUND_FIX; - } }); - Object.defineProperty(exports, "defaultTrieOptions", { enumerable: true, get: function() { - return trie_js_1.defaultTrieOptions; - } }); - Object.defineProperty(exports, "FORBID", { enumerable: true, get: function() { - return trie_js_1.FORBID; - } }); - Object.defineProperty(exports, "FORBID_PREFIX", { enumerable: true, get: function() { - return trie_js_1.FORBID_PREFIX; - } }); - Object.defineProperty(exports, "NORMALIZED", { enumerable: true, get: function() { - return trie_js_1.NORMALIZED; - } }); - Object.defineProperty(exports, "OPTIONAL_COMPOUND", { enumerable: true, get: function() { - return trie_js_1.OPTIONAL_COMPOUND; - } }); - Object.defineProperty(exports, "OPTIONAL_COMPOUND_FIX", { enumerable: true, get: function() { - return trie_js_1.OPTIONAL_COMPOUND_FIX; - } }); - Object.defineProperty(exports, "Trie", { enumerable: true, get: function() { - return trie_js_1.Trie; - } }); - var trie_util_js_1 = require_trie_util(); - Object.defineProperty(exports, "countNodes", { enumerable: true, get: function() { - return trie_util_js_1.countNodes; - } }); - Object.defineProperty(exports, "countWords", { enumerable: true, get: function() { - return trie_util_js_1.countWords; - } }); - Object.defineProperty(exports, "createTrieRoot", { enumerable: true, get: function() { - return trie_util_js_1.createTrieRoot; - } }); - Object.defineProperty(exports, "createTriFromList", { enumerable: true, get: function() { - return trie_util_js_1.createTriFromList; - } }); - Object.defineProperty(exports, "findNode", { enumerable: true, get: function() { - return trie_util_js_1.findNode; - } }); - Object.defineProperty(exports, "has", { enumerable: true, get: function() { - return trie_util_js_1.has; - } }); - Object.defineProperty(exports, "insert", { enumerable: true, get: function() { - return trie_util_js_1.insert; - } }); - Object.defineProperty(exports, "isCircular", { enumerable: true, get: function() { - return trie_util_js_1.isCircular; - } }); - Object.defineProperty(exports, "isWordTerminationNode", { enumerable: true, get: function() { - return trie_util_js_1.isWordTerminationNode; - } }); - Object.defineProperty(exports, "iterateTrie", { enumerable: true, get: function() { - return trie_util_js_1.iterateTrie; - } }); - Object.defineProperty(exports, "iteratorTrieWords", { enumerable: true, get: function() { - return trie_util_js_1.iteratorTrieWords; - } }); - Object.defineProperty(exports, "orderTrie", { enumerable: true, get: function() { - return trie_util_js_1.orderTrie; - } }); - Object.defineProperty(exports, "trieNodeToRoot", { enumerable: true, get: function() { - return trie_util_js_1.trieNodeToRoot; - } }); - Object.defineProperty(exports, "walk", { enumerable: true, get: function() { - return trie_util_js_1.walk; - } }); - var TrieBuilder_js_1 = require_TrieBuilder(); - Object.defineProperty(exports, "buildTrie", { enumerable: true, get: function() { - return TrieBuilder_js_1.buildTrie; - } }); - Object.defineProperty(exports, "buildTrieFast", { enumerable: true, get: function() { - return TrieBuilder_js_1.buildTrieFast; - } }); - Object.defineProperty(exports, "TrieBuilder", { enumerable: true, get: function() { - return TrieBuilder_js_1.TrieBuilder; - } }); - var TrieNode_js_1 = require_TrieNode(); - Object.defineProperty(exports, "ChildMap", { enumerable: true, get: function() { - return TrieNode_js_1.ChildMap; - } }); - Object.defineProperty(exports, "FLAG_WORD", { enumerable: true, get: function() { - return TrieNode_js_1.FLAG_WORD; - } }); - var isDefined_js_1 = require_isDefined(); - Object.defineProperty(exports, "isDefined", { enumerable: true, get: function() { - return isDefined_js_1.isDefined; - } }); - var mergeDefaults_js_1 = require_mergeDefaults(); - Object.defineProperty(exports, "mergeDefaults", { enumerable: true, get: function() { - return mergeDefaults_js_1.mergeDefaults; - } }); - var mergeOptionalWithDefaults_js_1 = require_mergeOptionalWithDefaults(); - Object.defineProperty(exports, "mergeOptionalWithDefaults", { enumerable: true, get: function() { - return mergeOptionalWithDefaults_js_1.mergeOptionalWithDefaults; - } }); - var normalizeWord_js_1 = require_normalizeWord(); - Object.defineProperty(exports, "normalizeWord", { enumerable: true, get: function() { - return normalizeWord_js_1.normalizeWord; - } }); - Object.defineProperty(exports, "normalizeWordForCaseInsensitive", { enumerable: true, get: function() { - return normalizeWord_js_1.normalizeWordForCaseInsensitive; - } }); - Object.defineProperty(exports, "normalizeWordToLowercase", { enumerable: true, get: function() { - return normalizeWord_js_1.normalizeWordToLowercase; - } }); - var text_js_1 = require_text(); - Object.defineProperty(exports, "expandCharacterSet", { enumerable: true, get: function() { - return text_js_1.expandCharacterSet; - } }); - var index_js_2 = require_walker2(); - Object.defineProperty(exports, "CompoundWordsMethod", { enumerable: true, get: function() { - return index_js_2.CompoundWordsMethod; - } }); - Object.defineProperty(exports, "hintedWalker", { enumerable: true, get: function() { - return index_js_2.hintedWalker; - } }); - Object.defineProperty(exports, "JOIN_SEPARATOR", { enumerable: true, get: function() { - return index_js_2.JOIN_SEPARATOR; - } }); - Object.defineProperty(exports, "walker", { enumerable: true, get: function() { - return index_js_2.walker; - } }); - Object.defineProperty(exports, "WORD_SEPARATOR", { enumerable: true, get: function() { - return index_js_2.WORD_SEPARATOR; - } }); + exports.createDirentFromStats = void 0; + var DirentFromStats = class { + constructor(name, stats) { + this.name = name; + this.isBlockDevice = stats.isBlockDevice.bind(stats); + this.isCharacterDevice = stats.isCharacterDevice.bind(stats); + this.isDirectory = stats.isDirectory.bind(stats); + this.isFIFO = stats.isFIFO.bind(stats); + this.isFile = stats.isFile.bind(stats); + this.isSocket = stats.isSocket.bind(stats); + this.isSymbolicLink = stats.isSymbolicLink.bind(stats); + } + }; + function createDirentFromStats(name, stats) { + return new DirentFromStats(name, stats); + } + exports.createDirentFromStats = createDirentFromStats; } }); -// node_modules/cspell-trie-lib/dist/cjs/index.js -var require_cjs5 = __commonJS({ - "node_modules/cspell-trie-lib/dist/cjs/index.js"(exports) { +// node_modules/@nodelib/fs.scandir/out/utils/index.js +var require_utils8 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/utils/index.js"(exports) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __exportStar = exports && exports.__exportStar || function(m, exports2) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) - __createBinding(exports2, m, p); - }; Object.defineProperty(exports, "__esModule", { value: true }); - __exportStar(require_lib7(), exports); + exports.fs = void 0; + var fs9 = require_fs3(); + exports.fs = fs9; } }); -// node_modules/cspell-lib/dist/cjs/Settings/DictionaryReferenceCollection.js -var require_DictionaryReferenceCollection = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/DictionaryReferenceCollection.js"(exports) { +// node_modules/@nodelib/fs.scandir/out/providers/common.js +var require_common3 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/providers/common.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.createDictionaryReferenceCollection = void 0; - function createDictionaryReferenceCollection(dictionaries) { - return new _DictionaryReferenceCollection(dictionaries); - } - exports.createDictionaryReferenceCollection = createDictionaryReferenceCollection; - var _DictionaryReferenceCollection = class { - constructor(dictionaries) { - this.dictionaries = dictionaries; - this.collection = collect(dictionaries); - } - isEnabled(name) { - const entry = this.collection[name]; - return entry === void 0 ? void 0 : !!(entry & 1); - } - isBlocked(name) { - const entry = this.collection[name]; - return entry === void 0 ? void 0 : !(entry & 1); - } - enabled() { - return this.dictionaryIds.filter((n) => this.isEnabled(n)); - } - blocked() { - return this.dictionaryIds.filter((n) => this.isBlocked(n)); - } - get dictionaryIds() { - return Object.keys(this.collection); - } - }; - function collect(dictionaries) { - const refs = dictionaries.map(normalizeName).map(mapReference); - const col = {}; - for (const ref of refs) { - col[ref.name] = Math.max(ref.weight, col[ref.name] || 0); + exports.joinPathSegments = void 0; + function joinPathSegments(a, b, separator) { + if (a.endsWith(separator)) { + return a + b; } - return col; - } - function normalizeName(entry) { - return entry.normalize().trim(); - } - function mapReference(ref) { - const name = ref.replace(/^!+/, ""); - const weight = ref.length - name.length + 1; - return { name: name.trim(), weight }; + return a + separator + b; } + exports.joinPathSegments = joinPathSegments; } }); -// node_modules/cspell-lib/dist/cjs/Settings/DictionarySettings.js -var require_DictionarySettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/DictionarySettings.js"(exports) { +// node_modules/@nodelib/fs.scandir/out/providers/async.js +var require_async2 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/providers/async.js"(exports) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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.isDictionaryDefinitionInlineInternalWithSource = exports.isDictionaryFileDefinitionInternalWithSource = exports.isDictionaryDefinitionInternal = exports.isDictionaryDefinitionWithSource = exports.calcDictionaryDefsToLoad = exports.mapDictDefToInternal = exports.mapDictDefsToInternal = exports.filterDictDefsToLoad = void 0; - var cspell_trie_lib_1 = require_cjs5(); - var path16 = __importStar(require("path")); - var CSpellSettingsInternalDef_js_1 = require_CSpellSettingsInternalDef(); - var AutoResolve_js_1 = require_AutoResolve(); - var resolveFile_js_1 = require_resolveFile(); - var util_js_1 = require_util(); - var DictionaryReferenceCollection_js_1 = require_DictionaryReferenceCollection(); - function filterDictDefsToLoad(dictRefCol, defs) { - const allActiveDefs = defs.filter(({ name }) => dictRefCol.isEnabled(name)).map(fixPath); - return [...new Map(allActiveDefs.map((d) => [d.name, d])).values()]; - } - exports.filterDictDefsToLoad = filterDictDefsToLoad; - function fixPath(def) { - if (def instanceof _DictionaryDefinitionInternalWithSource) { - return def; - } - const newPath = fixDicPath(def.path, def.file); - return { - ...def, - file: void 0, - path: newPath - }; + exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; + var fsStat = require_out(); + var rpl = require_run_parallel(); + var constants_1 = require_constants3(); + var utils = require_utils8(); + var common = require_common3(); + function read2(directory, settings, callback) { + if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + readdirWithFileTypes(directory, settings, callback); + return; + } + readdir(directory, settings, callback); } - function fixDicPath(defPath, defFile) { - const parts = [defPath || "", defFile || ""].filter((p) => !!p); - return parts.length > 1 ? path16.join(...parts) : parts[0] || ""; + exports.read = read2; + function readdirWithFileTypes(directory, settings, callback) { + settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => { + if (readdirError !== null) { + callFailureCallback(callback, readdirError); + return; + } + const entries = dirents.map((dirent) => ({ + dirent, + name: dirent.name, + path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + })); + if (!settings.followSymbolicLinks) { + callSuccessCallback(callback, entries); + return; + } + const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings)); + rpl(tasks, (rplError, rplEntries) => { + if (rplError !== null) { + callFailureCallback(callback, rplError); + return; + } + callSuccessCallback(callback, rplEntries); + }); + }); } - function mapDictDefsToInternal(defs, pathToSettingsFile) { - return defs?.map((def) => mapDictDefToInternal(def, pathToSettingsFile)); + exports.readdirWithFileTypes = readdirWithFileTypes; + function makeRplTaskEntry(entry, settings) { + return (done) => { + if (!entry.dirent.isSymbolicLink()) { + done(null, entry); + return; + } + settings.fs.stat(entry.path, (statError, stats) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + done(statError); + return; + } + done(null, entry); + return; + } + entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); + done(null, entry); + }); + }; } - exports.mapDictDefsToInternal = mapDictDefsToInternal; - var internalDefs = new AutoResolve_js_1.AutoResolveWeakCache(); - function mapDictDefToInternal(def, pathToSettingsFile) { - return internalDefs.get(def, (def2) => _mapDictDefToInternal(def2, pathToSettingsFile)); + function readdir(directory, settings, callback) { + settings.fs.readdir(directory, (readdirError, names) => { + if (readdirError !== null) { + callFailureCallback(callback, readdirError); + return; + } + const tasks = names.map((name) => { + const path26 = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); + return (done) => { + fsStat.stat(path26, settings.fsStatSettings, (error2, stats) => { + if (error2 !== null) { + done(error2); + return; + } + const entry = { + name, + path: path26, + dirent: utils.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; + } + done(null, entry); + }); + }; + }); + rpl(tasks, (rplError, entries) => { + if (rplError !== null) { + callFailureCallback(callback, rplError); + return; + } + callSuccessCallback(callback, entries); + }); + }); } - exports.mapDictDefToInternal = mapDictDefToInternal; - function _mapDictDefToInternal(def, pathToSettingsFile) { - if (isDictionaryDefinitionWithSource(def)) { - return def; - } - if ((0, CSpellSettingsInternalDef_js_1.isDictionaryDefinitionInlineInternal)(def)) { - return { ...def, __source: pathToSettingsFile }; - } - return new _DictionaryDefinitionInternalWithSource(def, pathToSettingsFile); + exports.readdir = readdir; + function callFailureCallback(callback, error2) { + callback(error2); } - function determineName(filename, options) { - return options.name || path16.basename(filename); + function callSuccessCallback(callback, result) { + callback(null, result); } - function calcDictionaryDefsToLoad(settings) { - const { dictionaries = [], dictionaryDefinitions = [], noSuggestDictionaries = [] } = settings; - const colNoSug = (0, DictionaryReferenceCollection_js_1.createDictionaryReferenceCollection)(noSuggestDictionaries); - const colDicts = (0, DictionaryReferenceCollection_js_1.createDictionaryReferenceCollection)(dictionaries.concat(colNoSug.enabled())); - const modDefs = dictionaryDefinitions.map((def) => { - const enabled = colNoSug.isEnabled(def.name); - if (enabled === void 0) - return def; - return { ...def, noSuggest: enabled }; - }); - return filterDictDefsToLoad(colDicts, modDefs); - } - exports.calcDictionaryDefsToLoad = calcDictionaryDefsToLoad; - function isDictionaryDefinitionWithSource(d) { - return isDictionaryFileDefinitionInternalWithSource(d) || isDictionaryDefinitionInlineInternalWithSource(d); - } - exports.isDictionaryDefinitionWithSource = isDictionaryDefinitionWithSource; - function isDictionaryDefinitionInternal(def) { - return def instanceof _DictionaryDefinitionInternalWithSource; - } - exports.isDictionaryDefinitionInternal = isDictionaryDefinitionInternal; - function isDictionaryFileDefinitionInternalWithSource(def) { - return def instanceof _DictionaryDefinitionInternalWithSource; - } - exports.isDictionaryFileDefinitionInternalWithSource = isDictionaryFileDefinitionInternalWithSource; - function isDictionaryDefinitionInlineInternalWithSource(def) { - return (0, CSpellSettingsInternalDef_js_1.isDictionaryDefinitionInlineInternal)(def) && !!def.__source; - } - exports.isDictionaryDefinitionInlineInternalWithSource = isDictionaryDefinitionInlineInternalWithSource; - var _DictionaryDefinitionInternalWithSource = class { - constructor(def, __source) { - this.__source = __source; - const defAll = def; - const { path: relPath = "", file = "", addWords, description, dictionaryInformation, type, repMap, noSuggest, scope, useCompounds } = defAll; - const defaultPath = path16.dirname(__source); - const filePath = fixDicPath(relPath, file); - const name = determineName(filePath, def); - const r = (0, resolveFile_js_1.resolveFile)(filePath, defaultPath); - const ddi = { - name, - file: void 0, - path: r.filename, - addWords, - description, - dictionaryInformation, - type, - repMap, - noSuggest, - scope, - useCompounds - }; - Object.assign(this, (0, util_js_1.clean)(ddi)); - this.ddi = ddi; - this.name = ddi.name; - this.file = ddi.file; - this.path = ddi.path; - this._weightMap = this.dictionaryInformation ? (0, cspell_trie_lib_1.mapDictionaryInformationToWeightMap)(this.dictionaryInformation) : void 0; - } - get weightMap() { - return this._weightMap; - } - toJSON() { - return this.ddi; - } - }; } }); -// node_modules/cspell-lib/dist/cjs/util/textRegex.js -var require_textRegex = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/textRegex.js"(exports) { +// node_modules/@nodelib/fs.scandir/out/providers/sync.js +var require_sync2 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/providers/sync.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.stringToRegExp = exports.regExNumericLiteral = exports.regExTrailingEndings = exports.regExDanglingQuote = exports.regExEscapeCharacters = exports.regExAccents = exports.regExMatchRegExParts = exports.regExPossibleWordBreaks = exports.regExAllLower = exports.regExAllUpper = exports.regExFirstUpper = exports.regExIgnoreCharacters = exports.regExWordsAndDigits = exports.regExWords = exports.regExSplitWords2 = exports.regExSplitWords = exports.regExUpperSOrIng = void 0; - exports.regExUpperSOrIng = /([\p{Lu}\p{M}]+\\?['’]?(?:s|ing|ies|es|ings|ed|ning))(?!\p{Ll})/gu; - exports.regExSplitWords = /(\p{Ll}\p{M}?)(\p{Lu})/gu; - exports.regExSplitWords2 = /(\p{Lu}\p{M}?)(\p{Lu}\p{M}?\p{Ll})/gu; - exports.regExWords = /\p{L}\p{M}?(?:(?:\\?['’])?\p{L}\p{M}?)*/gu; - exports.regExWordsAndDigits = /[\p{L}\w'’`.+-](?:(?:\\(?=[']))?[\p{L}\p{M}\w'’`.+-])*/gu; - exports.regExIgnoreCharacters = /[\p{sc=Hiragana}\p{sc=Han}\p{sc=Katakana}\u30A0-\u30FF\p{sc=Hangul}]/gu; - exports.regExFirstUpper = /^\p{Lu}\p{M}?\p{Ll}+$/u; - exports.regExAllUpper = /^(?:\p{Lu}\p{M}?)+$/u; - exports.regExAllLower = /^(?:\p{Ll}\p{M}?)+$/u; - exports.regExPossibleWordBreaks = /[-+_’'`.\s]/g; - exports.regExMatchRegExParts = /^\s*\/([\s\S]*?)\/([gimuxy]*)\s*$/; - exports.regExAccents = /\p{M}/gu; - exports.regExEscapeCharacters = /(?<=\\)[anrvtbf]/gi; - exports.regExDanglingQuote = /(?<=(?:^|(?!\p{M})\P{L})(?:\p{L}\p{M}?)?)[']/gu; - exports.regExTrailingEndings = /(?<=(?:\p{Lu}\p{M}?){2})['’]?(?:s|d|ings?|ies|e[ds]?|ning|th|nth)(?!\p{Ll})/gu; - exports.regExNumericLiteral = /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/; - function stringToRegExp(pattern, defaultFlags = "gimu", forceFlags = "g") { - if (pattern instanceof RegExp) { - return pattern; - } - try { - const [, pat, flag] = [ - ...pattern.match(exports.regExMatchRegExParts) || ["", pattern.trim(), defaultFlags], - forceFlags - ]; - if (pat) { - const regPattern = flag.includes("x") ? removeVerboseFromRegExp(pat) : pat; - const flags = [...new Set(forceFlags + flag)].join("").replace(/[^gimuy]/g, ""); - const regex = new RegExp(regPattern, flags); - return regex; - } - } catch (e) { + exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; + var fsStat = require_out(); + var constants_1 = require_constants3(); + var utils = require_utils8(); + var common = require_common3(); + function read2(directory, settings) { + if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + return readdirWithFileTypes(directory, settings); } - return void 0; + return readdir(directory, settings); } - exports.stringToRegExp = stringToRegExp; - var SPACES = { - " ": true, - "\n": true, - "\r": true, - " ": true - }; - function removeVerboseFromRegExp(pattern) { - function escape(acc) { - const char = pattern[acc.idx]; - if (char !== "\\") - return void 0; - const next = pattern[++acc.idx]; - acc.idx++; - if (next === "#") { - acc.result += "#"; - return acc; - } - if (!(next in SPACES)) { - acc.result += "\\" + next; - return acc; - } - acc.result += next; - if (next === "\r" && pattern[acc.idx] === "\n") { - acc.result += "\n"; - acc.idx++; - } - return acc; - } - function braces(acc) { - const char = pattern[acc.idx]; - if (char !== "[") - return void 0; - acc.result += char; - acc.idx++; - let escCount = 0; - while (acc.idx < pattern.length) { - const char2 = pattern[acc.idx]; - acc.result += char2; - acc.idx++; - if (char2 === "]" && !(escCount & 1)) - break; - escCount = char2 === "\\" ? escCount + 1 : 0; - } - return acc; - } - function spaces(acc) { - const char = pattern[acc.idx]; - if (!(char in SPACES)) - return void 0; - acc.idx++; - return acc; - } - function comments(acc) { - const char = pattern[acc.idx]; - if (char !== "#") - return void 0; - while (acc.idx < pattern.length && pattern[acc.idx] !== "\n") { - acc.idx++; + exports.read = read2; + function readdirWithFileTypes(directory, settings) { + const dirents = settings.fs.readdirSync(directory, { withFileTypes: true }); + return dirents.map((dirent) => { + const entry = { + dirent, + name: dirent.name, + path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + }; + if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) { + try { + const stats = settings.fs.statSync(entry.path); + entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); + } catch (error2) { + if (settings.throwErrorOnBrokenSymbolicLink) { + throw error2; + } + } } - return acc; - } - function copy(acc) { - const char = pattern[acc.idx++]; - acc.result += char; - return acc; - } - const reducers = [escape, braces, spaces, comments, copy]; - const result = { idx: 0, result: "" }; - while (result.idx < pattern.length) { - for (const r of reducers) { - if (r(result)) - break; + return entry; + }); + } + exports.readdirWithFileTypes = readdirWithFileTypes; + function readdir(directory, settings) { + const names = settings.fs.readdirSync(directory); + return names.map((name) => { + const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); + const stats = fsStat.statSync(entryPath, settings.fsStatSettings); + const entry = { + name, + path: entryPath, + dirent: utils.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; } - } - return result.result; + return entry; + }); } + exports.readdir = readdir; } }); -// node_modules/cspell-lib/dist/cjs/Settings/patterns.js -var require_patterns = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/patterns.js"(exports) { +// node_modules/@nodelib/fs.scandir/out/adapters/fs.js +var require_fs4 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/adapters/fs.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.resolvePatterns = void 0; - var textRegex_js_1 = require_textRegex(); - var util_js_1 = require_util(); - function resolvePatterns(regExpList = [], patternDefinitions = []) { - const patternMap = new Map(patternDefinitions.map((def) => [def.name.toLowerCase(), def.pattern])); - const resolved = /* @__PURE__ */ new Set(); - function resolvePattern(p) { - if (resolved.has(p)) - return void 0; - resolved.add(p); - return patternMap.get(p.toString().toLowerCase()) || p; - } - function* flatten(patterns) { - for (const pattern of patterns) { - if (Array.isArray(pattern)) { - yield* flatten(pattern.map(resolvePattern).filter(util_js_1.isDefined)); - } else { - yield pattern; - } - } + exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; + var fs9 = require("fs"); + exports.FILE_SYSTEM_ADAPTER = { + lstat: fs9.lstat, + stat: fs9.stat, + lstatSync: fs9.lstatSync, + statSync: fs9.statSync, + readdir: fs9.readdir, + readdirSync: fs9.readdirSync + }; + function createFileSystemAdapter(fsMethods) { + if (fsMethods === void 0) { + return exports.FILE_SYSTEM_ADAPTER; } - const patternList = regExpList.map(resolvePattern).filter(util_js_1.isDefined); - return [...flatten(patternList)].map(toRegExp).filter(util_js_1.isDefined); - } - exports.resolvePatterns = resolvePatterns; - function toRegExp(pattern) { - return pattern instanceof RegExp ? new RegExp(pattern) : (0, textRegex_js_1.stringToRegExp)(pattern, "gim", "g"); + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); } + exports.createFileSystemAdapter = createFileSystemAdapter; } }); -// node_modules/cspell-lib/dist/cjs/Settings/CSpellSettingsServer.js -var require_CSpellSettingsServer = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/CSpellSettingsServer.js"(exports) { +// node_modules/@nodelib/fs.scandir/out/settings.js +var require_settings2 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/settings.js"(exports) { "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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(exports, "__esModule", { value: true }); + var path26 = require("path"); + var fsStat = require_out(); + var fs9 = require_fs4(); + var Settings = class { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false); + this.fs = fs9.createFileSystemAdapter(this._options.fs); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path26.sep); + this.stats = this._getValue(this._options.stats, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); + this.fsStatSettings = new fsStat.Settings({ + followSymbolicLink: this.followSymbolicLinks, + fs: this.fs, + throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink + }); } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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); + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; } - __setModuleDefault(result, mod); - return result; - }; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; }; + exports.default = Settings; + } +}); + +// node_modules/@nodelib/fs.scandir/out/index.js +var require_out2 = __commonJS({ + "node_modules/@nodelib/fs.scandir/out/index.js"(exports) { + "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.extractDependencies = exports.getSources = exports.checkFilenameMatchesGlob = exports.toInternalSettings = exports.finalizeSettings = exports.calcOverrideSettings = exports.mergeInDocSettings = exports.mergeSettings = void 0; - var assert_1 = __importDefault(require("assert")); - var cspell_glob_1 = require_cjs(); - var path16 = __importStar(require("path")); - var CSpellSettingsInternalDef_js_1 = require_CSpellSettingsInternalDef(); - var AutoResolve_js_1 = require_AutoResolve(); - var util = __importStar(require_util()); - var constants_js_1 = require_constants3(); - var DictionarySettings_js_1 = require_DictionarySettings(); - var patterns_js_1 = require_patterns(); - function mergeListUnique(left, right) { - if (!Array.isArray(left)) - return Array.isArray(right) ? right : void 0; - if (!Array.isArray(right)) - return left; - if (!right.length) - return left; - if (!left.length) - return right; - return [.../* @__PURE__ */ new Set([...left, ...right])]; - } - function mergeList(left, right) { - if (!Array.isArray(left)) - return Array.isArray(right) ? right : void 0; - if (!Array.isArray(right)) - return left; - if (!left.length) - return right; - if (!right.length) - return left; - return left.concat(right); - } - var emptyWords = []; - Object.freeze(emptyWords); - var cachedMerges = /* @__PURE__ */ new WeakMap(); - function _mergeWordsCached(left, right) { - const map = (0, AutoResolve_js_1.autoResolveWeak)(cachedMerges, left, () => /* @__PURE__ */ new WeakMap()); - return (0, AutoResolve_js_1.autoResolveWeak)(map, right, () => left.concat(right)); - } - function mergeWordsCached(left, right) { - if (!Array.isArray(left) || !left.length) { - return Array.isArray(right) ? right.length ? right : emptyWords : void 0; - } - if (!Array.isArray(right) || !right.length) - return left; - return _mergeWordsCached(left, right); - } - function mergeObjects(left, right) { - if (!left || typeof left !== "object") - return !right || typeof right !== "object" ? void 0 : right; - if (!right || typeof right !== "object") - return left; - return { ...left, ...right }; - } - function replaceIfNotEmpty(left = [], right = []) { - const filtered = right.filter((a) => !!a); - if (filtered.length) { - return filtered; - } - return left; - } - function mergeSettings3(left, ...settings) { - const rawSettings = settings.filter(util.isDefined).reduce(merge, toInternalSettings(left)); - return util.clean(rawSettings); - } - exports.mergeSettings = mergeSettings3; - function isEmpty(obj) { - return Object.keys(obj).length === 0 && obj.constructor === Object; - } - var mergeCache = new AutoResolve_js_1.AutoResolveWeakCache(); - function merge(left, right) { - const map = mergeCache.get(left, () => /* @__PURE__ */ new WeakMap()); - return (0, AutoResolve_js_1.autoResolveWeak)(map, right, () => _merge(left, right)); - } - function _merge(left, right) { - const _left = toInternalSettings(left); - const _right = toInternalSettings(right); - if (left === right) { - return _left; - } - if (isEmpty(right)) { - return _left; - } - if (isEmpty(left)) { - return _right; - } - if (isLeftAncestorOfRight(_left, _right)) { - return _right; - } - if (doesLeftHaveRightAncestor(_left, _right)) { - return _left; - } - const includeRegExpList = takeRightOtherwiseLeft(_left.includeRegExpList, _right.includeRegExpList); - const optionals = includeRegExpList?.length ? { includeRegExpList } : {}; - const version3 = max(_left.version, _right.version); - const valuesToClear = { - name: void 0, - id: void 0, - description: void 0, - globRoot: void 0, - import: void 0, - __importRef: void 0 - }; - const settings = (0, CSpellSettingsInternalDef_js_1.cleanCSpellSettingsInternal)({ - ..._left, - ..._right, - ...optionals, - ...valuesToClear, - version: version3, - words: mergeWordsCached(_left.words, _right.words), - userWords: mergeWordsCached(_left.userWords, _right.userWords), - flagWords: mergeWordsCached(_left.flagWords, _right.flagWords), - ignoreWords: mergeWordsCached(_left.ignoreWords, _right.ignoreWords), - suggestWords: mergeWordsCached(_left.suggestWords, _right.suggestWords), - enabledLanguageIds: replaceIfNotEmpty(_left.enabledLanguageIds, _right.enabledLanguageIds), - enableFiletypes: mergeList(_left.enableFiletypes, _right.enableFiletypes), - ignoreRegExpList: mergeListUnique(_left.ignoreRegExpList, _right.ignoreRegExpList), - patterns: mergeListUnique(_left.patterns, _right.patterns), - dictionaryDefinitions: mergeListUnique(_left.dictionaryDefinitions, _right.dictionaryDefinitions), - dictionaries: mergeListUnique(_left.dictionaries, _right.dictionaries), - noSuggestDictionaries: mergeListUnique(_left.noSuggestDictionaries, _right.noSuggestDictionaries), - languageSettings: mergeList(_left.languageSettings, _right.languageSettings), - enabled: _right.enabled !== void 0 ? _right.enabled : _left.enabled, - files: mergeListUnique(_left.files, _right.files), - ignorePaths: versionBasedMergeList(_left.ignorePaths, _right.ignorePaths, version3), - overrides: versionBasedMergeList(_left.overrides, _right.overrides, version3), - features: mergeObjects(_left.features, _right.features), - source: mergeSources(_left, _right), - plugins: mergeList(_left.plugins, _right.plugins), - __imports: mergeImportRefs(_left, _right) - }); - return settings; - } - function versionBasedMergeList(left, right, version3) { - if (version3 === constants_js_1.configSettingsFileVersion0_1) { - return takeRightOtherwiseLeft(left, right); + exports.Settings = exports.scandirSync = exports.scandir = void 0; + var async = require_async2(); + var sync = require_sync2(); + var settings_1 = require_settings2(); + exports.Settings = settings_1.default; + function scandir(path26, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === "function") { + async.read(path26, getSettings2(), optionsOrSettingsOrCallback); + return; } - return mergeListUnique(left, right); - } - function isLeftAncestorOfRight(left, right) { - return hasAncestor(right, left, 0); - } - function doesLeftHaveRightAncestor(left, right) { - return hasAncestor(left, right, 1); + async.read(path26, getSettings2(optionsOrSettingsOrCallback), callback); } - function hasAncestor(s, ancestor, side) { - const sources = s.source?.sources; - if (!sources) - return false; - const i = side ? sources.length - 1 : 0; - const src = sources[i]; - return src === ancestor || src && hasAncestor(src, ancestor, side) || false; - } - function mergeInDocSettings(left, right) { - const merged = { - ...mergeSettings3(left, right), - includeRegExpList: mergeListUnique(left.includeRegExpList, right.includeRegExpList) - }; - return util.clean(merged); + exports.scandir = scandir; + function scandirSync(path26, optionsOrSettings) { + const settings = getSettings2(optionsOrSettings); + return sync.read(path26, settings); } - exports.mergeInDocSettings = mergeInDocSettings; - function takeRightOtherwiseLeft(left, right) { - if (right?.length) { - return right; + exports.scandirSync = scandirSync; + function getSettings2(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; } - return left || right; - } - function calcOverrideSettings2(settings, filename) { - const _settings = toInternalSettings(settings); - const overrides = _settings.overrides || []; - const result = overrides.filter((override) => checkFilenameMatchesGlob(filename, override.filename)).reduce((settings2, override) => mergeSettings3(settings2, override), _settings); - return result; - } - exports.calcOverrideSettings = calcOverrideSettings2; - function finalizeSettings(settings) { - return _finalizeSettings(toInternalSettings(settings)); - } - exports.finalizeSettings = finalizeSettings; - function _finalizeSettings(settings) { - const finalized = { - ...settings, - finalized: true, - ignoreRegExpList: (0, patterns_js_1.resolvePatterns)(settings.ignoreRegExpList, settings.patterns), - includeRegExpList: (0, patterns_js_1.resolvePatterns)(settings.includeRegExpList, settings.patterns), - parserFn: resolveParser(settings) - }; - finalized.name = "Finalized " + (finalized.name || ""); - finalized.source = { name: settings.name || "src", sources: [settings] }; - return finalized; - } - var cacheInternalSettings = new AutoResolve_js_1.AutoResolveWeakCache(); - function toInternalSettings(settings) { - if (settings === void 0) - return void 0; - if ((0, CSpellSettingsInternalDef_js_1.isCSpellSettingsInternal)(settings)) - return settings; - return cacheInternalSettings.get(settings, _toInternalSettings); - } - exports.toInternalSettings = toInternalSettings; - function _toInternalSettings(settings) { - const { dictionaryDefinitions: defs, ...rest } = settings; - const dictionaryDefinitions = (0, DictionarySettings_js_1.mapDictDefsToInternal)(defs, filenameToDirectory(settings.source?.filename) || resolveCwd()); - const setting = dictionaryDefinitions ? { ...rest, dictionaryDefinitions } : rest; - return (0, CSpellSettingsInternalDef_js_1.cleanCSpellSettingsInternal)(setting); - } - function filenameToDirectory(filename) { - return filename ? path16.dirname(filename) : void 0; - } - function checkFilenameMatchesGlob(filename, globs) { - const m = new cspell_glob_1.GlobMatcher(globs); - return m.match(filename); - } - exports.checkFilenameMatchesGlob = checkFilenameMatchesGlob; - function mergeSources(left, right) { - return { - name: "merged", - sources: [left, right] - }; + return new settings_1.default(settingsOrOptions); } - function max(a, b) { - if (a === void 0 || a === null) - return b; - if (b === void 0 || b === null) - return a; - return a > b ? a : b; - } - function getSources(settings) { - const visited = /* @__PURE__ */ new Set(); - const sources = []; - function _walkSourcesTree(settings2) { - if (!settings2 || visited.has(settings2)) - return; - visited.add(settings2); - if (!settings2.source?.sources?.length) { - sources.push(settings2); - return; + } +}); + +// node_modules/reusify/reusify.js +var require_reusify = __commonJS({ + "node_modules/reusify/reusify.js"(exports, module2) { + "use strict"; + function reusify(Constructor) { + var head = new Constructor(); + var tail = head; + function get() { + var current = head; + if (current.next) { + head = current.next; + } else { + head = new Constructor(); + tail = head; } - settings2.source.sources.forEach(_walkSourcesTree); - } - _walkSourcesTree(settings); - return sources; - } - exports.getSources = getSources; - function mergeImportRefs(left, right = {}) { - const imports = new Map(left.__imports || []); - if (left.__importRef) { - imports.set(left.__importRef.filename, left.__importRef); - } - if (right.__importRef) { - imports.set(right.__importRef.filename, right.__importRef); + current.next = null; + return current; } - const rightImports = right.__imports?.values() || []; - for (const ref of rightImports) { - imports.set(ref.filename, ref); + function release(obj) { + tail.next = obj; + tail = obj; } - return imports.size ? imports : void 0; - } - function extractDependencies2(settings) { - const settingsI = toInternalSettings(settings); - const configFiles = [...mergeImportRefs(settingsI) || []].map(([filename]) => filename); - const dictionaryFiles = (0, DictionarySettings_js_1.calcDictionaryDefsToLoad)(settingsI).map((dict) => dict.path).filter((file) => !!file); return { - configFiles, - dictionaryFiles + get, + release }; } - exports.extractDependencies = extractDependencies2; - function resolveCwd() { - const envGlobRoot = process.env[constants_js_1.ENV_CSPELL_GLOB_ROOT]; - const cwd = envGlobRoot || process.cwd(); - return cwd; - } - function resolveParser(settings) { - if (!settings.parser) - return void 0; - if (typeof settings.parser === "function") - return settings.parser; - const parserName = settings.parser; - (0, assert_1.default)(typeof parserName === "string"); - const parsers2 = extractParsers(settings.plugins); - const parser = parsers2.get(parserName); - (0, assert_1.default)(parser, `Parser "${parserName}" not found.`); - return parser; - } - var parserCache = new AutoResolve_js_1.AutoResolveWeakCache(); - var emptyParserMap = /* @__PURE__ */ new Map(); - function* parsers(plugins) { - for (const plugin of plugins) { - if (!plugin.parsers) - continue; - for (const parser of plugin.parsers) { - yield [parser.name, parser]; - } - } - } - function mapPlugins(plugins) { - return new Map(parsers(plugins)); - } - function extractParsers(plugins) { - if (!plugins || !plugins.length) - return emptyParserMap; - return parserCache.get(plugins, mapPlugins); - } - exports.__testing__ = { - mergeObjects - }; + module2.exports = reusify; } }); -// node_modules/cspell-lib/dist/cjs/util/errors.js -var require_errors3 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/errors.js"(exports) { +// node_modules/fastq/queue.js +var require_queue = __commonJS({ + "node_modules/fastq/queue.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.wrapCall = exports.catchPromiseError = exports.UnknownError = exports.toError = exports.isError = exports.isErrnoException = void 0; - var util_1 = require("util"); - function getTypeOf(t) { - return typeof t; - } - var allowStringOrUndefined = { - string: true, - undefined: true - }; - var allowNumberOrUndefined = { - number: true, - undefined: true - }; - function isErrnoException(e) { - if (!e || typeof e !== "object") - return false; - if (!isError4(e)) - return false; - const ex = e; - return typeof ex.errno in allowNumberOrUndefined && typeof ex.code in allowStringOrUndefined && typeof ex.path in allowStringOrUndefined; - } - exports.isErrnoException = isErrnoException; - function isError4(e) { - if (e instanceof Error) - return true; - if (!e || typeof e !== "object") - return false; - const ex = e; - return typeof ex.name == "string" && typeof ex.message == "string" && typeof ex.stack in allowStringOrUndefined; - } - exports.isError = isError4; - function toError4(e, errorFactory = UnknownError) { - if (isError4(e)) - return e; - return new errorFactory(e); - } - exports.toError = toError4; - var UnknownError = class extends Error { - constructor(cause) { - super((0, util_1.format)(cause)); - this.cause = cause; + var reusify = require_reusify(); + function fastqueue(context, worker, concurrency) { + if (typeof context === "function") { + concurrency = worker; + worker = context; + context = null; } - }; - exports.UnknownError = UnknownError; - function catchPromiseError(p, handler) { - if (p === void 0) - return void 0; - return _catchPromiseError(p, handler); - } - exports.catchPromiseError = catchPromiseError; - function wrapCall(fn, handler) { - return (...p) => { - try { - return fn(...p); - } catch (e) { - return handler(e); - } - }; - } - exports.wrapCall = wrapCall; - async function _catchPromiseError(p, handler) { - try { - return await p; - } catch (e) { - return handler(e); + if (concurrency < 1) { + throw new Error("fastqueue concurrency must be greater than 1"); } - } - exports.__testing__ = { - getTypeOf - }; - } -}); - -// node_modules/graceful-fs/polyfills.js -var require_polyfills = __commonJS({ - "node_modules/graceful-fs/polyfills.js"(exports, module2) { - var constants = require("constants"); - 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) { - } - if (typeof process.chdir === "function") { - chdir = process.chdir; - process.chdir = function(d) { - cwd = null; - chdir.call(process, d); + var cache2 = reusify(Task); + var queueHead = null; + var queueTail = null; + var _running = 0; + var errorHandler = null; + var self = { + push, + drain: noop, + saturated: noop, + pause, + paused: false, + concurrency, + running, + resume, + idle, + length, + getQueue, + unshift, + empty: noop, + kill, + killAndDrain, + error: error2 }; - if (Object.setPrototypeOf) - Object.setPrototypeOf(process.chdir, chdir); - } - var chdir; - module2.exports = patch; - function patch(fs6) { - if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - patchLchmod(fs6); - } - if (!fs6.lutimes) { - patchLutimes(fs6); - } - fs6.chown = chownFix(fs6.chown); - fs6.fchown = chownFix(fs6.fchown); - fs6.lchown = chownFix(fs6.lchown); - fs6.chmod = chmodFix(fs6.chmod); - fs6.fchmod = chmodFix(fs6.fchmod); - fs6.lchmod = chmodFix(fs6.lchmod); - fs6.chownSync = chownFixSync(fs6.chownSync); - fs6.fchownSync = chownFixSync(fs6.fchownSync); - fs6.lchownSync = chownFixSync(fs6.lchownSync); - fs6.chmodSync = chmodFixSync(fs6.chmodSync); - fs6.fchmodSync = chmodFixSync(fs6.fchmodSync); - fs6.lchmodSync = chmodFixSync(fs6.lchmodSync); - fs6.stat = statFix(fs6.stat); - fs6.fstat = statFix(fs6.fstat); - fs6.lstat = statFix(fs6.lstat); - fs6.statSync = statFixSync(fs6.statSync); - fs6.fstatSync = statFixSync(fs6.fstatSync); - fs6.lstatSync = statFixSync(fs6.lstatSync); - if (fs6.chmod && !fs6.lchmod) { - fs6.lchmod = function(path16, mode, cb) { - if (cb) - process.nextTick(cb); - }; - fs6.lchmodSync = function() { - }; + return self; + function running() { + return _running; } - if (fs6.chown && !fs6.lchown) { - fs6.lchown = function(path16, uid, gid, cb) { - if (cb) - process.nextTick(cb); - }; - fs6.lchownSync = function() { - }; + function pause() { + self.paused = true; } - if (platform === "win32") { - fs6.rename = typeof fs6.rename !== "function" ? fs6.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 < 6e4) { - setTimeout(function() { - fs6.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; - }(fs6.rename); + function length() { + var current = queueHead; + var counter = 0; + while (current) { + current = current.next; + counter++; + } + return counter; } - fs6.read = typeof fs6.read !== "function" ? fs6.read : function(fs$read) { - function read2(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(fs6, fd, buffer, offset, length, position, callback); - } - callback_.apply(this, arguments); - }; + function getQueue() { + var current = queueHead; + var tasks = []; + while (current) { + tasks.push(current.value); + current = current.next; + } + return tasks; + } + function resume() { + if (!self.paused) + return; + self.paused = false; + for (var i = 0; i < self.concurrency; i++) { + _running++; + release(); + } + } + function idle() { + return _running === 0 && self.length() === 0; + } + function push(value, done) { + var current = cache2.get(); + current.context = context; + current.release = release; + current.value = value; + current.callback = done || noop; + current.errorHandler = errorHandler; + if (_running === self.concurrency || self.paused) { + if (queueTail) { + queueTail.next = current; + queueTail = current; + } else { + queueHead = current; + queueTail = current; + self.saturated(); } - return fs$read.call(fs6, fd, buffer, offset, length, position, callback); + } else { + _running++; + worker.call(context, current.value, current.worked); } - if (Object.setPrototypeOf) - Object.setPrototypeOf(read2, fs$read); - return read2; - }(fs6.read); - fs6.readSync = typeof fs6.readSync !== "function" ? fs6.readSync : function(fs$readSync) { - return function(fd, buffer, offset, length, position) { - var eagCounter = 0; - while (true) { - try { - return fs$readSync.call(fs6, fd, buffer, offset, length, position); - } catch (er) { - if (er.code === "EAGAIN" && eagCounter < 10) { - eagCounter++; - continue; - } - throw er; - } + } + function unshift(value, done) { + var current = cache2.get(); + current.context = context; + current.release = release; + current.value = value; + current.callback = done || noop; + if (_running === self.concurrency || self.paused) { + if (queueHead) { + current.next = queueHead; + queueHead = current; + } else { + queueHead = current; + queueTail = current; + self.saturated(); } - }; - }(fs6.readSync); - function patchLchmod(fs7) { - fs7.lchmod = function(path16, mode, callback) { - fs7.open( - path16, - constants.O_WRONLY | constants.O_SYMLINK, - mode, - function(err, fd) { - if (err) { - if (callback) - callback(err); - return; - } - fs7.fchmod(fd, mode, function(err2) { - fs7.close(fd, function(err22) { - if (callback) - callback(err2 || err22); - }); - }); + } else { + _running++; + worker.call(context, current.value, current.worked); + } + } + function release(holder) { + if (holder) { + cache2.release(holder); + } + var next = queueHead; + if (next) { + if (!self.paused) { + if (queueTail === queueHead) { + queueTail = null; } - ); - }; - fs7.lchmodSync = function(path16, mode) { - var fd = fs7.openSync(path16, constants.O_WRONLY | constants.O_SYMLINK, mode); - var threw = true; - var ret; - try { - ret = fs7.fchmodSync(fd, mode); - threw = false; - } finally { - if (threw) { - try { - fs7.closeSync(fd); - } catch (er) { - } - } else { - fs7.closeSync(fd); + queueHead = next.next; + next.next = null; + worker.call(context, next.value, next.worked); + if (queueTail === null) { + self.empty(); } + } else { + _running--; } - return ret; - }; - } - function patchLutimes(fs7) { - if (constants.hasOwnProperty("O_SYMLINK") && fs7.futimes) { - fs7.lutimes = function(path16, at, mt, cb) { - fs7.open(path16, constants.O_SYMLINK, function(er, fd) { - if (er) { - if (cb) - cb(er); - return; - } - fs7.futimes(fd, at, mt, function(er2) { - fs7.close(fd, function(er22) { - if (cb) - cb(er2 || er22); - }); - }); - }); - }; - fs7.lutimesSync = function(path16, at, mt) { - var fd = fs7.openSync(path16, constants.O_SYMLINK); - var ret; - var threw = true; - try { - ret = fs7.futimesSync(fd, at, mt); - threw = false; - } finally { - if (threw) { - try { - fs7.closeSync(fd); - } catch (er) { - } - } else { - fs7.closeSync(fd); - } - } - return ret; - }; - } else if (fs7.futimes) { - fs7.lutimes = function(_a, _b, _c, cb) { - if (cb) - process.nextTick(cb); - }; - fs7.lutimesSync = function() { - }; + } else if (--_running === 0) { + self.drain(); } } - function chmodFix(orig) { - if (!orig) - return orig; - return function(target, mode, cb) { - return orig.call(fs6, target, mode, function(er) { - if (chownErOk(er)) - er = null; - if (cb) - cb.apply(this, arguments); - }); - }; + function kill() { + queueHead = null; + queueTail = null; + self.drain = noop; } - function chmodFixSync(orig) { - if (!orig) - return orig; - return function(target, mode) { - try { - return orig.call(fs6, target, mode); - } catch (er) { - if (!chownErOk(er)) - throw er; - } - }; + function killAndDrain() { + queueHead = null; + queueTail = null; + self.drain(); + self.drain = noop; } - function chownFix(orig) { - if (!orig) - return orig; - return function(target, uid, gid, cb) { - return orig.call(fs6, target, uid, gid, function(er) { - if (chownErOk(er)) - er = null; - if (cb) - cb.apply(this, arguments); - }); - }; + function error2(handler) { + errorHandler = handler; } - function chownFixSync(orig) { - if (!orig) - return orig; - return function(target, uid, gid) { - try { - return orig.call(fs6, target, uid, gid); - } catch (er) { - if (!chownErOk(er)) - throw er; - } - }; + } + function noop() { + } + function Task() { + this.value = null; + this.callback = noop; + this.next = null; + this.release = noop; + this.context = null; + this.errorHandler = null; + var self = this; + this.worked = function worked(err, result) { + var callback = self.callback; + var errorHandler = self.errorHandler; + var val = self.value; + self.value = null; + self.callback = noop; + if (self.errorHandler) { + errorHandler(err, val); + } + callback.call(self.context, err, result); + self.release(self); + }; + } + function queueAsPromised(context, worker, concurrency) { + if (typeof context === "function") { + concurrency = worker; + worker = context; + context = null; } - function statFix(orig) { - if (!orig) - return orig; - 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 += 4294967296; - if (stats.gid < 0) - stats.gid += 4294967296; + function asyncWrapper(arg, cb) { + worker.call(this, arg).then(function(res) { + cb(null, res); + }, cb); + } + var queue = fastqueue(context, asyncWrapper, concurrency); + var pushCb = queue.push; + var unshiftCb = queue.unshift; + queue.push = push; + queue.unshift = unshift; + queue.drained = drained; + return queue; + function push(value) { + var p = new Promise(function(resolve13, reject) { + pushCb(value, function(err, result) { + if (err) { + reject(err); + return; } - if (cb) - cb.apply(this, arguments); - } - return options ? orig.call(fs6, target, options, callback) : orig.call(fs6, target, callback); - }; + resolve13(result); + }); + }); + p.catch(noop); + return p; } - function statFixSync(orig) { - if (!orig) - return orig; - return function(target, options) { - var stats = options ? orig.call(fs6, target, options) : orig.call(fs6, target); - if (stats) { - if (stats.uid < 0) - stats.uid += 4294967296; - if (stats.gid < 0) - stats.gid += 4294967296; - } - return stats; - }; + function unshift(value) { + var p = new Promise(function(resolve13, reject) { + unshiftCb(value, function(err, result) { + if (err) { + reject(err); + return; + } + resolve13(result); + }); + }); + p.catch(noop); + return p; } - 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; + function drained() { + if (queue.idle()) { + return new Promise(function(resolve13) { + resolve13(); + }); } - return false; + var previousDrain = queue.drain; + var p = new Promise(function(resolve13) { + queue.drain = function() { + previousDrain(); + resolve13(); + }; + }); + return p; } } + module2.exports = fastqueue; + module2.exports.promise = queueAsPromised; } }); -// node_modules/graceful-fs/legacy-streams.js -var require_legacy_streams = __commonJS({ - "node_modules/graceful-fs/legacy-streams.js"(exports, module2) { - var Stream3 = require("stream").Stream; - module2.exports = legacy; - function legacy(fs6) { - return { - ReadStream, - WriteStream - }; - function ReadStream(path16, options) { - if (!(this instanceof ReadStream)) - return new ReadStream(path16, options); - Stream3.call(this); - var self = this; - this.path = path16; - this.fd = null; - this.readable = true; - this.paused = false; - this.flags = "r"; - this.mode = 438; - this.bufferSize = 64 * 1024; - options = options || {}; - 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 !== void 0) { - if ("number" !== typeof this.start) { - throw TypeError("start must be a Number"); - } - if (this.end === void 0) { - 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; - } - fs6.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(); - }); +// node_modules/@nodelib/fs.walk/out/readers/common.js +var require_common4 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/readers/common.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0; + function isFatalError(settings, error2) { + if (settings.errorFilter === null) { + return true; } - function WriteStream(path16, options) { - if (!(this instanceof WriteStream)) - return new WriteStream(path16, options); - Stream3.call(this); - this.path = path16; - this.fd = null; - this.writable = true; - this.flags = "w"; - this.encoding = "binary"; - this.mode = 438; - this.bytesWritten = 0; - options = options || {}; - 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 !== void 0) { - 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 = fs6.open; - this._queue.push([this._open, this.path, this.flags, this.mode, void 0]); - this.flush(); - } + return !settings.errorFilter(error2); + } + exports.isFatalError = isFatalError; + function isAppliedFilter(filter3, value) { + return filter3 === null || filter3(value); + } + exports.isAppliedFilter = isAppliedFilter; + function replacePathSegmentSeparator(filepath, separator) { + return filepath.split(/[/\\]/).join(separator); + } + exports.replacePathSegmentSeparator = replacePathSegmentSeparator; + function joinPathSegments(a, b, separator) { + if (a === "") { + return b; + } + if (a.endsWith(separator)) { + return a + b; } + return a + separator + b; } + exports.joinPathSegments = joinPathSegments; } }); -// node_modules/graceful-fs/clone.js -var require_clone = __commonJS({ - "node_modules/graceful-fs/clone.js"(exports, module2) { +// node_modules/@nodelib/fs.walk/out/readers/reader.js +var require_reader = __commonJS({ + "node_modules/@nodelib/fs.walk/out/readers/reader.js"(exports) { "use strict"; - module2.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 = /* @__PURE__ */ Object.create(null); - Object.getOwnPropertyNames(obj).forEach(function(key) { - Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)); - }); - return copy; - } + Object.defineProperty(exports, "__esModule", { value: true }); + var common = require_common4(); + var Reader = class { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator); + } + }; + exports.default = Reader; } }); -// node_modules/graceful-fs/graceful-fs.js -var require_graceful_fs = __commonJS({ - "node_modules/graceful-fs/graceful-fs.js"(exports, module2) { - var fs6 = require("fs"); - var polyfills = require_polyfills(); - var legacy = require_legacy_streams(); - var clone = require_clone(); - var util = require("util"); - var gracefulQueue; - var previousSymbol; - if (typeof Symbol === "function" && typeof Symbol.for === "function") { - gracefulQueue = Symbol.for("graceful-fs.queue"); - previousSymbol = Symbol.for("graceful-fs.previous"); - } else { - gracefulQueue = "___graceful-fs.queue"; - previousSymbol = "___graceful-fs.previous"; - } - function noop() { - } - function publishQueue(context, queue2) { - Object.defineProperty(context, gracefulQueue, { - get: function() { - return queue2; - } - }); - } - 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); - }; - if (!fs6[gracefulQueue]) { - queue = global[gracefulQueue] || []; - publishQueue(fs6, queue); - fs6.close = function(fs$close) { - function close(fd, cb) { - return fs$close.call(fs6, fd, function(err) { - if (!err) { - resetQueue(); - } - if (typeof cb === "function") - cb.apply(this, arguments); - }); - } - Object.defineProperty(close, previousSymbol, { - value: fs$close - }); - return close; - }(fs6.close); - fs6.closeSync = function(fs$closeSync) { - function closeSync(fd) { - fs$closeSync.apply(fs6, arguments); - resetQueue(); - } - Object.defineProperty(closeSync, previousSymbol, { - value: fs$closeSync - }); - return closeSync; - }(fs6.closeSync); - if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) { - process.on("exit", function() { - debug(fs6[gracefulQueue]); - require("assert").equal(fs6[gracefulQueue].length, 0); - }); - } - } - var queue; - if (!global[gracefulQueue]) { - publishQueue(global, fs6[gracefulQueue]); - } - module2.exports = patch(clone(fs6)); - if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs6.__patched) { - module2.exports = patch(fs6); - fs6.__patched = true; - } - function patch(fs7) { - polyfills(fs7); - fs7.gracefulify = patch; - fs7.createReadStream = createReadStream; - fs7.createWriteStream = createWriteStream; - var fs$readFile = fs7.readFile; - fs7.readFile = readFile4; - function readFile4(path16, options, cb) { - if (typeof options === "function") - cb = options, options = null; - return go$readFile(path16, options, cb); - function go$readFile(path17, options2, cb2, startTime) { - return fs$readFile(path17, options2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$readFile, [path17, options2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } - } - var fs$writeFile = fs7.writeFile; - fs7.writeFile = writeFile; - function writeFile(path16, data, options, cb) { - if (typeof options === "function") - cb = options, options = null; - return go$writeFile(path16, data, options, cb); - function go$writeFile(path17, data2, options2, cb2, startTime) { - return fs$writeFile(path17, data2, options2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$writeFile, [path17, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } +// node_modules/@nodelib/fs.walk/out/readers/async.js +var require_async3 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/readers/async.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var events_1 = require("events"); + var fsScandir = require_out2(); + var fastq = require_queue(); + var common = require_common4(); + var reader_1 = require_reader(); + var AsyncReader = class extends reader_1.default { + constructor(_root, _settings) { + super(_root, _settings); + this._settings = _settings; + this._scandir = fsScandir.scandir; + this._emitter = new events_1.EventEmitter(); + this._queue = fastq(this._worker.bind(this), this._settings.concurrency); + this._isFatalError = false; + this._isDestroyed = false; + this._queue.drain = () => { + if (!this._isFatalError) { + this._emitter.emit("end"); + } + }; } - var fs$appendFile = fs7.appendFile; - if (fs$appendFile) - fs7.appendFile = appendFile; - function appendFile(path16, data, options, cb) { - if (typeof options === "function") - cb = options, options = null; - return go$appendFile(path16, data, options, cb); - function go$appendFile(path17, data2, options2, cb2, startTime) { - return fs$appendFile(path17, data2, options2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$appendFile, [path17, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } + read() { + this._isFatalError = false; + this._isDestroyed = false; + setImmediate(() => { + this._pushToQueue(this._root, this._settings.basePath); + }); + return this._emitter; } - var fs$copyFile = fs7.copyFile; - if (fs$copyFile) - fs7.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(src2, dest2, flags2, cb2, startTime) { - return fs$copyFile(src2, dest2, flags2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } + get isDestroyed() { + return this._isDestroyed; } - var fs$readdir = fs7.readdir; - fs7.readdir = readdir; - var noReaddirOptionVersions = /^v[0-5]\./; - function readdir(path16, options, cb) { - if (typeof options === "function") - cb = options, options = null; - var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path17, options2, cb2, startTime) { - return fs$readdir(path17, fs$readdirCallback( - path17, - options2, - cb2, - startTime - )); - } : function go$readdir2(path17, options2, cb2, startTime) { - return fs$readdir(path17, options2, fs$readdirCallback( - path17, - options2, - cb2, - startTime - )); - }; - return go$readdir(path16, options, cb); - function fs$readdirCallback(path17, options2, cb2, startTime) { - return function(err, files) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([ - go$readdir, - [path17, options2, cb2], - err, - startTime || Date.now(), - Date.now() - ]); - else { - if (files && files.sort) - files.sort(); - if (typeof cb2 === "function") - cb2.call(this, err, files); - } - }; + destroy() { + if (this._isDestroyed) { + throw new Error("The reader is already destroyed"); } + this._isDestroyed = true; + this._queue.killAndDrain(); } - if (process.version.substr(0, 4) === "v0.8") { - var legStreams = legacy(fs7); - ReadStream = legStreams.ReadStream; - WriteStream = legStreams.WriteStream; - } - var fs$ReadStream = fs7.ReadStream; - if (fs$ReadStream) { - ReadStream.prototype = Object.create(fs$ReadStream.prototype); - ReadStream.prototype.open = ReadStream$open; + onEntry(callback) { + this._emitter.on("entry", callback); } - var fs$WriteStream = fs7.WriteStream; - if (fs$WriteStream) { - WriteStream.prototype = Object.create(fs$WriteStream.prototype); - WriteStream.prototype.open = WriteStream$open; + onError(callback) { + this._emitter.once("error", callback); } - Object.defineProperty(fs7, "ReadStream", { - get: function() { - return ReadStream; - }, - set: function(val) { - ReadStream = val; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(fs7, "WriteStream", { - get: function() { - return WriteStream; - }, - set: function(val) { - WriteStream = val; - }, - enumerable: true, - configurable: true - }); - var FileReadStream = ReadStream; - Object.defineProperty(fs7, "FileReadStream", { - get: function() { - return FileReadStream; - }, - set: function(val) { - FileReadStream = val; - }, - enumerable: true, - configurable: true - }); - var FileWriteStream = WriteStream; - Object.defineProperty(fs7, "FileWriteStream", { - get: function() { - return FileWriteStream; - }, - set: function(val) { - FileWriteStream = val; - }, - enumerable: true, - configurable: true - }); - function ReadStream(path16, options) { - if (this instanceof ReadStream) - return fs$ReadStream.apply(this, arguments), this; - else - return ReadStream.apply(Object.create(ReadStream.prototype), arguments); + onEnd(callback) { + this._emitter.once("end", callback); } - 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(); + _pushToQueue(directory, base) { + const queueItem = { directory, base }; + this._queue.push(queueItem, (error2) => { + if (error2 !== null) { + this._handleError(error2); } }); } - function WriteStream(path16, 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); + _worker(item, done) { + this._scandir(item.directory, this._settings.fsScandirSettings, (error2, entries) => { + if (error2 !== null) { + done(error2, void 0); + return; } + for (const entry of entries) { + this._handleEntry(entry, item.base); + } + done(null, void 0); }); } - function createReadStream(path16, options) { - return new fs7.ReadStream(path16, options); - } - function createWriteStream(path16, options) { - return new fs7.WriteStream(path16, options); - } - var fs$open = fs7.open; - fs7.open = open; - function open(path16, flags, mode, cb) { - if (typeof mode === "function") - cb = mode, mode = null; - return go$open(path16, flags, mode, cb); - function go$open(path17, flags2, mode2, cb2, startTime) { - return fs$open(path17, flags2, mode2, function(err, fd) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$open, [path17, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); + _handleError(error2) { + if (this._isDestroyed || !common.isFatalError(this._settings, error2)) { + return; } + this._isFatalError = true; + this._isDestroyed = true; + this._emitter.emit("error", error2); } - return fs7; - } - function enqueue(elem) { - debug("ENQUEUE", elem[0].name, elem[1]); - fs6[gracefulQueue].push(elem); - retry(); - } - var retryTimer; - function resetQueue() { - var now = Date.now(); - for (var i = 0; i < fs6[gracefulQueue].length; ++i) { - if (fs6[gracefulQueue][i].length > 2) { - fs6[gracefulQueue][i][3] = now; - fs6[gracefulQueue][i][4] = now; + _handleEntry(entry, base) { + if (this._isDestroyed || this._isFatalError) { + return; } - } - retry(); - } - function retry() { - clearTimeout(retryTimer); - retryTimer = void 0; - if (fs6[gracefulQueue].length === 0) - return; - var elem = fs6[gracefulQueue].shift(); - var fn = elem[0]; - var args = elem[1]; - var err = elem[2]; - var startTime = elem[3]; - var lastTime = elem[4]; - if (startTime === void 0) { - debug("RETRY", fn.name, args); - fn.apply(null, args); - } else if (Date.now() - startTime >= 6e4) { - debug("TIMEOUT", fn.name, args); - var cb = args.pop(); - if (typeof cb === "function") - cb.call(null, err); - } else { - var sinceAttempt = Date.now() - lastTime; - var sinceStart = Math.max(lastTime - startTime, 1); - var desiredDelay = Math.min(sinceStart * 1.2, 100); - if (sinceAttempt >= desiredDelay) { - debug("RETRY", fn.name, args); - fn.apply(null, args.concat([startTime])); - } else { - fs6[gracefulQueue].push(elem); + const fullpath = entry.path; + if (base !== void 0) { + entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common.isAppliedFilter(this._settings.entryFilter, entry)) { + this._emitEntry(entry); + } + if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path); } } - if (retryTimer === void 0) { - retryTimer = setTimeout(retry, 0); + _emitEntry(entry) { + this._emitter.emit("entry", entry); } - } + }; + exports.default = AsyncReader; } }); -// node_modules/make-dir/node_modules/semver/semver.js -var require_semver = __commonJS({ - "node_modules/make-dir/node_modules/semver/semver.js"(exports, module2) { - exports = module2.exports = SemVer; - var debug; - if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug = function() { - var args = Array.prototype.slice.call(arguments, 0); - args.unshift("SEMVER"); - console.log.apply(console, args); - }; - } else { - debug = function() { - }; - } - exports.SEMVER_SPEC_VERSION = "2.0.0"; - var MAX_LENGTH = 256; - var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ - 9007199254740991; - var MAX_SAFE_COMPONENT_LENGTH = 16; - var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6; - var re = exports.re = []; - var safeRe = exports.safeRe = []; - var src = exports.src = []; - var t = exports.tokens = {}; - var R = 0; - function tok(n) { - t[n] = R++; - } - var LETTERDASHNUMBER = "[a-zA-Z0-9-]"; - var safeRegexReplacements = [ - ["\\s", 1], - ["\\d", MAX_LENGTH], - [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH] - ]; - function makeSafeRe(value) { - for (var i2 = 0; i2 < safeRegexReplacements.length; i2++) { - var token = safeRegexReplacements[i2][0]; - var max = safeRegexReplacements[i2][1]; - value = value.split(token + "*").join(token + "{0," + max + "}").split(token + "+").join(token + "{1," + max + "}"); - } - return value; - } - tok("NUMERICIDENTIFIER"); - src[t.NUMERICIDENTIFIER] = "0|[1-9]\\d*"; - tok("NUMERICIDENTIFIERLOOSE"); - src[t.NUMERICIDENTIFIERLOOSE] = "\\d+"; - tok("NONNUMERICIDENTIFIER"); - src[t.NONNUMERICIDENTIFIER] = "\\d*[a-zA-Z-]" + LETTERDASHNUMBER + "*"; - tok("MAINVERSION"); - src[t.MAINVERSION] = "(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")"; - tok("MAINVERSIONLOOSE"); - src[t.MAINVERSIONLOOSE] = "(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")"; - tok("PRERELEASEIDENTIFIER"); - src[t.PRERELEASEIDENTIFIER] = "(?:" + src[t.NUMERICIDENTIFIER] + "|" + src[t.NONNUMERICIDENTIFIER] + ")"; - tok("PRERELEASEIDENTIFIERLOOSE"); - src[t.PRERELEASEIDENTIFIERLOOSE] = "(?:" + src[t.NUMERICIDENTIFIERLOOSE] + "|" + src[t.NONNUMERICIDENTIFIER] + ")"; - tok("PRERELEASE"); - src[t.PRERELEASE] = "(?:-(" + src[t.PRERELEASEIDENTIFIER] + "(?:\\." + src[t.PRERELEASEIDENTIFIER] + ")*))"; - tok("PRERELEASELOOSE"); - src[t.PRERELEASELOOSE] = "(?:-?(" + src[t.PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + src[t.PRERELEASEIDENTIFIERLOOSE] + ")*))"; - tok("BUILDIDENTIFIER"); - src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + "+"; - tok("BUILD"); - src[t.BUILD] = "(?:\\+(" + src[t.BUILDIDENTIFIER] + "(?:\\." + src[t.BUILDIDENTIFIER] + ")*))"; - tok("FULL"); - tok("FULLPLAIN"); - src[t.FULLPLAIN] = "v?" + src[t.MAINVERSION] + src[t.PRERELEASE] + "?" + src[t.BUILD] + "?"; - src[t.FULL] = "^" + src[t.FULLPLAIN] + "$"; - tok("LOOSEPLAIN"); - src[t.LOOSEPLAIN] = "[v=\\s]*" + src[t.MAINVERSIONLOOSE] + src[t.PRERELEASELOOSE] + "?" + src[t.BUILD] + "?"; - tok("LOOSE"); - src[t.LOOSE] = "^" + src[t.LOOSEPLAIN] + "$"; - tok("GTLT"); - src[t.GTLT] = "((?:<|>)?=?)"; - tok("XRANGEIDENTIFIERLOOSE"); - src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + "|x|X|\\*"; - tok("XRANGEIDENTIFIER"); - src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + "|x|X|\\*"; - tok("XRANGEPLAIN"); - src[t.XRANGEPLAIN] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:" + src[t.PRERELEASE] + ")?" + src[t.BUILD] + "?)?)?"; - tok("XRANGEPLAINLOOSE"); - src[t.XRANGEPLAINLOOSE] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:" + src[t.PRERELEASELOOSE] + ")?" + src[t.BUILD] + "?)?)?"; - tok("XRANGE"); - src[t.XRANGE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAIN] + "$"; - tok("XRANGELOOSE"); - src[t.XRANGELOOSE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAINLOOSE] + "$"; - tok("COERCE"); - src[t.COERCE] = "(^|[^\\d])(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "})(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:$|[^\\d])"; - tok("COERCERTL"); - re[t.COERCERTL] = new RegExp(src[t.COERCE], "g"); - safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), "g"); - tok("LONETILDE"); - src[t.LONETILDE] = "(?:~>?)"; - tok("TILDETRIM"); - src[t.TILDETRIM] = "(\\s*)" + src[t.LONETILDE] + "\\s+"; - re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], "g"); - safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), "g"); - var tildeTrimReplace = "$1~"; - tok("TILDE"); - src[t.TILDE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAIN] + "$"; - tok("TILDELOOSE"); - src[t.TILDELOOSE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + "$"; - tok("LONECARET"); - src[t.LONECARET] = "(?:\\^)"; - tok("CARETTRIM"); - src[t.CARETTRIM] = "(\\s*)" + src[t.LONECARET] + "\\s+"; - re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], "g"); - safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), "g"); - var caretTrimReplace = "$1^"; - tok("CARET"); - src[t.CARET] = "^" + src[t.LONECARET] + src[t.XRANGEPLAIN] + "$"; - tok("CARETLOOSE"); - src[t.CARETLOOSE] = "^" + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + "$"; - tok("COMPARATORLOOSE"); - src[t.COMPARATORLOOSE] = "^" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + ")$|^$"; - tok("COMPARATOR"); - src[t.COMPARATOR] = "^" + src[t.GTLT] + "\\s*(" + src[t.FULLPLAIN] + ")$|^$"; - tok("COMPARATORTRIM"); - src[t.COMPARATORTRIM] = "(\\s*)" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + "|" + src[t.XRANGEPLAIN] + ")"; - re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], "g"); - safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), "g"); - var comparatorTrimReplace = "$1$2$3"; - tok("HYPHENRANGE"); - src[t.HYPHENRANGE] = "^\\s*(" + src[t.XRANGEPLAIN] + ")\\s+-\\s+(" + src[t.XRANGEPLAIN] + ")\\s*$"; - tok("HYPHENRANGELOOSE"); - src[t.HYPHENRANGELOOSE] = "^\\s*(" + src[t.XRANGEPLAINLOOSE] + ")\\s+-\\s+(" + src[t.XRANGEPLAINLOOSE] + ")\\s*$"; - tok("STAR"); - src[t.STAR] = "(<|>)?=?\\s*\\*"; - for (i = 0; i < R; i++) { - debug(i, src[i]); - if (!re[i]) { - re[i] = new RegExp(src[i]); - safeRe[i] = new RegExp(makeSafeRe(src[i])); - } - } - var i; - exports.parse = parse3; - function parse3(version3, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; - } - if (version3 instanceof SemVer) { - return version3; - } - if (typeof version3 !== "string") { - return null; - } - if (version3.length > MAX_LENGTH) { - return null; - } - var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]; - if (!r.test(version3)) { - return null; +// node_modules/@nodelib/fs.walk/out/providers/async.js +var require_async4 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/providers/async.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var async_1 = require_async3(); + var AsyncProvider = class { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1.default(this._root, this._settings); + this._storage = []; } - try { - return new SemVer(version3, options); - } catch (er) { - return null; + read(callback) { + this._reader.onError((error2) => { + callFailureCallback(callback, error2); + }); + this._reader.onEntry((entry) => { + this._storage.push(entry); + }); + this._reader.onEnd(() => { + callSuccessCallback(callback, this._storage); + }); + this._reader.read(); } + }; + exports.default = AsyncProvider; + function callFailureCallback(callback, error2) { + callback(error2); } - exports.valid = valid; - function valid(version3, options) { - var v = parse3(version3, options); - return v ? v.version : null; - } - exports.clean = clean2; - function clean2(version3, options) { - var s = parse3(version3.trim().replace(/^[=v]+/, ""), options); - return s ? s.version : null; + function callSuccessCallback(callback, entries) { + callback(null, entries); } - exports.SemVer = SemVer; - function SemVer(version3, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; - } - if (version3 instanceof SemVer) { - if (version3.loose === options.loose) { - return version3; - } else { - version3 = version3.version; - } - } else if (typeof version3 !== "string") { - throw new TypeError("Invalid Version: " + version3); - } - if (version3.length > MAX_LENGTH) { - throw new TypeError("version is longer than " + MAX_LENGTH + " characters"); - } - if (!(this instanceof SemVer)) { - return new SemVer(version3, options); - } - debug("SemVer", version3, options); - this.options = options; - this.loose = !!options.loose; - var m = version3.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]); - if (!m) { - throw new TypeError("Invalid Version: " + version3); - } - this.raw = version3; - this.major = +m[1]; - this.minor = +m[2]; - this.patch = +m[3]; - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError("Invalid major version"); - } - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError("Invalid minor version"); - } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError("Invalid patch version"); - } - if (!m[4]) { - this.prerelease = []; - } else { - this.prerelease = m[4].split(".").map(function(id) { - if (/^[0-9]+$/.test(id)) { - var num = +id; - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num; + } +}); + +// node_modules/@nodelib/fs.walk/out/providers/stream.js +var require_stream2 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/providers/stream.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var stream_1 = require("stream"); + var async_1 = require_async3(); + var StreamProvider = class { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1.default(this._root, this._settings); + this._stream = new stream_1.Readable({ + objectMode: true, + read: () => { + }, + destroy: () => { + if (!this._reader.isDestroyed) { + this._reader.destroy(); } } - return id; }); } - this.build = m[5] ? m[5].split(".") : []; - this.format(); - } - SemVer.prototype.format = function() { - this.version = this.major + "." + this.minor + "." + this.patch; - if (this.prerelease.length) { - this.version += "-" + this.prerelease.join("."); - } - return this.version; - }; - SemVer.prototype.toString = function() { - return this.version; - }; - SemVer.prototype.compare = function(other) { - debug("SemVer.compare", this.version, this.options, other); - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); + read() { + this._reader.onError((error2) => { + this._stream.emit("error", error2); + }); + this._reader.onEntry((entry) => { + this._stream.push(entry); + }); + this._reader.onEnd(() => { + this._stream.push(null); + }); + this._reader.read(); + return this._stream; } - return this.compareMain(other) || this.comparePre(other); }; - SemVer.prototype.compareMain = function(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); + exports.default = StreamProvider; + } +}); + +// node_modules/@nodelib/fs.walk/out/readers/sync.js +var require_sync3 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/readers/sync.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var fsScandir = require_out2(); + var common = require_common4(); + var reader_1 = require_reader(); + var SyncReader = class extends reader_1.default { + constructor() { + super(...arguments); + this._scandir = fsScandir.scandirSync; + this._storage = []; + this._queue = /* @__PURE__ */ new Set(); } - return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); - }; - SemVer.prototype.comparePre = function(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); + read() { + this._pushToQueue(this._root, this._settings.basePath); + this._handleQueue(); + return this._storage; } - if (this.prerelease.length && !other.prerelease.length) { - return -1; - } else if (!this.prerelease.length && other.prerelease.length) { - return 1; - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0; + _pushToQueue(directory, base) { + this._queue.add({ directory, base }); } - var i2 = 0; - do { - var a = this.prerelease[i2]; - var b = other.prerelease[i2]; - debug("prerelease compare", i2, a, b); - if (a === void 0 && b === void 0) { - return 0; - } else if (b === void 0) { - return 1; - } else if (a === void 0) { - return -1; - } else if (a === b) { - continue; - } else { - return compareIdentifiers(a, b); + _handleQueue() { + for (const item of this._queue.values()) { + this._handleDirectory(item.directory, item.base); } - } while (++i2); - }; - SemVer.prototype.compareBuild = function(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); } - var i2 = 0; - do { - var a = this.build[i2]; - var b = other.build[i2]; - debug("prerelease compare", i2, a, b); - if (a === void 0 && b === void 0) { - return 0; - } else if (b === void 0) { - return 1; - } else if (a === void 0) { - return -1; - } else if (a === b) { - continue; - } else { - return compareIdentifiers(a, b); - } - } while (++i2); - }; - SemVer.prototype.inc = function(release, identifier) { - switch (release) { - case "premajor": - this.prerelease.length = 0; - this.patch = 0; - this.minor = 0; - this.major++; - this.inc("pre", identifier); - break; - case "preminor": - this.prerelease.length = 0; - this.patch = 0; - this.minor++; - this.inc("pre", identifier); - break; - case "prepatch": - this.prerelease.length = 0; - this.inc("patch", identifier); - this.inc("pre", identifier); - break; - case "prerelease": - if (this.prerelease.length === 0) { - this.inc("patch", identifier); + _handleDirectory(directory, base) { + try { + const entries = this._scandir(directory, this._settings.fsScandirSettings); + for (const entry of entries) { + this._handleEntry(entry, base); } - this.inc("pre", identifier); - break; - case "major": - if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { - this.major++; - } - this.minor = 0; - this.patch = 0; - this.prerelease = []; - break; - case "minor": - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++; - } - this.patch = 0; - this.prerelease = []; - break; - case "patch": - if (this.prerelease.length === 0) { - this.patch++; - } - this.prerelease = []; - break; - case "pre": - if (this.prerelease.length === 0) { - this.prerelease = [0]; - } else { - var i2 = this.prerelease.length; - while (--i2 >= 0) { - if (typeof this.prerelease[i2] === "number") { - this.prerelease[i2]++; - i2 = -2; - } - } - if (i2 === -1) { - this.prerelease.push(0); - } - } - if (identifier) { - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0]; - } - } else { - this.prerelease = [identifier, 0]; - } - } - break; - default: - throw new Error("invalid increment argument: " + release); - } - this.format(); - this.raw = this.version; - return this; - }; - exports.inc = inc; - function inc(version3, release, loose, identifier) { - if (typeof loose === "string") { - identifier = loose; - loose = void 0; + } catch (error2) { + this._handleError(error2); + } } - try { - return new SemVer(version3, loose).inc(release, identifier).version; - } catch (er) { - return null; + _handleError(error2) { + if (!common.isFatalError(this._settings, error2)) { + return; + } + throw error2; } - } - exports.diff = diff; - function diff(version1, version22) { - if (eq(version1, version22)) { - return null; - } else { - var v12 = parse3(version1); - var v2 = parse3(version22); - var prefix = ""; - if (v12.prerelease.length || v2.prerelease.length) { - prefix = "pre"; - var defaultResult = "prerelease"; - } - for (var key in v12) { - if (key === "major" || key === "minor" || key === "patch") { - if (v12[key] !== v2[key]) { - return prefix + key; - } - } + _handleEntry(entry, base) { + const fullpath = entry.path; + if (base !== void 0) { + entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common.isAppliedFilter(this._settings.entryFilter, entry)) { + this._pushToStorage(entry); + } + if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path); } - return defaultResult; } - } - exports.compareIdentifiers = compareIdentifiers; - var numeric = /^[0-9]+$/; - function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.test(b); - if (anum && bnum) { - a = +a; - b = +b; + _pushToStorage(entry) { + this._storage.push(entry); } - return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; - } - exports.rcompareIdentifiers = rcompareIdentifiers; - function rcompareIdentifiers(a, b) { - return compareIdentifiers(b, a); - } - exports.major = major; - function major(a, loose) { - return new SemVer(a, loose).major; - } - exports.minor = minor; - function minor(a, loose) { - return new SemVer(a, loose).minor; - } - exports.patch = patch; - function patch(a, loose) { - return new SemVer(a, loose).patch; - } - exports.compare = compare2; - function compare2(a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)); - } - exports.compareLoose = compareLoose; - function compareLoose(a, b) { - return compare2(a, b, true); - } - exports.compareBuild = compareBuild; - function compareBuild(a, b, loose) { - var versionA = new SemVer(a, loose); - var versionB = new SemVer(b, loose); - return versionA.compare(versionB) || versionA.compareBuild(versionB); - } - exports.rcompare = rcompare; - function rcompare(a, b, loose) { - return compare2(b, a, loose); - } - exports.sort = sort; - function sort(list, loose) { - return list.sort(function(a, b) { - return exports.compareBuild(a, b, loose); - }); - } - exports.rsort = rsort; - function rsort(list, loose) { - return list.sort(function(a, b) { - return exports.compareBuild(b, a, loose); - }); - } - exports.gt = gt; - function gt(a, b, loose) { - return compare2(a, b, loose) > 0; - } - exports.lt = lt; - function lt(a, b, loose) { - return compare2(a, b, loose) < 0; - } - exports.eq = eq; - function eq(a, b, loose) { - return compare2(a, b, loose) === 0; - } - exports.neq = neq; - function neq(a, b, loose) { - return compare2(a, b, loose) !== 0; - } - exports.gte = gte; - function gte(a, b, loose) { - return compare2(a, b, loose) >= 0; - } - exports.lte = lte; - function lte(a, b, loose) { - return compare2(a, b, loose) <= 0; - } - exports.cmp = cmp; - function cmp(a, op, b, loose) { - switch (op) { - case "===": - if (typeof a === "object") - a = a.version; - if (typeof b === "object") - b = b.version; - return a === b; - case "!==": - if (typeof a === "object") - a = a.version; - if (typeof b === "object") - b = b.version; - return a !== b; - case "": - case "=": - case "==": - return eq(a, b, loose); - case "!=": - return neq(a, b, loose); - case ">": - return gt(a, b, loose); - case ">=": - return gte(a, b, loose); - case "<": - return lt(a, b, loose); - case "<=": - return lte(a, b, loose); - default: - throw new TypeError("Invalid operator: " + op); + }; + exports.default = SyncReader; + } +}); + +// node_modules/@nodelib/fs.walk/out/providers/sync.js +var require_sync4 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/providers/sync.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var sync_1 = require_sync3(); + var SyncProvider = class { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new sync_1.default(this._root, this._settings); } - } - exports.Comparator = Comparator; - function Comparator(comp, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + read() { + return this._reader.read(); } - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; - } + }; + exports.default = SyncProvider; + } +}); + +// node_modules/@nodelib/fs.walk/out/settings.js +var require_settings3 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/settings.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var path26 = require("path"); + var fsScandir = require_out2(); + var Settings = class { + constructor(_options = {}) { + this._options = _options; + this.basePath = this._getValue(this._options.basePath, void 0); + this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY); + this.deepFilter = this._getValue(this._options.deepFilter, null); + this.entryFilter = this._getValue(this._options.entryFilter, null); + this.errorFilter = this._getValue(this._options.errorFilter, null); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path26.sep); + this.fsScandirSettings = new fsScandir.Settings({ + followSymbolicLinks: this._options.followSymbolicLinks, + fs: this._options.fs, + pathSegmentSeparator: this._options.pathSegmentSeparator, + stats: this._options.stats, + throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink + }); } - if (!(this instanceof Comparator)) { - return new Comparator(comp, options); + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; } - comp = comp.trim().split(/\s+/).join(" "); - debug("comparator", comp, options); - this.options = options; - this.loose = !!options.loose; - this.parse(comp); - if (this.semver === ANY) { - this.value = ""; - } else { - this.value = this.operator + this.semver.version; + }; + exports.default = Settings; + } +}); + +// node_modules/@nodelib/fs.walk/out/index.js +var require_out3 = __commonJS({ + "node_modules/@nodelib/fs.walk/out/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0; + var async_1 = require_async4(); + var stream_1 = require_stream2(); + var sync_1 = require_sync4(); + var settings_1 = require_settings3(); + exports.Settings = settings_1.default; + function walk4(directory, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === "function") { + new async_1.default(directory, getSettings2()).read(optionsOrSettingsOrCallback); + return; } - debug("comp", this); + new async_1.default(directory, getSettings2(optionsOrSettingsOrCallback)).read(callback); } - var ANY = {}; - Comparator.prototype.parse = function(comp) { - var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; - var m = comp.match(r); - if (!m) { - throw new TypeError("Invalid comparator: " + comp); - } - this.operator = m[1] !== void 0 ? m[1] : ""; - if (this.operator === "=") { - this.operator = ""; + exports.walk = walk4; + function walkSync(directory, optionsOrSettings) { + const settings = getSettings2(optionsOrSettings); + const provider = new sync_1.default(directory, settings); + return provider.read(); + } + exports.walkSync = walkSync; + function walkStream(directory, optionsOrSettings) { + const settings = getSettings2(optionsOrSettings); + const provider = new stream_1.default(directory, settings); + return provider.read(); + } + exports.walkStream = walkStream; + function getSettings2(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; } - if (!m[2]) { - this.semver = ANY; - } else { - this.semver = new SemVer(m[2], this.options.loose); + return new settings_1.default(settingsOrOptions); + } + } +}); + +// node_modules/fast-glob/out/readers/reader.js +var require_reader2 = __commonJS({ + "node_modules/fast-glob/out/readers/reader.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var path26 = require("path"); + var fsStat = require_out(); + var utils = require_utils7(); + var Reader = class { + constructor(_settings) { + this._settings = _settings; + this._fsStatSettings = new fsStat.Settings({ + followSymbolicLink: this._settings.followSymbolicLinks, + fs: this._settings.fs, + throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks + }); } - }; - Comparator.prototype.toString = function() { - return this.value; - }; - Comparator.prototype.test = function(version3) { - debug("Comparator.test", version3, this.options.loose); - if (this.semver === ANY || version3 === ANY) { - return true; + _getFullEntryPath(filepath) { + return path26.resolve(this._settings.cwd, filepath); } - if (typeof version3 === "string") { - try { - version3 = new SemVer(version3, this.options); - } catch (er) { - return false; + _makeEntry(stats, pattern) { + const entry = { + name: pattern, + path: pattern, + dirent: utils.fs.createDirentFromStats(pattern, stats) + }; + if (this._settings.stats) { + entry.stats = stats; } + return entry; + } + _isFatalError(error2) { + return !utils.errno.isEnoentCodeError(error2) && !this._settings.suppressErrors; } - return cmp(version3, this.operator, this.semver, this.options); }; - Comparator.prototype.intersects = function(comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError("a Comparator is required"); - } - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + exports.default = Reader; + } +}); + +// node_modules/fast-glob/out/readers/stream.js +var require_stream3 = __commonJS({ + "node_modules/fast-glob/out/readers/stream.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var stream_1 = require("stream"); + var fsStat = require_out(); + var fsWalk = require_out3(); + var reader_1 = require_reader2(); + var ReaderStream = class extends reader_1.default { + constructor() { + super(...arguments); + this._walkStream = fsWalk.walkStream; + this._stat = fsStat.stat; } - var rangeTmp; - if (this.operator === "") { - if (this.value === "") { - return true; - } - rangeTmp = new Range(comp.value, options); - return satisfies(this.value, rangeTmp, options); - } else if (comp.operator === "") { - if (comp.value === "") { - return true; - } - rangeTmp = new Range(this.value, options); - return satisfies(comp.semver, rangeTmp, options); + dynamic(root, options) { + return this._walkStream(root, options); } - var sameDirectionIncreasing = (this.operator === ">=" || this.operator === ">") && (comp.operator === ">=" || comp.operator === ">"); - var sameDirectionDecreasing = (this.operator === "<=" || this.operator === "<") && (comp.operator === "<=" || comp.operator === "<"); - var sameSemVer = this.semver.version === comp.semver.version; - var differentDirectionsInclusive = (this.operator === ">=" || this.operator === "<=") && (comp.operator === ">=" || comp.operator === "<="); - var oppositeDirectionsLessThan = cmp(this.semver, "<", comp.semver, options) && ((this.operator === ">=" || this.operator === ">") && (comp.operator === "<=" || comp.operator === "<")); - var oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp.semver, options) && ((this.operator === "<=" || this.operator === "<") && (comp.operator === ">=" || comp.operator === ">")); - return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan; - }; - exports.Range = Range; - function Range(range, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false + static(patterns, options) { + const filepaths = patterns.map(this._getFullEntryPath, this); + const stream = new stream_1.PassThrough({ objectMode: true }); + stream._write = (index, _enc, done) => { + return this._getEntry(filepaths[index], patterns[index], options).then((entry) => { + if (entry !== null && options.entryFilter(entry)) { + stream.push(entry); + } + if (index === filepaths.length - 1) { + stream.end(); + } + done(); + }).catch(done); }; - } - if (range instanceof Range) { - if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; - } else { - return new Range(range.raw, options); + for (let i = 0; i < filepaths.length; i++) { + stream.write(i); } + return stream; } - if (range instanceof Comparator) { - return new Range(range.value, options); - } - if (!(this instanceof Range)) { - return new Range(range, options); - } - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - this.raw = range.trim().split(/\s+/).join(" "); - this.set = this.raw.split("||").map(function(range2) { - return this.parseRange(range2.trim()); - }, this).filter(function(c) { - return c.length; - }); - if (!this.set.length) { - throw new TypeError("Invalid SemVer Range: " + this.raw); - } - this.format(); - } - Range.prototype.format = function() { - this.range = this.set.map(function(comps) { - return comps.join(" ").trim(); - }).join("||").trim(); - return this.range; - }; - Range.prototype.toString = function() { - return this.range; - }; - Range.prototype.parseRange = function(range) { - var loose = this.options.loose; - var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug("hyphen replace", range); - range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); - debug("comparator trim", range, safeRe[t.COMPARATORTRIM]); - range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); - range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); - range = range.split(/\s+/).join(" "); - var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; - var set = range.split(" ").map(function(comp) { - return parseComparator(comp, this.options); - }, this).join(" ").split(/\s+/); - if (this.options.loose) { - set = set.filter(function(comp) { - return !!comp.match(compRe); + _getEntry(filepath, pattern, options) { + return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern)).catch((error2) => { + if (options.errorFilter(error2)) { + return null; + } + throw error2; }); } - set = set.map(function(comp) { - return new Comparator(comp, this.options); - }, this); - return set; - }; - Range.prototype.intersects = function(range, options) { - if (!(range instanceof Range)) { - throw new TypeError("a Range is required"); - } - return this.set.some(function(thisComparators) { - return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { - return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { - return rangeComparators.every(function(rangeComparator) { - return thisComparator.intersects(rangeComparator, options); - }); + _getStat(filepath) { + return new Promise((resolve13, reject) => { + this._stat(filepath, this._fsStatSettings, (error2, stats) => { + return error2 === null ? resolve13(stats) : reject(error2); }); }); - }); + } }; - function isSatisfiable(comparators, options) { - var result = true; - var remainingComparators = comparators.slice(); - var testComparator = remainingComparators.pop(); - while (result && remainingComparators.length) { - result = remainingComparators.every(function(otherComparator) { - return testComparator.intersects(otherComparator, options); - }); - testComparator = remainingComparators.pop(); + exports.default = ReaderStream; + } +}); + +// node_modules/fast-glob/out/readers/async.js +var require_async5 = __commonJS({ + "node_modules/fast-glob/out/readers/async.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var fsWalk = require_out3(); + var reader_1 = require_reader2(); + var stream_1 = require_stream3(); + var ReaderAsync = class extends reader_1.default { + constructor() { + super(...arguments); + this._walkAsync = fsWalk.walk; + this._readerStream = new stream_1.default(this._settings); } - return result; - } - exports.toComparators = toComparators; - function toComparators(range, options) { - return new Range(range, options).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(" ").trim().split(" "); - }); - } - function parseComparator(comp, options) { - debug("comp", comp, options); - comp = replaceCarets(comp, options); - debug("caret", comp); - comp = replaceTildes(comp, options); - debug("tildes", comp); - comp = replaceXRanges(comp, options); - debug("xrange", comp); - comp = replaceStars(comp, options); - debug("stars", comp); - return comp; - } - function isX(id) { - return !id || id.toLowerCase() === "x" || id === "*"; - } - function replaceTildes(comp, options) { - return comp.trim().split(/\s+/).map(function(comp2) { - return replaceTilde(comp2, options); - }).join(" "); - } - function replaceTilde(comp, options) { - var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]; - return comp.replace(r, function(_, M, m, p, pr) { - debug("tilde", comp, _, M, m, p, pr); - var ret; - if (isX(M)) { - ret = ""; - } else if (isX(m)) { - ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0"; - } else if (isX(p)) { - ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0"; - } else if (pr) { - debug("replaceTilde pr", pr); - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; - } else { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; - } - debug("tilde return", ret); - return ret; - }); - } - function replaceCarets(comp, options) { - return comp.trim().split(/\s+/).map(function(comp2) { - return replaceCaret(comp2, options); - }).join(" "); - } - function replaceCaret(comp, options) { - debug("caret", comp, options); - var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; - return comp.replace(r, function(_, M, m, p, pr) { - debug("caret", comp, _, M, m, p, pr); - var ret; - if (isX(M)) { - ret = ""; - } else if (isX(m)) { - ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0"; - } else if (isX(p)) { - if (M === "0") { - ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0"; - } else { - ret = ">=" + M + "." + m + ".0 <" + (+M + 1) + ".0.0"; - } - } else if (pr) { - debug("replaceCaret pr", pr); - if (M === "0") { - if (m === "0") { - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + m + "." + (+p + 1); - } else { - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; - } - } else { - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0"; - } - } else { - debug("no pr"); - if (M === "0") { - if (m === "0") { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1); - } else { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; - } - } else { - ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0"; - } - } - debug("caret return", ret); - return ret; - }); - } - function replaceXRanges(comp, options) { - debug("replaceXRanges", comp, options); - return comp.split(/\s+/).map(function(comp2) { - return replaceXRange(comp2, options); - }).join(" "); - } - function replaceXRange(comp, options) { - comp = comp.trim(); - var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE]; - return comp.replace(r, function(ret, gtlt, M, m, p, pr) { - debug("xRange", comp, ret, gtlt, M, m, p, pr); - var xM = isX(M); - var xm = xM || isX(m); - var xp = xm || isX(p); - var anyX = xp; - if (gtlt === "=" && anyX) { - gtlt = ""; - } - pr = options.includePrerelease ? "-0" : ""; - if (xM) { - if (gtlt === ">" || gtlt === "<") { - ret = "<0.0.0-0"; - } else { - ret = "*"; - } - } else if (gtlt && anyX) { - if (xm) { - m = 0; - } - p = 0; - if (gtlt === ">") { - gtlt = ">="; - if (xm) { - M = +M + 1; - m = 0; - p = 0; - } else { - m = +m + 1; - p = 0; - } - } else if (gtlt === "<=") { - gtlt = "<"; - if (xm) { - M = +M + 1; + dynamic(root, options) { + return new Promise((resolve13, reject) => { + this._walkAsync(root, options, (error2, entries) => { + if (error2 === null) { + resolve13(entries); } else { - m = +m + 1; + reject(error2); } - } - ret = gtlt + M + "." + m + "." + p + pr; - } else if (xm) { - ret = ">=" + M + ".0.0" + pr + " <" + (+M + 1) + ".0.0" + pr; - } else if (xp) { - ret = ">=" + M + "." + m + ".0" + pr + " <" + M + "." + (+m + 1) + ".0" + pr; - } - debug("xRange return", ret); - return ret; - }); - } - function replaceStars(comp, options) { - debug("replaceStars", comp, options); - return comp.trim().replace(safeRe[t.STAR], ""); - } - function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { - if (isX(fM)) { - from = ""; - } else if (isX(fm)) { - from = ">=" + fM + ".0.0"; - } else if (isX(fp)) { - from = ">=" + fM + "." + fm + ".0"; - } else { - from = ">=" + from; - } - if (isX(tM)) { - to = ""; - } else if (isX(tm)) { - to = "<" + (+tM + 1) + ".0.0"; - } else if (isX(tp)) { - to = "<" + tM + "." + (+tm + 1) + ".0"; - } else if (tpr) { - to = "<=" + tM + "." + tm + "." + tp + "-" + tpr; - } else { - to = "<=" + to; + }); + }); } - return (from + " " + to).trim(); - } - Range.prototype.test = function(version3) { - if (!version3) { - return false; + async static(patterns, options) { + const entries = []; + const stream = this._readerStream.static(patterns, options); + return new Promise((resolve13, reject) => { + stream.once("error", reject); + stream.on("data", (entry) => entries.push(entry)); + stream.once("end", () => resolve13(entries)); + }); } - if (typeof version3 === "string") { - try { - version3 = new SemVer(version3, this.options); - } catch (er) { - return false; - } + }; + exports.default = ReaderAsync; + } +}); + +// node_modules/fast-glob/out/providers/matchers/matcher.js +var require_matcher = __commonJS({ + "node_modules/fast-glob/out/providers/matchers/matcher.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var utils = require_utils7(); + var Matcher = class { + constructor(_patterns, _settings, _micromatchOptions) { + this._patterns = _patterns; + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + this._storage = []; + this._fillStorage(); } - for (var i2 = 0; i2 < this.set.length; i2++) { - if (testSet(this.set[i2], version3, this.options)) { - return true; + _fillStorage() { + for (const pattern of this._patterns) { + const segments = this._getPatternSegments(pattern); + const sections = this._splitSegmentsIntoSections(segments); + this._storage.push({ + complete: sections.length <= 1, + pattern, + segments, + sections + }); } } - return false; - }; - function testSet(set, version3, options) { - for (var i2 = 0; i2 < set.length; i2++) { - if (!set[i2].test(version3)) { - return false; - } + _getPatternSegments(pattern) { + const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions); + return parts.map((part) => { + const dynamic = utils.pattern.isDynamicPattern(part, this._settings); + if (!dynamic) { + return { + dynamic: false, + pattern: part + }; + } + return { + dynamic: true, + pattern: part, + patternRe: utils.pattern.makeRe(part, this._micromatchOptions) + }; + }); } - if (version3.prerelease.length && !options.includePrerelease) { - for (i2 = 0; i2 < set.length; i2++) { - debug(set[i2].semver); - if (set[i2].semver === ANY) { - continue; + _splitSegmentsIntoSections(segments) { + return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern)); + } + }; + exports.default = Matcher; + } +}); + +// node_modules/fast-glob/out/providers/matchers/partial.js +var require_partial = __commonJS({ + "node_modules/fast-glob/out/providers/matchers/partial.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var matcher_1 = require_matcher(); + var PartialMatcher = class extends matcher_1.default { + match(filepath) { + const parts = filepath.split("/"); + const levels = parts.length; + const patterns = this._storage.filter((info3) => !info3.complete || info3.segments.length > levels); + for (const pattern of patterns) { + const section = pattern.sections[0]; + if (!pattern.complete && levels > section.length) { + return true; } - if (set[i2].semver.prerelease.length > 0) { - var allowed = set[i2].semver; - if (allowed.major === version3.major && allowed.minor === version3.minor && allowed.patch === version3.patch) { + const match2 = parts.every((part, index) => { + const segment = pattern.segments[index]; + if (segment.dynamic && segment.patternRe.test(part)) { + return true; + } + if (!segment.dynamic && segment.pattern === part) { return true; } + return false; + }); + if (match2) { + return true; } } return false; } - return true; - } - exports.satisfies = satisfies; - function satisfies(version3, range, options) { - try { - range = new Range(range, options); - } catch (er) { - return false; - } - return range.test(version3); - } - exports.maxSatisfying = maxSatisfying; - function maxSatisfying(versions, range, options) { - var max = null; - var maxSV = null; - try { - var rangeObj = new Range(range, options); - } catch (er) { - return null; - } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!max || maxSV.compare(v) === -1) { - max = v; - maxSV = new SemVer(max, options); - } - } - }); - return max; - } - exports.minSatisfying = minSatisfying; - function minSatisfying(versions, range, options) { - var min = null; - var minSV = null; - try { - var rangeObj = new Range(range, options); - } catch (er) { - return null; - } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!min || minSV.compare(v) === 1) { - min = v; - minSV = new SemVer(min, options); - } - } - }); - return min; - } - exports.minVersion = minVersion; - function minVersion(range, loose) { - range = new Range(range, loose); - var minver = new SemVer("0.0.0"); - if (range.test(minver)) { - return minver; - } - minver = new SemVer("0.0.0-0"); - if (range.test(minver)) { - return minver; - } - minver = null; - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.set[i2]; - comparators.forEach(function(comparator) { - var compver = new SemVer(comparator.semver.version); - switch (comparator.operator) { - case ">": - if (compver.prerelease.length === 0) { - compver.patch++; - } else { - compver.prerelease.push(0); - } - compver.raw = compver.format(); - case "": - case ">=": - if (!minver || gt(minver, compver)) { - minver = compver; - } - break; - case "<": - case "<=": - break; - default: - throw new Error("Unexpected operation: " + comparator.operator); - } - }); - } - if (minver && range.test(minver)) { - return minver; + }; + exports.default = PartialMatcher; + } +}); + +// node_modules/fast-glob/out/providers/filters/deep.js +var require_deep = __commonJS({ + "node_modules/fast-glob/out/providers/filters/deep.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var utils = require_utils7(); + var partial_1 = require_partial(); + var DeepFilter = class { + constructor(_settings, _micromatchOptions) { + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; } - return null; - } - exports.validRange = validRange; - function validRange(range, options) { - try { - return new Range(range, options).range || "*"; - } catch (er) { - return null; + getFilter(basePath, positive, negative) { + const matcher = this._getMatcher(positive); + const negativeRe = this._getNegativePatternsRe(negative); + return (entry) => this._filter(basePath, entry, matcher, negativeRe); } - } - exports.ltr = ltr; - function ltr(version3, range, options) { - return outside(version3, range, "<", options); - } - exports.gtr = gtr; - function gtr(version3, range, options) { - return outside(version3, range, ">", options); - } - exports.outside = outside; - function outside(version3, range, hilo, options) { - version3 = new SemVer(version3, options); - range = new Range(range, options); - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case ">": - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt; - ltefn = gte; - ltfn = gt; - comp = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); + _getMatcher(patterns) { + return new partial_1.default(patterns, this._settings, this._micromatchOptions); } - if (satisfies(version3, range, options)) { - return false; + _getNegativePatternsRe(patterns) { + const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern); + return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions); } - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.set[i2]; - var high = null; - var low = null; - comparators.forEach(function(comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator(">=0.0.0"); - } - high = high || comparator; - low = low || comparator; - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator; - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator; - } - }); - if (high.operator === comp || high.operator === ecomp) { + _filter(basePath, entry, matcher, negativeRe) { + if (this._isSkippedByDeep(basePath, entry.path)) { return false; } - if ((!low.operator || low.operator === comp) && ltefn(version3, low.semver)) { + if (this._isSkippedSymbolicLink(entry)) { return false; - } else if (low.operator === ecomp && ltfn(version3, low.semver)) { + } + const filepath = utils.path.removeLeadingDotSegment(entry.path); + if (this._isSkippedByPositivePatterns(filepath, matcher)) { return false; } + return this._isSkippedByNegativePatterns(filepath, negativeRe); } - return true; - } - exports.prerelease = prerelease; - function prerelease(version3, options) { - var parsed = parse3(version3, options); - return parsed && parsed.prerelease.length ? parsed.prerelease : null; - } - exports.intersects = intersects; - function intersects(r1, r2, options) { - r1 = new Range(r1, options); - r2 = new Range(r2, options); - return r1.intersects(r2); - } - exports.coerce = coerce; - function coerce(version3, options) { - if (version3 instanceof SemVer) { - return version3; + _isSkippedByDeep(basePath, entryPath) { + if (this._settings.deep === Infinity) { + return false; + } + return this._getEntryLevel(basePath, entryPath) >= this._settings.deep; } - if (typeof version3 === "number") { - version3 = String(version3); + _getEntryLevel(basePath, entryPath) { + const entryPathDepth = entryPath.split("/").length; + if (basePath === "") { + return entryPathDepth; + } + const basePathDepth = basePath.split("/").length; + return entryPathDepth - basePathDepth; } - if (typeof version3 !== "string") { - return null; + _isSkippedSymbolicLink(entry) { + return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink(); } - options = options || {}; - var match = null; - if (!options.rtl) { - match = version3.match(safeRe[t.COERCE]); - } else { - var next; - while ((next = safeRe[t.COERCERTL].exec(version3)) && (!match || match.index + match[0].length !== version3.length)) { - if (!match || next.index + next[0].length !== match.index + match[0].length) { - match = next; - } - safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; - } - safeRe[t.COERCERTL].lastIndex = -1; + _isSkippedByPositivePatterns(entryPath, matcher) { + return !this._settings.baseNameMatch && !matcher.match(entryPath); } - if (match === null) { - return null; + _isSkippedByNegativePatterns(entryPath, patternsRe) { + return !utils.pattern.matchAny(entryPath, patternsRe); } - return parse3(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); - } + }; + exports.default = DeepFilter; } }); -// node_modules/make-dir/index.js -var require_make_dir = __commonJS({ - "node_modules/make-dir/index.js"(exports, module2) { +// node_modules/fast-glob/out/providers/filters/entry.js +var require_entry = __commonJS({ + "node_modules/fast-glob/out/providers/filters/entry.js"(exports) { "use strict"; - var fs6 = require("fs"); - var path16 = require("path"); - var { promisify: promisify3 } = require("util"); - var semver = require_semver(); - var useNativeRecursiveOption = semver.satisfies(process.version, ">=10.12.0"); - var checkPath = (pth) => { - if (process.platform === "win32") { - const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path16.parse(pth).root, "")); - if (pathHasInvalidWinCharacters) { - const error2 = new Error(`Path contains invalid characters: ${pth}`); - error2.code = "EINVAL"; - throw error2; + Object.defineProperty(exports, "__esModule", { value: true }); + var utils = require_utils7(); + var EntryFilter = class { + constructor(_settings, _micromatchOptions) { + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + this.index = /* @__PURE__ */ new Map(); + } + getFilter(positive, negative) { + const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions); + const negativeRe = utils.pattern.convertPatternsToRe(negative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })); + return (entry) => this._filter(entry, positiveRe, negativeRe); + } + _filter(entry, positiveRe, negativeRe) { + const filepath = utils.path.removeLeadingDotSegment(entry.path); + if (this._settings.unique && this._isDuplicateEntry(filepath)) { + return false; + } + if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) { + return false; + } + if (this._isSkippedByAbsoluteNegativePatterns(filepath, negativeRe)) { + return false; + } + const isDirectory = entry.dirent.isDirectory(); + const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(filepath, negativeRe, isDirectory); + if (this._settings.unique && isMatched) { + this._createIndexRecord(filepath); } + return isMatched; } - }; - var processOptions = (options) => { - const defaults = { - mode: 511, - fs: fs6 - }; - return { - ...defaults, - ...options - }; - }; - var permissionError = (pth) => { - const error2 = new Error(`operation not permitted, mkdir '${pth}'`); - error2.code = "EPERM"; - error2.errno = -4048; - error2.path = pth; - error2.syscall = "mkdir"; - return error2; - }; - var makeDir = async (input, options) => { - checkPath(input); - options = processOptions(options); - const mkdir = promisify3(options.fs.mkdir); - const stat2 = promisify3(options.fs.stat); - if (useNativeRecursiveOption && options.fs.mkdir === fs6.mkdir) { - const pth = path16.resolve(input); - await mkdir(pth, { - mode: options.mode, - recursive: true - }); - return pth; + _isDuplicateEntry(filepath) { + return this.index.has(filepath); } - const make = async (pth) => { - try { - await mkdir(pth, options.mode); - return pth; - } catch (error2) { - if (error2.code === "EPERM") { - throw error2; - } - if (error2.code === "ENOENT") { - if (path16.dirname(pth) === pth) { - throw permissionError(pth); - } - if (error2.message.includes("null bytes")) { - throw error2; - } - await make(path16.dirname(pth)); - return make(pth); - } - try { - const stats = await stat2(pth); - if (!stats.isDirectory()) { - throw new Error("The path is not a directory"); - } - } catch (_) { - throw error2; - } - return pth; + _createIndexRecord(filepath) { + this.index.set(filepath, void 0); + } + _onlyFileFilter(entry) { + return this._settings.onlyFiles && !entry.dirent.isFile(); + } + _onlyDirectoryFilter(entry) { + return this._settings.onlyDirectories && !entry.dirent.isDirectory(); + } + _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) { + if (!this._settings.absolute) { + return false; } - }; - return make(path16.resolve(input)); - }; - module2.exports = makeDir; - module2.exports.sync = (input, options) => { - checkPath(input); - options = processOptions(options); - if (useNativeRecursiveOption && options.fs.mkdirSync === fs6.mkdirSync) { - const pth = path16.resolve(input); - fs6.mkdirSync(pth, { - mode: options.mode, - recursive: true - }); - return pth; + const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath); + return utils.pattern.matchAny(fullpath, patternsRe); } - const make = (pth) => { - try { - options.fs.mkdirSync(pth, options.mode); - } catch (error2) { - if (error2.code === "EPERM") { - throw error2; - } - if (error2.code === "ENOENT") { - if (path16.dirname(pth) === pth) { - throw permissionError(pth); - } - if (error2.message.includes("null bytes")) { - throw error2; - } - make(path16.dirname(pth)); - return make(pth); - } - try { - if (!options.fs.statSync(pth).isDirectory()) { - throw new Error("The path is not a directory"); - } - } catch (_) { - throw error2; - } + _isMatchToPatterns(filepath, patternsRe, isDirectory) { + const isMatched = utils.pattern.matchAny(filepath, patternsRe); + if (!isMatched && isDirectory) { + return utils.pattern.matchAny(filepath + "/", patternsRe); } - return pth; - }; - return make(path16.resolve(input)); + return isMatched; + } }; + exports.default = EntryFilter; } }); -// node_modules/xdg-basedir/index.js -var require_xdg_basedir = __commonJS({ - "node_modules/xdg-basedir/index.js"(exports) { +// node_modules/fast-glob/out/providers/filters/error.js +var require_error = __commonJS({ + "node_modules/fast-glob/out/providers/filters/error.js"(exports) { "use strict"; - var os = require("os"); - var path16 = require("path"); - var homeDirectory = os.homedir(); - var { env } = process; - exports.data = env.XDG_DATA_HOME || (homeDirectory ? path16.join(homeDirectory, ".local", "share") : void 0); - exports.config = env.XDG_CONFIG_HOME || (homeDirectory ? path16.join(homeDirectory, ".config") : void 0); - exports.cache = env.XDG_CACHE_HOME || (homeDirectory ? path16.join(homeDirectory, ".cache") : void 0); - exports.runtime = env.XDG_RUNTIME_DIR || void 0; - exports.dataDirs = (env.XDG_DATA_DIRS || "/usr/local/share/:/usr/share/").split(":"); - if (exports.data) { - exports.dataDirs.unshift(exports.data); - } - exports.configDirs = (env.XDG_CONFIG_DIRS || "/etc/xdg").split(":"); - if (exports.config) { - exports.configDirs.unshift(exports.config); - } + Object.defineProperty(exports, "__esModule", { value: true }); + var utils = require_utils7(); + var ErrorFilter = class { + constructor(_settings) { + this._settings = _settings; + } + getFilter() { + return (error2) => this._isNonFatalError(error2); + } + _isNonFatalError(error2) { + return utils.errno.isEnoentCodeError(error2) || this._settings.suppressErrors; + } + }; + exports.default = ErrorFilter; } }); -// node_modules/imurmurhash/imurmurhash.js -var require_imurmurhash = __commonJS({ - "node_modules/imurmurhash/imurmurhash.js"(exports, module2) { - (function() { - var cache; - function MurmurHash3(key, seed) { - var m = this instanceof MurmurHash3 ? this : cache; - m.reset(seed); - if (typeof key === "string" && key.length > 0) { - m.hash(key); - } - if (m !== this) { - return m; - } +// node_modules/fast-glob/out/providers/transformers/entry.js +var require_entry2 = __commonJS({ + "node_modules/fast-glob/out/providers/transformers/entry.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var utils = require_utils7(); + var EntryTransformer = class { + constructor(_settings) { + this._settings = _settings; } - ; - MurmurHash3.prototype.hash = function(key) { - var h1, k1, i, top, len; - len = key.length; - this.len += len; - k1 = this.k1; - i = 0; - switch (this.rem) { - case 0: - k1 ^= len > i ? key.charCodeAt(i++) & 65535 : 0; - case 1: - k1 ^= len > i ? (key.charCodeAt(i++) & 65535) << 8 : 0; - case 2: - k1 ^= len > i ? (key.charCodeAt(i++) & 65535) << 16 : 0; - case 3: - k1 ^= len > i ? (key.charCodeAt(i) & 255) << 24 : 0; - k1 ^= len > i ? (key.charCodeAt(i++) & 65280) >> 8 : 0; + getTransformer() { + return (entry) => this._transform(entry); + } + _transform(entry) { + let filepath = entry.path; + if (this._settings.absolute) { + filepath = utils.path.makeAbsolute(this._settings.cwd, filepath); + filepath = utils.path.unixify(filepath); } - this.rem = len + this.rem & 3; - len -= this.rem; - if (len > 0) { - h1 = this.h1; - while (1) { - k1 = k1 * 11601 + (k1 & 65535) * 3432906752 & 4294967295; - k1 = k1 << 15 | k1 >>> 17; - k1 = k1 * 13715 + (k1 & 65535) * 461832192 & 4294967295; - h1 ^= k1; - h1 = h1 << 13 | h1 >>> 19; - h1 = h1 * 5 + 3864292196 & 4294967295; - if (i >= len) { - break; - } - k1 = key.charCodeAt(i++) & 65535 ^ (key.charCodeAt(i++) & 65535) << 8 ^ (key.charCodeAt(i++) & 65535) << 16; - top = key.charCodeAt(i++); - k1 ^= (top & 255) << 24 ^ (top & 65280) >> 8; - } - k1 = 0; - switch (this.rem) { - case 3: - k1 ^= (key.charCodeAt(i + 2) & 65535) << 16; - case 2: - k1 ^= (key.charCodeAt(i + 1) & 65535) << 8; - case 1: - k1 ^= key.charCodeAt(i) & 65535; - } - this.h1 = h1; + if (this._settings.markDirectories && entry.dirent.isDirectory()) { + filepath += "/"; } - this.k1 = k1; - return this; - }; - MurmurHash3.prototype.result = function() { - var k1, h1; - k1 = this.k1; - h1 = this.h1; - if (k1 > 0) { - k1 = k1 * 11601 + (k1 & 65535) * 3432906752 & 4294967295; - k1 = k1 << 15 | k1 >>> 17; - k1 = k1 * 13715 + (k1 & 65535) * 461832192 & 4294967295; - h1 ^= k1; + if (!this._settings.objectMode) { + return filepath; } - h1 ^= this.len; - h1 ^= h1 >>> 16; - h1 = h1 * 51819 + (h1 & 65535) * 2246770688 & 4294967295; - h1 ^= h1 >>> 13; - h1 = h1 * 44597 + (h1 & 65535) * 3266445312 & 4294967295; - h1 ^= h1 >>> 16; - return h1 >>> 0; - }; - MurmurHash3.prototype.reset = function(seed) { - this.h1 = typeof seed === "number" ? seed : 0; - this.rem = this.k1 = this.len = 0; - return this; - }; - cache = new MurmurHash3(); - if (typeof module2 != "undefined") { - module2.exports = MurmurHash3; - } else { - this.MurmurHash3 = MurmurHash3; + return Object.assign(Object.assign({}, entry), { path: filepath }); } - })(); - } -}); - -// node_modules/signal-exit/signals.js -var require_signals = __commonJS({ - "node_modules/signal-exit/signals.js"(exports, module2) { - module2.exports = [ - "SIGABRT", - "SIGALRM", - "SIGHUP", - "SIGINT", - "SIGTERM" - ]; - if (process.platform !== "win32") { - module2.exports.push( - "SIGVTALRM", - "SIGXCPU", - "SIGXFSZ", - "SIGUSR2", - "SIGTRAP", - "SIGSYS", - "SIGQUIT", - "SIGIOT" - // should detect profiler and enable/disable accordingly. - // see #21 - // 'SIGPROF' - ); - } - if (process.platform === "linux") { - module2.exports.push( - "SIGIO", - "SIGPOLL", - "SIGPWR", - "SIGSTKFLT", - "SIGUNUSED" - ); - } + }; + exports.default = EntryTransformer; } }); -// node_modules/signal-exit/index.js -var require_signal_exit = __commonJS({ - "node_modules/signal-exit/index.js"(exports, module2) { - var process4 = global.process; - var processOk = function(process5) { - return process5 && typeof process5 === "object" && typeof process5.removeListener === "function" && typeof process5.emit === "function" && typeof process5.reallyExit === "function" && typeof process5.listeners === "function" && typeof process5.kill === "function" && typeof process5.pid === "number" && typeof process5.on === "function"; - }; - if (!processOk(process4)) { - module2.exports = function() { - return function() { - }; - }; - } else { - assert7 = require("assert"); - signals = require_signals(); - isWin = /^win/i.test(process4.platform); - EE = require("events"); - if (typeof EE !== "function") { - EE = EE.EventEmitter; - } - if (process4.__signal_exit_emitter__) { - emitter = process4.__signal_exit_emitter__; - } else { - emitter = process4.__signal_exit_emitter__ = new EE(); - emitter.count = 0; - emitter.emitted = {}; +// node_modules/fast-glob/out/providers/provider.js +var require_provider = __commonJS({ + "node_modules/fast-glob/out/providers/provider.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var path26 = require("path"); + var deep_1 = require_deep(); + var entry_1 = require_entry(); + var error_1 = require_error(); + var entry_2 = require_entry2(); + var Provider = class { + constructor(_settings) { + this._settings = _settings; + this.errorFilter = new error_1.default(this._settings); + this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions()); + this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions()); + this.entryTransformer = new entry_2.default(this._settings); } - if (!emitter.infinite) { - emitter.setMaxListeners(Infinity); - emitter.infinite = true; + _getRootDirectory(task) { + return path26.resolve(this._settings.cwd, task.base); } - module2.exports = function(cb, opts) { - if (!processOk(global.process)) { - return function() { - }; - } - assert7.equal(typeof cb, "function", "a callback must be provided for exit handler"); - if (loaded === false) { - load(); - } - var ev = "exit"; - if (opts && opts.alwaysLast) { - ev = "afterexit"; - } - var remove = function() { - emitter.removeListener(ev, cb); - if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) { - unload(); - } + _getReaderOptions(task) { + const basePath = task.base === "." ? "" : task.base; + return { + basePath, + pathSegmentSeparator: "/", + concurrency: this._settings.concurrency, + deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative), + entryFilter: this.entryFilter.getFilter(task.positive, task.negative), + errorFilter: this.errorFilter.getFilter(), + followSymbolicLinks: this._settings.followSymbolicLinks, + fs: this._settings.fs, + stats: this._settings.stats, + throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink, + transform: this.entryTransformer.getTransformer() }; - emitter.on(ev, cb); - return remove; - }; - unload = function unload2() { - if (!loaded || !processOk(global.process)) { - return; - } - loaded = false; - signals.forEach(function(sig) { - try { - process4.removeListener(sig, sigListeners[sig]); - } catch (er) { - } - }); - process4.emit = originalProcessEmit; - process4.reallyExit = originalProcessReallyExit; - emitter.count -= 1; - }; - module2.exports.unload = unload; - emit = function emit2(event, code, signal) { - if (emitter.emitted[event]) { - return; - } - emitter.emitted[event] = true; - emitter.emit(event, code, signal); - }; - sigListeners = {}; - signals.forEach(function(sig) { - sigListeners[sig] = function listener() { - if (!processOk(global.process)) { - return; - } - var listeners = process4.listeners(sig); - if (listeners.length === emitter.count) { - unload(); - emit("exit", null, sig); - emit("afterexit", null, sig); - if (isWin && sig === "SIGHUP") { - sig = "SIGINT"; - } - process4.kill(process4.pid, sig); - } + } + _getMicromatchOptions() { + return { + dot: this._settings.dot, + matchBase: this._settings.baseNameMatch, + nobrace: !this._settings.braceExpansion, + nocase: !this._settings.caseSensitiveMatch, + noext: !this._settings.extglob, + noglobstar: !this._settings.globstar, + posix: true, + strictSlashes: false }; - }); - module2.exports.signals = function() { - return signals; - }; - loaded = false; - load = function load2() { - if (loaded || !processOk(global.process)) { - return; - } - loaded = true; - emitter.count += 1; - signals = signals.filter(function(sig) { - try { - process4.on(sig, sigListeners[sig]); - return true; - } catch (er) { - return false; - } - }); - process4.emit = processEmit; - process4.reallyExit = processReallyExit; - }; - module2.exports.load = load; - originalProcessReallyExit = process4.reallyExit; - processReallyExit = function processReallyExit2(code) { - if (!processOk(global.process)) { - return; - } - process4.exitCode = code || /* istanbul ignore next */ - 0; - emit("exit", process4.exitCode, null); - emit("afterexit", process4.exitCode, null); - originalProcessReallyExit.call(process4, process4.exitCode); - }; - originalProcessEmit = process4.emit; - processEmit = function processEmit2(ev, arg) { - if (ev === "exit" && processOk(global.process)) { - if (arg !== void 0) { - process4.exitCode = arg; - } - var ret = originalProcessEmit.apply(this, arguments); - emit("exit", process4.exitCode, null); - emit("afterexit", process4.exitCode, null); - return ret; - } else { - return originalProcessEmit.apply(this, arguments); - } - }; - } - var assert7; - var signals; - var isWin; - var EE; - var emitter; - var unload; - var emit; - var sigListeners; - var loaded; - var load; - var originalProcessReallyExit; - var processReallyExit; - var originalProcessEmit; - var processEmit; - } -}); - -// node_modules/is-typedarray/index.js -var require_is_typedarray = __commonJS({ - "node_modules/is-typedarray/index.js"(exports, module2) { - module2.exports = isTypedArray; - isTypedArray.strict = isStrictTypedArray; - isTypedArray.loose = isLooseTypedArray; - var toString = Object.prototype.toString; - var names = { - "[object Int8Array]": true, - "[object Int16Array]": true, - "[object Int32Array]": true, - "[object Uint8Array]": true, - "[object Uint8ClampedArray]": true, - "[object Uint16Array]": true, - "[object Uint32Array]": true, - "[object Float32Array]": true, - "[object Float64Array]": true + } }; - function isTypedArray(arr) { - return isStrictTypedArray(arr) || isLooseTypedArray(arr); - } - function isStrictTypedArray(arr) { - return arr instanceof Int8Array || arr instanceof Int16Array || arr instanceof Int32Array || arr instanceof Uint8Array || arr instanceof Uint8ClampedArray || arr instanceof Uint16Array || arr instanceof Uint32Array || arr instanceof Float32Array || arr instanceof Float64Array; - } - function isLooseTypedArray(arr) { - return names[toString.call(arr)]; - } + exports.default = Provider; } }); -// node_modules/typedarray-to-buffer/index.js -var require_typedarray_to_buffer = __commonJS({ - "node_modules/typedarray-to-buffer/index.js"(exports, module2) { - var isTypedArray = require_is_typedarray().strict; - module2.exports = function typedarrayToBuffer(arr) { - if (isTypedArray(arr)) { - var buf = Buffer.from(arr.buffer); - if (arr.byteLength !== arr.buffer.byteLength) { - buf = buf.slice(arr.byteOffset, arr.byteOffset + arr.byteLength); +// node_modules/fast-glob/out/providers/async.js +var require_async6 = __commonJS({ + "node_modules/fast-glob/out/providers/async.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var async_1 = require_async5(); + var provider_1 = require_provider(); + var ProviderAsync = class extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new async_1.default(this._settings); + } + async read(task) { + const root = this._getRootDirectory(task); + const options = this._getReaderOptions(task); + const entries = await this.api(root, task, options); + return entries.map((entry) => options.transform(entry)); + } + api(root, task, options) { + if (task.dynamic) { + return this._reader.dynamic(root, options); } - return buf; - } else { - return Buffer.from(arr); + return this._reader.static(task.patterns, options); } }; + exports.default = ProviderAsync; } }); -// node_modules/write-file-atomic/index.js -var require_write_file_atomic = __commonJS({ - "node_modules/write-file-atomic/index.js"(exports, module2) { +// node_modules/fast-glob/out/providers/stream.js +var require_stream4 = __commonJS({ + "node_modules/fast-glob/out/providers/stream.js"(exports) { "use strict"; - module2.exports = writeFile; - module2.exports.sync = writeFileSync; - module2.exports._getTmpname = getTmpname; - module2.exports._cleanupOnExit = cleanupOnExit; - var fs6 = require("fs"); - var MurmurHash3 = require_imurmurhash(); - var onExit = require_signal_exit(); - var path16 = require("path"); - var isTypedArray = require_is_typedarray(); - var typedArrayToBuffer = require_typedarray_to_buffer(); - var { promisify: promisify3 } = require("util"); - var activeFiles = {}; - var threadId = function getId() { - try { - const workerThreads = require("worker_threads"); - return workerThreads.threadId; - } catch (e) { - return 0; - } - }(); - var invocations = 0; - function getTmpname(filename) { - return filename + "." + MurmurHash3(__filename).hash(String(process.pid)).hash(String(threadId)).hash(String(++invocations)).result(); - } - function cleanupOnExit(tmpfile) { - return () => { - try { - fs6.unlinkSync(typeof tmpfile === "function" ? tmpfile() : tmpfile); - } catch (_) { - } - }; - } - function serializeActiveFile(absoluteName) { - return new Promise((resolve10) => { - if (!activeFiles[absoluteName]) - activeFiles[absoluteName] = []; - activeFiles[absoluteName].push(resolve10); - if (activeFiles[absoluteName].length === 1) - resolve10(); - }); - } - function isChownErrOk(err) { - if (err.code === "ENOSYS") { - return true; - } - const nonroot = !process.getuid || process.getuid() !== 0; - if (nonroot) { - if (err.code === "EINVAL" || err.code === "EPERM") { - return true; - } - } - return false; - } - async function writeFileAsync(filename, data, options = {}) { - if (typeof options === "string") { - options = { encoding: options }; - } - let fd; - let tmpfile; - const removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile)); - const absoluteName = path16.resolve(filename); - try { - await serializeActiveFile(absoluteName); - const truename = await promisify3(fs6.realpath)(filename).catch(() => filename); - tmpfile = getTmpname(truename); - if (!options.mode || !options.chown) { - const stats = await promisify3(fs6.stat)(truename).catch(() => { - }); - if (stats) { - if (options.mode == null) { - options.mode = stats.mode; - } - if (options.chown == null && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid }; - } - } - } - fd = await promisify3(fs6.open)(tmpfile, "w", options.mode); - if (options.tmpfileCreated) { - await options.tmpfileCreated(tmpfile); - } - if (isTypedArray(data)) { - data = typedArrayToBuffer(data); - } - if (Buffer.isBuffer(data)) { - await promisify3(fs6.write)(fd, data, 0, data.length, 0); - } else if (data != null) { - await promisify3(fs6.write)(fd, String(data), 0, String(options.encoding || "utf8")); - } - if (options.fsync !== false) { - await promisify3(fs6.fsync)(fd); - } - await promisify3(fs6.close)(fd); - fd = null; - if (options.chown) { - await promisify3(fs6.chown)(tmpfile, options.chown.uid, options.chown.gid).catch((err) => { - if (!isChownErrOk(err)) { - throw err; - } - }); - } - if (options.mode) { - await promisify3(fs6.chmod)(tmpfile, options.mode).catch((err) => { - if (!isChownErrOk(err)) { - throw err; - } - }); - } - await promisify3(fs6.rename)(tmpfile, truename); - } finally { - if (fd) { - await promisify3(fs6.close)(fd).catch( - /* istanbul ignore next */ - () => { - } - ); - } - removeOnExitHandler(); - await promisify3(fs6.unlink)(tmpfile).catch(() => { - }); - activeFiles[absoluteName].shift(); - if (activeFiles[absoluteName].length > 0) { - activeFiles[absoluteName][0](); - } else - delete activeFiles[absoluteName]; - } - } - function writeFile(filename, data, options, callback) { - if (options instanceof Function) { - callback = options; - options = {}; - } - const promise = writeFileAsync(filename, data, options); - if (callback) { - promise.then(callback, callback); - } - return promise; - } - function writeFileSync(filename, data, options) { - if (typeof options === "string") - options = { encoding: options }; - else if (!options) - options = {}; - try { - filename = fs6.realpathSync(filename); - } catch (ex) { - } - const tmpfile = getTmpname(filename); - if (!options.mode || !options.chown) { - try { - const stats = fs6.statSync(filename); - options = Object.assign({}, options); - if (!options.mode) { - options.mode = stats.mode; - } - if (!options.chown && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid }; - } - } catch (ex) { - } - } - let fd; - const cleanup = cleanupOnExit(tmpfile); - const removeOnExitHandler = onExit(cleanup); - let threw = true; - try { - fd = fs6.openSync(tmpfile, "w", options.mode || 438); - if (options.tmpfileCreated) { - options.tmpfileCreated(tmpfile); - } - if (isTypedArray(data)) { - data = typedArrayToBuffer(data); - } - if (Buffer.isBuffer(data)) { - fs6.writeSync(fd, data, 0, data.length, 0); - } else if (data != null) { - fs6.writeSync(fd, String(data), 0, String(options.encoding || "utf8")); - } - if (options.fsync !== false) { - fs6.fsyncSync(fd); - } - fs6.closeSync(fd); - fd = null; - if (options.chown) { - try { - fs6.chownSync(tmpfile, options.chown.uid, options.chown.gid); - } catch (err) { - if (!isChownErrOk(err)) { - throw err; - } - } - } - if (options.mode) { - try { - fs6.chmodSync(tmpfile, options.mode); - } catch (err) { - if (!isChownErrOk(err)) { - throw err; - } - } - } - fs6.renameSync(tmpfile, filename); - threw = false; - } finally { - if (fd) { - try { - fs6.closeSync(fd); - } catch (ex) { - } - } - removeOnExitHandler(); - if (threw) { - cleanup(); - } - } - } - } -}); - -// node_modules/is-obj/index.js -var require_is_obj = __commonJS({ - "node_modules/is-obj/index.js"(exports, module2) { - "use strict"; - module2.exports = (value) => { - const type = typeof value; - return value !== null && (type === "object" || type === "function"); - }; - } -}); - -// node_modules/dot-prop/index.js -var require_dot_prop = __commonJS({ - "node_modules/dot-prop/index.js"(exports, module2) { - "use strict"; - var isObj = require_is_obj(); - var disallowedKeys = [ - "__proto__", - "prototype", - "constructor" - ]; - var isValidPath = (pathSegments) => !pathSegments.some((segment) => disallowedKeys.includes(segment)); - function getPathSegments(path16) { - const pathArray = path16.split("."); - const parts = []; - for (let i = 0; i < pathArray.length; i++) { - let p = pathArray[i]; - while (p[p.length - 1] === "\\" && pathArray[i + 1] !== void 0) { - p = p.slice(0, -1) + "."; - p += pathArray[++i]; - } - parts.push(p); + Object.defineProperty(exports, "__esModule", { value: true }); + var stream_1 = require("stream"); + var stream_2 = require_stream3(); + var provider_1 = require_provider(); + var ProviderStream = class extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new stream_2.default(this._settings); } - if (!isValidPath(parts)) { - return []; + read(task) { + const root = this._getRootDirectory(task); + const options = this._getReaderOptions(task); + const source = this.api(root, task, options); + const destination = new stream_1.Readable({ objectMode: true, read: () => { + } }); + source.once("error", (error2) => destination.emit("error", error2)).on("data", (entry) => destination.emit("data", options.transform(entry))).once("end", () => destination.emit("end")); + destination.once("close", () => source.destroy()); + return destination; } - return parts; - } - module2.exports = { - get(object, path16, value) { - if (!isObj(object) || typeof path16 !== "string") { - return value === void 0 ? object : value; - } - const pathArray = getPathSegments(path16); - if (pathArray.length === 0) { - return; - } - for (let i = 0; i < pathArray.length; i++) { - if (!Object.prototype.propertyIsEnumerable.call(object, pathArray[i])) { - return value; - } - object = object[pathArray[i]]; - if (object === void 0 || object === null) { - if (i !== pathArray.length - 1) { - return value; - } - break; - } - } - return object; - }, - set(object, path16, value) { - if (!isObj(object) || typeof path16 !== "string") { - return object; - } - const root = object; - const pathArray = getPathSegments(path16); - for (let i = 0; i < pathArray.length; i++) { - const p = pathArray[i]; - if (!isObj(object[p])) { - object[p] = {}; - } - if (i === pathArray.length - 1) { - object[p] = value; - } - object = object[p]; - } - return root; - }, - delete(object, path16) { - if (!isObj(object) || typeof path16 !== "string") { - return false; - } - const pathArray = getPathSegments(path16); - for (let i = 0; i < pathArray.length; i++) { - const p = pathArray[i]; - if (i === pathArray.length - 1) { - delete object[p]; - return true; - } - object = object[p]; - if (!isObj(object)) { - return false; - } - } - }, - has(object, path16) { - if (!isObj(object) || typeof path16 !== "string") { - return false; - } - const pathArray = getPathSegments(path16); - if (pathArray.length === 0) { - return false; - } - for (let i = 0; i < pathArray.length; i++) { - if (isObj(object)) { - if (!(pathArray[i] in object)) { - return false; - } - object = object[pathArray[i]]; - } else { - return false; - } + api(root, task, options) { + if (task.dynamic) { + return this._reader.dynamic(root, options); } - return true; + return this._reader.static(task.patterns, options); } }; + exports.default = ProviderStream; } }); -// node_modules/crypto-random-string/index.js -var require_crypto_random_string = __commonJS({ - "node_modules/crypto-random-string/index.js"(exports, module2) { +// node_modules/fast-glob/out/readers/sync.js +var require_sync5 = __commonJS({ + "node_modules/fast-glob/out/readers/sync.js"(exports) { "use strict"; - var crypto5 = require("crypto"); - module2.exports = (length) => { - if (!Number.isFinite(length)) { - throw new TypeError("Expected a finite number"); + Object.defineProperty(exports, "__esModule", { value: true }); + var fsStat = require_out(); + var fsWalk = require_out3(); + var reader_1 = require_reader2(); + var ReaderSync = class extends reader_1.default { + constructor() { + super(...arguments); + this._walkSync = fsWalk.walkSync; + this._statSync = fsStat.statSync; } - return crypto5.randomBytes(Math.ceil(length / 2)).toString("hex").slice(0, length); - }; - } -}); - -// node_modules/unique-string/index.js -var require_unique_string = __commonJS({ - "node_modules/unique-string/index.js"(exports, module2) { - "use strict"; - var cryptoRandomString = require_crypto_random_string(); - module2.exports = () => cryptoRandomString(32); - } -}); - -// node_modules/configstore/index.js -var require_configstore = __commonJS({ - "node_modules/configstore/index.js"(exports, module2) { - "use strict"; - var path16 = require("path"); - var os = require("os"); - var fs6 = require_graceful_fs(); - var makeDir = require_make_dir(); - var xdgBasedir = require_xdg_basedir(); - var writeFileAtomic = require_write_file_atomic(); - var dotProp = require_dot_prop(); - var uniqueString = require_unique_string(); - var configDirectory = xdgBasedir.config || path16.join(os.tmpdir(), uniqueString()); - var permissionError = "You don't have access to this file."; - var makeDirOptions = { mode: 448 }; - var writeFileOptions = { mode: 384 }; - var Configstore = class { - constructor(id, defaults, options = {}) { - const pathPrefix = options.globalConfigPath ? path16.join(id, "config.json") : path16.join("configstore", `${id}.json`); - this.path = options.configPath || path16.join(configDirectory, pathPrefix); - if (defaults) { - this.all = { - ...defaults, - ...this.all - }; - } + dynamic(root, options) { + return this._walkSync(root, options); } - get all() { - try { - return JSON.parse(fs6.readFileSync(this.path, "utf8")); - } catch (error2) { - if (error2.code === "ENOENT") { - return {}; - } - if (error2.code === "EACCES") { - error2.message = `${error2.message} -${permissionError} -`; - } - if (error2.name === "SyntaxError") { - writeFileAtomic.sync(this.path, "", writeFileOptions); - return {}; + static(patterns, options) { + const entries = []; + for (const pattern of patterns) { + const filepath = this._getFullEntryPath(pattern); + const entry = this._getEntry(filepath, pattern, options); + if (entry === null || !options.entryFilter(entry)) { + continue; } - throw error2; + entries.push(entry); } + return entries; } - set all(value) { + _getEntry(filepath, pattern, options) { try { - makeDir.sync(path16.dirname(this.path), makeDirOptions); - writeFileAtomic.sync(this.path, JSON.stringify(value, void 0, " "), writeFileOptions); + const stats = this._getStat(filepath); + return this._makeEntry(stats, pattern); } catch (error2) { - if (error2.code === "EACCES") { - error2.message = `${error2.message} -${permissionError} -`; + if (options.errorFilter(error2)) { + return null; } throw error2; } } - get size() { - return Object.keys(this.all || {}).length; - } - get(key) { - return dotProp.get(this.all, key); - } - set(key, value) { - const config = this.all; - if (arguments.length === 1) { - for (const k of Object.keys(key)) { - dotProp.set(config, k, key[k]); - } - } else { - dotProp.set(config, key, value); - } - this.all = config; - } - has(key) { - return dotProp.has(this.all, key); - } - delete(key) { - const config = this.all; - dotProp.delete(config, key); - this.all = config; - } - clear() { - this.all = {}; + _getStat(filepath) { + return this._statSync(filepath, this._fsStatSettings); } }; - module2.exports = Configstore; - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/cfgStore.js -var require_cfgStore = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/cfgStore.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ConfigStore = void 0; - var configstore_1 = __importDefault(require_configstore()); - exports.ConfigStore = configstore_1.default; - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/GlobalSettings.js -var require_GlobalSettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/GlobalSettings.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getGlobalConfigPath = exports.writeRawGlobalSettings = exports.getRawGlobalSettings = void 0; - var util_1 = require("util"); - var errors_js_1 = require_errors3(); - var logger_js_1 = require_logger(); - var cfgStore_js_1 = require_cfgStore(); - var packageName = "cspell"; - function getRawGlobalSettings() { - const name = "CSpell Configstore"; - const globalConf = { - source: { - name, - filename: void 0 - } - }; - try { - const cfgStore = new cfgStore_js_1.ConfigStore(packageName); - const cfg = cfgStore.all; - if (cfg && Object.keys(cfg).length) { - Object.assign(globalConf, cfg); - globalConf.source = { - name, - filename: cfgStore.path - }; - } - } catch (error2) { - if (!(0, errors_js_1.isErrnoException)(error2) || !error2.code || !["ENOENT", "EACCES", "ENOTDIR", "EISDIR"].includes(error2.code)) { - (0, logger_js_1.logError)(error2); - } - } - return globalConf; - } - exports.getRawGlobalSettings = getRawGlobalSettings; - function writeRawGlobalSettings(settings) { - const toWrite = { - import: settings.import - }; - try { - const cfgStore = new cfgStore_js_1.ConfigStore(packageName); - cfgStore.set(toWrite); - return void 0; - } catch (error2) { - if (error2 instanceof Error) - return error2; - return new Error((0, util_1.format)(error2)); - } - } - exports.writeRawGlobalSettings = writeRawGlobalSettings; - function getGlobalConfigPath() { - const cfgStore = new cfgStore_js_1.ConfigStore(packageName); - return cfgStore.path; - } - exports.getGlobalConfigPath = getGlobalConfigPath; + exports.default = ReaderSync; } }); -// node_modules/cspell-lib/dist/cjs/Settings/Controller/ImportError.js -var require_ImportError = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/ImportError.js"(exports) { +// node_modules/fast-glob/out/providers/sync.js +var require_sync6 = __commonJS({ + "node_modules/fast-glob/out/providers/sync.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.UnsupportedPnpFile = exports.UnsupportedSchema = exports.ImportError = void 0; - var errors_js_1 = require_errors3(); - var ImportError = class extends Error { - constructor(msg, cause) { - super(msg); - this.cause = (0, errors_js_1.isError)(cause) ? cause : void 0; + var sync_1 = require_sync5(); + var provider_1 = require_provider(); + var ProviderSync = class extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new sync_1.default(this._settings); } - }; - exports.ImportError = ImportError; - var UnsupportedSchema = class extends Error { - constructor(msg) { - super(msg); + read(task) { + const root = this._getRootDirectory(task); + const options = this._getReaderOptions(task); + const entries = this.api(root, task, options); + return entries.map(options.transform); } - }; - exports.UnsupportedSchema = UnsupportedSchema; - var UnsupportedPnpFile = class extends Error { - constructor(msg) { - super(msg); + api(root, task, options) { + if (task.dynamic) { + return this._reader.dynamic(root, options); + } + return this._reader.static(task.patterns, options); } }; - exports.UnsupportedPnpFile = UnsupportedPnpFile; + exports.default = ProviderSync; } }); -// node_modules/clear-module/node_modules/parent-module/index.js -var require_parent_module2 = __commonJS({ - "node_modules/clear-module/node_modules/parent-module/index.js"(exports, module2) { +// node_modules/fast-glob/out/settings.js +var require_settings4 = __commonJS({ + "node_modules/fast-glob/out/settings.js"(exports) { "use strict"; - var callsites = require_callsites(); - module2.exports = (filePath) => { - const stacks = callsites(); - if (!filePath) { - return stacks[2].getFileName(); - } - let hasSeenValue = false; - stacks.shift(); - for (const stack of stacks) { - const parentFilePath = stack.getFileName(); - if (typeof parentFilePath !== "string") { - continue; - } - if (parentFilePath === filePath) { - hasSeenValue = true; - continue; - } - if (parentFilePath === "module.js") { - continue; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0; + var fs9 = require("fs"); + var os5 = require("os"); + var CPU_COUNT = Math.max(os5.cpus().length, 1); + exports.DEFAULT_FILE_SYSTEM_ADAPTER = { + lstat: fs9.lstat, + lstatSync: fs9.lstatSync, + stat: fs9.stat, + statSync: fs9.statSync, + readdir: fs9.readdir, + readdirSync: fs9.readdirSync + }; + var Settings = class { + constructor(_options = {}) { + this._options = _options; + this.absolute = this._getValue(this._options.absolute, false); + this.baseNameMatch = this._getValue(this._options.baseNameMatch, false); + this.braceExpansion = this._getValue(this._options.braceExpansion, true); + this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true); + this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT); + this.cwd = this._getValue(this._options.cwd, process.cwd()); + this.deep = this._getValue(this._options.deep, Infinity); + this.dot = this._getValue(this._options.dot, false); + this.extglob = this._getValue(this._options.extglob, true); + this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true); + this.fs = this._getFileSystemMethods(this._options.fs); + this.globstar = this._getValue(this._options.globstar, true); + this.ignore = this._getValue(this._options.ignore, []); + this.markDirectories = this._getValue(this._options.markDirectories, false); + this.objectMode = this._getValue(this._options.objectMode, false); + this.onlyDirectories = this._getValue(this._options.onlyDirectories, false); + this.onlyFiles = this._getValue(this._options.onlyFiles, true); + this.stats = this._getValue(this._options.stats, false); + this.suppressErrors = this._getValue(this._options.suppressErrors, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false); + this.unique = this._getValue(this._options.unique, true); + if (this.onlyDirectories) { + this.onlyFiles = false; } - if (hasSeenValue && parentFilePath !== filePath) { - return parentFilePath; + if (this.stats) { + this.objectMode = true; } + this.ignore = [].concat(this.ignore); + } + _getValue(option, value) { + return option === void 0 ? value : option; + } + _getFileSystemMethods(methods = {}) { + return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods); } }; + exports.default = Settings; } }); -// node_modules/clear-module/index.js -var require_clear_module = __commonJS({ - "node_modules/clear-module/index.js"(exports, module2) { +// node_modules/fast-glob/out/index.js +var require_out4 = __commonJS({ + "node_modules/fast-glob/out/index.js"(exports, module2) { "use strict"; - var path16 = require("path"); - var resolveFrom = require_resolve_from2(); - var parentModule = require_parent_module2(); - var resolve10 = (moduleId) => { - try { - return resolveFrom(path16.dirname(parentModule(__filename)), moduleId); - } catch (_) { - } - }; - var clear = (moduleId) => { - if (typeof moduleId !== "string") { - throw new TypeError(`Expected a \`string\`, got \`${typeof moduleId}\``); + var taskManager = require_tasks(); + var async_1 = require_async6(); + var stream_1 = require_stream4(); + var sync_1 = require_sync6(); + var settings_1 = require_settings4(); + var utils = require_utils7(); + async function FastGlob(source, options) { + assertPatternsInput(source); + const works = getWorks(source, async_1.default, options); + const result = await Promise.all(works); + return utils.array.flatten(result); + } + (function(FastGlob2) { + FastGlob2.glob = FastGlob2; + FastGlob2.globSync = sync; + FastGlob2.globStream = stream; + FastGlob2.async = FastGlob2; + function sync(source, options) { + assertPatternsInput(source); + const works = getWorks(source, sync_1.default, options); + return utils.array.flatten(works); } - const filePath = resolve10(moduleId); - if (!filePath) { - return; + FastGlob2.sync = sync; + function stream(source, options) { + assertPatternsInput(source); + const works = getWorks(source, stream_1.default, options); + return utils.stream.merge(works); } - if (require.cache[filePath] && require.cache[filePath].parent) { - let i = require.cache[filePath].parent.children.length; - while (i--) { - if (require.cache[filePath].parent.children[i].id === filePath) { - require.cache[filePath].parent.children.splice(i, 1); - } - } + FastGlob2.stream = stream; + function generateTasks(source, options) { + assertPatternsInput(source); + const patterns = [].concat(source); + const settings = new settings_1.default(options); + return taskManager.generate(patterns, settings); } - if (require.cache[filePath]) { - const children = require.cache[filePath].children.map((child) => child.id); - delete require.cache[filePath]; - for (const id of children) { - clear(id); - } + FastGlob2.generateTasks = generateTasks; + function isDynamicPattern(source, options) { + assertPatternsInput(source); + const settings = new settings_1.default(options); + return utils.pattern.isDynamicPattern(source, settings); } - }; - clear.all = () => { - const directory = path16.dirname(parentModule(__filename)); - for (const moduleId of Object.keys(require.cache)) { - delete require.cache[resolveFrom(directory, moduleId)]; + FastGlob2.isDynamicPattern = isDynamicPattern; + function escapePath(source) { + assertPatternsInput(source); + return utils.path.escape(source); } - }; - clear.match = (regex) => { - for (const moduleId of Object.keys(require.cache)) { - if (regex.test(moduleId)) { - clear(moduleId); - } + FastGlob2.escapePath = escapePath; + function convertPathToPattern(source) { + assertPatternsInput(source); + return utils.path.convertPathToPattern(source); } - }; - clear.single = (moduleId) => { - if (typeof moduleId !== "string") { - throw new TypeError(`Expected a \`string\`, got \`${typeof moduleId}\``); + FastGlob2.convertPathToPattern = convertPathToPattern; + let posix3; + (function(posix4) { + function escapePath2(source) { + assertPatternsInput(source); + return utils.path.escapePosixPath(source); + } + posix4.escapePath = escapePath2; + function convertPathToPattern2(source) { + assertPatternsInput(source); + return utils.path.convertPosixPathToPattern(source); + } + posix4.convertPathToPattern = convertPathToPattern2; + })(posix3 = FastGlob2.posix || (FastGlob2.posix = {})); + let win32; + (function(win322) { + function escapePath2(source) { + assertPatternsInput(source); + return utils.path.escapeWindowsPath(source); + } + win322.escapePath = escapePath2; + function convertPathToPattern2(source) { + assertPatternsInput(source); + return utils.path.convertWindowsPathToPattern(source); + } + win322.convertPathToPattern = convertPathToPattern2; + })(win32 = FastGlob2.win32 || (FastGlob2.win32 = {})); + })(FastGlob || (FastGlob = {})); + function getWorks(source, _Provider, options) { + const patterns = [].concat(source); + const settings = new settings_1.default(options); + const tasks = taskManager.generate(patterns, settings); + const provider = new _Provider(settings); + return tasks.map(provider.read, provider); + } + function assertPatternsInput(input) { + const source = [].concat(input); + const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item)); + if (!isValidSource) { + throw new TypeError("Patterns must be a string (non empty) or an array of strings"); } - delete require.cache[resolve10(moduleId)]; - }; - module2.exports = clear; + } + module2.exports = FastGlob; } }); -// node_modules/yocto-queue/index.js -var require_yocto_queue = __commonJS({ - "node_modules/yocto-queue/index.js"(exports, module2) { - var Node = class { - /// value; - /// next; - constructor(value) { - this.value = value; - this.next = void 0; +// node_modules/flatted/cjs/index.js +var require_cjs = __commonJS({ + "node_modules/flatted/cjs/index.js"(exports) { + "use strict"; + var { parse: $parse, stringify: $stringify } = JSON; + var { keys: keys2 } = Object; + var Primitive = String; + var primitive = "string"; + var ignore = {}; + var object = "object"; + var noop = (_, value) => value; + var primitives = (value) => value instanceof Primitive ? Primitive(value) : value; + var Primitives = (_, value) => typeof value === primitive ? new Primitive(value) : value; + var revive = (input, parsed, output, $) => { + const lazy = []; + for (let ke = keys2(output), { length } = ke, y = 0; y < length; y++) { + const k = ke[y]; + const value = output[k]; + if (value instanceof Primitive) { + const tmp = input[value]; + if (typeof tmp === object && !parsed.has(tmp)) { + parsed.add(tmp); + output[k] = ignore; + lazy.push({ k, a: [input, parsed, tmp, $] }); + } else + output[k] = $.call(output, k, tmp); + } else if (output[k] !== ignore) + output[k] = $.call(output, k, value); + } + for (let { length } = lazy, i = 0; i < length; i++) { + const { k, a } = lazy[i]; + output[k] = $.call(output, k, revive.apply(null, a)); } + return output; }; - var Queue = class { - // TODO: Use private class fields when targeting Node.js 12. - // #_head; - // #_tail; - // #_size; - constructor() { - this.clear(); + var set = (known, input, value) => { + const index = Primitive(input.push(value) - 1); + known.set(value, index); + return index; + }; + var parse4 = (text, reviver) => { + const input = $parse(text, Primitives).map(primitives); + const value = input[0]; + const $ = reviver || noop; + const tmp = typeof value === object && value ? revive(input, /* @__PURE__ */ new Set(), value, $) : value; + return $.call({ "": tmp }, "", tmp); + }; + exports.parse = parse4; + var stringify2 = (value, replacer, space) => { + const $ = replacer && typeof replacer === object ? (k, v) => k === "" || -1 < replacer.indexOf(k) ? v : void 0 : replacer || noop; + const known = /* @__PURE__ */ new Map(); + const input = []; + const output = []; + let i = +set(known, input, $.call({ "": value }, "", value)); + let firstRun = !i; + while (i < input.length) { + firstRun = true; + output[i] = $stringify(input[i++], replace, space); } - enqueue(value) { - const node = new Node(value); - if (this._head) { - this._tail.next = node; - this._tail = node; - } else { - this._head = node; - this._tail = node; + return "[" + output.join(",") + "]"; + function replace(key, value2) { + if (firstRun) { + firstRun = !firstRun; + return value2; } - this._size++; - } - dequeue() { - const current = this._head; - if (!current) { - return; + const after = $.call(this, key, value2); + switch (typeof after) { + case object: + if (after === null) + return after; + case primitive: + return known.get(after) || set(known, input, after); } - this._head = this._head.next; - this._size--; - return current.value; - } - clear() { - this._head = void 0; - this._tail = void 0; - this._size = 0; - } - get size() { - return this._size; + return after; } - *[Symbol.iterator]() { - let current = this._head; - while (current) { - yield current.value; - current = current.next; + }; + exports.stringify = stringify2; + var toJSON = (any3) => $parse(stringify2(any3)); + exports.toJSON = toJSON; + var fromJSON = (any3) => parse4($stringify(any3)); + exports.fromJSON = fromJSON; + } +}); + +// node_modules/flat-cache/src/utils.js +var require_utils9 = __commonJS({ + "node_modules/flat-cache/src/utils.js"(exports, module2) { + var fs9 = require("fs"); + var path26 = require("path"); + var flatted = require_cjs(); + module2.exports = { + tryParse: function(filePath, defaultValue) { + var result; + try { + result = this.readJSON(filePath); + } catch (ex) { + result = defaultValue; } + return result; + }, + /** + * Read json file synchronously using flatted + * + * @method readJSON + * @param {String} filePath Json filepath + * @returns {*} parse result + */ + readJSON: function(filePath) { + return flatted.parse( + fs9.readFileSync(filePath, { + encoding: "utf8" + }) + ); + }, + /** + * Write json file synchronously using circular-json + * + * @method writeJSON + * @param {String} filePath Json filepath + * @param {*} data Object to serialize + */ + writeJSON: function(filePath, data) { + fs9.mkdirSync(path26.dirname(filePath), { + recursive: true + }); + fs9.writeFileSync(filePath, flatted.stringify(data)); } }; - module2.exports = Queue; } }); -// node_modules/p-limit/index.js -var require_p_limit = __commonJS({ - "node_modules/p-limit/index.js"(exports, module2) { - "use strict"; - var Queue = require_yocto_queue(); - var pLimit = (concurrency) => { - if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { - throw new TypeError("Expected `concurrency` to be a number from 1 and up"); +// node_modules/fs.realpath/old.js +var require_old = __commonJS({ + "node_modules/fs.realpath/old.js"(exports) { + var pathModule = require("path"); + var isWindows2 = process.platform === "win32"; + var fs9 = require("fs"); + var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); + function rethrow() { + var callback; + if (DEBUG) { + var backtrace = new Error(); + callback = debugCallback; + } else + callback = missingCallback; + return callback; + function debugCallback(err) { + if (err) { + backtrace.message = err.message; + err = backtrace; + missingCallback(err); + } } - const queue = new Queue(); - let activeCount = 0; - const next = () => { - activeCount--; - if (queue.size > 0) { - queue.dequeue()(); + function missingCallback(err) { + if (err) { + if (process.throwDeprecation) + throw err; + else if (!process.noDeprecation) { + var msg = "fs: missing callback " + (err.stack || err.message); + if (process.traceDeprecation) + console.trace(msg); + else + console.error(msg); + } } - }; - const run2 = async (fn, resolve10, ...args) => { - activeCount++; - const result = (async () => fn(...args))(); - resolve10(result); - try { - await result; - } catch { + } + } + function maybeCallback(cb) { + return typeof cb === "function" ? cb : rethrow(); + } + var normalize3 = pathModule.normalize; + if (isWindows2) { + nextPartRe = /(.*?)(?:[\/\\]+|$)/g; + } else { + nextPartRe = /(.*?)(?:[\/]+|$)/g; + } + var nextPartRe; + if (isWindows2) { + splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; + } else { + splitRootRe = /^[\/]*/; + } + var splitRootRe; + exports.realpathSync = function realpathSync2(p, cache2) { + p = pathModule.resolve(p); + if (cache2 && Object.prototype.hasOwnProperty.call(cache2, p)) { + return cache2[p]; + } + var original = p, seenLinks = {}, knownHard = {}; + var pos; + var current; + var base; + var previous; + start(); + function start() { + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ""; + if (isWindows2 && !knownHard[base]) { + fs9.lstatSync(base); + knownHard[base] = true; } - next(); - }; - const enqueue = (fn, resolve10, ...args) => { - queue.enqueue(run2.bind(null, fn, resolve10, ...args)); - (async () => { - await Promise.resolve(); - if (activeCount < concurrency && queue.size > 0) { - queue.dequeue()(); + } + while (pos < p.length) { + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + if (knownHard[base] || cache2 && cache2[base] === base) { + continue; + } + var resolvedLink; + if (cache2 && Object.prototype.hasOwnProperty.call(cache2, base)) { + resolvedLink = cache2[base]; + } else { + var stat2 = fs9.lstatSync(base); + if (!stat2.isSymbolicLink()) { + knownHard[base] = true; + if (cache2) + cache2[base] = base; + continue; } - })(); - }; - const generator = (fn, ...args) => new Promise((resolve10) => { - enqueue(fn, resolve10, ...args); - }); - Object.defineProperties(generator, { - activeCount: { - get: () => activeCount - }, - pendingCount: { - get: () => queue.size - }, - clearQueue: { - value: () => { - queue.clear(); + var linkTarget = null; + if (!isWindows2) { + var id = stat2.dev.toString(32) + ":" + stat2.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + linkTarget = seenLinks[id]; + } } + if (linkTarget === null) { + fs9.statSync(base); + linkTarget = fs9.readlinkSync(base); + } + resolvedLink = pathModule.resolve(previous, linkTarget); + if (cache2) + cache2[base] = resolvedLink; + if (!isWindows2) + seenLinks[id] = linkTarget; } - }); - return generator; - }; - module2.exports = pLimit; - } -}); - -// node_modules/p-locate/index.js -var require_p_locate = __commonJS({ - "node_modules/p-locate/index.js"(exports, module2) { - "use strict"; - var pLimit = require_p_limit(); - var EndError = class extends Error { - constructor(value) { - super(); - this.value = value; + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); } + if (cache2) + cache2[original] = p; + return p; }; - var testElement = async (element, tester) => tester(await element); - var finder = async (element) => { - const values = await Promise.all(element); - if (values[1] === true) { - throw new EndError(values[0]); + exports.realpath = function realpath(p, cache2, cb) { + if (typeof cb !== "function") { + cb = maybeCallback(cache2); + cache2 = null; } - return false; - }; - var pLocate = async (iterable, tester, options) => { - options = { - concurrency: Infinity, - preserveOrder: true, - ...options - }; - const limit = pLimit(options.concurrency); - const items = [...iterable].map((element) => [element, limit(testElement, element, tester)]); - const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity); - try { - await Promise.all(items.map((element) => checkLimit(finder, element))); - } catch (error2) { - if (error2 instanceof EndError) { - return error2.value; + p = pathModule.resolve(p); + if (cache2 && Object.prototype.hasOwnProperty.call(cache2, p)) { + return process.nextTick(cb.bind(null, null, cache2[p])); + } + var original = p, seenLinks = {}, knownHard = {}; + var pos; + var current; + var base; + var previous; + start(); + function start() { + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ""; + if (isWindows2 && !knownHard[base]) { + fs9.lstat(base, function(err) { + if (err) + return cb(err); + knownHard[base] = true; + LOOP(); + }); + } else { + process.nextTick(LOOP); } - throw error2; } - }; - module2.exports = pLocate; - } -}); - -// node_modules/locate-path/index.js -var require_locate_path = __commonJS({ - "node_modules/locate-path/index.js"(exports, module2) { - "use strict"; - var path16 = require("path"); - var fs6 = require("fs"); - var { promisify: promisify3 } = require("util"); - var pLocate = require_p_locate(); - var fsStat = promisify3(fs6.stat); - var fsLStat = promisify3(fs6.lstat); - var typeMappings = { - directory: "isDirectory", - file: "isFile" - }; - function checkType({ type }) { - if (type in typeMappings) { - return; + function LOOP() { + if (pos >= p.length) { + if (cache2) + cache2[original] = p; + return cb(null, p); + } + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + if (knownHard[base] || cache2 && cache2[base] === base) { + return process.nextTick(LOOP); + } + if (cache2 && Object.prototype.hasOwnProperty.call(cache2, base)) { + return gotResolvedLink(cache2[base]); + } + return fs9.lstat(base, gotStat); } - throw new Error(`Invalid type specified: ${type}`); - } - var matchType = (type, stat2) => type === void 0 || stat2[typeMappings[type]](); - module2.exports = async (paths, options) => { - options = { - cwd: process.cwd(), - type: "file", - allowSymlinks: true, - ...options - }; - checkType(options); - const statFn = options.allowSymlinks ? fsStat : fsLStat; - return pLocate(paths, async (path_) => { - try { - const stat2 = await statFn(path16.resolve(options.cwd, path_)); - return matchType(options.type, stat2); - } catch { - return false; + function gotStat(err, stat2) { + if (err) + return cb(err); + if (!stat2.isSymbolicLink()) { + knownHard[base] = true; + if (cache2) + cache2[base] = base; + return process.nextTick(LOOP); } - }, options); - }; - module2.exports.sync = (paths, options) => { - options = { - cwd: process.cwd(), - allowSymlinks: true, - type: "file", - ...options - }; - checkType(options); - const statFn = options.allowSymlinks ? fs6.statSync : fs6.lstatSync; - for (const path_ of paths) { - try { - const stat2 = statFn(path16.resolve(options.cwd, path_)); - if (matchType(options.type, stat2)) { - return path_; + if (!isWindows2) { + var id = stat2.dev.toString(32) + ":" + stat2.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + return gotTarget(null, seenLinks[id], base); } - } catch { } + fs9.stat(base, function(err2) { + if (err2) + return cb(err2); + fs9.readlink(base, function(err3, target) { + if (!isWindows2) + seenLinks[id] = target; + gotTarget(err3, target); + }); + }); } - }; - } -}); - -// node_modules/path-exists/index.js -var require_path_exists = __commonJS({ - "node_modules/path-exists/index.js"(exports, module2) { - "use strict"; - var fs6 = require("fs"); - var { promisify: promisify3 } = require("util"); - var pAccess = promisify3(fs6.access); - module2.exports = async (path16) => { - try { - await pAccess(path16); - return true; - } catch (_) { - return false; + function gotTarget(err, target, base2) { + if (err) + return cb(err); + var resolvedLink = pathModule.resolve(previous, target); + if (cache2) + cache2[base2] = resolvedLink; + gotResolvedLink(resolvedLink); } - }; - module2.exports.sync = (path16) => { - try { - fs6.accessSync(path16); - return true; - } catch (_) { - return false; + function gotResolvedLink(resolvedLink) { + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); } }; } }); -// node_modules/find-up/index.js -var require_find_up = __commonJS({ - "node_modules/find-up/index.js"(exports, module2) { - "use strict"; - var path16 = require("path"); - var locatePath = require_locate_path(); - var pathExists = require_path_exists(); - var stop = Symbol("findUp.stop"); - module2.exports = async (name, options = {}) => { - let directory = path16.resolve(options.cwd || ""); - const { root } = path16.parse(directory); - const paths = [].concat(name); - const runMatcher = async (locateOptions) => { - if (typeof name !== "function") { - return locatePath(paths, locateOptions); - } - const foundPath = await name(locateOptions.cwd); - if (typeof foundPath === "string") { - return locatePath([foundPath], locateOptions); - } - return foundPath; - }; - while (true) { - const foundPath = await runMatcher({ ...options, cwd: directory }); - if (foundPath === stop) { - return; - } - if (foundPath) { - return path16.resolve(directory, foundPath); - } - if (directory === root) { - return; - } - directory = path16.dirname(directory); - } - }; - module2.exports.sync = (name, options = {}) => { - let directory = path16.resolve(options.cwd || ""); - const { root } = path16.parse(directory); - const paths = [].concat(name); - const runMatcher = (locateOptions) => { - if (typeof name !== "function") { - return locatePath.sync(paths, locateOptions); - } - const foundPath = name(locateOptions.cwd); - if (typeof foundPath === "string") { - return locatePath.sync([foundPath], locateOptions); - } - return foundPath; - }; - while (true) { - const foundPath = runMatcher({ ...options, cwd: directory }); - if (foundPath === stop) { - return; - } - if (foundPath) { - return path16.resolve(directory, foundPath); - } - if (directory === root) { - return; - } - directory = path16.dirname(directory); - } - }; - module2.exports.exists = pathExists; - module2.exports.sync.exists = pathExists.sync; - module2.exports.stop = stop; - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/Controller/pnpLoader.js -var require_pnpLoader = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/pnpLoader.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.clearPnPGlobalCache = exports.pnpLoader = exports.PnpLoader = void 0; - var clear_module_1 = __importDefault(require_clear_module()); - var find_up_1 = __importDefault(require_find_up()); - var import_fresh_1 = __importDefault(require_import_fresh()); - var Uri_js_1 = require_Uri(); - var ImportError_js_1 = require_ImportError(); - var defaultPnpFiles = [".pnp.cjs", ".pnp.js"]; - var supportedSchemas = /* @__PURE__ */ new Set(["file"]); - var cachedRequests = /* @__PURE__ */ new Map(); - var lock = void 0; - var cachedPnpImportsSync = /* @__PURE__ */ new Map(); - var cachedRequestsSync = /* @__PURE__ */ new Map(); - var PnpLoader = class { - constructor(pnpFiles = defaultPnpFiles) { - this.pnpFiles = pnpFiles; - this.cacheKeySuffix = ":" + pnpFiles.join(); - } - /** - * Request that the nearest .pnp file gets loaded - * @param uriDirectory starting directory - * @returns promise - rejects on error - success if loaded or not found. - */ - async load(uriDirectory) { - if (!supportedSchemas.has(uriDirectory.scheme)) - return void 0; - await lock; - const cacheKey = this.calcKey(uriDirectory); - const cached = cachedRequests.get(cacheKey); - if (cached) - return cached; - const r = findPnpAndLoad(uriDirectory, this.pnpFiles); - cachedRequests.set(cacheKey, r); - const result = await r; - cachedRequestsSync.set(cacheKey, result); - return result; - } - async peek(uriDirectory) { - if (!supportedSchemas.has(uriDirectory.scheme)) - return void 0; - await lock; - const cacheKey = this.calcKey(uriDirectory); - return cachedRequests.get(cacheKey) ?? Promise.resolve(void 0); - } - /** - * Request that the nearest .pnp file gets loaded - * @param uriDirectory starting directory - * @returns promise - rejects on error - success if loaded or not found. - */ - loadSync(uriDirectory) { - if (!supportedSchemas.has(uriDirectory.scheme)) - return void 0; - const cacheKey = this.calcKey(uriDirectory); - const cached = cachedRequestsSync.get(cacheKey); - if (cached) - return cached; - const r = findPnpAndLoadSync(uriDirectory, this.pnpFiles); - cachedRequestsSync.set(cacheKey, r); - cachedRequests.set(cacheKey, Promise.resolve(r)); - return r; - } - peekSync(uriDirectory) { - if (!supportedSchemas.has(uriDirectory.scheme)) - return void 0; - const cacheKey = this.calcKey(uriDirectory); - return cachedRequestsSync.get(cacheKey); - } - /** - * Clears the cached so .pnp files will get reloaded on request. - */ - clearCache() { - return clearPnPGlobalCache(); +// node_modules/fs.realpath/index.js +var require_fs5 = __commonJS({ + "node_modules/fs.realpath/index.js"(exports, module2) { + module2.exports = realpath; + realpath.realpath = realpath; + realpath.sync = realpathSync2; + realpath.realpathSync = realpathSync2; + realpath.monkeypatch = monkeypatch; + realpath.unmonkeypatch = unmonkeypatch; + var fs9 = require("fs"); + var origRealpath = fs9.realpath; + var origRealpathSync = fs9.realpathSync; + var version4 = process.version; + var ok = /^v[0-5]\./.test(version4); + var old = require_old(); + function newError(er) { + return er && er.syscall === "realpath" && (er.code === "ELOOP" || er.code === "ENOMEM" || er.code === "ENAMETOOLONG"); + } + function realpath(p, cache2, cb) { + if (ok) { + return origRealpath(p, cache2, cb); } - calcKey(uriDirectory) { - return uriDirectory.toString() + this.cacheKeySuffix; + if (typeof cache2 === "function") { + cb = cache2; + cache2 = null; } - }; - exports.PnpLoader = PnpLoader; - function pnpLoader(pnpFiles) { - return new PnpLoader(pnpFiles); - } - exports.pnpLoader = pnpLoader; - async function findPnpAndLoad(uriDirectory, pnpFiles) { - const found = await (0, find_up_1.default)(pnpFiles, { cwd: (0, Uri_js_1.uriToFilePath)(uriDirectory) }); - return loadPnpIfNeeded(found); - } - function findPnpAndLoadSync(uriDirectory, pnpFiles) { - const found = find_up_1.default.sync(pnpFiles, { cwd: (0, Uri_js_1.uriToFilePath)(uriDirectory) }); - return loadPnpIfNeeded(found); - } - function loadPnpIfNeeded(found) { - if (!found) - return void 0; - const c = cachedPnpImportsSync.get(found); - if (c || cachedPnpImportsSync.has(found)) - return c; - const r = loadPnp(found); - cachedPnpImportsSync.set(found, r); - return r; + origRealpath(p, cache2, function(er, result) { + if (newError(er)) { + old.realpath(p, cache2, cb); + } else { + cb(er, result); + } + }); } - function loadPnp(pnpFile) { - const pnp = (0, import_fresh_1.default)(pnpFile); - if (pnp.setup) { - pnp.setup(); - return (0, Uri_js_1.toUri)(pnpFile); + function realpathSync2(p, cache2) { + if (ok) { + return origRealpathSync(p, cache2); + } + try { + return origRealpathSync(p, cache2); + } catch (er) { + if (newError(er)) { + return old.realpathSync(p, cache2); + } else { + throw er; + } } - throw new ImportError_js_1.UnsupportedPnpFile(`Unsupported pnp file: "${pnpFile}"`); } - function clearPnPGlobalCache() { - if (lock) - return lock; - lock = _cleanCache().finally(() => { - lock = void 0; - }); - return lock; - } - exports.clearPnPGlobalCache = clearPnPGlobalCache; - async function _cleanCache() { - await Promise.all([...cachedRequests.values()].map(rejectToUndefined)); - const modules = [...cachedPnpImportsSync.values()]; - modules.forEach((r) => r && clear_module_1.default.single((0, Uri_js_1.uriToFilePath)(r))); - cachedRequests.clear(); - cachedRequestsSync.clear(); - cachedPnpImportsSync.clear(); - return void 0; + function monkeypatch() { + fs9.realpath = realpath; + fs9.realpathSync = realpathSync2; } - function rejectToUndefined(p) { - return p.catch(() => void 0); + function unmonkeypatch() { + fs9.realpath = origRealpath; + fs9.realpathSync = origRealpathSync; } } }); -// node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/defaultSettings.js -var require_defaultSettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/defaultSettings.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultSettings = void 0; - var CSpellSettingsInternalDef_js_1 = require_CSpellSettingsInternalDef(); - var constants_js_1 = require_constants3(); - exports.defaultSettings = (0, CSpellSettingsInternalDef_js_1.createCSpellSettingsInternal)({ - id: "default", - name: "default", - version: constants_js_1.currentSettingsFileVersion - }); +// node_modules/concat-map/index.js +var require_concat_map = __commonJS({ + "node_modules/concat-map/index.js"(exports, module2) { + module2.exports = function(xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + var x = fn(xs[i], i); + if (isArray2(x)) + res.push.apply(res, x); + else + res.push(x); + } + return res; + }; + var isArray2 = Array.isArray || function(xs) { + return Object.prototype.toString.call(xs) === "[object Array]"; + }; } }); -// node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/toGlobDef.js -var require_toGlobDef = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/toGlobDef.js"(exports) { +// node_modules/balanced-match/index.js +var require_balanced_match = __commonJS({ + "node_modules/balanced-match/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toGlobDef = void 0; - function toGlobDef(g, root, source) { - if (g === void 0) - return void 0; - if (Array.isArray(g)) { - return g.map((g2) => toGlobDef(g2, root, source)); - } - if (typeof g === "string") { - const glob2 = { glob: g }; - if (root !== void 0) { - glob2.root = root; + module2.exports = balanced; + function balanced(a, b, str) { + if (a instanceof RegExp) + a = maybeMatch(a, str); + if (b instanceof RegExp) + b = maybeMatch(b, str); + var r = range(a, b, str); + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; + } + function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; + } + balanced.range = range; + function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var 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) { + result = [begs.pop(), bi]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + bi = str.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; + } + if (begs.length) { + result = [left, right]; } - return toGlobDef(glob2, root, source); - } - if (source) { - return { ...g, source }; } - return g; + return result; } - exports.toGlobDef = toGlobDef; } }); -// node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/normalizeRawSettings.js -var require_normalizeRawSettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/normalizeRawSettings.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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.normalizeCacheSettings = exports.normalizeSettingsGlobs = exports.normalizeGitignoreRoot = exports.normalizeLanguageSettings = exports.normalizeReporters = exports.normalizeOverrides = exports.normalizeDictionaryDefs = exports.normalizeRawConfig = void 0; - var path16 = __importStar(require("path")); - var resolveFile_js_1 = require_resolveFile(); - var util = __importStar(require_util()); - var DictionarySettings_js_1 = require_DictionarySettings(); - var toGlobDef_js_1 = require_toGlobDef(); - function normalizeRawConfig(config) { - if (typeof config.version === "number") { - config.version = config.version.toString(); - } - } - exports.normalizeRawConfig = normalizeRawConfig; - function normalizeDictionaryDefs(settings, pathToSettingsFile) { - const dictionaryDefinitions = (0, DictionarySettings_js_1.mapDictDefsToInternal)(settings.dictionaryDefinitions, pathToSettingsFile); - const languageSettings = settings.languageSettings?.map((langSetting) => util.clean({ - ...langSetting, - dictionaryDefinitions: (0, DictionarySettings_js_1.mapDictDefsToInternal)(langSetting.dictionaryDefinitions, pathToSettingsFile) - })); - return util.clean({ - dictionaryDefinitions, - languageSettings - }); +// node_modules/brace-expansion/index.js +var require_brace_expansion = __commonJS({ + "node_modules/brace-expansion/index.js"(exports, module2) { + var concatMap3 = require_concat_map(); + var balanced = require_balanced_match(); + module2.exports = expandTop; + var escSlash = "\0SLASH" + Math.random() + "\0"; + var escOpen = "\0OPEN" + Math.random() + "\0"; + var escClose = "\0CLOSE" + Math.random() + "\0"; + var escComma = "\0COMMA" + Math.random() + "\0"; + var escPeriod = "\0PERIOD" + Math.random() + "\0"; + function numeric(str) { + return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); } - exports.normalizeDictionaryDefs = normalizeDictionaryDefs; - function normalizeOverrides(settings, pathToSettingsFile) { - const { globRoot = path16.dirname(pathToSettingsFile) } = settings; - const overrides = settings.overrides?.map((override) => { - const filename = (0, toGlobDef_js_1.toGlobDef)(override.filename, globRoot, pathToSettingsFile); - const { dictionaryDefinitions, languageSettings } = normalizeDictionaryDefs(override, pathToSettingsFile); - return util.clean({ - ...override, - filename, - dictionaryDefinitions, - languageSettings: normalizeLanguageSettings(languageSettings) - }); - }); - return overrides ? { overrides } : {}; + function escapeBraces(str) { + return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); } - exports.normalizeOverrides = normalizeOverrides; - function normalizeReporters(settings, pathToSettingsFile) { - if (settings.reporters === void 0) - return {}; - const folder = path16.dirname(pathToSettingsFile); - function resolve10(s) { - if (s === "default") - return s; - const r = (0, resolveFile_js_1.resolveFile)(s, folder); - if (!r.found) { - throw new Error(`Not found: "${s}"`); - } - return r.filename; - } - function resolveReporter(s) { - if (typeof s === "string") { - return resolve10(s); - } - if (!Array.isArray(s) || typeof s[0] !== "string") - throw new Error("Invalid Reporter"); - const [r, ...rest] = s; - return [resolve10(r), ...rest]; - } - return { - reporters: settings.reporters.map(resolveReporter) - }; + function unescapeBraces(str) { + return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); } - exports.normalizeReporters = normalizeReporters; - function normalizeLanguageSettings(languageSettings) { - if (!languageSettings) - return void 0; - function fixLocale(s) { - const { local: locale, ...rest } = s; - return util.clean({ locale, ...rest }); + function parseCommaParts(str) { + if (!str) + return [""]; + var parts = []; + var m = balanced("{", "}", str); + if (!m) + return str.split(","); + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(","); + p[p.length - 1] += "{" + body + "}"; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); } - return languageSettings.map(fixLocale); - } - exports.normalizeLanguageSettings = normalizeLanguageSettings; - function normalizeGitignoreRoot(settings, pathToSettingsFile) { - const { gitignoreRoot } = settings; - if (!gitignoreRoot) - return {}; - const dir = path16.dirname(pathToSettingsFile); - const roots = Array.isArray(gitignoreRoot) ? gitignoreRoot : [gitignoreRoot]; - return { - gitignoreRoot: roots.map((p) => path16.resolve(dir, p)) - }; + parts.push.apply(parts, p); + return parts; } - exports.normalizeGitignoreRoot = normalizeGitignoreRoot; - function normalizeSettingsGlobs(settings, pathToSettingsFile) { - const { globRoot } = settings; - if (settings.ignorePaths === void 0) - return {}; - const ignorePaths = (0, toGlobDef_js_1.toGlobDef)(settings.ignorePaths, globRoot, pathToSettingsFile); - return { - ignorePaths - }; + function expandTop(str) { + if (!str) + return []; + if (str.substr(0, 2) === "{}") { + str = "\\{\\}" + str.substr(2); + } + return expand(escapeBraces(str), true).map(unescapeBraces); } - exports.normalizeSettingsGlobs = normalizeSettingsGlobs; - function normalizeCacheSettings(settings, pathToSettingsDir) { - const { cache } = settings; - if (cache === void 0) - return {}; - const { cacheLocation } = cache; - if (cacheLocation === void 0) - return { cache }; - return { cache: { ...cache, cacheLocation: resolveFilePath(cacheLocation, pathToSettingsDir) } }; + function embrace(str) { + return "{" + str + "}"; } - exports.normalizeCacheSettings = normalizeCacheSettings; - function resolveFilePath(filename, pathToSettingsFile) { - const cwd = process.cwd(); - return path16.resolve(pathToSettingsFile, filename.replace("${cwd}", cwd)); + function isPadded(el) { + return /^-?0\d/.test(el); } - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/PnPSettings.js -var require_PnPSettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/PnPSettings.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.normalizePnPSettings = exports.defaultPnPSettings = void 0; - var util_js_1 = require_util(); - exports.defaultPnPSettings = Object.freeze({}); - var lastPnP = exports.defaultPnPSettings; - function normalizePnPSettings(settings) { - if (equal(lastPnP, settings)) - return lastPnP; - if (equal(exports.defaultPnPSettings, settings)) - return exports.defaultPnPSettings; - const { usePnP, pnpFiles } = settings; - return lastPnP = (0, util_js_1.clean)({ usePnP, pnpFiles }); - } - exports.normalizePnPSettings = normalizePnPSettings; - function equal(a, b) { - return a === b || a.usePnP === b.usePnP && (a.pnpFiles === b.pnpFiles || a.pnpFiles?.join("|") === b.pnpFiles?.join("|")); + function lte(i, y) { + return i <= y; } - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/configLoader.js -var require_configLoader = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/configLoader.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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.__testing__ = exports.getDefaultConfigLoader = exports.createConfigLoader = exports.clearCachedSettingsFiles = exports.getCachedFileSize = exports.getGlobalSettings = exports.readRawSettings = exports.loadPnPSync = exports.loadPnP = exports.loadConfigSync = exports.loadConfig = exports.searchForConfigSync = exports.searchForConfig = exports.ConfigLoader = exports.defaultConfigFilenames = exports.defaultFileName = exports.sectionCSpell = void 0; - var json = __importStar(require_src2()); - var cosmiconfig_1 = require_dist(); - var cspell_io_1 = require_cjs3(); - var path16 = __importStar(require("path")); - var CSpellSettingsInternalDef_js_1 = require_CSpellSettingsInternalDef(); - var AutoResolveLRUCache_js_1 = require_AutoResolveLRUCache(); - var logger_js_1 = require_logger(); - var resolveFile_js_1 = require_resolveFile(); - var Uri_js_1 = require_Uri(); - var constants_js_1 = require_constants3(); - var CSpellSettingsServer_js_1 = require_CSpellSettingsServer(); - var GlobalSettings_js_1 = require_GlobalSettings(); - var ImportError_js_1 = require_ImportError(); - var pnpLoader_js_1 = require_pnpLoader(); - var defaultSettings_js_1 = require_defaultSettings(); - var normalizeRawSettings_js_1 = require_normalizeRawSettings(); - var PnPSettings_js_1 = require_PnPSettings(); - var supportedCSpellConfigVersions = [constants_js_1.configSettingsFileVersion0_2]; - var setOfSupportedConfigVersions = Object.freeze(new Set(supportedCSpellConfigVersions)); - exports.sectionCSpell = "cSpell"; - exports.defaultFileName = "cspell.json"; - var gcl = getDefaultConfigLoaderInternal; - var CACHE_SIZE_SEARCH_CONFIG = 32; - var searchPlaces = Object.freeze([ - "package.json", - // Original locations - ".cspell.json", - "cspell.json", - ".cSpell.json", - "cSpell.json", - // Original locations jsonc - ".cspell.jsonc", - "cspell.jsonc", - // Alternate locations - ".vscode/cspell.json", - ".vscode/cSpell.json", - ".vscode/.cspell.json", - // Standard Locations - "cspell.config.json", - "cspell.config.jsonc", - "cspell.config.yaml", - "cspell.config.yml", - "cspell.yaml", - "cspell.yml", - // Dynamic config is looked for last - "cspell.config.js", - "cspell.config.cjs", - // .config - ".config/.cspell.json", - ".config/cspell.json", - ".config/.cSpell.json", - ".config/cSpell.json", - ".config/.cspell.jsonc", - ".config/cspell.jsonc", - ".config/cspell.config.json", - ".config/cspell.config.jsonc", - ".config/cspell.config.yaml", - ".config/cspell.config.yml", - ".config/cspell.yaml", - ".config/cspell.yml", - ".config/cspell.config.js", - ".config/cspell.config.cjs" - ]); - var cspellCosmiconfig = { - searchPlaces: searchPlaces.concat(), - loaders: { - ".json": parseJson, - ".jsonc": parseJson - } - }; - function parseJson(_filename, content) { - return json.parse(content); + function gte(i, y) { + return i >= y; } - exports.defaultConfigFilenames = Object.freeze(searchPlaces.concat()); - var defaultConfigLoader = void 0; - var ConfigLoader = class { - /** - * Use `createConfigLoader` - * @param cspellIO - CSpellIO interface for reading files. - */ - constructor(cspellIO) { - this.cspellIO = cspellIO; - this.cachedFiles = /* @__PURE__ */ new Map(); - this.cspellConfigExplorer = (0, cosmiconfig_1.cosmiconfig)("cspell", cspellCosmiconfig); - this.cspellConfigExplorerSync = (0, cosmiconfig_1.cosmiconfigSync)("cspell", cspellCosmiconfig); - this.searchConfigLRU = new AutoResolveLRUCache_js_1.AutoResolveLRUCache(CACHE_SIZE_SEARCH_CONFIG, (a, b) => a.searchFrom === b.searchFrom && a.pnpSettings === b.pnpSettings); - } - readSettings(filename, relativeToOrDefault, defaultValue) { - const relativeTo = (typeof relativeToOrDefault === "string" ? relativeToOrDefault : "") || process.cwd(); - defaultValue = defaultValue || (typeof relativeToOrDefault !== "string" ? relativeToOrDefault : void 0); - const ref = resolveFilename2(filename, relativeTo); - return this.importSettings(ref, defaultValue, defaultValue || PnPSettings_js_1.defaultPnPSettings); - } - async readSettingsAsync(filename, relativeTo, pnpSettings) { - const ref = resolveFilename2(filename, relativeTo || process.cwd()); - return this.importSettings(ref, void 0, pnpSettings || PnPSettings_js_1.defaultPnPSettings); - } - /** - * - * @param searchFrom the directory / file to start searching from. - * @param pnpSettings - related to Using Yarn PNP. - * @returns the resulting settings - */ - searchForConfig(searchFrom, pnpSettings = PnPSettings_js_1.defaultPnPSettings) { - pnpSettings = (0, PnPSettings_js_1.normalizePnPSettings)(pnpSettings); - return this.searchConfigLRU.get({ searchFrom, pnpSettings }, (p) => this._searchForConfig(p)); - } - _searchForConfig(params) { - return gcl().normalizeSearchForConfigResultAsync(params.searchFrom || process.cwd(), this.cspellConfigExplorer.search(params.searchFrom), params.pnpSettings).then((r) => r.filepath ? r.config : void 0); - } - getGlobalSettings() { - if (!this.globalSettings) { - const globalConf = (0, GlobalSettings_js_1.getRawGlobalSettings)(); - this.globalSettings = { - id: "global_config", - ...this.normalizeSettings(globalConf || {}, "./global_config", {}) - }; + function expand(str, isTop) { + var expansions = []; + var m = balanced("{", "}", str); + if (!m || /\$$/.test(m.pre)) + return [str]; + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(",") >= 0; + if (!isSequence && !isOptions) { + if (m.post.match(/,.*\}/)) { + str = m.pre + "{" + m.body + escClose + m.post; + return expand(str); } - return this.globalSettings; - } - clearCachedSettingsFiles() { - this.searchConfigLRU.clear(); - this.globalSettings = void 0; - this.cachedFiles.clear(); - this.cspellConfigExplorer.clearCaches(); - this.cspellConfigExplorerSync.clearCaches(); + return [str]; } - /** - * Read a config file and inject the fileRef. - * @param fileRef - filename plus context, injected into the resulting config. - */ - readConfig(fileRef) { - const { filename, error: error2 } = fileRef; - if (error2) { - fileRef.error = error2 instanceof ImportError_js_1.ImportError ? error2 : new ImportError_js_1.ImportError(`Failed to read config file: "${filename}"`, error2); - return { __importRef: fileRef }; + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length ? expand(m.post, false) : [""]; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } } - const s = {}; - try { - const r = this.cspellConfigExplorerSync.load(filename); - if (!r?.config) - throw new Error(`not found: "${filename}"`); - Object.assign(s, r.config); - (0, normalizeRawSettings_js_1.normalizeRawConfig)(s); - validateRawConfig(s, fileRef); - } catch (err) { - fileRef.error = err instanceof ImportError_js_1.ImportError ? err : new ImportError_js_1.ImportError(`Failed to read config file: "${filename}"`, err); - } - s.__importRef = fileRef; - return s; - } - importSettings(fileRef, defaultValues, pnpSettings) { - defaultValues = defaultValues ?? defaultSettings_js_1.defaultSettings; - const { filename } = fileRef; - const importRef = { ...fileRef }; - const cached = this.cachedFiles.get(filename); - if (cached) { - const cachedImportRef = cached.__importRef || importRef; - cachedImportRef.referencedBy = mergeSourceList(cachedImportRef.referencedBy || [], importRef.referencedBy); - cached.__importRef = cachedImportRef; - return cached; - } - const id = [path16.basename(path16.dirname(filename)), path16.basename(filename)].join("/"); - const name = ""; - const finalizeSettings = (0, CSpellSettingsInternalDef_js_1.createCSpellSettingsInternal)({ id, name, __importRef: importRef }); - this.cachedFiles.set(filename, finalizeSettings); - const settings = { ...defaultValues, id, name, ...this.readConfig(importRef) }; - Object.assign(finalizeSettings, this.normalizeSettings(settings, filename, pnpSettings)); - const finalizeSrc = { name: path16.basename(filename), ...finalizeSettings.source }; - finalizeSettings.source = { ...finalizeSrc, filename }; - this.cachedFiles.set(filename, finalizeSettings); - return finalizeSettings; } - /** - * normalizeSettings handles correcting all relative paths, anchoring globs, and importing other config files. - * @param rawSettings - raw configuration settings - * @param pathToSettingsFile - path to the source file of the configuration settings. - */ - normalizeSettings(rawSettings, pathToSettingsFile, pnpSettings) { - const id = rawSettings.id || [path16.basename(path16.dirname(pathToSettingsFile)), path16.basename(pathToSettingsFile)].join("/"); - const name = rawSettings.name || id; - const { usePnP = pnpSettings.usePnP, pnpFiles = pnpSettings.pnpFiles } = rawSettings; - const pnpSettingsToUse = (0, PnPSettings_js_1.normalizePnPSettings)({ usePnP, pnpFiles }); - const pathToSettingsDir = path16.dirname(pathToSettingsFile); - loadPnPSync(pnpSettingsToUse, (0, Uri_js_1.toUri)(pathToSettingsDir)); - const settings = { - version: defaultSettings_js_1.defaultSettings.version, - ...rawSettings, - id, - name, - globRoot: resolveGlobRoot(rawSettings, pathToSettingsFile), - languageSettings: (0, normalizeRawSettings_js_1.normalizeLanguageSettings)(rawSettings.languageSettings) - }; - const pathToSettings = path16.dirname(pathToSettingsFile); - const normalizedDictionaryDefs = (0, normalizeRawSettings_js_1.normalizeDictionaryDefs)(settings, pathToSettingsFile); - const normalizedSettingsGlobs = (0, normalizeRawSettings_js_1.normalizeSettingsGlobs)(settings, pathToSettingsFile); - const normalizedOverrides = (0, normalizeRawSettings_js_1.normalizeOverrides)(settings, pathToSettingsFile); - const normalizedReporters = (0, normalizeRawSettings_js_1.normalizeReporters)(settings, pathToSettingsFile); - const normalizedGitignoreRoot = (0, normalizeRawSettings_js_1.normalizeGitignoreRoot)(settings, pathToSettingsFile); - const normalizedCacheSettings = (0, normalizeRawSettings_js_1.normalizeCacheSettings)(settings, pathToSettingsDir); - const imports = typeof settings.import === "string" ? [settings.import] : settings.import || []; - const source = settings.source || { - name: settings.name, - filename: pathToSettingsFile - }; - const fileSettings = (0, CSpellSettingsInternalDef_js_1.createCSpellSettingsInternal)({ - ...settings, - source, - ...normalizedDictionaryDefs, - ...normalizedSettingsGlobs, - ...normalizedOverrides, - ...normalizedReporters, - ...normalizedGitignoreRoot, - ...normalizedCacheSettings - }); - if (!imports.length) { - return fileSettings; + var pre = m.pre; + var post = m.post.length ? expand(m.post, false) : [""]; + var N; + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length); + var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; } - const importedSettings = imports.map((name2) => resolveFilename2(name2, pathToSettings)).map((ref) => (ref.referencedBy = [source], ref)).map((ref) => this.importSettings(ref, void 0, pnpSettingsToUse)).reduce((a, b) => (0, CSpellSettingsServer_js_1.mergeSettings)(a, b)); - const finalizeSettings = (0, CSpellSettingsServer_js_1.mergeSettings)(importedSettings, fileSettings); - finalizeSettings.name = settings.name || finalizeSettings.name || ""; - finalizeSettings.id = settings.id || finalizeSettings.id || ""; - return finalizeSettings; - } - }; - exports.ConfigLoader = ConfigLoader; - var ConfigLoaderInternal = class extends ConfigLoader { - constructor(cspellIO) { - super(cspellIO); - this._readConfig = this.readConfig.bind(this); - this._normalizeSettings = this.normalizeSettings.bind(this); - } - get _cachedFiles() { - return this.cachedFiles; - } - get _cspellConfigExplorer() { - return this.cspellConfigExplorer; - } - get _cspellConfigExplorerSync() { - return this.cspellConfigExplorerSync; - } - async normalizeSearchForConfigResultAsync(searchPath, searchResult, pnpSettings) { - let result; - try { - result = await searchResult || void 0; - } catch (cause) { - result = new ImportError_js_1.ImportError(`Failed to find config file at: "${searchPath}"`, cause); - } - return this.normalizeSearchForConfigResult(searchPath, result, pnpSettings); - } - normalizeSearchForConfigResult(searchPath, searchResult, pnpSettings) { - const error2 = searchResult instanceof ImportError_js_1.ImportError ? searchResult : void 0; - const result = searchResult instanceof ImportError_js_1.ImportError ? void 0 : searchResult; - const filepath = result?.filepath; - if (filepath) { - const cached = cachedFiles().get(filepath); - if (cached) { - return { - config: cached, - filepath, - error: error2 - }; + var pad = n.some(isPadded); + N = []; + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === "\\") + c = ""; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join("0"); + if (i < 0) + c = "-" + z + c.slice(1); + else + c = z + c; + } + } } + N.push(c); } - const { config = (0, CSpellSettingsInternalDef_js_1.createCSpellSettingsInternal)({}) } = result || {}; - const filename = result?.filepath ?? searchPath; - const importRef = { filename, error: error2 }; - const id = [path16.basename(path16.dirname(filename)), path16.basename(filename)].join("/"); - const name = result?.filepath ? id : `Config not found: ${id}`; - const finalizeSettings = (0, CSpellSettingsInternalDef_js_1.createCSpellSettingsInternal)({ id, name, __importRef: importRef }); - const settings = { id, ...config }; - cachedFiles().set(filename, finalizeSettings); - Object.assign(finalizeSettings, this.normalizeSettings(settings, filename, pnpSettings)); - return { - config: finalizeSettings, - filepath, - error: error2 - }; + } else { + N = concatMap3(n, function(el) { + return expand(el, false); + }); } - }; - function mergeSourceList(orig, append) { - const collection = new Map(orig.map((s) => [s.name + (s.filename || ""), s])); - for (const s of append || []) { - const key = s.name + (s.filename || ""); - if (!collection.has(key)) { - collection.set(key, s); + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); } } - return [...collection.values()]; - } - function searchForConfig2(searchFrom, pnpSettings = PnPSettings_js_1.defaultPnPSettings) { - return gcl().searchForConfig(searchFrom, pnpSettings); + return expansions; } - exports.searchForConfig = searchForConfig2; - function searchForConfigSync(searchFrom, pnpSettings = PnPSettings_js_1.defaultPnPSettings) { - pnpSettings = (0, PnPSettings_js_1.normalizePnPSettings)(pnpSettings); - let searchResult; + } +}); + +// node_modules/minimatch/minimatch.js +var require_minimatch = __commonJS({ + "node_modules/minimatch/minimatch.js"(exports, module2) { + module2.exports = minimatch; + minimatch.Minimatch = Minimatch; + var path26 = function() { try { - searchResult = cspellConfigExplorerSync().search(searchFrom) || void 0; - } catch (err) { - searchResult = new ImportError_js_1.ImportError(`Failed to find config file from: "${searchFrom}"`, err); - } - return gcl().normalizeSearchForConfigResult(searchFrom || process.cwd(), searchResult, pnpSettings).config; - } - exports.searchForConfigSync = searchForConfigSync; - async function loadConfig2(file, pnpSettings = PnPSettings_js_1.defaultPnPSettings) { - return gcl().readSettingsAsync(file, void 0, pnpSettings); - } - exports.loadConfig = loadConfig2; - function loadConfigSync(filename, pnpSettings = PnPSettings_js_1.defaultPnPSettings) { - const pnp = (0, PnPSettings_js_1.normalizePnPSettings)(pnpSettings); - return gcl().readSettings(filename, pnp); - } - exports.loadConfigSync = loadConfigSync; - function loadPnP(pnpSettings, searchFrom) { - if (!pnpSettings.usePnP) { - return Promise.resolve(void 0); - } - const loader = (0, pnpLoader_js_1.pnpLoader)(pnpSettings.pnpFiles); - return loader.load(searchFrom); - } - exports.loadPnP = loadPnP; - function loadPnPSync(pnpSettings, searchFrom) { - if (!pnpSettings.usePnP) { - return void 0; + return require("path"); + } catch (e) { } - const loader = (0, pnpLoader_js_1.pnpLoader)(pnpSettings.pnpFiles); - return loader.loadSync(searchFrom); - } - exports.loadPnPSync = loadPnPSync; - function readRawSettings(filename, relativeTo) { - relativeTo = relativeTo || process.cwd(); - const ref = resolveFilename2(filename, relativeTo); - return gcl()._readConfig(ref); + }() || { + sep: "/" + }; + minimatch.sep = path26.sep; + var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; + var expand = require_brace_expansion(); + var plTypes = { + "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, + "?": { open: "(?:", close: ")?" }, + "+": { open: "(?:", close: ")+" }, + "*": { open: "(?:", close: ")*" }, + "@": { open: "(?:", close: ")" } + }; + var qmark = "[^/]"; + var star = qmark + "*?"; + var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; + var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; + var reSpecials = charSet("().*{}+?[]^$\\!"); + function charSet(s) { + return s.split("").reduce(function(set, c) { + set[c] = true; + return set; + }, {}); } - exports.readRawSettings = readRawSettings; - function resolveFilename2(filename, relativeTo) { - const r = (0, resolveFile_js_1.resolveFile)(filename, relativeTo); - return { - filename: r.filename, - error: r.found ? void 0 : new Error(`Failed to resolve file: "${filename}"`) + var slashSplit = /\/+/; + minimatch.filter = filter3; + function filter3(pattern, options) { + options = options || {}; + return function(p, i, list) { + return minimatch(p, pattern, options); }; } - function getGlobalSettings3() { - return gcl().getGlobalSettings(); - } - exports.getGlobalSettings = getGlobalSettings3; - function getCachedFileSize() { - return cachedFiles().size; - } - exports.getCachedFileSize = getCachedFileSize; - function clearCachedSettingsFiles() { - return gcl().clearCachedSettingsFiles(); - } - exports.clearCachedSettingsFiles = clearCachedSettingsFiles; - var nestedConfigDirectories = { - ".vscode": true, - ".config": true - }; - function resolveGlobRoot(settings, pathToSettingsFile) { - const settingsFileDirRaw = path16.dirname(pathToSettingsFile); - const settingsFileDirName = path16.basename(settingsFileDirRaw); - const isNestedConfig = settingsFileDirName in nestedConfigDirectories; - const isVSCode = settingsFileDirName === ".vscode"; - const settingsFileDir = isNestedConfig ? path16.dirname(settingsFileDirRaw) : settingsFileDirRaw; - const envGlobRoot = process.env[constants_js_1.ENV_CSPELL_GLOB_ROOT]; - const defaultGlobRoot = envGlobRoot ?? "${cwd}"; - const rawRoot = settings.globRoot ?? (settings.version === constants_js_1.configSettingsFileVersion0_1 || envGlobRoot && !settings.version || isVSCode && !settings.version ? defaultGlobRoot : settingsFileDir); - const globRoot = rawRoot.startsWith("${cwd}") ? rawRoot : path16.resolve(settingsFileDir, rawRoot); - return globRoot; - } - function validationMessage(msg, fileRef) { - return msg + ` - File: "${fileRef.filename}"`; - } - function validateRawConfigVersion(config, fileRef) { - const { version: version3 } = config; - if (version3 === void 0) - return; - if (typeof version3 !== "string") { - (0, logger_js_1.logError)(validationMessage(`Unsupported config file version: "${version3}", string expected`, fileRef)); - return; - } - if (setOfSupportedConfigVersions.has(version3)) - return; - if (!/^\d+(\.\d+)*$/.test(version3)) { - (0, logger_js_1.logError)(validationMessage(`Unsupported config file version: "${version3}"`, fileRef)); - return; - } - const msg = version3 > constants_js_1.currentSettingsFileVersion ? `Newer config file version found: "${version3}". Supported version is "${constants_js_1.currentSettingsFileVersion}"` : `Legacy config file version found: "${version3}", upgrade to "${constants_js_1.currentSettingsFileVersion}"`; - (0, logger_js_1.logWarning)(validationMessage(msg, fileRef)); + function ext(a, b) { + b = b || {}; + var t = {}; + Object.keys(a).forEach(function(k) { + t[k] = a[k]; + }); + Object.keys(b).forEach(function(k) { + t[k] = b[k]; + }); + return t; } - function validateRawConfigExports(config, fileRef) { - if (config.default) { - throw new ImportError_js_1.ImportError(validationMessage("Module `export default` is not supported.\n Use `module.exports =` instead.", fileRef)); + minimatch.defaults = function(def) { + if (!def || typeof def !== "object" || !Object.keys(def).length) { + return minimatch; } - } - function validateRawConfig(config, fileRef) { - const validations = [validateRawConfigExports, validateRawConfigVersion]; - validations.forEach((fn) => fn(config, fileRef)); - } - function createConfigLoaderInternal(cspellIO) { - return new ConfigLoaderInternal(cspellIO ?? (0, cspell_io_1.getDefaultCSpellIO)()); - } - function createConfigLoader(cspellIO) { - return createConfigLoaderInternal(cspellIO); - } - exports.createConfigLoader = createConfigLoader; - function getDefaultConfigLoaderInternal() { - if (defaultConfigLoader) - return defaultConfigLoader; - return defaultConfigLoader = createConfigLoaderInternal(); - } - function getDefaultConfigLoader() { - return getDefaultConfigLoaderInternal(); - } - exports.getDefaultConfigLoader = getDefaultConfigLoader; - function cachedFiles() { - return gcl()._cachedFiles; - } - function cspellConfigExplorerSync() { - return gcl()._cspellConfigExplorerSync; - } - exports.__testing__ = { - getDefaultConfigLoaderInternal, - normalizeCacheSettings: normalizeRawSettings_js_1.normalizeCacheSettings, - validateRawConfigExports, - validateRawConfigVersion + var orig = minimatch; + var m = function minimatch2(p, pattern, options) { + return orig(p, pattern, ext(def, options)); + }; + m.Minimatch = function Minimatch2(pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)); + }; + m.Minimatch.defaults = function defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + }; + m.filter = function filter4(pattern, options) { + return orig.filter(pattern, ext(def, options)); + }; + m.defaults = function defaults(options) { + return orig.defaults(ext(def, options)); + }; + m.makeRe = function makeRe2(pattern, options) { + return orig.makeRe(pattern, ext(def, options)); + }; + m.braceExpand = function braceExpand2(pattern, options) { + return orig.braceExpand(pattern, ext(def, options)); + }; + m.match = function(list, pattern, options) { + return orig.match(list, pattern, ext(def, options)); + }; + return m; }; - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/extractImportErrors.js -var require_extractImportErrors = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/extractImportErrors.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.extractImportErrors = void 0; - function extractImportErrors2(settings) { - const imports = mergeImportRefs(settings); - return !imports ? [] : [...imports.values()].filter(isImportFileRefWithError); - } - exports.extractImportErrors = extractImportErrors2; - function mergeImportRefs(left, right = {}) { - const imports = new Map(left.__imports || []); - if (left.__importRef) { - imports.set(left.__importRef.filename, left.__importRef); - } - if (right.__importRef) { - imports.set(right.__importRef.filename, right.__importRef); - } - const rightImports = right.__imports?.values() || []; - for (const ref of rightImports) { - imports.set(ref.filename, ref); + Minimatch.defaults = function(def) { + return minimatch.defaults(def).Minimatch; + }; + function minimatch(p, pattern, options) { + assertValidPattern(pattern); + if (!options) + options = {}; + if (!options.nocomment && pattern.charAt(0) === "#") { + return false; } - return imports.size ? imports : void 0; - } - function isImportFileRefWithError(ref) { - return !!ref.error; - } - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/readSettings.js -var require_readSettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/readSettings.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.readSettings = void 0; - var configLoader_js_1 = require_configLoader(); - function readSettings(filename, relativeToOrDefault, defaultValue) { - const loader = (0, configLoader_js_1.getDefaultConfigLoader)(); - if (typeof relativeToOrDefault !== "string" || defaultValue === void 0) - return loader.readSettings(filename, relativeToOrDefault); - return loader.readSettings(filename, relativeToOrDefault, defaultValue); - } - exports.readSettings = readSettings; - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/readSettingsFiles.js -var require_readSettingsFiles = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/readSettingsFiles.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.readSettingsFiles = void 0; - var CSpellSettingsServer_js_1 = require_CSpellSettingsServer(); - var defaultSettings_js_1 = require_defaultSettings(); - var readSettings_js_1 = require_readSettings(); - function readSettingsFiles(filenames) { - return filenames.map((filename) => (0, readSettings_js_1.readSettings)(filename)).reduce((a, b) => (0, CSpellSettingsServer_js_1.mergeSettings)(a, b), defaultSettings_js_1.defaultSettings); + return new Minimatch(pattern, options).match(p); } - exports.readSettingsFiles = readSettingsFiles; - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/index.js -var require_configLoader2 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/Controller/configLoader/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.readSettingsFiles = exports.readSettings = exports.extractImportErrors = exports.sectionCSpell = exports.searchForConfigSync = exports.searchForConfig = exports.readRawSettings = exports.loadPnPSync = exports.loadPnP = exports.loadConfigSync = exports.loadConfig = exports.getGlobalSettings = exports.getCachedFileSize = exports.defaultFileName = exports.defaultConfigFilenames = exports.createConfigLoader = exports.ConfigLoader = exports.clearCachedSettingsFiles = exports.__testing__ = void 0; - var configLoader_js_1 = require_configLoader(); - Object.defineProperty(exports, "__testing__", { enumerable: true, get: function() { - return configLoader_js_1.__testing__; - } }); - Object.defineProperty(exports, "clearCachedSettingsFiles", { enumerable: true, get: function() { - return configLoader_js_1.clearCachedSettingsFiles; - } }); - Object.defineProperty(exports, "ConfigLoader", { enumerable: true, get: function() { - return configLoader_js_1.ConfigLoader; - } }); - Object.defineProperty(exports, "createConfigLoader", { enumerable: true, get: function() { - return configLoader_js_1.createConfigLoader; - } }); - Object.defineProperty(exports, "defaultConfigFilenames", { enumerable: true, get: function() { - return configLoader_js_1.defaultConfigFilenames; - } }); - Object.defineProperty(exports, "defaultFileName", { enumerable: true, get: function() { - return configLoader_js_1.defaultFileName; - } }); - Object.defineProperty(exports, "getCachedFileSize", { enumerable: true, get: function() { - return configLoader_js_1.getCachedFileSize; - } }); - Object.defineProperty(exports, "getGlobalSettings", { enumerable: true, get: function() { - return configLoader_js_1.getGlobalSettings; - } }); - Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function() { - return configLoader_js_1.loadConfig; - } }); - Object.defineProperty(exports, "loadConfigSync", { enumerable: true, get: function() { - return configLoader_js_1.loadConfigSync; - } }); - Object.defineProperty(exports, "loadPnP", { enumerable: true, get: function() { - return configLoader_js_1.loadPnP; - } }); - Object.defineProperty(exports, "loadPnPSync", { enumerable: true, get: function() { - return configLoader_js_1.loadPnPSync; - } }); - Object.defineProperty(exports, "readRawSettings", { enumerable: true, get: function() { - return configLoader_js_1.readRawSettings; - } }); - Object.defineProperty(exports, "searchForConfig", { enumerable: true, get: function() { - return configLoader_js_1.searchForConfig; - } }); - Object.defineProperty(exports, "searchForConfigSync", { enumerable: true, get: function() { - return configLoader_js_1.searchForConfigSync; - } }); - Object.defineProperty(exports, "sectionCSpell", { enumerable: true, get: function() { - return configLoader_js_1.sectionCSpell; - } }); - var extractImportErrors_js_1 = require_extractImportErrors(); - Object.defineProperty(exports, "extractImportErrors", { enumerable: true, get: function() { - return extractImportErrors_js_1.extractImportErrors; - } }); - var readSettings_js_1 = require_readSettings(); - Object.defineProperty(exports, "readSettings", { enumerable: true, get: function() { - return readSettings_js_1.readSettings; - } }); - var readSettingsFiles_js_1 = require_readSettingsFiles(); - Object.defineProperty(exports, "readSettingsFiles", { enumerable: true, get: function() { - return readSettingsFiles_js_1.readSettingsFiles; - } }); - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/link.js -var require_link = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/link.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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]; - } }; + function Minimatch(pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options); } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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); + assertValidPattern(pattern); + if (!options) + options = {}; + pattern = pattern.trim(); + if (!options.allowWindowsEscape && path26.sep !== "/") { + pattern = pattern.split(path26.sep).join("/"); } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.removePathsFromGlobalImports = exports.addPathsToGlobalImports = exports.listGlobalImports = void 0; - var fs6 = __importStar(require("fs")); - var Path3 = __importStar(require("path")); - var util_js_1 = require_util(); - var index_js_1 = require_configLoader2(); - var GlobalSettings_js_1 = require_GlobalSettings(); - function listGlobalImports() { - const globalSettings = (0, GlobalSettings_js_1.getRawGlobalSettings)(); - const list = resolveImports(globalSettings).map(({ filename, settings, error: error2 }) => ({ - filename, - error: error2, - id: settings.id, - name: settings.name, - dictionaryDefinitions: settings.dictionaryDefinitions, - languageSettings: settings.languageSettings, - package: findPackageForCSpellConfig(Path3.dirname(filename)) - })); - return { - list, - globalSettings - }; - } - exports.listGlobalImports = listGlobalImports; - function isString2(s) { - return s !== void 0; + this.options = options; + this.set = []; + this.pattern = pattern; + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.make(); } - function addPathsToGlobalImports(paths) { - const resolvedSettings = paths.map(resolveSettings); - const hasError = resolvedSettings.filter((r) => !!r.error).length > 0; - if (hasError) { - return { - success: false, - resolvedSettings, - error: "Unable to resolve files." - }; + Minimatch.prototype.debug = function() { + }; + Minimatch.prototype.make = make; + function make() { + var pattern = this.pattern; + var options = this.options; + if (!options.nocomment && pattern.charAt(0) === "#") { + this.comment = true; + return; } - const rawGlobalSettings = (0, GlobalSettings_js_1.getRawGlobalSettings)(); - const resolvedImports = resolveImports(rawGlobalSettings); - const imports = new Set(resolvedImports.map((r) => r.resolvedToFilename || r.filename)); - resolvedSettings.map((s) => s.resolvedToFilename).filter(isString2).reduce((imports2, s) => imports2.add(s), imports); - const globalSettings = { - import: [...imports] - }; - const error2 = (0, GlobalSettings_js_1.writeRawGlobalSettings)(globalSettings); - return { - success: !error2, - error: error2?.message, - resolvedSettings - }; - } - exports.addPathsToGlobalImports = addPathsToGlobalImports; - function removePathsFromGlobalImports(paths) { - const listResult = listGlobalImports(); - const toRemove = /* @__PURE__ */ new Set(); - function matchPackage(pathToRemove) { - return ({ package: pkg, id }) => pathToRemove === pkg?.name || pathToRemove === id; + if (!pattern) { + this.empty = true; + return; } - function compareFilenames(fullPath, partialPath) { - if (fullPath === partialPath) - return true; - if (!fullPath.endsWith(partialPath)) - return false; - const c = fullPath[fullPath.length - partialPath.length - 1]; - return c === Path3.sep || c === Path3.posix.sep; - } - function matchFilename(pathToRemove) { - return Path3.dirname(pathToRemove) != "." ? ({ filename }) => compareFilenames(filename, pathToRemove) : () => false; - } - paths.map((a) => a.trim()).filter((a) => !!a).forEach((pathToRemove) => { - const excludePackage = matchPackage(pathToRemove); - const excludeFilename = matchFilename(pathToRemove); - const shouldExclude = (r) => excludePackage(r) || excludeFilename(r); - for (const r of listResult.list) { - if (shouldExclude(r)) { - toRemove.add(r.filename); - } - } + this.parseNegate(); + var set = this.globSet = this.braceExpand(); + if (options.debug) + this.debug = function debug() { + console.error.apply(console, arguments); + }; + this.debug(this.pattern, set); + set = this.globParts = set.map(function(s) { + return s.split(slashSplit); }); - const toImport = normalizeImports(listResult.globalSettings.import).filter((p) => !toRemove.has(p)); - const updatedSettings = { - import: toImport - }; - const error2 = toRemove.size > 0 ? (0, GlobalSettings_js_1.writeRawGlobalSettings)(updatedSettings) : void 0; - return { - success: true, - removed: [...toRemove], - error: error2?.toString() - }; - } - exports.removePathsFromGlobalImports = removePathsFromGlobalImports; - function resolveSettings(filename) { - const settings = (0, index_js_1.readRawSettings)(filename); - const ref = settings.__importRef; - const resolvedToFilename = ref?.filename; - const error2 = ref?.error?.message || !resolvedToFilename && "File not Found" || void 0; - return (0, util_js_1.clean)({ - filename, - resolvedToFilename, - error: error2, - settings + this.debug(this.pattern, set); + set = set.map(function(s, si, set2) { + return s.map(this.parse, this); + }, this); + this.debug(this.pattern, set); + set = set.filter(function(s) { + return s.indexOf(false) === -1; }); + this.debug(this.pattern, set); + this.set = set; } - function normalizeImports(imports) { - return typeof imports === "string" ? [imports] : imports || []; - } - function resolveImports(s) { - const imported = normalizeImports(s.import); - return imported.map(resolveSettings); - } - function findPackageForCSpellConfig(pathToConfig) { - try { - const filename = Path3.join(pathToConfig, "package.json"); - const pkg = JSON.parse(fs6.readFileSync(filename, "utf8")); - return { - filename, - name: pkg["name"] - }; - } catch (e) { - return void 0; + Minimatch.prototype.parseNegate = parseNegate; + function parseNegate() { + var pattern = this.pattern; + var negate = false; + var options = this.options; + var negateOffset = 0; + if (options.nonegate) + return; + for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) { + negate = !negate; + negateOffset++; } + if (negateOffset) + this.pattern = pattern.substr(negateOffset); + this.negate = negate; } - exports.__testing__ = { - findPackageForCSpellConfig + minimatch.braceExpand = function(pattern, options) { + return braceExpand(pattern, options); }; - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/index.link.js -var require_index_link = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/index.link.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.removePathsFromGlobalImports = exports.listGlobalImports = exports.addPathsToGlobalImports = void 0; - var link_js_1 = require_link(); - Object.defineProperty(exports, "addPathsToGlobalImports", { enumerable: true, get: function() { - return link_js_1.addPathsToGlobalImports; - } }); - Object.defineProperty(exports, "listGlobalImports", { enumerable: true, get: function() { - return link_js_1.listGlobalImports; - } }); - Object.defineProperty(exports, "removePathsFromGlobalImports", { enumerable: true, get: function() { - return link_js_1.removePathsFromGlobalImports; - } }); - } -}); - -// node_modules/cspell-lib/dist/cjs/util/search.js -var require_search = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/search.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.binarySearch = void 0; - function binarySearch(arr, item, leftOffset, rightOffset) { - let left = Math.max(leftOffset ?? 0, 0); - let right = Math.min(rightOffset ?? arr.length, arr.length); - while (left < right) { - const pos = left + right >> 1; - if (arr[pos] < item) { - left = pos + 1; + Minimatch.prototype.braceExpand = braceExpand; + function braceExpand(pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options; } else { - right = pos; + options = {}; } } - return left; - } - exports.binarySearch = binarySearch; - } -}); - -// node_modules/cspell-lib/dist/cjs/util/text.js -var require_text2 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/text.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.removeAccents = exports.calculateTextDocumentOffsets = exports.extractText = exports.textOffset = exports.matchCase = exports.camelToSnake = exports.snakeToCamel = exports.lcFirst = exports.ucFirst = exports.isFirstCharacterLower = exports.isFirstCharacterUpper = exports.isLowerCase = exports.isUpperCase = exports.extractWordsFromCodeTextOffset = exports.extractWordsFromCode = exports.extractPossibleWordsFromTextOffset = exports.cleanTextOffset = exports.cleanText = exports.extractWordsFromTextOffset = exports.extractWordsFromText = exports.extractLinesOfText = exports.matchToTextOffset = exports.matchStringToTextOffset = exports.match = exports.splitCamelCaseWord = exports.splitCamelCaseWordWithOffset = exports.stringToRegExp = void 0; - var sync_1 = require_sync(); - var gensequence_1 = require_dist2(); - var search_js_1 = require_search(); - var textRegex_js_1 = require_textRegex(); - var Uri_js_1 = require_Uri(); - var util_js_1 = require_util(); - var textRegex_js_2 = require_textRegex(); - Object.defineProperty(exports, "stringToRegExp", { enumerable: true, get: function() { - return textRegex_js_2.stringToRegExp; - } }); - function splitCamelCaseWordWithOffset(wo) { - return splitCamelCaseWord(wo.text).map((0, util_js_1.scanMap)((last, text) => ({ text, offset: last.offset + last.text.length }), { - text: "", - offset: wo.offset - })); - } - exports.splitCamelCaseWordWithOffset = splitCamelCaseWordWithOffset; - function splitCamelCaseWord(word) { - const wPrime = word.replace(textRegex_js_1.regExUpperSOrIng, (s) => s[0] + s.slice(1).toLowerCase()); - const separator = "_<^*_*^>_"; - const pass1 = wPrime.replace(textRegex_js_1.regExSplitWords, "$1" + separator + "$2"); - const pass2 = pass1.replace(textRegex_js_1.regExSplitWords2, "$1" + separator + "$2"); - return pass2.split(separator); - } - exports.splitCamelCaseWord = splitCamelCaseWord; - function match(reg, text) { - return (0, gensequence_1.sequenceFromRegExpMatch)(reg, text); - } - exports.match = match; - function matchStringToTextOffset(reg, text) { - return matchToTextOffset(reg, { text, offset: 0 }); - } - exports.matchStringToTextOffset = matchStringToTextOffset; - function matchToTextOffset(reg, text) { - const textOffset2 = text; - const fnOffsetMap = offsetMap(textOffset2.offset); - textOffset2.text.matchAll(reg); - return (0, sync_1.pipe)(match(reg, textOffset2.text), (0, sync_1.opMap)((m) => fnOffsetMap({ text: m[0], offset: m.index || 0 }))); - } - exports.matchToTextOffset = matchToTextOffset; - function* extractLinesOfText(text) { - let i = 0; - for (let j = text.indexOf("\n", i); j >= 0; j = text.indexOf("\n", i)) { - const end = j + 1; - yield { text: text.slice(i, end), offset: i }; - i = end; + pattern = typeof pattern === "undefined" ? this.pattern : pattern; + assertValidPattern(pattern); + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + return [pattern]; } - yield { text: text.slice(i, text.length), offset: i }; - } - exports.extractLinesOfText = extractLinesOfText; - function extractWordsFromText(text) { - return extractWordsFromTextOffset(textOffset(text)); - } - exports.extractWordsFromText = extractWordsFromText; - function extractWordsFromTextOffset(text) { - const reg = new RegExp(textRegex_js_1.regExWords); - return matchToTextOffset(reg, cleanTextOffset(text)); - } - exports.extractWordsFromTextOffset = extractWordsFromTextOffset; - function cleanText(text) { - text = text.replace(textRegex_js_1.regExIgnoreCharacters, (match2) => " ".repeat(match2.length)); - return text; - } - exports.cleanText = cleanText; - function cleanTextOffset(text) { - return { - text: cleanText(text.text), - offset: text.offset - }; - } - exports.cleanTextOffset = cleanTextOffset; - function extractPossibleWordsFromTextOffset(text) { - const reg = new RegExp(textRegex_js_1.regExWordsAndDigits); - return matchToTextOffset(reg, text); - } - exports.extractPossibleWordsFromTextOffset = extractPossibleWordsFromTextOffset; - function extractWordsFromCode(text) { - return extractWordsFromCodeTextOffset(textOffset(text)); - } - exports.extractWordsFromCode = extractWordsFromCode; - function extractWordsFromCodeTextOffset(textOffset2) { - return (0, sync_1.pipe)(extractWordsFromTextOffset(textOffset2), (0, sync_1.opConcatMap)(splitCamelCaseWordWithOffset)); - } - exports.extractWordsFromCodeTextOffset = extractWordsFromCodeTextOffset; - function isUpperCase(word) { - return !!word.match(textRegex_js_1.regExAllUpper); - } - exports.isUpperCase = isUpperCase; - function isLowerCase(word) { - return !!word.match(textRegex_js_1.regExAllLower); - } - exports.isLowerCase = isLowerCase; - function isFirstCharacterUpper(word) { - return isUpperCase(word.slice(0, 1)); - } - exports.isFirstCharacterUpper = isFirstCharacterUpper; - function isFirstCharacterLower(word) { - return isLowerCase(word.slice(0, 1)); - } - exports.isFirstCharacterLower = isFirstCharacterLower; - function ucFirst(word) { - return word.slice(0, 1).toUpperCase() + word.slice(1); - } - exports.ucFirst = ucFirst; - function lcFirst(word) { - return word.slice(0, 1).toLowerCase() + word.slice(1); - } - exports.lcFirst = lcFirst; - function snakeToCamel(word) { - return word.split("_").map(ucFirst).join(""); - } - exports.snakeToCamel = snakeToCamel; - function camelToSnake(word) { - return splitCamelCaseWord(word).join("_").toLowerCase(); + return expand(pattern); } - exports.camelToSnake = camelToSnake; - function matchCase(example, word) { - if (example.match(textRegex_js_1.regExFirstUpper)) { - return word.slice(0, 1).toUpperCase() + word.slice(1).toLowerCase(); - } - if (example.match(textRegex_js_1.regExAllLower)) { - return word.toLowerCase(); - } - if (example.match(textRegex_js_1.regExAllUpper)) { - return word.toUpperCase(); - } - if (isFirstCharacterUpper(example)) { - return ucFirst(word); - } - if (isFirstCharacterLower(example)) { - return lcFirst(word); + var MAX_PATTERN_LENGTH = 1024 * 64; + var assertValidPattern = function(pattern) { + if (typeof pattern !== "string") { + throw new TypeError("invalid pattern"); } - return word; - } - exports.matchCase = matchCase; - function textOffset(text, offset = 0) { - return { text, offset }; - } - exports.textOffset = textOffset; - function extractText(textOffset2, startPos, endPos) { - const { text, offset: orig } = textOffset2; - const a = Math.max(startPos - orig, 0); - const b = Math.max(endPos - orig, 0); - return text.slice(a, b); - } - exports.extractText = extractText; - function offsetMap(offset) { - return (xo) => ({ ...xo, offset: xo.offset + offset }); - } - function calculateTextDocumentOffsets(uri, doc, wordOffsets) { - const lines = [ - -1, - ...(0, sync_1.pipe)(match(/\n/g, doc), (0, sync_1.opMap)((a) => a.index)), - doc.length - ]; - let lastRow = -1; - let lastOffset = doc.length + 1; - let lastLineRow = -1; - let lastLine; - function findRowCol(offset) { - const row = (0, search_js_1.binarySearch)(lines, offset, offset >= lastOffset ? lastRow : void 0); - const col = offset - lines[Math.max(0, row - 1)]; - lastOffset = offset; - lastRow = row; - return [row, col]; - } - function extractLine(row) { - const offset = lines[row - 1] + 1; - const text = doc.slice(offset, lines[row] + 1); - return { text, offset }; - } - function calcLine(row) { - const last = lastLineRow === row ? lastLine : void 0; - lastLineRow = row; - const r = last ?? extractLine(row); - lastLine = r; - return r; + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError("pattern is too long"); } - const _uri = (0, Uri_js_1.toUri)(uri).toString(); - return wordOffsets.map((wo) => { - const [row, col] = findRowCol(wo.offset); - return { ...wo, row, col, doc, uri: _uri, line: calcLine(row) }; - }); - } - exports.calculateTextDocumentOffsets = calculateTextDocumentOffsets; - function removeAccents(text) { - return text.normalize("NFD").replace(textRegex_js_1.regExAccents, ""); - } - exports.removeAccents = removeAccents; - exports.__testing__ = { - regExWords: textRegex_js_1.regExWords, - regExWordsAndDigits: textRegex_js_1.regExWordsAndDigits }; - } -}); - -// node_modules/cspell-lib/dist/cjs/LanguageIds.js -var require_LanguageIds = __commonJS({ - "node_modules/cspell-lib/dist/cjs/LanguageIds.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getLanguagesForBasename = exports.getLanguagesForExt = exports.buildLanguageExtensionMapSet = exports.isGenerated = exports.isGeneratedFile = exports.isGeneratedExt = exports.isBinary = exports.isBinaryFile = exports.isBinaryExt = exports.languageIds = exports.generatedFiles = exports.binaryLanguages = exports.languageExtensionDefinitions = void 0; - var AutoResolve_js_1 = require_AutoResolve(); - exports.languageExtensionDefinitions = [ - { id: "ada", extensions: [".adb", ".ads"] }, - { id: "apiblueprint", extensions: [".apib", ".apiblueprint"] }, - { id: "asciidoc", extensions: [".adoc", ".asc", ".asciidoc"] }, - { id: "bat", extensions: [".bat", ".cmd"] }, - { id: "clojure", extensions: [".clj", ".cljs", ".cljx", ".clojure", ".edn"] }, - { id: "coffeescript", extensions: [".coffee", ".cson"] }, - { id: "c", extensions: [".c"] }, - // cspell:ignore cmake - { id: "cmake", extensions: [".cmake"], filenames: ["CMakeLists.txt"] }, - { - id: "cpp", - extensions: [".cpp", ".cc", ".cxx", ".hpp", ".hh", ".hxx", ".h", ".mm", ".ino", ".inl"] - }, - { id: "csharp", extensions: [".cs"] }, - { id: "css", extensions: [".css"] }, - { id: "dhall", extensions: [".dhall"] }, - { id: "diff", extensions: [".diff", ".patch", ".rej"] }, - { id: "dockerfile", extensions: [".dockerfile"], filenames: ["Dockerfile"] }, - { id: "elixir", extensions: [".ex", ".exs"] }, - { id: "fsharp", extensions: [".fs", ".fsi", ".fsx", ".fsscript"] }, - { id: "go", extensions: [".go"] }, - { id: "groovy", extensions: [".groovy", ".gvy", ".gradle"] }, - { id: "handlebars", extensions: [".handlebars", ".hbs"] }, - { id: "haskell", extensions: [".hs", ".lhs"] }, - { - id: "html", - extensions: [".html", ".htm", ".shtml", ".xhtml", ".mdoc", ".jsp", ".asp", ".aspx", ".jshtm", ".volt", ".vue"] - }, - { id: "ini", extensions: [".ini", ".conf"] }, - { id: "properties", extensions: [".properties", ".gitconfig", ".cfg", ".conf"] }, - { id: "jade", extensions: [".jade", ".pug"] }, - { id: "java", extensions: [".java", ".jav"] }, - { id: "javascriptreact", extensions: [".jsx"] }, - { id: "javascript", extensions: [".js", ".mjs", ".es6", ".cjs"] }, - { - id: "json", - extensions: [".json", ".jsonc", ".bowerrc", ".jshintrc", ".jscsrc", ".eslintrc", ".babelrc", ".webmanifest"] - }, - { id: "jsonc", extensions: [".jsonc"] }, - { id: "jsonc", extensions: [".code-workspace"], filenames: [".code-workspace"] }, - { id: "jungle", extensions: [".jungle"] }, - { id: "less", extensions: [".less"] }, - { id: "literate haskell", extensions: [".lhs"] }, - { id: "lua", extensions: [".lua"] }, - { id: "makefile", extensions: [".mk"] }, - { id: "markdown", extensions: [".md", ".mdown", ".markdown", ".markdn"] }, - { id: "mdx", extensions: [".mdx"] }, - { id: "monkeyc", extensions: [".mc", ".mb"] }, - { id: "objective-c", extensions: [".m"] }, - { id: "perl", extensions: [".pl", ".pm", ".pod", ".t", ".PL", ".psgi"] }, - { id: "perl6", extensions: [".p6", ".pl6", ".pm6", ".nqp"] }, - { id: "php", extensions: [".php", ".php4", ".php5", ".phtml", ".ctp"] }, - { id: "plaintext", extensions: [".txt"] }, - { id: "powershell", extensions: [".ps1", ".psm1", ".psd1", ".pssc", ".psrc"] }, - { id: "purescript", extensions: [".purs"] }, - { id: "python", extensions: [".py", ".rpy", ".pyw", ".cpy", ".gyp", ".gypi"] }, - { id: "r", extensions: [".r", ".R", ".rhistory", ".rprofile", ".rt"] }, - { id: "razor", extensions: [".cshtml"] }, - { id: "ruby", extensions: [".rb", ".rbx", ".rjs", ".gemspec", ".rake", ".ru"] }, - { id: "ruby", extensions: [], filenames: ["Gemfile"] }, - { id: "rust", extensions: [".rs"] }, - { id: "scala", extensions: [".scala", ".sc", ".sbt"] }, - { id: "scss", extensions: [".scss"] }, - { id: "shaderlab", extensions: [".shader", ".cginc"] }, - { - id: "shellscript", - extensions: [ - ".sh", - ".bash", - ".bashrc", - ".bash_aliases", - ".bash_profile", - ".bash_login", - ".ebuild", - ".install", - ".profile", - ".bash_logout", - ".zsh", - ".zshrc", - ".zprofile", - ".zlogin", - ".zlogout", - ".zshenv", - ".zsh-theme" - ] - }, - { id: "sql", extensions: [".sql", ".dsql"] }, - { id: "svelte", extensions: [".svelte"] }, - { id: "swift", extensions: [".swift"] }, - { id: "toml", extensions: [".toml"] }, - { id: "typescript", extensions: [".ts", ".cts", ".mts"] }, - { id: "typescriptreact", extensions: [".tsx"] }, - { id: "vb", extensions: [".vb", ".brs", ".vbs", ".bas"] }, - { id: "vue", extensions: [".vue"] }, - { - id: "xml", - extensions: [ - ".ascx", - ".atom", - ".axml", - ".bpmn", - ".config", - ".cpt", - ".csl", - ".csproj.user", - ".csproj", - ".dita", - ".ditamap", - ".dtd", - ".dtml", - ".ent", - ".fsproj", - ".fxml", - ".iml", - ".isml", - ".jmx", - ".launch", - ".menu", - ".mod", - ".mxml", - ".nuspec", - ".opml", - ".owl", - ".proj", - ".pt", - ".pubxml.user", - ".pubxml", - ".rdf", - ".rng", - ".rss", - ".shproj", - ".storyboard", - ".svg", - ".targets", - ".tld", - ".tmx", - ".vbproj.user", - ".vbproj", - ".vcxproj.filters", - ".vcxproj", - ".wsdl", - ".wxi", - ".wxl", - ".wxs", - ".xaml", - ".xbl", - ".xib", - ".xlf", - ".xliff", - ".xml", - ".xoml", - ".xpdl", - ".xsd", - ".xul" - ] - }, - { id: "wheel", extensions: [".whl"], format: "Binary" }, - { id: "xsl", extensions: [".xsl", ".xslt"] }, - { id: "yaml", extensions: [".eyaml", ".eyml", ".yaml", ".yml"] }, - { id: "latex", extensions: [".tex"] }, - { id: "map", extensions: [".map"] }, - { id: "pdf", extensions: [".pdf"] }, - { id: "rsa", extensions: [".pub"], filenames: ["id_rsa", "id_rsa.pub"] }, - { id: "pem", extensions: [".private-key.pem", ".pem"] }, - { id: "pem-private-key", extensions: [".private-key.pem"] }, - // - // Special file types used to prevent spell checking. - // - { - id: "image", - extensions: [ - ".bmp", - ".exr", - ".gif", - ".ico", - ".jpeg", - ".jpg", - ".pbm", - ".pgm", - ".png", - ".ppm", - ".ras", - ".sgi", - ".tiff", - ".webp", - ".xbm" - ], - format: "Binary", - description: "Some image extensions" - }, - // cspell:ignore woff - { - id: "binary", - extensions: [".gz", ".exe", ".dll", ".lib", ".obj", ".o", ".eot", ".cur", ".zip"], - format: "Binary" - }, - { - id: "fonts", - extensions: [".ttf", ".woff", ".woff2"], - format: "Binary" - }, - { - id: "video", - extensions: [".mov", ".mpg"], - format: "Binary" - }, - { - id: "lock", - extensions: [".lock"], - filenames: ["package-lock.json"] - }, - { - id: "cache_files", - extensions: [], - // cspell:ignore eslintcache - filenames: [".cspellcache", ".DS_Store", ".eslintcache"] - }, - { id: "dll", extensions: [".dll"], format: "Binary" }, - { id: "exe", extensions: [".exe"], format: "Binary" }, - { id: "object-file", extensions: [".o", ".obj"], format: "Binary" }, - { id: "jar", extensions: [".jar"], format: "Binary" }, - { id: "spv", extensions: [".spv"], format: "Binary", description: "SPSS Output Document" }, - { id: "mdb", extensions: [".mdb"], format: "Binary", description: "Microsoft Access DB" }, - { id: "webm", extensions: [".webm"], format: "Binary", description: "WebM is an audiovisual media file format." }, - { id: "trie", extensions: [".trie"], format: "Binary", description: "CSpell dictionary file." } - ]; - var binaryFormatIds = exports.languageExtensionDefinitions.filter((d) => d.format === "Binary").map((d) => d.id); - exports.binaryLanguages = new Set(["binary", "image", "video", "fonts"].concat(binaryFormatIds)); - exports.generatedFiles = /* @__PURE__ */ new Set([...exports.binaryLanguages, "map", "lock", "pdf", "cache_files", "rsa", "pem", "trie"]); - exports.languageIds = exports.languageExtensionDefinitions.map(({ id }) => id); - var mapExtensionToSetOfLanguageIds = buildLanguageExtensionMapSet(exports.languageExtensionDefinitions); - var mapExtensionToLanguageIds = buildExtensionToLanguageIdMap(mapExtensionToSetOfLanguageIds); - function isBinaryExt(ext) { - return isBinary(getLanguagesForExt(ext)); - } - exports.isBinaryExt = isBinaryExt; - function isBinaryFile3(basename3) { - return isBinary(getLanguagesForBasename(basename3)); - } - exports.isBinaryFile = isBinaryFile3; - function isBinary(languageId) { - return doesSetContainAnyOf(exports.binaryLanguages, languageId); - } - exports.isBinary = isBinary; - function isGeneratedExt(ext) { - return isGenerated(getLanguagesForExt(ext)); - } - exports.isGeneratedExt = isGeneratedExt; - function isGeneratedFile(basename3) { - return isGenerated(getLanguagesForBasename(basename3)); - } - exports.isGeneratedFile = isGeneratedFile; - function isGenerated(languageId) { - return doesSetContainAnyOf(exports.generatedFiles, languageId); - } - exports.isGenerated = isGenerated; - function doesSetContainAnyOf(setOfIds, languageId) { - if (typeof languageId === "string") { - return setOfIds.has(languageId); - } - for (const id of languageId) { - if (setOfIds.has(id)) { - return true; - } - } - return false; - } - function buildLanguageExtensionMapSet(defs) { - return defs.reduce((map, def) => { - function addId(value) { - (0, AutoResolve_js_1.autoResolve)(map, value, () => /* @__PURE__ */ new Set()).add(def.id); - } - def.extensions.forEach(addId); - def.filenames?.forEach(addId); - return map; - }, /* @__PURE__ */ new Map()); - } - exports.buildLanguageExtensionMapSet = buildLanguageExtensionMapSet; - function buildExtensionToLanguageIdMap(map) { - return new Map([...map].map(([k, s]) => [k, [...s]])); - } - function _getLanguagesForExt(ext) { - return mapExtensionToLanguageIds.get(ext) || mapExtensionToLanguageIds.get("." + ext); - } - function getLanguagesForExt(ext) { - return _getLanguagesForExt(ext) || _getLanguagesForExt(ext.toLowerCase()) || []; - } - exports.getLanguagesForExt = getLanguagesForExt; - function _getLanguagesForBasename(basename3) { - const found = mapExtensionToLanguageIds.get(basename3); - if (found) - return found; - for (let pos = basename3.indexOf("."); pos >= 0; pos = basename3.indexOf(".", pos + 1)) { - const ids = mapExtensionToLanguageIds.get(basename3.slice(pos)); - if (ids) - return ids; + Minimatch.prototype.parse = parse4; + var SUBPARSE = {}; + function parse4(pattern, isSub) { + assertValidPattern(pattern); + var options = this.options; + if (pattern === "**") { + if (!options.noglobstar) + return GLOBSTAR; + else + pattern = "*"; } - return void 0; - } - function getLanguagesForBasename(basename3) { - return _getLanguagesForBasename(basename3) || _getLanguagesForBasename(basename3.toLowerCase()) || []; - } - exports.getLanguagesForBasename = getLanguagesForBasename; - } -}); - -// node_modules/cspell-lib/dist/cjs/Document/normalizeLanguageIds.js -var require_normalizeLanguageIds = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Document/normalizeLanguageIds.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.normalizeLanguageIds = void 0; - function normalizeLanguageIds(languageId) { - return (Array.isArray(languageId) ? languageId.join(",") : languageId).split(",").map((s) => s.trim()); - } - exports.normalizeLanguageIds = normalizeLanguageIds; - } -}); - -// node_modules/cspell-lib/dist/cjs/Document/isBinaryDoc.js -var require_isBinaryDoc = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Document/isBinaryDoc.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isBinaryFile = exports.isBinaryDoc = void 0; - var LanguageIds_js_1 = require_LanguageIds(); - var Uri_js_1 = require_Uri(); - var normalizeLanguageIds_js_1 = require_normalizeLanguageIds(); - function isBinaryDoc(document) { - return isBinaryFile3((0, Uri_js_1.toUri)(document.uri), document.languageId); - } - exports.isBinaryDoc = isBinaryDoc; - function isBinaryFile3(filename, languageId) { - const filenameUri = (0, Uri_js_1.toUri)(filename); - if (languageId) { - const ids = (0, normalizeLanguageIds_js_1.normalizeLanguageIds)(languageId); - if (ids.length) - return (0, LanguageIds_js_1.isGenerated)(ids); - } - const file = (0, Uri_js_1.basename)(filenameUri); - return (0, LanguageIds_js_1.isGeneratedFile)(file); - } - exports.isBinaryFile = isBinaryFile3; - } -}); - -// node_modules/vscode-languageserver-textdocument/lib/umd/main.js -var require_main = __commonJS({ - "node_modules/vscode-languageserver-textdocument/lib/umd/main.js"(exports, module2) { - var __spreadArray = exports && exports.__spreadArray || function(to, from, pack) { - if (pack || arguments.length === 2) - for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) - ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; + if (pattern === "") + return ""; + var re = ""; + var hasMagic = !!options.nocase; + var escaping = false; + var patternListStack = []; + var negativeLists = []; + var stateChar; + var inClass = false; + var reClassStart = -1; + var classStart = -1; + var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)"; + var self = this; + function clearStateChar() { + if (stateChar) { + switch (stateChar) { + case "*": + re += star; + hasMagic = true; + break; + case "?": + re += qmark; + hasMagic = true; + break; + default: + re += "\\" + stateChar; + break; } + self.debug("clearStateChar %j %j", stateChar, re); + stateChar = false; } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - (function(factory) { - if (typeof module2 === "object" && typeof module2.exports === "object") { - var v = factory(require, exports); - if (v !== void 0) - module2.exports = v; - } else if (typeof define === "function" && define.amd) { - define(["require", "exports"], factory); } - })(function(require2, exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.TextDocument = void 0; - var FullTextDocument = ( - /** @class */ - function() { - function FullTextDocument2(uri, languageId, version3, content) { - this._uri = uri; - this._languageId = languageId; - this._version = version3; - this._content = content; - this._lineOffsets = void 0; + for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) { + this.debug("%s %s %s %j", pattern, i, re, c); + if (escaping && reSpecials[c]) { + re += "\\" + c; + escaping = false; + continue; + } + switch (c) { + case "/": { + return false; } - Object.defineProperty(FullTextDocument2.prototype, "uri", { - get: function() { - return this._uri; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(FullTextDocument2.prototype, "languageId", { - get: function() { - return this._languageId; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(FullTextDocument2.prototype, "version", { - get: function() { - return this._version; - }, - enumerable: false, - configurable: true - }); - FullTextDocument2.prototype.getText = function(range) { - if (range) { - var start = this.offsetAt(range.start); - var end = this.offsetAt(range.end); - return this._content.substring(start, end); + case "\\": + clearStateChar(); + escaping = true; + continue; + case "?": + case "*": + case "+": + case "@": + case "!": + this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c); + if (inClass) { + this.debug(" in class"); + if (c === "!" && i === classStart + 1) + c = "^"; + re += c; + continue; } - return this._content; - }; - FullTextDocument2.prototype.update = function(changes, version3) { - for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) { - var change = changes_1[_i]; - if (FullTextDocument2.isIncremental(change)) { - var range = getWellformedRange(change.range); - var startOffset = this.offsetAt(range.start); - var endOffset = this.offsetAt(range.end); - this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length); - var startLine = Math.max(range.start.line, 0); - var endLine = Math.max(range.end.line, 0); - var lineOffsets = this._lineOffsets; - var addedLineOffsets = computeLineOffsets(change.text, false, startOffset); - if (endLine - startLine === addedLineOffsets.length) { - for (var i = 0, len = addedLineOffsets.length; i < len; i++) { - lineOffsets[i + startLine + 1] = addedLineOffsets[i]; - } - } else { - if (addedLineOffsets.length < 1e4) { - lineOffsets.splice.apply(lineOffsets, __spreadArray([startLine + 1, endLine - startLine], addedLineOffsets, false)); - } else { - this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1)); - } - } - var diff = change.text.length - (endOffset - startOffset); - if (diff !== 0) { - for (var i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) { - lineOffsets[i] = lineOffsets[i] + diff; - } - } - } else if (FullTextDocument2.isFull(change)) { - this._content = change.text; - this._lineOffsets = void 0; - } else { - throw new Error("Unknown change event received"); - } + self.debug("call clearStateChar %j", stateChar); + clearStateChar(); + stateChar = c; + if (options.noext) + clearStateChar(); + continue; + case "(": + if (inClass) { + re += "("; + continue; } - this._version = version3; - }; - FullTextDocument2.prototype.getLineOffsets = function() { - if (this._lineOffsets === void 0) { - this._lineOffsets = computeLineOffsets(this._content, true); + if (!stateChar) { + re += "\\("; + continue; } - return this._lineOffsets; - }; - FullTextDocument2.prototype.positionAt = function(offset) { - offset = Math.max(Math.min(offset, this._content.length), 0); - var lineOffsets = this.getLineOffsets(); - var low = 0, high = lineOffsets.length; - if (high === 0) { - return { line: 0, character: offset }; + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }); + re += stateChar === "!" ? "(?:(?!(?:" : "(?:"; + this.debug("plType %j %j", stateChar, re); + stateChar = false; + continue; + case ")": + if (inClass || !patternListStack.length) { + re += "\\)"; + continue; } - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (lineOffsets[mid] > offset) { - high = mid; - } else { - low = mid + 1; - } + clearStateChar(); + hasMagic = true; + var pl = patternListStack.pop(); + re += pl.close; + if (pl.type === "!") { + negativeLists.push(pl); } - var line = low - 1; - return { line, character: offset - lineOffsets[line] }; - }; - FullTextDocument2.prototype.offsetAt = function(position) { - var lineOffsets = this.getLineOffsets(); - if (position.line >= lineOffsets.length) { - return this._content.length; - } else if (position.line < 0) { - return 0; + pl.reEnd = re.length; + continue; + case "|": + if (inClass || !patternListStack.length || escaping) { + re += "\\|"; + escaping = false; + continue; } - var lineOffset = lineOffsets[position.line]; - var nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length; - return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); - }; - Object.defineProperty(FullTextDocument2.prototype, "lineCount", { - get: function() { - return this.getLineOffsets().length; - }, - enumerable: false, - configurable: true - }); - FullTextDocument2.isIncremental = function(event) { - var candidate = event; - return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range !== void 0 && (candidate.rangeLength === void 0 || typeof candidate.rangeLength === "number"); - }; - FullTextDocument2.isFull = function(event) { - var candidate = event; - return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range === void 0 && candidate.rangeLength === void 0; - }; - return FullTextDocument2; - }() - ); - var TextDocument; - (function(TextDocument2) { - function create(uri, languageId, version3, content) { - return new FullTextDocument(uri, languageId, version3, content); - } - TextDocument2.create = create; - function update(document, changes, version3) { - if (document instanceof FullTextDocument) { - document.update(changes, version3); - return document; - } else { - throw new Error("TextDocument.update: document must be created by TextDocument.create"); - } - } - TextDocument2.update = update; - function applyEdits(document, edits) { - var text = document.getText(); - var sortedEdits = mergeSort(edits.map(getWellformedEdit), function(a, b) { - var diff = a.range.start.line - b.range.start.line; - if (diff === 0) { - return a.range.start.character - b.range.start.character; + clearStateChar(); + re += "|"; + continue; + case "[": + clearStateChar(); + if (inClass) { + re += "\\" + c; + continue; } - return diff; - }); - var lastModifiedOffset = 0; - var spans = []; - for (var _i = 0, sortedEdits_1 = sortedEdits; _i < sortedEdits_1.length; _i++) { - var e = sortedEdits_1[_i]; - var startOffset = document.offsetAt(e.range.start); - if (startOffset < lastModifiedOffset) { - throw new Error("Overlapping edit"); - } else if (startOffset > lastModifiedOffset) { - spans.push(text.substring(lastModifiedOffset, startOffset)); + inClass = true; + classStart = i; + reClassStart = re.length; + re += c; + continue; + case "]": + if (i === classStart + 1 || !inClass) { + re += "\\" + c; + escaping = false; + continue; } - if (e.newText.length) { - spans.push(e.newText); + var cs = pattern.substring(classStart + 1, i); + try { + RegExp("[" + cs + "]"); + } catch (er) { + var sp = this.parse(cs, SUBPARSE); + re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]"; + hasMagic = hasMagic || sp[1]; + inClass = false; + continue; } - lastModifiedOffset = document.offsetAt(e.range.end); - } - spans.push(text.substr(lastModifiedOffset)); - return spans.join(""); - } - TextDocument2.applyEdits = applyEdits; - })(TextDocument = exports2.TextDocument || (exports2.TextDocument = {})); - function mergeSort(data, compare2) { - if (data.length <= 1) { - return data; - } - var p = data.length / 2 | 0; - var left = data.slice(0, p); - var right = data.slice(p); - mergeSort(left, compare2); - mergeSort(right, compare2); - var leftIdx = 0; - var rightIdx = 0; - var i = 0; - while (leftIdx < left.length && rightIdx < right.length) { - var ret = compare2(left[leftIdx], right[rightIdx]); - if (ret <= 0) { - data[i++] = left[leftIdx++]; - } else { - 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) { - if (textOffset === void 0) { - textOffset = 0; - } - var result = isAtLineStart ? [textOffset] : []; - for (var i = 0; i < text.length; i++) { - var ch = text.charCodeAt(i); - if (ch === 13 || ch === 10) { - if (ch === 13 && i + 1 < text.length && text.charCodeAt(i + 1) === 10) { - i++; + hasMagic = true; + inClass = false; + re += c; + continue; + default: + clearStateChar(); + if (escaping) { + escaping = false; + } else if (reSpecials[c] && !(c === "^" && inClass)) { + re += "\\"; } - result.push(textOffset + i + 1); - } - } - return result; - } - function getWellformedRange(range) { - var start = range.start; - var end = range.end; - if (start.line > end.line || start.line === end.line && start.character > end.character) { - return { start: end, end: start }; + re += c; } - return range; } - function getWellformedEdit(textEdit) { - var range = getWellformedRange(textEdit.range); - if (range !== textEdit.range) { - return { newText: textEdit.newText, range }; - } - return textEdit; + if (inClass) { + cs = pattern.substr(classStart + 1); + sp = this.parse(cs, SUBPARSE); + re = re.substr(0, reClassStart) + "\\[" + sp[0]; + hasMagic = hasMagic || sp[1]; } - }); - } -}); - -// node_modules/cspell-lib/dist/cjs/Models/TextDocument.js -var require_TextDocument = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Models/TextDocument.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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]; - } }; + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length); + this.debug("setting tail", re, pl); + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_, $1, $2) { + if (!$2) { + $2 = "\\"; + } + return $1 + $1 + $2 + "|"; + }); + this.debug("tail=%j\n %s", tail, tail, pl, re); + var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; + hasMagic = true; + re = re.slice(0, pl.reStart) + t + "\\(" + tail; } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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); + clearStateChar(); + if (escaping) { + re += "\\\\"; } - __setModuleDefault(result, mod); - return result; - }; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isTextDocument = exports.loadTextDocument = exports.updateTextDocument = exports.createTextDocument = void 0; - var assert_1 = __importDefault(require("assert")); - var fs_1 = require("fs"); - var vscode_languageserver_textdocument_1 = require_main(); - var LanguageIds_js_1 = require_LanguageIds(); - var Uri = __importStar(require_Uri()); - var TextDocumentImpl = class { - constructor(uri, text, languageId, locale, version3) { - this.uri = uri; - this.languageId = languageId; - this.locale = locale; - const primaryLanguageId = typeof languageId === "string" ? languageId : languageId[0] || "plaintext"; - this.vsTextDoc = vscode_languageserver_textdocument_1.TextDocument.create(uri.toString(), primaryLanguageId, version3, text); - } - get version() { - return this.vsTextDoc.version; - } - get text() { - return this.vsTextDoc.getText(); - } - positionAt(offset) { - return this.vsTextDoc.positionAt(offset); - } - offsetAt(position) { - return this.vsTextDoc.offsetAt(position); - } - lineAt(offset) { - const position = this.vsTextDoc.positionAt(offset); - return this.getLine(position.line); - } - getLine(lineNum) { - const position = { line: lineNum, character: 0 }; - const end = { line: lineNum + 1, character: 0 }; - const range = { - start: position, - end - }; - const lineOffset = this.vsTextDoc.offsetAt(position); - const text = this.vsTextDoc.getText(range); - return { - text, - offset: lineOffset, - position - }; + var addPatternStart = false; + switch (re.charAt(0)) { + case "[": + case ".": + case "(": + addPatternStart = true; } - /** - * Iterate over the lines of a document one-by-one. - * Changing the document between iterations can change the result - */ - *getLines() { - const range = { - start: { line: 0, character: 0 }, - end: { line: 1, character: 0 } - }; - while (this.vsTextDoc.offsetAt(range.end) > this.vsTextDoc.offsetAt(range.start)) { - const offset = this.vsTextDoc.offsetAt(range.start); - yield { - text: this.vsTextDoc.getText(range), - offset, - position: range.start - }; - ++range.start.line; - ++range.end.line; + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n]; + var nlBefore = re.slice(0, nl.reStart); + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8); + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd); + var nlAfter = re.slice(nl.reEnd); + nlLast += nlAfter; + var openParensBefore = nlBefore.split("(").length - 1; + var cleanAfter = nlAfter; + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, ""); } - } - /** - * Apply edits to the text. - * Note: the edits are applied one after the other. - * @param edits - changes to the text - * @param version - optional version to use. - * @returns this - */ - update(edits, version3) { - version3 = version3 ?? this.version + 1; - for (const edit of edits) { - const vsEdit = edit.range ? { - range: { start: this.positionAt(edit.range[0]), end: this.positionAt(edit.range[1]) }, - text: edit.text - } : edit; - vscode_languageserver_textdocument_1.TextDocument.update(this.vsTextDoc, [vsEdit], version3); + nlAfter = cleanAfter; + var dollar = ""; + if (nlAfter === "" && isSub !== SUBPARSE) { + dollar = "$"; } - return this; + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; + re = newRe; } - }; - function createTextDocument({ uri, content, languageId, locale, version: version3 }) { - version3 = version3 ?? 1; - uri = Uri.toUri(uri); - languageId = languageId ?? (0, LanguageIds_js_1.getLanguagesForBasename)(Uri.basename(uri)); - languageId = languageId.length === 0 ? "text" : languageId; - return new TextDocumentImpl(uri, content, languageId, locale, version3); - } - exports.createTextDocument = createTextDocument; - function updateTextDocument(doc, edits, version3) { - (0, assert_1.default)(isTextDocumentImpl(doc), "Unknown TextDocument type"); - return doc.update(edits, version3); - } - exports.updateTextDocument = updateTextDocument; - function isTextDocumentImpl(doc) { - return doc instanceof TextDocumentImpl; - } - async function loadTextDocument(filename, languageId) { - const uri = Uri.toUri(filename); - const content = await fs_1.promises.readFile(Uri.uriToFilePath(uri), "utf8"); - return createTextDocument({ uri, languageId, content }); - } - exports.loadTextDocument = loadTextDocument; - exports.isTextDocument = isTextDocumentImpl; - } -}); - -// node_modules/cspell-lib/dist/cjs/Document/resolveDocument.js -var require_resolveDocument = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Document/resolveDocument.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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]; - } }; + if (re !== "" && hasMagic) { + re = "(?=.)" + re; } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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); + if (addPatternStart) { + re = patternStart + re; } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.resolveDocument = exports.resolveDocumentToTextDocument = exports.documentToTextDocument = exports.fileToTextDocument = exports.fileToDocument = void 0; - var promises_1 = require("fs/promises"); - var TextDocument_js_1 = require_TextDocument(); - var Uri = __importStar(require_Uri()); - var util_js_1 = require_util(); - var defaultEncoding = "utf8"; - function fileToDocument2(file, text, languageId, locale) { - return (0, util_js_1.clean)({ - uri: Uri.toUri(file).toString(), - text, - languageId, - locale - }); - } - exports.fileToDocument = fileToDocument2; - async function fileToTextDocument(file) { - return documentToTextDocument(await resolveDocument(fileToDocument2(file))); - } - exports.fileToTextDocument = fileToTextDocument; - function documentToTextDocument(document) { - const { uri, text: content, languageId, locale } = document; - return (0, TextDocument_js_1.createTextDocument)({ uri, content, languageId, locale }); - } - exports.documentToTextDocument = documentToTextDocument; - async function resolveDocumentToTextDocument(doc) { - return documentToTextDocument(await resolveDocument(doc)); - } - exports.resolveDocumentToTextDocument = resolveDocumentToTextDocument; - async function readDocument(filename, encoding = defaultEncoding) { - const text = await (0, promises_1.readFile)(filename, encoding); - const uri = Uri.toUri(filename).toString(); - return { - uri, - text - }; - } - function resolveDocument(document, encoding) { - if (isDocumentWithText(document)) - return Promise.resolve(document); - const uri = Uri.toUri(document.uri); - if (uri.scheme !== "file") { - throw new Error(`Unsupported schema: "${uri.scheme}", open "${uri.toString()}"`); + if (isSub === SUBPARSE) { + return [re, hasMagic]; } - return readDocument(Uri.uriToFilePath(uri), encoding); - } - exports.resolveDocument = resolveDocument; - function isDocumentWithText(doc) { - return doc.text !== void 0; - } - } -}); - -// node_modules/cspell-lib/dist/cjs/Document/index.js -var require_Document = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Document/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fileToTextDocument = exports.fileToDocument = exports.isBinaryFile = void 0; - var isBinaryDoc_js_1 = require_isBinaryDoc(); - Object.defineProperty(exports, "isBinaryFile", { enumerable: true, get: function() { - return isBinaryDoc_js_1.isBinaryFile; - } }); - var resolveDocument_js_1 = require_resolveDocument(); - Object.defineProperty(exports, "fileToDocument", { enumerable: true, get: function() { - return resolveDocument_js_1.fileToDocument; - } }); - Object.defineProperty(exports, "fileToTextDocument", { enumerable: true, get: function() { - return resolveDocument_js_1.fileToTextDocument; - } }); - } -}); - -// node_modules/cspell-lib/dist/cjs/FeatureFlags/FeatureFlags.js -var require_FeatureFlags = __commonJS({ - "node_modules/cspell-lib/dist/cjs/FeatureFlags/FeatureFlags.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getSystemFeatureFlags = exports.UnknownFeatureFlagError = exports.FeatureFlags = void 0; - var systemFeatureFlags; - var FeatureFlags = class { - constructor(flags = []) { - this.flagValues = /* @__PURE__ */ new Map(); - this.flags = new Map(flags.map((f) => [f.name, f])); - } - register(flagOrName, description) { - if (typeof flagOrName === "string") { - return this.register({ name: flagOrName, description: description || "" }); - } - this.flags.set(flagOrName.name, flagOrName); - return this; + if (!hasMagic) { + return globUnescape(pattern); } - getFlag(flag) { - return this.flagValues.get(flag); + var flags = options.nocase ? "i" : ""; + try { + var regExp = new RegExp("^" + re + "$", flags); + } catch (er) { + return new RegExp("$."); } - getFlagBool(flag) { - return toBool(this.getFlag(flag)); + regExp._glob = pattern; + regExp._src = re; + return regExp; + } + minimatch.makeRe = function(pattern, options) { + return new Minimatch(pattern, options || {}).makeRe(); + }; + Minimatch.prototype.makeRe = makeRe; + function makeRe() { + if (this.regexp || this.regexp === false) + return this.regexp; + var set = this.set; + if (!set.length) { + this.regexp = false; + return this.regexp; } - setFlag(flag, value = true) { - if (!this.flags.has(flag)) { - throw new UnknownFeatureFlagError(flag); - } - this.flagValues.set(flag, value); - return this; + var options = this.options; + var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; + var flags = options.nocase ? "i" : ""; + var re = set.map(function(pattern) { + return pattern.map(function(p) { + return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src; + }).join("\\/"); + }).join("|"); + re = "^(?:" + re + ")$"; + if (this.negate) + re = "^(?!" + re + ").*$"; + try { + this.regexp = new RegExp(re, flags); + } catch (ex) { + this.regexp = false; } - getFlagInfo(flag) { - return this.flags.get(flag); + return this.regexp; + } + minimatch.match = function(list, pattern, options) { + options = options || {}; + var mm2 = new Minimatch(pattern, options); + list = list.filter(function(f) { + return mm2.match(f); + }); + if (mm2.options.nonull && !list.length) { + list.push(pattern); } - getFlags() { - return [...this.flags.values()]; + return list; + }; + Minimatch.prototype.match = function match2(f, partial) { + if (typeof partial === "undefined") + partial = this.partial; + this.debug("match", f, this.pattern); + if (this.comment) + return false; + if (this.empty) + return f === ""; + if (f === "/" && partial) + return true; + var options = this.options; + if (path26.sep !== "/") { + f = f.split(path26.sep).join("/"); } - getFlagValues() { - return new Map(this.flagValues); + f = f.split(slashSplit); + this.debug(this.pattern, "split", f); + var set = this.set; + this.debug(this.pattern, "set", set); + var filename; + var i; + for (i = f.length - 1; i >= 0; i--) { + filename = f[i]; + if (filename) + break; } - reset() { - this.flagValues.clear(); - return this; + for (i = 0; i < set.length; i++) { + var pattern = set[i]; + var file = f; + if (options.matchBase && pattern.length === 1) { + file = [filename]; + } + var hit = this.matchOne(file, pattern, partial); + if (hit) { + if (options.flipNegate) + return true; + return !this.negate; + } } + if (options.flipNegate) + return false; + return this.negate; }; - exports.FeatureFlags = FeatureFlags; - var UnknownFeatureFlagError = class extends Error { - constructor(flag) { - super(`Unknown feature flag: ${flag}`); - this.flag = flag; + Minimatch.prototype.matchOne = function(file, pattern, partial) { + var options = this.options; + this.debug( + "matchOne", + { "this": 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); + if (p === false) + return false; + if (p === GLOBSTAR) { + this.debug("GLOBSTAR", [pattern, p, f]); + var fr = fi; + var pr = pi + 1; + if (pr === pl) { + this.debug("** at the end"); + for (; fi < fl; fi++) { + if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") + return false; + } + return true; + } + while (fr < fl) { + var swallowee = file[fr]; + this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug("globstar found match!", fr, fl, swallowee); + return true; + } else { + if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { + this.debug("dot detected!", file, fr, pattern, pr); + break; + } + this.debug("globstar swallow a segment, and continue"); + fr++; + } + } + if (partial) { + this.debug("\n>>> no match, partial?", file, fr, pattern, pr); + if (fr === fl) + return true; + } + return false; + } + var hit; + if (typeof p === "string") { + hit = f === p; + this.debug("string match", p, f, hit); + } else { + hit = f.match(p); + this.debug("pattern match", p, f, hit); + } + if (!hit) + return false; } + if (fi === fl && pi === pl) { + return true; + } else if (fi === fl) { + return partial; + } else if (pi === pl) { + return fi === fl - 1 && file[fi] === ""; + } + throw new Error("wtf?"); }; - exports.UnknownFeatureFlagError = UnknownFeatureFlagError; - function getSystemFeatureFlags2() { - return systemFeatureFlags || (systemFeatureFlags = new FeatureFlags()); - } - exports.getSystemFeatureFlags = getSystemFeatureFlags2; - var boolValues = { - 0: false, - 1: true, - f: false, - false: false, - n: false, - no: false, - t: true, - true: true, - y: true, - yes: true - }; - function toBool(value) { - if (typeof value !== "string") - return value; - return boolValues[value.toLowerCase()]; + function globUnescape(s) { + return s.replace(/\\(.)/g, "$1"); + } + function regExpEscape(s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); } } }); -// node_modules/cspell-lib/dist/cjs/FeatureFlags/index.js -var require_FeatureFlags2 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/FeatureFlags/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.UnknownFeatureFlagError = exports.getSystemFeatureFlags = exports.FeatureFlags = void 0; - var FeatureFlags_js_1 = require_FeatureFlags(); - Object.defineProperty(exports, "FeatureFlags", { enumerable: true, get: function() { - return FeatureFlags_js_1.FeatureFlags; - } }); - Object.defineProperty(exports, "getSystemFeatureFlags", { enumerable: true, get: function() { - return FeatureFlags_js_1.getSystemFeatureFlags; - } }); - Object.defineProperty(exports, "UnknownFeatureFlagError", { enumerable: true, get: function() { - return FeatureFlags_js_1.UnknownFeatureFlagError; - } }); - } -}); - -// node_modules/cspell-grammar/dist/cjs/parser/grammarTypesHelpers.js -var require_grammarTypesHelpers = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parser/grammarTypesHelpers.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isGrammar = exports.isPatternPatterns = exports.isPatternBeginEnd = exports.isPatternMatch = exports.isPatternInclude = void 0; - function isPatternInclude(p) { - return !!p.include; - } - exports.isPatternInclude = isPatternInclude; - var TypeofMatch = { - object: true, - string: true - }; - var TypeofBegin = TypeofMatch; - var TypeofEnd = { ...TypeofBegin, undefined: true }; - function isPatternMatch(pattern) { - const p = pattern; - return !!p.match && typeof p.match in TypeofMatch; - } - exports.isPatternMatch = isPatternMatch; - function isPatternBeginEnd(pattern) { - const p = pattern; - return p.begin !== void 0 && typeof p.begin in TypeofBegin && typeof p.end in TypeofEnd; - } - exports.isPatternBeginEnd = isPatternBeginEnd; - function isPatternPatterns(p) { - return Array.isArray(p.patterns); - } - exports.isPatternPatterns = isPatternPatterns; - function isGrammar(g) { - return g.scopeName !== void 0; +// node_modules/inherits/inherits_browser.js +var require_inherits_browser = __commonJS({ + "node_modules/inherits/inherits_browser.js"(exports, module2) { + if (typeof Object.create === "function") { + module2.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 { + module2.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; + } + }; } - exports.isGrammar = isGrammar; } }); -// node_modules/cspell-grammar/dist/cjs/parser/matchResult.js -var require_matchResult = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parser/matchResult.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createSimpleMatchResult = exports.createMatchResult = exports.segmentMatch = void 0; - function segmentMatch(mr) { - const { matches, index, groups, input } = mr; - const segments = []; - let p = index; - for (let groupNum = 0; groupNum < matches.length; ++groupNum) { - const m = matches[groupNum]; - if (!m) - continue; - const idx0 = input.indexOf(m, p); - const idx = idx0 >= p ? idx0 : input.lastIndexOf(m, p); - if (idx < 0) - continue; - segments.push({ match: m, index: idx, groupNum, groupName: void 0 }); - p = idx; - } - const textToSeg = new Map(segments.map((s) => [s.match, s])); - for (const [name, value] of Object.entries(groups)) { - const s = value && textToSeg.get(value); - if (!s) - continue; - s.groupName = s.groupName ? Array.isArray(s.groupName) ? s.groupName.concat([name]) : [s.groupName, name] : name; - } - return segments; - } - exports.segmentMatch = segmentMatch; - function createMatchResult(r, lineNumber) { - const groups = /* @__PURE__ */ Object.create(null); - r.groups && Object.assign(groups, r.groups); - const matches = r; - const match = r[0]; - return { index: r.index, input: r.input, match, matches, groups, lineNumber }; - } - exports.createMatchResult = createMatchResult; - function createSimpleMatchResult(match, input, index, lineNumber) { - const groups = /* @__PURE__ */ Object.create(null); - return { index, input, match, matches: [match], groups, lineNumber }; +// node_modules/inherits/inherits.js +var require_inherits = __commonJS({ + "node_modules/inherits/inherits.js"(exports, module2) { + try { + util = require("util"); + if (typeof util.inherits !== "function") + throw ""; + module2.exports = util.inherits; + } catch (e) { + module2.exports = require_inherits_browser(); } - exports.createSimpleMatchResult = createSimpleMatchResult; + var util; } }); -// node_modules/cspell-grammar/dist/cjs/parser/scope.js -var require_scope = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parser/scope.js"(exports) { +// node_modules/path-is-absolute/index.js +var require_path_is_absolute = __commonJS({ + "node_modules/path-is-absolute/index.js"(exports, module2) { "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ScopePool = exports.Scope = void 0; - var assert_1 = __importDefault(require("assert")); - var Scope = class _Scope { - constructor(value, parent) { - this.value = value; - this.parent = parent; - } - /** - * Convert the scope hierarchy to a string - * @param ltr - return ancestry from left-to-right - * @returns the scope hierarchy as a string separated by a space. - */ - toString(ltr = false) { - if (!this.parent) - return this.value; - return ltr ? this.parent.toString(ltr) + " " + this.value : this.value + " " + this.parent.toString(ltr); - } - static isScope(value) { - return value instanceof _Scope; - } - }; - exports.Scope = Scope; - var ScopePool = class { - constructor() { - this.pool = /* @__PURE__ */ new Map(); - } - /** - * Get a Scope that matches the scope. This method is idempotent. - * @param scopeValue - a single scope value: i.e. `source.ts` - * @param parent - optional parent Scope - */ - getScope(scopeValue, parent) { - const foundPoolMap = this.pool.get(scopeValue); - const poolMap = foundPoolMap || /* @__PURE__ */ new Map(); - if (poolMap !== foundPoolMap) { - this.pool.set(scopeValue, poolMap); - } - const foundScope = poolMap.get(parent); - if (foundScope) - return foundScope.v; - const scope = new Scope(scopeValue, parent); - poolMap.set(parent, { v: scope }); - return scope; - } - parseScope(scopes, ltr = false) { - if (Scope.isScope(scopes)) - return scopes; - if (isScopeLike(scopes)) { - const parent = scopes.parent ? this.parseScope(scopes.parent) : void 0; - return this.getScope(scopes.value, parent); - } - return this.parseScopeString(scopes, ltr); - } - parseScopeString(scopes, ltr) { - scopes = Array.isArray(scopes) ? scopes : scopes.split(" "); - const parentToChild = ltr ? scopes : scopes.reverse(); - let parent = void 0; - for (const value of parentToChild) { - parent = this.getScope(value, parent); - } - (0, assert_1.default)(parent, "Empty scope is not allowed."); - return parent; - } - }; - exports.ScopePool = ScopePool; - function isScopeLike(value) { - return typeof value === "object" && !Array.isArray(value) && value.value !== void 0; + function posix3(path26) { + return path26.charAt(0) === "/"; + } + function win32(path26) { + var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + var result = splitDeviceRe.exec(path26); + var device = result[1] || ""; + var isUnc = Boolean(device && device.charAt(1) !== ":"); + return Boolean(result[2] || isUnc); } + module2.exports = process.platform === "win32" ? win32 : posix3; + module2.exports.posix = posix3; + module2.exports.win32 = win32; } }); -// node_modules/cspell-grammar/dist/cjs/parser/grammarNormalizer.js -var require_grammarNormalizer = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parser/grammarNormalizer.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.extractScope = exports.nPattern = exports.normalizeGrammar = void 0; - var grammarTypesHelpers_js_1 = require_grammarTypesHelpers(); - var matchResult_js_1 = require_matchResult(); - var scope_js_1 = require_scope(); - function normalizeGrammar(grammar) { - return new ImplNGrammar(grammar); - } - exports.normalizeGrammar = normalizeGrammar; - var SpecialRepositoryReferences = { - $self: true, - $base: true - }; - function nPattern(p) { - if ((0, grammarTypesHelpers_js_1.isPatternMatch)(p)) - return normalizePatternMatch(p); - if ((0, grammarTypesHelpers_js_1.isPatternBeginEnd)(p)) - return normalizePatternBeginEnd(p); - if ((0, grammarTypesHelpers_js_1.isPatternInclude)(p)) - return normalizePatternInclude(p); - if ((0, grammarTypesHelpers_js_1.isPatternPatterns)(p)) - return normalizePatternsPatterns(p); - return normalizePatternName(p); - } - exports.nPattern = nPattern; - function normalizePatternMatch(p) { - const regExec = makeTestMatchFn(p.match); - const self = { - ...p, - captures: normalizeCapture(p.captures), - findMatch - }; - function findMatch(line, parentRule) { - const match = regExec(line); - if (!match) - return void 0; - const rule = factoryRule(parentRule, self); - return { rule, match, line }; - } - return self; - } - function normalizePatternBeginEnd(p) { - const patterns = normalizePatterns(p.patterns); - const self = { - ...p, - captures: normalizeCapture(p.captures), - beginCaptures: normalizeCapture(p.beginCaptures), - endCaptures: normalizeCapture(p.endCaptures), - patterns, - findMatch - }; - function findMatch(line, parentRule) { - const match = testBegin(line); - if (!match) - return void 0; - const rule = factoryRule(parentRule, self, findNext, end); - return { rule, match, line }; - } - const testBegin = makeTestMatchFn(p.begin); - const testEnd = p.end !== void 0 ? makeTestMatchFn(p.end) : () => void 0; - function findNext(line) { - return patterns && findInPatterns(patterns, line, this); - } - function end(line) { - return testEnd(line); - } - return self; - } - function normalizePatternName(p) { - const patterns = void 0; - const self = { - ...p, - patterns, - findMatch - }; - function findMatch(line, parentRule) { - const rule = factoryRule(parentRule, self); - const input = line.text.slice(line.offset); - const match = (0, matchResult_js_1.createSimpleMatchResult)(input, input, line.offset, line.lineNumber); - return { rule, match, line }; - } - return self; - } - function normalizePatternInclude(p) { - const { include } = p; - return include.startsWith("#") || include in SpecialRepositoryReferences ? normalizePatternIncludeRef(p) : normalizePatternIncludeExt(p); - } - function normalizePatternIncludeRef(p) { - const { include, ...rest } = p; - const reference = include.startsWith("#") ? include.slice(1) : include; - const self = { - ...rest, - reference, - findMatch - }; - function findMatch(line, parentRule) { - const pat = parentRule.repository[reference]; - if (pat === void 0) - throw new Error(`Unknown Include Reference ${include}`); - return pat.findMatch(line, parentRule); - } - return self; - } - function normalizePatternIncludeExt(p) { - function findMatch(_line) { - return void 0; - } - const self = { - ...p, - findMatch - }; - return self; +// node_modules/glob/common.js +var require_common5 = __commonJS({ + "node_modules/glob/common.js"(exports) { + exports.setopts = setopts; + exports.ownProp = ownProp; + exports.makeAbs = makeAbs; + exports.finish = finish; + exports.mark = mark; + exports.isIgnored = isIgnored; + exports.childrenIgnored = childrenIgnored; + function ownProp(obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field); } - function normalizePatternsPatterns(p) { - return new ImplNPatternPatterns(p); + var fs9 = require("fs"); + var path26 = require("path"); + var minimatch = require_minimatch(); + var isAbsolute = require_path_is_absolute(); + var Minimatch = minimatch.Minimatch; + function alphasort(a, b) { + return a.localeCompare(b, "en"); } - function findInPatterns(patterns, line, rule) { - let r = void 0; - for (const pat of patterns) { - if (pat.disabled) - continue; - const er = pat.findMatch(line, rule); - if (er?.match !== void 0 && !er.rule.pattern.disabled) { - r = r && r.match && r.match.index <= er.match.index && r || er; - } + function setupIgnores(self, options) { + self.ignore = options.ignore || []; + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore]; + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap); } - return r; - } - function normalizePatterns(patterns) { - if (!patterns) - return void 0; - return patterns.map((p) => typeof p === "string" ? { include: p } : p).map(nPattern); - } - var emptyRepository = Object.freeze(/* @__PURE__ */ Object.create(null)); - function normalizePatternRepository(rep) { - if (!rep) - return emptyRepository; - return normalizeRepository(rep); } - function normalizeRepository(rep) { - const repository = /* @__PURE__ */ Object.create(null); - for (const [key, pat] of Object.entries(rep)) { - repository[key] = nPattern(pat); + function ignoreMap(pattern) { + var gmatcher = null; + if (pattern.slice(-3) === "/**") { + var gpattern = pattern.replace(/(\/\*\*)+$/, ""); + gmatcher = new Minimatch(gpattern, { dot: true }); } - return repository; - } - var ruleCounter = 0; - function factoryRuleBase(parent, pattern, repository, grammar, findNext, end) { - const depth = parent ? parent.depth + 1 : 0; return { - id: ruleCounter++, - grammar, - pattern, - parent, - repository, - depth, - findNext, - end - }; - } - function factoryRule(parent, pattern, findNext, end) { - return factoryRuleBase(parent, pattern, parent.repository, parent.grammar, findNext, end); - } - function normalizeCapture(cap) { - if (cap === void 0) - return void 0; - if (typeof cap === "string") - return { [0]: cap }; - const capture = /* @__PURE__ */ Object.create(null); - for (const [key, pat] of Object.entries(cap)) { - capture[key] = typeof pat === "string" ? pat : normalizePatternName(pat).name; - } - return capture; - } - function makeTestMatchFn(reg) { - if (typeof reg === "string") - return matchString(reg); - return matchRegExp(reg); - } - function matchString(s) { - return (line) => { - const input = line.text; - const index = input.indexOf(s, line.offset); - if (index < 0) - return void 0; - return (0, matchResult_js_1.createSimpleMatchResult)(s, input, index, line.lineNumber); - }; - } - function matchRegExp(r) { - return (line) => { - const rg = RegExp(r, "gm"); - rg.lastIndex = line.offset; - const m = rg.exec(line.text); - return (m && (0, matchResult_js_1.createMatchResult)(m, line.lineNumber)) ?? void 0; + matcher: new Minimatch(pattern, { dot: true }), + gmatcher }; } - function extractScope(er, isContent = true) { - const scope = []; - for (let rule = er; rule; rule = rule.parent) { - const pattern = rule.pattern; - const { name, contentName } = pattern; - if (contentName && isContent) { - scope.push(contentName); - } - if (name !== void 0) { - scope.push(name); - } - isContent = true; - } - return er.grammar.scopePool.parseScope(scope); - } - exports.extractScope = extractScope; - var ImplNGrammar = class { - constructor(grammar) { - this.scopeName = grammar.scopeName; - this.name = grammar.scopeName; - this.comment = grammar.comment; - this.disabled = grammar.disabled; - this.grammarName = grammar.name; - const self = nPattern({ - patterns: [{ patterns: grammar.patterns }] - }); - const repository = normalizePatternRepository(grammar.repository); - this.patterns = self.patterns; - this.repository = repository; - this.self = self; - this.scopePool = new scope_js_1.ScopePool(); - } - begin(parentRule) { - const patterns = this.patterns; - function grammarToRule(grammar, baseGrammar, parent) { - const repository = /* @__PURE__ */ Object.create(null); - Object.assign(repository, grammar.repository); - repository["$self"] = grammar.self; - repository["$base"] = repository["$base"] || baseGrammar.self; - function findNext(line) { - return findInPatterns(patterns, line, this); - } - function end(_line) { - return void 0; - } - return factoryRuleBase(parent, grammar, repository, grammar, findNext, end); + function setopts(self, pattern, options) { + if (!options) + options = {}; + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar"); } - return grammarToRule(this, parentRule?.grammar ?? this, parentRule); - } - }; - var ImplNPatternPatterns = class { - constructor(p) { - const { name, comment, disabled, ...rest } = p; - this.patterns = normalizePatterns(rest.patterns); - this.name = name; - this.comment = comment; - this.disabled = disabled; + pattern = "**/" + pattern; } - findMatch(line, parentRule) { - const patterns = this.patterns; - const rule = factoryRule(parentRule, this, findNext); - function findNext(line2) { - return findInPatterns(patterns, line2, this); - } - return rule.findNext?.(line); + self.silent = !!options.silent; + self.pattern = pattern; + self.strict = options.strict !== false; + self.realpath = !!options.realpath; + self.realpathCache = options.realpathCache || /* @__PURE__ */ Object.create(null); + self.follow = !!options.follow; + self.dot = !!options.dot; + self.mark = !!options.mark; + self.nodir = !!options.nodir; + if (self.nodir) + self.mark = true; + self.sync = !!options.sync; + self.nounique = !!options.nounique; + self.nonull = !!options.nonull; + self.nosort = !!options.nosort; + self.nocase = !!options.nocase; + self.stat = !!options.stat; + self.noprocess = !!options.noprocess; + self.absolute = !!options.absolute; + self.fs = options.fs || fs9; + self.maxLength = options.maxLength || Infinity; + self.cache = options.cache || /* @__PURE__ */ Object.create(null); + self.statCache = options.statCache || /* @__PURE__ */ Object.create(null); + self.symlinks = options.symlinks || /* @__PURE__ */ Object.create(null); + setupIgnores(self, options); + self.changedCwd = false; + var cwd = process.cwd(); + if (!ownProp(options, "cwd")) + self.cwd = cwd; + else { + self.cwd = path26.resolve(options.cwd); + self.changedCwd = self.cwd !== cwd; } - }; - } -}); - -// node_modules/cspell-grammar/dist/cjs/parser/grammar.js -var require_grammar = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parser/grammar.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.compileGrammar = void 0; - var grammarNormalizer_js_1 = require_grammarNormalizer(); - function compileGrammar(grammar) { - return (0, grammarNormalizer_js_1.normalizeGrammar)(grammar); - } - exports.compileGrammar = compileGrammar; - } -}); - -// node_modules/cspell-grammar/dist/cjs/parser/util.js -var require_util7 = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parser/util.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isDefined = void 0; - function isDefined2(t) { - return t !== void 0 && t !== null; + self.root = options.root || path26.resolve(self.cwd, "/"); + self.root = path26.resolve(self.root); + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/"); + self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd); + if (process.platform === "win32") + self.cwdAbs = self.cwdAbs.replace(/\\/g, "/"); + self.nomount = !!options.nomount; + options.nonegate = true; + options.nocomment = true; + options.allowWindowsEscape = false; + self.minimatch = new Minimatch(pattern, options); + self.options = self.minimatch.options; } - exports.isDefined = isDefined2; - } -}); - -// node_modules/cspell-grammar/dist/cjs/parser/processors/procMatchingRule.js -var require_procMatchingRule = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parser/processors/procMatchingRule.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.applyCaptures = exports.applyCaptureToEnd = exports.applyCaptureToBeginOrMatch = void 0; - var grammarNormalizer_js_1 = require_grammarNormalizer(); - var matchResult_js_1 = require_matchResult(); - var util_js_1 = require_util7(); - function applyCaptureToBeginOrMatch(matchRuleResult) { - const { match, rule } = matchRuleResult; - const bePattern = rule.pattern; - const captures = bePattern.beginCaptures ?? bePattern.captures; - return applyCaptures(rule, match, captures); - } - exports.applyCaptureToBeginOrMatch = applyCaptureToBeginOrMatch; - function applyCaptureToEnd(rule, match) { - const { pattern } = rule; - const bePattern = pattern; - const captures = bePattern.endCaptures ?? bePattern.captures; - return applyCaptures(rule, match, captures); - } - exports.applyCaptureToEnd = applyCaptureToEnd; - function applyCaptures(rule, match, captures) { - const scope = (0, grammarNormalizer_js_1.extractScope)(rule, false); - const pool = rule.grammar.scopePool; - const text = match.match; - const input = match.input; - const range = [match.index, match.index + text.length, match.lineNumber]; - if (!text && !captures) - return []; - if (!captures) { - const tokenized = { - scope, - text, - range - }; - return [tokenized]; - } - const captureScopes = new Map(Object.entries(captures)); - const cap0 = captureScopes.get("0"); - if (captureScopes.size === 1 && cap0) { - const tokenized = { - scope: rule.grammar.scopePool.getScope(cap0, scope), - text, - range - }; - return [tokenized]; - } - const min = match.index; - const max = match.index + text.length; - function trimSegment(seg) { - const { index, match: match2 } = seg; - const right = match2.length; - if (index >= min && right <= max) - return seg; - if (index >= max || right < min) - return void 0; - const a = Math.max(index, min) - index; - const b = Math.min(right, max) - index; - const text2 = match2.slice(a, b); - return { - ...seg, - index: index + a, - match: text2 - }; - } - const segments = (0, matchResult_js_1.segmentMatch)(match).map(trimSegment).filter(util_js_1.isDefined); - function processSegments(segments2) { - const base = segments2[0]; - const root = { - a: base.index, - b: base.index + base.match.length, - s: { seg: base } - }; - let m; - for (let i = 1; i < segments2.length; ++i) { - const seg = segments2[i]; - const index = seg.index; - const end = index + seg.match.length; - m = m && m.a <= index ? m : root; - while (m && m.b <= index) { - m = m.n; - } - while (m && m.a < end) { - if (m.a < index) { - const n = { ...m, a: index }; - m.n = n; - m.b = index; - m = n; - } - if (m.b > end) { - const n = { ...m, a: end }; - m.b = end; - m.n = n; - } - m.s = { seg, next: m.s }; - m = m.n; + function finish(self) { + var nou = self.nounique; + var all3 = nou ? [] : /* @__PURE__ */ Object.create(null); + for (var i = 0, l = self.matches.length; i < l; i++) { + var matches = self.matches[i]; + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + var literal = self.minimatch.globSet[i]; + if (nou) + all3.push(literal); + else + all3[literal] = true; } + } else { + var m = Object.keys(matches); + if (nou) + all3.push.apply(all3, m); + else + m.forEach(function(m2) { + all3[m2] = true; + }); } - return root; } - function segChainToScope(chain) { - function* _chain(chain2) { - while (chain2) { - const seg = chain2.seg; - if (seg.groupName) { - if (Array.isArray(seg.groupName)) { - yield* seg.groupName; - } else { - yield seg.groupName; - } - } - yield seg.groupNum.toString(); - chain2 = chain2.next; - } + if (!nou) + all3 = Object.keys(all3); + if (!self.nosort) + all3 = all3.sort(alphasort); + if (self.mark) { + for (var i = 0; i < all3.length; i++) { + all3[i] = self._mark(all3[i]); } - const scopeValues = [..._chain(chain)].map((cap) => captureScopes.get(cap)).filter(util_js_1.isDefined).reverse(); - return scopeValues.reduce((s, v) => pool.getScope(v, s), scope); - } - const merged = processSegments(segments); - function* emit(m) { - while (m) { - const t = { - text: input.slice(m.a, m.b), - range: [m.a, m.b, match.lineNumber], - scope: segChainToScope(m.s) - }; - yield t; - m = m.n; + if (self.nodir) { + all3 = all3.filter(function(e) { + var notDir = !/\/$/.test(e); + var c = self.cache[e] || self.cache[makeAbs(self, e)]; + if (notDir && c) + notDir = c !== "DIR" && !Array.isArray(c); + return notDir; + }); } } - const parsedText = [...emit(merged)]; - return parsedText; + if (self.ignore.length) + all3 = all3.filter(function(m2) { + return !isIgnored(self, m2); + }); + self.found = all3; } - exports.applyCaptures = applyCaptures; - } -}); - -// node_modules/cspell-grammar/dist/cjs/parser/tokenizeLine.js -var require_tokenizeLine = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parser/tokenizeLine.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.tokenizeTextIterable = exports.tokenizeText = exports.tokenizeLine = void 0; - var assert_1 = __importDefault(require("assert")); - var grammarNormalizer_js_1 = require_grammarNormalizer(); - var procMatchingRule_js_1 = require_procMatchingRule(); - function tokenizeLine(line, rule) { - const text = line.text; - const lineLen = line.text.length; - const parsedText = []; - let ctx = buildContext({ ...line, offset: 0, anchor: -1 }, rule); - while (ctx.line.offset <= lineLen) { - let endMatch = ctx.rule.end?.(ctx.line); - while (endMatch?.index === ctx.line.offset) { - parsedText.push(...(0, procMatchingRule_js_1.applyCaptureToEnd)(ctx.rule, endMatch)); - ctx = findParentWithEnd(ctx); - ctx.line.offset = endMatch.index + endMatch.match.length; - endMatch = ctx.rule.end?.(ctx.line); - } - if (ctx.line.offset >= lineLen) - break; - const { line: line2, rule: rule2 } = ctx; - const offset = line2.offset; - const match = rule2.findNext?.(line2); - const limit = endMatch?.index ?? lineLen; - const emitTil = match ? Math.min(match.match.index, limit) : limit; - if (offset < emitTil) { - const scope = (0, grammarNormalizer_js_1.extractScope)(rule2); - const start = offset; - const end = emitTil; - parsedText.push({ - scope, - text: text.slice(start, end), - range: [start, end, line2.lineNumber] - }); - ctx.line.offset = emitTil; - } - if (!match || endMatch && endMatch.index <= match.match.index) { - continue; + function mark(self, p) { + var abs = makeAbs(self, p); + var c = self.cache[abs]; + var m = p; + if (c) { + var isDir2 = c === "DIR" || Array.isArray(c); + var slash = p.slice(-1) === "/"; + if (isDir2 && !slash) + m += "/"; + else if (!isDir2 && slash) + m = m.slice(0, -1); + if (m !== p) { + var mabs = makeAbs(self, m); + self.statCache[mabs] = self.statCache[abs]; + self.cache[mabs] = self.cache[abs]; } - parsedText.push(...(0, procMatchingRule_js_1.applyCaptureToBeginOrMatch)(match)); - line2.anchor = match.match.index + match.match.match.length; - line2.offset = line2.anchor; - ctx = findNearestWithEnd(buildContext(line2, match.rule)); - } - return toParseLineResult(line, ctx.rule, parsedText); - } - exports.tokenizeLine = tokenizeLine; - function tokenizeText(text, grammar) { - return [...tokenizeTextIterable(text, grammar)]; - } - exports.tokenizeText = tokenizeText; - function* tokenizeTextIterable(text, grammar) { - const lines = text.split(/(?<=\r\n|\n|\r(?!\n))/); - const rule = grammar.begin(); - let documentOffset = 0; - let tr = tokenizeLine({ text: lines[0], lineNumber: 0, documentOffset }, rule); - documentOffset += lines[0].length; - yield toParsedLine(tr); - for (let i = 1; i < lines.length; ++i) { - const line = { text: lines[i], lineNumber: i, documentOffset }; - documentOffset += line.text.length; - tr = tr.parse(line); - yield toParsedLine(tr); - } - } - exports.tokenizeTextIterable = tokenizeTextIterable; - function toParsedLine(pr) { - const { tokens: parsedText, line, offset } = pr; - return { tokens: parsedText, line, offset }; - } - function toParseLineResult(line, rule, parsedText) { - return { - tokens: parsedText, - line, - offset: line.documentOffset, - parse: (line2) => tokenizeLine(line2, rule) - }; - } - function buildContext(line, rule) { - const rules = calcRuleStack(rule); - const numRules = rules.length; - const rootNum = numRules - 1; - const rootRule = rules[rootNum]; - const rootContext = { - line, - rule: rootRule - }; - let ctx = rootContext; - for (let i = rootNum - 1; i >= 0; --i) { - const rule2 = rules[i]; - const line2 = ctx.line; - ctx = { - line: line2, - rule: rule2, - parent: ctx - }; } - return ctx; + return m; } - function calcRuleStack(rule) { - const rules = []; - let r = rule; - while (r) { - rules.push(r); - r = r.parent; + function makeAbs(self, f) { + var abs = f; + if (f.charAt(0) === "/") { + abs = path26.join(self.root, f); + } else if (isAbsolute(f) || f === "") { + abs = f; + } else if (self.changedCwd) { + abs = path26.resolve(self.cwd, f); + } else { + abs = path26.resolve(f); } - return rules; - } - function must(t, msg = "Must be defined") { - (0, assert_1.default)(t !== void 0 && t !== null, msg); - return t; + if (process.platform === "win32") + abs = abs.replace(/\\/g, "/"); + return abs; } - function findParentWithEnd(ctx) { - return findNearestWithEnd(must(ctx.parent)); + function isIgnored(self, path27) { + if (!self.ignore.length) + return false; + return self.ignore.some(function(item) { + return item.matcher.match(path27) || !!(item.gmatcher && item.gmatcher.match(path27)); + }); } - function findNearestWithEnd(ctx) { - while (!ctx.rule.end) { - ctx = must(ctx.parent); - } - return ctx; + function childrenIgnored(self, path27) { + if (!self.ignore.length) + return false; + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path27)); + }); } } }); -// node_modules/cspell-grammar/dist/cjs/parser/index.js -var require_parser = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parser/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.tokenizeText = exports.tokenizeLine = exports.compileGrammar = void 0; - var grammar_js_1 = require_grammar(); - Object.defineProperty(exports, "compileGrammar", { enumerable: true, get: function() { - return grammar_js_1.compileGrammar; - } }); - var tokenizeLine_js_1 = require_tokenizeLine(); - Object.defineProperty(exports, "tokenizeLine", { enumerable: true, get: function() { - return tokenizeLine_js_1.tokenizeLine; - } }); - Object.defineProperty(exports, "tokenizeText", { enumerable: true, get: function() { - return tokenizeLine_js_1.tokenizeText; - } }); - } -}); - -// node_modules/cspell-grammar/dist/cjs/grammars/typescript.js -var require_typescript = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/grammars/typescript.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.grammar = void 0; - var repository = { - statements: { - name: "code.ts", - patterns: [ - "#keyword", - "#regexp", - "#string", - "#comment", - "#braces", - "#punctuation", - "#space", - { name: "identifier", match: /[^\s;,!|&:^%{}[\]()*/+=<>]+/ } - ] - }, - keyword: { - patterns: ["#keywordBase", "#standardTypes", "#standardLib"] - }, - keywordBase: { - name: "keyword.typescript.ts", - match: /\b(?:any|as|async|await|bigint|boolean|break|case|catch|const|continue|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|in|instanceof|interface|import|let|map|module|new|new|null|number|of|package|private|public|require|return|set|static|string|super|switch|this|throw|true|try|type|typeof|unknown|undefined|var|void|while|yield)\b/ - }, - standardTypes: { - name: "keyword.type.ts", - match: /\b(?:Promise|Record|Omit|Extract|Exclude|BigInt|Array)\b/ - }, - standardLib: { - name: "keyword.lib.ts", - match: /\b(?:console|process|window)\b/ - }, - string: { - patterns: ["#string_q_single", "#string_q_double", "#string_template"] - }, - string_q_single: { - name: "string.quoted.single.ts", - begin: "'", - end: /'|((?:[^\\\n])$)/, - captures: "punctuation.string.ts", - patterns: [{ include: "#string_character_escape" }] - }, - string_q_double: { - name: "string.quoted.double.ts", - begin: '"', - end: /"|((?:[^\\\n])$)/, - captures: "punctuation.string.ts", - patterns: [{ include: "#string_character_escape" }] - }, - string_template: { - name: "string.template.ts", - begin: "`", - end: "`", - captures: "punctuation.string.ts", - patterns: [ - { - name: "meta.template.expression.ts", - contentName: "meta.embedded.line.ts", - begin: "${", - end: "}", - patterns: ["#statements"], - captures: "punctuation.definition.template.expression.ts" - }, - { include: "#string_character_escape" } - ] - }, - string_character_escape: { - name: "constant.character.escape.ts", - match: /\\(x[0-9A-Fa-f]{2}|[0-3][0-7]{0,2}|[4-7][0-7]?|u[0-9A-Fa-f]{4}|.|\r?\n?$)/ - }, - braces: { - patterns: [ - { - begin: "(", - end: ")", - captures: "punctuation.meta.brace.ts", - patterns: ["#statements"], - name: "meta.brace.ts", - contentName: "code.ts" - }, - { - begin: "{", - end: "}", - captures: "punctuation.meta.brace.ts", - patterns: ["#statements"], - name: "meta.brace.ts", - contentName: "code.ts" - }, - { - begin: "[", - end: "]", - captures: "punctuation.meta.brace.ts", - patterns: ["#statements"], - name: "meta.brace.ts", - contentName: "code.ts" - } - ] - }, - punctuation: { - name: "punctuation.ts", - match: /[-;:,!|&^%*/+=<>\n\r]/ - }, - space: { - name: "punctuation.space.ts", - match: /\s+/ - }, - comment: { - patterns: [ - { - name: "comment.line.ts", - comment: "line comment", - begin: "//", - end: /(?=$)/, - captures: "punctuation.definition.comment.ts" - }, - { - name: "comment.block.documentation.ts", - comment: "DocBlock", - begin: /\/\*\*(?!\/)/, - captures: "punctuation.definition.comment.ts", - end: "*/" - }, - { - name: "comment.block.ts", - begin: "/*", - end: "*/", - captures: "punctuation.definition.comment.ts" - } - ] - }, - regexp: { - name: "regexp.ts", - begin: /\/(?![/*])/, - end: /\/([a-z]*)/i, - beginCaptures: "punctuation.begin.regexp.ts", - endCaptures: "punctuation.end.regexp.ts", - patterns: ["#regexp_escape", "#regexp_brace"] - }, - regexp_escape: { - name: "escape.regexp.ts", - match: /\\./ - }, - regexp_brace: { - name: "brace.regexp.ts", - begin: "[", - end: "]", - contentName: "character-class.regexp.ts", - patterns: ["#regexp_escape"] - } - }; - exports.grammar = { - name: "TypeScript", - scopeName: "source.ts", - patterns: [ - { - name: "comment.line.shebang.ts", - match: /^#!.*(?=$)/ - }, - { - include: "#statements" - } - ], - repository - }; - } -}); - -// node_modules/cspell-grammar/dist/cjs/mappers/appendMappedText.js -var require_appendMappedText = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/mappers/appendMappedText.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.appendMappedText = void 0; - var assert_1 = __importDefault(require("assert")); - function appendMappedText(a, b) { - if (!a.map && !b.map) { - return { text: a.text + b.text }; - } - const aLen = a.text.length; - const bLen = b.text.length; - const aMap = [0, 0].concat(a.map || [0, 0, aLen, aLen]); - const bMap = [0, 0].concat(b.map || [0, 0, bLen, bLen]); - (0, assert_1.default)(aMap[aMap.length - 1] === aLen); - (0, assert_1.default)(bMap[bMap.length - 1] === bLen); - (0, assert_1.default)((aMap.length & 1) === 0); - (0, assert_1.default)((bMap.length & 1) === 0); - return { - text: a.text + b.text, - map: joinMaps(aMap, bMap) - }; +// node_modules/glob/sync.js +var require_sync7 = __commonJS({ + "node_modules/glob/sync.js"(exports, module2) { + module2.exports = globSync; + globSync.GlobSync = GlobSync; + var rp = require_fs5(); + var minimatch = require_minimatch(); + var Minimatch = minimatch.Minimatch; + var Glob = require_glob().Glob; + var util = require("util"); + var path26 = require("path"); + var assert20 = require("assert"); + var isAbsolute = require_path_is_absolute(); + var common = require_common5(); + var setopts = common.setopts; + var ownProp = common.ownProp; + var childrenIgnored = common.childrenIgnored; + var isIgnored = common.isIgnored; + function globSync(pattern, options) { + if (typeof options === "function" || arguments.length === 3) + throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167"); + return new GlobSync(pattern, options).found; } - exports.appendMappedText = appendMappedText; - function joinMaps(aMap, bMap) { - const n = aMap.length - 1; - const offsets = [aMap[n - 1], aMap[n]]; - const ab = aMap.concat(bMap.map((v, i) => v + offsets[i & 1])); - const r = [0, 0]; - let last0 = 0, last1 = 0; - for (let i = 0; i < ab.length; i += 2) { - const v0 = ab[i]; - const v12 = ab[i + 1]; - if (v0 === last0 && v12 === last1) { - continue; - } - r.push(v0, v12); - last0 = v0; - last1 = v12; + function GlobSync(pattern, options) { + if (!pattern) + throw new Error("must provide pattern"); + if (typeof options === "function" || arguments.length === 3) + throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167"); + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options); + setopts(this, pattern, options); + if (this.noprocess) + return this; + var n = this.minimatch.set.length; + this.matches = new Array(n); + for (var i = 0; i < n; i++) { + this._process(this.minimatch.set[i], i, false); } - return r; + this._finish(); } - } -}); - -// node_modules/cspell-grammar/dist/cjs/mappers/typescript.js -var require_typescript2 = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/mappers/typescript.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.mapRawString = void 0; - var hexChars = { - "0": 0, - "1": 1, - "2": 2, - "3": 3, - "4": 4, - "5": 5, - "6": 6, - "7": 7, - "8": 8, - "9": 9, - A: 10, - B: 11, - C: 12, - D: 13, - E: 14, - F: 15, - a: 10, - b: 11, - c: 12, - d: 13, - e: 14, - f: 15 - }; - var escapeChars = { - t: " ", - n: "\n", - r: "\r", - b: "\b", - "\\": "\\", - '"': '"', - "'": "'", - "\n": "" - }; - function mapRawString(text) { - const end = text.length; - let t = ""; - const map = []; - const isHex = /^[0-9a-fA-F]+$/; - let i, j; - for (i = 0, j = 0; i < end; ++i) { - let parsed; - const ti = text[i]; - if (ti === "\\") { - map.push(i, j); - const tc = text[++i]; - const ec = escapeChars[tc]; - if (ec) { - t += ec; - j += ec.length; - map.push(i, j); - continue; - } - switch (tc) { - case "u": - { - let char; - let end2; - if (text[i + 1] !== "{") { - const digits = text.slice(i + 1, i + 5); - parsed = isHex.test(digits) ? parseInt(digits, 16) : NaN; - char = isNaN(parsed) ? "" : String.fromCharCode(parsed); - end2 = i + 4; - } else { - for (end2 = i + 2; text[end2] in hexChars; ++end2) { - } - if (text[end2] !== "}") { - char = ""; - } else { - const digits = text.slice(i + 2, end2); - parsed = isHex.test(digits) ? parseInt(digits, 16) : NaN; - char = isNaN(parsed) ? "" : String.fromCodePoint(parsed); - } - } - if (!char) { - t += tc; - j += 1; - } else { - t += char; - j += char.length; - i = end2; - } - } - break; - case "x": - { - const digits = text.slice(i + 1, i + 3); - parsed = isHex.test(digits) ? parseInt(digits, 16) : NaN; - if (isNaN(parsed)) { - t += tc; - j += 1; - } else { - t += String.fromCharCode(parsed); - i += 2; - ++j; - } - } - break; - case "0": - t += "0"; - j += 1; - break; - case "\r": - i += text[i + 1] === "\n" ? 1 : 0; - break; - case "\n": - break; - case void 0: - break; - default: - t += tc; - ++j; - break; + GlobSync.prototype._finish = function() { + assert20.ok(this instanceof GlobSync); + if (this.realpath) { + var self = this; + this.matches.forEach(function(matchset, index) { + var set = self.matches[index] = /* @__PURE__ */ Object.create(null); + for (var p in matchset) { + try { + p = self._makeAbs(p); + var real = rp.realpathSync(p, self.realpathCache); + set[real] = true; + } catch (er) { + if (er.syscall === "stat") + set[self._makeAbs(p)] = true; + else + throw er; + } } - map.push(i + 1, j); - continue; - } - t += ti; - ++j; - } - if (map.length) { - const ii = map[map.length - 2]; - const jj = map[map.length - 1]; - if (ii !== i || jj !== j) { - map.push(i, j); - } + }); } - return { - text: t, - map - }; - } - exports.mapRawString = mapRawString; - } -}); - -// node_modules/cspell-grammar/dist/cjs/parser/parser.js -var require_parser2 = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parser/parser.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createParser = exports.parseDocument = void 0; - var sync_1 = require_sync(); - var tokenizeLine_js_1 = require_tokenizeLine(); - function parseDocument(grammar, _filename, content, emitter = (line) => console.log(line)) { - const r = (0, tokenizeLine_js_1.tokenizeText)(content, grammar); - const tokens = (0, sync_1.pipe)(r, (0, sync_1.opMap)((tl) => tl.tokens.map((t) => ({ t, l: tl.line }))), (0, sync_1.opFlatten)(), (0, sync_1.opFilter)((t) => !t.t.scope.value.startsWith("punctuation"))); - for (const { t: token, l: line } of tokens) { - emitter(`${(token.range[2] ?? line.lineNumber) + 1}:${token.range[0] + 1} ${JSON.stringify(token.text)} ${token.scope.toString()}`); + common.finish(this); + }; + GlobSync.prototype._process = function(pattern, index, inGlobStar) { + assert20.ok(this instanceof GlobSync); + var n = 0; + while (typeof pattern[n] === "string") { + n++; } - } - exports.parseDocument = parseDocument; - function mapTokenizedLine(tl) { - return tl.tokens.map((t) => ({ - text: t.text, - range: [tl.offset + t.range[0], tl.offset + t.range[1]], - scope: t.scope - })); - } - function mapTokenizedLines(itl) { - return (0, sync_1.pipe)(itl, (0, sync_1.opMap)(mapTokenizedLine), (0, sync_1.opFlatten)()); - } - function createParser(grammar, name, transform = mapTokenizedLines) { - function parse3(content, filename) { - const parsedTexts = (0, sync_1.pipe)((0, tokenizeLine_js_1.tokenizeTextIterable)(content, grammar), transform); - return { content, filename, parsedTexts }; + var prefix; + switch (n) { + case pattern.length: + this._processSimple(pattern.join("/"), index); + return; + case 0: + prefix = null; + break; + default: + prefix = pattern.slice(0, n).join("/"); + break; } - return { name, parse: parse3 }; - } - exports.createParser = createParser; - } -}); - -// node_modules/cspell-grammar/dist/cjs/parsers/typescript/TypeScriptParser.js -var require_TypeScriptParser = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parsers/typescript/TypeScriptParser.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parser = void 0; - var sync_1 = require_sync(); - var typescript_js_1 = require_typescript(); - var appendMappedText_js_1 = require_appendMappedText(); - var typescript_js_2 = require_typescript2(); - var grammar_js_1 = require_grammar(); - var parser_js_1 = require_parser2(); - var scope_js_1 = require_scope(); - var tsGrammar = (0, grammar_js_1.compileGrammar)(typescript_js_1.grammar); - var pool = new scope_js_1.ScopePool(); - var useScope = /* @__PURE__ */ new WeakMap(); - function* transform(texts) { - for (const parsed of texts) { - if (doesScopeMatch(parsed.scope, "constant.character.escape.ts")) { - const mapped = (0, typescript_js_2.mapRawString)(parsed.text); - const scope = parsed.scope ? pool.parseScope(parsed.scope) : void 0; - yield { - text: mapped.text, - scope: scope?.parent, - map: mapped.map, - range: parsed.range - }; - continue; + var remain = pattern.slice(n); + var read2; + if (prefix === null) + read2 = "."; + else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) { + return typeof p === "string" ? p : "[*]"; + }).join("/"))) { + if (!prefix || !isAbsolute(prefix)) + prefix = "/" + prefix; + read2 = prefix; + } else + read2 = prefix; + var abs = this._makeAbs(read2); + if (childrenIgnored(this, read2)) + return; + var isGlobStar = remain[0] === minimatch.GLOBSTAR; + if (isGlobStar) + this._processGlobStar(prefix, read2, abs, remain, index, inGlobStar); + else + this._processReaddir(prefix, read2, abs, remain, index, inGlobStar); + }; + GlobSync.prototype._processReaddir = function(prefix, read2, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar); + if (!entries) + return; + var pn = remain[0]; + var negate = !!this.minimatch.negate; + var rawGlob = pn._glob; + var dotOk = this.dot || rawGlob.charAt(0) === "."; + var matchedEntries = []; + for (var i = 0; i < entries.length; i++) { + var e = entries[i]; + if (e.charAt(0) !== "." || dotOk) { + var m; + if (negate && !prefix) { + m = !e.match(pn); + } else { + m = e.match(pn); + } + if (m) + matchedEntries.push(e); } - yield parsed; } - } - function* mergeStringResults(results) { - let last; - for (const next of results) { - if (!doesScopeMatch(next.scope, "string.")) { - if (last) { - yield last; - last = void 0; + var len = matchedEntries.length; + if (len === 0) + return; + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = /* @__PURE__ */ Object.create(null); + for (var i = 0; i < len; i++) { + var e = matchedEntries[i]; + if (prefix) { + if (prefix.slice(-1) !== "/") + e = prefix + "/" + e; + else + e = prefix + e; } - yield next; - continue; - } - if (!last) { - last = next; - continue; - } - if (next.scope !== last.scope || last.range[1] !== next.range[0]) { - yield last; - last = next; - continue; + if (e.charAt(0) === "/" && !this.nomount) { + e = path26.join(this.root, e); + } + this._emitMatch(index, e); } - last = mergeParsedText(last, next); - } - if (last) - yield last; - } - function mergeParsedText(a, b) { - const abT = (0, appendMappedText_js_1.appendMappedText)(a, b); - const ab = { - text: abT.text, - scope: a.scope, - range: [a.range[0], b.range[1]], - map: abT.map, - delegate: a.delegate - }; - return ab; - } - function filterScope(scope) { - const cached = useScope.get(scope); - if (cached !== void 0) - return cached; - const value = scope.value; - const use = !value.startsWith("punctuation") && !value.startsWith("keyword."); - useScope.set(scope, use); - return use; - } - function mapTokenizedLine(tl) { - return tl.tokens.filter((t) => filterScope(t.scope)).map((t) => ({ - text: t.text, - range: [tl.offset + t.range[0], tl.offset + t.range[1]], - scope: t.scope - })); - } - function mapTokenizedLines(itl) { - return (0, sync_1.pipe)(itl, (0, sync_1.opMap)(mapTokenizedLine), (0, sync_1.opFlatten)(), transform, mergeStringResults); - } - exports.parser = (0, parser_js_1.createParser)(tsGrammar, "typescript", mapTokenizedLines); - function doesScopeMatch(s, match) { - if (!s) - return false; - return typeof s === "string" ? s.startsWith(match) : s.value.startsWith(match); - } - } -}); - -// node_modules/cspell-grammar/dist/cjs/parsers/typescript/index.js -var require_typescript3 = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parsers/typescript/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parser = void 0; - var TypeScriptParser_js_1 = require_TypeScriptParser(); - Object.defineProperty(exports, "parser", { enumerable: true, get: function() { - return TypeScriptParser_js_1.parser; - } }); - } -}); - -// node_modules/cspell-grammar/dist/cjs/parsers/index.js -var require_parsers = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/parsers/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parsers = void 0; - var index_js_1 = require_typescript3(); - exports.parsers = [index_js_1.parser]; - } -}); - -// node_modules/cspell-grammar/dist/cjs/index.js -var require_cjs6 = __commonJS({ - "node_modules/cspell-grammar/dist/cjs/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parsers = exports.tokenizeText = exports.tokenizeLine = exports.compileGrammar = void 0; - var index_js_1 = require_parser(); - Object.defineProperty(exports, "compileGrammar", { enumerable: true, get: function() { - return index_js_1.compileGrammar; - } }); - Object.defineProperty(exports, "tokenizeLine", { enumerable: true, get: function() { - return index_js_1.tokenizeLine; - } }); - Object.defineProperty(exports, "tokenizeText", { enumerable: true, get: function() { - return index_js_1.tokenizeText; - } }); - var index_js_2 = require_parsers(); - Object.defineProperty(exports, "parsers", { enumerable: true, get: function() { - return index_js_2.parsers; - } }); - } -}); - -// node_modules/cspell-lib/dist/lib-cjs/pkg-info.cjs -var require_pkg_info = __commonJS({ - "node_modules/cspell-lib/dist/lib-cjs/pkg-info.cjs"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.srcDirectory = void 0; - exports.srcDirectory = __dirname; - } -}); - -// node_modules/cspell-lib/dist/lib-cjs/index.cjs -var require_lib_cjs = __commonJS({ - "node_modules/cspell-lib/dist/lib-cjs/index.cjs"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.srcDirectory = void 0; - var pkg_info_cjs_1 = require_pkg_info(); - Object.defineProperty(exports, "srcDirectory", { enumerable: true, get: function() { - return pkg_info_cjs_1.srcDirectory; - } }); - } -}); - -// node_modules/cspell-lib/dist/cjs/Models/PatternRegExp.js -var require_PatternRegExp = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Models/PatternRegExp.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.PatternRegExp = void 0; - var PatternRegExp = class extends RegExp { - constructor(pattern) { - super(pattern); + return; } - toJSON() { - return this.toString(); + remain.shift(); + for (var i = 0; i < len; i++) { + var e = matchedEntries[i]; + var newPattern; + if (prefix) + newPattern = [prefix, e]; + else + newPattern = [e]; + this._process(newPattern.concat(remain), index, inGlobStar); } }; - exports.PatternRegExp = PatternRegExp; - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/LanguageSettings.js -var require_LanguageSettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/LanguageSettings.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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]; - } }; + GlobSync.prototype._emitMatch = function(index, e) { + if (isIgnored(this, e)) + return; + var abs = this._makeAbs(e); + if (this.mark) + e = this._mark(e); + if (this.absolute) { + e = abs; } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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); + if (this.matches[index][e]) + return; + if (this.nodir) { + var c = this.cache[abs]; + if (c === "DIR" || Array.isArray(c)) + return; } - __setModuleDefault(result, mod); - return result; + this.matches[index][e] = true; + if (this.stat) + this._stat(e); }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.calcSettingsForLanguageId = exports.calcUserSettingsForLanguage = exports.calcSettingsForLanguage = exports.isValidLocaleIntlFormat = exports.isLocaleInSet = exports.normalizeLocaleIntl = exports.normalizeLocale = exports.normalizeLanguageId = exports.getDefaultLanguageSettings = void 0; - var AutoResolve_js_1 = require_AutoResolve(); - var util_js_1 = require_util(); - var SpellSettings = __importStar(require_CSpellSettingsServer()); - var defaultLocale = "en"; - var defaultLanguageSettings = []; - function getDefaultLanguageSettings() { - return defaultLanguageSettings; - } - exports.getDefaultLanguageSettings = getDefaultLanguageSettings; - function localesToList(locales) { - return stringToList(locales.replace(/\s+/g, ",")); - } - function stringToList(sList) { - return sList.replace(/[|;]/g, ",").split(",").map((s) => s.trim()).filter((s) => !!s); - } - function memorizer(resolver) { - const cache = (0, AutoResolve_js_1.createAutoResolveCache)(); - return (k) => cache.get(k, resolver); - } - var _normalizeLanguageId = memorizer(__normalizeLanguageId); - function __normalizeLanguageId(langId) { - const langIds = stringToList(langId); - return new Set(langIds.map((a) => a.toLowerCase())); - } - function normalizeLanguageId(langId) { - return _normalizeLanguageId(typeof langId === "string" ? langId : langId.join(",")); - } - exports.normalizeLanguageId = normalizeLanguageId; - var _normalizeLocale = memorizer(__normalizeLocale); - function __normalizeLocale(locale) { - const locales = localesToList(locale); - return new Set(locales.map((locale2) => locale2.toLowerCase().replace(/[^a-z]/g, ""))); - } - function normalizeLocale(locale) { - locale = typeof locale === "string" ? locale : locale.join(","); - return _normalizeLocale(locale); - } - exports.normalizeLocale = normalizeLocale; - function normalizeLocaleIntl(locale) { - const values = [...normalizeLocale(locale)].map((locale2) => locale2.replace(/^([a-z]{2})-?([a-z]{2})$/, (_, lang, locale3) => locale3 ? `${lang}-${locale3.toUpperCase()}` : lang)); - return new Set(values); - } - exports.normalizeLocaleIntl = normalizeLocaleIntl; - function isLocaleInSet(locale, setOfLocals) { - const locales = normalizeLocale(locale); - return (0, util_js_1.doSetsIntersect)(locales, setOfLocals); - } - exports.isLocaleInSet = isLocaleInSet; - var regExpValidIntlLocaleStrict = /^[a-z]{2}(-[A-Z]{2})?$/; - var regExpValidIntlLocale = new RegExp(regExpValidIntlLocaleStrict, "i"); - function isValidLocaleIntlFormat(locale, strict = false) { - if (typeof locale === "string") - return strict ? regExpValidIntlLocaleStrict.test(locale) : regExpValidIntlLocale.test(locale); - for (const item of locale) { - if (!isValidLocaleIntlFormat(item, strict)) - return false; + GlobSync.prototype._readdirInGlobStar = function(abs) { + if (this.follow) + return this._readdir(abs, false); + var entries; + var lstat; + var stat2; + try { + lstat = this.fs.lstatSync(abs); + } catch (er) { + if (er.code === "ENOENT") { + return null; + } } - return locale.length > 0; - } - exports.isValidLocaleIntlFormat = isValidLocaleIntlFormat; - var cacheCalcSettingsForLanguage = /* @__PURE__ */ new WeakMap(); - function calcSettingsForLanguage(languageSettings, languageId, locale) { - const mapLang = (0, AutoResolve_js_1.autoResolveWeak)(cacheCalcSettingsForLanguage, languageSettings, () => /* @__PURE__ */ new Map()); - const mapLocale = (0, AutoResolve_js_1.autoResolve)(mapLang, languageId, () => /* @__PURE__ */ new Map()); - return (0, AutoResolve_js_1.autoResolve)(mapLocale, locale, () => _calcSettingsForLanguage(languageSettings, languageId, locale)); - } - exports.calcSettingsForLanguage = calcSettingsForLanguage; - function _calcSettingsForLanguage(languageSettings, languageId, locale) { - languageId = languageId.toLowerCase(); - const allowedLocals = normalizeLocale(locale); - const ls = languageSettings.filter((s) => doesLanguageSettingMatchLanguageId(s, languageId)).filter((s) => !s.locale || s.locale === "*" || isLocaleInSet(s.locale, allowedLocals)).map((langSetting) => { - const { languageId: _languageId, locale: _locale, ...s } = langSetting; - return s; - }).reduce((langSetting, setting) => SpellSettings.mergeSettings(langSetting, setting), {}); - ls.languageId = languageId; - ls.locale = locale; - return ls; - } - var cacheDoesLanguageSettingMatchLanguageId = /* @__PURE__ */ new WeakMap(); - function doesLanguageSettingMatchLanguageId(s, languageId) { - const r = cacheDoesLanguageSettingMatchLanguageId.get(s) ?? /* @__PURE__ */ new Map(); - const f = r.get(languageId); - if (f !== void 0) { - return f; - } - const v = _doesLanguageSettingMatchLanguageId(s, languageId); - r.set(languageId, v); - cacheDoesLanguageSettingMatchLanguageId.set(s, r); - return v; - } - function _doesLanguageSettingMatchLanguageId(s, languageId) { - const languageSettingsLanguageIds = s.languageId; - if (!languageSettingsLanguageIds || languageSettingsLanguageIds === "*") - return true; - const ids = normalizeLanguageId(languageSettingsLanguageIds); - if (ids.has(languageId)) - return true; - if (ids.has("!" + languageId)) - return false; - const numExcludes = [...ids].filter((id) => id.startsWith("!")).length; - return numExcludes === ids.size; - } - function calcUserSettingsForLanguage(settings, languageId) { - const { languageSettings = [], language: locale = defaultLocale, allowCompoundWords, enabled } = settings; - const langSettings = { - allowCompoundWords, - enabled, - ...calcSettingsForLanguage(languageSettings, languageId, locale) - }; - return SpellSettings.mergeSettings(settings, langSettings); - } - exports.calcUserSettingsForLanguage = calcUserSettingsForLanguage; - function calcSettingsForLanguageId(baseSettings, languageId) { - const langIds = ["*", ...normalizeLanguageId(languageId)]; - const langSettings = langIds.reduce((settings, languageId2) => { - return calcUserSettingsForLanguage(settings, languageId2); - }, baseSettings); - return langSettings; - } - exports.calcSettingsForLanguageId = calcSettingsForLanguageId; - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/RegExpPatterns.js -var require_RegExpPatterns = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/RegExpPatterns.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.regExHashStrings = exports.regExSha = exports.regExRepeatedChar = exports.regExEmail = exports.rexExPythonStyleComments = exports.regExCStyleComments = exports.regExString = exports.regExPhpHereDoc = exports.regExBase64MultiLine = exports.regExBase64SingleLine = exports.regExBase64 = exports.regExEscapeCharacters = exports.regExSshRSA = exports.regExCert = exports.regExPublicKey = exports.regExIgnoreSpellingDirectives = exports.regExSpellingGuardLine = exports.regExSpellingGuardNext = exports.regExSpellingGuardBlock = exports.regExUnicodeRef = exports.regExUUID = exports.regExCSSHexValue = exports.regExCStyleHexValue = exports.regExCommitHashLink = exports.regExCommitHash = exports.regExMatchCommonHexFormats = exports.regExHRef = exports.regExMatchUrls = void 0; - exports.regExMatchUrls = /(?:https?|ftp):\/\/[^\s"]+/gi; - exports.regExHRef = /\bhref\s*=\s*".*?"/gi; - exports.regExMatchCommonHexFormats = /(?:#[0-9a-f]{3,8})|(?:0x[0-9a-f]+)|(?:\\u[0-9a-f]{4})|(?:\\x\{[0-9a-f]{4}\})/gi; - exports.regExCommitHash = /\b(?![a-f]+\b)(?:0x)?[0-9a-f]{7,}\b/gi; - exports.regExCommitHashLink = /\[[0-9a-f]{7,}\]/gi; - exports.regExCStyleHexValue = /\b0x[0-9a-f]+\b/gi; - exports.regExCSSHexValue = /#[0-9a-f]{3,8}\b/gi; - exports.regExUUID = /\b[0-9a-fx]{8}-[0-9a-fx]{4}-[0-9a-fx]{4}-[0-9a-fx]{4}-[0-9a-fx]{12}\b/gi; - exports.regExUnicodeRef = /\bU\+[0-9a-f]{4,5}(?:-[0-9a-f]{4,5})?/gi; - exports.regExSpellingGuardBlock = /(\bc?spell(?:-?checker)?::?)\s*disable(?!-line|-next)\b(?!-)[\s\S]*?((?:\1\s*enable\b)|$)/gi; - exports.regExSpellingGuardNext = /\bc?spell(?:-?checker)?::?\s*disable-next\b.*\s\s?.*/gi; - exports.regExSpellingGuardLine = /^.*\bc?spell(?:-?checker)?::?\s*disable-line\b.*/gim; - exports.regExIgnoreSpellingDirectives = /\bc?spell(?:-?checker)?::?\s*ignoreRegExp.*/gim; - exports.regExPublicKey = /-{5}BEGIN\s+((?:RSA\s+)?PUBLIC\s+KEY)[\w=+\-/=\\\s]+?END\s+\1-{5}/g; - exports.regExCert = /-{5}BEGIN\s+(CERTIFICATE|(?:RSA\s+)?(?:PRIVATE|PUBLIC)\s+KEY)[\w=+\-/=\\\s]+?END\s+\1-{5}/g; - exports.regExSshRSA = /ssh-rsa\s+[a-z0-9/+]{28,}={0,3}(?![a-z0-9/+=])/gi; - exports.regExEscapeCharacters = /\\(?:[anrvtbf]|[xu][a-f0-9]+)/gi; - exports.regExBase64 = /(??/gi; - exports.regExRepeatedChar = /^(\w)\1{3,}$/i; - exports.regExSha = /\bsha\d+-[a-z0-9+/]{25,}={0,3}/gi; - exports.regExHashStrings = /(?:\b(?:sha\d+|md5|base64|crypt|bcrypt|scrypt|security-token|assertion)[-,:$=]|#code[/])[-\w/+%.]{25,}={0,3}(?:(['"])\s*\+?\s*\1?[-\w/+%.]+={0,3})*(?![-\w/+=%.])/gi; - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/DefaultSettings.js -var require_DefaultSettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/DefaultSettings.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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]; - } }; + var isSym = lstat && lstat.isSymbolicLink(); + this.symlinks[abs] = isSym; + if (!isSym && lstat && !lstat.isDirectory()) + this.cache[abs] = "FILE"; + else + entries = this._readdir(abs, false); + return entries; + }; + GlobSync.prototype._readdir = function(abs, inGlobStar) { + var entries; + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs); + if (ownProp(this.cache, abs)) { + var c = this.cache[abs]; + if (!c || c === "FILE") + return null; + if (Array.isArray(c)) + return c; } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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); + try { + return this._readdirEntries(abs, this.fs.readdirSync(abs)); + } catch (er) { + this._readdirError(abs, er); + return null; } - __setModuleDefault(result, mod); - return result; }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getDefaultBundledSettings = exports.getDefaultSettings = exports._defaultSettings = exports._defaultSettingsBasis = void 0; - var cspell_grammar_1 = require_cjs6(); - var index_cjs_1 = require_lib_cjs(); - var CSpellSettingsInternalDef_js_1 = require_CSpellSettingsInternalDef(); - var PatternRegExp_js_1 = require_PatternRegExp(); - var resolveFile_js_1 = require_resolveFile(); - var index_js_1 = require_configLoader2(); - var CSpellSettingsServer_js_1 = require_CSpellSettingsServer(); - var LanguageSettings = __importStar(require_LanguageSettings()); - var RegPat = __importStar(require_RegExpPatterns()); - var defaultConfigFileModuleRef = "@cspell/cspell-bundled-dicts/cspell-default.json"; - var defaultConfigFile = resolveConfigModule(defaultConfigFileModuleRef); - var regExpSpellCheckerDisable = [ - new PatternRegExp_js_1.PatternRegExp(RegPat.regExSpellingGuardBlock), - new PatternRegExp_js_1.PatternRegExp(RegPat.regExSpellingGuardLine), - new PatternRegExp_js_1.PatternRegExp(RegPat.regExSpellingGuardNext) - ]; - var predefinedPatterns = [ - // Exclude patterns - { name: "CommitHash", pattern: RegPat.regExCommitHash }, - { name: "CommitHashLink", pattern: RegPat.regExCommitHashLink }, - { name: "CStyleHexValue", pattern: RegPat.regExCStyleHexValue }, - { name: "CSSHexValue", pattern: RegPat.regExCSSHexValue }, - { name: "Urls", pattern: RegPat.regExMatchUrls }, - { name: "HexValues", pattern: RegPat.regExMatchCommonHexFormats }, - { name: "SpellCheckerDisable", pattern: regExpSpellCheckerDisable }, - { name: "PublicKey", pattern: RegPat.regExPublicKey }, - { name: "RsaCert", pattern: RegPat.regExCert }, - { name: "SshRsa", pattern: RegPat.regExSshRSA }, - { name: "EscapeCharacters", pattern: RegPat.regExEscapeCharacters }, - { name: "Base64", pattern: RegPat.regExBase64 }, - { name: "Base64SingleLine", pattern: RegPat.regExBase64SingleLine }, - { name: "Base64MultiLine", pattern: RegPat.regExBase64MultiLine }, - { name: "Email", pattern: RegPat.regExEmail }, - { name: "SHA", pattern: RegPat.regExSha }, - { name: "HashStrings", pattern: RegPat.regExHashStrings }, - { name: "UnicodeRef", pattern: RegPat.regExUnicodeRef }, - { name: "UUID", pattern: RegPat.regExUUID }, - { name: "href", pattern: RegPat.regExHRef }, - { name: "SpellCheckerDisableBlock", pattern: RegPat.regExSpellingGuardBlock }, - { name: "SpellCheckerDisableLine", pattern: RegPat.regExSpellingGuardLine }, - { name: "SpellCheckerDisableNext", pattern: RegPat.regExSpellingGuardNext }, - { name: "SpellCheckerIgnoreInDocSetting", pattern: RegPat.regExIgnoreSpellingDirectives }, - // Include Patterns - { name: "PhpHereDoc", pattern: RegPat.regExPhpHereDoc }, - { name: "string", pattern: RegPat.regExString }, - { name: "CStyleComment", pattern: RegPat.regExCStyleComments }, - { name: "Everything", pattern: ".*" } - ]; - var defaultRegExpPatterns = [...predefinedPatterns].map(normalizePattern2); - var definedDefaultRegExpExcludeList = [ - "SpellCheckerDisable", - "SpellCheckerIgnoreInDocSetting", - "Urls", - "Email", - "RsaCert", - "SshRsa", - "Base64MultiLine", - "Base64SingleLine", - "CommitHash", - "CommitHashLink", - "CStyleHexValue", - "CSSHexValue", - "SHA", - "HashStrings", - "UnicodeRef", - "UUID" - ]; - var defaultRegExpExcludeList = definedDefaultRegExpExcludeList; - exports._defaultSettingsBasis = Object.freeze((0, CSpellSettingsInternalDef_js_1.createCSpellSettingsInternal)({ - id: "static_defaults", - language: "en", - name: "Static Defaults", - enabled: true, - enabledLanguageIds: [], - maxNumberOfProblems: 100, - numSuggestions: 10, - suggestionsTimeout: 500, - suggestionNumChanges: 3, - words: [], - userWords: [], - ignorePaths: [], - allowCompoundWords: false, - patterns: defaultRegExpPatterns, - ignoreRegExpList: [], - languageSettings: [], - source: { name: "defaultSettings" }, - reporters: [], - plugins: [{ parsers: cspell_grammar_1.parsers }] - })); - exports._defaultSettings = Object.freeze((0, CSpellSettingsInternalDef_js_1.createCSpellSettingsInternal)({ - ...exports._defaultSettingsBasis, - enabledLanguageIds: [ - "ada", - "csharp", - "go", - "javascript", - "javascriptreact", - "json", - "markdown", - "mdx", - "php", - "plaintext", - "python", - "text", - "typescript", - "typescriptreact", - "haskell", - "html", - "css", - "less", - "scss", - "latex", - "ruby", - "rust", - "shellscript", - "toml" - ], - ignoreRegExpList: defaultRegExpExcludeList, - languageSettings: LanguageSettings.getDefaultLanguageSettings() - })); - var getSettings = function() { - let settings = void 0; - return function(useDefaultDictionaries) { - if (!useDefaultDictionaries) { - return exports._defaultSettingsBasis; - } - if (!settings) { - const jsonSettings = (0, index_js_1.readSettings)(defaultConfigFile); - settings = (0, CSpellSettingsServer_js_1.mergeSettings)(exports._defaultSettings, jsonSettings); - if (jsonSettings.name !== void 0) { - settings.name = jsonSettings.name; - } else { - delete settings.name; - } - } - return settings; - }; - }(); - function resolveConfigModule(configModuleName) { - return (0, resolveFile_js_1.resolveFile)(configModuleName, index_cjs_1.srcDirectory).filename; - } - function normalizePattern2(pat) { - const { name, pattern, description } = pat; - if (!(pattern instanceof RegExp)) - return pat; - return { - name, - pattern: new PatternRegExp_js_1.PatternRegExp(pattern), - description - }; - } - function getDefaultSettings3(useDefaultDictionaries = true) { - return getSettings(useDefaultDictionaries); - } - exports.getDefaultSettings = getDefaultSettings3; - function getDefaultBundledSettings() { - return getDefaultSettings3(); - } - exports.getDefaultBundledSettings = getDefaultBundledSettings; - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/index.js -var require_Settings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getDefaultSettings = exports.getDefaultBundledSettings = exports.mergeSettings = exports.mergeInDocSettings = exports.getSources = exports.finalizeSettings = exports.extractDependencies = exports.checkFilenameMatchesGlob = exports.calcOverrideSettings = exports.ImportError = exports.sectionCSpell = exports.searchForConfig = exports.readSettingsFiles = exports.readSettings = exports.readRawSettings = exports.loadPnPSync = exports.loadPnP = exports.loadConfig = exports.getGlobalSettings = exports.getCachedFileSize = exports.extractImportErrors = exports.defaultFileName = exports.defaultConfigFilenames = exports.clearCachedSettingsFiles = exports.ENV_CSPELL_GLOB_ROOT = exports.currentSettingsFileVersion = void 0; - var constants_js_1 = require_constants3(); - Object.defineProperty(exports, "currentSettingsFileVersion", { enumerable: true, get: function() { - return constants_js_1.currentSettingsFileVersion; - } }); - Object.defineProperty(exports, "ENV_CSPELL_GLOB_ROOT", { enumerable: true, get: function() { - return constants_js_1.ENV_CSPELL_GLOB_ROOT; - } }); - var index_js_1 = require_configLoader2(); - Object.defineProperty(exports, "clearCachedSettingsFiles", { enumerable: true, get: function() { - return index_js_1.clearCachedSettingsFiles; - } }); - Object.defineProperty(exports, "defaultConfigFilenames", { enumerable: true, get: function() { - return index_js_1.defaultConfigFilenames; - } }); - Object.defineProperty(exports, "defaultFileName", { enumerable: true, get: function() { - return index_js_1.defaultFileName; - } }); - Object.defineProperty(exports, "extractImportErrors", { enumerable: true, get: function() { - return index_js_1.extractImportErrors; - } }); - Object.defineProperty(exports, "getCachedFileSize", { enumerable: true, get: function() { - return index_js_1.getCachedFileSize; - } }); - Object.defineProperty(exports, "getGlobalSettings", { enumerable: true, get: function() { - return index_js_1.getGlobalSettings; - } }); - Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function() { - return index_js_1.loadConfig; - } }); - Object.defineProperty(exports, "loadPnP", { enumerable: true, get: function() { - return index_js_1.loadPnP; - } }); - Object.defineProperty(exports, "loadPnPSync", { enumerable: true, get: function() { - return index_js_1.loadPnPSync; - } }); - Object.defineProperty(exports, "readRawSettings", { enumerable: true, get: function() { - return index_js_1.readRawSettings; - } }); - Object.defineProperty(exports, "readSettings", { enumerable: true, get: function() { - return index_js_1.readSettings; - } }); - Object.defineProperty(exports, "readSettingsFiles", { enumerable: true, get: function() { - return index_js_1.readSettingsFiles; - } }); - Object.defineProperty(exports, "searchForConfig", { enumerable: true, get: function() { - return index_js_1.searchForConfig; - } }); - Object.defineProperty(exports, "sectionCSpell", { enumerable: true, get: function() { - return index_js_1.sectionCSpell; - } }); - var ImportError_js_1 = require_ImportError(); - Object.defineProperty(exports, "ImportError", { enumerable: true, get: function() { - return ImportError_js_1.ImportError; - } }); - var CSpellSettingsServer_js_1 = require_CSpellSettingsServer(); - Object.defineProperty(exports, "calcOverrideSettings", { enumerable: true, get: function() { - return CSpellSettingsServer_js_1.calcOverrideSettings; - } }); - Object.defineProperty(exports, "checkFilenameMatchesGlob", { enumerable: true, get: function() { - return CSpellSettingsServer_js_1.checkFilenameMatchesGlob; - } }); - Object.defineProperty(exports, "extractDependencies", { enumerable: true, get: function() { - return CSpellSettingsServer_js_1.extractDependencies; - } }); - Object.defineProperty(exports, "finalizeSettings", { enumerable: true, get: function() { - return CSpellSettingsServer_js_1.finalizeSettings; - } }); - Object.defineProperty(exports, "getSources", { enumerable: true, get: function() { - return CSpellSettingsServer_js_1.getSources; - } }); - Object.defineProperty(exports, "mergeInDocSettings", { enumerable: true, get: function() { - return CSpellSettingsServer_js_1.mergeInDocSettings; - } }); - Object.defineProperty(exports, "mergeSettings", { enumerable: true, get: function() { - return CSpellSettingsServer_js_1.mergeSettings; - } }); - var DefaultSettings_js_1 = require_DefaultSettings(); - Object.defineProperty(exports, "getDefaultBundledSettings", { enumerable: true, get: function() { - return DefaultSettings_js_1.getDefaultBundledSettings; - } }); - Object.defineProperty(exports, "getDefaultSettings", { enumerable: true, get: function() { - return DefaultSettings_js_1.getDefaultSettings; - } }); - } -}); - -// node_modules/cspell-dictionary/dist/cjs/util/AutoCache.js -var require_AutoCache = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/util/AutoCache.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.extractStats = exports.autoCache = exports.createCache01 = void 0; - var CACHE_SIZE = 100; - var Cache01 = class { - constructor(maxSize) { - this.maxSize = maxSize; - this.count = 0; - this.cache0 = /* @__PURE__ */ Object.create(null); - this.cache1 = /* @__PURE__ */ Object.create(null); - this.hits = 0; - this.misses = 0; - this.swaps = 0; - } - get(key) { - const cache0 = this.cache0; - const cache1 = this.cache1; - if (key in cache0) { - ++this.hits; - return cache0[key]; - } - if (key in cache1) { - ++this.hits; - ++this.count; - const r = cache1[key]; - cache0[key] = r; - return r; - } - ++this.misses; - return void 0; - } - set(key, value) { - if (this.count >= this.maxSize) { - this.cache1 = this.cache0; - this.cache0 = /* @__PURE__ */ Object.create(null); - this.swaps++; - this.count = 0; + GlobSync.prototype._readdirEntries = function(abs, entries) { + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i++) { + var e = entries[i]; + if (abs === "/") + e = abs + e; + else + e = abs + "/" + e; + this.cache[e] = true; } - ++this.count; - this.cache0[key] = value; - return this; } + this.cache[abs] = entries; + return entries; }; - function createCache01(size) { - return new Cache01(size); - } - exports.createCache01 = createCache01; - function autoCache(fn, size = CACHE_SIZE) { - const cache = createCache01(size); - const ac = get; - ac.hits = 0; - ac.misses = 0; - ac.swaps = 0; - function get(k) { - const f = cache.get(k); - if (f !== void 0) { - ++ac.hits; - return f; - } - const r = fn(k); - cache.set(k, r); - ac.swaps = cache.swaps; - ++ac.misses; - return r; - } - return ac; - } - exports.autoCache = autoCache; - function extractStats(ac) { - const { hits, misses, swaps } = ac; - return { hits, misses, swaps }; - } - exports.extractStats = extractStats; - } -}); - -// node_modules/cspell-dictionary/dist/cjs/util/text.js -var require_text3 = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/util/text.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.removeUnboundAccents = exports.removeAccents = exports.matchCase = exports.lcFirst = exports.ucFirst = exports.isFirstCharacterLower = exports.isFirstCharacterUpper = exports.isLowerCase = exports.isUpperCase = void 0; - var regExFirstUpper = /^\p{Lu}\p{M}?\p{Ll}+$/u; - var regExAllUpper = /^(?:\p{Lu}\p{M}?)+$/u; - var regExAllLower = /^(?:\p{Ll}\p{M}?)+$/u; - var regExAccents = /\p{M}/gu; - function isUpperCase(word) { - return !!word.match(regExAllUpper); - } - exports.isUpperCase = isUpperCase; - function isLowerCase(word) { - return !!word.match(regExAllLower); - } - exports.isLowerCase = isLowerCase; - function isFirstCharacterUpper(word) { - return isUpperCase(word.slice(0, 1)); - } - exports.isFirstCharacterUpper = isFirstCharacterUpper; - function isFirstCharacterLower(word) { - return isLowerCase(word.slice(0, 1)); - } - exports.isFirstCharacterLower = isFirstCharacterLower; - function ucFirst(word) { - return word.slice(0, 1).toUpperCase() + word.slice(1); - } - exports.ucFirst = ucFirst; - function lcFirst(word) { - return word.slice(0, 1).toLowerCase() + word.slice(1); - } - exports.lcFirst = lcFirst; - function matchCase(example, word) { - if (example.match(regExFirstUpper)) { - return word.slice(0, 1).toUpperCase() + word.slice(1).toLowerCase(); - } - if (example.match(regExAllLower)) { - return word.toLowerCase(); + GlobSync.prototype._readdirError = function(f, er) { + switch (er.code) { + case "ENOTSUP": + case "ENOTDIR": + var abs = this._makeAbs(f); + this.cache[abs] = "FILE"; + if (abs === this.cwdAbs) { + var error2 = new Error(er.code + " invalid cwd " + this.cwd); + error2.path = this.cwd; + error2.code = er.code; + throw error2; + } + break; + case "ENOENT": + case "ELOOP": + case "ENAMETOOLONG": + case "UNKNOWN": + this.cache[this._makeAbs(f)] = false; + break; + default: + this.cache[this._makeAbs(f)] = false; + if (this.strict) + throw er; + if (!this.silent) + console.error("glob error", er); + break; } - if (example.match(regExAllUpper)) { - return word.toUpperCase(); + }; + GlobSync.prototype._processGlobStar = function(prefix, read2, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar); + if (!entries) + return; + var remainWithoutGlobStar = remain.slice(1); + var gspref = prefix ? [prefix] : []; + var noGlobStar = gspref.concat(remainWithoutGlobStar); + this._process(noGlobStar, index, false); + var len = entries.length; + var isSym = this.symlinks[abs]; + if (isSym && inGlobStar) + return; + for (var i = 0; i < len; i++) { + var e = entries[i]; + if (e.charAt(0) === "." && !this.dot) + continue; + var instead = gspref.concat(entries[i], remainWithoutGlobStar); + this._process(instead, index, true); + var below = gspref.concat(entries[i], remain); + this._process(below, index, true); } - if (isFirstCharacterUpper(example)) { - return ucFirst(word); + }; + GlobSync.prototype._processSimple = function(prefix, index) { + var exists = this._stat(prefix); + if (!this.matches[index]) + this.matches[index] = /* @__PURE__ */ Object.create(null); + if (!exists) + return; + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix); + if (prefix.charAt(0) === "/") { + prefix = path26.join(this.root, prefix); + } else { + prefix = path26.resolve(this.root, prefix); + if (trail) + prefix += "/"; + } } - if (isFirstCharacterLower(example)) { - return lcFirst(word); + if (process.platform === "win32") + prefix = prefix.replace(/\\/g, "/"); + this._emitMatch(index, prefix); + }; + GlobSync.prototype._stat = function(f) { + var abs = this._makeAbs(f); + var needDir = f.slice(-1) === "/"; + if (f.length > this.maxLength) + return false; + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs]; + if (Array.isArray(c)) + c = "DIR"; + if (!needDir || c === "DIR") + return c; + if (needDir && c === "FILE") + return false; } - return word; - } - exports.matchCase = matchCase; - function removeAccents(text) { - return text.normalize("NFD").replace(regExAccents, ""); - } - exports.removeAccents = removeAccents; - function removeUnboundAccents(text) { - return text.replace(regExAccents, ""); - } - exports.removeUnboundAccents = removeUnboundAccents; - } -}); - -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/SpellingDictionaryMethods.js -var require_SpellingDictionaryMethods = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/SpellingDictionaryMethods.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testMethods__ = exports.createWeightMapFromDictionaryInformation = exports.suggestArgsToSuggestOptions = exports.canonicalSearchOptions = exports.hasOptionToSearchOption = exports.wordSuggestForms = exports.wordSuggestFormsArray = exports.wordSearchForms = exports.defaultNumSuggestions = exports.suggestionCollector = exports.impersonateCollector = void 0; - var cspell_trie_lib_1 = require_cjs5(); - var text_js_1 = require_text3(); - var cspell_trie_lib_2 = require_cjs5(); - Object.defineProperty(exports, "impersonateCollector", { enumerable: true, get: function() { - return cspell_trie_lib_2.impersonateCollector; - } }); - Object.defineProperty(exports, "suggestionCollector", { enumerable: true, get: function() { - return cspell_trie_lib_2.suggestionCollector; - } }); - exports.defaultNumSuggestions = 10; - function wordSearchFormsArray(word, isDictionaryCaseSensitive, ignoreCase) { - return [...wordSearchForms(word, isDictionaryCaseSensitive, ignoreCase)]; - } - function wordSearchForms(word, isDictionaryCaseSensitive, ignoreCase) { - const forms = /* @__PURE__ */ new Set(); - word = word.normalize("NFC"); - const wordLc = word.toLowerCase(); - if (ignoreCase) { - if (isDictionaryCaseSensitive) { - forms.add(wordLc); - } else { - forms.add(wordLc); - forms.add((0, text_js_1.removeUnboundAccents)(wordLc)); + var exists; + var stat2 = this.statCache[abs]; + if (!stat2) { + var lstat; + try { + lstat = this.fs.lstatSync(abs); + } catch (er) { + if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) { + this.statCache[abs] = false; + return false; + } } - } else { - if (isDictionaryCaseSensitive) { - forms.add(word); - forms.add(wordLc); - if ((0, text_js_1.isUpperCase)(word)) { - forms.add((0, text_js_1.ucFirst)(wordLc)); + if (lstat && lstat.isSymbolicLink()) { + try { + stat2 = this.fs.statSync(abs); + } catch (er) { + stat2 = lstat; } } else { - forms.add(wordLc); - forms.add((0, text_js_1.removeUnboundAccents)(wordLc)); - } - } - return forms; - } - exports.wordSearchForms = wordSearchForms; - function wordSuggestFormsArray(word) { - return [...wordSuggestForms(word)]; - } - exports.wordSuggestFormsArray = wordSuggestFormsArray; - function wordSuggestForms(word) { - word = word.normalize("NFC"); - const forms = /* @__PURE__ */ new Set([word]); - const wordLc = word.toLowerCase(); - forms.add(wordLc); - return forms; - } - exports.wordSuggestForms = wordSuggestForms; - var DEFAULT_HAS_OPTIONS = Object.freeze({}); - function hasOptionToSearchOption(opt) { - return canonicalSearchOptions(!opt ? DEFAULT_HAS_OPTIONS : opt); - } - exports.hasOptionToSearchOption = hasOptionToSearchOption; - var canonicalSearchOptionsMap = /* @__PURE__ */ new Map(); - var knownCanonicalOptions = /* @__PURE__ */ new WeakMap(); - function canonicalSearchOptions(opt) { - const known = knownCanonicalOptions.get(opt); - if (known) - return known; - const { ignoreCase, useCompounds } = opt; - const foundLevel1Map = canonicalSearchOptionsMap.get(ignoreCase); - const useLevel1Map = foundLevel1Map || /* @__PURE__ */ new Map(); - if (!foundLevel1Map) { - canonicalSearchOptionsMap.set(ignoreCase, useLevel1Map); - } - const foundCanOpts = useLevel1Map.get(useCompounds); - const canOpts = foundCanOpts || Object.freeze({ ignoreCase, useCompounds }); - if (!foundCanOpts) { - useLevel1Map.set(useCompounds, canOpts); - } - knownCanonicalOptions.set(opt, canOpts); - return canOpts; - } - exports.canonicalSearchOptions = canonicalSearchOptions; - function suggestArgsToSuggestOptions(args) { - const [_word, options, compoundMethod, numChanges, ignoreCase] = args; - const suggestOptions = typeof options === "object" ? options : { - numSuggestions: options, - compoundMethod, - numChanges, - ignoreCase - }; - return suggestOptions; - } - exports.suggestArgsToSuggestOptions = suggestArgsToSuggestOptions; - function createWeightMapFromDictionaryInformation(di) { - return di ? (0, cspell_trie_lib_1.mapDictionaryInformationToWeightMap)(di) : void 0; - } - exports.createWeightMapFromDictionaryInformation = createWeightMapFromDictionaryInformation; - exports.__testMethods__ = { - wordSearchForms, - wordSearchFormsArray - }; - } -}); - -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/CachingDictionary.js -var require_CachingDictionary = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/CachingDictionary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createCachingDictionary = void 0; - var AutoCache_js_1 = require_AutoCache(); - var SpellingDictionaryMethods_js_1 = require_SpellingDictionaryMethods(); - var dictionaryCounter = 0; - var DefaultAutoCacheSize = 1e3; - var CachedDict = class { - constructor(dict, options) { - this.dict = dict; - this.options = options; - this.id = ++dictionaryCounter; - this.has = (0, AutoCache_js_1.autoCache)((word) => this.dict.has(word, this.options), DefaultAutoCacheSize); - this.isNoSuggestWord = (0, AutoCache_js_1.autoCache)((word) => this.dict.isNoSuggestWord(word, this.options), DefaultAutoCacheSize); - this.isForbidden = (0, AutoCache_js_1.autoCache)((word) => this.dict.isForbidden(word), DefaultAutoCacheSize); - this.getPreferredSuggestions = (0, AutoCache_js_1.autoCache)((word) => this.dict.getPreferredSuggestions?.(word), DefaultAutoCacheSize); - this.name = dict.name; - } - stats() { - return { - name: this.name, - id: this.id, - has: (0, AutoCache_js_1.extractStats)(this.has), - isNoSuggestWord: (0, AutoCache_js_1.extractStats)(this.isNoSuggestWord), - isForbidden: (0, AutoCache_js_1.extractStats)(this.isForbidden), - getPreferredSuggestions: (0, AutoCache_js_1.extractStats)(this.getPreferredSuggestions) - }; + stat2 = lstat; + } } + this.statCache[abs] = stat2; + var c = true; + if (stat2) + c = stat2.isDirectory() ? "DIR" : "FILE"; + this.cache[abs] = this.cache[abs] || c; + if (needDir && c === "FILE") + return false; + return c; + }; + GlobSync.prototype._mark = function(p) { + return common.mark(this, p); + }; + GlobSync.prototype._makeAbs = function(f) { + return common.makeAbs(this, f); }; - var knownDicts = /* @__PURE__ */ new Map(); - function createCachingDictionary(dict, options) { - options = (0, SpellingDictionaryMethods_js_1.canonicalSearchOptions)(options); - let knownOptions = knownDicts.get(options); - if (!knownOptions) { - knownOptions = /* @__PURE__ */ new WeakMap(); - knownDicts.set(options, knownOptions); - } - const known = knownOptions.get(dict); - if (known) - return known; - const cached = new CachedDict(dict, options); - knownOptions.set(dict, cached); - return cached; - } - exports.createCachingDictionary = createCachingDictionary; } }); -// node_modules/cspell-dictionary/dist/cjs/util/AutoResolve.js -var require_AutoResolve2 = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/util/AutoResolve.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createAutoResolveWeakCache = exports.AutoResolveWeakCache = exports.autoResolveWeak = exports.createAutoResolveCache = exports.AutoResolveCache = exports.autoResolve = void 0; - function autoResolve(map, key, resolve10) { - const found = map.get(key); - if (found !== void 0 || map.has(key)) - return found; - const value = resolve10(key); - map.set(key, value); - return value; - } - exports.autoResolve = autoResolve; - var AutoResolveCache = class { - constructor() { - this.map = /* @__PURE__ */ new Map(); - } - get(k, resolve10) { - return resolve10 ? autoResolve(this.map, k, resolve10) : this.map.get(k); +// node_modules/inflight/inflight.js +var require_inflight = __commonJS({ + "node_modules/inflight/inflight.js"(exports, module2) { + var wrappy = require_wrappy(); + var reqs = /* @__PURE__ */ Object.create(null); + var once = require_once(); + module2.exports = wrappy(inflight); + function inflight(key, cb) { + if (reqs[key]) { + reqs[key].push(cb); + return null; + } else { + reqs[key] = [cb]; + return makeres(key); } - has(k) { - return this.map.has(k); - } - set(k, v) { - this.map.set(k, v); - return this; - } - }; - exports.AutoResolveCache = AutoResolveCache; - function createAutoResolveCache() { - return new AutoResolveCache(); - } - exports.createAutoResolveCache = createAutoResolveCache; - function autoResolveWeak(map, key, resolve10) { - const found = map.get(key); - if (found !== void 0 || map.has(key)) - return found; - const value = resolve10(key); - map.set(key, value); - return value; } - exports.autoResolveWeak = autoResolveWeak; - var AutoResolveWeakCache = class { - constructor() { - this.map = /* @__PURE__ */ new WeakMap(); - } - get(k, resolve10) { - return resolve10 ? autoResolveWeak(this.map, k, resolve10) : this.map.get(k); - } - has(k) { - return this.map.has(k); - } - set(k, v) { - this.map.set(k, v); - return this; - } - }; - exports.AutoResolveWeakCache = AutoResolveWeakCache; - function createAutoResolveWeakCache() { - return new AutoResolveWeakCache(); + function makeres(key) { + return once(function RES() { + var cbs = reqs[key]; + var len = cbs.length; + var args = slice(arguments); + try { + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args); + } + } finally { + if (cbs.length > len) { + cbs.splice(0, len); + process.nextTick(function() { + RES.apply(null, args); + }); + } else { + delete reqs[key]; + } + } + }); } - exports.createAutoResolveWeakCache = createAutoResolveWeakCache; - } -}); - -// node_modules/cspell-dictionary/dist/cjs/util/util.js -var require_util8 = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/util/util.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isDefined = void 0; - function isDefined2(v) { - return v !== void 0; + function slice(args) { + var length = args.length; + var array = []; + for (var i = 0; i < length; i++) + array[i] = args[i]; + return array; } - exports.isDefined = isDefined2; } }); -// node_modules/fast-equals/dist/fast-equals.cjs.js -var require_fast_equals_cjs = __commonJS({ - "node_modules/fast-equals/dist/fast-equals.cjs.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - function createDefaultIsNestedEqual(comparator) { - return function isEqual(a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, meta) { - return comparator(a, b, meta); - }; - } - function createIsCircular(areItemsEqual) { - return function isCircular(a, b, isEqual, cache) { - if (!a || !b || typeof a !== "object" || typeof b !== "object") { - return areItemsEqual(a, b, isEqual, cache); - } - var cachedA = cache.get(a); - var cachedB = cache.get(b); - if (cachedA && cachedB) { - return cachedA === b && cachedB === a; - } - cache.set(a, b); - cache.set(b, a); - var result = areItemsEqual(a, b, isEqual, cache); - cache.delete(a); - cache.delete(b); - return result; - }; - } - function merge(a, b) { - var merged = {}; - for (var key in a) { - merged[key] = a[key]; - } - for (var key in b) { - merged[key] = b[key]; - } - return merged; - } - function isPlainObject(value) { - return value.constructor === Object || value.constructor == null; - } - function isPromiseLike(value) { - return typeof value.then === "function"; - } - function sameValueZeroEqual(a, b) { - return a === b || a !== a && b !== b; - } - var ARGUMENTS_TAG = "[object Arguments]"; - var BOOLEAN_TAG = "[object Boolean]"; - var DATE_TAG = "[object Date]"; - var REG_EXP_TAG = "[object RegExp]"; - var MAP_TAG = "[object Map]"; - var NUMBER_TAG = "[object Number]"; - var OBJECT_TAG = "[object Object]"; - var SET_TAG = "[object Set]"; - var STRING_TAG = "[object String]"; - var toString = Object.prototype.toString; - function createComparator(_a) { - var areArraysEqual2 = _a.areArraysEqual, areDatesEqual2 = _a.areDatesEqual, areMapsEqual2 = _a.areMapsEqual, areObjectsEqual2 = _a.areObjectsEqual, areRegExpsEqual2 = _a.areRegExpsEqual, areSetsEqual2 = _a.areSetsEqual, createIsNestedEqual = _a.createIsNestedEqual; - var isEqual = createIsNestedEqual(comparator); - function comparator(a, b, meta) { - if (a === b) { - return true; - } - if (!a || !b || typeof a !== "object" || typeof b !== "object") { - return a !== a && b !== b; - } - if (isPlainObject(a) && isPlainObject(b)) { - return areObjectsEqual2(a, b, isEqual, meta); - } - var aArray = Array.isArray(a); - var bArray = Array.isArray(b); - if (aArray || bArray) { - return aArray === bArray && areArraysEqual2(a, b, isEqual, meta); - } - var aTag = toString.call(a); - if (aTag !== toString.call(b)) { - return false; - } - if (aTag === DATE_TAG) { - return areDatesEqual2(a, b, isEqual, meta); - } - if (aTag === REG_EXP_TAG) { - return areRegExpsEqual2(a, b, isEqual, meta); - } - if (aTag === MAP_TAG) { - return areMapsEqual2(a, b, isEqual, meta); - } - if (aTag === SET_TAG) { - return areSetsEqual2(a, b, isEqual, meta); - } - if (aTag === OBJECT_TAG || aTag === ARGUMENTS_TAG) { - return isPromiseLike(a) || isPromiseLike(b) ? false : areObjectsEqual2(a, b, isEqual, meta); - } - if (aTag === BOOLEAN_TAG || aTag === NUMBER_TAG || aTag === STRING_TAG) { - return sameValueZeroEqual(a.valueOf(), b.valueOf()); - } - return false; +// node_modules/glob/glob.js +var require_glob = __commonJS({ + "node_modules/glob/glob.js"(exports, module2) { + module2.exports = glob2; + var rp = require_fs5(); + var minimatch = require_minimatch(); + var Minimatch = minimatch.Minimatch; + var inherits = require_inherits(); + var EE = require("events").EventEmitter; + var path26 = require("path"); + var assert20 = require("assert"); + var isAbsolute = require_path_is_absolute(); + var globSync = require_sync7(); + var common = require_common5(); + var setopts = common.setopts; + var ownProp = common.ownProp; + var inflight = require_inflight(); + var util = require("util"); + var childrenIgnored = common.childrenIgnored; + var isIgnored = common.isIgnored; + var once = require_once(); + function glob2(pattern, options, cb) { + if (typeof options === "function") + cb = options, options = {}; + if (!options) + options = {}; + if (options.sync) { + if (cb) + throw new TypeError("callback provided to sync glob"); + return globSync(pattern, options); } - return comparator; + return new Glob(pattern, options, cb); } - function areArraysEqual(a, b, isEqual, meta) { - var index = a.length; - if (b.length !== index) { - return false; + glob2.sync = globSync; + var GlobSync = glob2.GlobSync = globSync.GlobSync; + glob2.glob = glob2; + function extend(origin, add) { + if (add === null || typeof add !== "object") { + return origin; } - while (index-- > 0) { - if (!isEqual(a[index], b[index], index, index, a, b, meta)) { - return false; - } + var keys2 = Object.keys(add); + var i = keys2.length; + while (i--) { + origin[keys2[i]] = add[keys2[i]]; } - return true; - } - var areArraysEqualCircular = createIsCircular(areArraysEqual); - function areDatesEqual(a, b) { - return sameValueZeroEqual(a.valueOf(), b.valueOf()); + return origin; } - function areMapsEqual(a, b, isEqual, meta) { - var isValueEqual = a.size === b.size; - if (!isValueEqual) { + glob2.hasMagic = function(pattern, options_) { + var options = extend({}, options_); + options.noprocess = true; + var g = new Glob(pattern, options); + var set = g.minimatch.set; + if (!pattern) return false; - } - if (!a.size) { + if (set.length > 1) return true; + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== "string") + return true; } - var matchedIndices = {}; - var indexA = 0; - a.forEach(function(aValue, aKey) { - if (!isValueEqual) { - return; - } - var hasMatch = false; - var matchIndexB = 0; - b.forEach(function(bValue, bKey) { - if (!hasMatch && !matchedIndices[matchIndexB] && (hasMatch = isEqual(aKey, bKey, indexA, matchIndexB, a, b, meta) && isEqual(aValue, bValue, aKey, bKey, a, b, meta))) { - matchedIndices[matchIndexB] = true; - } - matchIndexB++; + return false; + }; + glob2.Glob = Glob; + inherits(Glob, EE); + function Glob(pattern, options, cb) { + if (typeof options === "function") { + cb = options; + options = null; + } + if (options && options.sync) { + if (cb) + throw new TypeError("callback provided to sync glob"); + return new GlobSync(pattern, options); + } + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb); + setopts(this, pattern, options); + this._didRealPath = false; + var n = this.minimatch.set.length; + this.matches = new Array(n); + if (typeof cb === "function") { + cb = once(cb); + this.on("error", cb); + this.on("end", function(matches) { + cb(null, matches); }); - indexA++; - isValueEqual = hasMatch; - }); - return isValueEqual; - } - var areMapsEqualCircular = createIsCircular(areMapsEqual); - var OWNER = "_owner"; - var hasOwnProperty2 = Object.prototype.hasOwnProperty; - function areObjectsEqual(a, b, isEqual, meta) { - var keysA = Object.keys(a); - var index = keysA.length; - if (Object.keys(b).length !== index) { - return false; } - var key; - while (index-- > 0) { - key = keysA[index]; - if (key === OWNER) { - var reactElementA = !!a.$$typeof; - var reactElementB = !!b.$$typeof; - if ((reactElementA || reactElementB) && reactElementA !== reactElementB) { - return false; + var self = this; + this._processing = 0; + this._emitQueue = []; + this._processQueue = []; + this.paused = false; + if (this.noprocess) + return this; + if (n === 0) + return done(); + var sync = true; + for (var i = 0; i < n; i++) { + this._process(this.minimatch.set[i], i, false, done); + } + sync = false; + function done() { + --self._processing; + if (self._processing <= 0) { + if (sync) { + process.nextTick(function() { + self._finish(); + }); + } else { + self._finish(); } } - if (!hasOwnProperty2.call(b, key) || !isEqual(a[key], b[key], key, key, a, b, meta)) { - return false; - } } - return true; - } - var areObjectsEqualCircular = createIsCircular(areObjectsEqual); - function areRegExpsEqual(a, b) { - return a.source === b.source && a.flags === b.flags; } - function areSetsEqual(a, b, isEqual, meta) { - var isValueEqual = a.size === b.size; - if (!isValueEqual) { - return false; - } - if (!a.size) { - return true; + Glob.prototype._finish = function() { + assert20(this instanceof Glob); + if (this.aborted) + return; + if (this.realpath && !this._didRealpath) + return this._realpath(); + common.finish(this); + this.emit("end", this.found); + }; + Glob.prototype._realpath = function() { + if (this._didRealpath) + return; + this._didRealpath = true; + var n = this.matches.length; + if (n === 0) + return this._finish(); + var self = this; + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next); + function next() { + if (--n === 0) + self._finish(); } - var matchedIndices = {}; - a.forEach(function(aValue, aKey) { - if (!isValueEqual) { - return; - } - var hasMatch = false; - var matchIndex = 0; - b.forEach(function(bValue, bKey) { - if (!hasMatch && !matchedIndices[matchIndex] && (hasMatch = isEqual(aValue, bValue, aKey, bKey, a, b, meta))) { - matchedIndices[matchIndex] = true; + }; + Glob.prototype._realpathSet = function(index, cb) { + var matchset = this.matches[index]; + if (!matchset) + return cb(); + var found = Object.keys(matchset); + var self = this; + var n = found.length; + if (n === 0) + return cb(); + var set = this.matches[index] = /* @__PURE__ */ Object.create(null); + found.forEach(function(p, i) { + p = self._makeAbs(p); + rp.realpath(p, self.realpathCache, function(er, real) { + if (!er) + set[real] = true; + else if (er.syscall === "stat") + set[p] = true; + else + self.emit("error", er); + if (--n === 0) { + self.matches[index] = set; + cb(); } - matchIndex++; }); - isValueEqual = hasMatch; }); - return isValueEqual; - } - var areSetsEqualCircular = createIsCircular(areSetsEqual); - var DEFAULT_CONFIG = Object.freeze({ - areArraysEqual, - areDatesEqual, - areMapsEqual, - areObjectsEqual, - areRegExpsEqual, - areSetsEqual, - createIsNestedEqual: createDefaultIsNestedEqual - }); - var DEFAULT_CIRCULAR_CONFIG = Object.freeze({ - areArraysEqual: areArraysEqualCircular, - areDatesEqual, - areMapsEqual: areMapsEqualCircular, - areObjectsEqual: areObjectsEqualCircular, - areRegExpsEqual, - areSetsEqual: areSetsEqualCircular, - createIsNestedEqual: createDefaultIsNestedEqual - }); - var isDeepEqual = createComparator(DEFAULT_CONFIG); - function deepEqual(a, b) { - return isDeepEqual(a, b, void 0); - } - var isShallowEqual = createComparator(merge(DEFAULT_CONFIG, { createIsNestedEqual: function() { - return sameValueZeroEqual; - } })); - function shallowEqual(a, b) { - return isShallowEqual(a, b, void 0); - } - var isCircularDeepEqual = createComparator(DEFAULT_CIRCULAR_CONFIG); - function circularDeepEqual(a, b) { - return isCircularDeepEqual(a, b, /* @__PURE__ */ new WeakMap()); - } - var isCircularShallowEqual = createComparator(merge(DEFAULT_CIRCULAR_CONFIG, { - createIsNestedEqual: function() { - return sameValueZeroEqual; - } - })); - function circularShallowEqual(a, b) { - return isCircularShallowEqual(a, b, /* @__PURE__ */ new WeakMap()); - } - function createCustomEqual(getComparatorOptions) { - return createComparator(merge(DEFAULT_CONFIG, getComparatorOptions(DEFAULT_CONFIG))); - } - function createCustomCircularEqual(getComparatorOptions) { - var comparator = createComparator(merge(DEFAULT_CIRCULAR_CONFIG, getComparatorOptions(DEFAULT_CIRCULAR_CONFIG))); - return function(a, b, meta) { - if (meta === void 0) { - meta = /* @__PURE__ */ new WeakMap(); - } - return comparator(a, b, meta); - }; - } - exports.circularDeepEqual = circularDeepEqual; - exports.circularShallowEqual = circularShallowEqual; - exports.createCustomCircularEqual = createCustomCircularEqual; - exports.createCustomEqual = createCustomEqual; - exports.deepEqual = deepEqual; - exports.sameValueZeroEqual = sameValueZeroEqual; - exports.shallowEqual = shallowEqual; - } -}); - -// node_modules/cspell-dictionary/dist/cjs/util/simpleCache.js -var require_simpleCache = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/util/simpleCache.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AutoCache = exports.SimpleCache = exports.AutoWeakCache = exports.SimpleWeakCache = void 0; - var SimpleWeakCache = class { - constructor(size) { - this.size = size; - this.L0 = /* @__PURE__ */ new WeakMap(); - this.L1 = /* @__PURE__ */ new WeakMap(); - this.L2 = /* @__PURE__ */ new WeakMap(); - this.sizeL0 = 0; - } - has(key) { - for (const c of this.caches()) { - if (c.has(key)) - return true; - } - return false; - } - get(key) { - for (const c of this.caches()) { - const entry = c.get(key); - if (entry) { - if (c !== this.L0) { - this._set(key, entry); - } - return entry.v; - } - } - return void 0; - } - set(key, value) { - this._set(key, { v: value }); - } - _set(key, entry) { - if (this.L0.has(key)) { - this.L0.set(key, entry); - return this; - } - if (this.sizeL0 >= this.size) { - this.rotate(); - } - this.sizeL0 += 1; - this.L0.set(key, entry); - } - caches() { - return [this.L0, this.L1, this.L2]; - } - rotate() { - this.L2 = this.L1; - this.L1 = this.L0; - this.L0 = /* @__PURE__ */ new WeakMap(); - this.sizeL0 = 0; - } }; - exports.SimpleWeakCache = SimpleWeakCache; - var AutoWeakCache = class extends SimpleWeakCache { - constructor(factory, size) { - super(size); - this.factory = factory; - } - get(key) { - const v = super.get(key); - if (v !== void 0) - return v; - const val = this.factory(key); - this.set(key, val); - return val; - } + Glob.prototype._mark = function(p) { + return common.mark(this, p); }; - exports.AutoWeakCache = AutoWeakCache; - var SimpleCache = class { - constructor(size) { - this.size = size; - this.L0 = /* @__PURE__ */ new Map(); - this.L1 = /* @__PURE__ */ new Map(); - this.L2 = /* @__PURE__ */ new Map(); - } - has(key) { - for (const c of this.caches()) { - if (c.has(key)) - return true; - } - return false; + Glob.prototype._makeAbs = function(f) { + return common.makeAbs(this, f); + }; + Glob.prototype.abort = function() { + this.aborted = true; + this.emit("abort"); + }; + Glob.prototype.pause = function() { + if (!this.paused) { + this.paused = true; + this.emit("pause"); } - get(key) { - for (const c of this.caches()) { - const entry = c.get(key); - if (entry) { - if (c !== this.L0) { - this._set(key, entry); - } - return entry.v; + }; + Glob.prototype.resume = function() { + if (this.paused) { + this.emit("resume"); + this.paused = false; + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0); + this._emitQueue.length = 0; + for (var i = 0; i < eq.length; i++) { + var e = eq[i]; + this._emitMatch(e[0], e[1]); } } - return void 0; - } - set(key, value) { - this._set(key, { v: value }); - } - _set(key, entry) { - if (this.L0.has(key)) { - this.L0.set(key, entry); - return this; - } - if (this.L0.size >= this.size) { - this.rotate(); + if (this._processQueue.length) { + var pq = this._processQueue.slice(0); + this._processQueue.length = 0; + for (var i = 0; i < pq.length; i++) { + var p = pq[i]; + this._processing--; + this._process(p[0], p[1], p[2], p[3]); + } } - this.L0.set(key, entry); } - caches() { - return [this.L0, this.L1, this.L2]; + }; + Glob.prototype._process = function(pattern, index, inGlobStar, cb) { + assert20(this instanceof Glob); + assert20(typeof cb === "function"); + if (this.aborted) + return; + this._processing++; + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]); + return; } - rotate() { - this.L2 = this.L1; - this.L1 = this.L0; - this.L0 = /* @__PURE__ */ new Map(); + var n = 0; + while (typeof pattern[n] === "string") { + n++; } - }; - exports.SimpleCache = SimpleCache; - var AutoCache = class extends SimpleCache { - constructor(factory, size) { - super(size); - this.factory = factory; - } - get(key) { - const v = super.get(key); - if (v !== void 0) - return v; - const val = this.factory(key); - this.set(key, val); - return val; + var prefix; + switch (n) { + case pattern.length: + this._processSimple(pattern.join("/"), index, cb); + return; + case 0: + prefix = null; + break; + default: + prefix = pattern.slice(0, n).join("/"); + break; } + var remain = pattern.slice(n); + var read2; + if (prefix === null) + read2 = "."; + else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) { + return typeof p === "string" ? p : "[*]"; + }).join("/"))) { + if (!prefix || !isAbsolute(prefix)) + prefix = "/" + prefix; + read2 = prefix; + } else + read2 = prefix; + var abs = this._makeAbs(read2); + if (childrenIgnored(this, read2)) + return cb(); + var isGlobStar = remain[0] === minimatch.GLOBSTAR; + if (isGlobStar) + this._processGlobStar(prefix, read2, abs, remain, index, inGlobStar, cb); + else + this._processReaddir(prefix, read2, abs, remain, index, inGlobStar, cb); }; - exports.AutoCache = AutoCache; - } -}); - -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/SpellingDictionary.js -var require_SpellingDictionary = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/SpellingDictionary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultOptions = exports.CompoundWordsMethod = void 0; - var cspell_trie_lib_1 = require_cjs5(); - Object.defineProperty(exports, "CompoundWordsMethod", { enumerable: true, get: function() { - return cspell_trie_lib_1.CompoundWordsMethod; - } }); - exports.defaultOptions = Object.freeze({ - weightMap: void 0 - }); - } -}); - -// node_modules/cspell-dictionary/dist/cjs/util/clean.js -var require_clean2 = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/util/clean.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.clean = void 0; - function clean2(src) { - const r = src; - for (const key of Object.keys(r)) { - if (r[key] === void 0) { - delete r[key]; - } - } - return r; - } - exports.clean = clean2; - } -}); - -// node_modules/cspell-dictionary/dist/cjs/util/regexHelper.js -var require_regexHelper = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/util/regexHelper.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.escapeRegEx = void 0; - function escapeRegEx(s) { - return s.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); - } - exports.escapeRegEx = escapeRegEx; - } -}); - -// node_modules/cspell-dictionary/dist/cjs/util/repMap.js -var require_repMap = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/util/repMap.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.createRepMapper = exports.createMapper = void 0; - var cspell_trie_lib_1 = require_cjs5(); - var regexHelper_js_1 = require_regexHelper(); - var util_js_1 = require_util8(); - function createMapper(repMap, ignoreCharset) { - if (!repMap && !ignoreCharset) - return (a) => a; - repMap = repMap || []; - const charsetMap = charsetToRepMapRegEx(ignoreCharset); - if (charsetMap) { - repMap = repMap.concat(charsetMap); - } - const filteredMap = repMap.filter(([match, _]) => !!match); - if (!filteredMap.length) { - return (a) => a; - } - const regEx = createMapperRegExp(repMap); - const values = repMap.filter(([match, _]) => !!match).map(([_, into]) => into); - function resolve10(m, ...matches) { - const index = matches.findIndex((a) => !!a); - return 0 <= index && index < values.length ? values[index] : m; - } - return function(s) { - return s.replace(regEx, resolve10); - }; - } - exports.createMapper = createMapper; - function charsetToRepMapRegEx(charset, replaceWith = "") { - if (!charset) - return void 0; - return charset.split("|").map((chars) => `[${chars.replace(/[\][\\]/g, "\\$&")}]`).map((map) => [map, replaceWith]); - } - function charsetToRepMap(charset, replaceWith = "") { - if (!charset) - return void 0; - return charset.split("|").flatMap((chars) => [...(0, cspell_trie_lib_1.expandCharacterSet)(chars)]).map((char) => [char, replaceWith]); - } - function expandReplaceMap(repMap) { - return repMap.flatMap(([from, replaceWith]) => from.split("|").map((w) => [w, replaceWith])); - } - function createMapperRegExp(repMap) { - const filteredMap = repMap.filter(([match, _]) => !!match); - if (!filteredMap.length) { - return /$^/; - } - const regExStr = filteredMap.map(([from, _]) => from).map((s) => { - try { - const r = s.match(/\(/) ? s.replace(/\((?=.*\))/g, "(?:").replace(/\(\?:\?/g, "(?") : s; - new RegExp(r); - s = r; - } catch (err) { - return (0, regexHelper_js_1.escapeRegEx)(s); - } - return s; - }).map((s) => `(${s})`).join("|"); - const regEx = new RegExp(regExStr, "g"); - return regEx; - } - function createRepMapper(repMap, ignoreCharset) { - if (!repMap && !ignoreCharset) - return (word) => [word]; - const trie = createTrie(repMap, ignoreCharset); - return (word) => { - const edits = calcAllEdits(trie, word); - return applyEdits(word, edits); - }; - } - exports.createRepMapper = createRepMapper; - function applyEdits(word, edits) { - if (!edits.length) - return [word]; - const letterEdits = []; - for (let i = 0; i < word.length; ++i) { - letterEdits[i] = { edits: [{ b: i, e: i + 1, r: word[i] }], suffixes: [] }; - } - letterEdits[word.length] = { edits: [], suffixes: [""] }; - for (const edit of edits) { - const le = letterEdits[edit.b]; - le.edits.push(edit); - } - for (let i = word.length - 1; i >= 0; --i) { - const le = letterEdits[i]; - const sfx = le.suffixes; - for (const edit of le.edits) { - const pfx = edit.r; - const nSfx = letterEdits[edit.e].suffixes; - for (const s of nSfx) { - sfx.push(pfx + s); - } - } - } - const results = new Set(letterEdits[0].suffixes); - return [...results]; - } - function calcAllEdits(root, word) { - const edits = []; - function walk(node, b, e) { - if (node.rep) { - node.rep.forEach((r) => edits.push({ b, e, r })); - } - if (e === word.length || !node.children) - return; - const n = node.children[word[e]]; - if (!n) - return; - walk(n, b, e + 1); - } - for (let i = 0; i < word.length; ++i) { - walk(root, i, i); - } - return edits; - } - function createTrie(repMap, ignoreCharset) { - const combined = [repMap, charsetToRepMap(ignoreCharset)].filter(util_js_1.isDefined).flatMap((a) => a); - const expanded = expandReplaceMap(combined); - const trieRoot = /* @__PURE__ */ Object.create(null); - expanded.forEach(([match, replaceWith]) => addToTrie(trieRoot, match, replaceWith)); - return trieRoot; - } - function addToTrie(node, match, replaceWith) { - while (match) { - const children = node.children || (node.children = /* @__PURE__ */ Object.create(null)); - const k = match[0]; - const childNode = children[k] || (children[k] = /* @__PURE__ */ Object.create(null)); - node = childNode; - match = match.slice(1); - } - const s = new Set(node.rep || []); - s.add(replaceWith); - node.rep = [...s]; - } - exports.__testing__ = { - charsetToRepMap: charsetToRepMapRegEx, - createMapperRegExp, - createTrie, - calcAllEdits, - applyEdits - }; - } -}); - -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/defaults.js -var require_defaults = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/defaults.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isForbiddenIgnoreCaseAndAccents = exports.ignoreCase = void 0; - exports.ignoreCase = true; - exports.isForbiddenIgnoreCaseAndAccents = false; - } -}); - -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/SpellingDictionaryFromTrie.js -var require_SpellingDictionaryFromTrie = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/SpellingDictionaryFromTrie.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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; + Glob.prototype._processReaddir = function(prefix, read2, abs, remain, index, inGlobStar, cb) { + var self = this; + this._readdir(abs, inGlobStar, function(er, entries) { + return self._processReaddir2(prefix, read2, abs, remain, index, inGlobStar, entries, cb); + }); }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.createSpellingDictionaryFromTrieFile = exports.SpellingDictionaryFromTrie = void 0; - var sync_1 = require_sync(); - var cspell_trie_lib_1 = require_cjs5(); - var AutoCache_js_1 = require_AutoCache(); - var clean_js_1 = require_clean2(); - var repMap_js_1 = require_repMap(); - var Defaults = __importStar(require_defaults()); - var SpellingDictionaryMethods_js_1 = require_SpellingDictionaryMethods(); - var findWordOptionsCaseSensitive = Object.freeze({ caseSensitive: true }); - var findWordOptionsNotCaseSensitive = Object.freeze({ caseSensitive: false }); - var SpellingDictionaryFromTrie = class { - constructor(trie, name, options, source = "from trie", size) { - this.trie = trie; - this.name = name; - this.options = options; - this.source = source; - this._size = 0; - this.knownWords = /* @__PURE__ */ new Set(); - this.unknownWords = /* @__PURE__ */ new Set(); - this.type = "SpellingDictionaryFromTrie"; - this._find = findCache((word, useCompounds, ignoreCase) => this.findAnyForm(word, useCompounds, ignoreCase)); - this._isForbidden = (0, AutoCache_js_1.autoCache)((word) => { - return this.trie.isForbiddenWord(word); - }); - this.mapWord = (0, repMap_js_1.createMapper)(options.repMap, options.dictionaryInformation?.ignore); - this.remapWord = (0, repMap_js_1.createRepMapper)(options.repMap, options.dictionaryInformation?.ignore); - this.isDictionaryCaseSensitive = options.caseSensitive ?? !trie.isLegacy; - this.containsNoSuggestWords = options.noSuggest || false; - this._size = size || 0; - this.weightMap = options.weightMap || (0, SpellingDictionaryMethods_js_1.createWeightMapFromDictionaryInformation)(options.dictionaryInformation); - } - get size() { - if (!this._size) { - const i = this.trie.iterate(); - let deeper = true; - let size = 0; - for (let r = i.next(); !r.done; r = i.next(deeper)) { - size += 1; - deeper = r.value.text.length < 5; + Glob.prototype._processReaddir2 = function(prefix, read2, abs, remain, index, inGlobStar, entries, cb) { + if (!entries) + return cb(); + var pn = remain[0]; + var negate = !!this.minimatch.negate; + var rawGlob = pn._glob; + var dotOk = this.dot || rawGlob.charAt(0) === "."; + var matchedEntries = []; + for (var i = 0; i < entries.length; i++) { + var e = entries[i]; + if (e.charAt(0) !== "." || dotOk) { + var m; + if (negate && !prefix) { + m = !e.match(pn); + } else { + m = e.match(pn); } - this._size = size; - } - return this._size; - } - has(word, hasOptions) { - const { useCompounds, ignoreCase } = this.resolveOptions(hasOptions); - const r = this._find(word, useCompounds, ignoreCase); - return !!r && !r.forbidden && !!r.found; - } - find(word, hasOptions) { - const { useCompounds, ignoreCase } = this.resolveOptions(hasOptions); - const r = this._find(word, useCompounds, ignoreCase); - const { forbidden = this.isForbidden(word) } = r || {}; - if (!r && !forbidden) - return void 0; - const { found = forbidden ? word : false } = r || {}; - const noSuggest = found !== false && this.containsNoSuggestWords; - return { found, forbidden, noSuggest }; - } - resolveOptions(hasOptions) { - const { useCompounds = this.options.useCompounds, ignoreCase = Defaults.ignoreCase } = (0, SpellingDictionaryMethods_js_1.hasOptionToSearchOption)(hasOptions); - return { useCompounds, ignoreCase }; - } - findAnyForm(word, useCompounds, ignoreCase) { - const outerForms = outerWordForms(word, this.remapWord ? this.remapWord : (word2) => [this.mapWord(word2)]); - for (const form of outerForms) { - const r = this._findAnyForm(form, useCompounds, ignoreCase); - if (r) - return r; + if (m) + matchedEntries.push(e); } - return void 0; } - _findAnyForm(mWord, useCompounds, ignoreCase) { - const opts = ignoreCase ? findWordOptionsNotCaseSensitive : findWordOptionsCaseSensitive; - const findResult = this.trie.findWord(mWord, opts); - if (findResult.found !== false) { - return findResult; - } - const forms = (0, SpellingDictionaryMethods_js_1.wordSearchForms)(mWord, this.isDictionaryCaseSensitive, ignoreCase); - for (const w of forms) { - const findResult2 = this.trie.findWord(w, opts); - if (findResult2.found !== false) { - return findResult2; + var len = matchedEntries.length; + if (len === 0) + return cb(); + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = /* @__PURE__ */ Object.create(null); + for (var i = 0; i < len; i++) { + var e = matchedEntries[i]; + if (prefix) { + if (prefix !== "/") + e = prefix + "/" + e; + else + e = prefix + e; } - } - if (useCompounds) { - const optsUseCompounds = { ...opts, useLegacyWordCompounds: useCompounds }; - for (const w of forms) { - const findResult2 = this.trie.findWord(w, optsUseCompounds); - if (findResult2.found !== false) { - return findResult2; - } + if (e.charAt(0) === "/" && !this.nomount) { + e = path26.join(this.root, e); } + this._emitMatch(index, e); } - return void 0; - } - isNoSuggestWord(word, options) { - return this.containsNoSuggestWords ? this.has(word, options) : false; - } - isForbidden(word, _ignoreCaseAndAccents) { - return this._isForbidden(word); - } - suggest(...args) { - const [word] = args; - const suggestOptions = (0, SpellingDictionaryMethods_js_1.suggestArgsToSuggestOptions)(args); - return this._suggest(word, suggestOptions); + return cb(); } - _suggest(word, suggestOptions) { - const { numSuggestions = SpellingDictionaryMethods_js_1.defaultNumSuggestions, numChanges, includeTies, ignoreCase, timeout } = suggestOptions; - function filter(_word) { - return true; + remain.shift(); + for (var i = 0; i < len; i++) { + var e = matchedEntries[i]; + var newPattern; + if (prefix) { + if (prefix !== "/") + e = prefix + "/" + e; + else + e = prefix + e; } - const collector = (0, cspell_trie_lib_1.suggestionCollector)(word, (0, clean_js_1.clean)({ - numSuggestions, - filter, - changeLimit: numChanges, - includeTies, - ignoreCase, - timeout, - weightMap: this.weightMap - })); - this.genSuggestions(collector, suggestOptions); - return collector.suggestions.map((r) => ({ ...r, word: r.word })); + this._process([e].concat(remain), index, inGlobStar, cb); + } + cb(); + }; + Glob.prototype._emitMatch = function(index, e) { + if (this.aborted) + return; + if (isIgnored(this, e)) + return; + if (this.paused) { + this._emitQueue.push([index, e]); + return; } - genSuggestions(collector, suggestOptions) { - if (this.options.noSuggest) + var abs = isAbsolute(e) ? e : this._makeAbs(e); + if (this.mark) + e = this._mark(e); + if (this.absolute) + e = abs; + if (this.matches[index][e]) + return; + if (this.nodir) { + var c = this.cache[abs]; + if (c === "DIR" || Array.isArray(c)) return; - const _compoundMethod = suggestOptions.compoundMethod ?? (this.options.useCompounds ? cspell_trie_lib_1.CompoundWordsMethod.JOIN_WORDS : cspell_trie_lib_1.CompoundWordsMethod.NONE); - (0, SpellingDictionaryMethods_js_1.wordSuggestFormsArray)(collector.word).forEach((w) => this.trie.genSuggestions((0, SpellingDictionaryMethods_js_1.impersonateCollector)(collector, w), _compoundMethod)); } - getErrors() { - return []; + this.matches[index][e] = true; + var st = this.statCache[abs]; + if (st) + this.emit("stat", e, st); + this.emit("match", e); + }; + Glob.prototype._readdirInGlobStar = function(abs, cb) { + if (this.aborted) + return; + if (this.follow) + return this._readdir(abs, false, cb); + var lstatkey = "lstat\0" + abs; + var self = this; + var lstatcb = inflight(lstatkey, lstatcb_); + if (lstatcb) + self.fs.lstat(abs, lstatcb); + function lstatcb_(er, lstat) { + if (er && er.code === "ENOENT") + return cb(); + var isSym = lstat && lstat.isSymbolicLink(); + self.symlinks[abs] = isSym; + if (!isSym && lstat && !lstat.isDirectory()) { + self.cache[abs] = "FILE"; + cb(); + } else + self._readdir(abs, false, cb); } }; - exports.SpellingDictionaryFromTrie = SpellingDictionaryFromTrie; - SpellingDictionaryFromTrie.cachedWordsLimit = 5e4; - function createSpellingDictionaryFromTrieFile(data, name, source, options) { - data = typeof data === "string" ? data.split("\n") : data; - const trieNode = (0, cspell_trie_lib_1.importTrie)(data); - const trie = new cspell_trie_lib_1.Trie(trieNode); - return new SpellingDictionaryFromTrie(trie, name, options, source); - } - exports.createSpellingDictionaryFromTrieFile = createSpellingDictionaryFromTrieFile; - function findCache(fn, size = 2e3) { - const cache = (0, AutoCache_js_1.createCache01)(size); - function find(word, useCompounds, ignoreCase) { - const r = cache.get(word); - if (r !== void 0) { - if (r.useCompounds === useCompounds && r.ignoreCase === ignoreCase) { - return r.findResult; - } - } - const findResult = fn(word, useCompounds, ignoreCase); - cache.set(word, { useCompounds, ignoreCase, findResult }); - return findResult; + Glob.prototype._readdir = function(abs, inGlobStar, cb) { + if (this.aborted) + return; + cb = inflight("readdir\0" + abs + "\0" + inGlobStar, cb); + if (!cb) + return; + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb); + if (ownProp(this.cache, abs)) { + var c = this.cache[abs]; + if (!c || c === "FILE") + return cb(); + if (Array.isArray(c)) + return cb(null, c); } - return find; - } - function outerWordForms(word, mapWord) { - const forms = (0, sync_1.pipe)([word], (0, sync_1.opConcatMap)((word2) => [word2, word2.normalize("NFC"), word2.normalize("NFD")]), (0, sync_1.opConcatMap)((word2) => [word2, ...mapWord(word2)])); - return new Set(forms); - } - exports.__testing__ = { outerWordForms }; - } -}); - -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/createSpellingDictionary.js -var require_createSpellingDictionary = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/createSpellingDictionary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createFailedToLoadDictionary = exports.createSpellingDictionary = void 0; - var cspell_trie_lib_1 = require_cjs5(); - var fast_equals_1 = require_fast_equals_cjs(); - var simpleCache_js_1 = require_simpleCache(); - var SpellingDictionary_js_1 = require_SpellingDictionary(); - var SpellingDictionaryFromTrie_js_1 = require_SpellingDictionaryFromTrie(); - var SpellingDictionaryMethods_js_1 = require_SpellingDictionaryMethods(); - var cachedDictionaries = new simpleCache_js_1.AutoWeakCache(_createSpellingDictionary, 64); - var maxSetSize = 3; - var cachedParamsByWordList = new simpleCache_js_1.SimpleCache(64); - function createSpellingDictionary(wordList, name, source, options) { - const params = [wordList, name, source, options]; - if (!Array.isArray(wordList)) { - return _createSpellingDictionary(params); - } - const cached = cachedParamsByWordList.get(name) || /* @__PURE__ */ new Set(); - for (const cachedParams of cached) { - if ((0, fast_equals_1.deepEqual)(params, cachedParams)) { - return cachedDictionaries.get(cachedParams); - } - } - if (cached.size > maxSetSize) - cached.clear(); - cached.add(params); - cachedParamsByWordList.set(name, cached); - return cachedDictionaries.get(params); - } - exports.createSpellingDictionary = createSpellingDictionary; - function _createSpellingDictionary(params) { - const [wordList, name, source, options] = params; - const parseOptions = { stripCaseAndAccents: options?.supportNonStrictSearches ?? true }; - const words = (0, cspell_trie_lib_1.parseDictionaryLines)(wordList, parseOptions); - const trie = (0, cspell_trie_lib_1.buildTrieFast)(words); - const opts = { ...options || SpellingDictionary_js_1.defaultOptions }; - if (opts.weightMap === void 0 && opts.dictionaryInformation) { - opts.weightMap = (0, SpellingDictionaryMethods_js_1.createWeightMapFromDictionaryInformation)(opts.dictionaryInformation); - } - return new SpellingDictionaryFromTrie_js_1.SpellingDictionaryFromTrie(trie, name, opts, source); - } - function createFailedToLoadDictionary(name, source, error2, options) { - options = options || {}; - return { - name, - source, - type: "error", - containsNoSuggestWords: false, - has: () => false, - find: () => void 0, - isNoSuggestWord: () => false, - isForbidden: () => false, - suggest: () => [], - mapWord: (a) => a, - genSuggestions: () => { - return; - }, - size: 0, - options, - isDictionaryCaseSensitive: false, - getErrors: () => [error2] + var self = this; + self.fs.readdir(abs, readdirCb(this, abs, cb)); + }; + function readdirCb(self, abs, cb) { + return function(er, entries) { + if (er) + self._readdirError(abs, er, cb); + else + self._readdirEntries(abs, entries, cb); }; } - exports.createFailedToLoadDictionary = createFailedToLoadDictionary; - } -}); - -// node_modules/cspell-dictionary/dist/cjs/util/textMappers.js -var require_textMappers = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/util/textMappers.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.mapperRemoveCaseAndAccents = exports.mapperNormalizeNFC = void 0; - var text_js_1 = require_text3(); - function* mapperNormalizeNFC(words) { - for (const word of words) { - yield word.normalize("NFC"); + Glob.prototype._readdirEntries = function(abs, entries, cb) { + if (this.aborted) + return; + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i++) { + var e = entries[i]; + if (abs === "/") + e = abs + e; + else + e = abs + "/" + e; + this.cache[e] = true; + } } - } - exports.mapperNormalizeNFC = mapperNormalizeNFC; - function* mapperRemoveCaseAndAccents(words) { - for (const word of words) { - const lc = word.toLowerCase(); - yield lc; - const woAccents = (0, text_js_1.removeAccents)(lc); - if (lc !== woAccents) - yield woAccents; + this.cache[abs] = entries; + return cb(null, entries); + }; + Glob.prototype._readdirError = function(f, er, cb) { + if (this.aborted) + return; + switch (er.code) { + case "ENOTSUP": + case "ENOTDIR": + var abs = this._makeAbs(f); + this.cache[abs] = "FILE"; + if (abs === this.cwdAbs) { + var error2 = new Error(er.code + " invalid cwd " + this.cwd); + error2.path = this.cwd; + error2.code = er.code; + this.emit("error", error2); + this.abort(); + } + break; + case "ENOENT": + case "ELOOP": + case "ENAMETOOLONG": + case "UNKNOWN": + this.cache[this._makeAbs(f)] = false; + break; + default: + this.cache[this._makeAbs(f)] = false; + if (this.strict) { + this.emit("error", er); + this.abort(); + } + if (!this.silent) + console.error("glob error", er); + break; } - } - exports.mapperRemoveCaseAndAccents = mapperRemoveCaseAndAccents; - } -}); - -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/Typos/util.js -var require_util9 = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/Typos/util.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.extractIgnoreValues = exports.extractAllSuggestions = exports.createTyposDef = exports.appendToDef = exports.mergeDef = exports.mergeDefEntry = void 0; - var sync_1 = require_sync(); - function normalizeTyposDefValue(value) { - if (!value) - return false; - if (typeof value === "string") - return value; - const unique = [...new Set(value)]; - return unique.length > 1 ? unique : unique.length === 1 ? unique[0] : false; - } - function mergeDefEntry(targetDef, key, value) { - const curValue = targetDef[key]; - if (!curValue) { - targetDef[key] = normalizeTyposDefValue(value); - return targetDef; + return cb(); + }; + Glob.prototype._processGlobStar = function(prefix, read2, abs, remain, index, inGlobStar, cb) { + var self = this; + this._readdir(abs, inGlobStar, function(er, entries) { + self._processGlobStar2(prefix, read2, abs, remain, index, inGlobStar, entries, cb); + }); + }; + Glob.prototype._processGlobStar2 = function(prefix, read2, abs, remain, index, inGlobStar, entries, cb) { + if (!entries) + return cb(); + var remainWithoutGlobStar = remain.slice(1); + var gspref = prefix ? [prefix] : []; + var noGlobStar = gspref.concat(remainWithoutGlobStar); + this._process(noGlobStar, index, false, cb); + var isSym = this.symlinks[abs]; + var len = entries.length; + if (isSym && inGlobStar) + return cb(); + for (var i = 0; i < len; i++) { + var e = entries[i]; + if (e.charAt(0) === "." && !this.dot) + continue; + var instead = gspref.concat(entries[i], remainWithoutGlobStar); + this._process(instead, index, true, cb); + var below = gspref.concat(entries[i], remain); + this._process(below, index, true, cb); } - if (!value) - return targetDef; - const newValue = Array.isArray(curValue) ? curValue : [curValue]; - if (Array.isArray(value)) { - newValue.push(...value); - } else { - newValue.push(value); + cb(); + }; + Glob.prototype._processSimple = function(prefix, index, cb) { + var self = this; + this._stat(prefix, function(er, exists) { + self._processSimple2(prefix, index, er, exists, cb); + }); + }; + Glob.prototype._processSimple2 = function(prefix, index, er, exists, cb) { + if (!this.matches[index]) + this.matches[index] = /* @__PURE__ */ Object.create(null); + if (!exists) + return cb(); + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix); + if (prefix.charAt(0) === "/") { + prefix = path26.join(this.root, prefix); + } else { + prefix = path26.resolve(this.root, prefix); + if (trail) + prefix += "/"; + } } - targetDef[key] = normalizeTyposDefValue(newValue); - return targetDef; - } - exports.mergeDefEntry = mergeDefEntry; - function mergeDef(targetDef, fromDef) { - for (const key of Object.keys(fromDef)) { - mergeDefEntry(targetDef, key, fromDef[key]); + if (process.platform === "win32") + prefix = prefix.replace(/\\/g, "/"); + this._emitMatch(index, prefix); + cb(); + }; + Glob.prototype._stat = function(f, cb) { + var abs = this._makeAbs(f); + var needDir = f.slice(-1) === "/"; + if (f.length > this.maxLength) + return cb(); + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs]; + if (Array.isArray(c)) + c = "DIR"; + if (!needDir || c === "DIR") + return cb(null, c); + if (needDir && c === "FILE") + return cb(); } - return targetDef; - } - exports.mergeDef = mergeDef; - function appendToDef(def, entry) { - if (!entry) - return def; - if (typeof entry === "string") { - if (!def[entry]) { - def[entry] = false; + var exists; + var stat2 = this.statCache[abs]; + if (stat2 !== void 0) { + if (stat2 === false) + return cb(null, stat2); + else { + var type = stat2.isDirectory() ? "DIR" : "FILE"; + if (needDir && type === "FILE") + return cb(); + else + return cb(null, type, stat2); } - return def; } - if (Array.isArray(entry)) { - const [key, ...sugs] = entry.map((s2) => s2.trim()); - if (!key) - return def; - const s = sugs.map((s2) => s2.trim()).filter((s2) => !!s2); - return mergeDefEntry(def, key, s); + var self = this; + var statcb = inflight("stat\0" + abs, lstatcb_); + if (statcb) + self.fs.lstat(abs, statcb); + function lstatcb_(er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + return self.fs.stat(abs, function(er2, stat3) { + if (er2) + self._stat2(f, abs, null, lstat, cb); + else + self._stat2(f, abs, er2, stat3, cb); + }); + } else { + self._stat2(f, abs, er, lstat, cb); + } } - return mergeDef(def, entry); - } - exports.appendToDef = appendToDef; - function createTyposDef(entries) { - const def = /* @__PURE__ */ Object.create(null); - if (!entries) - return def; - for (const [key, value] of entries) { - def[key] = isDefined2(value) ? value : false; + }; + Glob.prototype._stat2 = function(f, abs, er, stat2, cb) { + if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) { + this.statCache[abs] = false; + return cb(); } - return def; - } - exports.createTyposDef = createTyposDef; - function extractAllSuggestions(typosDef) { - const allSugs = (0, sync_1.pipe)(Object.values(typosDef), (0, sync_1.opFilter)(hasSuggestions), (0, sync_1.opConcatMap)((v) => Array.isArray(v) ? v : [v])); - return new Set(allSugs); - } - exports.extractAllSuggestions = extractAllSuggestions; - function extractIgnoreValues(typosDef, ignorePrefix) { - const pfxLen = ignorePrefix.length; - return new Set(Object.keys(typosDef).filter((k) => k.startsWith(ignorePrefix)).map((k) => k.slice(pfxLen))); - } - exports.extractIgnoreValues = extractIgnoreValues; - function isDefined2(v) { - return v !== void 0 && v !== null; - } - function isString2(v) { - return typeof v === "string"; - } - function isArray(v) { - return Array.isArray(v); - } - function hasSuggestions(v) { - return isString2(v) || isArray(v); - } + var needDir = f.slice(-1) === "/"; + this.statCache[abs] = stat2; + if (abs.slice(-1) === "/" && stat2 && !stat2.isDirectory()) + return cb(null, false, stat2); + var c = true; + if (stat2) + c = stat2.isDirectory() ? "DIR" : "FILE"; + this.cache[abs] = this.cache[abs] || c; + if (needDir && c === "FILE") + return cb(); + return cb(null, c, stat2); + }; } }); -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/Typos/typosParser.js -var require_typosParser = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/Typos/typosParser.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseTyposFile = exports.parseTyposLine = exports.processEntriesToTyposDef = exports.sanitizeIntoTypoDef = exports.createTyposDefFromEntries = void 0; - var assert_1 = __importDefault(require("assert")); - var util_js_1 = require_util9(); - function assertString(v) { - (0, assert_1.default)(typeof v === "string", "A string was expected."); - return true; - } - var suggestionsSeparator = /[,]/; - var typoSuggestionsSeparator = /:|->/; - var typoEntrySeparator = /[\n;]/; - var inlineComment = /#.*/gm; - function createTyposDefFromEntries(entries) { - const def = /* @__PURE__ */ Object.create(null); - for (const entry of entries) { - (0, util_js_1.appendToDef)(def, entry); - } - return def; - } - exports.createTyposDefFromEntries = createTyposDefFromEntries; - function normalize(s) { - return s.normalize(); - } - function trimAndFilter(lines) { - return lines.map((s) => s.trim()).filter((s) => !!s).map(normalize); - } - function cleanSugs(rawSugs) { - const sugs = trimAndFilter(rawSugs); - return sugs.length === 1 ? sugs[0] : sugs.length ? sugs : false; - } - function splitSuggestionsValue(value) { - return cleanSugs(value.split(suggestionsSeparator)); +// node_modules/rimraf/rimraf.js +var require_rimraf = __commonJS({ + "node_modules/rimraf/rimraf.js"(exports, module2) { + var assert20 = require("assert"); + var path26 = require("path"); + var fs9 = require("fs"); + var glob2 = void 0; + try { + glob2 = require_glob(); + } catch (_err) { } - function sanitizeIntoTypoDef(dirtyDef) { - if (!dirtyDef || typeof dirtyDef !== "object") - return void 0; - const def = (0, util_js_1.createTyposDef)(); - for (const [rawKey, value] of Object.entries(dirtyDef)) { - const key = normalize(rawKey.trim()); - if (!key) - continue; - if (typeof value === "string") { - def[key] = splitSuggestionsValue(value); - continue; - } - if (Array.isArray(value)) { - const sugs = cleanSugs(value.filter(assertString)); - def[key] = sugs; - continue; - } - (0, assert_1.default)(value === false, "Unexpected suggestion type."); - def[key] = false; + var defaultGlobOpts = { + nosort: true, + silent: true + }; + var timeout = 0; + var isWindows2 = process.platform === "win32"; + var defaults = (options) => { + const methods = [ + "unlink", + "chmod", + "stat", + "lstat", + "rmdir", + "readdir" + ]; + methods.forEach((m) => { + options[m] = options[m] || fs9[m]; + m = m + "Sync"; + options[m] = options[m] || fs9[m]; + }); + options.maxBusyTries = options.maxBusyTries || 3; + options.emfileWait = options.emfileWait || 1e3; + if (options.glob === false) { + options.disableGlob = true; } - return def; - } - exports.sanitizeIntoTypoDef = sanitizeIntoTypoDef; - function processEntriesToTyposDef(entries) { - const def = isIterable2(entries) ? reduceToTyposDef(entries) : entries; - const result = sanitizeIntoTypoDef(def); - (0, assert_1.default)(result); - return result; - } - exports.processEntriesToTyposDef = processEntriesToTyposDef; - function reduceToTyposDef(entries) { - const def = (0, util_js_1.createTyposDef)(); - for (const entry of entries) { - (0, util_js_1.appendToDef)(def, parseTyposLine(entry)); + if (options.disableGlob !== true && glob2 === void 0) { + throw Error("glob dependency not found, set `options.disableGlob = true` if intentional"); } - return def; - } - function parseTyposLine(line) { - if (!line) - return void 0; - if (typeof line === "string") { - const def = (0, util_js_1.createTyposDef)(); - for (const subEntry of splitIntoLines(line)) { - const [left, right] = splitEntry(subEntry); - const typo = left.trim(); - if (!right) - return typo; - const sugs = splitSuggestionsValue(right); - def[typo] = sugs; - } - return def; - } - if (Array.isArray(line)) { - const [key, ...sugs] = line.filter(assertString).map((s) => s.trim()); - if (!key) - return void 0; - return [key, ...sugs]; + options.disableGlob = options.disableGlob || false; + options.glob = options.glob || defaultGlobOpts; + }; + var rimraf = (p, options, cb) => { + if (typeof options === "function") { + cb = options; + options = {}; } - return sanitizeIntoTypoDef(line); - } - exports.parseTyposLine = parseTyposLine; - function splitIntoLines(content) { - return trimAndFilter(normalize(content).split(typoEntrySeparator)); - } - function splitEntry(line) { - return line.split(typoSuggestionsSeparator, 2); - } - function parseTyposFile(content) { - const lines = splitIntoLines(content.replace(inlineComment, "")); - return reduceToTyposDef(lines); - } - exports.parseTyposFile = parseTyposFile; - function isIterable2(v) { - return Symbol.iterator in v; - } - } -}); - -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/Typos/index.js -var require_Typos = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/Typos/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.extractAllSuggestions = exports.createTyposDef = exports.processEntriesToTyposDef = exports.parseTyposLine = exports.parseTyposFile = void 0; - var typosParser_js_1 = require_typosParser(); - Object.defineProperty(exports, "parseTyposFile", { enumerable: true, get: function() { - return typosParser_js_1.parseTyposFile; - } }); - Object.defineProperty(exports, "parseTyposLine", { enumerable: true, get: function() { - return typosParser_js_1.parseTyposLine; - } }); - Object.defineProperty(exports, "processEntriesToTyposDef", { enumerable: true, get: function() { - return typosParser_js_1.processEntriesToTyposDef; - } }); - var util_js_1 = require_util9(); - Object.defineProperty(exports, "createTyposDef", { enumerable: true, get: function() { - return util_js_1.createTyposDef; - } }); - Object.defineProperty(exports, "extractAllSuggestions", { enumerable: true, get: function() { - return util_js_1.extractAllSuggestions; - } }); - } -}); - -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/TyposDictionary.js -var require_TyposDictionary = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/TyposDictionary.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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; + assert20(p, "rimraf: missing path"); + assert20.equal(typeof p, "string", "rimraf: path should be a string"); + assert20.equal(typeof cb, "function", "rimraf: callback function required"); + assert20(options, "rimraf: invalid options argument provided"); + assert20.equal(typeof options, "object", "rimraf: options should be object"); + defaults(options); + let busyTries = 0; + let errState = null; + let n = 0; + const next = (er) => { + errState = errState || er; + if (--n === 0) + cb(errState); + }; + const afterGlob = (er, results) => { + if (er) + return cb(er); + n = results.length; + if (n === 0) + return cb(); + results.forEach((p2) => { + const CB = (er2) => { + if (er2) { + if ((er2.code === "EBUSY" || er2.code === "ENOTEMPTY" || er2.code === "EPERM") && busyTries < options.maxBusyTries) { + busyTries++; + return setTimeout(() => rimraf_(p2, options, CB), busyTries * 100); + } + if (er2.code === "EMFILE" && timeout < options.emfileWait) { + return setTimeout(() => rimraf_(p2, options, CB), timeout++); + } + if (er2.code === "ENOENT") + er2 = null; + } + timeout = 0; + next(er2); + }; + rimraf_(p2, options, CB); + }); + }; + if (options.disableGlob || !glob2.hasMagic(p)) + return afterGlob(null, [p]); + options.lstat(p, (er, stat2) => { + if (!er) + return afterGlob(null, [p]); + glob2(p, options.glob, afterGlob); + }); }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createTyposDictionary = void 0; - var sync_1 = require_sync(); - var AutoResolve_js_1 = require_AutoResolve2(); - var textMappers_js_1 = require_textMappers(); - var defaults = __importStar(require_defaults()); - var index_js_1 = require_Typos(); - var util_js_1 = require_util9(); - var TyposDictionaryImpl = class { - constructor(name, source, typosDef, ignoreList) { - this.name = name; - this.source = source; - this.typosDef = typosDef; - this.options = {}; - this.type = "typos"; - this.isDictionaryCaseSensitive = true; - this.size = Object.keys(typosDef).length; - this.explicitIgnoreWords = (0, util_js_1.extractIgnoreValues)(typosDef, "!"); - this.suggestions = (0, util_js_1.extractAllSuggestions)(typosDef); - this.ignoreWords = new Set((0, sync_1.pipe)(this.explicitIgnoreWords, (0, sync_1.opAppend)(ignoreList || []))); - this.suggestionsLower = new Set((0, sync_1.pipe)(this.suggestions, textMappers_js_1.mapperRemoveCaseAndAccents)); - this.containsNoSuggestWords = this.ignoreWords.size > 0; - } - /** - * A Forbidden word list does not "have" valid words. - * Therefore it always returns false. - * @param _word - the word - * @param _options - options - * @returns always false - */ - has(_word, _options) { - return false; - } - /** A more detailed search for a word, might take longer than `has` */ - find(word, options) { - const result = this._findForms(word, options?.ignoreCase ?? defaults.ignoreCase); - if (result === false) - return void 0; - const { found, ignore } = result; - return { found, forbidden: !ignore, noSuggest: ignore }; - } - _findForms(word, ignoreCaseAndAccents) { - const lcWord = word.toLowerCase(); - if (this.ignoreWords.has(word)) { - return { found: word, ignore: true }; - } - if (this.suggestions.has(word)) { - return false; - } - if (ignoreCaseAndAccents) { - if (this.suggestionsLower.has(lcWord)) { - return false; - } - if (this.ignoreWords.has(lcWord)) { - return { found: lcWord, ignore: true }; + var rimraf_ = (p, options, cb) => { + assert20(p); + assert20(options); + assert20(typeof cb === "function"); + options.lstat(p, (er, st) => { + if (er && er.code === "ENOENT") + return cb(null); + if (er && er.code === "EPERM" && isWindows2) + fixWinEPERM(p, options, er, cb); + if (st && st.isDirectory()) + return rmdir(p, options, er, cb); + options.unlink(p, (er2) => { + if (er2) { + if (er2.code === "ENOENT") + return cb(null); + if (er2.code === "EPERM") + return isWindows2 ? fixWinEPERM(p, options, er2, cb) : rmdir(p, options, er2, cb); + if (er2.code === "EISDIR") + return rmdir(p, options, er2, cb); } - } - if (word in this.typosDef) - return { found: word, ignore: false }; - if (lcWord in this.typosDef) - return { found: lcWord, ignore: false }; - return false; - } - isForbidden(word, ignoreCaseAndAccents = defaults.isForbiddenIgnoreCaseAndAccents) { - const found = this._findForms(word, ignoreCaseAndAccents); - return found !== false && !found.ignore; - } - isNoSuggestWord(word, options) { - const result = this.find(word, options); - return result?.noSuggest ?? false; - } - /** - * Determine if the word can appear in a list of suggestions. - * @param word - word - * @param ignoreCaseAndAccents - ignore case. - * @returns true if a word is suggested, otherwise false. - */ - isSuggestedWord(word, ignoreCaseAndAccents = defaults.isForbiddenIgnoreCaseAndAccents) { - if (this.suggestions.has(word)) - return true; - const lcWord = word.toLowerCase(); - return ignoreCaseAndAccents && (this.suggestions.has(lcWord) || this.suggestionsLower.has(lcWord)); - } - suggest(word) { - return this.getPreferredSuggestions(word); - } - _suggest(word) { - if (this.ignoreWords.has(word)) - return []; - if (!(word in this.typosDef)) - return void 0; - const sug = this.typosDef[word]; - const isPreferred = true; - if (!sug) - return []; - if (typeof sug === "string") { - return [ - { - word: sug, - cost: 1, - isPreferred - } - ]; - } - return sug.map((word2, index) => ({ word: word2, cost: index + 1, isPreferred })); - } - genSuggestions(collector) { - const sugs = this.suggest(collector.word); - sugs.forEach((result) => collector.add(result)); - } - getPreferredSuggestions(word) { - return this._suggest(word) || this._suggest(word.toLowerCase()) || []; - } - mapWord(word) { - return word; - } - getErrors() { - return []; - } + return cb(er2); + }); + }); }; - var createCache2 = (0, AutoResolve_js_1.createAutoResolveWeakCache)(); - function createTyposDictionary(entries, name, source) { - return createCache2.get(entries, () => { - const def = (0, index_js_1.processEntriesToTyposDef)(entries); - return new TyposDictionaryImpl(name, source, def); + var fixWinEPERM = (p, options, er, cb) => { + assert20(p); + assert20(options); + assert20(typeof cb === "function"); + options.chmod(p, 438, (er2) => { + if (er2) + cb(er2.code === "ENOENT" ? null : er); + else + options.stat(p, (er3, stats) => { + if (er3) + cb(er3.code === "ENOENT" ? null : er); + else if (stats.isDirectory()) + rmdir(p, options, er, cb); + else + options.unlink(p, cb); + }); }); - } - exports.createTyposDictionary = createTyposDictionary; - } -}); - -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/FlagWordsDictionary.js -var require_FlagWordsDictionary = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/FlagWordsDictionary.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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.createFlagWordsDictionary = void 0; - var sync_1 = require_sync(); - var cspell_trie_lib_1 = require_cjs5(); - var AutoResolve_js_1 = require_AutoResolve2(); - var Defaults = __importStar(require_defaults()); - var SpellingDictionary_js_1 = require_SpellingDictionary(); - var SpellingDictionaryFromTrie_js_1 = require_SpellingDictionaryFromTrie(); - var SpellingDictionaryMethods_js_1 = require_SpellingDictionaryMethods(); - var TyposDictionary_js_1 = require_TyposDictionary(); - var FlagWordsDictionaryTrie = class extends SpellingDictionaryFromTrie_js_1.SpellingDictionaryFromTrie { - constructor(trie, name, source) { - super(trie, name, SpellingDictionary_js_1.defaultOptions, source); - this.name = name; - this.source = source; - this.containsNoSuggestWords = false; - this.options = {}; - this.isDictionaryCaseSensitive = true; - } - /** - * A Forbidden word list does not "have" valid words. - * Therefore it always returns false. - * @param _word - the word - * @param _options - options - * @returns always false - */ - has(_word, _options) { - return false; - } - find(word, hasOptions) { - const f = super.find(word, hasOptions); - if (!f || !f.forbidden) - return void 0; - return f; - } - suggest() { - return []; + var fixWinEPERMSync = (p, options, er) => { + assert20(p); + assert20(options); + try { + options.chmodSync(p, 438); + } catch (er2) { + if (er2.code === "ENOENT") + return; + else + throw er; } - genSuggestions() { - return; + let stats; + try { + stats = options.statSync(p); + } catch (er3) { + if (er3.code === "ENOENT") + return; + else + throw er; } + if (stats.isDirectory()) + rmdirSync(p, options, er); + else + options.unlinkSync(p); }; - var FlagWordsDictionary = class { - constructor(name, source, dictTypos, dictTrie) { - this.name = name; - this.source = source; - this.dictTypos = dictTypos; - this.dictTrie = dictTrie; - this.containsNoSuggestWords = false; - this.options = {}; - this.type = "flag-words"; - this.isDictionaryCaseSensitive = true; - } - /** - * A Forbidden word list does not "have" valid words. - * Therefore it always returns false. - * @param word - the word - * @param options - options - * @returns always false - */ - has(word, options) { - return this.dictTypos.has(word, options) || this.dictTrie?.has(word, options) || false; - } - /** A more detailed search for a word, might take longer than `has` */ - find(word, options) { - const findTypos = this.dictTypos.find(word, options); - if (findTypos) - return findTypos; - const ignoreCase = options?.ignoreCase ?? Defaults.ignoreCase; - if (this.dictTypos.isSuggestedWord(word, ignoreCase)) - return void 0; - return this.dictTrie?.find(word, options); - } - isForbidden(word, ignoreCaseAndAccents = Defaults.isForbiddenIgnoreCaseAndAccents) { - const findResult = this.find(word, { ignoreCase: ignoreCaseAndAccents }); - return findResult?.forbidden || false; - } - isNoSuggestWord(word, options) { - return this.dictTrie?.isNoSuggestWord(word, options) || this.dictTypos.isNoSuggestWord(word, options); - } - suggest(...args) { - const [word] = args; - const suggestOptions = (0, SpellingDictionaryMethods_js_1.suggestArgsToSuggestOptions)(args); - return this.dictTypos.suggest(word, suggestOptions); - } - getPreferredSuggestions(word) { - return this.dictTypos.getPreferredSuggestions(word); - } - genSuggestions() { - return; - } - mapWord(word) { - return word; - } - get size() { - return this.dictTypos.size + (this.dictTrie?.size || 0); - } - getErrors() { - return []; - } + var rmdir = (p, options, originalEr, cb) => { + assert20(p); + assert20(options); + assert20(typeof cb === "function"); + options.rmdir(p, (er) => { + if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) + rmkids(p, options, cb); + else if (er && er.code === "ENOTDIR") + cb(originalEr); + else + cb(er); + }); }; - var createCache2 = (0, AutoResolve_js_1.createAutoResolveWeakCache)(); - function createFlagWordsDictionary(wordList, name, source) { - return createCache2.get(wordList, () => { - const testSpecialCharacters = /[~*+]/; - const { t: specialWords, f: typoWords } = bisect((0, cspell_trie_lib_1.parseDictionaryLines)(wordList, { stripCaseAndAccents: false }), (line) => testSpecialCharacters.test(line)); - const trieDict = specialWords.size ? buildTrieDict(specialWords, name, source) : void 0; - const typosDict = (0, TyposDictionary_js_1.createTyposDictionary)(typoWords, name, source); - if (!trieDict) - return typosDict; - return new FlagWordsDictionary(name, source, typosDict, trieDict); + var rmkids = (p, options, cb) => { + assert20(p); + assert20(options); + assert20(typeof cb === "function"); + options.readdir(p, (er, files) => { + if (er) + return cb(er); + let n = files.length; + if (n === 0) + return options.rmdir(p, cb); + let errState; + files.forEach((f) => { + rimraf(path26.join(p, f), options, (er2) => { + if (errState) + return; + if (er2) + return cb(errState = er2); + if (--n === 0) + options.rmdir(p, cb); + }); + }); }); - } - exports.createFlagWordsDictionary = createFlagWordsDictionary; - var regExpCleanIgnore = /^(!!)+/; - function buildTrieDict(words, name, source) { - const trie = (0, cspell_trie_lib_1.buildTrieFast)((0, sync_1.pipe)(words, (0, sync_1.opMap)((w) => "!" + w), (0, sync_1.opMap)((w) => w.replace(regExpCleanIgnore, "")))); - return new FlagWordsDictionaryTrie(trie, name, source); - } - function bisect(values, predicate) { - const t = /* @__PURE__ */ new Set(); - const f = /* @__PURE__ */ new Set(); - for (const v of values) { - if (predicate(v)) { - t.add(v); - } else { - f.add(v); - } - } - return { t, f }; - } - } -}); - -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/IgnoreWordsDictionary.js -var require_IgnoreWordsDictionary = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/IgnoreWordsDictionary.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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.createIgnoreWordsDictionary = void 0; - var sync_1 = require_sync(); - var cspell_trie_lib_1 = require_cjs5(); - var AutoResolve_js_1 = require_AutoResolve2(); - var createSpellingDictionary_js_1 = require_createSpellingDictionary(); - var Defaults = __importStar(require_defaults()); - var NormalizeForm = "NFC"; - var IgnoreWordsDictionary = class { - constructor(name, source, words) { - this.name = name; - this.source = source; - this.containsNoSuggestWords = true; - this.options = {}; - this.type = "ignore"; - this.isDictionaryCaseSensitive = true; - this.dict = new Set(words); - this.dictNonStrict = new Set((0, sync_1.pipe)(this.dict, (0, sync_1.opFilter)((w) => w.startsWith("~")), (0, sync_1.opMap)((w) => w.slice(1)))); - } - /** - * A Forbidden word list does not "have" valid words. - * Therefore it always returns false. - * @param _word - the word - * @param _options - options - * @returns always false - */ - has(word, options) { - const nWord = word.normalize(NormalizeForm); - if (this.dict.has(nWord)) - return true; - const lcWord = nWord.toLowerCase(); - if (this.dict.has(lcWord)) - return true; - const ignoreCase = options?.ignoreCase ?? Defaults.ignoreCase; - return ignoreCase && (this.dictNonStrict.has(nWord) || this.dictNonStrict.has(lcWord)); - } - /** A more detailed search for a word, might take longer than `has` */ - find(word, options) { - const nWord = word.normalize(NormalizeForm); - if (this.dict.has(nWord)) - return { found: nWord, forbidden: false, noSuggest: true }; - const lcWord = nWord.toLowerCase(); - if (this.dict.has(lcWord)) - return { found: lcWord, forbidden: false, noSuggest: true }; - const ignoreCase = options?.ignoreCase ?? Defaults.ignoreCase; - if (!ignoreCase) - return void 0; - if (this.dictNonStrict.has(nWord)) - return { found: nWord, forbidden: false, noSuggest: true }; - return this.dictNonStrict.has(lcWord) && { found: lcWord, forbidden: false, noSuggest: true } || void 0; - } - isForbidden(_word, _ignoreCase) { - return false; - } - isNoSuggestWord(word, options) { - return this.has(word, options); - } - suggest() { - return []; + var rimrafSync = (p, options) => { + options = options || {}; + defaults(options); + assert20(p, "rimraf: missing path"); + assert20.equal(typeof p, "string", "rimraf: path should be a string"); + assert20(options, "rimraf: missing options"); + assert20.equal(typeof options, "object", "rimraf: options should be object"); + let results; + if (options.disableGlob || !glob2.hasMagic(p)) { + results = [p]; + } else { + try { + options.lstatSync(p); + results = [p]; + } catch (er) { + results = glob2.sync(p, options.glob); + } } - genSuggestions() { + if (!results.length) return; + for (let i = 0; i < results.length; i++) { + const p2 = results[i]; + let st; + try { + st = options.lstatSync(p2); + } catch (er) { + if (er.code === "ENOENT") + return; + if (er.code === "EPERM" && isWindows2) + fixWinEPERMSync(p2, options, er); + } + try { + if (st && st.isDirectory()) + rmdirSync(p2, options, null); + else + options.unlinkSync(p2); + } catch (er) { + if (er.code === "ENOENT") + return; + if (er.code === "EPERM") + return isWindows2 ? fixWinEPERMSync(p2, options, er) : rmdirSync(p2, options, er); + if (er.code !== "EISDIR") + throw er; + rmdirSync(p2, options, er); + } } - mapWord(word) { - return word; - } - get size() { - return this.dict.size; - } - getErrors() { - return []; + }; + var rmdirSync = (p, options, originalEr) => { + assert20(p); + assert20(options); + try { + options.rmdirSync(p); + } catch (er) { + if (er.code === "ENOENT") + return; + if (er.code === "ENOTDIR") + throw originalEr; + if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") + rmkidsSync(p, options); } }; - var createCache2 = (0, AutoResolve_js_1.createAutoResolveWeakCache)(); - function createIgnoreWordsDictionary(wordList, name, source) { - return createCache2.get(wordList, () => { - const testSpecialCharacters = /[*+]/; - const words = [...(0, cspell_trie_lib_1.parseDictionaryLines)(wordList, { stripCaseAndAccents: true })].map((w) => w.normalize(NormalizeForm)); - const hasSpecial = words.findIndex((word) => testSpecialCharacters.test(word)) >= 0; - if (hasSpecial) { - return (0, createSpellingDictionary_js_1.createSpellingDictionary)(words, name, source, { - caseSensitive: true, - noSuggest: true, - weightMap: void 0, - supportNonStrictSearches: true - }); + var rmkidsSync = (p, options) => { + assert20(p); + assert20(options); + options.readdirSync(p).forEach((f) => rimrafSync(path26.join(p, f), options)); + const retries = isWindows2 ? 100 : 1; + let i = 0; + do { + let threw = true; + try { + const ret = options.rmdirSync(p, options); + threw = false; + return ret; + } finally { + if (++i < retries && threw) + continue; } - return new IgnoreWordsDictionary(name, source, words); - }); - } - exports.createIgnoreWordsDictionary = createIgnoreWordsDictionary; + } while (true); + }; + module2.exports = rimraf; + rimraf.sync = rimrafSync; } }); -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/SpellingDictionaryCollection.js -var require_SpellingDictionaryCollection = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/SpellingDictionaryCollection.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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.__testing__ = exports.isSpellingDictionaryCollection = exports.createCollection = void 0; - var cspell_trie_lib_1 = require_cjs5(); - var gensequence_1 = require_dist2(); - var util_js_1 = require_util8(); - var Defaults = __importStar(require_defaults()); - var SpellingDictionary_js_1 = require_SpellingDictionary(); - var SpellingDictionaryMethods_js_1 = require_SpellingDictionaryMethods(); - function identityString(w) { - return w; - } - var SpellingDictionaryCollectionImpl = class { - constructor(dictionaries, name, source) { - this.dictionaries = dictionaries; - this.name = name; - this.options = { weightMap: void 0 }; - this.mapWord = identityString; - this.type = "SpellingDictionaryCollection"; - this._isNoSuggestWord = (word, options) => { - if (!this.containsNoSuggestWords) - return false; - return !!isNoSuggestWordInAnyDictionary(this.dictionaries, word, options || {}); - }; - this.dictionaries = this.dictionaries.sort((a, b) => b.size - a.size); - this.source = source || dictionaries.map((d) => d.name).join(", "); - this.isDictionaryCaseSensitive = this.dictionaries.reduce((a, b) => a || b.isDictionaryCaseSensitive, false); - this.containsNoSuggestWords = this.dictionaries.reduce((a, b) => a || b.containsNoSuggestWords, false); - } - has(word, hasOptions) { - const options = (0, SpellingDictionaryMethods_js_1.hasOptionToSearchOption)(hasOptions); - return !!isWordInAnyDictionary(this.dictionaries, word, options) && !this.isForbidden(word); - } - find(word, hasOptions) { - const options = (0, SpellingDictionaryMethods_js_1.hasOptionToSearchOption)(hasOptions); - return findInAnyDictionary(this.dictionaries, word, options); - } - isNoSuggestWord(word, options) { - return this._isNoSuggestWord(word, options); - } - isForbidden(word, ignoreCaseAndAccents) { - const ignoreCase = ignoreCaseAndAccents ?? Defaults.isForbiddenIgnoreCaseAndAccents; - return !!this._isForbiddenInDict(word, ignoreCase) && !this.isNoSuggestWord(word, { ignoreCase }); - } - suggest(...args) { - const [word] = args; - const suggestOptions = (0, SpellingDictionaryMethods_js_1.suggestArgsToSuggestOptions)(args); - return this._suggest(word, suggestOptions); - } - _suggest(word, suggestOptions) { - const { numSuggestions = SpellingDictionaryMethods_js_1.defaultNumSuggestions, numChanges, ignoreCase, includeTies, timeout } = suggestOptions; - const prefixNoCase = cspell_trie_lib_1.CASE_INSENSITIVE_PREFIX; - const filter = (word2, _cost) => { - return (ignoreCase || word2[0] !== prefixNoCase) && !this.isForbidden(word2) && !this.isNoSuggestWord(word2, suggestOptions); - }; - const collectorOptions = { - numSuggestions, - filter, - changeLimit: numChanges, - includeTies, - ignoreCase, - timeout - }; - const collector = (0, SpellingDictionaryMethods_js_1.suggestionCollector)(word, collectorOptions); - this.genSuggestions(collector, suggestOptions); - return collector.suggestions; - } - get size() { - return this.dictionaries.reduce((a, b) => a + b.size, 0); - } - getPreferredSuggestions(word) { - const sugs = this.dictionaries.flatMap((dict) => dict.getPreferredSuggestions?.(word)).filter(util_js_1.isDefined); - if (sugs.length <= 1) - return sugs; - const unique = /* @__PURE__ */ new Set(); - return sugs.filter((sug) => { - if (unique.has(sug.word)) - return false; - unique.add(sug.word); - return true; +// node_modules/flat-cache/src/del.js +var require_del = __commonJS({ + "node_modules/flat-cache/src/del.js"(exports, module2) { + var rimraf = require_rimraf().sync; + var fs9 = require("fs"); + module2.exports = function del(file) { + if (fs9.existsSync(file)) { + rimraf(file, { + glob: false }); + return true; } - genSuggestions(collector, suggestOptions) { - const _suggestOptions = { ...suggestOptions }; - const { compoundMethod = SpellingDictionary_js_1.CompoundWordsMethod.SEPARATE_WORDS } = suggestOptions; - _suggestOptions.compoundMethod = this.options.useCompounds ? SpellingDictionary_js_1.CompoundWordsMethod.JOIN_WORDS : compoundMethod; - this.dictionaries.forEach((dict) => dict.genSuggestions(collector, _suggestOptions)); - } - getErrors() { - return this.dictionaries.reduce((errors, dict) => errors.concat(dict.getErrors?.() || []), []); - } - _isForbiddenInDict(word, ignoreCase) { - return isWordForbiddenInAnyDictionary(this.dictionaries, word, ignoreCase); - } - }; - function createCollection(dictionaries, name, source) { - return new SpellingDictionaryCollectionImpl(dictionaries, name, source); - } - exports.createCollection = createCollection; - function isWordInAnyDictionary(dicts, word, options) { - return (0, gensequence_1.genSequence)(dicts).first((dict) => dict.has(word, options)); - } - function findInAnyDictionary(dicts, word, options) { - const found = dicts.map((dict) => dict.find(word, options)).filter(util_js_1.isDefined); - if (!found.length) - return void 0; - return found.reduce((a, b) => ({ - found: a.forbidden ? a.found : b.forbidden ? b.found : a.found || b.found, - forbidden: a.forbidden || b.forbidden, - noSuggest: a.noSuggest || b.noSuggest - })); - } - function isNoSuggestWordInAnyDictionary(dicts, word, options) { - return (0, gensequence_1.genSequence)(dicts).first((dict) => dict.isNoSuggestWord(word, options)); - } - function isWordForbiddenInAnyDictionary(dicts, word, ignoreCase) { - return (0, gensequence_1.genSequence)(dicts).first((dict) => dict.isForbidden(word, ignoreCase)); - } - function isSpellingDictionaryCollection(dict) { - return dict instanceof SpellingDictionaryCollectionImpl; - } - exports.isSpellingDictionaryCollection = isSpellingDictionaryCollection; - exports.__testing__ = { - isWordInAnyDictionary, - isWordForbiddenInAnyDictionary + return false; }; } }); -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/SuggestDictionary.js -var require_SuggestDictionary = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/SuggestDictionary.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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.createSuggestDictionary = void 0; - var sync_1 = require_sync(); - var AutoResolve_js_1 = require_AutoResolve2(); - var textMappers_js_1 = require_textMappers(); - var defaults = __importStar(require_defaults()); - var index_js_1 = require_Typos(); - var util_js_1 = require_util9(); - var SuggestDictionaryImpl = class { - constructor(name, source, typosDef) { - this.name = name; - this.source = source; - this.typosDef = typosDef; - this.containsNoSuggestWords = false; - this.options = {}; - this.type = "suggest"; - this.isDictionaryCaseSensitive = true; - this.size = Object.keys(typosDef).length; - this.suggestions = (0, util_js_1.extractAllSuggestions)(typosDef); - this.suggestionsLower = new Set((0, sync_1.pipe)(this.suggestions, textMappers_js_1.mapperRemoveCaseAndAccents)); - } +// node_modules/flat-cache/src/cache.js +var require_cache = __commonJS({ + "node_modules/flat-cache/src/cache.js"(exports, module2) { + var path26 = require("path"); + var fs9 = require("fs"); + var utils = require_utils9(); + var del = require_del(); + var writeJSON = utils.writeJSON; + var cache2 = { /** - * A Forbidden word list does not "have" valid words. - * Therefore it always returns false. - * @param _word - the word - * @param _options - options - * @returns always false + * Load a cache identified by the given Id. If the element does not exists, then initialize an empty + * cache storage. If specified `cacheDir` will be used as the directory to persist the data to. If omitted + * then the cache module directory `./cache` will be used instead + * + * @method load + * @param docId {String} the id of the cache, would also be used as the name of the file cache + * @param [cacheDir] {String} directory for the cache entry */ - has(_word, _options) { - return false; - } - /** A more detailed search for a word, might take longer than `has` */ - find(_word, _options) { - return void 0; - } - isForbidden(_word, _ignoreCaseAndAccents) { - return false; - } - isNoSuggestWord(_word, _options) { - return false; - } + load: function(docId, cacheDir) { + var me = this; + me._visited = {}; + me._persisted = {}; + me._pathToFile = cacheDir ? path26.resolve(cacheDir, docId) : path26.resolve(__dirname, "../.cache/", docId); + if (fs9.existsSync(me._pathToFile)) { + me._persisted = utils.tryParse(me._pathToFile, {}); + } + }, /** - * Determine if the word can appear in a list of suggestions. - * @param word - word - * @param ignoreCaseAndAccents - ignore case. - * @returns true if a word is suggested, otherwise false. + * Load the cache from the provided file + * @method loadFile + * @param {String} pathToFile the path to the file containing the info for the cache */ - isSuggestedWord(word, ignoreCaseAndAccents = defaults.isForbiddenIgnoreCaseAndAccents) { - if (this.suggestions.has(word)) - return true; - const lcWord = word.toLowerCase(); - return ignoreCaseAndAccents && (this.suggestions.has(lcWord) || this.suggestionsLower.has(lcWord)); - } - suggest(word) { - return this.getPreferredSuggestions(word); - } - _suggest(word) { - if (!(word in this.typosDef)) - return void 0; - const sug = this.typosDef[word]; - const isPreferred = true; - if (!sug) - return []; - if (typeof sug === "string") { - return [ - { - word: sug, - cost: 1, - isPreferred - } - ]; - } - return sug.map((word2, index) => ({ word: word2, cost: index + 1, isPreferred })); - } - getPreferredSuggestions(word) { - return this._suggest(word) || this._suggest(word.toLowerCase()) || []; - } - genSuggestions(collector) { - const sugs = this.suggest(collector.word); - sugs.forEach((result) => collector.add(result)); - } - mapWord(word) { - return word; - } - getErrors() { - return []; - } - }; - var createCache2 = (0, AutoResolve_js_1.createAutoResolveWeakCache)(); - function createSuggestDictionary(entries, name, source) { - return createCache2.get(entries, () => { - const def = (0, index_js_1.processEntriesToTyposDef)(entries); - return new SuggestDictionaryImpl(name, source, def); - }); - } - exports.createSuggestDictionary = createSuggestDictionary; - } -}); - -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/createInlineSpellingDictionary.js -var require_createInlineSpellingDictionary = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/createInlineSpellingDictionary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createInlineSpellingDictionary = void 0; - var AutoResolve_js_1 = require_AutoResolve2(); - var util_js_1 = require_util8(); - var createSpellingDictionary_js_1 = require_createSpellingDictionary(); - var FlagWordsDictionary_js_1 = require_FlagWordsDictionary(); - var IgnoreWordsDictionary_js_1 = require_IgnoreWordsDictionary(); - var SpellingDictionaryCollection_js_1 = require_SpellingDictionaryCollection(); - var SuggestDictionary_js_1 = require_SuggestDictionary(); - var cache = (0, AutoResolve_js_1.createAutoResolveWeakCache)(); - function createInlineSpellingDictionary(inlineDict, source) { - return cache.get(inlineDict, () => { - const { words, flagWords, ignoreWords, suggestWords, name } = inlineDict; - const dictSources = [ - words && (0, createSpellingDictionary_js_1.createSpellingDictionary)(words, name + "-words", source, inlineDict), - flagWords && (0, FlagWordsDictionary_js_1.createFlagWordsDictionary)(flagWords, name + "-flag-words", source), - ignoreWords && (0, IgnoreWordsDictionary_js_1.createIgnoreWordsDictionary)(ignoreWords, name + "-ignore-words", source), - suggestWords && (0, SuggestDictionary_js_1.createSuggestDictionary)(suggestWords, name + "-suggest", source) - ].filter(util_js_1.isDefined); - return (0, SpellingDictionaryCollection_js_1.createCollection)(dictSources, name, source); - }); - } - exports.createInlineSpellingDictionary = createInlineSpellingDictionary; - } -}); - -// node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/index.js -var require_SpellingDictionary2 = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/SpellingDictionary/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createTyposDictionary = exports.createSuggestDictionary = exports.createSpellingDictionaryFromTrieFile = exports.createCollection = exports.createIgnoreWordsDictionary = exports.createForbiddenWordsDictionary = exports.createFlagWordsDictionary = exports.createSpellingDictionary = exports.createFailedToLoadDictionary = exports.createInlineSpellingDictionary = exports.createCachingDictionary = void 0; - var CachingDictionary_js_1 = require_CachingDictionary(); - Object.defineProperty(exports, "createCachingDictionary", { enumerable: true, get: function() { - return CachingDictionary_js_1.createCachingDictionary; - } }); - var createInlineSpellingDictionary_js_1 = require_createInlineSpellingDictionary(); - Object.defineProperty(exports, "createInlineSpellingDictionary", { enumerable: true, get: function() { - return createInlineSpellingDictionary_js_1.createInlineSpellingDictionary; - } }); - var createSpellingDictionary_js_1 = require_createSpellingDictionary(); - Object.defineProperty(exports, "createFailedToLoadDictionary", { enumerable: true, get: function() { - return createSpellingDictionary_js_1.createFailedToLoadDictionary; - } }); - Object.defineProperty(exports, "createSpellingDictionary", { enumerable: true, get: function() { - return createSpellingDictionary_js_1.createSpellingDictionary; - } }); - var FlagWordsDictionary_js_1 = require_FlagWordsDictionary(); - Object.defineProperty(exports, "createFlagWordsDictionary", { enumerable: true, get: function() { - return FlagWordsDictionary_js_1.createFlagWordsDictionary; - } }); - Object.defineProperty(exports, "createForbiddenWordsDictionary", { enumerable: true, get: function() { - return FlagWordsDictionary_js_1.createFlagWordsDictionary; - } }); - var IgnoreWordsDictionary_js_1 = require_IgnoreWordsDictionary(); - Object.defineProperty(exports, "createIgnoreWordsDictionary", { enumerable: true, get: function() { - return IgnoreWordsDictionary_js_1.createIgnoreWordsDictionary; - } }); - var SpellingDictionaryCollection_js_1 = require_SpellingDictionaryCollection(); - Object.defineProperty(exports, "createCollection", { enumerable: true, get: function() { - return SpellingDictionaryCollection_js_1.createCollection; - } }); - var SpellingDictionaryFromTrie_js_1 = require_SpellingDictionaryFromTrie(); - Object.defineProperty(exports, "createSpellingDictionaryFromTrieFile", { enumerable: true, get: function() { - return SpellingDictionaryFromTrie_js_1.createSpellingDictionaryFromTrieFile; - } }); - var SuggestDictionary_js_1 = require_SuggestDictionary(); - Object.defineProperty(exports, "createSuggestDictionary", { enumerable: true, get: function() { - return SuggestDictionary_js_1.createSuggestDictionary; - } }); - var TyposDictionary_js_1 = require_TyposDictionary(); - Object.defineProperty(exports, "createTyposDictionary", { enumerable: true, get: function() { - return TyposDictionary_js_1.createTyposDictionary; - } }); - } -}); - -// node_modules/cspell-dictionary/dist/cjs/index.js -var require_cjs7 = __commonJS({ - "node_modules/cspell-dictionary/dist/cjs/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createSuggestDictionary = exports.createSpellingDictionaryFromTrieFile = exports.createSpellingDictionary = exports.createInlineSpellingDictionary = exports.createIgnoreWordsDictionary = exports.createForbiddenWordsDictionary = exports.createFlagWordsDictionary = exports.createFailedToLoadDictionary = exports.createCollection = exports.createCachingDictionary = void 0; - var index_js_1 = require_SpellingDictionary2(); - Object.defineProperty(exports, "createCachingDictionary", { enumerable: true, get: function() { - return index_js_1.createCachingDictionary; - } }); - Object.defineProperty(exports, "createCollection", { enumerable: true, get: function() { - return index_js_1.createCollection; - } }); - Object.defineProperty(exports, "createFailedToLoadDictionary", { enumerable: true, get: function() { - return index_js_1.createFailedToLoadDictionary; - } }); - Object.defineProperty(exports, "createFlagWordsDictionary", { enumerable: true, get: function() { - return index_js_1.createFlagWordsDictionary; - } }); - Object.defineProperty(exports, "createForbiddenWordsDictionary", { enumerable: true, get: function() { - return index_js_1.createForbiddenWordsDictionary; - } }); - Object.defineProperty(exports, "createIgnoreWordsDictionary", { enumerable: true, get: function() { - return index_js_1.createIgnoreWordsDictionary; - } }); - Object.defineProperty(exports, "createInlineSpellingDictionary", { enumerable: true, get: function() { - return index_js_1.createInlineSpellingDictionary; - } }); - Object.defineProperty(exports, "createSpellingDictionary", { enumerable: true, get: function() { - return index_js_1.createSpellingDictionary; - } }); - Object.defineProperty(exports, "createSpellingDictionaryFromTrieFile", { enumerable: true, get: function() { - return index_js_1.createSpellingDictionaryFromTrieFile; - } }); - Object.defineProperty(exports, "createSuggestDictionary", { enumerable: true, get: function() { - return index_js_1.createSuggestDictionary; - } }); - } -}); - -// node_modules/cspell-lib/dist/cjs/static.js -var require_static = __commonJS({ - "node_modules/cspell-lib/dist/cjs/static.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getCSpellIO = void 0; - var cspell_io_1 = require_cjs3(); - var cspellIO = new cspell_io_1.CSpellIONode(); - function getCSpellIO() { - return cspellIO; - } - exports.getCSpellIO = getCSpellIO; - } -}); - -// node_modules/@cspell/strong-weak-map/dist/cjs/StrongWeakMap.js -var require_StrongWeakMap = __commonJS({ - "node_modules/@cspell/strong-weak-map/dist/cjs/StrongWeakMap.js"(exports) { - "use strict"; - var _a; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.StrongWeakMap = void 0; - var StrongWeakMap = class { - constructor(init) { - this[_a] = "StrongWeakMap"; - this.map = new Map(init?.map(([k, v]) => [k, new WeakRef(v)])); - } - clear() { - this.map.clear(); - } + loadFile: function(pathToFile) { + var me = this; + var dir = path26.dirname(pathToFile); + var fName = path26.basename(pathToFile); + me.load(fName, dir); + }, /** - * @returns true if an element in the Map existed and has been removed, or false if the element does not exist. + * Returns the entire persisted object + * @method all + * @returns {*} */ - delete(key) { - return this.map.delete(key); - } + all: function() { + return this._persisted; + }, + keys: function() { + return Object.keys(this._persisted); + }, /** - * Executes a provided function once per each key/value pair in the Map, in insertion order. + * sets a key to a given value + * @method setKey + * @param key {string} the key to set + * @param value {object} the value of the key. Could be any object that can be serialized with JSON.stringify */ - forEach(callbackfn, thisArg) { - if (thisArg) { - callbackfn = callbackfn.bind(thisArg); - } - for (const [key, value] of this) { - callbackfn(value, key, this); - } - } + setKey: function(key, value) { + this._visited[key] = true; + this._persisted[key] = value; + }, /** - * Returns a specified element from the Map object. You will get a reference to the value object and any change made to that - * object will effectively modify it inside the Map. - * @returns Returns the element associated with the specified key. - * If no element is associated with the specified key, undefined is returned. + * remove a given key from the cache + * @method removeKey + * @param key {String} the key to remove from the object */ - get(key) { - const ref = this.map.get(key); - if (!ref) - return void 0; - const value = ref.deref(); - if (!value) { - this.map.delete(key); - return void 0; - } - return value; - } + removeKey: function(key) { + delete this._visited[key]; + delete this._persisted[key]; + }, /** - * Returns a specified element from the Map. If the element isn't found, the resolver function is called and the result is stored in the map and returned. + * Return the value of the provided key + * @method getKey + * @param key {String} the name of the key to retrieve + * @returns {*} the value from the key */ - autoGet(key, resolver) { - const found = this.get(key); - if (found) - return found; - const created = resolver(key); - this.set(key, created); - return created; - } + getKey: function(key) { + this._visited[key] = true; + return this._persisted[key]; + }, /** - * Note: has will cause the value object to live longer. - * See: [WeakRef - JavaScript | MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) - * @returns boolean indicating whether an element with the specified key exists or not. + * Remove keys that were not accessed/set since the + * last time the `prune` method was called. + * @method _prune + * @private */ - has(key) { - const value = this.get(key); - return !!value; - } + _prune: function() { + var me = this; + var obj = {}; + var keys2 = Object.keys(me._visited); + if (keys2.length === 0) { + return; + } + keys2.forEach(function(key) { + obj[key] = me._persisted[key]; + }); + me._visited = {}; + me._persisted = obj; + }, /** - * Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated. + * Save the state of the cache identified by the docId to disk + * as a JSON structure + * @param [noPrune=false] {Boolean} whether to remove from cache the non visited files + * @method save */ - set(key, value) { - this.map.set(key, new WeakRef(value)); - return this; - } + save: function(noPrune) { + var me = this; + !noPrune && me._prune(); + writeJSON(me._pathToFile, me._persisted); + }, /** - * @returns the number of elements in the Map. Note: it is possible that some of the values have been dereferenced + * remove the file where the cache is persisted + * @method removeCacheFile + * @return {Boolean} true or false if the file was successfully deleted */ - get size() { - return this.map.size; - } - /** Returns an iterable of entries in the map. */ - [Symbol.iterator]() { - return this.entries(); - } + removeCacheFile: function() { + return del(this._pathToFile); + }, /** - * Returns an iterable of key, value pairs for every entry in the map. + * Destroy the file cache and cache content. + * @method destroy */ - *entries() { - for (const key of this.map.keys()) { - const value = this.get(key); - if (!value) - continue; - yield [key, value]; - } + destroy: function() { + var me = this; + me._visited = {}; + me._persisted = {}; + me.removeCacheFile(); } + }; + module2.exports = { /** - * Returns an iterable of keys in the map + * Alias for create. Should be considered depreacted. Will be removed in next releases * - * Note: It is possible that the value associated with the key was released. + * @method load + * @param docId {String} the id of the cache, would also be used as the name of the file cache + * @param [cacheDir] {String} directory for the cache entry + * @returns {cache} cache instance */ - keys() { - return this.map.keys(); - } + load: function(docId, cacheDir) { + return this.create(docId, cacheDir); + }, /** - * Returns an iterable of values in the map + * Load a cache identified by the given Id. If the element does not exists, then initialize an empty + * cache storage. + * + * @method create + * @param docId {String} the id of the cache, would also be used as the name of the file cache + * @param [cacheDir] {String} directory for the cache entry + * @returns {cache} cache instance */ - *values() { - for (const [_, value] of this) { - yield value; - } - } + create: function(docId, cacheDir) { + var obj = Object.create(cache2); + obj.load(docId, cacheDir); + return obj; + }, + createFromFile: function(filePath) { + var obj = Object.create(cache2); + obj.loadFile(filePath); + return obj; + }, /** - * Removes any keys that reference released objects. + * Clear the cache identified by the given id. Caches stored in a different cache directory can be deleted directly + * + * @method clearCache + * @param docId {String} the id of the cache, would also be used as the name of the file cache + * @param cacheDir {String} the directory where the cache file was written + * @returns {Boolean} true if the cache folder was deleted. False otherwise */ - cleanKeys() { - [...this]; - return this; - } - }; - exports.StrongWeakMap = StrongWeakMap; - _a = Symbol.toStringTag; - } -}); - -// node_modules/@cspell/strong-weak-map/dist/cjs/index.js -var require_cjs8 = __commonJS({ - "node_modules/@cspell/strong-weak-map/dist/cjs/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.StrongWeakMap = void 0; - var StrongWeakMap_js_1 = require_StrongWeakMap(); - Object.defineProperty(exports, "StrongWeakMap", { enumerable: true, get: function() { - return StrongWeakMap_js_1.StrongWeakMap; - } }); - } -}); - -// node_modules/cspell-lib/dist/cjs/SpellingDictionary/SpellingDictionaryError.js -var require_SpellingDictionaryError = __commonJS({ - "node_modules/cspell-lib/dist/cjs/SpellingDictionary/SpellingDictionaryError.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isSpellingDictionaryLoadError = exports.SpellingDictionaryLoadError = void 0; - var SpellingDictionaryLoadError = class extends Error { - constructor(uri, options, cause, message) { - super(message); - this.uri = uri; - this.options = options; - this.cause = cause; - this.name = options.name; + clearCacheById: function(docId, cacheDir) { + var filePath = cacheDir ? path26.resolve(cacheDir, docId) : path26.resolve(__dirname, "../.cache/", docId); + return del(filePath); + }, + /** + * Remove all cache stored in the cache directory + * @method clearAll + * @returns {Boolean} true if the cache folder was deleted. False otherwise + */ + clearAll: function(cacheDir) { + var filePath = cacheDir ? path26.resolve(cacheDir) : path26.resolve(__dirname, "../.cache/"); + return del(filePath); } }; - exports.SpellingDictionaryLoadError = SpellingDictionaryLoadError; - function isSpellingDictionaryLoadError2(e) { - return e instanceof SpellingDictionaryLoadError; - } - exports.isSpellingDictionaryLoadError = isSpellingDictionaryLoadError2; } }); -// node_modules/cspell-lib/dist/cjs/SpellingDictionary/DictionaryController/DictionaryLoader.js -var require_DictionaryLoader = __commonJS({ - "node_modules/cspell-lib/dist/cjs/SpellingDictionary/DictionaryController/DictionaryLoader.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DictionaryLoader = void 0; - var sync_1 = require_sync(); - var strong_weak_map_1 = require_cjs8(); - var cspell_dictionary_1 = require_cjs7(); - var CSpellSettingsInternalDef_js_1 = require_CSpellSettingsInternalDef(); - var AutoResolve_js_1 = require_AutoResolve(); - var errors_js_1 = require_errors3(); - var SpellingDictionaryError_js_1 = require_SpellingDictionaryError(); - var MAX_AGE = 1e4; - var loaders = { - S: loadSimpleWordList, - C: legacyWordList, - W: wordsPerLineWordList, - T: loadTrie, - default: loadSimpleWordList - }; - var loadersSync = { - S: loadSimpleWordListSync, - C: legacyWordListSync, - W: wordsPerLineWordListSync, - T: loadTrieSync, - default: loadSimpleWordListSync - }; - var LoadingState; - (function(LoadingState2) { - LoadingState2[LoadingState2["Loaded"] = 0] = "Loaded"; - LoadingState2[LoadingState2["Loading"] = 1] = "Loading"; - })(LoadingState || (LoadingState = {})); - var DictionaryLoader = class { - constructor(cspellIO) { - this.cspellIO = cspellIO; - this.dictionaryCache = new strong_weak_map_1.StrongWeakMap(); - this.inlineDictionaryCache = new AutoResolve_js_1.AutoResolveWeakCache(); - this.dictionaryCacheByDef = new strong_weak_map_1.StrongWeakMap(); - this.reader = toReader(cspellIO); - this.readerSync = toReaderSync(cspellIO); - } - loadDictionary(def) { - if ((0, CSpellSettingsInternalDef_js_1.isDictionaryDefinitionInlineInternal)(def)) { - return Promise.resolve(this.loadInlineDict(def)); - } - const { key, entry } = this.getCacheEntry(def); - if (entry) { - return entry.pending.then(([dictionary]) => dictionary); - } - const loadedEntry = this.loadEntry(def.path, def); - this.setCacheEntry(key, loadedEntry, def); - return loadedEntry.pending.then(([dictionary]) => dictionary); - } - loadDictionarySync(def) { - if ((0, CSpellSettingsInternalDef_js_1.isDictionaryDefinitionInlineInternal)(def)) { - return this.loadInlineDict(def); - } - const { key, entry } = this.getCacheEntry(def); - if (entry?.dictionary && entry.loadingState === LoadingState.Loaded) { - return entry.dictionary; - } - const loadedEntry = this.loadEntrySync(def.path, def); - this.setCacheEntry(key, loadedEntry, def); - return loadedEntry.dictionary; - } - /** - * Check to see if any of the cached dictionaries have changed. If one has changed, reload it. - * @param maxAge - Only check the dictionary if it has been at least `maxAge` ms since the last check. - * @param now - optional timestamp representing now. (Mostly used in testing) - */ - async refreshCacheEntries(maxAge = MAX_AGE, now = Date.now()) { - await Promise.all([...this.dictionaryCache.values()].map((entry) => this.refreshEntry(entry, maxAge, now))); - } - getCacheEntry(def) { - const defEntry = this.dictionaryCacheByDef.get(def); - if (defEntry) { - return defEntry; - } - const key = calcKey(def); - const entry = this.dictionaryCache.get(key); - if (entry) { - entry.options = def; - } - return { key, entry }; - } - setCacheEntry(key, entry, def) { - this.dictionaryCache.set(key, entry); - this.dictionaryCacheByDef.set(def, { key, entry }); - } - async refreshEntry(entry, maxAge, now) { - if (now - entry.ts >= maxAge) { - const sig = now + Math.random(); - entry.sig = sig; - entry.ts = now; - const pStat = this.getStat(entry.uri); - const [newStat] = await Promise.all([pStat, entry.pending]); - const hasChanged = !this.isEqual(newStat, entry.stat); - const sigMatches = entry.sig === sig; - if (sigMatches && hasChanged) { - entry.loadingState = LoadingState.Loading; - const key = calcKey(entry.options); - const newEntry = this.loadEntry(entry.uri, entry.options); - this.dictionaryCache.set(key, newEntry); - this.dictionaryCacheByDef.set(entry.options, { key, entry: newEntry }); +// node_modules/file-entry-cache/cache.js +var require_cache2 = __commonJS({ + "node_modules/file-entry-cache/cache.js"(exports, module2) { + var path26 = require("path"); + var crypto6 = require("crypto"); + module2.exports = { + createFromFile: function(filePath, useChecksum) { + var fname = path26.basename(filePath); + var dir = path26.dirname(filePath); + return this.create(fname, dir, useChecksum); + }, + create: function(cacheId, _path, useChecksum) { + var fs9 = require("fs"); + var flatCache = require_cache(); + var cache2 = flatCache.load(cacheId, _path); + var normalizedEntries = {}; + var removeNotFoundFiles = function removeNotFoundFiles2() { + const cachedEntries = cache2.keys(); + cachedEntries.forEach(function remover(fPath) { + try { + fs9.statSync(fPath); + } catch (err) { + if (err.code === "ENOENT") { + cache2.removeKey(fPath); + } + } + }); + }; + removeNotFoundFiles(); + return { + /** + * the flat cache storage used to persist the metadata of the `files + * @type {Object} + */ + cache: cache2, + /** + * Given a buffer, calculate md5 hash of its content. + * @method getHash + * @param {Buffer} buffer buffer to calculate hash on + * @return {String} content hash digest + */ + getHash: function(buffer) { + return crypto6.createHash("md5").update(buffer).digest("hex"); + }, + /** + * Return whether or not a file has changed since last time reconcile was called. + * @method hasFileChanged + * @param {String} file the filepath to check + * @return {Boolean} wheter or not the file has changed + */ + hasFileChanged: function(file) { + return this.getFileDescriptor(file).changed; + }, + /** + * given an array of file paths it return and object with three arrays: + * - changedFiles: Files that changed since previous run + * - notChangedFiles: Files that haven't change + * - notFoundFiles: Files that were not found, probably deleted + * + * @param {Array} files the files to analyze and compare to the previous seen files + * @return {[type]} [description] + */ + analyzeFiles: function(files) { + var me = this; + files = files || []; + var res = { + changedFiles: [], + notFoundFiles: [], + notChangedFiles: [] + }; + me.normalizeEntries(files).forEach(function(entry) { + if (entry.changed) { + res.changedFiles.push(entry.key); + return; + } + if (entry.notFound) { + res.notFoundFiles.push(entry.key); + return; + } + res.notChangedFiles.push(entry.key); + }); + return res; + }, + getFileDescriptor: function(file) { + var fstat; + try { + fstat = fs9.statSync(file); + } catch (ex) { + this.removeEntry(file); + return { key: file, notFound: true, err: ex }; + } + if (useChecksum) { + return this._getFileDescriptorUsingChecksum(file); + } + return this._getFileDescriptorUsingMtimeAndSize(file, fstat); + }, + _getFileDescriptorUsingMtimeAndSize: function(file, fstat) { + var meta = cache2.getKey(file); + var cacheExists = !!meta; + var cSize = fstat.size; + var cTime = fstat.mtime.getTime(); + var isDifferentDate; + var isDifferentSize; + if (!meta) { + meta = { size: cSize, mtime: cTime }; + } else { + isDifferentDate = cTime !== meta.mtime; + isDifferentSize = cSize !== meta.size; + } + var nEntry = normalizedEntries[file] = { + key: file, + changed: !cacheExists || isDifferentDate || isDifferentSize, + meta + }; + return nEntry; + }, + _getFileDescriptorUsingChecksum: function(file) { + var meta = cache2.getKey(file); + var cacheExists = !!meta; + var contentBuffer; + try { + contentBuffer = fs9.readFileSync(file); + } catch (ex) { + contentBuffer = ""; + } + var isDifferent = true; + var hash = this.getHash(contentBuffer); + if (!meta) { + meta = { hash }; + } else { + isDifferent = hash !== meta.hash; + } + var nEntry = normalizedEntries[file] = { + key: file, + changed: !cacheExists || isDifferent, + meta + }; + return nEntry; + }, + /** + * Return the list o the files that changed compared + * against the ones stored in the cache + * + * @method getUpdated + * @param files {Array} the array of files to compare against the ones in the cache + * @returns {Array} + */ + getUpdatedFiles: function(files) { + var me = this; + files = files || []; + return me.normalizeEntries(files).filter(function(entry) { + return entry.changed; + }).map(function(entry) { + return entry.key; + }); + }, + /** + * return the list of files + * @method normalizeEntries + * @param files + * @returns {*} + */ + normalizeEntries: function(files) { + files = files || []; + var me = this; + var nEntries = files.map(function(file) { + return me.getFileDescriptor(file); + }); + return nEntries; + }, + /** + * Remove an entry from the file-entry-cache. Useful to force the file to still be considered + * modified the next time the process is run + * + * @method removeEntry + * @param entryName + */ + removeEntry: function(entryName) { + delete normalizedEntries[entryName]; + cache2.removeKey(entryName); + }, + /** + * Delete the cache file from the disk + * @method deleteCacheFile + */ + deleteCacheFile: function() { + cache2.removeCacheFile(); + }, + /** + * remove the cache from the file and clear the memory cache + */ + destroy: function() { + normalizedEntries = {}; + cache2.destroy(); + }, + _getMetaForFileUsingCheckSum: function(cacheEntry) { + var contentBuffer = fs9.readFileSync(cacheEntry.key); + var hash = this.getHash(contentBuffer); + var meta = Object.assign(cacheEntry.meta, { hash }); + delete meta.size; + delete meta.mtime; + return meta; + }, + _getMetaForFileUsingMtimeAndSize: function(cacheEntry) { + var stat2 = fs9.statSync(cacheEntry.key); + var meta = Object.assign(cacheEntry.meta, { + size: stat2.size, + mtime: stat2.mtime.getTime() + }); + delete meta.hash; + return meta; + }, + /** + * Sync the files and persist them to the cache + * @method reconcile + */ + reconcile: function(noPrune) { + removeNotFoundFiles(); + noPrune = typeof noPrune === "undefined" ? true : noPrune; + var entries = normalizedEntries; + var keys2 = Object.keys(entries); + if (keys2.length === 0) { + return; + } + var me = this; + keys2.forEach(function(entryName) { + var cacheEntry = entries[entryName]; + try { + var meta = useChecksum ? me._getMetaForFileUsingCheckSum(cacheEntry) : me._getMetaForFileUsingMtimeAndSize(cacheEntry); + cache2.setKey(entryName, meta); + } catch (err) { + if (err.code !== "ENOENT") { + throw err; + } + } + }); + cache2.save(noPrune); } - } - } - loadEntry(uri, options, now = Date.now()) { - options = this.normalizeOptions(uri, options); - const pDictionary = load(this.reader, uri, options).catch((e) => (0, cspell_dictionary_1.createFailedToLoadDictionary)(options.name, uri, new SpellingDictionaryError_js_1.SpellingDictionaryLoadError(uri, options, e, "failed to load"), options)); - const pStat = this.getStat(uri); - const pending = Promise.all([pDictionary, pStat]); - const sig = now + Math.random(); - const entry = { - uri, - options, - ts: now, - stat: void 0, - dictionary: void 0, - pending, - loadingState: LoadingState.Loading, - sig }; - pending.then(([dictionary, stat2]) => { - entry.stat = stat2; - entry.dictionary = dictionary; - entry.loadingState = LoadingState.Loaded; - return; - }); - return entry; - } - loadEntrySync(uri, options, now = Date.now()) { - options = this.normalizeOptions(uri, options); - const stat2 = this.getStatSync(uri); - const sig = now + Math.random(); - try { - const dictionary = loadSync(this.readerSync, uri, options); - const pending = Promise.resolve([dictionary, stat2]); - return { - uri, - options, - ts: now, - stat: stat2, - dictionary, - pending, - loadingState: LoadingState.Loaded, - sig - }; - } catch (e) { - const error2 = (0, errors_js_1.toError)(e); - const dictionary = (0, cspell_dictionary_1.createFailedToLoadDictionary)(options.name, uri, new SpellingDictionaryError_js_1.SpellingDictionaryLoadError(uri, options, error2, "failed to load"), options); - const pending = Promise.resolve([dictionary, stat2]); - return { - uri, - options, - ts: now, - stat: stat2, - dictionary, - pending, - loadingState: LoadingState.Loaded, - sig - }; - } - } - getStat(uri) { - return this.cspellIO.getStat(uri).catch(errors_js_1.toError); - } - getStatSync(uri) { - try { - return this.cspellIO.getStatSync(uri); - } catch (e) { - return (0, errors_js_1.toError)(e); - } - } - isEqual(a, b) { - if (!b) - return false; - if (isError4(a)) { - return isError4(b) && a.message === b.message && a.name === b.name; - } - return !isError4(b) && !this.cspellIO.compareStats(a, b); - } - normalizeOptions(uri, options) { - if (options.name) - return options; - return { ...options, name: this.cspellIO.uriBasename(uri) }; - } - loadInlineDict(def) { - return this.inlineDictionaryCache.get(def, (def2) => (0, cspell_dictionary_1.createInlineSpellingDictionary)(def2, def2.__source || "memory")); } }; - exports.DictionaryLoader = DictionaryLoader; - function toReader(cspellIO) { - return async function(filename) { - const res = await cspellIO.readFile(filename); - return res.content.split(/\n|\r\n|\r/); - }; - } - function toReaderSync(cspellIO) { - return function(filename) { - const res = cspellIO.readFileSync(filename); - return res.content.split(/\n|\r\n|\r/); - }; - } - var importantOptionKeys = ["name", "noSuggest", "useCompounds", "type"]; - function calcKey(def) { - const path16 = def.path; - const loaderType = determineType(path16, def); - const optValues = importantOptionKeys.map((k) => def[k]?.toString() || ""); - const parts = [path16, loaderType].concat(optValues); - return parts.join("|"); - } - function isError4(e) { - const err = e; - return !!err.message; - } - function determineType(uri, opts) { - const t = opts.type && opts.type in loaders && opts.type || "S"; - const defLoaderType = t; - const defType = uri.endsWith(".trie.gz") ? "T" : defLoaderType; - const regTrieTest = /\.trie\b/i; - return regTrieTest.test(uri) ? "T" : defType; - } - function load(reader2, uri, options) { - const type = determineType(uri, options); - const loader = loaders[type] || loaders.default; - return loader(reader2, uri, options); - } - function loadSync(reader2, uri, options) { - const type = determineType(uri, options); - const loader = loadersSync[type] || loaders.default; - return loader(reader2, uri, options); - } - async function legacyWordList(readLines, filename, options) { - const lines = await readLines(filename); - return _legacyWordListSync(lines, filename, options); - } - function legacyWordListSync(readLinesSync, filename, options) { - const lines = readLinesSync(filename); - return _legacyWordListSync(lines, filename, options); - } - function _legacyWordListSync(lines, filename, options) { - const words = (0, sync_1.pipe)( - lines, - // Remove comments - (0, sync_1.opMap)((line) => line.replace(/#.*/g, "")), - // Split on everything else - (0, sync_1.opConcatMap)((line) => line.split(/[^\w\p{L}\p{M}'’]+/gu)), - (0, sync_1.opFilter)((word) => !!word) - ); - return (0, cspell_dictionary_1.createSpellingDictionary)(words, options.name, filename, options); - } - async function wordsPerLineWordList(readLines, filename, options) { - const lines = await readLines(filename); - return _wordsPerLineWordList(lines, filename, options); - } - function wordsPerLineWordListSync(readLinesSync, filename, options) { - const lines = readLinesSync(filename); - return _wordsPerLineWordList(lines, filename, options); - } - function _wordsPerLineWordList(lines, filename, options) { - const words = (0, sync_1.pipe)( - lines, - // Remove comments - (0, sync_1.opMap)((line) => line.replace(/#.*/g, "")), - // Split on everything else - (0, sync_1.opConcatMap)((line) => line.split(/\s+/gu)), - (0, sync_1.opFilter)((word) => !!word) - ); - return (0, cspell_dictionary_1.createSpellingDictionary)(words, options.name, filename, options); - } - async function loadSimpleWordList(reader2, filename, options) { - const lines = await reader2(filename); - return (0, cspell_dictionary_1.createSpellingDictionary)(lines, options.name, filename, options); - } - function loadSimpleWordListSync(readLinesSync, filename, options) { - const lines = readLinesSync(filename); - return (0, cspell_dictionary_1.createSpellingDictionary)(lines, options.name, filename, options); - } - async function loadTrie(readLines, filename, options) { - const lines = await readLines(filename); - return (0, cspell_dictionary_1.createSpellingDictionaryFromTrieFile)(lines, options.name, filename, options); - } - function loadTrieSync(readLinesSync, filename, options) { - const lines = readLinesSync(filename); - return (0, cspell_dictionary_1.createSpellingDictionaryFromTrieFile)(lines, options.name, filename, options); - } - } -}); - -// node_modules/cspell-lib/dist/cjs/SpellingDictionary/DictionaryController/index.js -var require_DictionaryController = __commonJS({ - "node_modules/cspell-lib/dist/cjs/SpellingDictionary/DictionaryController/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DictionaryLoader = void 0; - var DictionaryLoader_js_1 = require_DictionaryLoader(); - Object.defineProperty(exports, "DictionaryLoader", { enumerable: true, get: function() { - return DictionaryLoader_js_1.DictionaryLoader; - } }); - } -}); - -// node_modules/cspell-lib/dist/cjs/SpellingDictionary/DictionaryLoader.js -var require_DictionaryLoader2 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/SpellingDictionary/DictionaryLoader.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.refreshCacheEntries = exports.loadDictionarySync = exports.loadDictionary = exports.getDictionaryLoader = void 0; - var static_js_1 = require_static(); - var index_js_1 = require_DictionaryController(); - var loader; - function getDictionaryLoader(cspellIO) { - if (loader) - return loader; - return loader = new index_js_1.DictionaryLoader(cspellIO || (0, static_js_1.getCSpellIO)()); - } - exports.getDictionaryLoader = getDictionaryLoader; - function loadDictionary(def) { - return getDictionaryLoader().loadDictionary(def); - } - exports.loadDictionary = loadDictionary; - function loadDictionarySync(def) { - return getDictionaryLoader().loadDictionarySync(def); - } - exports.loadDictionarySync = loadDictionarySync; - async function refreshCacheEntries(maxAge, now) { - return getDictionaryLoader().refreshCacheEntries(maxAge, now); - } - exports.refreshCacheEntries = refreshCacheEntries; - } -}); - -// node_modules/cspell-lib/dist/cjs/SpellingDictionary/Dictionaries.js -var require_Dictionaries = __commonJS({ - "node_modules/cspell-lib/dist/cjs/SpellingDictionary/Dictionaries.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getDictionaryInternalSync = exports.getDictionaryInternal = exports.refreshDictionaryCache = exports.loadDictionaryDefsSync = exports.loadDictionaryDefs = void 0; - var cspell_dictionary_1 = require_cjs7(); - var DictionarySettings_js_1 = require_DictionarySettings(); - var util_js_1 = require_util(); - var DictionaryLoader_js_1 = require_DictionaryLoader2(); - function loadDictionaryDefs(defsToLoad) { - return defsToLoad.map(DictionaryLoader_js_1.loadDictionary); - } - exports.loadDictionaryDefs = loadDictionaryDefs; - function loadDictionaryDefsSync(defsToLoad) { - return defsToLoad.map(DictionaryLoader_js_1.loadDictionarySync); - } - exports.loadDictionaryDefsSync = loadDictionaryDefsSync; - function refreshDictionaryCache(maxAge) { - return (0, DictionaryLoader_js_1.refreshCacheEntries)(maxAge); - } - exports.refreshDictionaryCache = refreshDictionaryCache; - var emptyWords = Object.freeze([]); - async function getDictionaryInternal(settings) { - const spellDictionaries = await Promise.all(loadDictionaryDefs((0, DictionarySettings_js_1.calcDictionaryDefsToLoad)(settings))); - return _getDictionaryInternal(settings, spellDictionaries); - } - exports.getDictionaryInternal = getDictionaryInternal; - function getDictionaryInternalSync(settings) { - const spellDictionaries = loadDictionaryDefsSync((0, DictionarySettings_js_1.calcDictionaryDefsToLoad)(settings)); - return _getDictionaryInternal(settings, spellDictionaries); - } - exports.getDictionaryInternalSync = getDictionaryInternalSync; - function _getDictionaryInternal(settings, spellDictionaries) { - const { words = emptyWords, userWords = emptyWords, flagWords = emptyWords, ignoreWords = emptyWords, suggestWords = emptyWords } = settings; - const settingsWordsDictionary = (0, cspell_dictionary_1.createSpellingDictionary)(words, "[words]", "From Settings `words`", { - caseSensitive: true, - weightMap: void 0 - }); - const settingsUserWordsDictionary = userWords.length ? (0, cspell_dictionary_1.createSpellingDictionary)(userWords, "[userWords]", "From Settings `userWords`", { - caseSensitive: true, - weightMap: void 0 - }) : void 0; - const ignoreWordsDictionary = (0, cspell_dictionary_1.createIgnoreWordsDictionary)(ignoreWords, "[ignoreWords]", "From Settings `ignoreWords`"); - const flagWordsDictionary = (0, cspell_dictionary_1.createForbiddenWordsDictionary)(flagWords, "[flagWords]", "From Settings `flagWords`"); - const suggestWordsDictionary = (0, cspell_dictionary_1.createSuggestDictionary)(suggestWords, "[suggestWords]", "From Settings `suggestWords`"); - const dictionaries = [ - ...spellDictionaries, - settingsWordsDictionary, - settingsUserWordsDictionary, - ignoreWordsDictionary, - flagWordsDictionary, - suggestWordsDictionary - ].filter(util_js_1.isDefined); - return (0, cspell_dictionary_1.createCollection)(dictionaries, "dictionary collection"); - } - } -}); - -// node_modules/cspell-lib/dist/cjs/SpellingDictionary/SpellingDictionary.js -var require_SpellingDictionary3 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/SpellingDictionary/SpellingDictionary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.CompoundWordsMethod = exports.createSpellingDictionary = exports.createInlineSpellingDictionary = exports.createCollection = void 0; - var cspell_dictionary_1 = require_cjs7(); - Object.defineProperty(exports, "createCollection", { enumerable: true, get: function() { - return cspell_dictionary_1.createCollection; - } }); - Object.defineProperty(exports, "createInlineSpellingDictionary", { enumerable: true, get: function() { - return cspell_dictionary_1.createInlineSpellingDictionary; - } }); - Object.defineProperty(exports, "createSpellingDictionary", { enumerable: true, get: function() { - return cspell_dictionary_1.createSpellingDictionary; - } }); - var cspell_trie_lib_1 = require_cjs5(); - Object.defineProperty(exports, "CompoundWordsMethod", { enumerable: true, get: function() { - return cspell_trie_lib_1.CompoundWordsMethod; - } }); } }); -// node_modules/cspell-lib/dist/cjs/SpellingDictionary/index.js -var require_SpellingDictionary4 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/SpellingDictionary/index.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __exportStar = exports && exports.__exportStar || function(m, exports2) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) - __createBinding(exports2, m, p); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - __exportStar(require_Dictionaries(), exports); - __exportStar(require_SpellingDictionary3(), exports); - __exportStar(require_SpellingDictionaryError(), exports); - } -}); - -// node_modules/cspell-lib/dist/cjs/Settings/InDocSettings.js -var require_InDocSettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/InDocSettings.js"(exports) { +// node_modules/cspell/dist/lib/file-entry-cache.cjs +var require_file_entry_cache = __commonJS({ + "node_modules/cspell/dist/lib/file-entry-cache.cjs"(exports) { "use strict"; var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { if (k2 === void 0) @@ -49888,13218 +35925,16971 @@ var require_InDocSettings = __commonJS({ return result; }; Object.defineProperty(exports, "__esModule", { value: true }); - exports.internal = exports.getIgnoreRegExpFromDocument = exports.getIgnoreWordsFromDocument = exports.extractInDocDictionary = exports.regExSpellingGuardLine = exports.regExSpellingGuardNext = exports.regExSpellingGuardBlock = exports.validateInDocumentSettings = exports.getInDocumentSettings = void 0; - var sync_1 = require_sync(); - var gensequence_1 = require_dist2(); - var index_js_1 = require_SpellingDictionary4(); - var Text2 = __importStar(require_text2()); - var util_js_1 = require_util(); - var CSpellSettingsServer_js_1 = require_CSpellSettingsServer(); - var regExMatchRegEx = /\/.*\/[gimuy]*/; - var regExCSpellInDocDirective = /\b(?:spell-?checker|c?spell)::?(.*)/gi; - var regExCSpellDirectiveKey = /(?<=\b(?:spell-?checker|c?spell)::?)(?!:)(.*)/i; - var regExInFileSettings = [regExCSpellInDocDirective, /\b(LocalWords:?.*)/g]; - var officialDirectives = [ - "enable", - "disable", - "disable-line", - "disable-next", - "disable-next-line", - "word", - "words", - "ignore", - "ignoreWord", - "ignoreWords", - "ignore-word", - "ignore-words", - "includeRegExp", - "ignoreRegExp", - "local", - "locale", - "language", - "dictionaries", - "dictionary", - "forbid", - "forbidWord", - "forbid-word", - "flag", - "flagWord", - "flag-word", - "enableCompoundWords", - "enableAllowCompoundWords", - "disableCompoundWords", - "disableAllowCompoundWords", - "enableCaseSensitive", - "disableCaseSensitive" - ]; - var noSuggestDirectives = /* @__PURE__ */ new Set(["local"]); - var preferredDirectives = [ - "enable", - "disable", - "disable-line", - "disable-next-line", - "words", - "ignore", - "forbid", - "locale", - "dictionary", - "dictionaries", - "enableCaseSensitive", - "disableCaseSensitive" - ]; - var allDirectives = new Set(preferredDirectives.concat(officialDirectives)); - var allDirectiveSuggestions = [ - ...(0, sync_1.pipeSync)(allDirectives, (0, sync_1.opMap)((word) => ({ word }))) - ]; - var dictInDocSettings = (0, index_js_1.createSpellingDictionary)(allDirectives, "Directives", "Directive List", { - supportNonStrictSearches: false - }); - var EmptyWords = []; - Object.freeze(EmptyWords); - var staticInDocumentDictionaryName = `[in-document-dict]`; - function getInDocumentSettings(text) { - const collectedSettings = getPossibleInDocSettings(text).concatMap((a) => parseSettingMatch(a)).reduce((s, setting) => { - return (0, CSpellSettingsServer_js_1.mergeInDocSettings)(s, setting); - }, { id: "in-doc-settings" }); - const { words, flagWords, ignoreWords, suggestWords, dictionaries = [], dictionaryDefinitions = [], ...rest } = collectedSettings; - const dict = (words || flagWords || ignoreWords || suggestWords) && (0, util_js_1.clean)({ - name: staticInDocumentDictionaryName, - words, - flagWords, - ignoreWords, - suggestWords - }); - const dictSettings = dict ? { - dictionaries: dictionaries.concat(staticInDocumentDictionaryName), - dictionaryDefinitions: dictionaryDefinitions.concat(dict) - } : (0, util_js_1.clean)({ - dictionaries: dictionaries.length ? dictionaries : void 0, - dictionaryDefinitions: dictionaryDefinitions.length ? dictionaryDefinitions : void 0 - }); - const settings = { - ...rest, - ...dictSettings - }; - return settings; - } - exports.getInDocumentSettings = getInDocumentSettings; - function validateInDocumentSettings(docText, _settings) { - return (0, sync_1.pipeSync)(getPossibleInDocSettings(docText), (0, sync_1.opMap)(parseSettingMatchValidation), (0, sync_1.opFilter)(util_js_1.isDefined)); - } - exports.validateInDocumentSettings = validateInDocumentSettings; - var settingParsers = [ - [/^(?:enable|disable)(?:allow)?CompoundWords\b(?!-)/i, parseCompoundWords], - [/^(?:enable|disable)CaseSensitive\b(?!-)/i, parseCaseSensitive], - [/^enable\b(?!-)/i, parseEnable], - [/^disable(-line|-next(-line)?)?\b(?!-)/i, parseDisable], - [/^words?\b(?!-)/i, parseWords], - [/^ignore(?:-?words?)?\b(?!-)/i, parseIgnoreWords], - [/^(?:flag|forbid)(?:-?words?)?\b(?!-)/i, parseFlagWords], - [/^ignore_?Reg_?Exp\s+.+$/i, parseIgnoreRegExp], - [/^include_?Reg_?Exp\s+.+$/i, parseIncludeRegExp], - [/^locale?\b(?!-)/i, parseLocale], - [/^language\s\b(?!-)/i, parseLocale], - [/^dictionar(?:y|ies)\b(?!-)/i, parseDictionaries], - [/^LocalWords:/, (w) => parseWords(w.replace(/^LocalWords:?/gi, " "))] - ]; - exports.regExSpellingGuardBlock = /(\bc?spell(?:-?checker)?::?)\s*disable(?!-line|-next)\b[\s\S]*?((?:\1\s*enable\b)|$)/gi; - exports.regExSpellingGuardNext = /\bc?spell(?:-?checker)?::?\s*disable-next\b.*\s\s?.*/gi; - exports.regExSpellingGuardLine = /^.*\bc?spell(?:-?checker)?::?\s*disable-line\b.*/gim; - var emptySettings = Object.freeze({}); - var issueMessages = { - unknownDirective: "Unknown CSpell directive" - }; - function parseSettingMatchValidation(matchArray) { - const [fullMatch = ""] = matchArray; - const directiveMatch = fullMatch.match(regExCSpellDirectiveKey); - if (!directiveMatch) - return void 0; - const match = directiveMatch[1]; - const possibleSetting = match.trim(); - if (!possibleSetting) - return void 0; - const start = (matchArray.index || 0) + (directiveMatch.index || 0) + (match.length - match.trimStart().length); - const text = possibleSetting.replace(/^([-\w]+)?.*/, "$1"); - const end = start + text.length; - if (!text) - return void 0; - const matchingParsers = settingParsers.filter(([regex]) => regex.test(possibleSetting)); - if (matchingParsers.length > 0) - return void 0; - const dictSugs = dictInDocSettings.suggest(text, { ignoreCase: false }).map(({ word, isPreferred }) => isPreferred ? { word, isPreferred } : { word }).filter((a) => !noSuggestDirectives.has(a.word)); - const sugs = (0, sync_1.pipeSync)(dictSugs, (0, sync_1.opAppend)(allDirectiveSuggestions), filterUniqueSuggestions); - const suggestionsEx = [...sugs].slice(0, 8); - const suggestions = suggestionsEx.map((s) => s.word); - const issue = { - range: [start, end], - text, - message: issueMessages.unknownDirective, - suggestions, - suggestionsEx - }; - return issue; - } - function* filterUniqueSuggestions(sugs) { - const map = /* @__PURE__ */ new Map(); - for (const sug of sugs) { - const existing = map.get(sug.word); - if (existing) { - if (sug.isPreferred) { - existing.isPreferred = true; - } - } - yield sug; - } - } - function parseSettingMatch(matchArray) { - const [, match = ""] = matchArray; - const possibleSetting = match.trim(); - return settingParsers.filter(([regex]) => regex.test(possibleSetting)).map(([, fn]) => fn).map((fn) => fn(possibleSetting)); - } - function parseCompoundWords(match) { - const allowCompoundWords = /enable/i.test(match); - return { allowCompoundWords }; - } - function parseCaseSensitive(match) { - const caseSensitive = /enable/i.test(match); - return { caseSensitive }; - } - function parseWords(match) { - const words = match.split(/[,\s;]+/g).slice(1).filter((a) => !!a); - return { words }; - } - function parseLocale(match) { - const parts = match.trim().split(/[\s,]+/); - const language = parts.slice(1).join(","); - return language ? { language } : emptySettings; - } - function parseIgnoreWords(match) { - const wordsSetting = parseWords(match); - const ignoreWords = wordsSetting.words; - return ignoreWords && ignoreWords.length ? { ignoreWords } : emptySettings; - } - function parseFlagWords(match) { - const wordsSetting = parseWords(match); - const flagWords = wordsSetting.words; - return flagWords && flagWords.length ? { flagWords } : emptySettings; + exports.createFromFile = void 0; + var fileEntryCache = __importStar(require_cache2()); + function createFromFile3(pathToCache, useChecksum) { + return fileEntryCache.createFromFile(pathToCache, useChecksum); } - function parseRegEx(match) { - const patterns = [match.replace(/^[^\s]+\s+/, "")].map((a) => { - const m = a.match(regExMatchRegEx); - if (m && m[0]) { - return m[0]; - } - return a.replace(/((?:[^\s]|\\ )+).*/, "$1"); - }); - return patterns; - } - function parseIgnoreRegExp(match) { - const ignoreRegExpList = parseRegEx(match); - return { ignoreRegExpList }; - } - function parseIncludeRegExp(match) { - const includeRegExpList = parseRegEx(match); - return { includeRegExpList }; - } - function parseDictionaries(match) { - const dictionaries = match.split(/[,\s]+/g).slice(1); - return { dictionaries }; - } - function getPossibleInDocSettings(text) { - return (0, gensequence_1.genSequence)(regExInFileSettings).concatMap((regexp) => Text2.match(regexp, text)); - } - function getWordsFromDocument(text) { - const dict = extractInDocDictionary(getInDocumentSettings(text)); - return dict?.words || EmptyWords; - } - function parseEnable(_match) { - return {}; - } - function parseDisable(_match) { - return {}; - } - function extractInDocDictionary(settings) { - const inDocDicts = settings.dictionaryDefinitions?.filter((def) => def.name === staticInDocumentDictionaryName); - const dict = inDocDicts?.[0]; - return dict; - } - exports.extractInDocDictionary = extractInDocDictionary; - function getIgnoreWordsFromDocument(text) { - const dict = extractInDocDictionary(getInDocumentSettings(text)); - return dict?.ignoreWords || EmptyWords; - } - exports.getIgnoreWordsFromDocument = getIgnoreWordsFromDocument; - function getIgnoreRegExpFromDocument(text) { - const { ignoreRegExpList = [] } = getInDocumentSettings(text); - return ignoreRegExpList; - } - exports.getIgnoreRegExpFromDocument = getIgnoreRegExpFromDocument; - exports.internal = { - getPossibleInDocSettings, - getWordsFromDocument, - parseWords, - parseCompoundWords, - parseIgnoreRegExp, - parseIgnoreWords, - staticInDocumentDictionaryName - }; + exports.createFromFile = createFromFile3; } }); -// node_modules/cspell-lib/dist/cjs/Settings/TextDocumentSettings.js -var require_TextDocumentSettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/Settings/TextDocumentSettings.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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]; - } }; +// node_modules/import-meta-resolve/lib/errors.js +function formatList(array, type = "and") { + return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array[array.length - 1]}`; +} +function createError(sym, value, def) { + messages.set(sym, value); + return makeNodeErrorWithCode(def, sym); +} +function makeNodeErrorWithCode(Base, key) { + return NodeError; + function NodeError(...args) { + const limit = Error.stackTraceLimit; + if (isErrorStackTraceLimitWritable()) + Error.stackTraceLimit = 0; + const error2 = new Base(); + if (isErrorStackTraceLimitWritable()) + Error.stackTraceLimit = limit; + const message = getMessage(key, args, error2); + Object.defineProperties(error2, { + // Note: no need to implement `kIsNodeError` symbol, would be hard, + // probably. + message: { + value: message, + enumerable: false, + writable: true, + configurable: true + }, + toString: { + /** @this {Error} */ + value() { + return `${this.name} [${key}]: ${this.message}`; + }, + enumerable: false, + writable: true, + configurable: true } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; }); - var __importStar = exports && exports.__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.extractSettingsFromText = exports.combineTextAndLanguageSettings = void 0; - var CSpellSettingsServer = __importStar(require_CSpellSettingsServer()); - var InDocSettings_js_1 = require_InDocSettings(); - var LanguageSettings_js_1 = require_LanguageSettings(); - function combineTextAndLanguageSettings(settings, text, languageId) { - if (!text) { - return CSpellSettingsServer.toInternalSettings((0, LanguageSettings_js_1.calcSettingsForLanguageId)(settings, languageId)); - } - const docSettings = extractSettingsFromText(text); - const settingsForText = CSpellSettingsServer.mergeSettings(settings, docSettings); - const langSettings = (0, LanguageSettings_js_1.calcSettingsForLanguageId)(settingsForText, languageId); - return CSpellSettingsServer.mergeSettings(langSettings, docSettings); - } - exports.combineTextAndLanguageSettings = combineTextAndLanguageSettings; - function extractSettingsFromText(text) { - return (0, InDocSettings_js_1.getInDocumentSettings)(text); - } - exports.extractSettingsFromText = extractSettingsFromText; + captureLargerStackTrace(error2); + error2.code = key; + return error2; } -}); - -// node_modules/cspell-lib/dist/cjs/textValidation/determineTextDocumentSettings.js -var require_determineTextDocumentSettings = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/determineTextDocumentSettings.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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.determineTextDocumentSettings = void 0; - var path16 = __importStar(require("path")); - var LanguageIds_js_1 = require_LanguageIds(); - var index_js_1 = require_Settings(); - var TextDocumentSettings_js_1 = require_TextDocumentSettings(); - var Uri_js_1 = require_Uri(); - function determineTextDocumentSettings(doc, settings) { - const filename = (0, Uri_js_1.uriToFilePath)(doc.uri); - const settingsWithDefaults = (0, index_js_1.mergeSettings)((0, index_js_1.getDefaultSettings)(settings.loadDefaultConfiguration ?? true), (0, index_js_1.getGlobalSettings)(), settings); - const fileSettings = (0, index_js_1.calcOverrideSettings)(settingsWithDefaults, filename); - const languageIds = fileSettings?.languageId?.length ? fileSettings.languageId : doc.languageId ? doc.languageId : getLanguageForFilename(filename); - if (doc.locale) { - fileSettings.language = doc.locale; - } - return (0, TextDocumentSettings_js_1.combineTextAndLanguageSettings)(fileSettings, doc.text, languageIds); - } - exports.determineTextDocumentSettings = determineTextDocumentSettings; - function getLanguageForFilename(filename) { - const basename3 = path16.basename(filename); - return (0, LanguageIds_js_1.getLanguagesForBasename)(basename3); +} +function isErrorStackTraceLimitWritable() { + try { + if (import_node_v8.default.startupSnapshot.isBuildingSnapshot()) { + return false; } + } catch { } -}); - -// node_modules/@cspell/cspell-types/dist/cjs/configFields.js -var require_configFields = __commonJS({ - "node_modules/@cspell/cspell-types/dist/cjs/configFields.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ConfigFields = void 0; - exports.ConfigFields = { - allowCompoundWords: "allowCompoundWords", - cache: "cache", - caseSensitive: "caseSensitive", - description: "description", - dictionaries: "dictionaries", - dictionaryDefinitions: "dictionaryDefinitions", - enabled: "enabled", - enabledLanguageIds: "enabledLanguageIds", - enableFiletypes: "enableFiletypes", - enableGlobDot: "enableGlobDot", - failFast: "failFast", - features: "features", - files: "files", - flagWords: "flagWords", - gitignoreRoot: "gitignoreRoot", - globRoot: "globRoot", - ignorePaths: "ignorePaths", - ignoreRegExpList: "ignoreRegExpList", - ignoreWords: "ignoreWords", - import: "import", - includeRegExpList: "includeRegExpList", - language: "language", - languageId: "languageId", - languageSettings: "languageSettings", - loadDefaultConfiguration: "loadDefaultConfiguration", - maxDuplicateProblems: "maxDuplicateProblems", - maxNumberOfProblems: "maxNumberOfProblems", - minWordLength: "minWordLength", - name: "name", - noConfigSearch: "noConfigSearch", - noSuggestDictionaries: "noSuggestDictionaries", - numSuggestions: "numSuggestions", - overrides: "overrides", - patterns: "patterns", - pnpFiles: "pnpFiles", - readonly: "readonly", - reporters: "reporters", - showStatus: "showStatus", - spellCheckDelayMs: "spellCheckDelayMs", - suggestionNumChanges: "suggestionNumChanges", - suggestionsTimeout: "suggestionsTimeout", - suggestWords: "suggestWords", - useGitignore: "useGitignore", - usePnP: "usePnP", - userWords: "userWords", - validateDirectives: "validateDirectives", - words: "words", - // Experimental - parser: "parser" - }; + const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit"); + if (desc === void 0) { + return Object.isExtensible(Error); } -}); - -// node_modules/@cspell/cspell-types/dist/cjs/CSpellReporter.js -var require_CSpellReporter = __commonJS({ - "node_modules/@cspell/cspell-types/dist/cjs/CSpellReporter.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MessageTypes = exports.IssueType = void 0; - var IssueType2; - (function(IssueType3) { - IssueType3[IssueType3["spelling"] = 0] = "spelling"; - IssueType3[IssueType3["directive"] = 1] = "directive"; - })(IssueType2 = exports.IssueType || (exports.IssueType = {})); - exports.MessageTypes = { - Debug: "Debug", - Info: "Info", - Warning: "Warning" - }; + return own.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0; +} +function hideStackFrames(fn) { + const hidden = nodeInternalPrefix + fn.name; + Object.defineProperty(fn, "name", { value: hidden }); + return fn; +} +function getMessage(key, args, self) { + const message = messages.get(key); + (0, import_node_assert.default)(message !== void 0, "expected `message` to be found"); + if (typeof message === "function") { + (0, import_node_assert.default)( + message.length <= args.length, + // Default options do not count. + `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${message.length}).` + ); + return Reflect.apply(message, self, args); } -}); - -// node_modules/@cspell/cspell-types/dist/cjs/index.js -var require_cjs9 = __commonJS({ - "node_modules/@cspell/cspell-types/dist/cjs/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MessageTypes = exports.IssueType = exports.ConfigFields = void 0; - var configFields_js_1 = require_configFields(); - Object.defineProperty(exports, "ConfigFields", { enumerable: true, get: function() { - return configFields_js_1.ConfigFields; - } }); - var CSpellReporter_js_1 = require_CSpellReporter(); - Object.defineProperty(exports, "IssueType", { enumerable: true, get: function() { - return CSpellReporter_js_1.IssueType; - } }); - Object.defineProperty(exports, "MessageTypes", { enumerable: true, get: function() { - return CSpellReporter_js_1.MessageTypes; - } }); + const regex = /%[dfijoOs]/g; + let expectedLength = 0; + while (regex.exec(message) !== null) + expectedLength++; + (0, import_node_assert.default)( + expectedLength === args.length, + `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).` + ); + if (args.length === 0) + return message; + args.unshift(message); + return Reflect.apply(import_node_util.format, null, args); +} +function determineSpecificType(value) { + if (value === null || value === void 0) { + return String(value); } -}); - -// node_modules/cspell-lib/dist/cjs/util/memorizeLastCall.js -var require_memorizeLastCall2 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/memorizeLastCall.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.memorizeLastCall = void 0; - var util_js_1 = require_util(); - function memorizeLastCall(fn) { - let last; - return (...p) => { - if (last && (0, util_js_1.isArrayEqual)(last.args, p)) { - return last.value; - } - const args = p; - const value = fn(...args); - last = { args, value }; - return value; - }; - } - exports.memorizeLastCall = memorizeLastCall; + if (typeof value === "function" && value.name) { + return `function ${value.name}`; } -}); - -// node_modules/cspell-lib/dist/cjs/suggestions.js -var require_suggestions = __commonJS({ - "node_modules/cspell-lib/dist/cjs/suggestions.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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 __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.SuggestionError = exports.calcSuggestionAdjustedToToMatchCase = exports.suggestionsForWord = exports.suggestionsForWords = void 0; - var assert_1 = __importDefault(require("assert")); - var index_js_1 = require_Settings(); - var LanguageSettings_js_1 = require_LanguageSettings(); - var index_js_2 = require_SpellingDictionary4(); - var AutoResolve_js_1 = require_AutoResolve(); - var memorizeLastCall_js_1 = require_memorizeLastCall2(); - var util = __importStar(require_util()); - var emptySuggestionOptions = Object.freeze({}); - var emptyCSpellSettings = Object.freeze({}); - async function* suggestionsForWords2(words, options, settings) { - for await (const word of words) { - yield await suggestionsForWord(word, options, settings); - } - } - exports.suggestionsForWords = suggestionsForWords2; - var memorizeSuggestions = (0, memorizeLastCall_js_1.memorizeLastCall)(cacheSuggestionsForWord); - function cacheSuggestionsForWord(options, settings) { - const cache = (0, AutoResolve_js_1.createAutoResolveCache)(); - return (word) => cache.get(word, (word2) => _suggestionsForWord(word2, options, settings)); - } - function suggestionsForWord(word, options = emptySuggestionOptions, settings = emptyCSpellSettings) { - return memorizeSuggestions(options, settings)(word); - } - exports.suggestionsForWord = suggestionsForWord; - async function _suggestionsForWord(word, options, settings) { - const { languageId, locale: language, includeDefaultConfig = true, dictionaries } = options; - async function determineDictionaries(config2) { - const withLocale = (0, index_js_1.mergeSettings)(config2, util.clean({ - language: language || config2.language - // dictionaries: dictionaries?.length ? dictionaries : config.dictionaries, - })); - const withLanguageId = (0, LanguageSettings_js_1.calcSettingsForLanguageId)(withLocale, languageId ?? withLocale.languageId ?? "plaintext"); - const settings2 = (0, index_js_1.finalizeSettings)(withLanguageId); - settings2.dictionaries = dictionaries?.length ? dictionaries : settings2.dictionaries || []; - validateDictionaries(settings2, dictionaries); - const dictionaryCollection2 = await (0, index_js_2.getDictionaryInternal)(settings2); - settings2.dictionaries = settings2.dictionaryDefinitions?.map((def) => def.name) || []; - const allDictionaryCollection2 = await (0, index_js_2.getDictionaryInternal)(settings2); - return { - dictionaryCollection: dictionaryCollection2, - allDictionaryCollection: allDictionaryCollection2 - }; - } - await (0, index_js_2.refreshDictionaryCache)(); - const config = includeDefaultConfig ? (0, index_js_1.mergeSettings)((0, index_js_1.getDefaultSettings)(settings.loadDefaultConfiguration ?? true), (0, index_js_1.getGlobalSettings)(), settings) : settings; - const { dictionaryCollection, allDictionaryCollection } = await determineDictionaries(config); - return _suggestionsForWordSync(word, options, settings, dictionaryCollection, allDictionaryCollection); - } - function _suggestionsForWordSync(word, options, settings, dictionaryCollection, allDictionaryCollection) { - const extendsDictionaryCollection = allDictionaryCollection || dictionaryCollection; - const { locale: language, strict = true, numChanges = 4, numSuggestions = 8, includeTies = true, includeDefaultConfig = true } = options; - const ignoreCase = !strict; - const config = includeDefaultConfig ? (0, index_js_1.mergeSettings)((0, index_js_1.getDefaultSettings)(settings.loadDefaultConfiguration ?? true), (0, index_js_1.getGlobalSettings)(), settings) : settings; - const opts = { ignoreCase, numChanges, numSuggestions, includeTies }; - const suggestionsByDictionary = dictionaryCollection.dictionaries.flatMap((dict) => dict.suggest(word, opts).map((r) => ({ ...r, dictName: dict.name }))); - const locale = adjustLocale(language || config.language || void 0); - const collator = Intl.Collator(locale); - const combined = limitResults(combine(suggestionsByDictionary.sort((a, b) => a.cost - b.cost || collator.compare(a.word, b.word))), numSuggestions, includeTies); - const sugsAdjusted = calcSuggestionAdjustedToToMatchCase(word, combined, locale, ignoreCase, extendsDictionaryCollection); - const allSugs = sugsAdjusted.map((sug) => { - const found = extendsDictionaryCollection.find(sug.word); - return { - ...sug, - forbidden: found?.forbidden || false, - noSuggest: found?.noSuggest || false - }; - }); - return { - word, - suggestions: limitResults(allSugs, numSuggestions, includeTies) - }; - } - function combine(suggestions) { - const words = /* @__PURE__ */ new Map(); - for (const sug of suggestions) { - const { word, cost, dictName, ...rest } = sug; - const f = words.get(word) || { word, cost, ...rest, dictionaries: [] }; - f.cost = Math.min(f.cost, cost); - f.dictionaries.push(dictName); - f.dictionaries.sort(); - words.set(word, f); - } - return [...words.values()]; - } - function adjustLocale(locale) { - if (!locale) - return void 0; - const locales = [...(0, LanguageSettings_js_1.normalizeLocaleIntl)(locale)].filter((locale2) => (0, LanguageSettings_js_1.isValidLocaleIntlFormat)(locale2)); - if (!locales.length) - return void 0; - if (locales.length === 1) - return locales[0]; - return locales; - } - function calcSuggestionAdjustedToToMatchCase(originalWord, sugs, locale, ignoreCase, dict) { - locale = adjustLocale(locale); - const knownSugs = new Set(sugs.map((sug) => sug.word)); - const matchStyle = { ...analyzeCase(originalWord), locale, ignoreCase }; - return sugs.map((sug) => { - const alt = matchCase(sug.word, !!sug.isPreferred, matchStyle); - if (alt === sug.word || knownSugs.has(alt)) - return sug; - const found = dict.find(alt); - if (!found || !found.forbidden || !found.noSuggest) { - knownSugs.add(alt); - return { ...sug, wordAdjustedToMatchCase: alt }; - } - return sug; - }); - } - exports.calcSuggestionAdjustedToToMatchCase = calcSuggestionAdjustedToToMatchCase; - function limitResults(suggestions, numSuggestions, includeTies) { - let cost = suggestions[0]?.cost; - let i = 0; - for (; i < suggestions.length; ++i) { - if (i >= numSuggestions && (!includeTies || suggestions[i].cost > cost)) { - break; - } - cost = suggestions[i].cost; - } - return suggestions.slice(0, i); + if (typeof value === "object") { + if (value.constructor && value.constructor.name) { + return `an instance of ${value.constructor.name}`; } - function validateDictionaries(settings, dictionaries) { - if (!dictionaries?.length) - return; - const knownDicts = new Set(settings.dictionaryDefinitions?.map((def) => def.name) || []); - for (const dict of dictionaries) { - if (!knownDicts.has(dict)) { - throw new SuggestionError2(`Unknown dictionary: "${dict}"`, "E_dictionary_unknown"); - } - } - } - function matchCase(word, isPreferred, style) { - const locale = style.locale; - if (style.isMixedCaps) { - return word; - } - if (hasCaps(word)) { - if (style.isAllCaps) - return word.toLocaleUpperCase(locale); - if (!style.ignoreCase || style.hasCaps || isPreferred) - return word; - if (isTitleCase(word) || isAllCaps(word)) - return word.toLocaleLowerCase(locale); - return word; - } - if (!style.hasCaps) - return word; - if (style.isAllCaps) - return word.toLocaleUpperCase(locale); - (0, assert_1.default)(style.isTitleCase); - return word.replace(/^\p{L}/u, (firstLetter) => firstLetter.toLocaleUpperCase(locale)); - } - var regExpHasCaps = /\p{Lu}/u; - var regExpIsAllCaps = /^[\P{L}\p{Lu}]+$/u; - var regExpIsTitleCase = /^\p{Lu}[\P{L}\p{Ll}]+$/u; - function analyzeCase(word) { - const hasCaps2 = regExpHasCaps.test(word); - const isAllCaps2 = hasCaps2 && regExpIsAllCaps.test(word); - const isTitleCase2 = hasCaps2 && !isAllCaps2 && regExpIsTitleCase.test(word); - const isMixedCaps = hasCaps2 && !isAllCaps2 && !isTitleCase2; - return { hasCaps: hasCaps2, isAllCaps: isAllCaps2, isMixedCaps, isTitleCase: isTitleCase2 }; - } - function hasCaps(word) { - return regExpHasCaps.test(word); - } - function isTitleCase(word) { - return regExpIsTitleCase.test(word); - } - function isAllCaps(word) { - return regExpIsAllCaps.test(word); - } - var SuggestionError2 = class extends Error { - constructor(message, code) { - super(message); - this.code = code; - } - }; - exports.SuggestionError = SuggestionError2; + return `${(0, import_node_util.inspect)(value, { depth: -1 })}`; } -}); - -// node_modules/cspell-lib/dist/cjs/util/simpleCache.js -var require_simpleCache2 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/simpleCache.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AutoCache = exports.SimpleCache = exports.AutoWeakCache = exports.SimpleWeakCache = void 0; - var SimpleWeakCache = class { - constructor(size) { - this.size = size; - this.L0 = /* @__PURE__ */ new WeakMap(); - this.L1 = /* @__PURE__ */ new WeakMap(); - this.L2 = /* @__PURE__ */ new WeakMap(); - this.sizeL0 = 0; - } - has(key) { - for (const c of this.caches()) { - if (c.has(key)) - return true; - } - return false; - } - get(key) { - for (const c of this.caches()) { - const entry = c.get(key); - if (entry) { - if (c !== this.L0) { - this._set(key, entry); - } - return entry.v; + let inspected = (0, import_node_util.inspect)(value, { colors: false }); + if (inspected.length > 28) { + inspected = `${inspected.slice(0, 25)}...`; + } + return `type ${typeof value} (${inspected})`; +} +var import_node_v8, import_node_process3, import_node_assert, import_node_util, isWindows, own, classRegExp, kTypes, codes2, messages, nodeInternalPrefix, userStackTraceLimit, captureLargerStackTrace; +var init_errors = __esm({ + "node_modules/import-meta-resolve/lib/errors.js"() { + import_node_v8 = __toESM(require("node:v8"), 1); + import_node_process3 = __toESM(require("node:process"), 1); + import_node_assert = __toESM(require("node:assert"), 1); + import_node_util = require("node:util"); + isWindows = import_node_process3.default.platform === "win32"; + own = {}.hasOwnProperty; + classRegExp = /^([A-Z][a-z\d]*)+$/; + kTypes = /* @__PURE__ */ new Set([ + "string", + "function", + "number", + "object", + // Accept 'Function' and 'Object' as alternative to the lower cased version. + "Function", + "Object", + "boolean", + "bigint", + "symbol" + ]); + codes2 = {}; + messages = /* @__PURE__ */ new Map(); + nodeInternalPrefix = "__node_internal_"; + codes2.ERR_INVALID_ARG_TYPE = createError( + "ERR_INVALID_ARG_TYPE", + /** + * @param {string} name + * @param {Array | string} expected + * @param {unknown} actual + */ + (name, expected, actual) => { + (0, import_node_assert.default)(typeof name === "string", "'name' must be a string"); + if (!Array.isArray(expected)) { + expected = [expected]; + } + let message = "The "; + if (name.endsWith(" argument")) { + message += `${name} `; + } else { + const type = name.includes(".") ? "property" : "argument"; + message += `"${name}" ${type} `; + } + message += "must be "; + const types = []; + const instances = []; + const other = []; + for (const value of expected) { + (0, import_node_assert.default)( + typeof value === "string", + "All expected entries have to be of type string" + ); + if (kTypes.has(value)) { + types.push(value.toLowerCase()); + } else if (classRegExp.exec(value) === null) { + (0, import_node_assert.default)( + value !== "object", + 'The value "object" should be written as "Object"' + ); + other.push(value); + } else { + instances.push(value); } } - return void 0; - } - set(key, value) { - this._set(key, { v: value }); - } - _set(key, entry) { - if (this.L0.has(key)) { - this.L0.set(key, entry); - return this; + if (instances.length > 0) { + const pos = types.indexOf("object"); + if (pos !== -1) { + types.slice(pos, 1); + instances.push("Object"); + } } - if (this.sizeL0 >= this.size) { - this.rotate(); + if (types.length > 0) { + message += `${types.length > 1 ? "one of type" : "of type"} ${formatList( + types, + "or" + )}`; + if (instances.length > 0 || other.length > 0) + message += " or "; } - this.sizeL0 += 1; - this.L0.set(key, entry); - } - caches() { - return [this.L0, this.L1, this.L2]; - } - rotate() { - this.L2 = this.L1; - this.L1 = this.L0; - this.L0 = /* @__PURE__ */ new WeakMap(); - this.sizeL0 = 0; - } - }; - exports.SimpleWeakCache = SimpleWeakCache; - var AutoWeakCache = class extends SimpleWeakCache { - constructor(factory, size) { - super(size); - this.factory = factory; - } - get(key) { - const v = super.get(key); - if (v !== void 0) - return v; - const val = this.factory(key); - this.set(key, val); - return val; - } - }; - exports.AutoWeakCache = AutoWeakCache; - var SimpleCache = class { - constructor(size) { - this.size = size; - this.L0 = /* @__PURE__ */ new Map(); - this.L1 = /* @__PURE__ */ new Map(); - this.L2 = /* @__PURE__ */ new Map(); - } - has(key) { - for (const c of this.caches()) { - if (c.has(key)) - return true; + if (instances.length > 0) { + message += `an instance of ${formatList(instances, "or")}`; + if (other.length > 0) + message += " or "; } - return false; - } - get(key) { - for (const c of this.caches()) { - const entry = c.get(key); - if (entry) { - if (c !== this.L0) { - this._set(key, entry); - } - return entry.v; + if (other.length > 0) { + if (other.length > 1) { + message += `one of ${formatList(other, "or")}`; + } else { + if (other[0].toLowerCase() !== other[0]) + message += "an "; + message += `${other[0]}`; } } - return void 0; - } - set(key, value) { - this._set(key, { v: value }); - } - _set(key, entry) { - if (this.L0.has(key)) { - this.L0.set(key, entry); - return this; + message += `. Received ${determineSpecificType(actual)}`; + return message; + }, + TypeError + ); + codes2.ERR_INVALID_MODULE_SPECIFIER = createError( + "ERR_INVALID_MODULE_SPECIFIER", + /** + * @param {string} request + * @param {string} reason + * @param {string} [base] + */ + (request, reason, base = void 0) => { + return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`; + }, + TypeError + ); + codes2.ERR_INVALID_PACKAGE_CONFIG = createError( + "ERR_INVALID_PACKAGE_CONFIG", + /** + * @param {string} path + * @param {string} [base] + * @param {string} [message] + */ + (path26, base, message) => { + return `Invalid package config ${path26}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`; + }, + Error + ); + codes2.ERR_INVALID_PACKAGE_TARGET = createError( + "ERR_INVALID_PACKAGE_TARGET", + /** + * @param {string} pkgPath + * @param {string} key + * @param {unknown} target + * @param {boolean} [isImport=false] + * @param {string} [base] + */ + (pkgPath, key, target, isImport = false, base = void 0) => { + const relError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./"); + if (key === ".") { + (0, import_node_assert.default)(isImport === false); + return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ""}${relError ? '; targets must start with "./"' : ""}`; + } + return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify( + target + )} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ""}${relError ? '; targets must start with "./"' : ""}`; + }, + Error + ); + codes2.ERR_MODULE_NOT_FOUND = createError( + "ERR_MODULE_NOT_FOUND", + /** + * @param {string} path + * @param {string} base + * @param {string} [type] + */ + (path26, base, type = "package") => { + return `Cannot find ${type} '${path26}' imported from ${base}`; + }, + Error + ); + codes2.ERR_NETWORK_IMPORT_DISALLOWED = createError( + "ERR_NETWORK_IMPORT_DISALLOWED", + "import of '%s' by %s is not supported: %s", + Error + ); + codes2.ERR_PACKAGE_IMPORT_NOT_DEFINED = createError( + "ERR_PACKAGE_IMPORT_NOT_DEFINED", + /** + * @param {string} specifier + * @param {string} packagePath + * @param {string} base + */ + (specifier, packagePath, base) => { + return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ""} imported from ${base}`; + }, + TypeError + ); + codes2.ERR_PACKAGE_PATH_NOT_EXPORTED = createError( + "ERR_PACKAGE_PATH_NOT_EXPORTED", + /** + * @param {string} pkgPath + * @param {string} subpath + * @param {string} [base] + */ + (pkgPath, subpath, base = void 0) => { + if (subpath === ".") + return `No "exports" main defined in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; + return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; + }, + Error + ); + codes2.ERR_UNSUPPORTED_DIR_IMPORT = createError( + "ERR_UNSUPPORTED_DIR_IMPORT", + "Directory import '%s' is not supported resolving ES modules imported from %s", + Error + ); + codes2.ERR_UNKNOWN_FILE_EXTENSION = createError( + "ERR_UNKNOWN_FILE_EXTENSION", + /** + * @param {string} ext + * @param {string} path + */ + (ext, path26) => { + return `Unknown file extension "${ext}" for ${path26}`; + }, + TypeError + ); + codes2.ERR_INVALID_ARG_VALUE = createError( + "ERR_INVALID_ARG_VALUE", + /** + * @param {string} name + * @param {unknown} value + * @param {string} [reason='is invalid'] + */ + (name, value, reason = "is invalid") => { + let inspected = (0, import_node_util.inspect)(value); + if (inspected.length > 128) { + inspected = `${inspected.slice(0, 128)}...`; } - if (this.L0.size >= this.size) { - this.rotate(); + const type = name.includes(".") ? "property" : "argument"; + return `The ${type} '${name}' ${reason}. Received ${inspected}`; + }, + TypeError + // Note: extra classes have been shaken out. + // , RangeError + ); + codes2.ERR_UNSUPPORTED_ESM_URL_SCHEME = createError( + "ERR_UNSUPPORTED_ESM_URL_SCHEME", + /** + * @param {URL} url + * @param {Array} supported + */ + (url, supported) => { + let message = `Only URLs with a scheme in: ${formatList( + supported + )} are supported by the default ESM loader`; + if (isWindows && url.protocol.length === 2) { + message += ". On Windows, absolute paths must be valid file:// URLs"; } - this.L0.set(key, entry); - } - caches() { - return [this.L0, this.L1, this.L2]; - } - rotate() { - this.L2 = this.L1; - this.L1 = this.L0; - this.L0 = /* @__PURE__ */ new Map(); - } - }; - exports.SimpleCache = SimpleCache; - var AutoCache = class extends SimpleCache { - constructor(factory, size) { - super(size); - this.factory = factory; - } - get(key) { - const v = super.get(key); - if (v !== void 0) - return v; - const val = this.factory(key); - this.set(key, val); - return val; + message += `. Received protocol '${url.protocol}'`; + return message; + }, + Error + ); + captureLargerStackTrace = hideStackFrames( + /** + * @param {Error} error + * @returns {Error} + */ + // @ts-expect-error: fine + function(error2) { + const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable(); + if (stackTraceLimitIsWritable) { + userStackTraceLimit = Error.stackTraceLimit; + Error.stackTraceLimit = Number.POSITIVE_INFINITY; + } + Error.captureStackTrace(error2); + if (stackTraceLimitIsWritable) + Error.stackTraceLimit = userStackTraceLimit; + return error2; } - }; - exports.AutoCache = AutoCache; + ); } }); -// node_modules/cspell-lib/dist/cjs/util/timer.js -var require_timer2 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/timer.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createLapRecorder = exports.polyHrTime = exports.toMilliseconds = exports.createTimer = void 0; - var _hrTime = process?.hrtime || polyHrTime; - function createTimer(hrTimeFn = _hrTime) { - let start = hrTimeFn(); - let lastLap = 0; - function elapsed() { - return toMilliseconds(hrTimeFn(start)); - } - return { - start() { - start = hrTimeFn(); - lastLap = 0; - }, - elapsed, - lap() { - const now = elapsed(); - const diff = now - lastLap; - lastLap = now; - return diff; - } - }; - } - exports.createTimer = createTimer; - function toMilliseconds(t) { - return (t[0] + t[1] * 1e-9) * 1e3; - } - exports.toMilliseconds = toMilliseconds; - function polyHrTime(time) { - const now = Date.now() - (time ? toMilliseconds(time) : 0); - const inSeconds = now * 1e-3; - const s = Math.floor(inSeconds); - const n = (inSeconds - s) * 1e9; - return [s, n]; - } - exports.polyHrTime = polyHrTime; - function createLapRecorder() { - const timer = createTimer(); - const times = []; - let lapTime = 0; - function lap(name) { - const now = timer.elapsed(); - const diff = now - lapTime; - times.push([name, diff, now]); - lapTime = diff; - } - function report() { - return times.map(([name, time]) => `${name}: ${time.toFixed(2)}`); - } - return { - times, - lap, - report - }; +// node_modules/import-meta-resolve/lib/package-json-reader.js +function read(jsonPath) { + try { + const string = import_node_fs2.default.readFileSync( + import_node_path3.default.toNamespacedPath(import_node_path3.default.join(import_node_path3.default.dirname(jsonPath), "package.json")), + "utf8" + ); + return { string }; + } catch (error2) { + const exception = ( + /** @type {ErrnoException} */ + error2 + ); + if (exception.code === "ENOENT") { + return { string: void 0 }; } - exports.createLapRecorder = createLapRecorder; + throw exception; } -}); - -// node_modules/cspell-lib/dist/cjs/textValidation/defaultConstants.js -var require_defaultConstants = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/defaultConstants.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.minWordSplitLen = exports.defaultMinWordLength = exports.defaultMaxDuplicateProblems = exports.defaultMaxNumberOfProblems = void 0; - exports.defaultMaxNumberOfProblems = 200; - exports.defaultMaxDuplicateProblems = 5; - exports.defaultMinWordLength = 4; - exports.minWordSplitLen = 3; +} +var import_node_fs2, import_node_path3, reader, package_json_reader_default; +var init_package_json_reader = __esm({ + "node_modules/import-meta-resolve/lib/package-json-reader.js"() { + import_node_fs2 = __toESM(require("node:fs"), 1); + import_node_path3 = __toESM(require("node:path"), 1); + reader = { read }; + package_json_reader_default = reader; } }); -// node_modules/cspell-lib/dist/cjs/util/PairingHeap.js -var require_PairingHeap2 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/PairingHeap.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.heapMethods = exports.PairingHeap = void 0; - var PairingHeap = class { - constructor(compare2) { - this.compare = compare2; - this._size = 0; - } - add(v) { - this._heap = insert(this.compare, this._heap, v); - ++this._size; - return this; - } - dequeue() { - const n = this.next(); - if (n.done) - return void 0; - return n.value; - } - concat(i) { - for (const v of i) { - this.add(v); - } - return this; - } - next() { - if (!this._heap) { - return { value: void 0, done: true }; - } - const value = this._heap.v; - --this._size; - this._heap = removeHead(this.compare, this._heap); - return { value }; - } - peek() { - return this._heap?.v; - } - [Symbol.iterator]() { - return this; - } - get length() { - return this._size; - } - }; - exports.PairingHeap = PairingHeap; - function removeHead(compare2, heap) { - if (!heap || !heap.c) - return void 0; - return mergeSiblings(compare2, heap.c); - } - function insert(compare2, heap, v) { - const n = { - v, - s: void 0, - c: void 0 - }; - if (!heap || compare2(v, heap.v) <= 0) { - n.c = heap; - return n; - } - n.s = heap.c; - heap.c = n; - return heap; - } - function merge(compare2, a, b) { - if (compare2(a.v, b.v) <= 0) { - a.s = void 0; - b.s = a.c; - a.c = b; - return a; - } - b.s = void 0; - a.s = b.c; - b.c = a; - return b; - } - function mergeSiblings(compare2, n) { - if (!n.s) - return n; - const s = n.s; - const ss = s.s; - const m = merge(compare2, n, s); - return ss ? merge(compare2, m, mergeSiblings(compare2, ss)) : m; - } - exports.heapMethods = { - insert, - merge, - mergeSiblings +// node_modules/import-meta-resolve/lib/package-config.js +function getPackageConfig(path26, specifier, base) { + const existing = packageJsonCache.get(path26); + if (existing !== void 0) { + return existing; + } + const source = package_json_reader_default.read(path26).string; + if (source === void 0) { + const packageConfig2 = { + pjsonPath: path26, + exists: false, + main: void 0, + name: void 0, + type: "none", + exports: void 0, + imports: void 0 }; + packageJsonCache.set(path26, packageConfig2); + return packageConfig2; + } + let packageJson; + try { + packageJson = JSON.parse(source); + } catch (error2) { + const exception = ( + /** @type {ErrnoException} */ + error2 + ); + throw new ERR_INVALID_PACKAGE_CONFIG( + path26, + (base ? `"${specifier}" from ` : "") + (0, import_node_url3.fileURLToPath)(base || specifier), + exception.message + ); + } + const { exports, imports, main, name, type } = packageJson; + const packageConfig = { + pjsonPath: path26, + exists: true, + main: typeof main === "string" ? main : void 0, + name: typeof name === "string" ? name : void 0, + type: type === "module" || type === "commonjs" ? type : "none", + // @ts-expect-error Assume `Record`. + exports, + // @ts-expect-error Assume `Record`. + imports: imports && typeof imports === "object" ? imports : void 0 + }; + packageJsonCache.set(path26, packageConfig); + return packageConfig; +} +function getPackageScopeConfig(resolved) { + let packageJsonUrl = new import_node_url3.URL("package.json", resolved); + while (true) { + const packageJsonPath2 = packageJsonUrl.pathname; + if (packageJsonPath2.endsWith("node_modules/package.json")) + break; + const packageConfig2 = getPackageConfig( + (0, import_node_url3.fileURLToPath)(packageJsonUrl), + resolved + ); + if (packageConfig2.exists) + return packageConfig2; + const lastPackageJsonUrl = packageJsonUrl; + packageJsonUrl = new import_node_url3.URL("../package.json", packageJsonUrl); + if (packageJsonUrl.pathname === lastPackageJsonUrl.pathname) + break; + } + const packageJsonPath = (0, import_node_url3.fileURLToPath)(packageJsonUrl); + const packageConfig = { + pjsonPath: packageJsonPath, + exists: false, + main: void 0, + name: void 0, + type: "none", + exports: void 0, + imports: void 0 + }; + packageJsonCache.set(packageJsonPath, packageConfig); + return packageConfig; +} +var import_node_url3, ERR_INVALID_PACKAGE_CONFIG, packageJsonCache; +var init_package_config = __esm({ + "node_modules/import-meta-resolve/lib/package-config.js"() { + import_node_url3 = require("node:url"); + init_errors(); + init_package_json_reader(); + ({ ERR_INVALID_PACKAGE_CONFIG } = codes2); + packageJsonCache = /* @__PURE__ */ new Map(); } }); -// node_modules/cspell-lib/dist/cjs/util/regexHelper.js -var require_regexHelper2 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/regexHelper.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.escapeRegEx = void 0; - function escapeRegEx(s) { - return s.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); - } - exports.escapeRegEx = escapeRegEx; +// node_modules/import-meta-resolve/lib/resolve-get-package-type.js +function getPackageType(url) { + const packageConfig = getPackageScopeConfig(url); + return packageConfig.type; +} +var init_resolve_get_package_type = __esm({ + "node_modules/import-meta-resolve/lib/resolve-get-package-type.js"() { + init_package_config(); } }); -// node_modules/cspell-lib/dist/cjs/util/wordSplitter.js -var require_wordSplitter = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/wordSplitter.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.split = void 0; - var PairingHeap_js_1 = require_PairingHeap2(); - var regexHelper_js_1 = require_regexHelper2(); - var textRegex_js_1 = require_textRegex(); - var ignoreBreak = Object.freeze([]); - function split(line, offset, isValidWord, options = {}) { - const relWordToSplit = findNextWordText({ text: line.text, offset: offset - line.offset }); - const lineOffset = line.offset; - const requested = /* @__PURE__ */ new Map(); - const regExpIgnoreSegment = /^[-.+\d_eE'`\\\s]+$/; - if (!relWordToSplit.text) { - const text = rebaseTextOffset(relWordToSplit); - return { - line, - offset, - text, - words: [], - endOffset: text.offset + text.text.length - }; - } - const lineSegment = { - line, - relStart: relWordToSplit.offset, - relEnd: relWordToSplit.offset + relWordToSplit.text.length - }; - const possibleBreaks = generateWordBreaks(lineSegment, options); - if (!possibleBreaks.length) { - const text = rebaseTextOffset(relWordToSplit); - return { - line, - offset, - text, - words: [{ ...text, isFound: isValidWord(text) }], - endOffset: text.offset + text.text.length - }; - } - function rebaseTextOffset(relText) { - return { - ...relText, - offset: relText.offset + lineOffset - }; - } - function has(word) { - if (regExpIgnoreSegment.test(word.text)) { - return true; - } - const i = word.offset; - const j = word.text.length; - let v = i + (j << 20); - if (i < 1 << 20 && j < 1 << 11) { - const b = requested.get(v); - if (b !== void 0) - return b; - } else { - v = -1; - } - const r = isValidWord(rebaseTextOffset(word)); - if (v >= 0) { - requested.set(v, r); - } - return r; - } - possibleBreaks.push({ - offset: lineSegment.relEnd, - breaks: [ignoreBreak] - }); - const result = { - line, - offset, - text: rebaseTextOffset(relWordToSplit), - words: splitIntoWords(lineSegment, possibleBreaks, has).map(rebaseTextOffset), - endOffset: lineOffset + lineSegment.relEnd - }; - return result; - } - exports.split = split; - function findNextWordText({ text, offset }) { - const reg = new RegExp(textRegex_js_1.regExWordsAndDigits); - reg.lastIndex = offset; - const m = reg.exec(text); - if (!m) { - return { - text: "", - offset: offset + text.length - }; - } - if (textRegex_js_1.regExNumericLiteral.test(m[0])) { - return findNextWordText({ text, offset: offset + m[0].length }); - } - return { - text: m[0], - offset: m.index - }; - } - function generateWordBreaks(line, options) { - const camelBreaks = genWordBreakCamel(line); - const symbolBreaks = genSymbolBreaks(line); - const optionalBreaks = genOptionalWordBreaks(line, options.optionalWordBreakCharacters); - return mergeSortedBreaks(...camelBreaks, ...symbolBreaks, ...optionalBreaks); - } - function offsetRegEx(reg, offset) { - const r = new RegExp(reg); - r.lastIndex = offset; - return r; - } - function genWordBreakCamel(line) { - const breaksCamel1 = []; - const text = line.line.text.slice(0, line.relEnd); - for (const m of text.matchAll(offsetRegEx(textRegex_js_1.regExSplitWords, line.relStart))) { - if (m.index === void 0) - break; - const i = m.index + 1; - breaksCamel1.push({ - offset: m.index, - breaks: [[i, i], ignoreBreak] - }); - } - const breaksCamel2 = []; - for (const m of text.matchAll(offsetRegEx(textRegex_js_1.regExSplitWords2, line.relStart))) { - if (m.index === void 0) - break; - const i = m.index + m[1].length; - const j = i + 1; - breaksCamel2.push({ - offset: m.index, - breaks: [[i, i], [j, j], ignoreBreak] - }); - } - return [breaksCamel1, breaksCamel2]; - } - function calcBreaksForRegEx(line, reg, calcBreak) { - const sb = []; - const text = line.line.text.slice(0, line.relEnd); - for (const m of text.matchAll(offsetRegEx(reg, line.relStart))) { - const b = calcBreak(m); - if (b) { - sb.push(b); - } - } - return sb; - } - function genOptionalWordBreaks(line, optionalBreakCharacters) { - function calcBreaks(m) { - const i = m.index; - if (i === void 0) - return; - const j = i + m[0].length; - return { - offset: i, - breaks: [ - [i, j], - ignoreBreak - ] - }; - } - const breaks = [ - calcBreaksForRegEx(line, textRegex_js_1.regExDanglingQuote, calcBreaks), - calcBreaksForRegEx(line, textRegex_js_1.regExTrailingEndings, calcBreaks) - ]; - if (optionalBreakCharacters) { - const regex = new RegExp(`[${(0, regexHelper_js_1.escapeRegEx)(optionalBreakCharacters)}]`, "gu"); - breaks.push(calcBreaksForRegEx(line, regex, calcBreaks)); - } - return breaks; +// node_modules/import-meta-resolve/lib/get-format.js +function mimeToFormat(mime) { + if (mime && /\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(mime)) + return "module"; + if (mime === "application/json") + return "json"; + return null; +} +function getDataProtocolModuleFormat(parsed) { + const { 1: mime } = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec( + parsed.pathname + ) || [null, null, null]; + return mimeToFormat(mime); +} +function extname(url) { + const pathname = url.pathname; + let index = pathname.length; + while (index--) { + const code = pathname.codePointAt(index); + if (code === 47) { + return ""; } - function genSymbolBreaks(line) { - function calcBreaks(m) { - const i = m.index; - if (i === void 0) - return; - const j = i + m[0].length; - return { - offset: i, - breaks: [ - [i, j], - [i, i], - [j, j], - ignoreBreak - ] - }; - } - return [ - calcBreaksForRegEx(line, textRegex_js_1.regExPossibleWordBreaks, calcBreaks), - calcBreaksForRegEx(line, /\d+/g, calcBreaks), - calcBreaksForRegEx(line, textRegex_js_1.regExEscapeCharacters, calcBreaks) - ]; + if (code === 46) { + return pathname.codePointAt(index - 1) === 47 ? "" : pathname.slice(index); } - function splitIntoWords(lineSeg, breaks, has) { - const maxIndex = lineSeg.relEnd; - const maxAttempts = 1e3; - const knownPathsByIndex = /* @__PURE__ */ new Map(); - function makeCandidates(p, i, bi, currentCost) { - const len = maxIndex; - while (bi < breaks.length && breaks[bi].offset < i) { - bi += 1; - } - if (bi >= breaks.length) { - return []; - } - const br = breaks[bi]; - function c(bp) { - const d = bp.length < 2 ? len - i : (bp[0] - i) * 0.5 + len - bp[1]; - const ec = currentCost + d; - return { - p, - i, - bi, - bp, - c: currentCost, - ec, - text: void 0 - }; - } - return br.breaks.map(c); - } - function toTextOffset(text2, offset) { - const valid = has({ text: text2, offset }); - return { - text: text2, - offset, - isFound: valid - }; - } - function compare2(a, b) { - return a.ec - b.ec || b.i - a.i; - } - function pathToWords(node) { - const results = []; - for (let p = node; p; p = p.n) { - if (p.text) { - results.push(p.text); - } - } - return results; - } - function addToKnownPaths(candidate, path16) { - for (let can = candidate; can !== void 0; can = can.p) { - const t = can.text; - const i = can.i; - const cost = (!t || t.isFound ? 0 : t.text.length) + (path16?.c ?? 0); - const exitingPath = knownPathsByIndex.get(i); - if (exitingPath && exitingPath.c <= cost) { - return void 0; - } - const node = { - n: path16, - i, - c: cost, - text: t - }; - knownPathsByIndex.set(i, node); - path16 = node; - } - return path16; - } - let maxCost = lineSeg.relEnd - lineSeg.relStart; - const candidates = new PairingHeap_js_1.PairingHeap(compare2); - const text = lineSeg.line.text; - candidates.concat(makeCandidates(void 0, lineSeg.relStart, 0, 0)); - let attempts = 0; - let bestPath; - while (maxCost && candidates.length && attempts++ < maxAttempts) { - const best = candidates.dequeue(); - if (!best || best.c >= maxCost) { - continue; - } - if (best.bp.length) { - const i = best.bp[0]; - const j = best.bp[1]; - const t = i > best.i ? toTextOffset(text.slice(best.i, i), best.i) : void 0; - const cost = !t || t.isFound ? 0 : t.text.length; - const mc = maxIndex - j; - best.c += cost; - best.ec = best.c + mc; - best.text = t; - const possiblePath = knownPathsByIndex.get(j); - if (possiblePath) { - const f = addToKnownPaths(best, possiblePath); - bestPath = !bestPath || f && f.c < bestPath.c ? f : bestPath; - } else if (best.c < maxCost) { - const c = makeCandidates(t ? best : best.p, j, best.bi + 1, best.c); - candidates.concat(c); - } - } else { - const c = makeCandidates(best.p, best.i, best.bi + 1, best.c); - candidates.concat(c); - if (!c.length) { - const t = maxIndex > best.i ? toTextOffset(text.slice(best.i, maxIndex), best.i) : void 0; - const cost = !t || t.isFound ? 0 : t.text.length; - best.c += cost; - best.ec = best.c; - best.text = t; - const segText = t || best.p?.text || toTextOffset("", best.i); - const can = t ? { ...best, text: segText } : { ...best, ...best.p, text: segText }; - const f = addToKnownPaths(can, void 0); - bestPath = !bestPath || f && f.c < bestPath.c ? f : bestPath; - } - } - if (bestPath && bestPath.c < maxCost) { - maxCost = bestPath.c; - } + } + return ""; +} +function getFileProtocolModuleFormat(url, _context, ignoreErrors) { + const ext = extname(url); + if (ext === ".js") { + return getPackageType(url) === "module" ? "module" : "commonjs"; + } + const format6 = extensionFormatMap[ext]; + if (format6) + return format6; + if (ignoreErrors) { + return void 0; + } + const filepath = (0, import_node_url4.fileURLToPath)(url); + throw new ERR_UNKNOWN_FILE_EXTENSION(ext, filepath); +} +function getHttpProtocolModuleFormat() { +} +function defaultGetFormatWithoutErrors(url, context) { + if (!hasOwnProperty.call(protocolHandlers, url.protocol)) { + return null; + } + return protocolHandlers[url.protocol](url, context, true) || null; +} +var import_node_url4, ERR_UNKNOWN_FILE_EXTENSION, hasOwnProperty, extensionFormatMap, protocolHandlers; +var init_get_format = __esm({ + "node_modules/import-meta-resolve/lib/get-format.js"() { + import_node_url4 = require("node:url"); + init_resolve_get_package_type(); + init_errors(); + ({ ERR_UNKNOWN_FILE_EXTENSION } = codes2); + hasOwnProperty = {}.hasOwnProperty; + extensionFormatMap = { + // @ts-expect-error: hush. + __proto__: null, + ".cjs": "commonjs", + ".js": "module", + ".json": "json", + ".mjs": "module" + }; + protocolHandlers = { + // @ts-expect-error: hush. + __proto__: null, + "data:": getDataProtocolModuleFormat, + "file:": getFileProtocolModuleFormat, + "http:": getHttpProtocolModuleFormat, + "https:": getHttpProtocolModuleFormat, + "node:"() { + return "builtin"; } - return pathToWords(bestPath); - } - function mergeSortedBreaks(...maps) { - return [].concat(...maps).sort((a, b) => a.offset - b.offset); - } - exports.__testing__ = { - generateWordBreaks, - findNextWordText }; } }); -// node_modules/cspell-lib/dist/cjs/textValidation/isWordValid.js -var require_isWordValid = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/isWordValid.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.isWordValidWithEscapeRetry = void 0; - function hasWordCheck(dict, word) { - word = word.includes("\\") ? word.replace(/\\/g, "") : word; - return dict.has(word); - } - function isWordValidWithEscapeRetry(dict, wo, line) { - const firstTry = hasWordCheck(dict, wo.text); - return firstTry || // Drop the first letter if it is preceded by a '\'. - line.text[wo.offset - line.offset - 1] === "\\" && hasWordCheck(dict, wo.text.slice(1)); - } - exports.isWordValidWithEscapeRetry = isWordValidWithEscapeRetry; - exports.__testing__ = { - hasWordCheck - }; +// node_modules/import-meta-resolve/lib/utils.js +function getDefaultConditions() { + return DEFAULT_CONDITIONS; +} +function getDefaultConditionsSet() { + return DEFAULT_CONDITIONS_SET; +} +function getConditionsSet(conditions) { + if (conditions !== void 0 && conditions !== getDefaultConditions()) { + if (!Array.isArray(conditions)) { + throw new ERR_INVALID_ARG_VALUE( + "conditions", + conditions, + "expected an array" + ); + } + return new Set(conditions); } -}); - -// node_modules/cspell-lib/dist/cjs/util/TextMap.js -var require_TextMap = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/TextMap.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.doesIntersect = exports.extractTextMapRangeOrigin = void 0; - var assert_1 = __importDefault(require("assert")); - function extractTextMapRangeOrigin(textMap, extractRange) { - const { text: srcTxt, range: srcRange, map: srcMap } = textMap; - const [r0, r1] = srcRange; - const startOrig = Math.min(Math.max(extractRange[0], r0), r1); - const endOrig = Math.min(Math.max(extractRange[1], r0), r1); - const a = startOrig - r0; - const b = endOrig - r0; - const range = [startOrig, endOrig]; - if (!srcMap || !srcMap.length || a === b) { - const text2 = srcTxt.slice(a, b); - return { text: text2, range }; - } - (0, assert_1.default)((srcMap.length & 1) === 0, "Map must be pairs of values."); - const mapLen = srcMap.length; - const mapEndSrc = srcMap[mapLen - 2]; - const mapEndDst = srcMap[mapLen - 1]; - const endDiff = srcTxt.length - mapEndDst; - const head = !srcMap[0] && !srcMap[1] ? [] : [0, 0]; - const tail = [mapEndSrc + endDiff, mapEndDst + endDiff]; - const sMap = head.concat(srcMap).concat(tail); - let idx = 0; - for (; idx < sMap.length && a >= sMap[idx]; idx += 2) { - } - const aIdx = idx; - idx -= 2; - const a0 = a - sMap[idx]; - const a1 = a0 + sMap[idx + 1]; - for (; idx < sMap.length && b > sMap[idx]; idx += 2) { - } - const bIdx = idx; - const b0 = b - sMap[idx]; - const b1 = b0 + sMap[idx + 1]; - const text = srcTxt.slice(a1, b1); - if (bIdx === aIdx) { - return { text, range }; - } - const ab = [a0, a1]; - const map = sMap.slice(aIdx, bIdx + 2).map((v, i) => v - ab[i & 1]); - return { text, range, map }; - } - exports.extractTextMapRangeOrigin = extractTextMapRangeOrigin; - function doesIntersect(textMap, rangeOrigin) { - const r = textMap.range; - return r[0] < rangeOrigin[1] && r[1] > rangeOrigin[0]; - } - exports.doesIntersect = doesIntersect; + return getDefaultConditionsSet(); +} +var ERR_INVALID_ARG_VALUE, DEFAULT_CONDITIONS, DEFAULT_CONDITIONS_SET; +var init_utils = __esm({ + "node_modules/import-meta-resolve/lib/utils.js"() { + init_errors(); + ({ ERR_INVALID_ARG_VALUE } = codes2); + DEFAULT_CONDITIONS = Object.freeze(["node", "import"]); + DEFAULT_CONDITIONS_SET = new Set(DEFAULT_CONDITIONS); } }); -// node_modules/cspell-lib/dist/cjs/textValidation/parsedText.js -var require_parsedText = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/parsedText.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createMappedTextSegmenter = exports.mapRangeToLocal = exports.mapRangeBackToOriginalPos = exports.mapIssueBackToOriginalPos = void 0; - var TextMap_js_1 = require_TextMap(); - function mapIssueBackToOriginalPos(mappedText, issue) { - if (!mappedText.map || mappedText.map.length === 0) - return issue; - const textOff = mapTextOffsetBackToOriginalPos(mappedText, issue); - return { - ...issue, - ...textOff - }; - } - exports.mapIssueBackToOriginalPos = mapIssueBackToOriginalPos; - function mapTextOffsetBackToOriginalPos(mappedText, textOff) { - if (!mappedText.map || !mappedText.map.length) - return textOff; - const off = textOff.offset - mappedText.range[0]; - const range = mapRangeBackToOriginalPos([off, off + (textOff.length ?? textOff.text.length)], mappedText.map); - return { - text: textOff.text, - offset: mappedText.range[0] + range[0], - length: range[1] - range[0] - }; +// node_modules/import-meta-resolve/lib/resolve.js +function emitInvalidSegmentDeprecation(target, request, match2, packageJsonUrl, internal, base, isTarget) { + const pjsonPath = (0, import_node_url5.fileURLToPath)(packageJsonUrl); + const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null; + import_node_process4.default.emitWarning( + `Use of deprecated ${double ? "double slash" : "leading or trailing slash matching"} resolving "${target}" for module request "${request}" ${request === match2 ? "" : `matched to "${match2}" `}in the "${internal ? "imports" : "exports"}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${(0, import_node_url5.fileURLToPath)(base)}` : ""}.`, + "DeprecationWarning", + "DEP0166" + ); +} +function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) { + const format6 = defaultGetFormatWithoutErrors(url, { parentURL: base.href }); + if (format6 !== "module") + return; + const path26 = (0, import_node_url5.fileURLToPath)(url.href); + const pkgPath = (0, import_node_url5.fileURLToPath)(new import_node_url5.URL(".", packageJsonUrl)); + const basePath = (0, import_node_url5.fileURLToPath)(base); + if (main) + import_node_process4.default.emitWarning( + `Package ${pkgPath} has a "main" field set to ${JSON.stringify(main)}, excluding the full filename and extension to the resolved file at "${path26.slice( + pkgPath.length + )}", imported from ${basePath}. + Automatic extension resolution of the "main" field isdeprecated for ES modules.`, + "DeprecationWarning", + "DEP0151" + ); + else + import_node_process4.default.emitWarning( + `No "main" or "exports" field defined in the package.json for ${pkgPath} resolving the main entry point "${path26.slice( + pkgPath.length + )}", imported from ${basePath}. +Default "index" lookups for the main are deprecated for ES modules.`, + "DeprecationWarning", + "DEP0151" + ); +} +function tryStatSync(path26) { + try { + return (0, import_node_fs3.statSync)(path26); + } catch { + return new import_node_fs3.Stats(); + } +} +function fileExists(url) { + const stats = (0, import_node_fs3.statSync)(url, { throwIfNoEntry: false }); + const isFile2 = stats ? stats.isFile() : void 0; + return isFile2 === null || isFile2 === void 0 ? false : isFile2; +} +function legacyMainResolve(packageJsonUrl, packageConfig, base) { + let guess; + if (packageConfig.main !== void 0) { + guess = new import_node_url5.URL(packageConfig.main, packageJsonUrl); + if (fileExists(guess)) + return guess; + const tries2 = [ + `./${packageConfig.main}.js`, + `./${packageConfig.main}.json`, + `./${packageConfig.main}.node`, + `./${packageConfig.main}/index.js`, + `./${packageConfig.main}/index.json`, + `./${packageConfig.main}/index.node` + ]; + let i2 = -1; + while (++i2 < tries2.length) { + guess = new import_node_url5.URL(tries2[i2], packageJsonUrl); + if (fileExists(guess)) + break; + guess = void 0; } - function mapRangeBackToOriginalPos(offRange, map) { - if (!map || !map.length) - return offRange; - const [start, end] = offRange; - let i = 0, j = 0, p = 1; - while (p < map.length && map[p] < start) { - i = map[p - 1]; - j = map[p]; - p += 2; - } - const iA = start - j + i; - while (p < map.length && map[p] < end) { - i = map[p - 1]; - j = map[p]; - p += 2; - } - const iB = end - j + i; - return [iA, iB]; - } - exports.mapRangeBackToOriginalPos = mapRangeBackToOriginalPos; - function mapRangeToLocal(rangeOrig, map) { - if (!map || !map.length) - return rangeOrig; - const [start, end] = rangeOrig; - let i = 0, j = 0, p = 0; - while (p < map.length && map[p] < start) { - i = map[p]; - j = map[p + 1]; - p += 2; - } - const jA = start - i + j; - while (p < map.length && map[p] < end) { - i = map[p]; - j = map[p + 1]; - p += 2; - } - const jB = end - i + j; - return [jA, jB]; - } - exports.mapRangeToLocal = mapRangeToLocal; - function createMappedTextSegmenter(includeRanges) { - let rangePos = 0; - function* segmenter(pText) { - if (!includeRanges.length) { - return; - } - const range = pText.range; - const textEndPos = range[1]; - let textStartPos = range[0]; - while (rangePos && (rangePos >= includeRanges.length || includeRanges[rangePos].startPos > textStartPos)) { - rangePos -= 1; - } - const cur = includeRanges[rangePos]; - if (textEndPos <= cur.endPos && textStartPos >= cur.startPos) { - yield pText; - return; - } - while (textStartPos < textEndPos) { - while (includeRanges[rangePos] && includeRanges[rangePos].endPos <= textStartPos) { - rangePos += 1; - } - if (!includeRanges[rangePos]) { - break; - } - const { startPos, endPos } = includeRanges[rangePos]; - if (textEndPos < startPos) { - break; - } - const a = Math.max(textStartPos, startPos); - const b = Math.min(textEndPos, endPos); - if (a !== b) { - yield (0, TextMap_js_1.extractTextMapRangeOrigin)(pText, [a, b]); - } - textStartPos = b; - } - } - return segmenter; + if (guess) { + emitLegacyIndexDeprecation( + guess, + packageJsonUrl, + base, + packageConfig.main + ); + return guess; } - exports.createMappedTextSegmenter = createMappedTextSegmenter; } -}); - -// node_modules/cspell-lib/dist/cjs/textValidation/lineValidatorFactory.js -var require_lineValidatorFactory = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/lineValidatorFactory.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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.textValidatorFactory = exports.lineValidatorFactory = void 0; - var sync_1 = require_sync(); - var cspell_dictionary_1 = require_cjs7(); - var RxPat = __importStar(require_RegExpPatterns()); - var Text2 = __importStar(require_text2()); - var util_js_1 = require_util(); - var wordSplitter_js_1 = require_wordSplitter(); - var defaultConstants_js_1 = require_defaultConstants(); - var isWordValid_js_1 = require_isWordValid(); - var parsedText_js_1 = require_parsedText(); - function lineValidatorFactory(sDict, options) { - const { minWordLength = defaultConstants_js_1.defaultMinWordLength, flagWords = [], allowCompoundWords = false, ignoreCase = true } = options; - const hasWordOptions = { - ignoreCase, - useCompounds: allowCompoundWords || void 0 - // let the dictionaries decide on useCompounds if allow is false - }; - const dictCol = (0, cspell_dictionary_1.createCachingDictionary)(sDict, hasWordOptions); - const setOfFlagWords = new Set(flagWords); - const setOfKnownSuccessfulWords = /* @__PURE__ */ new Set(); - const rememberFilter = (fn2) => (v) => { - const keep = fn2(v); - if (!keep) { - setOfKnownSuccessfulWords.add(v.text); - } - return keep; - }; - const filterAlreadyChecked = (wo) => { - return !setOfKnownSuccessfulWords.has(wo.text); - }; - function testForFlaggedWord(wo) { - const text = wo.text; - return setOfFlagWords.has(text) || setOfFlagWords.has(text.toLowerCase()) || dictCol.isForbidden(text); - } - function isWordIgnored(word) { - return dictCol.isNoSuggestWord(word); - } - function getSuggestions(word) { - return dictCol.getPreferredSuggestions(word); - } - function isWordFlagged(word) { - const isIgnored = isWordIgnored(word.text); - const isFlagged = !isIgnored && testForFlaggedWord(word); - return isFlagged; - } - function annotateIsFlagged(word) { - word.isFlagged = isWordFlagged(word); - return word; - } - function annotateIssue(issue) { - const sugs = getSuggestions(issue.text); - if (sugs && sugs.length) { - issue.suggestionsEx = sugs; - } - return issue; - } - function checkWord(word) { - const isIgnored = isWordIgnored(word.text); - const { isFlagged = !isIgnored && testForFlaggedWord(word) } = word; - const isFound = isFlagged ? void 0 : isIgnored || (0, isWordValid_js_1.isWordValidWithEscapeRetry)(dictCol, word, word.line); - return (0, util_js_1.clean)({ ...word, isFlagged, isFound }); + const tries = ["./index.js", "./index.json", "./index.node"]; + let i = -1; + while (++i < tries.length) { + guess = new import_node_url5.URL(tries[i], packageJsonUrl); + if (fileExists(guess)) + break; + guess = void 0; + } + if (guess) { + emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main); + return guess; + } + throw new ERR_MODULE_NOT_FOUND( + (0, import_node_url5.fileURLToPath)(new import_node_url5.URL(".", packageJsonUrl)), + (0, import_node_url5.fileURLToPath)(base) + ); +} +function finalizeResolution(resolved, base, preserveSymlinks) { + if (encodedSepRegEx.exec(resolved.pathname) !== null) + throw new ERR_INVALID_MODULE_SPECIFIER( + resolved.pathname, + 'must not include encoded "/" or "\\" characters', + (0, import_node_url5.fileURLToPath)(base) + ); + const filePath = (0, import_node_url5.fileURLToPath)(resolved); + const stats = tryStatSync( + filePath.endsWith("/") ? filePath.slice(-1) : filePath + ); + if (stats.isDirectory()) { + const error2 = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, (0, import_node_url5.fileURLToPath)(base)); + error2.url = String(resolved); + throw error2; + } + if (!stats.isFile()) { + throw new ERR_MODULE_NOT_FOUND( + filePath || resolved.pathname, + base && (0, import_node_url5.fileURLToPath)(base), + "module" + ); + } + if (!preserveSymlinks) { + const real = (0, import_node_fs3.realpathSync)(filePath); + const { search, hash } = resolved; + resolved = (0, import_node_url5.pathToFileURL)(real + (filePath.endsWith(import_node_path4.default.sep) ? "/" : "")); + resolved.search = search; + resolved.hash = hash; + } + return resolved; +} +function importNotDefined(specifier, packageJsonUrl, base) { + return new ERR_PACKAGE_IMPORT_NOT_DEFINED( + specifier, + packageJsonUrl && (0, import_node_url5.fileURLToPath)(new import_node_url5.URL(".", packageJsonUrl)), + (0, import_node_url5.fileURLToPath)(base) + ); +} +function exportsNotFound(subpath, packageJsonUrl, base) { + return new ERR_PACKAGE_PATH_NOT_EXPORTED( + (0, import_node_url5.fileURLToPath)(new import_node_url5.URL(".", packageJsonUrl)), + subpath, + base && (0, import_node_url5.fileURLToPath)(base) + ); +} +function throwInvalidSubpath(request, match2, packageJsonUrl, internal, base) { + const reason = `request is not a valid match in pattern "${match2}" for the "${internal ? "imports" : "exports"}" resolution of ${(0, import_node_url5.fileURLToPath)(packageJsonUrl)}`; + throw new ERR_INVALID_MODULE_SPECIFIER( + request, + reason, + base && (0, import_node_url5.fileURLToPath)(base) + ); +} +function invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) { + target = typeof target === "object" && target !== null ? JSON.stringify(target, null, "") : `${target}`; + return new ERR_INVALID_PACKAGE_TARGET( + (0, import_node_url5.fileURLToPath)(new import_node_url5.URL(".", packageJsonUrl)), + subpath, + target, + internal, + base && (0, import_node_url5.fileURLToPath)(base) + ); +} +function resolvePackageTargetString(target, subpath, match2, packageJsonUrl, base, pattern, internal, isPathMap, conditions) { + if (subpath !== "" && !pattern && target[target.length - 1] !== "/") + throw invalidPackageTarget(match2, target, packageJsonUrl, internal, base); + if (!target.startsWith("./")) { + if (internal && !target.startsWith("../") && !target.startsWith("/")) { + let isURL2 = false; + try { + new import_node_url5.URL(target); + isURL2 = true; + } catch { } - const fn = (lineSegment) => { - function splitterIsValid(word) { - return setOfKnownSuccessfulWords.has(word.text) || !testForFlaggedWord(word) && (0, isWordValid_js_1.isWordValidWithEscapeRetry)(dictCol, word, lineSegment.line); - } - function checkFullWord(vr) { - if (vr.isFlagged) { - return [vr]; - } - const codeWordResults = (0, sync_1.toArray)((0, sync_1.pipe)( - Text2.extractWordsFromCodeTextOffset(vr), - (0, sync_1.opFilter)(filterAlreadyChecked), - (0, sync_1.opMap)((t) => ({ ...t, line: vr.line })), - (0, sync_1.opMap)(annotateIsFlagged), - (0, sync_1.opFilter)(rememberFilter((wo) => wo.text.length >= minWordLength || !!wo.isFlagged)), - (0, sync_1.opMap)((wo) => wo.isFlagged ? wo : checkWord(wo)), - (0, sync_1.opFilter)(rememberFilter((wo) => wo.isFlagged || !wo.isFound)), - (0, sync_1.opFilter)(rememberFilter((wo) => !RxPat.regExRepeatedChar.test(wo.text))), - // get back the original text. - (0, sync_1.opMap)((wo) => ({ - ...wo, - text: Text2.extractText(lineSegment.segment, wo.offset, wo.offset + wo.text.length) - })) - )); - if (!codeWordResults.length || isWordIgnored(vr.text) || checkWord(vr).isFound) { - rememberFilter((_) => false)(vr); - return []; - } - return codeWordResults; - } - function checkPossibleWords(possibleWord) { - if (isWordFlagged(possibleWord)) { - const vr = { - ...possibleWord, - line: lineSegment.line, - isFlagged: true - }; - return [vr]; - } - const mismatches = (0, sync_1.toArray)((0, sync_1.pipe)(Text2.extractWordsFromTextOffset(possibleWord), (0, sync_1.opFilter)(filterAlreadyChecked), (0, sync_1.opMap)((wo) => ({ ...wo, line: lineSegment.line })), (0, sync_1.opMap)(annotateIsFlagged), (0, sync_1.opFilter)(rememberFilter((wo) => wo.text.length >= minWordLength || !!wo.isFlagged)), (0, sync_1.opConcatMap)(checkFullWord))); - if (mismatches.length) { - const splitResult = (0, wordSplitter_js_1.split)(lineSegment.segment, possibleWord.offset, splitterIsValid); - const nonMatching = splitResult.words.filter((w) => !w.isFound); - if (nonMatching.length < mismatches.length) { - return nonMatching.map((w) => ({ ...w, line: lineSegment.line })).map(annotateIsFlagged); - } - } - return mismatches; - } - const checkedPossibleWords = (0, sync_1.pipe)(Text2.extractPossibleWordsFromTextOffset(lineSegment.segment), (0, sync_1.opFilter)(filterAlreadyChecked), (0, sync_1.opConcatMap)(checkPossibleWords), (0, sync_1.opMap)(annotateIssue)); - return checkedPossibleWords; - }; - return { fn, dict: dictCol }; - } - exports.lineValidatorFactory = lineValidatorFactory; - function textValidatorFactory(dict, options) { - const lineValidator = lineValidatorFactory(dict, options); - const lineValidatorFn = lineValidator.fn; - function validate2(pText) { - const { text, range: srcRange, map } = pText; - const srcOffset = srcRange[0]; - const segment = { text, offset: 0 }; - const lineSegment = { line: segment, segment }; - function mapBackToOriginSimple(vr) { - const { text: text2, offset, isFlagged, isFound, suggestionsEx } = vr; - const r = (0, parsedText_js_1.mapRangeBackToOriginalPos)([offset, offset + text2.length], map); - const range = [r[0] + srcOffset, r[1] + srcOffset]; - return { text: text2, range, isFlagged, isFound, suggestionsEx }; - } - return [...lineValidatorFn(lineSegment)].map(mapBackToOriginSimple); + if (!isURL2) { + const exportTarget = pattern ? RegExpPrototypeSymbolReplace.call( + patternRegEx, + target, + () => subpath + ) : target + subpath; + return packageResolve(exportTarget, packageJsonUrl, conditions); } - return { - validate: validate2, - lineValidator - }; } - exports.textValidatorFactory = textValidatorFactory; + throw invalidPackageTarget(match2, target, packageJsonUrl, internal, base); } -}); - -// node_modules/cspell-lib/dist/cjs/textValidation/settingsToValidateOptions.js -var require_settingsToValidateOptions = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/settingsToValidateOptions.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.settingsToValidateOptions = void 0; - function settingsToValidateOptions(settings) { - const opt = { - ...settings, - ignoreCase: !(settings.caseSensitive ?? false) - }; - return opt; + if (invalidSegmentRegEx.exec(target.slice(2)) !== null) { + if (deprecatedInvalidSegmentRegEx.exec(target.slice(2)) === null) { + if (!isPathMap) { + const request = pattern ? match2.replace("*", () => subpath) : match2 + subpath; + const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call( + patternRegEx, + target, + () => subpath + ) : target; + emitInvalidSegmentDeprecation( + resolvedTarget, + request, + match2, + packageJsonUrl, + internal, + base, + true + ); + } + } else { + throw invalidPackageTarget(match2, target, packageJsonUrl, internal, base); } - exports.settingsToValidateOptions = settingsToValidateOptions; } -}); - -// node_modules/cspell-lib/dist/cjs/util/TextRange.js -var require_TextRange = __commonJS({ - "node_modules/cspell-lib/dist/cjs/util/TextRange.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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); + const resolved = new import_node_url5.URL(target, packageJsonUrl); + const resolvedPath = resolved.pathname; + const packagePath = new import_node_url5.URL(".", packageJsonUrl).pathname; + if (!resolvedPath.startsWith(packagePath)) + throw invalidPackageTarget(match2, target, packageJsonUrl, internal, base); + if (subpath === "") + return resolved; + if (invalidSegmentRegEx.exec(subpath) !== null) { + const request = pattern ? match2.replace("*", () => subpath) : match2 + subpath; + if (deprecatedInvalidSegmentRegEx.exec(subpath) === null) { + if (!isPathMap) { + const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call( + patternRegEx, + target, + () => subpath + ) : target; + emitInvalidSegmentDeprecation( + resolvedTarget, + request, + match2, + packageJsonUrl, + internal, + base, + false + ); } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.extractRangeText = exports.excludeRanges = exports.findMatchingRangesForPatterns = exports.unionRanges = exports.findMatchingRanges = void 0; - var GS = __importStar(require_dist2()); - function toMatchRangeWithText(m) { - const index = m.index || 0; - const _text = m[0]; - return { - startPos: index, - endPos: index + _text.length, - text: _text - }; + } else { + throwInvalidSubpath(request, match2, packageJsonUrl, internal, base); } - function findMatchingRanges(pattern, text) { - if (pattern.source === ".*") { - return [{ startPos: 0, endPos: text.length }]; + } + if (pattern) { + return new import_node_url5.URL( + RegExpPrototypeSymbolReplace.call( + patternRegEx, + resolved.href, + () => subpath + ) + ); + } + return new import_node_url5.URL(subpath, resolved); +} +function isArrayIndex(key) { + const keyNumber = Number(key); + if (`${keyNumber}` !== key) + return false; + return keyNumber >= 0 && keyNumber < 4294967295; +} +function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions) { + if (typeof target === "string") { + return resolvePackageTargetString( + target, + subpath, + packageSubpath, + packageJsonUrl, + base, + pattern, + internal, + isPathMap, + conditions + ); + } + if (Array.isArray(target)) { + const targetList = target; + if (targetList.length === 0) + return null; + let lastException; + let i = -1; + while (++i < targetList.length) { + const targetItem = targetList[i]; + let resolveResult; + try { + resolveResult = resolvePackageTarget( + packageJsonUrl, + targetItem, + subpath, + packageSubpath, + base, + pattern, + internal, + isPathMap, + conditions + ); + } catch (error2) { + const exception = ( + /** @type {ErrnoException} */ + error2 + ); + lastException = exception; + if (exception.code === "ERR_INVALID_PACKAGE_TARGET") + continue; + throw error2; } - const regex = new RegExp(pattern); - if (!regex.global) { - const m = text.match(regex); - if (!m) - return []; - return [toMatchRangeWithText(m)]; + if (resolveResult === void 0) + continue; + if (resolveResult === null) { + lastException = null; + continue; } - return [...text.matchAll(regex)].map(toMatchRangeWithText); + return resolveResult; } - exports.findMatchingRanges = findMatchingRanges; - function compareRanges(a, b) { - return a.startPos - b.startPos || a.endPos - b.endPos; + if (lastException === void 0 || lastException === null) { + return null; } - function unionRanges(ranges) { - return makeSortedMatchRangeArray([..._unionRanges(ranges)]); + throw lastException; + } + if (typeof target === "object" && target !== null) { + const keys2 = Object.getOwnPropertyNames(target); + let i = -1; + while (++i < keys2.length) { + const key = keys2[i]; + if (isArrayIndex(key)) { + throw new ERR_INVALID_PACKAGE_CONFIG2( + (0, import_node_url5.fileURLToPath)(packageJsonUrl), + base, + '"exports" cannot contain numeric property keys.' + ); + } } - exports.unionRanges = unionRanges; - function* _unionRanges(ranges) { - const sortedRanges = sortMatchRangeArray(ranges); - if (!sortedRanges.length) - return; - let { startPos, endPos } = sortedRanges[0]; - for (const r of ranges) { - if (r.startPos > endPos) { - yield { startPos, endPos }; - startPos = r.startPos; - endPos = r.endPos; + i = -1; + while (++i < keys2.length) { + const key = keys2[i]; + if (key === "default" || conditions && conditions.has(key)) { + const conditionalTarget = ( + /** @type {unknown} */ + target[key] + ); + const resolveResult = resolvePackageTarget( + packageJsonUrl, + conditionalTarget, + subpath, + packageSubpath, + base, + pattern, + internal, + isPathMap, + conditions + ); + if (resolveResult === void 0) continue; - } - endPos = Math.max(endPos, r.endPos); - } - if (startPos < endPos) { - yield { startPos, endPos }; + return resolveResult; } } - function findMatchingRangesForPatterns(patterns, text) { - const matchedPatterns = GS.genSequence(patterns).concatMap((pattern) => findMatchingRanges(pattern, text)); - return unionRanges(matchedPatterns.toArray()); + return null; + } + if (target === null) { + return null; + } + throw invalidPackageTarget( + packageSubpath, + target, + packageJsonUrl, + internal, + base + ); +} +function isConditionalExportsMainSugar(exports, packageJsonUrl, base) { + if (typeof exports === "string" || Array.isArray(exports)) + return true; + if (typeof exports !== "object" || exports === null) + return false; + const keys2 = Object.getOwnPropertyNames(exports); + let isConditionalSugar = false; + let i = 0; + let j = -1; + while (++j < keys2.length) { + const key = keys2[j]; + const curIsConditionalSugar = key === "" || key[0] !== "."; + if (i++ === 0) { + isConditionalSugar = curIsConditionalSugar; + } else if (isConditionalSugar !== curIsConditionalSugar) { + throw new ERR_INVALID_PACKAGE_CONFIG2( + (0, import_node_url5.fileURLToPath)(packageJsonUrl), + base, + `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.` + ); } - exports.findMatchingRangesForPatterns = findMatchingRangesForPatterns; - function excludeRanges(includeRanges, excludeRanges2) { - return [..._excludeRanges(sortMatchRangeArray(includeRanges), sortMatchRangeArray(excludeRanges2))]; + } + return isConditionalSugar; +} +function emitTrailingSlashPatternDeprecation(match2, pjsonUrl, base) { + const pjsonPath = (0, import_node_url5.fileURLToPath)(pjsonUrl); + if (emittedPackageWarnings.has(pjsonPath + "|" + match2)) + return; + emittedPackageWarnings.add(pjsonPath + "|" + match2); + import_node_process4.default.emitWarning( + `Use of deprecated trailing slash pattern mapping "${match2}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${(0, import_node_url5.fileURLToPath)(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, + "DeprecationWarning", + "DEP0155" + ); +} +function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions) { + let exports = packageConfig.exports; + if (isConditionalExportsMainSugar(exports, packageJsonUrl, base)) { + exports = { ".": exports }; + } + if (own2.call(exports, packageSubpath) && !packageSubpath.includes("*") && !packageSubpath.endsWith("/")) { + const target = exports[packageSubpath]; + const resolveResult = resolvePackageTarget( + packageJsonUrl, + target, + "", + packageSubpath, + base, + false, + false, + false, + conditions + ); + if (resolveResult === null || resolveResult === void 0) { + throw exportsNotFound(packageSubpath, packageJsonUrl, base); } - exports.excludeRanges = excludeRanges; - function* _excludeRanges(includeRanges, excludeRanges2) { - if (!includeRanges.length) - return; - if (!excludeRanges2.length) { - yield* includeRanges; - return; + return resolveResult; + } + let bestMatch = ""; + let bestMatchSubpath = ""; + const keys2 = Object.getOwnPropertyNames(exports); + let i = -1; + while (++i < keys2.length) { + const key = keys2[i]; + const patternIndex = key.indexOf("*"); + if (patternIndex !== -1 && packageSubpath.startsWith(key.slice(0, patternIndex))) { + if (packageSubpath.endsWith("/")) { + emitTrailingSlashPatternDeprecation( + packageSubpath, + packageJsonUrl, + base + ); } - let exIndex = 0; - const limit = excludeRanges2.length; - for (const incRange of includeRanges) { - const endPos = incRange.endPos; - let startPos = incRange.startPos; - for (; exIndex < limit; ++exIndex) { - const ex = excludeRanges2[exIndex]; - if (ex.startPos >= endPos) - break; - if (ex.endPos <= startPos) - continue; - if (ex.startPos > startPos) { - yield { startPos, endPos: ex.startPos }; + const patternTrailer = key.slice(patternIndex + 1); + if (packageSubpath.length >= key.length && packageSubpath.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && key.lastIndexOf("*") === patternIndex) { + bestMatch = key; + bestMatchSubpath = packageSubpath.slice( + patternIndex, + packageSubpath.length - patternTrailer.length + ); + } + } + } + if (bestMatch) { + const target = ( + /** @type {unknown} */ + exports[bestMatch] + ); + const resolveResult = resolvePackageTarget( + packageJsonUrl, + target, + bestMatchSubpath, + bestMatch, + base, + true, + false, + packageSubpath.endsWith("/"), + conditions + ); + if (resolveResult === null || resolveResult === void 0) { + throw exportsNotFound(packageSubpath, packageJsonUrl, base); + } + return resolveResult; + } + throw exportsNotFound(packageSubpath, packageJsonUrl, base); +} +function patternKeyCompare(a, b) { + const aPatternIndex = a.indexOf("*"); + const bPatternIndex = b.indexOf("*"); + const baseLengthA = aPatternIndex === -1 ? a.length : aPatternIndex + 1; + const baseLengthB = bPatternIndex === -1 ? b.length : bPatternIndex + 1; + if (baseLengthA > baseLengthB) + return -1; + if (baseLengthB > baseLengthA) + return 1; + if (aPatternIndex === -1) + return 1; + if (bPatternIndex === -1) + return -1; + if (a.length > b.length) + return -1; + if (b.length > a.length) + return 1; + return 0; +} +function packageImportsResolve(name, base, conditions) { + if (name === "#" || name.startsWith("#/") || name.endsWith("/")) { + const reason = "is not a valid internal imports specifier name"; + throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, (0, import_node_url5.fileURLToPath)(base)); + } + let packageJsonUrl; + const packageConfig = getPackageScopeConfig(base); + if (packageConfig.exists) { + packageJsonUrl = (0, import_node_url5.pathToFileURL)(packageConfig.pjsonPath); + const imports = packageConfig.imports; + if (imports) { + if (own2.call(imports, name) && !name.includes("*")) { + const resolveResult = resolvePackageTarget( + packageJsonUrl, + imports[name], + "", + name, + base, + false, + true, + false, + conditions + ); + if (resolveResult !== null && resolveResult !== void 0) { + return resolveResult; + } + } else { + let bestMatch = ""; + let bestMatchSubpath = ""; + const keys2 = Object.getOwnPropertyNames(imports); + let i = -1; + while (++i < keys2.length) { + const key = keys2[i]; + const patternIndex = key.indexOf("*"); + if (patternIndex !== -1 && name.startsWith(key.slice(0, -1))) { + const patternTrailer = key.slice(patternIndex + 1); + if (name.length >= key.length && name.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && key.lastIndexOf("*") === patternIndex) { + bestMatch = key; + bestMatchSubpath = name.slice( + patternIndex, + name.length - patternTrailer.length + ); + } } - startPos = ex.endPos; - if (startPos >= endPos) - break; } - if (startPos < endPos) { - yield { startPos, endPos }; + if (bestMatch) { + const target = imports[bestMatch]; + const resolveResult = resolvePackageTarget( + packageJsonUrl, + target, + bestMatchSubpath, + bestMatch, + base, + true, + true, + false, + conditions + ); + if (resolveResult !== null && resolveResult !== void 0) { + return resolveResult; + } } } } - function extractRangeText(text, ranges) { - return ranges.map(({ startPos, endPos }) => ({ - startPos, - endPos, - text: text.slice(startPos, endPos) - })); + } + throw importNotDefined(name, packageJsonUrl, base); +} +function parsePackageName(specifier, base) { + let separatorIndex = specifier.indexOf("/"); + let validPackageName = true; + let isScoped = false; + if (specifier[0] === "@") { + isScoped = true; + if (separatorIndex === -1 || specifier.length === 0) { + validPackageName = false; + } else { + separatorIndex = specifier.indexOf("/", separatorIndex + 1); + } + } + const packageName2 = separatorIndex === -1 ? specifier : specifier.slice(0, separatorIndex); + if (invalidPackageNameRegEx.exec(packageName2) !== null) { + validPackageName = false; + } + if (!validPackageName) { + throw new ERR_INVALID_MODULE_SPECIFIER( + specifier, + "is not a valid package name", + (0, import_node_url5.fileURLToPath)(base) + ); + } + const packageSubpath = "." + (separatorIndex === -1 ? "" : specifier.slice(separatorIndex)); + return { packageName: packageName2, packageSubpath, isScoped }; +} +function packageResolve(specifier, base, conditions) { + if (import_node_module.builtinModules.includes(specifier)) { + return new import_node_url5.URL("node:" + specifier); + } + const { packageName: packageName2, packageSubpath, isScoped } = parsePackageName( + specifier, + base + ); + const packageConfig = getPackageScopeConfig(base); + if (packageConfig.exists) { + const packageJsonUrl2 = (0, import_node_url5.pathToFileURL)(packageConfig.pjsonPath); + if (packageConfig.name === packageName2 && packageConfig.exports !== void 0 && packageConfig.exports !== null) { + return packageExportsResolve( + packageJsonUrl2, + packageSubpath, + packageConfig, + base, + conditions + ); + } + } + let packageJsonUrl = new import_node_url5.URL( + "./node_modules/" + packageName2 + "/package.json", + base + ); + let packageJsonPath = (0, import_node_url5.fileURLToPath)(packageJsonUrl); + let lastPath; + do { + const stat2 = tryStatSync(packageJsonPath.slice(0, -13)); + if (!stat2.isDirectory()) { + lastPath = packageJsonPath; + packageJsonUrl = new import_node_url5.URL( + (isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName2 + "/package.json", + packageJsonUrl + ); + packageJsonPath = (0, import_node_url5.fileURLToPath)(packageJsonUrl); + continue; } - exports.extractRangeText = extractRangeText; - var SymSortedMatchRangeArray = Symbol("SortedMatchRangeArray"); - function sortMatchRangeArray(values) { - if (isSortedMatchRangeArray(values)) - return values; - return makeSortedMatchRangeArray(values.sort(compareRanges)); + const packageConfig2 = getPackageConfig(packageJsonPath, specifier, base); + if (packageConfig2.exports !== void 0 && packageConfig2.exports !== null) { + return packageExportsResolve( + packageJsonUrl, + packageSubpath, + packageConfig2, + base, + conditions + ); } - function isSortedMatchRangeArray(a) { - return a[SymSortedMatchRangeArray] === true; + if (packageSubpath === ".") { + return legacyMainResolve(packageJsonUrl, packageConfig2, base); } - function makeSortedMatchRangeArray(sortedValues) { - const sorted = sortedValues; - sorted[SymSortedMatchRangeArray] = true; - Object.freeze(sorted); - return sorted; + return new import_node_url5.URL(packageSubpath, packageJsonUrl); + } while (packageJsonPath.length !== lastPath.length); + throw new ERR_MODULE_NOT_FOUND(packageName2, (0, import_node_url5.fileURLToPath)(base)); +} +function isRelativeSpecifier(specifier) { + if (specifier[0] === ".") { + if (specifier.length === 1 || specifier[1] === "/") + return true; + if (specifier[1] === "." && (specifier.length === 2 || specifier[2] === "/")) { + return true; } - exports.__testing__ = { - makeSortedMatchRangeArray - }; } -}); - -// node_modules/cspell-lib/dist/cjs/textValidation/textValidator.js -var require_textValidator = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/textValidator.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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); + return false; +} +function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) { + if (specifier === "") + return false; + if (specifier[0] === "/") + return true; + return isRelativeSpecifier(specifier); +} +function moduleResolve(specifier, base, conditions, preserveSymlinks) { + const protocol = base.protocol; + const isRemote = protocol === "http:" || protocol === "https:"; + let resolved; + if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) { + resolved = new import_node_url5.URL(specifier, base); + } else if (!isRemote && specifier[0] === "#") { + resolved = packageImportsResolve(specifier, base, conditions); + } else { + try { + resolved = new import_node_url5.URL(specifier); + } catch { + if (!isRemote) { + resolved = packageResolve(specifier, base, conditions); } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports._testMethods = exports.mapLineSegmentAgainstRangesFactory = exports.calcTextInclusionRanges = exports.validateText = void 0; - var sync_1 = require_sync(); - var Text2 = __importStar(require_text2()); - var TextRange = __importStar(require_TextRange()); - var defaultConstants_js_1 = require_defaultConstants(); - var lineValidatorFactory_js_1 = require_lineValidatorFactory(); - function validateText(text, dict, options) { - const { maxNumberOfProblems = defaultConstants_js_1.defaultMaxNumberOfProblems, maxDuplicateProblems = defaultConstants_js_1.defaultMaxDuplicateProblems } = options; - const mapOfProblems = /* @__PURE__ */ new Map(); - const includeRanges = calcTextInclusionRanges(text, options); - const lineValidator = (0, lineValidatorFactory_js_1.lineValidatorFactory)(dict, options); - const validator = lineValidator.fn; - const iter = (0, sync_1.pipe)(Text2.extractLinesOfText(text), (0, sync_1.opConcatMap)(mapLineToLineSegments(includeRanges)), (0, sync_1.opConcatMap)(validator), (0, sync_1.opFilter)((wo) => { - const word = wo.text; - const n = (mapOfProblems.get(word) || 0) + 1; - mapOfProblems.set(word, n); - return n <= maxDuplicateProblems; - }), (0, sync_1.opTake)(maxNumberOfProblems)); - return iter; - } - exports.validateText = validateText; - function calcTextInclusionRanges(text, options) { - const { ignoreRegExpList = [], includeRegExpList = [] } = options; - const filteredIncludeList = includeRegExpList.filter((a) => !!a); - const finalIncludeList = filteredIncludeList.length ? filteredIncludeList : [/.*/gim]; - const includeRanges = TextRange.excludeRanges(TextRange.findMatchingRangesForPatterns(finalIncludeList, text), TextRange.findMatchingRangesForPatterns(ignoreRegExpList, text)); - return includeRanges; - } - exports.calcTextInclusionRanges = calcTextInclusionRanges; - function mapLineToLineSegments(includeRanges) { - const mapAgainstRanges = mapLineSegmentAgainstRangesFactory(includeRanges); - return (line) => { - const segment = { line, segment: line }; - return mapAgainstRanges(segment); - }; - } - function mapLineSegmentAgainstRangesFactory(includeRanges) { - let rangePos = 0; - const mapper = (lineSeg) => { - if (!includeRanges.length) { - return []; - } - const parts = []; - const { segment, line } = lineSeg; - const { text, offset, length } = segment; - const textEndPos = offset + (length ?? text.length); - let textStartPos = offset; - while (rangePos && (rangePos >= includeRanges.length || includeRanges[rangePos].startPos > textStartPos)) { - rangePos -= 1; - } - const cur = includeRanges[rangePos]; - if (textEndPos <= cur.endPos && textStartPos >= cur.startPos) { - return [lineSeg]; - } - while (textStartPos < textEndPos) { - while (includeRanges[rangePos] && includeRanges[rangePos].endPos <= textStartPos) { - rangePos += 1; - } - if (!includeRanges[rangePos]) { - break; - } - const { startPos, endPos } = includeRanges[rangePos]; - if (textEndPos < startPos) { - break; - } - const a = Math.max(textStartPos, startPos); - const b = Math.min(textEndPos, endPos); - if (a !== b) { - parts.push({ line, segment: { offset: a, text: text.slice(a - offset, b - offset) } }); - } - textStartPos = b; - } - return parts; - }; - return mapper; } - exports.mapLineSegmentAgainstRangesFactory = mapLineSegmentAgainstRangesFactory; - exports._testMethods = { - mapWordsAgainstRanges: mapLineSegmentAgainstRangesFactory - }; } -}); - -// node_modules/cspell-lib/dist/cjs/textValidation/docValidator.js -var require_docValidator = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/docValidator.js"(exports) { - "use strict"; - var __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.__testing__ = exports.shouldCheckDocument = exports.DocumentValidator = void 0; - var sync_1 = require_sync(); - var cspell_types_1 = require_cjs9(); - var assert_1 = __importDefault(require("assert")); - var cspell_glob_1 = require_cjs(); - var path_1 = __importDefault(require("path")); - var TextDocument_js_1 = require_TextDocument(); - var index_js_1 = require_configLoader2(); - var index_js_2 = require_Settings(); - var InDocSettings_js_1 = require_InDocSettings(); - var index_js_3 = require_SpellingDictionary4(); - var suggestions_js_1 = require_suggestions(); - var errors_js_1 = require_errors3(); - var simpleCache_js_1 = require_simpleCache2(); - var timer_js_1 = require_timer2(); - var Uri_js_1 = require_Uri(); - var defaultConstants_js_1 = require_defaultConstants(); - var determineTextDocumentSettings_js_1 = require_determineTextDocumentSettings(); - var lineValidatorFactory_js_1 = require_lineValidatorFactory(); - var parsedText_js_1 = require_parsedText(); - var settingsToValidateOptions_js_1 = require_settingsToValidateOptions(); - var textValidator_js_1 = require_textValidator(); - var ERROR_NOT_PREPARED = "Validator Must be prepared before calling this function."; - var skipValidation = false; - var DocumentValidator = class { - /** - * @param doc - Document to validate - * @param config - configuration to use (not finalized). - */ - constructor(doc, options, settings) { - this.settings = settings; - this._ready = false; - this.errors = []; - this._preparationTime = -1; - this._suggestions = new simpleCache_js_1.AutoCache((text) => this.genSuggestions(text), 1e3); - this._document = doc; - this.options = { ...options }; - const numSuggestions = this.options.numSuggestions ?? settings.numSuggestions; - if (numSuggestions !== void 0) { - this.options.numSuggestions = numSuggestions; - } - } - get ready() { - return this._ready; - } - /** - * Prepare to validate a document. - * This will load all the necessary configuration and dictionaries. - * - * @deprecated - * @deprecationMessage Use the async `prepare` method. - */ - prepareSync() { - if (this._ready) - return; - const timer = (0, timer_js_1.createTimer)(); - const { options, settings } = this; - const useSearchForConfig = !options.noConfigSearch && !settings.noConfigSearch || options.noConfigSearch === false; - const optionsConfigFile = options.configFile; - const localConfigFn = optionsConfigFile ? () => (0, index_js_1.loadConfigSync)(optionsConfigFile, settings) : useSearchForConfig ? () => searchForDocumentConfigSync(this._document, settings, settings) : void 0; - const localConfig = localConfigFn && (0, errors_js_1.wrapCall)(localConfigFn, (e) => this.addPossibleError(e))(); - this.addPossibleError(localConfig?.__importRef?.error); - const config = (0, index_js_2.mergeSettings)(settings, localConfig); - const docSettings = (0, determineTextDocumentSettings_js_1.determineTextDocumentSettings)(this._document, config); - const dict = (0, index_js_3.getDictionaryInternalSync)(docSettings); - const matcher = new cspell_glob_1.GlobMatcher(localConfig?.ignorePaths || [], { root: process.cwd(), dot: true }); - const uri = this._document.uri; - const shouldCheck = !matcher.match((0, Uri_js_1.uriToFilePath)(uri)) && (docSettings.enabled ?? true); - const finalSettings = (0, index_js_2.finalizeSettings)(docSettings); - const validateOptions = (0, settingsToValidateOptions_js_1.settingsToValidateOptions)(finalSettings); - const includeRanges = (0, textValidator_js_1.calcTextInclusionRanges)(this._document.text, validateOptions); - const segmenter = (0, parsedText_js_1.createMappedTextSegmenter)(includeRanges); - const textValidator = (0, lineValidatorFactory_js_1.textValidatorFactory)(dict, validateOptions); - this._preparations = { - config, - dictionary: dict, - docSettings, - finalSettings, - shouldCheck, - validateOptions, - includeRanges, - segmenter, - textValidator, - localConfig, - localConfigFilepath: localConfig?.__importRef?.filename - }; - this._ready = true; - this._preparationTime = timer.elapsed(); - } - async prepare() { - if (this._ready) - return; - if (this._prepared) - return this._prepared; - this._prepared = this._prepareAsync(); - return this._prepared; - } - async _prepareAsync() { - (0, assert_1.default)(!this._ready); - const timer = (0, timer_js_1.createTimer)(); - const { options, settings } = this; - const useSearchForConfig = !options.noConfigSearch && !settings.noConfigSearch || options.noConfigSearch === false; - const pLocalConfig = options.configFile ? (0, index_js_2.loadConfig)(options.configFile, settings) : useSearchForConfig ? searchForDocumentConfig(this._document, settings, settings) : void 0; - const localConfig = await (0, errors_js_1.catchPromiseError)(pLocalConfig, (e) => this.addPossibleError(e)) || {}; - this.addPossibleError(localConfig?.__importRef?.error); - const config = (0, index_js_2.mergeSettings)(settings, localConfig); - const docSettings = (0, determineTextDocumentSettings_js_1.determineTextDocumentSettings)(this._document, config); - const dict = await (0, index_js_3.getDictionaryInternal)(docSettings); - const matcher = new cspell_glob_1.GlobMatcher(localConfig?.ignorePaths || [], { root: process.cwd(), dot: true }); - const uri = this._document.uri; - const shouldCheck = !matcher.match((0, Uri_js_1.uriToFilePath)(uri)) && (docSettings.enabled ?? true); - const finalSettings = (0, index_js_2.finalizeSettings)(docSettings); - const validateOptions = (0, settingsToValidateOptions_js_1.settingsToValidateOptions)(finalSettings); - const includeRanges = (0, textValidator_js_1.calcTextInclusionRanges)(this._document.text, validateOptions); - const segmenter = (0, parsedText_js_1.createMappedTextSegmenter)(includeRanges); - const textValidator = (0, lineValidatorFactory_js_1.textValidatorFactory)(dict, validateOptions); - this._preparations = { - config, - dictionary: dict, - docSettings, - finalSettings, - shouldCheck, - validateOptions, - includeRanges, - segmenter, - textValidator, - localConfig, - localConfigFilepath: localConfig?.__importRef?.filename - }; - this._ready = true; - this._preparationTime = timer.elapsed(); - } - _updatePrep() { - (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); - const timer = (0, timer_js_1.createTimer)(); - const prep = this._preparations; - const docSettings = (0, determineTextDocumentSettings_js_1.determineTextDocumentSettings)(this._document, prep.config); - const dict = (0, index_js_3.getDictionaryInternalSync)(docSettings); - const shouldCheck = docSettings.enabled ?? true; - const finalSettings = (0, index_js_2.finalizeSettings)(docSettings); - const validateOptions = (0, settingsToValidateOptions_js_1.settingsToValidateOptions)(finalSettings); - const includeRanges = (0, textValidator_js_1.calcTextInclusionRanges)(this._document.text, validateOptions); - const segmenter = (0, parsedText_js_1.createMappedTextSegmenter)(includeRanges); - const textValidator = (0, lineValidatorFactory_js_1.textValidatorFactory)(dict, validateOptions); - this._preparations = { - ...prep, - dictionary: dict, - docSettings, - shouldCheck, - validateOptions, - includeRanges, - segmenter, - textValidator - }; - this._preparationTime = timer.elapsed(); - } - /** - * The amount of time in ms to prepare for validation. - */ - get prepTime() { - return this._preparationTime; - } - get validateDirectives() { - return this.options.validateDirectives ?? this._preparations?.config.validateDirectives ?? false; - } - checkText(range, _text, scope) { - const text = this._document.text.slice(range[0], range[1]); - return this.check({ text, range, scope: scope.join(" ") }); - } - check(parsedText) { - (0, assert_1.default)(this._ready); - (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); - const { segmenter, textValidator } = this._preparations; - const document = this._document; - let line = void 0; - function mapToIssue(issue) { - const { range, text, isFlagged, isFound, suggestionsEx } = issue; - const offset = range[0]; - const length = range[1] - range[0]; - (0, assert_1.default)(!line || line.offset <= offset); - if (!line || line.offset + line.text.length <= offset) { - line = document.lineAt(offset); - } - return { text, offset, line, length, isFlagged, isFound, suggestionsEx }; - } - const issues = [...(0, sync_1.pipeSync)(segmenter(parsedText), (0, sync_1.opConcatMap)(textValidator.validate), (0, sync_1.opMap)(mapToIssue))]; - if (!this.options.generateSuggestions) { - return issues.map((issue) => { - if (!issue.suggestionsEx) - return issue; - const suggestionsEx = this.adjustSuggestions(issue.text, issue.suggestionsEx); - const suggestions = suggestionsEx.map((s) => s.word); - return { ...issue, suggestionsEx, suggestions }; - }); + (0, import_node_assert2.default)(resolved !== void 0, "expected to be defined"); + if (resolved.protocol !== "file:") { + return resolved; + } + return finalizeResolution(resolved, base, preserveSymlinks); +} +function checkIfDisallowedImport(specifier, parsed, parsedParentURL) { + if (parsedParentURL) { + const parentProtocol = parsedParentURL.protocol; + if (parentProtocol === "http:" || parentProtocol === "https:") { + if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) { + const parsedProtocol = parsed?.protocol; + if (parsedProtocol && parsedProtocol !== "https:" && parsedProtocol !== "http:") { + throw new ERR_NETWORK_IMPORT_DISALLOWED( + specifier, + parsedParentURL, + "remote imports cannot import from a local location." + ); } - const withSugs = issues.map((t) => { - const text = t.text; - const suggestionsEx = this.getSuggestions(text); - t.suggestionsEx = suggestionsEx; - t.suggestions = suggestionsEx.map((s) => s.word); - return t; - }); - return withSugs; - } - /** - * Check a Document for Validation Issues. - * @param forceCheck - force a check even if the document would normally be excluded. - * @returns the validation issues. - */ - async checkDocumentAsync(forceCheck) { - await this.prepare(); - return this.checkDocument(forceCheck); + return { url: parsed?.href || "" }; } - /** - * Check a Document for Validation Issues. - * - * Note: The validator must be prepared before calling this method. - * @param forceCheck - force a check even if the document would normally be excluded. - * @returns the validation issues. - */ - checkDocument(forceCheck = false) { - if (skipValidation) - return []; - (0, assert_1.default)(this._ready); - (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); - const spellingIssues = forceCheck || this.shouldCheckDocument() ? [...this._checkParsedText(this._parse())] : []; - const directiveIssues = this.checkDocumentDirectives(); - const allIssues = spellingIssues.concat(directiveIssues).sort((a, b) => a.offset - b.offset); - return allIssues; - } - checkDocumentDirectives(forceCheck = false) { - (0, assert_1.default)(this._ready); - (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); - const validateDirectives = forceCheck || this.validateDirectives; - if (!validateDirectives) - return []; - const document = this.document; - const issueType = cspell_types_1.IssueType.directive; - function toValidationIssue(dirIssue) { - const { text, range, suggestions, suggestionsEx, message } = dirIssue; - const offset = range[0]; - const pos = document.positionAt(offset); - const line = document.getLine(pos.line); - const issue = { text, offset, line, suggestions, suggestionsEx, message, issueType }; - return issue; - } - return [...(0, InDocSettings_js_1.validateInDocumentSettings)(this.document.text, this._preparations.config)].map(toValidationIssue); + if (import_node_module.builtinModules.includes(specifier)) { + throw new ERR_NETWORK_IMPORT_DISALLOWED( + specifier, + parsedParentURL, + "remote imports cannot import from a local location." + ); } - get document() { - return this._document; - } - updateDocumentText(text) { - (0, TextDocument_js_1.updateTextDocument)(this._document, [{ text }]); - this._updatePrep(); - } - defaultParser() { - return (0, sync_1.pipeSync)(this.document.getLines(), (0, sync_1.opMap)((line) => { - const { text, offset } = line; - const range = [offset, offset + text.length]; - return { text, range }; - })); - } - *_checkParsedText(parsedTexts) { - (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); - const { maxNumberOfProblems = defaultConstants_js_1.defaultMaxNumberOfProblems, maxDuplicateProblems = defaultConstants_js_1.defaultMaxDuplicateProblems } = this._preparations.validateOptions; - let numProblems = 0; - const mapOfProblems = /* @__PURE__ */ new Map(); - for (const pText of parsedTexts) { - for (const issue of this.check(pText)) { - const { text } = issue; - const n = (mapOfProblems.get(text) || 0) + 1; - mapOfProblems.set(text, n); - if (n > maxDuplicateProblems) - continue; - yield issue; - if (++numProblems >= maxNumberOfProblems) - return; - } - } - } - addPossibleError(error2) { - if (!error2) - return; - error2 = this.errors.push((0, errors_js_1.toError)(error2)); - } - _parse() { - (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); - const parser = this._preparations.finalSettings.parserFn; - if (typeof parser !== "object") - return this.defaultParser(); - return parser.parse(this.document.text, this.document.uri.path).parsedTexts; - } - getSuggestions(text) { - return this._suggestions.get(text); - } - genSuggestions(text) { - (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); - const settings = this._preparations.docSettings; - const dict = this._preparations.dictionary; - const sugOptions = { - compoundMethod: 0, - numSuggestions: this.options.numSuggestions, - includeTies: false, - ignoreCase: !(settings.caseSensitive ?? false), - timeout: settings.suggestionsTimeout, - numChanges: settings.suggestionNumChanges - }; - const rawSuggestions = dict.suggest(text, sugOptions); - return this.adjustSuggestions(text, rawSuggestions); - } - adjustSuggestions(text, rawSuggestions) { - (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); - const settings = this._preparations.docSettings; - const ignoreCase = !(settings.caseSensitive ?? false); - const locale = this._preparations.config.language; - const dict = this._preparations.dictionary; - const sugsWithAlt = (0, suggestions_js_1.calcSuggestionAdjustedToToMatchCase)(text, rawSuggestions.map(mapSug), locale, ignoreCase, dict); - return sugsWithAlt.map(sanitizeSuggestion); - } - getFinalizedDocSettings() { - (0, assert_1.default)(this._ready); - (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); - return this._preparations.docSettings; - } - /** - * Returns true if the final result of the configuration calculation results - * in the document being enabled. Note: in some cases, checking the document - * might still make sense, for example, the `@cspell/eslint-plugin` relies on - * `eslint` configuration to make that determination. - * @returns true if the document settings have resolved to be `enabled` - */ - shouldCheckDocument() { - (0, assert_1.default)(this._preparations, ERROR_NOT_PREPARED); - return this._preparations.shouldCheck; - } - /** - * Internal `cspell-lib` use. - */ - _getPreparations() { - return this._preparations; - } - }; - exports.DocumentValidator = DocumentValidator; - function sanitizeSuggestion(sug) { - const { word, isPreferred, wordAdjustedToMatchCase } = sug; - if (isPreferred && wordAdjustedToMatchCase) - return { word, wordAdjustedToMatchCase, isPreferred }; - if (isPreferred) - return { word, isPreferred }; - if (wordAdjustedToMatchCase) - return { word, wordAdjustedToMatchCase }; - return { word }; - } - async function searchForDocumentConfig(document, defaultConfig, pnpSettings) { - const { uri } = document; - if (uri.scheme !== "file") - return Promise.resolve(defaultConfig); - return (0, index_js_2.searchForConfig)(path_1.default.dirname((0, Uri_js_1.uriToFilePath)(uri)), pnpSettings).then((s) => s || defaultConfig); - } - function mapSug(sug) { - return { cost: 999, ...sug }; - } - function searchForDocumentConfigSync(document, defaultConfig, pnpSettings) { - const { uri } = document; - if (uri.scheme !== "file") - defaultConfig; - return (0, index_js_1.searchForConfigSync)((0, Uri_js_1.uriToFilePath)(uri), pnpSettings) || defaultConfig; - } - async function shouldCheckDocument2(doc, options, settings) { - const errors = []; - function addPossibleError(error2) { - if (!error2) - return void 0; - error2 = errors.push((0, errors_js_1.toError)(error2)); - return void 0; - } - async function shouldCheck() { - const useSearchForConfig = !options.noConfigSearch && !settings.noConfigSearch || options.noConfigSearch === false; - const pLocalConfig = options.configFile ? (0, index_js_2.loadConfig)(options.configFile, settings) : useSearchForConfig ? searchForDocumentConfig(doc, settings, settings) : void 0; - const localConfig = await (0, errors_js_1.catchPromiseError)(pLocalConfig, addPossibleError) || {}; - addPossibleError(localConfig?.__importRef?.error); - const config = (0, index_js_2.mergeSettings)(settings, localConfig); - const matcher = new cspell_glob_1.GlobMatcher(localConfig?.ignorePaths || [], { root: process.cwd(), dot: true }); - const docSettings = (0, determineTextDocumentSettings_js_1.determineTextDocumentSettings)(doc, config); - const uri = doc.uri; - return !matcher.match((0, Uri_js_1.uriToFilePath)(uri)) && (docSettings.enabled ?? true); - } - return { errors, shouldCheck: await shouldCheck() }; - } - exports.shouldCheckDocument = shouldCheckDocument2; - exports.__testing__ = { - sanitizeSuggestion - }; + throw new ERR_NETWORK_IMPORT_DISALLOWED( + specifier, + parsedParentURL, + "only relative and absolute specifiers are supported." + ); + } } -}); - -// node_modules/cspell-lib/dist/cjs/textValidation/validator.js -var require_validator = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/validator.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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.validateText = exports.diagSource = void 0; - var cspell_types_1 = require_cjs9(); - var TextDocument_js_1 = require_TextDocument(); - var Settings = __importStar(require_Settings()); - var InDocSettings_js_1 = require_InDocSettings(); - var index_js_1 = require_SpellingDictionary4(); - var settingsToValidateOptions_js_1 = require_settingsToValidateOptions(); - var textValidator_js_1 = require_textValidator(); - exports.diagSource = "cSpell Checker"; - async function validateText(text, settings, options = {}) { - const finalSettings = Settings.finalizeSettings(settings); - const dict = await (0, index_js_1.getDictionaryInternal)(finalSettings); - const spellingIssues = [...(0, textValidator_js_1.validateText)(text, dict, (0, settingsToValidateOptions_js_1.settingsToValidateOptions)(finalSettings))]; - const validationIssues = options.validateDirectives || finalSettings.validateDirectives ? (0, InDocSettings_js_1.validateInDocumentSettings)(text, settings) : []; - const issues = spellingIssues.concat(mapValidationIssues(text, validationIssues)); - if (!options.generateSuggestions) { - return issues; - } - const sugOptions = { - numSuggestions: options.numSuggestions, - compoundMethod: index_js_1.CompoundWordsMethod.NONE, - includeTies: false, - ignoreCase: !(settings.caseSensitive ?? false), - timeout: settings.suggestionsTimeout, - numChanges: settings.suggestionNumChanges - }; - const withSugs = issues.map((t) => { - const text2 = t.text; - const suggestionsEx = dict.suggest(text2, sugOptions).map(({ word, isPreferred }) => isPreferred ? { word, isPreferred } : { word }); - t.suggestions = suggestionsEx.map((s) => s.word); - t.suggestionsEx = suggestionsEx; - return t; - }); - return withSugs; +} +function isURL(self) { + return Boolean( + self && typeof self === "object" && "href" in self && typeof self.href === "string" && "protocol" in self && typeof self.protocol === "string" && self.href && self.protocol + ); +} +function throwIfInvalidParentURL(parentURL) { + if (parentURL === void 0) { + return; + } + if (typeof parentURL !== "string" && !isURL(parentURL)) { + throw new codes2.ERR_INVALID_ARG_TYPE( + "parentURL", + ["string", "URL"], + parentURL + ); + } +} +function throwIfUnsupportedURLProtocol(url) { + const protocol = url.protocol; + if (protocol !== "file:" && protocol !== "data:" && protocol !== "node:") { + throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(url); + } +} +function throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports2) { + const protocol = parsed?.protocol; + if (protocol && protocol !== "file:" && protocol !== "data:" && (!experimentalNetworkImports2 || protocol !== "https:" && protocol !== "http:")) { + throw new ERR_UNSUPPORTED_ESM_URL_SCHEME( + parsed, + ["file", "data"].concat( + experimentalNetworkImports2 ? ["https", "http"] : [] + ) + ); + } +} +function defaultResolve(specifier, context = {}) { + const { parentURL } = context; + (0, import_node_assert2.default)(parentURL !== void 0, "expected `parentURL` to be defined"); + throwIfInvalidParentURL(parentURL); + let parsedParentURL; + if (parentURL) { + try { + parsedParentURL = new import_node_url5.URL(parentURL); + } catch { } - exports.validateText = validateText; - function mapValidationIssues(text, valIssues) { - const issues = [...valIssues]; - if (!issues.length) - return []; - const document = (0, TextDocument_js_1.createTextDocument)({ uri: "", content: text }); - const issueType = cspell_types_1.IssueType.directive; - function toValidationIssue(dirIssue) { - const { text: text2, range, suggestions, suggestionsEx, message } = dirIssue; - const offset = range[0]; - const pos = document.positionAt(offset); - const line = document.getLine(pos.line); - const issue = { text: text2, offset, line, suggestions, suggestionsEx, message, issueType }; - return issue; - } - return issues.map(toValidationIssue); + } + let parsed; + try { + parsed = shouldBeTreatedAsRelativeOrAbsolutePath(specifier) ? new import_node_url5.URL(specifier, parsedParentURL) : new import_node_url5.URL(specifier); + const protocol = parsed.protocol; + if (protocol === "data:" || experimentalNetworkImports && (protocol === "https:" || protocol === "http:")) { + return { url: parsed.href, format: null }; } + } catch { + } + const maybeReturn = checkIfDisallowedImport( + specifier, + parsed, + parsedParentURL + ); + if (maybeReturn) + return maybeReturn; + if (parsed && parsed.protocol === "node:") + return { url: specifier }; + throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports); + const conditions = getConditionsSet(context.conditions); + const url = moduleResolve(specifier, new import_node_url5.URL(parentURL), conditions, false); + throwIfUnsupportedURLProtocol(url); + return { + // Do NOT cast `url` to a string: that will work even when there are real + // problems, silencing them + url: url.href, + format: defaultGetFormatWithoutErrors(url, { parentURL }) + }; +} +var import_node_assert2, import_node_fs3, import_node_process4, import_node_url5, import_node_path4, import_node_module, RegExpPrototypeSymbolReplace, experimentalNetworkImports, ERR_NETWORK_IMPORT_DISALLOWED, ERR_INVALID_MODULE_SPECIFIER, ERR_INVALID_PACKAGE_CONFIG2, ERR_INVALID_PACKAGE_TARGET, ERR_MODULE_NOT_FOUND, ERR_PACKAGE_IMPORT_NOT_DEFINED, ERR_PACKAGE_PATH_NOT_EXPORTED, ERR_UNSUPPORTED_DIR_IMPORT, ERR_UNSUPPORTED_ESM_URL_SCHEME, own2, invalidSegmentRegEx, deprecatedInvalidSegmentRegEx, invalidPackageNameRegEx, patternRegEx, encodedSepRegEx, emittedPackageWarnings, doubleSlashRegEx; +var init_resolve = __esm({ + "node_modules/import-meta-resolve/lib/resolve.js"() { + import_node_assert2 = __toESM(require("node:assert"), 1); + import_node_fs3 = require("node:fs"); + import_node_process4 = __toESM(require("node:process"), 1); + import_node_url5 = require("node:url"); + import_node_path4 = __toESM(require("node:path"), 1); + import_node_module = require("node:module"); + init_get_format(); + init_errors(); + init_package_config(); + init_utils(); + RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace]; + experimentalNetworkImports = false; + ({ + ERR_NETWORK_IMPORT_DISALLOWED, + ERR_INVALID_MODULE_SPECIFIER, + ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG2, + ERR_INVALID_PACKAGE_TARGET, + ERR_MODULE_NOT_FOUND, + ERR_PACKAGE_IMPORT_NOT_DEFINED, + ERR_PACKAGE_PATH_NOT_EXPORTED, + ERR_UNSUPPORTED_DIR_IMPORT, + ERR_UNSUPPORTED_ESM_URL_SCHEME + } = codes2); + own2 = {}.hasOwnProperty; + invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i; + deprecatedInvalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i; + invalidPackageNameRegEx = /^\.|%|\\/; + patternRegEx = /\*/g; + encodedSepRegEx = /%2f|%5c/i; + emittedPackageWarnings = /* @__PURE__ */ new Set(); + doubleSlashRegEx = /[/\\]{2}/; } }); -// node_modules/cspell-lib/dist/cjs/textValidation/checkText.js -var require_checkText = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/checkText.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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 __importDefault = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.genCheckText = exports.checkTextDocument = exports.IncludeExcludeFlag = exports.checkTextOld = exports.checkText = void 0; - var assert_1 = __importDefault(require("assert")); - var resolveDocument_js_1 = require_resolveDocument(); - var TextDocument_js_1 = require_TextDocument(); - var Settings = __importStar(require_Settings()); - var util_js_1 = require_util(); - var docValidator_js_1 = require_docValidator(); - var textValidator_js_1 = require_textValidator(); - var validator_js_1 = require_validator(); - async function checkText(text, settings) { - const languageId = settings.languageId || "plaintext"; - const doc = (0, util_js_1.clean)({ - uri: "", - text, - languageId: Array.isArray(languageId) ? languageId.join(",") : languageId, - locale: settings.language - }); - return checkTextDocument2(doc, { noConfigSearch: true }, { loadDefaultConfiguration: false, ...settings }); - } - exports.checkText = checkText; - async function checkTextOld(text, settings) { - const validationResult = (0, validator_js_1.validateText)(text, settings); - const finalSettings = Settings.finalizeSettings(settings); - const includeRanges = (0, textValidator_js_1.calcTextInclusionRanges)(text, finalSettings); - const issues = await validationResult; - return genResult(text, issues, includeRanges); - } - exports.checkTextOld = checkTextOld; - var IncludeExcludeFlag2; - (function(IncludeExcludeFlag3) { - IncludeExcludeFlag3["INCLUDE"] = "I"; - IncludeExcludeFlag3["EXCLUDE"] = "E"; - })(IncludeExcludeFlag2 || (exports.IncludeExcludeFlag = IncludeExcludeFlag2 = {})); - async function checkTextDocument2(doc, options, settings = {}) { - doc = (0, TextDocument_js_1.isTextDocument)(doc) ? doc : await (0, resolveDocument_js_1.resolveDocumentToTextDocument)(doc); - return genCheckText(new docValidator_js_1.DocumentValidator(doc, options, settings)); - } - exports.checkTextDocument = checkTextDocument2; - async function genCheckText(docValidator) { - await docValidator.prepare(); - const issues = docValidator.checkDocument(true); - const preparations = docValidator._getPreparations(); - (0, assert_1.default)(preparations); - return genResult(docValidator.document.text, issues, preparations.includeRanges); - } - exports.genCheckText = genCheckText; - function genResult(text, issues, includeRanges) { - const result = []; - let lastPos = 0; - for (const { startPos, endPos } of includeRanges) { - result.push({ - text: text.slice(lastPos, startPos), - startPos: lastPos, - endPos: startPos, - flagIE: IncludeExcludeFlag2.EXCLUDE - }); - result.push({ - text: text.slice(startPos, endPos), - startPos, - endPos, - flagIE: IncludeExcludeFlag2.INCLUDE - }); - lastPos = endPos; - } - result.push({ - text: text.slice(lastPos), - startPos: lastPos, - endPos: text.length, - flagIE: IncludeExcludeFlag2.EXCLUDE - }); - function* merge() { - let i = 0; - for (const r of result) { - if (i >= issues.length || issues[i].offset >= r.endPos) { - yield r; - continue; - } - const span = { ...r }; - while (i < issues.length && issues[i].offset < span.endPos) { - const issue = issues[i]; - const endPos = issue.offset; - const text2 = span.text.slice(0, endPos - span.startPos); - const endPosError = issue.offset + issue.text.length; - yield { ...span, text: text2, endPos }; - yield { - ...span, - isError: true, - startPos: issue.offset, - endPos: endPosError, - text: issue.text - }; - span.text = span.text.slice(endPosError - span.startPos); - span.startPos = endPosError; - i += 1; - } - yield span; - } - } - return { - text, - items: [...merge()].filter((i) => i.startPos < i.endPos) - }; +// node_modules/import-meta-resolve/index.js +var import_meta_resolve_exports = {}; +__export(import_meta_resolve_exports, { + moduleResolve: () => moduleResolve, + resolve: () => resolve10 +}); +function resolve10(specifier, parent) { + if (!parent) { + throw new Error( + "Please pass `parent`: `import-meta-resolve` cannot ponyfill that" + ); + } + try { + return defaultResolve(specifier, { parentURL: parent }).url; + } catch (error2) { + const exception = ( + /** @type {ErrnoException} */ + error2 + ); + if (exception.code === "ERR_UNSUPPORTED_DIR_IMPORT" && typeof exception.url === "string") { + return exception.url; } + throw error2; + } +} +var init_import_meta_resolve = __esm({ + "node_modules/import-meta-resolve/index.js"() { + init_resolve(); + init_resolve(); } }); -// node_modules/cspell-lib/dist/cjs/textValidation/index.js -var require_textValidation = __commonJS({ - "node_modules/cspell-lib/dist/cjs/textValidation/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.validateText = exports.calcTextInclusionRanges = exports.shouldCheckDocument = exports.DocumentValidator = exports.IncludeExcludeFlag = exports.checkTextDocument = exports.checkText = void 0; - var checkText_js_1 = require_checkText(); - Object.defineProperty(exports, "checkText", { enumerable: true, get: function() { - return checkText_js_1.checkText; - } }); - Object.defineProperty(exports, "checkTextDocument", { enumerable: true, get: function() { - return checkText_js_1.checkTextDocument; - } }); - Object.defineProperty(exports, "IncludeExcludeFlag", { enumerable: true, get: function() { - return checkText_js_1.IncludeExcludeFlag; - } }); - var docValidator_js_1 = require_docValidator(); - Object.defineProperty(exports, "DocumentValidator", { enumerable: true, get: function() { - return docValidator_js_1.DocumentValidator; - } }); - Object.defineProperty(exports, "shouldCheckDocument", { enumerable: true, get: function() { - return docValidator_js_1.shouldCheckDocument; - } }); - var textValidator_js_1 = require_textValidator(); - Object.defineProperty(exports, "calcTextInclusionRanges", { enumerable: true, get: function() { - return textValidator_js_1.calcTextInclusionRanges; - } }); - var validator_js_1 = require_validator(); - Object.defineProperty(exports, "validateText", { enumerable: true, get: function() { - return validator_js_1.validateText; - } }); +// src/main.ts +var core4 = __toESM(require_core()); +var import_github2 = __toESM(require_github()); +var import_context = __toESM(require_context()); + +// src/error.ts +var AppError = class extends Error { + constructor(message) { + super(message); } -}); +}; +function isError(e) { + if (!e) + return false; + if (typeof e !== "object") + return false; + const err = e; + return err.message !== void 0 && err.name !== void 0 && (err.stack === void 0 || typeof err.stack === "string"); +} +function isAppError(e) { + return e instanceof AppError; +} -// node_modules/cspell-lib/dist/cjs/spellCheckFile.js -var require_spellCheckFile = __commonJS({ - "node_modules/cspell-lib/dist/cjs/spellCheckFile.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.determineFinalDocumentSettings = exports.spellCheckDocument = exports.spellCheckFile = void 0; - var isBinaryDoc_js_1 = require_isBinaryDoc(); - var resolveDocument_js_1 = require_resolveDocument(); - var TextDocument_js_1 = require_TextDocument(); - var determineTextDocumentSettings_js_1 = require_determineTextDocumentSettings(); - var index_js_1 = require_textValidation(); - var errors_js_1 = require_errors3(); - var Uri_js_1 = require_Uri(); - function spellCheckFile(file, options, settings) { - const doc = { - uri: (0, Uri_js_1.toUri)(file).toString() - }; - return spellCheckDocument2(doc, options, settings); - } - exports.spellCheckFile = spellCheckFile; - async function spellCheckDocument2(document, options, settings) { - if ((0, isBinaryDoc_js_1.isBinaryDoc)(document)) { - return { - document, - options, - settingsUsed: settings, - localConfigFilepath: void 0, - issues: [], - checked: false, - errors: void 0 - }; - } - try { - return spellCheckFullDocument(await (0, resolveDocument_js_1.resolveDocument)(document), options, settings); - } catch (e) { - const errors = (0, errors_js_1.isError)(e) ? [e] : []; - return { - document, - options, - settingsUsed: settings, - localConfigFilepath: void 0, - issues: [], - checked: false, - errors - }; - } - } - exports.spellCheckDocument = spellCheckDocument2; - async function spellCheckFullDocument(document, options, settings) { - const doc = (0, resolveDocument_js_1.documentToTextDocument)(document); - const docValOptions = options; - const docValidator = new index_js_1.DocumentValidator(doc, docValOptions, settings); - await docValidator.prepare(); - const prep = docValidator._getPreparations(); - if (docValidator.errors.length) { - return { - document, - options, - settingsUsed: prep?.localConfig || settings, - localConfigFilepath: prep?.localConfigFilepath, - issues: [], - checked: false, - errors: docValidator.errors - }; +// src/action.ts +var core3 = __toESM(require_core()); + +// node_modules/cspell-glob/dist/esm/globHelper.mjs +var Path = __toESM(require("path"), 1); +var { posix } = Path; +var relRegExp = /^\.[\\/]/; +var isGlobalPatternRegExp = /^!*[*]{2}/; +function fileOrGlobToGlob(fileOrGlob, root, path26 = Path) { + const pathToGlob = path26.sep === "\\" ? (p) => p.replace(/\\/g, "/") : (p) => p; + const isGlobalPattern = false; + if (isGlobPatternWithOptionalRoot(fileOrGlob)) { + const useRoot = fileOrGlob.root ?? root; + const isGlobalPattern2 = isGlobPatternWithRoot(fileOrGlob) ? fileOrGlob.isGlobalPattern : isGlobalGlob(fileOrGlob.glob); + return { ...fileOrGlob, root: useRoot, isGlobalPattern: isGlobalPattern2 }; + } + if (doesRootContainPath(root, fileOrGlob, path26) || relRegExp.test(fileOrGlob)) { + const rel = path26.relative(root, path26.resolve(root, fileOrGlob)); + return { glob: pathToGlob(rel), root, isGlobalPattern }; + } + return { glob: pathToGlob(fileOrGlob), root, isGlobalPattern }; +} +function doesRootContainPath(root, child, path26) { + if (child.startsWith(root)) + return true; + const rel = path26.relative(root, child); + return !rel || rel !== child && !rel.startsWith("..") && !path26.isAbsolute(rel); +} +function isGlobPatternWithOptionalRoot(g) { + return typeof g !== "string" && typeof g.glob === "string"; +} +function isGlobPatternWithRoot(g) { + return typeof g.root === "string" && "isGlobalPattern" in g; +} +function isGlobPatternNormalized(g) { + if (!isGlobPatternWithOptionalRoot(g)) + return false; + if (!isGlobPatternWithRoot(g)) + return false; + const gr = g; + return "rawGlob" in gr && "rawRoot" in gr && typeof gr.rawGlob === "string"; +} +function normalizePattern(pattern, nested) { + pattern = pattern.replace(/^(!!)+/, ""); + const isNeg = pattern.startsWith("!"); + const prefix = isNeg ? "!" : ""; + pattern = isNeg ? pattern.slice(1) : pattern; + const patterns = nested ? normalizePatternNested(pattern) : normalizePatternGeneral(pattern); + return patterns.map((p) => prefix + p); +} +function normalizePatternNested(pattern) { + if (!pattern.includes("/")) { + if (pattern === "**") + return ["**"]; + return ["**/" + pattern, "**/" + pattern + "/**"]; + } + const hasLeadingSlash = pattern.startsWith("/"); + pattern = hasLeadingSlash ? pattern.slice(1) : pattern; + if (pattern.endsWith("/")) { + return hasLeadingSlash || pattern.slice(0, -1).includes("/") ? [pattern + "**/*"] : ["**/" + pattern + "**/*"]; + } + if (pattern.endsWith("**")) { + return [pattern]; + } + return [pattern, pattern + "/**"]; +} +function normalizePatternGeneral(pattern) { + pattern = pattern.startsWith("/") ? pattern.slice(1) : pattern; + pattern = pattern.endsWith("/") ? pattern + "**/*" : pattern; + return [pattern]; +} +function normalizeGlobPatterns(patterns, options) { + function* normalize3() { + for (const glob2 of patterns) { + if (isGlobPatternNormalized(glob2)) { + yield glob2; + continue; } - const issues = docValidator.checkDocument(); - const result = { - document, - options, - settingsUsed: docValidator.getFinalizedDocSettings(), - localConfigFilepath: prep?.localConfigFilepath, - issues, - checked: docValidator.shouldCheckDocument(), - errors: void 0 - }; - return result; - } - function determineFinalDocumentSettings(document, settings) { - const doc = (0, TextDocument_js_1.createTextDocument)({ - uri: document.uri, - content: document.text, - languageId: document.languageId, - locale: document.locale - }); - return { - document, - settings: (0, determineTextDocumentSettings_js_1.determineTextDocumentSettings)(doc, settings) - }; + yield* normalizeGlobPattern(glob2, options); } - exports.determineFinalDocumentSettings = determineFinalDocumentSettings; } -}); - -// node_modules/cspell-lib/dist/cjs/trace.js -var require_trace = __commonJS({ - "node_modules/cspell-lib/dist/cjs/trace.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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; + return [...normalize3()]; +} +function normalizeGlobPattern(g, options) { + const { root, nodePath: path26 = Path, nested, cwd = Path.resolve() } = options; + g = !isGlobPatternWithOptionalRoot(g) ? { glob: g } : g; + const gr = { ...g, root: g.root ?? root }; + const rawRoot = gr.root; + const rawGlob = g.glob; + gr.glob = gr.glob.trim(); + if (gr.glob.startsWith("${cwd}")) { + gr.glob = gr.glob.replace("${cwd}", ""); + gr.root = "${cwd}"; + } + if (gr.root.startsWith("${cwd}")) { + gr.root = path26.resolve(gr.root.replace("${cwd}", cwd)); + } + const isGlobalPattern = isGlobalGlob(gr.glob); + gr.root = path26.resolve(root, path26.normalize(gr.root)); + const globs = normalizePattern(gr.glob, nested); + return globs.map((glob2) => ({ ...gr, glob: glob2, rawGlob, rawRoot, isGlobalPattern })); +} +function normalizeGlobToRoot(glob2, root, path26) { + function relToGlob(relativePath2) { + return path26.sep === "\\" ? relativePath2.replace(/\\/g, "/") : relativePath2; + } + if (glob2.root === root) { + return glob2; + } + const relFromRootToGlob = path26.relative(root, glob2.root); + if (!relFromRootToGlob) { + return glob2; + } + if (glob2.isGlobalPattern) { + return { ...glob2, root }; + } + const relFromGlobToRoot = path26.relative(glob2.root, root); + const globIsUnderRoot = relFromRootToGlob[0] !== "." && !path26.isAbsolute(relFromRootToGlob); + const rootIsUnderGlob = relFromGlobToRoot[0] !== "." && !path26.isAbsolute(relFromGlobToRoot); + if (!globIsUnderRoot && !rootIsUnderGlob) { + return glob2; + } + const isNeg = glob2.glob.startsWith("!"); + const g = isNeg ? glob2.glob.slice(1) : glob2.glob; + const prefix = isNeg ? "!" : ""; + if (globIsUnderRoot) { + const relGlob2 = relToGlob(relFromRootToGlob); + return { + ...glob2, + glob: prefix + posix.join(relGlob2, g), + root }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.traceWordsAsync = exports.traceWords = void 0; - var gensequence_1 = require_dist2(); - var CSpellSettingsServer_js_1 = require_CSpellSettingsServer(); - var index_js_1 = require_Settings(); - var LanguageSettings_js_1 = require_LanguageSettings(); - var index_js_2 = require_SpellingDictionary4(); - var util = __importStar(require_util()); - async function traceWords(words, settings, options) { - const results = await util.asyncIterableToArray(traceWordsAsync2(words, settings, options)); - const s = (0, gensequence_1.genSequence)(results).concatMap((p) => p).toArray(); - return s; - } - exports.traceWords = traceWords; - async function* traceWordsAsync2(words, settings, options) { - const { languageId, locale: language, ignoreCase = true, allowCompoundWords } = options || {}; - async function finalize(config2) { - const withLocale = (0, index_js_1.mergeSettings)(config2, util.clean({ - language: language || config2.language, - allowCompoundWords: allowCompoundWords ?? config2.allowCompoundWords - })); - const withLanguageId = (0, LanguageSettings_js_1.calcSettingsForLanguageId)(withLocale, languageId ?? withLocale.languageId ?? "plaintext"); - const settings2 = (0, index_js_1.finalizeSettings)(withLanguageId); - const dictionaries = (settings2.dictionaries || []).concat((settings2.dictionaryDefinitions || []).map((d) => d.name)).filter(util.uniqueFn); - const dictSettings = (0, CSpellSettingsServer_js_1.toInternalSettings)({ ...settings2, dictionaries }); - const dictBase = await (0, index_js_2.getDictionaryInternal)(settings2); - const dicts2 = await (0, index_js_2.getDictionaryInternal)(dictSettings); - const activeDictionaries2 = dictBase.dictionaries.map((d) => d.name); - return { - activeDictionaries: activeDictionaries2, - config: settings2, - dicts: dicts2 - }; - } - await (0, index_js_2.refreshDictionaryCache)(); - const { config, dicts, activeDictionaries } = await finalize(settings); - const setOfActiveDicts = new Set(activeDictionaries); - const opts = util.clean({ ignoreCase, useCompounds: config.allowCompoundWords }); - function normalizeErrors(errors) { - if (!errors?.length) - return void 0; - return errors; - } - function processWord(word) { - return dicts.dictionaries.map((dict) => ({ dict, findResult: dict.find(word, opts) })).map(({ dict, findResult }) => ({ - word, - found: !!findResult?.found, - foundWord: findResult?.found || void 0, - forbidden: findResult?.forbidden || false, - noSuggest: findResult?.noSuggest || false, - dictName: dict.name, - dictSource: dict.source, - dictActive: setOfActiveDicts.has(dict.name), - configSource: config.name || "", - errors: normalizeErrors(dict.getErrors?.()) - })); - } - for await (const word of words) { - yield processWord(word); - } - } - exports.traceWordsAsync = traceWordsAsync2; } -}); - -// node_modules/cspell-lib/dist/cjs/validator.js -var require_validator2 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/validator.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.validateText = exports.IncludeExcludeFlag = exports.checkTextDocument = exports.checkText = void 0; - var index_js_1 = require_textValidation(); - Object.defineProperty(exports, "checkText", { enumerable: true, get: function() { - return index_js_1.checkText; - } }); - Object.defineProperty(exports, "checkTextDocument", { enumerable: true, get: function() { - return index_js_1.checkTextDocument; - } }); - Object.defineProperty(exports, "IncludeExcludeFlag", { enumerable: true, get: function() { - return index_js_1.IncludeExcludeFlag; - } }); - Object.defineProperty(exports, "validateText", { enumerable: true, get: function() { - return index_js_1.validateText; - } }); + const relGlob = relToGlob(relFromGlobToRoot) + "/"; + const rebasedGlob = rebaseGlob(g, relGlob); + return rebasedGlob ? { ...glob2, glob: prefix + rebasedGlob, root } : glob2; +} +function rebaseGlob(glob2, rebaseTo) { + if (!rebaseTo || rebaseTo === "/") + return glob2; + if (glob2.startsWith("**")) + return glob2; + rebaseTo = rebaseTo.endsWith("/") ? rebaseTo : rebaseTo + "/"; + if (glob2.startsWith(rebaseTo)) { + return glob2.slice(rebaseTo.length); } -}); - -// node_modules/cspell-lib/dist/cjs/clearCachedFiles.js -var require_clearCachedFiles = __commonJS({ - "node_modules/cspell-lib/dist/cjs/clearCachedFiles.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.clearCachedFiles = void 0; - var index_js_1 = require_Settings(); - var index_js_2 = require_SpellingDictionary4(); - async function clearCachedFiles() { - await Promise.all([(0, index_js_1.clearCachedSettingsFiles)(), (0, index_js_2.refreshDictionaryCache)(0)]); + const relParts = rebaseTo.split("/"); + const globParts = glob2.split("/"); + for (let i = 0; i < relParts.length && i < globParts.length; ++i) { + const relSeg = relParts[i]; + const globSeg = globParts[i]; + if (!relSeg || globSeg === "**") { + return globParts.slice(i).join("/"); } - exports.clearCachedFiles = clearCachedFiles; - } -}); - -// node_modules/cspell-lib/dist/cjs/getDictionary.js -var require_getDictionary = __commonJS({ - "node_modules/cspell-lib/dist/cjs/getDictionary.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getDictionary = void 0; - var CSpellSettingsServer_js_1 = require_CSpellSettingsServer(); - var index_js_1 = require_SpellingDictionary4(); - function getDictionary2(settings) { - return (0, index_js_1.getDictionaryInternal)((0, CSpellSettingsServer_js_1.toInternalSettings)(settings)); + if (relSeg !== globSeg && globSeg !== "*") { + break; } - exports.getDictionary = getDictionary2; } -}); + return void 0; +} +function isGlobalGlob(glob2) { + return isGlobalPatternRegExp.test(glob2); +} -// node_modules/cspell-lib/dist/cjs/index.js -var require_cjs10 = __commonJS({ - "node_modules/cspell-lib/dist/cjs/index.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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 __exportStar = exports && exports.__exportStar || function(m, exports2) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) - __createBinding(exports2, m, p); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.suggestionsForWord = exports.SuggestionError = exports.SpellingDictionaryLoadError = exports.refreshDictionaryCache = exports.isSpellingDictionaryLoadError = exports.createSpellingDictionaryCollection = exports.createSpellingDictionary = exports.CompoundWordsMethod = exports.spellCheckFile = exports.spellCheckDocument = exports.determineFinalDocumentSettings = exports.constructSettingsForText = exports.combineTextAndLanguageSettings = exports.defaultSettingsFilename = exports.sectionCSpell = exports.searchForConfig = exports.readSettingsFiles = exports.readSettings = exports.readRawSettings = exports.mergeSettings = exports.mergeInDocSettings = exports.loadPnPSync = exports.loadPnP = exports.loadConfig = exports.ImportError = exports.getSources = exports.getGlobalSettings = exports.getDefaultSettings = exports.getDefaultBundledSettings = exports.getCachedFileSize = exports.finalizeSettings = exports.extractImportErrors = exports.extractDependencies = exports.ENV_CSPELL_GLOB_ROOT = exports.defaultFileName = exports.defaultConfigFilenames = exports.currentSettingsFileVersion = exports.clearCachedSettingsFiles = exports.checkFilenameMatchesGlob = exports.calcOverrideSettings = exports.updateTextDocument = exports.createTextDocument = exports.getLanguagesForExt = exports.getLanguageIdsForBaseFilename = exports.UnknownFeatureFlagError = exports.getSystemFeatureFlags = exports.FeatureFlags = exports.isBinaryFile = exports.fileToTextDocument = exports.fileToDocument = void 0; - exports.getDictionary = exports.clearCachedFiles = exports.ExclusionHelper = exports.Text = exports.Link = exports.writeToFileIterableP = exports.writeToFileIterable = exports.writeToFile = exports.readFileSync = exports.readFile = exports.asyncIterableToArray = exports.validateText = exports.IncludeExcludeFlag = exports.checkTextDocument = exports.checkText = exports.resolveFile = exports.setLogger = exports.getLogger = exports.traceWordsAsync = exports.traceWords = exports.shouldCheckDocument = exports.DocumentValidator = exports.suggestionsForWords = void 0; - var ExclusionHelper = __importStar(require_exclusionHelper()); - exports.ExclusionHelper = ExclusionHelper; - var Link = __importStar(require_index_link()); - exports.Link = Link; - var Text2 = __importStar(require_text2()); - exports.Text = Text2; - var index_js_1 = require_Document(); - Object.defineProperty(exports, "fileToDocument", { enumerable: true, get: function() { - return index_js_1.fileToDocument; - } }); - Object.defineProperty(exports, "fileToTextDocument", { enumerable: true, get: function() { - return index_js_1.fileToTextDocument; - } }); - Object.defineProperty(exports, "isBinaryFile", { enumerable: true, get: function() { - return index_js_1.isBinaryFile; - } }); - var index_js_2 = require_FeatureFlags2(); - Object.defineProperty(exports, "FeatureFlags", { enumerable: true, get: function() { - return index_js_2.FeatureFlags; - } }); - Object.defineProperty(exports, "getSystemFeatureFlags", { enumerable: true, get: function() { - return index_js_2.getSystemFeatureFlags; - } }); - Object.defineProperty(exports, "UnknownFeatureFlagError", { enumerable: true, get: function() { - return index_js_2.UnknownFeatureFlagError; - } }); - var LanguageIds_js_1 = require_LanguageIds(); - Object.defineProperty(exports, "getLanguageIdsForBaseFilename", { enumerable: true, get: function() { - return LanguageIds_js_1.getLanguagesForBasename; - } }); - Object.defineProperty(exports, "getLanguagesForExt", { enumerable: true, get: function() { - return LanguageIds_js_1.getLanguagesForExt; - } }); - var TextDocument_js_1 = require_TextDocument(); - Object.defineProperty(exports, "createTextDocument", { enumerable: true, get: function() { - return TextDocument_js_1.createTextDocument; - } }); - Object.defineProperty(exports, "updateTextDocument", { enumerable: true, get: function() { - return TextDocument_js_1.updateTextDocument; - } }); - var index_js_3 = require_Settings(); - Object.defineProperty(exports, "calcOverrideSettings", { enumerable: true, get: function() { - return index_js_3.calcOverrideSettings; - } }); - Object.defineProperty(exports, "checkFilenameMatchesGlob", { enumerable: true, get: function() { - return index_js_3.checkFilenameMatchesGlob; - } }); - Object.defineProperty(exports, "clearCachedSettingsFiles", { enumerable: true, get: function() { - return index_js_3.clearCachedSettingsFiles; - } }); - Object.defineProperty(exports, "currentSettingsFileVersion", { enumerable: true, get: function() { - return index_js_3.currentSettingsFileVersion; - } }); - Object.defineProperty(exports, "defaultConfigFilenames", { enumerable: true, get: function() { - return index_js_3.defaultConfigFilenames; - } }); - Object.defineProperty(exports, "defaultFileName", { enumerable: true, get: function() { - return index_js_3.defaultFileName; - } }); - Object.defineProperty(exports, "ENV_CSPELL_GLOB_ROOT", { enumerable: true, get: function() { - return index_js_3.ENV_CSPELL_GLOB_ROOT; - } }); - Object.defineProperty(exports, "extractDependencies", { enumerable: true, get: function() { - return index_js_3.extractDependencies; - } }); - Object.defineProperty(exports, "extractImportErrors", { enumerable: true, get: function() { - return index_js_3.extractImportErrors; - } }); - Object.defineProperty(exports, "finalizeSettings", { enumerable: true, get: function() { - return index_js_3.finalizeSettings; - } }); - Object.defineProperty(exports, "getCachedFileSize", { enumerable: true, get: function() { - return index_js_3.getCachedFileSize; - } }); - Object.defineProperty(exports, "getDefaultBundledSettings", { enumerable: true, get: function() { - return index_js_3.getDefaultBundledSettings; - } }); - Object.defineProperty(exports, "getDefaultSettings", { enumerable: true, get: function() { - return index_js_3.getDefaultSettings; - } }); - Object.defineProperty(exports, "getGlobalSettings", { enumerable: true, get: function() { - return index_js_3.getGlobalSettings; - } }); - Object.defineProperty(exports, "getSources", { enumerable: true, get: function() { - return index_js_3.getSources; - } }); - Object.defineProperty(exports, "ImportError", { enumerable: true, get: function() { - return index_js_3.ImportError; - } }); - Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function() { - return index_js_3.loadConfig; - } }); - Object.defineProperty(exports, "loadPnP", { enumerable: true, get: function() { - return index_js_3.loadPnP; - } }); - Object.defineProperty(exports, "loadPnPSync", { enumerable: true, get: function() { - return index_js_3.loadPnPSync; - } }); - Object.defineProperty(exports, "mergeInDocSettings", { enumerable: true, get: function() { - return index_js_3.mergeInDocSettings; - } }); - Object.defineProperty(exports, "mergeSettings", { enumerable: true, get: function() { - return index_js_3.mergeSettings; - } }); - Object.defineProperty(exports, "readRawSettings", { enumerable: true, get: function() { - return index_js_3.readRawSettings; - } }); - Object.defineProperty(exports, "readSettings", { enumerable: true, get: function() { - return index_js_3.readSettings; - } }); - Object.defineProperty(exports, "readSettingsFiles", { enumerable: true, get: function() { - return index_js_3.readSettingsFiles; - } }); - Object.defineProperty(exports, "searchForConfig", { enumerable: true, get: function() { - return index_js_3.searchForConfig; - } }); - Object.defineProperty(exports, "sectionCSpell", { enumerable: true, get: function() { - return index_js_3.sectionCSpell; - } }); - var index_js_4 = require_Settings(); - Object.defineProperty(exports, "defaultSettingsFilename", { enumerable: true, get: function() { - return index_js_4.defaultFileName; - } }); - var TextDocumentSettings_js_1 = require_TextDocumentSettings(); - Object.defineProperty(exports, "combineTextAndLanguageSettings", { enumerable: true, get: function() { - return TextDocumentSettings_js_1.combineTextAndLanguageSettings; - } }); - Object.defineProperty(exports, "constructSettingsForText", { enumerable: true, get: function() { - return TextDocumentSettings_js_1.combineTextAndLanguageSettings; - } }); - var spellCheckFile_js_1 = require_spellCheckFile(); - Object.defineProperty(exports, "determineFinalDocumentSettings", { enumerable: true, get: function() { - return spellCheckFile_js_1.determineFinalDocumentSettings; - } }); - Object.defineProperty(exports, "spellCheckDocument", { enumerable: true, get: function() { - return spellCheckFile_js_1.spellCheckDocument; - } }); - Object.defineProperty(exports, "spellCheckFile", { enumerable: true, get: function() { - return spellCheckFile_js_1.spellCheckFile; - } }); - var index_js_5 = require_SpellingDictionary4(); - Object.defineProperty(exports, "CompoundWordsMethod", { enumerable: true, get: function() { - return index_js_5.CompoundWordsMethod; - } }); - Object.defineProperty(exports, "createSpellingDictionary", { enumerable: true, get: function() { - return index_js_5.createSpellingDictionary; - } }); - Object.defineProperty(exports, "createSpellingDictionaryCollection", { enumerable: true, get: function() { - return index_js_5.createCollection; - } }); - Object.defineProperty(exports, "isSpellingDictionaryLoadError", { enumerable: true, get: function() { - return index_js_5.isSpellingDictionaryLoadError; - } }); - Object.defineProperty(exports, "refreshDictionaryCache", { enumerable: true, get: function() { - return index_js_5.refreshDictionaryCache; - } }); - Object.defineProperty(exports, "SpellingDictionaryLoadError", { enumerable: true, get: function() { - return index_js_5.SpellingDictionaryLoadError; - } }); - var suggestions_js_1 = require_suggestions(); - Object.defineProperty(exports, "SuggestionError", { enumerable: true, get: function() { - return suggestions_js_1.SuggestionError; - } }); - Object.defineProperty(exports, "suggestionsForWord", { enumerable: true, get: function() { - return suggestions_js_1.suggestionsForWord; - } }); - Object.defineProperty(exports, "suggestionsForWords", { enumerable: true, get: function() { - return suggestions_js_1.suggestionsForWords; - } }); - var index_js_6 = require_textValidation(); - Object.defineProperty(exports, "DocumentValidator", { enumerable: true, get: function() { - return index_js_6.DocumentValidator; - } }); - Object.defineProperty(exports, "shouldCheckDocument", { enumerable: true, get: function() { - return index_js_6.shouldCheckDocument; - } }); - var trace_js_1 = require_trace(); - Object.defineProperty(exports, "traceWords", { enumerable: true, get: function() { - return trace_js_1.traceWords; - } }); - Object.defineProperty(exports, "traceWordsAsync", { enumerable: true, get: function() { - return trace_js_1.traceWordsAsync; - } }); - var logger_js_1 = require_logger(); - Object.defineProperty(exports, "getLogger", { enumerable: true, get: function() { - return logger_js_1.getLogger; - } }); - Object.defineProperty(exports, "setLogger", { enumerable: true, get: function() { - return logger_js_1.setLogger; - } }); - var resolveFile_js_1 = require_resolveFile(); - Object.defineProperty(exports, "resolveFile", { enumerable: true, get: function() { - return resolveFile_js_1.resolveFile; - } }); - var validator_js_1 = require_validator2(); - Object.defineProperty(exports, "checkText", { enumerable: true, get: function() { - return validator_js_1.checkText; - } }); - Object.defineProperty(exports, "checkTextDocument", { enumerable: true, get: function() { - return validator_js_1.checkTextDocument; - } }); - Object.defineProperty(exports, "IncludeExcludeFlag", { enumerable: true, get: function() { - return validator_js_1.IncludeExcludeFlag; - } }); - Object.defineProperty(exports, "validateText", { enumerable: true, get: function() { - return validator_js_1.validateText; - } }); - __exportStar(require_cjs9(), exports); - var cspell_io_1 = require_cjs3(); - Object.defineProperty(exports, "asyncIterableToArray", { enumerable: true, get: function() { - return cspell_io_1.asyncIterableToArray; - } }); - Object.defineProperty(exports, "readFile", { enumerable: true, get: function() { - return cspell_io_1.readFile; - } }); - Object.defineProperty(exports, "readFileSync", { enumerable: true, get: function() { - return cspell_io_1.readFileSync; - } }); - Object.defineProperty(exports, "writeToFile", { enumerable: true, get: function() { - return cspell_io_1.writeToFile; - } }); - Object.defineProperty(exports, "writeToFileIterable", { enumerable: true, get: function() { - return cspell_io_1.writeToFileIterable; - } }); - Object.defineProperty(exports, "writeToFileIterableP", { enumerable: true, get: function() { - return cspell_io_1.writeToFileIterableP; - } }); - var clearCachedFiles_js_1 = require_clearCachedFiles(); - Object.defineProperty(exports, "clearCachedFiles", { enumerable: true, get: function() { - return clearCachedFiles_js_1.clearCachedFiles; - } }); - var getDictionary_js_1 = require_getDictionary(); - Object.defineProperty(exports, "getDictionary", { enumerable: true, get: function() { - return getDictionary_js_1.getDictionary; - } }); - } -}); - -// node_modules/color-name/index.js -var require_color_name3 = __commonJS({ - "node_modules/color-name/index.js"(exports, module2) { - "use strict"; - module2.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] - }; - } -}); - -// node_modules/color-convert/conversions.js -var require_conversions3 = __commonJS({ - "node_modules/color-convert/conversions.js"(exports, module2) { - var cssKeywords = require_color_name3(); - var reverseKeywords = {}; - for (const key of Object.keys(cssKeywords)) { - reverseKeywords[cssKeywords[key]] = key; - } - var convert = { - rgb: { channels: 3, labels: "rgb" }, - hsl: { channels: 3, labels: "hsl" }, - hsv: { channels: 3, labels: "hsv" }, - hwb: { channels: 3, labels: "hwb" }, - cmyk: { channels: 4, labels: "cmyk" }, - xyz: { channels: 3, labels: "xyz" }, - lab: { channels: 3, labels: "lab" }, - lch: { channels: 3, labels: "lch" }, - hex: { channels: 1, labels: ["hex"] }, - keyword: { channels: 1, labels: ["keyword"] }, - ansi16: { channels: 1, labels: ["ansi16"] }, - ansi256: { channels: 1, labels: ["ansi256"] }, - hcg: { channels: 3, labels: ["h", "c", "g"] }, - apple: { channels: 3, labels: ["r16", "g16", "b16"] }, - gray: { channels: 1, labels: ["gray"] } - }; - module2.exports = convert; - for (const model of Object.keys(convert)) { - if (!("channels" in convert[model])) { - throw new Error("missing channels property: " + model); - } - if (!("labels" in convert[model])) { - throw new Error("missing channel labels property: " + model); - } - if (convert[model].labels.length !== convert[model].channels) { - throw new Error("channel and label counts mismatch: " + model); - } - const { channels, labels } = convert[model]; - delete convert[model].channels; - delete convert[model].labels; - Object.defineProperty(convert[model], "channels", { value: channels }); - Object.defineProperty(convert[model], "labels", { value: labels }); - } - convert.rgb.hsl = function(rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const min = Math.min(r, g, b); - const max = Math.max(r, g, b); - const delta = max - min; - let h; - let s; - if (max === min) { - h = 0; - } else if (r === max) { - h = (g - b) / delta; - } else if (g === max) { - h = 2 + (b - r) / delta; - } else if (b === max) { - h = 4 + (r - g) / delta; - } - h = Math.min(h * 60, 360); - if (h < 0) { - h += 360; - } - const l = (min + max) / 2; - if (max === min) { - s = 0; - } else if (l <= 0.5) { - s = delta / (max + min); - } else { - s = delta / (2 - max - min); - } - return [h, s * 100, l * 100]; - }; - convert.rgb.hsv = function(rgb) { - let rdif; - let gdif; - let bdif; - let h; - let s; - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const v = Math.max(r, g, b); - const diff = v - Math.min(r, g, b); - const diffc = function(c) { - return (v - c) / 6 / diff + 1 / 2; - }; - if (diff === 0) { - h = 0; - s = 0; - } else { - s = diff / v; - rdif = diffc(r); - gdif = diffc(g); - bdif = diffc(b); - if (r === v) { - h = bdif - gdif; - } else if (g === v) { - h = 1 / 3 + rdif - bdif; - } else if (b === v) { - h = 2 / 3 + gdif - rdif; - } - if (h < 0) { - h += 1; - } else if (h > 1) { - h -= 1; - } - } - return [ - h * 360, - s * 100, - v * 100 - ]; - }; - convert.rgb.hwb = function(rgb) { - const r = rgb[0]; - const g = rgb[1]; - let b = rgb[2]; - const h = convert.rgb.hsl(rgb)[0]; - const w = 1 / 255 * Math.min(r, Math.min(g, b)); - b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); - return [h, w * 100, b * 100]; - }; - convert.rgb.cmyk = function(rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const k = Math.min(1 - r, 1 - g, 1 - b); - const c = (1 - r - k) / (1 - k) || 0; - const m = (1 - g - k) / (1 - k) || 0; - const y = (1 - b - k) / (1 - k) || 0; - return [c * 100, m * 100, y * 100, k * 100]; - }; - function comparativeDistance(x, y) { - return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2; - } - convert.rgb.keyword = function(rgb) { - const reversed = reverseKeywords[rgb]; - if (reversed) { - return reversed; - } - let currentClosestDistance = Infinity; - let currentClosestKeyword; - for (const keyword of Object.keys(cssKeywords)) { - const value = cssKeywords[keyword]; - const distance = comparativeDistance(rgb, value); - if (distance < currentClosestDistance) { - currentClosestDistance = distance; - currentClosestKeyword = keyword; - } - } - return currentClosestKeyword; - }; - convert.keyword.rgb = function(keyword) { - return cssKeywords[keyword]; - }; - convert.rgb.xyz = function(rgb) { - let r = rgb[0] / 255; - let g = rgb[1] / 255; - let b = rgb[2] / 255; - r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92; - g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92; - b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92; - const x = r * 0.4124 + g * 0.3576 + b * 0.1805; - const y = r * 0.2126 + g * 0.7152 + b * 0.0722; - const z = r * 0.0193 + g * 0.1192 + b * 0.9505; - return [x * 100, y * 100, z * 100]; - }; - convert.rgb.lab = function(rgb) { - const xyz = convert.rgb.xyz(rgb); - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; - x /= 95.047; - y /= 100; - z /= 108.883; - x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116; - y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116; - z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116; - const l = 116 * y - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); - return [l, a, b]; - }; - convert.hsl.rgb = function(hsl) { - const h = hsl[0] / 360; - const s = hsl[1] / 100; - const l = hsl[2] / 100; - let t2; - let t3; - let val; - if (s === 0) { - val = l * 255; - return [val, val, val]; - } - if (l < 0.5) { - t2 = l * (1 + s); - } else { - t2 = l + s - l * s; - } - const t1 = 2 * l - t2; - const rgb = [0, 0, 0]; - for (let i = 0; i < 3; i++) { - t3 = h + 1 / 3 * -(i - 1); - if (t3 < 0) { - t3++; - } - if (t3 > 1) { - t3--; - } - if (6 * t3 < 1) { - val = t1 + (t2 - t1) * 6 * t3; - } else if (2 * t3 < 1) { - val = t2; - } else if (3 * t3 < 2) { - val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; - } else { - val = t1; - } - rgb[i] = val * 255; - } - return rgb; - }; - convert.hsl.hsv = function(hsl) { - const h = hsl[0]; - let s = hsl[1] / 100; - let l = hsl[2] / 100; - let smin = s; - const lmin = Math.max(l, 0.01); - l *= 2; - s *= l <= 1 ? l : 2 - l; - smin *= lmin <= 1 ? lmin : 2 - lmin; - const v = (l + s) / 2; - const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s); - return [h, sv * 100, v * 100]; - }; - convert.hsv.rgb = function(hsv) { - const h = hsv[0] / 60; - const s = hsv[1] / 100; - let v = hsv[2] / 100; - const hi = Math.floor(h) % 6; - const f = h - Math.floor(h); - const p = 255 * v * (1 - s); - const q = 255 * v * (1 - s * f); - const t = 255 * v * (1 - s * (1 - f)); - v *= 255; - switch (hi) { - case 0: - return [v, t, p]; - case 1: - return [q, v, p]; - case 2: - return [p, v, t]; - case 3: - return [p, q, v]; - case 4: - return [t, p, v]; - case 5: - return [v, p, q]; - } - }; - convert.hsv.hsl = function(hsv) { - const h = hsv[0]; - const s = hsv[1] / 100; - const v = hsv[2] / 100; - const vmin = Math.max(v, 0.01); - let sl; - let l; - l = (2 - s) * v; - const lmin = (2 - s) * vmin; - sl = s * vmin; - sl /= lmin <= 1 ? lmin : 2 - lmin; - sl = sl || 0; - l /= 2; - return [h, sl * 100, l * 100]; - }; - convert.hwb.rgb = function(hwb) { - const h = hwb[0] / 360; - let wh = hwb[1] / 100; - let bl = hwb[2] / 100; - const ratio = wh + bl; - let f; - if (ratio > 1) { - wh /= ratio; - bl /= ratio; - } - const i = Math.floor(6 * h); - const v = 1 - bl; - f = 6 * h - i; - if ((i & 1) !== 0) { - f = 1 - f; - } - const n = wh + f * (v - wh); - let r; - let g; - let b; - switch (i) { - default: - case 6: - case 0: - r = v; - g = n; - b = wh; - break; - case 1: - r = n; - g = v; - b = wh; - break; - case 2: - r = wh; - g = v; - b = n; - break; - case 3: - r = wh; - g = n; - b = v; - break; - case 4: - r = n; - g = wh; - b = v; - break; - case 5: - r = v; - g = wh; - b = n; - break; - } - return [r * 255, g * 255, b * 255]; - }; - convert.cmyk.rgb = function(cmyk) { - const c = cmyk[0] / 100; - const m = cmyk[1] / 100; - const y = cmyk[2] / 100; - const k = cmyk[3] / 100; - const r = 1 - Math.min(1, c * (1 - k) + k); - const g = 1 - Math.min(1, m * (1 - k) + k); - const b = 1 - Math.min(1, y * (1 - k) + k); - return [r * 255, g * 255, b * 255]; - }; - convert.xyz.rgb = function(xyz) { - const x = xyz[0] / 100; - const y = xyz[1] / 100; - const z = xyz[2] / 100; - let r; - let g; - let b; - r = x * 3.2406 + y * -1.5372 + z * -0.4986; - g = x * -0.9689 + y * 1.8758 + z * 0.0415; - b = x * 0.0557 + y * -0.204 + z * 1.057; - r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92; - g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92; - b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92; - r = Math.min(Math.max(0, r), 1); - g = Math.min(Math.max(0, g), 1); - b = Math.min(Math.max(0, b), 1); - return [r * 255, g * 255, b * 255]; - }; - convert.xyz.lab = function(xyz) { - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; - x /= 95.047; - y /= 100; - z /= 108.883; - x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116; - y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116; - z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116; - const l = 116 * y - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); - return [l, a, b]; - }; - convert.lab.xyz = function(lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let x; - let y; - let z; - y = (l + 16) / 116; - x = a / 500 + y; - z = y - b / 200; - const y2 = y ** 3; - const x2 = x ** 3; - const z2 = z ** 3; - y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787; - x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787; - z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787; - x *= 95.047; - y *= 100; - z *= 108.883; - return [x, y, z]; - }; - convert.lab.lch = function(lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let h; - const hr = Math.atan2(b, a); - h = hr * 360 / 2 / Math.PI; - if (h < 0) { - h += 360; - } - const c = Math.sqrt(a * a + b * b); - return [l, c, h]; - }; - convert.lch.lab = function(lch) { - const l = lch[0]; - const c = lch[1]; - const h = lch[2]; - const hr = h / 360 * 2 * Math.PI; - const a = c * Math.cos(hr); - const b = c * Math.sin(hr); - return [l, a, b]; - }; - convert.rgb.ansi16 = function(args, saturation = null) { - const [r, g, b] = args; - let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; - value = Math.round(value / 50); - if (value === 0) { - return 30; - } - let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255)); - if (value === 2) { - ansi += 60; - } - return ansi; - }; - convert.hsv.ansi16 = function(args) { - return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); - }; - convert.rgb.ansi256 = function(args) { - const r = args[0]; - const g = args[1]; - const b = args[2]; - if (r === g && g === b) { - if (r < 8) { - return 16; - } - if (r > 248) { - return 231; - } - return Math.round((r - 8) / 247 * 24) + 232; - } - const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5); - return ansi; - }; - convert.ansi16.rgb = function(args) { - let color = args % 10; - if (color === 0 || color === 7) { - if (args > 50) { - color += 3.5; - } - color = color / 10.5 * 255; - return [color, color, color]; - } - const mult = (~~(args > 50) + 1) * 0.5; - const r = (color & 1) * mult * 255; - const g = (color >> 1 & 1) * mult * 255; - const b = (color >> 2 & 1) * mult * 255; - return [r, g, b]; - }; - convert.ansi256.rgb = function(args) { - if (args >= 232) { - const c = (args - 232) * 10 + 8; - return [c, c, c]; - } - args -= 16; - let rem; - const r = Math.floor(args / 36) / 5 * 255; - const g = Math.floor((rem = args % 36) / 6) / 5 * 255; - const b = rem % 6 / 5 * 255; - return [r, g, b]; - }; - convert.rgb.hex = function(args) { - const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255); - const string = integer.toString(16).toUpperCase(); - return "000000".substring(string.length) + string; - }; - convert.hex.rgb = function(args) { - const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); - if (!match) { - return [0, 0, 0]; - } - let colorString = match[0]; - if (match[0].length === 3) { - colorString = colorString.split("").map((char) => { - return char + char; - }).join(""); - } - const integer = parseInt(colorString, 16); - const r = integer >> 16 & 255; - const g = integer >> 8 & 255; - const b = integer & 255; - return [r, g, b]; - }; - convert.rgb.hcg = function(rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const max = Math.max(Math.max(r, g), b); - const min = Math.min(Math.min(r, g), b); - const chroma = max - min; - let grayscale; - let hue; - if (chroma < 1) { - grayscale = min / (1 - chroma); - } else { - grayscale = 0; - } - if (chroma <= 0) { - hue = 0; - } else if (max === r) { - hue = (g - b) / chroma % 6; - } else if (max === g) { - hue = 2 + (b - r) / chroma; - } else { - hue = 4 + (r - g) / chroma; - } - hue /= 6; - hue %= 1; - return [hue * 360, chroma * 100, grayscale * 100]; - }; - convert.hsl.hcg = function(hsl) { - const s = hsl[1] / 100; - const l = hsl[2] / 100; - const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l); - let f = 0; - if (c < 1) { - f = (l - 0.5 * c) / (1 - c); - } - return [hsl[0], c * 100, f * 100]; - }; - convert.hsv.hcg = function(hsv) { - const s = hsv[1] / 100; - const v = hsv[2] / 100; - const c = s * v; - let f = 0; - if (c < 1) { - f = (v - c) / (1 - c); - } - return [hsv[0], c * 100, f * 100]; - }; - convert.hcg.rgb = function(hcg) { - const h = hcg[0] / 360; - const c = hcg[1] / 100; - const g = hcg[2] / 100; - if (c === 0) { - return [g * 255, g * 255, g * 255]; - } - const pure = [0, 0, 0]; - const hi = h % 1 * 6; - const v = hi % 1; - const w = 1 - v; - let mg = 0; - switch (Math.floor(hi)) { - case 0: - pure[0] = 1; - pure[1] = v; - pure[2] = 0; - break; - case 1: - pure[0] = w; - pure[1] = 1; - pure[2] = 0; - break; - case 2: - pure[0] = 0; - pure[1] = 1; - pure[2] = v; - break; - case 3: - pure[0] = 0; - pure[1] = w; - pure[2] = 1; - break; - case 4: - pure[0] = v; - pure[1] = 0; - pure[2] = 1; - break; - default: - pure[0] = 1; - pure[1] = 0; - pure[2] = w; - } - mg = (1 - c) * g; - return [ - (c * pure[0] + mg) * 255, - (c * pure[1] + mg) * 255, - (c * pure[2] + mg) * 255 - ]; - }; - convert.hcg.hsv = function(hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - const v = c + g * (1 - c); - let f = 0; - if (v > 0) { - f = c / v; - } - return [hcg[0], f * 100, v * 100]; - }; - convert.hcg.hsl = function(hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - const l = g * (1 - c) + 0.5 * c; - let s = 0; - if (l > 0 && l < 0.5) { - s = c / (2 * l); - } else if (l >= 0.5 && l < 1) { - s = c / (2 * (1 - l)); - } - return [hcg[0], s * 100, l * 100]; - }; - convert.hcg.hwb = function(hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - const v = c + g * (1 - c); - return [hcg[0], (v - c) * 100, (1 - v) * 100]; - }; - convert.hwb.hcg = function(hwb) { - const w = hwb[1] / 100; - const b = hwb[2] / 100; - const v = 1 - b; - const c = v - w; - let g = 0; - if (c < 1) { - g = (v - c) / (1 - c); - } - return [hwb[0], c * 100, g * 100]; - }; - convert.apple.rgb = function(apple) { - return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255]; - }; - convert.rgb.apple = function(rgb) { - return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535]; - }; - convert.gray.rgb = function(args) { - return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; - }; - convert.gray.hsl = function(args) { - return [0, 0, args[0]]; - }; - convert.gray.hsv = convert.gray.hsl; - convert.gray.hwb = function(gray) { - return [0, 100, gray[0]]; - }; - convert.gray.cmyk = function(gray) { - return [0, 0, 0, gray[0]]; - }; - convert.gray.lab = function(gray) { - return [gray[0], 0, 0]; - }; - convert.gray.hex = function(gray) { - const val = Math.round(gray[0] / 100 * 255) & 255; - const integer = (val << 16) + (val << 8) + val; - const string = integer.toString(16).toUpperCase(); - return "000000".substring(string.length) + string; - }; - convert.rgb.gray = function(rgb) { - const val = (rgb[0] + rgb[1] + rgb[2]) / 3; - return [val / 255 * 100]; - }; - } -}); - -// node_modules/color-convert/route.js -var require_route3 = __commonJS({ - "node_modules/color-convert/route.js"(exports, module2) { - var conversions = require_conversions3(); - function buildGraph() { - const graph = {}; - const models = Object.keys(conversions); - for (let len = models.length, i = 0; i < len; i++) { - graph[models[i]] = { - // http://jsperf.com/1-vs-infinity - // micro-opt, but this is simple. - distance: -1, - parent: null - }; - } - return graph; - } - function deriveBFS(fromModel) { - const graph = buildGraph(); - const queue = [fromModel]; - graph[fromModel].distance = 0; - while (queue.length) { - const current = queue.pop(); - const adjacents = Object.keys(conversions[current]); - for (let len = adjacents.length, i = 0; i < len; i++) { - const adjacent = adjacents[i]; - const node = graph[adjacent]; - if (node.distance === -1) { - node.distance = graph[current].distance + 1; - node.parent = current; - queue.unshift(adjacent); - } - } - } - return graph; - } - function link(from, to) { - return function(args) { - return to(from(args)); - }; - } - function wrapConversion(toModel, graph) { - const path16 = [graph[toModel].parent, toModel]; - let fn = conversions[graph[toModel].parent][toModel]; - let cur = graph[toModel].parent; - while (graph[cur].parent) { - path16.unshift(graph[cur].parent); - fn = link(conversions[graph[cur].parent][cur], fn); - cur = graph[cur].parent; - } - fn.conversion = path16; - return fn; - } - module2.exports = function(fromModel) { - const graph = deriveBFS(fromModel); - const conversion = {}; - const models = Object.keys(graph); - for (let len = models.length, i = 0; i < len; i++) { - const toModel = models[i]; - const node = graph[toModel]; - if (node.parent === null) { - continue; - } - conversion[toModel] = wrapConversion(toModel, graph); - } - return conversion; - }; - } -}); - -// node_modules/color-convert/index.js -var require_color_convert3 = __commonJS({ - "node_modules/color-convert/index.js"(exports, module2) { - var conversions = require_conversions3(); - var route = require_route3(); - var convert = {}; - var models = Object.keys(conversions); - function wrapRaw(fn) { - const wrappedFn = function(...args) { - const arg0 = args[0]; - if (arg0 === void 0 || arg0 === null) { - return arg0; - } - if (arg0.length > 1) { - args = arg0; - } - return fn(args); - }; - if ("conversion" in fn) { - wrappedFn.conversion = fn.conversion; - } - return wrappedFn; - } - function wrapRounded(fn) { - const wrappedFn = function(...args) { - const arg0 = args[0]; - if (arg0 === void 0 || arg0 === null) { - return arg0; - } - if (arg0.length > 1) { - args = arg0; - } - const result = fn(args); - if (typeof result === "object") { - for (let len = result.length, i = 0; i < len; i++) { - result[i] = Math.round(result[i]); - } - } - return result; - }; - if ("conversion" in fn) { - wrappedFn.conversion = fn.conversion; - } - return wrappedFn; - } - models.forEach((fromModel) => { - convert[fromModel] = {}; - Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels }); - Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels }); - const routes = route(fromModel); - const routeModels = Object.keys(routes); - routeModels.forEach((toModel) => { - const fn = routes[toModel]; - convert[fromModel][toModel] = wrapRounded(fn); - convert[fromModel][toModel].raw = wrapRaw(fn); - }); - }); - module2.exports = convert; - } -}); - -// node_modules/ansi-styles/index.js -var require_ansi_styles3 = __commonJS({ - "node_modules/ansi-styles/index.js"(exports, module2) { - "use strict"; - var wrapAnsi16 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\x1B[${code + offset}m`; - }; - var wrapAnsi256 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\x1B[${38 + offset};5;${code}m`; - }; - var wrapAnsi16m = (fn, offset) => (...args) => { - const rgb = fn(...args); - return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; - }; - var ansi2ansi = (n) => n; - var rgb2rgb = (r, g, b) => [r, g, b]; - var setLazyProperty = (object, property, get) => { - Object.defineProperty(object, property, { - get: () => { - const value = get(); - Object.defineProperty(object, property, { - value, - enumerable: true, - configurable: true - }); - return value; - }, - enumerable: true, - configurable: true - }); - }; - var colorConvert; - var makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { - if (colorConvert === void 0) { - colorConvert = require_color_convert3(); - } - const offset = isBackground ? 10 : 0; - const styles = {}; - for (const [sourceSpace, suite] of Object.entries(colorConvert)) { - const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace; - if (sourceSpace === targetSpace) { - styles[name] = wrap(identity, offset); - } else if (typeof suite === "object") { - styles[name] = wrap(suite[targetSpace], offset); - } - } - return styles; - }; - function assembleStyles() { - const codes2 = /* @__PURE__ */ new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - // Bright color - blackBright: [90, 39], - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - styles.color.gray = styles.color.blackBright; - styles.bgColor.bgGray = styles.bgColor.bgBlackBright; - styles.color.grey = styles.color.blackBright; - styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; - for (const [groupName, group] of Object.entries(styles)) { - for (const [styleName, style] of Object.entries(group)) { - styles[styleName] = { - open: `\x1B[${style[0]}m`, - close: `\x1B[${style[1]}m` - }; - group[styleName] = styles[styleName]; - codes2.set(style[0], style[1]); - } - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - } - Object.defineProperty(styles, "codes", { - value: codes2, - enumerable: false - }); - styles.color.close = "\x1B[39m"; - styles.bgColor.close = "\x1B[49m"; - setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false)); - setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false)); - setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false)); - setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true)); - setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true)); - setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true)); - return styles; - } - Object.defineProperty(module2, "exports", { - enumerable: true, - get: assembleStyles - }); - } -}); - -// node_modules/has-flag/index.js -var require_has_flag3 = __commonJS({ - "node_modules/has-flag/index.js"(exports, module2) { - "use strict"; - module2.exports = (flag, argv = process.argv) => { - const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf("--"); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); - }; - } -}); - -// node_modules/supports-color/index.js -var require_supports_color3 = __commonJS({ - "node_modules/supports-color/index.js"(exports, module2) { - "use strict"; - var os = require("os"); - var tty = require("tty"); - var hasFlag = require_has_flag3(); - var { env } = process; - var forceColor; - if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { - forceColor = 0; - } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { - forceColor = 1; - } - if ("FORCE_COLOR" in env) { - if (env.FORCE_COLOR === "true") { - forceColor = 1; - } else if (env.FORCE_COLOR === "false") { - forceColor = 0; - } else { - forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); - } - } - function translateLevel(level) { - if (level === 0) { - return false; - } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; - } - function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; - } - if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { - return 3; - } - if (hasFlag("color=256")) { - return 2; - } - if (haveStream && !streamIsTTY && forceColor === void 0) { - return 0; - } - const min = forceColor || 0; - if (env.TERM === "dumb") { - return min; - } - if (process.platform === "win32") { - const osRelease = os.release().split("."); - if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - return 1; - } - if ("CI" in env) { - if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { - return 1; - } - return min; - } - if ("TEAMCITY_VERSION" in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - if (env.COLORTERM === "truecolor") { - return 3; - } - if ("TERM_PROGRAM" in env) { - const version3 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch (env.TERM_PROGRAM) { - case "iTerm.app": - return version3 >= 3 ? 3 : 2; - case "Apple_Terminal": - return 2; - } - } - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } - if ("COLORTERM" in env) { - return 1; - } - return min; - } - function getSupportLevel(stream) { - const level = supportsColor(stream, stream && stream.isTTY); - return translateLevel(level); - } - module2.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) - }; - } -}); - -// node_modules/chalk/source/util.js -var require_util10 = __commonJS({ - "node_modules/chalk/source/util.js"(exports, module2) { - "use strict"; - var stringReplaceAll = (string, substring, replacer) => { - let index = string.indexOf(substring); - if (index === -1) { - return string; - } - const substringLength = substring.length; - let endIndex = 0; - let returnValue = ""; - do { - returnValue += string.substr(endIndex, index - endIndex) + substring + replacer; - endIndex = index + substringLength; - index = string.indexOf(substring, endIndex); - } while (index !== -1); - returnValue += string.substr(endIndex); - return returnValue; - }; - var stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => { - let endIndex = 0; - let returnValue = ""; - do { - const gotCR = string[index - 1] === "\r"; - returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix; - endIndex = index + 1; - index = string.indexOf("\n", endIndex); - } while (index !== -1); - returnValue += string.substr(endIndex); - return returnValue; - }; - module2.exports = { - stringReplaceAll, - stringEncaseCRLFWithFirstIndex - }; - } -}); - -// node_modules/chalk/source/templates.js -var require_templates3 = __commonJS({ - "node_modules/chalk/source/templates.js"(exports, module2) { - "use strict"; - var TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; - var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; - var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; - var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi; - var ESCAPES = /* @__PURE__ */ new Map([ - ["n", "\n"], - ["r", "\r"], - ["t", " "], - ["b", "\b"], - ["f", "\f"], - ["v", "\v"], - ["0", "\0"], - ["\\", "\\"], - ["e", "\x1B"], - ["a", "\x07"] - ]); - function unescape2(c) { - const u = c[0] === "u"; - const bracket = c[1] === "{"; - if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) { - return String.fromCharCode(parseInt(c.slice(1), 16)); - } - if (u && bracket) { - return String.fromCodePoint(parseInt(c.slice(2, -1), 16)); - } - return ESCAPES.get(c) || c; - } - function parseArguments(name, arguments_) { - const results = []; - const chunks = arguments_.trim().split(/\s*,\s*/g); - let matches; - for (const chunk of chunks) { - const number = Number(chunk); - if (!Number.isNaN(number)) { - results.push(number); - } else if (matches = chunk.match(STRING_REGEX)) { - results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape2(escape) : character)); - } else { - throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); - } - } - return results; - } - function parseStyle(style) { - STYLE_REGEX.lastIndex = 0; - const results = []; - let matches; - while ((matches = STYLE_REGEX.exec(style)) !== null) { - const name = matches[1]; - if (matches[2]) { - const args = parseArguments(name, matches[2]); - results.push([name].concat(args)); - } else { - results.push([name]); - } - } - return results; - } - function buildStyle(chalk3, styles) { - const enabled = {}; - for (const layer of styles) { - for (const style of layer.styles) { - enabled[style[0]] = layer.inverse ? null : style.slice(1); - } - } - let current = chalk3; - for (const [styleName, styles2] of Object.entries(enabled)) { - if (!Array.isArray(styles2)) { - continue; - } - if (!(styleName in current)) { - throw new Error(`Unknown Chalk style: ${styleName}`); - } - current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName]; - } - return current; - } - module2.exports = (chalk3, temporary) => { - const styles = []; - const chunks = []; - let chunk = []; - temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => { - if (escapeCharacter) { - chunk.push(unescape2(escapeCharacter)); - } else if (style) { - const string = chunk.join(""); - chunk = []; - chunks.push(styles.length === 0 ? string : buildStyle(chalk3, styles)(string)); - styles.push({ inverse, styles: parseStyle(style) }); - } else if (close) { - if (styles.length === 0) { - throw new Error("Found extraneous } in Chalk template literal"); - } - chunks.push(buildStyle(chalk3, styles)(chunk.join(""))); - chunk = []; - styles.pop(); - } else { - chunk.push(character); - } - }); - chunks.push(chunk.join("")); - if (styles.length > 0) { - const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`; - throw new Error(errMessage); - } - return chunks.join(""); - }; - } -}); - -// node_modules/chalk/source/index.js -var require_source = __commonJS({ - "node_modules/chalk/source/index.js"(exports, module2) { - "use strict"; - var ansiStyles = require_ansi_styles3(); - var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color3(); - var { - stringReplaceAll, - stringEncaseCRLFWithFirstIndex - } = require_util10(); - var { isArray } = Array; - var levelMapping = [ - "ansi", - "ansi", - "ansi256", - "ansi16m" - ]; - var styles = /* @__PURE__ */ Object.create(null); - var applyOptions = (object, options = {}) => { - if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { - throw new Error("The `level` option should be an integer from 0 to 3"); - } - const colorLevel = stdoutColor ? stdoutColor.level : 0; - object.level = options.level === void 0 ? colorLevel : options.level; - }; - var ChalkClass = class { - constructor(options) { - return chalkFactory(options); - } - }; - var chalkFactory = (options) => { - const chalk4 = {}; - applyOptions(chalk4, options); - chalk4.template = (...arguments_) => chalkTag(chalk4.template, ...arguments_); - Object.setPrototypeOf(chalk4, Chalk.prototype); - Object.setPrototypeOf(chalk4.template, chalk4); - chalk4.template.constructor = () => { - throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead."); - }; - chalk4.template.Instance = ChalkClass; - return chalk4.template; - }; - function Chalk(options) { - return chalkFactory(options); - } - for (const [styleName, style] of Object.entries(ansiStyles)) { - styles[styleName] = { - get() { - const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty); - Object.defineProperty(this, styleName, { value: builder }); - return builder; - } - }; - } - styles.visible = { - get() { - const builder = createBuilder(this, this._styler, true); - Object.defineProperty(this, "visible", { value: builder }); - return builder; - } - }; - var usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"]; - for (const model of usedModels) { - styles[model] = { - get() { - const { level } = this; - return function(...arguments_) { - const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler); - return createBuilder(this, styler, this._isEmpty); - }; - } - }; - } - for (const model of usedModels) { - const bgModel = "bg" + model[0].toUpperCase() + model.slice(1); - styles[bgModel] = { - get() { - const { level } = this; - return function(...arguments_) { - const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler); - return createBuilder(this, styler, this._isEmpty); - }; - } - }; - } - var proto = Object.defineProperties(() => { - }, { - ...styles, - level: { - enumerable: true, - get() { - return this._generator.level; - }, - set(level) { - this._generator.level = level; - } - } - }); - var createStyler = (open, close, parent) => { - let openAll; - let closeAll; - if (parent === void 0) { - openAll = open; - closeAll = close; - } else { - openAll = parent.openAll + open; - closeAll = close + parent.closeAll; - } - return { - open, - close, - openAll, - closeAll, - parent - }; - }; - var createBuilder = (self, _styler, _isEmpty) => { - const builder = (...arguments_) => { - if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) { - return applyStyle(builder, chalkTag(builder, ...arguments_)); - } - return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" ")); - }; - Object.setPrototypeOf(builder, proto); - builder._generator = self; - builder._styler = _styler; - builder._isEmpty = _isEmpty; - return builder; - }; - var applyStyle = (self, string) => { - if (self.level <= 0 || !string) { - return self._isEmpty ? "" : string; - } - let styler = self._styler; - if (styler === void 0) { - return string; - } - const { openAll, closeAll } = styler; - if (string.indexOf("\x1B") !== -1) { - while (styler !== void 0) { - string = stringReplaceAll(string, styler.close, styler.open); - styler = styler.parent; - } - } - const lfIndex = string.indexOf("\n"); - if (lfIndex !== -1) { - string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); - } - return openAll + string + closeAll; - }; - var template2; - var chalkTag = (chalk4, ...strings) => { - const [firstString] = strings; - if (!isArray(firstString) || !isArray(firstString.raw)) { - return strings.join(" "); - } - const arguments_ = strings.slice(1); - const parts = [firstString.raw[0]]; - for (let i = 1; i < firstString.length; i++) { - parts.push( - String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"), - String(firstString.raw[i]) - ); - } - if (template2 === void 0) { - template2 = require_templates3(); - } - return template2(chalk4, parts.join("")); - }; - Object.defineProperties(Chalk.prototype, styles); - var chalk3 = Chalk(); - chalk3.supportsColor = stdoutColor; - chalk3.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 }); - chalk3.stderr.supportsColor = stderrColor; - module2.exports = chalk3; - } -}); - -// node_modules/cspell/dist/lib/uri.cjs -var require_uri = __commonJS({ - "node_modules/cspell/dist/lib/uri.cjs"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Utils = exports.URI = void 0; - var vscode_uri_1 = require_umd(); - Object.defineProperty(exports, "URI", { enumerable: true, get: function() { - return vscode_uri_1.URI; - } }); - Object.defineProperty(exports, "Utils", { enumerable: true, get: function() { - return vscode_uri_1.Utils; - } }); - } -}); - -// node_modules/cspell/package.json -var require_package = __commonJS({ - "node_modules/cspell/package.json"(exports, module2) { - module2.exports = { - name: "cspell", - version: "6.31.3", - description: "A Spelling Checker for Code!", - funding: "https://github.com/streetsidesoftware/cspell?sponsor=1", - bin: { - cspell: "bin.js", - "cspell-esm": "bin.mjs" - }, - type: "commonjs", - main: "dist/cjs/index.js", - types: "dist/cjs/index.d.ts", - module: "dist/esm/index.mjs", - exports: { - ".": { - import: "./dist/esm/index.mjs", - require: "./dist/cjs/index.js" - }, - "./app": { - import: "./dist/esm/app.mjs", - require: "./dist/cjs/app.js" - }, - "./bin": { - import: "./bin.mjs", - require: "./bin.js" - }, - "./application": { - import: "./dist/esm/application.mjs", - require: "./dist/cjs/application.js" - } - }, - files: [ - "bin.js", - "bin.mjs", - "dist", - "!dist/esm/**/*.js", - "!dist/esm/**/*.ts", - "!**/*.tsbuildInfo", - "!**/__mocks__", - "!**/test/**", - "!**/*.test.*", - "!**/*.spec.*", - "!**/*.map" - ], - scripts: { - clean: "shx rm -rf dist coverage temp .tsbuildinfo", - build: "tsc -b . && ts2mjs dist/esm && pnpm run build:api", - "build:api": "rollup -c rollup.config.mjs", - "build:cjs": "tsc -b tsconfig.cjs.json", - "build:esm": "tsc -b tsconfig.esm.json", - "build:esm:ts2mjs": "tsc -b tsconfig.esm.json && ts2mjs dist/esm", - "build:lib": "tsc -b src/lib/tsconfig.json", - "build:readme": "pnpm build:readme:help", - "build:readme:help": "pnpm build:readme:help:lint && pnpm build:readme:help:trace && inject-markdown README.md && prettier -w README.md", - "build:readme:help:lint": "./bin.js lint --help > static/help-lint.txt", - "build:readme:help:trace": "./bin.js trace --help > static/help-trace.txt", - "clean-build": "pnpm run clean && pnpm run build", - coverage: "pnpm coverage:vitest && pnpm coverage:fix", - "coverage:vitest": "vitest run --coverage", - "coverage:fix": 'nyc report --temp-dir "$(pwd)/coverage" --reporter lcov --report-dir "$(pwd)/coverage" --cwd ../..', - "test:watch": "vitest", - test: "vitest run", - watch: "tsc -b . -w", - compile: "tsc -p .", - "test-watch": "vitest", - prepublishOnly: "pnpm run clean-build", - "test:update-snapshot": "vitest run --update" - }, - repository: { - type: "git", - url: "git+https://github.com/streetsidesoftware/cspell.git" - }, - keywords: [ - "spell", - "checker", - "code", - "camel", - "case", - "spelling", - "spell checker", - "spelling checker", - "lint" - ], - author: "Jason Dent", - license: "MIT", - bugs: { - url: "https://github.com/streetsidesoftware/cspell/issues" - }, - homepage: "https://streetsidesoftware.github.io/cspell/", - dependencies: { - "@cspell/cspell-json-reporter": "6.31.3", - "@cspell/cspell-pipe": "6.31.3", - "@cspell/cspell-types": "6.31.3", - "@cspell/dynamic-import": "6.31.3", - chalk: "^4.1.2", - commander: "^10.0.0", - "cspell-gitignore": "6.31.3", - "cspell-glob": "6.31.3", - "cspell-io": "6.31.3", - "cspell-lib": "6.31.3", - "fast-glob": "^3.2.12", - "fast-json-stable-stringify": "^2.1.0", - "file-entry-cache": "^6.0.1", - "get-stdin": "^8.0.0", - imurmurhash: "^0.1.4", - semver: "^7.3.8", - "strip-ansi": "^6.0.1", - "vscode-uri": "^3.0.7" - }, - engines: { - node: ">=14" - }, - devDependencies: { - "@types/file-entry-cache": "^5.0.2", - "@types/glob": "^8.1.0", - "@types/imurmurhash": "^0.1.1", - "@types/micromatch": "^4.0.2", - "@types/semver": "^7.3.13", - micromatch: "^4.0.5", - minimatch: "^7.4.4" - }, - gitHead: "0e8ca7b32f21aea40ade645172ef93017e6a143d" - }; - } -}); - -// node_modules/cspell/dist/lib/pkgInfo.cjs -var require_pkgInfo = __commonJS({ - "node_modules/cspell/dist/lib/pkgInfo.cjs"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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.npmPackage = exports.pkgDir = void 0; - var path16 = __importStar(require("path")); - exports.pkgDir = path16.join(__dirname, "../.."); - exports.npmPackage = require_package(); - } -}); - -// node_modules/get-stdin/index.js -var require_get_stdin = __commonJS({ - "node_modules/get-stdin/index.js"(exports, module2) { - "use strict"; - var { stdin } = process; - module2.exports = async () => { - let result = ""; - if (stdin.isTTY) { - return result; - } - stdin.setEncoding("utf8"); - for await (const chunk of stdin) { - result += chunk; - } - return result; - }; - module2.exports.buffer = async () => { - const result = []; - let length = 0; - if (stdin.isTTY) { - return Buffer.concat([]); - } - for await (const chunk of stdin) { - result.push(chunk); - length += chunk.length; - } - return Buffer.concat(result, length); - }; - } -}); - -// node_modules/fast-glob/out/utils/array.js -var require_array2 = __commonJS({ - "node_modules/fast-glob/out/utils/array.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.splitWhen = exports.flatten = void 0; - function flatten(items) { - return items.reduce((collection, item) => [].concat(collection, item), []); - } - exports.flatten = flatten; - function splitWhen(items, predicate) { - const result = [[]]; - let groupIndex = 0; - for (const item of items) { - if (predicate(item)) { - groupIndex++; - result[groupIndex] = []; - } else { - result[groupIndex].push(item); - } - } - return result; - } - exports.splitWhen = splitWhen; - } -}); - -// node_modules/fast-glob/out/utils/errno.js -var require_errno = __commonJS({ - "node_modules/fast-glob/out/utils/errno.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isEnoentCodeError = void 0; - function isEnoentCodeError(error2) { - return error2.code === "ENOENT"; - } - exports.isEnoentCodeError = isEnoentCodeError; - } -}); - -// node_modules/fast-glob/out/utils/fs.js -var require_fs = __commonJS({ - "node_modules/fast-glob/out/utils/fs.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createDirentFromStats = void 0; - var DirentFromStats = class { - constructor(name, stats) { - this.name = name; - this.isBlockDevice = stats.isBlockDevice.bind(stats); - this.isCharacterDevice = stats.isCharacterDevice.bind(stats); - this.isDirectory = stats.isDirectory.bind(stats); - this.isFIFO = stats.isFIFO.bind(stats); - this.isFile = stats.isFile.bind(stats); - this.isSocket = stats.isSocket.bind(stats); - this.isSymbolicLink = stats.isSymbolicLink.bind(stats); - } - }; - function createDirentFromStats(name, stats) { - return new DirentFromStats(name, stats); - } - exports.createDirentFromStats = createDirentFromStats; - } -}); - -// node_modules/fast-glob/out/utils/path.js -var require_path = __commonJS({ - "node_modules/fast-glob/out/utils/path.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0; - var os = require("os"); - var path16 = require("path"); - var IS_WINDOWS_PLATFORM = os.platform() === "win32"; - var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; - var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g; - var WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([(){}]|^!|[!+@](?=\())/g; - var DOS_DEVICE_PATH_RE = /^\\\\([.?])/; - var WINDOWS_BACKSLASHES_RE = /\\(?![!()+@{}])/g; - function unixify(filepath) { - return filepath.replace(/\\/g, "/"); - } - exports.unixify = unixify; - function makeAbsolute(cwd, filepath) { - return path16.resolve(cwd, filepath); - } - exports.makeAbsolute = makeAbsolute; - function removeLeadingDotSegment(entry) { - if (entry.charAt(0) === ".") { - const secondCharactery = entry.charAt(1); - if (secondCharactery === "/" || secondCharactery === "\\") { - return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT); - } - } - return entry; - } - exports.removeLeadingDotSegment = removeLeadingDotSegment; - exports.escape = IS_WINDOWS_PLATFORM ? escapeWindowsPath : escapePosixPath; - function escapeWindowsPath(pattern) { - return pattern.replace(WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2"); - } - exports.escapeWindowsPath = escapeWindowsPath; - function escapePosixPath(pattern) { - return pattern.replace(POSIX_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2"); - } - exports.escapePosixPath = escapePosixPath; - exports.convertPathToPattern = IS_WINDOWS_PLATFORM ? convertWindowsPathToPattern : convertPosixPathToPattern; - function convertWindowsPathToPattern(filepath) { - return escapeWindowsPath(filepath).replace(DOS_DEVICE_PATH_RE, "//$1").replace(WINDOWS_BACKSLASHES_RE, "/"); - } - exports.convertWindowsPathToPattern = convertWindowsPathToPattern; - function convertPosixPathToPattern(filepath) { - return escapePosixPath(filepath); - } - exports.convertPosixPathToPattern = convertPosixPathToPattern; - } -}); - -// node_modules/is-extglob/index.js -var require_is_extglob = __commonJS({ - "node_modules/is-extglob/index.js"(exports, module2) { - module2.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; - }; - } -}); - -// node_modules/is-glob/index.js -var require_is_glob = __commonJS({ - "node_modules/is-glob/index.js"(exports, module2) { - var isExtglob = require_is_extglob(); - 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; - }; - module2.exports = function isGlob(str, options) { - if (typeof str !== "string" || str === "") { - return false; - } - if (isExtglob(str)) { - return true; - } - var check = strictCheck; - if (options && options.strict === false) { - check = relaxedCheck; - } - return check(str); - }; - } -}); - -// node_modules/glob-parent/index.js -var require_glob_parent = __commonJS({ - "node_modules/glob-parent/index.js"(exports, module2) { - "use strict"; - var isGlob = require_is_glob(); - var pathPosixDirname = require("path").posix.dirname; - var isWin32 = require("os").platform() === "win32"; - var slash = "/"; - var backslash = /\\/g; - var enclosure = /[\{\[].*[\}\]]$/; - var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; - var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; - module2.exports = function globParent(str, opts) { - var options = Object.assign({ flipBackslashes: true }, opts); - if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { - str = str.replace(backslash, slash); - } - if (enclosure.test(str)) { - str += slash; - } - str += "a"; - do { - str = pathPosixDirname(str); - } while (isGlob(str) || globby.test(str)); - return str.replace(escaped, "$1"); - }; - } -}); - -// node_modules/fast-glob/out/utils/pattern.js -var require_pattern = __commonJS({ - "node_modules/fast-glob/out/utils/pattern.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0; - var path16 = require("path"); - var globParent = require_glob_parent(); - var micromatch = require_micromatch(); - var GLOBSTAR = "**"; - var ESCAPE_SYMBOL = "\\"; - var COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/; - var REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/; - var REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/; - var GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/; - var BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./; - var DOUBLE_SLASH_RE = /(?!^)\/{2,}/g; - function isStaticPattern(pattern, options = {}) { - return !isDynamicPattern(pattern, options); - } - exports.isStaticPattern = isStaticPattern; - function isDynamicPattern(pattern, options = {}) { - if (pattern === "") { - return false; - } - if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) { - return true; - } - if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) { - return true; - } - if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) { - return true; - } - if (options.braceExpansion !== false && hasBraceExpansion(pattern)) { - return true; - } - return false; - } - exports.isDynamicPattern = isDynamicPattern; - function hasBraceExpansion(pattern) { - const openingBraceIndex = pattern.indexOf("{"); - if (openingBraceIndex === -1) { - return false; - } - const closingBraceIndex = pattern.indexOf("}", openingBraceIndex + 1); - if (closingBraceIndex === -1) { - return false; - } - const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex); - return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent); - } - function convertToPositivePattern(pattern) { - return isNegativePattern(pattern) ? pattern.slice(1) : pattern; - } - exports.convertToPositivePattern = convertToPositivePattern; - function convertToNegativePattern(pattern) { - return "!" + pattern; - } - exports.convertToNegativePattern = convertToNegativePattern; - function isNegativePattern(pattern) { - return pattern.startsWith("!") && pattern[1] !== "("; - } - exports.isNegativePattern = isNegativePattern; - function isPositivePattern(pattern) { - return !isNegativePattern(pattern); - } - exports.isPositivePattern = isPositivePattern; - function getNegativePatterns(patterns) { - return patterns.filter(isNegativePattern); - } - exports.getNegativePatterns = getNegativePatterns; - function getPositivePatterns(patterns) { - return patterns.filter(isPositivePattern); - } - exports.getPositivePatterns = getPositivePatterns; - function getPatternsInsideCurrentDirectory(patterns) { - return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern)); - } - exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory; - function getPatternsOutsideCurrentDirectory(patterns) { - return patterns.filter(isPatternRelatedToParentDirectory); - } - exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory; - function isPatternRelatedToParentDirectory(pattern) { - return pattern.startsWith("..") || pattern.startsWith("./.."); - } - exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory; - function getBaseDirectory(pattern) { - return globParent(pattern, { flipBackslashes: false }); - } - exports.getBaseDirectory = getBaseDirectory; - function hasGlobStar(pattern) { - return pattern.includes(GLOBSTAR); - } - exports.hasGlobStar = hasGlobStar; - function endsWithSlashGlobStar(pattern) { - return pattern.endsWith("/" + GLOBSTAR); - } - exports.endsWithSlashGlobStar = endsWithSlashGlobStar; - function isAffectDepthOfReadingPattern(pattern) { - const basename3 = path16.basename(pattern); - return endsWithSlashGlobStar(pattern) || isStaticPattern(basename3); - } - exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; - function expandPatternsWithBraceExpansion(patterns) { - return patterns.reduce((collection, pattern) => { - return collection.concat(expandBraceExpansion(pattern)); - }, []); - } - exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion; - function expandBraceExpansion(pattern) { - const patterns = micromatch.braces(pattern, { expand: true, nodupes: true }); - patterns.sort((a, b) => a.length - b.length); - return patterns.filter((pattern2) => pattern2 !== ""); - } - exports.expandBraceExpansion = expandBraceExpansion; - function getPatternParts(pattern, options) { - let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true })); - if (parts.length === 0) { - parts = [pattern]; - } - if (parts[0].startsWith("/")) { - parts[0] = parts[0].slice(1); - parts.unshift(""); - } - return parts; - } - exports.getPatternParts = getPatternParts; - function makeRe(pattern, options) { - return micromatch.makeRe(pattern, options); - } - exports.makeRe = makeRe; - function convertPatternsToRe(patterns, options) { - return patterns.map((pattern) => makeRe(pattern, options)); - } - exports.convertPatternsToRe = convertPatternsToRe; - function matchAny(entry, patternsRe) { - return patternsRe.some((patternRe) => patternRe.test(entry)); - } - exports.matchAny = matchAny; - function removeDuplicateSlashes(pattern) { - return pattern.replace(DOUBLE_SLASH_RE, "/"); - } - exports.removeDuplicateSlashes = removeDuplicateSlashes; - } -}); - -// node_modules/merge2/index.js -var require_merge2 = __commonJS({ - "node_modules/merge2/index.js"(exports, module2) { - "use strict"; - var Stream3 = require("stream"); - var PassThrough2 = Stream3.PassThrough; - var slice = Array.prototype.slice; - module2.exports = merge2; - function merge2() { - const streamsQueue = []; - const args = slice.call(arguments); - let merging = false; - let options = args[args.length - 1]; - if (options && !Array.isArray(options) && options.pipe == null) { - args.pop(); - } else { - options = {}; - } - const doEnd = options.end !== false; - const doPipeError = options.pipeError === true; - if (options.objectMode == null) { - options.objectMode = true; - } - if (options.highWaterMark == null) { - options.highWaterMark = 64 * 1024; - } - const mergedStream = PassThrough2(options); - function addStream() { - for (let i = 0, len = arguments.length; i < len; i++) { - streamsQueue.push(pauseStreams(arguments[i], options)); - } - mergeStream(); - return this; - } - function mergeStream() { - if (merging) { - return; - } - merging = true; - let streams = streamsQueue.shift(); - if (!streams) { - process.nextTick(endStream); - return; - } - if (!Array.isArray(streams)) { - streams = [streams]; - } - let pipesCount = streams.length + 1; - function next() { - if (--pipesCount > 0) { - return; - } - merging = false; - mergeStream(); - } - function pipe(stream) { - function onend() { - stream.removeListener("merge2UnpipeEnd", onend); - stream.removeListener("end", onend); - if (doPipeError) { - stream.removeListener("error", onerror); - } - next(); - } - function onerror(err) { - mergedStream.emit("error", err); - } - if (stream._readableState.endEmitted) { - return next(); - } - stream.on("merge2UnpipeEnd", onend); - stream.on("end", onend); - if (doPipeError) { - stream.on("error", onerror); - } - stream.pipe(mergedStream, { end: false }); - stream.resume(); - } - for (let i = 0; i < streams.length; i++) { - pipe(streams[i]); - } - next(); - } - function endStream() { - merging = false; - mergedStream.emit("queueDrain"); - if (doEnd) { - mergedStream.end(); - } - } - mergedStream.setMaxListeners(0); - mergedStream.add = addStream; - mergedStream.on("unpipe", function(stream) { - stream.emit("merge2UnpipeEnd"); - }); - if (args.length) { - addStream.apply(null, args); - } - return mergedStream; - } - function pauseStreams(streams, options) { - if (!Array.isArray(streams)) { - if (!streams._readableState && streams.pipe) { - streams = streams.pipe(PassThrough2(options)); - } - if (!streams._readableState || !streams.pause || !streams.pipe) { - throw new Error("Only readable stream can be merged."); - } - streams.pause(); - } else { - for (let i = 0, len = streams.length; i < len; i++) { - streams[i] = pauseStreams(streams[i], options); - } - } - return streams; - } - } -}); - -// node_modules/fast-glob/out/utils/stream.js -var require_stream = __commonJS({ - "node_modules/fast-glob/out/utils/stream.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.merge = void 0; - var merge2 = require_merge2(); - function merge(streams) { - const mergedStream = merge2(streams); - streams.forEach((stream) => { - stream.once("error", (error2) => mergedStream.emit("error", error2)); - }); - mergedStream.once("close", () => propagateCloseEventToSources(streams)); - mergedStream.once("end", () => propagateCloseEventToSources(streams)); - return mergedStream; - } - exports.merge = merge; - function propagateCloseEventToSources(streams) { - streams.forEach((stream) => stream.emit("close")); - } - } -}); - -// node_modules/fast-glob/out/utils/string.js -var require_string = __commonJS({ - "node_modules/fast-glob/out/utils/string.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isEmpty = exports.isString = void 0; - function isString2(input) { - return typeof input === "string"; - } - exports.isString = isString2; - function isEmpty(input) { - return input === ""; - } - exports.isEmpty = isEmpty; - } -}); - -// node_modules/fast-glob/out/utils/index.js -var require_utils7 = __commonJS({ - "node_modules/fast-glob/out/utils/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0; - var array = require_array2(); - exports.array = array; - var errno = require_errno(); - exports.errno = errno; - var fs6 = require_fs(); - exports.fs = fs6; - var path16 = require_path(); - exports.path = path16; - var pattern = require_pattern(); - exports.pattern = pattern; - var stream = require_stream(); - exports.stream = stream; - var string = require_string(); - exports.string = string; - } -}); - -// node_modules/fast-glob/out/managers/tasks.js -var require_tasks = __commonJS({ - "node_modules/fast-glob/out/managers/tasks.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0; - var utils = require_utils7(); - function generate(input, settings) { - const patterns = processPatterns(input, settings); - const ignore = processPatterns(settings.ignore, settings); - const positivePatterns = getPositivePatterns(patterns); - const negativePatterns = getNegativePatternsAsPositive(patterns, ignore); - const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings)); - const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings)); - const staticTasks = convertPatternsToTasks( - staticPatterns, - negativePatterns, - /* dynamic */ - false - ); - const dynamicTasks = convertPatternsToTasks( - dynamicPatterns, - negativePatterns, - /* dynamic */ - true - ); - return staticTasks.concat(dynamicTasks); - } - exports.generate = generate; - function processPatterns(input, settings) { - let patterns = input; - if (settings.braceExpansion) { - patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns); - } - if (settings.baseNameMatch) { - patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`); - } - return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern)); - } - function convertPatternsToTasks(positive, negative, dynamic) { - const tasks = []; - const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive); - const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive); - const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory); - const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory); - tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic)); - if ("." in insideCurrentDirectoryGroup) { - tasks.push(convertPatternGroupToTask(".", patternsInsideCurrentDirectory, negative, dynamic)); - } else { - tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic)); - } - return tasks; - } - exports.convertPatternsToTasks = convertPatternsToTasks; - function getPositivePatterns(patterns) { - return utils.pattern.getPositivePatterns(patterns); - } - exports.getPositivePatterns = getPositivePatterns; - function getNegativePatternsAsPositive(patterns, ignore) { - const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore); - const positive = negative.map(utils.pattern.convertToPositivePattern); - return positive; - } - exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive; - function groupPatternsByBaseDirectory(patterns) { - const group = {}; - return patterns.reduce((collection, pattern) => { - const base = utils.pattern.getBaseDirectory(pattern); - if (base in collection) { - collection[base].push(pattern); - } else { - collection[base] = [pattern]; - } - return collection; - }, group); - } - exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; - function convertPatternGroupsToTasks(positive, negative, dynamic) { - return Object.keys(positive).map((base) => { - return convertPatternGroupToTask(base, positive[base], negative, dynamic); - }); - } - exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks; - function convertPatternGroupToTask(base, positive, negative, dynamic) { - return { - dynamic, - positive, - negative, - base, - patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern)) - }; - } - exports.convertPatternGroupToTask = convertPatternGroupToTask; - } -}); - -// node_modules/@nodelib/fs.stat/out/providers/async.js -var require_async = __commonJS({ - "node_modules/@nodelib/fs.stat/out/providers/async.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.read = void 0; - function read2(path16, settings, callback) { - settings.fs.lstat(path16, (lstatError, lstat) => { - if (lstatError !== null) { - callFailureCallback(callback, lstatError); - return; - } - if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { - callSuccessCallback(callback, lstat); - return; - } - settings.fs.stat(path16, (statError, stat2) => { - if (statError !== null) { - if (settings.throwErrorOnBrokenSymbolicLink) { - callFailureCallback(callback, statError); - return; - } - callSuccessCallback(callback, lstat); - return; - } - if (settings.markSymbolicLink) { - stat2.isSymbolicLink = () => true; - } - callSuccessCallback(callback, stat2); - }); - }); - } - exports.read = read2; - function callFailureCallback(callback, error2) { - callback(error2); - } - function callSuccessCallback(callback, result) { - callback(null, result); - } - } -}); - -// node_modules/@nodelib/fs.stat/out/providers/sync.js -var require_sync2 = __commonJS({ - "node_modules/@nodelib/fs.stat/out/providers/sync.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.read = void 0; - function read2(path16, settings) { - const lstat = settings.fs.lstatSync(path16); - if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { - return lstat; - } - try { - const stat2 = settings.fs.statSync(path16); - if (settings.markSymbolicLink) { - stat2.isSymbolicLink = () => true; - } - return stat2; - } catch (error2) { - if (!settings.throwErrorOnBrokenSymbolicLink) { - return lstat; - } - throw error2; - } - } - exports.read = read2; - } -}); - -// node_modules/@nodelib/fs.stat/out/adapters/fs.js -var require_fs2 = __commonJS({ - "node_modules/@nodelib/fs.stat/out/adapters/fs.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; - var fs6 = require("fs"); - exports.FILE_SYSTEM_ADAPTER = { - lstat: fs6.lstat, - stat: fs6.stat, - lstatSync: fs6.lstatSync, - statSync: fs6.statSync - }; - function createFileSystemAdapter(fsMethods) { - if (fsMethods === void 0) { - return exports.FILE_SYSTEM_ADAPTER; - } - return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); - } - exports.createFileSystemAdapter = createFileSystemAdapter; - } -}); - -// node_modules/@nodelib/fs.stat/out/settings.js -var require_settings = __commonJS({ - "node_modules/@nodelib/fs.stat/out/settings.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var fs6 = require_fs2(); - var Settings = class { - constructor(_options = {}) { - this._options = _options; - this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true); - this.fs = fs6.createFileSystemAdapter(this._options.fs); - this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false); - this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); - } - _getValue(option, value) { - return option !== null && option !== void 0 ? option : value; - } - }; - exports.default = Settings; - } -}); - -// node_modules/@nodelib/fs.stat/out/index.js -var require_out = __commonJS({ - "node_modules/@nodelib/fs.stat/out/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.statSync = exports.stat = exports.Settings = void 0; - var async = require_async(); - var sync = require_sync2(); - var settings_1 = require_settings(); - exports.Settings = settings_1.default; - function stat2(path16, optionsOrSettingsOrCallback, callback) { - if (typeof optionsOrSettingsOrCallback === "function") { - async.read(path16, getSettings(), optionsOrSettingsOrCallback); - return; - } - async.read(path16, getSettings(optionsOrSettingsOrCallback), callback); - } - exports.stat = stat2; - function statSync3(path16, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - return sync.read(path16, settings); - } - exports.statSync = statSync3; - function getSettings(settingsOrOptions = {}) { - if (settingsOrOptions instanceof settings_1.default) { - return settingsOrOptions; - } - return new settings_1.default(settingsOrOptions); - } - } -}); - -// node_modules/queue-microtask/index.js -var require_queue_microtask = __commonJS({ - "node_modules/queue-microtask/index.js"(exports, module2) { - var promise; - module2.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => { - throw err; - }, 0)); - } -}); - -// node_modules/run-parallel/index.js -var require_run_parallel = __commonJS({ - "node_modules/run-parallel/index.js"(exports, module2) { - module2.exports = runParallel; - var queueMicrotask2 = require_queue_microtask(); - function runParallel(tasks, cb) { - let results, pending, keys; - let isSync = true; - if (Array.isArray(tasks)) { - results = []; - pending = tasks.length; - } else { - keys = Object.keys(tasks); - results = {}; - pending = keys.length; - } - function done(err) { - function end() { - if (cb) - cb(err, results); - cb = null; - } - if (isSync) - queueMicrotask2(end); - else - end(); - } - function each(i, err, result) { - results[i] = result; - if (--pending === 0 || err) { - done(err); - } - } - if (!pending) { - done(null); - } else if (keys) { - keys.forEach(function(key) { - tasks[key](function(err, result) { - each(key, err, result); - }); - }); - } else { - tasks.forEach(function(task, i) { - task(function(err, result) { - each(i, err, result); - }); - }); - } - isSync = false; - } - } -}); - -// node_modules/@nodelib/fs.scandir/out/constants.js -var require_constants6 = __commonJS({ - "node_modules/@nodelib/fs.scandir/out/constants.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0; - var NODE_PROCESS_VERSION_PARTS = process.versions.node.split("."); - if (NODE_PROCESS_VERSION_PARTS[0] === void 0 || NODE_PROCESS_VERSION_PARTS[1] === void 0) { - throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`); - } - var MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10); - var MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10); - var SUPPORTED_MAJOR_VERSION = 10; - var SUPPORTED_MINOR_VERSION = 10; - var IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION; - var IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION; - exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR; - } -}); - -// node_modules/@nodelib/fs.scandir/out/utils/fs.js -var require_fs3 = __commonJS({ - "node_modules/@nodelib/fs.scandir/out/utils/fs.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createDirentFromStats = void 0; - var DirentFromStats = class { - constructor(name, stats) { - this.name = name; - this.isBlockDevice = stats.isBlockDevice.bind(stats); - this.isCharacterDevice = stats.isCharacterDevice.bind(stats); - this.isDirectory = stats.isDirectory.bind(stats); - this.isFIFO = stats.isFIFO.bind(stats); - this.isFile = stats.isFile.bind(stats); - this.isSocket = stats.isSocket.bind(stats); - this.isSymbolicLink = stats.isSymbolicLink.bind(stats); - } - }; - function createDirentFromStats(name, stats) { - return new DirentFromStats(name, stats); - } - exports.createDirentFromStats = createDirentFromStats; - } -}); - -// node_modules/@nodelib/fs.scandir/out/utils/index.js -var require_utils8 = __commonJS({ - "node_modules/@nodelib/fs.scandir/out/utils/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.fs = void 0; - var fs6 = require_fs3(); - exports.fs = fs6; - } -}); - -// node_modules/@nodelib/fs.scandir/out/providers/common.js -var require_common3 = __commonJS({ - "node_modules/@nodelib/fs.scandir/out/providers/common.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.joinPathSegments = void 0; - function joinPathSegments(a, b, separator) { - if (a.endsWith(separator)) { - return a + b; - } - return a + separator + b; - } - exports.joinPathSegments = joinPathSegments; - } -}); - -// node_modules/@nodelib/fs.scandir/out/providers/async.js -var require_async2 = __commonJS({ - "node_modules/@nodelib/fs.scandir/out/providers/async.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; - var fsStat = require_out(); - var rpl = require_run_parallel(); - var constants_1 = require_constants6(); - var utils = require_utils8(); - var common = require_common3(); - function read2(directory, settings, callback) { - if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { - readdirWithFileTypes(directory, settings, callback); - return; - } - readdir(directory, settings, callback); - } - exports.read = read2; - function readdirWithFileTypes(directory, settings, callback) { - settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => { - if (readdirError !== null) { - callFailureCallback(callback, readdirError); - return; - } - const entries = dirents.map((dirent) => ({ - dirent, - name: dirent.name, - path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) - })); - if (!settings.followSymbolicLinks) { - callSuccessCallback(callback, entries); - return; - } - const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings)); - rpl(tasks, (rplError, rplEntries) => { - if (rplError !== null) { - callFailureCallback(callback, rplError); - return; - } - callSuccessCallback(callback, rplEntries); - }); - }); - } - exports.readdirWithFileTypes = readdirWithFileTypes; - function makeRplTaskEntry(entry, settings) { - return (done) => { - if (!entry.dirent.isSymbolicLink()) { - done(null, entry); - return; - } - settings.fs.stat(entry.path, (statError, stats) => { - if (statError !== null) { - if (settings.throwErrorOnBrokenSymbolicLink) { - done(statError); - return; - } - done(null, entry); - return; - } - entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); - done(null, entry); - }); - }; - } - function readdir(directory, settings, callback) { - settings.fs.readdir(directory, (readdirError, names) => { - if (readdirError !== null) { - callFailureCallback(callback, readdirError); - return; - } - const tasks = names.map((name) => { - const path16 = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); - return (done) => { - fsStat.stat(path16, settings.fsStatSettings, (error2, stats) => { - if (error2 !== null) { - done(error2); - return; - } - const entry = { - name, - path: path16, - dirent: utils.fs.createDirentFromStats(name, stats) - }; - if (settings.stats) { - entry.stats = stats; - } - done(null, entry); - }); - }; - }); - rpl(tasks, (rplError, entries) => { - if (rplError !== null) { - callFailureCallback(callback, rplError); - return; - } - callSuccessCallback(callback, entries); - }); - }); - } - exports.readdir = readdir; - function callFailureCallback(callback, error2) { - callback(error2); - } - function callSuccessCallback(callback, result) { - callback(null, result); - } - } -}); - -// node_modules/@nodelib/fs.scandir/out/providers/sync.js -var require_sync3 = __commonJS({ - "node_modules/@nodelib/fs.scandir/out/providers/sync.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; - var fsStat = require_out(); - var constants_1 = require_constants6(); - var utils = require_utils8(); - var common = require_common3(); - function read2(directory, settings) { - if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { - return readdirWithFileTypes(directory, settings); - } - return readdir(directory, settings); - } - exports.read = read2; - function readdirWithFileTypes(directory, settings) { - const dirents = settings.fs.readdirSync(directory, { withFileTypes: true }); - return dirents.map((dirent) => { - const entry = { - dirent, - name: dirent.name, - path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) - }; - if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) { - try { - const stats = settings.fs.statSync(entry.path); - entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); - } catch (error2) { - if (settings.throwErrorOnBrokenSymbolicLink) { - throw error2; - } - } - } - return entry; - }); - } - exports.readdirWithFileTypes = readdirWithFileTypes; - function readdir(directory, settings) { - const names = settings.fs.readdirSync(directory); - return names.map((name) => { - const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); - const stats = fsStat.statSync(entryPath, settings.fsStatSettings); - const entry = { - name, - path: entryPath, - dirent: utils.fs.createDirentFromStats(name, stats) - }; - if (settings.stats) { - entry.stats = stats; - } - return entry; - }); - } - exports.readdir = readdir; - } -}); - -// node_modules/@nodelib/fs.scandir/out/adapters/fs.js -var require_fs4 = __commonJS({ - "node_modules/@nodelib/fs.scandir/out/adapters/fs.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; - var fs6 = require("fs"); - exports.FILE_SYSTEM_ADAPTER = { - lstat: fs6.lstat, - stat: fs6.stat, - lstatSync: fs6.lstatSync, - statSync: fs6.statSync, - readdir: fs6.readdir, - readdirSync: fs6.readdirSync - }; - function createFileSystemAdapter(fsMethods) { - if (fsMethods === void 0) { - return exports.FILE_SYSTEM_ADAPTER; - } - return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); - } - exports.createFileSystemAdapter = createFileSystemAdapter; - } -}); - -// node_modules/@nodelib/fs.scandir/out/settings.js -var require_settings2 = __commonJS({ - "node_modules/@nodelib/fs.scandir/out/settings.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var path16 = require("path"); - var fsStat = require_out(); - var fs6 = require_fs4(); - var Settings = class { - constructor(_options = {}) { - this._options = _options; - this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false); - this.fs = fs6.createFileSystemAdapter(this._options.fs); - this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path16.sep); - this.stats = this._getValue(this._options.stats, false); - this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); - this.fsStatSettings = new fsStat.Settings({ - followSymbolicLink: this.followSymbolicLinks, - fs: this.fs, - throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink - }); - } - _getValue(option, value) { - return option !== null && option !== void 0 ? option : value; - } - }; - exports.default = Settings; - } -}); - -// node_modules/@nodelib/fs.scandir/out/index.js -var require_out2 = __commonJS({ - "node_modules/@nodelib/fs.scandir/out/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Settings = exports.scandirSync = exports.scandir = void 0; - var async = require_async2(); - var sync = require_sync3(); - var settings_1 = require_settings2(); - exports.Settings = settings_1.default; - function scandir(path16, optionsOrSettingsOrCallback, callback) { - if (typeof optionsOrSettingsOrCallback === "function") { - async.read(path16, getSettings(), optionsOrSettingsOrCallback); - return; - } - async.read(path16, getSettings(optionsOrSettingsOrCallback), callback); - } - exports.scandir = scandir; - function scandirSync(path16, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - return sync.read(path16, settings); - } - exports.scandirSync = scandirSync; - function getSettings(settingsOrOptions = {}) { - if (settingsOrOptions instanceof settings_1.default) { - return settingsOrOptions; - } - return new settings_1.default(settingsOrOptions); - } - } -}); - -// node_modules/reusify/reusify.js -var require_reusify = __commonJS({ - "node_modules/reusify/reusify.js"(exports, module2) { - "use strict"; - function reusify(Constructor) { - var head = new Constructor(); - var tail = head; - function get() { - var current = head; - if (current.next) { - head = current.next; - } else { - head = new Constructor(); - tail = head; - } - current.next = null; - return current; - } - function release(obj) { - tail.next = obj; - tail = obj; - } - return { - get, - release - }; - } - module2.exports = reusify; - } -}); - -// node_modules/fastq/queue.js -var require_queue = __commonJS({ - "node_modules/fastq/queue.js"(exports, module2) { - "use strict"; - var reusify = require_reusify(); - function fastqueue(context, worker, concurrency) { - if (typeof context === "function") { - concurrency = worker; - worker = context; - context = null; - } - if (concurrency < 1) { - throw new Error("fastqueue concurrency must be greater than 1"); - } - var cache = reusify(Task); - var queueHead = null; - var queueTail = null; - var _running = 0; - var errorHandler = null; - var self = { - push, - drain: noop, - saturated: noop, - pause, - paused: false, - concurrency, - running, - resume, - idle, - length, - getQueue, - unshift, - empty: noop, - kill, - killAndDrain, - error: error2 - }; - return self; - function running() { - return _running; - } - function pause() { - self.paused = true; - } - function length() { - var current = queueHead; - var counter = 0; - while (current) { - current = current.next; - counter++; - } - return counter; - } - function getQueue() { - var current = queueHead; - var tasks = []; - while (current) { - tasks.push(current.value); - current = current.next; - } - return tasks; - } - function resume() { - if (!self.paused) - return; - self.paused = false; - for (var i = 0; i < self.concurrency; i++) { - _running++; - release(); - } - } - function idle() { - return _running === 0 && self.length() === 0; - } - function push(value, done) { - var current = cache.get(); - current.context = context; - current.release = release; - current.value = value; - current.callback = done || noop; - current.errorHandler = errorHandler; - if (_running === self.concurrency || self.paused) { - if (queueTail) { - queueTail.next = current; - queueTail = current; - } else { - queueHead = current; - queueTail = current; - self.saturated(); - } - } else { - _running++; - worker.call(context, current.value, current.worked); - } - } - function unshift(value, done) { - var current = cache.get(); - current.context = context; - current.release = release; - current.value = value; - current.callback = done || noop; - if (_running === self.concurrency || self.paused) { - if (queueHead) { - current.next = queueHead; - queueHead = current; - } else { - queueHead = current; - queueTail = current; - self.saturated(); - } - } else { - _running++; - worker.call(context, current.value, current.worked); - } - } - function release(holder) { - if (holder) { - cache.release(holder); - } - var next = queueHead; - if (next) { - if (!self.paused) { - if (queueTail === queueHead) { - queueTail = null; - } - queueHead = next.next; - next.next = null; - worker.call(context, next.value, next.worked); - if (queueTail === null) { - self.empty(); - } - } else { - _running--; - } - } else if (--_running === 0) { - self.drain(); - } - } - function kill() { - queueHead = null; - queueTail = null; - self.drain = noop; - } - function killAndDrain() { - queueHead = null; - queueTail = null; - self.drain(); - self.drain = noop; - } - function error2(handler) { - errorHandler = handler; - } - } - function noop() { - } - function Task() { - this.value = null; - this.callback = noop; - this.next = null; - this.release = noop; - this.context = null; - this.errorHandler = null; - var self = this; - this.worked = function worked(err, result) { - var callback = self.callback; - var errorHandler = self.errorHandler; - var val = self.value; - self.value = null; - self.callback = noop; - if (self.errorHandler) { - errorHandler(err, val); - } - callback.call(self.context, err, result); - self.release(self); - }; - } - function queueAsPromised(context, worker, concurrency) { - if (typeof context === "function") { - concurrency = worker; - worker = context; - context = null; - } - function asyncWrapper(arg, cb) { - worker.call(this, arg).then(function(res) { - cb(null, res); - }, cb); - } - var queue = fastqueue(context, asyncWrapper, concurrency); - var pushCb = queue.push; - var unshiftCb = queue.unshift; - queue.push = push; - queue.unshift = unshift; - queue.drained = drained; - return queue; - function push(value) { - var p = new Promise(function(resolve10, reject) { - pushCb(value, function(err, result) { - if (err) { - reject(err); - return; - } - resolve10(result); - }); - }); - p.catch(noop); - return p; - } - function unshift(value) { - var p = new Promise(function(resolve10, reject) { - unshiftCb(value, function(err, result) { - if (err) { - reject(err); - return; - } - resolve10(result); - }); - }); - p.catch(noop); - return p; - } - function drained() { - if (queue.idle()) { - return new Promise(function(resolve10) { - resolve10(); - }); - } - var previousDrain = queue.drain; - var p = new Promise(function(resolve10) { - queue.drain = function() { - previousDrain(); - resolve10(); - }; - }); - return p; - } - } - module2.exports = fastqueue; - module2.exports.promise = queueAsPromised; - } -}); - -// node_modules/@nodelib/fs.walk/out/readers/common.js -var require_common4 = __commonJS({ - "node_modules/@nodelib/fs.walk/out/readers/common.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0; - function isFatalError(settings, error2) { - if (settings.errorFilter === null) { - return true; - } - return !settings.errorFilter(error2); - } - exports.isFatalError = isFatalError; - function isAppliedFilter(filter, value) { - return filter === null || filter(value); - } - exports.isAppliedFilter = isAppliedFilter; - function replacePathSegmentSeparator(filepath, separator) { - return filepath.split(/[/\\]/).join(separator); - } - exports.replacePathSegmentSeparator = replacePathSegmentSeparator; - function joinPathSegments(a, b, separator) { - if (a === "") { - return b; - } - if (a.endsWith(separator)) { - return a + b; - } - return a + separator + b; - } - exports.joinPathSegments = joinPathSegments; - } -}); - -// node_modules/@nodelib/fs.walk/out/readers/reader.js -var require_reader = __commonJS({ - "node_modules/@nodelib/fs.walk/out/readers/reader.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var common = require_common4(); - var Reader = class { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator); - } - }; - exports.default = Reader; - } -}); - -// node_modules/@nodelib/fs.walk/out/readers/async.js -var require_async3 = __commonJS({ - "node_modules/@nodelib/fs.walk/out/readers/async.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var events_1 = require("events"); - var fsScandir = require_out2(); - var fastq = require_queue(); - var common = require_common4(); - var reader_1 = require_reader(); - var AsyncReader = class extends reader_1.default { - constructor(_root, _settings) { - super(_root, _settings); - this._settings = _settings; - this._scandir = fsScandir.scandir; - this._emitter = new events_1.EventEmitter(); - this._queue = fastq(this._worker.bind(this), this._settings.concurrency); - this._isFatalError = false; - this._isDestroyed = false; - this._queue.drain = () => { - if (!this._isFatalError) { - this._emitter.emit("end"); - } - }; - } - read() { - this._isFatalError = false; - this._isDestroyed = false; - setImmediate(() => { - this._pushToQueue(this._root, this._settings.basePath); - }); - return this._emitter; - } - get isDestroyed() { - return this._isDestroyed; - } - destroy() { - if (this._isDestroyed) { - throw new Error("The reader is already destroyed"); - } - this._isDestroyed = true; - this._queue.killAndDrain(); - } - onEntry(callback) { - this._emitter.on("entry", callback); - } - onError(callback) { - this._emitter.once("error", callback); - } - onEnd(callback) { - this._emitter.once("end", callback); - } - _pushToQueue(directory, base) { - const queueItem = { directory, base }; - this._queue.push(queueItem, (error2) => { - if (error2 !== null) { - this._handleError(error2); - } - }); - } - _worker(item, done) { - this._scandir(item.directory, this._settings.fsScandirSettings, (error2, entries) => { - if (error2 !== null) { - done(error2, void 0); - return; - } - for (const entry of entries) { - this._handleEntry(entry, item.base); - } - done(null, void 0); - }); - } - _handleError(error2) { - if (this._isDestroyed || !common.isFatalError(this._settings, error2)) { - return; - } - this._isFatalError = true; - this._isDestroyed = true; - this._emitter.emit("error", error2); - } - _handleEntry(entry, base) { - if (this._isDestroyed || this._isFatalError) { - return; - } - const fullpath = entry.path; - if (base !== void 0) { - entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); - } - if (common.isAppliedFilter(this._settings.entryFilter, entry)) { - this._emitEntry(entry); - } - if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { - this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path); - } - } - _emitEntry(entry) { - this._emitter.emit("entry", entry); - } - }; - exports.default = AsyncReader; - } -}); - -// node_modules/@nodelib/fs.walk/out/providers/async.js -var require_async4 = __commonJS({ - "node_modules/@nodelib/fs.walk/out/providers/async.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var async_1 = require_async3(); - var AsyncProvider = class { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._reader = new async_1.default(this._root, this._settings); - this._storage = []; - } - read(callback) { - this._reader.onError((error2) => { - callFailureCallback(callback, error2); - }); - this._reader.onEntry((entry) => { - this._storage.push(entry); - }); - this._reader.onEnd(() => { - callSuccessCallback(callback, this._storage); - }); - this._reader.read(); - } - }; - exports.default = AsyncProvider; - function callFailureCallback(callback, error2) { - callback(error2); - } - function callSuccessCallback(callback, entries) { - callback(null, entries); - } - } -}); - -// node_modules/@nodelib/fs.walk/out/providers/stream.js -var require_stream2 = __commonJS({ - "node_modules/@nodelib/fs.walk/out/providers/stream.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var stream_1 = require("stream"); - var async_1 = require_async3(); - var StreamProvider = class { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._reader = new async_1.default(this._root, this._settings); - this._stream = new stream_1.Readable({ - objectMode: true, - read: () => { - }, - destroy: () => { - if (!this._reader.isDestroyed) { - this._reader.destroy(); - } - } - }); - } - read() { - this._reader.onError((error2) => { - this._stream.emit("error", error2); - }); - this._reader.onEntry((entry) => { - this._stream.push(entry); - }); - this._reader.onEnd(() => { - this._stream.push(null); - }); - this._reader.read(); - return this._stream; - } - }; - exports.default = StreamProvider; - } -}); - -// node_modules/@nodelib/fs.walk/out/readers/sync.js -var require_sync4 = __commonJS({ - "node_modules/@nodelib/fs.walk/out/readers/sync.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var fsScandir = require_out2(); - var common = require_common4(); - var reader_1 = require_reader(); - var SyncReader = class extends reader_1.default { - constructor() { - super(...arguments); - this._scandir = fsScandir.scandirSync; - this._storage = []; - this._queue = /* @__PURE__ */ new Set(); - } - read() { - this._pushToQueue(this._root, this._settings.basePath); - this._handleQueue(); - return this._storage; - } - _pushToQueue(directory, base) { - this._queue.add({ directory, base }); - } - _handleQueue() { - for (const item of this._queue.values()) { - this._handleDirectory(item.directory, item.base); - } - } - _handleDirectory(directory, base) { - try { - const entries = this._scandir(directory, this._settings.fsScandirSettings); - for (const entry of entries) { - this._handleEntry(entry, base); - } - } catch (error2) { - this._handleError(error2); - } - } - _handleError(error2) { - if (!common.isFatalError(this._settings, error2)) { - return; - } - throw error2; - } - _handleEntry(entry, base) { - const fullpath = entry.path; - if (base !== void 0) { - entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); - } - if (common.isAppliedFilter(this._settings.entryFilter, entry)) { - this._pushToStorage(entry); - } - if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { - this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path); - } - } - _pushToStorage(entry) { - this._storage.push(entry); - } - }; - exports.default = SyncReader; - } -}); - -// node_modules/@nodelib/fs.walk/out/providers/sync.js -var require_sync5 = __commonJS({ - "node_modules/@nodelib/fs.walk/out/providers/sync.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var sync_1 = require_sync4(); - var SyncProvider = class { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._reader = new sync_1.default(this._root, this._settings); - } - read() { - return this._reader.read(); - } - }; - exports.default = SyncProvider; - } -}); - -// node_modules/@nodelib/fs.walk/out/settings.js -var require_settings3 = __commonJS({ - "node_modules/@nodelib/fs.walk/out/settings.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var path16 = require("path"); - var fsScandir = require_out2(); - var Settings = class { - constructor(_options = {}) { - this._options = _options; - this.basePath = this._getValue(this._options.basePath, void 0); - this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY); - this.deepFilter = this._getValue(this._options.deepFilter, null); - this.entryFilter = this._getValue(this._options.entryFilter, null); - this.errorFilter = this._getValue(this._options.errorFilter, null); - this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path16.sep); - this.fsScandirSettings = new fsScandir.Settings({ - followSymbolicLinks: this._options.followSymbolicLinks, - fs: this._options.fs, - pathSegmentSeparator: this._options.pathSegmentSeparator, - stats: this._options.stats, - throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink - }); - } - _getValue(option, value) { - return option !== null && option !== void 0 ? option : value; - } - }; - exports.default = Settings; - } -}); - -// node_modules/@nodelib/fs.walk/out/index.js -var require_out3 = __commonJS({ - "node_modules/@nodelib/fs.walk/out/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0; - var async_1 = require_async4(); - var stream_1 = require_stream2(); - var sync_1 = require_sync5(); - var settings_1 = require_settings3(); - exports.Settings = settings_1.default; - function walk(directory, optionsOrSettingsOrCallback, callback) { - if (typeof optionsOrSettingsOrCallback === "function") { - new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback); - return; - } - new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback); - } - exports.walk = walk; - function walkSync(directory, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - const provider = new sync_1.default(directory, settings); - return provider.read(); - } - exports.walkSync = walkSync; - function walkStream(directory, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - const provider = new stream_1.default(directory, settings); - return provider.read(); - } - exports.walkStream = walkStream; - function getSettings(settingsOrOptions = {}) { - if (settingsOrOptions instanceof settings_1.default) { - return settingsOrOptions; - } - return new settings_1.default(settingsOrOptions); - } - } -}); - -// node_modules/fast-glob/out/readers/reader.js -var require_reader2 = __commonJS({ - "node_modules/fast-glob/out/readers/reader.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var path16 = require("path"); - var fsStat = require_out(); - var utils = require_utils7(); - var Reader = class { - constructor(_settings) { - this._settings = _settings; - this._fsStatSettings = new fsStat.Settings({ - followSymbolicLink: this._settings.followSymbolicLinks, - fs: this._settings.fs, - throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks - }); - } - _getFullEntryPath(filepath) { - return path16.resolve(this._settings.cwd, filepath); - } - _makeEntry(stats, pattern) { - const entry = { - name: pattern, - path: pattern, - dirent: utils.fs.createDirentFromStats(pattern, stats) - }; - if (this._settings.stats) { - entry.stats = stats; - } - return entry; - } - _isFatalError(error2) { - return !utils.errno.isEnoentCodeError(error2) && !this._settings.suppressErrors; - } - }; - exports.default = Reader; - } -}); - -// node_modules/fast-glob/out/readers/stream.js -var require_stream3 = __commonJS({ - "node_modules/fast-glob/out/readers/stream.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var stream_1 = require("stream"); - var fsStat = require_out(); - var fsWalk = require_out3(); - var reader_1 = require_reader2(); - var ReaderStream = class extends reader_1.default { - constructor() { - super(...arguments); - this._walkStream = fsWalk.walkStream; - this._stat = fsStat.stat; - } - dynamic(root, options) { - return this._walkStream(root, options); - } - static(patterns, options) { - const filepaths = patterns.map(this._getFullEntryPath, this); - const stream = new stream_1.PassThrough({ objectMode: true }); - stream._write = (index, _enc, done) => { - return this._getEntry(filepaths[index], patterns[index], options).then((entry) => { - if (entry !== null && options.entryFilter(entry)) { - stream.push(entry); - } - if (index === filepaths.length - 1) { - stream.end(); - } - done(); - }).catch(done); - }; - for (let i = 0; i < filepaths.length; i++) { - stream.write(i); - } - return stream; - } - _getEntry(filepath, pattern, options) { - return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern)).catch((error2) => { - if (options.errorFilter(error2)) { - return null; - } - throw error2; - }); - } - _getStat(filepath) { - return new Promise((resolve10, reject) => { - this._stat(filepath, this._fsStatSettings, (error2, stats) => { - return error2 === null ? resolve10(stats) : reject(error2); - }); - }); - } - }; - exports.default = ReaderStream; - } -}); - -// node_modules/fast-glob/out/readers/async.js -var require_async5 = __commonJS({ - "node_modules/fast-glob/out/readers/async.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var fsWalk = require_out3(); - var reader_1 = require_reader2(); - var stream_1 = require_stream3(); - var ReaderAsync = class extends reader_1.default { - constructor() { - super(...arguments); - this._walkAsync = fsWalk.walk; - this._readerStream = new stream_1.default(this._settings); - } - dynamic(root, options) { - return new Promise((resolve10, reject) => { - this._walkAsync(root, options, (error2, entries) => { - if (error2 === null) { - resolve10(entries); - } else { - reject(error2); - } - }); - }); - } - async static(patterns, options) { - const entries = []; - const stream = this._readerStream.static(patterns, options); - return new Promise((resolve10, reject) => { - stream.once("error", reject); - stream.on("data", (entry) => entries.push(entry)); - stream.once("end", () => resolve10(entries)); - }); - } - }; - exports.default = ReaderAsync; - } -}); - -// node_modules/fast-glob/out/providers/matchers/matcher.js -var require_matcher = __commonJS({ - "node_modules/fast-glob/out/providers/matchers/matcher.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var utils = require_utils7(); - var Matcher = class { - constructor(_patterns, _settings, _micromatchOptions) { - this._patterns = _patterns; - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - this._storage = []; - this._fillStorage(); - } - _fillStorage() { - for (const pattern of this._patterns) { - const segments = this._getPatternSegments(pattern); - const sections = this._splitSegmentsIntoSections(segments); - this._storage.push({ - complete: sections.length <= 1, - pattern, - segments, - sections - }); - } - } - _getPatternSegments(pattern) { - const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions); - return parts.map((part) => { - const dynamic = utils.pattern.isDynamicPattern(part, this._settings); - if (!dynamic) { - return { - dynamic: false, - pattern: part - }; - } - return { - dynamic: true, - pattern: part, - patternRe: utils.pattern.makeRe(part, this._micromatchOptions) - }; - }); - } - _splitSegmentsIntoSections(segments) { - return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern)); - } - }; - exports.default = Matcher; - } -}); - -// node_modules/fast-glob/out/providers/matchers/partial.js -var require_partial = __commonJS({ - "node_modules/fast-glob/out/providers/matchers/partial.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var matcher_1 = require_matcher(); - var PartialMatcher = class extends matcher_1.default { - match(filepath) { - const parts = filepath.split("/"); - const levels = parts.length; - const patterns = this._storage.filter((info3) => !info3.complete || info3.segments.length > levels); - for (const pattern of patterns) { - const section = pattern.sections[0]; - if (!pattern.complete && levels > section.length) { - return true; - } - const match = parts.every((part, index) => { - const segment = pattern.segments[index]; - if (segment.dynamic && segment.patternRe.test(part)) { - return true; - } - if (!segment.dynamic && segment.pattern === part) { - return true; - } - return false; - }); - if (match) { - return true; - } - } - return false; - } - }; - exports.default = PartialMatcher; - } -}); - -// node_modules/fast-glob/out/providers/filters/deep.js -var require_deep = __commonJS({ - "node_modules/fast-glob/out/providers/filters/deep.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var utils = require_utils7(); - var partial_1 = require_partial(); - var DeepFilter = class { - constructor(_settings, _micromatchOptions) { - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - } - getFilter(basePath, positive, negative) { - const matcher = this._getMatcher(positive); - const negativeRe = this._getNegativePatternsRe(negative); - return (entry) => this._filter(basePath, entry, matcher, negativeRe); - } - _getMatcher(patterns) { - return new partial_1.default(patterns, this._settings, this._micromatchOptions); - } - _getNegativePatternsRe(patterns) { - const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern); - return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions); - } - _filter(basePath, entry, matcher, negativeRe) { - if (this._isSkippedByDeep(basePath, entry.path)) { - return false; - } - if (this._isSkippedSymbolicLink(entry)) { - return false; - } - const filepath = utils.path.removeLeadingDotSegment(entry.path); - if (this._isSkippedByPositivePatterns(filepath, matcher)) { - return false; - } - return this._isSkippedByNegativePatterns(filepath, negativeRe); - } - _isSkippedByDeep(basePath, entryPath) { - if (this._settings.deep === Infinity) { - return false; - } - return this._getEntryLevel(basePath, entryPath) >= this._settings.deep; - } - _getEntryLevel(basePath, entryPath) { - const entryPathDepth = entryPath.split("/").length; - if (basePath === "") { - return entryPathDepth; - } - const basePathDepth = basePath.split("/").length; - return entryPathDepth - basePathDepth; - } - _isSkippedSymbolicLink(entry) { - return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink(); - } - _isSkippedByPositivePatterns(entryPath, matcher) { - return !this._settings.baseNameMatch && !matcher.match(entryPath); - } - _isSkippedByNegativePatterns(entryPath, patternsRe) { - return !utils.pattern.matchAny(entryPath, patternsRe); - } - }; - exports.default = DeepFilter; - } -}); - -// node_modules/fast-glob/out/providers/filters/entry.js -var require_entry = __commonJS({ - "node_modules/fast-glob/out/providers/filters/entry.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var utils = require_utils7(); - var EntryFilter = class { - constructor(_settings, _micromatchOptions) { - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - this.index = /* @__PURE__ */ new Map(); - } - getFilter(positive, negative) { - const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions); - const negativeRe = utils.pattern.convertPatternsToRe(negative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })); - return (entry) => this._filter(entry, positiveRe, negativeRe); - } - _filter(entry, positiveRe, negativeRe) { - const filepath = utils.path.removeLeadingDotSegment(entry.path); - if (this._settings.unique && this._isDuplicateEntry(filepath)) { - return false; - } - if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) { - return false; - } - if (this._isSkippedByAbsoluteNegativePatterns(filepath, negativeRe)) { - return false; - } - const isDirectory = entry.dirent.isDirectory(); - const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(filepath, negativeRe, isDirectory); - if (this._settings.unique && isMatched) { - this._createIndexRecord(filepath); - } - return isMatched; - } - _isDuplicateEntry(filepath) { - return this.index.has(filepath); - } - _createIndexRecord(filepath) { - this.index.set(filepath, void 0); - } - _onlyFileFilter(entry) { - return this._settings.onlyFiles && !entry.dirent.isFile(); - } - _onlyDirectoryFilter(entry) { - return this._settings.onlyDirectories && !entry.dirent.isDirectory(); - } - _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) { - if (!this._settings.absolute) { - return false; - } - const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath); - return utils.pattern.matchAny(fullpath, patternsRe); - } - _isMatchToPatterns(filepath, patternsRe, isDirectory) { - const isMatched = utils.pattern.matchAny(filepath, patternsRe); - if (!isMatched && isDirectory) { - return utils.pattern.matchAny(filepath + "/", patternsRe); - } - return isMatched; - } - }; - exports.default = EntryFilter; - } -}); - -// node_modules/fast-glob/out/providers/filters/error.js -var require_error2 = __commonJS({ - "node_modules/fast-glob/out/providers/filters/error.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var utils = require_utils7(); - var ErrorFilter = class { - constructor(_settings) { - this._settings = _settings; - } - getFilter() { - return (error2) => this._isNonFatalError(error2); - } - _isNonFatalError(error2) { - return utils.errno.isEnoentCodeError(error2) || this._settings.suppressErrors; - } - }; - exports.default = ErrorFilter; - } -}); - -// node_modules/fast-glob/out/providers/transformers/entry.js -var require_entry2 = __commonJS({ - "node_modules/fast-glob/out/providers/transformers/entry.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var utils = require_utils7(); - var EntryTransformer = class { - constructor(_settings) { - this._settings = _settings; - } - getTransformer() { - return (entry) => this._transform(entry); - } - _transform(entry) { - let filepath = entry.path; - if (this._settings.absolute) { - filepath = utils.path.makeAbsolute(this._settings.cwd, filepath); - filepath = utils.path.unixify(filepath); - } - if (this._settings.markDirectories && entry.dirent.isDirectory()) { - filepath += "/"; - } - if (!this._settings.objectMode) { - return filepath; - } - return Object.assign(Object.assign({}, entry), { path: filepath }); - } - }; - exports.default = EntryTransformer; - } -}); - -// node_modules/fast-glob/out/providers/provider.js -var require_provider = __commonJS({ - "node_modules/fast-glob/out/providers/provider.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var path16 = require("path"); - var deep_1 = require_deep(); - var entry_1 = require_entry(); - var error_1 = require_error2(); - var entry_2 = require_entry2(); - var Provider = class { - constructor(_settings) { - this._settings = _settings; - this.errorFilter = new error_1.default(this._settings); - this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions()); - this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions()); - this.entryTransformer = new entry_2.default(this._settings); - } - _getRootDirectory(task) { - return path16.resolve(this._settings.cwd, task.base); - } - _getReaderOptions(task) { - const basePath = task.base === "." ? "" : task.base; - return { - basePath, - pathSegmentSeparator: "/", - concurrency: this._settings.concurrency, - deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative), - entryFilter: this.entryFilter.getFilter(task.positive, task.negative), - errorFilter: this.errorFilter.getFilter(), - followSymbolicLinks: this._settings.followSymbolicLinks, - fs: this._settings.fs, - stats: this._settings.stats, - throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink, - transform: this.entryTransformer.getTransformer() - }; - } - _getMicromatchOptions() { - return { - dot: this._settings.dot, - matchBase: this._settings.baseNameMatch, - nobrace: !this._settings.braceExpansion, - nocase: !this._settings.caseSensitiveMatch, - noext: !this._settings.extglob, - noglobstar: !this._settings.globstar, - posix: true, - strictSlashes: false - }; - } - }; - exports.default = Provider; - } -}); - -// node_modules/fast-glob/out/providers/async.js -var require_async6 = __commonJS({ - "node_modules/fast-glob/out/providers/async.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var async_1 = require_async5(); - var provider_1 = require_provider(); - var ProviderAsync = class extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new async_1.default(this._settings); - } - async read(task) { - const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const entries = await this.api(root, task, options); - return entries.map((entry) => options.transform(entry)); - } - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - return this._reader.static(task.patterns, options); - } - }; - exports.default = ProviderAsync; - } -}); - -// node_modules/fast-glob/out/providers/stream.js -var require_stream4 = __commonJS({ - "node_modules/fast-glob/out/providers/stream.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var stream_1 = require("stream"); - var stream_2 = require_stream3(); - var provider_1 = require_provider(); - var ProviderStream = class extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new stream_2.default(this._settings); - } - read(task) { - const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const source = this.api(root, task, options); - const destination = new stream_1.Readable({ objectMode: true, read: () => { - } }); - source.once("error", (error2) => destination.emit("error", error2)).on("data", (entry) => destination.emit("data", options.transform(entry))).once("end", () => destination.emit("end")); - destination.once("close", () => source.destroy()); - return destination; - } - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - return this._reader.static(task.patterns, options); - } - }; - exports.default = ProviderStream; - } -}); - -// node_modules/fast-glob/out/readers/sync.js -var require_sync6 = __commonJS({ - "node_modules/fast-glob/out/readers/sync.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var fsStat = require_out(); - var fsWalk = require_out3(); - var reader_1 = require_reader2(); - var ReaderSync = class extends reader_1.default { - constructor() { - super(...arguments); - this._walkSync = fsWalk.walkSync; - this._statSync = fsStat.statSync; - } - dynamic(root, options) { - return this._walkSync(root, options); - } - static(patterns, options) { - const entries = []; - for (const pattern of patterns) { - const filepath = this._getFullEntryPath(pattern); - const entry = this._getEntry(filepath, pattern, options); - if (entry === null || !options.entryFilter(entry)) { - continue; - } - entries.push(entry); - } - return entries; - } - _getEntry(filepath, pattern, options) { - try { - const stats = this._getStat(filepath); - return this._makeEntry(stats, pattern); - } catch (error2) { - if (options.errorFilter(error2)) { - return null; - } - throw error2; - } - } - _getStat(filepath) { - return this._statSync(filepath, this._fsStatSettings); - } - }; - exports.default = ReaderSync; - } -}); - -// node_modules/fast-glob/out/providers/sync.js -var require_sync7 = __commonJS({ - "node_modules/fast-glob/out/providers/sync.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var sync_1 = require_sync6(); - var provider_1 = require_provider(); - var ProviderSync = class extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new sync_1.default(this._settings); - } - read(task) { - const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const entries = this.api(root, task, options); - return entries.map(options.transform); - } - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - return this._reader.static(task.patterns, options); - } - }; - exports.default = ProviderSync; - } -}); - -// node_modules/fast-glob/out/settings.js -var require_settings4 = __commonJS({ - "node_modules/fast-glob/out/settings.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0; - var fs6 = require("fs"); - var os = require("os"); - var CPU_COUNT = Math.max(os.cpus().length, 1); - exports.DEFAULT_FILE_SYSTEM_ADAPTER = { - lstat: fs6.lstat, - lstatSync: fs6.lstatSync, - stat: fs6.stat, - statSync: fs6.statSync, - readdir: fs6.readdir, - readdirSync: fs6.readdirSync - }; - var Settings = class { - constructor(_options = {}) { - this._options = _options; - this.absolute = this._getValue(this._options.absolute, false); - this.baseNameMatch = this._getValue(this._options.baseNameMatch, false); - this.braceExpansion = this._getValue(this._options.braceExpansion, true); - this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true); - this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT); - this.cwd = this._getValue(this._options.cwd, process.cwd()); - this.deep = this._getValue(this._options.deep, Infinity); - this.dot = this._getValue(this._options.dot, false); - this.extglob = this._getValue(this._options.extglob, true); - this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true); - this.fs = this._getFileSystemMethods(this._options.fs); - this.globstar = this._getValue(this._options.globstar, true); - this.ignore = this._getValue(this._options.ignore, []); - this.markDirectories = this._getValue(this._options.markDirectories, false); - this.objectMode = this._getValue(this._options.objectMode, false); - this.onlyDirectories = this._getValue(this._options.onlyDirectories, false); - this.onlyFiles = this._getValue(this._options.onlyFiles, true); - this.stats = this._getValue(this._options.stats, false); - this.suppressErrors = this._getValue(this._options.suppressErrors, false); - this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false); - this.unique = this._getValue(this._options.unique, true); - if (this.onlyDirectories) { - this.onlyFiles = false; - } - if (this.stats) { - this.objectMode = true; - } - this.ignore = [].concat(this.ignore); - } - _getValue(option, value) { - return option === void 0 ? value : option; - } - _getFileSystemMethods(methods = {}) { - return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods); - } - }; - exports.default = Settings; - } -}); - -// node_modules/fast-glob/out/index.js -var require_out4 = __commonJS({ - "node_modules/fast-glob/out/index.js"(exports, module2) { - "use strict"; - var taskManager = require_tasks(); - var async_1 = require_async6(); - var stream_1 = require_stream4(); - var sync_1 = require_sync7(); - var settings_1 = require_settings4(); - var utils = require_utils7(); - async function FastGlob(source, options) { - assertPatternsInput(source); - const works = getWorks(source, async_1.default, options); - const result = await Promise.all(works); - return utils.array.flatten(result); - } - (function(FastGlob2) { - FastGlob2.glob = FastGlob2; - FastGlob2.globSync = sync; - FastGlob2.globStream = stream; - FastGlob2.async = FastGlob2; - function sync(source, options) { - assertPatternsInput(source); - const works = getWorks(source, sync_1.default, options); - return utils.array.flatten(works); - } - FastGlob2.sync = sync; - function stream(source, options) { - assertPatternsInput(source); - const works = getWorks(source, stream_1.default, options); - return utils.stream.merge(works); - } - FastGlob2.stream = stream; - function generateTasks(source, options) { - assertPatternsInput(source); - const patterns = [].concat(source); - const settings = new settings_1.default(options); - return taskManager.generate(patterns, settings); - } - FastGlob2.generateTasks = generateTasks; - function isDynamicPattern(source, options) { - assertPatternsInput(source); - const settings = new settings_1.default(options); - return utils.pattern.isDynamicPattern(source, settings); - } - FastGlob2.isDynamicPattern = isDynamicPattern; - function escapePath(source) { - assertPatternsInput(source); - return utils.path.escape(source); - } - FastGlob2.escapePath = escapePath; - function convertPathToPattern(source) { - assertPatternsInput(source); - return utils.path.convertPathToPattern(source); - } - FastGlob2.convertPathToPattern = convertPathToPattern; - let posix3; - (function(posix4) { - function escapePath2(source) { - assertPatternsInput(source); - return utils.path.escapePosixPath(source); - } - posix4.escapePath = escapePath2; - function convertPathToPattern2(source) { - assertPatternsInput(source); - return utils.path.convertPosixPathToPattern(source); - } - posix4.convertPathToPattern = convertPathToPattern2; - })(posix3 = FastGlob2.posix || (FastGlob2.posix = {})); - let win32; - (function(win322) { - function escapePath2(source) { - assertPatternsInput(source); - return utils.path.escapeWindowsPath(source); - } - win322.escapePath = escapePath2; - function convertPathToPattern2(source) { - assertPatternsInput(source); - return utils.path.convertWindowsPathToPattern(source); - } - win322.convertPathToPattern = convertPathToPattern2; - })(win32 = FastGlob2.win32 || (FastGlob2.win32 = {})); - })(FastGlob || (FastGlob = {})); - function getWorks(source, _Provider, options) { - const patterns = [].concat(source); - const settings = new settings_1.default(options); - const tasks = taskManager.generate(patterns, settings); - const provider = new _Provider(settings); - return tasks.map(provider.read, provider); - } - function assertPatternsInput(input) { - const source = [].concat(input); - const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item)); - if (!isValidSource) { - throw new TypeError("Patterns must be a string (non empty) or an array of strings"); - } - } - module2.exports = FastGlob; +// node_modules/cspell-glob/dist/esm/GlobMatcher.mjs +var import_micromatch = __toESM(require_micromatch(), 1); +var Path2 = __toESM(require("path"), 1); +var GlobMatcher = class { + constructor(patterns, rootOrOptions, _nodePath) { + _nodePath = _nodePath ?? Path2; + const options = typeof rootOrOptions === "string" ? { root: rootOrOptions } : rootOrOptions ?? {}; + const { mode = "exclude" } = options; + const isExcludeMode = mode !== "include"; + _nodePath = options.nodePath ?? _nodePath; + const { root = _nodePath.resolve(), dot = isExcludeMode, nodePath = _nodePath, nested = isExcludeMode, cwd = process.cwd(), nobrace } = options; + const normalizedRoot = nodePath.resolve(nodePath.normalize(root)); + this.options = { root: normalizedRoot, dot, nodePath, nested, mode, nobrace, cwd }; + patterns = Array.isArray(patterns) ? patterns : typeof patterns === "string" ? patterns.split(/\r?\n/g) : [patterns]; + const globPatterns = normalizeGlobPatterns(patterns, this.options); + this.patternsNormalizedToRoot = globPatterns.map((g) => normalizeGlobToRoot(g, normalizedRoot, nodePath)).filter((g) => nodePath.relative(g.root, normalizedRoot) === ""); + this.patterns = globPatterns; + this.root = normalizedRoot; + this.path = nodePath; + this.dot = dot; + this.matchEx = buildMatcherFn(this.patterns, this.options); } -}); - -// node_modules/flatted/cjs/index.js -var require_cjs11 = __commonJS({ - "node_modules/flatted/cjs/index.js"(exports) { - "use strict"; - var { parse: $parse, stringify: $stringify } = JSON; - var { keys } = Object; - var Primitive = String; - var primitive = "string"; - var ignore = {}; - var object = "object"; - var noop = (_, value) => value; - var primitives = (value) => value instanceof Primitive ? Primitive(value) : value; - var Primitives = (_, value) => typeof value === primitive ? new Primitive(value) : value; - var revive = (input, parsed, output, $) => { - const lazy = []; - for (let ke = keys(output), { length } = ke, y = 0; y < length; y++) { - const k = ke[y]; - const value = output[k]; - if (value instanceof Primitive) { - const tmp = input[value]; - if (typeof tmp === object && !parsed.has(tmp)) { - parsed.add(tmp); - output[k] = ignore; - lazy.push({ k, a: [input, parsed, tmp, $] }); - } else - output[k] = $.call(output, k, tmp); - } else if (output[k] !== ignore) - output[k] = $.call(output, k, value); - } - for (let { length } = lazy, i = 0; i < length; i++) { - const { k, a } = lazy[i]; - output[k] = $.call(output, k, revive.apply(null, a)); - } - return output; - }; - var set = (known, input, value) => { - const index = Primitive(input.push(value) - 1); - known.set(value, index); - return index; - }; - var parse3 = (text, reviver) => { - const input = $parse(text, Primitives).map(primitives); - const value = input[0]; - const $ = reviver || noop; - const tmp = typeof value === object && value ? revive(input, /* @__PURE__ */ new Set(), value, $) : value; - return $.call({ "": tmp }, "", tmp); - }; - exports.parse = parse3; - var stringify2 = (value, replacer, space) => { - const $ = replacer && typeof replacer === object ? (k, v) => k === "" || -1 < replacer.indexOf(k) ? v : void 0 : replacer || noop; - const known = /* @__PURE__ */ new Map(); - const input = []; - const output = []; - let i = +set(known, input, $.call({ "": value }, "", value)); - let firstRun = !i; - while (i < input.length) { - firstRun = true; - output[i] = $stringify(input[i++], replace, space); - } - return "[" + output.join(",") + "]"; - function replace(key, value2) { - if (firstRun) { - firstRun = !firstRun; - return value2; - } - const after = $.call(this, key, value2); - switch (typeof after) { - case object: - if (after === null) - return after; - case primitive: - return known.get(after) || set(known, input, after); - } - return after; - } - }; - exports.stringify = stringify2; - var toJSON = (any) => $parse(stringify2(any)); - exports.toJSON = toJSON; - var fromJSON = (any) => parse3($stringify(any)); - exports.fromJSON = fromJSON; + /** + * Check to see if a filename matches any of the globs. + * If filename is relative, it is considered relative to the root. + * If filename is absolute and contained within the root, it will be made relative before being tested for a glob match. + * If filename is absolute and not contained within the root, it will be tested as is. + * @param filename full path of the file to check. + */ + match(filename) { + return this.matchEx(filename).matched; } -}); - -// node_modules/flat-cache/src/utils.js -var require_utils9 = __commonJS({ - "node_modules/flat-cache/src/utils.js"(exports, module2) { - var fs6 = require("fs"); - var path16 = require("path"); - var flatted = require_cjs11(); - module2.exports = { - tryParse: function(filePath, defaultValue) { - var result; - try { - result = this.readJSON(filePath); - } catch (ex) { - result = defaultValue; - } - return result; - }, - /** - * Read json file synchronously using flatted - * - * @method readJSON - * @param {String} filePath Json filepath - * @returns {*} parse result - */ - readJSON: function(filePath) { - return flatted.parse( - fs6.readFileSync(filePath, { - encoding: "utf8" - }) - ); - }, - /** - * Write json file synchronously using circular-json - * - * @method writeJSON - * @param {String} filePath Json filepath - * @param {*} data Object to serialize - */ - writeJSON: function(filePath, data) { - fs6.mkdirSync(path16.dirname(filePath), { - recursive: true - }); - fs6.writeFileSync(filePath, flatted.stringify(data)); - } +}; +function buildMatcherFn(patterns, options) { + const { nodePath: path26, dot, nobrace } = options; + const makeReOptions = { dot, nobrace }; + const rules = patterns.map((pattern, index) => ({ pattern, index })).filter((r) => !!r.pattern.glob).filter((r) => !r.pattern.glob.startsWith("#")).map(({ pattern, index }) => { + const matchNeg = pattern.glob.match(/^!/); + const glob2 = pattern.glob.replace(/^!/, ""); + const isNeg = matchNeg && matchNeg[0].length & 1 && true || false; + const reg = import_micromatch.default.makeRe(glob2, makeReOptions); + const fn2 = (filename) => { + const match2 = filename.match(reg); + return !!match2; }; - } -}); - -// node_modules/fs.realpath/old.js -var require_old = __commonJS({ - "node_modules/fs.realpath/old.js"(exports) { - var pathModule = require("path"); - var isWindows2 = process.platform === "win32"; - var fs6 = require("fs"); - var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); - function rethrow() { - var callback; - if (DEBUG) { - var backtrace = new Error(); - callback = debugCallback; - } else - callback = missingCallback; - return callback; - function debugCallback(err) { - if (err) { - backtrace.message = err.message; - err = backtrace; - missingCallback(err); - } - } - function missingCallback(err) { - if (err) { - if (process.throwDeprecation) - throw err; - else if (!process.noDeprecation) { - var msg = "fs: missing callback " + (err.stack || err.message); - if (process.traceDeprecation) - console.trace(msg); - else - console.error(msg); - } - } - } - } - function maybeCallback(cb) { - return typeof cb === "function" ? cb : rethrow(); - } - var normalize = pathModule.normalize; - if (isWindows2) { - nextPartRe = /(.*?)(?:[\/\\]+|$)/g; - } else { - nextPartRe = /(.*?)(?:[\/]+|$)/g; - } - var nextPartRe; - if (isWindows2) { - splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; - } else { - splitRootRe = /^[\/]*/; - } - var splitRootRe; - exports.realpathSync = function realpathSync2(p, cache) { - p = pathModule.resolve(p); - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return cache[p]; - } - var original = p, seenLinks = {}, knownHard = {}; - var pos; - var current; - var base; - var previous; - start(); - function start() { - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ""; - if (isWindows2 && !knownHard[base]) { - fs6.lstatSync(base); - knownHard[base] = true; - } - } - while (pos < p.length) { - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - if (knownHard[base] || cache && cache[base] === base) { + return { pattern, index, isNeg, fn: fn2, reg }; + }); + const negRules = rules.filter((r) => r.isNeg); + const posRules = rules.filter((r) => !r.isNeg); + const fn = (filename) => { + filename = path26.resolve(path26.normalize(filename)); + function testRules(rules2, matched) { + for (const rule of rules2) { + const pattern = rule.pattern; + const root = pattern.root; + const isRelPat = !pattern.isGlobalPattern; + if (isRelPat && !doesRootContainPath(root, filename, path26)) { continue; } - var resolvedLink; - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - resolvedLink = cache[base]; - } else { - var stat2 = fs6.lstatSync(base); - if (!stat2.isSymbolicLink()) { - knownHard[base] = true; - if (cache) - cache[base] = base; - continue; - } - var linkTarget = null; - if (!isWindows2) { - var id = stat2.dev.toString(32) + ":" + stat2.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - linkTarget = seenLinks[id]; - } - } - if (linkTarget === null) { - fs6.statSync(base); - linkTarget = fs6.readlinkSync(base); - } - resolvedLink = pathModule.resolve(previous, linkTarget); - if (cache) - cache[base] = resolvedLink; - if (!isWindows2) - seenLinks[id] = linkTarget; - } - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } - if (cache) - cache[original] = p; - return p; - }; - exports.realpath = function realpath(p, cache, cb) { - if (typeof cb !== "function") { - cb = maybeCallback(cache); - cache = null; - } - p = pathModule.resolve(p); - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return process.nextTick(cb.bind(null, null, cache[p])); - } - var original = p, seenLinks = {}, knownHard = {}; - var pos; - var current; - var base; - var previous; - start(); - function start() { - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ""; - if (isWindows2 && !knownHard[base]) { - fs6.lstat(base, function(err) { - if (err) - return cb(err); - knownHard[base] = true; - LOOP(); - }); - } else { - process.nextTick(LOOP); - } - } - function LOOP() { - if (pos >= p.length) { - if (cache) - cache[original] = p; - return cb(null, p); - } - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - if (knownHard[base] || cache && cache[base] === base) { - return process.nextTick(LOOP); - } - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - return gotResolvedLink(cache[base]); - } - return fs6.lstat(base, gotStat); - } - function gotStat(err, stat2) { - if (err) - return cb(err); - if (!stat2.isSymbolicLink()) { - knownHard[base] = true; - if (cache) - cache[base] = base; - return process.nextTick(LOOP); - } - if (!isWindows2) { - var id = stat2.dev.toString(32) + ":" + stat2.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - return gotTarget(null, seenLinks[id], base); - } + const relName = isRelPat ? path26.relative(root, filename) : filename; + const fname = path26.sep === "\\" ? relName.replace(/\\/g, "/") : relName; + if (rule.fn(fname)) { + return { + matched, + glob: pattern.glob, + root, + pattern, + index: rule.index, + isNeg: rule.isNeg + }; } - fs6.stat(base, function(err2) { - if (err2) - return cb(err2); - fs6.readlink(base, function(err3, target) { - if (!isWindows2) - seenLinks[id] = target; - gotTarget(err3, target); - }); - }); } - function gotTarget(err, target, base2) { - if (err) - return cb(err); - var resolvedLink = pathModule.resolve(previous, target); - if (cache) - cache[base2] = resolvedLink; - gotResolvedLink(resolvedLink); - } - function gotResolvedLink(resolvedLink) { - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } - }; + } + return testRules(negRules, false) || testRules(posRules, true) || { matched: false }; + }; + return fn; +} + +// src/action.ts +var path25 = __toESM(require("path")); + +// src/ActionParams.ts +var import_fs = require("fs"); +var defaultActionParams = { + github_token: "", + files: "", + incremental_files_only: "true", + config: "", + root: "", + inline: "warning", + strict: "true", + verbose: "false", + check_dot_files: "explicit" +}; +function applyDefaults(params) { + const results = { ...params }; + const alias = results; + for (const [key, value] of Object.entries(defaultActionParams)) { + alias[key] = alias[key] || value; } -}); + return results; +} +function validateToken(params) { + const token = params.github_token; + return !token ? "Missing GITHUB Token" : void 0; +} +function validateConfig(params) { + const config = params.config; + const success = !config || (0, import_fs.existsSync)(config); + return !success ? `Configuration file "${config}" not found.` : void 0; +} +function validateRoot(params) { + const root = params.root; + const success = !root || (0, import_fs.existsSync)(root); + return !success ? `Root path does not exist: "${root}"` : void 0; +} +function validateInlineLevel(params) { + const inline = params.inline; + const success = isInlineWorkflowCommand(inline); + return !success ? `Invalid inline level (${inline}), must be one of (error, warning, none)` : void 0; +} +var validateStrict = validateTrueFalse("strict", "Invalid strict setting, must be one of (true, false)"); +var validateIncrementalFilesOnly = validateTrueFalse( + "incremental_files_only", + "Invalid incremental_files_only setting, must be one of (true, false)" +); +var validateVerbose = validateTrueFalse("verbose", "Invalid verbose setting, must be one of (true, false)"); +function validateTrueFalse(key, msg) { + return (params) => { + const value = params[key]; + const success = value === "true" || value === "false"; + return !success ? msg : void 0; + }; +} +var inlineWorkflowCommandSet = { + error: true, + warning: true, + none: true +}; +function isInlineWorkflowCommand(cmd) { + return !!inlineWorkflowCommandSet[cmd]; +} +function validateActionParams(params, logError2) { + const validations = [ + validateToken, + validateConfig, + validateRoot, + validateInlineLevel, + validateStrict, + validateIncrementalFilesOnly, + validateVerbose + ]; + const success = validations.map((fn) => fn(params)).map((msg) => !msg || (logError2(msg), false)).reduce((a, b) => a && b, true); + if (!success) { + throw new AppError("Bad Configuration."); + } +} -// node_modules/fs.realpath/index.js -var require_fs5 = __commonJS({ - "node_modules/fs.realpath/index.js"(exports, module2) { - module2.exports = realpath; - realpath.realpath = realpath; - realpath.sync = realpathSync2; - realpath.realpathSync = realpathSync2; - realpath.monkeypatch = monkeypatch; - realpath.unmonkeypatch = unmonkeypatch; - var fs6 = require("fs"); - var origRealpath = fs6.realpath; - var origRealpathSync = fs6.realpathSync; - var version3 = process.version; - var ok = /^v[0-5]\./.test(version3); - var old = require_old(); - function newError(er) { - return er && er.syscall === "realpath" && (er.code === "ELOOP" || er.code === "ENOMEM" || er.code === "ENAMETOOLONG"); - } - function realpath(p, cache, cb) { - if (ok) { - return origRealpath(p, cache, cb); - } - if (typeof cache === "function") { - cb = cache; - cache = null; - } - origRealpath(p, cache, function(er, result) { - if (newError(er)) { - old.realpath(p, cache, cb); - } else { - cb(er, result); - } - }); - } - function realpathSync2(p, cache) { - if (ok) { - return origRealpathSync(p, cache); - } - try { - return origRealpathSync(p, cache); - } catch (er) { - if (newError(er)) { - return old.realpathSync(p, cache); - } else { - throw er; - } +// src/getActionParams.ts +var core = __toESM(require_core()); +function getActionParams() { + return applyDefaults({ + github_token: core.getInput("github_token", { required: true }), + files: core.getInput("files"), + incremental_files_only: tf(core.getInput("incremental_files_only")), + config: core.getInput("config"), + root: core.getInput("root"), + inline: core.getInput("inline").toLowerCase(), + strict: tf(core.getInput("strict")), + verbose: tf(core.getInput("verbose")), + check_dot_files: tf(core.getInput("check_dot_files")) + }); +} +function tf(v) { + const mapValues = { + true: "true", + t: "true", + false: "false", + f: "false", + "0": "false", + "1": "true" + }; + v = typeof v === "boolean" || typeof v === "number" ? v ? "true" : "false" : v; + v = v.toString(); + v = v.toLowerCase(); + v = mapValues[v] || v; + return v; +} + +// src/github.ts +var import_plugin_rest_endpoint_methods = __toESM(require_dist_node11()); +async function getPullRequestFiles(git, prRef) { + const { owner, repo, pull_number } = prRef; + const { rest } = (0, import_plugin_rest_endpoint_methods.restEndpointMethods)(git); + const commits = await rest.pulls.listCommits({ owner, repo, pull_number }); + return fetchFilesForCommits(git, prRef, commits.data.map((c) => c.sha).filter(isString)); +} +function isString(s) { + return typeof s === "string"; +} +async function fetchFilesForCommits(git, context, commitIds) { + const files = /* @__PURE__ */ new Set(); + for await (const file of fetchFilesForCommitsX(git, context, commitIds)) { + files.add(file); + } + return files; +} +async function* fetchFilesForCommitsX(git, context, commitIds) { + const { owner, repo } = context; + const { rest } = (0, import_plugin_rest_endpoint_methods.restEndpointMethods)(git); + for (const ref of commitIds) { + const commit = await rest.repos.getCommit({ owner, repo, ref }); + const files = commit.data.files; + if (!files) + continue; + for (const f of files) { + if (f.filename) { + yield f.filename; } } - function monkeypatch() { - fs6.realpath = realpath; - fs6.realpathSync = realpathSync2; - } - function unmonkeypatch() { - fs6.realpath = origRealpath; - fs6.realpathSync = origRealpathSync; - } } -}); +} -// node_modules/concat-map/index.js -var require_concat_map = __commonJS({ - "node_modules/concat-map/index.js"(exports, module2) { - module2.exports = function(xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (isArray(x)) - res.push.apply(res, x); - else - res.push(x); - } - return res; +// src/reporter.ts +var core2 = __toESM(require_core()); +var import_command = __toESM(require_command()); +var import_vscode_uri = __toESM(require_umd()); +var path = __toESM(require("path")); +function nullEmitter(_msg) { +} +var CSpellReporterForGithubAction = class { + constructor(reportIssueCommand, options, logger = core2) { + this.reportIssueCommand = reportIssueCommand; + this.options = options; + this.logger = logger; + this.issues = []; + this.issueCounts = /* @__PURE__ */ new Map(); + this.result = { + files: -1, + filesWithIssues: /* @__PURE__ */ new Set(), + issues: -1, + errors: -1, + cachedFiles: 0 }; - var isArray = Array.isArray || function(xs) { - return Object.prototype.toString.call(xs) === "[object Array]"; + this.finished = false; + this.reporter = { + debug: (...args) => this._debug(...args), + error: (...args) => this._error(...args), + info: (...args) => this._info(...args), + issue: (...args) => this._issue(...args), + progress: (...args) => this._progress(...args), + result: (...args) => this._result(...args) }; + this.verbose = options.verbose; } -}); - -// node_modules/balanced-match/index.js -var require_balanced_match = __commonJS({ - "node_modules/balanced-match/index.js"(exports, module2) { - "use strict"; - module2.exports = balanced; - function balanced(a, b, str) { - if (a instanceof RegExp) - a = maybeMatch(a, str); - if (b instanceof RegExp) - b = maybeMatch(b, str); - var r = range(a, b, str); - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; - } - function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; + _issue(issue) { + const { issues, issueCounts } = this; + const uri = issue.uri; + uri && issueCounts.set(uri, (issueCounts.get(uri) || 0) + 1); + issues.push(issue); + } + _info(message, _msgType) { + this._debug(message); + } + _debug(message) { + nullEmitter(message); + } + _progress(progress) { + if (!this.verbose || !isProgressFileComplete(progress)) { + return; } - balanced.range = range; - function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var 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) { - result = [begs.pop(), bi]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - bi = str.indexOf(b, i + 1); - } - i = ai < bi && ai >= 0 ? ai : bi; - } - if (begs.length) { - result = [left, right]; - } - } - return result; + const { issueCounts, logger } = this; + const issueCount = issueCounts.get(progress.filename) || 0; + const { fileNum, fileCount, filename, elapsedTimeMs } = progress; + const issues = issueCount ? ` issues: ${issueCount}` : ""; + const timeMsg = elapsedTimeMs ? `(${elapsedTimeMs.toFixed(2)}ms)` : "-"; + logger.info(`${fileNum}/${fileCount} ${filename}${issues} ${timeMsg}`); + } + _error(message, error2) { + const { logger } = this; + logger.error(`${message} + name: ${error2.name} + msg: ${error2.message} + stack: +${error2.stack} + `); + return; + } + _result(result) { + Object.assign(this.result, result); + this.finished = true; + const command = this.reportIssueCommand; + if (!["error", "warning"].includes(command)) { + return; } + const cwd = process.cwd(); + this.issues.forEach((item) => { + (0, import_command.issueCommand)( + command, + { + file: relative2(cwd, item.uri || ""), + line: item.row, + col: item.col + }, + `Unknown word (${item.text})` + ); + console.warn(`${relative2(cwd, item.uri || "")}:${item.row}:${item.col} Unknown word (${item.text})`); + }); + } +}; +function isProgressFileComplete(p) { + return p.type === "ProgressFileComplete"; +} +function relative2(cwd, fileUri) { + const fsPath = import_vscode_uri.URI.parse(fileUri).fsPath; + return path.relative(cwd, fsPath); +} + +// node_modules/@cspell/cspell-pipe/dist/helpers/iteratorToIterable.js +function* iteratorToIterable(iterator) { + let n; + while (!(n = iterator.next()).done) { + yield n.value; + } +} +async function* asyncIteratorToAsyncIterable(iterator) { + let n; + while (!(n = await iterator.next()).done) { + yield n.value; + } +} + +// node_modules/@cspell/cspell-pipe/dist/helpers/util.js +function toPipeFn(syncFn, asyncFn) { + function _(i) { + return isAsyncIterable(i) ? asyncFn(i) : syncFn(i); + } + return _; +} +function isAsyncIterable(i) { + return typeof i[Symbol.asyncIterator] === "function"; +} + +// node_modules/@cspell/cspell-pipe/dist/helpers/toArray.js +function toArray(i) { + return isAsyncIterable(i) ? toArrayAsync(i) : toArraySync(i); +} +function toArraySync(iter) { + return [...iter]; +} +async function toArrayAsync(iter) { + const collection = []; + for await (const i of iter) { + collection.push(i); + } + return collection; +} + +// node_modules/@cspell/cspell-pipe/dist/helpers/toAsyncIterable.js +async function* mergeAsyncIterables(iter, ...rest) { + for await (const i of [iter, ...rest]) { + yield* i; } +} +var toAsyncIterable = mergeAsyncIterables; + +// node_modules/@cspell/cspell-pipe/dist/operators/index.js +var operators_exports = {}; +__export(operators_exports, { + opAppend: () => opAppend, + opAppendAsync: () => opAppendAsync, + opAppendSync: () => opAppendSync, + opAwaitAsync: () => opAwaitAsync, + opCombineAsync: () => opCombineAsync, + opCombineSync: () => opCombineSync, + opConcatMap: () => opConcatMap, + opConcatMapAsync: () => opConcatMapAsync, + opConcatMapSync: () => opConcatMapSync, + opFilter: () => opFilter, + opFilterAsync: () => opFilterAsync, + opFilterSync: () => opFilterSync, + opFirst: () => opFirst, + opFirstAsync: () => opFirstAsync, + opFirstSync: () => opFirstSync, + opFlatten: () => opFlatten, + opFlattenAsync: () => opFlattenAsync, + opFlattenSync: () => opFlattenSync, + opJoinStrings: () => opJoinStrings, + opJoinStringsAsync: () => opJoinStringsAsync, + opJoinStringsSync: () => opJoinStringsSync, + opLast: () => opLast, + opLastAsync: () => opLastAsync, + opLastSync: () => opLastSync, + opMap: () => opMap, + opMapAsync: () => opMapAsync, + opMapSync: () => opMapSync, + opReduceAsync: () => opReduceAsync, + opReduceSync: () => opReduceSync, + opSkip: () => opSkip, + opSkipAsync: () => opSkipAsync, + opSkipSync: () => opSkipSync, + opTake: () => opTake, + opTakeAsync: () => opTakeAsync, + opTakeSync: () => opTakeSync, + opTap: () => opTap, + opTapAsync: () => opTapAsync, + opTapSync: () => opTapSync, + opUnique: () => opUnique, + opUniqueAsync: () => opUniqueAsync, + opUniqueSync: () => opUniqueSync }); -// node_modules/brace-expansion/index.js -var require_brace_expansion = __commonJS({ - "node_modules/brace-expansion/index.js"(exports, module2) { - var concatMap = require_concat_map(); - var balanced = require_balanced_match(); - module2.exports = expandTop; - var escSlash = "\0SLASH" + Math.random() + "\0"; - var escOpen = "\0OPEN" + Math.random() + "\0"; - var escClose = "\0CLOSE" + Math.random() + "\0"; - var escComma = "\0COMMA" + Math.random() + "\0"; - var escPeriod = "\0PERIOD" + Math.random() + "\0"; - function numeric(str) { - return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); - } - function escapeBraces(str) { - return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); +// node_modules/@cspell/cspell-pipe/dist/operators/append.js +function opAppendAsync(...iterablesToAppend) { + async function* fn(iter) { + yield* iter; + for (const i of iterablesToAppend) { + yield* i; } - function unescapeBraces(str) { - return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); + } + return fn; +} +function opAppendSync(...iterablesToAppend) { + function* fn(iter) { + yield* iter; + for (const i of iterablesToAppend) { + yield* i; } - function parseCommaParts(str) { - if (!str) - return [""]; - var parts = []; - var m = balanced("{", "}", str); - if (!m) - return str.split(","); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(","); - p[p.length - 1] += "{" + body + "}"; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length - 1] += postParts.shift(); - p.push.apply(p, postParts); - } - parts.push.apply(parts, p); - return parts; + } + return fn; +} +function opAppend(...iterablesToAppend) { + function _(i) { + return isAsyncIterable(i) ? opAppendAsync(...iterablesToAppend)(i) : opAppendSync(...iterablesToAppend)(i); + } + return _; +} + +// node_modules/@cspell/cspell-pipe/dist/operators/await.js +async function* _asyncAwait(iter) { + for await (const v of iter) { + yield v; + } +} +function opAwaitAsync() { + return _asyncAwait; +} + +// node_modules/@cspell/cspell-pipe/dist/operators/combine.js +function opCombineAsync(...fns) { + function combine4(iter) { + for (const fn of fns) { + iter = fn(iter); } - function expandTop(str) { - if (!str) - return []; - if (str.substr(0, 2) === "{}") { - str = "\\{\\}" + str.substr(2); - } - return expand(escapeBraces(str), true).map(unescapeBraces); + return iter; + } + return combine4; +} +function opCombineSync(...fns) { + function combine4(iter) { + for (const fn of fns) { + iter = fn(iter); } - function embrace(str) { - return "{" + str + "}"; + return iter; + } + return combine4; +} + +// node_modules/@cspell/cspell-pipe/dist/operators/concatMap.js +function opConcatMapAsync(mapFn) { + async function* fn(iter) { + for await (const v of iter) { + yield* mapFn(v); } - function isPadded(el) { - return /^-?0\d/.test(el); + } + return fn; +} +function opConcatMapSync(mapFn) { + function* fn(iter) { + for (const v of iter) { + yield* mapFn(v); } - function lte(i, y) { - return i <= y; + } + return fn; +} +var opConcatMap = (fn) => toPipeFn(opConcatMapSync(fn), opConcatMapAsync(fn)); + +// node_modules/@cspell/cspell-pipe/dist/operators/filter.js +function opFilterAsync(filterFn) { + async function* fn(iter) { + for await (const v of iter) { + const pass = await filterFn(v); + if (pass) + yield v; } - function gte(i, y) { - return i >= y; + } + return fn; +} +function opFilterSync(filterFn) { + function* fn(iter) { + for (const v of iter) { + if (filterFn(v)) + yield v; } - function expand(str, isTop) { - var expansions = []; - var m = balanced("{", "}", str); - if (!m || /\$$/.test(m.pre)) - return [str]; - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(",") >= 0; - if (!isSequence && !isOptions) { - if (m.post.match(/,.*\}/)) { - str = m.pre + "{" + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length ? expand(m.post, false) : [""]; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - var pre = m.pre; - var post = m.post.length ? expand(m.post, false) : [""]; - var N; - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length); - var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - N = []; - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === "\\") - c = ""; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join("0"); - if (i < 0) - c = "-" + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { - return expand(el, false); - }); + } + return fn; +} +function opFilter(fn) { + const asyncFn = opFilterAsync(fn); + const syncFn = opFilterSync(fn); + function _(i) { + return isAsyncIterable(i) ? asyncFn(i) : syncFn(i); + } + return _; +} + +// node_modules/@cspell/cspell-pipe/dist/operators/first.js +function opFirstAsync(firstFn) { + async function* fn(iter) { + for await (const v of iter) { + const pass = await firstFn(v); + if (pass) { + yield v; + break; } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } + } + } + return fn; +} +function opFirstSync(firstFn) { + function* fn(iter) { + for (const v of iter) { + if (firstFn(v)) { + yield v; + break; } - return expansions; } } -}); + return fn; +} +function opFirst(fn) { + const asyncFn = opFirstAsync(fn); + const syncFn = opFirstSync(fn); + function _(i) { + return isAsyncIterable(i) ? asyncFn(i) : syncFn(i); + } + return _; +} + +// node_modules/@cspell/cspell-pipe/dist/operators/flatten.js +function opFlattenAsync() { + async function* fn(iter) { + for await (const v of iter) { + yield* v; + } + } + return fn; +} +function opFlattenSync() { + function* fn(iter) { + for (const v of iter) { + yield* v; + } + } + return fn; +} +var opFlatten = () => toPipeFn(opFlattenSync(), opFlattenAsync()); -// node_modules/minimatch/minimatch.js -var require_minimatch = __commonJS({ - "node_modules/minimatch/minimatch.js"(exports, module2) { - module2.exports = minimatch; - minimatch.Minimatch = Minimatch; - var path16 = function() { - try { - return require("path"); - } catch (e) { - } - }() || { - sep: "/" - }; - minimatch.sep = path16.sep; - var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; - var expand = require_brace_expansion(); - var plTypes = { - "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, - "?": { open: "(?:", close: ")?" }, - "+": { open: "(?:", close: ")+" }, - "*": { open: "(?:", close: ")*" }, - "@": { open: "(?:", close: ")" } - }; - var qmark = "[^/]"; - var star = qmark + "*?"; - var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; - var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; - var reSpecials = charSet("().*{}+?[]^$\\!"); - function charSet(s) { - return s.split("").reduce(function(set, c) { - set[c] = true; - return set; - }, {}); - } - var slashSplit = /\/+/; - minimatch.filter = filter; - function filter(pattern, options) { - options = options || {}; - return function(p, i, list) { - return minimatch(p, pattern, options); - }; +// node_modules/@cspell/cspell-pipe/dist/operators/joinStrings.js +function opJoinStringsAsync(joinCharacter = ",") { + async function* fn(iter) { + for await (const v of iter) { + const a = await toArray(v); + yield a.join(joinCharacter); } - function ext(a, b) { - b = b || {}; - var t = {}; - Object.keys(a).forEach(function(k) { - t[k] = a[k]; - }); - Object.keys(b).forEach(function(k) { - t[k] = b[k]; - }); - return t; + } + return fn; +} +function opJoinStringsSync(joinCharacter = ",") { + function* fn(iter) { + for (const v of iter) { + const a = toArray(v); + yield a.join(joinCharacter); } - minimatch.defaults = function(def) { - if (!def || typeof def !== "object" || !Object.keys(def).length) { - return minimatch; - } - var orig = minimatch; - var m = function minimatch2(p, pattern, options) { - return orig(p, pattern, ext(def, options)); - }; - m.Minimatch = function Minimatch2(pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)); - }; - m.Minimatch.defaults = function defaults(options) { - return orig.defaults(ext(def, options)).Minimatch; - }; - m.filter = function filter2(pattern, options) { - return orig.filter(pattern, ext(def, options)); - }; - m.defaults = function defaults(options) { - return orig.defaults(ext(def, options)); - }; - m.makeRe = function makeRe2(pattern, options) { - return orig.makeRe(pattern, ext(def, options)); - }; - m.braceExpand = function braceExpand2(pattern, options) { - return orig.braceExpand(pattern, ext(def, options)); - }; - m.match = function(list, pattern, options) { - return orig.match(list, pattern, ext(def, options)); - }; - return m; - }; - Minimatch.defaults = function(def) { - return minimatch.defaults(def).Minimatch; - }; - function minimatch(p, pattern, options) { - assertValidPattern(pattern); - if (!options) - options = {}; - if (!options.nocomment && pattern.charAt(0) === "#") { - return false; + } + return fn; +} +var opJoinStrings = (joinCharacter) => toPipeFn(opJoinStringsSync(joinCharacter), opJoinStringsAsync(joinCharacter)); + +// node_modules/@cspell/cspell-pipe/dist/operators/last.js +var symNotFound = Symbol("LastNotFound"); +function opLastAsync(lastFn) { + async function* fn(iter) { + let last = symNotFound; + for await (const v of iter) { + const pass = await lastFn(v); + if (pass) { + last = v; } - return new Minimatch(pattern, options).match(p); } - function Minimatch(pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options); - } - assertValidPattern(pattern); - if (!options) - options = {}; - pattern = pattern.trim(); - if (!options.allowWindowsEscape && path16.sep !== "/") { - pattern = pattern.split(path16.sep).join("/"); + if (last !== symNotFound) + yield last; + } + return fn; +} +function opLastSync(lastFn) { + function* fn(iter) { + let last = symNotFound; + for (const v of iter) { + if (lastFn(v)) { + last = v; } - this.options = options; - this.set = []; - this.pattern = pattern; - this.regexp = null; - this.negate = false; - this.comment = false; - this.empty = false; - this.partial = !!options.partial; - this.make(); } - Minimatch.prototype.debug = function() { - }; - Minimatch.prototype.make = make; - function make() { - var pattern = this.pattern; - var options = this.options; - if (!options.nocomment && pattern.charAt(0) === "#") { - this.comment = true; - return; - } - if (!pattern) { - this.empty = true; - return; - } - this.parseNegate(); - var set = this.globSet = this.braceExpand(); - if (options.debug) - this.debug = function debug() { - console.error.apply(console, arguments); - }; - this.debug(this.pattern, set); - set = this.globParts = set.map(function(s) { - return s.split(slashSplit); - }); - this.debug(this.pattern, set); - set = set.map(function(s, si, set2) { - return s.map(this.parse, this); - }, this); - this.debug(this.pattern, set); - set = set.filter(function(s) { - return s.indexOf(false) === -1; - }); - this.debug(this.pattern, set); - this.set = set; + if (last !== symNotFound) + yield last; + } + return fn; +} +function opLast(fn) { + const asyncFn = opLastAsync(fn); + const syncFn = opLastSync(fn); + function _(i) { + return isAsyncIterable(i) ? asyncFn(i) : syncFn(i); + } + return _; +} + +// node_modules/@cspell/cspell-pipe/dist/operators/map.js +function opMapAsync(mapFn) { + async function* fn(iter) { + for await (const v of iter) { + yield mapFn(v); } - Minimatch.prototype.parseNegate = parseNegate; - function parseNegate() { - var pattern = this.pattern; - var negate = false; - var options = this.options; - var negateOffset = 0; - if (options.nonegate) - return; - for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) { - negate = !negate; - negateOffset++; - } - if (negateOffset) - this.pattern = pattern.substr(negateOffset); - this.negate = negate; + } + return fn; +} +function opMapSync(mapFn) { + function* fn(iter) { + for (const v of iter) { + yield mapFn(v); } - minimatch.braceExpand = function(pattern, options) { - return braceExpand(pattern, options); - }; - Minimatch.prototype.braceExpand = braceExpand; - function braceExpand(pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options; - } else { - options = {}; - } - } - pattern = typeof pattern === "undefined" ? this.pattern : pattern; - assertValidPattern(pattern); - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - return [pattern]; - } - return expand(pattern); + } + return fn; +} +var opMap = (fn) => toPipeFn(opMapSync(fn), opMapAsync(fn)); + +// node_modules/@cspell/cspell-pipe/dist/operators/reduce.js +function opReduceAsync(reduceFn, initialValue) { + async function* reduce4(head, tail) { + for await (const v of tail) { + head = reduceFn(head, v); } - var MAX_PATTERN_LENGTH = 1024 * 64; - var assertValidPattern = function(pattern) { - if (typeof pattern !== "string") { - throw new TypeError("invalid pattern"); - } - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError("pattern is too long"); - } - }; - Minimatch.prototype.parse = parse3; - var SUBPARSE = {}; - function parse3(pattern, isSub) { - assertValidPattern(pattern); - var options = this.options; - if (pattern === "**") { - if (!options.noglobstar) - return GLOBSTAR; - else - pattern = "*"; - } - if (pattern === "") - return ""; - var re = ""; - var hasMagic = !!options.nocase; - var escaping = false; - var patternListStack = []; - var negativeLists = []; - var stateChar; - var inClass = false; - var reClassStart = -1; - var classStart = -1; - var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)"; - var self = this; - function clearStateChar() { - if (stateChar) { - switch (stateChar) { - case "*": - re += star; - hasMagic = true; - break; - case "?": - re += qmark; - hasMagic = true; - break; - default: - re += "\\" + stateChar; - break; - } - self.debug("clearStateChar %j %j", stateChar, re); - stateChar = false; - } - } - for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) { - this.debug("%s %s %s %j", pattern, i, re, c); - if (escaping && reSpecials[c]) { - re += "\\" + c; - escaping = false; - continue; - } - switch (c) { - case "/": { - return false; - } - case "\\": - clearStateChar(); - escaping = true; - continue; - case "?": - case "*": - case "+": - case "@": - case "!": - this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c); - if (inClass) { - this.debug(" in class"); - if (c === "!" && i === classStart + 1) - c = "^"; - re += c; - continue; - } - self.debug("call clearStateChar %j", stateChar); - clearStateChar(); - stateChar = c; - if (options.noext) - clearStateChar(); - continue; - case "(": - if (inClass) { - re += "("; - continue; - } - if (!stateChar) { - re += "\\("; - continue; - } - patternListStack.push({ - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }); - re += stateChar === "!" ? "(?:(?!(?:" : "(?:"; - this.debug("plType %j %j", stateChar, re); - stateChar = false; - continue; - case ")": - if (inClass || !patternListStack.length) { - re += "\\)"; - continue; - } - clearStateChar(); - hasMagic = true; - var pl = patternListStack.pop(); - re += pl.close; - if (pl.type === "!") { - negativeLists.push(pl); - } - pl.reEnd = re.length; - continue; - case "|": - if (inClass || !patternListStack.length || escaping) { - re += "\\|"; - escaping = false; - continue; - } - clearStateChar(); - re += "|"; - continue; - case "[": - clearStateChar(); - if (inClass) { - re += "\\" + c; - continue; - } - inClass = true; - classStart = i; - reClassStart = re.length; - re += c; - continue; - case "]": - if (i === classStart + 1 || !inClass) { - re += "\\" + c; - escaping = false; - continue; - } - var cs = pattern.substring(classStart + 1, i); - try { - RegExp("[" + cs + "]"); - } catch (er) { - var sp = this.parse(cs, SUBPARSE); - re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]"; - hasMagic = hasMagic || sp[1]; - inClass = false; - continue; - } - hasMagic = true; - inClass = false; - re += c; - continue; - default: - clearStateChar(); - if (escaping) { - escaping = false; - } else if (reSpecials[c] && !(c === "^" && inClass)) { - re += "\\"; - } - re += c; - } - } - if (inClass) { - cs = pattern.substr(classStart + 1); - sp = this.parse(cs, SUBPARSE); - re = re.substr(0, reClassStart) + "\\[" + sp[0]; - hasMagic = hasMagic || sp[1]; - } - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + pl.open.length); - this.debug("setting tail", re, pl); - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_, $1, $2) { - if (!$2) { - $2 = "\\"; - } - return $1 + $1 + $2 + "|"; - }); - this.debug("tail=%j\n %s", tail, tail, pl, re); - var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; - hasMagic = true; - re = re.slice(0, pl.reStart) + t + "\\(" + tail; - } - clearStateChar(); - if (escaping) { - re += "\\\\"; - } - var addPatternStart = false; - switch (re.charAt(0)) { - case "[": - case ".": - case "(": - addPatternStart = true; - } - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n]; - var nlBefore = re.slice(0, nl.reStart); - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8); - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd); - var nlAfter = re.slice(nl.reEnd); - nlLast += nlAfter; - var openParensBefore = nlBefore.split("(").length - 1; - var cleanAfter = nlAfter; - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, ""); - } - nlAfter = cleanAfter; - var dollar = ""; - if (nlAfter === "" && isSub !== SUBPARSE) { - dollar = "$"; - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; - re = newRe; - } - if (re !== "" && hasMagic) { - re = "(?=.)" + re; - } - if (addPatternStart) { - re = patternStart + re; - } - if (isSub === SUBPARSE) { - return [re, hasMagic]; - } - if (!hasMagic) { - return globUnescape(pattern); + yield head; + } + async function* fn(iter) { + const ht = initialValue === void 0 ? await headTailAsync(iter) : { head: await initialValue, tail: iter }; + if (!ht) + return; + yield* reduce4(ht.head, ht.tail); + } + return fn; +} +function opReduceSync(reduceFn, initialValue) { + function* reduce4(head, tail) { + for (const v of tail) { + head = reduceFn(head, v); + } + yield head; + } + function* fn(iter) { + const ht = initialValue === void 0 ? headTail(iter) : { head: initialValue, tail: iter }; + if (!ht) + return; + yield* reduce4(ht.head, ht.tail); + } + return fn; +} +function headTail(iter) { + const iterator = iter[Symbol.iterator](); + const first3 = iterator.next(); + if (first3.done) + return void 0; + return { head: first3.value, tail: iteratorToIterable(iterator) }; +} +async function headTailAsync(iter) { + const iterator = isIterable(iter) ? iter[Symbol.iterator]() : iter[Symbol.asyncIterator](); + const first3 = await iterator.next(); + if (first3.done) + return void 0; + return { head: first3.value, tail: asyncIteratorToAsyncIterable(iterator) }; +} +function isIterable(i) { + return typeof i[Symbol.iterator] === "function"; +} + +// node_modules/@cspell/cspell-pipe/dist/operators/skip.js +function opSkipAsync(count3) { + async function* fn(iter) { + for await (const v of iter) { + if (count3 > 0) { + --count3; + continue; } - var flags = options.nocase ? "i" : ""; - try { - var regExp = new RegExp("^" + re + "$", flags); - } catch (er) { - return new RegExp("$."); + yield v; + } + } + return fn; +} +function opSkipSync(count3) { + function* fn(iter) { + for (const v of iter) { + if (count3 > 0) { + --count3; + continue; } - regExp._glob = pattern; - regExp._src = re; - return regExp; + yield v; } - minimatch.makeRe = function(pattern, options) { - return new Minimatch(pattern, options || {}).makeRe(); - }; - Minimatch.prototype.makeRe = makeRe; - function makeRe() { - if (this.regexp || this.regexp === false) - return this.regexp; - var set = this.set; - if (!set.length) { - this.regexp = false; - return this.regexp; + } + return fn; +} +var opSkip = (count3) => toPipeFn(opSkipSync(count3), opSkipAsync(count3)); + +// node_modules/@cspell/cspell-pipe/dist/operators/take.js +function opTakeAsync(count3) { + async function* fn(iter) { + if (count3 <= 0) + return; + for await (const v of iter) { + yield v; + if (--count3 <= 0) + return; + } + } + return fn; +} +function opTakeSync(count3) { + function* fn(iter) { + if (count3 <= 0) + return; + for (const v of iter) { + yield v; + if (--count3 <= 0) + return; + } + } + return fn; +} +var opTake = (count3) => toPipeFn(opTakeSync(count3), opTakeAsync(count3)); + +// node_modules/@cspell/cspell-pipe/dist/operators/tap.js +function opTapAsync(tapFn) { + async function* fn(iter) { + for await (const v of iter) { + tapFn(v); + yield v; + } + } + return fn; +} +function opTapSync(tapFn) { + function* fn(iter) { + for (const v of iter) { + tapFn(v); + yield v; + } + } + return fn; +} +var opTap = (fn) => toPipeFn(opTapSync(fn), opTapAsync(fn)); + +// node_modules/@cspell/cspell-pipe/dist/operators/unique.js +function opUniqueAsync(k) { + function fnK(k2) { + async function* fn2(iter) { + const s = /* @__PURE__ */ new Set(); + for await (const v of iter) { + const kk = k2(v); + if (s.has(kk)) + continue; + s.add(kk); + yield v; } - var options = this.options; - var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; - var flags = options.nocase ? "i" : ""; - var re = set.map(function(pattern) { - return pattern.map(function(p) { - return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src; - }).join("\\/"); - }).join("|"); - re = "^(?:" + re + ")$"; - if (this.negate) - re = "^(?!" + re + ").*$"; - try { - this.regexp = new RegExp(re, flags); - } catch (ex) { - this.regexp = false; + } + return fn2; + } + async function* fn(iter) { + const s = /* @__PURE__ */ new Set(); + for await (const v of iter) { + if (s.has(v)) + continue; + s.add(v); + yield v; + } + } + return k ? fnK(k) : fn; +} +function opUniqueSync(k) { + function fnK(key) { + function* fn2(iter) { + const s = /* @__PURE__ */ new Set(); + for (const v of iter) { + const kk = key(v); + if (s.has(kk)) + continue; + s.add(kk); + yield v; } - return this.regexp; } - minimatch.match = function(list, pattern, options) { - options = options || {}; - var mm2 = new Minimatch(pattern, options); - list = list.filter(function(f) { - return mm2.match(f); - }); - if (mm2.options.nonull && !list.length) { - list.push(pattern); + return fn2; + } + function* fn(iter) { + const s = /* @__PURE__ */ new Set(); + for (const v of iter) { + if (s.has(v)) + continue; + s.add(v); + yield v; + } + } + return k ? fnK(k) : fn; +} +var opUnique = (getKey) => toPipeFn(opUniqueSync(getKey), opUniqueAsync(getKey)); + +// node_modules/@cspell/cspell-pipe/dist/pipe.js +function pipeAsync(i, ...fns) { + const iter = toAsyncIterable(i); + return opCombineAsync(...fns)(iter); +} +function pipeSync(i, ...fns) { + return opCombineSync(...fns)(i); +} + +// node_modules/@cspell/cspell-pipe/dist/reduce.js +function reduceSync(iter, reduceFn, initialValue) { + const i = initialValue === void 0 ? pipeSync(iter, opReduceSync(reduceFn)) : pipeSync(iter, opReduceSync(reduceFn, initialValue)); + return [...i][0]; +} + +// node_modules/@cspell/cspell-pipe/dist/index.js +var operators = operators_exports; + +// node_modules/cspell-lib/dist/esm/util/Uri.mjs +var import_assert = __toESM(require("assert"), 1); +var import_vscodeUri = __toESM(require_vscodeUri(), 1); +var isFile = /^(?:[a-zA-Z]:|[/\\])/; +var isPossibleUri = /\w:\/\//; +var isUrl = /^(file:|stdin:|https?:|s?ftp:)/; +var STDIN_PROTOCOL = "stdin:"; +function toUri(uriOrFile) { + if (UriImpl.isUri(uriOrFile)) + return uriOrFile; + if (import_vscodeUri.URI.isUri(uriOrFile)) + return UriImpl.from(uriOrFile); + if (uriOrFile instanceof URL) + return UriImpl.parse(uriOrFile.toString()); + if (isUrlLike(uriOrFile)) + return UriImpl.parse(uriOrFile.href); + if (isUri(uriOrFile)) + return UriImpl.from(uriOrFile); + if (isUrl.test(uriOrFile)) + return UriImpl.parse(uriOrFile); + return isFile.test(uriOrFile) && !isPossibleUri.test(uriOrFile) ? UriImpl.file(normalizeDriveLetter(uriOrFile)) : UriImpl.parse(uriOrFile); +} +var hasDriveLetter = /^[A-Z]:/i; +function uriToFilePath(uri) { + const adj = uri.scheme === "stdin" ? { scheme: "file" } : {}; + return normalizeDriveLetter(import_vscodeUri.URI.from(UriImpl.from(uri, adj)).fsPath); +} +function normalizeDriveLetter(path26) { + return hasDriveLetter.test(path26) ? path26[0].toLowerCase() + path26.slice(1) : path26; +} +function isUrlLike(url) { + return !!url && typeof url === "object" && typeof url.href === "string" || false; +} +function isUri(uri) { + if (!uri || typeof uri !== "object") + return false; + if (UriImpl.isUri(uri)) + return true; + if (import_vscodeUri.URI.isUri(uri)) + return true; + const u = uri; + return typeof u.path === "string" && typeof u.scheme === "string"; +} +function basename(uri) { + return import_vscodeUri.Utils.basename(import_vscodeUri.URI.from(uri)); +} +var keys = ["scheme", "authority", "path", "query", "fragment"]; +var UriImpl = class _UriImpl { + constructor(uri) { + this.scheme = uri.scheme || ""; + uri.authority && (this.authority = uri.authority); + this.path = uri.path || ""; + uri.query && (this.query = uri.query); + uri.fragment && (this.fragment = uri.fragment); + } + toString() { + const path26 = this.path; + const base = `${this.scheme}://${this.authority || ""}${path26}`; + const query = this.query && `?${this.query}` || ""; + const fragment = this.fragment && `#${this.fragment}` || ""; + const url = base + query + fragment; + return encodeURI(url); + } + toJson() { + const { scheme, authority, path: path26, query, fragment } = this; + return { scheme, authority, path: path26, query, fragment }; + } + with(change) { + const { scheme, authority, path: path26, query, fragment } = this; + const u = { scheme, authority, path: path26, query, fragment }; + for (const key of keys) { + if (change[key] && typeof change[key] === "string") { + u[key] = change[key]; } - return list; - }; - Minimatch.prototype.match = function match(f, partial) { - if (typeof partial === "undefined") - partial = this.partial; - this.debug("match", f, this.pattern); - if (this.comment) - return false; - if (this.empty) - return f === ""; - if (f === "/" && partial) + } + return new _UriImpl(u); + } + static isUri(uri) { + return uri instanceof _UriImpl; + } + static from(uri, ...parts) { + let u = new _UriImpl(uri); + for (const part of parts) { + u = u.with(part); + } + return u; + } + static parse(uri) { + if (uri.startsWith(STDIN_PROTOCOL)) { + return _UriImpl.from(parseStdinUri(uri)); + } + const u = import_vscodeUri.URI.parse(uri); + return _UriImpl.from(u); + } + static file(filename) { + return _UriImpl.from(import_vscodeUri.URI.file(normalizeFilePath(filename))); + } + static stdin(filePath = "") { + return _UriImpl.from(_UriImpl.file(filePath), { scheme: "stdin" }); + } +}; +function normalizeFilePath(path26) { + return normalizeDriveLetter(path26.replace(/\\/g, "/")); +} +function parseStdinUri(uri) { + (0, import_assert.default)(uri.startsWith(STDIN_PROTOCOL)); + const idxSlash = STDIN_PROTOCOL.length; + let idxSlashEnd = idxSlash; + for (; uri[idxSlashEnd] === "/"; ++idxSlashEnd) { + } + const pathStart = idxSlashEnd; + const iH = uri.indexOf("#", pathStart); + const idxHash = iH > 0 ? iH : uri.length; + const iQ = uri.indexOf("?", pathStart); + const idxQ = iQ > 0 && iQ < idxHash ? iQ : idxHash; + const pathEnd = idxQ; + const path26 = uri.slice(pathStart, pathEnd); + const query = idxQ < idxHash ? uri.slice(idxQ + 1, idxHash) : ""; + const hash = uri.slice(idxHash + 1); + const pathPrefix = idxSlashEnd - idxSlash > 2 ? "/" : ""; + return { + scheme: "stdin", + path: pathPrefix + normalizeFilePath(decodeURI(path26)), + query: decodeURI(query), + fragment: decodeURI(hash) + }; +} + +// node_modules/cspell-lib/dist/esm/util/util.mjs +function clean(src) { + const r = src; + for (const key of Object.keys(r)) { + if (r[key] === void 0 || r[key] === null) { + delete r[key]; + } + } + return r; +} +function scanMap(accFn, init) { + let acc = init; + let first3 = true; + return function(value) { + if (first3 && acc === void 0) { + first3 = false; + acc = value; + return acc; + } + acc = accFn(acc, value); + return acc; + }; +} +function isDefined(v) { + return v !== void 0; +} +function isArrayEqual(a, b) { + if (a === b) + return true; + let isMatch = a.length === b.length; + for (let i = 0; i < a.length && isMatch; ++i) { + isMatch = a[i] === b[i]; + } + return isMatch; +} +function doSetsIntersect(a, b) { + function compare4(a2, b2) { + for (const item of a2) { + if (b2.has(item)) return true; - var options = this.options; - if (path16.sep !== "/") { - f = f.split(path16.sep).join("/"); - } - f = f.split(slashSplit); - this.debug(this.pattern, "split", f); - var set = this.set; - this.debug(this.pattern, "set", set); - var filename; - var i; - for (i = f.length - 1; i >= 0; i--) { - filename = f[i]; - if (filename) - break; - } - for (i = 0; i < set.length; i++) { - var pattern = set[i]; - var file = f; - if (options.matchBase && pattern.length === 1) { - file = [filename]; - } - var hit = this.matchOne(file, pattern, partial); - if (hit) { - if (options.flipNegate) - return true; - return !this.negate; - } + } + return false; + } + return a.size <= b.size ? compare4(a, b) : compare4(b, a); +} + +// node_modules/cspell-lib/dist/esm/Settings/Controller/configLoader/configLoader.mjs +var json = __toESM(require_src2(), 1); +var import_cosmiconfig = __toESM(require_dist(), 1); + +// node_modules/@cspell/cspell-service-bus/dist/esm/errors.mjs +var ErrorUnhandledRequest = class extends Error { + constructor(request) { + super(`Unhandled Request: ${request.type}`); + this.request = request; + } +}; +var ErrorServiceRequestDepthExceeded = class extends Error { + constructor(request, depth) { + super(`Service Request Depth ${depth} Exceeded: ${request.type}`); + this.request = request; + this.depth = depth; + } +}; +var UnhandledHandlerError = class extends Error { + constructor(handlerName, handlerDescription, cause) { + super(`Unhandled Error in Handler: ${handlerName}`); + this.handlerName = handlerName; + this.handlerDescription = handlerDescription; + this.cause = cause; + } +}; + +// node_modules/@cspell/cspell-service-bus/dist/esm/request.mjs +var BaseServiceRequest = class { + constructor(type, params) { + this.type = type; + this.params = params; + } +}; +var ServiceRequestCls = class extends BaseServiceRequest { + constructor(type, params) { + super(type, params); + } +}; +function createResponse(value, _req) { + return { value }; +} +function createResponseFail(_request, error2) { + return { error: error2 }; +} +function isServiceResponseSuccess(res) { + return "value" in res && res.error === void 0; +} +function isServiceResponseFailure(res) { + return res.error !== void 0; +} + +// node_modules/@cspell/cspell-service-bus/dist/esm/bus.mjs +var MAX_DEPTH = 10; +var ServiceBus = class { + constructor(handlers = []) { + this.handlers = []; + handlers.forEach((h) => this.addHandler(h)); + } + addHandler(handler, name = "anonymous", description) { + const h = typeof handler === "function" ? { fn: handler, name, description } : handler; + const { fn, name: _name, description: _description } = h; + this.handlers.push({ fn, name: _name, description: _description }); + return this; + } + dispatch(request) { + let depth = 0; + const dispatcher = { dispatch }; + const handler = this.reduceHandlers(this.handlers, request, dispatcher, this.defaultHandler); + function dispatch(request2) { + ++depth; + if (depth >= MAX_DEPTH) { + return createResponseFail(request2, new ErrorServiceRequestDepthExceeded(request2, depth)); } - if (options.flipNegate) - return false; - return this.negate; - }; - Minimatch.prototype.matchOne = function(file, pattern, partial) { - var options = this.options; - this.debug( - "matchOne", - { "this": 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); - if (p === false) - return false; - if (p === GLOBSTAR) { - this.debug("GLOBSTAR", [pattern, p, f]); - var fr = fi; - var pr = pi + 1; - if (pr === pl) { - this.debug("** at the end"); - for (; fi < fl; fi++) { - if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") - return false; - } - return true; - } - while (fr < fl) { - var swallowee = file[fr]; - this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug("globstar found match!", fr, fl, swallowee); - return true; - } else { - if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { - this.debug("dot detected!", file, fr, pattern, pr); - break; - } - this.debug("globstar swallow a segment, and continue"); - fr++; - } - } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) - return true; - } - return false; - } - var hit; - if (typeof p === "string") { - hit = f === p; - this.debug("string match", p, f, hit); - } else { - hit = f.match(p); - this.debug("pattern match", p, f, hit); + const response = handler(request2); + --depth; + return response; + } + return dispatch(request); + } + defaultHandler(request) { + return createResponseFail(request, new ErrorUnhandledRequest(request)); + } + reduceHandlers(handlers, request, dispatcher, defaultHandler) { + const _handlers = handlers.map((m) => ({ ...m, fn: m.fn(dispatcher) })); + const handler = _handlers.reduce((next, h) => { + const fn = h.fn(next); + return (req) => { + try { + return fn(req); + } catch (e) { + return createResponseFail(request, new UnhandledHandlerError(h.name, h.description, e)); } - if (!hit) - return false; - } - if (fi === fl && pi === pl) { - return true; - } else if (fi === fl) { - return partial; - } else if (pi === pl) { - return fi === fl - 1 && file[fi] === ""; - } - throw new Error("wtf?"); - }; - function globUnescape(s) { - return s.replace(/\\(.)/g, "$1"); + }; + }, defaultHandler); + return handler; + } +}; + +// node_modules/@cspell/cspell-service-bus/dist/esm/createRequestHandler.mjs +function createRequestHandler(requestDef, fn, name, description) { + return createIsRequestHandler(requestDef.is, fn, name ?? requestDef.type, description); +} +function createIsRequestHandlerFn(isA, fn) { + return (dispatcher) => (next) => (request) => isA(request) ? fn(request, next, dispatcher) : next(request); +} +function createIsRequestHandler(isA, fn, name, description) { + return { + fn: createIsRequestHandlerFn(isA, fn), + name, + description + }; +} + +// node_modules/@cspell/cspell-service-bus/dist/esm/requestFactory.mjs +function requestFactory(requestType) { + class RequestClass extends ServiceRequestCls { + constructor(params) { + super(requestType, params); } - function regExpEscape(s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + static is(req) { + return req instanceof RequestClass && req.type === requestType; } + static create(params) { + return new RequestClass(params); + } + static createRequestHandler(fn, name, description) { + return createRequestHandler(RequestClass, fn, name, description); + } + } + RequestClass.type = requestType; + return RequestClass; +} + +// node_modules/cspell-io/dist/esm/common/stat.mjs +function compareStats(left, right) { + if (left === right) + return 0; + if (left.eTag || right.eTag) + return left.eTag === right.eTag ? 0 : (left.eTag || "") < (right.eTag || "") ? -1 : 1; + const diff = left.size - right.size || left.mtimeMs - right.mtimeMs; + return diff < 0 ? -1 : diff > 0 ? 1 : 0; +} + +// node_modules/cspell-io/dist/esm/errors/ErrorNotImplemented.mjs +var ErrorNotImplemented = class extends Error { + constructor(method) { + super(`Method ${method} is not supported.`); + this.method = method; + } +}; + +// node_modules/cspell-io/dist/esm/handlers/node/file.mjs +var import_assert2 = __toESM(require("assert"), 1); +var import_fs2 = require("fs"); +var import_url2 = require("url"); +var import_zlib = require("zlib"); + +// node_modules/cspell-io/dist/esm/common/arrayBuffers.mjs +function arrayBufferViewToBuffer(data) { + if (data instanceof Buffer) { + return data; + } + const buf = Buffer.from(data.buffer); + if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) { + return buf; + } + return buf.subarray(data.byteOffset, data.byteOffset + data.byteLength); +} +function copyArrayBufferView(data) { + return new Uint8Array(data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength)); +} + +// node_modules/cspell-io/dist/esm/common/encode-decode.mjs +var BOM_BE = 65279; +var BOM_LE = 65534; +function decodeUtf16LE(data) { + let buf = arrayBufferViewToBuffer(data); + const bom = buf[0] << 8 | buf[1]; + buf = bom === BOM_LE ? buf.subarray(2) : buf; + return buf.toString("utf16le"); +} +function decodeUtf16BE(buf) { + return decodeUtf16LE(swapBytes(buf)); +} +function decode(data, encoding) { + const buf = arrayBufferViewToBuffer(data); + switch (encoding) { + case "utf16be": + return decodeUtf16BE(buf); + case "utf16le": + return decodeUtf16LE(buf); + } + if (buf.length < 2 || encoding && !encoding.startsWith("utf")) + return buf.toString(encoding); + const bom = buf[0] << 8 | buf[1]; + if (bom === BOM_BE || buf[0] === 0 && buf[1] !== 0) + return decodeUtf16BE(buf); + if (bom === BOM_LE || buf[0] !== 0 && buf[1] === 0) + return decodeUtf16LE(buf); + return buf.toString(encoding); +} +function swapBytesInPlace(data) { + const buf = arrayBufferViewToBuffer(data); + buf.swap16(); + return buf; +} +function swapBytes(data) { + const buf = copyArrayBufferView(data); + return swapBytesInPlace(buf); +} + +// node_modules/cspell-io/dist/esm/errors/error.mjs +function toError(e) { + if (e instanceof Error) + return e; + if (typeof e === "object" && e && typeof e.message === "string") { + return e; + } + return Error(e && e.toString()); +} + +// node_modules/cspell-io/dist/esm/node/file/util.mjs +var import_url = require("url"); +var isURLRegExp = /^(\w{2,64}:\/\/|data:)/i; +function isUrlLike2(filename) { + return filename instanceof URL || isURLRegExp.test(filename); +} +function toURL(filename) { + return filename instanceof URL || typeof filename !== "string" ? filename : isUrlLike2(filename) ? new URL(filename) : (0, import_url.pathToFileURL)(filename); +} +var regMatchFilename = /filename=([^;,]*)/; +function urlBasename(url) { + function guessDataUrlName(header) { + const filenameMatch = header.match(regMatchFilename); + if (filenameMatch) + return filenameMatch[1]; + const mime = header.split(";", 1)[0]; + return mime.replace(/\W/g, "."); } -}); + if (typeof url === "string" && url.startsWith("data:")) { + return guessDataUrlName(url.split(",", 1)[0].split(":", 2)[1]); + } + url = toURL(url); + if (url.protocol === "data:") { + return guessDataUrlName(url.pathname.split(",", 1)[0]); + } + return basename2(url.pathname); +} +function urlDirname(url) { + if (typeof url === "string" && url.startsWith("data:")) { + return toURL("data:"); + } + url = toURL(url); + if (url.protocol === "data:") { + return toURL("data:"); + } + return new URL(url.pathname.endsWith("/") ? ".." : ".", url); +} +function basename2(path26) { + path26 = path26.endsWith("/") ? path26.slice(0, path26.length - 1) : path26; + const idx2 = path26.lastIndexOf("/"); + return idx2 >= 0 ? path26.slice(idx2 + 1) || "" : path26; +} -// node_modules/inherits/inherits_browser.js -var require_inherits_browser = __commonJS({ - "node_modules/inherits/inherits_browser.js"(exports, module2) { - if (typeof Object.create === "function") { - module2.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 { - module2.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; - } - }; - } +// node_modules/cspell-io/dist/esm/node/dataUrl.mjs +var dataUrlRegExHead = /^data:(?[^;,]*)(?(?:;[^=]+=[^;,]*)*)(?;base64)?$/; +function decodeDataUrl(url) { + url = url.toString(); + const [head, encodedData] = url.split(",", 2); + if (!head || encodedData === void 0) + throw Error("Not a data url"); + const match2 = head.match(dataUrlRegExHead); + if (!match2 || !match2.groups) + throw Error("Not a data url"); + const mediaType = match2.groups["mediaType"] || ""; + const rawAttributes = (match2.groups["attributes"] || "").split(";").filter((a) => !!a).map((entry) => entry.split("=", 2)).map(([key, value]) => [key, decodeURIComponent(value)]); + const attributes = new Map(rawAttributes); + const encoding = attributes.get("charset"); + const isBase64 = !!match2.groups["base64"]; + const data = isBase64 ? Buffer.from(encodedData, "base64url") : Buffer.from(decodeURIComponent(encodedData)); + return { mediaType, data, encoding, attributes }; +} + +// node_modules/cspell-io/dist/esm/node/file/fetch.mjs +var import_node_fetch = __toESM(require_lib3(), 1); + +// node_modules/cspell-io/dist/esm/node/file/FetchError.mjs +var FetchUrlError = class _FetchUrlError extends Error { + constructor(message, code, status, url) { + super(message); + this.code = code; + this.status = status; + this.url = url; + this.name = "FetchUrlError"; } -}); + static create(url, status, message) { + if (status === 404) + return new _FetchUrlError(message || "URL not found.", "ENOENT", status, url); + if (status >= 400 && status < 500) + return new _FetchUrlError(message || "Permission denied.", "EACCES", status, url); + return new _FetchUrlError(message || "Fatal Error", "ECONNREFUSED", status, url); + } +}; -// node_modules/inherits/inherits.js -var require_inherits = __commonJS({ - "node_modules/inherits/inherits.js"(exports, module2) { - try { - util = require("util"); - if (typeof util.inherits !== "function") - throw ""; - module2.exports = util.inherits; - } catch (e) { - module2.exports = require_inherits_browser(); - } - var util; +// node_modules/cspell-io/dist/esm/node/file/fetch.mjs +var fetch = import_node_fetch.default; +async function fetchHead(request) { + const r = await fetch(request, { method: "HEAD" }); + return r.headers; +} +async function fetchURL(url) { + const response = await fetch(url); + if (!response.ok) { + throw FetchUrlError.create(url, response.status); } -}); + return Buffer.from(await response.arrayBuffer()); +} -// node_modules/path-is-absolute/index.js -var require_path_is_absolute = __commonJS({ - "node_modules/path-is-absolute/index.js"(exports, module2) { - "use strict"; - function posix3(path16) { - return path16.charAt(0) === "/"; - } - function win32(path16) { - var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - var result = splitDeviceRe.exec(path16); - var device = result[1] || ""; - var isUnc = Boolean(device && device.charAt(1) !== ":"); - return Boolean(result[2] || isUnc); - } - module2.exports = process.platform === "win32" ? win32 : posix3; - module2.exports.posix = posix3; - module2.exports.win32 = win32; +// node_modules/cspell-io/dist/esm/node/file/stat.mjs +async function getStatHttp(url) { + const headers = await fetchHead(url); + const eTag = headers.get("etag") || void 0; + const guessSize = Number.parseInt(headers.get("content-length") || "0", 10); + return { + size: eTag ? -1 : guessSize, + mtimeMs: 0, + eTag + }; +} + +// node_modules/cspell-io/dist/esm/requests/RequestFsReadBinaryFile.mjs +var RequestType = "fs:readBinaryFile"; +var RequestFsReadBinaryFile = requestFactory(RequestType); +var RequestTypeSync = "fs:readBinaryFileSync"; +var RequestFsReadBinaryFileSync = requestFactory(RequestTypeSync); + +// node_modules/cspell-io/dist/esm/requests/RequestFsReadFile.mjs +var RequestType2 = "fs:readFile"; +var RequestFsReadFileText = requestFactory(RequestType2); + +// node_modules/cspell-io/dist/esm/requests/RequestFsReadFileSync.mjs +var RequestType3 = "fs:readFileSync"; +var RequestFsReadFileTextSync = requestFactory(RequestType3); + +// node_modules/cspell-io/dist/esm/requests/RequestFsStat.mjs +var RequestTypeStat = "fs:stat"; +var RequestFsStat = requestFactory(RequestTypeStat); +var RequestTypeStatSync = "fs:statSync"; +var RequestFsStatSync = requestFactory(RequestTypeStatSync); + +// node_modules/cspell-io/dist/esm/requests/RequestFsWriteFile.mjs +var RequestType4 = "fs:writeFile"; +var RequestFsWriteFile = requestFactory(RequestType4); + +// node_modules/cspell-io/dist/esm/requests/RequestZlibInflate.mjs +var RequestType5 = "zlib:inflate"; +var RequestZlibInflate = requestFactory(RequestType5); + +// node_modules/cspell-io/dist/esm/handlers/node/file.mjs +var isGzFileRegExp = /\.gz($|[?#])/; +function isGzFile(url) { + return isGzFileRegExp.test(url.pathname); +} +var handleRequestFsReadBinaryFile = RequestFsReadBinaryFile.createRequestHandler(({ params }) => createResponse(import_fs2.promises.readFile((0, import_url2.fileURLToPath)(params.url)).then((content) => ({ url: params.url, content }))), void 0, "Node: Read Binary File."); +var handleRequestFsReadBinaryFileSync = RequestFsReadBinaryFileSync.createRequestHandler(({ params }) => createResponse({ url: params.url, content: (0, import_fs2.readFileSync)((0, import_url2.fileURLToPath)(params.url)) }), void 0, "Node: Sync Read Binary File."); +var handleRequestFsReadFile = RequestFsReadFileText.createRequestHandler((req, _, dispatcher) => { + const { url, encoding } = req.params; + const res = dispatcher.dispatch(RequestFsReadBinaryFile.create({ url })); + if (!isServiceResponseSuccess(res)) { + (0, import_assert2.default)(isServiceResponseFailure(res)); + return createResponseFail(req, res.error); } -}); + return createResponse(res.value.then((res2) => { + const content = bufferToText(res2.content, encoding); + return { + url, + baseFilename: res2.baseFilename, + encoding, + ...content + }; + })); +}, void 0, "Node: Read Text File."); +var handleRequestFsReadFileSync = RequestFsReadFileTextSync.createRequestHandler((req, _, dispatcher) => { + const { url, encoding } = req.params; + const res = dispatcher.dispatch(RequestFsReadBinaryFileSync.create({ url })); + if (!isServiceResponseSuccess(res)) { + (0, import_assert2.default)(isServiceResponseFailure(res)); + return createResponseFail(req, res.error); + } + return createResponse({ + encoding, + ...res.value, + ...bufferToText(res.value.content, encoding) + }); +}, void 0, "Node: Sync Read Text File."); +var handleRequestZlibInflate = RequestZlibInflate.createRequestHandler(({ params }) => createResponse((0, import_zlib.gunzipSync)(params.data).toString("utf-8")), void 0, "Node: gz deflate."); +var supportedFetchProtocols = { "http:": true, "https:": true }; +var handleRequestFsReadBinaryFileHttp = RequestFsReadBinaryFile.createRequestHandler((req, next) => { + const { url } = req.params; + if (!(url.protocol in supportedFetchProtocols)) + return next(req); + return createResponse(fetchURL(url).then((content) => ({ url, content }))); +}, void 0, "Node: Read Http(s) file."); +var handleRequestFsReadBinaryFileSyncData = RequestFsReadBinaryFileSync.createRequestHandler((req, next) => { + const { url } = req.params; + if (url.protocol !== "data:") + return next(req); + const data = decodeDataUrl(url); + return createResponse({ url, content: data.data, baseFilename: data.attributes.get("filename") }); +}, void 0, "Node: Read data: urls."); +var handleRequestFsReadBinaryFileData = RequestFsReadBinaryFile.createRequestHandler((req, next, dispatcher) => { + const { url } = req.params; + if (url.protocol !== "data:") + return next(req); + const res = dispatcher.dispatch(RequestFsReadBinaryFileSync.create(req.params)); + if (!isServiceResponseSuccess(res)) + return res; + return createResponse(Promise.resolve(res.value)); +}, void 0, "Node: Read data: urls."); +function bufferToText(data, encoding) { + const buf = arrayBufferViewToBuffer(data); + const gz = buf[0] === 31 && buf[1] === 139; + const content = gz ? decode((0, import_zlib.gunzipSync)(buf), encoding) : decode(buf, encoding); + return { content, gz }; +} +var handleRequestFsStat = RequestFsStat.createRequestHandler(({ params }) => createResponse(import_fs2.promises.stat((0, import_url2.fileURLToPath)(params.url))), void 0, "Node: fs.stat."); +var handleRequestFsStatSync = RequestFsStatSync.createRequestHandler((req) => { + const { params } = req; + try { + return createResponse((0, import_fs2.statSync)((0, import_url2.fileURLToPath)(params.url))); + } catch (e) { + return createResponseFail(req, toError(e)); + } +}, void 0, "Node: fs.stat."); +var handleRequestFsStatHttp = RequestFsStat.createRequestHandler((req, next) => { + const { url } = req.params; + if (!(url.protocol in supportedFetchProtocols)) + return next(req); + return createResponse(getStatHttp(url)); +}, void 0, "Node: http get stat"); +var handleRequestFsWriteFile = RequestFsWriteFile.createRequestHandler(({ params }) => createResponse(import_fs2.promises.writeFile(params.url, params.content)), void 0, "Node: fs.writeFile"); +var handleRequestFsWriteFileGz = RequestFsWriteFile.createRequestHandler((req, next) => { + const { url, content } = req.params; + if (!isGzFile(url)) + return next(req); + return createResponse(import_fs2.promises.writeFile(url, (0, import_zlib.gzipSync)(content))); +}, void 0, "Node: http get stat"); +function registerHandlers(serviceBus) { + const handlers = [ + handleRequestFsWriteFile, + handleRequestFsWriteFileGz, + handleRequestFsReadBinaryFile, + handleRequestFsReadBinaryFileSync, + handleRequestFsReadBinaryFileHttp, + handleRequestFsReadBinaryFileData, + handleRequestFsReadBinaryFileSyncData, + handleRequestFsReadFile, + handleRequestFsReadFileSync, + handleRequestZlibInflate, + handleRequestFsStatSync, + handleRequestFsStat, + handleRequestFsStatHttp + ]; + handlers.forEach((handler) => serviceBus.addHandler(handler)); +} -// node_modules/glob/common.js -var require_common5 = __commonJS({ - "node_modules/glob/common.js"(exports) { - exports.setopts = setopts; - exports.ownProp = ownProp; - exports.makeAbs = makeAbs; - exports.finish = finish; - exports.mark = mark; - exports.isIgnored = isIgnored; - exports.childrenIgnored = childrenIgnored; - function ownProp(obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field); - } - var fs6 = require("fs"); - var path16 = require("path"); - var minimatch = require_minimatch(); - var isAbsolute = require_path_is_absolute(); - var Minimatch = minimatch.Minimatch; - function alphasort(a, b) { - return a.localeCompare(b, "en"); - } - function setupIgnores(self, options) { - self.ignore = options.ignore || []; - if (!Array.isArray(self.ignore)) - self.ignore = [self.ignore]; - if (self.ignore.length) { - self.ignore = self.ignore.map(ignoreMap); - } +// node_modules/cspell-io/dist/esm/CSpellIONode.mjs +var defaultCSpellIONode = void 0; +var CSpellIONode = class { + constructor(serviceBus = new ServiceBus()) { + this.serviceBus = serviceBus; + registerHandlers(serviceBus); + } + readFile(uriOrFilename, encoding = "utf8") { + const url = toURL(uriOrFilename); + const res = this.serviceBus.dispatch(RequestFsReadFileText.create({ url, encoding })); + if (!isServiceResponseSuccess(res)) { + throw genError(res.error, "readFile"); } - function ignoreMap(pattern) { - var gmatcher = null; - if (pattern.slice(-3) === "/**") { - var gpattern = pattern.replace(/(\/\*\*)+$/, ""); - gmatcher = new Minimatch(gpattern, { dot: true }); - } - return { - matcher: new Minimatch(pattern, { dot: true }), - gmatcher - }; + return res.value; + } + readFileSync(uriOrFilename, encoding = "utf8") { + const url = toURL(uriOrFilename); + const res = this.serviceBus.dispatch(RequestFsReadFileTextSync.create({ url, encoding })); + if (!isServiceResponseSuccess(res)) { + throw genError(res.error, "readFileSync"); } - function setopts(self, pattern, options) { - if (!options) - options = {}; - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar"); - } - pattern = "**/" + pattern; - } - self.silent = !!options.silent; - self.pattern = pattern; - self.strict = options.strict !== false; - self.realpath = !!options.realpath; - self.realpathCache = options.realpathCache || /* @__PURE__ */ Object.create(null); - self.follow = !!options.follow; - self.dot = !!options.dot; - self.mark = !!options.mark; - self.nodir = !!options.nodir; - if (self.nodir) - self.mark = true; - self.sync = !!options.sync; - self.nounique = !!options.nounique; - self.nonull = !!options.nonull; - self.nosort = !!options.nosort; - self.nocase = !!options.nocase; - self.stat = !!options.stat; - self.noprocess = !!options.noprocess; - self.absolute = !!options.absolute; - self.fs = options.fs || fs6; - self.maxLength = options.maxLength || Infinity; - self.cache = options.cache || /* @__PURE__ */ Object.create(null); - self.statCache = options.statCache || /* @__PURE__ */ Object.create(null); - self.symlinks = options.symlinks || /* @__PURE__ */ Object.create(null); - setupIgnores(self, options); - self.changedCwd = false; - var cwd = process.cwd(); - if (!ownProp(options, "cwd")) - self.cwd = cwd; - else { - self.cwd = path16.resolve(options.cwd); - self.changedCwd = self.cwd !== cwd; - } - self.root = options.root || path16.resolve(self.cwd, "/"); - self.root = path16.resolve(self.root); - if (process.platform === "win32") - self.root = self.root.replace(/\\/g, "/"); - self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd); - if (process.platform === "win32") - self.cwdAbs = self.cwdAbs.replace(/\\/g, "/"); - self.nomount = !!options.nomount; - options.nonegate = true; - options.nocomment = true; - options.allowWindowsEscape = false; - self.minimatch = new Minimatch(pattern, options); - self.options = self.minimatch.options; + return res.value; + } + writeFile(uriOrFilename, content) { + const url = toURL(uriOrFilename); + const res = this.serviceBus.dispatch(RequestFsWriteFile.create({ url, content })); + if (!isServiceResponseSuccess(res)) { + throw genError(res.error, "writeFile"); } - function finish(self) { - var nou = self.nounique; - var all = nou ? [] : /* @__PURE__ */ Object.create(null); - for (var i = 0, l = self.matches.length; i < l; i++) { - var matches = self.matches[i]; - if (!matches || Object.keys(matches).length === 0) { - if (self.nonull) { - var literal = self.minimatch.globSet[i]; - if (nou) - all.push(literal); - else - all[literal] = true; - } - } else { - var m = Object.keys(matches); - if (nou) - all.push.apply(all, m); - else - m.forEach(function(m2) { - all[m2] = true; - }); - } - } - if (!nou) - all = Object.keys(all); - if (!self.nosort) - all = all.sort(alphasort); - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]); - } - if (self.nodir) { - all = all.filter(function(e) { - var notDir = !/\/$/.test(e); - var c = self.cache[e] || self.cache[makeAbs(self, e)]; - if (notDir && c) - notDir = c !== "DIR" && !Array.isArray(c); - return notDir; - }); - } - } - if (self.ignore.length) - all = all.filter(function(m2) { - return !isIgnored(self, m2); - }); - self.found = all; + return res.value; + } + getStat(uriOrFilename) { + const url = toURL(uriOrFilename); + const res = this.serviceBus.dispatch(RequestFsStat.create({ url })); + if (!isServiceResponseSuccess(res)) { + throw genError(res.error, "getStat"); } - function mark(self, p) { - var abs = makeAbs(self, p); - var c = self.cache[abs]; - var m = p; - if (c) { - var isDir2 = c === "DIR" || Array.isArray(c); - var slash = p.slice(-1) === "/"; - if (isDir2 && !slash) - m += "/"; - else if (!isDir2 && slash) - m = m.slice(0, -1); - if (m !== p) { - var mabs = makeAbs(self, m); - self.statCache[mabs] = self.statCache[abs]; - self.cache[mabs] = self.cache[abs]; - } - } - return m; + return res.value; + } + getStatSync(uriOrFilename) { + const url = toURL(uriOrFilename); + const res = this.serviceBus.dispatch(RequestFsStatSync.create({ url })); + if (!isServiceResponseSuccess(res)) { + throw genError(res.error, "getStatSync"); } - function makeAbs(self, f) { - var abs = f; - if (f.charAt(0) === "/") { - abs = path16.join(self.root, f); - } else if (isAbsolute(f) || f === "") { - abs = f; - } else if (self.changedCwd) { - abs = path16.resolve(self.cwd, f); - } else { - abs = path16.resolve(f); - } - if (process.platform === "win32") - abs = abs.replace(/\\/g, "/"); - return abs; + return res.value; + } + compareStats(left, right) { + return compareStats(left, right); + } + toURL(uriOrFilename) { + return toURL(uriOrFilename); + } + uriBasename(uriOrFilename) { + return urlBasename(uriOrFilename); + } + uriDirname(uriOrFilename) { + return urlDirname(uriOrFilename); + } +}; +function genError(err, alt) { + return err || new ErrorNotImplemented(alt); +} +function getDefaultCSpellIO() { + if (defaultCSpellIONode) + return defaultCSpellIONode; + const cspellIO2 = new CSpellIONode(); + defaultCSpellIONode = cspellIO2; + return cspellIO2; +} + +// node_modules/cspell-io/dist/esm/node/file/fileReader.mjs +var Stream = __toESM(require("stream"), 1); +var import_util17 = require("util"); +var pipeline2 = (0, import_util17.promisify)(Stream.pipeline); + +// node_modules/cspell-io/dist/esm/node/file/fileWriter.mjs +var Stream2 = __toESM(require("stream"), 1); +var import_util19 = require("util"); +var pipeline4 = (0, import_util19.promisify)(Stream2.pipeline); + +// node_modules/cspell-io/dist/esm/file/file.mjs +var readFileText2 = function(filename, encoding) { + return getDefaultCSpellIO().readFile(filename, encoding).then((fr) => fr.content); +}; + +// node_modules/cspell-lib/dist/esm/Settings/Controller/configLoader/configLoader.mjs +var path10 = __toESM(require("path"), 1); + +// node_modules/cspell-lib/dist/esm/Models/CSpellSettingsInternalDef.mjs +var SymbolCSpellSettingsInternal = Symbol("CSpellSettingsInternal"); +function cleanCSpellSettingsInternal(parts = {}) { + const csi = clean(parts); + Object.assign(csi, { [SymbolCSpellSettingsInternal]: true }); + return csi; +} +function createCSpellSettingsInternal(parts = {}) { + return clean({ + ...parts, + [SymbolCSpellSettingsInternal]: true + }); +} +function isCSpellSettingsInternal(cs) { + return !!cs[SymbolCSpellSettingsInternal]; +} +function isDictionaryDefinitionInlineInternal(def) { + if (def.path) + return false; + const defInline = def; + return !!(defInline.words || defInline.flagWords || defInline.ignoreWords || defInline.suggestWords); +} + +// node_modules/cspell-lib/dist/esm/util/AutoResolveLRUCache.mjs +var import_assert3 = __toESM(require("assert"), 1); +var AutoResolveLRUCache = class { + constructor(maxSize, isEqual) { + this.maxSize = maxSize; + this.isEqual = isEqual; + this.list = {}; + this.count = 0; + this._misses = 0; + this._hits = 0; + this._added = 0; + this._removed = 0; + (0, import_assert3.default)(maxSize > 0); + } + get(params, fn) { + const isEqual = this.isEqual; + for (let n = this.list.n; n; n = n.n) { + if (isEqual(n.value.p, params)) { + this.addToHead(n); + ++this._hits; + return n.value.r; + } + } + ++this._misses; + if (!fn) + return void 0; + const value = { + p: params, + r: fn(params) + }; + this.addToHead({ value, n: void 0, p: void 0 }); + return value.r; + } + get size() { + return this.count; + } + get hits() { + return this._hits; + } + get misses() { + return this._misses; + } + get added() { + return this._added; + } + get removed() { + return this._removed; + } + clear() { + this._added = 0; + this._hits = 0; + this._misses = 0; + this._removed = 0; + this.list.n = void 0; + this.list.p = void 0; + this.count = 0; + } + addToHead(n) { + if (!this.list.n) { + this.list.n = n; + this.list.p = n; + n.n = void 0; + n.p = void 0; + this.count = 1; + this._added = 1; + return; } - function isIgnored(self, path17) { - if (!self.ignore.length) - return false; - return self.ignore.some(function(item) { - return item.matcher.match(path17) || !!(item.gmatcher && item.gmatcher.match(path17)); - }); + if (this.list.n === n) + return; + if (this.list.p === n) { + this.list.p = n.p; + } + const isNew = !n.n && !n.p; + n.p && (n.p.n = n.n); + n.n && (n.n.p = n.p); + n.p = void 0; + n.n = this.list.n; + n.n && (n.n.p = n); + this.list.n = n; + const add = isNew && 1 || 0; + this._added += add; + this.count += add; + if (this.count > this.maxSize) { + const prev = this.list.p?.p; + (0, import_assert3.default)(prev); + prev.n = void 0; + this.list.p = prev; + ++this._removed; + --this.count; + } + } + stats() { + return { size: this.count, hits: this.hits, misses: this.misses, added: this.added, removed: this.removed }; + } + toJSON() { + return this.stats(); + } + static assertValid(cache2) { + assertValidateLL(cache2.list); + } +}; +function assertValidateLL(list) { + if (!list.n && !list.p) + return; + (0, import_assert3.default)(list.n, "Bad Next"); + (0, import_assert3.default)(list.p, "Bad Prev"); + const visited = /* @__PURE__ */ new Set(); + let n = list; + for (; n.n; n = n.n) { + (0, import_assert3.default)(!visited.has(n.n), "Circular"); + visited.add(n.n); + } + (0, import_assert3.default)(list.p === n, "Tail matches"); + visited.clear(); + n = list; + for (; n.p; n = n.p) { + (0, import_assert3.default)(!visited.has(n.p), "Circular"); + visited.add(n.p); + } + (0, import_assert3.default)(list.n === n, "Head matches"); +} + +// node_modules/cspell-lib/dist/esm/util/logger.mjs +var _logger = console; +function logError(...args) { + _logger.error(...args); +} +function logWarning(...args) { + _logger.warn(...args); +} +function setLogger(logger) { + const oldLogger = _logger; + _logger = logger; + return oldLogger; +} + +// node_modules/cspell-lib/dist/esm/util/resolveFile.mjs +var fs2 = __toESM(require("fs"), 1); +var os = __toESM(require("os"), 1); +var path2 = __toESM(require("path"), 1); +var import_resolve_from = __toESM(require_resolve_from2(), 1); +var import_resolve_global = __toESM(require_resolve_global(), 1); +var testNodeModules = /^node_modules\//; +function resolveFile(filename, relativeTo) { + filename = filename.replace(/^~/, os.homedir()); + const steps = [ + { filename, fn: tryUrl }, + { filename, fn: tryNodeResolve }, + { filename: path2.resolve(relativeTo, filename), fn: tryResolveExists }, + { filename: path2.resolve(filename), fn: tryResolveExists }, + { filename, fn: tryNodeResolveDefaultPaths }, + { filename, fn: tryResolveFrom }, + { filename: filename.replace(testNodeModules, ""), fn: tryResolveFrom }, + { filename, fn: tryResolveGlobal } + ]; + for (const step of steps) { + const r = step.fn(step.filename, relativeTo); + if (r.found) + return r; + } + return { filename: path2.resolve(relativeTo, filename), relativeTo, found: false }; +} +var isUrlRegExp = /^\w+:\/\//i; +function tryUrl(filename, relativeTo) { + if (isUrlRegExp.test(filename)) { + return { filename, relativeTo: void 0, found: true }; + } + if (isUrlRegExp.test(relativeTo)) { + const url = new URL(filename, relativeTo); + return { filename: url.href, relativeTo, found: true }; + } + return { filename, relativeTo: void 0, found: false }; +} +function tryNodeResolveDefaultPaths(filename) { + try { + const r = require.resolve(filename); + return { filename: r, relativeTo: void 0, found: true }; + } catch (_) { + return { filename, relativeTo: void 0, found: false }; + } +} +function tryNodeResolve(filename, relativeTo) { + const home = os.homedir(); + function calcPaths(p) { + const paths2 = [p]; + if (filename.startsWith(".") && (filename.startsWith("./") || filename.startsWith("." + path2.sep) || filename.startsWith(".."))) { + return paths2; } - function childrenIgnored(self, path17) { - if (!self.ignore.length) - return false; - return self.ignore.some(function(item) { - return !!(item.gmatcher && item.gmatcher.match(path17)); - }); + for (; p && path2.dirname(p) !== p && p !== home; p = path2.dirname(p)) { + paths2.push(p); } + return paths2; } -}); + const paths = calcPaths(path2.resolve(relativeTo)); + try { + const r = require.resolve(filename, { paths }); + return { filename: r, relativeTo, found: true }; + } catch (_) { + return { filename, relativeTo, found: false }; + } +} +function tryResolveGlobal(filename) { + const r = import_resolve_global.default.silent(filename); + return { filename: r || filename, relativeTo: void 0, found: !!r }; +} +function tryResolveExists(filename) { + return { filename, relativeTo: void 0, found: fs2.existsSync(filename) }; +} +function tryResolveFrom(filename, relativeTo) { + try { + return { filename: (0, import_resolve_from.default)(relativeTo, filename), relativeTo, found: true }; + } catch (error2) { + return { filename, relativeTo, found: false }; + } +} -// node_modules/glob/sync.js -var require_sync8 = __commonJS({ - "node_modules/glob/sync.js"(exports, module2) { - module2.exports = globSync; - globSync.GlobSync = GlobSync; - var rp = require_fs5(); - var minimatch = require_minimatch(); - var Minimatch = minimatch.Minimatch; - var Glob = require_glob().Glob; - var util = require("util"); - var path16 = require("path"); - var assert7 = require("assert"); - var isAbsolute = require_path_is_absolute(); - var common = require_common5(); - var setopts = common.setopts; - var ownProp = common.ownProp; - var childrenIgnored = common.childrenIgnored; - var isIgnored = common.isIgnored; - function globSync(pattern, options) { - if (typeof options === "function" || arguments.length === 3) - throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167"); - return new GlobSync(pattern, options).found; - } - function GlobSync(pattern, options) { - if (!pattern) - throw new Error("must provide pattern"); - if (typeof options === "function" || arguments.length === 3) - throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167"); - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options); - setopts(this, pattern, options); - if (this.noprocess) - return this; - var n = this.minimatch.set.length; - this.matches = new Array(n); - for (var i = 0; i < n; i++) { - this._process(this.minimatch.set[i], i, false); - } - this._finish(); +// node_modules/cspell-lib/dist/esm/Settings/constants.mjs +var configSettingsFileVersion0_1 = "0.1"; +var configSettingsFileVersion0_2 = "0.2"; +var currentSettingsFileVersion = configSettingsFileVersion0_2; +var ENV_CSPELL_GLOB_ROOT = "CSPELL_GLOB_ROOT"; + +// node_modules/cspell-lib/dist/esm/Settings/CSpellSettingsServer.mjs +var import_assert7 = __toESM(require("assert"), 1); +var path4 = __toESM(require("path"), 1); + +// node_modules/cspell-lib/dist/esm/util/AutoResolve.mjs +function autoResolve(map3, key, resolve13) { + const found = map3.get(key); + if (found !== void 0 || map3.has(key)) + return found; + const value = resolve13(key); + map3.set(key, value); + return value; +} +var AutoResolveCache = class { + constructor() { + this.map = /* @__PURE__ */ new Map(); + } + get(k, resolve13) { + return resolve13 ? autoResolve(this.map, k, resolve13) : this.map.get(k); + } + has(k) { + return this.map.has(k); + } + set(k, v) { + this.map.set(k, v); + return this; + } +}; +function createAutoResolveCache() { + return new AutoResolveCache(); +} +function autoResolveWeak(map3, key, resolve13) { + const found = map3.get(key); + if (found !== void 0 || map3.has(key)) + return found; + const value = resolve13(key); + map3.set(key, value); + return value; +} +var AutoResolveWeakCache = class { + constructor() { + this.map = /* @__PURE__ */ new WeakMap(); + } + get(k, resolve13) { + return resolve13 ? autoResolveWeak(this.map, k, resolve13) : this.map.get(k); + } + has(k) { + return this.map.has(k); + } + set(k, v) { + this.map.set(k, v); + return this; + } +}; + +// node_modules/cspell-trie-lib/dist/lib/constants.js +var COMPOUND_FIX = "+"; +var OPTIONAL_COMPOUND_FIX = "*"; +var CASE_INSENSITIVE_PREFIX = "~"; +var FORBID_PREFIX = "!"; +var LINE_COMMENT = "#"; +var IDENTITY_PREFIX = "="; +var defaultTrieInfo = Object.freeze({ + compoundCharacter: COMPOUND_FIX, + forbiddenWordPrefix: FORBID_PREFIX, + stripCaseAndAccentsPrefix: CASE_INSENSITIVE_PREFIX, + isCaseAware: true +}); + +// node_modules/cspell-trie-lib/dist/lib/utils/memorizeLastCall.js +var SymEmpty = Symbol("memorizeLastCall"); +function memorizeLastCall(fn) { + let lastP = void 0; + let lastR = SymEmpty; + function calc(p) { + if (lastR !== SymEmpty && lastP === p) + return lastR; + lastP = p; + lastR = fn(p); + return lastR; + } + return calc; +} + +// node_modules/cspell-trie-lib/dist/lib/utils/mergeDefaults.js +function mergeDefaults(value, defaultValue) { + const result = { ...defaultValue }; + if (value) { + for (const [k, v] of Object.entries(value)) { + if (k in result) { + result[k] = v ?? result[k]; + } + } + } + return result; +} + +// node_modules/cspell-trie-lib/dist/lib/ITrieNode/find.js +var defaultLegacyMinCompoundLength = 3; +var _defaultFindOptions = { + matchCase: false, + compoundMode: "compound", + forbidPrefix: FORBID_PREFIX, + compoundFix: COMPOUND_FIX, + caseInsensitivePrefix: CASE_INSENSITIVE_PREFIX, + legacyMinCompoundLength: defaultLegacyMinCompoundLength +}; +var arrayCompoundModes = ["none", "compound", "legacy"]; +var knownCompoundModes = new Map(arrayCompoundModes.map((a) => [a, a])); +function findWord(root, word, options) { + return _findWord(root, word, createFindOptions(options)); +} +function findWordNode(root, word, options) { + return _findWordNode(root, word, createFindOptions(options)); +} +function _findWord(root, word, options) { + const { node: _, ...result } = _findWordNode(root, word, options); + return result; +} +function _findWordNode(root, word, options) { + const trieInfo = root.info; + const compoundMode = knownCompoundModes.get(options.compoundMode) || _defaultFindOptions.compoundMode; + const compoundPrefix = options.compoundMode === "compound" ? trieInfo.compoundCharacter ?? options.compoundFix : ""; + const ignoreCasePrefix = options.matchCase ? "" : trieInfo.stripCaseAndAccentsPrefix ?? options.caseInsensitivePrefix; + function __findCompound() { + const f = findCompoundWord(root, word, compoundPrefix, ignoreCasePrefix); + const result = { ...f }; + if (f.found !== false && f.compoundUsed) { + const r = !f.caseMatched ? walk(root, options.caseInsensitivePrefix) : root; + result.forbidden = isForbiddenWord(r, word, options.forbidPrefix); } - GlobSync.prototype._finish = function() { - assert7.ok(this instanceof GlobSync); - if (this.realpath) { - var self = this; - this.matches.forEach(function(matchset, index) { - var set = self.matches[index] = /* @__PURE__ */ Object.create(null); - for (var p in matchset) { - try { - p = self._makeAbs(p); - var real = rp.realpathSync(p, self.realpathCache); - set[real] = true; - } catch (er) { - if (er.syscall === "stat") - set[self._makeAbs(p)] = true; - else - throw er; - } - } - }); - } - common.finish(this); + return result; + } + function __findExact() { + const n = walk(root, word); + const isFound = isEndOfWordNode(n); + const result = { + found: isFound && word, + compoundUsed: false, + forbidden: isForbiddenWord(root, word, options.forbidPrefix), + node: n, + caseMatched: true }; - GlobSync.prototype._process = function(pattern, index, inGlobStar) { - assert7.ok(this instanceof GlobSync); - var n = 0; - while (typeof pattern[n] === "string") { - n++; - } - var prefix; - switch (n) { - case pattern.length: - this._processSimple(pattern.join("/"), index); - return; - case 0: - prefix = null; - break; - default: - prefix = pattern.slice(0, n).join("/"); + return result; + } + switch (compoundMode) { + case "none": + return options.matchCase ? __findExact() : __findCompound(); + case "compound": + return __findCompound(); + case "legacy": + return findLegacyCompound(root, word, options); + } +} +function findLegacyCompound(root, word, options) { + const roots = [root]; + if (!options.matchCase) { + roots.push(walk(root, options.caseInsensitivePrefix)); + } + return findLegacyCompoundNode(roots, word, options.legacyMinCompoundLength); +} +function findCompoundNode(root, word, compoundCharacter, ignoreCasePrefix) { + const stack = [ + // { n: root, compoundPrefix: '', cr: undefined, caseMatched: true }, + { n: root, compoundPrefix: ignoreCasePrefix, cr: void 0, caseMatched: true } + ]; + const compoundPrefix = compoundCharacter || ignoreCasePrefix; + const possibleCompoundPrefix = ignoreCasePrefix && compoundCharacter ? ignoreCasePrefix + compoundCharacter : ""; + const w = word.normalize(); + function determineRoot(s) { + const prefix = s.compoundPrefix; + let r = root; + let i2; + for (i2 = 0; i2 < prefix.length && r; ++i2) { + r = r.get(prefix[i2]); + } + const caseMatched2 = s.caseMatched && prefix[0] !== ignoreCasePrefix; + return { + n: s.n, + compoundPrefix: prefix === compoundPrefix ? possibleCompoundPrefix : "", + cr: r, + caseMatched: caseMatched2 + }; + } + let compoundUsed = false; + let caseMatched = true; + let i = 0; + let node; + while (true) { + const s = stack[i]; + const h = w[i++]; + const n = s.cr || s.n; + const c = n?.get(h); + if (c && i < word.length) { + caseMatched = s.caseMatched; + stack[i] = { n: c, compoundPrefix, cr: void 0, caseMatched }; + } else if (!c || !c.eow) { + node = node || c; + while (--i > 0) { + const s2 = stack[i]; + if (!s2.compoundPrefix || !s2.n?.hasChildren()) + continue; + if (s2.n.get(compoundCharacter)) break; } - var remain = pattern.slice(n); - var read2; - if (prefix === null) - read2 = "."; - else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) { - return typeof p === "string" ? p : "[*]"; - }).join("/"))) { - if (!prefix || !isAbsolute(prefix)) - prefix = "/" + prefix; - read2 = prefix; - } else - read2 = prefix; - var abs = this._makeAbs(read2); - if (childrenIgnored(this, read2)) - return; - var isGlobStar = remain[0] === minimatch.GLOBSTAR; - if (isGlobStar) - this._processGlobStar(prefix, read2, abs, remain, index, inGlobStar); - else - this._processReaddir(prefix, read2, abs, remain, index, inGlobStar); - }; - GlobSync.prototype._processReaddir = function(prefix, read2, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar); - if (!entries) - return; - var pn = remain[0]; - var negate = !!this.minimatch.negate; - var rawGlob = pn._glob; - var dotOk = this.dot || rawGlob.charAt(0) === "."; - var matchedEntries = []; - for (var i = 0; i < entries.length; i++) { - var e = entries[i]; - if (e.charAt(0) !== "." || dotOk) { - var m; - if (negate && !prefix) { - m = !e.match(pn); - } else { - m = e.match(pn); - } - if (m) - matchedEntries.push(e); + if (i >= 0 && stack[i].compoundPrefix) { + compoundUsed = i > 0; + const r = determineRoot(stack[i]); + stack[i] = r; + if (!r.cr) { + break; } - } - var len = matchedEntries.length; - if (len === 0) - return; - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = /* @__PURE__ */ Object.create(null); - for (var i = 0; i < len; i++) { - var e = matchedEntries[i]; - if (prefix) { - if (prefix.slice(-1) !== "/") - e = prefix + "/" + e; - else - e = prefix + e; - } - if (e.charAt(0) === "/" && !this.nomount) { - e = path16.join(this.root, e); + if (!i && !r.caseMatched) { + if (w !== w.toLowerCase()) { + break; } - this._emitMatch(index, e); } - return; - } - remain.shift(); - for (var i = 0; i < len; i++) { - var e = matchedEntries[i]; - var newPattern; - if (prefix) - newPattern = [prefix, e]; - else - newPattern = [e]; - this._process(newPattern.concat(remain), index, inGlobStar); - } - }; - GlobSync.prototype._emitMatch = function(index, e) { - if (isIgnored(this, e)) - return; - var abs = this._makeAbs(e); - if (this.mark) - e = this._mark(e); - if (this.absolute) { - e = abs; - } - if (this.matches[index][e]) - return; - if (this.nodir) { - var c = this.cache[abs]; - if (c === "DIR" || Array.isArray(c)) - return; + } else { + break; } - this.matches[index][e] = true; - if (this.stat) - this._stat(e); - }; - GlobSync.prototype._readdirInGlobStar = function(abs) { - if (this.follow) - return this._readdir(abs, false); - var entries; - var lstat; - var stat2; - try { - lstat = this.fs.lstatSync(abs); - } catch (er) { - if (er.code === "ENOENT") { - return null; + } else { + node = c; + caseMatched = s.caseMatched; + break; + } + } + const found = i && i === word.length && word || false; + const result = { found, compoundUsed, node, forbidden: void 0, caseMatched }; + return result; +} +function findCompoundWord(root, word, compoundCharacter, ignoreCasePrefix) { + const { found, compoundUsed, node, caseMatched } = findCompoundNode(root, word, compoundCharacter, ignoreCasePrefix); + if (!node || !node.eow) { + return { found: false, compoundUsed, node, forbidden: void 0, caseMatched }; + } + return { found, compoundUsed, node, forbidden: void 0, caseMatched }; +} +function findWordExact(root, word) { + return isEndOfWordNode(walk(root, word)); +} +function isEndOfWordNode(n) { + return !!n?.eow; +} +function walk(root, word) { + const w = word; + let n = root; + let i = 0; + while (n && i < word.length) { + const h = w[i++]; + n = n.get(h); + } + return n; +} +function findLegacyCompoundNode(roots, word, minCompoundLength) { + const root = roots[0]; + const numRoots = roots.length; + const stack = [ + { n: root, usedRoots: 1, subLength: 0, isCompound: false, cr: void 0, caseMatched: true } + ]; + const w = word; + const wLen = w.length; + let compoundUsed = false; + let caseMatched = true; + let i = 0; + let node; + while (true) { + const s = stack[i]; + const h = w[i++]; + const n = s.cr || s.n; + const c = n?.get(h); + if (c && i < wLen) { + stack[i] = { + n: c, + usedRoots: 0, + subLength: s.subLength + 1, + isCompound: s.isCompound, + cr: void 0, + caseMatched: s.caseMatched + }; + } else if (!c || !c.eow || c.eow && s.subLength < minCompoundLength - 1) { + while (--i > 0) { + const s2 = stack[i]; + if (s2.usedRoots < numRoots && s2.n?.eow && (s2.subLength >= minCompoundLength || !s2.subLength) && wLen - i >= minCompoundLength) { + break; } } - var isSym = lstat && lstat.isSymbolicLink(); - this.symlinks[abs] = isSym; - if (!isSym && lstat && !lstat.isDirectory()) - this.cache[abs] = "FILE"; - else - entries = this._readdir(abs, false); - return entries; - }; - GlobSync.prototype._readdir = function(abs, inGlobStar) { - var entries; - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs); - if (ownProp(this.cache, abs)) { - var c = this.cache[abs]; - if (!c || c === "FILE") - return null; - if (Array.isArray(c)) - return c; - } - try { - return this._readdirEntries(abs, this.fs.readdirSync(abs)); - } catch (er) { - this._readdirError(abs, er); - return null; + if (i > 0 || stack[i].usedRoots < numRoots) { + compoundUsed = i > 0; + const s2 = stack[i]; + s2.cr = roots[s2.usedRoots++]; + s2.subLength = 0; + s2.isCompound = compoundUsed; + s2.caseMatched = s2.caseMatched && s2.usedRoots <= 1; + } else { + break; } - }; - GlobSync.prototype._readdirEntries = function(abs, entries) { - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i++) { - var e = entries[i]; - if (abs === "/") - e = abs + e; - else - e = abs + "/" + e; - this.cache[e] = true; + } else { + node = c; + caseMatched = s.caseMatched; + break; + } + } + function extractWord() { + if (!word || i < word.length) + return false; + const letters = []; + let subLen = 0; + for (let j = 0; j < i; ++j) { + const { subLength } = stack[j]; + if (subLength < subLen) { + letters.push("+"); + } + letters.push(word[j]); + subLen = subLength; + } + return letters.join(""); + } + const found = extractWord(); + const result = { found, compoundUsed, node, forbidden: void 0, caseMatched }; + return result; +} +function isForbiddenWord(root, word, forbiddenPrefix) { + return findWordExact(root?.get(forbiddenPrefix), word); +} +var createFindOptions = memorizeLastCall(_createFindOptions); +function _createFindOptions(options) { + return mergeDefaults(options, _defaultFindOptions); +} + +// node_modules/cspell-trie-lib/dist/lib/walker/walkerTypes.js +var JOIN_SEPARATOR = "+"; +var WORD_SEPARATOR = " "; +var CompoundWordsMethod; +(function(CompoundWordsMethod2) { + CompoundWordsMethod2[CompoundWordsMethod2["NONE"] = 0] = "NONE"; + CompoundWordsMethod2[CompoundWordsMethod2["SEPARATE_WORDS"] = 1] = "SEPARATE_WORDS"; + CompoundWordsMethod2[CompoundWordsMethod2["JOIN_WORDS"] = 2] = "JOIN_WORDS"; +})(CompoundWordsMethod || (CompoundWordsMethod = {})); + +// node_modules/cspell-trie-lib/dist/lib/ITrieNode/walker/walker.js +function* compoundWalker(root, compoundingMethod) { + const empty = Object.freeze([]); + const roots = { + [CompoundWordsMethod.NONE]: empty, + [CompoundWordsMethod.JOIN_WORDS]: [[JOIN_SEPARATOR, root]], + [CompoundWordsMethod.SEPARATE_WORDS]: [[WORD_SEPARATOR, root]] + }; + const rc = roots[compoundingMethod].length ? roots[compoundingMethod] : void 0; + function children(n) { + if (n.hasChildren()) { + const c = n.keys().map((k, i) => [k, n.child(i)]); + return n.eow && rc ? c.concat(rc) : c; + } + if (n.eow) { + return roots[compoundingMethod]; + } + return empty; + } + let depth = 0; + const stack = []; + stack[depth] = { t: "", c: children(root), ci: 0 }; + while (depth >= 0) { + let s = stack[depth]; + let baseText = s.t; + while (s.ci < s.c.length) { + const [char, node] = s.c[s.ci++]; + const text = baseText + char; + const goDeeper = yield { text, node, depth }; + if (goDeeper ?? true) { + depth++; + baseText = text; + stack[depth] = { t: text, c: children(node), ci: 0 }; + } + s = stack[depth]; + } + depth -= 1; + } +} +function* nodeWalker(root) { + let depth = 0; + const stack = []; + stack[depth] = { t: "", n: root, c: root.keys(), ci: 0 }; + while (depth >= 0) { + let s = stack[depth]; + let baseText = s.t; + while (s.ci < s.c.length && s.n) { + const idx2 = s.ci++; + const char = s.c[idx2]; + const node = s.n.child(idx2); + const text = baseText + char; + const goDeeper = yield { text, node, depth }; + if (goDeeper !== false) { + depth++; + baseText = text; + const s2 = stack[depth]; + const c = node.keys(); + if (s2) { + s2.t = text; + s2.n = node; + s2.c = c; + s2.ci = 0; + } else { + stack[depth] = { t: text, n: node, c, ci: 0 }; } } - this.cache[abs] = entries; - return entries; - }; - GlobSync.prototype._readdirError = function(f, er) { - switch (er.code) { - case "ENOTSUP": - case "ENOTDIR": - var abs = this._makeAbs(f); - this.cache[abs] = "FILE"; - if (abs === this.cwdAbs) { - var error2 = new Error(er.code + " invalid cwd " + this.cwd); - error2.path = this.cwd; - error2.code = er.code; - throw error2; - } - break; - case "ENOENT": - case "ELOOP": - case "ENAMETOOLONG": - case "UNKNOWN": - this.cache[this._makeAbs(f)] = false; - break; - default: - this.cache[this._makeAbs(f)] = false; - if (this.strict) - throw er; - if (!this.silent) - console.error("glob error", er); - break; + s = stack[depth]; + } + depth -= 1; + } +} +function walker(root, compoundingMethod = CompoundWordsMethod.NONE) { + return compoundingMethod === CompoundWordsMethod.NONE ? nodeWalker(root) : compoundWalker(root, compoundingMethod); +} +function walkerWords(root) { + return walkerWordsITrie(root); +} +function* walkerWordsITrie(root) { + let depth = 0; + const stack = []; + stack[depth] = { t: "", n: root, c: root.keys(), ci: 0 }; + while (depth >= 0) { + let s = stack[depth]; + let baseText = s.t; + while (s.ci < s.c.length && s.n) { + const char = s.c[s.ci++]; + const node = s.n.get(char); + if (!node) + continue; + const text = baseText + char; + if (node.eow) + yield text; + depth++; + baseText = text; + const c = node.keys(); + if (stack[depth]) { + s = stack[depth]; + s.t = text; + s.n = node; + s.c = c; + s.ci = 0; + } else { + stack[depth] = { t: text, n: node, c, ci: 0 }; } - }; - GlobSync.prototype._processGlobStar = function(prefix, read2, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar); - if (!entries) - return; - var remainWithoutGlobStar = remain.slice(1); - var gspref = prefix ? [prefix] : []; - var noGlobStar = gspref.concat(remainWithoutGlobStar); - this._process(noGlobStar, index, false); - var len = entries.length; - var isSym = this.symlinks[abs]; - if (isSym && inGlobStar) - return; - for (var i = 0; i < len; i++) { - var e = entries[i]; - if (e.charAt(0) === "." && !this.dot) - continue; - var instead = gspref.concat(entries[i], remainWithoutGlobStar); - this._process(instead, index, true); - var below = gspref.concat(entries[i], remain); - this._process(below, index, true); + s = stack[depth]; + } + depth -= 1; + } +} + +// node_modules/cspell-trie-lib/dist/lib/ITrieNode/trie-util.js +function iteratorTrieWords(node) { + return walkerWords(node); +} +function findNode(node, word) { + for (let i = 0; i < word.length; ++i) { + const n = node.get(word[i]); + if (!n) + return void 0; + node = n; + } + return node; +} +function countWords(root) { + const visited = /* @__PURE__ */ new Map(); + function walk4(n) { + const nestedCount = visited.get(n.id); + if (nestedCount !== void 0) { + return nestedCount; + } + let cnt = n.eow ? 1 : 0; + visited.set(n, cnt); + const size = n.size; + for (let i = 0; i < size; ++i) { + cnt += walk4(n.child(i)); + } + visited.set(n, cnt); + return cnt; + } + return walk4(root); +} + +// node_modules/cspell-trie-lib/dist/lib/TrieNode/trie.js +function trieRootToITrieRoot(root) { + return ImplITrieRoot.toITrieNode(root); +} +function trieNodeToITrieNode(node) { + return ImplITrieNode.toITrieNode(node); +} +var EmptyKeys = Object.freeze([]); +var EmptyValues = Object.freeze([]); +var EmptyEntries = Object.freeze([]); +var ImplITrieNode = class _ImplITrieNode { + constructor(node) { + this.node = node; + this.id = node; + } + /** flag End of Word */ + get eow() { + return !!this.node.f; + } + /** number of children */ + get size() { + if (!this.node.c) + return 0; + return this.keys().length; + } + /** get keys to children */ + keys() { + if (this._keys) + return this._keys; + const keys2 = this.node.c ? Object.keys(this.node.c) : EmptyKeys; + this._keys = keys2; + return keys2; + } + /** get the child nodes */ + values() { + return !this.node.c ? EmptyValues : Object.values(this.node.c).map((n) => _ImplITrieNode.toITrieNode(n)); + } + entries() { + return !this.node.c ? EmptyEntries : Object.entries(this.node.c).map(([k, n]) => [k, _ImplITrieNode.toITrieNode(n)]); + } + /** get child ITrieNode */ + get(char) { + const n = this.node.c?.[char]; + if (!n) + return void 0; + return _ImplITrieNode.toITrieNode(n); + } + has(char) { + const c = this.node.c; + return c && char in c || false; + } + child(keyIdx) { + const char = this.keys()[keyIdx]; + const n = char && this.get(char); + if (!n) + throw new Error("Index out of range."); + return n; + } + hasChildren() { + return !!this.node.c; + } + static toITrieNode(node) { + return new this(node); + } +}; +var ImplITrieRoot = class extends ImplITrieNode { + constructor(root) { + super(root); + this.root = root; + const { stripCaseAndAccentsPrefix, compoundCharacter, forbiddenWordPrefix, isCaseAware } = root; + this.info = { stripCaseAndAccentsPrefix, compoundCharacter, forbiddenWordPrefix, isCaseAware }; + } + get eow() { + return false; + } + resolveId(id) { + const n = id; + return new ImplITrieNode(n); + } + static toITrieNode(node) { + return new this(node); + } +}; + +// node_modules/cspell-trie-lib/dist/lib/walker/walker.js +var useITrie = false; +var walkerWords2 = useITrie ? _walkerWords2 : _walkerWords; +function* _walkerWords(root) { + const empty = []; + function children(n) { + if (n.c) { + return Object.keys(n.c); + } + return empty; + } + let depth = 0; + const stack = []; + stack[depth] = { t: "", n: root.c, c: children(root), ci: 0 }; + while (depth >= 0) { + let s = stack[depth]; + let baseText = s.t; + while (s.ci < s.c.length && s.n) { + const char = s.c[s.ci++]; + const node = s.n[char]; + const text = baseText + char; + if (node.f) + yield text; + depth++; + baseText = text; + const c = children(node); + if (stack[depth]) { + s = stack[depth]; + s.t = text; + s.n = node.c; + s.c = c; + s.ci = 0; + } else { + stack[depth] = { t: text, n: node.c, c, ci: 0 }; } - }; - GlobSync.prototype._processSimple = function(prefix, index) { - var exists = this._stat(prefix); - if (!this.matches[index]) - this.matches[index] = /* @__PURE__ */ Object.create(null); - if (!exists) - return; - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix); - if (prefix.charAt(0) === "/") { - prefix = path16.join(this.root, prefix); - } else { - prefix = path16.resolve(this.root, prefix); - if (trail) - prefix += "/"; - } + s = stack[depth]; + } + depth -= 1; + } +} +function _walkerWords2(root) { + return walkerWordsITrie2(trieNodeToITrieNode(root)); +} +function* walkerWordsITrie2(root) { + let depth = 0; + const stack = []; + stack[depth] = { t: "", n: root, c: root.keys(), ci: 0 }; + while (depth >= 0) { + let s = stack[depth]; + let baseText = s.t; + while (s.ci < s.c.length && s.n) { + const char = s.c[s.ci++]; + const node = s.n.get(char); + if (!node) + continue; + const text = baseText + char; + if (node.eow) + yield text; + depth++; + baseText = text; + const c = node.keys(); + if (stack[depth]) { + s = stack[depth]; + s.t = text; + s.n = node; + s.c = c; + s.ci = 0; + } else { + stack[depth] = { t: text, n: node, c, ci: 0 }; } - if (process.platform === "win32") - prefix = prefix.replace(/\\/g, "/"); - this._emitMatch(index, prefix); - }; - GlobSync.prototype._stat = function(f) { - var abs = this._makeAbs(f); - var needDir = f.slice(-1) === "/"; - if (f.length > this.maxLength) - return false; - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs]; - if (Array.isArray(c)) - c = "DIR"; - if (!needDir || c === "DIR") - return c; - if (needDir && c === "FILE") - return false; + s = stack[depth]; + } + depth -= 1; + } +} + +// node_modules/cspell-trie-lib/dist/lib/suggestions/genSuggestionsOptions.js +var defaultGenSuggestionOptions = { + compoundMethod: CompoundWordsMethod.NONE, + ignoreCase: true, + changeLimit: 5 +}; +var defaultSuggestionOptions = { + ...defaultGenSuggestionOptions, + numSuggestions: 8, + includeTies: true, + timeout: 5e3 +}; +var keyMapOfGenSuggestionOptionsStrict = { + changeLimit: "changeLimit", + compoundMethod: "compoundMethod", + ignoreCase: "ignoreCase", + compoundSeparator: "compoundSeparator" +}; +var keyMapOfSuggestionOptionsStrict = { + ...keyMapOfGenSuggestionOptionsStrict, + filter: "filter", + includeTies: "includeTies", + numSuggestions: "numSuggestions", + timeout: "timeout", + weightMap: "weightMap" +}; +function createSuggestionOptions(...opts) { + const options = { ...defaultSuggestionOptions }; + const keys2 = Object.keys(keyMapOfSuggestionOptionsStrict); + for (const opt of opts) { + for (const key of keys2) { + assign(options, opt, key); + } + } + return options; +} +function assign(dest, src, k) { + dest[k] = src[k] ?? dest[k]; +} + +// node_modules/cspell-trie-lib/dist/lib/utils/PairingHeap.js +var PairingHeap = class { + constructor(compare4) { + this.compare = compare4; + this._size = 0; + } + /** Add an item to the heap. */ + add(v) { + this._heap = insert(this.compare, this._heap, v); + ++this._size; + return this; + } + /** take an item from the heap. */ + dequeue() { + const n = this.next(); + if (n.done) + return void 0; + return n.value; + } + /** Add items to the heap */ + concat(i) { + for (const v of i) { + this.add(v); + } + return this; + } + /** get the next value */ + next() { + if (!this._heap) { + return { value: void 0, done: true }; + } + const value = this._heap.v; + --this._size; + this._heap = removeHead(this.compare, this._heap); + return { value }; + } + /** peek at the next value without removing it. */ + peek() { + return this._heap?.v; + } + [Symbol.iterator]() { + return this; + } + /** alias of `size` */ + get length() { + return this._size; + } + /** number of entries in the heap. */ + get size() { + return this._size; + } +}; +function removeHead(compare4, heap) { + if (!heap || !heap.c) + return void 0; + return mergeSiblings(compare4, heap.c); +} +function insert(compare4, heap, v) { + const n = { + v, + s: void 0, + c: void 0 + }; + if (!heap || compare4(v, heap.v) <= 0) { + n.c = heap; + return n; + } + n.s = heap.c; + heap.c = n; + return heap; +} +function merge(compare4, a, b) { + if (compare4(a.v, b.v) <= 0) { + a.s = void 0; + b.s = a.c; + a.c = b; + return a; + } + b.s = void 0; + a.s = b.c; + b.c = a; + return b; +} +function mergeSiblings(compare4, n) { + if (!n.s) + return n; + const s = n.s; + const ss = s.s; + const m = merge(compare4, n, s); + return ss ? merge(compare4, m, mergeSiblings(compare4, ss)) : m; +} + +// node_modules/cspell-trie-lib/dist/lib/suggestions/constants.js +var DEFAULT_COMPOUNDED_WORD_SEPARATOR = "\u2219"; +var opCosts = { + baseCost: 100, + swapCost: 75, + duplicateLetterCost: 80, + compound: 1, + visuallySimilar: 1, + firstLetterBias: 5, + wordBreak: 99, + wordLengthCostFactor: 0.5 +}; + +// node_modules/cspell-trie-lib/dist/lib/suggestions/orthography.js +var intl = new Intl.Collator("en", { sensitivity: "base" }); +var compare = intl.compare; +var visualLetterGroups = [ + // cspell:disable + forms("\u01CE\xE0\xE5\xC4\xC0A\xE3\xE2\xE1\u01DF\u1EB7\u1EAF\u1EA5\u0100\u0101\u0103\u0105a\xE4\xE6\u0250\u0251\u03B1\u0430\u1FB3") + "\u1FB3", + forms("Bb\u1E03\u0432\u044A\u044C"), + forms("\u010B\u010C\u010Dc\u0109\xE7C\xC7\u0107\u010A\u0421\u0441\u03C2"), + forms("\u1E0E\u1E0B\u1E0F\u1E11\u010F\u0111\u1E0DDd"), + forms("\u0113\xEB\xC8\xCA\xCB\u1EC1\xE9\xE8\u1EBF\u1EC7\u0115eE\u0112\u0117\u0119\u011B\xEA\u0259\u025B\u0451\u0401\u0435\u0292"), + forms("f\u1E1FF\uFB00"), + forms("\u0121\u0120\u011E\u01E7\u011D\u0123Gg\u0263"), + forms("\u0127\u0126\u0125\u1E25Hh\u1E24\u021F\u043D"), + forms("I\u012F\xEF\u0130\xCE\xCD\u012Bi\xCC\xEC\xED\xEE\u0131\u026A\u0268\u0457\u038A\u0399"), + forms("jJ\u0135"), + forms("\u0137Kk\u03BA\u043A\u045C"), + forms("\u1E37\u0142\u013E\u013CLl\u013A\u1E36\u03AF\u03B9"), + forms("M\u1E43\u1E41m"), + forms("n\u0146\xD1N\u1E47\u0148\u0147\xF1\u0144\u014B\u045D\u0438\u0439"), + forms("\xD2O\xF8\u022D\u014C\u014D\u0151\u1ECFo\xD6\xF2\u0231\u022F\xF3\xF4\xF5\xF6\u01A1\u0254\u03CC\u03B4\u043E"), + forms("P\u1E57p\u0440\u0420\u03C1"), + forms("Qq"), + forms("\u0159R\u1E5Br\u0155\u0157\u0453\u0433\u044F"), + forms("\u1E63\u0161\u0218\u1E62sS\u0160\u1E61\u015E\u015D\u015B\u0219\u0283\u03A3"), + forms("t\u021B\u021A\u0165T\u1E6D\u1E6C\u1E6B"), + forms("\xDC\xFC\xFB\u016A\u01B0\u016F\u016B\u0171\xFA\xDB\u016D\xD9\xF9u\u0173U"), + forms("Vv\u03BD"), + forms("\u0175wW\u1E83\u1E85\u1E81\u03C9\u0448"), + forms("xX\u0445"), + forms("\xFF\xFDY\u0177y\xDD\u1EF3\u0423\u045E\u0443"), + forms("Z\u1E93\u017E\u017D\u017C\u017B\u017Az") + // cspell:enable +]; +function forms(letters) { + const n = letters.normalize("NFC").replace(/\p{M}/gu, ""); + const na = n.normalize("NFD").replace(/\p{M}/gu, ""); + const s = new Set(n + n.toLowerCase() + n.toUpperCase() + na + na.toLowerCase() + na.toUpperCase()); + return [...s].join(""); +} +var visualLetterMaskMap = calcVisualLetterMasks(visualLetterGroups); +function calcVisualLetterMasks(groups) { + const map3 = /* @__PURE__ */ Object.create(null); + for (let i = 0; i < groups.length; ++i) { + const m = 1 << i; + const g = groups[i]; + for (const c of g) { + map3[c] = (map3[c] || 0) | m; + } + } + return map3; +} + +// node_modules/cspell-trie-lib/dist/lib/distance/distanceAStarWeighted.js +var import_assert4 = __toESM(require("assert"), 1); + +// node_modules/cspell-trie-lib/dist/lib/distance/weightedMaps.js +var matchPossibleWordSeparators = /[+∙•・●]/g; +function createWeightMap(...defs) { + const map3 = _createWeightMap(); + addDefsToWeightMap(map3, defs); + return map3; +} +function addDefToWeightMap(map3, ...defs) { + return addDefsToWeightMap(map3, defs); +} +function addAdjustment(map3, ...adjustments) { + for (const adj of adjustments) { + map3.adjustments.set(adj.id, adj); + } + return map3; +} +function addDefsToWeightMap(map3, defs) { + function addSet(set, def) { + addSetToTrieCost(map3.insDel, set, def.insDel, def.penalty); + addSetToTrieTrieCost(map3.replace, set, def.replace, def.penalty); + addSetToTrieTrieCost(map3.swap, set, def.swap, def.penalty); + } + for (const _def of defs) { + const def = normalizeDef(_def); + const mapSets = splitMap(def); + mapSets.forEach((s) => addSet(s, def)); + } + return map3; +} +function _createWeightMap() { + return { + insDel: {}, + replace: {}, + swap: {}, + adjustments: /* @__PURE__ */ new Map() + }; +} +function lowest(a, b) { + if (a === void 0) + return b; + if (b === void 0) + return a; + return a <= b ? a : b; +} +function highest(a, b) { + if (a === void 0) + return b; + if (b === void 0) + return a; + return a >= b ? a : b; +} +function normalize(s) { + const f = /* @__PURE__ */ new Set([s]); + f.add(s.normalize("NFC")); + f.add(s.normalize("NFD")); + return f; +} +function* splitMapSubstringsIterable(map3) { + let seq = ""; + let mode = 0; + for (const char of map3) { + if (mode && char === ")") { + yield* normalize(seq); + mode = 0; + continue; + } + if (mode) { + seq += char; + continue; + } + if (char === "(") { + mode = 1; + seq = ""; + continue; + } + yield* normalize(char); + } +} +function splitMapSubstrings(map3) { + return [...splitMapSubstringsIterable(map3)]; +} +function splitMap(def) { + const { map: map3 } = def; + const sets = map3.split("|"); + return sets.map(splitMapSubstrings).filter((s) => s.length > 0); +} +function addToTrieCost(trie, str, cost, penalties) { + if (!str) + return; + let t = trie; + for (const c of str) { + const n = t.n = t.n || /* @__PURE__ */ Object.create(null); + t = n[c] = n[c] || /* @__PURE__ */ Object.create(null); + } + t.c = lowest(t.c, cost); + t.p = highest(t.p, penalties); +} +function addToTrieTrieCost(trie, left, right, cost, penalties) { + let t = trie; + for (const c of left) { + const n = t.n = t.n || /* @__PURE__ */ Object.create(null); + t = n[c] = n[c] || /* @__PURE__ */ Object.create(null); + } + const trieCost = t.t = t.t || /* @__PURE__ */ Object.create(null); + addToTrieCost(trieCost, right, cost, penalties); +} +function addSetToTrieCost(trie, set, cost, penalties) { + if (cost === void 0) + return; + for (const str of set) { + addToTrieCost(trie, str, cost, penalties); + } +} +function addSetToTrieTrieCost(trie, set, cost, penalties) { + if (cost === void 0) + return; + for (const left of set) { + for (const right of set) { + if (left === right) + continue; + addToTrieTrieCost(trie, left, right, cost, penalties); + } + } +} +function* searchTrieNodes(trie, str, i) { + const len = str.length; + for (let n = trie.n; i < len && n; ) { + const t = n[str[i]]; + if (!t) + return; + ++i; + yield { i, t }; + n = t.n; + } +} +function* findTrieCostPrefixes(trie, str, i) { + for (const n of searchTrieNodes(trie, str, i)) { + const { c, p } = n.t; + if (c !== void 0) { + yield { i: n.i, c, p: p || 0 }; + } + } +} +function* findTrieTrieCostPrefixes(trie, str, i) { + for (const n of searchTrieNodes(trie, str, i)) { + const t = n.t.t; + if (t !== void 0) { + yield { i: n.i, t }; + } + } +} +function createWeightCostCalculator(weightMap) { + return new _WeightCostCalculator(weightMap); +} +var _WeightCostCalculator = class { + constructor(weightMap) { + this.weightMap = weightMap; + } + *calcInsDelCosts(pos) { + const { a, ai, b, bi, c, p } = pos; + for (const del of findTrieCostPrefixes(this.weightMap.insDel, a, ai)) { + yield { a, b, ai: del.i, bi, c: c + del.c, p: p + del.p }; + } + for (const ins of findTrieCostPrefixes(this.weightMap.insDel, b, bi)) { + yield { a, b, ai, bi: ins.i, c: c + ins.c, p: p + ins.p }; + } + } + *calcReplaceCosts(pos) { + const { a, ai, b, bi, c, p } = pos; + for (const del of findTrieTrieCostPrefixes(this.weightMap.replace, a, ai)) { + for (const ins of findTrieCostPrefixes(del.t, b, bi)) { + yield { a, b, ai: del.i, bi: ins.i, c: c + ins.c, p: p + ins.p }; } - var exists; - var stat2 = this.statCache[abs]; - if (!stat2) { - var lstat; - try { - lstat = this.fs.lstatSync(abs); - } catch (er) { - if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) { - this.statCache[abs] = false; - return false; - } + } + } + *calcSwapCosts(pos) { + const { a, ai, b, bi, c, p } = pos; + const swap = this.weightMap.swap; + for (const left of findTrieTrieCostPrefixes(swap, a, ai)) { + for (const right of findTrieCostPrefixes(left.t, a, left.i)) { + const sw = a.slice(left.i, right.i) + a.slice(ai, left.i); + if (b.slice(bi).startsWith(sw)) { + const len = sw.length; + yield { a, b, ai: ai + len, bi: bi + len, c: c + right.c, p: p + right.p }; } - if (lstat && lstat.isSymbolicLink()) { - try { - stat2 = this.fs.statSync(abs); - } catch (er) { - stat2 = lstat; - } - } else { - stat2 = lstat; + } + } + } + calcAdjustment(word) { + let penalty = 0; + for (const adj of this.weightMap.adjustments.values()) { + if (adj.regexp.global) { + for (const _m of word.matchAll(adj.regexp)) { + penalty += adj.penalty; } + } else if (adj.regexp.test(word)) { + penalty += adj.penalty; } - this.statCache[abs] = stat2; - var c = true; - if (stat2) - c = stat2.isDirectory() ? "DIR" : "FILE"; - this.cache[abs] = this.cache[abs] || c; - if (needDir && c === "FILE") - return false; - return c; - }; - GlobSync.prototype._mark = function(p) { - return common.mark(this, p); - }; - GlobSync.prototype._makeAbs = function(f) { - return common.makeAbs(this, f); - }; + } + return penalty; } -}); +}; +function normalizeDef(def) { + const { map: map3, ...rest } = def; + return { ...rest, map: normalizeMap(map3) }; +} +function normalizeMap(map3) { + return map3.replace(matchPossibleWordSeparators, DEFAULT_COMPOUNDED_WORD_SEPARATOR); +} -// node_modules/inflight/inflight.js -var require_inflight = __commonJS({ - "node_modules/inflight/inflight.js"(exports, module2) { - var wrappy = require_wrappy(); - var reqs = /* @__PURE__ */ Object.create(null); - var once = require_once(); - module2.exports = wrappy(inflight); - function inflight(key, cb) { - if (reqs[key]) { - reqs[key].push(cb); - return null; - } else { - reqs[key] = [cb]; - return makeres(key); +// node_modules/cspell-trie-lib/dist/lib/distance/distanceAStarWeighted.js +function distanceAStarWeighted(wordA, wordB, map3, cost = 100) { + const calc = createWeightCostCalculator(map3); + const best = _distanceAStarWeightedEx(wordA, wordB, calc, cost); + const penalty = calc.calcAdjustment(wordB); + return best.c + best.p + penalty; +} +function _distanceAStarWeightedEx(wordA, wordB, map3, cost = 100) { + const a = "^" + wordA + "$"; + const b = "^" + wordB + "$"; + const aN = a.length; + const bN = b.length; + const candidates = new CandidatePool(aN, bN); + candidates.add({ ai: 0, bi: 0, c: 0, p: 0, f: void 0 }); + function opSub(n) { + const { ai, bi, c, p } = n; + if (ai < aN && bi < bN) { + const cc = a[ai] === b[bi] ? c : c + cost; + candidates.add({ ai: ai + 1, bi: bi + 1, c: cc, p, f: n }); + } + } + function opIns(n) { + const { ai, bi, c, p } = n; + if (bi < bN) { + candidates.add({ ai, bi: bi + 1, c: c + cost, p, f: n }); + } + } + function opDel(n) { + const { ai, bi, c, p } = n; + if (ai < aN) { + candidates.add({ ai: ai + 1, bi, c: c + cost, p, f: n }); + } + } + function opSwap(n) { + const { ai, bi, c, p } = n; + if (a[ai] === b[bi + 1] && a[ai + 1] === b[bi]) { + candidates.add({ ai: ai + 2, bi: bi + 2, c: c + cost, p, f: n }); + } + } + function opMap2(n) { + const { ai, bi, c, p } = n; + const pos = { a, b, ai, bi, c, p }; + const costCalculations = [map3.calcInsDelCosts(pos), map3.calcSwapCosts(pos), map3.calcReplaceCosts(pos)]; + costCalculations.forEach((iter) => { + for (const nn of iter) { + candidates.add({ ...nn, f: n }); } + }); + } + let best; + while (best = candidates.next()) { + if (best.ai === aN && best.bi === bN) + break; + opSwap(best); + opIns(best); + opDel(best); + opMap2(best); + opSub(best); + } + (0, import_assert4.default)(best); + return best; +} +var CandidatePool = class { + constructor(aN, bN) { + this.aN = aN; + this.bN = bN; + this.pool = new PairingHeap(compare2); + this.grid = []; + } + next() { + let n; + while (n = this.pool.dequeue()) { + if (!n.d) + return n; } - function makeres(key) { - return once(function RES() { - var cbs = reqs[key]; - var len = cbs.length; - var args = slice(arguments); - try { - for (var i = 0; i < len; i++) { - cbs[i].apply(null, args); - } - } finally { - if (cbs.length > len) { - cbs.splice(0, len); - process.nextTick(function() { - RES.apply(null, args); - }); - } else { - delete reqs[key]; + return void 0; + } + add(n) { + const i = idx(n.ai, n.bi, this.bN); + const g = this.grid[i]; + if (!g) { + this.grid[i] = n; + this.pool.add(n); + return; + } + if (g.c <= n.c) + return; + g.d = true; + this.grid[i] = n; + this.pool.add(n); + } +}; +function idx(r, c, cols) { + return r * cols + c; +} +function compare2(a, b) { + return a.c - b.c || b.ai + b.bi - a.ai - a.bi; +} + +// node_modules/cspell-trie-lib/dist/lib/distance/levenshtein.js +var initialRow = ".".repeat(50).split("").map((_, i) => i); +Object.freeze(initialRow); + +// node_modules/cspell-trie-lib/dist/lib/distance/distance.js +var defaultCost = 100; +function editDistanceWeighted(wordA, wordB, weights, editCost = defaultCost) { + return distanceAStarWeighted(wordA, wordB, weights, editCost); +} + +// node_modules/cspell-trie-lib/dist/lib/utils/timer.js +function startTimer() { + const start = performance.now(); + return () => performance.now() - start; +} +function createPerfTimer() { + const timer = startTimer(); + const active = /* @__PURE__ */ new Map(); + const events = [{ name: "start", at: 0 }]; + function updateEvent(event, atTime = timer()) { + const elapsed = atTime - event.at; + event.elapsed = (event.elapsed || 0) + elapsed; + return elapsed; + } + function start(name) { + const event = createEvent(name || "start"); + events.push(event); + name && active.set(name, event); + return () => updateEvent(event); + } + function stop(name) { + const knownEvent = name && active.get(name); + if (knownEvent) { + return updateEvent(knownEvent); + } + return mark(name || "stop"); + } + function createEvent(name) { + return { name, at: timer() }; + } + function mark(name) { + const event = createEvent(name); + events.push(event); + return event.at; + } + function formatReport() { + const lineElements = [ + { name: "Event Name", at: "Time", elapsed: "Elapsed" }, + { name: "----------", at: "----", elapsed: "-------" }, + ...mapEvents() + ]; + function mapEvents() { + const stack = []; + return events.map((e) => { + for (let s = stack.pop(); s; s = stack.pop()) { + if (s >= e.at + (e.elapsed || 0)) { + stack.push(s); + break; } } + const d = stack.length; + if (e.elapsed) { + stack.push(e.at + e.elapsed); + } + return { + name: "| ".repeat(d) + (e.name || "").replace(/\t/g, " "), + at: `${t(e.at)}`, + elapsed: e.elapsed ? `${t(e.elapsed)}` : "--" + }; }); } - function slice(args) { - var length = args.length; - var array = []; - for (var i = 0; i < length; i++) - array[i] = args[i]; - return array; + function t(ms) { + return ms.toFixed(3) + "ms"; + } + function m(v, s) { + return Math.max(v, s.length); } + const lengths = lineElements.reduce((a, b) => ({ name: m(a.name, b.name), at: m(a.at, b.at), elapsed: m(a.elapsed, b.elapsed) }), { name: 0, at: 0, elapsed: 0 }); + const lines = lineElements.map((e) => `${e.at.padStart(lengths.at)} ${e.name.padEnd(lengths.name)} ${e.elapsed.padStart(lengths.elapsed)}`); + return lines.join("\n"); } -}); - -// node_modules/glob/glob.js -var require_glob = __commonJS({ - "node_modules/glob/glob.js"(exports, module2) { - module2.exports = glob2; - var rp = require_fs5(); - var minimatch = require_minimatch(); - var Minimatch = minimatch.Minimatch; - var inherits = require_inherits(); - var EE = require("events").EventEmitter; - var path16 = require("path"); - var assert7 = require("assert"); - var isAbsolute = require_path_is_absolute(); - var globSync = require_sync8(); - var common = require_common5(); - var setopts = common.setopts; - var ownProp = common.ownProp; - var inflight = require_inflight(); - var util = require("util"); - var childrenIgnored = common.childrenIgnored; - var isIgnored = common.isIgnored; - var once = require_once(); - function glob2(pattern, options, cb) { - if (typeof options === "function") - cb = options, options = {}; - if (!options) - options = {}; - if (options.sync) { - if (cb) - throw new TypeError("callback provided to sync glob"); - return globSync(pattern, options); + function measureFn(name, fn) { + const s = start(name); + const v = fn(); + s(); + return v; + } + async function measureAsyncFn(name, fn) { + const s = start(name); + const v = await fn(); + s(); + return v; + } + function report(reporter = console.log) { + reporter(formatReport()); + } + return { + start, + stop, + mark, + elapsed: timer, + report, + formatReport, + measureFn, + measureAsyncFn + }; +} +var globalPerfTimer = void 0; +function getGlobalPerfTimer() { + const timer = globalPerfTimer || createPerfTimer(); + globalPerfTimer = timer; + return timer; +} + +// node_modules/cspell-trie-lib/dist/lib/utils/util.js +function isDefined3(a) { + return a !== void 0; +} +function cleanCopy(t) { + const r = { ...t }; + return clean2(r); +} +function clean2(t) { + for (const prop in t) { + if (t[prop] === void 0) { + delete t[prop]; + } + } + return t; +} +function unique(a) { + return [...new Set(a)]; +} +function regexQuote(text) { + return text.replace(/([[\]\-+(){},|*.\\])/g, "\\$1"); +} +function replaceAllFactory(match2, replaceWithText) { + const r = RegExp(regexQuote(match2), "g"); + return (text) => text.replace(r, replaceWithText); +} + +// node_modules/cspell-trie-lib/dist/lib/suggestions/suggestCollector.js +var defaultMaxNumberSuggestions = 10; +var BASE_COST = 100; +var MAX_NUM_CHANGES = 5; +var MAX_COST_SCALE = 0.5; +var MAX_ALLOWED_COST_SCALE = 1.03 * MAX_COST_SCALE; +var collator = new Intl.Collator(); +var regexSeparator = new RegExp(`[${regexQuote(WORD_SEPARATOR)}]`, "g"); +var wordLengthCost = [0, 50, 25, 5, 0]; +var EXTRA_WORD_COST = 5; +var DEFAULT_COLLECTOR_TIMEOUT = 1e3; +var symStopProcessing = Symbol("Collector Stop Processing"); +function compSuggestionResults(a, b) { + const aPref = a.isPreferred && -1 || 0; + const bPref = b.isPreferred && -1 || 0; + return aPref - bPref || a.cost - b.cost || a.word.length - b.word.length || collator.compare(a.word, b.word); +} +var defaultSuggestionCollectorOptions = Object.freeze({ + numSuggestions: defaultMaxNumberSuggestions, + filter: () => true, + changeLimit: MAX_NUM_CHANGES, + includeTies: false, + ignoreCase: true, + timeout: DEFAULT_COLLECTOR_TIMEOUT, + weightMap: void 0, + compoundSeparator: "", + compoundMethod: void 0 +}); +function suggestionCollector(wordToMatch, options) { + const { filter: filter3 = () => true, changeLimit = MAX_NUM_CHANGES, includeTies = false, ignoreCase: ignoreCase2 = true, timeout = DEFAULT_COLLECTOR_TIMEOUT, weightMap, compoundSeparator = defaultSuggestionCollectorOptions.compoundSeparator } = options; + const numSuggestions = Math.max(options.numSuggestions, 0) || 0; + const numSugToHold = weightMap ? numSuggestions * 2 : numSuggestions; + const sugs = /* @__PURE__ */ new Map(); + let maxCost = BASE_COST * Math.min(wordToMatch.length * MAX_ALLOWED_COST_SCALE, changeLimit); + const useSeparator = compoundSeparator || (weightMap ? DEFAULT_COMPOUNDED_WORD_SEPARATOR : defaultSuggestionCollectorOptions.compoundSeparator); + const fnCleanWord = !useSeparator || useSeparator === compoundSeparator ? (w) => w : replaceAllFactory(useSeparator, ""); + if (useSeparator && weightMap) { + addDefToWeightMap(weightMap, { map: useSeparator, insDel: 50 }); + } + const genSuggestionOptions = clean2({ + changeLimit, + ignoreCase: ignoreCase2, + compoundMethod: options.compoundMethod, + compoundSeparator: useSeparator + }); + let timeRemaining = timeout; + function dropMax() { + if (sugs.size < 2 || !numSuggestions) { + sugs.clear(); + return; + } + const sorted = [...sugs.values()].sort(compSuggestionResults); + let i = numSugToHold - 1; + maxCost = sorted[i].cost; + for (; i < sorted.length && sorted[i].cost <= maxCost; ++i) { + } + for (; i < sorted.length; ++i) { + sugs.delete(sorted[i].word); + } + } + function adjustCost(sug) { + if (sug.isPreferred) + return sug; + const words = sug.word.split(regexSeparator); + const extraCost = words.map((w) => wordLengthCost[w.length] || 0).reduce((a, b) => a + b, 0) + (words.length - 1) * EXTRA_WORD_COST; + return { word: sug.word, cost: sug.cost + extraCost }; + } + function collectSuggestion(suggestion) { + const { word, cost, isPreferred } = adjustCost(suggestion); + if (cost <= maxCost && filter3(suggestion.word, cost)) { + const known = sugs.get(word); + if (known) { + known.cost = Math.min(known.cost, cost); + known.isPreferred = known.isPreferred || isPreferred; + } else { + sugs.set(word, { word, cost, isPreferred }); + if (cost < maxCost && sugs.size > numSugToHold) { + dropMax(); + } } - return new Glob(pattern, options, cb); } - glob2.sync = globSync; - var GlobSync = glob2.GlobSync = globSync.GlobSync; - glob2.glob = glob2; - function extend(origin, add) { - if (add === null || typeof add !== "object") { - return origin; + return maxCost; + } + function collect2(src, timeout2, filter4) { + let stop = false; + timeout2 = timeout2 ?? timeRemaining; + timeout2 = Math.min(timeout2, timeRemaining); + if (timeout2 < 0) + return; + const timer = startTimer(); + let ir; + while (!(ir = src.next(stop || maxCost)).done) { + if (timer() > timeout2) { + stop = symStopProcessing; } - var keys = Object.keys(add); - var i = keys.length; - while (i--) { - origin[keys[i]] = add[keys[i]]; + const { value } = ir; + if (!value) + continue; + if (isSuggestionResult(value)) { + if (!filter4 || filter4(value.word, value.cost)) { + collectSuggestion(value); + } + continue; } - return origin; } - glob2.hasMagic = function(pattern, options_) { - var options = extend({}, options_); - options.noprocess = true; - var g = new Glob(pattern, options); - var set = g.minimatch.set; - if (!pattern) - return false; - if (set.length > 1) - return true; - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== "string") - return true; + timeRemaining -= timer(); + } + function cleanCompoundResult(sr) { + const { word, cost } = sr; + const cWord = fnCleanWord(word); + if (cWord !== word) { + return { + word: cWord, + cost, + compoundWord: word, + isPreferred: void 0 + }; + } + return { ...sr }; + } + function suggestions() { + if (numSuggestions < 1 || !sugs.size) + return []; + const NF = "NFD"; + const nWordToMatch = wordToMatch.normalize(NF); + const rawValues = [...sugs.values()]; + const values = weightMap ? rawValues.map(({ word, cost, isPreferred }) => ({ + word, + cost: isPreferred ? cost : editDistanceWeighted(nWordToMatch, word.normalize(NF), weightMap, 110), + isPreferred + })) : rawValues; + const sorted = values.sort(compSuggestionResults).map(cleanCompoundResult); + let i = Math.min(sorted.length, numSuggestions) - 1; + const limit = includeTies ? sorted.length : Math.min(sorted.length, numSuggestions); + const iCost = sorted[i].cost; + const maxCost2 = Math.min(iCost, weightMap ? changeLimit * BASE_COST - 1 : iCost); + for (i = 1; i < limit && sorted[i].cost <= maxCost2; ++i) { + } + sorted.length = i; + return sorted; + } + const collector = { + collect: collect2, + add: function(suggestion) { + collectSuggestion(suggestion); + return this; + }, + get suggestions() { + return suggestions(); + }, + get maxCost() { + return maxCost; + }, + get word() { + return wordToMatch; + }, + get maxNumSuggestions() { + return numSuggestions; + }, + get changeLimit() { + return changeLimit; + }, + includesTies: includeTies, + ignoreCase: ignoreCase2, + symbolStopProcessing: symStopProcessing, + genSuggestionOptions + }; + return collector; +} +function impersonateCollector(collector, word) { + const r = Object.create(collector); + Object.defineProperty(r, "word", { value: word, writable: false }); + return r; +} +function isSuggestionResult(s) { + const r = s; + return !!r && typeof r === "object" && r?.cost !== void 0 && r.word != void 0; +} + +// node_modules/cspell-trie-lib/dist/lib/suggestions/suggestAStar.js +function comparePath(a, b) { + return a.c / (a.i + 1) - b.c / (b.i + 1) + (b.i - a.i); +} +function suggestAStar(trie, word, options = {}) { + const opts = createSuggestionOptions(options); + const collector = suggestionCollector(word, opts); + collector.collect(getSuggestionsAStar(trie, word, opts)); + return collector.suggestions; +} +function* getSuggestionsAStar(trie, srcWord, options = {}) { + const { compoundMethod, changeLimit, ignoreCase: ignoreCase2, weightMap } = createSuggestionOptions(options); + const visMap = visualLetterMaskMap; + const root = trie.getRoot(); + const rootIgnoreCase = ignoreCase2 && root.get(root.info.stripCaseAndAccentsPrefix) || void 0; + const pathHeap = new PairingHeap(comparePath); + const resultHeap = new PairingHeap(compareSuggestion); + const rootPNode = { n: root, i: 0, c: 0, s: "", p: void 0, t: createCostTrie() }; + const BC = opCosts.baseCost; + const VC = opCosts.visuallySimilar; + const DL = opCosts.duplicateLetterCost; + const wordSeparator = compoundMethod === CompoundWordsMethod.JOIN_WORDS ? JOIN_SEPARATOR : WORD_SEPARATOR; + const sc = specialChars(trie.info); + const comp = trie.info.compoundCharacter; + const compRoot = root.get(comp); + const compRootIgnoreCase = rootIgnoreCase && rootIgnoreCase.get(comp); + const emitted = /* @__PURE__ */ Object.create(null); + let limit = BC * Math.min(srcWord.length * opCosts.wordLengthCostFactor, changeLimit); + pathHeap.add(rootPNode); + if (rootIgnoreCase) { + pathHeap.add({ n: rootIgnoreCase, i: 0, c: 0, s: "", p: void 0, t: createCostTrie() }); + } + let best = pathHeap.dequeue(); + let maxSize = pathHeap.size; + let suggestionsGenerated = 0; + let nodesProcessed = 0; + let nodesProcessedLimit = 1e3; + let minGen = 1; + while (best) { + if (++nodesProcessed > nodesProcessedLimit) { + nodesProcessedLimit += 1e3; + if (suggestionsGenerated < minGen) { + break; } - return false; - }; - glob2.Glob = Glob; - inherits(Glob, EE); - function Glob(pattern, options, cb) { - if (typeof options === "function") { - cb = options; - options = null; + minGen += suggestionsGenerated; + } + if (best.c > limit) { + best = pathHeap.dequeue(); + maxSize = Math.max(maxSize, pathHeap.size); + continue; + } + processPath(best); + for (const sug of resultHeap) { + ++suggestionsGenerated; + if (sug.cost > limit) + continue; + if (sug.word in emitted && emitted[sug.word] <= sug.cost) + continue; + const action2 = yield sug; + emitted[sug.word] = sug.cost; + if (typeof action2 === "number") { + limit = Math.min(action2, limit); } - if (options && options.sync) { - if (cb) - throw new TypeError("callback provided to sync glob"); - return new GlobSync(pattern, options); + if (typeof action2 === "symbol") { + return; } - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb); - setopts(this, pattern, options); - this._didRealPath = false; - var n = this.minimatch.set.length; - this.matches = new Array(n); - if (typeof cb === "function") { - cb = once(cb); - this.on("error", cb); - this.on("end", function(matches) { - cb(null, matches); - }); + } + best = pathHeap.dequeue(); + maxSize = Math.max(maxSize, pathHeap.size); + } + return; + function compareSuggestion(a, b) { + const pa = a.isPreferred && 1 || 0; + const pb = b.isPreferred && 1 || 0; + return pb - pa || a.cost - b.cost || Math.abs(a.word.charCodeAt(0) - srcWord.charCodeAt(0)) - Math.abs(b.word.charCodeAt(0) - srcWord.charCodeAt(0)); + } + function processPath(p) { + const len = srcWord.length; + if (p.n.eow && p.i === len) { + const word = pNodeToWord(p); + const result = { word, cost: p.c }; + resultHeap.add(result); + } + calcEdges(p); + } + function calcEdges(p) { + const { n, i, t } = p; + const keys2 = n.keys(); + const s = srcWord[i]; + const sg = visMap[s] || 0; + const cost0 = p.c; + const cost = cost0 + BC + (i ? 0 : opCosts.firstLetterBias); + const costVis = cost0 + VC; + const costLegacyCompound = cost0 + opCosts.wordBreak; + const costCompound = cost0 + opCosts.compound; + if (s) { + const mIdx = keys2.indexOf(s); + if (mIdx >= 0) { + storePath(t, n.child(mIdx), i + 1, cost0, s, p, "=", s); + } + if (weightMap) { + processWeightMapEdges(p, weightMap); + } + const ns = srcWord[i + 1]; + if (s == ns && mIdx >= 0) { + storePath(t, n.child(mIdx), i + 2, cost0 + DL, s, p, "dd", s); + } + storePath(t, n, i + 1, cost, "", p, "d", ""); + for (let j = 0; j < keys2.length; ++j) { + const ss = keys2[j]; + if (j === mIdx || ss in sc) + continue; + const g = visMap[ss] || 0; + const c = sg & g ? costVis : cost; + storePath(t, n.child(j), i + 1, c, ss, p, "r", ss); } - var self = this; - this._processing = 0; - this._emitQueue = []; - this._processQueue = []; - this.paused = false; - if (this.noprocess) - return this; - if (n === 0) - return done(); - var sync = true; - for (var i = 0; i < n; i++) { - this._process(this.minimatch.set[i], i, false, done); + if (n.eow && i) { + if (compoundMethod) { + storePath(t, root, i, costLegacyCompound, wordSeparator, p, "L", wordSeparator); + } } - sync = false; - function done() { - --self._processing; - if (self._processing <= 0) { - if (sync) { - process.nextTick(function() { - self._finish(); - }); - } else { - self._finish(); - } + if (ns) { + const n1 = n.get(ns); + const n2 = n1?.get(s); + if (n2) { + const ss = ns + s; + storePath(t, n2, i + 2, cost0 + opCosts.swapCost, ss, p, "s", ss); } } } - Glob.prototype._finish = function() { - assert7(this instanceof Glob); - if (this.aborted) - return; - if (this.realpath && !this._didRealpath) - return this._realpath(); - common.finish(this); - this.emit("end", this.found); - }; - Glob.prototype._realpath = function() { - if (this._didRealpath) - return; - this._didRealpath = true; - var n = this.matches.length; - if (n === 0) - return this._finish(); - var self = this; - for (var i = 0; i < this.matches.length; i++) - this._realpathSet(i, next); - function next() { - if (--n === 0) - self._finish(); + if (compRoot && costCompound <= limit && keys2.includes(comp)) { + if (compRootIgnoreCase) { + storePath(t, compRootIgnoreCase, i, costCompound, "", p, "~+", "~+"); } - }; - Glob.prototype._realpathSet = function(index, cb) { - var matchset = this.matches[index]; - if (!matchset) - return cb(); - var found = Object.keys(matchset); - var self = this; - var n = found.length; - if (n === 0) - return cb(); - var set = this.matches[index] = /* @__PURE__ */ Object.create(null); - found.forEach(function(p, i) { - p = self._makeAbs(p); - rp.realpath(p, self.realpathCache, function(er, real) { - if (!er) - set[real] = true; - else if (er.syscall === "stat") - set[p] = true; - else - self.emit("error", er); - if (--n === 0) { - self.matches[index] = set; - cb(); - } - }); - }); - }; - Glob.prototype._mark = function(p) { - return common.mark(this, p); - }; - Glob.prototype._makeAbs = function(f) { - return common.makeAbs(this, f); - }; - Glob.prototype.abort = function() { - this.aborted = true; - this.emit("abort"); - }; - Glob.prototype.pause = function() { - if (!this.paused) { - this.paused = true; - this.emit("pause"); + storePath(t, compRoot, i, costCompound, "", p, "+", "+"); + } + if (cost <= limit) { + for (let j = 0; j < keys2.length; ++j) { + const char = keys2[j]; + if (char in sc) + continue; + storePath(t, n.child(j), i, cost, char, p, "i", char); } - }; - Glob.prototype.resume = function() { - if (this.paused) { - this.emit("resume"); - this.paused = false; - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0); - this._emitQueue.length = 0; - for (var i = 0; i < eq.length; i++) { - var e = eq[i]; - this._emitMatch(e[0], e[1]); - } + } + } + function processWeightMapEdges(p, weightMap2) { + delLetters(p, weightMap2, srcWord, storePath); + insLetters(p, weightMap2, srcWord, storePath); + repLetters(p, weightMap2, srcWord, storePath); + return; + } + function storePath(t, n, i, c, s, p, a, ss) { + const tt = getCostTrie(t, ss); + const curr = tt.c[i]; + if (curr <= c || c > limit) + return void 0; + tt.c[i] = c; + pathHeap.add({ n, i, c, s, p, t: tt, a }); + } +} +function delLetters(pNode, weightMap, word, storePath) { + const { t, n } = pNode; + const trie = weightMap.insDel; + let ii = pNode.i; + const cost0 = pNode.c - pNode.i; + const len = word.length; + for (let nn = trie.n; ii < len && nn; ) { + const tt = nn[word[ii]]; + if (!tt) + return; + ++ii; + if (tt.c !== void 0) { + storePath(t, n, ii, cost0 + tt.c, "", pNode, "d", ""); + } + nn = tt.n; + } +} +function insLetters(p, weightMap, _word, storePath) { + const { t, i, c, n } = p; + const cost0 = c; + searchTrieCostNodesMatchingTrie2(weightMap.insDel, n, (s, tc, n2) => { + if (tc.c !== void 0) { + storePath(t, n2, i, cost0 + tc.c, s, p, "i", s); + } + }); +} +function repLetters(pNode, weightMap, word, storePath) { + const node = pNode.n; + const pt = pNode.t; + const cost0 = pNode.c; + const len = word.length; + const trie = weightMap.replace; + let i = pNode.i; + for (let n = trie.n; i < len && n; ) { + const t = n[word[i]]; + if (!t) + return; + ++i; + const tInsert = t.t; + if (tInsert) { + searchTrieCostNodesMatchingTrie2(tInsert, node, (s, tt, n2) => { + const c = tt.c; + if (c === void 0) { + return; } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0); - this._processQueue.length = 0; - for (var i = 0; i < pq.length; i++) { - var p = pq[i]; - this._processing--; - this._process(p[0], p[1], p[2], p[3]); - } + storePath(pt, n2, i, cost0 + c + (tt.p || 0), s, pNode, "r", s); + }); + } + n = t.n; + } +} +function createCostTrie() { + return { c: [], t: /* @__PURE__ */ Object.create(null) }; +} +function getCostTrie(t, s) { + if (s.length == 1) { + return t.t[s] ??= createCostTrie(); + } + if (!s) { + return t; + } + let tt = t; + for (const c of [...s]) { + tt = tt.t[c] ??= createCostTrie(); + } + return tt; +} +function pNodeToWord(p) { + const parts = []; + let n = p; + while (n) { + parts.push(n.s); + n = n.p; + } + parts.reverse(); + return parts.join(""); +} +function specialChars(options) { + const charSet = /* @__PURE__ */ Object.create(null); + for (const c of Object.values(options)) { + charSet[c] = true; + } + return charSet; +} +function searchTrieCostNodesMatchingTrie2(trie, node, emit, s = "") { + const n = trie.n; + if (!n) + return; + const keys2 = node.keys(); + for (let i = 0; i < keys2.length; ++i) { + const key = keys2[i]; + const t = n[key]; + if (!t) + continue; + const c = node.child(i); + const pfx = s + key; + emit(pfx, t, c); + if (t.n) { + searchTrieCostNodesMatchingTrie2(t, c, emit, pfx); + } + } +} + +// node_modules/cspell-trie-lib/dist/lib/utils/assert.js +function assert5(condition, message = "Assert Failed") { + if (condition) + return; + throw new Error(message); +} + +// node_modules/cspell-trie-lib/dist/lib/utils/mergeOptionalWithDefaults.js +function mergeOptionalWithDefaults(...options) { + return options.reduce((acc, opt) => mergeDefaults(opt, acc), defaultTrieInfo); +} + +// node_modules/cspell-trie-lib/dist/lib/TrieBlob/FastTrieBlobBitMaskInfo.js +function extractInfo(info3) { + const { NodeMaskEOW, NodeMaskChildCharIndex, NodeChildRefShift } = info3; + return { + NodeMaskEOW, + NodeMaskChildCharIndex, + NodeChildRefShift + }; +} + +// node_modules/cspell-trie-lib/dist/lib/TrieBlob/FastTrieBlobInternals.js +var FastTrieBlobInternals = class { + constructor(nodes, charIndex, charToIndexMap, maskInfo) { + this.nodes = nodes; + this.charIndex = charIndex; + this.charToIndexMap = charToIndexMap; + const { NodeMaskEOW, NodeMaskChildCharIndex, NodeChildRefShift } = maskInfo; + this.NodeMaskEOW = NodeMaskEOW; + this.NodeMaskChildCharIndex = NodeMaskChildCharIndex; + this.NodeChildRefShift = NodeChildRefShift; + } +}; + +// node_modules/cspell-trie-lib/dist/lib/TrieBlob/FastTrieBlobIRoot.js +var EmptyKeys2 = Object.freeze([]); +var EmptyNodes = Object.freeze([]); +var FastTrieBlobINode = class _FastTrieBlobINode { + constructor(trie, nodeIdx) { + this.trie = trie; + this.nodeIdx = nodeIdx; + const node = trie.nodes[nodeIdx]; + this.node = node; + const value = node[0]; + this.eow = !!(value & trie.NodeMaskEOW); + this.size = node.length - 1; + this.id = nodeIdx; + } + keys() { + return this._keys ??= this.calcKeys(); + } + /** get keys to children */ + calcKeys() { + if (!this.size) + return EmptyKeys2; + const NodeMaskChildCharIndex = this.trie.NodeMaskChildCharIndex; + const charIndex = this.trie.charIndex; + const keys2 = Array(this.size); + const len = this.size; + const node = this.trie.nodes[this.nodeIdx]; + for (let i = 0; i < len; ++i) { + const entry = node[i + 1]; + const charIdx = entry & NodeMaskChildCharIndex; + keys2[i] = charIndex[charIdx]; + } + return Object.freeze(keys2); + } + values() { + if (!this.size) + return EmptyNodes; + const nodes = Array(this.size); + for (let i = 0; i < this.size; ++i) { + nodes[i] = this.child(i); + } + return nodes; + } + entries() { + const keys2 = this.keys(); + const values = this.values(); + const len = keys2.length; + const entries = Array(len); + for (let i = 0; i < len; ++i) { + entries[i] = [keys2[i], values[i]]; + } + return entries; + } + /** get child ITrieNode */ + get(char) { + const idx2 = this.getCharToIdxMap()[char]; + if (idx2 === void 0) + return void 0; + return this.child(idx2); + } + has(char) { + const idx2 = this.getCharToIdxMap()[char]; + return idx2 !== void 0; + } + hasChildren() { + return this.size > 0; + } + child(keyIdx) { + const node = this.trie.nodes[this.nodeIdx]; + const nodeIdx = node[keyIdx + 1] >>> this.trie.NodeChildRefShift; + return new _FastTrieBlobINode(this.trie, nodeIdx); + } + getCharToIdxMap() { + const m = this.charToIdx; + if (m) + return m; + const map3 = /* @__PURE__ */ Object.create(null); + const keys2 = this.keys(); + for (let i = 0; i < keys2.length; ++i) { + map3[keys2[i]] = i; + } + this.charToIdx = map3; + return map3; + } +}; +var FastTrieBlobIRoot = class extends FastTrieBlobINode { + constructor(trie, nodeIdx, info3) { + super(trie, nodeIdx); + this.info = info3; + } + resolveId(id) { + return new FastTrieBlobINode(this.trie, id); + } +}; + +// node_modules/cspell-trie-lib/dist/lib/TrieBlob/TrieBlobIRoot.js +var TrieBlobInternals = class { + constructor(nodes, charIndex, charToIndexMap, maskInfo) { + this.nodes = nodes; + this.charIndex = charIndex; + this.charToIndexMap = charToIndexMap; + const { NodeMaskEOW, NodeMaskChildCharIndex, NodeMaskNumChildren, NodeChildRefShift } = maskInfo; + this.NodeMaskEOW = NodeMaskEOW; + this.NodeMaskNumChildren = NodeMaskNumChildren; + this.NodeMaskChildCharIndex = NodeMaskChildCharIndex; + this.NodeChildRefShift = NodeChildRefShift; + } +}; +var EmptyKeys3 = Object.freeze([]); +var EmptyNodes2 = Object.freeze([]); +var TrieBlobINode = class _TrieBlobINode { + constructor(trie, nodeIdx) { + this.trie = trie; + this.nodeIdx = nodeIdx; + const node = trie.nodes[nodeIdx]; + this.node = node; + this.eow = !!(node & trie.NodeMaskEOW); + this.size = node & trie.NodeMaskNumChildren; + this.id = nodeIdx; + } + /** get keys to children */ + keys() { + if (this._keys) + return this._keys; + if (!this.size) + return EmptyKeys3; + const NodeMaskChildCharIndex = this.trie.NodeMaskChildCharIndex; + const charIndex = this.trie.charIndex; + const keys2 = Array(this.size); + const offset = this.nodeIdx + 1; + const len = this.size; + for (let i = 0; i < len; ++i) { + const entry = this.trie.nodes[i + offset]; + const charIdx = entry & NodeMaskChildCharIndex; + keys2[i] = charIndex[charIdx]; + } + this._keys = keys2; + return keys2; + } + values() { + if (!this.size) + return EmptyNodes2; + const nodes = Array(this.size); + for (let i = 0; i < this.size; ++i) { + nodes[i] = this.child(i); + } + return nodes; + } + entries() { + const keys2 = this.keys(); + const values = this.values(); + const len = keys2.length; + const entries = Array(len); + for (let i = 0; i < len; ++i) { + entries[i] = [keys2[i], values[i]]; + } + return entries; + } + /** get child ITrieNode */ + get(char) { + const idx2 = this.getCharToIdxMap()[char]; + if (idx2 === void 0) + return void 0; + return this.child(idx2); + } + has(char) { + const idx2 = this.getCharToIdxMap()[char]; + return idx2 !== void 0; + } + hasChildren() { + return this.size > 0; + } + child(keyIdx) { + const n = this.trie.nodes[this.nodeIdx + keyIdx + 1]; + const nodeIdx = n >>> this.trie.NodeChildRefShift; + return new _TrieBlobINode(this.trie, nodeIdx); + } + getCharToIdxMap() { + const m = this.charToIdx; + if (m) + return m; + const map3 = /* @__PURE__ */ Object.create(null); + const keys2 = this.keys(); + for (let i = 0; i < keys2.length; ++i) { + map3[keys2[i]] = i; + } + this.charToIdx = map3; + return map3; + } +}; +var TrieBlobIRoot = class extends TrieBlobINode { + constructor(trie, nodeIdx, info3) { + super(trie, nodeIdx); + this.info = info3; + } + resolveId(id) { + return new TrieBlobINode(this.trie, id); + } +}; + +// node_modules/cspell-trie-lib/dist/lib/TrieBlob/TrieBlob.js +var NodeHeaderNumChildrenBits = 8; +var NodeHeaderNumChildrenShift = 0; +var HEADER_SIZE_UINT32 = 8; +var HEADER_SIZE = HEADER_SIZE_UINT32 * 4; +var HEADER_OFFSET = 0; +var HEADER_OFFSET_SIG = HEADER_OFFSET; +var HEADER_OFFSET_ENDIAN = HEADER_OFFSET_SIG + 8; +var HEADER_OFFSET_VERSION = HEADER_OFFSET_ENDIAN + 4; +var HEADER_OFFSET_NODES = HEADER_OFFSET_VERSION + 4; +var HEADER_OFFSET_NODES_LEN = HEADER_OFFSET_NODES + 4; +var HEADER_OFFSET_CHAR_INDEX = HEADER_OFFSET_NODES_LEN + 4; +var HEADER_OFFSET_CHAR_INDEX_LEN = HEADER_OFFSET_CHAR_INDEX + 4; +var HEADER = { + header: HEADER_OFFSET, + sig: HEADER_OFFSET_SIG, + version: HEADER_OFFSET_VERSION, + endian: HEADER_OFFSET_ENDIAN, + nodes: HEADER_OFFSET_NODES, + nodesLen: HEADER_OFFSET_NODES_LEN, + charIndex: HEADER_OFFSET_CHAR_INDEX, + charIndexLen: HEADER_OFFSET_CHAR_INDEX_LEN +}; +var headerSig = "TrieBlob"; +var version2 = "00.01.00"; +var endianSig = 67305985; +var TrieBlob = class _TrieBlob { + constructor(nodes, charIndex, info3) { + this.nodes = nodes; + this.charIndex = charIndex; + this.info = mergeOptionalWithDefaults(info3); + this.charToIndexMap = /* @__PURE__ */ Object.create(null); + for (let i = 0; i < charIndex.length; ++i) { + const char = charIndex[i]; + this.charToIndexMap[char.normalize("NFC")] = i; + this.charToIndexMap[char.normalize("NFD")] = i; + } + this._forbidIdx = this._lookupNode(0, this.info.forbiddenWordPrefix); + } + has(word) { + return this._has(0, word); + } + isForbiddenWord(word) { + return !!this._forbidIdx && this._has(this._forbidIdx, word); + } + hasForbiddenWords() { + return !!this._forbidIdx; + } + getRoot() { + return this._iTrieRoot ??= this._getRoot(); + } + _getRoot() { + const trieData = new TrieBlobInternals(this.nodes, this.charIndex, this.charToIndexMap, { + NodeMaskEOW: _TrieBlob.NodeMaskEOW, + NodeMaskNumChildren: _TrieBlob.NodeMaskNumChildren, + NodeMaskChildCharIndex: _TrieBlob.NodeMaskChildCharIndex, + NodeChildRefShift: _TrieBlob.NodeChildRefShift + }); + return new TrieBlobIRoot(trieData, 0, this.info); + } + getNode(prefix) { + return findNode(this.getRoot(), prefix); + } + _has(nodeIdx, word) { + const NodeMaskNumChildren = _TrieBlob.NodeMaskNumChildren; + const NodeMaskChildCharIndex = _TrieBlob.NodeMaskChildCharIndex; + const NodeChildRefShift = _TrieBlob.NodeChildRefShift; + const nodes = this.nodes; + const len = word.length; + const charToIndexMap = this.charToIndexMap; + let node = nodes[nodeIdx]; + for (let p = 0; p < len; ++p, node = nodes[nodeIdx]) { + const letterIdx = charToIndexMap[word[p]]; + const count3 = node & NodeMaskNumChildren; + let i = count3; + for (; i > 0; --i) { + if ((nodes[i + nodeIdx] & NodeMaskChildCharIndex) === letterIdx) { + break; } } - }; - Glob.prototype._process = function(pattern, index, inGlobStar, cb) { - assert7(this instanceof Glob); - assert7(typeof cb === "function"); - if (this.aborted) - return; - this._processing++; - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]); - return; + if (i < 1) + return false; + nodeIdx = nodes[i + nodeIdx] >>> NodeChildRefShift; + } + return (node & _TrieBlob.NodeMaskEOW) === _TrieBlob.NodeMaskEOW; + } + _lookupNode(nodeIdx, char) { + const NodeMaskNumChildren = _TrieBlob.NodeMaskNumChildren; + const NodeMaskChildCharIndex = _TrieBlob.NodeMaskChildCharIndex; + const NodeChildRefShift = _TrieBlob.NodeChildRefShift; + const nodes = this.nodes; + const charToIndexMap = this.charToIndexMap; + const node = nodes[nodeIdx]; + const letterIdx = charToIndexMap[char]; + const count3 = node & NodeMaskNumChildren; + let i = count3; + for (; i > 0; --i) { + if ((nodes[i + nodeIdx] & NodeMaskChildCharIndex) === letterIdx) { + return nodes[i + nodeIdx] >>> NodeChildRefShift; } - var n = 0; - while (typeof pattern[n] === "string") { - n++; + } + return void 0; + } + *words() { + const NodeMaskNumChildren = _TrieBlob.NodeMaskNumChildren; + const NodeMaskEOW = _TrieBlob.NodeMaskEOW; + const NodeMaskChildCharIndex = _TrieBlob.NodeMaskChildCharIndex; + const NodeChildRefShift = _TrieBlob.NodeChildRefShift; + const nodes = this.nodes; + const stack = [{ nodeIdx: 0, pos: 0, word: "" }]; + let depth = 0; + while (depth >= 0) { + const { nodeIdx, pos, word } = stack[depth]; + const node = nodes[nodeIdx]; + if (!pos && node & NodeMaskEOW) { + yield word; + } + const len = node & NodeMaskNumChildren; + if (pos >= len) { + --depth; + continue; } - var prefix; - switch (n) { - case pattern.length: - this._processSimple(pattern.join("/"), index, cb); - return; - case 0: - prefix = null; - break; - default: - prefix = pattern.slice(0, n).join("/"); + const nextPos = ++stack[depth].pos; + const entry = nodes[nodeIdx + nextPos]; + const charIdx = entry & NodeMaskChildCharIndex; + const letter = this.charIndex[charIdx]; + ++depth; + stack[depth] = { + nodeIdx: entry >>> NodeChildRefShift, + pos: 0, + word: word + letter + }; + } + } + get size() { + if (this._size) + return this._size; + const NodeMaskNumChildren = _TrieBlob.NodeMaskNumChildren; + const nodes = this.nodes; + let p = 0; + let count3 = 0; + while (p < nodes.length) { + ++count3; + p += (nodes[p] & NodeMaskNumChildren) + 1; + } + this._size = count3; + return count3; + } + toJSON() { + return { + charIndex: this.charIndex, + options: this.info, + nodes: splitString(Buffer.from(this.nodes.buffer, 128).toString("base64")) + }; + } + encodeBin() { + const charIndex = Buffer.from(this.charIndex.join("\n")); + const charIndexLen = charIndex.byteLength + 3 & ~3; + const nodeOffset = HEADER_SIZE + charIndexLen; + const size = nodeOffset + this.nodes.length * 4; + const useLittle = isLittleEndian(); + const buffer = Buffer.alloc(size); + const header = new DataView(buffer.buffer); + const nodeData = new Uint8Array(this.nodes.buffer); + buffer.write(headerSig, HEADER.sig, "utf8"); + buffer.write(version2, HEADER.version, "utf8"); + header.setUint32(HEADER.endian, endianSig, useLittle); + header.setUint32(HEADER.nodes, nodeOffset, useLittle); + header.setUint32(HEADER.nodesLen, this.nodes.length, useLittle); + header.setUint32(HEADER.charIndex, HEADER_SIZE, useLittle); + header.setUint32(HEADER.charIndexLen, charIndex.length, useLittle); + buffer.set(charIndex, HEADER_SIZE); + buffer.set(nodeData, nodeOffset); + return buffer; + } + static decodeBin(blob) { + if (!checkSig(blob)) { + throw new ErrorDecodeTrieBlob("Invalid TrieBlob Header"); + } + const header = new DataView(blob.buffer); + const useLittle = isLittleEndian(); + if (header.getUint32(HEADER.endian, useLittle) !== endianSig) { + if (header.getUint32(HEADER.endian, useLittle) !== endianSig) { + throw new ErrorDecodeTrieBlob("Invalid TrieBlob Header"); + } + } + const offsetNodes = header.getUint32(HEADER.nodes, useLittle); + const lenNodes = header.getUint32(HEADER.nodesLen, useLittle); + const offsetCharIndex = header.getUint32(HEADER.charIndex, useLittle); + const lenCharIndex = header.getUint32(HEADER.charIndexLen, useLittle); + const charIndex = Buffer.from(blob.subarray(offsetCharIndex, offsetCharIndex + lenCharIndex)).toString("utf8").split("\n"); + const nodes = new Uint32Array(blob.buffer).subarray(offsetNodes / 4, offsetNodes / 4 + lenNodes); + return new _TrieBlob(nodes, charIndex, defaultTrieInfo); + } +}; +TrieBlob.NodeMaskEOW = 256; +TrieBlob.NodeMaskNumChildren = (1 << NodeHeaderNumChildrenBits) - 1; +TrieBlob.NodeMaskNumChildrenShift = NodeHeaderNumChildrenShift; +TrieBlob.NodeChildRefShift = 8; +TrieBlob.NodeMaskChildCharIndex = 255; +function isLittleEndian() { + const buf = new Uint8Array([1, 2, 3, 4]); + const view = new DataView(buf.buffer); + return view.getUint32(0, true) === 67305985; +} +function checkSig(blob) { + if (blob.length < HEADER_SIZE) { + return false; + } + const buf = Buffer.from(blob, 0, headerSig.length); + if (buf.toString("utf8", 0, headerSig.length) !== headerSig) { + return false; + } + return true; +} +var ErrorDecodeTrieBlob = class extends Error { + constructor(message) { + super(message); + } +}; +function splitString(s, len = 64) { + const splits = []; + for (let i = 0; i < s.length; i += len) { + splits.push(s.slice(i, i + len)); + } + return splits; +} + +// node_modules/cspell-trie-lib/dist/lib/TrieBlob/FastTrieBlob.js +var FastTrieBlob = class _FastTrieBlob { + constructor(nodes, charIndex, bitMasksInfo, options) { + this.nodes = nodes; + this.charIndex = charIndex; + this.bitMasksInfo = bitMasksInfo; + this._readonly = false; + this.info = mergeOptionalWithDefaults(options); + this.charToIndexMap = createCharToIndexMap(charIndex); + this._forbidIdx = this._lookupChar(0, this.info.forbiddenWordPrefix); + } + lookUpCharIndex(char) { + return this.charToIndexMap[char] ?? -1; + } + has(word) { + return this._has(0, word); + } + _has(nodeIdx, word) { + const NodeMaskChildCharIndex = this.bitMasksInfo.NodeMaskChildCharIndex; + const NodeChildRefShift = this.bitMasksInfo.NodeChildRefShift; + const NodeMaskEOW = this.bitMasksInfo.NodeMaskEOW; + const nodes = this.nodes; + const len = word.length; + let node = nodes[nodeIdx]; + for (let p = 0; p < len; ++p, node = nodes[nodeIdx]) { + const letterIdx = this.lookUpCharIndex(word[p]); + const count3 = node.length; + let i = count3 - 1; + for (; i > 0; --i) { + if ((node[i] & NodeMaskChildCharIndex) === letterIdx) { break; - } - var remain = pattern.slice(n); - var read2; - if (prefix === null) - read2 = "."; - else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) { - return typeof p === "string" ? p : "[*]"; - }).join("/"))) { - if (!prefix || !isAbsolute(prefix)) - prefix = "/" + prefix; - read2 = prefix; - } else - read2 = prefix; - var abs = this._makeAbs(read2); - if (childrenIgnored(this, read2)) - return cb(); - var isGlobStar = remain[0] === minimatch.GLOBSTAR; - if (isGlobStar) - this._processGlobStar(prefix, read2, abs, remain, index, inGlobStar, cb); - else - this._processReaddir(prefix, read2, abs, remain, index, inGlobStar, cb); - }; - Glob.prototype._processReaddir = function(prefix, read2, abs, remain, index, inGlobStar, cb) { - var self = this; - this._readdir(abs, inGlobStar, function(er, entries) { - return self._processReaddir2(prefix, read2, abs, remain, index, inGlobStar, entries, cb); - }); - }; - Glob.prototype._processReaddir2 = function(prefix, read2, abs, remain, index, inGlobStar, entries, cb) { - if (!entries) - return cb(); - var pn = remain[0]; - var negate = !!this.minimatch.negate; - var rawGlob = pn._glob; - var dotOk = this.dot || rawGlob.charAt(0) === "."; - var matchedEntries = []; - for (var i = 0; i < entries.length; i++) { - var e = entries[i]; - if (e.charAt(0) !== "." || dotOk) { - var m; - if (negate && !prefix) { - m = !e.match(pn); - } else { - m = e.match(pn); - } - if (m) - matchedEntries.push(e); } } - var len = matchedEntries.length; - if (len === 0) - return cb(); - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = /* @__PURE__ */ Object.create(null); - for (var i = 0; i < len; i++) { - var e = matchedEntries[i]; - if (prefix) { - if (prefix !== "/") - e = prefix + "/" + e; - else - e = prefix + e; - } - if (e.charAt(0) === "/" && !this.nomount) { - e = path16.join(this.root, e); - } - this._emitMatch(index, e); - } - return cb(); + if (i < 1) + return false; + nodeIdx = node[i] >>> NodeChildRefShift; + if (!nodeIdx) + return false; + } + return !!(node[0] & NodeMaskEOW); + } + *words() { + const NodeMaskChildCharIndex = this.bitMasksInfo.NodeMaskChildCharIndex; + const NodeChildRefShift = this.bitMasksInfo.NodeChildRefShift; + const NodeMaskEOW = this.bitMasksInfo.NodeMaskEOW; + const nodes = this.nodes; + const stack = [{ nodeIdx: 0, pos: 0, word: "" }]; + let depth = 0; + while (depth >= 0) { + const { nodeIdx, pos, word } = stack[depth]; + const node = nodes[nodeIdx]; + if (!pos && node[0] & NodeMaskEOW) { + yield word; + } + if (pos >= node.length - 1) { + --depth; + continue; + } + const nextPos = ++stack[depth].pos; + const entry = node[nextPos]; + const charIdx = entry & NodeMaskChildCharIndex; + const letter = this.charIndex[charIdx]; + ++depth; + stack[depth] = { + nodeIdx: entry >>> NodeChildRefShift, + pos: 0, + word: word + letter + }; + } + } + toTrieBlob() { + const NodeMaskChildCharIndex = this.bitMasksInfo.NodeMaskChildCharIndex; + const NodeChildRefShift = this.bitMasksInfo.NodeChildRefShift; + const nodes = this.nodes; + function calcNodeToIndex(nodes2) { + let offset2 = 0; + const idx2 = Array(nodes2.length + 1); + for (let i = 0; i < nodes2.length; ++i) { + idx2[i] = offset2; + offset2 += nodes2[i].length; + } + idx2[nodes2.length] = offset2; + return idx2; + } + const nodeToIndex = calcNodeToIndex(nodes); + const nodeElementCount = nodeToIndex[nodeToIndex.length - 1]; + const binNodes = new Uint32Array(nodeElementCount); + const lenShift = TrieBlob.NodeMaskNumChildrenShift; + const refShift = TrieBlob.NodeChildRefShift; + let offset = 0; + for (let i = 0; i < nodes.length; ++i) { + const node = nodes[i]; + binNodes[offset++] = node.length - 1 << lenShift | node[0]; + for (let j = 1; j < node.length; ++j) { + const v = node[j]; + const nodeRef = v >>> NodeChildRefShift; + const charIndex = v & NodeMaskChildCharIndex; + binNodes[offset++] = nodeToIndex[nodeRef] << refShift | charIndex; + } + } + return new TrieBlob(binNodes, this.charIndex, this.info); + } + isReadonly() { + return this._readonly; + } + freeze() { + this._readonly = true; + return this; + } + static create(data, options) { + return new _FastTrieBlob(data.nodes, data.charIndex, extractInfo(data), options); + } + static toITrieNodeRoot(trie) { + return new FastTrieBlobIRoot(new FastTrieBlobInternals(trie.nodes, trie.charIndex, trie.charToIndexMap, trie.bitMasksInfo), 0, trie.info); + } + get iTrieRoot() { + return this._iTrieRoot ??= _FastTrieBlob.toITrieNodeRoot(this); + } + getRoot() { + return this.iTrieRoot; + } + getNode(prefix) { + return findNode(this.getRoot(), prefix); + } + isForbiddenWord(word) { + return !!this._forbidIdx && this._has(this._forbidIdx, word); + } + hasForbiddenWords() { + return !!this._forbidIdx; + } + /** number of nodes */ + get size() { + return this.nodes.length; + } + _lookupChar(nodeIdx, char) { + const NodeMaskChildCharIndex = this.bitMasksInfo.NodeMaskChildCharIndex; + const NodeChildRefShift = this.bitMasksInfo.NodeChildRefShift; + const nodes = this.nodes; + const node = nodes[nodeIdx]; + const letterIdx = this.lookUpCharIndex(char); + const count3 = node.length; + let i = count3 - 1; + for (; i > 0; --i) { + if ((node[i] & NodeMaskChildCharIndex) === letterIdx) { + return node[i] >>> NodeChildRefShift; + } + } + return 0; + } +}; +FastTrieBlob.NodeMaskEOW = TrieBlob.NodeMaskEOW; +FastTrieBlob.NodeChildRefShift = TrieBlob.NodeChildRefShift; +FastTrieBlob.NodeMaskChildCharIndex = TrieBlob.NodeMaskChildCharIndex; +FastTrieBlob.DefaultBitMaskInfo = { + NodeMaskEOW: FastTrieBlob.NodeMaskEOW, + NodeMaskChildCharIndex: FastTrieBlob.NodeMaskChildCharIndex, + NodeChildRefShift: FastTrieBlob.NodeChildRefShift +}; +function createCharToIndexMap(charIndex) { + const map3 = /* @__PURE__ */ Object.create(null); + for (let i = 0; i < charIndex.length; ++i) { + const char = charIndex[i]; + map3[char.normalize("NFC")] = i; + map3[char.normalize("NFD")] = i; + } + return map3; +} + +// node_modules/cspell-trie-lib/dist/lib/TrieBlob/resolveMap.js +function resolveMap(map3, key, resolve13) { + const r = map3.get(key); + if (r !== void 0) + return r; + const v = resolve13(key); + map3.set(key, v); + return v; +} + +// node_modules/cspell-trie-lib/dist/lib/TrieBlob/FastTrieBlobBuilder.js +var FastTrieBlobBuilder = class _FastTrieBlobBuilder { + constructor(options, bitMasksInfo = _FastTrieBlobBuilder.DefaultBitMaskInfo) { + this.charToIndexMap = /* @__PURE__ */ Object.create(null); + this.charIndex = [""]; + this._readonly = false; + this._options = mergeOptionalWithDefaults(options); + this.bitMasksInfo = bitMasksInfo; + this.nodes = [[0], Object.freeze([_FastTrieBlobBuilder.NodeMaskEOW])]; + this.IdxEOW = 1; + } + setOptions(options) { + this._options = mergeOptionalWithDefaults(this.options, options); + return this.options; + } + get options() { + return this._options; + } + getCharIndex(char) { + let idx2 = this.charToIndexMap[char]; + if (idx2) + return idx2; + const charNFC = char.normalize("NFC"); + const charNFD = char.normalize("NFD"); + idx2 = this.charIndex.push(charNFC) - 1; + this.charToIndexMap[charNFC] = idx2; + this.charToIndexMap[charNFD] = idx2; + return idx2; + } + insert(word) { + if (this.isReadonly()) { + throw new Error("FastTrieBlob is readonly"); + } + if (typeof word === "string") { + return this._insert(word); + } + const words = word; + if (Array.isArray(words)) { + for (let i = 0; i < words.length; ++i) { + this._insert(words[i]); } - remain.shift(); - for (var i = 0; i < len; i++) { - var e = matchedEntries[i]; - var newPattern; - if (prefix) { - if (prefix !== "/") - e = prefix + "/" + e; - else - e = prefix + e; + return this; + } + for (const w of words) { + this._insert(w); + } + return this; + } + getCursor() { + this._cursor ??= this.createCursor(); + return this._cursor; + } + createCursor() { + const NodeChildRefShift = this.bitMasksInfo.NodeChildRefShift; + const NodeMaskEOW = this.bitMasksInfo.NodeMaskEOW; + const LetterMask = this.bitMasksInfo.NodeMaskChildCharIndex; + function childPos(node, letterIdx) { + for (let i = 1; i < node.length; ++i) { + if ((node[i] & LetterMask) === letterIdx) { + return i; } - this._process([e].concat(remain), index, inGlobStar, cb); } - cb(); + return 0; + } + assert5(this.nodes.length === 2); + const eow = 1; + const eowShifted = eow << NodeChildRefShift; + const nodes = this.nodes; + const stack = [{ nodeIdx: 0, pos: 0 }]; + let nodeIdx = 0; + let depth = 0; + const insertChar = (char) => { + if (nodes[nodeIdx] && Object.isFrozen(nodes[nodeIdx])) { + nodeIdx = nodes.push([...nodes[nodeIdx]]) - 1; + const { pos: pos2, nodeIdx: pNodeIdx } = stack[depth]; + const pNode = nodes[pNodeIdx]; + pNode[pos2] = pNode[pos2] & LetterMask | nodeIdx << NodeChildRefShift; + } + const node = nodes[nodeIdx] ?? [0]; + nodes[nodeIdx] = node; + const letterIdx = this.getCharIndex(char); + const hasIdx = childPos(node, letterIdx); + const childIdx = hasIdx ? node[hasIdx] >>> NodeChildRefShift : nodes.length; + const pos = hasIdx || node.push(childIdx << NodeChildRefShift | letterIdx) - 1; + ++depth; + const s = stack[depth]; + if (s) { + s.nodeIdx = nodeIdx; + s.pos = pos; + } else { + stack[depth] = { nodeIdx, pos }; + } + nodeIdx = childIdx; }; - Glob.prototype._emitMatch = function(index, e) { - if (this.aborted) - return; - if (isIgnored(this, e)) - return; - if (this.paused) { - this._emitQueue.push([index, e]); + const markEOW = () => { + if (nodeIdx === eow) return; - } - var abs = isAbsolute(e) ? e : this._makeAbs(e); - if (this.mark) - e = this._mark(e); - if (this.absolute) - e = abs; - if (this.matches[index][e]) + const node = nodes[nodeIdx]; + if (!node) { + const { pos, nodeIdx: pNodeIdx } = stack[depth]; + const pNode = nodes[pNodeIdx]; + pNode[pos] = pNode[pos] & LetterMask | eowShifted; + } else { + nodes[nodeIdx] = node; + node[0] |= NodeMaskEOW; + } + nodeIdx = eow; + }; + const reference = (nodeId) => { + const refNodeIdx = nodeId; + Object.freeze(nodes[refNodeIdx]); + const s = stack[depth]; + nodeIdx = s.nodeIdx; + const pos = s.pos; + const node = nodes[nodeIdx]; + node[pos] = refNodeIdx << NodeChildRefShift | node[pos] & LetterMask; + }; + const backStep = (num) => { + if (!num) return; - if (this.nodir) { - var c = this.cache[abs]; - if (c === "DIR" || Array.isArray(c)) - return; - } - this.matches[index][e] = true; - var st = this.statCache[abs]; - if (st) - this.emit("stat", e, st); - this.emit("match", e); + assert5(num <= depth && num > 0); + depth -= num; + nodeIdx = stack[depth + 1].nodeIdx; }; - Glob.prototype._readdirInGlobStar = function(abs, cb) { - if (this.aborted) - return; - if (this.follow) - return this._readdir(abs, false, cb); - var lstatkey = "lstat\0" + abs; - var self = this; - var lstatcb = inflight(lstatkey, lstatcb_); - if (lstatcb) - self.fs.lstat(abs, lstatcb); - function lstatcb_(er, lstat) { - if (er && er.code === "ENOENT") - return cb(); - var isSym = lstat && lstat.isSymbolicLink(); - self.symlinks[abs] = isSym; - if (!isSym && lstat && !lstat.isDirectory()) { - self.cache[abs] = "FILE"; - cb(); - } else - self._readdir(abs, false, cb); - } + const c = { + insertChar, + markEOW, + reference, + backStep }; - Glob.prototype._readdir = function(abs, inGlobStar, cb) { - if (this.aborted) - return; - cb = inflight("readdir\0" + abs + "\0" + inGlobStar, cb); - if (!cb) - return; - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb); - if (ownProp(this.cache, abs)) { - var c = this.cache[abs]; - if (!c || c === "FILE") - return cb(); - if (Array.isArray(c)) - return cb(null, c); + return c; + } + _insert(word) { + word = word.trim(); + if (!word) + return this; + const NodeMaskChildCharIndex = this.bitMasksInfo.NodeMaskChildCharIndex; + const NodeChildRefShift = this.bitMasksInfo.NodeChildRefShift; + const NodeMaskEOW = this.bitMasksInfo.NodeMaskEOW; + const IdxEOW = this.IdxEOW; + const nodes = this.nodes; + const len = word.length; + let nodeIdx = 0; + for (let p = 0; p < len; ++p) { + const letterIdx = this.getCharIndex(word[p]); + const node = nodes[nodeIdx]; + const count3 = node.length; + let i = count3 - 1; + for (; i > 0; --i) { + if ((node[i] & NodeMaskChildCharIndex) === letterIdx) { + break; + } } - var self = this; - self.fs.readdir(abs, readdirCb(this, abs, cb)); - }; - function readdirCb(self, abs, cb) { - return function(er, entries) { - if (er) - self._readdirError(abs, er, cb); - else - self._readdirEntries(abs, entries, cb); - }; - } - Glob.prototype._readdirEntries = function(abs, entries, cb) { - if (this.aborted) - return; - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i++) { - var e = entries[i]; - if (abs === "/") - e = abs + e; - else - e = abs + "/" + e; - this.cache[e] = true; + if (i > 0) { + nodeIdx = node[i] >>> NodeChildRefShift; + if (nodeIdx === 1 && p < len - 1) { + nodeIdx = this.nodes.push([NodeMaskEOW]) - 1; + node[i] = nodeIdx << NodeChildRefShift | letterIdx; } + continue; } - this.cache[abs] = entries; - return cb(null, entries); - }; - Glob.prototype._readdirError = function(f, er, cb) { - if (this.aborted) - return; - switch (er.code) { - case "ENOTSUP": - case "ENOTDIR": - var abs = this._makeAbs(f); - this.cache[abs] = "FILE"; - if (abs === this.cwdAbs) { - var error2 = new Error(er.code + " invalid cwd " + this.cwd); - error2.path = this.cwd; - error2.code = er.code; - this.emit("error", error2); - this.abort(); - } - break; - case "ENOENT": - case "ELOOP": - case "ENAMETOOLONG": - case "UNKNOWN": - this.cache[this._makeAbs(f)] = false; - break; - default: - this.cache[this._makeAbs(f)] = false; - if (this.strict) { - this.emit("error", er); - this.abort(); - } - if (!this.silent) - console.error("glob error", er); + nodeIdx = p < len - 1 ? this.nodes.push([0]) - 1 : IdxEOW; + node.push(nodeIdx << NodeChildRefShift | letterIdx); + } + if (nodeIdx > 1) { + const node = nodes[nodeIdx]; + node[0] |= NodeMaskEOW; + } + return this; + } + has(word) { + const NodeMaskChildCharIndex = this.bitMasksInfo.NodeMaskChildCharIndex; + const NodeChildRefShift = this.bitMasksInfo.NodeChildRefShift; + const NodeMaskEOW = this.bitMasksInfo.NodeMaskEOW; + const nodes = this.nodes; + const len = word.length; + let nodeIdx = 0; + let node = nodes[nodeIdx]; + for (let p = 0; p < len; ++p, node = nodes[nodeIdx]) { + const letterIdx = this.charToIndexMap[word[p]]; + const count3 = node.length; + let i = count3 - 1; + for (; i > 0; --i) { + if ((node[i] & NodeMaskChildCharIndex) === letterIdx) { break; + } } - return cb(); + if (i < 1) + return false; + nodeIdx = node[i] >>> NodeChildRefShift; + } + return !!(node[0] & NodeMaskEOW); + } + isReadonly() { + return this._readonly; + } + freeze() { + this._readonly = true; + return this; + } + build() { + this.freeze(); + Object.freeze(this.nodes); + return FastTrieBlob.create(new FastTrieBlobInternals(this.nodes, this.charIndex, this.charToIndexMap, this.bitMasksInfo), this.options); + } + static fromWordList(words, options) { + const ft = new _FastTrieBlobBuilder(options); + return ft.insert(words).build(); + } + static fromTrieRoot(root) { + const bitMasksInfo = _FastTrieBlobBuilder.DefaultBitMaskInfo; + const NodeChildRefShift = bitMasksInfo.NodeChildRefShift; + const NodeMaskEOW = bitMasksInfo.NodeMaskEOW; + const tf2 = new _FastTrieBlobBuilder(void 0, bitMasksInfo); + const IdxEOW = tf2.IdxEOW; + const known = /* @__PURE__ */ new Map([[root, 0]]); + function resolveNode(n) { + if (n.f && !n.c) + return IdxEOW; + const node = [n.f ? NodeMaskEOW : 0]; + return tf2.nodes.push(node) - 1; + } + function walk4(n) { + const found = known.get(n); + if (found) + return found; + const nodeIdx = resolveMap(known, n, resolveNode); + const node = tf2.nodes[nodeIdx]; + if (!n.c) + return nodeIdx; + const children = Object.entries(n.c); + node.length = children.length + 1; + for (let p = 0; p < children.length; ++p) { + const [char, childNode] = children[p]; + const letterIdx = tf2.getCharIndex(char); + const childIdx = walk4(childNode); + node[p + 1] = childIdx << NodeChildRefShift | letterIdx; + } + return nodeIdx; + } + walk4(root); + return tf2.build(); + } +}; +FastTrieBlobBuilder.NodeMaskEOW = TrieBlob.NodeMaskEOW; +FastTrieBlobBuilder.NodeChildRefShift = TrieBlob.NodeChildRefShift; +FastTrieBlobBuilder.NodeMaskChildCharIndex = TrieBlob.NodeMaskChildCharIndex; +FastTrieBlobBuilder.DefaultBitMaskInfo = { + NodeMaskEOW: FastTrieBlobBuilder.NodeMaskEOW, + NodeMaskChildCharIndex: FastTrieBlobBuilder.NodeMaskChildCharIndex, + NodeChildRefShift: FastTrieBlobBuilder.NodeChildRefShift +}; + +// node_modules/cspell-trie-lib/dist/lib/utils/clean.js +function clean3(t) { + const copy = { ...t }; + for (const key of Object.keys(copy)) { + if (copy[key] === void 0) { + delete copy[key]; + } + } + return copy; +} + +// node_modules/cspell-trie-lib/dist/lib/ITrie.js +var defaultLegacyMinCompoundLength2 = 3; +var ITrieImpl = class _ITrieImpl { + constructor(data, numNodes) { + this.data = data; + this.numNodes = numNodes; + this.lastCreateFindOptionsMatchCaseMap = /* @__PURE__ */ new Map(); + this.root = data.getRoot(); + this._info = mergeOptionalWithDefaults(data.info); + this.hasForbidden = data.hasForbiddenWords(); + this._findOptionsDefaults = { + caseInsensitivePrefix: this._info.stripCaseAndAccentsPrefix, + compoundFix: this._info.compoundCharacter, + forbidPrefix: this._info.forbiddenWordPrefix }; - Glob.prototype._processGlobStar = function(prefix, read2, abs, remain, index, inGlobStar, cb) { - var self = this; - this._readdir(abs, inGlobStar, function(er, entries) { - self._processGlobStar2(prefix, read2, abs, remain, index, inGlobStar, entries, cb); + } + /** + * Number of words in the Trie, the first call to this method might be expensive. + * Use `size` to get the number of nodes. + */ + numWords() { + this.count ??= countWords(this.root); + return this.count; + } + isNumWordsKnown() { + return this.count !== void 0; + } + get size() { + return this.data.size; + } + get info() { + return this._info; + } + get isCaseAware() { + return this.info.isCaseAware ?? true; + } + /** + * @param text - text to find in the Trie + */ + find(text) { + const options = this.createFindOptions({ compoundMode: "compound" }); + return findWordNode(this.data.getRoot(), text, options).node; + } + has(word, minLegacyCompoundLength) { + if (this.hasWord(word, false)) + return true; + if (minLegacyCompoundLength) { + const f = this.findWord(word, { useLegacyWordCompounds: minLegacyCompoundLength }); + return !!f.found; + } + return false; + } + /** + * Determine if a word is in the dictionary. + * @param word - the exact word to search for - must be normalized. + * @param caseSensitive - false means also searching a dictionary where the words were normalized to lower case and accents removed. + * @returns true if the word was found and is not forbidden. + */ + hasWord(word, caseSensitive) { + const f = this.findWord(word, { caseSensitive }); + return !!f.found && !f.forbidden; + } + findWord(word, options) { + if (options?.useLegacyWordCompounds) { + const len = options.useLegacyWordCompounds !== true ? options.useLegacyWordCompounds : defaultLegacyMinCompoundLength2; + const findOptions2 = this.createFindOptions({ + legacyMinCompoundLength: len, + matchCase: options.caseSensitive }); - }; - Glob.prototype._processGlobStar2 = function(prefix, read2, abs, remain, index, inGlobStar, entries, cb) { - if (!entries) - return cb(); - var remainWithoutGlobStar = remain.slice(1); - var gspref = prefix ? [prefix] : []; - var noGlobStar = gspref.concat(remainWithoutGlobStar); - this._process(noGlobStar, index, false, cb); - var isSym = this.symlinks[abs]; - var len = entries.length; - if (isSym && inGlobStar) - return cb(); - for (var i = 0; i < len; i++) { - var e = entries[i]; - if (e.charAt(0) === "." && !this.dot) - continue; - var instead = gspref.concat(entries[i], remainWithoutGlobStar); - this._process(instead, index, true, cb); - var below = gspref.concat(entries[i], remain); - this._process(below, index, true, cb); + return findLegacyCompound(this.root, word, findOptions2); + } + const findOptions = this.createFindOptionsMatchCase(options?.caseSensitive); + return findWord(this.root, word, findOptions); + } + /** + * Determine if a word is in the forbidden word list. + * @param word the word to lookup. + */ + isForbiddenWord(word) { + return this.hasForbidden && isForbiddenWord(this.root, word, this.info.forbiddenWordPrefix); + } + /** + * Provides an ordered sequence of words with the prefix of text. + */ + completeWord(text) { + const n = this.find(text); + const compoundChar = this.info.compoundCharacter; + const subNodes = pipeSync(n ? iteratorTrieWords(n) : [], opFilterSync((w) => w[w.length - 1] !== compoundChar), opMapSync((suffix) => text + suffix)); + return pipeSync(n && n.eow ? [text] : [], opAppendSync(subNodes)); + } + /** + * Suggest spellings for `text`. The results are sorted by edit distance with changes near the beginning of a word having a greater impact. + * @param text - the text to search for + * @param maxNumSuggestions - the maximum number of suggestions to return. + * @param compoundMethod - Use to control splitting words. + * @param numChanges - the maximum number of changes allowed to text. This is an approximate value, since some changes cost less than others. + * the lower the value, the faster results are returned. Values less than 4 are best. + */ + suggest(text, options) { + return this.suggestWithCost(text, options).map((a) => a.word); + } + /** + * Suggest spellings for `text`. The results are sorted by edit distance with changes near the beginning of a word having a greater impact. + * The results include the word and adjusted edit cost. This is useful for merging results from multiple tries. + */ + suggestWithCost(text, options) { + const sep5 = options.compoundSeparator; + const weightMap = options.weightMap || this.weightMap; + const adjWord = sep5 ? replaceAllFactory(sep5, "") : (a) => a; + const optFilter = options.filter; + const filter3 = optFilter ? (word, cost) => { + const w = adjWord(word); + return !this.isForbiddenWord(w) && optFilter(w, cost); + } : (word) => !this.isForbiddenWord(adjWord(word)); + const opts = { ...options, filter: filter3, weightMap }; + return suggestAStar(this.data, text, opts); + } + /** + * genSuggestions will generate suggestions and send them to `collector`. `collector` is responsible for returning the max acceptable cost. + * Costs are measured in weighted changes. A cost of 100 is the same as 1 edit. Some edits are considered cheaper. + * Returning a MaxCost < 0 will effectively cause the search for suggestions to stop. + */ + genSuggestions(collector, compoundMethod) { + const filter3 = (word) => !this.isForbiddenWord(word); + const options = createSuggestionOptions(clean3({ compoundMethod, ...collector.genSuggestionOptions })); + const suggestions = getSuggestionsAStar(this.data, collector.word, options); + collector.collect(suggestions, void 0, filter3); + } + /** + * Returns an iterator that can be used to get all words in the trie. For some dictionaries, this can result in millions of words. + */ + words() { + return iteratorTrieWords(this.root); + } + /** + * Allows iteration over the entire tree. + * On the returned Iterator, calling .next(goDeeper: boolean), allows for controlling the depth. + */ + iterate() { + return walker(this.root); + } + static create(words, info3) { + const builder2 = new FastTrieBlobBuilder(info3); + builder2.insert(words); + const root = builder2.build(); + return new _ITrieImpl(root, void 0); + } + createFindOptions(options = {}) { + const findOptions = createFindOptions({ + ...this._findOptionsDefaults, + ...options + }); + return findOptions; + } + createFindOptionsMatchCase(matchCase3) { + const f = this.lastCreateFindOptionsMatchCaseMap.get(matchCase3); + if (f !== void 0) + return f; + const findOptions = this.createFindOptions({ matchCase: matchCase3 }); + this.lastCreateFindOptionsMatchCaseMap.set(matchCase3, findOptions); + return findOptions; + } +}; + +// node_modules/cspell-trie-lib/dist/lib/buildITrie.js +function buildITrieFromWords(words, info3 = {}) { + const builder2 = new FastTrieBlobBuilder(info3); + builder2.insert(words); + return new ITrieImpl(builder2.build()); +} + +// node_modules/cspell-trie-lib/dist/lib/TrieNode/TrieNode.js +var FLAG_WORD = 1; + +// node_modules/cspell-trie-lib/dist/lib/TrieNode/trie-util.js +function insert2(text, root = {}) { + let node = root; + for (let i = 0; i < text.length; ++i) { + const head = text[i]; + const c = node.c || /* @__PURE__ */ Object.create(null); + node.c = c; + node = c[head] || {}; + c[head] = node; + } + node.f = (node.f || 0) | FLAG_WORD; + return root; +} +function iteratorTrieWords2(node) { + return walkerWords2(node); +} +function createTrieRoot(options) { + const fullOptions = mergeOptionalWithDefaults(options); + return { + ...fullOptions, + c: /* @__PURE__ */ Object.create(null) + }; +} +function createTrieRootFromList(words, options) { + const root = createTrieRoot(options); + for (const word of words) { + if (word.length) { + insert2(word, root); + } + } + return root; +} +function countNodes(root) { + const seen = /* @__PURE__ */ new Set(); + function walk4(n) { + if (seen.has(n)) + return; + seen.add(n); + if (n.c) { + Object.values(n.c).forEach((n2) => walk4(n2)); + } + } + walk4(root); + return seen.size; +} +function checkCircular(root) { + const seen = /* @__PURE__ */ new Set(); + const inStack = /* @__PURE__ */ new Set(); + function walk4(n) { + if (seen.has(n)) + return { isCircular: false, allSeen: true }; + if (inStack.has(n)) { + const stack = [...inStack, n]; + const word = trieStackToWord(stack); + const pos = stack.indexOf(n); + return { isCircular: true, allSeen: false, ref: { stack, word, pos } }; + } + inStack.add(n); + let r = { isCircular: false, allSeen: true }; + if (n.c) { + r = Object.values(n.c).reduce((acc, n2) => { + if (acc.isCircular) + return acc; + const r2 = walk4(n2); + r2.allSeen = r2.allSeen && acc.allSeen; + return r2; + }, r); + } + if (r.allSeen) { + seen.add(n); + } + inStack.delete(n); + return r; + } + return walk4(root); +} +function reverseMapTrieNode(node) { + return node.c && new Map(Object.entries(node.c).map(([c, n]) => [n, c])); +} +function trieStackToWord(stack) { + let word = ""; + let lastMap = reverseMapTrieNode(stack[0]); + for (let i = 1; i < stack.length; ++i) { + const n = stack[i]; + const char = lastMap?.get(n); + if (char) { + word += char; + } + lastMap = reverseMapTrieNode(n); + } + return word; +} +function isCircular(root) { + return checkCircular(root).isCircular; +} +function trieNodeToRoot(node, options) { + const newOptions = mergeOptionalWithDefaults(options); + return { + ...newOptions, + c: node.c || /* @__PURE__ */ Object.create(null) + }; +} + +// node_modules/cspell-trie-lib/dist/lib/consolidate.js +function consolidate(root) { + let count3 = 0; + const signatures = /* @__PURE__ */ new Map(); + const cached = /* @__PURE__ */ new Map(); + const knownMap = /* @__PURE__ */ new Map(); + if (isCircular(root)) { + throw new Error("Trie is circular."); + } + function signature(n) { + const isWord = n.f ? "*" : ""; + const ref = n.c ? JSON.stringify(Object.entries(n.c).map(([k, n2]) => [k, cached.get(n2)])) : ""; + return isWord + ref; + } + function findEow(n) { + if (n.f && !n.c) + return n; + let r; + if (n.c) { + for (const c of Object.values(n.c)) { + r = findEow(c); + if (r) + break; } - cb(); - }; - Glob.prototype._processSimple = function(prefix, index, cb) { - var self = this; - this._stat(prefix, function(er, exists) { - self._processSimple2(prefix, index, er, exists, cb); - }); - }; - Glob.prototype._processSimple2 = function(prefix, index, er, exists, cb) { - if (!this.matches[index]) - this.matches[index] = /* @__PURE__ */ Object.create(null); - if (!exists) - return cb(); - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix); - if (prefix.charAt(0) === "/") { - prefix = path16.join(this.root, prefix); - } else { - prefix = path16.resolve(this.root, prefix); - if (trail) - prefix += "/"; - } + } + return r; + } + function compareMaps(a, b) { + for (const e of a) { + if (b[e[0]] !== e[1]) + return false; + } + return a.length === b.size; + } + function deepCopy(n) { + const k = knownMap.get(n); + if (k) { + return k; + } + const orig = n; + if (n.c) { + const children = Object.entries(n.c).map((c) => [c[0], deepCopy(c[1])]); + if (!compareMaps(children, n.c)) { + n = { f: n.f, c: Object.fromEntries(children) }; } - if (process.platform === "win32") - prefix = prefix.replace(/\\/g, "/"); - this._emitMatch(index, prefix); - cb(); - }; - Glob.prototype._stat = function(f, cb) { - var abs = this._makeAbs(f); - var needDir = f.slice(-1) === "/"; - if (f.length > this.maxLength) - return cb(); - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs]; - if (Array.isArray(c)) - c = "DIR"; - if (!needDir || c === "DIR") - return cb(null, c); - if (needDir && c === "FILE") - return cb(); + } + const sig = signature(n); + const ref = signatures.get(sig); + if (ref) { + knownMap.set(orig, ref); + return ref; + } + Object.freeze(n); + signatures.set(sig, n); + cached.set(n, count3++); + knownMap.set(orig, n); + return n; + } + function process6(n) { + if (cached.has(n)) { + return n; + } + if (Object.isFrozen(n)) { + return knownMap.get(n) || deepCopy(n); + } + if (n.c) { + const children = Object.entries(n.c).sort((a, b) => a[0] < b[0] ? -1 : 1).map(([k, n2]) => [k, process6(n2)]); + n.c = Object.fromEntries(children); + } + const sig = signature(n); + const ref = signatures.get(sig); + if (ref) { + return ref; + } + signatures.set(sig, n); + cached.set(n, count3++); + return n; + } + const eow = findEow(root) || { f: FLAG_WORD, c: void 0 }; + signatures.set(signature(eow), eow); + cached.set(eow, count3++); + return trieNodeToRoot(process6(root), root); +} + +// node_modules/cspell-trie-lib/dist/lib/TrieNode/find.js +var defaultLegacyMinCompoundLength3 = 3; +var _defaultFindOptions2 = { + matchCase: false, + compoundMode: "compound", + forbidPrefix: FORBID_PREFIX, + compoundFix: COMPOUND_FIX, + caseInsensitivePrefix: CASE_INSENSITIVE_PREFIX, + legacyMinCompoundLength: defaultLegacyMinCompoundLength3 +}; +var arrayCompoundModes2 = ["none", "compound", "legacy"]; +var knownCompoundModes2 = new Map(arrayCompoundModes2.map((a) => [a, a])); +function findWordExact2(root, word) { + return isEndOfWordNode2(walk2(root, word)); +} +function isEndOfWordNode2(n) { + return n?.f === FLAG_WORD; +} +function walk2(root, word) { + const w = word; + let n = root; + let i = 0; + while (n && i < word.length) { + const h = w[i++]; + n = n.c?.[h]; + } + return n; +} +var createFindOptions2 = memorizeLastCall(_createFindOptions2); +function _createFindOptions2(options) { + return mergeDefaults(options, _defaultFindOptions2); +} + +// node_modules/cspell-trie-lib/dist/lib/TrieNode/TrieNodeTrie.js +var TrieNodeTrie = class _TrieNodeTrie { + constructor(root) { + this.root = root; + this.info = mergeOptionalWithDefaults(root); + } + get iTrieRoot() { + return this._iTrieRoot || (this._iTrieRoot = trieRootToITrieRoot(this.root)); + } + getRoot() { + return this.iTrieRoot; + } + getNode(prefix) { + return findNode(this.getRoot(), prefix); + } + words() { + return iteratorTrieWords2(this.root); + } + has(word) { + return findWordExact2(this.root, word); + } + isForbiddenWord(word) { + return findWordExact2(this.root.c[this.root.forbiddenWordPrefix], word); + } + hasForbiddenWords() { + const root = this.root; + return !!root.c[root.forbiddenWordPrefix]; + } + get size() { + return this._size ??= countNodes(this.root); + } + static createFromWords(words, options) { + const root = createTrieRootFromList(words, options); + return new _TrieNodeTrie(root); + } + static createFromWordsAndConsolidate(words, options) { + const root = createTrieRootFromList(words, options); + return new _TrieNodeTrie(consolidate(root)); + } +}; + +// node_modules/gensequence/dist/esm/util/util.mjs +function* toIterableIterator(i) { + yield* i; +} + +// node_modules/gensequence/dist/esm/operators/operatorsBase.mjs +function* filter(i, fnFilter) { + for (const v of i) { + if (fnFilter(v)) { + yield v; + } + } +} +function* skip(i, n) { + let a = 0; + for (const t of i) { + if (a >= n) { + yield t; + } + a += 1; + } +} +function* take(i, n) { + let a = 0; + if (n) { + for (const t of i) { + if (a >= n) { + break; + } + yield t; + a += 1; + } + } +} +function* concat(i, j) { + yield* i; + yield* j; +} +function* concatMap(i, fn) { + for (const t of i) { + yield* fn(t); + } +} +function* combine(i, j, fnMap) { + const jit = j[Symbol.iterator](); + for (const r of i) { + const s = jit.next().value; + yield fnMap(r, s); + } +} +function map(i, fnMap) { + function* fn(i2, fnMap2) { + for (const v of i2) { + yield fnMap2(v); + } + } + return fn(i, fnMap); +} +function* scan(i, fnReduce, initValue) { + let index = 0; + if (initValue === void 0) { + index = 1; + const iter = i[Symbol.iterator](); + let r = iter.next(); + if (!r.done) + yield r.value; + initValue = r.value; + i = makeIterable(iter); + } + let prevValue = initValue; + for (const t of i) { + const nextValue = fnReduce(prevValue, t, index); + yield nextValue; + prevValue = nextValue; + index += 1; + } +} +function all(i, fn) { + for (const t of i) { + if (!fn(t)) { + return false; + } + } + return true; +} +function any(i, fn) { + for (const t of i) { + if (fn(t)) { + return true; + } + } + return false; +} +function count(i) { + return reduce2(i, (p) => p + 1, 0); +} +function first(i, fn, defaultValue) { + fn = fn || (() => true); + for (const t of i) { + if (fn(t)) { + return t; + } + } + return defaultValue; +} +function forEach(i, fn) { + let index = 0; + for (const t of i) { + fn(t, index); + index += 1; + } +} +function max(i, selector = (t) => t) { + return reduce2(i, (p, c) => selector(c) > selector(p) ? c : p, void 0); +} +function min(i, selector = (t) => t) { + return reduce2(i, (p, c) => selector(c) < selector(p) ? c : p, void 0); +} +function reduce2(i, fnReduce, initialValue) { + const iter = makeIterable(i[Symbol.iterator]()); + let index = 0; + if (initialValue === void 0) { + index = 1; + const r = iter.next(); + initialValue = r.value; + } + let prevValue = initialValue; + for (const t of iter) { + const nextValue = fnReduce(prevValue, t, index); + prevValue = nextValue; + index += 1; + } + return prevValue; +} +async function reduceAsync2(i, fnReduce, initialValue) { + const iter = makeIterable(i[Symbol.iterator]()); + let index = 0; + if (initialValue === void 0) { + index = 1; + const r = iter.next(); + initialValue = r.value; + } + let previousValue = await initialValue; + for (const p of iter) { + const t = await p; + const nextValue = await fnReduce(previousValue, t, index); + previousValue = nextValue; + index += 1; + } + return previousValue; +} +async function reduceAsyncForAsyncIterator(i, fnReduce, initialValue) { + const iter = makeAsyncIterable(i[Symbol.asyncIterator]()); + let index = 0; + if (initialValue === void 0) { + index = 1; + const r = await iter.next(); + initialValue = r.value; + } + let previousValue = await initialValue; + for await (const t of iter) { + const nextValue = await fnReduce(previousValue, t, index); + previousValue = nextValue; + index += 1; + } + return previousValue; +} +function makeIterable(i) { + function* fromIterator(i2) { + for (let r = i2.next(); !r.done; r = i2.next()) { + yield r.value; + } + } + function* fromIterable(i2) { + yield* i2; + } + return isIterable2(i) ? isIterableIterator(i) ? i : fromIterable(i) : fromIterator(i); +} +function isIterable2(i) { + return !!i[Symbol.iterator]; +} +function isIterableIterator(i) { + return typeof i.next == "function"; +} +function makeAsyncIterable(i) { + async function* fromIterable(i2) { + for (const v of i2) { + yield v; + } + } + async function* fromIterator(i2) { + for (let r = await i2.next(); !r.done; r = await i2.next()) { + yield r.value; + } + } + async function* fromAsyncIterable(i2) { + yield* i2; + } + return isAsyncIterable2(i) ? isAsyncIterableIterator(i) ? i : fromAsyncIterable(i) : isIterable2(i) ? fromIterable(i) : fromIterator(i); +} +function isAsyncIterable2(i) { + return !!i[Symbol.asyncIterator]; +} +function isAsyncIterableIterator(i) { + return typeof i.next == "function"; +} + +// node_modules/gensequence/dist/esm/operators/operators.mjs +function filter2(fnFilter) { + return (i) => filter(i, fnFilter); +} +function skip2(n) { + return (i) => skip(i, n); +} +function take2(n) { + return (i) => take(i, n); +} +function concat2(j) { + return (i) => concat(i, j); +} +function concatMap2(fn) { + return (i) => concatMap(i, fn); +} +function combine2(fnMap, j) { + return (i) => combine(i, j, fnMap); +} +function map2(fnMap) { + return (i) => map(i, fnMap); +} +function scan2(fnReduce, initValue) { + return (i) => scan(i, fnReduce, initValue); +} +function all2(fn) { + return (i) => all(i, fn); +} +function any2(fn) { + return (i) => any(i, fn); +} +function count2() { + return (i) => count(i); +} +function first2(fn, defaultValue) { + return (i) => first(i, fn, defaultValue); +} +function forEach2(fn) { + return (i) => forEach(i, fn); +} +function max2(selector) { + return (i) => max(i, selector); +} +function min2(selector) { + return (i) => min(i, selector); +} +function reduce3(fnReduce, initialValue) { + return (i) => reduce2(i, fnReduce, initialValue); +} +function reduceAsync3(fnReduceAsync, initialValue) { + return (i) => reduceAsync2(i, fnReduceAsync, initialValue); +} +function reduceAsyncForAsyncIterator2(fnReduceAsync, initialValue) { + return (i) => reduceAsyncForAsyncIterator(i, fnReduceAsync, initialValue); +} +function pipe(...fns) { + return (i) => { + for (const fn of fns) { + i = fn ? fn(i) : i; + } + return i; + }; +} + +// node_modules/gensequence/dist/esm/ImplSequence.mjs +var ImplSequence = class _ImplSequence { + constructor(i) { + this.i = i; + } + get iter() { + return typeof this.i === "function" ? this.i() : this.i; + } + get iterator() { + if (!this._iterator) { + this._iterator = this.iter[Symbol.iterator](); + } + return this._iterator; + } + inject(fn) { + const iter = this.i; + return () => fn(typeof iter === "function" ? iter() : iter); + } + chain(fn) { + return new _ImplSequence(this.inject(fn)); + } + [Symbol.iterator]() { + return this.iter[Symbol.iterator](); + } + next() { + return this.iterator.next(); + } + //// Filters + filter(fnFilter) { + return this.chain(filter2(fnFilter)); + } + skip(n) { + return this.chain(skip2(n)); + } + take(n) { + return this.chain(take2(n)); + } + //// Extenders + concat(j) { + return this.chain(concat2(j)); + } + concatMap(fn) { + return this.chain(concatMap2(fn)); + } + //// Mappers + combine(fn, j) { + return this.chain(combine2(fn, j)); + } + map(fn) { + return this.chain(map2(fn)); + } + scan(fnReduce, initValue) { + return this.chain(scan2(fnReduce, initValue)); + } + pipe(...fns) { + if (!fns.length) + return this; + return this.chain(pipe.apply(null, fns)); + } + // Reducers + all(fnFilter) { + return all2(fnFilter)(this.iter); + } + any(fnFilter) { + return any2(fnFilter)(this.iter); + } + count() { + return count2()(this.iter); + } + first(fnFilter, defaultValue) { + return first2(fnFilter, defaultValue)(this.iter); + } + forEach(fn) { + return forEach2(fn)(this.iter); + } + max(fnSelector) { + return max2(fnSelector)(this.iter); + } + min(fnSelector) { + return min2(fnSelector)(this.iter); + } + reduce(fnReduce, initValue) { + return reduce3(fnReduce, initValue)(this.iter); + } + reduceAsync(fnReduceAsync, initialValue) { + return reduceAsync3(fnReduceAsync, initialValue)(this.iter); + } + reduceToSequence(fnReduce, initialValue) { + return this.chain(reduce3(fnReduce, initialValue)); + } + //// Cast + toArray() { + return [...this.iter]; + } + toIterable() { + return toIterableIterator(this.iter); + } +}; + +// node_modules/gensequence/dist/esm/GenSequence.mjs +function genSequence(i) { + return new ImplSequence(i); +} +function sequenceFromRegExpMatch(pattern, text) { + function* doMatch() { + const regex = new RegExp(pattern); + let match2; + let lastIndex = void 0; + while (match2 = regex.exec(text)) { + if (match2.index === lastIndex) { + break; + } + lastIndex = match2.index; + yield match2; + } + } + return genSequence(() => doMatch()); +} + +// node_modules/gensequence/dist/esm/ImplAsyncSequence.mjs +var ImplAsyncSequence = class { + constructor(i) { + this.i = i; + } + get iter() { + return typeof this.i === "function" ? this.i() : this.i; + } + [Symbol.asyncIterator]() { + return this.iter[Symbol.asyncIterator](); + } + reduceAsync(fnReduceAsync, initialValue) { + return reduceAsyncForAsyncIterator2(fnReduceAsync, initialValue)(this.iter); + } +}; + +// node_modules/gensequence/dist/esm/ImplSequenceBuilder.mjs +var ImplSequenceBuilder = class _ImplSequenceBuilder { + constructor(operators2 = []) { + this.operators = []; + this.operators = operators2; + } + build(i) { + return new ImplSequence(i).pipe(pipe.apply(null, this.operators)); + } + pipe(...fns) { + return new _ImplSequenceBuilder([...this.operators, ...fns]); + } + //// Filters + /** keep values where the fnFilter(t) returns true */ + filter(fnFilter) { + return this.pipe(filter2(fnFilter)); + } + skip(n) { + return this.pipe(skip2(n)); + } + take(n) { + return this.pipe(take2(n)); + } + //// Extenders + concat(j) { + return this.pipe(concat2(j)); + } + concatMap(fn) { + return this.pipe(concatMap2(fn)); + } + //// Mappers + combine(fn, j) { + return this.pipe(combine2(fn, j)); + } + /** map values from type T to type U */ + map(fnMap) { + return this.pipe(map2(fnMap)); + } + scan(fnReduce, initialValue) { + return this.pipe(scan2(fnReduce, initialValue)); + } +}; + +// node_modules/gensequence/dist/esm/builder.mjs +function makeBuilder(fn) { + return new ImplSequenceBuilder([fn]); +} +var builder = Object.freeze({ + pipe: (fn) => { + return makeBuilder(fn); + }, + //// Filters + /** keep values where the fnFilter(t) returns true */ + filter: (fnFilter) => { + return makeBuilder(filter2(fnFilter)); + }, + skip: (n) => { + return makeBuilder(skip2(n)); + }, + take: (n) => { + return makeBuilder(take2(n)); + }, + //// Extenders + concat: (j) => { + return makeBuilder(concat2(j)); + }, + concatMap: (fn) => { + return makeBuilder(concatMap2(fn)); + }, + //// Mappers + combine: (fn, j) => { + return makeBuilder(combine2(fn, j)); + }, + /** map values from type T to type U */ + map: (fnMap) => { + return makeBuilder(map2(fnMap)); + }, + scan: (fnReduce, initialValue) => { + return makeBuilder(scan2(fnReduce, initialValue)); + } +}); + +// node_modules/cspell-trie-lib/dist/lib/io/importExportV1.js +var EOW = "*"; +var DATA = EOW; +function* toIterableIterator2(iter) { + yield* iter; +} +function importTrie(linesX) { + let radix = 16; + const comment = /^\s*#/; + const iter = toIterableIterator2(linesX); + function parseHeaderRows(headerRows) { + const header = headerRows.slice(0, 2).join("\n"); + const headerReg2 = /^TrieXv1\nbase=(\d+)$/; + if (!headerReg2.test(header)) + throw new Error("Unknown file format"); + radix = Number.parseInt(header.replace(headerReg2, "$1"), 10); + } + function readHeader(iter2) { + const headerRows = []; + while (true) { + const next = iter2.next(); + if (next.done) { + break; } - var exists; - var stat2 = this.statCache[abs]; - if (stat2 !== void 0) { - if (stat2 === false) - return cb(null, stat2); - else { - var type = stat2.isDirectory() ? "DIR" : "FILE"; - if (needDir && type === "FILE") - return cb(); - else - return cb(null, type, stat2); - } + const line = next.value.trim(); + if (!line || comment.test(line)) { + continue; } - var self = this; - var statcb = inflight("stat\0" + abs, lstatcb_); - if (statcb) - self.fs.lstat(abs, statcb); - function lstatcb_(er, lstat) { - if (lstat && lstat.isSymbolicLink()) { - return self.fs.stat(abs, function(er2, stat3) { - if (er2) - self._stat2(f, abs, null, lstat, cb); - else - self._stat2(f, abs, er2, stat3, cb); - }); - } else { - self._stat2(f, abs, er, lstat, cb); - } + if (line === DATA) { + break; } - }; - Glob.prototype._stat2 = function(f, abs, er, stat2, cb) { - if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) { - this.statCache[abs] = false; - return cb(); + headerRows.push(line); + } + parseHeaderRows(headerRows); + } + const regNotEscapedCommas = /(^|[^\\]),/g; + const regUnescapeCommas = /__COMMA__/g; + const regUnescape = /[\\](.)/g; + const flagsWord = { f: FLAG_WORD }; + function splitLine2(line) { + const pattern = "$1__COMMA__"; + return line.replace(regNotEscapedCommas, pattern).split(regUnescapeCommas).map((a) => a.replace(regUnescape, "$1")); + } + function decodeLine2(line, nodes) { + const isWord = line[0] === EOW; + line = isWord ? line.slice(1) : line; + const flags = isWord ? flagsWord : {}; + const children = splitLine2(line).filter((a) => !!a).map((a) => [a[0], Number.parseInt(a.slice(1) || "0", radix)]).map(([k, i]) => [k, nodes[i]]); + const cNode = children.length ? { c: Object.fromEntries(children) } : {}; + return { ...cNode, ...flags }; + } + readHeader(iter); + const n = genSequence([DATA]).concat(iter).map((a) => a.replace(/\r?\n/, "")).filter((a) => !!a).reduce((acc, line) => { + const { lines, nodes } = acc; + const root = decodeLine2(line, nodes); + nodes[lines] = root; + return { lines: lines + 1, root, nodes }; + }, { lines: 0, nodes: [], root: {} }); + return trieNodeToRoot(n.root, { isCaseAware: false }); +} + +// node_modules/cspell-trie-lib/dist/lib/io/importExportV2.js +var EOW2 = "*"; +var DATA2 = "__DATA__"; +function* toIterableIterator3(iter) { + yield* iter; +} +function importTrie2(linesX) { + let radix = 16; + const comment = /^\s*#/; + const iter = toIterableIterator3(linesX); + function parseHeaderRows(headerRows) { + const header = headerRows.slice(0, 2).join("\n"); + const headerReg2 = /^TrieXv2\nbase=(\d+)$/; + if (!headerReg2.test(header)) + throw new Error("Unknown file format"); + radix = Number.parseInt(header.replace(headerReg2, "$1"), 10); + } + function readHeader(iter2) { + const headerRows = []; + while (true) { + const next = iter2.next(); + if (next.done) { + break; } - var needDir = f.slice(-1) === "/"; - this.statCache[abs] = stat2; - if (abs.slice(-1) === "/" && stat2 && !stat2.isDirectory()) - return cb(null, false, stat2); - var c = true; - if (stat2) - c = stat2.isDirectory() ? "DIR" : "FILE"; - this.cache[abs] = this.cache[abs] || c; - if (needDir && c === "FILE") - return cb(); - return cb(null, c, stat2); - }; + const line = next.value.trim(); + if (!line || comment.test(line)) { + continue; + } + if (line === DATA2) { + break; + } + headerRows.push(line); + } + parseHeaderRows(headerRows); } -}); + function parseLine(line, base) { + const isWord = line[1] === EOW2; + const refOffset = isWord ? 2 : 1; + const refs = line.slice(refOffset).split(",").filter((a) => !!a).map((r) => parseInt(r, base)); + return { + letter: line[0], + isWord, + refs + }; + } + const flagsWord = { f: FLAG_WORD }; + function decodeLine2(line, nodes) { + const { letter, isWord, refs } = parseLine(line, radix); + const flags = isWord ? flagsWord : {}; + const children = refs.map((r) => nodes[r]).sort((a, b) => a.s < b.s ? -1 : 1).map((n2) => [n2.s, n2]); + const cNode = children.length ? { c: Object.fromEntries(children) } : {}; + return { s: letter, ...cNode, ...flags }; + } + readHeader(iter); + const n = genSequence(iter).map((a) => a.replace(/\r?\n/, "")).filter((a) => !!a).reduce((acc, line) => { + const { nodes } = acc; + const root = decodeLine2(line, nodes); + nodes.push(root); + return { root, nodes }; + }, { nodes: [], root: { s: "", c: /* @__PURE__ */ Object.create(null) } }); + return trieNodeToRoot(n.root, { isCaseAware: false }); +} + +// node_modules/cspell-trie-lib/dist/lib/io/constants.js +var EOW3 = "$"; +var BACK = "<"; +var EOL = "\n"; +var LF = "\r"; +var REF = "#"; +var REF_REL = "@"; +var EOR = ";"; +var ESCAPE = "\\"; + +// node_modules/cspell-trie-lib/dist/lib/io/importExportV4.js +var REF_INDEX_BEGIN = "["; +var REF_INDEX_END = "]"; +var INLINE_DATA_COMMENT_LINE = "/"; +var specialCharacters = stringToCharSet([EOW3, BACK, EOL, REF, REF_REL, EOR, ESCAPE, LF, REF_INDEX_BEGIN, REF_INDEX_END, INLINE_DATA_COMMENT_LINE].concat("0123456789".split("")).concat("`~!@#$%^&*()_-+=[]{};:'\"<>,./?\\|".split("")).join("")); +var SPECIAL_CHARACTERS_MAP = [ + ["\n", "\\n"], + ["\r", "\\r"], + ["\\", "\\\\"] +]; +var specialCharacterMap = stringToCharMap(SPECIAL_CHARACTERS_MAP); +var characterMap = stringToCharMap(SPECIAL_CHARACTERS_MAP.map((a) => [a[1], a[0]])); +var specialPrefix = stringToCharSet("~!"); +var DATA3 = "__DATA__"; +function importTrie3(linesX) { + linesX = typeof linesX === "string" ? linesX.split(/^/m) : linesX; + let radix = 10; + const comment = /^\s*#/; + const iter = tapIterable(pipeSync(linesX, opConcatMapSync((a) => a.split(/^/m)))); + function parseHeaderRows(headerRows) { + const header = headerRows.slice(0, 2).join("\n"); + const headerReg2 = /^TrieXv[34]\nbase=(\d+)$/; + if (!headerReg2.test(header)) + throw new Error("Unknown file format"); + radix = Number.parseInt(header.replace(headerReg2, "$1"), 10); + } + function readHeader(iter2) { + const headerRows = []; + for (const value of iter2) { + const line = value.trim(); + if (!line || comment.test(line)) + continue; + if (line === DATA3) + break; + headerRows.push(line); + } + parseHeaderRows(headerRows); + } + readHeader(iter); + const root = parseStream(radix, iter); + return root; +} +var numbersSet = stringToCharSet("0123456789"); +function parseStream(radix, iter) { + const eow = Object.freeze({ f: 1 }); + let refIndex = []; + const root = trieNodeToRoot({}, {}); + function parseReference(acc, s) { + const isIndexRef = s === REF_REL; + let ref = ""; + function parser2(acc2, s2) { + if (s2 === EOR || radix === 10 && !(s2 in numbersSet)) { + const { root: root2, nodes: nodes2, stack } = acc2; + const r = parseInt(ref, radix); + const top = stack[stack.length - 1]; + const p = stack[stack.length - 2].node; + const n = isIndexRef ? refIndex[r] : r; + p.c && (p.c[top.s] = nodes2[n]); + const rr = { root: root2, nodes: nodes2, stack, parser: void 0 }; + return s2 === EOR ? rr : parserMain(rr, s2); + } + ref = ref + s2; + return acc2; + } + const { nodes } = acc; + nodes.pop(); + return { ...acc, nodes, parser: parser2 }; + } + function parseEscapeCharacter(acc, _) { + let prev = ""; + const parser2 = function(acc2, s) { + if (prev) { + s = characterMap[prev + s] || s; + return parseCharacter({ ...acc2, parser: void 0 }, s); + } + if (s === ESCAPE) { + prev = s; + return acc2; + } + return parseCharacter({ ...acc2, parser: void 0 }, s); + }; + return { ...acc, parser: parser2 }; + } + function parseComment(acc, s) { + const endOfComment = s; + let isEscaped = false; + function parser2(acc2, s2) { + if (isEscaped) { + isEscaped = false; + return acc2; + } + if (s2 === ESCAPE) { + isEscaped = true; + return acc2; + } + if (s2 === endOfComment) { + return { ...acc2, parser: void 0 }; + } + return acc2; + } + return { ...acc, parser: parser2 }; + } + function parseCharacter(acc, s) { + const parser2 = void 0; + const { root: root2, nodes, stack } = acc; + const top = stack[stack.length - 1]; + const node = top.node; + const c = node.c ?? /* @__PURE__ */ Object.create(null); + const n = { f: void 0, c: void 0, n: nodes.length }; + c[s] = n; + node.c = c; + stack.push({ node: n, s }); + nodes.push(n); + return { root: root2, nodes, stack, parser: parser2 }; + } + function parseEOW(acc, _) { + const parser2 = parseBack; + const { root: root2, nodes, stack } = acc; + const top = stack[stack.length - 1]; + const node = top.node; + node.f = FLAG_WORD; + if (!node.c) { + top.node = eow; + const p = stack[stack.length - 2].node; + p.c && (p.c[top.s] = eow); + nodes.pop(); + } + stack.pop(); + return { root: root2, nodes, stack, parser: parser2 }; + } + const charactersBack = stringToCharSet(BACK + "23456789"); + function parseBack(acc, s) { + if (!(s in charactersBack)) { + return parserMain({ ...acc, parser: void 0 }, s); + } + let n = s === BACK ? 1 : parseInt(s, 10) - 1; + const { stack } = acc; + while (n-- > 0) { + stack.pop(); + } + return { ...acc, parser: parseBack }; + } + function parseIgnore(acc, _) { + return acc; + } + const parsers3 = createStringLookupMap([ + [EOW3, parseEOW], + [BACK, parseBack], + [REF, parseReference], + [REF_REL, parseReference], + [ESCAPE, parseEscapeCharacter], + [EOL, parseIgnore], + [LF, parseIgnore], + [INLINE_DATA_COMMENT_LINE, parseComment] + ]); + function parserMain(acc, s) { + const parser2 = acc.parser ?? parsers3[s] ?? parseCharacter; + return parser2(acc, s); + } + const charsetSpaces = stringToCharSet(" \r\n "); + function parseReferenceIndex(acc, s) { + let json2 = ""; + function parserStart(acc2, s2) { + if (s2 === REF_INDEX_BEGIN) { + json2 = json2 + s2; + return { ...acc2, parser: parser2 }; + } + if (s2 in charsetSpaces) { + return acc2; + } + return parserMain({ ...acc2, parser: void 0 }, s2); + } + function parser2(acc2, s2) { + json2 = json2 + s2; + if (s2 === REF_INDEX_END) { + refIndex = json2.replace(/[\s[\]]/g, "").split(",").map((n) => parseInt(n, radix)); + return { ...acc2, parser: void 0 }; + } + return acc2; + } + return parserStart({ ...acc, parser: parserStart }, s); + } + reduceSync(pipeSync(iter, opConcatMapSync((a) => a.split(""))), parserMain, { + nodes: [root], + root, + stack: [{ node: root, s: "" }], + parser: parseReferenceIndex + }); + return root; +} +function stringToCharSet(values) { + const set = /* @__PURE__ */ Object.create(null); + const len = values.length; + for (let i = 0; i < len; ++i) { + set[values[i]] = true; + } + return set; +} +function stringToCharMap(values) { + return createStringLookupMap(values); +} +function createStringLookupMap(values) { + const map3 = /* @__PURE__ */ Object.create(null); + const len = values.length; + for (let i = 0; i < len; ++i) { + map3[values[i][0]] = values[i][1]; + } + return map3; +} +function tapIterable(iterable) { + let lastValue; + let iter; + function getNext() { + if (lastValue && lastValue.done) { + return { ...lastValue }; + } + iter = iter || iterable[Symbol.iterator](); + lastValue = iter.next(); + return lastValue; + } + function* iterableFn() { + let next; + while (!(next = getNext()).done) { + yield next.value; + } + } + return { + [Symbol.iterator]: iterableFn + }; +} -// node_modules/rimraf/rimraf.js -var require_rimraf = __commonJS({ - "node_modules/rimraf/rimraf.js"(exports, module2) { - var assert7 = require("assert"); - var path16 = require("path"); - var fs6 = require("fs"); - var glob2 = void 0; - try { - glob2 = require_glob(); - } catch (_err) { +// node_modules/cspell-trie-lib/dist/lib/TrieNode/TrieNodeBuilder.js +var EOW4 = Object.freeze({ f: 1, k: true }); + +// node_modules/cspell-trie-lib/dist/lib/io/importV3.js +var specialCharacterMap2 = /* @__PURE__ */ new Map([ + ["\n", "\\n"], + ["\r", "\\r"], + ["\\", "\\\\"] +]); +var characterMap2 = new Map([...specialCharacterMap2].map((a) => [a[1], a[0]])); +var DATA4 = "__DATA__"; +function importTrieV3WithBuilder(builder2, srcLines) { + const timer = getGlobalPerfTimer(); + const timerStart = timer.start("importTrieV3"); + const dataLines = typeof srcLines === "string" ? srcLines.split("\n") : Array.isArray(srcLines) ? srcLines : [...srcLines]; + let radix = 16; + const comment = /^\s*#/; + function parseHeaderRows(headerRows) { + const header = headerRows.slice(0, 2).join("\n"); + const headerReg2 = /^TrieXv3\nbase=(\d+)$/; + if (!headerReg2.test(header)) + throw new Error("Unknown file format"); + radix = Number.parseInt(header.replace(headerReg2, "$1"), 10); + } + function findStartOfData(data) { + for (let i = 0; i < data.length; ++i) { + const line = data[i]; + if (line.includes(DATA4)) { + return i; + } } - var defaultGlobOpts = { - nosort: true, - silent: true - }; - var timeout = 0; - var isWindows2 = process.platform === "win32"; - var defaults = (options) => { - const methods = [ - "unlink", - "chmod", - "stat", - "lstat", - "rmdir", - "readdir" - ]; - methods.forEach((m) => { - options[m] = options[m] || fs6[m]; - m = m + "Sync"; - options[m] = options[m] || fs6[m]; - }); - options.maxBusyTries = options.maxBusyTries || 3; - options.emfileWait = options.emfileWait || 1e3; - if (options.glob === false) { - options.disableGlob = true; + return -1; + } + function readHeader(data) { + const headerRows = []; + for (const hLine of data) { + const line = hLine.trim(); + if (!line || comment.test(line)) { + continue; } - if (options.disableGlob !== true && glob2 === void 0) { - throw Error("glob dependency not found, set `options.disableGlob = true` if intentional"); + if (line === DATA4) { + break; } - options.disableGlob = options.disableGlob || false; - options.glob = options.glob || defaultGlobOpts; - }; - var rimraf = (p, options, cb) => { - if (typeof options === "function") { - cb = options; - options = {}; + headerRows.push(line); + } + parseHeaderRows(headerRows); + } + const startOfData = findStartOfData(dataLines); + if (startOfData < 0) { + throw new Error("Unknown file format"); + } + readHeader(dataLines.slice(0, startOfData)); + const cursor = builder2.getCursor(); + let node = { + cursor, + parser: void 0 + }; + const parser2 = parseStream2(radix); + const timerParse = timer.start("importTrieV3.parse"); + for (let i = startOfData + 1; i < dataLines.length; ++i) { + const line = dataLines[i]; + for (let j = 0; j < line.length; ++j) { + node = parser2(node, line[j]); + } + } + timerParse(); + timerStart(); + return builder2.build(); +} +function parseStream2(radix) { + function parseReference(acc, _) { + let ref = ""; + function parser2(acc2, s) { + if (s === EOR) { + const { cursor } = acc2; + const r = parseInt(ref, radix); + cursor.reference(r + 1); + acc2.parser = void 0; + return acc2; + } + ref = ref + s; + return acc2; + } + acc.parser = parser2; + return acc; + } + function parseEscapeCharacter(acc, _) { + let prev = ""; + const parser2 = function(acc2, s) { + if (prev) { + s = characterMap2.get(prev + s) || s; + acc2.parser = void 0; + return parseCharacter(acc2, s); + } + if (s === ESCAPE) { + prev = s; + return acc2; + } + acc2.parser = void 0; + return parseCharacter(acc2, s); + }; + acc.parser = parser2; + return acc; + } + function parseCharacter(acc, s) { + acc.cursor.insertChar(s); + acc.parser = void 0; + return acc; + } + function parseEOW(acc, _) { + acc.parser = parseBack; + acc.cursor.markEOW(); + acc.cursor.backStep(1); + return acc; + } + const charactersBack = stringToCharSet2(BACK + "23456789"); + function parseBack(acc, s) { + if (!(s in charactersBack)) { + acc.parser = void 0; + return parserMain(acc, s); + } + const n = s === BACK ? 1 : parseInt(s, 10) - 1; + acc.cursor.backStep(n); + acc.parser = parseBack; + return acc; + } + function parseIgnore(acc, _) { + return acc; + } + const parsers3 = /* @__PURE__ */ new Map([ + [EOW3, parseEOW], + [BACK, parseBack], + [REF, parseReference], + [ESCAPE, parseEscapeCharacter], + [EOL, parseIgnore], + [LF, parseIgnore] + ]); + function parserMain(acc, s) { + const parser2 = acc.parser ?? parsers3.get(s) ?? parseCharacter; + return parser2(acc, s); + } + return parserMain; +} +function stringToCharSet2(values) { + const set = /* @__PURE__ */ Object.create(null); + const len = values.length; + for (let i = 0; i < len; ++i) { + set[values[i]] = true; + } + return set; +} + +// node_modules/cspell-trie-lib/dist/lib/io/importV3FastBlob.js +function importTrieV3AsFastTrieBlob(srcLines) { + return importTrieV3WithBuilder(new FastTrieBlobBuilder(), srcLines); +} + +// node_modules/cspell-trie-lib/dist/lib/io/decode.js +function decodeTrieData(raw) { + return decodeStringFormat(typeof raw === "string" ? raw : raw.toString("utf8")); +} +function decodeStringFormat(data) { + return importTrie4(data); +} +var deserializers = [ + (data) => new TrieNodeTrie(importTrie(data)), + (data) => new TrieNodeTrie(importTrie(data)), + (data) => new TrieNodeTrie(importTrie2(data)), + (data) => importTrieV3AsFastTrieBlob(data), + (data) => new TrieNodeTrie(importTrie3(data)) +]; +var headerReg = /^\s*TrieXv(\d+)/m; +function importTrie4(input) { + const lines = Array.isArray(input) ? input : typeof input === "string" ? input.split("\n") : [...input]; + function parseHeaderRows(headerRows) { + for (let i = 0; i < headerRows.length; ++i) { + const match2 = headerRows[i].match(headerReg); + if (match2) { + return parseInt(match2[1], 10); + } + } + throw new Error("Unknown file format"); + } + function readHeader(iter) { + const headerRows = []; + for (const entry of iter) { + const line = entry.trim(); + headerRows.push(line); + if (line === DATA || line === DATA2) { + break; } - assert7(p, "rimraf: missing path"); - assert7.equal(typeof p, "string", "rimraf: path should be a string"); - assert7.equal(typeof cb, "function", "rimraf: callback function required"); - assert7(options, "rimraf: invalid options argument provided"); - assert7.equal(typeof options, "object", "rimraf: options should be object"); - defaults(options); - let busyTries = 0; - let errState = null; - let n = 0; - const next = (er) => { - errState = errState || er; - if (--n === 0) - cb(errState); - }; - const afterGlob = (er, results) => { - if (er) - return cb(er); - n = results.length; - if (n === 0) - return cb(); - results.forEach((p2) => { - const CB = (er2) => { - if (er2) { - if ((er2.code === "EBUSY" || er2.code === "ENOTEMPTY" || er2.code === "EPERM") && busyTries < options.maxBusyTries) { - busyTries++; - return setTimeout(() => rimraf_(p2, options, CB), busyTries * 100); - } - if (er2.code === "EMFILE" && timeout < options.emfileWait) { - return setTimeout(() => rimraf_(p2, options, CB), timeout++); - } - if (er2.code === "ENOENT") - er2 = null; - } - timeout = 0; - next(er2); - }; - rimraf_(p2, options, CB); - }); - }; - if (options.disableGlob || !glob2.hasMagic(p)) - return afterGlob(null, [p]); - options.lstat(p, (er, stat2) => { - if (!er) - return afterGlob(null, [p]); - glob2(p, options.glob, afterGlob); - }); - }; - var rimraf_ = (p, options, cb) => { - assert7(p); - assert7(options); - assert7(typeof cb === "function"); - options.lstat(p, (er, st) => { - if (er && er.code === "ENOENT") - return cb(null); - if (er && er.code === "EPERM" && isWindows2) - fixWinEPERM(p, options, er, cb); - if (st && st.isDirectory()) - return rmdir(p, options, er, cb); - options.unlink(p, (er2) => { - if (er2) { - if (er2.code === "ENOENT") - return cb(null); - if (er2.code === "EPERM") - return isWindows2 ? fixWinEPERM(p, options, er2, cb) : rmdir(p, options, er2, cb); - if (er2.code === "EISDIR") - return rmdir(p, options, er2, cb); - } - return cb(er2); - }); - }); - }; - var fixWinEPERM = (p, options, er, cb) => { - assert7(p); - assert7(options); - assert7(typeof cb === "function"); - options.chmod(p, 438, (er2) => { - if (er2) - cb(er2.code === "ENOENT" ? null : er); - else - options.stat(p, (er3, stats) => { - if (er3) - cb(er3.code === "ENOENT" ? null : er); - else if (stats.isDirectory()) - rmdir(p, options, er, cb); - else - options.unlink(p, cb); - }); - }); - }; - var fixWinEPERMSync = (p, options, er) => { - assert7(p); - assert7(options); - try { - options.chmodSync(p, 438); - } catch (er2) { - if (er2.code === "ENOENT") - return; - else - throw er; + } + return headerRows; + } + const headerLines = readHeader(lines); + const version4 = parseHeaderRows(headerLines); + const method = deserializers[version4]; + if (!method) { + throw new Error(`Unsupported version: ${version4}`); + } + return method(lines); +} + +// node_modules/cspell-trie-lib/dist/lib/decodeTrie.js +function decodeTrie(raw) { + const data = decodeTrieData(raw); + return new ITrieImpl(data); +} + +// node_modules/cspell-trie-lib/dist/lib/io/importExportV3.js +var specialCharacters2 = stringToCharSet3([EOW3, BACK, EOL, REF, EOR, ESCAPE, LF, "0123456789", "`~!@#$%^&*()_-+=[]{};:'\"<>,./?\\|"].join("")); +var specialPrefix2 = stringToCharSet3("~!"); +function stringToCharSet3(values) { + const set = /* @__PURE__ */ Object.create(null); + const len = values.length; + for (let i = 0; i < len; ++i) { + set[values[i]] = true; + } + return set; +} + +// node_modules/cspell-trie-lib/dist/lib/models/locale/knownLocales.js +var codes = [ + // ['code', 'language'[', ''locale']], + ["af", "Afrikaans"], + ["af-NA", "Afrikaans", "Namibia"], + ["af-ZA", "Afrikaans", "South Africa"], + ["ak", "Akan"], + ["ak-GH", "Akan", "Ghana"], + ["am", "Amharic"], + ["am-ET", "Amharic", "Ethiopia"], + ["ar", "Arabic"], + ["ar-1", "Arabic"], + ["ar-AE", "Arabic", "United Arab Emirates"], + ["ar-BH", "Arabic", "Bahrain"], + ["ar-DJ", "Arabic", "Djibouti"], + ["ar-DZ", "Arabic", "Algeria"], + ["ar-EG", "Arabic", "Egypt"], + ["ar-EH", "Arabic"], + ["ar-ER", "Arabic", "Eritrea"], + ["ar-IL", "Arabic", "Israel"], + ["ar-IQ", "Arabic", "Iraq"], + ["ar-JO", "Arabic", "Jordan"], + ["ar-KM", "Arabic", "Comoros"], + ["ar-KW", "Arabic", "Kuwait"], + ["ar-LB", "Arabic", "Lebanon"], + ["ar-LY", "Arabic", "Libya"], + ["ar-MA", "Arabic", "Morocco"], + ["ar-MR", "Arabic", "Mauritania"], + ["ar-OM", "Arabic", "Oman"], + ["ar-PS", "Arabic"], + ["ar-QA", "Arabic", "Qatar"], + ["ar-SA", "Arabic", "Saudi Arabia"], + ["ar-SD", "Arabic", "Sudan"], + ["ar-SO", "Arabic", "Somalia"], + ["ar-SS", "Arabic"], + ["ar-SY", "Arabic", "Syria"], + ["ar-TD", "Arabic", "Chad"], + ["ar-TN", "Arabic", "Tunisia"], + ["ar-YE", "Arabic", "Yemen"], + ["as", "Assamese"], + ["as-IN", "Assamese", "India"], + ["az", "Azerbaijani"], + ["az-AZ", "Azerbaijani", "Azerbaijan"], + ["be", "Belarusian"], + ["be-BY", "Belarusian", "Belarus"], + ["bg", "Bulgarian"], + ["bg-BG", "Bulgarian", "Bulgaria"], + ["bm", "Bambara"], + ["bm-ML", "Bambara", "Mali"], + ["bn", "Bengali"], + ["bn-BD", "Bengali", "Bangladesh"], + ["bn-IN", "Bengali", "India"], + ["bo", "Tibetan"], + ["bo-CN", "Tibetan", "China"], + ["bo-IN", "Tibetan", "India"], + ["br", "Breton"], + ["br-FR", "Breton", "France"], + ["bs", "Bosnian"], + ["bs-BA", "Bosnian", "Bosnia and Herzegovina"], + ["ca", "Catalan"], + ["ca-AD", "Catalan", "Andorra"], + ["ca-ES", "Catalan", "Spain"], + ["ca-FR", "Catalan", "France"], + ["ca-IT", "Catalan", "Italy"], + ["ce", "Chechen"], + ["ce-RU", "Chechen", "Russia"], + ["cs", "Czech"], + ["cs-CZ", "Czech", "Czech Republic"], + ["cu", "Old Slavonic"], + ["cu-RU", "Old Slavonic", "Russia"], + ["cy", "Welsh"], + ["cy-GB", "Welsh", "United Kingdom"], + ["da", "Danish"], + ["da-DK", "Danish", "Denmark"], + ["da-GL", "Danish", "Greenland"], + ["de", "German"], + ["de-AT", "German", "Austria"], + ["de-BE", "German", "Belgium"], + ["de-CH", "German", "Switzerland"], + ["de-DE", "German", "Germany"], + ["de-IT", "German", "Italy"], + ["de-LI", "German", "Liechtenstein"], + ["de-LU", "German", "Luxembourg"], + ["dz", "Dzongkha"], + ["dz-BT", "Dzongkha", "Bhutan"], + ["ee", "Ewe"], + ["ee-GH", "Ewe", "Ghana"], + ["ee-TG", "Ewe", "Togo"], + ["el", "Greek", "Modern (1453-)"], + ["el-CY", "Greek", "Cyprus"], + ["el-GR", "Greek", "Greece"], + ["en", "English"], + ["en-AG", "English", "Antigua and Barbuda"], + ["en-AI", "English", "Anguilla"], + ["en-AS", "English", "American Samoa"], + ["en-AT", "English", "Austria"], + ["en-AU", "English", "Australia"], + ["en-BB", "English", "Barbados"], + ["en-BE", "English", "Belgium"], + ["en-BI", "English", "Burundi"], + ["en-BM", "English", "Bermuda"], + ["en-BS", "English", "Bahamas"], + ["en-BW", "English", "Botswana"], + ["en-BZ", "English", "Belize"], + ["en-CA", "English", "Canada"], + ["en-CC", "English", "Cocos (Keeling) Islands"], + ["en-CH", "English", "Switzerland"], + ["en-CK", "English", "Cook Islands"], + ["en-CM", "English", "Cameroon"], + ["en-CX", "English", "Christmas Island"], + ["en-CY", "English", "Cyprus"], + ["en-DE", "English", "Germany"], + ["en-DG", "English"], + ["en-DK", "English", "Denmark"], + ["en-DM", "English", "Dominica"], + ["en-ER", "English", "Eritrea"], + ["en-FI", "English", "Finland"], + ["en-FJ", "English", "Fiji"], + ["en-FK", "English", "Falkland Islands (Islas Malvinas)"], + ["en-FM", "English", "Micronesia"], + ["en-GB", "English", "United Kingdom"], + ["en-GD", "English", "Grenada"], + ["en-GG", "English", "Guernsey"], + ["en-GH", "English", "Ghana"], + ["en-GI", "English", "Gibraltar"], + ["en-GM", "English", "Gambia"], + ["en-GU", "English", "Guam"], + ["en-GY", "English", "Guyana"], + ["en-HK", "English", "Hong Kong"], + ["en-IE", "English", "Ireland"], + ["en-IL", "English", "Israel"], + ["en-IM", "English", "Isle of Man"], + ["en-IN", "English", "India"], + ["en-IO", "English", "British Indian Ocean Territory"], + ["en-JE", "English", "Jersey"], + ["en-JM", "English", "Jamaica"], + ["en-KE", "English", "Kenya"], + ["en-KI", "English", "Kiribati"], + ["en-KN", "English", "Saint Kitts and Nevis"], + ["en-KY", "English", "Cayman Islands"], + ["en-LC", "English", "Saint Lucia"], + ["en-LR", "English", "Liberia"], + ["en-LS", "English", "Lesotho"], + ["en-MG", "English", "Madagascar"], + ["en-MH", "English", "Marshall Islands"], + ["en-MO", "English", "Macau"], + ["en-MP", "English", "Northern Mariana Islands"], + ["en-MS", "English", "Montserrat"], + ["en-MT", "English", "Malta"], + ["en-MU", "English", "Mauritius"], + ["en-MW", "English", "Malawi"], + ["en-MY", "English", "Malaysia"], + ["en-NA", "English", "Namibia"], + ["en-NF", "English", "Norfolk Island"], + ["en-NG", "English", "Nigeria"], + ["en-NL", "English", "Netherlands"], + ["en-NR", "English", "Nauru"], + ["en-NU", "English", "Niue"], + ["en-NZ", "English", "New Zealand"], + ["en-PG", "English", "Papua New Guinea"], + ["en-PH", "English", "Philippines"], + ["en-PK", "English", "Pakistan"], + ["en-PN", "English", "Pitcairn Islands"], + ["en-PR", "English", "Puerto Rico"], + ["en-PW", "English", "Palau"], + ["en-RW", "English", "Rwanda"], + ["en-SB", "English", "Solomon Islands"], + ["en-SC", "English", "Seychelles"], + ["en-SD", "English", "Sudan"], + ["en-SE", "English", "Sweden"], + ["en-SG", "English", "Singapore"], + ["en-SH", "English", "Saint Helena"], + ["en-SI", "English", "Slovenia"], + ["en-SL", "English", "Sierra Leone"], + ["en-SS", "English"], + ["en-SX", "English"], + ["en-SZ", "English", "Swaziland"], + ["en-TC", "English", "Turks and Caicos Islands"], + ["en-TK", "English", "Tokelau"], + ["en-TO", "English", "Tonga"], + ["en-TT", "English", "Trinidad and Tobago"], + ["en-TV", "English", "Tuvalu"], + ["en-TZ", "English", "Tanzania"], + ["en-UG", "English", "Uganda"], + ["en-UM", "English", "Baker Island"], + ["en-US", "English", "United States"], + ["en-VC", "English", "Saint Vincent and the Grenadines"], + ["en-VG", "English", "British Virgin Islands"], + ["en-VI", "English", "U.S. Virgin Islands"], + ["en-VU", "English", "Vanuatu"], + ["en-WS", "English", "Samoa"], + ["en-ZA", "English", "South Africa"], + ["en-ZM", "English", "Zambia"], + ["en-ZW", "English", "Zimbabwe"], + ["eo", "Esperanto"], + ["es", "Spanish"], + ["es-AR", "Spanish", "Argentina"], + ["es-BO", "Spanish", "Bolivia"], + ["es-BR", "Spanish", "Brazil"], + ["es-BZ", "Spanish", "Belize"], + ["es-CL", "Spanish", "Chile"], + ["es-CO", "Spanish", "Colombia"], + ["es-CR", "Spanish", "Costa Rica"], + ["es-CU", "Spanish", "Cuba"], + ["es-DO", "Spanish", "Dominican Republic"], + ["es-EA", "Spanish"], + ["es-EC", "Spanish", "Ecuador"], + ["es-ES", "Spanish", "Spain"], + ["es-GQ", "Spanish", "Equatorial Guinea"], + ["es-GT", "Spanish", "Guatemala"], + ["es-HN", "Spanish", "Honduras"], + ["es-IC", "Spanish"], + ["es-MX", "Spanish", "Mexico"], + ["es-NI", "Spanish", "Nicaragua"], + ["es-PA", "Spanish", "Panama"], + ["es-PE", "Spanish", "Peru"], + ["es-PH", "Spanish", "Philippines"], + ["es-PR", "Spanish", "Puerto Rico"], + ["es-PY", "Spanish", "Paraguay"], + ["es-SV", "Spanish", "El Salvador"], + ["es-US", "Spanish", "United States"], + ["es-UY", "Spanish", "Uruguay"], + ["es-VE", "Spanish", "Venezuela"], + ["et", "Estonian"], + ["et-EE", "Estonian", "Estonia"], + ["eu", "Basque"], + ["eu-ES", "Basque", "Spain"], + ["fa", "Persian"], + ["fa-AF", "Persian", "Afghanistan"], + ["fa-IR", "Persian", "Iran"], + ["ff", "Fulah"], + ["ff-CM", "Fulah", "Cameroon"], + ["ff-GN", "Fulah", "Guinea"], + ["ff-MR", "Fulah", "Mauritania"], + ["ff-SN", "Fulah", "Senegal"], + ["fi", "Finnish"], + ["fi-FI", "Finnish", "Finland"], + ["fo", "Faroese"], + ["fo-DK", "Faroese", "Denmark"], + ["fo-FO", "Faroese", "Faroe Islands"], + ["fr", "French"], + ["fr-BE", "French", "Belgium"], + ["fr-BF", "French", "Burkina Faso"], + ["fr-BI", "French", "Burundi"], + ["fr-BJ", "French", "Benin"], + ["fr-BL", "French"], + ["fr-CA", "French", "Canada"], + ["fr-CD", "French", "Congo"], + ["fr-CF", "French", "Central African Republic"], + ["fr-CG", "French", "Congo"], + ["fr-CH", "French", "Switzerland"], + ["fr-CI", "French, Cote d'Ivoire (Ivory Coast)"], + ["fr-CM", "French", "Cameroon"], + ["fr-DJ", "French", "Djibouti"], + ["fr-DZ", "French", "Algeria"], + ["fr-FR", "French", "France"], + ["fr-GA", "French", "Gabon"], + ["fr-GF", "French", "French Guiana"], + ["fr-GN", "French", "Guinea"], + ["fr-GP", "French", "Saint Barthelemy"], + ["fr-GQ", "French", "Equatorial Guinea"], + ["fr-HT", "French", "Haiti"], + ["fr-KM", "French", "Comoros"], + ["fr-LU", "French", "Luxembourg"], + ["fr-MA", "French", "Morocco"], + ["fr-MC", "French", "Monaco"], + ["fr-MF", "French"], + ["fr-MG", "French", "Madagascar"], + ["fr-ML", "French", "Mali"], + ["fr-MQ", "French", "Martinique"], + ["fr-MR", "French", "Mauritania"], + ["fr-MU", "French", "Mauritius"], + ["fr-NC", "French", "New Caledonia"], + ["fr-NE", "French", "Niger"], + ["fr-PF", "French", "French Polynesia"], + ["fr-PM", "French", "Saint Pierre and Miquelon"], + ["fr-RE", "French", "Reunion"], + ["fr-RW", "French", "Rwanda"], + ["fr-SC", "French", "Seychelles"], + ["fr-SN", "French", "Senegal"], + ["fr-SY", "French", "Syria"], + ["fr-TD", "French", "Chad"], + ["fr-TG", "French", "Togo"], + ["fr-TN", "French", "Tunisia"], + ["fr-VU", "French", "Vanuatu"], + ["fr-WF", "French", "Wallis and Futuna"], + ["fr-YT", "French", "Mayotte"], + ["fy", "Western Frisian"], + ["fy-NL", "Western Frisian", "Netherlands"], + ["ga", "Irish"], + ["ga-IE", "Irish", "Ireland"], + ["gd", "Gaelic"], + ["gd-GB", "Gaelic", "United Kingdom"], + ["gl", "Galician"], + ["gl-ES", "Galician", "Spain"], + ["gu", "Gujarati"], + ["gu-IN", "Gujarati", "India"], + ["gv", "Manx"], + ["gv-IM", "Manx", "Isle of Man"], + ["ha", "Hausa"], + ["ha-GH", "Hausa", "Ghana"], + ["ha-NE", "Hausa", "Niger"], + ["ha-NG", "Hausa", "Nigeria"], + ["he", "Hebrew"], + ["he-IL", "Hebrew", "Israel"], + ["hi", "Hindi"], + ["hi-IN", "Hindi", "India"], + ["hr", "Croatian"], + ["hr-BA", "Croatian", "Bosnia and Herzegovina"], + ["hr-HR", "Croatian", "Croatia"], + ["hu", "Hungarian"], + ["hu-HU", "Hungarian", "Hungary"], + ["hy", "Armenian"], + ["hy-AM", "Armenian", "Armenia"], + ["id", "Indonesian"], + ["id-ID", "Indonesian", "Indonesia"], + ["ig", "Igbo"], + ["ig-NG", "Igbo", "Nigeria"], + ["ii", "Sichuan Yi"], + ["ii-CN", "Sichuan Yi", "China"], + ["is", "Icelandic"], + ["is-IS", "Icelandic", "Iceland"], + ["it", "Italian"], + ["it-CH", "Italian", "Switzerland"], + ["it-IT", "Italian", "Italy"], + ["it-SM", "Italian", "San Marino"], + ["it-VA", "Italian", "Vatican City"], + ["ja", "Japanese"], + ["ja-JP", "Japanese", "Japan"], + ["ka", "Georgian"], + ["ka-GE", "Georgian", "Georgia"], + ["ki", "Kikuyu"], + ["ki-KE", "Kikuyu", "Kenya"], + ["kk", "Kazakh"], + ["kk-KZ", "Kazakh", "Kazakhstan"], + ["kl", "Kalaallisut"], + ["kl-GL", "Kalaallisut", "Greenland"], + ["km", "Central Khmer"], + ["km-KH", "Central Khmer", "Cambodia"], + ["kn", "Kannada"], + ["kn-IN", "Kannada", "India"], + ["ko", "Korean"], + ["ko-KP", "Korean", "Korea"], + ["ko-KR", "Korean", "Korea"], + ["ks", "Kashmiri"], + ["ks-IN", "Kashmiri", "India"], + ["kw", "Cornish"], + ["kw-GB", "Cornish", "United Kingdom"], + ["ky", "Kirghiz"], + ["ky-KG", "Kirghiz", "Kyrgyzstan"], + ["lb", "Luxembourgish"], + ["lb-LU", "Luxembourgish", "Luxembourg"], + ["lg", "Ganda"], + ["lg-UG", "Ganda", "Uganda"], + ["ln", "Lingala"], + ["ln-AO", "Lingala", "Angola"], + ["ln-CD", "Lingala", "Congo"], + ["ln-CF", "Lingala", "Central African Republic"], + ["ln-CG", "Lingala", "Congo"], + ["lo", "Lao"], + ["lo-LA", "Lao", "Laos"], + ["lt", "Lithuanian"], + ["lt-LT", "Lithuanian", "Lithuania"], + ["lu", "Luba-Katanga"], + ["lu-CD", "Luba-Katanga", "Congo"], + ["lv", "Latvian"], + ["lv-LV", "Latvian", "Latvia"], + ["mg", "Malagasy"], + ["mg-MG", "Malagasy", "Madagascar"], + ["mk", "Macedonian"], + ["mk-MK", "Macedonian", "Macedonia"], + ["ml", "Malayalam"], + ["ml-IN", "Malayalam", "India"], + ["mn", "Mongolian"], + ["mn-MN", "Mongolian", "Mongolia"], + ["mr", "Marathi"], + ["mr-IN", "Marathi", "India"], + ["ms", "Malay"], + ["ms-BN", "Malay", "Brunei"], + ["ms-MY", "Malay", "Malaysia"], + ["ms-SG", "Malay", "Singapore"], + ["mt", "Maltese"], + ["mt-MT", "Maltese", "Malta"], + ["my", "Burmese"], + ["my-MM", "Burmese", "Myanmar (Burma)"], + ["nb", "Bokm\xE5l Norwegian"], + ["nb-NO", "Bokm\xE5l Norwegian", "Norway"], + ["nb-SJ", "Bokm\xE5l Norwegian", "Svalbard"], + ["nd", "Ndebele, North"], + ["nd-ZW", "Ndebele, North", "Zimbabwe"], + ["ne", "Nepali"], + ["ne-IN", "Nepali", "India"], + ["ne-NP", "Nepali", "Nepal"], + ["nl", "Dutch"], + ["nl-AW", "Dutch", "Aruba"], + ["nl-BE", "Dutch", "Belgium"], + ["nl-BQ", "Dutch"], + ["nl-CW", "Dutch"], + ["nl-NL", "Dutch", "Netherlands"], + ["nl-SR", "Dutch", "Suriname"], + ["nl-SX", "Dutch"], + ["nn", "Norwegian Nynorsk"], + ["nn-NO", "Norwegian Nynorsk", "Norway"], + ["om", "Oromo"], + ["om-ET", "Oromo", "Ethiopia"], + ["om-KE", "Oromo", "Kenya"], + ["or", "Oriya"], + ["or-IN", "Oriya", "India"], + ["os", "Ossetian"], + ["os-GE", "Ossetian", "Georgia"], + ["os-RU", "Ossetian", "Russia"], + ["pa", "Panjabi"], + ["pa-IN", "Panjabi", "India"], + ["pa-PK", "Panjabi", "Pakistan"], + ["pl", "Polish"], + ["pl-PL", "Polish", "Poland"], + ["ps", "Pushto"], + ["ps-AF", "Pushto", "Afghanistan"], + ["pt", "Portuguese"], + ["pt-AO", "Portuguese", "Angola"], + ["pt-BR", "Portuguese", "Brazil"], + ["pt-CH", "Portuguese", "Switzerland"], + ["pt-CV", "Portuguese", "Cape Verde"], + ["pt-GQ", "Portuguese", "Equatorial Guinea"], + ["pt-GW", "Portuguese", "Guinea-Bissau"], + ["pt-LU", "Portuguese", "Luxembourg"], + ["pt-MO", "Portuguese", "Macau"], + ["pt-MZ", "Portuguese", "Mozambique"], + ["pt-PT", "Portuguese", "Portugal"], + ["pt-ST", "Portuguese", "Sao Tome and Principe"], + ["pt-TL", "Portuguese", "Timor-Leste (East Timor)"], + ["qu", "Quechua"], + ["qu-BO", "Quechua", "Bolivia"], + ["qu-EC", "Quechua", "Ecuador"], + ["qu-PE", "Quechua", "Peru"], + ["rm", "Romansh"], + ["rm-CH", "Romansh", "Switzerland"], + ["rn", "Rundi"], + ["rn-BI", "Rundi", "Burundi"], + ["ro", "Romanian"], + ["ro-MD", "Romanian", "Moldova"], + ["ro-RO", "Romanian", "Romania"], + ["ru", "Russian"], + ["ru-BY", "Russian", "Belarus"], + ["ru-KG", "Russian", "Kyrgyzstan"], + ["ru-KZ", "Russian", "Kazakhstan"], + ["ru-MD", "Russian", "Moldova"], + ["ru-RU", "Russian", "Russia"], + ["ru-UA", "Russian", "Ukraine"], + ["rw", "Kinyarwanda"], + ["rw-RW", "Kinyarwanda", "Rwanda"], + ["se", "Northern Sami"], + ["se-FI", "Northern Sami", "Finland"], + ["se-NO", "Northern Sami", "Norway"], + ["se-SE", "Northern Sami", "Sweden"], + ["sg", "Sango"], + ["sg-CF", "Sango", "Central African Republic"], + ["si", "Sinhala"], + ["si-LK", "Sinhala", "Sri Lanka"], + ["sk", "Slovak"], + ["sk-SK", "Slovak", "Slovakia"], + ["sl", "Slovenian"], + ["sl-SI", "Slovenian", "Slovenia"], + ["sn", "Shona"], + ["sn-ZW", "Shona", "Zimbabwe"], + ["so", "Somali"], + ["so-DJ", "Somali", "Djibouti"], + ["so-ET", "Somali", "Ethiopia"], + ["so-KE", "Somali", "Kenya"], + ["so-SO", "Somali", "Somalia"], + ["sq", "Albanian"], + ["sq-AL", "Albanian", "Albania"], + ["sq-MK", "Albanian", "Macedonia"], + ["sq-XK", "Albanian"], + ["sr", "Serbian"], + ["sr-BA", "Serbian", "Bosnia and Herzegovina"], + ["sr-ME", "Serbian", "Montenegro"], + ["sr-RS", "Serbian", "Serbia"], + ["sr-XK", "Serbian"], + ["sv", "Swedish"], + ["sv-AX", "Swedish", "Aland"], + ["sv-FI", "Swedish", "Finland"], + ["sv-SE", "Swedish", "Sweden"], + ["sw", "Swahili"], + ["sw-CD", "Swahili", "Congo"], + ["sw-KE", "Swahili", "Kenya"], + ["sw-TZ", "Swahili", "Tanzania"], + ["sw-UG", "Swahili", "Uganda"], + ["ta", "Tamil"], + ["ta-IN", "Tamil", "India"], + ["ta-LK", "Tamil", "Sri Lanka"], + ["ta-MY", "Tamil", "Malaysia"], + ["ta-SG", "Tamil", "Singapore"], + ["te", "Telugu"], + ["te-IN", "Telugu", "India"], + ["th", "Thai"], + ["th-TH", "Thai", "Thailand"], + ["ti", "Tigrinya"], + ["ti-ER", "Tigrinya", "Eritrea"], + ["ti-ET", "Tigrinya", "Ethiopia"], + ["tk", "Turkmen"], + ["tk-TM", "Turkmen", "Turkmenistan"], + ["to", "Tonga (Tonga Islands)"], + ["to-TO", "Tonga (Tonga Islands)", "Tonga"], + ["tr", "Turkish"], + ["tr-CY", "Turkish", "Cyprus"], + ["tr-TR", "Turkish", "Turkey"], + ["ug", "Uighur"], + ["ug-CN", "Uighur", "China"], + ["uk", "Ukrainian"], + ["uk-UA", "Ukrainian", "Ukraine"], + ["ur", "Urdu"], + ["ur-IN", "Urdu", "India"], + ["ur-PK", "Urdu", "Pakistan"], + ["uz", "Uzbek"], + ["uz-AF", "Uzbek", "Afghanistan"], + ["uz-UZ", "Uzbek", "Uzbekistan"], + ["vi", "Vietnamese"], + ["vi-VN", "Vietnamese", "Vietnam"], + ["vo", "Volap\xFCk"], + ["yi", "Yiddish"], + ["yi-1", "Yiddish"], + ["yo", "Yoruba"], + ["yo-BJ", "Yoruba", "Benin"], + ["yo-NG", "Yoruba", "Nigeria"], + ["zh", "Chinese"], + ["zh-CN", "Chinese", "China"], + ["zh-HK", "Chinese", "Hong Kong"], + ["zh-MO", "Chinese", "Macau"], + ["zh-SG", "Chinese", "Singapore"], + ["zh-TW", "Chinese", "China"], + ["zu", "Zulu"], + ["zu-ZA", "Zulu", "South Africa"] +]; + +// node_modules/cspell-trie-lib/dist/lib/models/locale/locale.js +var codesByLocale; +var Locale = class { + constructor(locale) { + this._raw = locale; + this._locale = normalizeLocale(locale); + } + get locale() { + return this._locale; + } + localInfo() { + return lookupLocaleInfo(this._locale); + } + isValid() { + return isStandardLocale(this._locale); + } + toJSON() { + return this.locale; + } + toString() { + return this.locale; + } +}; +var regExTwoLetter = /^[a-z]{2}$/i; +var regExLocaleWithCountry = /^([a-z]{2})[_-]?([a-z]{2,3})$/i; +var regExValidLocale = /^([a-z]{2})(?:-([A-Z]{2,3}))?$/; +function normalizeLocale(locale) { + locale = locale.trim(); + if (regExTwoLetter.test(locale)) + return locale.toLowerCase(); + const m = locale.match(regExLocaleWithCountry); + if (!m) + return locale; + const lang = m[1].toLowerCase(); + const variant = m[2].toUpperCase(); + return `${lang}-${variant}`; +} +function isStandardLocale(locale) { + return regExValidLocale.test(locale); +} +function lookupLocaleInfo(locale) { + codesByLocale = codesByLocale || buildLocaleLookup(); + return codesByLocale.get(locale); +} +function buildLocaleLookup() { + const info3 = codes.map(([locale, language, country]) => ({ locale, language, country })); + return new Map(info3.map((i) => [i.locale, i])); +} +function createLocale(locale) { + return new Locale(locale); +} +function parseLocale(locales) { + locales = typeof locales === "string" ? locales.split(",") : locales; + return locales.map(createLocale); +} + +// node_modules/cspell-trie-lib/dist/lib/mappers/mapCosts.js +var defaultEditCosts = { + accentCosts: 1, + baseCost: 100, + capsCosts: 1, + firstLetterPenalty: 4, + nonAlphabetCosts: 110 +}; +var defaultHunspellCosts = { + ...defaultEditCosts, + ioConvertCost: 30, + keyboardCost: 99, + mapCost: 25, + replaceCosts: 75, + tryCharCost: 100 +}; +function mapHunspellCosts(costs = {}) { + return { ...defaultHunspellCosts, ...cleanCopy(costs) }; +} +function mapEditCosts(costs = {}) { + return { ...defaultEditCosts, ...cleanCopy(costs) }; +} + +// node_modules/cspell-trie-lib/dist/lib/utils/text.js +function expandCharacterSet(line, rangeChar = "-") { + const charSet = /* @__PURE__ */ new Set(); + let mode = 0; + let prev = ""; + for (const char of line) { + if (mode) { + expandRange(prev, char).forEach((a) => charSet.add(a)); + mode = 0; + } + if (char === rangeChar) { + if (prev) { + mode = 1; + continue; } - let stats; - try { - stats = options.statSync(p); - } catch (er3) { - if (er3.code === "ENOENT") - return; - else - throw er; + } + charSet.add(char); + prev = char; + } + if (mode) + charSet.add(rangeChar); + return charSet; +} +function expandRange(a, b) { + const values = []; + const end = b.codePointAt(0); + const begin = a.codePointAt(0); + if (!(begin && end)) + return values; + for (let i = begin; i <= end; ++i) { + values.push(String.fromCodePoint(i)); + } + return values; +} +function caseForms(letter, locale) { + const forms2 = /* @__PURE__ */ new Set([letter]); + function tryCases(s) { + forms2.add(s.toLocaleLowerCase(locale)); + forms2.add(s.toLocaleUpperCase(locale)); + } + tryCases(letter); + [...forms2].forEach(tryCases); + return [...forms2].filter((a) => !!a); +} +function accentForms(letter) { + const forms2 = /* @__PURE__ */ new Set([letter, letter.normalize("NFC"), letter.normalize("NFD")]); + return forms2; +} +function stripAccents(characters) { + return characters.normalize("NFD").replace(/\p{M}/gu, ""); +} +function stripNonAccents(characters) { + return characters.normalize("NFD").replace(/[^\p{M}]/gu, ""); +} + +// node_modules/cspell-trie-lib/dist/lib/mappers/joinLetters.js +function joinLetters(letters) { + const v = [...letters]; + return v.map((a) => a.length > 1 || !a.length ? `(${a})` : a).join(""); +} + +// node_modules/cspell-trie-lib/dist/lib/mappers/mapToSuggestionCostDef.js +function parseAlphabet(cs, locale, editCost) { + const { cost, penalty } = cs; + const characters = expandCharacterSet(cs.characters); + const charForms = [ + ...pipeSync(characters, opMapSync((c) => caseForms(c, locale).sort())) + ]; + const alphabet = joinLetters([ + ...pipeSync(charForms, opFlattenSync(), opMapSync((letter) => accentForms(letter)), opFlattenSync(), opUniqueSync()) + ].sort()); + const sugAlpha = clean2({ + map: alphabet, + replace: cost, + insDel: cost, + swap: cost, + penalty + }); + return [ + sugAlpha, + parseAlphabetCaps(cs.characters, locale, editCost), + ...calcCostsForAccentedLetters(alphabet, locale, editCost) + ]; +} +function parseAlphabetCaps(alphabet, locale, editCost) { + const characters = expandCharacterSet(alphabet); + const charForms = [ + ...pipeSync(characters, opMapSync((c) => caseForms(c, locale).sort())) + ]; + const caps = charForms.map((a) => joinLetters(a)).join("|"); + const sugCaps = { + map: caps, + replace: editCost.capsCosts + }; + return sugCaps; +} +function calcFirstCharacterReplaceDefs(alphabets, editCost) { + return alphabets.map((cs) => calcFirstCharacterReplace(cs, editCost)); +} +function calcFirstCharacterReplace(cs, editCost) { + const mapOfFirstLetters = [ + ...pipeSync(expandCharacterSet(cs.characters), opUniqueSync(), opMapSync((letter) => `(^${letter})`)) + ].sort().join("") + "(^)"; + const penalty = editCost.firstLetterPenalty; + const cost = cs.cost - penalty; + return { + map: mapOfFirstLetters, + replace: cost, + penalty: penalty * 2 + }; +} +function parseAccents(cs, _editCost) { + const { cost, penalty } = cs; + const accents = joinLetters([ + ...pipeSync(expandCharacterSet(cs.characters), opMapSync((char) => stripNonAccents(char))) + ]); + if (!accents) + return void 0; + return clean2({ + map: accents, + replace: cost, + insDel: cost, + penalty + }); +} +function calcCostsForAccentedLetters(simpleMap, locale, costs) { + const charactersWithAccents = [ + ...pipeSync(splitMap2(simpleMap), opMapSync((char) => caseForms(char, locale)), opFlattenSync(), opMapSync((char) => [...accentForms(char)]), opFilterSync((forms2) => forms2.length > 1)) + ]; + const characters = pipeSync(charactersWithAccents, opMapSync((forms2) => /* @__PURE__ */ new Set([...forms2, ...forms2.map((char) => stripAccents(char))])), opMapSync((forms2) => [...forms2].sort()), opFilterSync((forms2) => forms2.length > 1), opMapSync(joinLetters), opUniqueSync()); + const replaceAccentMap = [...characters].join("|"); + const cost = costs.accentCosts; + const costToReplaceAccent = !replaceAccentMap ? [] : [{ map: replaceAccentMap, replace: cost }]; + const normalizeMap2 = charactersWithAccents.map((a) => a.sort()).map(joinLetters).join("|"); + const costToNormalizeAccent = !normalizeMap2 ? [] : [{ map: normalizeMap2, replace: 0 }]; + return [...costToReplaceAccent, ...costToNormalizeAccent]; +} +function* splitMap2(map3) { + let seq = ""; + let mode = 0; + for (const char of map3) { + if (mode && char === ")") { + yield seq; + mode = 0; + continue; + } + if (mode) { + seq += char; + continue; + } + if (char === "(") { + mode = 1; + seq = ""; + continue; + } + yield char; + } +} + +// node_modules/cspell-trie-lib/dist/lib/mappers/mapHunspellInformation.js +function hunspellInformationToSuggestionCostDef(hunInfo, locales) { + const costs = calcCosts(hunInfo.costs, locales); + const operations = [ + affKey, + affKeyCaps, + affMap, + affMapAccents, + affMapCaps, + affNoTry, + affRepConv, + affTry, + affTryAccents, + affTryFirstCharacterReplace + ]; + function parseAff(aff, costs2) { + const regSupportedAff = /^(?:MAP|KEY|TRY|NO-TRY|ICONV|OCONV|REP)\s/; + const rejectAff = /^(?:MAP|KEY|TRY|ICONV|OCONV|REP)\s+\d+$/; + const lines = aff.split("\n").map((a) => a.replace(/#.*/, "")).map((a) => a.trim()).filter((a) => regSupportedAff.test(a)).filter((a) => !rejectAff.test(a)); + const defs = pipeSync(lines, opMapSync((line) => pipeSync(operations, opMapSync((fn) => fn(line, costs2)), opMapSync(asArrayOf), opFlattenSync())), opFlattenSync(), opFilterSync(isDefined3)); + return [...defs]; + } + return parseAff(hunInfo.aff, costs); +} +function calcCosts(costs = {}, locale) { + const useLocale = locale?.length ? locale.map((loc) => loc.locale) : void 0; + const hunCosts = mapHunspellCosts(costs); + const c = { + ...hunCosts, + locale: useLocale + }; + return c; +} +var regExpMap = /^(?:MAP)\s+(\S+)$/; +function affMap(line, costs) { + const m = line.match(regExpMap); + if (!m) + return void 0; + const map3 = m[1]; + const cost = costs.mapCost; + return { + map: map3, + replace: cost, + swap: cost + }; +} +var regExpTry = /^(?:TRY)\s+(\S+)$/; +function affTry(line, costs) { + const m = line.match(regExpTry); + if (!m) + return void 0; + const cost = costs.tryCharCost; + const tryChars = m[1]; + const characters = tryChars; + return parseAlphabet({ + characters, + cost + }, costs.locale, costs); +} +function affTryFirstCharacterReplace(line, costs) { + const m = line.match(regExpTry); + if (!m) + return void 0; + const characters = m[1]; + const cost = costs.tryCharCost; + return calcFirstCharacterReplace({ + characters, + cost + }, costs); +} +var regExpNoTry = /^NO-TRY\s+(\S+)$/; +function affNoTry(line, costs) { + const m = line.match(regExpNoTry); + if (!m) + return void 0; + const map3 = m[1]; + return { + map: map3, + insDel: Math.max(costs.nonAlphabetCosts - costs.tryCharCost, 0), + penalty: costs.nonAlphabetCosts + costs.tryCharCost + }; +} +var regExpRepConv = /^(?:REP|(?:I|O)CONV)\s+(\S+)\s+(\S+)$/; +function affRepConv(line, costs) { + const m = line.match(regExpRepConv); + if (!m) + return void 0; + const cost = line.startsWith("REP") ? costs.replaceCosts : costs.ioConvertCost; + const from = m[1]; + let into = m[2]; + into = into.replace(/^0$/, ""); + if (from.startsWith("^") && !into.startsWith("^")) { + into = "^" + into; + } + if (from.endsWith("$") && !into.endsWith("$")) { + into = into + "$"; + } + return { + map: joinLetters([from, into]), + replace: cost + }; +} +var regExpKey = /^(?:KEY)\s+(\S+)$/; +function affKey(line, costs) { + const m = line.match(regExpKey); + if (!m) + return void 0; + const kbd = m[1]; + const pairs = [...splitMap2(kbd)].map(reducer((p, v) => ({ a: p.b, b: v }), { a: "|", b: "|" })).filter((ab) => ab.a !== "|" && ab.b !== "|").map(({ a, b }) => joinLetters([a, b])); + const pairsUpper = pairs.map((p) => p.toLocaleUpperCase(costs.locale)); + const map3 = unique(pairs.concat(pairsUpper)).join("|"); + const cost = costs.keyboardCost; + return { + map: map3, + replace: cost, + swap: cost + }; +} +function affKeyCaps(line, costs) { + const m = line.match(regExpKey); + if (!m) + return void 0; + return parseCaps(m[1], costs); +} +function affMapCaps(line, costs) { + const m = line.match(regExpMap); + if (!m) + return void 0; + return parseCaps(m[1], costs); +} +function affTryAccents(line, costs) { + const m = line.match(regExpTry); + if (!m) + return void 0; + return calcCostsForAccentedLetters(m[1], costs.locale, costs); +} +function affMapAccents(line, costs) { + const m = line.match(regExpMap); + if (!m) + return void 0; + return calcCostsForAccentedLetters(m[1], costs.locale, costs); +} +function parseCaps(value, costs) { + const locale = costs.locale; + const letters = [...splitMap2(value)].filter((a) => a !== "|"); + const withCases = letters.map((s) => caseForms(s, locale)).filter((forms2) => forms2.length > 1).map(joinLetters); + const map3 = unique(withCases).join("|"); + const cost = costs.capsCosts; + if (!map3) + return void 0; + return { + map: map3, + replace: cost + }; +} +function reducer(fn, initialVal) { + let acc = initialVal; + return (val, i) => acc = fn(acc, val, i); +} +function asArrayOf(v) { + return Array.isArray(v) ? v : [v]; +} + +// node_modules/cspell-trie-lib/dist/lib/mappers/mapDictionaryInfo.js +function mapDictionaryInformation(dictInfo) { + const _locale = dictInfo.locale; + const locale = _locale ? parseLocale(_locale).filter((loc) => loc.isValid()) : void 0; + const locales = locale?.map((loc) => loc.locale); + const costs = mapEditCosts(dictInfo.costs); + const defsEC = dictInfo.suggestionEditCosts || []; + const defsHI = dictInfo.hunspellInformation ? hunspellInformationToSuggestionCostDef(dictInfo.hunspellInformation, locale) : []; + return [ + ...defsEC, + ...processAlphabet(dictInfo.alphabet, locales, costs), + ...processAccents(dictInfo.accents, costs), + ...defsHI + ]; +} +function processAlphabet(alphabet, locale, editCost) { + const csAlphabet = toCharSets(alphabet, "a-zA-Z", editCost.baseCost); + return [ + ...pipeSync(csAlphabet, opMapSync((cs) => parseAlphabet(cs, locale, editCost)), opFlattenSync()), + ...calcFirstCharacterReplaceDefs(csAlphabet, editCost) + ]; +} +function toCharSets(cs, defaultValue, cost, penalty) { + cs = cs ?? defaultValue; + if (!cs) + return []; + if (typeof cs === "string") { + cs = [ + { + characters: cs, + cost } - if (stats.isDirectory()) - rmdirSync(p, options, er); - else - options.unlinkSync(p); - }; - var rmdir = (p, options, originalEr, cb) => { - assert7(p); - assert7(options); - assert7(typeof cb === "function"); - options.rmdir(p, (er) => { - if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) - rmkids(p, options, cb); - else if (er && er.code === "ENOTDIR") - cb(originalEr); - else - cb(er); - }); - }; - var rmkids = (p, options, cb) => { - assert7(p); - assert7(options); - assert7(typeof cb === "function"); - options.readdir(p, (er, files) => { - if (er) - return cb(er); - let n = files.length; - if (n === 0) - return options.rmdir(p, cb); - let errState; - files.forEach((f) => { - rimraf(path16.join(p, f), options, (er2) => { - if (errState) - return; - if (er2) - return cb(errState = er2); - if (--n === 0) - options.rmdir(p, cb); - }); - }); - }); - }; - var rimrafSync = (p, options) => { - options = options || {}; - defaults(options); - assert7(p, "rimraf: missing path"); - assert7.equal(typeof p, "string", "rimraf: path should be a string"); - assert7(options, "rimraf: missing options"); - assert7.equal(typeof options, "object", "rimraf: options should be object"); - let results; - if (options.disableGlob || !glob2.hasMagic(p)) { - results = [p]; - } else { - try { - options.lstatSync(p); - results = [p]; - } catch (er) { - results = glob2.sync(p, options.glob); + ]; + } + if (penalty !== void 0) { + cs.forEach((cs2) => cs2.penalty = penalty); + } + return cs; +} +function processAccents(accents, editCost) { + const cs = toCharSets(accents, "\u0300-\u0341", editCost.accentCosts); + return cs.map((cs2) => parseAccents(cs2, editCost)).filter(isDefined3); +} +function mapDictionaryInformationToAdjustment(dictInfo) { + if (!dictInfo.adjustments) + return []; + return dictInfo.adjustments.map(mapAdjustment); +} +function mapAdjustment(adj) { + const { id, regexp, penalty } = adj; + return { + id, + regexp: new RegExp(regexp), + penalty + }; +} + +// node_modules/cspell-trie-lib/dist/lib/mappers/mapDictionaryInfoToWeightMap.js +var defaultDefs = [ + { + map: "1234567890-.", + insDel: 1, + penalty: 200 + } +]; +var defaultAdjustments = [ + { + id: "compound-case-change", + regexp: /\p{Ll}∙\p{Lu}/gu, + penalty: 1e3 + }, + { + id: "short-compounds-1", + regexp: /^[^∙]{0,2}(?=∙)|∙[^∙]{0,2}(?=∙|$)/gm, + penalty: 100 + }, + { + id: "short-compounds-3", + regexp: /^[^∙]{3}(?=∙)|∙[^∙]{3}(?=∙|$)/gm, + penalty: 50 + } +]; +function mapDictionaryInformationToWeightMap(dictInfo) { + const defs = mapDictionaryInformation(dictInfo).concat(defaultDefs); + const adjustments = mapDictionaryInformationToAdjustment(dictInfo); + const map3 = createWeightMap(...defs); + addAdjustment(map3, ...defaultAdjustments, ...adjustments); + return map3; +} + +// node_modules/cspell-trie-lib/dist/lib/suggestions/suggest.js +var baseCost = opCosts.baseCost; +var swapCost = opCosts.swapCost; +var postSwapCost = swapCost - baseCost; +var mapSubCost = opCosts.visuallySimilar; +var maxCostScale = opCosts.wordLengthCostFactor; + +// node_modules/cspell-trie-lib/dist/lib/TrieBuilder.js +var SymbolFrozenNode = Symbol(); + +// node_modules/cspell-trie-lib/dist/lib/utils/normalizeWord.js +var normalizeWord = (text) => text.normalize(); +var normalizeWordForCaseInsensitive = (text) => { + const t = text.toLowerCase(); + return [t, t.normalize("NFD").replace(/\p{M}/gu, "")]; +}; + +// node_modules/cspell-trie-lib/dist/lib/SimpleDictionaryParser.js +var RegExpSplit = /[\s,;]/g; +var _defaultOptions = { + commentCharacter: LINE_COMMENT, + optionalCompoundCharacter: OPTIONAL_COMPOUND_FIX, + compoundCharacter: COMPOUND_FIX, + forbiddenPrefix: FORBID_PREFIX, + caseInsensitivePrefix: CASE_INSENSITIVE_PREFIX, + keepExactPrefix: IDENTITY_PREFIX, + stripCaseAndAccents: true, + stripCaseAndAccentsKeepDuplicate: false, + stripCaseAndAccentsOnForbidden: false, + split: false, + splitKeepBoth: false, + splitSeparator: RegExpSplit +}; +var defaultParseDictionaryOptions = Object.freeze(_defaultOptions); +var cSpellToolDirective = "cspell-dictionary:"; +function createDictionaryLineParserMapper(options) { + const _options = options || _defaultOptions; + const { commentCharacter = _defaultOptions.commentCharacter, optionalCompoundCharacter: optionalCompound = _defaultOptions.optionalCompoundCharacter, compoundCharacter: compound = _defaultOptions.compoundCharacter, caseInsensitivePrefix: ignoreCase2 = _defaultOptions.caseInsensitivePrefix, forbiddenPrefix: forbidden = _defaultOptions.forbiddenPrefix, keepExactPrefix: keepCase = _defaultOptions.keepExactPrefix, splitSeparator = _defaultOptions.splitSeparator, splitKeepBoth = _defaultOptions.splitKeepBoth, stripCaseAndAccentsKeepDuplicate = _defaultOptions.stripCaseAndAccentsKeepDuplicate, stripCaseAndAccentsOnForbidden = _defaultOptions.stripCaseAndAccentsOnForbidden } = _options; + let { stripCaseAndAccents = _defaultOptions.stripCaseAndAccents, split: split2 = _defaultOptions.split } = _options; + function isString3(line) { + return typeof line === "string"; + } + function trim(line) { + return line.trim(); + } + function removeComments(line) { + const idx2 = line.indexOf(commentCharacter); + if (idx2 < 0) + return line; + const idxDirective = line.indexOf(cSpellToolDirective, idx2); + if (idxDirective >= 0) { + const flags = line.slice(idxDirective).split(/[\s,;]/g).map((s) => s.trim()).filter((a) => !!a); + for (const flag of flags) { + switch (flag) { + case "split": + split2 = true; + break; + case "no-split": + split2 = false; + break; + case "no-generate-alternatives": + stripCaseAndAccents = false; + break; + case "generate-alternatives": + stripCaseAndAccents = true; + break; } } - if (!results.length) - return; - for (let i = 0; i < results.length; i++) { - const p2 = results[i]; - let st; - try { - st = options.lstatSync(p2); - } catch (er) { - if (er.code === "ENOENT") - return; - if (er.code === "EPERM" && isWindows2) - fixWinEPERMSync(p2, options, er); - } - try { - if (st && st.isDirectory()) - rmdirSync(p2, options, null); - else - options.unlinkSync(p2); - } catch (er) { - if (er.code === "ENOENT") - return; - if (er.code === "EPERM") - return isWindows2 ? fixWinEPERMSync(p2, options, er) : rmdirSync(p2, options, er); - if (er.code !== "EISDIR") - throw er; - rmdirSync(p2, options, er); - } + } + return line.slice(0, idx2).trim(); + } + function filterEmptyLines(line) { + return !!line; + } + function* mapOptionalPrefix(line) { + if (line[0] === optionalCompound) { + const t = line.slice(1); + yield t; + yield compound + t; + } else { + yield line; + } + } + function* mapOptionalSuffix(line) { + if (line.slice(-1) === optionalCompound) { + const t = line.slice(0, -1); + yield t; + yield t + compound; + } else { + yield line; + } + } + const doNotNormalizePrefix = /* @__PURE__ */ Object.create(null); + [ignoreCase2, keepCase, '"'].forEach((prefix) => doNotNormalizePrefix[prefix] = true); + if (!stripCaseAndAccentsOnForbidden) { + doNotNormalizePrefix[forbidden] = true; + } + function removeDoublePrefix(w) { + return w.startsWith(ignoreCase2 + ignoreCase2) ? w.slice(1) : w; + } + function stripKeepCasePrefixAndQuotes(word) { + word = word.replace(/"(.*?)"/g, "$1"); + return word[0] === keepCase ? word.slice(1) : word; + } + function _normalize(word) { + return normalizeWord(stripKeepCasePrefixAndQuotes(word)); + } + function* mapNormalize(word) { + const nWord = _normalize(word); + const forms2 = /* @__PURE__ */ new Set(); + forms2.add(nWord); + if (stripCaseAndAccents && !(word[0] in doNotNormalizePrefix)) { + for (const n of normalizeWordForCaseInsensitive(nWord)) { + (stripCaseAndAccentsKeepDuplicate || n !== nWord) && forms2.add(ignoreCase2 + n); } - }; - var rmdirSync = (p, options, originalEr) => { - assert7(p); - assert7(options); - try { - options.rmdirSync(p); - } catch (er) { - if (er.code === "ENOENT") - return; - if (er.code === "ENOTDIR") - throw originalEr; - if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") - rmkidsSync(p, options); + } + yield* forms2; + } + function* splitWords(lines) { + for (const line of lines) { + if (split2) { + const lineEscaped = line.indexOf('"') >= 0 ? line.replace(/".*?"/g, (quoted) => " " + quoted.replace(/(\s)/g, "\\$1") + " ") : line; + const words = splitLine(lineEscaped, splitSeparator); + yield* words.map((escaped) => escaped.replace(/\\/g, "")); + if (!splitKeepBoth) + continue; } - }; - var rmkidsSync = (p, options) => { - assert7(p); - assert7(options); - options.readdirSync(p).forEach((f) => rimrafSync(path16.join(p, f), options)); - const retries = isWindows2 ? 100 : 1; - let i = 0; - do { - let threw = true; - try { - const ret = options.rmdirSync(p, options); - threw = false; - return ret; - } finally { - if (++i < retries && threw) - continue; - } - } while (true); - }; - module2.exports = rimraf; - rimraf.sync = rimrafSync; + yield line; + } + } + function* splitLines(paragraphs) { + for (const paragraph of paragraphs) { + yield* paragraph.split("\n"); + } + } + const processLines = opCombineSync(opFilterSync(isString3), splitLines, opMapSync(removeComments), splitWords, opMapSync(trim), opFilterSync(filterEmptyLines), opConcatMapSync(mapOptionalPrefix), opConcatMapSync(mapOptionalSuffix), opConcatMapSync(mapNormalize), opMapSync(removeDoublePrefix)); + return processLines; +} +function parseDictionaryLines(lines, options) { + return createDictionaryLineParserMapper(options)(typeof lines === "string" ? [lines] : lines); +} +var RegExpToEncode = /\\([\s,;])/g; +var RegExpDecode = /<<(%[\da-f]{2})>>/gi; +function encodeLine(line) { + return line.replace(RegExpToEncode, (_, v) => "<<" + encodeURIComponent(v) + ">>"); +} +function decodeLine(line) { + return line.replace(RegExpDecode, (_, v) => "\\" + decodeURIComponent(v)); +} +function splitLine(line, regExp) { + return encodeLine(line).split(regExp).map((line2) => decodeLine(line2)); +} + +// node_modules/cspell-lib/dist/esm/Settings/DictionarySettings.mjs +var path3 = __toESM(require("path"), 1); + +// node_modules/cspell-lib/dist/esm/Settings/DictionaryReferenceCollection.mjs +function createDictionaryReferenceCollection(dictionaries) { + return new _DictionaryReferenceCollection(dictionaries); +} +var _DictionaryReferenceCollection = class { + constructor(dictionaries) { + this.dictionaries = dictionaries; + this.collection = collect(dictionaries); + } + isEnabled(name) { + const entry = this.collection[name]; + return entry === void 0 ? void 0 : !!(entry & 1); + } + isBlocked(name) { + const entry = this.collection[name]; + return entry === void 0 ? void 0 : !(entry & 1); + } + enabled() { + return this.dictionaryIds.filter((n) => this.isEnabled(n)); + } + blocked() { + return this.dictionaryIds.filter((n) => this.isBlocked(n)); + } + get dictionaryIds() { + return Object.keys(this.collection); + } +}; +function collect(dictionaries) { + const refs = dictionaries.map(normalizeName).map(mapReference); + const col = {}; + for (const ref of refs) { + col[ref.name] = Math.max(ref.weight, col[ref.name] || 0); + } + return col; +} +function normalizeName(entry) { + return entry.normalize().trim(); +} +function mapReference(ref) { + const name = ref.replace(/^!+/, ""); + const weight = ref.length - name.length + 1; + return { name: name.trim(), weight }; +} + +// node_modules/cspell-lib/dist/esm/Settings/DictionarySettings.mjs +function filterDictDefsToLoad(dictRefCol, defs) { + const allActiveDefs = defs.filter(({ name }) => dictRefCol.isEnabled(name)).map(fixPath); + return [...new Map(allActiveDefs.map((d) => [d.name, d])).values()]; +} +function fixPath(def) { + if (def instanceof _DictionaryDefinitionInternalWithSource) { + return def; + } + const newPath = fixDicPath(def.path, def.file); + return { + ...def, + file: void 0, + path: newPath + }; +} +function fixDicPath(defPath, defFile) { + const parts = [defPath || "", defFile || ""].filter((p) => !!p); + return parts.length > 1 ? path3.join(...parts) : parts[0] || ""; +} +function mapDictDefsToInternal(defs, pathToSettingsFile) { + return defs?.map((def) => mapDictDefToInternal(def, pathToSettingsFile)); +} +var internalDefs = new AutoResolveWeakCache(); +function mapDictDefToInternal(def, pathToSettingsFile) { + return internalDefs.get(def, (def2) => _mapDictDefToInternal(def2, pathToSettingsFile)); +} +function _mapDictDefToInternal(def, pathToSettingsFile) { + if (isDictionaryDefinitionWithSource(def)) { + return def; + } + if (isDictionaryDefinitionInlineInternal(def)) { + return { ...def, __source: pathToSettingsFile }; + } + return new _DictionaryDefinitionInternalWithSource(def, pathToSettingsFile); +} +function determineName(filename, options) { + return options.name || path3.basename(filename); +} +function calcDictionaryDefsToLoad(settings) { + const { dictionaries = [], dictionaryDefinitions = [], noSuggestDictionaries = [] } = settings; + const colNoSug = createDictionaryReferenceCollection(noSuggestDictionaries); + const colDicts = createDictionaryReferenceCollection(dictionaries.concat(colNoSug.enabled())); + const modDefs = dictionaryDefinitions.map((def) => { + const enabled = colNoSug.isEnabled(def.name); + if (enabled === void 0) + return def; + return { ...def, noSuggest: enabled }; + }); + return filterDictDefsToLoad(colDicts, modDefs); +} +function isDictionaryDefinitionWithSource(d) { + return isDictionaryFileDefinitionInternalWithSource(d) || isDictionaryDefinitionInlineInternalWithSource(d); +} +function isDictionaryFileDefinitionInternalWithSource(def) { + return def instanceof _DictionaryDefinitionInternalWithSource; +} +function isDictionaryDefinitionInlineInternalWithSource(def) { + return isDictionaryDefinitionInlineInternal(def) && !!def.__source; +} +var _DictionaryDefinitionInternalWithSource = class { + constructor(def, __source) { + this.__source = __source; + const defAll = def; + const { path: relPath = "", file = "", addWords, description, dictionaryInformation, type, repMap, noSuggest, scope, useCompounds } = defAll; + const defaultPath = path3.dirname(__source); + const filePath = fixDicPath(relPath, file); + const name = determineName(filePath, def); + const r = resolveFile(filePath, defaultPath); + const ddi = { + name, + file: void 0, + path: r.filename, + addWords, + description, + dictionaryInformation, + type, + repMap, + noSuggest, + scope, + useCompounds + }; + Object.assign(this, clean(ddi)); + this.ddi = ddi; + this.name = ddi.name; + this.file = ddi.file; + this.path = ddi.path; + this._weightMap = this.dictionaryInformation ? mapDictionaryInformationToWeightMap(this.dictionaryInformation) : void 0; + } + get weightMap() { + return this._weightMap; + } + toJSON() { + return this.ddi; + } +}; + +// node_modules/cspell-lib/dist/esm/util/textRegex.mjs +var regExUpperSOrIng = /([\p{Lu}\p{M}]+\\?['’]?(?:s|ing|ies|es|ings|ed|ning))(?!\p{Ll})/gu; +var regExSplitWords = /(\p{Ll}\p{M}?)(\p{Lu})/gu; +var regExSplitWords2 = /(\p{Lu}\p{M}?)(\p{Lu}\p{M}?\p{Ll})/gu; +var regExWords = /\p{L}\p{M}?(?:(?:\\?['’])?\p{L}\p{M}?)*/gu; +var regExWordsAndDigits = /[\p{L}\w'’`.+-](?:(?:\\(?=[']))?[\p{L}\p{M}\w'’`.+-])*/gu; +var regExIgnoreCharacters = /[\p{sc=Hiragana}\p{sc=Han}\p{sc=Katakana}\u30A0-\u30FF\p{sc=Hangul}]/gu; +var regExFirstUpper = /^\p{Lu}\p{M}?\p{Ll}+$/u; +var regExAllUpper = /^(?:\p{Lu}\p{M}?)+$/u; +var regExAllLower = /^(?:\p{Ll}\p{M}?)+$/u; +var regExPossibleWordBreaks = /[-+_’'`.\s]/g; +var regExMatchRegExParts = /^\s*\/([\s\S]*?)\/([gimuxy]*)\s*$/; +var regExAccents = /\p{M}/gu; +var regExEscapeCharacters = /(?<=\\)[anrvtbf]/gi; +var regExDanglingQuote = /(?<=(?:^|(?!\p{M})\P{L})(?:\p{L}\p{M}?)?)[']/gu; +var regExTrailingEndings = /(?<=(?:\p{Lu}\p{M}?){2})['’]?(?:s|d|ings?|ies|e[ds]?|ning|th|nth)(?!\p{Ll})/gu; +var regExNumericLiteral = /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/; +function stringToRegExp(pattern, defaultFlags = "gimu", forceFlags = "g") { + if (pattern instanceof RegExp) { + return pattern; + } + try { + const [, pat, flag] = [ + ...pattern.match(regExMatchRegExParts) || ["", pattern.trim(), defaultFlags], + forceFlags + ]; + if (pat) { + const regPattern = flag.includes("x") ? removeVerboseFromRegExp(pat) : pat; + const flags = [...new Set(forceFlags + flag)].join("").replace(/[^gimuy]/g, ""); + const regex = new RegExp(regPattern, flags); + return regex; + } + } catch (e) { + } + return void 0; +} +var SPACES = { + " ": true, + "\n": true, + "\r": true, + " ": true +}; +function removeVerboseFromRegExp(pattern) { + function escape(acc) { + const char = pattern[acc.idx]; + if (char !== "\\") + return void 0; + const next = pattern[++acc.idx]; + acc.idx++; + if (next === "#") { + acc.result += "#"; + return acc; + } + if (!(next in SPACES)) { + acc.result += "\\" + next; + return acc; + } + acc.result += next; + if (next === "\r" && pattern[acc.idx] === "\n") { + acc.result += "\n"; + acc.idx++; + } + return acc; + } + function braces(acc) { + const char = pattern[acc.idx]; + if (char !== "[") + return void 0; + acc.result += char; + acc.idx++; + let escCount = 0; + while (acc.idx < pattern.length) { + const char2 = pattern[acc.idx]; + acc.result += char2; + acc.idx++; + if (char2 === "]" && !(escCount & 1)) + break; + escCount = char2 === "\\" ? escCount + 1 : 0; + } + return acc; + } + function spaces(acc) { + const char = pattern[acc.idx]; + if (!(char in SPACES)) + return void 0; + acc.idx++; + return acc; + } + function comments(acc) { + const char = pattern[acc.idx]; + if (char !== "#") + return void 0; + while (acc.idx < pattern.length && pattern[acc.idx] !== "\n") { + acc.idx++; + } + return acc; + } + function copy(acc) { + const char = pattern[acc.idx++]; + acc.result += char; + return acc; + } + const reducers = [escape, braces, spaces, comments, copy]; + const result = { idx: 0, result: "" }; + while (result.idx < pattern.length) { + for (const r of reducers) { + if (r(result)) + break; + } + } + return result.result; +} + +// node_modules/cspell-lib/dist/esm/Settings/patterns.mjs +function resolvePatterns(regExpList = [], patternDefinitions = []) { + const patternMap = new Map(patternDefinitions.map((def) => [def.name.toLowerCase(), def.pattern])); + const resolved = /* @__PURE__ */ new Set(); + function resolvePattern(p) { + if (resolved.has(p)) + return void 0; + resolved.add(p); + return patternMap.get(p.toString().toLowerCase()) || p; } -}); + function* flatten(patterns) { + for (const pattern of patterns) { + if (Array.isArray(pattern)) { + yield* flatten(pattern.map(resolvePattern).filter(isDefined)); + } else { + yield pattern; + } + } + } + const patternList = regExpList.map(resolvePattern).filter(isDefined); + return [...flatten(patternList)].map(toRegExp).filter(isDefined); +} +function toRegExp(pattern) { + return pattern instanceof RegExp ? new RegExp(pattern) : stringToRegExp(pattern, "gim", "g"); +} + +// node_modules/cspell-lib/dist/esm/Settings/CSpellSettingsServer.mjs +function mergeListUnique(left, right) { + if (!Array.isArray(left)) + return Array.isArray(right) ? right : void 0; + if (!Array.isArray(right)) + return left; + if (!right.length) + return left; + if (!left.length) + return right; + return [.../* @__PURE__ */ new Set([...left, ...right])]; +} +function mergeList(left, right) { + if (!Array.isArray(left)) + return Array.isArray(right) ? right : void 0; + if (!Array.isArray(right)) + return left; + if (!left.length) + return right; + if (!right.length) + return left; + return left.concat(right); +} +var emptyWords = []; +Object.freeze(emptyWords); +var cachedMerges = /* @__PURE__ */ new WeakMap(); +function _mergeWordsCached(left, right) { + const map3 = autoResolveWeak(cachedMerges, left, () => /* @__PURE__ */ new WeakMap()); + return autoResolveWeak(map3, right, () => left.concat(right)); +} +function mergeWordsCached(left, right) { + if (!Array.isArray(left) || !left.length) { + return Array.isArray(right) ? right.length ? right : emptyWords : void 0; + } + if (!Array.isArray(right) || !right.length) + return left; + return _mergeWordsCached(left, right); +} +function mergeObjects(left, right) { + if (!left || typeof left !== "object") + return !right || typeof right !== "object" ? void 0 : right; + if (!right || typeof right !== "object") + return left; + return { ...left, ...right }; +} +function replaceIfNotEmpty(left = [], right = []) { + const filtered = right.filter((a) => !!a); + if (filtered.length) { + return filtered; + } + return left; +} +function mergeSettings(left, ...settings) { + const rawSettings = settings.filter(isDefined).reduce(merge2, toInternalSettings(left)); + return clean(rawSettings); +} +function isEmpty(obj) { + return Object.keys(obj).length === 0 && obj.constructor === Object; +} +var mergeCache = new AutoResolveWeakCache(); +function merge2(left, right) { + const map3 = mergeCache.get(left, () => /* @__PURE__ */ new WeakMap()); + return autoResolveWeak(map3, right, () => _merge(left, right)); +} +function _merge(left, right) { + const _left = toInternalSettings(left); + const _right = toInternalSettings(right); + if (left === right) { + return _left; + } + if (isEmpty(right)) { + return _left; + } + if (isEmpty(left)) { + return _right; + } + if (isLeftAncestorOfRight(_left, _right)) { + return _right; + } + if (doesLeftHaveRightAncestor(_left, _right)) { + return _left; + } + const includeRegExpList = takeRightOtherwiseLeft(_left.includeRegExpList, _right.includeRegExpList); + const optionals = includeRegExpList?.length ? { includeRegExpList } : {}; + const version4 = max3(_left.version, _right.version); + const valuesToClear = { + name: void 0, + id: void 0, + description: void 0, + globRoot: void 0, + import: void 0, + __importRef: void 0 + }; + const settings = cleanCSpellSettingsInternal({ + ..._left, + ..._right, + ...optionals, + ...valuesToClear, + version: version4, + words: mergeWordsCached(_left.words, _right.words), + userWords: mergeWordsCached(_left.userWords, _right.userWords), + flagWords: mergeWordsCached(_left.flagWords, _right.flagWords), + ignoreWords: mergeWordsCached(_left.ignoreWords, _right.ignoreWords), + suggestWords: mergeWordsCached(_left.suggestWords, _right.suggestWords), + enabledLanguageIds: replaceIfNotEmpty(_left.enabledLanguageIds, _right.enabledLanguageIds), + enableFiletypes: mergeList(_left.enableFiletypes, _right.enableFiletypes), + ignoreRegExpList: mergeListUnique(_left.ignoreRegExpList, _right.ignoreRegExpList), + patterns: mergeListUnique(_left.patterns, _right.patterns), + dictionaryDefinitions: mergeListUnique(_left.dictionaryDefinitions, _right.dictionaryDefinitions), + dictionaries: mergeListUnique(_left.dictionaries, _right.dictionaries), + noSuggestDictionaries: mergeListUnique(_left.noSuggestDictionaries, _right.noSuggestDictionaries), + languageSettings: mergeList(_left.languageSettings, _right.languageSettings), + enabled: _right.enabled !== void 0 ? _right.enabled : _left.enabled, + files: mergeListUnique(_left.files, _right.files), + ignorePaths: versionBasedMergeList(_left.ignorePaths, _right.ignorePaths, version4), + overrides: versionBasedMergeList(_left.overrides, _right.overrides, version4), + features: mergeObjects(_left.features, _right.features), + source: mergeSources(_left, _right), + plugins: mergeList(_left.plugins, _right.plugins), + __imports: mergeImportRefs(_left, _right) + }); + return settings; +} +function versionBasedMergeList(left, right, version4) { + if (version4 === configSettingsFileVersion0_1) { + return takeRightOtherwiseLeft(left, right); + } + return mergeListUnique(left, right); +} +function isLeftAncestorOfRight(left, right) { + return hasAncestor(right, left, 0); +} +function doesLeftHaveRightAncestor(left, right) { + return hasAncestor(left, right, 1); +} +function hasAncestor(s, ancestor, side) { + const sources = s.source?.sources; + if (!sources) + return false; + const i = side ? sources.length - 1 : 0; + const src = sources[i]; + return src === ancestor || src && hasAncestor(src, ancestor, side) || false; +} +function mergeInDocSettings(left, right) { + const merged = { + ...mergeSettings(left, right), + includeRegExpList: mergeListUnique(left.includeRegExpList, right.includeRegExpList) + }; + return clean(merged); +} +function takeRightOtherwiseLeft(left, right) { + if (right?.length) { + return right; + } + return left || right; +} +function calcOverrideSettings(settings, filename) { + const _settings = toInternalSettings(settings); + const overrides = _settings.overrides || []; + const result = overrides.filter((override) => checkFilenameMatchesGlob(filename, override.filename)).reduce((settings2, override) => mergeSettings(settings2, override), _settings); + return result; +} +function finalizeSettings(settings) { + return _finalizeSettings(toInternalSettings(settings)); +} +function _finalizeSettings(settings) { + const finalized = { + ...settings, + finalized: true, + ignoreRegExpList: resolvePatterns(settings.ignoreRegExpList, settings.patterns), + includeRegExpList: resolvePatterns(settings.includeRegExpList, settings.patterns), + parserFn: resolveParser(settings) + }; + finalized.name = "Finalized " + (finalized.name || ""); + finalized.source = { name: settings.name || "src", sources: [settings] }; + return finalized; +} +var cacheInternalSettings = new AutoResolveWeakCache(); +function toInternalSettings(settings) { + if (settings === void 0) + return void 0; + if (isCSpellSettingsInternal(settings)) + return settings; + return cacheInternalSettings.get(settings, _toInternalSettings); +} +function _toInternalSettings(settings) { + const { dictionaryDefinitions: defs, ...rest } = settings; + const dictionaryDefinitions = mapDictDefsToInternal(defs, filenameToDirectory(settings.source?.filename) || resolveCwd()); + const setting = dictionaryDefinitions ? { ...rest, dictionaryDefinitions } : rest; + return cleanCSpellSettingsInternal(setting); +} +function filenameToDirectory(filename) { + return filename ? path4.dirname(filename) : void 0; +} +function checkFilenameMatchesGlob(filename, globs) { + const m = new GlobMatcher(globs); + return m.match(filename); +} +function mergeSources(left, right) { + return { + name: "merged", + sources: [left, right] + }; +} +function max3(a, b) { + if (a === void 0 || a === null) + return b; + if (b === void 0 || b === null) + return a; + return a > b ? a : b; +} +function mergeImportRefs(left, right = {}) { + const imports = new Map(left.__imports || []); + if (left.__importRef) { + imports.set(left.__importRef.filename, left.__importRef); + } + if (right.__importRef) { + imports.set(right.__importRef.filename, right.__importRef); + } + const rightImports = right.__imports?.values() || []; + for (const ref of rightImports) { + imports.set(ref.filename, ref); + } + return imports.size ? imports : void 0; +} +function extractDependencies(settings) { + const settingsI = toInternalSettings(settings); + const configFiles = [...mergeImportRefs(settingsI) || []].map(([filename]) => filename); + const dictionaryFiles = calcDictionaryDefsToLoad(settingsI).map((dict) => dict.path).filter((file) => !!file); + return { + configFiles, + dictionaryFiles + }; +} +function resolveCwd() { + const envGlobRoot = process.env[ENV_CSPELL_GLOB_ROOT]; + const cwd = envGlobRoot || process.cwd(); + return cwd; +} +function resolveParser(settings) { + if (!settings.parser) + return void 0; + if (typeof settings.parser === "function") + return settings.parser; + const parserName = settings.parser; + (0, import_assert7.default)(typeof parserName === "string"); + const parsers3 = extractParsers(settings.plugins); + const parser2 = parsers3.get(parserName); + (0, import_assert7.default)(parser2, `Parser "${parserName}" not found.`); + return parser2; +} +var parserCache = new AutoResolveWeakCache(); +var emptyParserMap = /* @__PURE__ */ new Map(); +function* parsers(plugins) { + for (const plugin of plugins) { + if (!plugin.parsers) + continue; + for (const parser2 of plugin.parsers) { + yield [parser2.name, parser2]; + } + } +} +function mapPlugins(plugins) { + return new Map(parsers(plugins)); +} +function extractParsers(plugins) { + if (!plugins || !plugins.length) + return emptyParserMap; + return parserCache.get(plugins, mapPlugins); +} -// node_modules/flat-cache/src/del.js -var require_del = __commonJS({ - "node_modules/flat-cache/src/del.js"(exports, module2) { - var rimraf = require_rimraf().sync; - var fs6 = require("fs"); - module2.exports = function del(file) { - if (fs6.existsSync(file)) { - rimraf(file, { - glob: false - }); - return true; - } - return false; - }; +// node_modules/cspell-lib/dist/esm/util/errors.mjs +var import_util34 = require("util"); +var allowStringOrUndefined = { + string: true, + undefined: true +}; +var allowNumberOrUndefined = { + number: true, + undefined: true +}; +function isErrnoException(e) { + if (!e || typeof e !== "object") + return false; + if (!isError2(e)) + return false; + const ex = e; + return typeof ex.errno in allowNumberOrUndefined && typeof ex.code in allowStringOrUndefined && typeof ex.path in allowStringOrUndefined; +} +function isError2(e) { + if (e instanceof Error) + return true; + if (!e || typeof e !== "object") + return false; + const ex = e; + return typeof ex.name == "string" && typeof ex.message == "string" && typeof ex.stack in allowStringOrUndefined; +} +function toError2(e, errorFactory = UnknownError) { + if (isError2(e)) + return e; + return new errorFactory(e); +} +var UnknownError = class extends Error { + constructor(cause) { + super((0, import_util34.format)(cause)); + this.cause = cause; } -}); +}; +function catchPromiseError(p, handler) { + if (p === void 0) + return void 0; + return _catchPromiseError(p, handler); +} +function wrapCall(fn, handler) { + return (...p) => { + try { + return fn(...p); + } catch (e) { + return handler(e); + } + }; +} +async function _catchPromiseError(p, handler) { + try { + return await p; + } catch (e) { + return handler(e); + } +} -// node_modules/flat-cache/src/cache.js -var require_cache = __commonJS({ - "node_modules/flat-cache/src/cache.js"(exports, module2) { - var path16 = require("path"); - var fs6 = require("fs"); - var utils = require_utils9(); - var del = require_del(); - var writeJSON = utils.writeJSON; - var cache = { - /** - * Load a cache identified by the given Id. If the element does not exists, then initialize an empty - * cache storage. If specified `cacheDir` will be used as the directory to persist the data to. If omitted - * then the cache module directory `./cache` will be used instead - * - * @method load - * @param docId {String} the id of the cache, would also be used as the name of the file cache - * @param [cacheDir] {String} directory for the cache entry - */ - load: function(docId, cacheDir) { - var me = this; - me._visited = {}; - me._persisted = {}; - me._pathToFile = cacheDir ? path16.resolve(cacheDir, docId) : path16.resolve(__dirname, "../.cache/", docId); - if (fs6.existsSync(me._pathToFile)) { - me._persisted = utils.tryParse(me._pathToFile, {}); - } - }, - /** - * Load the cache from the provided file - * @method loadFile - * @param {String} pathToFile the path to the file containing the info for the cache - */ - loadFile: function(pathToFile) { - var me = this; - var dir = path16.dirname(pathToFile); - var fName = path16.basename(pathToFile); - me.load(fName, dir); - }, - /** - * Returns the entire persisted object - * @method all - * @returns {*} - */ - all: function() { - return this._persisted; - }, - keys: function() { - return Object.keys(this._persisted); - }, - /** - * sets a key to a given value - * @method setKey - * @param key {string} the key to set - * @param value {object} the value of the key. Could be any object that can be serialized with JSON.stringify - */ - setKey: function(key, value) { - this._visited[key] = true; - this._persisted[key] = value; - }, - /** - * remove a given key from the cache - * @method removeKey - * @param key {String} the key to remove from the object - */ - removeKey: function(key) { - delete this._visited[key]; - delete this._persisted[key]; - }, - /** - * Return the value of the provided key - * @method getKey - * @param key {String} the name of the key to retrieve - * @returns {*} the value from the key - */ - getKey: function(key) { - this._visited[key] = true; - return this._persisted[key]; - }, - /** - * Remove keys that were not accessed/set since the - * last time the `prune` method was called. - * @method _prune - * @private - */ - _prune: function() { - var me = this; - var obj = {}; - var keys = Object.keys(me._visited); - if (keys.length === 0) { - return; - } - keys.forEach(function(key) { - obj[key] = me._persisted[key]; - }); - me._visited = {}; - me._persisted = obj; - }, - /** - * Save the state of the cache identified by the docId to disk - * as a JSON structure - * @param [noPrune=false] {Boolean} whether to remove from cache the non visited files - * @method save - */ - save: function(noPrune) { - var me = this; - !noPrune && me._prune(); - writeJSON(me._pathToFile, me._persisted); - }, - /** - * remove the file where the cache is persisted - * @method removeCacheFile - * @return {Boolean} true or false if the file was successfully deleted - */ - removeCacheFile: function() { - return del(this._pathToFile); - }, - /** - * Destroy the file cache and cache content. - * @method destroy - */ - destroy: function() { - var me = this; - me._visited = {}; - me._persisted = {}; - me.removeCacheFile(); +// node_modules/configstore/index.js +var import_path2 = __toESM(require("path"), 1); +var import_os2 = __toESM(require("os"), 1); +var import_graceful_fs = __toESM(require_graceful_fs(), 1); + +// node_modules/xdg-basedir/index.js +var import_os = __toESM(require("os"), 1); +var import_path = __toESM(require("path"), 1); +var homeDirectory = import_os.default.homedir(); +var { env } = process; +var xdgData = env.XDG_DATA_HOME || (homeDirectory ? import_path.default.join(homeDirectory, ".local", "share") : void 0); +var xdgConfig = env.XDG_CONFIG_HOME || (homeDirectory ? import_path.default.join(homeDirectory, ".config") : void 0); +var xdgState = env.XDG_STATE_HOME || (homeDirectory ? import_path.default.join(homeDirectory, ".local", "state") : void 0); +var xdgCache = env.XDG_CACHE_HOME || (homeDirectory ? import_path.default.join(homeDirectory, ".cache") : void 0); +var xdgRuntime = env.XDG_RUNTIME_DIR || void 0; +var xdgDataDirectories = (env.XDG_DATA_DIRS || "/usr/local/share/:/usr/share/").split(":"); +if (xdgData) { + xdgDataDirectories.unshift(xdgData); +} +var xdgConfigDirectories = (env.XDG_CONFIG_DIRS || "/etc/xdg").split(":"); +if (xdgConfig) { + xdgConfigDirectories.unshift(xdgConfig); +} + +// node_modules/configstore/index.js +var import_write_file_atomic = __toESM(require_write_file_atomic(), 1); +var import_dot_prop = __toESM(require_dot_prop(), 1); + +// node_modules/crypto-random-string/index.js +var import_util35 = require("util"); +var import_crypto4 = __toESM(require("crypto"), 1); +var randomBytesAsync = (0, import_util35.promisify)(import_crypto4.default.randomBytes); +var urlSafeCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~".split(""); +var numericCharacters = "0123456789".split(""); +var distinguishableCharacters = "CDEHKMPRTUWXY012458".split(""); +var asciiPrintableCharacters = "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~".split(""); +var alphanumericCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""); +var generateForCustomCharacters = (length, characters) => { + const characterCount = characters.length; + const maxValidSelector = Math.floor(65536 / characterCount) * characterCount - 1; + const entropyLength = 2 * Math.ceil(1.1 * length); + let string = ""; + let stringLength = 0; + while (stringLength < length) { + const entropy = import_crypto4.default.randomBytes(entropyLength); + let entropyPosition = 0; + while (entropyPosition < entropyLength && stringLength < length) { + const entropyValue = entropy.readUInt16LE(entropyPosition); + entropyPosition += 2; + if (entropyValue > maxValidSelector) { + continue; } - }; - module2.exports = { - /** - * Alias for create. Should be considered depreacted. Will be removed in next releases - * - * @method load - * @param docId {String} the id of the cache, would also be used as the name of the file cache - * @param [cacheDir] {String} directory for the cache entry - * @returns {cache} cache instance - */ - load: function(docId, cacheDir) { - return this.create(docId, cacheDir); - }, - /** - * Load a cache identified by the given Id. If the element does not exists, then initialize an empty - * cache storage. - * - * @method create - * @param docId {String} the id of the cache, would also be used as the name of the file cache - * @param [cacheDir] {String} directory for the cache entry - * @returns {cache} cache instance - */ - create: function(docId, cacheDir) { - var obj = Object.create(cache); - obj.load(docId, cacheDir); - return obj; - }, - createFromFile: function(filePath) { - var obj = Object.create(cache); - obj.loadFile(filePath); - return obj; - }, - /** - * Clear the cache identified by the given id. Caches stored in a different cache directory can be deleted directly - * - * @method clearCache - * @param docId {String} the id of the cache, would also be used as the name of the file cache - * @param cacheDir {String} the directory where the cache file was written - * @returns {Boolean} true if the cache folder was deleted. False otherwise - */ - clearCacheById: function(docId, cacheDir) { - var filePath = cacheDir ? path16.resolve(cacheDir, docId) : path16.resolve(__dirname, "../.cache/", docId); - return del(filePath); - }, - /** - * Remove all cache stored in the cache directory - * @method clearAll - * @returns {Boolean} true if the cache folder was deleted. False otherwise - */ - clearAll: function(cacheDir) { - var filePath = cacheDir ? path16.resolve(cacheDir) : path16.resolve(__dirname, "../.cache/"); - return del(filePath); + string += characters[entropyValue % characterCount]; + stringLength++; + } + } + return string; +}; +var generateForCustomCharactersAsync = async (length, characters) => { + const characterCount = characters.length; + const maxValidSelector = Math.floor(65536 / characterCount) * characterCount - 1; + const entropyLength = 2 * Math.ceil(1.1 * length); + let string = ""; + let stringLength = 0; + while (stringLength < length) { + const entropy = await randomBytesAsync(entropyLength); + let entropyPosition = 0; + while (entropyPosition < entropyLength && stringLength < length) { + const entropyValue = entropy.readUInt16LE(entropyPosition); + entropyPosition += 2; + if (entropyValue > maxValidSelector) { + continue; } - }; + string += characters[entropyValue % characterCount]; + stringLength++; + } } -}); + return string; +}; +var generateRandomBytes = (byteLength, type, length) => import_crypto4.default.randomBytes(byteLength).toString(type).slice(0, length); +var generateRandomBytesAsync = async (byteLength, type, length) => { + const buffer = await randomBytesAsync(byteLength); + return buffer.toString(type).slice(0, length); +}; +var allowedTypes = /* @__PURE__ */ new Set([ + void 0, + "hex", + "base64", + "url-safe", + "numeric", + "distinguishable", + "ascii-printable", + "alphanumeric" +]); +var createGenerator = (generateForCustomCharacters2, generateRandomBytes2) => ({ length, type, characters }) => { + if (!(length >= 0 && Number.isFinite(length))) { + throw new TypeError("Expected a `length` to be a non-negative finite number"); + } + if (type !== void 0 && characters !== void 0) { + throw new TypeError("Expected either `type` or `characters`"); + } + if (characters !== void 0 && typeof characters !== "string") { + throw new TypeError("Expected `characters` to be string"); + } + if (!allowedTypes.has(type)) { + throw new TypeError(`Unknown type: ${type}`); + } + if (type === void 0 && characters === void 0) { + type = "hex"; + } + if (type === "hex" || type === void 0 && characters === void 0) { + return generateRandomBytes2(Math.ceil(length * 0.5), "hex", length); + } + if (type === "base64") { + return generateRandomBytes2(Math.ceil(length * 0.75), "base64", length); + } + if (type === "url-safe") { + return generateForCustomCharacters2(length, urlSafeCharacters); + } + if (type === "numeric") { + return generateForCustomCharacters2(length, numericCharacters); + } + if (type === "distinguishable") { + return generateForCustomCharacters2(length, distinguishableCharacters); + } + if (type === "ascii-printable") { + return generateForCustomCharacters2(length, asciiPrintableCharacters); + } + if (type === "alphanumeric") { + return generateForCustomCharacters2(length, alphanumericCharacters); + } + if (characters.length === 0) { + throw new TypeError("Expected `characters` string length to be greater than or equal to 1"); + } + if (characters.length > 65536) { + throw new TypeError("Expected `characters` string length to be less or equal to 65536"); + } + return generateForCustomCharacters2(length, characters.split("")); +}; +var cryptoRandomString = createGenerator(generateForCustomCharacters, generateRandomBytes); +cryptoRandomString.async = createGenerator(generateForCustomCharactersAsync, generateRandomBytesAsync); +var crypto_random_string_default = cryptoRandomString; -// node_modules/file-entry-cache/cache.js -var require_cache2 = __commonJS({ - "node_modules/file-entry-cache/cache.js"(exports, module2) { - var path16 = require("path"); - var crypto5 = require("crypto"); - module2.exports = { - createFromFile: function(filePath, useChecksum) { - var fname = path16.basename(filePath); - var dir = path16.dirname(filePath); - return this.create(fname, dir, useChecksum); - }, - create: function(cacheId, _path, useChecksum) { - var fs6 = require("fs"); - var flatCache = require_cache(); - var cache = flatCache.load(cacheId, _path); - var normalizedEntries = {}; - var removeNotFoundFiles = function removeNotFoundFiles2() { - const cachedEntries = cache.keys(); - cachedEntries.forEach(function remover(fPath) { - try { - fs6.statSync(fPath); - } catch (err) { - if (err.code === "ENOENT") { - cache.removeKey(fPath); - } - } - }); - }; - removeNotFoundFiles(); - return { - /** - * the flat cache storage used to persist the metadata of the `files - * @type {Object} - */ - cache, - /** - * Given a buffer, calculate md5 hash of its content. - * @method getHash - * @param {Buffer} buffer buffer to calculate hash on - * @return {String} content hash digest - */ - getHash: function(buffer) { - return crypto5.createHash("md5").update(buffer).digest("hex"); - }, - /** - * Return whether or not a file has changed since last time reconcile was called. - * @method hasFileChanged - * @param {String} file the filepath to check - * @return {Boolean} wheter or not the file has changed - */ - hasFileChanged: function(file) { - return this.getFileDescriptor(file).changed; - }, - /** - * given an array of file paths it return and object with three arrays: - * - changedFiles: Files that changed since previous run - * - notChangedFiles: Files that haven't change - * - notFoundFiles: Files that were not found, probably deleted - * - * @param {Array} files the files to analyze and compare to the previous seen files - * @return {[type]} [description] - */ - analyzeFiles: function(files) { - var me = this; - files = files || []; - var res = { - changedFiles: [], - notFoundFiles: [], - notChangedFiles: [] - }; - me.normalizeEntries(files).forEach(function(entry) { - if (entry.changed) { - res.changedFiles.push(entry.key); - return; - } - if (entry.notFound) { - res.notFoundFiles.push(entry.key); - return; - } - res.notChangedFiles.push(entry.key); - }); - return res; - }, - getFileDescriptor: function(file) { - var fstat; - try { - fstat = fs6.statSync(file); - } catch (ex) { - this.removeEntry(file); - return { key: file, notFound: true, err: ex }; - } - if (useChecksum) { - return this._getFileDescriptorUsingChecksum(file); - } - return this._getFileDescriptorUsingMtimeAndSize(file, fstat); - }, - _getFileDescriptorUsingMtimeAndSize: function(file, fstat) { - var meta = cache.getKey(file); - var cacheExists = !!meta; - var cSize = fstat.size; - var cTime = fstat.mtime.getTime(); - var isDifferentDate; - var isDifferentSize; - if (!meta) { - meta = { size: cSize, mtime: cTime }; - } else { - isDifferentDate = cTime !== meta.mtime; - isDifferentSize = cSize !== meta.size; - } - var nEntry = normalizedEntries[file] = { - key: file, - changed: !cacheExists || isDifferentDate || isDifferentSize, - meta - }; - return nEntry; - }, - _getFileDescriptorUsingChecksum: function(file) { - var meta = cache.getKey(file); - var cacheExists = !!meta; - var contentBuffer; - try { - contentBuffer = fs6.readFileSync(file); - } catch (ex) { - contentBuffer = ""; - } - var isDifferent = true; - var hash = this.getHash(contentBuffer); - if (!meta) { - meta = { hash }; - } else { - isDifferent = hash !== meta.hash; - } - var nEntry = normalizedEntries[file] = { - key: file, - changed: !cacheExists || isDifferent, - meta - }; - return nEntry; - }, - /** - * Return the list o the files that changed compared - * against the ones stored in the cache - * - * @method getUpdated - * @param files {Array} the array of files to compare against the ones in the cache - * @returns {Array} - */ - getUpdatedFiles: function(files) { - var me = this; - files = files || []; - return me.normalizeEntries(files).filter(function(entry) { - return entry.changed; - }).map(function(entry) { - return entry.key; - }); - }, - /** - * return the list of files - * @method normalizeEntries - * @param files - * @returns {*} - */ - normalizeEntries: function(files) { - files = files || []; - var me = this; - var nEntries = files.map(function(file) { - return me.getFileDescriptor(file); - }); - return nEntries; - }, - /** - * Remove an entry from the file-entry-cache. Useful to force the file to still be considered - * modified the next time the process is run - * - * @method removeEntry - * @param entryName - */ - removeEntry: function(entryName) { - delete normalizedEntries[entryName]; - cache.removeKey(entryName); - }, - /** - * Delete the cache file from the disk - * @method deleteCacheFile - */ - deleteCacheFile: function() { - cache.removeCacheFile(); - }, - /** - * remove the cache from the file and clear the memory cache - */ - destroy: function() { - normalizedEntries = {}; - cache.destroy(); - }, - _getMetaForFileUsingCheckSum: function(cacheEntry) { - var contentBuffer = fs6.readFileSync(cacheEntry.key); - var hash = this.getHash(contentBuffer); - var meta = Object.assign(cacheEntry.meta, { hash }); - delete meta.size; - delete meta.mtime; - return meta; - }, - _getMetaForFileUsingMtimeAndSize: function(cacheEntry) { - var stat2 = fs6.statSync(cacheEntry.key); - var meta = Object.assign(cacheEntry.meta, { - size: stat2.size, - mtime: stat2.mtime.getTime() - }); - delete meta.hash; - return meta; - }, - /** - * Sync the files and persist them to the cache - * @method reconcile - */ - reconcile: function(noPrune) { - removeNotFoundFiles(); - noPrune = typeof noPrune === "undefined" ? true : noPrune; - var entries = normalizedEntries; - var keys = Object.keys(entries); - if (keys.length === 0) { - return; - } - var me = this; - keys.forEach(function(entryName) { - var cacheEntry = entries[entryName]; - try { - var meta = useChecksum ? me._getMetaForFileUsingCheckSum(cacheEntry) : me._getMetaForFileUsingMtimeAndSize(cacheEntry); - cache.setKey(entryName, meta); - } catch (err) { - if (err.code !== "ENOENT") { - throw err; - } - } - }); - cache.save(noPrune); - } - }; +// node_modules/unique-string/index.js +function uniqueString() { + return crypto_random_string_default({ length: 32 }); +} + +// node_modules/configstore/index.js +var configDirectory = xdgConfig || import_path2.default.join(import_os2.default.tmpdir(), uniqueString()); +var permissionError = "You don't have access to this file."; +var mkdirOptions = { mode: 448, recursive: true }; +var writeFileOptions = { mode: 384 }; +var Configstore = class { + constructor(id, defaults, options = {}) { + const pathPrefix = options.globalConfigPath ? import_path2.default.join(id, "config.json") : import_path2.default.join("configstore", `${id}.json`); + this._path = options.configPath || import_path2.default.join(configDirectory, pathPrefix); + if (defaults) { + this.all = { + ...defaults, + ...this.all + }; + } + } + get all() { + try { + return JSON.parse(import_graceful_fs.default.readFileSync(this._path, "utf8")); + } catch (error2) { + if (error2.code === "ENOENT") { + return {}; + } + if (error2.code === "EACCES") { + error2.message = `${error2.message} +${permissionError} +`; + } + if (error2.name === "SyntaxError") { + import_write_file_atomic.default.sync(this._path, "", writeFileOptions); + return {}; } - }; + throw error2; + } } -}); + set all(value) { + try { + import_graceful_fs.default.mkdirSync(import_path2.default.dirname(this._path), mkdirOptions); + import_write_file_atomic.default.sync(this._path, JSON.stringify(value, void 0, " "), writeFileOptions); + } catch (error2) { + if (error2.code === "EACCES") { + error2.message = `${error2.message} +${permissionError} +`; + } + throw error2; + } + } + get size() { + return Object.keys(this.all || {}).length; + } + get(key) { + return import_dot_prop.default.get(this.all, key); + } + set(key, value) { + const config = this.all; + if (arguments.length === 1) { + for (const k of Object.keys(key)) { + import_dot_prop.default.set(config, k, key[k]); + } + } else { + import_dot_prop.default.set(config, key, value); + } + this.all = config; + } + has(key) { + return import_dot_prop.default.has(this.all, key); + } + delete(key) { + const config = this.all; + import_dot_prop.default.delete(config, key); + this.all = config; + } + clear() { + this.all = {}; + } + get path() { + return this._path; + } +}; -// node_modules/cspell/dist/lib/file-entry-cache.cjs -var require_file_entry_cache = __commonJS({ - "node_modules/cspell/dist/lib/file-entry-cache.cjs"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - 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]; - } }; +// node_modules/cspell-lib/dist/esm/Settings/cfgStore.mjs +var ConfigStore = Configstore; + +// node_modules/cspell-lib/dist/esm/Settings/GlobalSettings.mjs +var packageName = "cspell"; +function getRawGlobalSettings() { + const name = "CSpell Configstore"; + const globalConf = { + source: { + name, + filename: void 0 + } + }; + try { + const cfgStore = new ConfigStore(packageName); + const cfg = cfgStore.all; + if (cfg && Object.keys(cfg).length) { + Object.assign(globalConf, cfg); + globalConf.source = { + name, + filename: cfgStore.path + }; + } + } catch (error2) { + if (!isErrnoException(error2) || !error2.code || !["ENOENT", "EACCES", "ENOTDIR", "EISDIR"].includes(error2.code)) { + logError(error2); + } + } + return globalConf; +} + +// node_modules/cspell-lib/dist/esm/Settings/Controller/ImportError.mjs +var ImportError = class extends Error { + constructor(msg, cause) { + super(msg); + this.cause = isError2(cause) ? cause : void 0; + } +}; +var UnsupportedPnpFile = class extends Error { + constructor(msg) { + super(msg); + } +}; + +// node_modules/cspell-lib/dist/esm/Settings/Controller/pnpLoader.mjs +var import_clear_module = __toESM(require_clear_module(), 1); + +// node_modules/cspell-lib/node_modules/find-up/index.js +var import_node_path2 = __toESM(require("node:path"), 1); +var import_node_url2 = require("node:url"); + +// node_modules/cspell-lib/node_modules/locate-path/index.js +var import_node_process = __toESM(require("node:process"), 1); +var import_node_path = __toESM(require("node:path"), 1); +var import_node_fs = __toESM(require("node:fs"), 1); +var import_node_url = require("node:url"); + +// node_modules/cspell-lib/node_modules/yocto-queue/index.js +var Node = class { + value; + next; + constructor(value) { + this.value = value; + } +}; +var Queue = class { + #head; + #tail; + #size; + constructor() { + this.clear(); + } + enqueue(value) { + const node = new Node(value); + if (this.#head) { + this.#tail.next = node; + this.#tail = node; + } else { + this.#head = node; + this.#tail = node; + } + this.#size++; + } + dequeue() { + const current = this.#head; + if (!current) { + return; + } + this.#head = this.#head.next; + this.#size--; + return current.value; + } + clear() { + this.#head = void 0; + this.#tail = void 0; + this.#size = 0; + } + get size() { + return this.#size; + } + *[Symbol.iterator]() { + let current = this.#head; + while (current) { + yield current.value; + current = current.next; + } + } +}; + +// node_modules/cspell-lib/node_modules/p-limit/index.js +function pLimit(concurrency) { + if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) { + throw new TypeError("Expected `concurrency` to be a number from 1 and up"); + } + const queue = new Queue(); + let activeCount = 0; + const next = () => { + activeCount--; + if (queue.size > 0) { + queue.dequeue()(); + } + }; + const run2 = async (fn, resolve13, args) => { + activeCount++; + const result = (async () => fn(...args))(); + resolve13(result); + try { + await result; + } catch { + } + next(); + }; + const enqueue = (fn, resolve13, args) => { + queue.enqueue(run2.bind(void 0, fn, resolve13, args)); + (async () => { + await Promise.resolve(); + if (activeCount < concurrency && queue.size > 0) { + queue.dequeue()(); } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__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); + })(); + }; + const generator = (fn, ...args) => new Promise((resolve13) => { + enqueue(fn, resolve13, args); + }); + Object.defineProperties(generator, { + activeCount: { + get: () => activeCount + }, + pendingCount: { + get: () => queue.size + }, + clearQueue: { + value: () => { + queue.clear(); } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createFromFile = void 0; - var file_entry_cache = __importStar(require_cache2()); - function createFromFile3(pathToCache, useChecksum) { - return file_entry_cache.createFromFile(pathToCache, useChecksum); } - exports.createFromFile = createFromFile3; + }); + return generator; +} + +// node_modules/cspell-lib/node_modules/p-locate/index.js +var EndError = class extends Error { + constructor(value) { + super(); + this.value = value; + } +}; +var testElement = async (element, tester) => tester(await element); +var finder = async (element) => { + const values = await Promise.all(element); + if (values[1] === true) { + throw new EndError(values[0]); + } + return false; +}; +async function pLocate(iterable, tester, { + concurrency = Number.POSITIVE_INFINITY, + preserveOrder = true +} = {}) { + const limit = pLimit(concurrency); + const items = [...iterable].map((element) => [element, limit(testElement, element, tester)]); + const checkLimit = pLimit(preserveOrder ? 1 : Number.POSITIVE_INFINITY); + try { + await Promise.all(items.map((element) => checkLimit(finder, element))); + } catch (error2) { + if (error2 instanceof EndError) { + return error2.value; + } + throw error2; + } +} + +// node_modules/cspell-lib/node_modules/locate-path/index.js +var typeMappings = { + directory: "isDirectory", + file: "isFile" +}; +function checkType(type) { + if (Object.hasOwnProperty.call(typeMappings, type)) { + return; + } + throw new Error(`Invalid type specified: ${type}`); +} +var matchType = (type, stat2) => stat2[typeMappings[type]](); +var toPath = (urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath; +async function locatePath(paths, { + cwd = import_node_process.default.cwd(), + type = "file", + allowSymlinks = true, + concurrency, + preserveOrder +} = {}) { + checkType(type); + cwd = toPath(cwd); + const statFunction = allowSymlinks ? import_node_fs.promises.stat : import_node_fs.promises.lstat; + return pLocate(paths, async (path_) => { + try { + const stat2 = await statFunction(import_node_path.default.resolve(cwd, path_)); + return matchType(type, stat2); + } catch { + return false; + } + }, { concurrency, preserveOrder }); +} +function locatePathSync(paths, { + cwd = import_node_process.default.cwd(), + type = "file", + allowSymlinks = true +} = {}) { + checkType(type); + cwd = toPath(cwd); + const statFunction = allowSymlinks ? import_node_fs.default.statSync : import_node_fs.default.lstatSync; + for (const path_ of paths) { + try { + const stat2 = statFunction(import_node_path.default.resolve(cwd, path_), { + throwIfNoEntry: false + }); + if (!stat2) { + continue; + } + if (matchType(type, stat2)) { + return path_; + } + } catch { + } + } +} + +// node_modules/cspell-lib/node_modules/find-up/index.js +var toPath2 = (urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url2.fileURLToPath)(urlOrPath) : urlOrPath; +var findUpStop = Symbol("findUpStop"); +async function findUpMultiple(name, options = {}) { + let directory = import_node_path2.default.resolve(toPath2(options.cwd) || ""); + const { root } = import_node_path2.default.parse(directory); + const stopAt = import_node_path2.default.resolve(directory, options.stopAt || root); + const limit = options.limit || Number.POSITIVE_INFINITY; + const paths = [name].flat(); + const runMatcher = async (locateOptions) => { + if (typeof name !== "function") { + return locatePath(paths, locateOptions); + } + const foundPath = await name(locateOptions.cwd); + if (typeof foundPath === "string") { + return locatePath([foundPath], locateOptions); + } + return foundPath; + }; + const matches = []; + while (true) { + const foundPath = await runMatcher({ ...options, cwd: directory }); + if (foundPath === findUpStop) { + break; + } + if (foundPath) { + matches.push(import_node_path2.default.resolve(directory, foundPath)); + } + if (directory === stopAt || matches.length >= limit) { + break; + } + directory = import_node_path2.default.dirname(directory); + } + return matches; +} +function findUpMultipleSync(name, options = {}) { + let directory = import_node_path2.default.resolve(toPath2(options.cwd) || ""); + const { root } = import_node_path2.default.parse(directory); + const stopAt = options.stopAt || root; + const limit = options.limit || Number.POSITIVE_INFINITY; + const paths = [name].flat(); + const runMatcher = (locateOptions) => { + if (typeof name !== "function") { + return locatePathSync(paths, locateOptions); + } + const foundPath = name(locateOptions.cwd); + if (typeof foundPath === "string") { + return locatePathSync([foundPath], locateOptions); + } + return foundPath; + }; + const matches = []; + while (true) { + const foundPath = runMatcher({ ...options, cwd: directory }); + if (foundPath === findUpStop) { + break; + } + if (foundPath) { + matches.push(import_node_path2.default.resolve(directory, foundPath)); + } + if (directory === stopAt || matches.length >= limit) { + break; + } + directory = import_node_path2.default.dirname(directory); + } + return matches; +} +async function findUp(name, options = {}) { + const matches = await findUpMultiple(name, { ...options, limit: 1 }); + return matches[0]; +} +function findUpSync(name, options = {}) { + const matches = findUpMultipleSync(name, { ...options, limit: 1 }); + return matches[0]; +} + +// node_modules/cspell-lib/dist/esm/Settings/Controller/pnpLoader.mjs +var import_import_fresh = __toESM(require_import_fresh(), 1); +var defaultPnpFiles = [".pnp.cjs", ".pnp.js"]; +var supportedSchemas = /* @__PURE__ */ new Set(["file"]); +var cachedRequests = /* @__PURE__ */ new Map(); +var lock = void 0; +var cachedPnpImportsSync = /* @__PURE__ */ new Map(); +var cachedRequestsSync = /* @__PURE__ */ new Map(); +var PnpLoader = class { + constructor(pnpFiles = defaultPnpFiles) { + this.pnpFiles = pnpFiles; + this.cacheKeySuffix = ":" + pnpFiles.join(); + } + /** + * Request that the nearest .pnp file gets loaded + * @param uriDirectory starting directory + * @returns promise - rejects on error - success if loaded or not found. + */ + async load(uriDirectory) { + if (!supportedSchemas.has(uriDirectory.scheme)) + return void 0; + await lock; + const cacheKey = this.calcKey(uriDirectory); + const cached = cachedRequests.get(cacheKey); + if (cached) + return cached; + const r = findPnpAndLoad(uriDirectory, this.pnpFiles); + cachedRequests.set(cacheKey, r); + const result = await r; + cachedRequestsSync.set(cacheKey, result); + return result; + } + async peek(uriDirectory) { + if (!supportedSchemas.has(uriDirectory.scheme)) + return void 0; + await lock; + const cacheKey = this.calcKey(uriDirectory); + return cachedRequests.get(cacheKey) ?? Promise.resolve(void 0); + } + /** + * Request that the nearest .pnp file gets loaded + * @param uriDirectory starting directory + * @returns promise - rejects on error - success if loaded or not found. + */ + loadSync(uriDirectory) { + if (!supportedSchemas.has(uriDirectory.scheme)) + return void 0; + const cacheKey = this.calcKey(uriDirectory); + const cached = cachedRequestsSync.get(cacheKey); + if (cached) + return cached; + const r = findPnpAndLoadSync(uriDirectory, this.pnpFiles); + cachedRequestsSync.set(cacheKey, r); + cachedRequests.set(cacheKey, Promise.resolve(r)); + return r; + } + peekSync(uriDirectory) { + if (!supportedSchemas.has(uriDirectory.scheme)) + return void 0; + const cacheKey = this.calcKey(uriDirectory); + return cachedRequestsSync.get(cacheKey); + } + /** + * Clears the cached so .pnp files will get reloaded on request. + */ + clearCache() { + return clearPnPGlobalCache(); + } + calcKey(uriDirectory) { + return uriDirectory.toString() + this.cacheKeySuffix; + } +}; +function pnpLoader(pnpFiles) { + return new PnpLoader(pnpFiles); +} +async function findPnpAndLoad(uriDirectory, pnpFiles) { + const found = await findUp(pnpFiles, { cwd: uriToFilePath(uriDirectory) }); + return loadPnpIfNeeded(found); +} +function findPnpAndLoadSync(uriDirectory, pnpFiles) { + const found = findUpSync(pnpFiles, { cwd: uriToFilePath(uriDirectory) }); + return loadPnpIfNeeded(found); +} +function loadPnpIfNeeded(found) { + if (!found) + return void 0; + const c = cachedPnpImportsSync.get(found); + if (c || cachedPnpImportsSync.has(found)) + return c; + const r = loadPnp(found); + cachedPnpImportsSync.set(found, r); + return r; +} +function loadPnp(pnpFile) { + const pnp = (0, import_import_fresh.default)(pnpFile); + if (pnp.setup) { + pnp.setup(); + return toUri(pnpFile); } + throw new UnsupportedPnpFile(`Unsupported pnp file: "${pnpFile}"`); +} +function clearPnPGlobalCache() { + if (lock) + return lock; + lock = _cleanCache().finally(() => { + lock = void 0; + }); + return lock; +} +async function _cleanCache() { + await Promise.all([...cachedRequests.values()].map(rejectToUndefined)); + const modules = [...cachedPnpImportsSync.values()]; + modules.forEach((r) => r && import_clear_module.default.single(uriToFilePath(r))); + cachedRequests.clear(); + cachedRequestsSync.clear(); + cachedPnpImportsSync.clear(); + return void 0; +} +function rejectToUndefined(p) { + return p.catch(() => void 0); +} + +// node_modules/cspell-lib/dist/esm/Settings/Controller/configLoader/defaultSettings.mjs +var defaultSettings = createCSpellSettingsInternal({ + id: "default", + name: "default", + version: currentSettingsFileVersion }); -// node_modules/import-meta-resolve/lib/errors.js -function formatList(array, type = "and") { - return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array[array.length - 1]}`; +// node_modules/cspell-lib/dist/esm/Settings/Controller/configLoader/normalizeRawSettings.mjs +var path9 = __toESM(require("path"), 1); + +// node_modules/cspell-lib/dist/esm/Settings/Controller/configLoader/toGlobDef.mjs +function toGlobDef(g, root, source) { + if (g === void 0) + return void 0; + if (Array.isArray(g)) { + return g.map((g2) => toGlobDef(g2, root, source)); + } + if (typeof g === "string") { + const glob2 = { glob: g }; + if (root !== void 0) { + glob2.root = root; + } + return toGlobDef(glob2, root, source); + } + if (source) { + return { ...g, source }; + } + return g; } -function createError(sym, value, def) { - messages.set(sym, value); - return makeNodeErrorWithCode(def, sym); + +// node_modules/cspell-lib/dist/esm/Settings/Controller/configLoader/normalizeRawSettings.mjs +function normalizeRawConfig(config) { + if (typeof config.version === "number") { + config.version = config.version.toString(); + } } -function makeNodeErrorWithCode(Base, key) { - return NodeError; - function NodeError(...args) { - const limit = Error.stackTraceLimit; - if (isErrorStackTraceLimitWritable()) - Error.stackTraceLimit = 0; - const error2 = new Base(); - if (isErrorStackTraceLimitWritable()) - Error.stackTraceLimit = limit; - const message = getMessage(key, args, error2); - Object.defineProperties(error2, { - // Note: no need to implement `kIsNodeError` symbol, would be hard, - // probably. - message: { - value: message, - enumerable: false, - writable: true, - configurable: true - }, - toString: { - /** @this {Error} */ - value() { - return `${this.name} [${key}]: ${this.message}`; - }, - enumerable: false, - writable: true, - configurable: true - } +function normalizeDictionaryDefs(settings, pathToSettingsFile) { + const dictionaryDefinitions = mapDictDefsToInternal(settings.dictionaryDefinitions, pathToSettingsFile); + const languageSettings = settings.languageSettings?.map((langSetting) => clean({ + ...langSetting, + dictionaryDefinitions: mapDictDefsToInternal(langSetting.dictionaryDefinitions, pathToSettingsFile) + })); + return clean({ + dictionaryDefinitions, + languageSettings + }); +} +function normalizeOverrides(settings, pathToSettingsFile) { + const { globRoot = path9.dirname(pathToSettingsFile) } = settings; + const overrides = settings.overrides?.map((override) => { + const filename = toGlobDef(override.filename, globRoot, pathToSettingsFile); + const { dictionaryDefinitions, languageSettings } = normalizeDictionaryDefs(override, pathToSettingsFile); + return clean({ + ...override, + filename, + dictionaryDefinitions, + languageSettings: normalizeLanguageSettings(languageSettings) }); - captureLargerStackTrace(error2); - error2.code = key; - return error2; + }); + return overrides ? { overrides } : {}; +} +function normalizeReporters(settings, pathToSettingsFile) { + if (settings.reporters === void 0) + return {}; + const folder = path9.dirname(pathToSettingsFile); + function resolve13(s) { + if (s === "default") + return s; + const r = resolveFile(s, folder); + if (!r.found) { + throw new Error(`Not found: "${s}"`); + } + return r.filename; + } + function resolveReporter(s) { + if (typeof s === "string") { + return resolve13(s); + } + if (!Array.isArray(s) || typeof s[0] !== "string") + throw new Error("Invalid Reporter"); + const [r, ...rest] = s; + return [resolve13(r), ...rest]; } + return { + reporters: settings.reporters.map(resolveReporter) + }; } -function isErrorStackTraceLimitWritable() { - try { - if (import_node_v8.default.startupSnapshot.isBuildingSnapshot()) { - return false; +function normalizeLanguageSettings(languageSettings) { + if (!languageSettings) + return void 0; + function fixLocale(s) { + const { local: locale, ...rest } = s; + return clean({ locale, ...rest }); + } + return languageSettings.map(fixLocale); +} +function normalizeGitignoreRoot(settings, pathToSettingsFile) { + const { gitignoreRoot } = settings; + if (!gitignoreRoot) + return {}; + const dir = path9.dirname(pathToSettingsFile); + const roots = Array.isArray(gitignoreRoot) ? gitignoreRoot : [gitignoreRoot]; + return { + gitignoreRoot: roots.map((p) => path9.resolve(dir, p)) + }; +} +function normalizeSettingsGlobs(settings, pathToSettingsFile) { + const { globRoot } = settings; + if (settings.ignorePaths === void 0) + return {}; + const ignorePaths = toGlobDef(settings.ignorePaths, globRoot, pathToSettingsFile); + return { + ignorePaths + }; +} +function normalizeCacheSettings(settings, pathToSettingsDir) { + const { cache: cache2 } = settings; + if (cache2 === void 0) + return {}; + const { cacheLocation } = cache2; + if (cacheLocation === void 0) + return { cache: cache2 }; + return { cache: { ...cache2, cacheLocation: resolveFilePath(cacheLocation, pathToSettingsDir) } }; +} +function resolveFilePath(filename, pathToSettingsFile) { + const cwd = process.cwd(); + return path9.resolve(pathToSettingsFile, filename.replace("${cwd}", cwd)); +} + +// node_modules/cspell-lib/dist/esm/Settings/Controller/configLoader/PnPSettings.mjs +var defaultPnPSettings = Object.freeze({}); +var lastPnP = defaultPnPSettings; +function normalizePnPSettings(settings) { + if (equal(lastPnP, settings)) + return lastPnP; + if (equal(defaultPnPSettings, settings)) + return defaultPnPSettings; + const { usePnP, pnpFiles } = settings; + return lastPnP = clean({ usePnP, pnpFiles }); +} +function equal(a, b) { + return a === b || a.usePnP === b.usePnP && (a.pnpFiles === b.pnpFiles || a.pnpFiles?.join("|") === b.pnpFiles?.join("|")); +} + +// node_modules/cspell-lib/dist/esm/Settings/Controller/configLoader/configLoader.mjs +var supportedCSpellConfigVersions = [configSettingsFileVersion0_2]; +var setOfSupportedConfigVersions = Object.freeze(new Set(supportedCSpellConfigVersions)); +var gcl = getDefaultConfigLoaderInternal; +var CACHE_SIZE_SEARCH_CONFIG = 32; +var searchPlaces = Object.freeze([ + "package.json", + // Original locations + ".cspell.json", + "cspell.json", + ".cSpell.json", + "cSpell.json", + // Original locations jsonc + ".cspell.jsonc", + "cspell.jsonc", + // Alternate locations + ".vscode/cspell.json", + ".vscode/cSpell.json", + ".vscode/.cspell.json", + // Standard Locations + "cspell.config.json", + "cspell.config.jsonc", + "cspell.config.yaml", + "cspell.config.yml", + "cspell.yaml", + "cspell.yml", + // Dynamic config is looked for last + "cspell.config.js", + "cspell.config.cjs", + // .config + ".config/.cspell.json", + ".config/cspell.json", + ".config/.cSpell.json", + ".config/cSpell.json", + ".config/.cspell.jsonc", + ".config/cspell.jsonc", + ".config/cspell.config.json", + ".config/cspell.config.jsonc", + ".config/cspell.config.yaml", + ".config/cspell.config.yml", + ".config/cspell.yaml", + ".config/cspell.yml", + ".config/cspell.config.js", + ".config/cspell.config.cjs" +]); +var cspellCosmiconfig = { + searchPlaces: searchPlaces.concat(), + loaders: { + ".json": parseJson, + ".jsonc": parseJson + } +}; +function parseJson(_filename, content) { + return json.parse(content); +} +var defaultConfigFilenames = Object.freeze(searchPlaces.concat()); +var defaultConfigLoader = void 0; +var ConfigLoader = class { + /** + * Use `createConfigLoader` + * @param cspellIO - CSpellIO interface for reading files. + */ + constructor(cspellIO2) { + this.cspellIO = cspellIO2; + this.cachedFiles = /* @__PURE__ */ new Map(); + this.cspellConfigExplorer = (0, import_cosmiconfig.cosmiconfig)("cspell", cspellCosmiconfig); + this.cspellConfigExplorerSync = (0, import_cosmiconfig.cosmiconfigSync)("cspell", cspellCosmiconfig); + this.searchConfigLRU = new AutoResolveLRUCache(CACHE_SIZE_SEARCH_CONFIG, (a, b) => a.searchFrom === b.searchFrom && a.pnpSettings === b.pnpSettings); + } + readSettings(filename, relativeToOrDefault, defaultValue) { + const relativeTo = (typeof relativeToOrDefault === "string" ? relativeToOrDefault : "") || process.cwd(); + defaultValue = defaultValue || (typeof relativeToOrDefault !== "string" ? relativeToOrDefault : void 0); + const ref = resolveFilename(filename, relativeTo); + return this.importSettings(ref, defaultValue, defaultValue || defaultPnPSettings); + } + async readSettingsAsync(filename, relativeTo, pnpSettings) { + const ref = resolveFilename(filename, relativeTo || process.cwd()); + return this.importSettings(ref, void 0, pnpSettings || defaultPnPSettings); + } + /** + * + * @param searchFrom the directory / file to start searching from. + * @param pnpSettings - related to Using Yarn PNP. + * @returns the resulting settings + */ + searchForConfig(searchFrom, pnpSettings = defaultPnPSettings) { + pnpSettings = normalizePnPSettings(pnpSettings); + return this.searchConfigLRU.get({ searchFrom, pnpSettings }, (p) => this._searchForConfig(p)); + } + _searchForConfig(params) { + return gcl().normalizeSearchForConfigResultAsync(params.searchFrom || process.cwd(), this.cspellConfigExplorer.search(params.searchFrom), params.pnpSettings).then((r) => r.filepath ? r.config : void 0); + } + getGlobalSettings() { + if (!this.globalSettings) { + const globalConf = getRawGlobalSettings(); + this.globalSettings = { + id: "global_config", + ...this.normalizeSettings(globalConf || {}, "./global_config", {}) + }; } - } catch { + return this.globalSettings; } - const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit"); - if (desc === void 0) { - return Object.isExtensible(Error); + clearCachedSettingsFiles() { + this.searchConfigLRU.clear(); + this.globalSettings = void 0; + this.cachedFiles.clear(); + this.cspellConfigExplorer.clearCaches(); + this.cspellConfigExplorerSync.clearCaches(); } - return own.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0; + /** + * Read a config file and inject the fileRef. + * @param fileRef - filename plus context, injected into the resulting config. + */ + readConfig(fileRef) { + const { filename, error: error2 } = fileRef; + if (error2) { + fileRef.error = error2 instanceof ImportError ? error2 : new ImportError(`Failed to read config file: "${filename}"`, error2); + return { __importRef: fileRef }; + } + const s = {}; + try { + const r = this.cspellConfigExplorerSync.load(filename); + if (!r?.config) + throw new Error(`not found: "${filename}"`); + Object.assign(s, r.config); + normalizeRawConfig(s); + validateRawConfig(s, fileRef); + } catch (err) { + fileRef.error = err instanceof ImportError ? err : new ImportError(`Failed to read config file: "${filename}"`, err); + } + s.__importRef = fileRef; + return s; + } + importSettings(fileRef, defaultValues, pnpSettings) { + defaultValues = defaultValues ?? defaultSettings; + const { filename } = fileRef; + const importRef = { ...fileRef }; + const cached = this.cachedFiles.get(filename); + if (cached) { + const cachedImportRef = cached.__importRef || importRef; + cachedImportRef.referencedBy = mergeSourceList(cachedImportRef.referencedBy || [], importRef.referencedBy); + cached.__importRef = cachedImportRef; + return cached; + } + const id = [path10.basename(path10.dirname(filename)), path10.basename(filename)].join("/"); + const name = ""; + const finalizeSettings2 = createCSpellSettingsInternal({ id, name, __importRef: importRef }); + this.cachedFiles.set(filename, finalizeSettings2); + const settings = { ...defaultValues, id, name, ...this.readConfig(importRef) }; + Object.assign(finalizeSettings2, this.normalizeSettings(settings, filename, pnpSettings)); + const finalizeSrc = { name: path10.basename(filename), ...finalizeSettings2.source }; + finalizeSettings2.source = { ...finalizeSrc, filename }; + this.cachedFiles.set(filename, finalizeSettings2); + return finalizeSettings2; + } + /** + * normalizeSettings handles correcting all relative paths, anchoring globs, and importing other config files. + * @param rawSettings - raw configuration settings + * @param pathToSettingsFile - path to the source file of the configuration settings. + */ + normalizeSettings(rawSettings, pathToSettingsFile, pnpSettings) { + const id = rawSettings.id || [path10.basename(path10.dirname(pathToSettingsFile)), path10.basename(pathToSettingsFile)].join("/"); + const name = rawSettings.name || id; + const { usePnP = pnpSettings.usePnP, pnpFiles = pnpSettings.pnpFiles } = rawSettings; + const pnpSettingsToUse = normalizePnPSettings({ usePnP, pnpFiles }); + const pathToSettingsDir = path10.dirname(pathToSettingsFile); + loadPnPSync(pnpSettingsToUse, toUri(pathToSettingsDir)); + const settings = { + version: defaultSettings.version, + ...rawSettings, + id, + name, + globRoot: resolveGlobRoot(rawSettings, pathToSettingsFile), + languageSettings: normalizeLanguageSettings(rawSettings.languageSettings) + }; + const pathToSettings = path10.dirname(pathToSettingsFile); + const normalizedDictionaryDefs = normalizeDictionaryDefs(settings, pathToSettingsFile); + const normalizedSettingsGlobs = normalizeSettingsGlobs(settings, pathToSettingsFile); + const normalizedOverrides = normalizeOverrides(settings, pathToSettingsFile); + const normalizedReporters = normalizeReporters(settings, pathToSettingsFile); + const normalizedGitignoreRoot = normalizeGitignoreRoot(settings, pathToSettingsFile); + const normalizedCacheSettings = normalizeCacheSettings(settings, pathToSettingsDir); + const imports = typeof settings.import === "string" ? [settings.import] : settings.import || []; + const source = settings.source || { + name: settings.name, + filename: pathToSettingsFile + }; + const fileSettings = createCSpellSettingsInternal({ + ...settings, + source, + ...normalizedDictionaryDefs, + ...normalizedSettingsGlobs, + ...normalizedOverrides, + ...normalizedReporters, + ...normalizedGitignoreRoot, + ...normalizedCacheSettings + }); + if (!imports.length) { + return fileSettings; + } + const importedSettings = imports.map((name2) => resolveFilename(name2, pathToSettings)).map((ref) => (ref.referencedBy = [source], ref)).map((ref) => this.importSettings(ref, void 0, pnpSettingsToUse)).reduce((a, b) => mergeSettings(a, b)); + const finalizeSettings2 = mergeSettings(importedSettings, fileSettings); + finalizeSettings2.name = settings.name || finalizeSettings2.name || ""; + finalizeSettings2.id = settings.id || finalizeSettings2.id || ""; + return finalizeSettings2; + } +}; +var ConfigLoaderInternal = class extends ConfigLoader { + constructor(cspellIO2) { + super(cspellIO2); + this._readConfig = this.readConfig.bind(this); + this._normalizeSettings = this.normalizeSettings.bind(this); + } + get _cachedFiles() { + return this.cachedFiles; + } + get _cspellConfigExplorer() { + return this.cspellConfigExplorer; + } + get _cspellConfigExplorerSync() { + return this.cspellConfigExplorerSync; + } + async normalizeSearchForConfigResultAsync(searchPath, searchResult, pnpSettings) { + let result; + try { + result = await searchResult || void 0; + } catch (cause) { + result = new ImportError(`Failed to find config file at: "${searchPath}"`, cause); + } + return this.normalizeSearchForConfigResult(searchPath, result, pnpSettings); + } + normalizeSearchForConfigResult(searchPath, searchResult, pnpSettings) { + const error2 = searchResult instanceof ImportError ? searchResult : void 0; + const result = searchResult instanceof ImportError ? void 0 : searchResult; + const filepath = result?.filepath; + if (filepath) { + const cached = cachedFiles().get(filepath); + if (cached) { + return { + config: cached, + filepath, + error: error2 + }; + } + } + const { config = createCSpellSettingsInternal({}) } = result || {}; + const filename = result?.filepath ?? searchPath; + const importRef = { filename, error: error2 }; + const id = [path10.basename(path10.dirname(filename)), path10.basename(filename)].join("/"); + const name = result?.filepath ? id : `Config not found: ${id}`; + const finalizeSettings2 = createCSpellSettingsInternal({ id, name, __importRef: importRef }); + const settings = { id, ...config }; + cachedFiles().set(filename, finalizeSettings2); + Object.assign(finalizeSettings2, this.normalizeSettings(settings, filename, pnpSettings)); + return { + config: finalizeSettings2, + filepath, + error: error2 + }; + } +}; +function mergeSourceList(orig, append) { + const collection = new Map(orig.map((s) => [s.name + (s.filename || ""), s])); + for (const s of append || []) { + const key = s.name + (s.filename || ""); + if (!collection.has(key)) { + collection.set(key, s); + } + } + return [...collection.values()]; } -function hideStackFrames(fn) { - const hidden = nodeInternalPrefix + fn.name; - Object.defineProperty(fn, "name", { value: hidden }); - return fn; +function searchForConfig(searchFrom, pnpSettings = defaultPnPSettings) { + return gcl().searchForConfig(searchFrom, pnpSettings); } -function getMessage(key, args, self) { - const message = messages.get(key); - (0, import_node_assert.default)(typeof message !== "undefined", "expected `message` to be found"); - if (typeof message === "function") { - (0, import_node_assert.default)( - message.length <= args.length, - // Default options do not count. - `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${message.length}).` - ); - return Reflect.apply(message, self, args); +function searchForConfigSync(searchFrom, pnpSettings = defaultPnPSettings) { + pnpSettings = normalizePnPSettings(pnpSettings); + let searchResult; + try { + searchResult = cspellConfigExplorerSync().search(searchFrom) || void 0; + } catch (err) { + searchResult = new ImportError(`Failed to find config file from: "${searchFrom}"`, err); } - const regex = /%[dfijoOs]/g; - let expectedLength = 0; - while (regex.exec(message) !== null) - expectedLength++; - (0, import_node_assert.default)( - expectedLength === args.length, - `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).` - ); - if (args.length === 0) - return message; - args.unshift(message); - return Reflect.apply(import_node_util.format, null, args); + return gcl().normalizeSearchForConfigResult(searchFrom || process.cwd(), searchResult, pnpSettings).config; } -var import_node_v8, import_node_process, import_node_assert, import_node_util, isWindows, own, codes, messages, nodeInternalPrefix, userStackTraceLimit, captureLargerStackTrace; -var init_errors = __esm({ - "node_modules/import-meta-resolve/lib/errors.js"() { - import_node_v8 = __toESM(require("node:v8"), 1); - import_node_process = __toESM(require("node:process"), 1); - import_node_assert = __toESM(require("node:assert"), 1); - import_node_util = require("node:util"); - isWindows = import_node_process.default.platform === "win32"; - own = {}.hasOwnProperty; - codes = {}; - messages = /* @__PURE__ */ new Map(); - nodeInternalPrefix = "__node_internal_"; - codes.ERR_INVALID_MODULE_SPECIFIER = createError( - "ERR_INVALID_MODULE_SPECIFIER", - /** - * @param {string} request - * @param {string} reason - * @param {string} [base] - */ - (request, reason, base = void 0) => { - return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`; - }, - TypeError - ); - codes.ERR_INVALID_PACKAGE_CONFIG = createError( - "ERR_INVALID_PACKAGE_CONFIG", - /** - * @param {string} path - * @param {string} [base] - * @param {string} [message] - */ - (path16, base, message) => { - return `Invalid package config ${path16}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`; - }, - Error - ); - codes.ERR_INVALID_PACKAGE_TARGET = createError( - "ERR_INVALID_PACKAGE_TARGET", - /** - * @param {string} pkgPath - * @param {string} key - * @param {unknown} target - * @param {boolean} [isImport=false] - * @param {string} [base] - */ - (pkgPath, key, target, isImport = false, base = void 0) => { - const relError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./"); - if (key === ".") { - (0, import_node_assert.default)(isImport === false); - return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ""}${relError ? '; targets must start with "./"' : ""}`; - } - return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify( - target - )} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ""}${relError ? '; targets must start with "./"' : ""}`; - }, - Error - ); - codes.ERR_MODULE_NOT_FOUND = createError( - "ERR_MODULE_NOT_FOUND", - /** - * @param {string} path - * @param {string} base - * @param {string} [type] - */ - (path16, base, type = "package") => { - return `Cannot find ${type} '${path16}' imported from ${base}`; - }, - Error - ); - codes.ERR_NETWORK_IMPORT_DISALLOWED = createError( - "ERR_NETWORK_IMPORT_DISALLOWED", - "import of '%s' by %s is not supported: %s", - Error - ); - codes.ERR_PACKAGE_IMPORT_NOT_DEFINED = createError( - "ERR_PACKAGE_IMPORT_NOT_DEFINED", - /** - * @param {string} specifier - * @param {string} packagePath - * @param {string} base - */ - (specifier, packagePath, base) => { - return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ""} imported from ${base}`; - }, - TypeError - ); - codes.ERR_PACKAGE_PATH_NOT_EXPORTED = createError( - "ERR_PACKAGE_PATH_NOT_EXPORTED", - /** - * @param {string} pkgPath - * @param {string} subpath - * @param {string} [base] - */ - (pkgPath, subpath, base = void 0) => { - if (subpath === ".") - return `No "exports" main defined in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - }, - Error - ); - codes.ERR_UNSUPPORTED_DIR_IMPORT = createError( - "ERR_UNSUPPORTED_DIR_IMPORT", - "Directory import '%s' is not supported resolving ES modules imported from %s", - Error - ); - codes.ERR_UNKNOWN_FILE_EXTENSION = createError( - "ERR_UNKNOWN_FILE_EXTENSION", - /** - * @param {string} ext - * @param {string} path - */ - (ext, path16) => { - return `Unknown file extension "${ext}" for ${path16}`; - }, - TypeError - ); - codes.ERR_INVALID_ARG_VALUE = createError( - "ERR_INVALID_ARG_VALUE", - /** - * @param {string} name - * @param {unknown} value - * @param {string} [reason='is invalid'] - */ - (name, value, reason = "is invalid") => { - let inspected = (0, import_node_util.inspect)(value); - if (inspected.length > 128) { - inspected = `${inspected.slice(0, 128)}...`; - } - const type = name.includes(".") ? "property" : "argument"; - return `The ${type} '${name}' ${reason}. Received ${inspected}`; - }, - TypeError - // Note: extra classes have been shaken out. - // , RangeError - ); - codes.ERR_UNSUPPORTED_ESM_URL_SCHEME = createError( - "ERR_UNSUPPORTED_ESM_URL_SCHEME", - /** - * @param {URL} url - * @param {Array} supported - */ - (url, supported) => { - let message = `Only URLs with a scheme in: ${formatList( - supported - )} are supported by the default ESM loader`; - if (isWindows && url.protocol.length === 2) { - message += ". On Windows, absolute paths must be valid file:// URLs"; - } - message += `. Received protocol '${url.protocol}'`; - return message; - }, - Error - ); - captureLargerStackTrace = hideStackFrames( - /** - * @param {Error} error - * @returns {Error} - */ - // @ts-expect-error: fine - function(error2) { - const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable(); - if (stackTraceLimitIsWritable) { - userStackTraceLimit = Error.stackTraceLimit; - Error.stackTraceLimit = Number.POSITIVE_INFINITY; - } - Error.captureStackTrace(error2); - if (stackTraceLimitIsWritable) - Error.stackTraceLimit = userStackTraceLimit; - return error2; - } - ); +async function loadConfig(file, pnpSettings = defaultPnPSettings) { + return gcl().readSettingsAsync(file, void 0, pnpSettings); +} +function loadConfigSync(filename, pnpSettings = defaultPnPSettings) { + const pnp = normalizePnPSettings(pnpSettings); + return gcl().readSettings(filename, pnp); +} +function loadPnPSync(pnpSettings, searchFrom) { + if (!pnpSettings.usePnP) { + return void 0; + } + const loader2 = pnpLoader(pnpSettings.pnpFiles); + return loader2.loadSync(searchFrom); +} +function resolveFilename(filename, relativeTo) { + const r = resolveFile(filename, relativeTo); + return { + filename: r.filename, + error: r.found ? void 0 : new Error(`Failed to resolve file: "${filename}"`) + }; +} +function getGlobalSettings() { + return gcl().getGlobalSettings(); +} +var nestedConfigDirectories = { + ".vscode": true, + ".config": true +}; +function resolveGlobRoot(settings, pathToSettingsFile) { + const settingsFileDirRaw = path10.dirname(pathToSettingsFile); + const settingsFileDirName = path10.basename(settingsFileDirRaw); + const isNestedConfig = settingsFileDirName in nestedConfigDirectories; + const isVSCode = settingsFileDirName === ".vscode"; + const settingsFileDir = isNestedConfig ? path10.dirname(settingsFileDirRaw) : settingsFileDirRaw; + const envGlobRoot = process.env[ENV_CSPELL_GLOB_ROOT]; + const defaultGlobRoot = envGlobRoot ?? "${cwd}"; + const rawRoot = settings.globRoot ?? (settings.version === configSettingsFileVersion0_1 || envGlobRoot && !settings.version || isVSCode && !settings.version ? defaultGlobRoot : settingsFileDir); + const globRoot = rawRoot.startsWith("${cwd}") ? rawRoot : path10.resolve(settingsFileDir, rawRoot); + return globRoot; +} +function validationMessage(msg, fileRef) { + return msg + ` + File: "${fileRef.filename}"`; +} +function validateRawConfigVersion(config, fileRef) { + const { version: version4 } = config; + if (version4 === void 0) + return; + if (typeof version4 !== "string") { + logError(validationMessage(`Unsupported config file version: "${version4}", string expected`, fileRef)); + return; + } + if (setOfSupportedConfigVersions.has(version4)) + return; + if (!/^\d+(\.\d+)*$/.test(version4)) { + logError(validationMessage(`Unsupported config file version: "${version4}"`, fileRef)); + return; + } + const msg = version4 > currentSettingsFileVersion ? `Newer config file version found: "${version4}". Supported version is "${currentSettingsFileVersion}"` : `Legacy config file version found: "${version4}", upgrade to "${currentSettingsFileVersion}"`; + logWarning(validationMessage(msg, fileRef)); +} +function validateRawConfigExports(config, fileRef) { + if (config.default) { + throw new ImportError(validationMessage("Module `export default` is not supported.\n Use `module.exports =` instead.", fileRef)); + } +} +function validateRawConfig(config, fileRef) { + const validations = [validateRawConfigExports, validateRawConfigVersion]; + validations.forEach((fn) => fn(config, fileRef)); +} +function createConfigLoaderInternal(cspellIO2) { + return new ConfigLoaderInternal(cspellIO2 ?? getDefaultCSpellIO()); +} +function getDefaultConfigLoaderInternal() { + if (defaultConfigLoader) + return defaultConfigLoader; + return defaultConfigLoader = createConfigLoaderInternal(); +} +function getDefaultConfigLoader() { + return getDefaultConfigLoaderInternal(); +} +function cachedFiles() { + return gcl()._cachedFiles; +} +function cspellConfigExplorerSync() { + return gcl()._cspellConfigExplorerSync; +} + +// node_modules/cspell-lib/dist/esm/Settings/Controller/configLoader/extractImportErrors.mjs +function extractImportErrors(settings) { + const imports = mergeImportRefs2(settings); + return !imports ? [] : [...imports.values()].filter(isImportFileRefWithError); +} +function mergeImportRefs2(left, right = {}) { + const imports = new Map(left.__imports || []); + if (left.__importRef) { + imports.set(left.__importRef.filename, left.__importRef); + } + if (right.__importRef) { + imports.set(right.__importRef.filename, right.__importRef); + } + const rightImports = right.__imports?.values() || []; + for (const ref of rightImports) { + imports.set(ref.filename, ref); + } + return imports.size ? imports : void 0; +} +function isImportFileRefWithError(ref) { + return !!ref.error; +} + +// node_modules/cspell-lib/dist/esm/Settings/Controller/configLoader/readSettings.mjs +function readSettings(filename, relativeToOrDefault, defaultValue) { + const loader2 = getDefaultConfigLoader(); + if (typeof relativeToOrDefault !== "string" || defaultValue === void 0) + return loader2.readSettings(filename, relativeToOrDefault); + return loader2.readSettings(filename, relativeToOrDefault, defaultValue); +} + +// node_modules/cspell-lib/dist/esm/util/text.mjs +var text_exports = {}; +__export(text_exports, { + __testing__: () => __testing__2, + calculateTextDocumentOffsets: () => calculateTextDocumentOffsets, + camelToSnake: () => camelToSnake, + cleanText: () => cleanText, + cleanTextOffset: () => cleanTextOffset, + extractLinesOfText: () => extractLinesOfText, + extractPossibleWordsFromTextOffset: () => extractPossibleWordsFromTextOffset, + extractText: () => extractText, + extractWordsFromCode: () => extractWordsFromCode, + extractWordsFromCodeTextOffset: () => extractWordsFromCodeTextOffset, + extractWordsFromText: () => extractWordsFromText, + extractWordsFromTextOffset: () => extractWordsFromTextOffset, + isFirstCharacterLower: () => isFirstCharacterLower, + isFirstCharacterUpper: () => isFirstCharacterUpper, + isLowerCase: () => isLowerCase, + isUpperCase: () => isUpperCase, + lcFirst: () => lcFirst, + match: () => match, + matchCase: () => matchCase, + matchStringToTextOffset: () => matchStringToTextOffset, + matchToTextOffset: () => matchToTextOffset, + removeAccents: () => removeAccents, + snakeToCamel: () => snakeToCamel, + splitCamelCaseWord: () => splitCamelCaseWord, + splitCamelCaseWordWithOffset: () => splitCamelCaseWordWithOffset, + stringToRegExp: () => stringToRegExp, + textOffset: () => textOffset, + ucFirst: () => ucFirst +}); + +// node_modules/cspell-lib/dist/esm/util/search.mjs +function binarySearch(arr, item, leftOffset, rightOffset) { + let left = Math.max(leftOffset ?? 0, 0); + let right = Math.min(rightOffset ?? arr.length, arr.length); + while (left < right) { + const pos = left + right >> 1; + if (arr[pos] < item) { + left = pos + 1; + } else { + right = pos; + } } -}); + return left; +} -// node_modules/import-meta-resolve/lib/package-json-reader.js -function read(jsonPath) { - try { - const string = import_node_fs.default.readFileSync( - import_node_path.default.toNamespacedPath(import_node_path.default.join(import_node_path.default.dirname(jsonPath), "package.json")), - "utf8" - ); - return { string }; - } catch (error2) { - const exception = ( - /** @type {ErrnoException} */ - error2 - ); - if (exception.code === "ENOENT") { - return { string: void 0 }; +// node_modules/cspell-lib/dist/esm/util/text.mjs +function splitCamelCaseWordWithOffset(wo) { + return splitCamelCaseWord(wo.text).map(scanMap((last, text) => ({ text, offset: last.offset + last.text.length }), { + text: "", + offset: wo.offset + })); +} +function splitCamelCaseWord(word) { + const wPrime = word.replace(regExUpperSOrIng, (s) => s[0] + s.slice(1).toLowerCase()); + const separator = "_<^*_*^>_"; + const pass1 = wPrime.replace(regExSplitWords, "$1" + separator + "$2"); + const pass2 = pass1.replace(regExSplitWords2, "$1" + separator + "$2"); + return pass2.split(separator); +} +function match(reg, text) { + return sequenceFromRegExpMatch(reg, text); +} +function matchStringToTextOffset(reg, text) { + return matchToTextOffset(reg, { text, offset: 0 }); +} +function matchToTextOffset(reg, text) { + const textOffset2 = text; + const fnOffsetMap = offsetMap(textOffset2.offset); + textOffset2.text.matchAll(reg); + return pipeSync(match(reg, textOffset2.text), opMapSync((m) => fnOffsetMap({ text: m[0], offset: m.index || 0 }))); +} +function* extractLinesOfText(text) { + let i = 0; + for (let j = text.indexOf("\n", i); j >= 0; j = text.indexOf("\n", i)) { + const end = j + 1; + yield { text: text.slice(i, end), offset: i }; + i = end; + } + yield { text: text.slice(i, text.length), offset: i }; +} +function extractWordsFromText(text) { + return extractWordsFromTextOffset(textOffset(text)); +} +function extractWordsFromTextOffset(text) { + const reg = new RegExp(regExWords); + return matchToTextOffset(reg, cleanTextOffset(text)); +} +function cleanText(text) { + text = text.replace(regExIgnoreCharacters, (match2) => " ".repeat(match2.length)); + return text; +} +function cleanTextOffset(text) { + return { + text: cleanText(text.text), + offset: text.offset + }; +} +function extractPossibleWordsFromTextOffset(text) { + const reg = new RegExp(regExWordsAndDigits); + return matchToTextOffset(reg, text); +} +function extractWordsFromCode(text) { + return extractWordsFromCodeTextOffset(textOffset(text)); +} +function extractWordsFromCodeTextOffset(textOffset2) { + return pipeSync(extractWordsFromTextOffset(textOffset2), opConcatMapSync(splitCamelCaseWordWithOffset)); +} +function isUpperCase(word) { + return !!word.match(regExAllUpper); +} +function isLowerCase(word) { + return !!word.match(regExAllLower); +} +function isFirstCharacterUpper(word) { + return isUpperCase(word.slice(0, 1)); +} +function isFirstCharacterLower(word) { + return isLowerCase(word.slice(0, 1)); +} +function ucFirst(word) { + return word.slice(0, 1).toUpperCase() + word.slice(1); +} +function lcFirst(word) { + return word.slice(0, 1).toLowerCase() + word.slice(1); +} +function snakeToCamel(word) { + return word.split("_").map(ucFirst).join(""); +} +function camelToSnake(word) { + return splitCamelCaseWord(word).join("_").toLowerCase(); +} +function matchCase(example, word) { + if (example.match(regExFirstUpper)) { + return word.slice(0, 1).toUpperCase() + word.slice(1).toLowerCase(); + } + if (example.match(regExAllLower)) { + return word.toLowerCase(); + } + if (example.match(regExAllUpper)) { + return word.toUpperCase(); + } + if (isFirstCharacterUpper(example)) { + return ucFirst(word); + } + if (isFirstCharacterLower(example)) { + return lcFirst(word); + } + return word; +} +function textOffset(text, offset = 0) { + return { text, offset }; +} +function extractText(textOffset2, startPos, endPos) { + const { text, offset: orig } = textOffset2; + const a = Math.max(startPos - orig, 0); + const b = Math.max(endPos - orig, 0); + return text.slice(a, b); +} +function offsetMap(offset) { + return (xo) => ({ ...xo, offset: xo.offset + offset }); +} +function calculateTextDocumentOffsets(uri, doc, wordOffsets) { + const lines = [ + -1, + ...pipeSync(match(/\n/g, doc), opMapSync((a) => a.index)), + doc.length + ]; + let lastRow = -1; + let lastOffset = doc.length + 1; + let lastLineRow = -1; + let lastLine; + function findRowCol(offset) { + const row = binarySearch(lines, offset, offset >= lastOffset ? lastRow : void 0); + const col = offset - lines[Math.max(0, row - 1)]; + lastOffset = offset; + lastRow = row; + return [row, col]; + } + function extractLine(row) { + const offset = lines[row - 1] + 1; + const text = doc.slice(offset, lines[row] + 1); + return { text, offset }; + } + function calcLine(row) { + const last = lastLineRow === row ? lastLine : void 0; + lastLineRow = row; + const r = last ?? extractLine(row); + lastLine = r; + return r; + } + const _uri = toUri(uri).toString(); + return wordOffsets.map((wo) => { + const [row, col] = findRowCol(wo.offset); + return { ...wo, row, col, doc, uri: _uri, line: calcLine(row) }; + }); +} +function removeAccents(text) { + return text.normalize("NFD").replace(regExAccents, ""); +} +var __testing__2 = { + regExWords, + regExWordsAndDigits +}; + +// node_modules/cspell-lib/dist/esm/LanguageIds.mjs +var languageExtensionDefinitions = [ + { id: "ada", extensions: [".adb", ".ads"] }, + { id: "apiblueprint", extensions: [".apib", ".apiblueprint"] }, + { id: "asciidoc", extensions: [".adoc", ".asc", ".asciidoc"] }, + { id: "bat", extensions: [".bat", ".cmd"] }, + { id: "clojure", extensions: [".clj", ".cljs", ".cljx", ".clojure", ".edn"] }, + { id: "coffeescript", extensions: [".coffee", ".cson"] }, + { id: "c", extensions: [".c"] }, + // cspell:ignore cmake + { id: "cmake", extensions: [".cmake"], filenames: ["CMakeLists.txt"] }, + { + id: "cpp", + extensions: [".cpp", ".cc", ".cxx", ".hpp", ".hh", ".hxx", ".h", ".mm", ".ino", ".inl"] + }, + { id: "csharp", extensions: [".cs"] }, + { id: "css", extensions: [".css"] }, + { id: "dhall", extensions: [".dhall"] }, + { id: "diff", extensions: [".diff", ".patch", ".rej"] }, + { id: "dockerfile", extensions: [".dockerfile"], filenames: ["Dockerfile"] }, + { id: "elixir", extensions: [".ex", ".exs"] }, + { id: "fsharp", extensions: [".fs", ".fsi", ".fsx", ".fsscript"] }, + { id: "go", extensions: [".go"] }, + { id: "groovy", extensions: [".groovy", ".gvy", ".gradle"] }, + { id: "handlebars", extensions: [".handlebars", ".hbs"] }, + { id: "haskell", extensions: [".hs", ".lhs"] }, + { + id: "html", + extensions: [".html", ".htm", ".shtml", ".xhtml", ".mdoc", ".jsp", ".asp", ".aspx", ".jshtm", ".volt", ".vue"] + }, + { id: "ini", extensions: [".ini", ".conf"] }, + { id: "properties", extensions: [".properties", ".gitconfig", ".cfg", ".conf"] }, + { id: "jade", extensions: [".jade", ".pug"] }, + { id: "java", extensions: [".java", ".jav"] }, + { id: "javascriptreact", extensions: [".jsx"] }, + { id: "javascript", extensions: [".js", ".mjs", ".es6", ".cjs"] }, + { + id: "json", + extensions: [".json", ".jsonc", ".bowerrc", ".jshintrc", ".jscsrc", ".eslintrc", ".babelrc", ".webmanifest"] + }, + { id: "jsonc", extensions: [".jsonc"] }, + { id: "jsonc", extensions: [".code-workspace"], filenames: [".code-workspace"] }, + { id: "jungle", extensions: [".jungle"] }, + { id: "less", extensions: [".less"] }, + { id: "literate haskell", extensions: [".lhs"] }, + { id: "lua", extensions: [".lua"] }, + { id: "makefile", extensions: [".mk"] }, + { id: "markdown", extensions: [".md", ".mdown", ".markdown", ".markdn"] }, + { id: "mdx", extensions: [".mdx"] }, + { id: "monkeyc", extensions: [".mc", ".mb"] }, + { id: "objective-c", extensions: [".m"] }, + { id: "perl", extensions: [".pl", ".pm", ".pod", ".t", ".PL", ".psgi"] }, + { id: "perl6", extensions: [".p6", ".pl6", ".pm6", ".nqp"] }, + { id: "php", extensions: [".php", ".php4", ".php5", ".phtml", ".ctp"] }, + { id: "plaintext", extensions: [".txt"] }, + { id: "powershell", extensions: [".ps1", ".psm1", ".psd1", ".pssc", ".psrc"] }, + { id: "purescript", extensions: [".purs"] }, + { id: "python", extensions: [".py", ".rpy", ".pyw", ".cpy", ".gyp", ".gypi"] }, + { id: "r", extensions: [".r", ".R", ".rhistory", ".rprofile", ".rt"] }, + { id: "razor", extensions: [".cshtml"] }, + { id: "ruby", extensions: [".rb", ".rbx", ".rjs", ".gemspec", ".rake", ".ru"] }, + { id: "ruby", extensions: [], filenames: ["Gemfile"] }, + { id: "rust", extensions: [".rs"] }, + { id: "scala", extensions: [".scala", ".sc", ".sbt"] }, + { id: "scss", extensions: [".scss"] }, + { id: "shaderlab", extensions: [".shader", ".cginc"] }, + { + id: "shellscript", + extensions: [ + ".sh", + ".bash", + ".bashrc", + ".bash_aliases", + ".bash_profile", + ".bash_login", + ".ebuild", + ".install", + ".profile", + ".bash_logout", + ".zsh", + ".zshrc", + ".zprofile", + ".zlogin", + ".zlogout", + ".zshenv", + ".zsh-theme" + ] + }, + { id: "sql", extensions: [".sql", ".dsql"] }, + { id: "svelte", extensions: [".svelte"] }, + { id: "swift", extensions: [".swift"] }, + { id: "toml", extensions: [".toml"] }, + { id: "typescript", extensions: [".ts", ".cts", ".mts"] }, + { id: "typescriptreact", extensions: [".tsx"] }, + { id: "vb", extensions: [".vb", ".brs", ".vbs", ".bas"] }, + { id: "vue", extensions: [".vue"] }, + { + id: "xml", + extensions: [ + ".ascx", + ".atom", + ".axml", + ".bpmn", + ".config", + ".cpt", + ".csl", + ".csproj.user", + ".csproj", + ".dita", + ".ditamap", + ".dtd", + ".dtml", + ".ent", + ".fsproj", + ".fxml", + ".iml", + ".isml", + ".jmx", + ".launch", + ".menu", + ".mod", + ".mxml", + ".nuspec", + ".opml", + ".owl", + ".proj", + ".pt", + ".pubxml.user", + ".pubxml", + ".rdf", + ".rng", + ".rss", + ".shproj", + ".storyboard", + ".svg", + ".targets", + ".tld", + ".tmx", + ".vbproj.user", + ".vbproj", + ".vcxproj.filters", + ".vcxproj", + ".wsdl", + ".wxi", + ".wxl", + ".wxs", + ".xaml", + ".xbl", + ".xib", + ".xlf", + ".xliff", + ".xml", + ".xoml", + ".xpdl", + ".xsd", + ".xul" + ] + }, + { id: "wheel", extensions: [".whl"], format: "Binary" }, + { id: "xsl", extensions: [".xsl", ".xslt"] }, + { id: "yaml", extensions: [".eyaml", ".eyml", ".yaml", ".yml"] }, + { id: "latex", extensions: [".tex"] }, + { id: "map", extensions: [".map"] }, + { id: "pdf", extensions: [".pdf"] }, + { id: "rsa", extensions: [".pub"], filenames: ["id_rsa", "id_rsa.pub"] }, + { id: "pem", extensions: [".private-key.pem", ".pem"] }, + { id: "pem-private-key", extensions: [".private-key.pem"] }, + // + // Special file types used to prevent spell checking. + // + { + id: "image", + extensions: [ + ".bmp", + ".exr", + ".gif", + ".ico", + ".jpeg", + ".jpg", + ".pbm", + ".pgm", + ".png", + ".ppm", + ".ras", + ".sgi", + ".tiff", + ".webp", + ".xbm" + ], + format: "Binary", + description: "Some image extensions" + }, + // cspell:ignore woff + { + id: "binary", + extensions: [".gz", ".exe", ".dll", ".lib", ".obj", ".o", ".eot", ".cur", ".zip"], + format: "Binary" + }, + { + id: "fonts", + extensions: [".ttf", ".woff", ".woff2"], + format: "Binary" + }, + { + id: "video", + extensions: [".mov", ".mpg"], + format: "Binary" + }, + { + id: "lock", + extensions: [".lock"], + filenames: ["package-lock.json"] + }, + { + id: "cache_files", + extensions: [], + // cspell:ignore eslintcache + filenames: [".cspellcache", ".DS_Store", ".eslintcache"] + }, + { id: "dll", extensions: [".dll"], format: "Binary" }, + { id: "exe", extensions: [".exe"], format: "Binary" }, + { id: "object-file", extensions: [".o", ".obj"], format: "Binary" }, + { id: "jar", extensions: [".jar"], format: "Binary" }, + { id: "spv", extensions: [".spv"], format: "Binary", description: "SPSS Output Document" }, + { id: "mdb", extensions: [".mdb"], format: "Binary", description: "Microsoft Access DB" }, + { id: "webm", extensions: [".webm"], format: "Binary", description: "WebM is an audiovisual media file format." }, + { id: "trie", extensions: [".trie"], format: "Binary", description: "CSpell dictionary file." } +]; +var binaryFormatIds = languageExtensionDefinitions.filter((d) => d.format === "Binary").map((d) => d.id); +var binaryLanguages = new Set(["binary", "image", "video", "fonts"].concat(binaryFormatIds)); +var generatedFiles = /* @__PURE__ */ new Set([...binaryLanguages, "map", "lock", "pdf", "cache_files", "rsa", "pem", "trie"]); +var languageIds = languageExtensionDefinitions.map(({ id }) => id); +var mapExtensionToSetOfLanguageIds = buildLanguageExtensionMapSet(languageExtensionDefinitions); +var mapExtensionToLanguageIds = buildExtensionToLanguageIdMap(mapExtensionToSetOfLanguageIds); +function isGeneratedFile(basename7) { + return isGenerated(getLanguagesForBasename(basename7)); +} +function isGenerated(languageId) { + return doesSetContainAnyOf(generatedFiles, languageId); +} +function doesSetContainAnyOf(setOfIds, languageId) { + if (typeof languageId === "string") { + return setOfIds.has(languageId); + } + for (const id of languageId) { + if (setOfIds.has(id)) { + return true; } - throw exception; } + return false; } -var import_node_fs, import_node_path, reader, package_json_reader_default; -var init_package_json_reader = __esm({ - "node_modules/import-meta-resolve/lib/package-json-reader.js"() { - import_node_fs = __toESM(require("node:fs"), 1); - import_node_path = __toESM(require("node:path"), 1); - reader = { read }; - package_json_reader_default = reader; +function buildLanguageExtensionMapSet(defs) { + return defs.reduce((map3, def) => { + function addId(value) { + autoResolve(map3, value, () => /* @__PURE__ */ new Set()).add(def.id); + } + def.extensions.forEach(addId); + def.filenames?.forEach(addId); + return map3; + }, /* @__PURE__ */ new Map()); +} +function buildExtensionToLanguageIdMap(map3) { + return new Map([...map3].map(([k, s]) => [k, [...s]])); +} +function _getLanguagesForBasename(basename7) { + const found = mapExtensionToLanguageIds.get(basename7); + if (found) + return found; + for (let pos = basename7.indexOf("."); pos >= 0; pos = basename7.indexOf(".", pos + 1)) { + const ids = mapExtensionToLanguageIds.get(basename7.slice(pos)); + if (ids) + return ids; } -}); + return void 0; +} +function getLanguagesForBasename(basename7) { + return _getLanguagesForBasename(basename7) || _getLanguagesForBasename(basename7.toLowerCase()) || []; +} -// node_modules/import-meta-resolve/lib/package-config.js -function getPackageConfig(path16, specifier, base) { - const existing = packageJsonCache.get(path16); - if (existing !== void 0) { - return existing; +// node_modules/cspell-lib/dist/esm/Document/normalizeLanguageIds.mjs +function normalizeLanguageIds(languageId) { + return (Array.isArray(languageId) ? languageId.join(",") : languageId).split(",").map((s) => s.trim()); +} + +// node_modules/cspell-lib/dist/esm/Document/isBinaryDoc.mjs +function isBinaryDoc(document) { + return isBinaryFile(toUri(document.uri), document.languageId); +} +function isBinaryFile(filename, languageId) { + const filenameUri = toUri(filename); + if (languageId) { + const ids = normalizeLanguageIds(languageId); + if (ids.length) + return isGenerated(ids); } - const source = package_json_reader_default.read(path16).string; - if (source === void 0) { - const packageConfig2 = { - pjsonPath: path16, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 + const file = basename(filenameUri); + return isGeneratedFile(file); +} + +// node_modules/cspell-lib/dist/esm/Document/resolveDocument.mjs +var import_promises = require("fs/promises"); + +// node_modules/cspell-lib/dist/esm/Models/TextDocument.mjs +var import_assert8 = __toESM(require("assert"), 1); +var import_vscode_languageserver_textdocument = __toESM(require_main(), 1); +var TextDocumentImpl = class { + constructor(uri, text, languageId, locale, version4) { + this.uri = uri; + this.languageId = languageId; + this.locale = locale; + const primaryLanguageId = typeof languageId === "string" ? languageId : languageId[0] || "plaintext"; + this.vsTextDoc = import_vscode_languageserver_textdocument.TextDocument.create(uri.toString(), primaryLanguageId, version4, text); + } + get version() { + return this.vsTextDoc.version; + } + get text() { + return this.vsTextDoc.getText(); + } + positionAt(offset) { + return this.vsTextDoc.positionAt(offset); + } + offsetAt(position) { + return this.vsTextDoc.offsetAt(position); + } + lineAt(offset) { + const position = this.vsTextDoc.positionAt(offset); + return this.getLine(position.line); + } + getLine(lineNum) { + const position = { line: lineNum, character: 0 }; + const end = { line: lineNum + 1, character: 0 }; + const range = { + start: position, + end + }; + const lineOffset = this.vsTextDoc.offsetAt(position); + const text = this.vsTextDoc.getText(range); + return { + text, + offset: lineOffset, + position }; - packageJsonCache.set(path16, packageConfig2); - return packageConfig2; } - let packageJson; - try { - packageJson = JSON.parse(source); - } catch (error2) { - const exception = ( - /** @type {ErrnoException} */ - error2 - ); - throw new ERR_INVALID_PACKAGE_CONFIG( - path16, - (base ? `"${specifier}" from ` : "") + (0, import_node_url.fileURLToPath)(base || specifier), - exception.message - ); + /** + * Iterate over the lines of a document one-by-one. + * Changing the document between iterations can change the result + */ + *getLines() { + const range = { + start: { line: 0, character: 0 }, + end: { line: 1, character: 0 } + }; + while (this.vsTextDoc.offsetAt(range.end) > this.vsTextDoc.offsetAt(range.start)) { + const offset = this.vsTextDoc.offsetAt(range.start); + yield { + text: this.vsTextDoc.getText(range), + offset, + position: range.start + }; + ++range.start.line; + ++range.end.line; + } } - const { exports, imports, main, name, type } = packageJson; - const packageConfig = { - pjsonPath: path16, - exists: true, - main: typeof main === "string" ? main : void 0, - name: typeof name === "string" ? name : void 0, - type: type === "module" || type === "commonjs" ? type : "none", - // @ts-expect-error Assume `Record`. - exports, - // @ts-expect-error Assume `Record`. - imports: imports && typeof imports === "object" ? imports : void 0 + /** + * Apply edits to the text. + * Note: the edits are applied one after the other. + * @param edits - changes to the text + * @param version - optional version to use. + * @returns this + */ + update(edits, version4) { + version4 = version4 ?? this.version + 1; + for (const edit of edits) { + const vsEdit = edit.range ? { + range: { start: this.positionAt(edit.range[0]), end: this.positionAt(edit.range[1]) }, + text: edit.text + } : edit; + import_vscode_languageserver_textdocument.TextDocument.update(this.vsTextDoc, [vsEdit], version4); + } + return this; + } +}; +function createTextDocument({ uri, content, languageId, locale, version: version4 }) { + version4 = version4 ?? 1; + uri = toUri(uri); + languageId = languageId ?? getLanguagesForBasename(basename(uri)); + languageId = languageId.length === 0 ? "text" : languageId; + return new TextDocumentImpl(uri, content, languageId, locale, version4); +} +function updateTextDocument(doc, edits, version4) { + (0, import_assert8.default)(isTextDocumentImpl(doc), "Unknown TextDocument type"); + return doc.update(edits, version4); +} +function isTextDocumentImpl(doc) { + return doc instanceof TextDocumentImpl; +} + +// node_modules/cspell-lib/dist/esm/Document/resolveDocument.mjs +var defaultEncoding = "utf8"; +function fileToDocument(file, text, languageId, locale) { + return clean({ + uri: toUri(file).toString(), + text, + languageId, + locale + }); +} +function documentToTextDocument(document) { + const { uri, text: content, languageId, locale } = document; + return createTextDocument({ uri, content, languageId, locale }); +} +async function readDocument(filename, encoding = defaultEncoding) { + const text = await (0, import_promises.readFile)(filename, encoding); + const uri = toUri(filename).toString(); + return { + uri, + text }; - packageJsonCache.set(path16, packageConfig); - return packageConfig; } -function getPackageScopeConfig(resolved) { - let packageJsonUrl = new import_node_url.URL("package.json", resolved); - while (true) { - const packageJsonPath2 = packageJsonUrl.pathname; - if (packageJsonPath2.endsWith("node_modules/package.json")) - break; - const packageConfig2 = getPackageConfig( - (0, import_node_url.fileURLToPath)(packageJsonUrl), - resolved - ); - if (packageConfig2.exists) - return packageConfig2; - const lastPackageJsonUrl = packageJsonUrl; - packageJsonUrl = new import_node_url.URL("../package.json", packageJsonUrl); - if (packageJsonUrl.pathname === lastPackageJsonUrl.pathname) - break; +function resolveDocument(document, encoding) { + if (isDocumentWithText(document)) + return Promise.resolve(document); + const uri = toUri(document.uri); + if (uri.scheme !== "file") { + throw new Error(`Unsupported schema: "${uri.scheme}", open "${uri.toString()}"`); } - const packageJsonPath = (0, import_node_url.fileURLToPath)(packageJsonUrl); - const packageConfig = { - pjsonPath: packageJsonPath, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJsonCache.set(packageJsonPath, packageConfig); - return packageConfig; + return readDocument(uriToFilePath(uri), encoding); } -var import_node_url, ERR_INVALID_PACKAGE_CONFIG, packageJsonCache; -var init_package_config = __esm({ - "node_modules/import-meta-resolve/lib/package-config.js"() { - import_node_url = require("node:url"); - init_errors(); - init_package_json_reader(); - ({ ERR_INVALID_PACKAGE_CONFIG } = codes); - packageJsonCache = /* @__PURE__ */ new Map(); +function isDocumentWithText(doc) { + return doc.text !== void 0; +} + +// node_modules/cspell-lib/dist/esm/FeatureFlags/FeatureFlags.mjs +var systemFeatureFlags; +var FeatureFlags = class { + constructor(flags = []) { + this.flagValues = /* @__PURE__ */ new Map(); + this.flags = new Map(flags.map((f) => [f.name, f])); } -}); + register(flagOrName, description) { + if (typeof flagOrName === "string") { + return this.register({ name: flagOrName, description: description || "" }); + } + this.flags.set(flagOrName.name, flagOrName); + return this; + } + getFlag(flag) { + return this.flagValues.get(flag); + } + getFlagBool(flag) { + return toBool(this.getFlag(flag)); + } + setFlag(flag, value = true) { + if (!this.flags.has(flag)) { + throw new UnknownFeatureFlagError(flag); + } + this.flagValues.set(flag, value); + return this; + } + getFlagInfo(flag) { + return this.flags.get(flag); + } + getFlags() { + return [...this.flags.values()]; + } + getFlagValues() { + return new Map(this.flagValues); + } + reset() { + this.flagValues.clear(); + return this; + } +}; +var UnknownFeatureFlagError = class extends Error { + constructor(flag) { + super(`Unknown feature flag: ${flag}`); + this.flag = flag; + } +}; +function getSystemFeatureFlags() { + return systemFeatureFlags || (systemFeatureFlags = new FeatureFlags()); +} +var boolValues = { + 0: false, + 1: true, + f: false, + false: false, + n: false, + no: false, + t: true, + true: true, + y: true, + yes: true +}; +function toBool(value) { + if (typeof value !== "string") + return value; + return boolValues[value.toLowerCase()]; +} -// node_modules/import-meta-resolve/lib/resolve-get-package-type.js -function getPackageType(url) { - const packageConfig = getPackageScopeConfig(url); - return packageConfig.type; +// node_modules/cspell-grammar/dist/parser/grammarTypesHelpers.js +function isPatternInclude(p) { + return !!p.include; } -var init_resolve_get_package_type = __esm({ - "node_modules/import-meta-resolve/lib/resolve-get-package-type.js"() { - init_package_config(); +var TypeofMatch = { + object: true, + string: true +}; +var TypeofBegin = TypeofMatch; +var TypeofEnd = { ...TypeofBegin, undefined: true }; +function isPatternMatch(pattern) { + const p = pattern; + return !!p.match && typeof p.match in TypeofMatch; +} +function isPatternBeginEnd(pattern) { + const p = pattern; + return p.begin !== void 0 && typeof p.begin in TypeofBegin && typeof p.end in TypeofEnd; +} +function isPatternPatterns(p) { + return Array.isArray(p.patterns); +} + +// node_modules/cspell-grammar/dist/parser/matchResult.js +function segmentMatch(mr) { + const { matches, index, groups, input } = mr; + const segments = []; + let p = index; + for (let groupNum = 0; groupNum < matches.length; ++groupNum) { + const m = matches[groupNum]; + if (!m) + continue; + const idx0 = input.indexOf(m, p); + const idx2 = idx0 >= p ? idx0 : input.lastIndexOf(m, p); + if (idx2 < 0) + continue; + segments.push({ match: m, index: idx2, groupNum, groupName: void 0 }); + p = idx2; } -}); - -// node_modules/import-meta-resolve/lib/get-format.js -function mimeToFormat(mime) { - if (mime && /\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(mime)) - return "module"; - if (mime === "application/json") - return "json"; - return null; + const textToSeg = new Map(segments.map((s) => [s.match, s])); + for (const [name, value] of Object.entries(groups)) { + const s = value && textToSeg.get(value); + if (!s) + continue; + s.groupName = s.groupName ? Array.isArray(s.groupName) ? s.groupName.concat([name]) : [s.groupName, name] : name; + } + return segments; } -function getDataProtocolModuleFormat(parsed) { - const { 1: mime } = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec( - parsed.pathname - ) || [null, null, null]; - return mimeToFormat(mime); +function createMatchResult(r, lineNumber) { + const groups = /* @__PURE__ */ Object.create(null); + r.groups && Object.assign(groups, r.groups); + const matches = r; + const match2 = r[0]; + return { index: r.index, input: r.input, match: match2, matches, groups, lineNumber }; } -function getFileProtocolModuleFormat(url, _context, ignoreErrors) { - const filepath = (0, import_node_url2.fileURLToPath)(url); - const ext = import_node_path2.default.extname(filepath); - if (ext === ".js") { - return getPackageType(url) === "module" ? "module" : "commonjs"; +function createSimpleMatchResult(match2, input, index, lineNumber) { + const groups = /* @__PURE__ */ Object.create(null); + return { index, input, match: match2, matches: [match2], groups, lineNumber }; +} + +// node_modules/cspell-grammar/dist/parser/scope.js +var import_assert9 = __toESM(require("assert"), 1); +var Scope = class _Scope { + constructor(value, parent) { + this.value = value; + this.parent = parent; } - const format5 = extensionFormatMap[ext]; - if (format5) - return format5; - if (ignoreErrors) { - return void 0; + /** + * Convert the scope hierarchy to a string + * @param ltr - return ancestry from left-to-right + * @returns the scope hierarchy as a string separated by a space. + */ + toString(ltr = false) { + if (!this.parent) + return this.value; + return ltr ? this.parent.toString(ltr) + " " + this.value : this.value + " " + this.parent.toString(ltr); } - throw new ERR_UNKNOWN_FILE_EXTENSION(ext, filepath); + static isScope(value) { + return value instanceof _Scope; + } +}; +var ScopePool = class { + constructor() { + this.pool = /* @__PURE__ */ new Map(); + } + /** + * Get a Scope that matches the scope. This method is idempotent. + * @param scopeValue - a single scope value: i.e. `source.ts` + * @param parent - optional parent Scope + */ + getScope(scopeValue, parent) { + const foundPoolMap = this.pool.get(scopeValue); + const poolMap = foundPoolMap || /* @__PURE__ */ new Map(); + if (poolMap !== foundPoolMap) { + this.pool.set(scopeValue, poolMap); + } + const foundScope = poolMap.get(parent); + if (foundScope) + return foundScope.v; + const scope = new Scope(scopeValue, parent); + poolMap.set(parent, { v: scope }); + return scope; + } + parseScope(scopes, ltr = false) { + if (Scope.isScope(scopes)) + return scopes; + if (isScopeLike(scopes)) { + const parent = scopes.parent ? this.parseScope(scopes.parent) : void 0; + return this.getScope(scopes.value, parent); + } + return this.parseScopeString(scopes, ltr); + } + parseScopeString(scopes, ltr) { + scopes = Array.isArray(scopes) ? scopes : scopes.split(" "); + const parentToChild = ltr ? scopes : scopes.reverse(); + let parent = void 0; + for (const value of parentToChild) { + parent = this.getScope(value, parent); + } + (0, import_assert9.default)(parent, "Empty scope is not allowed."); + return parent; + } +}; +function isScopeLike(value) { + return typeof value === "object" && !Array.isArray(value) && value.value !== void 0; } -function getHttpProtocolModuleFormat() { + +// node_modules/cspell-grammar/dist/parser/grammarNormalizer.js +function normalizeGrammar(grammar2) { + return new ImplNGrammar(grammar2); } -function defaultGetFormatWithoutErrors(url, context) { - if (!hasOwnProperty.call(protocolHandlers, url.protocol)) { - return null; +var SpecialRepositoryReferences = { + $self: true, + $base: true +}; +function nPattern(p) { + if (isPatternMatch(p)) + return normalizePatternMatch(p); + if (isPatternBeginEnd(p)) + return normalizePatternBeginEnd(p); + if (isPatternInclude(p)) + return normalizePatternInclude(p); + if (isPatternPatterns(p)) + return normalizePatternsPatterns(p); + return normalizePatternName(p); +} +function normalizePatternMatch(p) { + const regExec = makeTestMatchFn(p.match); + const self = { + ...p, + captures: normalizeCapture(p.captures), + findMatch + }; + function findMatch(line, parentRule) { + const match2 = regExec(line); + if (!match2) + return void 0; + const rule = factoryRule(parentRule, self); + return { rule, match: match2, line }; + } + return self; +} +function normalizePatternBeginEnd(p) { + const patterns = normalizePatterns(p.patterns); + const self = { + ...p, + captures: normalizeCapture(p.captures), + beginCaptures: normalizeCapture(p.beginCaptures), + endCaptures: normalizeCapture(p.endCaptures), + patterns, + findMatch + }; + function findMatch(line, parentRule) { + const match2 = testBegin(line); + if (!match2) + return void 0; + const rule = factoryRule(parentRule, self, findNext, end); + return { rule, match: match2, line }; } - return protocolHandlers[url.protocol](url, context, true) || null; + const testBegin = makeTestMatchFn(p.begin); + const testEnd = p.end !== void 0 ? makeTestMatchFn(p.end) : () => void 0; + function findNext(line) { + return patterns && findInPatterns(patterns, line, this); + } + function end(line) { + return testEnd(line); + } + return self; } -var import_node_path2, import_node_url2, ERR_UNKNOWN_FILE_EXTENSION, hasOwnProperty, extensionFormatMap, protocolHandlers; -var init_get_format = __esm({ - "node_modules/import-meta-resolve/lib/get-format.js"() { - import_node_path2 = __toESM(require("node:path"), 1); - import_node_url2 = require("node:url"); - init_resolve_get_package_type(); - init_errors(); - ({ ERR_UNKNOWN_FILE_EXTENSION } = codes); - hasOwnProperty = {}.hasOwnProperty; - extensionFormatMap = { - // @ts-expect-error: hush. - __proto__: null, - ".cjs": "commonjs", - ".js": "module", - ".json": "json", - ".mjs": "module" - }; - protocolHandlers = { - // @ts-expect-error: hush. - __proto__: null, - "data:": getDataProtocolModuleFormat, - "file:": getFileProtocolModuleFormat, - "http:": getHttpProtocolModuleFormat, - "https:": getHttpProtocolModuleFormat, - "node:"() { - return "builtin"; - } - }; +function normalizePatternName(p) { + const patterns = void 0; + const self = { + ...p, + patterns, + findMatch + }; + function findMatch(line, parentRule) { + const rule = factoryRule(parentRule, self); + const input = line.text.slice(line.offset); + const match2 = createSimpleMatchResult(input, input, line.offset, line.lineNumber); + return { rule, match: match2, line }; + } + return self; +} +function normalizePatternInclude(p) { + const { include } = p; + return include.startsWith("#") || include in SpecialRepositoryReferences ? normalizePatternIncludeRef(p) : normalizePatternIncludeExt(p); +} +function normalizePatternIncludeRef(p) { + const { include, ...rest } = p; + const reference = include.startsWith("#") ? include.slice(1) : include; + const self = { + ...rest, + reference, + findMatch + }; + function findMatch(line, parentRule) { + const pat = parentRule.repository[reference]; + if (pat === void 0) + throw new Error(`Unknown Include Reference ${include}`); + return pat.findMatch(line, parentRule); } -}); - -// node_modules/import-meta-resolve/lib/utils.js -function getDefaultConditions() { - return DEFAULT_CONDITIONS; + return self; } -function getDefaultConditionsSet() { - return DEFAULT_CONDITIONS_SET; +function normalizePatternIncludeExt(p) { + function findMatch(_line) { + return void 0; + } + const self = { + ...p, + findMatch + }; + return self; } -function getConditionsSet(conditions) { - if (conditions !== void 0 && conditions !== getDefaultConditions()) { - if (!Array.isArray(conditions)) { - throw new ERR_INVALID_ARG_VALUE( - "conditions", - conditions, - "expected an array" - ); +function normalizePatternsPatterns(p) { + return new ImplNPatternPatterns(p); +} +function findInPatterns(patterns, line, rule) { + let r = void 0; + for (const pat of patterns) { + if (pat.disabled) + continue; + const er = pat.findMatch(line, rule); + if (er?.match !== void 0 && !er.rule.pattern.disabled) { + r = r && r.match && r.match.index <= er.match.index && r || er; } - return new Set(conditions); } - return getDefaultConditionsSet(); + return r; } -var ERR_INVALID_ARG_VALUE, DEFAULT_CONDITIONS, DEFAULT_CONDITIONS_SET; -var init_utils = __esm({ - "node_modules/import-meta-resolve/lib/utils.js"() { - init_errors(); - ({ ERR_INVALID_ARG_VALUE } = codes); - DEFAULT_CONDITIONS = Object.freeze(["node", "import"]); - DEFAULT_CONDITIONS_SET = new Set(DEFAULT_CONDITIONS); - } -}); - -// node_modules/import-meta-resolve/lib/resolve.js -function emitInvalidSegmentDeprecation(target, request, match, packageJsonUrl, internal, base, isTarget) { - const pjsonPath = (0, import_node_url3.fileURLToPath)(packageJsonUrl); - const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null; - import_node_process2.default.emitWarning( - `Use of deprecated ${double ? "double slash" : "leading or trailing slash matching"} resolving "${target}" for module request "${request}" ${request === match ? "" : `matched to "${match}" `}in the "${internal ? "imports" : "exports"}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${(0, import_node_url3.fileURLToPath)(base)}` : ""}.`, - "DeprecationWarning", - "DEP0166" - ); +function normalizePatterns(patterns) { + if (!patterns) + return void 0; + return patterns.map((p) => typeof p === "string" ? { include: p } : p).map(nPattern); } -function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) { - const format5 = defaultGetFormatWithoutErrors(url, { parentURL: base.href }); - if (format5 !== "module") - return; - const path16 = (0, import_node_url3.fileURLToPath)(url.href); - const pkgPath = (0, import_node_url3.fileURLToPath)(new import_node_url3.URL(".", packageJsonUrl)); - const basePath = (0, import_node_url3.fileURLToPath)(base); - if (main) - import_node_process2.default.emitWarning( - `Package ${pkgPath} has a "main" field set to ${JSON.stringify(main)}, excluding the full filename and extension to the resolved file at "${path16.slice( - pkgPath.length - )}", imported from ${basePath}. - Automatic extension resolution of the "main" field isdeprecated for ES modules.`, - "DeprecationWarning", - "DEP0151" - ); - else - import_node_process2.default.emitWarning( - `No "main" or "exports" field defined in the package.json for ${pkgPath} resolving the main entry point "${path16.slice( - pkgPath.length - )}", imported from ${basePath}. -Default "index" lookups for the main are deprecated for ES modules.`, - "DeprecationWarning", - "DEP0151" - ); +var emptyRepository = Object.freeze(/* @__PURE__ */ Object.create(null)); +function normalizePatternRepository(rep) { + if (!rep) + return emptyRepository; + return normalizeRepository(rep); } -function tryStatSync(path16) { - try { - return (0, import_node_fs2.statSync)(path16); - } catch { - return new import_node_fs2.Stats(); +function normalizeRepository(rep) { + const repository2 = /* @__PURE__ */ Object.create(null); + for (const [key, pat] of Object.entries(rep)) { + repository2[key] = nPattern(pat); } + return repository2; } -function fileExists(url) { - const stats = (0, import_node_fs2.statSync)(url, { throwIfNoEntry: false }); - const isFile = stats ? stats.isFile() : void 0; - return isFile === null || isFile === void 0 ? false : isFile; +var ruleCounter = 0; +function factoryRuleBase(parent, pattern, repository2, grammar2, findNext, end) { + const depth = parent ? parent.depth + 1 : 0; + return { + id: ruleCounter++, + grammar: grammar2, + pattern, + parent, + repository: repository2, + depth, + findNext, + end + }; } -function legacyMainResolve(packageJsonUrl, packageConfig, base) { - let guess; - if (packageConfig.main !== void 0) { - guess = new import_node_url3.URL(packageConfig.main, packageJsonUrl); - if (fileExists(guess)) - return guess; - const tries2 = [ - `./${packageConfig.main}.js`, - `./${packageConfig.main}.json`, - `./${packageConfig.main}.node`, - `./${packageConfig.main}/index.js`, - `./${packageConfig.main}/index.json`, - `./${packageConfig.main}/index.node` - ]; - let i2 = -1; - while (++i2 < tries2.length) { - guess = new import_node_url3.URL(tries2[i2], packageJsonUrl); - if (fileExists(guess)) - break; - guess = void 0; - } - if (guess) { - emitLegacyIndexDeprecation( - guess, - packageJsonUrl, - base, - packageConfig.main - ); - return guess; +function factoryRule(parent, pattern, findNext, end) { + return factoryRuleBase(parent, pattern, parent.repository, parent.grammar, findNext, end); +} +function normalizeCapture(cap) { + if (cap === void 0) + return void 0; + if (typeof cap === "string") + return { [0]: cap }; + const capture = /* @__PURE__ */ Object.create(null); + for (const [key, pat] of Object.entries(cap)) { + capture[key] = typeof pat === "string" ? pat : normalizePatternName(pat).name; + } + return capture; +} +function makeTestMatchFn(reg) { + if (typeof reg === "string") + return matchString(reg); + return matchRegExp(reg); +} +function matchString(s) { + return (line) => { + const input = line.text; + const index = input.indexOf(s, line.offset); + if (index < 0) + return void 0; + return createSimpleMatchResult(s, input, index, line.lineNumber); + }; +} +function matchRegExp(r) { + return (line) => { + const rg = RegExp(r, "gm"); + rg.lastIndex = line.offset; + const m = rg.exec(line.text); + return (m && createMatchResult(m, line.lineNumber)) ?? void 0; + }; +} +function extractScope(er, isContent = true) { + const scope = []; + for (let rule = er; rule; rule = rule.parent) { + const pattern = rule.pattern; + const { name, contentName } = pattern; + if (contentName && isContent) { + scope.push(contentName); + } + if (name !== void 0) { + scope.push(name); + } + isContent = true; + } + return er.grammar.scopePool.parseScope(scope); +} +var ImplNGrammar = class { + constructor(grammar2) { + this.scopeName = grammar2.scopeName; + this.name = grammar2.scopeName; + this.comment = grammar2.comment; + this.disabled = grammar2.disabled; + this.grammarName = grammar2.name; + const self = nPattern({ + patterns: [{ patterns: grammar2.patterns }] + }); + const repository2 = normalizePatternRepository(grammar2.repository); + this.patterns = self.patterns; + this.repository = repository2; + this.self = self; + this.scopePool = new ScopePool(); + } + begin(parentRule) { + const patterns = this.patterns; + function grammarToRule(grammar2, baseGrammar, parent) { + const repository2 = /* @__PURE__ */ Object.create(null); + Object.assign(repository2, grammar2.repository); + repository2["$self"] = grammar2.self; + repository2["$base"] = repository2["$base"] || baseGrammar.self; + function findNext(line) { + return findInPatterns(patterns, line, this); + } + function end(_line) { + return void 0; + } + return factoryRuleBase(parent, grammar2, repository2, grammar2, findNext, end); } + return grammarToRule(this, parentRule?.grammar ?? this, parentRule); } - const tries = ["./index.js", "./index.json", "./index.node"]; - let i = -1; - while (++i < tries.length) { - guess = new import_node_url3.URL(tries[i], packageJsonUrl); - if (fileExists(guess)) - break; - guess = void 0; +}; +var ImplNPatternPatterns = class { + constructor(p) { + const { name, comment, disabled, ...rest } = p; + this.patterns = normalizePatterns(rest.patterns); + this.name = name; + this.comment = comment; + this.disabled = disabled; + } + findMatch(line, parentRule) { + const patterns = this.patterns; + const rule = factoryRule(parentRule, this, findNext); + function findNext(line2) { + return findInPatterns(patterns, line2, this); + } + return rule.findNext?.(line); } - if (guess) { - emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main); - return guess; +}; + +// node_modules/cspell-grammar/dist/parser/grammar.js +function compileGrammar(grammar2) { + return normalizeGrammar(grammar2); +} + +// node_modules/cspell-grammar/dist/parser/tokenizeLine.js +var import_assert10 = __toESM(require("assert"), 1); + +// node_modules/cspell-grammar/dist/parser/util.js +function isDefined4(t) { + return t !== void 0 && t !== null; +} + +// node_modules/cspell-grammar/dist/parser/processors/procMatchingRule.js +function applyCaptureToBeginOrMatch(matchRuleResult) { + const { match: match2, rule } = matchRuleResult; + const bePattern = rule.pattern; + const captures = bePattern.beginCaptures ?? bePattern.captures; + return applyCaptures(rule, match2, captures); +} +function applyCaptureToEnd(rule, match2) { + const { pattern } = rule; + const bePattern = pattern; + const captures = bePattern.endCaptures ?? bePattern.captures; + return applyCaptures(rule, match2, captures); +} +function applyCaptures(rule, match2, captures) { + const scope = extractScope(rule, false); + const pool2 = rule.grammar.scopePool; + const text = match2.match; + const input = match2.input; + const range = [match2.index, match2.index + text.length, match2.lineNumber]; + if (!text && !captures) + return []; + if (!captures) { + const tokenized = { + scope, + text, + range + }; + return [tokenized]; } - throw new ERR_MODULE_NOT_FOUND( - (0, import_node_url3.fileURLToPath)(new import_node_url3.URL(".", packageJsonUrl)), - (0, import_node_url3.fileURLToPath)(base) - ); -} -function finalizeResolution(resolved, base, preserveSymlinks) { - if (encodedSepRegEx.exec(resolved.pathname) !== null) - throw new ERR_INVALID_MODULE_SPECIFIER( - resolved.pathname, - 'must not include encoded "/" or "\\" characters', - (0, import_node_url3.fileURLToPath)(base) - ); - const filePath = (0, import_node_url3.fileURLToPath)(resolved); - const stats = tryStatSync( - filePath.endsWith("/") ? filePath.slice(-1) : filePath - ); - if (stats.isDirectory()) { - const error2 = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, (0, import_node_url3.fileURLToPath)(base)); - error2.url = String(resolved); - throw error2; + const captureScopes = new Map(Object.entries(captures)); + const cap0 = captureScopes.get("0"); + if (captureScopes.size === 1 && cap0) { + const tokenized = { + scope: rule.grammar.scopePool.getScope(cap0, scope), + text, + range + }; + return [tokenized]; + } + const min3 = match2.index; + const max4 = match2.index + text.length; + function trimSegment(seg) { + const { index, match: match3 } = seg; + const right = match3.length; + if (index >= min3 && right <= max4) + return seg; + if (index >= max4 || right < min3) + return void 0; + const a = Math.max(index, min3) - index; + const b = Math.min(right, max4) - index; + const text2 = match3.slice(a, b); + return { + ...seg, + index: index + a, + match: text2 + }; + } + const segments = segmentMatch(match2).map(trimSegment).filter(isDefined4); + function processSegments(segments2) { + const base = segments2[0]; + const root = { + a: base.index, + b: base.index + base.match.length, + s: { seg: base } + }; + let m; + for (let i = 1; i < segments2.length; ++i) { + const seg = segments2[i]; + const index = seg.index; + const end = index + seg.match.length; + m = m && m.a <= index ? m : root; + while (m && m.b <= index) { + m = m.n; + } + while (m && m.a < end) { + if (m.a < index) { + const n = { ...m, a: index }; + m.n = n; + m.b = index; + m = n; + } + if (m.b > end) { + const n = { ...m, a: end }; + m.b = end; + m.n = n; + } + m.s = { seg, next: m.s }; + m = m.n; + } + } + return root; + } + function segChainToScope(chain) { + function* _chain(chain2) { + while (chain2) { + const seg = chain2.seg; + if (seg.groupName) { + if (Array.isArray(seg.groupName)) { + yield* seg.groupName; + } else { + yield seg.groupName; + } + } + yield seg.groupNum.toString(); + chain2 = chain2.next; + } + } + const scopeValues = [..._chain(chain)].map((cap) => captureScopes.get(cap)).filter(isDefined4).reverse(); + return scopeValues.reduce((s, v) => pool2.getScope(v, s), scope); } - if (!stats.isFile()) { - throw new ERR_MODULE_NOT_FOUND( - filePath || resolved.pathname, - base && (0, import_node_url3.fileURLToPath)(base), - "module" - ); + const merged = processSegments(segments); + function* emit(m) { + while (m) { + const t = { + text: input.slice(m.a, m.b), + range: [m.a, m.b, match2.lineNumber], + scope: segChainToScope(m.s) + }; + yield t; + m = m.n; + } } - if (!preserveSymlinks) { - const real = (0, import_node_fs2.realpathSync)(filePath); - const { search, hash } = resolved; - resolved = (0, import_node_url3.pathToFileURL)(real + (filePath.endsWith(import_node_path3.default.sep) ? "/" : "")); - resolved.search = search; - resolved.hash = hash; + const parsedText = [...emit(merged)]; + return parsedText; +} + +// node_modules/cspell-grammar/dist/parser/tokenizeLine.js +function tokenizeLine(line, rule) { + const text = line.text; + const lineLen = line.text.length; + const parsedText = []; + let ctx = buildContext({ ...line, offset: 0, anchor: -1 }, rule); + while (ctx.line.offset <= lineLen) { + let endMatch = ctx.rule.end?.(ctx.line); + while (endMatch?.index === ctx.line.offset) { + parsedText.push(...applyCaptureToEnd(ctx.rule, endMatch)); + ctx = findParentWithEnd(ctx); + ctx.line.offset = endMatch.index + endMatch.match.length; + endMatch = ctx.rule.end?.(ctx.line); + } + if (ctx.line.offset >= lineLen) + break; + const { line: line2, rule: rule2 } = ctx; + const offset = line2.offset; + const match2 = rule2.findNext?.(line2); + const limit = endMatch?.index ?? lineLen; + const emitTil = match2 ? Math.min(match2.match.index, limit) : limit; + if (offset < emitTil) { + const scope = extractScope(rule2); + const start = offset; + const end = emitTil; + parsedText.push({ + scope, + text: text.slice(start, end), + range: [start, end, line2.lineNumber] + }); + ctx.line.offset = emitTil; + } + if (!match2 || endMatch && endMatch.index <= match2.match.index) { + continue; + } + parsedText.push(...applyCaptureToBeginOrMatch(match2)); + line2.anchor = match2.match.index + match2.match.match.length; + line2.offset = line2.anchor; + ctx = findNearestWithEnd(buildContext(line2, match2.rule)); } - return resolved; + return toParseLineResult(line, ctx.rule, parsedText); } -function importNotDefined(specifier, packageJsonUrl, base) { - return new ERR_PACKAGE_IMPORT_NOT_DEFINED( - specifier, - packageJsonUrl && (0, import_node_url3.fileURLToPath)(new import_node_url3.URL(".", packageJsonUrl)), - (0, import_node_url3.fileURLToPath)(base) - ); +function* tokenizeTextIterable(text, grammar2) { + const lines = text.split(/(?<=\r\n|\n|\r(?!\n))/); + const rule = grammar2.begin(); + let documentOffset = 0; + let tr = tokenizeLine({ text: lines[0], lineNumber: 0, documentOffset }, rule); + documentOffset += lines[0].length; + yield toParsedLine(tr); + for (let i = 1; i < lines.length; ++i) { + const line = { text: lines[i], lineNumber: i, documentOffset }; + documentOffset += line.text.length; + tr = tr.parse(line); + yield toParsedLine(tr); + } } -function exportsNotFound(subpath, packageJsonUrl, base) { - return new ERR_PACKAGE_PATH_NOT_EXPORTED( - (0, import_node_url3.fileURLToPath)(new import_node_url3.URL(".", packageJsonUrl)), - subpath, - base && (0, import_node_url3.fileURLToPath)(base) - ); +function toParsedLine(pr) { + const { tokens: parsedText, line, offset } = pr; + return { tokens: parsedText, line, offset }; } -function throwInvalidSubpath(request, match, packageJsonUrl, internal, base) { - const reason = `request is not a valid match in pattern "${match}" for the "${internal ? "imports" : "exports"}" resolution of ${(0, import_node_url3.fileURLToPath)(packageJsonUrl)}`; - throw new ERR_INVALID_MODULE_SPECIFIER( - request, - reason, - base && (0, import_node_url3.fileURLToPath)(base) - ); +function toParseLineResult(line, rule, parsedText) { + return { + tokens: parsedText, + line, + offset: line.documentOffset, + parse: (line2) => tokenizeLine(line2, rule) + }; } -function invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) { - target = typeof target === "object" && target !== null ? JSON.stringify(target, null, "") : `${target}`; - return new ERR_INVALID_PACKAGE_TARGET( - (0, import_node_url3.fileURLToPath)(new import_node_url3.URL(".", packageJsonUrl)), - subpath, - target, - internal, - base && (0, import_node_url3.fileURLToPath)(base) - ); +function buildContext(line, rule) { + const rules = calcRuleStack(rule); + const numRules = rules.length; + const rootNum = numRules - 1; + const rootRule = rules[rootNum]; + const rootContext = { + line, + rule: rootRule + }; + let ctx = rootContext; + for (let i = rootNum - 1; i >= 0; --i) { + const rule2 = rules[i]; + const line2 = ctx.line; + ctx = { + line: line2, + rule: rule2, + parent: ctx + }; + } + return ctx; +} +function calcRuleStack(rule) { + const rules = []; + let r = rule; + while (r) { + rules.push(r); + r = r.parent; + } + return rules; +} +function must(t, msg = "Must be defined") { + (0, import_assert10.default)(t !== void 0 && t !== null, msg); + return t; +} +function findParentWithEnd(ctx) { + return findNearestWithEnd(must(ctx.parent)); +} +function findNearestWithEnd(ctx) { + while (!ctx.rule.end) { + ctx = must(ctx.parent); + } + return ctx; +} + +// node_modules/cspell-grammar/dist/grammars/typescript.js +var repository = { + statements: { + name: "code.ts", + patterns: [ + "#keyword", + "#regexp", + "#string", + "#comment", + "#braces", + "#punctuation", + "#space", + { name: "identifier", match: /[^\s;,!|&:^%{}[\]()*/+=<>]+/ } + ] + }, + keyword: { + patterns: ["#keywordBase", "#standardTypes", "#standardLib"] + }, + keywordBase: { + name: "keyword.typescript.ts", + match: /\b(?:any|as|async|await|bigint|boolean|break|case|catch|const|continue|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|in|instanceof|interface|import|let|map|module|new|new|null|number|of|package|private|public|require|return|set|static|string|super|switch|this|throw|true|try|type|typeof|unknown|undefined|var|void|while|yield)\b/ + }, + standardTypes: { + name: "keyword.type.ts", + match: /\b(?:Promise|Record|Omit|Extract|Exclude|BigInt|Array)\b/ + }, + standardLib: { + name: "keyword.lib.ts", + match: /\b(?:console|process|window)\b/ + }, + string: { + patterns: ["#string_q_single", "#string_q_double", "#string_template"] + }, + string_q_single: { + name: "string.quoted.single.ts", + begin: "'", + end: /'|((?:[^\\\n])$)/, + captures: "punctuation.string.ts", + patterns: [{ include: "#string_character_escape" }] + }, + string_q_double: { + name: "string.quoted.double.ts", + begin: '"', + end: /"|((?:[^\\\n])$)/, + captures: "punctuation.string.ts", + patterns: [{ include: "#string_character_escape" }] + }, + string_template: { + name: "string.template.ts", + begin: "`", + end: "`", + captures: "punctuation.string.ts", + patterns: [ + { + name: "meta.template.expression.ts", + contentName: "meta.embedded.line.ts", + begin: "${", + end: "}", + patterns: ["#statements"], + captures: "punctuation.definition.template.expression.ts" + }, + { include: "#string_character_escape" } + ] + }, + string_character_escape: { + name: "constant.character.escape.ts", + match: /\\(x[0-9A-Fa-f]{2}|[0-3][0-7]{0,2}|[4-7][0-7]?|u[0-9A-Fa-f]{4}|.|\r?\n?$)/ + }, + braces: { + patterns: [ + { + begin: "(", + end: ")", + captures: "punctuation.meta.brace.ts", + patterns: ["#statements"], + name: "meta.brace.ts", + contentName: "code.ts" + }, + { + begin: "{", + end: "}", + captures: "punctuation.meta.brace.ts", + patterns: ["#statements"], + name: "meta.brace.ts", + contentName: "code.ts" + }, + { + begin: "[", + end: "]", + captures: "punctuation.meta.brace.ts", + patterns: ["#statements"], + name: "meta.brace.ts", + contentName: "code.ts" + } + ] + }, + punctuation: { + name: "punctuation.ts", + match: /[-;:,!|&^%*/+=<>\n\r]/ + }, + space: { + name: "punctuation.space.ts", + match: /\s+/ + }, + comment: { + patterns: [ + { + name: "comment.line.ts", + comment: "line comment", + begin: "//", + end: /(?=$)/, + captures: "punctuation.definition.comment.ts" + }, + { + name: "comment.block.documentation.ts", + comment: "DocBlock", + begin: /\/\*\*(?!\/)/, + captures: "punctuation.definition.comment.ts", + end: "*/" + }, + { + name: "comment.block.ts", + begin: "/*", + end: "*/", + captures: "punctuation.definition.comment.ts" + } + ] + }, + regexp: { + name: "regexp.ts", + begin: /\/(?![/*])/, + end: /\/([a-z]*)/i, + beginCaptures: "punctuation.begin.regexp.ts", + endCaptures: "punctuation.end.regexp.ts", + patterns: ["#regexp_escape", "#regexp_brace"] + }, + regexp_escape: { + name: "escape.regexp.ts", + match: /\\./ + }, + regexp_brace: { + name: "brace.regexp.ts", + begin: "[", + end: "]", + contentName: "character-class.regexp.ts", + patterns: ["#regexp_escape"] + } +}; +var grammar = { + name: "TypeScript", + scopeName: "source.ts", + patterns: [ + { + name: "comment.line.shebang.ts", + match: /^#!.*(?=$)/ + }, + { + include: "#statements" + } + ], + repository +}; + +// node_modules/cspell-grammar/dist/mappers/appendMappedText.js +var import_assert11 = __toESM(require("assert"), 1); +function appendMappedText(a, b) { + if (!a.map && !b.map) { + return { text: a.text + b.text }; + } + const aLen = a.text.length; + const bLen = b.text.length; + const aMap = [0, 0].concat(a.map || [0, 0, aLen, aLen]); + const bMap = [0, 0].concat(b.map || [0, 0, bLen, bLen]); + (0, import_assert11.default)(aMap[aMap.length - 1] === aLen); + (0, import_assert11.default)(bMap[bMap.length - 1] === bLen); + (0, import_assert11.default)((aMap.length & 1) === 0); + (0, import_assert11.default)((bMap.length & 1) === 0); + return { + text: a.text + b.text, + map: joinMaps(aMap, bMap) + }; } -function resolvePackageTargetString(target, subpath, match, packageJsonUrl, base, pattern, internal, isPathMap, conditions) { - if (subpath !== "" && !pattern && target[target.length - 1] !== "/") - throw invalidPackageTarget(match, target, packageJsonUrl, internal, base); - if (!target.startsWith("./")) { - if (internal && !target.startsWith("../") && !target.startsWith("/")) { - let isURL = false; - try { - new import_node_url3.URL(target); - isURL = true; - } catch { +function joinMaps(aMap, bMap) { + const n = aMap.length - 1; + const offsets = [aMap[n - 1], aMap[n]]; + const ab = aMap.concat(bMap.map((v, i) => v + offsets[i & 1])); + const r = [0, 0]; + let last0 = 0, last1 = 0; + for (let i = 0; i < ab.length; i += 2) { + const v0 = ab[i]; + const v12 = ab[i + 1]; + if (v0 === last0 && v12 === last1) { + continue; + } + r.push(v0, v12); + last0 = v0; + last1 = v12; + } + return r; +} + +// node_modules/cspell-grammar/dist/mappers/typescript.js +var hexChars = { + "0": 0, + "1": 1, + "2": 2, + "3": 3, + "4": 4, + "5": 5, + "6": 6, + "7": 7, + "8": 8, + "9": 9, + A: 10, + B: 11, + C: 12, + D: 13, + E: 14, + F: 15, + a: 10, + b: 11, + c: 12, + d: 13, + e: 14, + f: 15 +}; +var escapeChars = { + t: " ", + n: "\n", + r: "\r", + b: "\b", + "\\": "\\", + '"': '"', + "'": "'", + "\n": "" +}; +function mapRawString(text) { + const end = text.length; + let t = ""; + const map3 = []; + const isHex = /^[0-9a-fA-F]+$/; + let i, j; + for (i = 0, j = 0; i < end; ++i) { + let parsed; + const ti = text[i]; + if (ti === "\\") { + map3.push(i, j); + const tc = text[++i]; + const ec = escapeChars[tc]; + if (ec) { + t += ec; + j += ec.length; + map3.push(i, j); + continue; } - if (!isURL) { - const exportTarget = pattern ? RegExpPrototypeSymbolReplace.call( - patternRegEx, - target, - () => subpath - ) : target + subpath; - return packageResolve(exportTarget, packageJsonUrl, conditions); + switch (tc) { + case "u": + { + let char; + let end2; + if (text[i + 1] !== "{") { + const digits = text.slice(i + 1, i + 5); + parsed = isHex.test(digits) ? parseInt(digits, 16) : NaN; + char = isNaN(parsed) ? "" : String.fromCharCode(parsed); + end2 = i + 4; + } else { + for (end2 = i + 2; text[end2] in hexChars; ++end2) { + } + if (text[end2] !== "}") { + char = ""; + } else { + const digits = text.slice(i + 2, end2); + parsed = isHex.test(digits) ? parseInt(digits, 16) : NaN; + char = isNaN(parsed) ? "" : String.fromCodePoint(parsed); + } + } + if (!char) { + t += tc; + j += 1; + } else { + t += char; + j += char.length; + i = end2; + } + } + break; + case "x": + { + const digits = text.slice(i + 1, i + 3); + parsed = isHex.test(digits) ? parseInt(digits, 16) : NaN; + if (isNaN(parsed)) { + t += tc; + j += 1; + } else { + t += String.fromCharCode(parsed); + i += 2; + ++j; + } + } + break; + case "0": + t += "0"; + j += 1; + break; + case "\r": + i += text[i + 1] === "\n" ? 1 : 0; + break; + case "\n": + break; + case void 0: + break; + default: + t += tc; + ++j; + break; } + map3.push(i + 1, j); + continue; } - throw invalidPackageTarget(match, target, packageJsonUrl, internal, base); + t += ti; + ++j; } - if (invalidSegmentRegEx.exec(target.slice(2)) !== null) { - if (deprecatedInvalidSegmentRegEx.exec(target.slice(2)) === null) { - if (!isPathMap) { - const request = pattern ? match.replace("*", () => subpath) : match + subpath; - const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call( - patternRegEx, - target, - () => subpath - ) : target; - emitInvalidSegmentDeprecation( - resolvedTarget, - request, - match, - packageJsonUrl, - internal, - base, - true - ); - } - } else { - throw invalidPackageTarget(match, target, packageJsonUrl, internal, base); + if (map3.length) { + const ii = map3[map3.length - 2]; + const jj = map3[map3.length - 1]; + if (ii !== i || jj !== j) { + map3.push(i, j); } } - const resolved = new import_node_url3.URL(target, packageJsonUrl); - const resolvedPath = resolved.pathname; - const packagePath = new import_node_url3.URL(".", packageJsonUrl).pathname; - if (!resolvedPath.startsWith(packagePath)) - throw invalidPackageTarget(match, target, packageJsonUrl, internal, base); - if (subpath === "") - return resolved; - if (invalidSegmentRegEx.exec(subpath) !== null) { - const request = pattern ? match.replace("*", () => subpath) : match + subpath; - if (deprecatedInvalidSegmentRegEx.exec(subpath) === null) { - if (!isPathMap) { - const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call( - patternRegEx, - target, - () => subpath - ) : target; - emitInvalidSegmentDeprecation( - resolvedTarget, - request, - match, - packageJsonUrl, - internal, - base, - false - ); - } - } else { - throwInvalidSubpath(request, match, packageJsonUrl, internal, base); + return { + text: t, + map: map3 + }; +} + +// node_modules/cspell-grammar/dist/parser/parser.js +function mapTokenizedLine(tl) { + return tl.tokens.map((t) => ({ + text: t.text, + range: [tl.offset + t.range[0], tl.offset + t.range[1]], + scope: t.scope + })); +} +function mapTokenizedLines(itl) { + return pipeSync(itl, opMapSync(mapTokenizedLine), opFlattenSync()); +} +function createParser(grammar2, name, transform2 = mapTokenizedLines) { + function parse4(content, filename) { + const parsedTexts = pipeSync(tokenizeTextIterable(content, grammar2), transform2); + return { content, filename, parsedTexts }; + } + return { name, parse: parse4 }; +} + +// node_modules/cspell-grammar/dist/parsers/typescript/TypeScriptParser.js +var tsGrammar = compileGrammar(grammar); +var pool = new ScopePool(); +var useScope = /* @__PURE__ */ new WeakMap(); +function* transform(texts) { + for (const parsed of texts) { + if (doesScopeMatch(parsed.scope, "constant.character.escape.ts")) { + const mapped = mapRawString(parsed.text); + const scope = parsed.scope ? pool.parseScope(parsed.scope) : void 0; + yield { + text: mapped.text, + scope: scope?.parent, + map: mapped.map, + range: parsed.range + }; + continue; } + yield parsed; } - if (pattern) { - return new import_node_url3.URL( - RegExpPrototypeSymbolReplace.call( - patternRegEx, - resolved.href, - () => subpath - ) - ); +} +function* mergeStringResults(results) { + let last; + for (const next of results) { + if (!doesScopeMatch(next.scope, "string.")) { + if (last) { + yield last; + last = void 0; + } + yield next; + continue; + } + if (!last) { + last = next; + continue; + } + if (next.scope !== last.scope || last.range[1] !== next.range[0]) { + yield last; + last = next; + continue; + } + last = mergeParsedText(last, next); } - return new import_node_url3.URL(subpath, resolved); + if (last) + yield last; } -function isArrayIndex(key) { - const keyNumber = Number(key); - if (`${keyNumber}` !== key) +function mergeParsedText(a, b) { + const abT = appendMappedText(a, b); + const ab = { + text: abT.text, + scope: a.scope, + range: [a.range[0], b.range[1]], + map: abT.map, + delegate: a.delegate + }; + return ab; +} +function filterScope(scope) { + const cached = useScope.get(scope); + if (cached !== void 0) + return cached; + const value = scope.value; + const use = !value.startsWith("punctuation") && !value.startsWith("keyword."); + useScope.set(scope, use); + return use; +} +function mapTokenizedLine2(tl) { + return tl.tokens.filter((t) => filterScope(t.scope)).map((t) => ({ + text: t.text, + range: [tl.offset + t.range[0], tl.offset + t.range[1]], + scope: t.scope + })); +} +function mapTokenizedLines2(itl) { + return pipeSync(itl, opMapSync(mapTokenizedLine2), opFlattenSync(), transform, mergeStringResults); +} +var parser = createParser(tsGrammar, "typescript", mapTokenizedLines2); +function doesScopeMatch(s, match2) { + if (!s) return false; - return keyNumber >= 0 && keyNumber < 4294967295; + return typeof s === "string" ? s.startsWith(match2) : s.value.startsWith(match2); } -function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions) { - if (typeof target === "string") { - return resolvePackageTargetString( - target, - subpath, - packageSubpath, - packageJsonUrl, - base, - pattern, - internal, - isPathMap, - conditions - ); + +// node_modules/cspell-grammar/dist/parsers/index.js +var parsers2 = [parser]; + +// node_modules/cspell-lib/dist/esm/Settings/DefaultSettings.mjs +var import_lib_cjs = __toESM(require_lib_cjs(), 1); + +// node_modules/cspell-lib/dist/esm/Models/PatternRegExp.mjs +var PatternRegExp = class extends RegExp { + constructor(pattern) { + super(pattern); } - if (Array.isArray(target)) { - const targetList = target; - if (targetList.length === 0) - return null; - let lastException; - let i = -1; - while (++i < targetList.length) { - const targetItem = targetList[i]; - let resolveResult; - try { - resolveResult = resolvePackageTarget( - packageJsonUrl, - targetItem, - subpath, - packageSubpath, - base, - pattern, - internal, - isPathMap, - conditions - ); - } catch (error2) { - const exception = ( - /** @type {ErrnoException} */ - error2 - ); - lastException = exception; - if (exception.code === "ERR_INVALID_PACKAGE_TARGET") - continue; - throw error2; - } - if (resolveResult === void 0) - continue; - if (resolveResult === null) { - lastException = null; - continue; + toJSON() { + return this.toString(); + } +}; + +// node_modules/cspell-lib/dist/esm/Settings/LanguageSettings.mjs +var defaultLocale = "en"; +var defaultLanguageSettings = []; +function getDefaultLanguageSettings() { + return defaultLanguageSettings; +} +function localesToList(locales) { + return stringToList(locales.replace(/\s+/g, ",")); +} +function stringToList(sList) { + return sList.replace(/[|;]/g, ",").split(",").map((s) => s.trim()).filter((s) => !!s); +} +function memorizer(resolver) { + const cache2 = createAutoResolveCache(); + return (k) => cache2.get(k, resolver); +} +var _normalizeLanguageId = memorizer(__normalizeLanguageId); +function __normalizeLanguageId(langId) { + const langIds = stringToList(langId); + return new Set(langIds.map((a) => a.toLowerCase())); +} +function normalizeLanguageId(langId) { + return _normalizeLanguageId(typeof langId === "string" ? langId : langId.join(",")); +} +var _normalizeLocale = memorizer(__normalizeLocale); +function __normalizeLocale(locale) { + const locales = localesToList(locale); + return new Set(locales.map((locale2) => locale2.toLowerCase().replace(/[^a-z]/g, ""))); +} +function normalizeLocale2(locale) { + locale = typeof locale === "string" ? locale : locale.join(","); + return _normalizeLocale(locale); +} +function normalizeLocaleIntl(locale) { + const values = [...normalizeLocale2(locale)].map((locale2) => locale2.replace(/^([a-z]{2})-?([a-z]{2})$/, (_, lang, locale3) => locale3 ? `${lang}-${locale3.toUpperCase()}` : lang)); + return new Set(values); +} +function isLocaleInSet(locale, setOfLocals) { + const locales = normalizeLocale2(locale); + return doSetsIntersect(locales, setOfLocals); +} +var regExpValidIntlLocaleStrict = /^[a-z]{2}(-[A-Z]{2})?$/; +var regExpValidIntlLocale = new RegExp(regExpValidIntlLocaleStrict, "i"); +function isValidLocaleIntlFormat(locale, strict = false) { + if (typeof locale === "string") + return strict ? regExpValidIntlLocaleStrict.test(locale) : regExpValidIntlLocale.test(locale); + for (const item of locale) { + if (!isValidLocaleIntlFormat(item, strict)) + return false; + } + return locale.length > 0; +} +var cacheCalcSettingsForLanguage = /* @__PURE__ */ new WeakMap(); +function calcSettingsForLanguage(languageSettings, languageId, locale) { + const mapLang = autoResolveWeak(cacheCalcSettingsForLanguage, languageSettings, () => /* @__PURE__ */ new Map()); + const mapLocale = autoResolve(mapLang, languageId, () => /* @__PURE__ */ new Map()); + return autoResolve(mapLocale, locale, () => _calcSettingsForLanguage(languageSettings, languageId, locale)); +} +function _calcSettingsForLanguage(languageSettings, languageId, locale) { + languageId = languageId.toLowerCase(); + const allowedLocals = normalizeLocale2(locale); + const ls = languageSettings.filter((s) => doesLanguageSettingMatchLanguageId(s, languageId)).filter((s) => !s.locale || s.locale === "*" || isLocaleInSet(s.locale, allowedLocals)).map((langSetting) => { + const { languageId: _languageId, locale: _locale, ...s } = langSetting; + return s; + }).reduce((langSetting, setting) => mergeSettings(langSetting, setting), {}); + ls.languageId = languageId; + ls.locale = locale; + return ls; +} +var cacheDoesLanguageSettingMatchLanguageId = /* @__PURE__ */ new WeakMap(); +function doesLanguageSettingMatchLanguageId(s, languageId) { + const r = cacheDoesLanguageSettingMatchLanguageId.get(s) ?? /* @__PURE__ */ new Map(); + const f = r.get(languageId); + if (f !== void 0) { + return f; + } + const v = _doesLanguageSettingMatchLanguageId(s, languageId); + r.set(languageId, v); + cacheDoesLanguageSettingMatchLanguageId.set(s, r); + return v; +} +function _doesLanguageSettingMatchLanguageId(s, languageId) { + const languageSettingsLanguageIds = s.languageId; + if (!languageSettingsLanguageIds || languageSettingsLanguageIds === "*") + return true; + const ids = normalizeLanguageId(languageSettingsLanguageIds); + if (ids.has(languageId)) + return true; + if (ids.has("!" + languageId)) + return false; + const numExcludes = [...ids].filter((id) => id.startsWith("!")).length; + return numExcludes === ids.size; +} +function calcUserSettingsForLanguage(settings, languageId) { + const { languageSettings = [], language: locale = defaultLocale, allowCompoundWords, enabled } = settings; + const langSettings = { + allowCompoundWords, + enabled, + ...calcSettingsForLanguage(languageSettings, languageId, locale) + }; + return mergeSettings(settings, langSettings); +} +function calcSettingsForLanguageId(baseSettings, languageId) { + const langIds = ["*", ...normalizeLanguageId(languageId)]; + const langSettings = langIds.reduce((settings, languageId2) => { + return calcUserSettingsForLanguage(settings, languageId2); + }, baseSettings); + return langSettings; +} + +// node_modules/cspell-lib/dist/esm/Settings/RegExpPatterns.mjs +var regExMatchUrls = /(?:https?|ftp):\/\/[^\s"]+/gi; +var regExHRef = /\bhref\s*=\s*".*?"/gi; +var regExMatchCommonHexFormats = /(?:#[0-9a-f]{3,8})|(?:0x[0-9a-f]+)|(?:\\u[0-9a-f]{4})|(?:\\x\{[0-9a-f]{4}\})/gi; +var regExCommitHash = /\b(?![a-f]+\b)(?:0x)?[0-9a-f]{7,}\b/gi; +var regExCommitHashLink = /\[[0-9a-f]{7,}\]/gi; +var regExCStyleHexValue = /\b0x[0-9a-f]+\b/gi; +var regExCSSHexValue = /#[0-9a-f]{3,8}\b/gi; +var regExUUID = /\b[0-9a-fx]{8}-[0-9a-fx]{4}-[0-9a-fx]{4}-[0-9a-fx]{4}-[0-9a-fx]{12}\b/gi; +var regExUnicodeRef = /\bU\+[0-9a-f]{4,5}(?:-[0-9a-f]{4,5})?/gi; +var regExSpellingGuardBlock = /(\bc?spell(?:-?checker)?::?)\s*disable(?!-line|-next)\b(?!-)[\s\S]*?((?:\1\s*enable\b)|$)/gi; +var regExSpellingGuardNext = /\bc?spell(?:-?checker)?::?\s*disable-next\b.*\s\s?.*/gi; +var regExSpellingGuardLine = /^.*\bc?spell(?:-?checker)?::?\s*disable-line\b.*/gim; +var regExIgnoreSpellingDirectives = /\bc?spell(?:-?checker)?::?\s*ignoreRegExp.*/gim; +var regExPublicKey = /-{5}BEGIN\s+((?:RSA\s+)?PUBLIC\s+KEY)[\w=+\-/=\\\s]+?END\s+\1-{5}/g; +var regExCert = /-{5}BEGIN\s+(CERTIFICATE|(?:RSA\s+)?(?:PRIVATE|PUBLIC)\s+KEY)[\w=+\-/=\\\s]+?END\s+\1-{5}/g; +var regExSshRSA = /ssh-rsa\s+[a-z0-9/+]{28,}={0,3}(?![a-z0-9/+=])/gi; +var regExEscapeCharacters2 = /\\(?:[anrvtbf]|[xu][a-f0-9]+)/gi; +var regExBase64 = /(??/gi; +var regExRepeatedChar = /^(\w)\1{3,}$/i; +var regExSha = /\bsha\d+-[a-z0-9+/]{25,}={0,3}/gi; +var regExHashStrings = /(?:\b(?:sha\d+|md5|base64|crypt|bcrypt|scrypt|security-token|assertion)[-,:$=]|#code[/])[-\w/+%.]{25,}={0,3}(?:(['"])\s*\+?\s*\1?[-\w/+%.]+={0,3})*(?![-\w/+=%.])/gi; + +// node_modules/cspell-lib/dist/esm/Settings/DefaultSettings.mjs +var defaultConfigFileModuleRef = "@cspell/cspell-bundled-dicts/cspell-default.json"; +var defaultConfigFile = resolveConfigModule(defaultConfigFileModuleRef); +var regExpSpellCheckerDisable = [ + new PatternRegExp(regExSpellingGuardBlock), + new PatternRegExp(regExSpellingGuardLine), + new PatternRegExp(regExSpellingGuardNext) +]; +var predefinedPatterns = [ + // Exclude patterns + { name: "CommitHash", pattern: regExCommitHash }, + { name: "CommitHashLink", pattern: regExCommitHashLink }, + { name: "CStyleHexValue", pattern: regExCStyleHexValue }, + { name: "CSSHexValue", pattern: regExCSSHexValue }, + { name: "Urls", pattern: regExMatchUrls }, + { name: "HexValues", pattern: regExMatchCommonHexFormats }, + { name: "SpellCheckerDisable", pattern: regExpSpellCheckerDisable }, + { name: "PublicKey", pattern: regExPublicKey }, + { name: "RsaCert", pattern: regExCert }, + { name: "SshRsa", pattern: regExSshRSA }, + { name: "EscapeCharacters", pattern: regExEscapeCharacters2 }, + { name: "Base64", pattern: regExBase64 }, + { name: "Base64SingleLine", pattern: regExBase64SingleLine }, + { name: "Base64MultiLine", pattern: regExBase64MultiLine }, + { name: "Email", pattern: regExEmail }, + { name: "SHA", pattern: regExSha }, + { name: "HashStrings", pattern: regExHashStrings }, + { name: "UnicodeRef", pattern: regExUnicodeRef }, + { name: "UUID", pattern: regExUUID }, + { name: "href", pattern: regExHRef }, + { name: "SpellCheckerDisableBlock", pattern: regExSpellingGuardBlock }, + { name: "SpellCheckerDisableLine", pattern: regExSpellingGuardLine }, + { name: "SpellCheckerDisableNext", pattern: regExSpellingGuardNext }, + { name: "SpellCheckerIgnoreInDocSetting", pattern: regExIgnoreSpellingDirectives }, + // Include Patterns + { name: "PhpHereDoc", pattern: regExPhpHereDoc }, + { name: "string", pattern: regExString }, + { name: "CStyleComment", pattern: regExCStyleComments }, + { name: "Everything", pattern: ".*" } +]; +var defaultRegExpPatterns = [...predefinedPatterns].map(normalizePattern2); +var definedDefaultRegExpExcludeList = [ + "SpellCheckerDisable", + "SpellCheckerIgnoreInDocSetting", + "Urls", + "Email", + "RsaCert", + "SshRsa", + "Base64MultiLine", + "Base64SingleLine", + "CommitHash", + "CommitHashLink", + "CStyleHexValue", + "CSSHexValue", + "SHA", + "HashStrings", + "UnicodeRef", + "UUID" +]; +var defaultRegExpExcludeList = definedDefaultRegExpExcludeList; +var _defaultSettingsBasis = Object.freeze(createCSpellSettingsInternal({ + id: "static_defaults", + language: "en", + name: "Static Defaults", + enabled: true, + enabledLanguageIds: [], + maxNumberOfProblems: 100, + numSuggestions: 10, + suggestionsTimeout: 500, + suggestionNumChanges: 3, + words: [], + userWords: [], + ignorePaths: [], + allowCompoundWords: false, + patterns: defaultRegExpPatterns, + ignoreRegExpList: [], + languageSettings: [], + source: { name: "defaultSettings" }, + reporters: [], + plugins: [{ parsers: parsers2 }] +})); +var _defaultSettings = Object.freeze(createCSpellSettingsInternal({ + ..._defaultSettingsBasis, + enabledLanguageIds: [ + "ada", + "csharp", + "go", + "javascript", + "javascriptreact", + "json", + "markdown", + "mdx", + "php", + "plaintext", + "python", + "text", + "typescript", + "typescriptreact", + "haskell", + "html", + "css", + "less", + "scss", + "latex", + "ruby", + "rust", + "shellscript", + "toml" + ], + ignoreRegExpList: defaultRegExpExcludeList, + languageSettings: getDefaultLanguageSettings() +})); +var getSettings = function() { + let settings = void 0; + return function(useDefaultDictionaries) { + if (!useDefaultDictionaries) { + return _defaultSettingsBasis; + } + if (!settings) { + const jsonSettings = readSettings(defaultConfigFile); + settings = mergeSettings(_defaultSettings, jsonSettings); + if (jsonSettings.name !== void 0) { + settings.name = jsonSettings.name; + } else { + delete settings.name; } - return resolveResult; } - if (lastException === void 0 || lastException === null) { - return null; + return settings; + }; +}(); +function resolveConfigModule(configModuleName) { + return resolveFile(configModuleName, import_lib_cjs.srcDirectory).filename; +} +function normalizePattern2(pat) { + const { name, pattern, description } = pat; + if (!(pattern instanceof RegExp)) + return pat; + return { + name, + pattern: new PatternRegExp(pattern), + description + }; +} +function getDefaultSettings(useDefaultDictionaries = true) { + return getSettings(useDefaultDictionaries); +} + +// node_modules/cspell-dictionary/dist/util/AutoCache.js +var CACHE_SIZE = 100; +var Cache01 = class { + constructor(maxSize) { + this.maxSize = maxSize; + this.count = 0; + this.cache0 = /* @__PURE__ */ Object.create(null); + this.cache1 = /* @__PURE__ */ Object.create(null); + this.hits = 0; + this.misses = 0; + this.swaps = 0; + } + get(key) { + const cache0 = this.cache0; + const cache1 = this.cache1; + if (key in cache0) { + ++this.hits; + return cache0[key]; + } + if (key in cache1) { + ++this.hits; + ++this.count; + const r = cache1[key]; + cache0[key] = r; + return r; } - throw lastException; + ++this.misses; + return void 0; } - if (typeof target === "object" && target !== null) { - const keys = Object.getOwnPropertyNames(target); - let i = -1; - while (++i < keys.length) { - const key = keys[i]; - if (isArrayIndex(key)) { - throw new ERR_INVALID_PACKAGE_CONFIG2( - (0, import_node_url3.fileURLToPath)(packageJsonUrl), - base, - '"exports" cannot contain numeric property keys.' - ); - } - } - i = -1; - while (++i < keys.length) { - const key = keys[i]; - if (key === "default" || conditions && conditions.has(key)) { - const conditionalTarget = ( - /** @type {unknown} */ - target[key] - ); - const resolveResult = resolvePackageTarget( - packageJsonUrl, - conditionalTarget, - subpath, - packageSubpath, - base, - pattern, - internal, - isPathMap, - conditions - ); - if (resolveResult === void 0) - continue; - return resolveResult; - } + set(key, value) { + if (this.count >= this.maxSize) { + this.cache1 = this.cache0; + this.cache0 = /* @__PURE__ */ Object.create(null); + this.swaps++; + this.count = 0; } - return null; + ++this.count; + this.cache0[key] = value; + return this; } - if (target === null) { - return null; +}; +function createCache01(size) { + return new Cache01(size); +} +function autoCache(fn, size = CACHE_SIZE) { + const cache2 = createCache01(size); + const ac = get; + ac.hits = 0; + ac.misses = 0; + ac.swaps = 0; + function get(k) { + const f = cache2.get(k); + if (f !== void 0) { + ++ac.hits; + return f; + } + const r = fn(k); + cache2.set(k, r); + ac.swaps = cache2.swaps; + ++ac.misses; + return r; } - throw invalidPackageTarget( - packageSubpath, - target, - packageJsonUrl, - internal, - base - ); + return ac; } -function isConditionalExportsMainSugar(exports, packageJsonUrl, base) { - if (typeof exports === "string" || Array.isArray(exports)) - return true; - if (typeof exports !== "object" || exports === null) - return false; - const keys = Object.getOwnPropertyNames(exports); - let isConditionalSugar = false; - let i = 0; - let j = -1; - while (++j < keys.length) { - const key = keys[j]; - const curIsConditionalSugar = key === "" || key[0] !== "."; - if (i++ === 0) { - isConditionalSugar = curIsConditionalSugar; - } else if (isConditionalSugar !== curIsConditionalSugar) { - throw new ERR_INVALID_PACKAGE_CONFIG2( - (0, import_node_url3.fileURLToPath)(packageJsonUrl), - base, - `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.` - ); +function extractStats(ac) { + const { hits, misses, swaps } = ac; + return { hits, misses, swaps }; +} + +// node_modules/cspell-dictionary/dist/util/text.js +var regExAllUpper2 = /^(?:\p{Lu}\p{M}?)+$/u; +var regExAccents2 = /\p{M}/gu; +function isUpperCase2(word) { + return !!word.match(regExAllUpper2); +} +function ucFirst2(word) { + return word.slice(0, 1).toUpperCase() + word.slice(1); +} +function removeAccents2(text) { + return text.normalize("NFD").replace(regExAccents2, ""); +} +function removeUnboundAccents(text) { + return text.replace(regExAccents2, ""); +} + +// node_modules/cspell-dictionary/dist/SpellingDictionary/SpellingDictionaryMethods.js +var defaultNumSuggestions = 10; +function wordSearchForms(word, isDictionaryCaseSensitive, ignoreCase2) { + const forms2 = /* @__PURE__ */ new Set(); + word = word.normalize("NFC"); + const wordLc = word.toLowerCase(); + if (ignoreCase2) { + if (isDictionaryCaseSensitive) { + forms2.add(wordLc); + } else { + forms2.add(wordLc); + forms2.add(removeUnboundAccents(wordLc)); } + } else { + if (isDictionaryCaseSensitive) { + forms2.add(word); + forms2.add(wordLc); + if (isUpperCase2(word)) { + forms2.add(ucFirst2(wordLc)); + } + } else { + forms2.add(wordLc); + forms2.add(removeUnboundAccents(wordLc)); + } + } + return forms2; +} +function wordSuggestFormsArray(word) { + return [...wordSuggestForms(word)]; +} +function wordSuggestForms(word) { + word = word.normalize("NFC"); + const forms2 = /* @__PURE__ */ new Set([word]); + const wordLc = word.toLowerCase(); + forms2.add(wordLc); + return forms2; +} +var DEFAULT_HAS_OPTIONS = Object.freeze({}); +function hasOptionToSearchOption(opt) { + return canonicalSearchOptions(!opt ? DEFAULT_HAS_OPTIONS : opt); +} +var canonicalSearchOptionsMap = /* @__PURE__ */ new Map(); +var knownCanonicalOptions = /* @__PURE__ */ new WeakMap(); +function canonicalSearchOptions(opt) { + const known = knownCanonicalOptions.get(opt); + if (known) + return known; + const { ignoreCase: ignoreCase2, useCompounds } = opt; + const foundLevel1Map = canonicalSearchOptionsMap.get(ignoreCase2); + const useLevel1Map = foundLevel1Map || /* @__PURE__ */ new Map(); + if (!foundLevel1Map) { + canonicalSearchOptionsMap.set(ignoreCase2, useLevel1Map); + } + const foundCanOpts = useLevel1Map.get(useCompounds); + const canOpts = foundCanOpts || Object.freeze({ ignoreCase: ignoreCase2, useCompounds }); + if (!foundCanOpts) { + useLevel1Map.set(useCompounds, canOpts); + } + knownCanonicalOptions.set(opt, canOpts); + return canOpts; +} +function createWeightMapFromDictionaryInformation(di) { + return di ? mapDictionaryInformationToWeightMap(di) : void 0; +} + +// node_modules/cspell-dictionary/dist/SpellingDictionary/CachingDictionary.js +var dictionaryCounter = 0; +var DefaultAutoCacheSize = 1e3; +var CachedDict = class { + constructor(dict, options) { + this.dict = dict; + this.options = options; + this.id = ++dictionaryCounter; + this.has = autoCache((word) => this.dict.has(word, this.options), DefaultAutoCacheSize); + this.isNoSuggestWord = autoCache((word) => this.dict.isNoSuggestWord(word, this.options), DefaultAutoCacheSize); + this.isForbidden = autoCache((word) => this.dict.isForbidden(word), DefaultAutoCacheSize); + this.getPreferredSuggestions = autoCache((word) => this.dict.getPreferredSuggestions?.(word), DefaultAutoCacheSize); + this.name = dict.name; + } + stats() { + return { + name: this.name, + id: this.id, + has: extractStats(this.has), + isNoSuggestWord: extractStats(this.isNoSuggestWord), + isForbidden: extractStats(this.isForbidden), + getPreferredSuggestions: extractStats(this.getPreferredSuggestions) + }; } - return isConditionalSugar; +}; +var knownDicts = /* @__PURE__ */ new Map(); +function createCachingDictionary(dict, options) { + options = canonicalSearchOptions(options); + let knownOptions = knownDicts.get(options); + if (!knownOptions) { + knownOptions = /* @__PURE__ */ new WeakMap(); + knownDicts.set(options, knownOptions); + } + const known = knownOptions.get(dict); + if (known) + return known; + const cached = new CachedDict(dict, options); + knownOptions.set(dict, cached); + return cached; +} + +// node_modules/cspell-dictionary/dist/util/AutoResolve.js +function autoResolveWeak2(map3, key, resolve13) { + const found = map3.get(key); + if (found !== void 0 || map3.has(key)) + return found; + const value = resolve13(key); + map3.set(key, value); + return value; +} +var AutoResolveWeakCache2 = class { + constructor() { + this.map = /* @__PURE__ */ new WeakMap(); + } + get(k, resolve13) { + return resolve13 ? autoResolveWeak2(this.map, k, resolve13) : this.map.get(k); + } + has(k) { + return this.map.has(k); + } + set(k, v) { + this.map.set(k, v); + return this; + } +}; +function createAutoResolveWeakCache() { + return new AutoResolveWeakCache2(); } -function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { - const pjsonPath = (0, import_node_url3.fileURLToPath)(pjsonUrl); - if (emittedPackageWarnings.has(pjsonPath + "|" + match)) - return; - emittedPackageWarnings.add(pjsonPath + "|" + match); - import_node_process2.default.emitWarning( - `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${(0, import_node_url3.fileURLToPath)(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, - "DeprecationWarning", - "DEP0155" - ); + +// node_modules/cspell-dictionary/dist/util/util.js +function isDefined5(v) { + return v !== void 0; } -function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions) { - let exports = packageConfig.exports; - if (isConditionalExportsMainSugar(exports, packageJsonUrl, base)) { - exports = { ".": exports }; + +// node_modules/cspell-dictionary/dist/SpellingDictionary/createSpellingDictionary.js +var import_fast_equals = __toESM(require_fast_equals_cjs(), 1); + +// node_modules/cspell-dictionary/dist/util/simpleCache.js +var SimpleWeakCache = class { + constructor(size) { + this.size = size; + this.L0 = /* @__PURE__ */ new WeakMap(); + this.L1 = /* @__PURE__ */ new WeakMap(); + this.L2 = /* @__PURE__ */ new WeakMap(); + this.sizeL0 = 0; } - if (own2.call(exports, packageSubpath) && !packageSubpath.includes("*") && !packageSubpath.endsWith("/")) { - const target = exports[packageSubpath]; - const resolveResult = resolvePackageTarget( - packageJsonUrl, - target, - "", - packageSubpath, - base, - false, - false, - false, - conditions - ); - if (resolveResult === null || resolveResult === void 0) { - throw exportsNotFound(packageSubpath, packageJsonUrl, base); + has(key) { + for (const c of this.caches()) { + if (c.has(key)) + return true; } - return resolveResult; + return false; } - let bestMatch = ""; - let bestMatchSubpath = ""; - const keys = Object.getOwnPropertyNames(exports); - let i = -1; - while (++i < keys.length) { - const key = keys[i]; - const patternIndex = key.indexOf("*"); - if (patternIndex !== -1 && packageSubpath.startsWith(key.slice(0, patternIndex))) { - if (packageSubpath.endsWith("/")) { - emitTrailingSlashPatternDeprecation( - packageSubpath, - packageJsonUrl, - base - ); - } - const patternTrailer = key.slice(patternIndex + 1); - if (packageSubpath.length >= key.length && packageSubpath.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && key.lastIndexOf("*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = packageSubpath.slice( - patternIndex, - packageSubpath.length - patternTrailer.length - ); + get(key) { + for (const c of this.caches()) { + const entry = c.get(key); + if (entry) { + if (c !== this.L0) { + this._set(key, entry); + } + return entry.v; } } + return void 0; } - if (bestMatch) { - const target = ( - /** @type {unknown} */ - exports[bestMatch] - ); - const resolveResult = resolvePackageTarget( - packageJsonUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - false, - packageSubpath.endsWith("/"), - conditions - ); - if (resolveResult === null || resolveResult === void 0) { - throw exportsNotFound(packageSubpath, packageJsonUrl, base); + set(key, value) { + this._set(key, { v: value }); + } + _set(key, entry) { + if (this.L0.has(key)) { + this.L0.set(key, entry); + return this; } - return resolveResult; + if (this.sizeL0 >= this.size) { + this.rotate(); + } + this.sizeL0 += 1; + this.L0.set(key, entry); } - throw exportsNotFound(packageSubpath, packageJsonUrl, base); -} -function patternKeyCompare(a, b) { - const aPatternIndex = a.indexOf("*"); - const bPatternIndex = b.indexOf("*"); - const baseLengthA = aPatternIndex === -1 ? a.length : aPatternIndex + 1; - const baseLengthB = bPatternIndex === -1 ? b.length : bPatternIndex + 1; - if (baseLengthA > baseLengthB) - return -1; - if (baseLengthB > baseLengthA) - return 1; - if (aPatternIndex === -1) - return 1; - if (bPatternIndex === -1) - return -1; - if (a.length > b.length) - return -1; - if (b.length > a.length) - return 1; - return 0; -} -function packageImportsResolve(name, base, conditions) { - if (name === "#" || name.startsWith("#/") || name.endsWith("/")) { - const reason = "is not a valid internal imports specifier name"; - throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, (0, import_node_url3.fileURLToPath)(base)); + caches() { + return [this.L0, this.L1, this.L2]; } - let packageJsonUrl; - const packageConfig = getPackageScopeConfig(base); - if (packageConfig.exists) { - packageJsonUrl = (0, import_node_url3.pathToFileURL)(packageConfig.pjsonPath); - const imports = packageConfig.imports; - if (imports) { - if (own2.call(imports, name) && !name.includes("*")) { - const resolveResult = resolvePackageTarget( - packageJsonUrl, - imports[name], - "", - name, - base, - false, - true, - false, - conditions - ); - if (resolveResult !== null && resolveResult !== void 0) { - return resolveResult; - } - } else { - let bestMatch = ""; - let bestMatchSubpath = ""; - const keys = Object.getOwnPropertyNames(imports); - let i = -1; - while (++i < keys.length) { - const key = keys[i]; - const patternIndex = key.indexOf("*"); - if (patternIndex !== -1 && name.startsWith(key.slice(0, -1))) { - const patternTrailer = key.slice(patternIndex + 1); - if (name.length >= key.length && name.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && key.lastIndexOf("*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = name.slice( - patternIndex, - name.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = imports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJsonUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - true, - false, - conditions - ); - if (resolveResult !== null && resolveResult !== void 0) { - return resolveResult; - } + rotate() { + this.L2 = this.L1; + this.L1 = this.L0; + this.L0 = /* @__PURE__ */ new WeakMap(); + this.sizeL0 = 0; + } +}; +var AutoWeakCache = class extends SimpleWeakCache { + constructor(factory, size) { + super(size); + this.factory = factory; + } + get(key) { + const v = super.get(key); + if (v !== void 0) + return v; + const val = this.factory(key); + this.set(key, val); + return val; + } +}; +var SimpleCache = class { + constructor(size) { + this.size = size; + this.L0 = /* @__PURE__ */ new Map(); + this.L1 = /* @__PURE__ */ new Map(); + this.L2 = /* @__PURE__ */ new Map(); + } + has(key) { + for (const c of this.caches()) { + if (c.has(key)) + return true; + } + return false; + } + get(key) { + for (const c of this.caches()) { + const entry = c.get(key); + if (entry) { + if (c !== this.L0) { + this._set(key, entry); } + return entry.v; } } + return void 0; } - throw importNotDefined(name, packageJsonUrl, base); -} -function parsePackageName(specifier, base) { - let separatorIndex = specifier.indexOf("/"); - let validPackageName = true; - let isScoped = false; - if (specifier[0] === "@") { - isScoped = true; - if (separatorIndex === -1 || specifier.length === 0) { - validPackageName = false; - } else { - separatorIndex = specifier.indexOf("/", separatorIndex + 1); + set(key, value) { + this._set(key, { v: value }); + } + _set(key, entry) { + if (this.L0.has(key)) { + this.L0.set(key, entry); + return this; + } + if (this.L0.size >= this.size) { + this.rotate(); } + this.L0.set(key, entry); } - const packageName = separatorIndex === -1 ? specifier : specifier.slice(0, separatorIndex); - if (invalidPackageNameRegEx.exec(packageName) !== null) { - validPackageName = false; + caches() { + return [this.L0, this.L1, this.L2]; } - if (!validPackageName) { - throw new ERR_INVALID_MODULE_SPECIFIER( - specifier, - "is not a valid package name", - (0, import_node_url3.fileURLToPath)(base) - ); + rotate() { + this.L2 = this.L1; + this.L1 = this.L0; + this.L0 = /* @__PURE__ */ new Map(); } - const packageSubpath = "." + (separatorIndex === -1 ? "" : specifier.slice(separatorIndex)); - return { packageName, packageSubpath, isScoped }; +}; + +// node_modules/cspell-dictionary/dist/SpellingDictionary/SpellingDictionary.js +var defaultOptions = Object.freeze({ + weightMap: void 0 +}); + +// node_modules/cspell-dictionary/dist/util/clean.js +function clean4(src) { + const r = src; + for (const key of Object.keys(r)) { + if (r[key] === void 0) { + delete r[key]; + } + } + return r; } -function packageResolve(specifier, base, conditions) { - if (import_node_module.builtinModules.includes(specifier)) { - return new import_node_url3.URL("node:" + specifier); + +// node_modules/cspell-dictionary/dist/util/regexHelper.js +function escapeRegEx(s) { + return s.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); +} + +// node_modules/cspell-dictionary/dist/util/repMap.js +function createMapper(repMap, ignoreCharset) { + if (!repMap && !ignoreCharset) + return (a) => a; + repMap = repMap || []; + const charsetMap = charsetToRepMapRegEx(ignoreCharset); + if (charsetMap) { + repMap = repMap.concat(charsetMap); } - const { packageName, packageSubpath, isScoped } = parsePackageName( - specifier, - base - ); - const packageConfig = getPackageScopeConfig(base); - if (packageConfig.exists) { - const packageJsonUrl2 = (0, import_node_url3.pathToFileURL)(packageConfig.pjsonPath); - if (packageConfig.name === packageName && packageConfig.exports !== void 0 && packageConfig.exports !== null) { - return packageExportsResolve( - packageJsonUrl2, - packageSubpath, - packageConfig, - base, - conditions - ); + const filteredMap = repMap.filter(([match2, _]) => !!match2); + if (!filteredMap.length) { + return (a) => a; + } + const regEx = createMapperRegExp(repMap); + const values = repMap.filter(([match2, _]) => !!match2).map(([_, into]) => into); + function resolve13(m, ...matches) { + const index = matches.findIndex((a) => !!a); + return 0 <= index && index < values.length ? values[index] : m; + } + return function(s) { + return s.replace(regEx, resolve13); + }; +} +function charsetToRepMapRegEx(charset, replaceWith = "") { + if (!charset) + return void 0; + return charset.split("|").map((chars) => `[${chars.replace(/[\][\\]/g, "\\$&")}]`).map((map3) => [map3, replaceWith]); +} +function charsetToRepMap(charset, replaceWith = "") { + if (!charset) + return void 0; + return charset.split("|").flatMap((chars) => [...expandCharacterSet(chars)]).map((char) => [char, replaceWith]); +} +function expandReplaceMap(repMap) { + return repMap.flatMap(([from, replaceWith]) => from.split("|").map((w) => [w, replaceWith])); +} +function createMapperRegExp(repMap) { + const filteredMap = repMap.filter(([match2, _]) => !!match2); + if (!filteredMap.length) { + return /$^/; + } + const regExStr = filteredMap.map(([from, _]) => from).map((s) => { + try { + const r = s.match(/\(/) ? s.replace(/\((?=.*\))/g, "(?:").replace(/\(\?:\?/g, "(?") : s; + new RegExp(r); + s = r; + } catch (err) { + return escapeRegEx(s); + } + return s; + }).map((s) => `(${s})`).join("|"); + const regEx = new RegExp(regExStr, "g"); + return regEx; +} +function createRepMapper(repMap, ignoreCharset) { + if (!repMap && !ignoreCharset) + return (word) => [word]; + const trie = createTrie(repMap, ignoreCharset); + return (word) => { + const edits = calcAllEdits(trie, word); + return applyEdits(word, edits); + }; +} +function applyEdits(word, edits) { + if (!edits.length) + return [word]; + const letterEdits = []; + for (let i = 0; i < word.length; ++i) { + letterEdits[i] = { edits: [{ b: i, e: i + 1, r: word[i] }], suffixes: [] }; + } + letterEdits[word.length] = { edits: [], suffixes: [""] }; + for (const edit of edits) { + const le = letterEdits[edit.b]; + le.edits.push(edit); + } + for (let i = word.length - 1; i >= 0; --i) { + const le = letterEdits[i]; + const sfx = le.suffixes; + for (const edit of le.edits) { + const pfx = edit.r; + const nSfx = letterEdits[edit.e].suffixes; + for (const s of nSfx) { + sfx.push(pfx + s); + } } } - let packageJsonUrl = new import_node_url3.URL( - "./node_modules/" + packageName + "/package.json", - base - ); - let packageJsonPath = (0, import_node_url3.fileURLToPath)(packageJsonUrl); - let lastPath; - do { - const stat2 = tryStatSync(packageJsonPath.slice(0, -13)); - if (!stat2.isDirectory()) { - lastPath = packageJsonPath; - packageJsonUrl = new import_node_url3.URL( - (isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName + "/package.json", - packageJsonUrl - ); - packageJsonPath = (0, import_node_url3.fileURLToPath)(packageJsonUrl); - continue; + const results = new Set(letterEdits[0].suffixes); + return [...results]; +} +function calcAllEdits(root, word) { + const edits = []; + function walk4(node, b, e) { + if (node.rep) { + node.rep.forEach((r) => edits.push({ b, e, r })); } - const packageConfig2 = getPackageConfig(packageJsonPath, specifier, base); - if (packageConfig2.exports !== void 0 && packageConfig2.exports !== null) { - return packageExportsResolve( - packageJsonUrl, - packageSubpath, - packageConfig2, - base, - conditions - ); + if (e === word.length || !node.children) + return; + const n = node.children[word[e]]; + if (!n) + return; + walk4(n, b, e + 1); + } + for (let i = 0; i < word.length; ++i) { + walk4(root, i, i); + } + return edits; +} +function createTrie(repMap, ignoreCharset) { + const combined = [repMap, charsetToRepMap(ignoreCharset)].filter(isDefined5).flatMap((a) => a); + const expanded = expandReplaceMap(combined); + const trieRoot = /* @__PURE__ */ Object.create(null); + expanded.forEach(([match2, replaceWith]) => addToTrie(trieRoot, match2, replaceWith)); + return trieRoot; +} +function addToTrie(node, match2, replaceWith) { + while (match2) { + const children = node.children || (node.children = /* @__PURE__ */ Object.create(null)); + const k = match2[0]; + const childNode = children[k] || (children[k] = /* @__PURE__ */ Object.create(null)); + node = childNode; + match2 = match2.slice(1); + } + const s = new Set(node.rep || []); + s.add(replaceWith); + node.rep = [...s]; +} + +// node_modules/cspell-dictionary/dist/SpellingDictionary/defaults.js +var ignoreCase = true; +var isForbiddenIgnoreCaseAndAccents = false; + +// node_modules/cspell-dictionary/dist/SpellingDictionary/SpellingDictionaryFromTrie.js +var findWordOptionsCaseSensitive = Object.freeze({ caseSensitive: true }); +var findWordOptionsNotCaseSensitive = Object.freeze({ caseSensitive: false }); +var SpellingDictionaryFromTrie = class { + constructor(trie, name, options, source = "from trie", size) { + this.trie = trie; + this.name = name; + this.options = options; + this.source = source; + this._size = 0; + this.knownWords = /* @__PURE__ */ new Set(); + this.unknownWords = /* @__PURE__ */ new Set(); + this.type = "SpellingDictionaryFromTrie"; + this._find = findCache((word, useCompounds, ignoreCase2) => this.findAnyForm(word, useCompounds, ignoreCase2)); + this._isForbidden = autoCache((word) => { + return this.trie.isForbiddenWord(word); + }); + this.mapWord = createMapper(options.repMap, options.dictionaryInformation?.ignore); + this.remapWord = createRepMapper(options.repMap, options.dictionaryInformation?.ignore); + this.isDictionaryCaseSensitive = options.caseSensitive ?? trie.isCaseAware; + this.containsNoSuggestWords = options.noSuggest || false; + this._size = size || 0; + this.weightMap = options.weightMap || createWeightMapFromDictionaryInformation(options.dictionaryInformation); + } + get size() { + if (!this._size) { + const i = this.trie.iterate(); + let deeper = true; + let size = 0; + for (let r = i.next(); !r.done; r = i.next(deeper)) { + size += 1; + deeper = r.value.text.length < 5; + } + this._size = size; + } + return this._size; + } + has(word, hasOptions) { + const { useCompounds, ignoreCase: ignoreCase2 } = this.resolveOptions(hasOptions); + const r = this._find(word, useCompounds, ignoreCase2); + return !!r && !r.forbidden && !!r.found; + } + find(word, hasOptions) { + const { useCompounds, ignoreCase: ignoreCase2 } = this.resolveOptions(hasOptions); + const r = this._find(word, useCompounds, ignoreCase2); + const { forbidden = this.isForbidden(word) } = r || {}; + if (!r && !forbidden) + return void 0; + const { found = forbidden ? word : false } = r || {}; + const noSuggest = found !== false && this.containsNoSuggestWords; + return { found, forbidden, noSuggest }; + } + resolveOptions(hasOptions) { + const { useCompounds = this.options.useCompounds, ignoreCase: ignoreCase2 = ignoreCase } = hasOptionToSearchOption(hasOptions); + return { useCompounds, ignoreCase: ignoreCase2 }; + } + findAnyForm(word, useCompounds, ignoreCase2) { + const outerForms = outerWordForms(word, this.remapWord ? this.remapWord : (word2) => [this.mapWord(word2)]); + for (const form of outerForms) { + const r = this._findAnyForm(form, useCompounds, ignoreCase2); + if (r) + return r; } - if (packageSubpath === ".") { - return legacyMainResolve(packageJsonUrl, packageConfig2, base); + return void 0; + } + _findAnyForm(mWord, useCompounds, ignoreCase2) { + const opts = ignoreCase2 ? findWordOptionsNotCaseSensitive : findWordOptionsCaseSensitive; + const findResult = this.trie.findWord(mWord, opts); + if (findResult.found !== false) { + return findResult; } - return new import_node_url3.URL(packageSubpath, packageJsonUrl); - } while (packageJsonPath.length !== lastPath.length); - throw new ERR_MODULE_NOT_FOUND(packageName, (0, import_node_url3.fileURLToPath)(base)); -} -function isRelativeSpecifier(specifier) { - if (specifier[0] === ".") { - if (specifier.length === 1 || specifier[1] === "/") - return true; - if (specifier[1] === "." && (specifier.length === 2 || specifier[2] === "/")) { + const forms2 = wordSearchForms(mWord, this.isDictionaryCaseSensitive, ignoreCase2); + for (const w of forms2) { + const findResult2 = this.trie.findWord(w, opts); + if (findResult2.found !== false) { + return findResult2; + } + } + if (useCompounds) { + const optsUseCompounds = { ...opts, useLegacyWordCompounds: useCompounds }; + for (const w of forms2) { + const findResult2 = this.trie.findWord(w, optsUseCompounds); + if (findResult2.found !== false) { + return findResult2; + } + } + } + return void 0; + } + isNoSuggestWord(word, options) { + return this.containsNoSuggestWords ? this.has(word, options) : false; + } + isForbidden(word, _ignoreCaseAndAccents) { + return this._isForbidden(word); + } + suggest(word, suggestOptions = {}) { + return this._suggest(word, suggestOptions); + } + _suggest(word, suggestOptions) { + const { numSuggestions = defaultNumSuggestions, numChanges, includeTies, ignoreCase: ignoreCase2, timeout } = suggestOptions; + function filter3(_word) { return true; } + const collector = suggestionCollector(word, clean4({ + numSuggestions, + filter: filter3, + changeLimit: numChanges, + includeTies, + ignoreCase: ignoreCase2, + timeout, + weightMap: this.weightMap + })); + this.genSuggestions(collector, suggestOptions); + return collector.suggestions.map((r) => ({ ...r, word: r.word })); + } + genSuggestions(collector, suggestOptions) { + if (this.options.noSuggest) + return; + const _compoundMethod = suggestOptions.compoundMethod ?? (this.options.useCompounds ? CompoundWordsMethod.JOIN_WORDS : CompoundWordsMethod.NONE); + wordSuggestFormsArray(collector.word).forEach((w) => this.trie.genSuggestions(impersonateCollector(collector, w), _compoundMethod)); + } + getErrors() { + return []; + } +}; +SpellingDictionaryFromTrie.cachedWordsLimit = 5e4; +function createSpellingDictionaryFromTrieFile(data, name, source, options) { + const trie = decodeTrie(data); + return new SpellingDictionaryFromTrie(trie, name, options, source); +} +function findCache(fn, size = 2e3) { + const cache2 = createCache01(size); + function find(word, useCompounds, ignoreCase2) { + const r = cache2.get(word); + if (r !== void 0) { + if (r.useCompounds === useCompounds && r.ignoreCase === ignoreCase2) { + return r.findResult; + } + } + const findResult = fn(word, useCompounds, ignoreCase2); + cache2.set(word, { useCompounds, ignoreCase: ignoreCase2, findResult }); + return findResult; + } + return find; +} +function outerWordForms(word, mapWord) { + const forms2 = pipeSync([word], opConcatMapSync((word2) => [word2, word2.normalize("NFC"), word2.normalize("NFD")]), opConcatMapSync((word2) => [word2, ...mapWord(word2)])); + return new Set(forms2); +} + +// node_modules/cspell-dictionary/dist/SpellingDictionary/createSpellingDictionary.js +var cachedDictionaries = new AutoWeakCache(_createSpellingDictionary, 64); +var maxSetSize = 3; +var cachedParamsByWordList = new SimpleCache(64); +function createSpellingDictionary(wordList, name, source, options) { + const params = [wordList, name, source, options]; + if (!Array.isArray(wordList)) { + return _createSpellingDictionary(params); + } + const cached = cachedParamsByWordList.get(name) || /* @__PURE__ */ new Set(); + for (const cachedParams of cached) { + if ((0, import_fast_equals.deepEqual)(params, cachedParams)) { + return cachedDictionaries.get(cachedParams); + } + } + if (cached.size > maxSetSize) + cached.clear(); + cached.add(params); + cachedParamsByWordList.set(name, cached); + return cachedDictionaries.get(params); +} +function _createSpellingDictionary(params) { + const [wordList, name, source, options] = params; + const parseOptions = { stripCaseAndAccents: options?.supportNonStrictSearches ?? true }; + const words = parseDictionaryLines(wordList, parseOptions); + const trie = buildITrieFromWords(words); + const opts = { ...options || defaultOptions }; + if (opts.weightMap === void 0 && opts.dictionaryInformation) { + opts.weightMap = createWeightMapFromDictionaryInformation(opts.dictionaryInformation); + } + return new SpellingDictionaryFromTrie(trie, name, opts, source); +} +function createFailedToLoadDictionary(name, source, error2, options) { + options = options || {}; + return { + name, + source, + type: "error", + containsNoSuggestWords: false, + has: () => false, + find: () => void 0, + isNoSuggestWord: () => false, + isForbidden: () => false, + suggest: () => [], + mapWord: (a) => a, + genSuggestions: () => { + return; + }, + size: 0, + options, + isDictionaryCaseSensitive: false, + getErrors: () => [error2] + }; +} + +// node_modules/cspell-dictionary/dist/util/textMappers.js +function* mapperRemoveCaseAndAccents(words) { + for (const word of words) { + const lc = word.toLowerCase(); + yield lc; + const woAccents = removeAccents2(lc); + if (lc !== woAccents) + yield woAccents; } - return false; } -function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) { - if (specifier === "") + +// node_modules/cspell-dictionary/dist/SpellingDictionary/Typos/typosParser.js +var import_assert12 = __toESM(require("assert"), 1); + +// node_modules/cspell-dictionary/dist/SpellingDictionary/Typos/util.js +function normalizeTyposDefValue(value) { + if (!value) return false; - if (specifier[0] === "/") - return true; - return isRelativeSpecifier(specifier); -} -function moduleResolve(specifier, base, conditions, preserveSymlinks) { - const isRemote = base.protocol === "http:" || base.protocol === "https:"; - let resolved; - if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) { - resolved = new import_node_url3.URL(specifier, base); - } else if (!isRemote && specifier[0] === "#") { - resolved = packageImportsResolve(specifier, base, conditions); + if (typeof value === "string") + return value; + const unique2 = [...new Set(value)]; + return unique2.length > 1 ? unique2 : unique2.length === 1 ? unique2[0] : false; +} +function mergeDefEntry(targetDef, key, value) { + const curValue = targetDef[key]; + if (!curValue) { + targetDef[key] = normalizeTyposDefValue(value); + return targetDef; + } + if (!value) + return targetDef; + const newValue = Array.isArray(curValue) ? curValue : [curValue]; + if (Array.isArray(value)) { + newValue.push(...value); } else { - try { - resolved = new import_node_url3.URL(specifier); - } catch { - if (!isRemote) { - resolved = packageResolve(specifier, base, conditions); - } + newValue.push(value); + } + targetDef[key] = normalizeTyposDefValue(newValue); + return targetDef; +} +function mergeDef(targetDef, fromDef) { + for (const key of Object.keys(fromDef)) { + mergeDefEntry(targetDef, key, fromDef[key]); + } + return targetDef; +} +function appendToDef(def, entry) { + if (!entry) + return def; + if (typeof entry === "string") { + if (!def[entry]) { + def[entry] = false; } + return def; } - (0, import_node_assert2.default)(typeof resolved !== "undefined", "expected to be defined"); - if (resolved.protocol !== "file:") { - return resolved; + if (Array.isArray(entry)) { + const [key, ...sugs] = entry.map((s2) => s2.trim()); + if (!key) + return def; + const s = sugs.map((s2) => s2.trim()).filter((s2) => !!s2); + return mergeDefEntry(def, key, s); } - return finalizeResolution(resolved, base, preserveSymlinks); + return mergeDef(def, entry); } -function checkIfDisallowedImport(specifier, parsed, parsedParentURL) { - if (parsed && parsedParentURL && (parsedParentURL.protocol === "http:" || parsedParentURL.protocol === "https:")) { - if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) { - if (parsed && parsed.protocol !== "https:" && parsed.protocol !== "http:") { - throw new ERR_NETWORK_IMPORT_DISALLOWED( - specifier, - parsedParentURL, - "remote imports cannot import from a local location." - ); - } - return { url: parsed.href }; +function createTyposDef(entries) { + const def = /* @__PURE__ */ Object.create(null); + if (!entries) + return def; + for (const [key, value] of entries) { + def[key] = isDefined6(value) ? value : false; + } + return def; +} +function extractAllSuggestions(typosDef) { + const allSugs = pipeSync(Object.values(typosDef), opFilterSync(hasSuggestions), opConcatMapSync((v) => Array.isArray(v) ? v : [v])); + return new Set(allSugs); +} +function extractIgnoreValues(typosDef, ignorePrefix) { + const pfxLen = ignorePrefix.length; + return new Set(Object.keys(typosDef).filter((k) => k.startsWith(ignorePrefix)).map((k) => k.slice(pfxLen))); +} +function isDefined6(v) { + return v !== void 0 && v !== null; +} +function isString2(v) { + return typeof v === "string"; +} +function isArray(v) { + return Array.isArray(v); +} +function hasSuggestions(v) { + return isString2(v) || isArray(v); +} + +// node_modules/cspell-dictionary/dist/SpellingDictionary/Typos/typosParser.js +function assertString(v) { + (0, import_assert12.default)(typeof v === "string", "A string was expected."); + return true; +} +var suggestionsSeparator = /[,]/; +var typoSuggestionsSeparator = /:|->/; +var typoEntrySeparator = /[\n;]/; +function normalize2(s) { + return s.normalize(); +} +function trimAndFilter(lines) { + return lines.map((s) => s.trim()).filter((s) => !!s).map(normalize2); +} +function cleanSugs(rawSugs) { + const sugs = trimAndFilter(rawSugs); + return sugs.length === 1 ? sugs[0] : sugs.length ? sugs : false; +} +function splitSuggestionsValue(value) { + return cleanSugs(value.split(suggestionsSeparator)); +} +function sanitizeIntoTypoDef(dirtyDef) { + if (!dirtyDef || typeof dirtyDef !== "object") + return void 0; + const def = createTyposDef(); + for (const [rawKey, value] of Object.entries(dirtyDef)) { + const key = normalize2(rawKey.trim()); + if (!key) + continue; + if (typeof value === "string") { + def[key] = splitSuggestionsValue(value); + continue; } - if (import_node_module.builtinModules.includes(specifier)) { - throw new ERR_NETWORK_IMPORT_DISALLOWED( - specifier, - parsedParentURL, - "remote imports cannot import from a local location." - ); + if (Array.isArray(value)) { + const sugs = cleanSugs(value.filter(assertString)); + def[key] = sugs; + continue; } - throw new ERR_NETWORK_IMPORT_DISALLOWED( - specifier, - parsedParentURL, - "only relative and absolute specifiers are supported." - ); + (0, import_assert12.default)(value === false, "Unexpected suggestion type."); + def[key] = false; } + return def; } -function throwIfUnsupportedURLProtocol(url) { - if (url.protocol !== "file:" && url.protocol !== "data:" && url.protocol !== "node:") { - throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(url); +function processEntriesToTyposDef(entries) { + const def = isIterable3(entries) ? reduceToTyposDef(entries) : entries; + const result = sanitizeIntoTypoDef(def); + (0, import_assert12.default)(result); + return result; +} +function reduceToTyposDef(entries) { + const def = createTyposDef(); + for (const entry of entries) { + appendToDef(def, parseTyposLine(entry)); } + return def; } -function throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports2) { - if (parsed && parsed.protocol !== "file:" && parsed.protocol !== "data:" && (!experimentalNetworkImports2 || parsed.protocol !== "https:" && parsed.protocol !== "http:")) { - throw new ERR_UNSUPPORTED_ESM_URL_SCHEME( - parsed, - ["file", "data"].concat( - experimentalNetworkImports2 ? ["https", "http"] : [] - ) - ); +function parseTyposLine(line) { + if (!line) + return void 0; + if (typeof line === "string") { + const def = createTyposDef(); + for (const subEntry of splitIntoLines(line)) { + const [left, right] = splitEntry(subEntry); + const typo = left.trim(); + if (!right) + return typo; + const sugs = splitSuggestionsValue(right); + def[typo] = sugs; + } + return def; + } + if (Array.isArray(line)) { + const [key, ...sugs] = line.filter(assertString).map((s) => s.trim()); + if (!key) + return void 0; + return [key, ...sugs]; } + return sanitizeIntoTypoDef(line); } -function defaultResolve(specifier, context = {}) { - const { parentURL } = context; - (0, import_node_assert2.default)(typeof parentURL !== "undefined", "expected `parentURL` to be defined"); - let parsedParentURL; - if (parentURL) { - try { - parsedParentURL = new import_node_url3.URL(parentURL); - } catch { +function splitIntoLines(content) { + return trimAndFilter(normalize2(content).split(typoEntrySeparator)); +} +function splitEntry(line) { + return line.split(typoSuggestionsSeparator, 2); +} +function isIterable3(v) { + return Symbol.iterator in v; +} + +// node_modules/cspell-dictionary/dist/SpellingDictionary/TyposDictionary.js +var TyposDictionaryImpl = class { + constructor(name, source, typosDef, ignoreList) { + this.name = name; + this.source = source; + this.typosDef = typosDef; + this.options = {}; + this.type = "typos"; + this.isDictionaryCaseSensitive = true; + this.size = Object.keys(typosDef).length; + this.explicitIgnoreWords = extractIgnoreValues(typosDef, "!"); + this.suggestions = extractAllSuggestions(typosDef); + this.ignoreWords = new Set(pipeSync(this.explicitIgnoreWords, opAppendSync(ignoreList || []))); + this.suggestionsLower = new Set(pipeSync(this.suggestions, mapperRemoveCaseAndAccents)); + this.containsNoSuggestWords = this.ignoreWords.size > 0; + } + /** + * A Forbidden word list does not "have" valid words. + * Therefore it always returns false. + * @param _word - the word + * @param _options - options + * @returns always false + */ + has(_word, _options) { + return false; + } + /** A more detailed search for a word, might take longer than `has` */ + find(word, options) { + const result = this._findForms(word, options?.ignoreCase ?? ignoreCase); + if (result === false) + return void 0; + const { found, ignore } = result; + return { found, forbidden: !ignore, noSuggest: ignore }; + } + _findForms(word, ignoreCaseAndAccents) { + const lcWord = word.toLowerCase(); + if (this.ignoreWords.has(word)) { + return { found: word, ignore: true }; + } + if (this.suggestions.has(word)) { + return false; } + if (ignoreCaseAndAccents) { + if (this.suggestionsLower.has(lcWord)) { + return false; + } + if (this.ignoreWords.has(lcWord)) { + return { found: lcWord, ignore: true }; + } + } + if (word in this.typosDef) + return { found: word, ignore: false }; + if (lcWord in this.typosDef) + return { found: lcWord, ignore: false }; + return false; } - let parsed; - try { - parsed = shouldBeTreatedAsRelativeOrAbsolutePath(specifier) ? new import_node_url3.URL(specifier, parsedParentURL) : new import_node_url3.URL(specifier); - if (parsed.protocol === "data:" || experimentalNetworkImports && (parsed.protocol === "https:" || parsed.protocol === "http:")) { - return { url: parsed.href, format: null }; + isForbidden(word, ignoreCaseAndAccents = isForbiddenIgnoreCaseAndAccents) { + const found = this._findForms(word, ignoreCaseAndAccents); + return found !== false && !found.ignore; + } + isNoSuggestWord(word, options) { + const result = this.find(word, options); + return result?.noSuggest ?? false; + } + /** + * Determine if the word can appear in a list of suggestions. + * @param word - word + * @param ignoreCaseAndAccents - ignore case. + * @returns true if a word is suggested, otherwise false. + */ + isSuggestedWord(word, ignoreCaseAndAccents = isForbiddenIgnoreCaseAndAccents) { + if (this.suggestions.has(word)) + return true; + const lcWord = word.toLowerCase(); + return ignoreCaseAndAccents && (this.suggestions.has(lcWord) || this.suggestionsLower.has(lcWord)); + } + suggest(word) { + return this.getPreferredSuggestions(word); + } + _suggest(word) { + if (this.ignoreWords.has(word)) + return []; + if (!(word in this.typosDef)) + return void 0; + const sug = this.typosDef[word]; + const isPreferred = true; + if (!sug) + return []; + if (typeof sug === "string") { + return [ + { + word: sug, + cost: 1, + isPreferred + } + ]; } - } catch { + return sug.map((word2, index) => ({ word: word2, cost: index + 1, isPreferred })); } - const maybeReturn = checkIfDisallowedImport( - specifier, - parsed, - parsedParentURL - ); - if (maybeReturn) - return maybeReturn; - if (parsed && parsed.protocol === "node:") - return { url: specifier }; - throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports); - const conditions = getConditionsSet(context.conditions); - const url = moduleResolve(specifier, new import_node_url3.URL(parentURL), conditions, false); - throwIfUnsupportedURLProtocol(url); - return { - // Do NOT cast `url` to a string: that will work even when there are real - // problems, silencing them - url: url.href, - format: defaultGetFormatWithoutErrors(url, { parentURL }) - }; -} -var import_node_assert2, import_node_fs2, import_node_process2, import_node_url3, import_node_path3, import_node_module, RegExpPrototypeSymbolReplace, experimentalNetworkImports, ERR_NETWORK_IMPORT_DISALLOWED, ERR_INVALID_MODULE_SPECIFIER, ERR_INVALID_PACKAGE_CONFIG2, ERR_INVALID_PACKAGE_TARGET, ERR_MODULE_NOT_FOUND, ERR_PACKAGE_IMPORT_NOT_DEFINED, ERR_PACKAGE_PATH_NOT_EXPORTED, ERR_UNSUPPORTED_DIR_IMPORT, ERR_UNSUPPORTED_ESM_URL_SCHEME, own2, invalidSegmentRegEx, deprecatedInvalidSegmentRegEx, invalidPackageNameRegEx, patternRegEx, encodedSepRegEx, emittedPackageWarnings, doubleSlashRegEx; -var init_resolve = __esm({ - "node_modules/import-meta-resolve/lib/resolve.js"() { - import_node_assert2 = __toESM(require("node:assert"), 1); - import_node_fs2 = require("node:fs"); - import_node_process2 = __toESM(require("node:process"), 1); - import_node_url3 = require("node:url"); - import_node_path3 = __toESM(require("node:path"), 1); - import_node_module = require("node:module"); - init_get_format(); - init_errors(); - init_package_config(); - init_utils(); - RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace]; - experimentalNetworkImports = false; - ({ - ERR_NETWORK_IMPORT_DISALLOWED, - ERR_INVALID_MODULE_SPECIFIER, - ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG2, - ERR_INVALID_PACKAGE_TARGET, - ERR_MODULE_NOT_FOUND, - ERR_PACKAGE_IMPORT_NOT_DEFINED, - ERR_PACKAGE_PATH_NOT_EXPORTED, - ERR_UNSUPPORTED_DIR_IMPORT, - ERR_UNSUPPORTED_ESM_URL_SCHEME - } = codes); - own2 = {}.hasOwnProperty; - invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i; - deprecatedInvalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i; - invalidPackageNameRegEx = /^\.|%|\\/; - patternRegEx = /\*/g; - encodedSepRegEx = /%2f|%5c/i; - emittedPackageWarnings = /* @__PURE__ */ new Set(); - doubleSlashRegEx = /[/\\]{2}/; + genSuggestions(collector) { + const sugs = this.suggest(collector.word); + sugs.forEach((result) => collector.add(result)); } -}); - -// node_modules/import-meta-resolve/index.js -var import_meta_resolve_exports = {}; -__export(import_meta_resolve_exports, { - moduleResolve: () => moduleResolve, - resolve: () => resolve7 -}); -async function resolve7(specifier, parent) { - if (!parent) { - throw new Error( - "Please pass `parent`: `import-meta-resolve` cannot ponyfill that" - ); + getPreferredSuggestions(word) { + return this._suggest(word) || this._suggest(word.toLowerCase()) || []; } - try { - return defaultResolve(specifier, { parentURL: parent }).url; - } catch (error2) { - const exception = ( - /** @type {ErrnoException} */ - error2 - ); - return exception.code === "ERR_UNSUPPORTED_DIR_IMPORT" && typeof exception.url === "string" ? exception.url : Promise.reject(error2); + mapWord(word) { + return word; } -} -var init_import_meta_resolve = __esm({ - "node_modules/import-meta-resolve/index.js"() { - init_resolve(); - init_resolve(); + getErrors() { + return []; } -}); - -// src/main.ts -var core4 = __toESM(require_core()); -var import_github2 = __toESM(require_github()); -var import_context = __toESM(require_context()); +}; +var createCache = createAutoResolveWeakCache(); +function createTyposDictionary(entries, name, source) { + return createCache.get(entries, () => { + const def = processEntriesToTyposDef(entries); + return new TyposDictionaryImpl(name, source, def); + }); +} -// src/error.ts -var AppError = class extends Error { - constructor(message) { - super(message); +// node_modules/cspell-dictionary/dist/SpellingDictionary/FlagWordsDictionary.js +var FlagWordsDictionaryTrie = class extends SpellingDictionaryFromTrie { + constructor(trie, name, source) { + super(trie, name, defaultOptions, source); + this.name = name; + this.source = source; + this.containsNoSuggestWords = false; + this.options = {}; + this.isDictionaryCaseSensitive = true; } -}; -function isError(e) { - if (!e) - return false; - if (typeof e !== "object") + /** + * A Forbidden word list does not "have" valid words. + * Therefore it always returns false. + * @param _word - the word + * @param _options - options + * @returns always false + */ + has(_word, _options) { return false; - const err = e; - return err.message !== void 0 && err.name !== void 0 && (err.stack === void 0 || typeof err.stack === "string"); + } + find(word, hasOptions) { + const f = super.find(word, hasOptions); + if (!f || !f.forbidden) + return void 0; + return f; + } + suggest() { + return []; + } + genSuggestions() { + return; + } +}; +var FlagWordsDictionary = class { + constructor(name, source, dictTypos, dictTrie) { + this.name = name; + this.source = source; + this.dictTypos = dictTypos; + this.dictTrie = dictTrie; + this.containsNoSuggestWords = false; + this.options = {}; + this.type = "flag-words"; + this.isDictionaryCaseSensitive = true; + } + /** + * A Forbidden word list does not "have" valid words. + * Therefore it always returns false. + * @param word - the word + * @param options - options + * @returns always false + */ + has(word, options) { + return this.dictTypos.has(word, options) || this.dictTrie?.has(word, options) || false; + } + /** A more detailed search for a word, might take longer than `has` */ + find(word, options) { + const findTypos = this.dictTypos.find(word, options); + if (findTypos) + return findTypos; + const ignoreCase2 = options?.ignoreCase ?? ignoreCase; + if (this.dictTypos.isSuggestedWord(word, ignoreCase2)) + return void 0; + return this.dictTrie?.find(word, options); + } + isForbidden(word, ignoreCaseAndAccents = isForbiddenIgnoreCaseAndAccents) { + const findResult = this.find(word, { ignoreCase: ignoreCaseAndAccents }); + return findResult?.forbidden || false; + } + isNoSuggestWord(word, options) { + return this.dictTrie?.isNoSuggestWord(word, options) || this.dictTypos.isNoSuggestWord(word, options); + } + suggest(word, suggestOptions = {}) { + return this.dictTypos.suggest(word, suggestOptions); + } + getPreferredSuggestions(word) { + return this.dictTypos.getPreferredSuggestions(word); + } + genSuggestions() { + return; + } + mapWord(word) { + return word; + } + get size() { + return this.dictTypos.size + (this.dictTrie?.size || 0); + } + getErrors() { + return []; + } +}; +var createCache2 = createAutoResolveWeakCache(); +function createFlagWordsDictionary(wordList, name, source) { + return createCache2.get(wordList, () => { + const testSpecialCharacters = /[~*+]/; + const { t: specialWords, f: typoWords } = bisect(parseDictionaryLines(wordList, { stripCaseAndAccents: false }), (line) => testSpecialCharacters.test(line)); + const trieDict = specialWords.size ? buildTrieDict(specialWords, name, source) : void 0; + const typosDict = createTyposDictionary(typoWords, name, source); + if (!trieDict) + return typosDict; + return new FlagWordsDictionary(name, source, typosDict, trieDict); + }); } -function isAppError(e) { - return e instanceof AppError; +var regExpCleanIgnore = /^(!!)+/; +function buildTrieDict(words, name, source) { + const trie = buildITrieFromWords(pipeSync(words, opMapSync((w) => "!" + w), opMapSync((w) => w.replace(regExpCleanIgnore, "")))); + return new FlagWordsDictionaryTrie(trie, name, source); +} +function bisect(values, predicate) { + const t = /* @__PURE__ */ new Set(); + const f = /* @__PURE__ */ new Set(); + for (const v of values) { + if (predicate(v)) { + t.add(v); + } else { + f.add(v); + } + } + return { t, f }; } -// src/action.ts -var core3 = __toESM(require_core()); - -// node_modules/cspell-glob/dist/esm/globHelper.mjs -var Path = __toESM(require("path"), 1); -var { posix } = Path; -var relRegExp = /^\.[\\/]/; -var isGlobalPatternRegExp = /^!*[*]{2}/; -function fileOrGlobToGlob(fileOrGlob, root, path16 = Path) { - const pathToGlob = path16.sep === "\\" ? (p) => p.replace(/\\/g, "/") : (p) => p; - const isGlobalPattern = false; - if (isGlobPatternWithOptionalRoot(fileOrGlob)) { - const useRoot = fileOrGlob.root ?? root; - const isGlobalPattern2 = isGlobPatternWithRoot(fileOrGlob) ? fileOrGlob.isGlobalPattern : isGlobalGlob(fileOrGlob.glob); - return { ...fileOrGlob, root: useRoot, isGlobalPattern: isGlobalPattern2 }; +// node_modules/cspell-dictionary/dist/SpellingDictionary/IgnoreWordsDictionary.js +var NormalizeForm = "NFC"; +var IgnoreWordsDictionary = class { + constructor(name, source, words) { + this.name = name; + this.source = source; + this.containsNoSuggestWords = true; + this.options = {}; + this.type = "ignore"; + this.isDictionaryCaseSensitive = true; + this.dict = new Set(words); + this.dictNonStrict = new Set(pipeSync(this.dict, opFilterSync((w) => w.startsWith("~")), opMapSync((w) => w.slice(1)))); } - if (doesRootContainPath(root, fileOrGlob, path16) || relRegExp.test(fileOrGlob)) { - const rel = path16.relative(root, path16.resolve(root, fileOrGlob)); - return { glob: pathToGlob(rel), root, isGlobalPattern }; + /** + * A Forbidden word list does not "have" valid words. + * Therefore it always returns false. + * @param _word - the word + * @param _options - options + * @returns always false + */ + has(word, options) { + const nWord = word.normalize(NormalizeForm); + if (this.dict.has(nWord)) + return true; + const lcWord = nWord.toLowerCase(); + if (this.dict.has(lcWord)) + return true; + const ignoreCase2 = options?.ignoreCase ?? ignoreCase; + return ignoreCase2 && (this.dictNonStrict.has(nWord) || this.dictNonStrict.has(lcWord)); + } + /** A more detailed search for a word, might take longer than `has` */ + find(word, options) { + const nWord = word.normalize(NormalizeForm); + if (this.dict.has(nWord)) + return { found: nWord, forbidden: false, noSuggest: true }; + const lcWord = nWord.toLowerCase(); + if (this.dict.has(lcWord)) + return { found: lcWord, forbidden: false, noSuggest: true }; + const ignoreCase2 = options?.ignoreCase ?? ignoreCase; + if (!ignoreCase2) + return void 0; + if (this.dictNonStrict.has(nWord)) + return { found: nWord, forbidden: false, noSuggest: true }; + return this.dictNonStrict.has(lcWord) && { found: lcWord, forbidden: false, noSuggest: true } || void 0; } - return { glob: pathToGlob(fileOrGlob), root, isGlobalPattern }; + isForbidden(_word, _ignoreCase) { + return false; + } + isNoSuggestWord(word, options) { + return this.has(word, options); + } + suggest() { + return []; + } + genSuggestions() { + return; + } + mapWord(word) { + return word; + } + get size() { + return this.dict.size; + } + getErrors() { + return []; + } +}; +var createCache3 = createAutoResolveWeakCache(); +function createIgnoreWordsDictionary(wordList, name, source) { + return createCache3.get(wordList, () => { + const testSpecialCharacters = /[*+]/; + const words = [...parseDictionaryLines(wordList, { stripCaseAndAccents: true })].map((w) => w.normalize(NormalizeForm)); + const hasSpecial = words.findIndex((word) => testSpecialCharacters.test(word)) >= 0; + if (hasSpecial) { + return createSpellingDictionary(words, name, source, { + caseSensitive: true, + noSuggest: true, + weightMap: void 0, + supportNonStrictSearches: true + }); + } + return new IgnoreWordsDictionary(name, source, words); + }); } -function doesRootContainPath(root, child, path16) { - if (child.startsWith(root)) - return true; - const rel = path16.relative(root, child); - return !rel || rel !== child && !rel.startsWith("..") && !path16.isAbsolute(rel); + +// node_modules/cspell-dictionary/dist/SpellingDictionary/SpellingDictionaryCollection.js +function identityString(w) { + return w; } -function isGlobPatternWithOptionalRoot(g) { - return typeof g !== "string" && typeof g.glob === "string"; +var SpellingDictionaryCollectionImpl = class { + constructor(dictionaries, name, source) { + this.dictionaries = dictionaries; + this.name = name; + this.options = { weightMap: void 0 }; + this.mapWord = identityString; + this.type = "SpellingDictionaryCollection"; + this._isNoSuggestWord = (word, options) => { + if (!this.containsNoSuggestWords) + return false; + return !!isNoSuggestWordInAnyDictionary(this.dictionaries, word, options || {}); + }; + this.dictionaries = this.dictionaries.sort((a, b) => b.size - a.size); + this.source = source || dictionaries.map((d) => d.name).join(", "); + this.isDictionaryCaseSensitive = this.dictionaries.reduce((a, b) => a || b.isDictionaryCaseSensitive, false); + this.containsNoSuggestWords = this.dictionaries.reduce((a, b) => a || b.containsNoSuggestWords, false); + } + has(word, hasOptions) { + const options = hasOptionToSearchOption(hasOptions); + return !!isWordInAnyDictionary(this.dictionaries, word, options) && !this.isForbidden(word); + } + find(word, hasOptions) { + const options = hasOptionToSearchOption(hasOptions); + return findInAnyDictionary(this.dictionaries, word, options); + } + isNoSuggestWord(word, options) { + return this._isNoSuggestWord(word, options); + } + isForbidden(word, ignoreCaseAndAccents) { + const ignoreCase2 = ignoreCaseAndAccents ?? isForbiddenIgnoreCaseAndAccents; + return !!this._isForbiddenInDict(word, ignoreCase2) && !this.isNoSuggestWord(word, { ignoreCase: ignoreCase2 }); + } + suggest(word, suggestOptions = {}) { + return this._suggest(word, suggestOptions); + } + _suggest(word, suggestOptions) { + const { numSuggestions = defaultNumSuggestions, numChanges, ignoreCase: ignoreCase2, includeTies, timeout } = suggestOptions; + const prefixNoCase = CASE_INSENSITIVE_PREFIX; + const filter3 = (word2, _cost) => { + return (ignoreCase2 || word2[0] !== prefixNoCase) && !this.isForbidden(word2) && !this.isNoSuggestWord(word2, suggestOptions); + }; + const collectorOptions = { + numSuggestions, + filter: filter3, + changeLimit: numChanges, + includeTies, + ignoreCase: ignoreCase2, + timeout + }; + const collector = suggestionCollector(word, collectorOptions); + this.genSuggestions(collector, suggestOptions); + return collector.suggestions; + } + get size() { + return this.dictionaries.reduce((a, b) => a + b.size, 0); + } + getPreferredSuggestions(word) { + const sugs = this.dictionaries.flatMap((dict) => dict.getPreferredSuggestions?.(word)).filter(isDefined5); + if (sugs.length <= 1) + return sugs; + const unique2 = /* @__PURE__ */ new Set(); + return sugs.filter((sug) => { + if (unique2.has(sug.word)) + return false; + unique2.add(sug.word); + return true; + }); + } + genSuggestions(collector, suggestOptions) { + const _suggestOptions = { ...suggestOptions }; + const { compoundMethod = CompoundWordsMethod.SEPARATE_WORDS } = suggestOptions; + _suggestOptions.compoundMethod = this.options.useCompounds ? CompoundWordsMethod.JOIN_WORDS : compoundMethod; + this.dictionaries.forEach((dict) => dict.genSuggestions(collector, _suggestOptions)); + } + getErrors() { + return this.dictionaries.reduce((errors, dict) => errors.concat(dict.getErrors?.() || []), []); + } + _isForbiddenInDict(word, ignoreCase2) { + return isWordForbiddenInAnyDictionary(this.dictionaries, word, ignoreCase2); + } +}; +function createCollection(dictionaries, name, source) { + return new SpellingDictionaryCollectionImpl(dictionaries, name, source); } -function isGlobPatternWithRoot(g) { - return typeof g.root === "string" && "isGlobalPattern" in g; +function isWordInAnyDictionary(dicts, word, options) { + return genSequence(dicts).first((dict) => dict.has(word, options)); } -function isGlobPatternNormalized(g) { - if (!isGlobPatternWithOptionalRoot(g)) +function findInAnyDictionary(dicts, word, options) { + const found = dicts.map((dict) => dict.find(word, options)).filter(isDefined5); + if (!found.length) + return void 0; + return found.reduce((a, b) => ({ + found: a.forbidden ? a.found : b.forbidden ? b.found : a.found || b.found, + forbidden: a.forbidden || b.forbidden, + noSuggest: a.noSuggest || b.noSuggest + })); +} +function isNoSuggestWordInAnyDictionary(dicts, word, options) { + return genSequence(dicts).first((dict) => dict.isNoSuggestWord(word, options)); +} +function isWordForbiddenInAnyDictionary(dicts, word, ignoreCase2) { + return genSequence(dicts).first((dict) => dict.isForbidden(word, ignoreCase2)); +} + +// node_modules/cspell-dictionary/dist/SpellingDictionary/SuggestDictionary.js +var SuggestDictionaryImpl = class { + constructor(name, source, typosDef) { + this.name = name; + this.source = source; + this.typosDef = typosDef; + this.containsNoSuggestWords = false; + this.options = {}; + this.type = "suggest"; + this.isDictionaryCaseSensitive = true; + this.size = Object.keys(typosDef).length; + this.suggestions = extractAllSuggestions(typosDef); + this.suggestionsLower = new Set(pipeSync(this.suggestions, mapperRemoveCaseAndAccents)); + } + /** + * A Forbidden word list does not "have" valid words. + * Therefore it always returns false. + * @param _word - the word + * @param _options - options + * @returns always false + */ + has(_word, _options) { return false; - if (!isGlobPatternWithRoot(g)) + } + /** A more detailed search for a word, might take longer than `has` */ + find(_word, _options) { + return void 0; + } + isForbidden(_word, _ignoreCaseAndAccents) { return false; - const gr = g; - return "rawGlob" in gr && "rawRoot" in gr && typeof gr.rawGlob === "string"; -} -function normalizePattern(pattern, nested) { - pattern = pattern.replace(/^(!!)+/, ""); - const isNeg = pattern.startsWith("!"); - const prefix = isNeg ? "!" : ""; - pattern = isNeg ? pattern.slice(1) : pattern; - const patterns = nested ? normalizePatternNested(pattern) : normalizePatternGeneral(pattern); - return patterns.map((p) => prefix + p); -} -function normalizePatternNested(pattern) { - if (!pattern.includes("/")) { - if (pattern === "**") - return ["**"]; - return ["**/" + pattern, "**/" + pattern + "/**"]; } - const hasLeadingSlash = pattern.startsWith("/"); - pattern = hasLeadingSlash ? pattern.slice(1) : pattern; - if (pattern.endsWith("/")) { - return hasLeadingSlash || pattern.slice(0, -1).includes("/") ? [pattern + "**/*"] : ["**/" + pattern + "**/*"]; + isNoSuggestWord(_word, _options) { + return false; } - if (pattern.endsWith("**")) { - return [pattern]; + /** + * Determine if the word can appear in a list of suggestions. + * @param word - word + * @param ignoreCaseAndAccents - ignore case. + * @returns true if a word is suggested, otherwise false. + */ + isSuggestedWord(word, ignoreCaseAndAccents = isForbiddenIgnoreCaseAndAccents) { + if (this.suggestions.has(word)) + return true; + const lcWord = word.toLowerCase(); + return ignoreCaseAndAccents && (this.suggestions.has(lcWord) || this.suggestionsLower.has(lcWord)); } - return [pattern, pattern + "/**"]; -} -function normalizePatternGeneral(pattern) { - pattern = pattern.startsWith("/") ? pattern.slice(1) : pattern; - pattern = pattern.endsWith("/") ? pattern + "**/*" : pattern; - return [pattern]; -} -function normalizeGlobPatterns(patterns, options) { - function* normalize() { - for (const glob2 of patterns) { - if (isGlobPatternNormalized(glob2)) { - yield glob2; - continue; - } - yield* normalizeGlobPattern(glob2, options); + suggest(word) { + return this.getPreferredSuggestions(word); + } + _suggest(word) { + if (!(word in this.typosDef)) + return void 0; + const sug = this.typosDef[word]; + const isPreferred = true; + if (!sug) + return []; + if (typeof sug === "string") { + return [ + { + word: sug, + cost: 1, + isPreferred + } + ]; } + return sug.map((word2, index) => ({ word: word2, cost: index + 1, isPreferred })); } - return [...normalize()]; -} -function normalizeGlobPattern(g, options) { - const { root, nodePath: path16 = Path, nested, cwd = Path.resolve() } = options; - g = !isGlobPatternWithOptionalRoot(g) ? { glob: g } : g; - const gr = { ...g, root: g.root ?? root }; - const rawRoot = gr.root; - const rawGlob = g.glob; - gr.glob = gr.glob.trim(); - if (gr.glob.startsWith("${cwd}")) { - gr.glob = gr.glob.replace("${cwd}", ""); - gr.root = "${cwd}"; + getPreferredSuggestions(word) { + return this._suggest(word) || this._suggest(word.toLowerCase()) || []; } - if (gr.root.startsWith("${cwd}")) { - gr.root = path16.resolve(gr.root.replace("${cwd}", cwd)); + genSuggestions(collector) { + const sugs = this.suggest(collector.word); + sugs.forEach((result) => collector.add(result)); } - const isGlobalPattern = isGlobalGlob(gr.glob); - gr.root = path16.resolve(root, path16.normalize(gr.root)); - const globs = normalizePattern(gr.glob, nested); - return globs.map((glob2) => ({ ...gr, glob: glob2, rawGlob, rawRoot, isGlobalPattern })); + mapWord(word) { + return word; + } + getErrors() { + return []; + } +}; +var createCache4 = createAutoResolveWeakCache(); +function createSuggestDictionary(entries, name, source) { + return createCache4.get(entries, () => { + const def = processEntriesToTyposDef(entries); + return new SuggestDictionaryImpl(name, source, def); + }); } -function normalizeGlobToRoot(glob2, root, path16) { - function relToGlob(relativePath2) { - return path16.sep === "\\" ? relativePath2.replace(/\\/g, "/") : relativePath2; + +// node_modules/cspell-dictionary/dist/SpellingDictionary/createInlineSpellingDictionary.js +var cache = createAutoResolveWeakCache(); +function createInlineSpellingDictionary(inlineDict, source) { + return cache.get(inlineDict, () => { + const { words, flagWords, ignoreWords, suggestWords, name } = inlineDict; + const dictSources = [ + words && createSpellingDictionary(words, name + "-words", source, inlineDict), + flagWords && createFlagWordsDictionary(flagWords, name + "-flag-words", source), + ignoreWords && createIgnoreWordsDictionary(ignoreWords, name + "-ignore-words", source), + suggestWords && createSuggestDictionary(suggestWords, name + "-suggest", source) + ].filter(isDefined5); + return createCollection(dictSources, name, source); + }); +} + +// node_modules/cspell-lib/dist/esm/static.mjs +var cspellIO = new CSpellIONode(); +function getCSpellIO() { + return cspellIO; +} + +// node_modules/@cspell/strong-weak-map/dist/esm/StrongWeakMap.mjs +var _a; +var StrongWeakMap = class { + constructor(init) { + this[_a] = "StrongWeakMap"; + this.map = new Map(init?.map(([k, v]) => [k, new WeakRef(v)])); } - if (glob2.root === root) { - return glob2; + clear() { + this.map.clear(); } - const relFromRootToGlob = path16.relative(root, glob2.root); - if (!relFromRootToGlob) { - return glob2; + /** + * @returns true if an element in the Map existed and has been removed, or false if the element does not exist. + */ + delete(key) { + return this.map.delete(key); } - if (glob2.isGlobalPattern) { - return { ...glob2, root }; + /** + * Executes a provided function once per each key/value pair in the Map, in insertion order. + */ + forEach(callbackfn, thisArg) { + if (thisArg) { + callbackfn = callbackfn.bind(thisArg); + } + for (const [key, value] of this) { + callbackfn(value, key, this); + } } - const relFromGlobToRoot = path16.relative(glob2.root, root); - const globIsUnderRoot = relFromRootToGlob[0] !== "." && !path16.isAbsolute(relFromRootToGlob); - const rootIsUnderGlob = relFromGlobToRoot[0] !== "." && !path16.isAbsolute(relFromGlobToRoot); - if (!globIsUnderRoot && !rootIsUnderGlob) { - return glob2; + /** + * Returns a specified element from the Map object. You will get a reference to the value object and any change made to that + * object will effectively modify it inside the Map. + * @returns Returns the element associated with the specified key. + * If no element is associated with the specified key, undefined is returned. + */ + get(key) { + const ref = this.map.get(key); + if (!ref) + return void 0; + const value = ref.deref(); + if (!value) { + this.map.delete(key); + return void 0; + } + return value; } - const isNeg = glob2.glob.startsWith("!"); - const g = isNeg ? glob2.glob.slice(1) : glob2.glob; - const prefix = isNeg ? "!" : ""; - if (globIsUnderRoot) { - const relGlob2 = relToGlob(relFromRootToGlob); - return { - ...glob2, - glob: prefix + posix.join(relGlob2, g), - root - }; + /** + * Returns a specified element from the Map. If the element isn't found, the resolver function is called and the result is stored in the map and returned. + */ + autoGet(key, resolver) { + const found = this.get(key); + if (found) + return found; + const created = resolver(key); + this.set(key, created); + return created; } - const relGlob = relToGlob(relFromGlobToRoot) + "/"; - const rebasedGlob = rebaseGlob(g, relGlob); - return rebasedGlob ? { ...glob2, glob: prefix + rebasedGlob, root } : glob2; -} -function rebaseGlob(glob2, rebaseTo) { - if (!rebaseTo || rebaseTo === "/") - return glob2; - if (glob2.startsWith("**")) - return glob2; - rebaseTo = rebaseTo.endsWith("/") ? rebaseTo : rebaseTo + "/"; - if (glob2.startsWith(rebaseTo)) { - return glob2.slice(rebaseTo.length); + /** + * Note: has will cause the value object to live longer. + * See: [WeakRef - JavaScript | MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) + * @returns boolean indicating whether an element with the specified key exists or not. + */ + has(key) { + const value = this.get(key); + return !!value; } - const relParts = rebaseTo.split("/"); - const globParts = glob2.split("/"); - for (let i = 0; i < relParts.length && i < globParts.length; ++i) { - const relSeg = relParts[i]; - const globSeg = globParts[i]; - if (!relSeg || globSeg === "**") { - return globParts.slice(i).join("/"); + /** + * Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated. + */ + set(key, value) { + this.map.set(key, new WeakRef(value)); + return this; + } + /** + * @returns the number of elements in the Map. Note: it is possible that some of the values have been dereferenced + */ + get size() { + return this.map.size; + } + /** Returns an iterable of entries in the map. */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * Returns an iterable of key, value pairs for every entry in the map. + */ + *entries() { + for (const key of this.map.keys()) { + const value = this.get(key); + if (!value) + continue; + yield [key, value]; } - if (relSeg !== globSeg && globSeg !== "*") { - break; + } + /** + * Returns an iterable of keys in the map + * + * Note: It is possible that the value associated with the key was released. + */ + keys() { + return this.map.keys(); + } + /** + * Returns an iterable of values in the map + */ + *values() { + for (const [_, value] of this) { + yield value; } } - return void 0; -} -function isGlobalGlob(glob2) { - return isGlobalPatternRegExp.test(glob2); -} + /** + * Removes any keys that reference released objects. + */ + cleanKeys() { + [...this]; + return this; + } +}; +_a = Symbol.toStringTag; -// node_modules/cspell-glob/dist/esm/GlobMatcher.mjs -var import_micromatch = __toESM(require_micromatch(), 1); -var Path2 = __toESM(require("path"), 1); -var GlobMatcher = class { - constructor(patterns, rootOrOptions, _nodePath) { - _nodePath = _nodePath ?? Path2; - const options = typeof rootOrOptions === "string" ? { root: rootOrOptions } : rootOrOptions ?? {}; - const { mode = "exclude" } = options; - const isExcludeMode = mode !== "include"; - _nodePath = options.nodePath ?? _nodePath; - const { root = _nodePath.resolve(), dot = isExcludeMode, nodePath = _nodePath, nested = isExcludeMode, cwd = process.cwd(), nobrace } = options; - const normalizedRoot = nodePath.resolve(nodePath.normalize(root)); - this.options = { root: normalizedRoot, dot, nodePath, nested, mode, nobrace, cwd }; - patterns = Array.isArray(patterns) ? patterns : typeof patterns === "string" ? patterns.split(/\r?\n/g) : [patterns]; - const globPatterns = normalizeGlobPatterns(patterns, this.options); - this.patternsNormalizedToRoot = globPatterns.map((g) => normalizeGlobToRoot(g, normalizedRoot, nodePath)).filter((g) => nodePath.relative(g.root, normalizedRoot) === ""); - this.patterns = globPatterns; - this.root = normalizedRoot; - this.path = nodePath; - this.dot = dot; - this.matchEx = buildMatcherFn(this.patterns, this.options); +// node_modules/cspell-lib/dist/esm/SpellingDictionary/SpellingDictionaryError.mjs +var SpellingDictionaryLoadError = class extends Error { + constructor(uri, options, cause, message) { + super(message); + this.uri = uri; + this.options = options; + this.cause = cause; + this.name = options.name; + } +}; +function isSpellingDictionaryLoadError(e) { + return e instanceof SpellingDictionaryLoadError; +} + +// node_modules/cspell-lib/dist/esm/SpellingDictionary/DictionaryController/DictionaryLoader.mjs +var MAX_AGE = 1e4; +var loaders = { + S: loadSimpleWordList, + C: legacyWordList, + W: wordsPerLineWordList, + T: loadTrie, + default: loadSimpleWordList +}; +var loadersSync = { + S: loadSimpleWordListSync, + C: legacyWordListSync, + W: wordsPerLineWordListSync, + T: loadTrieSync, + default: loadSimpleWordListSync +}; +var LoadingState; +(function(LoadingState2) { + LoadingState2[LoadingState2["Loaded"] = 0] = "Loaded"; + LoadingState2[LoadingState2["Loading"] = 1] = "Loading"; +})(LoadingState || (LoadingState = {})); +var DictionaryLoader = class { + constructor(cspellIO2) { + this.cspellIO = cspellIO2; + this.dictionaryCache = new StrongWeakMap(); + this.inlineDictionaryCache = new AutoResolveWeakCache(); + this.dictionaryCacheByDef = new StrongWeakMap(); + this.reader = toReader(cspellIO2); + } + loadDictionary(def) { + if (isDictionaryDefinitionInlineInternal(def)) { + return Promise.resolve(this.loadInlineDict(def)); + } + const { key, entry } = this.getCacheEntry(def); + if (entry) { + return entry.pending.then(([dictionary]) => dictionary); + } + const loadedEntry = this.loadEntry(def.path, def); + this.setCacheEntry(key, loadedEntry, def); + return loadedEntry.pending.then(([dictionary]) => dictionary); + } + loadDictionarySync(def) { + if (isDictionaryDefinitionInlineInternal(def)) { + return this.loadInlineDict(def); + } + const { key, entry } = this.getCacheEntry(def); + if (entry?.dictionary && entry.loadingState === LoadingState.Loaded) { + return entry.dictionary; + } + const loadedEntry = this.loadEntrySync(def.path, def); + this.setCacheEntry(key, loadedEntry, def); + return loadedEntry.dictionary; + } + /** + * Check to see if any of the cached dictionaries have changed. If one has changed, reload it. + * @param maxAge - Only check the dictionary if it has been at least `maxAge` ms since the last check. + * @param now - optional timestamp representing now. (Mostly used in testing) + */ + async refreshCacheEntries(maxAge = MAX_AGE, now = Date.now()) { + await Promise.all([...this.dictionaryCache.values()].map((entry) => this.refreshEntry(entry, maxAge, now))); + } + getCacheEntry(def) { + const defEntry = this.dictionaryCacheByDef.get(def); + if (defEntry) { + return defEntry; + } + const key = calcKey(def); + const entry = this.dictionaryCache.get(key); + if (entry) { + entry.options = def; + } + return { key, entry }; + } + setCacheEntry(key, entry, def) { + this.dictionaryCache.set(key, entry); + this.dictionaryCacheByDef.set(def, { key, entry }); + } + async refreshEntry(entry, maxAge, now) { + if (now - entry.ts >= maxAge) { + const sig = now + Math.random(); + entry.sig = sig; + entry.ts = now; + const pStat = this.getStat(entry.uri); + const [newStat] = await Promise.all([pStat, entry.pending]); + const hasChanged = !this.isEqual(newStat, entry.stat); + const sigMatches = entry.sig === sig; + if (sigMatches && hasChanged) { + entry.loadingState = LoadingState.Loading; + const key = calcKey(entry.options); + const newEntry = this.loadEntry(entry.uri, entry.options); + this.dictionaryCache.set(key, newEntry); + this.dictionaryCacheByDef.set(entry.options, { key, entry: newEntry }); + } + } + } + loadEntry(uri, options, now = Date.now()) { + options = this.normalizeOptions(uri, options); + const pDictionary = load(this.reader, uri, options).catch((e) => createFailedToLoadDictionary(options.name, uri, new SpellingDictionaryLoadError(uri, options, e, "failed to load"), options)); + const pStat = this.getStat(uri); + const pending = Promise.all([pDictionary, pStat]); + const sig = now + Math.random(); + const entry = { + uri, + options, + ts: now, + stat: void 0, + dictionary: void 0, + pending, + loadingState: LoadingState.Loading, + sig + }; + pending.then(([dictionary, stat2]) => { + entry.stat = stat2; + entry.dictionary = dictionary; + entry.loadingState = LoadingState.Loaded; + return; + }); + return entry; + } + loadEntrySync(uri, options, now = Date.now()) { + options = this.normalizeOptions(uri, options); + const stat2 = this.getStatSync(uri); + const sig = now + Math.random(); + try { + const dictionary = loadSync(this.reader, uri, options); + const pending = Promise.resolve([dictionary, stat2]); + return { + uri, + options, + ts: now, + stat: stat2, + dictionary, + pending, + loadingState: LoadingState.Loaded, + sig + }; + } catch (e) { + const error2 = toError2(e); + const dictionary = createFailedToLoadDictionary(options.name, uri, new SpellingDictionaryLoadError(uri, options, error2, "failed to load"), options); + const pending = Promise.resolve([dictionary, stat2]); + return { + uri, + options, + ts: now, + stat: stat2, + dictionary, + pending, + loadingState: LoadingState.Loaded, + sig + }; + } + } + getStat(uri) { + return this.cspellIO.getStat(uri).catch(toError2); + } + getStatSync(uri) { + try { + return this.cspellIO.getStatSync(uri); + } catch (e) { + return toError2(e); + } + } + isEqual(a, b) { + if (!b) + return false; + if (isError3(a)) { + return isError3(b) && a.message === b.message && a.name === b.name; + } + return !isError3(b) && !this.cspellIO.compareStats(a, b); } - /** - * Check to see if a filename matches any of the globs. - * If filename is relative, it is considered relative to the root. - * If filename is absolute and contained within the root, it will be made relative before being tested for a glob match. - * If filename is absolute and not contained within the root, it will be tested as is. - * @param filename full path of the file to check. - */ - match(filename) { - return this.matchEx(filename).matched; + normalizeOptions(uri, options) { + if (options.name) + return options; + return { ...options, name: this.cspellIO.uriBasename(uri) }; + } + loadInlineDict(def) { + return this.inlineDictionaryCache.get(def, (def2) => createInlineSpellingDictionary(def2, def2.__source || "memory")); } }; -function buildMatcherFn(patterns, options) { - const { nodePath: path16, dot, nobrace } = options; - const makeReOptions = { dot, nobrace }; - const rules = patterns.map((pattern, index) => ({ pattern, index })).filter((r) => !!r.pattern.glob).filter((r) => !r.pattern.glob.startsWith("#")).map(({ pattern, index }) => { - const matchNeg = pattern.glob.match(/^!/); - const glob2 = pattern.glob.replace(/^!/, ""); - const isNeg = matchNeg && matchNeg[0].length & 1 && true || false; - const reg = import_micromatch.default.makeRe(glob2, makeReOptions); - const fn2 = (filename) => { - const match = filename.match(reg); - return !!match; - }; - return { pattern, index, isNeg, fn: fn2, reg }; - }); - const negRules = rules.filter((r) => r.isNeg); - const posRules = rules.filter((r) => !r.isNeg); - const fn = (filename) => { - filename = path16.resolve(path16.normalize(filename)); - function testRules(rules2, matched) { - for (const rule of rules2) { - const pattern = rule.pattern; - const root = pattern.root; - const isRelPat = !pattern.isGlobalPattern; - if (isRelPat && !doesRootContainPath(root, filename, path16)) { - continue; - } - const relName = isRelPat ? path16.relative(root, filename) : filename; - const fname = path16.sep === "\\" ? relName.replace(/\\/g, "/") : relName; - if (rule.fn(fname)) { - return { - matched, - glob: pattern.glob, - root, - pattern, - index: rule.index, - isNeg: rule.isNeg - }; - } - } - } - return testRules(negRules, false) || testRules(posRules, true) || { matched: false }; +function toReader(cspellIO2) { + return { + read: async (filename) => (await cspellIO2.readFile(filename)).content, + readLines: async (filename) => toLines((await cspellIO2.readFile(filename)).content), + readSync: (filename) => cspellIO2.readFileSync(filename).content, + readLinesSync: (filename) => toLines(cspellIO2.readFileSync(filename).content) }; - return fn; +} +var importantOptionKeys = ["name", "noSuggest", "useCompounds", "type"]; +function calcKey(def) { + const path26 = def.path; + const loaderType = determineType(path26, def); + const optValues = importantOptionKeys.map((k) => def[k]?.toString() || ""); + const parts = [path26, loaderType].concat(optValues); + return parts.join("|"); +} +function isError3(e) { + const err = e; + return !!err.message; +} +function determineType(uri, opts) { + const t = opts.type && opts.type in loaders && opts.type || "S"; + const defLoaderType = t; + const defType = uri.endsWith(".trie.gz") ? "T" : defLoaderType; + const regTrieTest = /\.trie\b/i; + return regTrieTest.test(uri) ? "T" : defType; +} +function load(reader2, uri, options) { + const type = determineType(uri, options); + const loader2 = loaders[type] || loaders.default; + return loader2(reader2, uri, options); +} +function loadSync(reader2, uri, options) { + const type = determineType(uri, options); + const loader2 = loadersSync[type] || loaders.default; + return loader2(reader2, uri, options); +} +async function legacyWordList(reader2, filename, options) { + const lines = await reader2.readLines(filename); + return _legacyWordListSync(lines, filename, options); +} +function legacyWordListSync(reader2, filename, options) { + const lines = reader2.readLinesSync(filename); + return _legacyWordListSync(lines, filename, options); +} +function _legacyWordListSync(lines, filename, options) { + const words = pipeSync( + lines, + // Remove comments + opMapSync((line) => line.replace(/#.*/g, "")), + // Split on everything else + opConcatMapSync((line) => line.split(/[^\w\p{L}\p{M}'’]+/gu)), + opFilterSync((word) => !!word) + ); + return createSpellingDictionary(words, options.name, filename, options); +} +async function wordsPerLineWordList(reader2, filename, options) { + const lines = await reader2.readLines(filename); + return _wordsPerLineWordList(lines, filename, options); +} +function wordsPerLineWordListSync(reader2, filename, options) { + const lines = reader2.readLinesSync(filename); + return _wordsPerLineWordList(lines, filename, options); +} +function _wordsPerLineWordList(lines, filename, options) { + const words = pipeSync( + lines, + // Remove comments + opMapSync((line) => line.replace(/#.*/g, "")), + // Split on everything else + opConcatMapSync((line) => line.split(/\s+/gu)), + opFilterSync((word) => !!word) + ); + return createSpellingDictionary(words, options.name, filename, options); +} +async function loadSimpleWordList(reader2, filename, options) { + const lines = await reader2.readLines(filename); + return createSpellingDictionary(lines, options.name, filename, options); +} +function loadSimpleWordListSync(reader2, filename, options) { + const lines = reader2.readLinesSync(filename); + return createSpellingDictionary(lines, options.name, filename, options); +} +async function loadTrie(reader2, filename, options) { + const content = await reader2.read(filename); + return createSpellingDictionaryFromTrieFile(content, options.name, filename, options); +} +function loadTrieSync(reader2, filename, options) { + const content = reader2.readSync(filename); + return createSpellingDictionaryFromTrieFile(content, options.name, filename, options); +} +function toLines(content) { + return content.split(/\n|\r\n|\r/); } -// src/action.ts -var path15 = __toESM(require("path")); +// node_modules/cspell-lib/dist/esm/SpellingDictionary/DictionaryLoader.mjs +var loader; +function getDictionaryLoader(cspellIO2) { + if (loader) + return loader; + return loader = new DictionaryLoader(cspellIO2 || getCSpellIO()); +} +function loadDictionary(def) { + return getDictionaryLoader().loadDictionary(def); +} +function loadDictionarySync(def) { + return getDictionaryLoader().loadDictionarySync(def); +} +async function refreshCacheEntries(maxAge, now) { + return getDictionaryLoader().refreshCacheEntries(maxAge, now); +} -// src/ActionParams.ts -var import_fs = require("fs"); -var defaultActionParams = { - github_token: "", - files: "", - incremental_files_only: "true", - config: "", - root: "", - inline: "warning", - strict: "true", - verbose: "false", - check_dot_files: "explicit" -}; -function applyDefaults(params) { - const results = { ...params }; - const alias = results; - for (const [key, value] of Object.entries(defaultActionParams)) { - alias[key] = alias[key] || value; - } - return results; +// node_modules/cspell-lib/dist/esm/SpellingDictionary/Dictionaries.mjs +function loadDictionaryDefs(defsToLoad) { + return defsToLoad.map(loadDictionary); } -function validateToken(params) { - const token = params.github_token; - return !token ? "Missing GITHUB Token" : void 0; +function loadDictionaryDefsSync(defsToLoad) { + return defsToLoad.map(loadDictionarySync); } -function validateConfig(params) { - const config = params.config; - const success = !config || (0, import_fs.existsSync)(config); - return !success ? `Configuration file "${config}" not found.` : void 0; +function refreshDictionaryCache(maxAge) { + return refreshCacheEntries(maxAge); } -function validateRoot(params) { - const root = params.root; - const success = !root || (0, import_fs.existsSync)(root); - return !success ? `Root path does not exist: "${root}"` : void 0; +var emptyWords2 = Object.freeze([]); +async function getDictionaryInternal(settings) { + const spellDictionaries = await Promise.all(loadDictionaryDefs(calcDictionaryDefsToLoad(settings))); + return _getDictionaryInternal(settings, spellDictionaries); } -function validateInlineLevel(params) { - const inline = params.inline; - const success = isInlineWorkflowCommand(inline); - return !success ? `Invalid inline level (${inline}), must be one of (error, warning, none)` : void 0; +function getDictionaryInternalSync(settings) { + const spellDictionaries = loadDictionaryDefsSync(calcDictionaryDefsToLoad(settings)); + return _getDictionaryInternal(settings, spellDictionaries); } -var validateStrict = validateTrueFalse("strict", "Invalid strict setting, must be one of (true, false)"); -var validateIncrementalFilesOnly = validateTrueFalse( - "incremental_files_only", - "Invalid incremental_files_only setting, must be one of (true, false)" -); -var validateVerbose = validateTrueFalse("verbose", "Invalid verbose setting, must be one of (true, false)"); -function validateTrueFalse(key, msg) { - return (params) => { - const value = params[key]; - const success = value === "true" || value === "false"; - return !success ? msg : void 0; +function _getDictionaryInternal(settings, spellDictionaries) { + const { words = emptyWords2, userWords = emptyWords2, flagWords = emptyWords2, ignoreWords = emptyWords2, suggestWords = emptyWords2 } = settings; + const settingsWordsDictionary = createSpellingDictionary(words, "[words]", "From Settings `words`", { + caseSensitive: true, + weightMap: void 0 + }); + const settingsUserWordsDictionary = userWords.length ? createSpellingDictionary(userWords, "[userWords]", "From Settings `userWords`", { + caseSensitive: true, + weightMap: void 0 + }) : void 0; + const ignoreWordsDictionary = createIgnoreWordsDictionary(ignoreWords, "[ignoreWords]", "From Settings `ignoreWords`"); + const flagWordsDictionary = createFlagWordsDictionary(flagWords, "[flagWords]", "From Settings `flagWords`"); + const suggestWordsDictionary = createSuggestDictionary(suggestWords, "[suggestWords]", "From Settings `suggestWords`"); + const dictionaries = [ + ...spellDictionaries, + settingsWordsDictionary, + settingsUserWordsDictionary, + ignoreWordsDictionary, + flagWordsDictionary, + suggestWordsDictionary + ].filter(isDefined); + return createCollection(dictionaries, "dictionary collection"); +} + +// node_modules/cspell-lib/dist/esm/Settings/InDocSettings.mjs +var regExMatchRegEx = /\/.*\/[gimuy]*/; +var regExCSpellInDocDirective = /\b(?:spell-?checker|c?spell)::?(.*)/gi; +var regExCSpellDirectiveKey = /(?<=\b(?:spell-?checker|c?spell)::?)(?!:)(.*)/i; +var regExInFileSettings = [regExCSpellInDocDirective, /\b(LocalWords:?.*)/g]; +var officialDirectives = [ + "enable", + "disable", + "disable-line", + "disable-next", + "disable-next-line", + "word", + "words", + "ignore", + "ignoreWord", + "ignoreWords", + "ignore-word", + "ignore-words", + "includeRegExp", + "ignoreRegExp", + "local", + "locale", + "language", + "dictionaries", + "dictionary", + "forbid", + "forbidWord", + "forbid-word", + "flag", + "flagWord", + "flag-word", + "enableCompoundWords", + "enableAllowCompoundWords", + "disableCompoundWords", + "disableAllowCompoundWords", + "enableCaseSensitive", + "disableCaseSensitive" +]; +var noSuggestDirectives = /* @__PURE__ */ new Set(["local"]); +var preferredDirectives = [ + "enable", + "disable", + "disable-line", + "disable-next-line", + "words", + "ignore", + "forbid", + "locale", + "dictionary", + "dictionaries", + "enableCaseSensitive", + "disableCaseSensitive" +]; +var allDirectives = new Set(preferredDirectives.concat(officialDirectives)); +var allDirectiveSuggestions = [ + ...pipeSync(allDirectives, opMapSync((word) => ({ word }))) +]; +var dictInDocSettings = createSpellingDictionary(allDirectives, "Directives", "Directive List", { + supportNonStrictSearches: false +}); +var EmptyWords = []; +Object.freeze(EmptyWords); +var staticInDocumentDictionaryName = `[in-document-dict]`; +function getInDocumentSettings(text) { + const collectedSettings = getPossibleInDocSettings(text).concatMap((a) => parseSettingMatch(a)).reduce((s, setting) => { + return mergeInDocSettings(s, setting); + }, { id: "in-doc-settings" }); + const { words, flagWords, ignoreWords, suggestWords, dictionaries = [], dictionaryDefinitions = [], ...rest } = collectedSettings; + const dict = (words || flagWords || ignoreWords || suggestWords) && clean({ + name: staticInDocumentDictionaryName, + words, + flagWords, + ignoreWords, + suggestWords + }); + const dictSettings = dict ? { + dictionaries: dictionaries.concat(staticInDocumentDictionaryName), + dictionaryDefinitions: dictionaryDefinitions.concat(dict) + } : clean({ + dictionaries: dictionaries.length ? dictionaries : void 0, + dictionaryDefinitions: dictionaryDefinitions.length ? dictionaryDefinitions : void 0 + }); + const settings = { + ...rest, + ...dictSettings }; -} -var inlineWorkflowCommandSet = { - error: true, - warning: true, - none: true + return settings; +} +function validateInDocumentSettings(docText, _settings) { + return pipeSync(getPossibleInDocSettings(docText), opMapSync(parseSettingMatchValidation), opFilterSync(isDefined)); +} +var settingParsers = [ + [/^(?:enable|disable)(?:allow)?CompoundWords\b(?!-)/i, parseCompoundWords], + [/^(?:enable|disable)CaseSensitive\b(?!-)/i, parseCaseSensitive], + [/^enable\b(?!-)/i, parseEnable], + [/^disable(-line|-next(-line)?)?\b(?!-)/i, parseDisable], + [/^words?\b(?!-)/i, parseWords], + [/^ignore(?:-?words?)?\b(?!-)/i, parseIgnoreWords], + [/^(?:flag|forbid)(?:-?words?)?\b(?!-)/i, parseFlagWords], + [/^ignore_?Reg_?Exp\s+.+$/i, parseIgnoreRegExp], + [/^include_?Reg_?Exp\s+.+$/i, parseIncludeRegExp], + [/^locale?\b(?!-)/i, parseLocale2], + [/^language\s\b(?!-)/i, parseLocale2], + [/^dictionar(?:y|ies)\b(?!-)/i, parseDictionaries], + [/^LocalWords:/, (w) => parseWords(w.replace(/^LocalWords:?/gi, " "))] +]; +var emptySettings = Object.freeze({}); +var issueMessages = { + unknownDirective: "Unknown CSpell directive" }; -function isInlineWorkflowCommand(cmd) { - return !!inlineWorkflowCommandSet[cmd]; +function parseSettingMatchValidation(matchArray) { + const [fullMatch = ""] = matchArray; + const directiveMatch = fullMatch.match(regExCSpellDirectiveKey); + if (!directiveMatch) + return void 0; + const match2 = directiveMatch[1]; + const possibleSetting = match2.trim(); + if (!possibleSetting) + return void 0; + const start = (matchArray.index || 0) + (directiveMatch.index || 0) + (match2.length - match2.trimStart().length); + const text = possibleSetting.replace(/^([-\w]+)?.*/, "$1"); + const end = start + text.length; + if (!text) + return void 0; + const matchingParsers = settingParsers.filter(([regex]) => regex.test(possibleSetting)); + if (matchingParsers.length > 0) + return void 0; + const dictSugs = dictInDocSettings.suggest(text, { ignoreCase: false }).map(({ word, isPreferred }) => isPreferred ? { word, isPreferred } : { word }).filter((a) => !noSuggestDirectives.has(a.word)); + const sugs = pipeSync(dictSugs, opAppendSync(allDirectiveSuggestions), filterUniqueSuggestions); + const suggestionsEx = [...sugs].slice(0, 8); + const suggestions = suggestionsEx.map((s) => s.word); + const issue = { + range: [start, end], + text, + message: issueMessages.unknownDirective, + suggestions, + suggestionsEx + }; + return issue; } -function validateActionParams(params, logError) { - const validations = [ - validateToken, - validateConfig, - validateRoot, - validateInlineLevel, - validateStrict, - validateIncrementalFilesOnly, - validateVerbose - ]; - const success = validations.map((fn) => fn(params)).map((msg) => !msg || (logError(msg), false)).reduce((a, b) => a && b, true); - if (!success) { - throw new AppError("Bad Configuration."); +function* filterUniqueSuggestions(sugs) { + const map3 = /* @__PURE__ */ new Map(); + for (const sug of sugs) { + const existing = map3.get(sug.word); + if (existing) { + if (sug.isPreferred) { + existing.isPreferred = true; + } + } + yield sug; } } - -// src/getActionParams.ts -var core = __toESM(require_core()); -function getActionParams() { - return applyDefaults({ - github_token: core.getInput("github_token", { required: true }), - files: core.getInput("files"), - incremental_files_only: tf(core.getInput("incremental_files_only")), - config: core.getInput("config"), - root: core.getInput("root"), - inline: core.getInput("inline").toLowerCase(), - strict: tf(core.getInput("strict")), - verbose: tf(core.getInput("verbose")), - check_dot_files: tf(core.getInput("check_dot_files")) +function parseSettingMatch(matchArray) { + const [, match2 = ""] = matchArray; + const possibleSetting = match2.trim(); + return settingParsers.filter(([regex]) => regex.test(possibleSetting)).map(([, fn]) => fn).map((fn) => fn(possibleSetting)); +} +function parseCompoundWords(match2) { + const allowCompoundWords = /enable/i.test(match2); + return { allowCompoundWords }; +} +function parseCaseSensitive(match2) { + const caseSensitive = /enable/i.test(match2); + return { caseSensitive }; +} +function parseWords(match2) { + const words = match2.split(/[,\s;]+/g).slice(1).filter((a) => !!a); + return { words }; +} +function parseLocale2(match2) { + const parts = match2.trim().split(/[\s,]+/); + const language = parts.slice(1).join(","); + return language ? { language } : emptySettings; +} +function parseIgnoreWords(match2) { + const wordsSetting = parseWords(match2); + const ignoreWords = wordsSetting.words; + return ignoreWords && ignoreWords.length ? { ignoreWords } : emptySettings; +} +function parseFlagWords(match2) { + const wordsSetting = parseWords(match2); + const flagWords = wordsSetting.words; + return flagWords && flagWords.length ? { flagWords } : emptySettings; +} +function parseRegEx(match2) { + const patterns = [match2.replace(/^[^\s]+\s+/, "")].map((a) => { + const m = a.match(regExMatchRegEx); + if (m && m[0]) { + return m[0]; + } + return a.replace(/((?:[^\s]|\\ )+).*/, "$1"); }); + return patterns; } -function tf(v) { - const mapValues = { - true: "true", - t: "true", - false: "false", - f: "false", - "0": "false", - "1": "true" - }; - v = typeof v === "boolean" || typeof v === "number" ? v ? "true" : "false" : v; - v = v.toString(); - v = v.toLowerCase(); - v = mapValues[v] || v; - return v; +function parseIgnoreRegExp(match2) { + const ignoreRegExpList = parseRegEx(match2); + return { ignoreRegExpList }; } - -// src/github.ts -var import_plugin_rest_endpoint_methods = __toESM(require_dist_node11()); -async function getPullRequestFiles(git, prRef) { - const { owner, repo, pull_number } = prRef; - const { rest } = (0, import_plugin_rest_endpoint_methods.restEndpointMethods)(git); - const commits = await rest.pulls.listCommits({ owner, repo, pull_number }); - return fetchFilesForCommits(git, prRef, commits.data.map((c) => c.sha).filter(isString)); +function parseIncludeRegExp(match2) { + const includeRegExpList = parseRegEx(match2); + return { includeRegExpList }; } -function isString(s) { - return typeof s === "string"; +function parseDictionaries(match2) { + const dictionaries = match2.split(/[,\s]+/g).slice(1); + return { dictionaries }; } -async function fetchFilesForCommits(git, context, commitIds) { - const files = /* @__PURE__ */ new Set(); - for await (const file of fetchFilesForCommitsX(git, context, commitIds)) { - files.add(file); +function getPossibleInDocSettings(text) { + return genSequence(regExInFileSettings).concatMap((regexp) => match(regexp, text)); +} +function parseEnable(_match) { + return {}; +} +function parseDisable(_match) { + return {}; +} + +// node_modules/cspell-lib/dist/esm/Settings/TextDocumentSettings.mjs +function combineTextAndLanguageSettings(settings, text, languageId) { + if (!text) { + return toInternalSettings(calcSettingsForLanguageId(settings, languageId)); } - return files; + const docSettings = extractSettingsFromText(text); + const settingsForText = mergeSettings(settings, docSettings); + const langSettings = calcSettingsForLanguageId(settingsForText, languageId); + return mergeSettings(langSettings, docSettings); } -async function* fetchFilesForCommitsX(git, context, commitIds) { - const { owner, repo } = context; - const { rest } = (0, import_plugin_rest_endpoint_methods.restEndpointMethods)(git); - for (const ref of commitIds) { - const commit = await rest.repos.getCommit({ owner, repo, ref }); - const files = commit.data.files; - if (!files) - continue; - for (const f of files) { - if (f.filename) { - yield f.filename; - } - } +function extractSettingsFromText(text) { + return getInDocumentSettings(text); +} + +// node_modules/cspell-lib/dist/esm/textValidation/determineTextDocumentSettings.mjs +var path11 = __toESM(require("path"), 1); +function determineTextDocumentSettings(doc, settings) { + const filename = uriToFilePath(doc.uri); + const settingsWithDefaults = mergeSettings(getDefaultSettings(settings.loadDefaultConfiguration ?? true), getGlobalSettings(), settings); + const fileSettings = calcOverrideSettings(settingsWithDefaults, filename); + const languageIds2 = fileSettings?.languageId?.length ? fileSettings.languageId : doc.languageId ? doc.languageId : getLanguageForFilename(filename); + if (doc.locale) { + fileSettings.language = doc.locale; } + return combineTextAndLanguageSettings(fileSettings, doc.text, languageIds2); +} +function getLanguageForFilename(filename) { + const basename7 = path11.basename(filename); + return getLanguagesForBasename(basename7); } -// src/reporter.ts -var core2 = __toESM(require_core()); -var import_command = __toESM(require_command()); -var import_vscode_uri = __toESM(require_umd()); -var path = __toESM(require("path")); -function nullEmitter(_msg) { +// node_modules/@cspell/cspell-types/dist/esm/CSpellReporter.mjs +var IssueType; +(function(IssueType2) { + IssueType2[IssueType2["spelling"] = 0] = "spelling"; + IssueType2[IssueType2["directive"] = 1] = "directive"; +})(IssueType || (IssueType = {})); +var MessageTypes = { + Debug: "Debug", + Info: "Info", + Warning: "Warning" +}; + +// node_modules/cspell-lib/dist/esm/textValidation/docValidator.mjs +var import_assert15 = __toESM(require("assert"), 1); +var import_path3 = __toESM(require("path"), 1); + +// node_modules/cspell-lib/dist/esm/suggestions.mjs +var import_assert13 = __toESM(require("assert"), 1); + +// node_modules/cspell-lib/dist/esm/util/memorizeLastCall.mjs +function memorizeLastCall2(fn) { + let last; + return (...p) => { + if (last && isArrayEqual(last.args, p)) { + return last.value; + } + const args = p; + const value = fn(...args); + last = { args, value }; + return value; + }; } -var CSpellReporterForGithubAction = class { - constructor(reportIssueCommand, options, logger = core2) { - this.reportIssueCommand = reportIssueCommand; - this.options = options; - this.logger = logger; - this.issues = []; - this.issueCounts = /* @__PURE__ */ new Map(); - this.result = { - files: -1, - filesWithIssues: /* @__PURE__ */ new Set(), - issues: -1, - errors: -1, - cachedFiles: 0 - }; - this.finished = false; - this.reporter = { - debug: (...args) => this._debug(...args), - error: (...args) => this._error(...args), - info: (...args) => this._info(...args), - issue: (...args) => this._issue(...args), - progress: (...args) => this._progress(...args), - result: (...args) => this._result(...args) + +// node_modules/cspell-lib/dist/esm/suggestions.mjs +var emptySuggestionOptions = Object.freeze({}); +var emptyCSpellSettings = Object.freeze({}); +var memorizeSuggestions = memorizeLastCall2(cacheSuggestionsForWord); +function cacheSuggestionsForWord(options, settings) { + const cache2 = createAutoResolveCache(); + return (word) => cache2.get(word, (word2) => _suggestionsForWord(word2, options, settings)); +} +async function _suggestionsForWord(word, options, settings) { + const { languageId, locale: language, includeDefaultConfig = true, dictionaries } = options; + async function determineDictionaries(config2) { + const withLocale = mergeSettings(config2, clean({ + language: language || config2.language + // dictionaries: dictionaries?.length ? dictionaries : config.dictionaries, + })); + const withLanguageId = calcSettingsForLanguageId(withLocale, languageId ?? withLocale.languageId ?? "plaintext"); + const settings2 = finalizeSettings(withLanguageId); + settings2.dictionaries = dictionaries?.length ? dictionaries : settings2.dictionaries || []; + validateDictionaries(settings2, dictionaries); + const dictionaryCollection2 = await getDictionaryInternal(settings2); + settings2.dictionaries = settings2.dictionaryDefinitions?.map((def) => def.name) || []; + const allDictionaryCollection2 = await getDictionaryInternal(settings2); + return { + dictionaryCollection: dictionaryCollection2, + allDictionaryCollection: allDictionaryCollection2 + }; + } + await refreshDictionaryCache(); + const config = includeDefaultConfig ? mergeSettings(getDefaultSettings(settings.loadDefaultConfiguration ?? true), getGlobalSettings(), settings) : settings; + const { dictionaryCollection, allDictionaryCollection } = await determineDictionaries(config); + return _suggestionsForWordSync(word, options, settings, dictionaryCollection, allDictionaryCollection); +} +function _suggestionsForWordSync(word, options, settings, dictionaryCollection, allDictionaryCollection) { + const extendsDictionaryCollection = allDictionaryCollection || dictionaryCollection; + const { locale: language, strict = true, numChanges = 4, numSuggestions = 8, includeTies = true, includeDefaultConfig = true } = options; + const ignoreCase2 = !strict; + const config = includeDefaultConfig ? mergeSettings(getDefaultSettings(settings.loadDefaultConfiguration ?? true), getGlobalSettings(), settings) : settings; + const opts = { ignoreCase: ignoreCase2, numChanges, numSuggestions, includeTies }; + const suggestionsByDictionary = dictionaryCollection.dictionaries.flatMap((dict) => dict.suggest(word, opts).map((r) => ({ ...r, dictName: dict.name }))); + const locale = adjustLocale(language || config.language || void 0); + const collator2 = Intl.Collator(locale); + const combined = limitResults(combine3(suggestionsByDictionary.sort((a, b) => a.cost - b.cost || collator2.compare(a.word, b.word))), numSuggestions, includeTies); + const sugsAdjusted = calcSuggestionAdjustedToToMatchCase(word, combined, locale, ignoreCase2, extendsDictionaryCollection); + const allSugs = sugsAdjusted.map((sug) => { + const found = extendsDictionaryCollection.find(sug.word); + return { + ...sug, + forbidden: found?.forbidden || false, + noSuggest: found?.noSuggest || false }; - this.verbose = options.verbose; + }); + return { + word, + suggestions: limitResults(allSugs, numSuggestions, includeTies) + }; +} +function combine3(suggestions) { + const words = /* @__PURE__ */ new Map(); + for (const sug of suggestions) { + const { word, cost, dictName, ...rest } = sug; + const f = words.get(word) || { word, cost, ...rest, dictionaries: [] }; + f.cost = Math.min(f.cost, cost); + f.dictionaries.push(dictName); + f.dictionaries.sort(); + words.set(word, f); } - _issue(issue) { - const { issues, issueCounts } = this; - const uri = issue.uri; - uri && issueCounts.set(uri, (issueCounts.get(uri) || 0) + 1); - issues.push(issue); + return [...words.values()]; +} +function adjustLocale(locale) { + if (!locale) + return void 0; + const locales = [...normalizeLocaleIntl(locale)].filter((locale2) => isValidLocaleIntlFormat(locale2)); + if (!locales.length) + return void 0; + if (locales.length === 1) + return locales[0]; + return locales; +} +function calcSuggestionAdjustedToToMatchCase(originalWord, sugs, locale, ignoreCase2, dict) { + locale = adjustLocale(locale); + const knownSugs = new Set(sugs.map((sug) => sug.word)); + const matchStyle = { ...analyzeCase(originalWord), locale, ignoreCase: ignoreCase2 }; + return sugs.map((sug) => { + const alt = matchCase2(sug.word, !!sug.isPreferred, matchStyle); + if (alt === sug.word || knownSugs.has(alt)) + return sug; + const found = dict.find(alt); + if (!found || !found.forbidden || !found.noSuggest) { + knownSugs.add(alt); + return { ...sug, wordAdjustedToMatchCase: alt }; + } + return sug; + }); +} +function limitResults(suggestions, numSuggestions, includeTies) { + let cost = suggestions[0]?.cost; + let i = 0; + for (; i < suggestions.length; ++i) { + if (i >= numSuggestions && (!includeTies || suggestions[i].cost > cost)) { + break; + } + cost = suggestions[i].cost; } - _info(message, _msgType) { - this._debug(message); + return suggestions.slice(0, i); +} +function validateDictionaries(settings, dictionaries) { + if (!dictionaries?.length) + return; + const knownDicts2 = new Set(settings.dictionaryDefinitions?.map((def) => def.name) || []); + for (const dict of dictionaries) { + if (!knownDicts2.has(dict)) { + throw new SuggestionError(`Unknown dictionary: "${dict}"`, "E_dictionary_unknown"); + } } - _debug(message) { - nullEmitter(message); +} +function matchCase2(word, isPreferred, style) { + const locale = style.locale; + if (style.isMixedCaps) { + return word; } - _progress(progress) { - if (!this.verbose || !isProgressFileComplete(progress)) { - return; + if (hasCaps(word)) { + if (style.isAllCaps) + return word.toLocaleUpperCase(locale); + if (!style.ignoreCase || style.hasCaps || isPreferred) + return word; + if (isTitleCase(word) || isAllCaps(word)) + return word.toLocaleLowerCase(locale); + return word; + } + if (!style.hasCaps) + return word; + if (style.isAllCaps) + return word.toLocaleUpperCase(locale); + (0, import_assert13.default)(style.isTitleCase); + return word.replace(/^\p{L}/u, (firstLetter) => firstLetter.toLocaleUpperCase(locale)); +} +var regExpHasCaps = /\p{Lu}/u; +var regExpIsAllCaps = /^[\P{L}\p{Lu}]+$/u; +var regExpIsTitleCase = /^\p{Lu}[\P{L}\p{Ll}]+$/u; +function analyzeCase(word) { + const hasCaps2 = regExpHasCaps.test(word); + const isAllCaps2 = hasCaps2 && regExpIsAllCaps.test(word); + const isTitleCase2 = hasCaps2 && !isAllCaps2 && regExpIsTitleCase.test(word); + const isMixedCaps = hasCaps2 && !isAllCaps2 && !isTitleCase2; + return { hasCaps: hasCaps2, isAllCaps: isAllCaps2, isMixedCaps, isTitleCase: isTitleCase2 }; +} +function hasCaps(word) { + return regExpHasCaps.test(word); +} +function isTitleCase(word) { + return regExpIsTitleCase.test(word); +} +function isAllCaps(word) { + return regExpIsAllCaps.test(word); +} +var SuggestionError = class extends Error { + constructor(message, code) { + super(message); + this.code = code; + } +}; + +// node_modules/cspell-lib/dist/esm/util/simpleCache.mjs +var SimpleCache2 = class { + constructor(size) { + this.size = size; + this.L0 = /* @__PURE__ */ new Map(); + this.L1 = /* @__PURE__ */ new Map(); + this.L2 = /* @__PURE__ */ new Map(); + } + has(key) { + for (const c of this.caches()) { + if (c.has(key)) + return true; } - const { issueCounts, logger } = this; - const issueCount = issueCounts.get(progress.filename) || 0; - const { fileNum, fileCount, filename, elapsedTimeMs } = progress; - const issues = issueCount ? ` issues: ${issueCount}` : ""; - const timeMsg = elapsedTimeMs ? `(${elapsedTimeMs.toFixed(2)}ms)` : "-"; - logger.info(`${fileNum}/${fileCount} ${filename}${issues} ${timeMsg}`); + return false; } - _error(message, error2) { - const { logger } = this; - logger.error(`${message} - name: ${error2.name} - msg: ${error2.message} - stack: -${error2.stack} - `); - return; + get(key) { + for (const c of this.caches()) { + const entry = c.get(key); + if (entry) { + if (c !== this.L0) { + this._set(key, entry); + } + return entry.v; + } + } + return void 0; } - _result(result) { - Object.assign(this.result, result); - this.finished = true; - const command = this.reportIssueCommand; - if (!["error", "warning"].includes(command)) { - return; + set(key, value) { + this._set(key, { v: value }); + } + _set(key, entry) { + if (this.L0.has(key)) { + this.L0.set(key, entry); + return this; } - const cwd = process.cwd(); - this.issues.forEach((item) => { - (0, import_command.issueCommand)( - command, - { - file: relative2(cwd, item.uri || ""), - line: item.row, - col: item.col - }, - `Unknown word (${item.text})` - ); - console.warn(`${relative2(cwd, item.uri || "")}:${item.row}:${item.col} Unknown word (${item.text})`); - }); + if (this.L0.size >= this.size) { + this.rotate(); + } + this.L0.set(key, entry); } -}; -function isProgressFileComplete(p) { - return p.type === "ProgressFileComplete"; -} -function relative2(cwd, fileUri) { - const fsPath = import_vscode_uri.URI.parse(fileUri).fsPath; - return path.relative(cwd, fsPath); -} - -// node_modules/@cspell/cspell-pipe/dist/esm/helpers/iteratorToIterable.mjs -function* iteratorToIterable(iterator) { - let n; - while (!(n = iterator.next()).done) { - yield n.value; + caches() { + return [this.L0, this.L1, this.L2]; } -} -async function* asyncIteratorToAsyncIterable(iterator) { - let n; - while (!(n = await iterator.next()).done) { - yield n.value; + rotate() { + this.L2 = this.L1; + this.L1 = this.L0; + this.L0 = /* @__PURE__ */ new Map(); } -} - -// node_modules/@cspell/cspell-pipe/dist/esm/helpers/util.mjs -function toPipeFn(syncFn, asyncFn) { - function _(i) { - return isAsyncIterable(i) ? asyncFn(i) : syncFn(i); +}; +var AutoCache = class extends SimpleCache2 { + constructor(factory, size) { + super(size); + this.factory = factory; + } + get(key) { + const v = super.get(key); + if (v !== void 0) + return v; + const val = this.factory(key); + this.set(key, val); + return val; } - return _; -} -function isAsyncIterable(i) { - return typeof i[Symbol.asyncIterator] === "function"; -} +}; -// node_modules/@cspell/cspell-pipe/dist/esm/helpers/toArray.mjs -function toArray(i) { - return isAsyncIterable(i) ? toArrayAsync(i) : toArraySync(i); -} -function toArraySync(iter) { - return [...iter]; -} -async function toArrayAsync(iter) { - const collection = []; - for await (const i of iter) { - collection.push(i); +// node_modules/cspell-lib/dist/esm/util/timer.mjs +var _hrTime = process?.hrtime || polyHrTime; +function createTimer(hrTimeFn = _hrTime) { + let start = hrTimeFn(); + let lastLap = 0; + function elapsed() { + return toMilliseconds(hrTimeFn(start)); } - return collection; + return { + start() { + start = hrTimeFn(); + lastLap = 0; + }, + elapsed, + lap() { + const now = elapsed(); + const diff = now - lastLap; + lastLap = now; + return diff; + } + }; } - -// node_modules/@cspell/cspell-pipe/dist/esm/helpers/toAsyncIterable.mjs -async function* mergeAsyncIterables(iter, ...rest) { - for await (const i of [iter, ...rest]) { - yield* i; - } +function toMilliseconds(t) { + return (t[0] + t[1] * 1e-9) * 1e3; +} +function polyHrTime(time) { + const now = Date.now() - (time ? toMilliseconds(time) : 0); + const inSeconds = now * 1e-3; + const s = Math.floor(inSeconds); + const n = (inSeconds - s) * 1e9; + return [s, n]; } -var toAsyncIterable = mergeAsyncIterables; -// node_modules/@cspell/cspell-pipe/dist/esm/operators/index.mjs -var operators_exports = {}; -__export(operators_exports, { - opAppend: () => opAppend, - opAppendAsync: () => opAppendAsync, - opAppendSync: () => opAppendSync, - opAwaitAsync: () => opAwaitAsync, - opCombineAsync: () => opCombineAsync, - opCombineSync: () => opCombineSync, - opConcatMap: () => opConcatMap, - opConcatMapAsync: () => opConcatMapAsync, - opConcatMapSync: () => opConcatMapSync, - opFilter: () => opFilter, - opFilterAsync: () => opFilterAsync, - opFilterSync: () => opFilterSync, - opFirst: () => opFirst, - opFirstAsync: () => opFirstAsync, - opFirstSync: () => opFirstSync, - opFlatten: () => opFlatten, - opFlattenAsync: () => opFlattenAsync, - opFlattenSync: () => opFlattenSync, - opJoinStrings: () => opJoinStrings, - opJoinStringsAsync: () => opJoinStringsAsync, - opJoinStringsSync: () => opJoinStringsSync, - opLast: () => opLast, - opLastAsync: () => opLastAsync, - opLastSync: () => opLastSync, - opMap: () => opMap, - opMapAsync: () => opMapAsync, - opMapSync: () => opMapSync, - opReduceAsync: () => opReduceAsync, - opReduceSync: () => opReduceSync, - opSkip: () => opSkip, - opSkipAsync: () => opSkipAsync, - opSkipSync: () => opSkipSync, - opTake: () => opTake, - opTakeAsync: () => opTakeAsync, - opTakeSync: () => opTakeSync, - opTap: () => opTap, - opTapAsync: () => opTapAsync, - opTapSync: () => opTapSync, - opUnique: () => opUnique, - opUniqueAsync: () => opUniqueAsync, - opUniqueSync: () => opUniqueSync -}); +// node_modules/cspell-lib/dist/esm/textValidation/defaultConstants.mjs +var defaultMaxNumberOfProblems = 200; +var defaultMaxDuplicateProblems = 5; +var defaultMinWordLength = 4; -// node_modules/@cspell/cspell-pipe/dist/esm/operators/append.mjs -function opAppendAsync(...iterablesToAppend) { - async function* fn(iter) { - yield* iter; - for (const i of iterablesToAppend) { - yield* i; +// node_modules/cspell-lib/dist/esm/util/PairingHeap.mjs +var PairingHeap2 = class { + constructor(compare4) { + this.compare = compare4; + this._size = 0; + } + add(v) { + this._heap = insert3(this.compare, this._heap, v); + ++this._size; + return this; + } + dequeue() { + const n = this.next(); + if (n.done) + return void 0; + return n.value; + } + concat(i) { + for (const v of i) { + this.add(v); } + return this; } - return fn; -} -function opAppendSync(...iterablesToAppend) { - function* fn(iter) { - yield* iter; - for (const i of iterablesToAppend) { - yield* i; + next() { + if (!this._heap) { + return { value: void 0, done: true }; } + const value = this._heap.v; + --this._size; + this._heap = removeHead2(this.compare, this._heap); + return { value }; } - return fn; + peek() { + return this._heap?.v; + } + [Symbol.iterator]() { + return this; + } + get length() { + return this._size; + } +}; +function removeHead2(compare4, heap) { + if (!heap || !heap.c) + return void 0; + return mergeSiblings2(compare4, heap.c); } -function opAppend(...iterablesToAppend) { - function _(i) { - return isAsyncIterable(i) ? opAppendAsync(...iterablesToAppend)(i) : opAppendSync(...iterablesToAppend)(i); +function insert3(compare4, heap, v) { + const n = { + v, + s: void 0, + c: void 0 + }; + if (!heap || compare4(v, heap.v) <= 0) { + n.c = heap; + return n; + } + n.s = heap.c; + heap.c = n; + return heap; +} +function merge3(compare4, a, b) { + if (compare4(a.v, b.v) <= 0) { + a.s = void 0; + b.s = a.c; + a.c = b; + return a; + } + b.s = void 0; + a.s = b.c; + b.c = a; + return b; +} +function mergeSiblings2(compare4, n) { + if (!n.s) + return n; + const s = n.s; + const ss = s.s; + const m = merge3(compare4, n, s); + return ss ? merge3(compare4, m, mergeSiblings2(compare4, ss)) : m; +} + +// node_modules/cspell-lib/dist/esm/util/regexHelper.mjs +function escapeRegEx2(s) { + return s.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); +} + +// node_modules/cspell-lib/dist/esm/util/wordSplitter.mjs +var ignoreBreak = Object.freeze([]); +function split(line, offset, isValidWord, options = {}) { + const relWordToSplit = findNextWordText({ text: line.text, offset: offset - line.offset }); + const lineOffset = line.offset; + const requested = /* @__PURE__ */ new Map(); + const regExpIgnoreSegment = /^[-.+\d_eE'`\\\s]+$/; + if (!relWordToSplit.text) { + const text = rebaseTextOffset(relWordToSplit); + return { + line, + offset, + text, + words: [], + endOffset: text.offset + text.text.length + }; } - return _; + const lineSegment = { + line, + relStart: relWordToSplit.offset, + relEnd: relWordToSplit.offset + relWordToSplit.text.length + }; + const possibleBreaks = generateWordBreaks(lineSegment, options); + if (!possibleBreaks.length) { + const text = rebaseTextOffset(relWordToSplit); + return { + line, + offset, + text, + words: [{ ...text, isFound: isValidWord(text) }], + endOffset: text.offset + text.text.length + }; + } + function rebaseTextOffset(relText) { + return { + ...relText, + offset: relText.offset + lineOffset + }; + } + function has2(word) { + if (regExpIgnoreSegment.test(word.text)) { + return true; + } + const i = word.offset; + const j = word.text.length; + let v = i + (j << 20); + if (i < 1 << 20 && j < 1 << 11) { + const b = requested.get(v); + if (b !== void 0) + return b; + } else { + v = -1; + } + const r = isValidWord(rebaseTextOffset(word)); + if (v >= 0) { + requested.set(v, r); + } + return r; + } + possibleBreaks.push({ + offset: lineSegment.relEnd, + breaks: [ignoreBreak] + }); + const result = { + line, + offset, + text: rebaseTextOffset(relWordToSplit), + words: splitIntoWords(lineSegment, possibleBreaks, has2).map(rebaseTextOffset), + endOffset: lineOffset + lineSegment.relEnd + }; + return result; } - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/await.mjs -async function* _asyncAwait(iter) { - for await (const v of iter) { - yield v; +function findNextWordText({ text, offset }) { + const reg = new RegExp(regExWordsAndDigits); + reg.lastIndex = offset; + const m = reg.exec(text); + if (!m) { + return { + text: "", + offset: offset + text.length + }; } + if (regExNumericLiteral.test(m[0])) { + return findNextWordText({ text, offset: offset + m[0].length }); + } + return { + text: m[0], + offset: m.index + }; } -function opAwaitAsync() { - return _asyncAwait; +function generateWordBreaks(line, options) { + const camelBreaks = genWordBreakCamel(line); + const symbolBreaks = genSymbolBreaks(line); + const optionalBreaks = genOptionalWordBreaks(line, options.optionalWordBreakCharacters); + return mergeSortedBreaks(...camelBreaks, ...symbolBreaks, ...optionalBreaks); } - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/combine.mjs -function opCombineAsync(...fns) { - function combine(iter) { - for (const fn of fns) { - iter = fn(iter); - } - return iter; - } - return combine; +function offsetRegEx(reg, offset) { + const r = new RegExp(reg); + r.lastIndex = offset; + return r; } -function opCombineSync(...fns) { - function combine(iter) { - for (const fn of fns) { - iter = fn(iter); - } - return iter; +function genWordBreakCamel(line) { + const breaksCamel1 = []; + const text = line.line.text.slice(0, line.relEnd); + for (const m of text.matchAll(offsetRegEx(regExSplitWords, line.relStart))) { + if (m.index === void 0) + break; + const i = m.index + 1; + breaksCamel1.push({ + offset: m.index, + breaks: [[i, i], ignoreBreak] + }); } - return combine; + const breaksCamel2 = []; + for (const m of text.matchAll(offsetRegEx(regExSplitWords2, line.relStart))) { + if (m.index === void 0) + break; + const i = m.index + m[1].length; + const j = i + 1; + breaksCamel2.push({ + offset: m.index, + breaks: [[i, i], [j, j], ignoreBreak] + }); + } + return [breaksCamel1, breaksCamel2]; } - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/concatMap.mjs -function opConcatMapAsync(mapFn) { - async function* fn(iter) { - for await (const v of iter) { - yield* mapFn(v); +function calcBreaksForRegEx(line, reg, calcBreak) { + const sb = []; + const text = line.line.text.slice(0, line.relEnd); + for (const m of text.matchAll(offsetRegEx(reg, line.relStart))) { + const b = calcBreak(m); + if (b) { + sb.push(b); } } - return fn; + return sb; } -function opConcatMapSync(mapFn) { - function* fn(iter) { - for (const v of iter) { - yield* mapFn(v); - } +function genOptionalWordBreaks(line, optionalBreakCharacters) { + function calcBreaks(m) { + const i = m.index; + if (i === void 0) + return; + const j = i + m[0].length; + return { + offset: i, + breaks: [ + [i, j], + ignoreBreak + ] + }; } - return fn; + const breaks = [ + calcBreaksForRegEx(line, regExDanglingQuote, calcBreaks), + calcBreaksForRegEx(line, regExTrailingEndings, calcBreaks) + ]; + if (optionalBreakCharacters) { + const regex = new RegExp(`[${escapeRegEx2(optionalBreakCharacters)}]`, "gu"); + breaks.push(calcBreaksForRegEx(line, regex, calcBreaks)); + } + return breaks; } -var opConcatMap = (fn) => toPipeFn(opConcatMapSync(fn), opConcatMapAsync(fn)); - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/filter.mjs -function opFilterAsync(filterFn) { - async function* fn(iter) { - for await (const v of iter) { - const pass = await filterFn(v); - if (pass) - yield v; - } +function genSymbolBreaks(line) { + function calcBreaks(m) { + const i = m.index; + if (i === void 0) + return; + const j = i + m[0].length; + return { + offset: i, + breaks: [ + [i, j], + [i, i], + [j, j], + ignoreBreak + ] + }; } - return fn; + return [ + calcBreaksForRegEx(line, regExPossibleWordBreaks, calcBreaks), + calcBreaksForRegEx(line, /\d+/g, calcBreaks), + calcBreaksForRegEx(line, regExEscapeCharacters, calcBreaks) + ]; } -function opFilterSync(filterFn) { - function* fn(iter) { - for (const v of iter) { - if (filterFn(v)) - yield v; +function splitIntoWords(lineSeg, breaks, has2) { + const maxIndex = lineSeg.relEnd; + const maxAttempts = 1e3; + const knownPathsByIndex = /* @__PURE__ */ new Map(); + function makeCandidates(p, i, bi, currentCost) { + const len = maxIndex; + while (bi < breaks.length && breaks[bi].offset < i) { + bi += 1; + } + if (bi >= breaks.length) { + return []; } + const br = breaks[bi]; + function c(bp) { + const d = bp.length < 2 ? len - i : (bp[0] - i) * 0.5 + len - bp[1]; + const ec = currentCost + d; + return { + p, + i, + bi, + bp, + c: currentCost, + ec, + text: void 0 + }; + } + return br.breaks.map(c); } - return fn; -} -function opFilter(fn) { - const asyncFn = opFilterAsync(fn); - const syncFn = opFilterSync(fn); - function _(i) { - return isAsyncIterable(i) ? asyncFn(i) : syncFn(i); + function toTextOffset(text2, offset) { + const valid = has2({ text: text2, offset }); + return { + text: text2, + offset, + isFound: valid + }; } - return _; -} - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/first.mjs -function opFirstAsync(firstFn) { - async function* fn(iter) { - for await (const v of iter) { - const pass = await firstFn(v); - if (pass) { - yield v; - break; + function compare4(a, b) { + return a.ec - b.ec || b.i - a.i; + } + function pathToWords(node) { + const results = []; + for (let p = node; p; p = p.n) { + if (p.text) { + results.push(p.text); } } + return results; } - return fn; -} -function opFirstSync(firstFn) { - function* fn(iter) { - for (const v of iter) { - if (firstFn(v)) { - yield v; + function addToKnownPaths(candidate, path26) { + for (let can = candidate; can !== void 0; can = can.p) { + const t = can.text; + const i = can.i; + const cost = (!t || t.isFound ? 0 : t.text.length) + (path26?.c ?? 0); + const exitingPath = knownPathsByIndex.get(i); + if (exitingPath && exitingPath.c <= cost) { + return void 0; + } + const node = { + n: path26, + i, + c: cost, + text: t + }; + knownPathsByIndex.set(i, node); + path26 = node; + } + return path26; + } + let maxCost = lineSeg.relEnd - lineSeg.relStart; + const candidates = new PairingHeap2(compare4); + const text = lineSeg.line.text; + candidates.concat(makeCandidates(void 0, lineSeg.relStart, 0, 0)); + let attempts = 0; + let bestPath; + while (maxCost && candidates.length && attempts++ < maxAttempts) { + const best = candidates.dequeue(); + if (!best || best.c >= maxCost) { + continue; + } + if (best.bp.length) { + const i = best.bp[0]; + const j = best.bp[1]; + const t = i > best.i ? toTextOffset(text.slice(best.i, i), best.i) : void 0; + const cost = !t || t.isFound ? 0 : t.text.length; + const mc = maxIndex - j; + best.c += cost; + best.ec = best.c + mc; + best.text = t; + const possiblePath = knownPathsByIndex.get(j); + if (possiblePath) { + const f = addToKnownPaths(best, possiblePath); + bestPath = !bestPath || f && f.c < bestPath.c ? f : bestPath; + } else if (best.c < maxCost) { + const c = makeCandidates(t ? best : best.p, j, best.bi + 1, best.c); + candidates.concat(c); + } + } else { + const c = makeCandidates(best.p, best.i, best.bi + 1, best.c); + candidates.concat(c); + if (!c.length) { + const t = maxIndex > best.i ? toTextOffset(text.slice(best.i, maxIndex), best.i) : void 0; + const cost = !t || t.isFound ? 0 : t.text.length; + best.c += cost; + best.ec = best.c; + best.text = t; + const segText = t || best.p?.text || toTextOffset("", best.i); + const can = t ? { ...best, text: segText } : { ...best, ...best.p, text: segText }; + const f = addToKnownPaths(can, void 0); + bestPath = !bestPath || f && f.c < bestPath.c ? f : bestPath; + } + } + if (bestPath && bestPath.c < maxCost) { + maxCost = bestPath.c; + } + } + return pathToWords(bestPath); +} +function mergeSortedBreaks(...maps) { + return [].concat(...maps).sort((a, b) => a.offset - b.offset); +} + +// node_modules/cspell-lib/dist/esm/textValidation/isWordValid.mjs +function hasWordCheck(dict, word) { + word = word.includes("\\") ? word.replace(/\\/g, "") : word; + return dict.has(word); +} +function isWordValidWithEscapeRetry(dict, wo, line) { + const firstTry = hasWordCheck(dict, wo.text); + return firstTry || // Drop the first letter if it is preceded by a '\'. + line.text[wo.offset - line.offset - 1] === "\\" && hasWordCheck(dict, wo.text.slice(1)); +} + +// node_modules/cspell-lib/dist/esm/util/TextMap.mjs +var import_assert14 = __toESM(require("assert"), 1); +function extractTextMapRangeOrigin(textMap, extractRange) { + const { text: srcTxt, range: srcRange, map: srcMap } = textMap; + const [r0, r1] = srcRange; + const startOrig = Math.min(Math.max(extractRange[0], r0), r1); + const endOrig = Math.min(Math.max(extractRange[1], r0), r1); + const a = startOrig - r0; + const b = endOrig - r0; + const range = [startOrig, endOrig]; + if (!srcMap || !srcMap.length || a === b) { + const text2 = srcTxt.slice(a, b); + return { text: text2, range }; + } + (0, import_assert14.default)((srcMap.length & 1) === 0, "Map must be pairs of values."); + const mapLen = srcMap.length; + const mapEndSrc = srcMap[mapLen - 2]; + const mapEndDst = srcMap[mapLen - 1]; + const endDiff = srcTxt.length - mapEndDst; + const head = !srcMap[0] && !srcMap[1] ? [] : [0, 0]; + const tail = [mapEndSrc + endDiff, mapEndDst + endDiff]; + const sMap = head.concat(srcMap).concat(tail); + let idx2 = 0; + for (; idx2 < sMap.length && a >= sMap[idx2]; idx2 += 2) { + } + const aIdx = idx2; + idx2 -= 2; + const a0 = a - sMap[idx2]; + const a1 = a0 + sMap[idx2 + 1]; + for (; idx2 < sMap.length && b > sMap[idx2]; idx2 += 2) { + } + const bIdx = idx2; + const b0 = b - sMap[idx2]; + const b1 = b0 + sMap[idx2 + 1]; + const text = srcTxt.slice(a1, b1); + if (bIdx === aIdx) { + return { text, range }; + } + const ab = [a0, a1]; + const map3 = sMap.slice(aIdx, bIdx + 2).map((v, i) => v - ab[i & 1]); + return { text, range, map: map3 }; +} + +// node_modules/cspell-lib/dist/esm/textValidation/parsedText.mjs +function mapRangeBackToOriginalPos(offRange, map3) { + if (!map3 || !map3.length) + return offRange; + const [start, end] = offRange; + let i = 0, j = 0, p = 1; + while (p < map3.length && map3[p] < start) { + i = map3[p - 1]; + j = map3[p]; + p += 2; + } + const iA = start - j + i; + while (p < map3.length && map3[p] < end) { + i = map3[p - 1]; + j = map3[p]; + p += 2; + } + const iB = end - j + i; + return [iA, iB]; +} +function createMappedTextSegmenter(includeRanges) { + let rangePos = 0; + function* segmenter(pText) { + if (!includeRanges.length) { + return; + } + const range = pText.range; + const textEndPos = range[1]; + let textStartPos = range[0]; + while (rangePos && (rangePos >= includeRanges.length || includeRanges[rangePos].startPos > textStartPos)) { + rangePos -= 1; + } + const cur = includeRanges[rangePos]; + if (textEndPos <= cur.endPos && textStartPos >= cur.startPos) { + yield pText; + return; + } + while (textStartPos < textEndPos) { + while (includeRanges[rangePos] && includeRanges[rangePos].endPos <= textStartPos) { + rangePos += 1; + } + if (!includeRanges[rangePos]) { + break; + } + const { startPos, endPos } = includeRanges[rangePos]; + if (textEndPos < startPos) { break; } + const a = Math.max(textStartPos, startPos); + const b = Math.min(textEndPos, endPos); + if (a !== b) { + yield extractTextMapRangeOrigin(pText, [a, b]); + } + textStartPos = b; } } - return fn; + return segmenter; } -function opFirst(fn) { - const asyncFn = opFirstAsync(fn); - const syncFn = opFirstSync(fn); - function _(i) { - return isAsyncIterable(i) ? asyncFn(i) : syncFn(i); + +// node_modules/cspell-lib/dist/esm/textValidation/lineValidatorFactory.mjs +function lineValidatorFactory(sDict, options) { + const { minWordLength = defaultMinWordLength, flagWords = [], allowCompoundWords = false, ignoreCase: ignoreCase2 = true } = options; + const hasWordOptions = { + ignoreCase: ignoreCase2, + useCompounds: allowCompoundWords || void 0 + // let the dictionaries decide on useCompounds if allow is false + }; + const dictCol = createCachingDictionary(sDict, hasWordOptions); + const setOfFlagWords = new Set(flagWords); + const setOfKnownSuccessfulWords = /* @__PURE__ */ new Set(); + const rememberFilter = (fn2) => (v) => { + const keep = fn2(v); + if (!keep) { + setOfKnownSuccessfulWords.add(v.text); + } + return keep; + }; + const filterAlreadyChecked = (wo) => { + return !setOfKnownSuccessfulWords.has(wo.text); + }; + function testForFlaggedWord(wo) { + const text = wo.text; + return setOfFlagWords.has(text) || setOfFlagWords.has(text.toLowerCase()) || dictCol.isForbidden(text); + } + function isWordIgnored(word) { + return dictCol.isNoSuggestWord(word); + } + function getSuggestions(word) { + return dictCol.getPreferredSuggestions(word); + } + function isWordFlagged(word) { + const isIgnored = isWordIgnored(word.text); + const isFlagged = !isIgnored && testForFlaggedWord(word); + return isFlagged; + } + function annotateIsFlagged(word) { + word.isFlagged = isWordFlagged(word); + return word; + } + function annotateIssue(issue) { + const sugs = getSuggestions(issue.text); + if (sugs && sugs.length) { + issue.suggestionsEx = sugs; + } + return issue; + } + function checkWord(word) { + const isIgnored = isWordIgnored(word.text); + const { isFlagged = !isIgnored && testForFlaggedWord(word) } = word; + const isFound = isFlagged ? void 0 : isIgnored || isWordValidWithEscapeRetry(dictCol, word, word.line); + return clean({ ...word, isFlagged, isFound }); + } + const fn = (lineSegment) => { + function splitterIsValid(word) { + return setOfKnownSuccessfulWords.has(word.text) || !testForFlaggedWord(word) && isWordValidWithEscapeRetry(dictCol, word, lineSegment.line); + } + function checkFullWord(vr) { + if (vr.isFlagged) { + return [vr]; + } + const codeWordResults = toArraySync(pipeSync( + extractWordsFromCodeTextOffset(vr), + opFilterSync(filterAlreadyChecked), + opMapSync((t) => ({ ...t, line: vr.line })), + opMapSync(annotateIsFlagged), + opFilterSync(rememberFilter((wo) => wo.text.length >= minWordLength || !!wo.isFlagged)), + opMapSync((wo) => wo.isFlagged ? wo : checkWord(wo)), + opFilterSync(rememberFilter((wo) => wo.isFlagged || !wo.isFound)), + opFilterSync(rememberFilter((wo) => !regExRepeatedChar.test(wo.text))), + // get back the original text. + opMapSync((wo) => ({ + ...wo, + text: extractText(lineSegment.segment, wo.offset, wo.offset + wo.text.length) + })) + )); + if (!codeWordResults.length || isWordIgnored(vr.text) || checkWord(vr).isFound) { + rememberFilter((_) => false)(vr); + return []; + } + return codeWordResults; + } + function checkPossibleWords(possibleWord) { + if (isWordFlagged(possibleWord)) { + const vr = { + ...possibleWord, + line: lineSegment.line, + isFlagged: true + }; + return [vr]; + } + const mismatches = toArraySync(pipeSync(extractWordsFromTextOffset(possibleWord), opFilterSync(filterAlreadyChecked), opMapSync((wo) => ({ ...wo, line: lineSegment.line })), opMapSync(annotateIsFlagged), opFilterSync(rememberFilter((wo) => wo.text.length >= minWordLength || !!wo.isFlagged)), opConcatMapSync(checkFullWord))); + if (mismatches.length) { + const splitResult = split(lineSegment.segment, possibleWord.offset, splitterIsValid); + const nonMatching = splitResult.words.filter((w) => !w.isFound); + if (nonMatching.length < mismatches.length) { + return nonMatching.map((w) => ({ ...w, line: lineSegment.line })).map(annotateIsFlagged); + } + } + return mismatches; + } + const checkedPossibleWords = pipeSync(extractPossibleWordsFromTextOffset(lineSegment.segment), opFilterSync(filterAlreadyChecked), opConcatMapSync(checkPossibleWords), opMapSync(annotateIssue)); + return checkedPossibleWords; + }; + return { fn, dict: dictCol }; +} +function textValidatorFactory(dict, options) { + const lineValidator = lineValidatorFactory(dict, options); + const lineValidatorFn = lineValidator.fn; + function validate2(pText) { + const { text, range: srcRange, map: map3 } = pText; + const srcOffset = srcRange[0]; + const segment = { text, offset: 0 }; + const lineSegment = { line: segment, segment }; + function mapBackToOriginSimple(vr) { + const { text: text2, offset, isFlagged, isFound, suggestionsEx } = vr; + const r = mapRangeBackToOriginalPos([offset, offset + text2.length], map3); + const range = [r[0] + srcOffset, r[1] + srcOffset]; + return { text: text2, range, isFlagged, isFound, suggestionsEx }; + } + return [...lineValidatorFn(lineSegment)].map(mapBackToOriginSimple); } - return _; + return { + validate: validate2, + lineValidator + }; } -// node_modules/@cspell/cspell-pipe/dist/esm/operators/flatten.mjs -function opFlattenAsync() { - async function* fn(iter) { - for await (const v of iter) { - yield* v; +// node_modules/cspell-lib/dist/esm/textValidation/settingsToValidateOptions.mjs +function settingsToValidateOptions(settings) { + const opt = { + ...settings, + ignoreCase: !(settings.caseSensitive ?? false) + }; + return opt; +} + +// node_modules/cspell-lib/dist/esm/util/TextRange.mjs +function toMatchRangeWithText(m) { + const index = m.index || 0; + const _text = m[0]; + return { + startPos: index, + endPos: index + _text.length, + text: _text + }; +} +function findMatchingRanges(pattern, text) { + if (pattern.source === ".*") { + return [{ startPos: 0, endPos: text.length }]; + } + const regex = new RegExp(pattern); + if (!regex.global) { + const m = text.match(regex); + if (!m) + return []; + return [toMatchRangeWithText(m)]; + } + return [...text.matchAll(regex)].map(toMatchRangeWithText); +} +function compareRanges(a, b) { + return a.startPos - b.startPos || a.endPos - b.endPos; +} +function unionRanges(ranges) { + return makeSortedMatchRangeArray([..._unionRanges(ranges)]); +} +function* _unionRanges(ranges) { + const sortedRanges = sortMatchRangeArray(ranges); + if (!sortedRanges.length) + return; + let { startPos, endPos } = sortedRanges[0]; + for (const r of ranges) { + if (r.startPos > endPos) { + yield { startPos, endPos }; + startPos = r.startPos; + endPos = r.endPos; + continue; } + endPos = Math.max(endPos, r.endPos); + } + if (startPos < endPos) { + yield { startPos, endPos }; } - return fn; } -function opFlattenSync() { - function* fn(iter) { - for (const v of iter) { - yield* v; +function findMatchingRangesForPatterns(patterns, text) { + const matchedPatterns = genSequence(patterns).concatMap((pattern) => findMatchingRanges(pattern, text)); + return unionRanges(matchedPatterns.toArray()); +} +function excludeRanges(includeRanges, excludeRanges2) { + return [..._excludeRanges(sortMatchRangeArray(includeRanges), sortMatchRangeArray(excludeRanges2))]; +} +function* _excludeRanges(includeRanges, excludeRanges2) { + if (!includeRanges.length) + return; + if (!excludeRanges2.length) { + yield* includeRanges; + return; + } + let exIndex = 0; + const limit = excludeRanges2.length; + for (const incRange of includeRanges) { + const endPos = incRange.endPos; + let startPos = incRange.startPos; + for (; exIndex < limit; ++exIndex) { + const ex = excludeRanges2[exIndex]; + if (ex.startPos >= endPos) + break; + if (ex.endPos <= startPos) + continue; + if (ex.startPos > startPos) { + yield { startPos, endPos: ex.startPos }; + } + startPos = ex.endPos; + if (startPos >= endPos) + break; + } + if (startPos < endPos) { + yield { startPos, endPos }; } } - return fn; } -var opFlatten = () => toPipeFn(opFlattenSync(), opFlattenAsync()); +var SymSortedMatchRangeArray = Symbol("SortedMatchRangeArray"); +function sortMatchRangeArray(values) { + if (isSortedMatchRangeArray(values)) + return values; + return makeSortedMatchRangeArray(values.sort(compareRanges)); +} +function isSortedMatchRangeArray(a) { + return a[SymSortedMatchRangeArray] === true; +} +function makeSortedMatchRangeArray(sortedValues) { + const sorted = sortedValues; + sorted[SymSortedMatchRangeArray] = true; + Object.freeze(sorted); + return sorted; +} -// node_modules/@cspell/cspell-pipe/dist/esm/operators/joinStrings.mjs -function opJoinStringsAsync(joinCharacter = ",") { - async function* fn(iter) { - for await (const v of iter) { - const a = await toArray(v); - yield a.join(joinCharacter); +// node_modules/cspell-lib/dist/esm/textValidation/textValidator.mjs +function calcTextInclusionRanges(text, options) { + const { ignoreRegExpList = [], includeRegExpList = [] } = options; + const filteredIncludeList = includeRegExpList.filter((a) => !!a); + const finalIncludeList = filteredIncludeList.length ? filteredIncludeList : [/.*/gim]; + const includeRanges = excludeRanges(findMatchingRangesForPatterns(finalIncludeList, text), findMatchingRangesForPatterns(ignoreRegExpList, text)); + return includeRanges; +} + +// node_modules/cspell-lib/dist/esm/textValidation/docValidator.mjs +var ERROR_NOT_PREPARED = "Validator Must be prepared before calling this function."; +var skipValidation = false; +var DocumentValidator = class { + /** + * @param doc - Document to validate + * @param config - configuration to use (not finalized). + */ + constructor(doc, options, settings) { + this.settings = settings; + this._ready = false; + this.errors = []; + this._preparationTime = -1; + this._suggestions = new AutoCache((text) => this.genSuggestions(text), 1e3); + this._document = doc; + this.options = { ...options }; + const numSuggestions = this.options.numSuggestions ?? settings.numSuggestions; + if (numSuggestions !== void 0) { + this.options.numSuggestions = numSuggestions; + } + } + get ready() { + return this._ready; + } + /** + * Prepare to validate a document. + * This will load all the necessary configuration and dictionaries. + * + * @deprecated + * @deprecationMessage Use the async `prepare` method. + */ + prepareSync() { + if (this._ready) + return; + const timer = createTimer(); + const { options, settings } = this; + const useSearchForConfig = !options.noConfigSearch && !settings.noConfigSearch || options.noConfigSearch === false; + const optionsConfigFile = options.configFile; + const localConfigFn = optionsConfigFile ? () => loadConfigSync(optionsConfigFile, settings) : useSearchForConfig ? () => searchForDocumentConfigSync(this._document, settings, settings) : void 0; + const localConfig = localConfigFn && wrapCall(localConfigFn, (e) => this.addPossibleError(e))(); + this.addPossibleError(localConfig?.__importRef?.error); + const config = mergeSettings(settings, localConfig); + const docSettings = determineTextDocumentSettings(this._document, config); + const dict = getDictionaryInternalSync(docSettings); + const matcher = new GlobMatcher(localConfig?.ignorePaths || [], { root: process.cwd(), dot: true }); + const uri = this._document.uri; + const shouldCheck = !matcher.match(uriToFilePath(uri)) && (docSettings.enabled ?? true); + const finalSettings = finalizeSettings(docSettings); + const validateOptions = settingsToValidateOptions(finalSettings); + const includeRanges = calcTextInclusionRanges(this._document.text, validateOptions); + const segmenter = createMappedTextSegmenter(includeRanges); + const textValidator = textValidatorFactory(dict, validateOptions); + this._preparations = { + config, + dictionary: dict, + docSettings, + finalSettings, + shouldCheck, + validateOptions, + includeRanges, + segmenter, + textValidator, + localConfig, + localConfigFilepath: localConfig?.__importRef?.filename + }; + this._ready = true; + this._preparationTime = timer.elapsed(); + } + async prepare() { + if (this._ready) + return; + if (this._prepared) + return this._prepared; + this._prepared = this._prepareAsync(); + return this._prepared; + } + async _prepareAsync() { + (0, import_assert15.default)(!this._ready); + const timer = createTimer(); + const { options, settings } = this; + const useSearchForConfig = !options.noConfigSearch && !settings.noConfigSearch || options.noConfigSearch === false; + const pLocalConfig = options.configFile ? loadConfig(options.configFile, settings) : useSearchForConfig ? searchForDocumentConfig(this._document, settings, settings) : void 0; + const localConfig = await catchPromiseError(pLocalConfig, (e) => this.addPossibleError(e)) || {}; + this.addPossibleError(localConfig?.__importRef?.error); + const config = mergeSettings(settings, localConfig); + const docSettings = determineTextDocumentSettings(this._document, config); + const dict = await getDictionaryInternal(docSettings); + const matcher = new GlobMatcher(localConfig?.ignorePaths || [], { root: process.cwd(), dot: true }); + const uri = this._document.uri; + const shouldCheck = !matcher.match(uriToFilePath(uri)) && (docSettings.enabled ?? true); + const finalSettings = finalizeSettings(docSettings); + const validateOptions = settingsToValidateOptions(finalSettings); + const includeRanges = calcTextInclusionRanges(this._document.text, validateOptions); + const segmenter = createMappedTextSegmenter(includeRanges); + const textValidator = textValidatorFactory(dict, validateOptions); + this._preparations = { + config, + dictionary: dict, + docSettings, + finalSettings, + shouldCheck, + validateOptions, + includeRanges, + segmenter, + textValidator, + localConfig, + localConfigFilepath: localConfig?.__importRef?.filename + }; + this._ready = true; + this._preparationTime = timer.elapsed(); + } + _updatePrep() { + (0, import_assert15.default)(this._preparations, ERROR_NOT_PREPARED); + const timer = createTimer(); + const prep = this._preparations; + const docSettings = determineTextDocumentSettings(this._document, prep.config); + const dict = getDictionaryInternalSync(docSettings); + const shouldCheck = docSettings.enabled ?? true; + const finalSettings = finalizeSettings(docSettings); + const validateOptions = settingsToValidateOptions(finalSettings); + const includeRanges = calcTextInclusionRanges(this._document.text, validateOptions); + const segmenter = createMappedTextSegmenter(includeRanges); + const textValidator = textValidatorFactory(dict, validateOptions); + this._preparations = { + ...prep, + dictionary: dict, + docSettings, + shouldCheck, + validateOptions, + includeRanges, + segmenter, + textValidator + }; + this._preparationTime = timer.elapsed(); + } + /** + * The amount of time in ms to prepare for validation. + */ + get prepTime() { + return this._preparationTime; + } + get validateDirectives() { + return this.options.validateDirectives ?? this._preparations?.config.validateDirectives ?? false; + } + checkText(range, _text, scope) { + const text = this._document.text.slice(range[0], range[1]); + return this.check({ text, range, scope: scope.join(" ") }); + } + check(parsedText) { + (0, import_assert15.default)(this._ready); + (0, import_assert15.default)(this._preparations, ERROR_NOT_PREPARED); + const { segmenter, textValidator } = this._preparations; + const document = this._document; + let line = void 0; + function mapToIssue(issue) { + const { range, text, isFlagged, isFound, suggestionsEx } = issue; + const offset = range[0]; + const length = range[1] - range[0]; + (0, import_assert15.default)(!line || line.offset <= offset); + if (!line || line.offset + line.text.length <= offset) { + line = document.lineAt(offset); + } + return { text, offset, line, length, isFlagged, isFound, suggestionsEx }; + } + const issues = [...pipeSync(segmenter(parsedText), opConcatMapSync(textValidator.validate), opMapSync(mapToIssue))]; + if (!this.options.generateSuggestions) { + return issues.map((issue) => { + if (!issue.suggestionsEx) + return issue; + const suggestionsEx = this.adjustSuggestions(issue.text, issue.suggestionsEx); + const suggestions = suggestionsEx.map((s) => s.word); + return { ...issue, suggestionsEx, suggestions }; + }); } + const withSugs = issues.map((t) => { + const text = t.text; + const suggestionsEx = this.getSuggestions(text); + t.suggestionsEx = suggestionsEx; + t.suggestions = suggestionsEx.map((s) => s.word); + return t; + }); + return withSugs; } - return fn; -} -function opJoinStringsSync(joinCharacter = ",") { - function* fn(iter) { - for (const v of iter) { - const a = toArray(v); - yield a.join(joinCharacter); + /** + * Check a Document for Validation Issues. + * @param forceCheck - force a check even if the document would normally be excluded. + * @returns the validation issues. + */ + async checkDocumentAsync(forceCheck) { + await this.prepare(); + return this.checkDocument(forceCheck); + } + /** + * Check a Document for Validation Issues. + * + * Note: The validator must be prepared before calling this method. + * @param forceCheck - force a check even if the document would normally be excluded. + * @returns the validation issues. + */ + checkDocument(forceCheck = false) { + if (skipValidation) + return []; + (0, import_assert15.default)(this._ready); + (0, import_assert15.default)(this._preparations, ERROR_NOT_PREPARED); + const spellingIssues = forceCheck || this.shouldCheckDocument() ? [...this._checkParsedText(this._parse())] : []; + const directiveIssues = this.checkDocumentDirectives(); + const allIssues = spellingIssues.concat(directiveIssues).sort((a, b) => a.offset - b.offset); + return allIssues; + } + checkDocumentDirectives(forceCheck = false) { + (0, import_assert15.default)(this._ready); + (0, import_assert15.default)(this._preparations, ERROR_NOT_PREPARED); + const validateDirectives = forceCheck || this.validateDirectives; + if (!validateDirectives) + return []; + const document = this.document; + const issueType = IssueType.directive; + function toValidationIssue(dirIssue) { + const { text, range, suggestions, suggestionsEx, message } = dirIssue; + const offset = range[0]; + const pos = document.positionAt(offset); + const line = document.getLine(pos.line); + const issue = { text, offset, line, suggestions, suggestionsEx, message, issueType }; + return issue; } + return [...validateInDocumentSettings(this.document.text, this._preparations.config)].map(toValidationIssue); } - return fn; -} -var opJoinStrings = (joinCharacter) => toPipeFn(opJoinStringsSync(joinCharacter), opJoinStringsAsync(joinCharacter)); - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/last.mjs -var symNotFound = Symbol("LastNotFound"); -function opLastAsync(lastFn) { - async function* fn(iter) { - let last = symNotFound; - for await (const v of iter) { - const pass = await lastFn(v); - if (pass) { - last = v; + get document() { + return this._document; + } + updateDocumentText(text) { + updateTextDocument(this._document, [{ text }]); + this._updatePrep(); + } + defaultParser() { + return pipeSync(this.document.getLines(), opMapSync((line) => { + const { text, offset } = line; + const range = [offset, offset + text.length]; + return { text, range }; + })); + } + *_checkParsedText(parsedTexts) { + (0, import_assert15.default)(this._preparations, ERROR_NOT_PREPARED); + const { maxNumberOfProblems = defaultMaxNumberOfProblems, maxDuplicateProblems = defaultMaxDuplicateProblems } = this._preparations.validateOptions; + let numProblems = 0; + const mapOfProblems = /* @__PURE__ */ new Map(); + for (const pText of parsedTexts) { + for (const issue of this.check(pText)) { + const { text } = issue; + const n = (mapOfProblems.get(text) || 0) + 1; + mapOfProblems.set(text, n); + if (n > maxDuplicateProblems) + continue; + yield issue; + if (++numProblems >= maxNumberOfProblems) + return; } } - if (last !== symNotFound) - yield last; } - return fn; + addPossibleError(error2) { + if (!error2) + return; + error2 = this.errors.push(toError2(error2)); + } + _parse() { + (0, import_assert15.default)(this._preparations, ERROR_NOT_PREPARED); + const parser2 = this._preparations.finalSettings.parserFn; + if (typeof parser2 !== "object") + return this.defaultParser(); + return parser2.parse(this.document.text, this.document.uri.path).parsedTexts; + } + getSuggestions(text) { + return this._suggestions.get(text); + } + genSuggestions(text) { + (0, import_assert15.default)(this._preparations, ERROR_NOT_PREPARED); + const settings = this._preparations.docSettings; + const dict = this._preparations.dictionary; + const sugOptions = { + compoundMethod: 0, + numSuggestions: this.options.numSuggestions, + includeTies: false, + ignoreCase: !(settings.caseSensitive ?? false), + timeout: settings.suggestionsTimeout, + numChanges: settings.suggestionNumChanges + }; + const rawSuggestions = dict.suggest(text, sugOptions); + return this.adjustSuggestions(text, rawSuggestions); + } + adjustSuggestions(text, rawSuggestions) { + (0, import_assert15.default)(this._preparations, ERROR_NOT_PREPARED); + const settings = this._preparations.docSettings; + const ignoreCase2 = !(settings.caseSensitive ?? false); + const locale = this._preparations.config.language; + const dict = this._preparations.dictionary; + const sugsWithAlt = calcSuggestionAdjustedToToMatchCase(text, rawSuggestions.map(mapSug), locale, ignoreCase2, dict); + return sugsWithAlt.map(sanitizeSuggestion); + } + getFinalizedDocSettings() { + (0, import_assert15.default)(this._ready); + (0, import_assert15.default)(this._preparations, ERROR_NOT_PREPARED); + return this._preparations.docSettings; + } + /** + * Returns true if the final result of the configuration calculation results + * in the document being enabled. Note: in some cases, checking the document + * might still make sense, for example, the `@cspell/eslint-plugin` relies on + * `eslint` configuration to make that determination. + * @returns true if the document settings have resolved to be `enabled` + */ + shouldCheckDocument() { + (0, import_assert15.default)(this._preparations, ERROR_NOT_PREPARED); + return this._preparations.shouldCheck; + } + /** + * Internal `cspell-lib` use. + */ + _getPreparations() { + return this._preparations; + } +}; +function sanitizeSuggestion(sug) { + const { word, isPreferred, wordAdjustedToMatchCase } = sug; + if (isPreferred && wordAdjustedToMatchCase) + return { word, wordAdjustedToMatchCase, isPreferred }; + if (isPreferred) + return { word, isPreferred }; + if (wordAdjustedToMatchCase) + return { word, wordAdjustedToMatchCase }; + return { word }; +} +async function searchForDocumentConfig(document, defaultConfig, pnpSettings) { + const { uri } = document; + if (uri.scheme !== "file") + return Promise.resolve(defaultConfig); + return searchForConfig(import_path3.default.dirname(uriToFilePath(uri)), pnpSettings).then((s) => s || defaultConfig); +} +function mapSug(sug) { + return { cost: 999, ...sug }; +} +function searchForDocumentConfigSync(document, defaultConfig, pnpSettings) { + const { uri } = document; + if (uri.scheme !== "file") + defaultConfig; + return searchForConfigSync(uriToFilePath(uri), pnpSettings) || defaultConfig; +} +async function shouldCheckDocument(doc, options, settings) { + const errors = []; + function addPossibleError(error2) { + if (!error2) + return void 0; + error2 = errors.push(toError2(error2)); + return void 0; + } + async function shouldCheck() { + const useSearchForConfig = !options.noConfigSearch && !settings.noConfigSearch || options.noConfigSearch === false; + const pLocalConfig = options.configFile ? loadConfig(options.configFile, settings) : useSearchForConfig ? searchForDocumentConfig(doc, settings, settings) : void 0; + const localConfig = await catchPromiseError(pLocalConfig, addPossibleError) || {}; + addPossibleError(localConfig?.__importRef?.error); + const config = mergeSettings(settings, localConfig); + const matcher = new GlobMatcher(localConfig?.ignorePaths || [], { root: process.cwd(), dot: true }); + const docSettings = determineTextDocumentSettings(doc, config); + const uri = doc.uri; + return !matcher.match(uriToFilePath(uri)) && (docSettings.enabled ?? true); + } + return { errors, shouldCheck: await shouldCheck() }; +} + +// node_modules/cspell-lib/dist/esm/textValidation/checkText.mjs +var IncludeExcludeFlag; +(function(IncludeExcludeFlag2) { + IncludeExcludeFlag2["INCLUDE"] = "I"; + IncludeExcludeFlag2["EXCLUDE"] = "E"; +})(IncludeExcludeFlag || (IncludeExcludeFlag = {})); + +// node_modules/cspell-lib/dist/esm/spellCheckFile.mjs +async function spellCheckDocument(document, options, settings) { + if (isBinaryDoc(document)) { + return { + document, + options, + settingsUsed: settings, + localConfigFilepath: void 0, + issues: [], + checked: false, + errors: void 0 + }; + } + try { + return spellCheckFullDocument(await resolveDocument(document), options, settings); + } catch (e) { + const errors = isError2(e) ? [e] : []; + return { + document, + options, + settingsUsed: settings, + localConfigFilepath: void 0, + issues: [], + checked: false, + errors + }; + } } -function opLastSync(lastFn) { - function* fn(iter) { - let last = symNotFound; - for (const v of iter) { - if (lastFn(v)) { - last = v; - } +async function spellCheckFullDocument(document, options, settings) { + const doc = documentToTextDocument(document); + const docValOptions = options; + const docValidator = new DocumentValidator(doc, docValOptions, settings); + await docValidator.prepare(); + const prep = docValidator._getPreparations(); + if (docValidator.errors.length) { + return { + document, + options, + settingsUsed: prep?.localConfig || settings, + localConfigFilepath: prep?.localConfigFilepath, + issues: [], + checked: false, + errors: docValidator.errors + }; + } + const issues = docValidator.checkDocument(); + const result = { + document, + options, + settingsUsed: docValidator.getFinalizedDocSettings(), + localConfigFilepath: prep?.localConfigFilepath, + issues, + checked: docValidator.shouldCheckDocument(), + errors: void 0 + }; + return result; +} + +// node_modules/cspell-lib/dist/esm/getDictionary.mjs +function getDictionary(settings) { + return getDictionaryInternal(toInternalSettings(settings)); +} + +// node_modules/chalk/source/vendor/ansi-styles/index.js +var ANSI_BACKGROUND_OFFSET = 10; +var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`; +var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`; +var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`; +var styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + overline: [53, 55], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + // Bright color + blackBright: [90, 39], + gray: [90, 39], + // Alias of `blackBright` + grey: [90, 39], + // Alias of `blackBright` + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + // Bright color + bgBlackBright: [100, 49], + bgGray: [100, 49], + // Alias of `bgBlackBright` + bgGrey: [100, 49], + // Alias of `bgBlackBright` + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } +}; +var modifierNames = Object.keys(styles.modifier); +var foregroundColorNames = Object.keys(styles.color); +var backgroundColorNames = Object.keys(styles.bgColor); +var colorNames = [...foregroundColorNames, ...backgroundColorNames]; +function assembleStyles() { + const codes3 = /* @__PURE__ */ new Map(); + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\x1B[${style[0]}m`, + close: `\x1B[${style[1]}m` + }; + group[styleName] = styles[styleName]; + codes3.set(style[0], style[1]); } - if (last !== symNotFound) - yield last; + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + } + Object.defineProperty(styles, "codes", { + value: codes3, + enumerable: false + }); + styles.color.close = "\x1B[39m"; + styles.bgColor.close = "\x1B[49m"; + styles.color.ansi = wrapAnsi16(); + styles.color.ansi256 = wrapAnsi256(); + styles.color.ansi16m = wrapAnsi16m(); + styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET); + styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET); + styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET); + Object.defineProperties(styles, { + rgbToAnsi256: { + value(red, green, blue) { + if (red === green && green === blue) { + if (red < 8) { + return 16; + } + if (red > 248) { + return 231; + } + return Math.round((red - 8) / 247 * 24) + 232; + } + return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5); + }, + enumerable: false + }, + hexToRgb: { + value(hex) { + const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16)); + if (!matches) { + return [0, 0, 0]; + } + let [colorString] = matches; + if (colorString.length === 3) { + colorString = [...colorString].map((character) => character + character).join(""); + } + const integer = Number.parseInt(colorString, 16); + return [ + /* eslint-disable no-bitwise */ + integer >> 16 & 255, + integer >> 8 & 255, + integer & 255 + /* eslint-enable no-bitwise */ + ]; + }, + enumerable: false + }, + hexToAnsi256: { + value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)), + enumerable: false + }, + ansi256ToAnsi: { + value(code) { + if (code < 8) { + return 30 + code; + } + if (code < 16) { + return 90 + (code - 8); + } + let red; + let green; + let blue; + if (code >= 232) { + red = ((code - 232) * 10 + 8) / 255; + green = red; + blue = red; + } else { + code -= 16; + const remainder = code % 36; + red = Math.floor(code / 36) / 5; + green = Math.floor(remainder / 6) / 5; + blue = remainder % 6 / 5; + } + const value = Math.max(red, green, blue) * 2; + if (value === 0) { + return 30; + } + let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red)); + if (value === 2) { + result += 60; + } + return result; + }, + enumerable: false + }, + rgbToAnsi: { + value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)), + enumerable: false + }, + hexToAnsi: { + value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)), + enumerable: false + } + }); + return styles; +} +var ansiStyles = assembleStyles(); +var ansi_styles_default = ansiStyles; + +// node_modules/chalk/source/vendor/supports-color/index.js +var import_node_process2 = __toESM(require("node:process"), 1); +var import_node_os = __toESM(require("node:os"), 1); +var import_node_tty = __toESM(require("node:tty"), 1); +function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process2.default.argv) { + const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf("--"); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); +} +var { env: env2 } = import_node_process2.default; +var flagForceColor; +if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { + flagForceColor = 0; +} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { + flagForceColor = 1; +} +function envForceColor() { + if ("FORCE_COLOR" in env2) { + if (env2.FORCE_COLOR === "true") { + return 1; + } + if (env2.FORCE_COLOR === "false") { + return 0; + } + return env2.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env2.FORCE_COLOR, 10), 3); } - return fn; } -function opLast(fn) { - const asyncFn = opLastAsync(fn); - const syncFn = opLastSync(fn); - function _(i) { - return isAsyncIterable(i) ? asyncFn(i) : syncFn(i); +function translateLevel(level) { + if (level === 0) { + return false; } - return _; + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; } - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/map.mjs -function opMapAsync(mapFn) { - async function* fn(iter) { - for await (const v of iter) { - yield mapFn(v); +function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) { + const noFlagForceColor = envForceColor(); + if (noFlagForceColor !== void 0) { + flagForceColor = noFlagForceColor; + } + const forceColor = sniffFlags ? flagForceColor : noFlagForceColor; + if (forceColor === 0) { + return 0; + } + if (sniffFlags) { + if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { + return 3; + } + if (hasFlag("color=256")) { + return 2; } } - return fn; -} -function opMapSync(mapFn) { - function* fn(iter) { - for (const v of iter) { - yield mapFn(v); + if ("TF_BUILD" in env2 && "AGENT_NAME" in env2) { + return 1; + } + if (haveStream && !streamIsTTY && forceColor === void 0) { + return 0; + } + const min3 = forceColor || 0; + if (env2.TERM === "dumb") { + return min3; + } + if (import_node_process2.default.platform === "win32") { + const osRelease = import_node_os.default.release().split("."); + if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; } + return 1; } - return fn; -} -var opMap = (fn) => toPipeFn(opMapSync(fn), opMapAsync(fn)); - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/reduce.mjs -function opReduceAsync(reduceFn, initialValue) { - async function* reduce2(head, tail) { - for await (const v of tail) { - head = reduceFn(head, v); + if ("CI" in env2) { + if ("GITHUB_ACTIONS" in env2 || "GITEA_ACTIONS" in env2) { + return 3; } - yield head; + if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") { + return 1; + } + return min3; } - async function* fn(iter) { - const ht = initialValue === void 0 ? await headTailAsync(iter) : { head: await initialValue, tail: iter }; - if (!ht) - return; - yield* reduce2(ht.head, ht.tail); + if ("TEAMCITY_VERSION" in env2) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0; } - return fn; -} -function opReduceSync(reduceFn, initialValue) { - function* reduce2(head, tail) { - for (const v of tail) { - head = reduceFn(head, v); + if (env2.COLORTERM === "truecolor") { + return 3; + } + if (env2.TERM === "xterm-kitty") { + return 3; + } + if ("TERM_PROGRAM" in env2) { + const version4 = Number.parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + switch (env2.TERM_PROGRAM) { + case "iTerm.app": { + return version4 >= 3 ? 3 : 2; + } + case "Apple_Terminal": { + return 2; + } } - yield head; } - function* fn(iter) { - const ht = initialValue === void 0 ? headTail(iter) : { head: initialValue, tail: iter }; - if (!ht) - return; - yield* reduce2(ht.head, ht.tail); + if (/-256(color)?$/i.test(env2.TERM)) { + return 2; } - return fn; -} -function headTail(iter) { - const iterator = iter[Symbol.iterator](); - const first = iterator.next(); - if (first.done) - return void 0; - return { head: first.value, tail: iteratorToIterable(iterator) }; + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) { + return 1; + } + if ("COLORTERM" in env2) { + return 1; + } + return min3; } -async function headTailAsync(iter) { - const iterator = isIterable(iter) ? iter[Symbol.iterator]() : iter[Symbol.asyncIterator](); - const first = await iterator.next(); - if (first.done) - return void 0; - return { head: first.value, tail: asyncIteratorToAsyncIterable(iterator) }; +function createSupportsColor(stream, options = {}) { + const level = _supportsColor(stream, { + streamIsTTY: stream && stream.isTTY, + ...options + }); + return translateLevel(level); } -function isIterable(i) { - return typeof i[Symbol.iterator] === "function"; +var supportsColor = { + stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }), + stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) }) +}; +var supports_color_default = supportsColor; + +// node_modules/chalk/source/utilities.js +function stringReplaceAll(string, substring, replacer) { + let index = string.indexOf(substring); + if (index === -1) { + return string; + } + const substringLength = substring.length; + let endIndex = 0; + let returnValue = ""; + do { + returnValue += string.slice(endIndex, index) + substring + replacer; + endIndex = index + substringLength; + index = string.indexOf(substring, endIndex); + } while (index !== -1); + returnValue += string.slice(endIndex); + return returnValue; +} +function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) { + let endIndex = 0; + let returnValue = ""; + do { + const gotCR = string[index - 1] === "\r"; + returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix; + endIndex = index + 1; + index = string.indexOf("\n", endIndex); + } while (index !== -1); + returnValue += string.slice(endIndex); + return returnValue; } -// node_modules/@cspell/cspell-pipe/dist/esm/operators/skip.mjs -function opSkipAsync(count) { - async function* fn(iter) { - for await (const v of iter) { - if (count > 0) { - --count; - continue; - } - yield v; +// node_modules/chalk/source/index.js +var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default; +var GENERATOR = Symbol("GENERATOR"); +var STYLER = Symbol("STYLER"); +var IS_EMPTY = Symbol("IS_EMPTY"); +var levelMapping = [ + "ansi", + "ansi", + "ansi256", + "ansi16m" +]; +var styles2 = /* @__PURE__ */ Object.create(null); +var applyOptions = (object, options = {}) => { + if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { + throw new Error("The `level` option should be an integer from 0 to 3"); + } + const colorLevel = stdoutColor ? stdoutColor.level : 0; + object.level = options.level === void 0 ? colorLevel : options.level; +}; +var chalkFactory = (options) => { + const chalk2 = (...strings) => strings.join(" "); + applyOptions(chalk2, options); + Object.setPrototypeOf(chalk2, createChalk.prototype); + return chalk2; +}; +function createChalk(options) { + return chalkFactory(options); +} +Object.setPrototypeOf(createChalk.prototype, Function.prototype); +for (const [styleName, style] of Object.entries(ansi_styles_default)) { + styles2[styleName] = { + get() { + const builder2 = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]); + Object.defineProperty(this, styleName, { value: builder2 }); + return builder2; } - } - return fn; + }; } -function opSkipSync(count) { - function* fn(iter) { - for (const v of iter) { - if (count > 0) { - --count; - continue; - } - yield v; +styles2.visible = { + get() { + const builder2 = createBuilder(this, this[STYLER], true); + Object.defineProperty(this, "visible", { value: builder2 }); + return builder2; + } +}; +var getModelAnsi = (model, level, type, ...arguments_) => { + if (model === "rgb") { + if (level === "ansi16m") { + return ansi_styles_default[type].ansi16m(...arguments_); + } + if (level === "ansi256") { + return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_)); } + return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_)); } - return fn; + if (model === "hex") { + return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_)); + } + return ansi_styles_default[type][model](...arguments_); +}; +var usedModels = ["rgb", "hex", "ansi256"]; +for (const model of usedModels) { + styles2[model] = { + get() { + const { level } = this; + return function(...arguments_) { + const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]); + return createBuilder(this, styler, this[IS_EMPTY]); + }; + } + }; + const bgModel = "bg" + model[0].toUpperCase() + model.slice(1); + styles2[bgModel] = { + get() { + const { level } = this; + return function(...arguments_) { + const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]); + return createBuilder(this, styler, this[IS_EMPTY]); + }; + } + }; } -var opSkip = (count) => toPipeFn(opSkipSync(count), opSkipAsync(count)); - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/take.mjs -function opTakeAsync(count) { - async function* fn(iter) { - if (count <= 0) - return; - for await (const v of iter) { - yield v; - if (--count <= 0) - return; +var proto = Object.defineProperties(() => { +}, { + ...styles2, + level: { + enumerable: true, + get() { + return this[GENERATOR].level; + }, + set(level) { + this[GENERATOR].level = level; } } - return fn; -} -function opTakeSync(count) { - function* fn(iter) { - if (count <= 0) - return; - for (const v of iter) { - yield v; - if (--count <= 0) - return; +}); +var createStyler = (open, close, parent) => { + let openAll; + let closeAll; + if (parent === void 0) { + openAll = open; + closeAll = close; + } else { + openAll = parent.openAll + open; + closeAll = close + parent.closeAll; + } + return { + open, + close, + openAll, + closeAll, + parent + }; +}; +var createBuilder = (self, _styler, _isEmpty) => { + const builder2 = (...arguments_) => applyStyle(builder2, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" ")); + Object.setPrototypeOf(builder2, proto); + builder2[GENERATOR] = self; + builder2[STYLER] = _styler; + builder2[IS_EMPTY] = _isEmpty; + return builder2; +}; +var applyStyle = (self, string) => { + if (self.level <= 0 || !string) { + return self[IS_EMPTY] ? "" : string; + } + let styler = self[STYLER]; + if (styler === void 0) { + return string; + } + const { openAll, closeAll } = styler; + if (string.includes("\x1B")) { + while (styler !== void 0) { + string = stringReplaceAll(string, styler.close, styler.open); + styler = styler.parent; } } - return fn; -} -var opTake = (count) => toPipeFn(opTakeSync(count), opTakeAsync(count)); - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/tap.mjs -function opTapAsync(tapFn) { - async function* fn(iter) { - for await (const v of iter) { - tapFn(v); - yield v; + const lfIndex = string.indexOf("\n"); + if (lfIndex !== -1) { + string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); + } + return openAll + string + closeAll; +}; +Object.defineProperties(createChalk.prototype, styles2); +var chalk = createChalk(); +var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 }); +var source_default = chalk; + +// node_modules/chalk-template/index.js +var TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.))|(?:{(~)?(#?[\w:]+(?:\([^)]*\))?(?:\.#?[\w:]+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(})|((?:.|[\r\n\f])+?)/gi; +var STYLE_REGEX = /(?:^|\.)(?:(?:(\w+)(?:\(([^)]*)\))?)|(?:#(?=[:a-fA-F\d]{2,})([a-fA-F\d]{6})?(?::([a-fA-F\d]{6}))?))/g; +var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; +var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi; +var ESCAPES = /* @__PURE__ */ new Map([ + ["n", "\n"], + ["r", "\r"], + ["t", " "], + ["b", "\b"], + ["f", "\f"], + ["v", "\v"], + ["0", "\0"], + ["\\", "\\"], + ["e", "\x1B"], + ["a", "\x07"] +]); +function unescape2(c) { + const u = c[0] === "u"; + const bracket = c[1] === "{"; + if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) { + return String.fromCodePoint(Number.parseInt(c.slice(1), 16)); + } + if (u && bracket) { + return String.fromCodePoint(Number.parseInt(c.slice(2, -1), 16)); + } + return ESCAPES.get(c) || c; +} +function parseArguments(name, arguments_) { + const results = []; + const chunks = arguments_.trim().split(/\s*,\s*/g); + let matches; + for (const chunk of chunks) { + const number = Number(chunk); + if (!Number.isNaN(number)) { + results.push(number); + } else if (matches = chunk.match(STRING_REGEX)) { + results.push(matches[2].replace(ESCAPE_REGEX, (_, escape, character) => escape ? unescape2(escape) : character)); + } else { + throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); } } - return fn; + return results; } -function opTapSync(tapFn) { - function* fn(iter) { - for (const v of iter) { - tapFn(v); - yield v; +function parseHex(hex) { + const n = Number.parseInt(hex, 16); + return [ + // eslint-disable-next-line no-bitwise + n >> 16 & 255, + // eslint-disable-next-line no-bitwise + n >> 8 & 255, + // eslint-disable-next-line no-bitwise + n & 255 + ]; +} +function parseStyle(style) { + STYLE_REGEX.lastIndex = 0; + const results = []; + let matches; + while ((matches = STYLE_REGEX.exec(style)) !== null) { + const name = matches[1]; + if (matches[2]) { + results.push([name, ...parseArguments(name, matches[2])]); + } else if (matches[3] || matches[4]) { + if (matches[3]) { + results.push(["rgb", ...parseHex(matches[3])]); + } + if (matches[4]) { + results.push(["bgRgb", ...parseHex(matches[4])]); + } + } else { + results.push([name]); } } - return fn; + return results; } -var opTap = (fn) => toPipeFn(opTapSync(fn), opTapAsync(fn)); - -// node_modules/@cspell/cspell-pipe/dist/esm/operators/unique.mjs -function opUniqueAsync(k) { - function fnK(k2) { - async function* fn2(iter) { - const s = /* @__PURE__ */ new Set(); - for await (const v of iter) { - const kk = k2(v); - if (s.has(kk)) - continue; - s.add(kk); - yield v; +function makeTemplate(chalk2) { + function buildStyle(styles3) { + const enabled = {}; + for (const layer of styles3) { + for (const style of layer.styles) { + enabled[style[0]] = layer.inverse ? null : style.slice(1); } } - return fn2; - } - async function* fn(iter) { - const s = /* @__PURE__ */ new Set(); - for await (const v of iter) { - if (s.has(v)) + let current = chalk2; + for (const [styleName, styles4] of Object.entries(enabled)) { + if (!Array.isArray(styles4)) { continue; - s.add(v); - yield v; + } + if (!(styleName in current)) { + throw new Error(`Unknown Chalk style: ${styleName}`); + } + current = styles4.length > 0 ? current[styleName](...styles4) : current[styleName]; + } + return current; + } + function template3(string) { + const styles3 = []; + const chunks = []; + let chunk = []; + string.replace(TEMPLATE_REGEX, (_, escapeCharacter, inverse, style, close, character) => { + if (escapeCharacter) { + chunk.push(unescape2(escapeCharacter)); + } else if (style) { + const string2 = chunk.join(""); + chunk = []; + chunks.push(styles3.length === 0 ? string2 : buildStyle(styles3)(string2)); + styles3.push({ inverse, styles: parseStyle(style) }); + } else if (close) { + if (styles3.length === 0) { + throw new Error("Found extraneous } in Chalk template literal"); + } + chunks.push(buildStyle(styles3)(chunk.join(""))); + chunk = []; + styles3.pop(); + } else { + chunk.push(character); + } + }); + chunks.push(chunk.join("")); + if (styles3.length > 0) { + throw new Error(`Chalk template literal is missing ${styles3.length} closing bracket${styles3.length === 1 ? "" : "s"} (\`}\`)`); } + return chunks.join(""); } - return k ? fnK(k) : fn; + return template3; } -function opUniqueSync(k) { - function fnK(key) { - function* fn2(iter) { - const s = /* @__PURE__ */ new Set(); - for (const v of iter) { - const kk = key(v); - if (s.has(kk)) - continue; - s.add(kk); - yield v; - } +function makeChalkTemplate(template3) { + function chalkTemplate(firstString, ...arguments_) { + if (!Array.isArray(firstString) || !Array.isArray(firstString.raw)) { + throw new TypeError("A tagged template literal must be provided"); } - return fn2; - } - function* fn(iter) { - const s = /* @__PURE__ */ new Set(); - for (const v of iter) { - if (s.has(v)) - continue; - s.add(v); - yield v; + const parts = [firstString.raw[0]]; + for (let index = 1; index < firstString.raw.length; index++) { + parts.push( + String(arguments_[index - 1]).replace(/[{}\\]/g, "\\$&"), + String(firstString.raw[index]) + ); } + return template3(parts.join("")); } - return k ? fnK(k) : fn; -} -var opUnique = (getKey) => toPipeFn(opUniqueSync(getKey), opUniqueAsync(getKey)); - -// node_modules/@cspell/cspell-pipe/dist/esm/pipe.mjs -function pipeAsync(i, ...fns) { - const iter = toAsyncIterable(i); - return opCombineAsync(...fns)(iter); -} -function pipeSync(i, ...fns) { - return opCombineSync(...fns)(i); + return chalkTemplate; } - -// node_modules/@cspell/cspell-pipe/dist/esm/index.mjs -var operators = operators_exports; - -// node_modules/cspell/dist/esm/application.mjs -var import_cspell_lib4 = __toESM(require_cjs10(), 1); +var template = makeTemplate(source_default); +var chalk_template_default = makeChalkTemplate(template); +var templateStderr = makeTemplate(chalkStderr); +var chalkTemplateStderr = makeChalkTemplate(templateStderr); // node_modules/cspell/dist/esm/cli-reporter.mjs -var import_chalk = __toESM(require_source(), 1); -var import_cspell_lib = __toESM(require_cjs10(), 1); -var path2 = __toESM(require("path"), 1); +var path13 = __toESM(require("path"), 1); var import_uri = __toESM(require_uri(), 1); var templateIssue = `{green $filename}:{yellow $row:$col} - $message ({red $text}) $quickFix`; var templateIssueNoFix = `{green $filename}:{yellow $row:$col} - $message ({red $text})`; @@ -63107,9 +52897,9 @@ var templateIssueWithSuggestions = `{green $filename}:{yellow $row:$col} - $mess var templateIssueWithContext = `{green $filename}:{yellow $row:$col} $padRowCol- $message ({red $text})$padContext -- {gray $contextLeft}{red {underline $text}}{gray $contextRight}`; var templateIssueWithContextWithSuggestions = `{green $filename}:{yellow $row:$col} $padRowCol- $message ({red $text})$padContext -- {gray $contextLeft}{red {underline $text}}{gray $contextRight} Suggestions: {yellow [$suggestions]}`; -var templateIssueLegacy = `${import_chalk.default.green("$filename")}[$row, $col]: $message: ${import_chalk.default.red("$text")}`; +var templateIssueLegacy = `${source_default.green("$filename")}[$row, $col]: $message: ${source_default.red("$text")}`; var templateIssueWordsOnly = "$text"; -function genIssueEmitter(template2) { +function genIssueEmitter(template3) { const defaultWidth = 10; let maxWidth = defaultWidth; let uri; @@ -63119,29 +52909,29 @@ function genIssueEmitter(template2) { uri = issue.uri; } maxWidth = Math.max(maxWidth * 0.999, issue.text.length, 10); - console.log(formatIssue(template2, issue, Math.ceil(maxWidth))); + console.log(formatIssue(template3, issue, Math.ceil(maxWidth))); }; } function errorEmitter(message, error2) { - if ((0, import_cspell_lib.isSpellingDictionaryLoadError)(error2)) { + if (isSpellingDictionaryLoadError(error2)) { error2 = error2.cause; } - console.error(import_chalk.default.red(message), error2.toString()); + console.error(source_default.red(message), error2.toString()); } function nullEmitter2() { } function relativeFilename(filename, cwd = process.cwd()) { - const rel = path2.relative(cwd, filename); + const rel = path13.relative(cwd, filename); if (rel.startsWith("..")) return filename; - return "." + path2.sep + rel; + return "." + path13.sep + rel; } function relativeUriFilename(uri, fsPathRoot) { const fsPath = import_uri.URI.parse(uri).fsPath; - const rel = path2.relative(fsPathRoot, fsPath); + const rel = path13.relative(fsPathRoot, fsPath); if (rel.startsWith("..")) return fsPath; - return "." + path2.sep + rel; + return "." + path13.sep + rel; } function reportProgress(p) { if (p.type === "ProgressFileComplete") { @@ -63154,31 +52944,31 @@ function reportProgress(p) { function reportProgressFileBegin(p) { const fc = "" + p.fileCount; const fn = (" ".repeat(fc.length) + p.fileNum).slice(-fc.length); - const idx = fn + "/" + fc; - const filename = import_chalk.default.gray(relativeFilename(p.filename)); - process.stderr.write(`\r${idx} ${filename}`); + const idx2 = fn + "/" + fc; + const filename = source_default.gray(relativeFilename(p.filename)); + process.stderr.write(`\r${idx2} ${filename}`); } function reportProgressFileComplete(p) { const time = reportTime(p.elapsedTimeMs, !!p.cached); const skipped = p.processed === false ? " skipped" : ""; - const hasErrors = p.numErrors ? import_chalk.default.red` X` : ""; + const hasErrors = p.numErrors ? source_default.red` X` : ""; console.error(` ${time}${skipped}${hasErrors}`); } function reportTime(elapsedTimeMs, cached) { if (cached) - return import_chalk.default.green("cached"); + return source_default.green("cached"); if (elapsedTimeMs === void 0) return "-"; - const color = elapsedTimeMs < 1e3 ? import_chalk.default.white : elapsedTimeMs < 2e3 ? import_chalk.default.yellow : import_chalk.default.redBright; + const color = elapsedTimeMs < 1e3 ? source_default.white : elapsedTimeMs < 2e3 ? source_default.yellow : source_default.redBright; return color(elapsedTimeMs.toFixed(2) + "ms"); } function getReporter(options) { const issueTemplate = options.wordsOnly ? templateIssueWordsOnly : options.legacy ? templateIssueLegacy : options.showContext ? options.showSuggestions ? templateIssueWithContextWithSuggestions : templateIssueWithContext : options.showSuggestions ? templateIssueWithSuggestions : options.showSuggestions === false ? templateIssueNoFix : templateIssue; const { fileGlobs, silent, summary, issues, progress, verbose, debug } = options; const emitters = { - Debug: !silent && debug ? (s) => console.info(import_chalk.default.cyan(s)) : nullEmitter2, - Info: !silent && verbose ? (s) => console.info(import_chalk.default.yellow(s)) : nullEmitter2, - Warning: (s) => console.info(import_chalk.default.yellow(s)) + Debug: !silent && debug ? (s) => console.info(source_default.cyan(s)) : nullEmitter2, + Info: !silent && verbose ? (s) => console.info(source_default.yellow(s)) : nullEmitter2, + Warning: (s) => console.info(source_default.yellow(s)) }; function infoEmitter(message, msgType) { emitters[msgType]?.(message); @@ -63213,13 +53003,13 @@ function getReporter(options) { }; } function formatIssue(templateStr, issue, maxIssueTextWidth) { - function clean2(t2) { + function clean6(t2) { return t2.replace(/\s+/, " "); } const { uri = "", filename, row, col, text, context, offset } = issue; - const contextLeft = clean2(context.text.slice(0, offset - context.offset)); - const contextRight = clean2(context.text.slice(offset + text.length - context.offset)); - const contextFull = clean2(context.text); + const contextLeft = clean6(context.text.slice(0, offset - context.offset)); + const contextRight = clean6(context.text.slice(offset + text.length - context.offset)); + const contextFull = clean6(context.text); const padContext = " ".repeat(Math.max(maxIssueTextWidth - text.length, 0)); const rowText = row.toString(); const colText = col.toString(); @@ -63241,12 +53031,12 @@ function formatIssue(templateStr, issue, maxIssueTextWidth) { $uri: uri, $quickFix: formatQuickFix(issue) }; - const t = template(templateStr.replace(/\$message/g, message)); - return substitute((0, import_chalk.default)(t), substitutions).trimEnd(); + const t = template2(templateStr.replace(/\$message/g, message)); + return substitute(chalk_template_default(t), substitutions).trimEnd(); } function formatSuggestions(issue) { if (issue.suggestionsEx) { - return issue.suggestionsEx.map((sug) => sug.isPreferred ? import_chalk.default.italic(import_chalk.default.bold(sug.wordAdjustedToMatchCase || sug.word)) + "*" : sug.wordAdjustedToMatchCase || sug.word).join(", "); + return issue.suggestionsEx.map((sug) => sug.isPreferred ? source_default.italic(source_default.bold(sug.wordAdjustedToMatchCase || sug.word)) + "*" : sug.wordAdjustedToMatchCase || sug.word).join(", "); } if (issue.suggestions) { return issue.suggestions.join(", "); @@ -63259,7 +53049,7 @@ function formatQuickFix(issue) { const preferred = issue.suggestionsEx.filter((sug) => sug.isPreferred).map((sug) => sug.wordAdjustedToMatchCase || sug.word); if (!preferred.length) return ""; - const fixes = preferred.map((w) => import_chalk.default.italic(import_chalk.default.yellow(w))); + const fixes = preferred.map((w) => source_default.italic(source_default.yellow(w))); return `fix: (${fixes.join(", ")})`; } var TS = class extends Array { @@ -63268,14 +53058,14 @@ var TS = class extends Array { this.raw = [s]; } }; -function template(s) { +function template2(s) { return new TS(s); } function substitute(text, substitutions) { const subs = []; - for (const [match, replaceWith] of Object.entries(substitutions)) { - const len = match.length; - for (let i2 = text.indexOf(match); i2 >= 0; i2 = text.indexOf(match, i2 + 1)) { + for (const [match2, replaceWith] of Object.entries(substitutions)) { + const len = match2.length; + for (let i2 = text.indexOf(match2); i2 >= 0; i2 = text.indexOf(match2, i2 + 1)) { subs.push([i2, i2 + len, replaceWith]); } } @@ -63292,63 +53082,47 @@ function substitute(text, substitutions) { } // node_modules/cspell/dist/esm/featureFlags/featureFlags.mjs -var import_cspell_lib2 = __toESM(require_cjs10(), 1); function getFeatureFlags() { - return (0, import_cspell_lib2.getSystemFeatureFlags)(); + return getSystemFeatureFlags(); } -// node_modules/@cspell/cspell-types/dist/esm/CSpellReporter.mjs -var IssueType; -(function(IssueType2) { - IssueType2[IssueType2["spelling"] = 0] = "spelling"; - IssueType2[IssueType2["directive"] = 1] = "directive"; -})(IssueType || (IssueType = {})); -var MessageTypes = { - Debug: "Debug", - Info: "Info", - Warning: "Warning" -}; - -// node_modules/cspell/dist/esm/lint/lint.mjs -var import_chalk2 = __toESM(require_source(), 1); - -// node_modules/cspell-gitignore/dist/esm/GitIgnore.mjs -var path5 = __toESM(require("path"), 1); +// node_modules/cspell-gitignore/dist/GitIgnore.js +var path16 = __toESM(require("path"), 1); -// node_modules/cspell-gitignore/dist/esm/GitIgnoreFile.mjs -var import_fs2 = require("fs"); -var path4 = __toESM(require("path"), 1); +// node_modules/cspell-gitignore/dist/GitIgnoreFile.js +var import_fs3 = require("fs"); +var path15 = __toESM(require("path"), 1); -// node_modules/cspell-gitignore/dist/esm/helpers.mjs -var import_find_up = __toESM(require_find_up(), 1); -var path3 = __toESM(require("path"), 1); -function factoryPathHelper(path16) { +// node_modules/cspell-gitignore/dist/helpers.js +var import_find_up2 = __toESM(require_find_up(), 1); +var path14 = __toESM(require("path"), 1); +function factoryPathHelper(path26) { function directoryRoot2(directory) { - const p = path16.parse(directory); + const p = path26.parse(directory); return p.root; } async function findRepoRoot2(directory) { - const found = await (0, import_find_up.default)(".git", { cwd: directory, type: "directory" }); + const found = await (0, import_find_up2.default)(".git", { cwd: directory, type: "directory" }); if (!found) return void 0; - return path16.dirname(found); + return path26.dirname(found); } function isParentOf2(parent, child) { - const rel = path16.relative(parent, child); - return !!rel && !path16.isAbsolute(rel) && rel[0] !== "."; + const rel = path26.relative(parent, child); + return !!rel && !path26.isAbsolute(rel) && rel[0] !== "."; } function contains2(parent, child) { - const rel = path16.relative(parent, child); - return !rel || !path16.isAbsolute(rel) && rel[0] !== "."; + const rel = path26.relative(parent, child); + return !rel || !path26.isAbsolute(rel) && rel[0] !== "."; } function makeRelativeTo2(child, parent) { - const rel = path16.relative(parent, child); - if (path16.isAbsolute(rel) || rel[0] === ".") + const rel = path26.relative(parent, child); + if (path26.isAbsolute(rel) || rel[0] === ".") return void 0; return normalizePath3(rel); } - function normalizePath3(path17) { - return path17.replace(/\\/g, "/"); + function normalizePath3(path27) { + return path27.replace(/\\/g, "/"); } return { directoryRoot: directoryRoot2, @@ -63359,18 +53133,18 @@ function factoryPathHelper(path16) { makeRelativeTo: makeRelativeTo2 }; } -var defaultHelper = factoryPathHelper(path3); +var defaultHelper = factoryPathHelper(path14); var directoryRoot = defaultHelper.directoryRoot; var findRepoRoot = defaultHelper.findRepoRoot; var isParentOf = defaultHelper.isParentOf; var contains = defaultHelper.contains; var makeRelativeTo = defaultHelper.makeRelativeTo; var normalizePath = defaultHelper.normalizePath; -function isDefined(v) { +function isDefined7(v) { return v !== void 0 && v !== null; } -// node_modules/cspell-gitignore/dist/esm/GitIgnoreFile.mjs +// node_modules/cspell-gitignore/dist/GitIgnoreFile.js var GitIgnoreFile = class _GitIgnoreFile { constructor(matcher, gitignore) { this.matcher = matcher; @@ -63396,10 +53170,10 @@ var GitIgnoreFile = class _GitIgnoreFile { return this.matcher.patterns; } getGlobs(relativeTo) { - return this.getGlobPatters().map((pat) => globToString(pat, relativeTo)).filter(isDefined); + return this.getGlobPatters().map((pat) => globToString(pat, relativeTo)).filter(isDefined7); } static parseGitignore(content, gitignoreFilename) { - const options = { root: path4.dirname(gitignoreFilename) }; + const options = { root: path15.dirname(gitignoreFilename) }; const globs = content.split(/\r?\n/g).map((glob2, index) => ({ glob: glob2.replace(/^#.*/, ""), source: gitignoreFilename, @@ -63409,8 +53183,8 @@ var GitIgnoreFile = class _GitIgnoreFile { return new _GitIgnoreFile(globMatcher, gitignoreFilename); } static async loadGitignore(gitignore) { - gitignore = path4.resolve(gitignore); - const content = await import_fs2.promises.readFile(gitignore, "utf8"); + gitignore = path15.resolve(gitignore); + const content = await import_fs3.promises.readFile(gitignore, "utf8"); return this.parseGitignore(content, gitignore); } }; @@ -63447,7 +53221,7 @@ var GitIgnoreHierarchy = class { } }; async function loadGitIgnore(dir) { - const file = path4.join(dir, ".gitignore"); + const file = path15.join(dir, ".gitignore"); try { return await GitIgnoreFile.loadGitignore(file); } catch (e) { @@ -63474,7 +53248,7 @@ function globToString(glob2, relativeTo) { return (base ? base + "/" : "") + glob2.glob; } -// node_modules/cspell-gitignore/dist/esm/GitIgnore.mjs +// node_modules/cspell-gitignore/dist/GitIgnore.js var GitIgnore = class { /** * @param roots - (search roots) an optional array of root paths to prevent searching for `.gitignore` files above the root. @@ -63491,15 +53265,15 @@ var GitIgnore = class { return this.resolvedGitIgnoreHierarchies.get(directory); } isIgnoredQuick(file) { - const gh = this.findResolvedGitIgnoreHierarchy(path5.dirname(file)); + const gh = this.findResolvedGitIgnoreHierarchy(path16.dirname(file)); return gh?.isIgnored(file); } async isIgnored(file) { - const gh = await this.findGitIgnoreHierarchy(path5.dirname(file)); + const gh = await this.findGitIgnoreHierarchy(path16.dirname(file)); return gh.isIgnored(file); } async isIgnoredEx(file) { - const gh = await this.findGitIgnoreHierarchy(path5.dirname(file)); + const gh = await this.findGitIgnoreHierarchy(path16.dirname(file)); return gh.isIgnoredEx(file); } async findGitIgnoreHierarchy(directory) { @@ -63515,7 +53289,7 @@ var GitIgnore = class { } filterOutIgnored(files) { const iter = this.filterOutIgnoredAsync(files); - return isAsyncIterable2(files) ? iter : asyncIterableToArray(iter); + return isAsyncIterable3(files) ? iter : asyncIterableToArray2(iter); } async *filterOutIgnoredAsync(files) { for await (const file of files) { @@ -63529,7 +53303,7 @@ var GitIgnore = class { return this._sortedRoots; } addRoots(roots) { - const rootsToAdd = roots.map((p) => path5.resolve(p)).filter((r) => !this._roots.has(r)); + const rootsToAdd = roots.map((p) => path16.resolve(p)).filter((r) => !this._roots.has(r)); if (!rootsToAdd.length) return; rootsToAdd.forEach((r) => this._roots.add(r)); @@ -63549,7 +53323,7 @@ var GitIgnore = class { } async _findGitIgnoreHierarchy(directory) { const root = this.determineRoot(directory); - const parent = path5.dirname(directory); + const parent = path16.dirname(directory); const parentHierarchy = parent !== directory && contains(root, parent) ? await this.findGitIgnoreHierarchy(parent) : void 0; const git = await loadGitIgnore(directory); if (!git) { @@ -63565,11 +53339,11 @@ var GitIgnore = class { if (contains(r, directory)) return r; } - return path5.parse(directory).root; + return path16.parse(directory).root; } }; function resolveAndSortRoots(roots) { - const sortedRoots = roots.map((a) => path5.resolve(a)); + const sortedRoots = roots.map((a) => path16.resolve(a)); sortRoots(sortedRoots); Object.freeze(sortedRoots); return sortedRoots; @@ -63578,11 +53352,11 @@ function sortRoots(roots) { roots.sort((a, b) => a.length - b.length); return roots; } -function isAsyncIterable2(i) { +function isAsyncIterable3(i) { const as = i; return typeof as[Symbol.asyncIterator] === "function"; } -async function asyncIterableToArray(iter) { +async function asyncIterableToArray2(iter) { const r = []; for await (const t of iter) { r.push(t); @@ -63591,19 +53365,18 @@ async function asyncIterableToArray(iter) { } // node_modules/cspell/dist/esm/lint/lint.mjs -var cspell2 = __toESM(require_cjs10(), 1); -var path13 = __toESM(require("path"), 1); -var import_util23 = require("util"); +var path23 = __toESM(require("path"), 1); +var import_util57 = require("util"); var import_pkgInfo2 = __toESM(require_pkgInfo(), 1); var import_uri3 = __toESM(require_uri(), 1); // node_modules/cspell/dist/esm/util/cache/createCache.mjs -var import_assert3 = __toESM(require("assert"), 1); -var import_promises = require("fs/promises"); -var import_path3 = __toESM(require("path"), 1); +var import_assert17 = __toESM(require("assert"), 1); +var import_promises2 = require("fs/promises"); +var import_path6 = __toESM(require("path"), 1); // node_modules/cspell/dist/esm/util/errors.mjs -var import_util14 = require("util"); +var import_util54 = require("util"); var CheckFailed = class extends Error { constructor(message, exitCode = 1) { super(message); @@ -63629,17 +53402,17 @@ var IOError = class extends ApplicationError { return this.cause.code === "ENOENT"; } }; -function toError(e) { - if (isError2(e)) +function toError3(e) { + if (isError4(e)) return e; - const message = (0, import_util14.format)(e); + const message = (0, import_util54.format)(e); return { name: "error", message, toString: () => message }; } -function isError2(e) { +function isError4(e) { if (e instanceof Error) return true; if (!e || typeof e !== "object") @@ -63650,549 +53423,47 @@ function isError2(e) { function toApplicationError(e, message) { if (e instanceof ApplicationError && !message) return e; - const err = toError(e); + const err = toError3(e); return new ApplicationError(message ?? err.message, void 0, err); } // node_modules/cspell/dist/esm/util/cache/DiskCache.mjs -var import_assert2 = __toESM(require("assert"), 1); -var crypto4 = __toESM(require("crypto"), 1); -var fs4 = __toESM(require("fs"), 1); -var import_path2 = require("path"); - -// node_modules/@cspell/cspell-service-bus/dist/esm/errors.mjs -var ErrorUnhandledRequest = class extends Error { - constructor(request) { - super(`Unhandled Request: ${request.type}`); - this.request = request; - } -}; -var ErrorServiceRequestDepthExceeded = class extends Error { - constructor(request, depth) { - super(`Service Request Depth ${depth} Exceeded: ${request.type}`); - this.request = request; - this.depth = depth; - } -}; -var UnhandledHandlerError = class extends Error { - constructor(handlerName, handlerDescription, cause) { - super(`Unhandled Error in Handler: ${handlerName}`); - this.handlerName = handlerName; - this.handlerDescription = handlerDescription; - this.cause = cause; - } -}; - -// node_modules/@cspell/cspell-service-bus/dist/esm/request.mjs -var BaseServiceRequest = class { - constructor(type, params) { - this.type = type; - this.params = params; - } -}; -var ServiceRequestCls = class extends BaseServiceRequest { - constructor(type, params) { - super(type, params); - } -}; -function createResponse(value, _req) { - return { value }; -} -function createResponseFail(_request, error2) { - return { error: error2 }; -} -function isServiceResponseSuccess(res) { - return "value" in res && res.error === void 0; -} -function isServiceResponseFailure(res) { - return res.error !== void 0; -} - -// node_modules/@cspell/cspell-service-bus/dist/esm/bus.mjs -var MAX_DEPTH = 10; -var ServiceBus = class { - constructor(handlers = []) { - this.handlers = []; - handlers.forEach((h) => this.addHandler(h)); - } - addHandler(handler, name = "anonymous", description) { - const h = typeof handler === "function" ? { fn: handler, name, description } : handler; - const { fn, name: _name, description: _description } = h; - this.handlers.push({ fn, name: _name, description: _description }); - return this; - } - dispatch(request) { - let depth = 0; - const dispatcher = { dispatch }; - const handler = this.reduceHandlers(this.handlers, request, dispatcher, this.defaultHandler); - function dispatch(request2) { - ++depth; - if (depth >= MAX_DEPTH) { - return createResponseFail(request2, new ErrorServiceRequestDepthExceeded(request2, depth)); - } - const response = handler(request2); - --depth; - return response; - } - return dispatch(request); - } - defaultHandler(request) { - return createResponseFail(request, new ErrorUnhandledRequest(request)); - } - reduceHandlers(handlers, request, dispatcher, defaultHandler) { - const _handlers = handlers.map((m) => ({ ...m, fn: m.fn(dispatcher) })); - const handler = _handlers.reduce((next, h) => { - const fn = h.fn(next); - return (req) => { - try { - return fn(req); - } catch (e) { - return createResponseFail(request, new UnhandledHandlerError(h.name, h.description, e)); - } - }; - }, defaultHandler); - return handler; - } -}; - -// node_modules/@cspell/cspell-service-bus/dist/esm/createRequestHandler.mjs -function createRequestHandler(requestDef, fn, name, description) { - return createIsRequestHandler(requestDef.is, fn, name ?? requestDef.type, description); -} -function createIsRequestHandlerFn(isA, fn) { - return (dispatcher) => (next) => (request) => isA(request) ? fn(request, next, dispatcher) : next(request); -} -function createIsRequestHandler(isA, fn, name, description) { - return { - fn: createIsRequestHandlerFn(isA, fn), - name, - description - }; -} - -// node_modules/@cspell/cspell-service-bus/dist/esm/requestFactory.mjs -function requestFactory(requestType) { - class RequestClass extends ServiceRequestCls { - constructor(params) { - super(requestType, params); - } - static is(req) { - return req instanceof RequestClass && req.type === requestType; - } - static create(params) { - return new RequestClass(params); - } - static createRequestHandler(fn, name, description) { - return createRequestHandler(RequestClass, fn, name, description); - } - } - RequestClass.type = requestType; - return RequestClass; -} - -// node_modules/cspell-io/dist/esm/common/stat.mjs -function compareStats(left, right) { - if (left === right) - return 0; - if (left.eTag || right.eTag) - return left.eTag === right.eTag ? 0 : (left.eTag || "") < (right.eTag || "") ? -1 : 1; - const diff = left.size - right.size || left.mtimeMs - right.mtimeMs; - return diff < 0 ? -1 : diff > 0 ? 1 : 0; -} - -// node_modules/cspell-io/dist/esm/errors/ErrorNotImplemented.mjs -var ErrorNotImplemented = class extends Error { - constructor(method) { - super(`Method ${method} is not supported.`); - this.method = method; - } -}; - -// node_modules/cspell-io/dist/esm/handlers/node/file.mjs -var import_assert = __toESM(require("assert"), 1); -var import_fs3 = require("fs"); -var import_url2 = require("url"); -var import_zlib = require("zlib"); - -// node_modules/cspell-io/dist/esm/common/encode-decode.mjs -var BOM_BE = 65279; -var BOM_LE = 65534; -function decodeUtf16LE(buf) { - const bom = buf[0] << 8 | buf[1]; - buf = bom === BOM_LE ? buf.subarray(2) : buf; - return buf.toString("utf16le"); -} -function decodeUtf16BE(buf) { - return decodeUtf16LE(swapBytes(buf)); -} -function decode(buf, encoding) { - switch (encoding) { - case "utf16be": - return decodeUtf16BE(buf); - case "utf16le": - return decodeUtf16LE(buf); - } - if (buf.length < 2 || encoding && !encoding.startsWith("utf")) - return buf.toString(encoding); - const bom = buf[0] << 8 | buf[1]; - if (bom === BOM_BE || buf[0] === 0 && buf[1] !== 0) - return decodeUtf16BE(buf); - if (bom === BOM_LE || buf[0] !== 0 && buf[1] === 0) - return decodeUtf16LE(buf); - return buf.toString(encoding); -} -function swapBytesInPlace(buf) { - for (let i = 0; i < buf.length - 1; i += 2) { - const v = buf[i]; - buf[i] = buf[i + 1]; - buf[i + 1] = v; - } - return buf; -} -function swapBytes(buf) { - const tBuf = Buffer.from(buf); - return swapBytesInPlace(tBuf); -} - -// node_modules/cspell-io/dist/esm/errors/error.mjs -function toError2(e) { - if (e instanceof Error) - return e; - if (typeof e === "object" && e && typeof e.message === "string") { - return e; - } - return Error(e && e.toString()); -} - -// node_modules/cspell-io/dist/esm/node/file/util.mjs -var import_url = require("url"); -var isURLRegExp = /^(\w{2,64}:\/\/|data:)/i; -function isUrlLike(filename) { - return filename instanceof URL || isURLRegExp.test(filename); -} -function toURL(filename) { - return filename instanceof URL || typeof filename !== "string" ? filename : isUrlLike(filename) ? new URL(filename) : (0, import_url.pathToFileURL)(filename); -} -var regMatchFilename = /filename=([^;,]*)/; -function urlBasename(url) { - function guessDataUrlName(header) { - const filenameMatch = header.match(regMatchFilename); - if (filenameMatch) - return filenameMatch[1]; - const mime = header.split(";", 1)[0]; - return mime.replace(/\W/g, "."); - } - if (typeof url === "string" && url.startsWith("data:")) { - return guessDataUrlName(url.split(",", 1)[0].split(":", 2)[1]); - } - url = toURL(url); - if (url.protocol === "data:") { - return guessDataUrlName(url.pathname.split(",", 1)[0]); - } - return basename(url.pathname); -} -function urlDirname(url) { - if (typeof url === "string" && url.startsWith("data:")) { - return toURL("data:"); - } - url = toURL(url); - if (url.protocol === "data:") { - return toURL("data:"); - } - return new URL(url.pathname.endsWith("/") ? ".." : ".", url); -} -function basename(path16) { - path16 = path16.endsWith("/") ? path16.slice(0, path16.length - 1) : path16; - const idx = path16.lastIndexOf("/"); - return idx >= 0 ? path16.slice(idx + 1) || "" : path16; -} - -// node_modules/cspell-io/dist/esm/node/dataUrl.mjs -var dataUrlRegExHead = /^data:(?[^;,]*)(?(?:;[^=]+=[^;,]*)*)(?;base64)?$/; -function decodeDataUrl(url) { - url = url.toString(); - const [head, encodedData] = url.split(",", 2); - if (!head || encodedData === void 0) - throw Error("Not a data url"); - const match = head.match(dataUrlRegExHead); - if (!match || !match.groups) - throw Error("Not a data url"); - const mediaType = match.groups["mediaType"] || ""; - const rawAttributes = (match.groups["attributes"] || "").split(";").filter((a) => !!a).map((entry) => entry.split("=", 2)).map(([key, value]) => [key, decodeURIComponent(value)]); - const attributes = new Map(rawAttributes); - const encoding = attributes.get("charset"); - const isBase64 = !!match.groups["base64"]; - const data = isBase64 ? Buffer.from(encodedData, "base64url") : Buffer.from(decodeURIComponent(encodedData)); - return { mediaType, data, encoding, attributes }; -} - -// node_modules/cspell-io/dist/esm/node/file/fetch.mjs -var import_node_fetch = __toESM(require_lib3(), 1); +var import_assert16 = __toESM(require("assert"), 1); +var crypto5 = __toESM(require("crypto"), 1); +var fs7 = __toESM(require("fs"), 1); +var import_path5 = require("path"); -// node_modules/cspell-io/dist/esm/node/file/FetchError.mjs -var FetchUrlError = class _FetchUrlError extends Error { - constructor(message, code, status, url) { - super(message); - this.code = code; - this.status = status; - this.url = url; - this.name = "FetchUrlError"; - } - static create(url, status, message) { - if (status === 404) - return new _FetchUrlError(message || "URL not found.", "ENOENT", status, url); - if (status >= 400 && status < 500) - return new _FetchUrlError(message || "Permission denied.", "EACCES", status, url); - return new _FetchUrlError(message || "Fatal Error", "ECONNREFUSED", status, url); - } -}; - -// node_modules/cspell-io/dist/esm/node/file/fetch.mjs -var fetch = import_node_fetch.default; -async function fetchHead(request) { - const r = await fetch(request, { method: "HEAD" }); - return r.headers; -} -async function fetchURL(url) { - const response = await fetch(url); - if (!response.ok) { - throw FetchUrlError.create(url, response.status); - } - return Buffer.from(await response.arrayBuffer()); -} - -// node_modules/cspell-io/dist/esm/node/file/stat.mjs -async function getStatHttp(url) { - const headers = await fetchHead(url); - const eTag = headers.get("etag") || void 0; - const guessSize = Number.parseInt(headers.get("content-length") || "0", 10); - return { - size: eTag ? -1 : guessSize, - mtimeMs: 0, - eTag - }; -} - -// node_modules/cspell-io/dist/esm/requests/RequestFsReadBinaryFile.mjs -var RequestType = "fs:readBinaryFile"; -var RequestFsReadBinaryFile = requestFactory(RequestType); -var RequestTypeSync = "fs:readBinaryFileSync"; -var RequestFsReadBinaryFileSync = requestFactory(RequestTypeSync); - -// node_modules/cspell-io/dist/esm/requests/RequestFsReadFile.mjs -var RequestType2 = "fs:readFile"; -var RequestFsReadFile = requestFactory(RequestType2); - -// node_modules/cspell-io/dist/esm/requests/RequestFsReadFileSync.mjs -var RequestType3 = "fs:readFileSync"; -var RequestFsReadFileSync = requestFactory(RequestType3); - -// node_modules/cspell-io/dist/esm/requests/RequestFsStat.mjs -var RequestTypeStat = "fs:stat"; -var RequestFsStat = requestFactory(RequestTypeStat); -var RequestTypeStatSync = "fs:statSync"; -var RequestFsStatSync = requestFactory(RequestTypeStatSync); - -// node_modules/cspell-io/dist/esm/requests/RequestFsWriteFile.mjs -var RequestType4 = "fs:writeFile"; -var RequestFsWriteFile = requestFactory(RequestType4); - -// node_modules/cspell-io/dist/esm/requests/RequestZlibInflate.mjs -var RequestType5 = "zlib:inflate"; -var RequestZlibInflate = requestFactory(RequestType5); +// node_modules/cspell/dist/esm/util/fileHelper.mjs +var import_fs5 = require("fs"); -// node_modules/cspell-io/dist/esm/handlers/node/file.mjs -var isGzFileRegExp = /\.gz($|[?#])/; -function isGzFile(url) { - return isGzFileRegExp.test(url.pathname); -} -var handleRequestFsReadBinaryFile = RequestFsReadBinaryFile.createRequestHandler(({ params }) => createResponse(import_fs3.promises.readFile((0, import_url2.fileURLToPath)(params.url)).then((content) => ({ url: params.url, content }))), void 0, "Node: Read Binary File."); -var handleRequestFsReadBinaryFileSync = RequestFsReadBinaryFileSync.createRequestHandler(({ params }) => createResponse({ url: params.url, content: (0, import_fs3.readFileSync)((0, import_url2.fileURLToPath)(params.url)) }), void 0, "Node: Sync Read Binary File."); -var handleRequestFsReadFile = RequestFsReadFile.createRequestHandler((req, _, dispatcher) => { - const { url, encoding } = req.params; - const res = dispatcher.dispatch(RequestFsReadBinaryFile.create({ url })); - if (!isServiceResponseSuccess(res)) { - (0, import_assert.default)(isServiceResponseFailure(res)); - return createResponseFail(req, res.error); - } - return createResponse(res.value.then((res2) => ({ - url, - content: bufferToText(res2.content, encoding), - baseFilename: res2.baseFilename - }))); -}, void 0, "Node: Read Text File."); -var handleRequestFsReadFileSync = RequestFsReadFileSync.createRequestHandler((req, _, dispatcher) => { - const { url, encoding } = req.params; - const res = dispatcher.dispatch(RequestFsReadBinaryFileSync.create({ url })); - if (!isServiceResponseSuccess(res)) { - (0, import_assert.default)(isServiceResponseFailure(res)); - return createResponseFail(req, res.error); +// node_modules/get-stdin/index.js +var { stdin } = process; +async function getStdin() { + let result = ""; + if (stdin.isTTY) { + return result; } - return createResponse({ - ...res.value, - content: bufferToText(res.value.content, encoding) - }); -}, void 0, "Node: Sync Read Text File."); -var handleRequestZlibInflate = RequestZlibInflate.createRequestHandler(({ params }) => createResponse((0, import_zlib.gunzipSync)(params.data).toString("utf-8")), void 0, "Node: gz deflate."); -var supportedFetchProtocols = { "http:": true, "https:": true }; -var handleRequestFsReadBinaryFileHttp = RequestFsReadBinaryFile.createRequestHandler((req, next) => { - const { url } = req.params; - if (!(url.protocol in supportedFetchProtocols)) - return next(req); - return createResponse(fetchURL(url).then((content) => ({ url, content }))); -}, void 0, "Node: Read Http(s) file."); -var handleRequestFsReadBinaryFileSyncData = RequestFsReadBinaryFileSync.createRequestHandler((req, next) => { - const { url } = req.params; - if (url.protocol !== "data:") - return next(req); - const data = decodeDataUrl(url); - return createResponse({ url, content: data.data, baseFilename: data.attributes.get("filename") }); -}, void 0, "Node: Read data: urls."); -var handleRequestFsReadBinaryFileData = RequestFsReadBinaryFile.createRequestHandler((req, next, dispatcher) => { - const { url } = req.params; - if (url.protocol !== "data:") - return next(req); - const res = dispatcher.dispatch(RequestFsReadBinaryFileSync.create(req.params)); - if (!isServiceResponseSuccess(res)) - return res; - return createResponse(Promise.resolve(res.value)); -}, void 0, "Node: Read data: urls."); -function bufferToText(buf, encoding) { - return buf[0] === 31 && buf[1] === 139 ? decode((0, import_zlib.gunzipSync)(buf), encoding) : decode(buf, encoding); -} -var handleRequestFsStat = RequestFsStat.createRequestHandler(({ params }) => createResponse(import_fs3.promises.stat((0, import_url2.fileURLToPath)(params.url))), void 0, "Node: fs.stat."); -var handleRequestFsStatSync = RequestFsStatSync.createRequestHandler((req) => { - const { params } = req; - try { - return createResponse((0, import_fs3.statSync)((0, import_url2.fileURLToPath)(params.url))); - } catch (e) { - return createResponseFail(req, toError2(e)); + stdin.setEncoding("utf8"); + for await (const chunk of stdin) { + result += chunk; } -}, void 0, "Node: fs.stat."); -var handleRequestFsStatHttp = RequestFsStat.createRequestHandler((req, next) => { - const { url } = req.params; - if (!(url.protocol in supportedFetchProtocols)) - return next(req); - return createResponse(getStatHttp(url)); -}, void 0, "Node: http get stat"); -var handleRequestFsWriteFile = RequestFsWriteFile.createRequestHandler(({ params }) => createResponse(import_fs3.promises.writeFile(params.url, params.content)), void 0, "Node: fs.writeFile"); -var handleRequestFsWriteFileGz = RequestFsWriteFile.createRequestHandler((req, next) => { - const { url, content } = req.params; - if (!isGzFile(url)) - return next(req); - return createResponse(import_fs3.promises.writeFile(url, (0, import_zlib.gzipSync)(content))); -}, void 0, "Node: http get stat"); -function registerHandlers(serviceBus) { - const handlers = [ - handleRequestFsWriteFile, - handleRequestFsWriteFileGz, - handleRequestFsReadBinaryFile, - handleRequestFsReadBinaryFileSync, - handleRequestFsReadBinaryFileHttp, - handleRequestFsReadBinaryFileData, - handleRequestFsReadBinaryFileSyncData, - handleRequestFsReadFile, - handleRequestFsReadFileSync, - handleRequestZlibInflate, - handleRequestFsStatSync, - handleRequestFsStat, - handleRequestFsStatHttp - ]; - handlers.forEach((handler) => serviceBus.addHandler(handler)); + return result; } - -// node_modules/cspell-io/dist/esm/CSpellIONode.mjs -var defaultCSpellIONode = void 0; -var CSpellIONode = class { - constructor(serviceBus = new ServiceBus()) { - this.serviceBus = serviceBus; - registerHandlers(serviceBus); - } - readFile(uriOrFilename, encoding = "utf8") { - const url = toURL(uriOrFilename); - const res = this.serviceBus.dispatch(RequestFsReadFile.create({ url, encoding })); - if (!isServiceResponseSuccess(res)) { - throw genError(res.error, "readFile"); - } - return res.value; +getStdin.buffer = async () => { + const result = []; + let length = 0; + if (stdin.isTTY) { + return Buffer.concat([]); } - readFileSync(uriOrFilename, encoding = "utf8") { - const url = toURL(uriOrFilename); - const res = this.serviceBus.dispatch(RequestFsReadFileSync.create({ url, encoding })); - if (!isServiceResponseSuccess(res)) { - throw genError(res.error, "readFileSync"); - } - return res.value; + for await (const chunk of stdin) { + result.push(chunk); + length += chunk.length; } - writeFile(uriOrFilename, content) { - const url = toURL(uriOrFilename); - const res = this.serviceBus.dispatch(RequestFsWriteFile.create({ url, content })); - if (!isServiceResponseSuccess(res)) { - throw genError(res.error, "writeFile"); - } - return res.value; - } - getStat(uriOrFilename) { - const url = toURL(uriOrFilename); - const res = this.serviceBus.dispatch(RequestFsStat.create({ url })); - if (!isServiceResponseSuccess(res)) { - throw genError(res.error, "getStat"); - } - return res.value; - } - getStatSync(uriOrFilename) { - const url = toURL(uriOrFilename); - const res = this.serviceBus.dispatch(RequestFsStatSync.create({ url })); - if (!isServiceResponseSuccess(res)) { - throw genError(res.error, "getStatSync"); - } - return res.value; - } - compareStats(left, right) { - return compareStats(left, right); - } - toURL(uriOrFilename) { - return toURL(uriOrFilename); - } - uriBasename(uriOrFilename) { - return urlBasename(uriOrFilename); - } - uriDirname(uriOrFilename) { - return urlDirname(uriOrFilename); - } -}; -function genError(err, alt) { - return err || new ErrorNotImplemented(alt); -} -function getDefaultCSpellIO() { - if (defaultCSpellIONode) - return defaultCSpellIONode; - const cspellIO = new CSpellIONode(); - defaultCSpellIONode = cspellIO; - return cspellIO; -} - -// node_modules/cspell-io/dist/esm/node/file/fileReader.mjs -var Stream = __toESM(require("stream"), 1); -var import_util18 = require("util"); -var pipeline2 = (0, import_util18.promisify)(Stream.pipeline); - -// node_modules/cspell-io/dist/esm/node/file/fileWriter.mjs -var Stream2 = __toESM(require("stream"), 1); -var import_util20 = require("util"); -var pipeline4 = (0, import_util20.promisify)(Stream2.pipeline); - -// node_modules/cspell-io/dist/esm/file/file.mjs -var readFile2 = function(filename, encoding) { - return getDefaultCSpellIO().readFile(filename, encoding).then((fr) => fr.content); + return Buffer.concat(result, length); }; // node_modules/cspell/dist/esm/util/fileHelper.mjs -var cspell = __toESM(require_cjs10(), 1); -var import_cspell_lib3 = __toESM(require_cjs10(), 1); -var import_fs5 = require("fs"); -var import_get_stdin = __toESM(require_get_stdin(), 1); -var path7 = __toESM(require("path"), 1); +var path18 = __toESM(require("path"), 1); var import_url3 = require("url"); var import_uri2 = __toESM(require_uri(), 1); @@ -64208,11 +53479,11 @@ var FileProtocol = "file://"; // node_modules/cspell/dist/esm/util/glob.mjs var import_fast_glob = __toESM(require_out4(), 1); var import_fs4 = require("fs"); -var path6 = __toESM(require("path"), 1); -var import_path = require("path"); +var path17 = __toESM(require("path"), 1); +var import_path4 = require("path"); // node_modules/cspell/dist/esm/util/util.mjs -var uniqueFn = uniqueFilterFnGenerator; +var uniqueFn2 = uniqueFilterFnGenerator; function uniqueFilterFnGenerator(extractFn) { const values = /* @__PURE__ */ new Set(); const extractor = extractFn || ((a) => a); @@ -64223,7 +53494,7 @@ function uniqueFilterFnGenerator(extractFn) { return ret; }; } -function clean(src) { +function clean5(src) { const r = src; for (const key of Object.keys(r)) { if (r[key] === void 0) { @@ -64241,7 +53512,7 @@ async function globP(pattern, options) { const onlyFiles = options?.nodir; const dot = options?.dot; const patterns = typeof pattern === "string" ? [pattern] : pattern; - const useOptions = clean({ + const useOptions = clean5({ cwd, onlyFiles, dot, @@ -64249,9 +53520,9 @@ async function globP(pattern, options) { absolute: true, followSymbolicLinks: false }); - const compare2 = new Intl.Collator("en").compare; - const absolutePaths = (await (0, import_fast_glob.default)(patterns, useOptions)).sort(compare2); - const relativePaths = absolutePaths.map((absFilename) => path6.relative(cwd, absFilename)); + const compare4 = new Intl.Collator("en").compare; + const absolutePaths = (await (0, import_fast_glob.default)(patterns, useOptions)).sort(compare4); + const relativePaths = absolutePaths.map((absFilename) => path17.relative(cwd, absFilename)); return relativePaths; } function calcGlobs(commandLineExclude) { @@ -64316,11 +53587,11 @@ async function adjustPossibleDirectory(glob2, root) { if (isPossibleUrlRegExp.test(g.glob)) { return glob2; } - const dirPath = path6.resolve(g.root, g.glob); + const dirPath = path17.resolve(g.root, g.glob); try { const stat2 = await import_fs4.promises.stat(dirPath); if (stat2.isDirectory()) { - const useGlob = import_path.posix.join(posixPath(g.glob), "**"); + const useGlob = import_path4.posix.join(posixPath(g.glob), "**"); return typeof glob2 === "string" ? useGlob : { ...glob2, glob: useGlob }; } } catch (e) { @@ -64329,7 +53600,7 @@ async function adjustPossibleDirectory(glob2, root) { return glob2; } function posixPath(p) { - return path6.sep === "\\" ? p.replace(/\\/g, "/") : p; + return path17.sep === "\\" ? p.replace(/\\/g, "/") : p; } async function normalizeFileOrGlobsToRoot(globs, root) { const adjustedGlobs = await Promise.all(globs.map((g) => adjustPossibleDirectory(g, root))); @@ -64346,10 +53617,10 @@ function readStdin() { var doesMatchUrl = /^(file|stdin|https?):\/\//; async function readConfig(configFile, root) { if (configFile) { - const config2 = await cspell.loadConfig(configFile) || {}; + const config2 = await loadConfig(configFile) || {}; return { source: configFile, config: config2 }; } - const config = await cspell.searchForConfig(root); + const config = await searchForConfig(root); return { source: config?.__importRef?.filename || "None found", config: config || {} }; } function fileInfoToDocument(fileInfo, languageId, locale) { @@ -64358,67 +53629,67 @@ function fileInfoToDocument(fileInfo, languageId, locale) { locale = locale || void 0; const uri = filenameToUrlString(filename); if (uri.startsWith(STDINProtocol)) { - return clean({ + return clean5({ uri, text, languageId, locale }); } - return (0, import_cspell_lib3.fileToDocument)(uri, text, languageId, locale); + return fileToDocument(uri, text, languageId, locale); } function filenameToUrlString(filename, cwd = ".") { if (filename === STDIN) return "stdin:///"; if (filename.startsWith(STDINProtocol)) { const filePath = filename.slice(STDINProtocol.length); - const fullPath = path7.resolve(cwd, filePath); + const fullPath = path18.resolve(cwd, filePath); return (0, import_url3.pathToFileURL)(fullPath).toString(); } if (doesMatchUrl.test(filename)) return filename; - return (0, import_url3.pathToFileURL)(path7.resolve(cwd, filename)).toString(); + return (0, import_url3.pathToFileURL)(path18.resolve(cwd, filename)).toString(); } function filenameToUri(filename, cwd) { return import_uri2.URI.parse(filenameToUrlString(filename, cwd)); } -function isBinaryFile(filename, cwd) { +function isBinaryFile2(filename, cwd) { const uri = filenameToUri(filename, cwd); if (uri.scheme.startsWith("stdin")) return false; - return (0, import_cspell_lib3.isBinaryFile)(uri); + return isBinaryFile(uri); } -function resolveFilename(filename, cwd) { +function resolveFilename2(filename, cwd) { cwd = cwd || process.cwd(); if (filename === STDIN) return STDINProtocol; if (filename.startsWith(FileProtocol)) { - const url = new URL(filename.slice(FileProtocol.length), (0, import_url3.pathToFileURL)(cwd + path7.sep)); + const url = new URL(filename.slice(FileProtocol.length), (0, import_url3.pathToFileURL)(cwd + path18.sep)); return (0, import_url3.fileURLToPath)(url); } const scheme = filename.startsWith(STDINProtocol) ? STDINProtocol : ""; const pathname = filename.slice(scheme.length); - return scheme + path7.resolve(cwd, pathname); + return scheme + path18.resolve(cwd, pathname); } function readFileInfo(filename, encoding = UTF8, handleNotFound = false) { - filename = resolveFilename(filename); - const pText = filename.startsWith(STDINProtocol) ? (0, import_get_stdin.default)() : readFile2(filename, encoding); + filename = resolveFilename2(filename); + const pText = filename.startsWith(STDINProtocol) ? getStdin() : readFileText2(filename, encoding); return pText.then((text) => ({ text, filename }), (e) => { - const error2 = toError(e); + const error2 = toError3(e); return handleNotFound && error2.code === "EISDIR" ? Promise.resolve({ text: "", filename, errorCode: error2.code }) : handleNotFound && error2.code === "ENOENT" ? Promise.resolve({ text: "", filename, errorCode: error2.code }) : Promise.reject(new IOError(`Error reading file: "${filename}"`, error2)); }); } -function readFile3(filename, encoding = UTF8) { +function readFile2(filename, encoding = UTF8) { return readFileInfo(filename, encoding).then((info3) => info3.text); } async function findFiles(globPatterns, options) { - const stdin = []; - const globPats = globPatterns.filter((filename) => filename !== STDIN && !filename.startsWith(STDINProtocol) && !filename.startsWith(FileProtocol) ? true : (stdin.push(filename), false)); + const stdin2 = []; + const globPats = globPatterns.filter((filename) => filename !== STDIN && !filename.startsWith(STDINProtocol) && !filename.startsWith(FileProtocol) ? true : (stdin2.push(filename), false)); const globResults = globPats.length ? await globP(globPats, options) : []; const cwd = options.cwd || process.cwd(); - return [...stdin, ...globResults].map((filename) => resolveFilename(filename, cwd)); + return [...stdin2, ...globResults].map((filename) => resolveFilename2(filename, cwd)); } -var resolveFilenames = asyncMap(resolveFilename); +var resolveFilenames = asyncMap(resolveFilename2); function readFileListFiles(listFiles) { let useStdin = false; const files = listFiles.filter((file) => { @@ -64427,14 +53698,14 @@ function readFileListFiles(listFiles) { return !isStdin; }); const found = pipeAsync(files, asyncMap((file) => readFileListFile(file)), asyncAwait(), asyncFlatten()); - const stdin = useStdin ? readStdin() : []; - return pipeAsync(toAsyncIterable(found, stdin), resolveFilenames); + const stdin2 = useStdin ? readStdin() : []; + return pipeAsync(toAsyncIterable(found, stdin2), resolveFilenames); } async function readFileListFile(listFile) { try { - const relTo = path7.resolve(path7.dirname(listFile)); - const content = await readFile3(listFile); - const lines = content.split("\n").map((a) => a.trim()).filter((a) => !!a).map((file) => path7.resolve(relTo, file)); + const relTo = path18.resolve(path18.dirname(listFile)); + const content = await readFile2(listFile); + const lines = content.split("\n").map((a) => a.trim()).filter((a) => !!a).map((file) => path18.resolve(relTo, file)); return lines; } catch (err) { throw toApplicationError(err, `Error reading file list from: "${listFile}"`); @@ -64454,12 +53725,12 @@ function isNotDir(filename) { // node_modules/cspell/dist/esm/util/cache/fileEntryCache.mjs var import_fs6 = require("fs"); -var path8 = __toESM(require("path"), 1); +var path19 = __toESM(require("path"), 1); var import_worker_threads = require("worker_threads"); var fec = __toESM(require_file_entry_cache(), 1); function createFromFile2(pathToCache, useCheckSum, useRelative) { - const absPathToCache = path8.resolve(pathToCache); - const relDir = path8.dirname(absPathToCache); + const absPathToCache = path19.resolve(pathToCache); + const relDir = path19.dirname(absPathToCache); (0, import_fs6.mkdirSync)(relDir, { recursive: true }); const create = wrap(() => fec.createFromFile(absPathToCache, useCheckSum)); const feCache = create(); @@ -64472,13 +53743,13 @@ function createFromFile2(pathToCache, useCheckSum, useRelative) { }, hasFileChanged: wrap((cwd, file) => { console.log(file); - return feCache.hasFileChanged(resolveFile(cwd, file)); + return feCache.hasFileChanged(resolveFile2(cwd, file)); }), analyzeFiles: wrap((cwd, files) => { return feCache.analyzeFiles(resolveFiles(cwd, files)); }), getFileDescriptor: wrap((cwd, file) => { - return feCache.getFileDescriptor(resolveFile(cwd, file)); + return feCache.getFileDescriptor(resolveFile2(cwd, file)); }), getUpdatedFiles: wrap((cwd, files) => { return feCache.getUpdatedFiles(resolveFiles(cwd, files)); @@ -64488,7 +53759,7 @@ function createFromFile2(pathToCache, useCheckSum, useRelative) { }), removeEntry: wrap((cwd, file) => { console.log(file); - return feCache.removeEntry(resolveFile(cwd, file)); + return feCache.removeEntry(resolveFile2(cwd, file)); }), deleteCacheFile() { feCache.deleteCacheFile(); @@ -64501,14 +53772,14 @@ function createFromFile2(pathToCache, useCheckSum, useRelative) { }) }; return cacheWrapper; - function resolveFile(cwd, file) { + function resolveFile2(cwd, file) { if (!useRelative) return file; - const r = path8.relative(relDir, path8.resolve(cwd, file)); + const r = path19.relative(relDir, path19.resolve(cwd, file)); return normalizePath2(r); } function resolveFiles(cwd, files) { - return files?.map((file) => resolveFile(cwd, file)); + return files?.map((file) => resolveFile2(cwd, file)); } function wrap(fn) { return (...params) => { @@ -64527,7 +53798,7 @@ function normalizePath2(filePath) { } // node_modules/cspell/dist/esm/util/cache/ObjectCollection.mjs -var compare = Intl.Collator().compare; +var compare3 = Intl.Collator().compare; var ShallowObjectCollection = class { constructor() { this.tree = {}; @@ -64536,9 +53807,9 @@ var ShallowObjectCollection = class { if (typeof v !== "object" || v === null) { return v; } - const keys = Object.entries(v).filter((entry) => entry[1] !== void 0).sort((a, b) => compare(a[0], b[0])); + const keys2 = Object.entries(v).filter((entry) => entry[1] !== void 0).sort((a, b) => compare3(a[0], b[0])); let t = this.tree; - for (const [key, obj] of keys) { + for (const [key, obj] of keys2) { if (!t.c) { t.c = /* @__PURE__ */ new Map(); } @@ -64578,8 +53849,8 @@ var DiskCache = class { this.dependencyCacheTree = {}; this.objectCollection = new ShallowObjectCollection(); this.ocCacheFileResult = new ShallowObjectCollection(); - this.cacheFileLocation = (0, import_path2.resolve)(cacheFileLocation); - this.cacheDir = (0, import_path2.dirname)(this.cacheFileLocation); + this.cacheFileLocation = (0, import_path5.resolve)(cacheFileLocation); + this.cacheDir = (0, import_path5.dirname)(this.cacheFileLocation); this.fileEntryCache = createFromFile2(this.cacheFileLocation, useCheckSum, useUniversalCache); this.version = calcVersion(cspellVersion); } @@ -64672,11 +53943,11 @@ var DiskCache = class { return d; } getFileDep(file) { - (0, import_assert2.default)((0, import_path2.isAbsolute)(file), `Dependency must be absolute "${file}"`); + (0, import_assert16.default)((0, import_path5.isAbsolute)(file), `Dependency must be absolute "${file}"`); const f = this.toRelFile(file); let h; try { - const buffer = fs4.readFileSync(file); + const buffer = fs7.readFileSync(file); h = this.getHash(buffer); } catch (e) { return { f }; @@ -64694,18 +53965,18 @@ var DiskCache = class { return true; } getHash(buffer) { - return crypto4.createHash("md5").update(buffer).digest("hex"); + return crypto5.createHash("md5").update(buffer).digest("hex"); } resolveFile(file) { - return normalizePath2((0, import_path2.resolve)(this.cacheDir, file)); + return normalizePath2((0, import_path5.resolve)(this.cacheDir, file)); } toRelFile(file) { - return normalizePath2(this.useUniversalCache ? (0, import_path2.relative)(this.cacheDir, file) : file); + return normalizePath2(this.useUniversalCache ? (0, import_path5.relative)(this.cacheDir, file) : file); } }; -function getTreeEntry(tree, keys) { +function getTreeEntry(tree, keys2) { let r = tree; - for (const k of keys) { + for (const k of keys2) { r = r.c?.get(k); if (!r) return r; @@ -64736,8 +54007,8 @@ function setTreeEntry(tree, deps, update = false) { function compDep(a, b) { return a.f === b.f && a.h === b.h; } -function calcVersion(version3) { - return version3 + META_DATA_VERSION_SUFFIX; +function calcVersion(version4) { + return version4 + META_DATA_VERSION_SUFFIX; } // node_modules/cspell/dist/esm/util/cache/DummyCache.mjs @@ -64759,20 +54030,20 @@ var DummyCache = class { // node_modules/cspell/dist/esm/util/cache/createCache.mjs var DEFAULT_CACHE_LOCATION = ".cspellcache"; var versionSuffix = ""; -function createCache(options) { +function createCache5(options) { const { useCache, cacheLocation, cacheStrategy, reset } = options; - const location = import_path3.default.resolve(cacheLocation); + const location = import_path6.default.resolve(cacheLocation); const useChecksum = cacheStrategy === "content"; - const version3 = normalizeVersion(options.version); + const version4 = normalizeVersion(options.version); const useUniversal = options.cacheFormat === "universal"; - const cache = useCache ? new DiskCache(location, useChecksum, version3, useUniversal) : new DummyCache(); - reset && cache.reset(); - return cache; + const cache2 = useCache ? new DiskCache(location, useChecksum, version4, useUniversal) : new DummyCache(); + reset && cache2.reset(); + return cache2; } async function calcCacheSettings(config, cacheOptions, root) { const cs = config.cache ?? {}; const useCache = cacheOptions.cache ?? cs.useCache ?? false; - const cacheLocation = await resolveCacheLocation(import_path3.default.resolve(root, cacheOptions.cacheLocation ?? cs.cacheLocation ?? DEFAULT_CACHE_LOCATION)); + const cacheLocation = await resolveCacheLocation(import_path6.default.resolve(root, cacheOptions.cacheLocation ?? cs.cacheLocation ?? DEFAULT_CACHE_LOCATION)); const cacheStrategy = cacheOptions.cacheStrategy ?? cs.cacheStrategy ?? "metadata"; const cacheFormat = cacheOptions.cacheFormat ?? cs.cacheFormat ?? "legacy"; const optionals = {}; @@ -64790,27 +54061,27 @@ async function calcCacheSettings(config, cacheOptions, root) { } async function resolveCacheLocation(cacheLocation) { try { - const s = await (0, import_promises.stat)(cacheLocation); + const s = await (0, import_promises2.stat)(cacheLocation); if (s.isFile()) return cacheLocation; - return import_path3.default.join(cacheLocation, DEFAULT_CACHE_LOCATION); + return import_path6.default.join(cacheLocation, DEFAULT_CACHE_LOCATION); } catch (err) { - if (isError2(err) && err.code === "ENOENT") { + if (isError4(err) && err.code === "ENOENT") { return cacheLocation; } throw err; } } -function normalizeVersion(version3) { - const parts = version3.split(".").slice(0, 2); - (0, import_assert3.default)(parts.length === 2); +function normalizeVersion(version4) { + const parts = version4.split(".").slice(0, 2); + (0, import_assert17.default)(parts.length === 2); return parts.join(".") + versionSuffix; } // node_modules/cspell/dist/esm/util/prefetch.mjs -var import_assert4 = __toESM(require("assert"), 1); +var import_assert18 = __toESM(require("assert"), 1); function* prefetchIterable(iterable, size) { - (0, import_assert4.default)(size >= 0); + (0, import_assert18.default)(size >= 0); const iter = iterable[Symbol.iterator](); const buffer = []; for (let next = iter.next(); !next.done; next = iter.next()) { @@ -64825,7 +54096,7 @@ function* prefetchIterable(iterable, size) { } // node_modules/@cspell/dynamic-import/dist/esm/dynamicImport.mjs -var import_path4 = require("path"); +var import_path7 = require("path"); var import_url4 = require("url"); var isWindowsPath = /^[a-z]:\\/i; async function dynamicImportFrom(moduleName, paths) { @@ -64835,19 +54106,19 @@ async function dynamicImportFrom(moduleName, paths) { try { return await import(modulesNameToImport.toString()); } catch (e) { - const err = toError3(e); + const err = toError4(e); throw err; } } const importResolveModule = await Promise.resolve().then(() => (init_import_meta_resolve(), import_meta_resolve_exports)); - const { resolve: resolve10 } = importResolveModule; + const { resolve: resolve13 } = importResolveModule; let lastError = void 0; for (const parent of paths) { - const url = typeof parent === "string" ? parent.startsWith("file://") ? new URL(parent) : (0, import_url4.pathToFileURL)(parent + import_path4.sep) : parent; + const url = typeof parent === "string" ? parent.startsWith("file://") ? new URL(parent) : (0, import_url4.pathToFileURL)(parent + import_path7.sep) : parent; let resolved = ""; let location = ""; try { - resolved = await resolve10(modulesNameToImport.toString(), url.toString()); + resolved = resolve13(modulesNameToImport.toString(), url.toString()); location = isWindowsPath.test(resolved) ? (0, import_url4.pathToFileURL)(resolved).toString() : resolved; return await import(location); } catch (err) { @@ -64856,12 +54127,12 @@ async function dynamicImportFrom(moduleName, paths) { } throw lastError; } -function toError3(e) { - if (isError3(e)) +function toError4(e) { + if (isError5(e)) return e; return new Error(e?.toString()); } -function isError3(e) { +function isError5(e) { return e instanceof Error; } @@ -64905,7 +54176,7 @@ async function loadReporters(reporters, defaultReporter, config) { const { getReporter: getReporter2 } = await dynamicImportFrom(moduleName, [process.cwd(), import_pkgInfo.pkgDir]); return getReporter2(settings, config); } catch (e) { - throw new ApplicationError(`Failed to load reporter ${moduleName}: ${toError(e).message}`); + throw new ApplicationError(`Failed to load reporter ${moduleName}: ${toError3(e).message}`); } } reporters = !reporters || !reporters.length ? ["default"] : [...reporters]; @@ -64926,12 +54197,12 @@ function hrTimeToMs(hrTime) { } // node_modules/cspell/dist/esm/lint/lint.mjs -var version2 = import_pkgInfo2.npmPackage.version; +var version3 = import_pkgInfo2.npmPackage.version; var BATCH_SIZE = 8; var { opFilterAsync: opFilterAsync2 } = operators; async function runLint(cfg) { let { reporter } = cfg; - cspell2.setLogger(getLoggerFromReporter(reporter)); + setLogger(getLoggerFromReporter(reporter)); const configErrors = /* @__PURE__ */ new Set(); const timer = getTimeMeasurer(); const lintResult = await run2(); @@ -64941,19 +54212,19 @@ async function runLint(cfg) { console.log(`Elapsed Time: ${elapsed.toFixed(2)}ms`); } return lintResult; - function prefetch(filename, configInfo, cache) { - if (isBinaryFile(filename, cfg.root)) + function prefetch(filename, configInfo, cache2) { + if (isBinaryFile2(filename, cfg.root)) return { filename, result: Promise.resolve({ skip: true }) }; async function fetch2() { const getElapsedTimeMs = getTimeMeasurer(); - const cachedResult = await cache.getCachedLintResults(filename); + const cachedResult = await cache2.getCachedLintResults(filename); if (cachedResult) { reporter.debug(`Filename: ${filename}, using cache`); const fileResult = { ...cachedResult, elapsedTimeMs: getElapsedTimeMs() }; return { fileResult }; } const uri = filenameToUri(filename, cfg.root); - const checkResult = await cspell2.shouldCheckDocument({ uri }, {}, configInfo.config); + const checkResult = await shouldCheckDocument({ uri }, {}, configInfo.config); if (!checkResult.shouldCheck) return { skip: true }; const fileInfo = await readFileInfo(filename, void 0, true); @@ -64962,11 +54233,11 @@ async function runLint(cfg) { const result = fetch2(); return { filename, result }; } - async function processFile(filename, configInfo, cache, prefetch2) { + async function processFile(filename, configInfo, cache2, prefetch2) { if (prefetch2?.fileResult) return prefetch2.fileResult; const getElapsedTimeMs = getTimeMeasurer(); - const cachedResult = await cache.getCachedLintResults(filename); + const cachedResult = await cache2.getCachedLintResults(filename); if (cachedResult) { reporter.debug(`Filename: ${filename}, using cache`); return { ...cachedResult, elapsedTimeMs: getElapsedTimeMs() }; @@ -64984,7 +54255,7 @@ async function runLint(cfg) { const fileInfo = prefetch2?.fileInfo || await readFileInfo(filename, void 0, true); if (fileInfo.errorCode) { if (fileInfo.errorCode !== "EISDIR" && cfg.options.mustFindFiles) { - const err = toError(`File not found: "${filename}"`); + const err = toError3(`File not found: "${filename}"`); reporter.error("Linter:", err); result.errors += 1; } @@ -64998,13 +54269,13 @@ async function runLint(cfg) { try { const { showSuggestions: generateSuggestions, validateDirectives } = cfg.options; const numSuggestions = configInfo.config.numSuggestions ?? 5; - const validateOptions = clean({ generateSuggestions, numSuggestions, validateDirectives }); - const r = await cspell2.spellCheckDocument(doc, validateOptions, configInfo.config); + const validateOptions = clean5({ generateSuggestions, numSuggestions, validateDirectives }); + const r = await spellCheckDocument(doc, validateOptions, configInfo.config); spellResult = r; result.processed = r.checked; - result.issues = cspell2.Text.calculateTextDocumentOffsets(doc.uri, text, r.issues).map(mapIssue); + result.issues = text_exports.calculateTextDocumentOffsets(doc.uri, text, r.issues).map(mapIssue); } catch (e) { - reporter.error(`Failed to process "${filename}"`, toError(e)); + reporter.error(`Failed to process "${filename}"`, toError3(e)); result.errors += 1; } result.elapsedTimeMs = getElapsedTimeMs(); @@ -65026,17 +54297,17 @@ async function runLint(cfg) { reporter.debug(JSON.stringify(debugCfg, void 0, 2)); } const dep = calcDependencies(config); - cache.setCachedLintResults(result, dep.files); + cache2.setCachedLintResults(result, dep.files); return result; } function mapIssue({ doc: _, ...tdo }) { const context = cfg.showContext ? extractContext(tdo, cfg.showContext) : { text: tdo.line.text.trimEnd(), offset: tdo.line.offset }; - return clean({ ...tdo, context }); + return clean5({ ...tdo, context }); } async function processFiles(files, configInfo, cacheSettings) { const fileCount = files instanceof Array ? files.length : void 0; const status = runResult(); - const cache = createCache(cacheSettings); + const cache2 = createCache5(cacheSettings); const failFast = cfg.options.failFast ?? configInfo.config.failFast ?? false; const emitProgressBegin = (filename, fileNum, fileCount2) => reporter.progress({ type: "ProgressFileBegin", @@ -65044,7 +54315,7 @@ async function runLint(cfg) { fileCount: fileCount2, filename }); - const emitProgressComplete = (filename, fileNum, fileCount2, result) => reporter.progress(clean({ + const emitProgressComplete = (filename, fileNum, fileCount2, result) => reporter.progress(clean5({ type: "ProgressFileComplete", fileNum, fileCount: fileCount2, @@ -65055,14 +54326,14 @@ async function runLint(cfg) { cached: result?.cached })); function* prefetchFiles(files2) { - const iter = prefetchIterable(pipeSync(files2, opMapSync((filename) => prefetch(filename, configInfo, cache))), BATCH_SIZE); + const iter = prefetchIterable(pipeSync(files2, opMapSync((filename) => prefetch(filename, configInfo, cache2))), BATCH_SIZE); for (const v of iter) { yield v; } } async function* prefetchFilesAsync(files2) { for await (const filename of files2) { - yield prefetch(filename, configInfo, cache); + yield prefetch(filename, configInfo, cache2); } } const emptyResult = { @@ -65085,7 +54356,7 @@ async function runLint(cfg) { result: { ...emptyResult, fileInfo: { filename }, elapsedTimeMs: getElapsedTimeMs() } }; } - const result = await processFile(filename, configInfo, cache, fetchResult); + const result = await processFile(filename, configInfo, cache2, fetchResult); return { filename, fileNum: index, result }; } async function* loadAndProcessFiles() { @@ -65117,25 +54388,25 @@ async function runLint(cfg) { } status.errors += result.configErrors; } - cache.reconcile(); + cache2.reconcile(); return status; } function calcDependencies(config) { - const { configFiles, dictionaryFiles } = cspell2.extractDependencies(config); + const { configFiles, dictionaryFiles } = extractDependencies(config); return { files: configFiles.concat(dictionaryFiles) }; } async function reportConfigurationErrors(config) { - const errors = cspell2.extractImportErrors(config); - let count = 0; + const errors = extractImportErrors(config); + let count3 = 0; errors.forEach((ref) => { const key = ref.error.toString(); if (configErrors.has(key)) return; configErrors.add(key); - count += 1; + count3 += 1; reporter.error("Configuration", ref.error); }); - const dictCollection = await cspell2.getDictionary(config); + const dictCollection = await getDictionary(config); dictCollection.dictionaries.forEach((dict) => { const dictErrors = dict.getErrors?.() || []; const msg = `Dictionary Error with (${dict.name})`; @@ -65144,24 +54415,24 @@ async function runLint(cfg) { if (configErrors.has(key)) return; configErrors.add(key); - count += 1; + count3 += 1; reporter.error(msg, error2); }); }); - return count; + return count3; } function countConfigErrors(configInfo) { return reportConfigurationErrors(configInfo.config); } async function run2() { if (cfg.options.root) { - process.env[cspell2.ENV_CSPELL_GLOB_ROOT] = cfg.root; + process.env[ENV_CSPELL_GLOB_ROOT] = cfg.root; } const configInfo = await readConfig(cfg.configFile, cfg.root); if (cfg.options.defaultConfiguration !== void 0) { configInfo.config.loadDefaultConfiguration = cfg.options.defaultConfiguration; } - const reporterConfig = clean({ + const reporterConfig = clean5({ maxNumberOfProblems: configInfo.config.maxNumberOfProblems, maxDuplicateProblems: configInfo.config.maxDuplicateProblems, minWordLength: configInfo.config.minWordLength, @@ -65169,7 +54440,7 @@ async function runLint(cfg) { }); const reporters = cfg.options.reporter ?? configInfo.config.reporters; reporter = mergeReporters(...await loadReporters(reporters, cfg.reporter, reporterConfig)); - cspell2.setLogger(getLoggerFromReporter(reporter)); + setLogger(getLoggerFromReporter(reporter)); const globInfo = await determineGlobs(configInfo, cfg); const { fileGlobs, excludeGlobs } = globInfo; const hasFileLists = !!cfg.fileLists.length; @@ -65186,7 +54457,7 @@ async function runLint(cfg) { return runResult({ errors: configErrors2 }); const { root } = cfg; try { - const cacheSettings = await calcCacheSettings(configInfo.config, { ...cfg.options, version: version2 }, root); + const cacheSettings = await calcCacheSettings(configInfo.config, { ...cfg.options, version: version3 }, root); const files = await determineFilesToCheck(configInfo, cfg, reporter, globInfo); return await processFiles(files, configInfo, cacheSettings); } catch (e) { @@ -65211,7 +54482,7 @@ Options: } } function checkGlobs(globs, reporter) { - globs.filter((g) => g.startsWith("'") || g.endsWith("'")).map((glob2) => import_chalk2.default.yellow(glob2)).forEach((glob2) => reporter.error("Linter", new CheckFailed(`Glob starting or ending with ' (single quote) is not likely to match any files: ${glob2}.`))); + globs.filter((g) => g.startsWith("'") || g.endsWith("'")).map((glob2) => source_default.yellow(glob2)).forEach((glob2) => reporter.error("Linter", new CheckFailed(`Glob starting or ending with ' (single quote) is not likely to match any files: ${glob2}.`))); } async function determineGlobs(configInfo, cfg) { const useGitignore = cfg.options.gitignore ?? configInfo.config.useGitignore ?? false; @@ -65254,21 +54525,21 @@ async function determineFilesToCheck(configInfo, cfg, reporter, globInfo) { return files; } function isExcluded(filename, globMatcherExclude) { - if (cspell2.isBinaryFile(import_uri3.URI.file(filename))) { + if (isBinaryFile(import_uri3.URI.file(filename))) { return true; } const { root } = cfg; - const absFilename = path13.resolve(root, filename); + const absFilename = path23.resolve(root, filename); const r = globMatcherExclude.matchEx(absFilename); if (r.matched) { const { glob: glob2, source } = extractGlobSource(r.pattern); - reporter.info(`Excluded File: ${path13.relative(root, absFilename)}; Excluded by ${glob2} from ${source}`, MessageTypes.Info); + reporter.info(`Excluded File: ${path23.relative(root, absFilename)}; Excluded by ${glob2} from ${source}`, MessageTypes.Info); } return r.matched; } function filterFilesFn(globMatcherExclude) { const patterns = globMatcherExclude.patterns; - const excludeInfo = patterns.map(extractGlobSource).map(({ glob: glob2, source }) => `Glob: ${glob2} from ${source}`).filter(uniqueFn()); + const excludeInfo = patterns.map(extractGlobSource).map(({ glob: glob2, source }) => `Glob: ${glob2} from ${source}`).filter(uniqueFn2()); reporter.info(`Exclusion Globs: ${excludeInfo.join("\n ")} `, MessageTypes.Info); @@ -65310,24 +54581,24 @@ function extractGlobSource(g) { }; } function runResult(init = {}) { - const { files = 0, filesWithIssues = /* @__PURE__ */ new Set(), issues = 0, errors = 0, cachedFiles = 0 } = init; - return { files, filesWithIssues, issues, errors, cachedFiles }; + const { files = 0, filesWithIssues = /* @__PURE__ */ new Set(), issues = 0, errors = 0, cachedFiles: cachedFiles2 = 0 } = init; + return { files, filesWithIssues, issues, errors, cachedFiles: cachedFiles2 }; } function yesNo(value) { return value ? "Yes" : "No"; } function getLoggerFromReporter(reporter) { const log = (...params) => { - const msg = (0, import_util23.format)(...params); + const msg = (0, import_util57.format)(...params); reporter.info(msg, "Info"); }; const error2 = (...params) => { - const msg = (0, import_util23.format)(...params); + const msg = (0, import_util57.format)(...params); const err = { message: "", name: "error", toString: () => "" }; reporter.error(msg, err); }; const warn = (...params) => { - const msg = (0, import_util23.format)(...params); + const msg = (0, import_util57.format)(...params); reporter.info(msg, "Warning"); }; return { @@ -65343,7 +54614,7 @@ async function generateGitIgnore(roots) { const repo = await findRepoRoot(cwd) || cwd; root.push(repo); } - return new GitIgnore(root?.map((p) => path13.resolve(p))); + return new GitIgnore(root?.map((p) => path23.resolve(p))); } async function useFileLists(fileListFiles, includeGlobPatterns, root, dot) { includeGlobPatterns = includeGlobPatterns.length ? includeGlobPatterns : ["**"]; @@ -65358,14 +54629,14 @@ async function useFileLists(fileListFiles, includeGlobPatterns, root, dot) { } // node_modules/cspell/dist/esm/lint/LintRequest.mjs -var path14 = __toESM(require("path"), 1); +var path24 = __toESM(require("path"), 1); var defaultContextRange = 20; var LintRequest = class { constructor(fileGlobs, options, reporter) { this.fileGlobs = fileGlobs; this.options = options; this.reporter = reporter; - this.root = path14.resolve(options.root || process.cwd()); + this.root = path24.resolve(options.root || process.cwd()); this.configFile = options.config; this.excludes = calcExcludeGlobInfo(this.root, options.exclude); this.locale = options.locale || ""; @@ -65402,8 +54673,8 @@ var SimpleRepl = class { this.rl.on("history", (h) => (this._history = h, void 0)); } question(query) { - return new Promise((resolve10) => { - this.rl.question(query, resolve10); + return new Promise((resolve13) => { + this.rl.question(query, resolve13); }); } _completer(line) { @@ -65426,7 +54697,6 @@ var SimpleRepl = class { }; // node_modules/cspell/dist/esm/application.mjs -var import_cspell_lib5 = __toESM(require_cjs10(), 1); function lint(fileGlobs, options, reporter) { options = fixLegacy(options); const cfg = new LintRequest(fileGlobs, options, finalizeReporter(reporter) ?? getReporter({ ...options, fileGlobs })); @@ -65582,11 +54852,11 @@ function normalizeResult(result) { } function normalizeFiles(files) { const cwd = process.cwd(); - return [...files].map((file) => path15.relative(cwd, file)); + return [...files].map((file) => path25.relative(cwd, file)); } // src/main.ts -var import_util24 = require("util"); +var import_util58 = require("util"); function getGithubToken() { const t0 = core4.getInput("github_token", { required: true }); if (t0[0] !== "$") { @@ -65603,7 +54873,7 @@ async function run() { core4.info("Done."); } catch (error2) { console.error(error2); - core4.setFailed(isAppError(error2) ? error2.message : isError(error2) ? error2 : (0, import_util24.format)(error2)); + core4.setFailed(isAppError(error2) ? error2.message : isError(error2) ? error2 : (0, import_util58.format)(error2)); } } diff --git a/action/node_modules/@cspell/cspell-bundled-dicts/cspell-default.config.js b/action/node_modules/@cspell/cspell-bundled-dicts/cspell-default.config.js index 7d6859dca..d69930ab9 100644 --- a/action/node_modules/@cspell/cspell-bundled-dicts/cspell-default.config.js +++ b/action/node_modules/@cspell/cspell-bundled-dicts/cspell-default.config.js @@ -134,6 +134,7 @@ const settings = { '@cspell/dict-en-gb/cspell-ext.json', '@cspell/dict-filetypes/cspell-ext.json', '@cspell/dict-fonts/cspell-ext.json', + '@cspell/dict-fsharp/cspell-ext.json', '@cspell/dict-fullstack/cspell-ext.json', '@cspell/dict-gaming-terms/cspell-ext.json', '@cspell/dict-git/cspell-ext.json', diff --git a/action/node_modules/@cspell/cspell-bundled-dicts/package.json b/action/node_modules/@cspell/cspell-bundled-dicts/package.json index bfb1eb118..be7bf866a 100644 --- a/action/node_modules/@cspell/cspell-bundled-dicts/package.json +++ b/action/node_modules/@cspell/cspell-bundled-dicts/package.json @@ -1,6 +1,6 @@ { "name": "@cspell/cspell-bundled-dicts", - "version": "6.31.3", + "version": "7.0.0", "description": "Dictionaries bundled with cspell", "publishConfig": { "access": "public" @@ -20,10 +20,10 @@ "scripts": { "build": "tsc -p .", "build-dict": "cspell-tools-cli compile compatibility-words.txt", - "clean": "echo clean", + "clean": "shx rm -rf dist temp coverage \"*.tsbuildInfo\"", "clean-build": "pnpm run clean && pnpm run build", "watch": "pnpm run build --watch", - "test": "node ../../bin.js \"**/*.{txt,md,ts}\"", + "test": "node ../../bin.mjs \"**/*.{txt,md,ts}\"", "update-fix-en-gb": "pnpm add @cspell/dict-en-gb@1.1.33", "update-dictionaries": "pnpm update --latest \"@cspell/dict-*\" && pnpm run update-fix-en-gb" }, @@ -44,60 +44,60 @@ }, "homepage": "https://github.com/streetsidesoftware/cspell#readme", "dependencies": { - "@cspell/dict-ada": "^4.0.1", - "@cspell/dict-aws": "^3.0.0", + "@cspell/dict-ada": "^4.0.2", + "@cspell/dict-aws": "^4.0.0", "@cspell/dict-bash": "^4.1.1", - "@cspell/dict-companies": "^3.0.9", - "@cspell/dict-cpp": "^5.0.2", + "@cspell/dict-companies": "^3.0.19", + "@cspell/dict-cpp": "^5.0.4", "@cspell/dict-cryptocurrencies": "^3.0.1", "@cspell/dict-csharp": "^4.0.2", - "@cspell/dict-css": "^4.0.5", - "@cspell/dict-dart": "^2.0.2", - "@cspell/dict-django": "^4.0.2", - "@cspell/dict-docker": "^1.1.6", + "@cspell/dict-css": "^4.0.6", + "@cspell/dict-dart": "^2.0.3", + "@cspell/dict-django": "^4.1.0", + "@cspell/dict-docker": "^1.1.7", "@cspell/dict-dotnet": "^5.0.0", - "@cspell/dict-elixir": "^4.0.2", + "@cspell/dict-elixir": "^4.0.3", "@cspell/dict-en-common-misspellings": "^1.0.2", "@cspell/dict-en-gb": "1.1.33", - "@cspell/dict-en_us": "^4.3.2", - "@cspell/dict-filetypes": "^3.0.0", - "@cspell/dict-fonts": "^3.0.2", + "@cspell/dict-en_us": "^4.3.6", + "@cspell/dict-filetypes": "^3.0.1", + "@cspell/dict-fonts": "^4.0.0", + "@cspell/dict-fsharp": "^1.0.0", "@cspell/dict-fullstack": "^3.1.5", "@cspell/dict-gaming-terms": "^1.0.4", "@cspell/dict-git": "^2.0.0", - "@cspell/dict-golang": "^6.0.1", + "@cspell/dict-golang": "^6.0.2", "@cspell/dict-haskell": "^4.0.1", "@cspell/dict-html": "^4.0.3", "@cspell/dict-html-symbol-entities": "^4.0.0", "@cspell/dict-java": "^5.0.5", "@cspell/dict-k8s": "^1.0.1", "@cspell/dict-latex": "^4.0.0", - "@cspell/dict-lorem-ipsum": "^3.0.0", + "@cspell/dict-lorem-ipsum": "^4.0.0", "@cspell/dict-lua": "^4.0.1", "@cspell/dict-node": "^4.0.2", - "@cspell/dict-npm": "^5.0.5", + "@cspell/dict-npm": "^5.0.8", "@cspell/dict-php": "^4.0.1", - "@cspell/dict-powershell": "^5.0.1", - "@cspell/dict-public-licenses": "^2.0.2", - "@cspell/dict-python": "^4.0.2", + "@cspell/dict-powershell": "^5.0.2", + "@cspell/dict-public-licenses": "^2.0.3", + "@cspell/dict-python": "^4.1.5", "@cspell/dict-r": "^2.0.1", "@cspell/dict-ruby": "^5.0.0", "@cspell/dict-rust": "^4.0.1", "@cspell/dict-scala": "^5.0.0", - "@cspell/dict-software-terms": "^3.1.6", - "@cspell/dict-sql": "^2.1.0", + "@cspell/dict-software-terms": "^3.2.1", + "@cspell/dict-sql": "^2.1.1", "@cspell/dict-svelte": "^1.0.2", "@cspell/dict-swift": "^2.0.1", "@cspell/dict-typescript": "^3.1.1", "@cspell/dict-vue": "^3.0.0" }, "engines": { - "node": ">=14" + "node": ">=16" }, "devDependencies": { - "@cspell/cspell-tools": "6.31.3", - "@cspell/cspell-types": "6.31.3", - "typescript": "^4.9.5" + "@cspell/cspell-tools": "7.0.0", + "@cspell/cspell-types": "7.0.0" }, - "gitHead": "0e8ca7b32f21aea40ade645172ef93017e6a143d" + "gitHead": "52960d5ed75655978f9b633f44fd106937a63cd7" } diff --git a/action/node_modules/@cspell/dict-aws/README.md b/action/node_modules/@cspell/dict-aws/README.md index 0c1e4aceb..325a8b326 100644 --- a/action/node_modules/@cspell/dict-aws/README.md +++ b/action/node_modules/@cspell/dict-aws/README.md @@ -1,4 +1,4 @@ -# cSpell AWS Terms Dictionary +# CSpell AWS Terms Dictionary AWS terms dictionary for cspell. diff --git a/action/node_modules/@cspell/dict-aws/aws.txt.gz b/action/node_modules/@cspell/dict-aws/aws.txt.gz deleted file mode 100644 index 98ac1e8db..000000000 Binary files a/action/node_modules/@cspell/dict-aws/aws.txt.gz and /dev/null differ diff --git a/action/node_modules/@cspell/dict-aws/cspell-ext.json b/action/node_modules/@cspell/dict-aws/cspell-ext.json index 0f0d2962c..df8c79811 100644 --- a/action/node_modules/@cspell/dict-aws/cspell-ext.json +++ b/action/node_modules/@cspell/dict-aws/cspell-ext.json @@ -8,7 +8,7 @@ "dictionaryDefinitions": [ { "name": "aws", - "path": "./aws.txt.gz", + "path": "./dict/aws.txt", "description": "AWS dictionary for cspell." } ], diff --git a/action/node_modules/@cspell/dict-aws/dict/README.md b/action/node_modules/@cspell/dict-aws/dict/README.md new file mode 100644 index 000000000..ce6712301 --- /dev/null +++ b/action/node_modules/@cspell/dict-aws/dict/README.md @@ -0,0 +1,3 @@ +# Dict Directory + +NOTE: This directory contains generated content. Please edit [src](../src/README.md) files. diff --git a/action/node_modules/@cspell/dict-aws/dict/aws.txt b/action/node_modules/@cspell/dict-aws/dict/aws.txt new file mode 100644 index 000000000..9db649833 --- /dev/null +++ b/action/node_modules/@cspell/dict-aws/dict/aws.txt @@ -0,0 +1,1484 @@ + +# cspell-tools: keep-case no-split + +a +abort +accelerate +accelerator +accelerators +accept +accepted +access +accessed +account +accounts +acknowledge +acl +acls +acm +action +actions +activate +activated +activation +activations +active +activities +activity +add +address +addresses +adjustment +adm +admin +advertise +aesop +affected +agent +agents +aggregate +aggregated +aggregates +aggregation +aggregator +aggregators +agreement +alarm +alarms +algorithm +algorithms +alias +aliases +all +allocate +allowed +amazonaws +amplify +analysis +analytics +analyze +and +anomaly +answer +api +apigateway +apis +apns +app +appliance +appliances +application +applicationinsights +applications +applied +apply +appmesh +approval +approve +apps +appstream +appsync +archival +archive +archives +arns +arrays +artifact +artifacts +assessment +asset +assets +assign +assignment +assignments +associate +associated +association +associations +assume +async +athena +attach +attached +attachment +attachments +attack +attacks +attribute +attributes +audit +audits +auth +authenticate +authorities +authority +authorization +authorizations +authorize +authorized +authorizer +authorizers +auto +automated +automation +autoscaling +availability +available +avs +aws +b +backend +backtrack +backtracks +backup +backups +baidu +balance +balancer +balancers +bandwidth +barcode +base +based +baseline +baselines +batch +begin +behaviors +bgp +billing +blacklist +blob +block +blocked +blueprints +bonus +book +bookmark +books +bootstrap +bot +bots +bounce +boundary +branch +branches +broker +brokers +bucket +buckets +budget +budgets +buffer +build +builder +builders +builds +builtin +bulk +bundle +bundles +bus +buses +business +byoip +byte +cache +cachedi +caller +calling +campaign +campaigns +cancel +canceled +capacities +capacity +catalog +catalogs +categories +category +cdr +celebrities +celebrity +certificate +certificates +challenge +change +changes +channel +channels +chap +chatbot +check +checker +checks +child +children +chime +cidr +cidrs +claim +class +classic +classification +classifier +classifiers +clear +click +client +clients +clone +close +closed +cloud +clouddirectory +cloudformation +cloudfront +cloudhsm +cloudsearch +cloudtrail +cloudwatch +cluster +clusters +cnam +code +codebuild +codecommit +codedeploy +codepipeline +codestar +cognito +collection +collections +command +commands +comment +comments +commit +commits +company +compare +compared +compatibility +compatible +compilation +complete +completed +compliance +component +components +compose +comprehend +comprehendmedical +compute +computer +concurrency +condition +conditional +conference +config +configs +configuration +configurations +configure +confirm +confirmation +conflicts +connect +connected +connection +connections +connectivity +connector +connectors +console +constraint +constraints +consumer +consumers +contact +contacts +container +containers +content +contents +context +continue +continuous +control +controllers +conversion +cookie +copy +core +cors +cost +count +counts +coverage +crawler +crawlers +crawling +create +created +creation +credential +credentials +credit +cross +csr +csv +cur +curated +current +custom +customer +customization +dash +dashboard +dashboards +data +database +databases +datafeed +dataflow +datapipeline +dataset +datasets +datastore +datastores +datasync +dax +deactivate +dead +decision +decline +decode +decrease +decrypt +dedicated +deeplens +default +define +defined +definition +definitions +delegate +delegates +delegation +delete +deletion +deletions +deliver +deliverability +deliveries +delivery +demand +dependencies +deploy +deployable +deployment +deployments +deprecate +deprovision +deregister +describe +description +descriptions +desired +destination +destinations +destroy +detach +detail +detailed +details +detect +detection +detector +detectors +dev +developer +development +device +devicefarm +devices +dhcp +diagnostic +differences +digest +dimension +direct +directconnect +directories +directory +disable +disassociate +disconnect +discover +discovered +discovery +disk +disks +display +dispose +dissociate +distribution +distributions +dkim +dlm +dms +dns +document +documents +domain +domains +dominant +download +drift +drifts +drt +dynamic +dynamodb +ebs +ec +ecr +ecs +editor +editors +effective +efs +egress +eks +elastic +elasticache +elasticbeanstalk +elasticfilesystem +elasticloadbalancing +elasticmapreduce +elasticsearch +elastictranscoder +email +embed +emergency +enable +enabled +encrypt +encryption +endpoint +endpoints +engine +engines +enhanced +enter +entities +entitlement +entitlements +entity +entry +environment +environments +errors +estimate +evaluate +evaluation +evaluations +event +events +exchange +exclude +execute +execution +executions +exit +expire +export +exports +expression +expressions +extend +extended +extension +extensions +external +face +faces +facet +factor +fail +failed +failover +failure +families +fast +feature +features +federation +feedback +fetch +field +fields +file +files +filter +filters +finalize +financial +findings +firehose +fleet +fleets +flow +flows +fms +folder +folders +for +force +forecast +forget +forgot +format +formation +forward +forwarder +forwarders +forwarding +fpga +fragment +fragments +free +freertos +from +front +fsx +function +functions +game +gamelift +gateway +gateways +gcm +generate +geo +get +git +glacier +global +globalaccelerator +glue +gov +gpus +grant +granting +grants +graph +graphql +greengrass +ground +groundstation +groundtruthlabeling +group +groups +guardduty +guest +handshake +handshakes +hapg +hapgs +hardware +head +header +headers +health +heartbeat +history +hit +hls +hold +home +hook +hooks +host +hosted +hostname +hosts +hsm +hsms +http +hub +hyper +iam +identifier +identities +identity +idp +ids +image +images +import +imported +importexport +imports +include +incoming +increase +index +indexing +indices +inference +info +information +ingest +ingress +initialize +initiate +initiators +injection +input +inputs +insert +insight +insights +inspector +install +instance +instances +intel +intent +intents +interconnect +interconnects +interface +interfaces +internet +interrupt +into +introspection +invalidate +invalidation +invalidations +inventory +invitation +invitations +invite +invocation +invocations +invoke +iot +iotanalytics +iotevents +iotsitewise +iotthingsgraph +ips +ipv +issue +item +items +iterator +job +jobs +join +journal +json +kafka +key +keys +kinesis +kinesisanalytics +kinesisvideo +kms +known +label +labeling +labels +lag +lags +lake +lakeformation +lambda +landingzone +language +last +launch +layer +layers +leave +ledger +ledgers +legal +letter +level +levels +lex +lexicon +lexicons +license +licenses +lifecycle +lightsail +limit +limits +link +linked +links +list +listener +listeners +listing +listings +lists +live +loa +load +local +location +locations +lock +log +logger +logging +login +logout +logs +lookup +luna +machine +machinelearning +machines +macie +mail +mailbox +maintenance +manage +managed +managedblockchain +management +manager +manifest +mapping +mappings +marker +marketing +marketplace +master +match +material +measurement +mechanicalturk +media +mediaconnect +mediaconvert +medialive +mediapackage +mediastore +mediatailor +meeting +meetings +member +members +membership +memberships +merge +mesh +meshes +message +messages +metadata +meter +method +methods +metric +metrics +mfa +mgh +microsoft +migration +minute +mission +mobile +mobileanalytics +mobilehub +mobiletargeting +model +models +moderation +modifications +modify +monitor +monitoring +mount +move +moving +multipart +mutability +name +named +names +nameservers +namespace +namespaces +nat +neighbors +neptune +network +networks +new +next +nfs +node +nodes +notebook +notification +notifications +notify +now +number +numbers +oauth +object +objects +observation +observations +offering +offerings +only +open +operation +operations +ops +opsworks +opt +opted +option +options +order +orderable +orders +organization +organizational +organizations +origin +origination +ota +out +outbound +outgoing +output +outputs +override +owner +package +packager +packages +packaging +pair +pairs +parameter +parameters +parent +parents +part +partition +partitions +partner +parts +party +pass +password +patch +patches +path +paths +pattern +payment +payments +pca +peer +peered +peering +pending +period +permission +permissions +persist +person +personal +personalize +personalized +phi +phone +phrases +pin +pipeline +pipelines +placement +placements +plaintext +plan +plans +platform +platforms +playback +player +point +points +policies +policy +poll +polly +pool +pools +port +portal +portfolio +portfolios +portion +ports +position +post +predict +prediction +predictions +preference +preferences +prefix +premises +preset +presets +presigned +preview +price +pricing +primary +principal +principals +priorities +priority +privacy +private +problem +problems +process +processes +processing +processor +processors +procurement +product +products +profile +profiles +progress +project +projects +promote +promotions +propagation +propagations +properties +proposal +proposals +protected +protection +protections +provider +providers +provision +provisioned +provisioning +public +publish +published +pull +purchase +purge +push +put +qldb +qualification +qualifications +queries +query +queue +queues +quicksight +quota +quotas +quote +quotes +radius +raid +ram +random +ranges +ranking +rate +raw +rds +reachability +read +reader +realtime +reason +reboot +rebuild +receipt +receive +recipe +recipes +recognition +recognize +recognizer +recognizers +recommendation +recommendations +record +recorder +recorders +records +recovery +redeem +redshift +reference +references +refresh +regenerate +regex +region +regional +regions +register +registration +reject +rejected +rekognition +relational +release +reload +remediation +remote +remove +rename +render +renew +reorder +replace +replica +replicate +replication +reply +report +reports +repositories +repository +reprocessing +reputation +request +requested +requester +requests +resend +reservation +reservations +reserve +reserved +reset +resize +resolve +resolver +resolvers +resource +resources +respond +response +rest +restart +restore +result +results +resume +resync +retention +retirable +retire +retrieval +retrieve +retry +reusable +review +reviewable +reviewing +revision +revisions +revocation +revoke +rightsizing +risk +robomaker +robot +robots +role +roles +rollback +room +rooms +root +roots +rotate +rotation +route +router +routers +routes +routing +rtos +rule +rules +run +runner +runs +runtime +sagemaker +saml +sample +sampled +samples +sampling +sandbox +satellite +satellites +saved +scalable +scaling +scan +schedule +scheduled +schedules +schema +schemas +scheme +schemes +score +screenshot +script +scsi +sdb +search +secret +secrets +secretsmanager +security +securitygroup +securityhub +segment +segments +select +selection +selections +selectors +send +sending +sentiment +series +server +serverlessrepo +servers +service +servicecatalog +servicediscovery +servicequotas +services +ses +session +sessions +set +sets +setting +settings +shadow +shard +shards +share +shared +shares +sharing +shield +shipping +show +shutdown +sign +signal +signer +signing +simulate +simulation +sink +size +skill +skills +slack +slot +smart +smb +sms +snapshot +snapshots +snowball +sns +software +solution +solutions +source +sources +specific +specification +specifications +speech +split +spot +sql +sqs +squash +ssh +ssl +ssm +ssmmessages +sso +stack +stacks +stage +stale +standards +standby +start +state +statement +states +static +stations +statistic +statistics +status +statuses +step +steps +stickiness +stop +storage +storagegateway +store +storedi +stores +stream +streaming +streams +sts +submit +subnet +subnets +subscribe +subscribed +subscription +subscriptions +success +suggest +suggester +suggesters +suggestion +suggestions +suite +suites +sumerian +summaries +summary +support +supported +suspend +swap +swf +sync +synchronize +syntax +synthesis +synthesize +system +systems +table +tables +tag +tagging +tags +tape +tapes +target +targets +task +tasks +team +telemetry +telephony +template +templated +templates +temporary +tenancy +terminate +termination +terminologies +terminology +test +tests +text +textract +thing +things +third +threat +three +thumbprint +time +timer +title +tls +token +tokens +topic +topics +torrent +trace +traces +tracker +trackers +tracking +tracks +traffic +trail +trails +training +transaction +transactions +transcribe +transcription +transfer +transform +transformation +transit +transition +translate +tree +trigger +triggers +trust +trustedadvisor +trusts +tuning +type +typed +types +unarchive +unassign +unauthorize +unblock +unclaim +undeploy +unique +unit +units +unlink +unlock +unmonitor +unpeer +unreferenced +unshare +unsubscribe +unsuspend +untag +update +updates +upgrade +upload +uploaded +uploads +url +usage +used +user +users +utilization +utterances +valid +validate +validation +value +values +vault +vaults +vendors +verification +verified +verify +version +versioning +versions +vgw +view +views +violation +violations +virtual +visibility +vocabularies +vocabulary +vod +voice +voices +voip +volume +volumes +vote +votes +vpc +vpce +vpcs +vpn +vtl +waf +wam +warmup +watch +way +web +webhook +webhooks +website +weights +wellarchitected +when +widget +window +windows +wipe +with +withdraw +without +work +workdocs +worker +workers +workflow +workflows +working +worklink +workload +workloads +workmail +workspace +workspaces +workteam +workteams +write +xray +xss +zone +zones diff --git a/action/node_modules/@cspell/dict-aws/package.json b/action/node_modules/@cspell/dict-aws/package.json index c6193f195..57abb001c 100644 --- a/action/node_modules/@cspell/dict-aws/package.json +++ b/action/node_modules/@cspell/dict-aws/package.json @@ -1,6 +1,6 @@ { "name": "@cspell/dict-aws", - "version": "3.0.0", + "version": "4.0.0", "description": "AWS dictionary for cspell.", "publishConfig": { "access": "public" @@ -11,10 +11,10 @@ "./cspell-ext.json": "./cspell-ext.json" }, "scripts": { - "build": "cspell-tools compile \"aws.txt\" -o .", - "test": "head -n 100 \"aws.txt\" | cspell -v -c ./cspell-ext.json \"--local=*\" \"--languageId=aws\" stdin", + "build": "cspell-tools-cli compile --keep-raw-case --use-legacy-splitter src/aws.txt --no-compress -o ./dict", + "test": "head -n 100 src/aws.txt | cspell -v -c ./cspell-ext.json \"--local=*\" \"--languageId=aws\" stdin", "prepublishOnly": "echo pre-publish", - "prepare": "yarn run build" + "prepare": "pnpm run build" }, "repository": { "type": "git", @@ -34,8 +34,8 @@ }, "homepage": "https://github.com/streetsidesoftware/cspell-dicts/blob/main/dictionaries/aws#readme", "files": [ - "aws.txt.gz", + "dict/aws.txt", "cspell-ext.json" ], - "gitHead": "1ca7c3ef9e48ab76719fd8e7b578eaee452ddf68" + "gitHead": "8c8ef90bd518f9874789ee589205e723fba6ae7c" } diff --git a/action/node_modules/@cspell/dict-fonts/cspell-ext.json b/action/node_modules/@cspell/dict-fonts/cspell-ext.json index 4b2769947..a939836c4 100644 --- a/action/node_modules/@cspell/dict-fonts/cspell-ext.json +++ b/action/node_modules/@cspell/dict-fonts/cspell-ext.json @@ -7,7 +7,7 @@ "dictionaryDefinitions": [ { "name": "fonts", - "path": "./fonts.txt.gz", + "path": "./dict/fonts.txt", "description": "Font names dictionary for cspell." } ] diff --git a/action/node_modules/@cspell/dict-fonts/dict/README.md b/action/node_modules/@cspell/dict-fonts/dict/README.md new file mode 100644 index 000000000..ce6712301 --- /dev/null +++ b/action/node_modules/@cspell/dict-fonts/dict/README.md @@ -0,0 +1,3 @@ +# Dict Directory + +NOTE: This directory contains generated content. Please edit [src](../src/README.md) files. diff --git a/action/node_modules/@cspell/dict-fonts/dict/fonts.txt b/action/node_modules/@cspell/dict-fonts/dict/fonts.txt new file mode 100644 index 000000000..206a1393f --- /dev/null +++ b/action/node_modules/@cspell/dict-fonts/dict/fonts.txt @@ -0,0 +1,1149 @@ + +# cspell-tools: keep-case no-split + +a +abel +abhaya +abril +aclonica +acme +actor +adamina +advent +again +agave +age +aguafina +aharoni +akronim +aladin +aldhabi +aldrich +alef +alegreya +alex +alfa +alice +alike +allan +allerta +allura +almendra +alternates +amarante +amaranth +amatic +amatica +american +amethysta +amiko +amiri +amita +anaheim +andada +andale +andalus +andika +angkor +angsana +angular +annie +anonymice +anonymous +another +antic +antiqua +anton +aparajita +apple +arabic +arapey +arbutus +architects +archivo +aref +arial +arima +arimo +arizonia +armata +artifika +arvo +arya +asap +asar +asset +assets +assistant +astloch +asul +athiti +atma +atomic +aubrey +audiowide +aurore +aurulent +autour +average +averia +b +bad +bahnschrift +baiti +baloo +balthazar +bangers +bangla +banner +basic +baskerville +batang +battambang +baumans +bayon +bd +beanie +bebas +bedfort +bee +belgrano +belle +belleza +bench +bentham +berkshire +bevan +bhai +bhaina +big +bigelow +bigshot +bilbo +bio +biryani +bitstrom +bitter +biz +black +blex +blue +bokor +bold +boli +bonbon +boogaloo +boogie +book +bookletter +boran +bowlby +brains +brawler +bree +bright +browallia +brush +bubblegum +bubbler +buda +buenard +bungee +busorama +butcherman +butterfly +by +cabin +caesar +cagliostro +cairo +calibri +calligraffitti +cambay +cambo +cambria +candal +candara +candy +canon +cantarell +cantata +cantora +capitals +capriola +caps +caption +cardo +carme +carrois +carter +cascadia +caskaydia +caslon +catamaran +caudex +caveat +cedarville +century +ceviche +champa +chancery +changa +chango +charcoal +charter +chathura +chau +che +chela +chelsea +chenla +cherokee +cherry +chettan +chewy +chey +chicle +chivo +chonburi +christmas +cinzel +clean +clicker +coda +code +codystar +coiny +combo +comfortaa +comic +coming +concert +cond +condensed +condiment +consolas +console +constantia +content +contrail +convergence +cook +cookie +copperplate +copse +corbel +corben +cordia +cormorant +could +courgette +courier +cousine +coustard +cove +covered +crafty +cream +creepster +crete +crimson +croissant +crushed +cuprum +cursive +cut +cutive +cycle +da +daddy +dafoe +damion +dancing +dangrek +dark +data +daughter +daun +david +dawningofa +day +days +de +decorative +deja +dekko +delafield +delius +della +demibold +deng +denk +devonshire +df +dhurjati +didact +didone +didot +digi +dillenia +dingbats +diplomata +display +do +dok +domine +donegal +door +doppio +dorsa +dosis +dots +dotum +double +doulaise +down +dr +dressing +droid +duru +dw +dynalight +dyslexic +eagle +eater +eb +ebrima +economica +eczar +edessa +ek +el +electrolize +elite +ellen +elsie +emblema +emilys +emoji +engagement +englebert +english +enriqueta +envy +erica +esteban +estrangelo +eucrosia +euphemia +euphoria +ewert +exo +expanded +expletus +ext +extra +face +fajardose +fang +fantasque +fanwood +farsan +fascinate +faster +fasthand +fatface +fauna +federant +federo +felipa +fell +felt +fenix +fill +finger +fira +fixed +fjalla +fjord +flamenco +flat +flavors +flower +fondamento +font +fontdiner +formal +forum +francisco +francois +frank +franklin +freckle +frederickathe +fredoka +free +freehand +freesia +french +fresca +frijole +fruktur +fugaz +futura +gabriela +gabriola +gadget +gadugi +gafata +galada +galdeano +galindo +garamond +gautami +gentium +geo +georgia +geostar +germania +gfs +gidugu +gilda +gill +girl +girls +gisha +give +glass +glegoo +gloria +glory +go +goblin +gochi +gohu +gorditas +gothic +goudy +grace +graduate +grand +grande +gravitas +great +griffy +grotesk +grover +gruesa +gruppo +gudea +gulim +gungsuh +guntur +gurajada +guy +haas +habibi +hack +hairline +halant +hallelujah +hammersmith +hanalei +hand +handlee +hanuman +happy +harmattan +hasklug +haviland +heading +headland +heavy +heebo +hei +helvetica +henny +herculanum +here +herr +hill +himalaya +hind +hiragino +historic +hkscs +hoefler +holo +holtwood +homemade +homenaje +hotel +hurmit +i +iceberg +iceland +im +impact +imprima +inconsolata +inder +indie +infant +inika +inimai +ink +inknut +inline +into +intone +iosevka +iris +irish +iskoola +istok +italiana +italianno +italic +itim +jacques +jaldi +jasmine +javanese +jet +jheng +jim +jockey +jolly +jomhuria +josefin +joti +judson +julee +julius +junge +jura +just +kadwa +kaffeesatz +kai +kalam +kalinga +kameron +kanit +kantumruy +karla +karma +kartika +katibeh +kaushan +kavivanar +kavoon +kdam +keania +kelly +kenia +khand +khmer +khula +kids +king +kite +knewave +kodchiang +kokila +kotta +koulen +kranky +kreon +kristi +krona +krushnadevaraya +kufi +kumar +kurale +kyokasho +la +laila +lake +lakki +lalezar +lancelot +lao +laren +lateef +latha +lato +le +league +leckerli +ledger +leelawadee +lekton +lemon +lemonada +lens +levenim +lgc +li +libre +life +light +like +lilex +lilita +lily +limelight +linden +linotype +literation +lligat +lobster +lodger +londrina +lora +love +lovedbythe +lovers +lt +lucida +luckiest +lue +lusitana +lustria +m +macondo +mada +madurai +magra +maguntia +maiden +maitree +majalla +mako +malgun +mallanna +mandali +mangal +mania +marcellus +marck +margarine +marker +market +marko +marlett +marmelad +marrow +martel +marvel +mate +math +maven +mc +mdl +me +mean +meddon +medieval +medium +medula +meera +megrim +meie +meiryo +memoirs +menlo +merienda +merriweather +meslo +messiri +metal +metamorphous +metrophobic +michroma +microsoft +mill +milonga +miltonian +mincho +ming +minion +miniver +miriam +mirza +miss +mitr +modak +modern +mogra +molengo +molle +monda +mongolian +monkey +mono +monofett +monofur +monoid +mononoki +monoton +monsieur +montaga +montez +montserrat +moo +mool +moul +moulpali +mountainsof +mouse +mr +mrs +ms +mt +muellerhoff +mukta +muli +mv +myanmar +mystery +n +narkisim +narrow +negative +neohellenic +neucha +neue +neuton +new +news +next +niconne +nightshade +nine +nirmala +nixie +nk +nobile +nokora +norican +nosifer +nothing +noticia +noto +nova +np +ntr +numans +nunito +nyala +odor +offside +old +oldenburg +oleo +one +open +ops +optima +orange +oranienbaum +orbitron +oregano +orienta +original +ornaments +osaka +oswald +outline +oval +overlock +overpass +overthe +ovo +oxygen +p +pa +paaji +pacifico +paint +palanquin +palatino +paprika +papyrus +parisienne +passero +passion +pathway +patrick +pattaya +patua +pavanam +paytone +peddana +penh +penny +peralta +permanent +petit +petrona +phags +philomene +philosopher +pica +piedra +pinyon +pirata +plantagenet +plaster +play +playball +playfair +podkova +poiret +poller +poly +pompiere +pontano +poppins +port +pota +pragati +prakash +prata +preahvihear +press +pridi +primer +princess +print +pro +prociono +proggy +prompt +prosto +proza +pt +puritan +purple +purse +px +quando +quantico +quarrel +quattrocento +quest +questrial +quicksand +quintessential +qwigley +r +raavi +racing +radley +rainbow +raisin +rajdhani +rakkas +raleway +ramabhadra +ramakrishna +ramaraja +rambla +rammetto +ranchers +rancho +ranga +rasa +rationale +ravi +reddy +redressed +reem +reenie +regular +respira +revalia +rhodium +rhyme +ribeye +rice +righteous +risque +roboto +rochester +rock +rocker +rockwell +rod +rokkitt +roman +romanesco +ropa +rosario +rosarivo +rouge +round +rozha +rubik +ruda +ruehl +rufina +ruge +ruhl +rules +ruluko +rum +ruqaa +ruslan +russo +ruthie +rye +sacramento +sahitya +sail +saint +sakkal +salsa +salt +sanchez +sancreek +sand +sans +sansita +sanskrit +sarala +sarina +sarpanch +satisfy +sauce +savers +sb +sc +scada +scheherazade +schoolbell +schoolbook +scope +script +seaweed +secular +segoe +semi +semibold +semilight +serif +sevillana +seymour +shade +shadow +shadows +shanns +shanti +share +sharp +sheppards +shojumaru +shonar +short +shrikhand +shruti +shure +siemreap +sigmar +signika +siliguri +sim +simonetta +simplified +sintony +sirin +sister +sitka +six +sketch +skia +skranji +slab +slabo +slackey +slim +small +smokum +smythe +sniglet +snippet +snowburst +soda +sofadi +sofia +solid +song +sonsie +soon +sorts +source +space +special +spicy +spinnaker +spirax +squada +square +sree +sriracha +stack +stalemate +stalinist +standard +stardos +start +stencil +stint +stoke +strait +subheading +subrayada +sue +suez +sugiyama +sumana +sun +sunrise +sunshiney +supermercado +sura +suranna +suravaram +surfer +suwannaphum +swanky +swankyand +swash +sylfaen +symbol +syncopate +tahoma +tai +tamma +tangerine +taprom +tattoo +tauri +taviraj +tech +techno +teko +telescope +telex +tenali +tenor +term +terminal +terminess +text +textile +thambi +the +thmor +ti +tienne +tillana +time +times +timmana +tinos +titan +titillium +trade +traditional +trebuchet +trirong +trocchi +trochut +trykker +tt +tulpen +tunga +turncoat +two +typesetting +typewriter +u +ubuntu +ud +udp +ui +uighur +ultra +uncial +underdog +unica +unicase +unicode +unifraktur +unkempt +unlock +unna +upc +upright +urdu +use +utopia +utsaah +vaani +vadodara +vampiro +vani +varela +vast +verdana +vesper +vibes +vibur +victor +vidaloka +viga +vijaya +voces +volkhov +vollkorn +voltaire +von +vrinda +vt +vu +waitingforthe +wallpoet +walter +warnes +web +webdings +wellfleet +wendy +wera +winds +wingdings +wire +work +writing +x +xian +ya +yanone +yantramanav +yatra +yellowtail +yeseva +yesteryear +yi +you +your +yrsa +ysabeau +yu +zapf +zapfino +zee +zeyada diff --git a/action/node_modules/@cspell/dict-fonts/fonts.txt.gz b/action/node_modules/@cspell/dict-fonts/fonts.txt.gz deleted file mode 100644 index 27fd87bfb..000000000 Binary files a/action/node_modules/@cspell/dict-fonts/fonts.txt.gz and /dev/null differ diff --git a/action/node_modules/@cspell/dict-fonts/package.json b/action/node_modules/@cspell/dict-fonts/package.json index 11d98e2df..c9e719e88 100644 --- a/action/node_modules/@cspell/dict-fonts/package.json +++ b/action/node_modules/@cspell/dict-fonts/package.json @@ -1,6 +1,6 @@ { "name": "@cspell/dict-fonts", - "version": "3.0.2", + "version": "4.0.0", "description": "Font names dictionary for cspell.", "publishConfig": { "access": "public" @@ -11,10 +11,10 @@ "./cspell-ext.json": "./cspell-ext.json" }, "scripts": { - "build": "cspell-tools compile \"fonts.txt\" -o .", - "test": "head -n 100 \"fonts.txt\" | cspell -v -c ./cspell.json \"--local=*\" \"--languageId=*\" stdin", + "build": "cspell-tools-cli compile --keep-raw-case --use-legacy-splitter src/fonts.txt --no-compress -o ./dict", + "test": "shx head -n 100 src/fonts.txt | cspell -v -c ./cspell.json \"--local=*\" \"--languageId=*\" stdin", "prepublishOnly": "echo pre-publish", - "prepare": "yarn run build" + "prepare": "pnpm run build" }, "repository": { "type": "git", @@ -34,8 +34,8 @@ }, "homepage": "https://github.com/streetsidesoftware/cspell-dicts/blob/main/dictionaries/fonts#readme", "files": [ - "fonts.txt.gz", + "dict/fonts.txt", "cspell-ext.json" ], - "gitHead": "0f6fc04dbfb4ddbe9fdb706e85df6d3811aefa96" + "gitHead": "f6b5f6f68a7582b929f9475df98da41d9b639fb2" } diff --git a/action/node_modules/@cspell/dict-fsharp/LICENSE b/action/node_modules/@cspell/dict-fsharp/LICENSE new file mode 100644 index 000000000..58d55ba5b --- /dev/null +++ b/action/node_modules/@cspell/dict-fsharp/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017-2022 Street Side Software + +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. diff --git a/action/node_modules/@cspell/dict-fsharp/README.md b/action/node_modules/@cspell/dict-fsharp/README.md new file mode 100644 index 000000000..a42cb3ecd --- /dev/null +++ b/action/node_modules/@cspell/dict-fsharp/README.md @@ -0,0 +1,62 @@ +# CSpell F# Dictionary + +F# dictionary for cspell. + +This is a pre-built dictionary for use with CSpell. + +## Installation + +Global Install and add to CSpell global settings. + +```sh +npm install -g @cspell/dict-fsharp +cspell link add @cspell/dict-fsharp +``` + +## Uninstall from CSpell + +```sh +cspell link remove @cspell/dict-fsharp +``` + +## Manual Installation + +Manual installation is useful if you want to include this dictionary as part of your CI/CD lint process. + +``` +npm i @cspell/dict-fsharp +``` + +The `cspell-ext.json` file in this package should be added to the import section in your `cspell.json` file. + +```javascript +{ + // … + "import": ["@cspell/dict-fsharp/cspell-ext.json"], + // … +} +``` + +# Dictionary Development + +See: [How to Create a New Dictionary](https://github.com/streetsidesoftware/cspell-dicts#how-to-create-a-new-dictionary) + +## License + +MIT + +> Some packages may have other licenses included. + + + +
+ +--- + +

+Brought to you by +Street Side Software Logo Street Side Software + +

+ + diff --git a/action/node_modules/@cspell/dict-fsharp/cspell-ext.json b/action/node_modules/@cspell/dict-fsharp/cspell-ext.json new file mode 100644 index 000000000..f481c3727 --- /dev/null +++ b/action/node_modules/@cspell/dict-fsharp/cspell-ext.json @@ -0,0 +1,27 @@ +{ + "id": "fsharp", + "version": "0.2", + "name": "f#", + "description": "F# dictionary for cspell.", + "readonly": true, + "dictionaryDefinitions": [ + { + "name": "fsharp", + "path": "./dict/fsharp.txt", + "description": "F# dictionary for cspell." + } + ], + "dictionaries": [], + "enableFiletypes": ["fsharp"], + "languageSettings": [ + { + "languageId": "fsharp", + "locale": "*", + "includeRegExpList": [], + "ignoreRegExpList": [], + "patterns": [], + "dictionaries": ["fsharp", "dotnet"], + "dictionaryDefinitions": [] + } + ] +} diff --git a/action/node_modules/@cspell/dict-fsharp/dict/README.md b/action/node_modules/@cspell/dict-fsharp/dict/README.md new file mode 100644 index 000000000..ce6712301 --- /dev/null +++ b/action/node_modules/@cspell/dict-fsharp/dict/README.md @@ -0,0 +1,3 @@ +# Dict Directory + +NOTE: This directory contains generated content. Please edit [src](../src/README.md) files. diff --git a/action/node_modules/@cspell/dict-fsharp/dict/fsharp.txt b/action/node_modules/@cspell/dict-fsharp/dict/fsharp.txt new file mode 100644 index 000000000..741afda50 --- /dev/null +++ b/action/node_modules/@cspell/dict-fsharp/dict/fsharp.txt @@ -0,0 +1,294 @@ + +# cspell-tools: keep-case no-split + +Browsable +Datas +Lexhelp +StateTracker +Zmap +Zset +abstract +amap +and +aref +arities +arity +asr +assem +assert +atomic +attribs +base +begin +behaviour +blit +boxity +break +byref +byrefs +callconv +callvirt +castclass +cctor +ccus +cdecl +cenv +checked +class +compiland +component +cond +const +constraint +constructor +continue +conv +coreclr +cpath +cpblk +cpobj +cref +ctok +ctxt +decr +default +defaultof +defn +defns +delegate +demangle +demangled +denv +detuple +dflt +discrim +do +done +downcast +downto +dprintf +dtree +eager +ecref +einfo +elif +else +end +eqns +eref +event +exception +exiter +exnc +extern +external +failwith +failwithf +false +fastcall +fdef +finally +finfo +fixed +flds +for +forall +fprintf +fprintfn +fref +fslib +fsobjmodel +fspec +fsyacc +fun +function +functor +global +gotos +idents +idxs +if +iimpls +ilxgen +impls +in +include +inherit +initblk +initialElement +initobj +inline +inref +instrs +interface +internal +interp +intf +isinst +iteri +land +lazy +lcid +ldarg +ldelem +ldelema +ldfld +ldflda +ldlen +ldloc +ldloca +ldnull +ldobj +ldsfld +ldsflda +ldstr +ldtoken +let +letrec +lexbuf +lidwd +lor +lparen +lsl +lsr +lxor +mapi +match +mdef +measure +measureable +memb +member +method +minfo +minfos +minst +mixin +mod +modref +modul +module +mref +mscorlib +mspec +mutable +mutables +nameof +namespace +nativeint +nativeptr +netstandard +new +newState +newarr +newobj +noframework +not +notlazy +nowarn +null +nullary +nullness +object +occurence +of +open +or +outfile +override +parallel +parens +pdef +pickler +pinfo +pinfos +plid +printf +printfn +private +process +protected +public +pure +qmark +rec +recursive +repr +reraise +rescope +return +rfield +rfinfo +rfref +sbyte +scoref +sealed +select +sig +slotsig +sprintf +static +stdcall +stelem +stfld +stloc +stobj +struct +structs +stsfld +taccess +tailcall +tailcalls +tast +tcaug +tcref +tdef +then +thiscall +tinst +to +toplevel +tpenv +trait +true +try +tspec +tupled +tupling +tyapp +tyargs +tycon +tycons +typ +typar +typars +type +typecheck +typechecked +typedefof +typeof +typeproviders +tyvar +tyvars +ucase +ucref +unativeint +unmanaged +unpickle +untaint +upcast +use +val +vals +virt +virtual +void +volatile +voption +vref +vspec +when +while +with +xmldoc +yield diff --git a/action/node_modules/@cspell/dict-fsharp/package.json b/action/node_modules/@cspell/dict-fsharp/package.json new file mode 100644 index 000000000..07d68fb80 --- /dev/null +++ b/action/node_modules/@cspell/dict-fsharp/package.json @@ -0,0 +1,44 @@ +{ + "name": "@cspell/dict-fsharp", + "version": "1.0.0", + "description": "F# dictionary for cspell.", + "publishConfig": { + "access": "public" + }, + "exports": { + ".": "./cspell-ext.json", + "./cspell": "./cspell-ext.json", + "./cspell-ext.json": "./cspell-ext.json" + }, + "scripts": { + "build": "cspell-tools-cli build", + "test": "cspell samples", + "prepublishOnly": "echo OK", + "prepare": "pnpm run build" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/streetsidesoftware/cspell-dicts.git" + }, + "keywords": [ + "cspell", + "cspell-ext", + "fsharp", + "f#", + "dictionary", + "spelling" + ], + "author": "Jason Dent", + "license": "MIT", + "bugs": { + "url": "https://github.com/streetsidesoftware/cspell-dicts/issues" + }, + "homepage": "https://github.com/streetsidesoftware/cspell-dicts/blob/main/dictionaries/f_sharp#readme", + "files": [ + "dict/fsharp.txt", + "cspell-ext.json", + "*.js", + "*.d.ts" + ], + "gitHead": "f6b5f6f68a7582b929f9475df98da41d9b639fb2" +} diff --git a/action/node_modules/@cspell/dict-lorem-ipsum/README.md b/action/node_modules/@cspell/dict-lorem-ipsum/README.md index c08c79388..42d0147f4 100644 --- a/action/node_modules/@cspell/dict-lorem-ipsum/README.md +++ b/action/node_modules/@cspell/dict-lorem-ipsum/README.md @@ -1,4 +1,4 @@ -# Cspell lorem-ipsum Dictionary +# CSpell lorem-ipsum Dictionary Lorem-ipsum dictionary for cspell. diff --git a/action/node_modules/@cspell/dict-lorem-ipsum/cspell-ext.json b/action/node_modules/@cspell/dict-lorem-ipsum/cspell-ext.json index efde5dcff..908a47d00 100644 --- a/action/node_modules/@cspell/dict-lorem-ipsum/cspell-ext.json +++ b/action/node_modules/@cspell/dict-lorem-ipsum/cspell-ext.json @@ -8,7 +8,7 @@ "dictionaryDefinitions": [ { "name": "lorem-ipsum", - "path": "./dictionary.txt.gz", + "path": "./dict/lorem.txt", "description": "Lorem-ipsum dictionary for cspell." } ], diff --git a/action/node_modules/@cspell/dict-lorem-ipsum/dict/README.md b/action/node_modules/@cspell/dict-lorem-ipsum/dict/README.md new file mode 100644 index 000000000..ce6712301 --- /dev/null +++ b/action/node_modules/@cspell/dict-lorem-ipsum/dict/README.md @@ -0,0 +1,3 @@ +# Dict Directory + +NOTE: This directory contains generated content. Please edit [src](../src/README.md) files. diff --git a/action/node_modules/@cspell/dict-lorem-ipsum/dict/lorem.txt b/action/node_modules/@cspell/dict-lorem-ipsum/dict/lorem.txt new file mode 100644 index 000000000..65d760fdf --- /dev/null +++ b/action/node_modules/@cspell/dict-lorem-ipsum/dict/lorem.txt @@ -0,0 +1,363 @@ + +# cspell-tools: keep-case no-split + +ab +ac +accumsan +accusamus +accusantium +ad +adipisci +adipiscing +adipisicing +aenean +alias +aliqua +aliquam +aliquet +aliquid +aliquip +amet +anim +animi +ante +aperiam +aptent +architecto +arcu +asperiores +aspernatur +assumenda +at +atque +auctor +augue +aut +aute +autem +beatae +bibendum +blandit +blanditiis +cillum +class +commodi +commodo +condimentum +congue +consectetur +consequat +consequatur +consequuntur +conubia +convallis +corporis +corrupti +cras +cubilia +culpa +cum +cumque +cupidatat +cupiditate +curabitur +curae +cursus +dapibus +debitis +delectus +deleniti +deserunt +diam +dicta +dictum +dictumst +dignissim +dignissimos +dis +distinctio +do +dolor +dolore +dolorem +doloremque +dolores +doloribus +dolorum +donec +ducimus +dui +duis +ea +eaque +earum +efficitur +egestas +eget +eius +eiusmod +eleifend +elementum +eligendi +elit +enim +eos +erat +eros +error +esse +est +et +etiam +eu +euismod +eum +eveniet +ex +excepteur +excepturi +exercitation +exercitationem +expedita +explicabo +facere +facilis +facilisi +facilisis +fames +faucibus +felis +fermentum +feugiat +finibus +fringilla +fuga +fugiat +fugit +fusce +gravida +habitant +habitasse +hac +hamburgefons +hamburgefonstiv +hamburgevons +harum +hendrerit +hic +himenaeos +iaculis +id +illo +illum +impedit +imperdiet +in +inceptos +incididunt +incidunt +integer +interdum +inventore +ipsa +ipsam +ipsum +irure +iste +itaque +iure +iusto +justo +labore +laboriosam +laboris +laborum +lacinia +lacus +laoreet +laudantium +lectus +leo +libero +ligula +litora +lobortis +lorem +luctus +maecenas +magna +magnam +magni +magnis +maiores +malesuada +massa +mattis +mauris +maxime +maximus +metus +mi +minim +minima +minus +modi +molestiae +molestias +molestie +mollis +mollit +mollitia +montes +morbi +mus +nam +nascetur +natoque +natus +nec +necessitatibus +nemo +neque +nesciunt +netus +nibh +nihil +nisi +nisl +nobis +non +nostra +nostrud +nostrum +nulla +nullam +numquam +nunc +obcaecati +occaecat +odio +odit +officia +officiis +omnis +optio +orci +ornare +pariatur +parturient +pellentesque +penatibus +per +perferendis +perspiciatis +pharetra +phasellus +placeat +placerat +platea +porro +porta +porttitor +possimus +posuere +praesent +praesentium +pretium +primis +proident +proin +provident +pulvinar +purus +quae +quaerat +quam +quas +quasi +qui +quia +quibusdam +quidem +quis +quisquam +quisque +quo +quod +quos +ratione +recusandae +reiciendis +rem +repellat +repellendus +reprehenderit +repudiandae +rerum +rhoncus +ridiculus +risus +rutrum +saepe +sagittis +sapien +sapiente +scelerisque +sed +sem +semper +senectus +sequi +similique +sint +sit +sociis +sociosqu +sodales +sollicitudin +soluta +sunt +suscipit +suspendisse +taciti +tellus +tempor +tempora +tempore +temporibus +tempus +tenetur +tincidunt +torquent +tortor +totam +tristique +turpis +ullam +ullamco +ullamcorper +ultrices +ultricies +unde +urna +ut +varius +vehicula +vel +velit +venenatis +veniam +veritatis +vero +vestibulum +vitae +vivamus +viverra +voluptas +voluptate +voluptatem +voluptates +voluptatibus +voluptatum +volutpat +vulputate diff --git a/action/node_modules/@cspell/dict-lorem-ipsum/dictionary.txt.gz b/action/node_modules/@cspell/dict-lorem-ipsum/dictionary.txt.gz deleted file mode 100644 index 3c9668164..000000000 Binary files a/action/node_modules/@cspell/dict-lorem-ipsum/dictionary.txt.gz and /dev/null differ diff --git a/action/node_modules/@cspell/dict-lorem-ipsum/package.json b/action/node_modules/@cspell/dict-lorem-ipsum/package.json index 23b8ae672..22cfc95e7 100644 --- a/action/node_modules/@cspell/dict-lorem-ipsum/package.json +++ b/action/node_modules/@cspell/dict-lorem-ipsum/package.json @@ -1,6 +1,6 @@ { "name": "@cspell/dict-lorem-ipsum", - "version": "3.0.0", + "version": "4.0.0", "description": "Lorem-ipsum dictionary for cspell.", "publishConfig": { "access": "public" @@ -11,10 +11,10 @@ "./cspell-ext.json": "./cspell-ext.json" }, "scripts": { - "build": "cspell-tools compile \"dictionary.txt\" -o .", - "test": "head -n 1000 \"dictionary.txt\" | cspell -v -c ./cspell-ext.json --local=lorem --languageId=* stdin", + "build": "cspell-tools-cli build", + "test": "shx head -n 1000 src/dictionary.txt | cspell -v -c ./cspell-ext.json --local=lorem --languageId=* stdin", "prepublishOnly": "echo pre-publish", - "prepare": "yarn run build" + "prepare": "pnpm run build" }, "repository": { "type": "git", @@ -33,8 +33,8 @@ }, "homepage": "https://github.com/streetsidesoftware/cspell-dicts/blob/main/dictionaries/lorem-ipsum#readme", "files": [ - "dictionary.txt.gz", + "dict/lorem.txt", "cspell-ext.json" ], - "gitHead": "1ca7c3ef9e48ab76719fd8e7b578eaee452ddf68" + "gitHead": "f6b5f6f68a7582b929f9475df98da41d9b639fb2" } diff --git a/action/package.json b/action/package.json index 269ce9650..a99957715 100644 --- a/action/package.json +++ b/action/package.json @@ -9,6 +9,6 @@ ] }, "dependencies": { - "@cspell/cspell-bundled-dicts": "^6.31.3" + "@cspell/cspell-bundled-dicts": "^7.0.0" } } diff --git a/yarn.lock b/yarn.lock index fc33a0683..f72822f90 100644 --- a/yarn.lock +++ b/yarn.lock @@ -219,101 +219,102 @@ "@babel/helper-validator-identifier" "^7.22.5" to-fast-properties "^2.0.0" -"@cspell/cspell-bundled-dicts@6.31.3", "@cspell/cspell-bundled-dicts@^6.31.3": - version "6.31.3" - resolved "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-6.31.3.tgz#b9d7fc363b6ce3e0e49e945a563d9d012346ceb6" - integrity sha512-KXy3qKWYzXOGYwqOGMCXHem3fV39iEmoKLiNhoWWry/SFdvAafmeY+LIDcQTXAcOQLkMDCwP2/rY/NadcWnrjg== +"@cspell/cspell-bundled-dicts@7.0.0", "@cspell/cspell-bundled-dicts@^7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-7.0.0.tgz#aea8a596a40748ed3e59ba4edd4fe73c0618d4f7" + integrity sha512-qfBAS4W35+loOfbprBDS8nN0Eitl9wmuPE8GQLbwYj9Qj+COlLg57KECeXF8cgGnHkahrIkc3t6V6eFF8nhXQw== dependencies: - "@cspell/dict-ada" "^4.0.1" - "@cspell/dict-aws" "^3.0.0" + "@cspell/dict-ada" "^4.0.2" + "@cspell/dict-aws" "^4.0.0" "@cspell/dict-bash" "^4.1.1" - "@cspell/dict-companies" "^3.0.9" - "@cspell/dict-cpp" "^5.0.2" + "@cspell/dict-companies" "^3.0.19" + "@cspell/dict-cpp" "^5.0.4" "@cspell/dict-cryptocurrencies" "^3.0.1" "@cspell/dict-csharp" "^4.0.2" - "@cspell/dict-css" "^4.0.5" - "@cspell/dict-dart" "^2.0.2" - "@cspell/dict-django" "^4.0.2" - "@cspell/dict-docker" "^1.1.6" + "@cspell/dict-css" "^4.0.6" + "@cspell/dict-dart" "^2.0.3" + "@cspell/dict-django" "^4.1.0" + "@cspell/dict-docker" "^1.1.7" "@cspell/dict-dotnet" "^5.0.0" - "@cspell/dict-elixir" "^4.0.2" + "@cspell/dict-elixir" "^4.0.3" "@cspell/dict-en-common-misspellings" "^1.0.2" "@cspell/dict-en-gb" "1.1.33" - "@cspell/dict-en_us" "^4.3.2" - "@cspell/dict-filetypes" "^3.0.0" - "@cspell/dict-fonts" "^3.0.2" + "@cspell/dict-en_us" "^4.3.6" + "@cspell/dict-filetypes" "^3.0.1" + "@cspell/dict-fonts" "^4.0.0" + "@cspell/dict-fsharp" "^1.0.0" "@cspell/dict-fullstack" "^3.1.5" "@cspell/dict-gaming-terms" "^1.0.4" "@cspell/dict-git" "^2.0.0" - "@cspell/dict-golang" "^6.0.1" + "@cspell/dict-golang" "^6.0.2" "@cspell/dict-haskell" "^4.0.1" "@cspell/dict-html" "^4.0.3" "@cspell/dict-html-symbol-entities" "^4.0.0" "@cspell/dict-java" "^5.0.5" "@cspell/dict-k8s" "^1.0.1" "@cspell/dict-latex" "^4.0.0" - "@cspell/dict-lorem-ipsum" "^3.0.0" + "@cspell/dict-lorem-ipsum" "^4.0.0" "@cspell/dict-lua" "^4.0.1" "@cspell/dict-node" "^4.0.2" - "@cspell/dict-npm" "^5.0.5" + "@cspell/dict-npm" "^5.0.8" "@cspell/dict-php" "^4.0.1" - "@cspell/dict-powershell" "^5.0.1" - "@cspell/dict-public-licenses" "^2.0.2" - "@cspell/dict-python" "^4.0.2" + "@cspell/dict-powershell" "^5.0.2" + "@cspell/dict-public-licenses" "^2.0.3" + "@cspell/dict-python" "^4.1.5" "@cspell/dict-r" "^2.0.1" "@cspell/dict-ruby" "^5.0.0" "@cspell/dict-rust" "^4.0.1" "@cspell/dict-scala" "^5.0.0" - "@cspell/dict-software-terms" "^3.1.6" - "@cspell/dict-sql" "^2.1.0" + "@cspell/dict-software-terms" "^3.2.1" + "@cspell/dict-sql" "^2.1.1" "@cspell/dict-svelte" "^1.0.2" "@cspell/dict-swift" "^2.0.1" "@cspell/dict-typescript" "^3.1.1" "@cspell/dict-vue" "^3.0.0" -"@cspell/cspell-json-reporter@6.31.3": - version "6.31.3" - resolved "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-6.31.3.tgz#1911b6ef70d97821fa9d71ee9540efd67fc4a679" - integrity sha512-ZJwj2vT4lxncYxduXcxy0dCvjjMvXIfphbLSCN5CXvufrtupB4KlcjZUnOofCi4pfpp8qocCSn1lf2DU9xgUXA== +"@cspell/cspell-json-reporter@7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-7.0.0.tgz#7d04d10b4c7df678847ac94bacf4bcc8740ad719" + integrity sha512-8OheTVzwwfOQqPZe3Enbe1F7Y0djjGunk5K7aC5MyXc3BuIV7Cx13xWo2gfAjiHBRuO5lqg9qidEfp6NE33amg== dependencies: - "@cspell/cspell-types" "6.31.3" + "@cspell/cspell-types" "7.0.0" -"@cspell/cspell-pipe@6.31.3": - version "6.31.3" - resolved "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-6.31.3.tgz#76e852728fb1b939c8fac045067b8259baa7d46e" - integrity sha512-Lv/y4Ya/TJyU1pf66yl1te7LneFZd3lZg1bN5oe1cPrKSmfWdiX48v7plTRecWd/OWyLGd0yN807v79A+/0W7A== +"@cspell/cspell-pipe@7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-7.0.0.tgz#a1fdb9a8e31d445b4bf48c49c71cf36769ad9de2" + integrity sha512-MmQeLyyS5rZ/VvRtHGOLFUcCF9zy01WpWYthLZB61o96HCokqtlN4BBBPLYNxrotFNA4syVy9Si/wTxsC9oTiA== -"@cspell/cspell-service-bus@6.31.3": - version "6.31.3" - resolved "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-6.31.3.tgz#2bf2465a60bb6df8f9d301b33f45d37322f9dcab" - integrity sha512-x5j8j3n39KN8EXOAlv75CpircdpF5WEMCC5pcO916o6GBmJBy8SrdzdsBGJhVcYGGilqy6pf8R9RCZ3yAmG8gQ== +"@cspell/cspell-service-bus@7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-7.0.0.tgz#b764fda9f8d02cfe6cc4df12a290ad4a2f4a94f8" + integrity sha512-0YMM5SJY+XooOTEoo5+xuqTBLO87FP6QR8OBLBDeWNHvON9M4TpeAAN5K+IM0vMSFzgt1aSSMJNO0HSmxn17Yw== -"@cspell/cspell-types@6.31.3": - version "6.31.3" - resolved "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-6.31.3.tgz#ff7493c435778fc76f5f6c6d786c86d12dc76790" - integrity sha512-wZ+t+lUsQJB65M31btZM4fH3K1CkRgE8pSeTiCwxYcnCL19pi4TMcEEMKdO8yFZMdocW4B7VRwzxNoQMw2ewBg== +"@cspell/cspell-types@7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-7.0.0.tgz#d4fbe255c9e69b9785cf274e408cf183ba4f1ab3" + integrity sha512-b/Dee5lb362ODlEK+kQcUDJfCprDRUFWcddo5tyzsYm3ID08ll6+DzCtfRxf48isyX1tL7uBKMj/iIpAhRNu9Q== -"@cspell/dict-ada@^4.0.1": +"@cspell/dict-ada@^4.0.2": version "4.0.2" resolved "https://registry.npmjs.org/@cspell/dict-ada/-/dict-ada-4.0.2.tgz#8da2216660aeb831a0d9055399a364a01db5805a" integrity sha512-0kENOWQeHjUlfyId/aCM/mKXtkEgV0Zu2RhUXCBr4hHo9F9vph+Uu8Ww2b0i5a4ZixoIkudGA+eJvyxrG1jUpA== -"@cspell/dict-aws@^3.0.0": - version "3.0.0" - resolved "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-3.0.0.tgz#7b2db82bb632c664c3d72b83267b93b9b0cafe60" - integrity sha512-O1W6nd5y3Z00AMXQMzfiYrIJ1sTd9fB1oLr+xf/UD7b3xeHeMeYE2OtcWbt9uyeHim4tk+vkSTcmYEBKJgS5bQ== +"@cspell/dict-aws@^4.0.0": + version "4.0.0" + resolved "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.0.tgz#ab71fe0c05d9ad662d27495e74361bdcb5b470eb" + integrity sha512-1YkCMWuna/EGIDN/zKkW+j98/55mxigftrSFgsehXhPld+ZMJM5J9UuBA88YfL7+/ETvBdd7mwW6IwWsC+/ltQ== "@cspell/dict-bash@^4.1.1": version "4.1.1" resolved "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-4.1.1.tgz#fe28016096f44d4a09fe4c5bcaf6fa40f33d98c6" integrity sha512-8czAa/Mh96wu2xr0RXQEGMTBUGkTvYn/Pb0o+gqOO1YW+poXGQc3gx0YPqILDryP/KCERrNvkWUJz3iGbvwC2A== -"@cspell/dict-companies@^3.0.9": +"@cspell/dict-companies@^3.0.19": version "3.0.19" resolved "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.0.19.tgz#ac7ecaf7fe6568a93ca983a4f72bb64328864b2e" integrity sha512-hO7rS4DhFA333qyvf89wIVoclCtXe/2sftY6aS0oMIH1bMZLjLx2B2sQJj6dCiu6gG/By1S9YZ0fXabiPk2Tkg== -"@cspell/dict-cpp@^5.0.2": +"@cspell/dict-cpp@^5.0.4": version "5.0.4" resolved "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.0.4.tgz#2c237dd5d690ee7464c612fd0ef8f2244359d97f" integrity sha512-Vmz/CCb2d91ES5juaO8+CFWeTa2AFsbpR8bkCPJq+P8cRP16+37tY0zNXEBSK/1ur4MakaRf76jeQBijpZxw0Q== @@ -328,12 +329,12 @@ resolved "https://registry.npmjs.org/@cspell/dict-csharp/-/dict-csharp-4.0.2.tgz#e55659dbe594e744d86b1baf0f3397fe57b1e283" integrity sha512-1JMofhLK+4p4KairF75D3A924m5ERMgd1GvzhwK2geuYgd2ZKuGW72gvXpIV7aGf52E3Uu1kDXxxGAiZ5uVG7g== -"@cspell/dict-css@^4.0.5": +"@cspell/dict-css@^4.0.6": version "4.0.6" resolved "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.6.tgz#39cf199e68d6e17b9518938fa64368cec2f7f9ca" integrity sha512-2Lo8W2ezHmGgY8cWFr4RUwnjbndna5mokpCK/DuxGILQnuajR0J31ANQOXj/8iZM2phFB93ZzMNk/0c04TDfSQ== -"@cspell/dict-dart@^2.0.2": +"@cspell/dict-dart@^2.0.3": version "2.0.3" resolved "https://registry.npmjs.org/@cspell/dict-dart/-/dict-dart-2.0.3.tgz#75e7ffe47d5889c2c831af35acdd92ebdbd4cf12" integrity sha512-cLkwo1KT5CJY5N5RJVHks2genFkNCl/WLfj+0fFjqNR+tk3tBI1LY7ldr9piCtSFSm4x9pO1x6IV3kRUY1lLiw== @@ -343,12 +344,12 @@ resolved "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-1.0.10.tgz#88beefd1937fd8c7d94bb3d60f0e9c1b3c428ad8" integrity sha512-7ZsRCnW0f4Bdo6Cqq8V4gHr8K58h+MP8majcDeMNhpMFUPiiSnvKsDuG9V5jciI/0t+lptPrZwGGIVEDF4Kqtg== -"@cspell/dict-django@^4.0.2": +"@cspell/dict-django@^4.1.0": version "4.1.0" resolved "https://registry.npmjs.org/@cspell/dict-django/-/dict-django-4.1.0.tgz#2d4b765daf3c83e733ef3e06887ea34403a4de7a" integrity sha512-bKJ4gPyrf+1c78Z0Oc4trEB9MuhcB+Yg+uTTWsvhY6O2ncFYbB/LbEZfqhfmmuK/XJJixXfI1laF2zicyf+l0w== -"@cspell/dict-docker@^1.1.6": +"@cspell/dict-docker@^1.1.7": version "1.1.7" resolved "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.7.tgz#bcf933283fbdfef19c71a642e7e8c38baf9014f2" integrity sha512-XlXHAr822euV36GGsl2J1CkBIVg3fZ6879ZOg5dxTIssuhUOCiV2BuzKZmt6aIFmcdPmR14+9i9Xq+3zuxeX0A== @@ -358,7 +359,7 @@ resolved "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.0.tgz#13690aafe14b240ad17a30225ac1ec29a5a6a510" integrity sha512-EOwGd533v47aP5QYV8GlSSKkmM9Eq8P3G/eBzSpH3Nl2+IneDOYOBLEUraHuiCtnOkNsz0xtZHArYhAB2bHWAw== -"@cspell/dict-elixir@^4.0.2": +"@cspell/dict-elixir@^4.0.3": version "4.0.3" resolved "https://registry.npmjs.org/@cspell/dict-elixir/-/dict-elixir-4.0.3.tgz#57c25843e46cf3463f97da72d9ef8e37c818296f" integrity sha512-g+uKLWvOp9IEZvrIvBPTr/oaO6619uH/wyqypqvwpmnmpjcfi8+/hqZH8YNKt15oviK8k4CkINIqNhyndG9d9Q== @@ -373,20 +374,25 @@ resolved "https://registry.npmjs.org/@cspell/dict-en-gb/-/dict-en-gb-1.1.33.tgz#7f1fd90fc364a5cb77111b5438fc9fcf9cc6da0e" integrity sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g== -"@cspell/dict-en_us@^4.3.2": +"@cspell/dict-en_us@^4.3.6": version "4.3.6" resolved "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.6.tgz#1f554cf4e235af4e8d115c5924c87537b16a08d0" integrity sha512-odhgsjNZI9BtEOJdvqfAuv/3yz5aB1ngfBNaph7WSnYVt//9e3fhrElZ6/pIIkoyuGgeQPwz1fXt+tMgcnLSEQ== -"@cspell/dict-filetypes@^3.0.0": +"@cspell/dict-filetypes@^3.0.1": version "3.0.1" resolved "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.1.tgz#61642b14af90894e6acf4c00f20ab2d097c1ed12" integrity sha512-8z8mY1IbrTyTRumx2vvD9yzRhNMk9SajM/GtI5hdMM2pPpNSp25bnuauzjRf300eqlqPY2MNb5MmhBFO014DJw== -"@cspell/dict-fonts@^3.0.2": - version "3.0.2" - resolved "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-3.0.2.tgz#657d871cf627466765166cf18c448743c19317e2" - integrity sha512-Z5QdbgEI7DV+KPXrAeDA6dDm/vTzyaW53SGlKqz6PI5VhkOjgkBXv3YtZjnxMZ4dY2ZIqq+RUK6qa9Pi8rQdGQ== +"@cspell/dict-fonts@^4.0.0": + version "4.0.0" + resolved "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-4.0.0.tgz#9bc8beb2a7b068b4fdb45cb994b36fd184316327" + integrity sha512-t9V4GeN/m517UZn63kZPUYP3OQg5f0OBLSd3Md5CU3eH1IFogSvTzHHnz4Wqqbv8NNRiBZ3HfdY/pqREZ6br3Q== + +"@cspell/dict-fsharp@^1.0.0": + version "1.0.0" + resolved "https://registry.npmjs.org/@cspell/dict-fsharp/-/dict-fsharp-1.0.0.tgz#420df73069f7bb8efe82bf823eef620647a571bc" + integrity sha512-dHPkMHwW4dWv3Lv9VWxHuVm4IylqvcfRBSnZ7usJTRThraetSVrOPIJwr6UJh7F5un/lGJx2lxWVApf2WQaB/A== "@cspell/dict-fullstack@^3.1.5": version "3.1.5" @@ -403,7 +409,7 @@ resolved "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-2.0.0.tgz#fa5cb298845da9c69efc01c6af07a99097718dc9" integrity sha512-n1AxyX5Kgxij/sZFkxFJlzn3K9y/sCcgVPg/vz4WNJ4K9YeTsUmyGLA2OQI7d10GJeiuAo2AP1iZf2A8j9aj2w== -"@cspell/dict-golang@^6.0.1": +"@cspell/dict-golang@^6.0.2": version "6.0.2" resolved "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.2.tgz#dcba58b9e658c1cc713c19965a358185d15d1987" integrity sha512-5pyZn4AAiYukAW+gVMIMVmUSkIERFrDX2vtPDjg8PLQUhAHWiVeQSDjuOhq9/C5GCCEZU/zWSONkGiwLBBvV9A== @@ -438,10 +444,10 @@ resolved "https://registry.npmjs.org/@cspell/dict-latex/-/dict-latex-4.0.0.tgz#85054903db834ea867174795d162e2a8f0e9c51e" integrity sha512-LPY4y6D5oI7D3d+5JMJHK/wxYTQa2lJMSNxps2JtuF8hbAnBQb3igoWEjEbIbRRH1XBM0X8dQqemnjQNCiAtxQ== -"@cspell/dict-lorem-ipsum@^3.0.0": - version "3.0.0" - resolved "https://registry.npmjs.org/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-3.0.0.tgz#c6347660fcab480b47bdcaec3b57e8c3abc4af68" - integrity sha512-msEV24qEpzWZs2kcEicqYlhyBpR0amfDkJOs+iffC07si9ftqtQ+yP3lf1VFLpgqw3SQh1M1vtU7RD4sPrNlcQ== +"@cspell/dict-lorem-ipsum@^4.0.0": + version "4.0.0" + resolved "https://registry.npmjs.org/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-4.0.0.tgz#2793a5dbfde474a546b0caecc40c38fdf076306e" + integrity sha512-1l3yjfNvMzZPibW8A7mQU4kTozwVZVw0AvFEdy+NcqtbxH+TvbSkNMqROOFWrkD2PjnKG0+Ea0tHI2Pi6Gchnw== "@cspell/dict-lua@^4.0.1": version "4.0.1" @@ -453,7 +459,7 @@ resolved "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-4.0.2.tgz#9e5f64d882568fdd2a2243542d1263dbbb87c53a" integrity sha512-FEQJ4TnMcXEFslqBQkXa5HposMoCGsiBv2ux4IZuIXgadXeHKHUHk60iarWpjhzNzQLyN2GD7NoRMd12bK3Llw== -"@cspell/dict-npm@^5.0.5": +"@cspell/dict-npm@^5.0.8": version "5.0.8" resolved "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.0.8.tgz#51b2e6dd54f915a2e8725ff7fd75769cb645ff6e" integrity sha512-KuqH8tEsFD6DPKqKwIfWr9E+admE3yghaC0AKXG8jPaf77N0lkctKaS3dm0oxWUXkYKA/eXj6LCtz3VcTyxFPg== @@ -463,17 +469,17 @@ resolved "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.1.tgz#f3c5cd241f43a32b09355370fc6ce7bd50e6402c" integrity sha512-XaQ/JkSyq2c07MfRG54DjLi2CV+HHwS99DDCAao9Fq2JfkWroTQsUeek7wYZXJATrJVOULoV3HKih12x905AtQ== -"@cspell/dict-powershell@^5.0.1": +"@cspell/dict-powershell@^5.0.2": version "5.0.2" resolved "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.2.tgz#2b1d7d514354b6d7de405d5faaef30f8eca0ef09" integrity sha512-IHfWLme3FXE7vnOmMncSBxOsMTdNWd1Vcyhag03WS8oANSgX8IZ+4lMI00mF0ptlgchf16/OU8WsV4pZfikEFw== -"@cspell/dict-public-licenses@^2.0.2": +"@cspell/dict-public-licenses@^2.0.3": version "2.0.3" resolved "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.3.tgz#fa03649a5d6b8284e0c1da17eb449707df1a2a1c" integrity sha512-JSLEdpEYufQ1H+93UHi+axlqQm1fhgK6kpdLHp6uPHu//CsvETcqNVawjB+qOdI/g38JTMw5fBqSd0aGNxa6Dw== -"@cspell/dict-python@^4.0.2": +"@cspell/dict-python@^4.1.5": version "4.1.5" resolved "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.1.5.tgz#0c5eab3f12a166c9339dec508d8b07b4dddab1d4" integrity sha512-wWUWyHdyJtx5iG6Fz9rBQ17BtdpEsB17vmutao+gixQD28Jzb6XoLgDQ6606M0RnFjBSFhs5iT4CJBzlD2Kq6g== @@ -500,12 +506,12 @@ resolved "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.0.tgz#b64365ad559110a36d44ccd90edf7151ea648022" integrity sha512-ph0twaRoV+ylui022clEO1dZ35QbeEQaKTaV2sPOsdwIokABPIiK09oWwGK9qg7jRGQwVaRPEq0Vp+IG1GpqSQ== -"@cspell/dict-software-terms@^3.1.6": +"@cspell/dict-software-terms@^3.2.1": version "3.2.1" resolved "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.2.1.tgz#655b52768d05d002d9fc18a0efa63eee66766b8b" integrity sha512-+QXmyoONVc/3aNgKW+0F0u3XUCRTfNRkWKLZQA78i+9fOfde8ZT4JmROmZgRveH/MxD4n6pNFceIRcYI6C8WuQ== -"@cspell/dict-sql@^2.1.0": +"@cspell/dict-sql@^2.1.1": version "2.1.1" resolved "https://registry.npmjs.org/@cspell/dict-sql/-/dict-sql-2.1.1.tgz#eb16c8bece4ff3154a193fe854a600ed0f75c64c" integrity sha512-v1mswi9NF40+UDUMuI148YQPEQvWjac72P6ZsjlRdLjEiQEEMEsTQ+zlkIdnzC9QCNyJaqD5Liq9Mn78/8Zxtw== @@ -530,17 +536,17 @@ resolved "https://registry.npmjs.org/@cspell/dict-vue/-/dict-vue-3.0.0.tgz#68ccb432ad93fcb0fd665352d075ae9a64ea9250" integrity sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A== -"@cspell/dynamic-import@6.31.3": - version "6.31.3" - resolved "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-6.31.3.tgz#f98ee7a8210e457b6f885be9a918b9608571b677" - integrity sha512-A6sT00+6UNGFksQ5SxW2ohNl6vUutai8F4jwJMHTjZL/9vivQpU7y5V4PpsfoPZtx3WZcbrzuTvJ+tLfdbWc4A== +"@cspell/dynamic-import@7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-7.0.0.tgz#96f4ec55cca88939364abf4f0d51dc981ab959a1" + integrity sha512-GRSJvdQvVOC0y7Qla8eg6LLe8p8WnbnHLabGJGsqYfXgtfkUFev9v65kMybQSJt9qhDtGCRw6EN1UyaeeEtavQ== dependencies: - import-meta-resolve "^2.2.2" + import-meta-resolve "^3.0.0" -"@cspell/strong-weak-map@6.31.3": - version "6.31.3" - resolved "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-6.31.3.tgz#dd7470ce86c2372ec2cd889439c0f9808122b9c7" - integrity sha512-znwc9IlgGUPioHGshP/zyM8HsuYg1OY5S7HSiVXARh5H8RqcyBsnyn8abc0PPhqPrfDy9Fh5xHsAEPZ55dl1vQ== +"@cspell/strong-weak-map@7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-7.0.0.tgz#a8a4d16c1d5c4a8892465b25685e3ef2c28236f0" + integrity sha512-DT1R30i3V7aJIGLt7x1igaMLHhYSFv6pgc9gNwXvZWFl1xm/f7Jx07GPXKKKhwwXd4vy7G5rhwo63F4Pt9i8Ng== "@esbuild/android-arm64@0.18.20": version "0.18.20" @@ -1383,6 +1389,11 @@ ansi-regex@^5.0.1: resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== +ansi-regex@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" + integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== + ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -1556,6 +1567,13 @@ chai@^4.3.7: pathval "^1.1.1" type-detect "^4.0.5" +chalk-template@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/chalk-template/-/chalk-template-1.1.0.tgz#ffc55db6dd745e9394b85327c8ac8466edb7a7b1" + integrity sha512-T2VJbcDuZQ0Tb2EWwSotMPJjgpy1/tGee1BTpUNsGZ/qgNjV2t7Mvu+d4600U564nbLesN1x2dPL+xii174Ekg== + dependencies: + chalk "^5.2.0" + chalk@^2.4.2: version "2.4.2" resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" @@ -1565,7 +1583,7 @@ chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0, chalk@^4.1.2: +chalk@^4.0.0: version "4.1.2" resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -1573,6 +1591,11 @@ chalk@^4.0.0, chalk@^4.1.2: ansi-styles "^4.1.0" supports-color "^7.1.0" +chalk@^5.2.0, chalk@^5.3.0: + version "5.3.0" + resolved "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" + integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== + check-error@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" @@ -1610,7 +1633,7 @@ color-name@~1.1.4: resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -commander@^10.0.0: +commander@^10.0.1: version "10.0.1" resolved "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== @@ -1636,17 +1659,16 @@ concat-map@0.0.1: resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -configstore@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz#d365021b5df4b98cdd187d6a3b0e3f6a7cc5ed96" - integrity sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA== +configstore@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/configstore/-/configstore-6.0.0.tgz#49eca2ebc80983f77e09394a1a56e0aca8235566" + integrity sha512-cD31W1v3GqUlQvbBCGcXmd2Nj9SvLDOP1oQ0YFuLETufzSPaKp11rYBsSOm7rCsW3OnIRAFM3OxRhceaXNYHkA== dependencies: - dot-prop "^5.2.0" - graceful-fs "^4.1.2" - make-dir "^3.0.0" - unique-string "^2.0.0" - write-file-atomic "^3.0.0" - xdg-basedir "^4.0.0" + dot-prop "^6.0.1" + graceful-fs "^4.2.6" + unique-string "^3.0.0" + write-file-atomic "^3.0.3" + xdg-basedir "^5.0.1" content-disposition@0.5.4: version "0.5.4" @@ -1707,73 +1729,75 @@ cross-spawn@^7.0.0, cross-spawn@^7.0.2: shebang-command "^2.0.0" which "^2.0.1" -crypto-random-string@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" - integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== +crypto-random-string@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz#5a3cc53d7dd86183df5da0312816ceeeb5bb1fc2" + integrity sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA== + dependencies: + type-fest "^1.0.1" -cspell-dictionary@6.31.3: - version "6.31.3" - resolved "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-6.31.3.tgz#5ab069e11e9c2231b01f66ecf250fff23215648c" - integrity sha512-3w5P3Md/tbHLVGPKVL0ePl1ObmNwhdDiEuZ2TXfm2oAIwg4aqeIrw42A2qmhaKLcuAIywpqGZsrGg8TviNNhig== +cspell-dictionary@7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-7.0.0.tgz#c6df4d8c81cd0aa0f00a6f374005bf229b9b8d6e" + integrity sha512-CYB02vB870JfCtmi4Njuzw1nCjbyRCjoqlsAQgHkhRSevRKcjFrK3+XsBhNA3Zo4ek4P35+oS/I4vMOHu6cdCg== dependencies: - "@cspell/cspell-pipe" "6.31.3" - "@cspell/cspell-types" "6.31.3" - cspell-trie-lib "6.31.3" + "@cspell/cspell-pipe" "7.0.0" + "@cspell/cspell-types" "7.0.0" + cspell-trie-lib "7.0.0" fast-equals "^4.0.3" gensequence "^5.0.2" -cspell-gitignore@6.31.3: - version "6.31.3" - resolved "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-6.31.3.tgz#324ff7c8f2e35b103eeec81a185d578bf37c42f0" - integrity sha512-vCfVG4ZrdwJnsZHl/cdp8AY+YNPL3Ga+0KR9XJsaz69EkQpgI6porEqehuwle7hiXw5e3L7xFwNEbpCBlxgLRA== +cspell-gitignore@7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-7.0.0.tgz#8d003d562d803018624fb2816663d5dac9106877" + integrity sha512-9VVLuiVhntXO/It3K0nTDhxbPPc2nItvGLymItfUudfB0ZqgzBaomdoYZzXrcNOITjYiBXWCPuVOXLbyoL0DjQ== dependencies: - cspell-glob "6.31.3" + cspell-glob "7.0.0" find-up "^5.0.0" -cspell-glob@6.31.3, cspell-glob@^6.31.3: - version "6.31.3" - resolved "https://registry.npmjs.org/cspell-glob/-/cspell-glob-6.31.3.tgz#99ed7e39f83735fbda9a77f13636a18fd54bef39" - integrity sha512-+koUJPSCOittQwhR0T1mj4xXT3N+ZnY2qQ53W6Gz9HY3hVfEEy0NpbwE/Uy7sIvFMbc426fK0tGXjXyIj72uhQ== +cspell-glob@7.0.0, cspell-glob@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/cspell-glob/-/cspell-glob-7.0.0.tgz#188d637357080598b5468a84bc432d69979fed21" + integrity sha512-Wl47kChIuSiuStofVSPdgvwi8BRD4tN03j+yhpJ1q+lWT023ctFacZy+Lc+L6nxaTUriDy5ET+UoooPMJ2PskA== dependencies: micromatch "^4.0.5" -cspell-grammar@6.31.3: - version "6.31.3" - resolved "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-6.31.3.tgz#1c8ebb9f623ec866d307c78ace9fa4ba73c94822" - integrity sha512-TZYaOLIGAumyHlm4w7HYKKKcR1ZgEMKt7WNjCFqq7yGVW7U+qyjQqR8jqnLiUTZl7c2Tque4mca7n0CFsjVv5A== +cspell-grammar@7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-7.0.0.tgz#b008feef90723538bc5ecc5af90f222f87a5faf9" + integrity sha512-0k1qVvxMNwP4WXX1zIp3Ub+RQnUzjiBtB+BO4Lprnkp6/JuRndpBRDrXBsqNZBVzZ+JjyRSU1elNSN6/nudXvQ== dependencies: - "@cspell/cspell-pipe" "6.31.3" - "@cspell/cspell-types" "6.31.3" + "@cspell/cspell-pipe" "7.0.0" + "@cspell/cspell-types" "7.0.0" -cspell-io@6.31.3: - version "6.31.3" - resolved "https://registry.npmjs.org/cspell-io/-/cspell-io-6.31.3.tgz#a62e95196027ab9c7c8a35d9ec347ded8d054658" - integrity sha512-yCnnQ5bTbngUuIAaT5yNSdI1P0Kc38uvC8aynNi7tfrCYOQbDu1F9/DcTpbdhrsCv+xUn2TB1YjuCmm0STfJlA== +cspell-io@7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/cspell-io/-/cspell-io-7.0.0.tgz#ac6e96629fa7f329c71bb503dcca0e6233c57c99" + integrity sha512-pGf+XlMcOxZfO7NIwJYmje8D30OEUt2Vb7cfZ2nazdFf9/NfiZpYp3JHOT+n53DhbIXTfdmojXo5bVezPXA48g== dependencies: - "@cspell/cspell-service-bus" "6.31.3" - node-fetch "^2.6.9" + "@cspell/cspell-service-bus" "7.0.0" + node-fetch "^2.6.12" -cspell-lib@6.31.3: - version "6.31.3" - resolved "https://registry.npmjs.org/cspell-lib/-/cspell-lib-6.31.3.tgz#4b5034adb3af3e3d6acb49bbf251b9c18b280f50" - integrity sha512-Dv55aecaMvT/5VbNryKo0Zos8dtHon7e1K0z8DR4/kGZdQVT0bOFWeotSLhuaIqoNFdEt8ypfKbrIHIdbgt1Hg== +cspell-lib@7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/cspell-lib/-/cspell-lib-7.0.0.tgz#df5940bc9151f83dbd93db0b8240527618670693" + integrity sha512-CJAa7uV4hrm8OTnWdFPONSUP1Dp7J7fVhKu15aTrpNASUMAHe5YWqFqInCg+0+XhdRpGGYjQKhd+khsXL5a+bg== dependencies: - "@cspell/cspell-bundled-dicts" "6.31.3" - "@cspell/cspell-pipe" "6.31.3" - "@cspell/cspell-types" "6.31.3" - "@cspell/strong-weak-map" "6.31.3" + "@cspell/cspell-bundled-dicts" "7.0.0" + "@cspell/cspell-pipe" "7.0.0" + "@cspell/cspell-types" "7.0.0" + "@cspell/strong-weak-map" "7.0.0" clear-module "^4.1.2" comment-json "^4.2.3" - configstore "^5.0.1" + configstore "^6.0.0" cosmiconfig "8.0.0" - cspell-dictionary "6.31.3" - cspell-glob "6.31.3" - cspell-grammar "6.31.3" - cspell-io "6.31.3" - cspell-trie-lib "6.31.3" - fast-equals "^4.0.3" - find-up "^5.0.0" + cspell-dictionary "7.0.0" + cspell-glob "7.0.0" + cspell-grammar "7.0.0" + cspell-io "7.0.0" + cspell-trie-lib "7.0.0" + fast-equals "^5.0.1" + find-up "^6.3.0" gensequence "^5.0.2" import-fresh "^3.3.0" resolve-from "^5.0.0" @@ -1781,37 +1805,37 @@ cspell-lib@6.31.3: vscode-languageserver-textdocument "^1.0.8" vscode-uri "^3.0.7" -cspell-trie-lib@6.31.3: - version "6.31.3" - resolved "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-6.31.3.tgz#73060aa1e9926faeffe509f9f8b8fd74aa55d1a4" - integrity sha512-HNUcLWOZAvtM3E34U+7/mSSpO0F6nLd/kFlRIcvSvPb9taqKe8bnSa0Yyb3dsdMq9rMxUmuDQtF+J6arZK343g== +cspell-trie-lib@7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-7.0.0.tgz#4b13d812b531d1670f505a1ef6b4cd37cde86933" + integrity sha512-mopXyfjNRVuYbrZcbBcLwOMrWeyTezh4w8zy+RywUmsF6IW6/HM2DkfE2BmH1IyE9af29lgQqdB5eDbJLWrP5A== dependencies: - "@cspell/cspell-pipe" "6.31.3" - "@cspell/cspell-types" "6.31.3" + "@cspell/cspell-pipe" "7.0.0" + "@cspell/cspell-types" "7.0.0" gensequence "^5.0.2" -cspell@^6.31.3: - version "6.31.3" - resolved "https://registry.npmjs.org/cspell/-/cspell-6.31.3.tgz#d06176e7fe7ac80c4dd5c4a927139446e433385a" - integrity sha512-VeeShDLWVM6YPiU/imeGy0lmg6ki63tbLEa6hz20BExhzzpmINOP5nSTYtpY0H9zX9TrF/dLbI38TuuYnyG3Uw== - dependencies: - "@cspell/cspell-json-reporter" "6.31.3" - "@cspell/cspell-pipe" "6.31.3" - "@cspell/cspell-types" "6.31.3" - "@cspell/dynamic-import" "6.31.3" - chalk "^4.1.2" - commander "^10.0.0" - cspell-gitignore "6.31.3" - cspell-glob "6.31.3" - cspell-io "6.31.3" - cspell-lib "6.31.3" - fast-glob "^3.2.12" +cspell@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/cspell/-/cspell-7.0.0.tgz#f77e614c60254a6dd11f7a572e91904e395f2abf" + integrity sha512-E8wQP30bTLROJsSNwYnhhRUdzVa4vQo6zILv7PqgTCSaveg8Af1HEh4ocRPRhppRgIXDpccG27+ATlpEzxiPGQ== + dependencies: + "@cspell/cspell-json-reporter" "7.0.0" + "@cspell/cspell-pipe" "7.0.0" + "@cspell/cspell-types" "7.0.0" + "@cspell/dynamic-import" "7.0.0" + chalk "^5.3.0" + chalk-template "^1.1.0" + commander "^10.0.1" + cspell-gitignore "7.0.0" + cspell-glob "7.0.0" + cspell-io "7.0.0" + cspell-lib "7.0.0" + fast-glob "^3.3.1" fast-json-stable-stringify "^2.1.0" file-entry-cache "^6.0.1" - get-stdin "^8.0.0" - imurmurhash "^0.1.4" - semver "^7.3.8" - strip-ansi "^6.0.1" + get-stdin "^9.0.0" + semver "^7.5.4" + strip-ansi "^7.1.0" vscode-uri "^3.0.7" debug@2.6.9: @@ -1874,10 +1898,10 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -dot-prop@^5.2.0: - version "5.3.0" - resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" - integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q== +dot-prop@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz#fc26b3cf142b9e59b74dbd39ed66ce620c681083" + integrity sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA== dependencies: is-obj "^2.0.0" @@ -2146,7 +2170,12 @@ fast-equals@^4.0.3: resolved "https://registry.npmjs.org/fast-equals/-/fast-equals-4.0.3.tgz#72884cc805ec3c6679b99875f6b7654f39f0e8c7" integrity sha512-G3BSX9cfKttjr+2o1O22tYMLq0DPluZnYtq1rXumE1SpL/F/SLIfHx08WYQoWSIpeMYf8sRbJ8++71+v6Pnxfg== -fast-glob@^3.2.12, fast-glob@^3.2.9: +fast-equals@^5.0.1: + version "5.0.1" + resolved "https://registry.npmjs.org/fast-equals/-/fast-equals-5.0.1.tgz#a4eefe3c5d1c0d021aeed0bc10ba5e0c12ee405d" + integrity sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ== + +fast-glob@^3.2.9, fast-glob@^3.3.1: version "3.3.1" resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4" integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg== @@ -2209,6 +2238,14 @@ find-up@^5.0.0: locate-path "^6.0.0" path-exists "^4.0.0" +find-up@^6.3.0: + version "6.3.0" + resolved "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz#2abab3d3280b2dc7ac10199ef324c4e002c8c790" + integrity sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw== + dependencies: + locate-path "^7.1.0" + path-exists "^5.0.0" + flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" @@ -2281,10 +2318,10 @@ get-intrinsic@^1.0.2: has-proto "^1.0.1" has-symbols "^1.0.3" -get-stdin@^8.0.0: - version "8.0.0" - resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53" - integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg== +get-stdin@^9.0.0: + version "9.0.0" + resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-9.0.0.tgz#3983ff82e03d56f1b2ea0d3e60325f39d703a575" + integrity sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA== glob-parent@^5.1.2: version "5.1.2" @@ -2343,7 +2380,7 @@ globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" -graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0: +graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.6: version "4.2.11" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -2428,10 +2465,10 @@ import-fresh@^3.2.1, import-fresh@^3.3.0: parent-module "^1.0.0" resolve-from "^4.0.0" -import-meta-resolve@^2.2.2: - version "2.2.2" - resolved "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-2.2.2.tgz#75237301e72d1f0fbd74dbc6cca9324b164c2cc9" - integrity sha512-f8KcQ1D80V7RnqVm+/lirO9zkOxjGxhaTC1IPrBGd3MEfNgmNG67tSUO9gTi2F3Blr2Az6g1vocaxzkVnWl9MA== +import-meta-resolve@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-3.0.0.tgz#94a6aabc623874fbc2f3525ec1300db71c6cbc11" + integrity sha512-4IwhLhNNA8yy445rPjD/lWh++7hMDOml2eHtd58eG7h+qK3EryMuuRbsHGPikCoAgIkkDnckKfWSk2iDla/ejg== imurmurhash@^0.1.4: version "0.1.4" @@ -2648,6 +2685,13 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" +locate-path@^7.1.0: + version "7.2.0" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz#69cb1779bd90b35ab1e771e1f2f89a202c2a8a8a" + integrity sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA== + dependencies: + p-locate "^6.0.0" + lodash-es@^4.17.21: version "4.17.21" resolved "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee" @@ -2696,13 +2740,6 @@ magic-string@^0.30.1: dependencies: "@jridgewell/sourcemap-codec" "^1.4.15" -make-dir@^3.0.0: - version "3.1.0" - resolved "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" - integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== - dependencies: - semver "^6.0.0" - make-dir@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" @@ -2838,7 +2875,7 @@ nock@^13.2.1: lodash "^4.17.21" propagate "^2.0.0" -node-fetch@^2.6.7, node-fetch@^2.6.9: +node-fetch@^2.6.12, node-fetch@^2.6.7: version "2.6.12" resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba" integrity sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g== @@ -2919,6 +2956,13 @@ p-locate@^5.0.0: dependencies: p-limit "^3.0.2" +p-locate@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz#3da9a49d4934b901089dca3302fa65dc5a05c04f" + integrity sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw== + dependencies: + p-limit "^4.0.0" + parent-module@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -2953,6 +2997,11 @@ path-exists@^4.0.0: resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== +path-exists@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz#a6aad9489200b21fab31e49cf09277e5116fb9e7" + integrity sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ== + path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -3196,12 +3245,12 @@ safe-buffer@5.2.1: resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -semver@^6.0.0, semver@^6.3.1: +semver@^6.3.1: version "6.3.1" resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.3.7, semver@^7.3.8, semver@^7.5.3, semver@^7.5.4: +semver@^7.3.7, semver@^7.5.3, semver@^7.5.4: version "7.5.4" resolved "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== @@ -3337,6 +3386,13 @@ strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" +strip-ansi@^7.1.0: + version "7.1.0" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" + integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== + dependencies: + ansi-regex "^6.0.1" + strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" @@ -3453,6 +3509,11 @@ type-fest@^0.20.2: resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== +type-fest@^1.0.1: + version "1.4.0" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz#e9fb813fe3bf1744ec359d55d1affefa76f14be1" + integrity sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA== + type-is@~1.6.18: version "1.6.18" resolved "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" @@ -3478,12 +3539,12 @@ ufo@^1.1.2: resolved "https://registry.npmjs.org/ufo/-/ufo-1.2.0.tgz#28d127a087a46729133fdc89cb1358508b3f80ba" integrity sha512-RsPyTbqORDNDxqAdQPQBpgqhWle1VcTSou/FraClYlHf6TZnQcGslpLcAphNR+sQW4q5lLWLbOsRlh9j24baQg== -unique-string@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz#39c6451f81afb2749de2b233e3f7c5e8843bd89d" - integrity sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg== +unique-string@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz#84a1c377aff5fd7a8bc6b55d8244b2bd90d75b9a" + integrity sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ== dependencies: - crypto-random-string "^2.0.0" + crypto-random-string "^4.0.0" universal-user-agent@^6.0.0: version "6.0.0" @@ -3639,7 +3700,7 @@ wrappy@1: resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== -write-file-atomic@^3.0.0: +write-file-atomic@^3.0.3: version "3.0.3" resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== @@ -3649,10 +3710,10 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" -xdg-basedir@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" - integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q== +xdg-basedir@^5.0.1: + version "5.1.0" + resolved "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz#1efba19425e73be1bc6f2a6ceb52a3d2c884c0c9" + integrity sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ== yallist@^3.0.2: version "3.1.1"