@shopify/create-app
Version:
A CLI tool to create a new Shopify app.
11,806 lines • 543 kB
JavaScript
import {
require_src,
require_supports_color
} from "./chunk-ODCXYGJ2.js";
import {
require_is_wsl
} from "./chunk-LBXDGVFS.js";
import {
require_semver
} from "./chunk-OQ3KXXGH.js";
import {
require_typescript
} from "./chunk-D6NYWNY2.js";
import {
__commonJS,
__require,
init_cjs_shims
} from "./chunk-3XNI6LP4.js";
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/util.js
var require_util = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/util.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.pickBy = pickBy;
exports.compact = compact;
exports.uniqBy = uniqBy;
exports.last = last;
exports.sortBy = sortBy;
exports.castArray = castArray;
exports.isProd = isProd;
exports.maxBy = maxBy;
exports.sumBy = sumBy;
exports.capitalize = capitalize;
exports.isTruthy = isTruthy;
exports.isNotFalsy = isNotFalsy;
exports.uniq = uniq;
exports.mapValues = mapValues;
exports.mergeNestedObjects = mergeNestedObjects;
function pickBy(obj, fn) {
return Object.entries(obj).reduce((o, [k, v]) => (fn(v) && (o[k] = v), o), {});
}
function compact(a) {
return a.filter((a2) => !!a2);
}
function uniqBy(arr, fn) {
return arr.filter((a, i) => {
let aVal = fn(a);
return !arr.some((b, j) => j > i && fn(b) === aVal);
});
}
function last(arr) {
if (arr)
return arr.at(-1);
}
function compare(a, b) {
if (a = a === void 0 ? 0 : a, b = b === void 0 ? 0 : b, Array.isArray(a) && Array.isArray(b)) {
if (a.length === 0 && b.length === 0)
return 0;
let diff = compare(a[0], b[0]);
return diff !== 0 ? diff : compare(a.slice(1), b.slice(1));
}
return a < b ? -1 : a > b ? 1 : 0;
}
function sortBy(arr, fn) {
return arr.sort((a, b) => compare(fn(a), fn(b)));
}
function castArray(input) {
return input === void 0 ? [] : Array.isArray(input) ? input : [input];
}
function isProd() {
return !["development", "test"].includes(process.env.NODE_ENV ?? "");
}
function maxBy(arr, fn) {
if (arr.length !== 0)
return arr.reduce((maxItem, i) => {
let curr = fn(i), max = fn(maxItem);
return curr > max ? i : maxItem;
});
}
function sumBy(arr, fn) {
return arr.reduce((sum, i) => sum + fn(i), 0);
}
function capitalize(s) {
return s ? s.charAt(0).toUpperCase() + s.slice(1).toLowerCase() : "";
}
function isTruthy(input) {
return ["1", "true", "y", "yes"].includes(input.toLowerCase());
}
function isNotFalsy(input) {
return !["0", "false", "n", "no"].includes(input.toLowerCase());
}
function uniq(arr) {
return [...new Set(arr)].sort();
}
function mapValues(obj, fn) {
return Object.entries(obj).reduce((o, [k, v]) => (o[k] = fn(v, k), o), {});
}
function get(obj, path) {
return path.split(".").reduce((o, p) => o?.[p], obj);
}
function mergeNestedObjects(objs, path) {
return Object.fromEntries(objs.flatMap((o) => Object.entries(get(o, path) ?? {})).reverse());
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/fs.js
var require_fs = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/fs.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.fileExists = exports.dirExists = void 0;
exports.readJson = readJson;
exports.safeReadJson = safeReadJson;
exports.existsSync = existsSync;
var node_fs_1 = __require("node:fs"), promises_1 = __require("node:fs/promises"), util_1 = require_util(), dirExists = async (input) => {
let dirStat;
try {
dirStat = await (0, promises_1.stat)(input);
} catch {
throw new Error(`No directory found at ${input}`);
}
if (!dirStat.isDirectory())
throw new Error(`${input} exists but is not a directory`);
return input;
};
exports.dirExists = dirExists;
var fileExists = async (input) => {
let fileStat;
try {
fileStat = await (0, promises_1.stat)(input);
} catch {
throw new Error(`No file found at ${input}`);
}
if (!fileStat.isFile())
throw new Error(`${input} exists but is not a file`);
return input;
};
exports.fileExists = fileExists;
var ProdOnlyCache = class extends Map {
set(key, value) {
return ((0, util_1.isProd)() ?? !1) && super.set(key, value), this;
}
}, cache = new ProdOnlyCache();
async function readJson(path, useCache = !0) {
if (useCache && cache.has(path))
return JSON.parse(cache.get(path));
let contents = await (0, promises_1.readFile)(path, "utf8");
return cache.set(path, contents), JSON.parse(contents);
}
async function safeReadJson(path, useCache = !0) {
try {
return await readJson(path, useCache);
} catch {
}
}
function existsSync(path) {
return (0, node_fs_1.existsSync)(path);
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/args.js
var require_args = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/args.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.string = exports.url = exports.file = exports.directory = exports.integer = exports.boolean = void 0;
exports.custom = custom;
var node_url_1 = __require("node:url"), fs_1 = require_fs(), util_1 = require_util();
function custom(defaults) {
return (options = {}) => ({
parse: async (i, _context, _opts) => i,
...defaults,
...options,
input: [],
type: "option"
});
}
exports.boolean = custom({
parse: async (b) => !!b && (0, util_1.isNotFalsy)(b)
});
exports.integer = custom({
async parse(input, _, opts) {
if (!/^-?\d+$/.test(input))
throw new Error(`Expected an integer but received: ${input}`);
let num = Number.parseInt(input, 10);
if (opts.min !== void 0 && num < opts.min)
throw new Error(`Expected an integer greater than or equal to ${opts.min} but received: ${input}`);
if (opts.max !== void 0 && num > opts.max)
throw new Error(`Expected an integer less than or equal to ${opts.max} but received: ${input}`);
return num;
}
});
exports.directory = custom({
async parse(input, _, opts) {
return opts.exists ? (0, fs_1.dirExists)(input) : input;
}
});
exports.file = custom({
async parse(input, _, opts) {
return opts.exists ? (0, fs_1.fileExists)(input) : input;
}
});
exports.url = custom({
async parse(input) {
try {
return new node_url_1.URL(input);
} catch {
throw new Error(`Expected a valid url but received: ${input}`);
}
}
});
var stringArg = custom({});
exports.string = stringArg;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/package.json
var require_package = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/package.json"(exports, module) {
module.exports = {
name: "@oclif/core",
description: "base library for oclif CLIs",
version: "4.8.3",
author: "Salesforce",
bugs: "https://github.com/oclif/core/issues",
dependencies: {
"ansi-escapes": "^4.3.2",
ansis: "^3.17.0",
"clean-stack": "^3.0.1",
"cli-spinners": "^2.9.2",
debug: "^4.4.3",
ejs: "^3.1.10",
"get-package-type": "^0.1.0",
"indent-string": "^4.0.0",
"is-wsl": "^2.2.0",
lilconfig: "^3.1.3",
minimatch: "^10.2.4",
semver: "^7.7.3",
"string-width": "^4.2.3",
"supports-color": "^8",
tinyglobby: "^0.2.14",
"widest-line": "^3.1.0",
wordwrap: "^1.0.0",
"wrap-ansi": "^7.0.0"
},
devDependencies: {
"@commitlint/config-conventional": "^19",
"@eslint/compat": "^1.4.1",
"@oclif/plugin-help": "^6",
"@oclif/plugin-plugins": "^5",
"@oclif/prettier-config": "^0.2.1",
"@oclif/test": "^4",
"@types/benchmark": "^2.1.5",
"@types/chai": "^4.3.16",
"@types/chai-as-promised": "^7.1.8",
"@types/clean-stack": "^2.1.1",
"@types/debug": "^4.1.10",
"@types/ejs": "^3.1.5",
"@types/indent-string": "^4.0.1",
"@types/mocha": "^10.0.10",
"@types/node": "^18",
"@types/pnpapi": "^0.0.5",
"@types/sinon": "^17.0.3",
"@types/supports-color": "^8.1.3",
"@types/wordwrap": "^1.0.3",
"@types/wrap-ansi": "^3.0.0",
benchmark: "^2.1.4",
chai: "^4.5.0",
"chai-as-promised": "^7.1.2",
commitlint: "^19",
"cross-env": "^7.0.3",
eslint: "^9",
"eslint-config-oclif": "^6",
"eslint-config-prettier": "^10",
husky: "^9.1.7",
"lint-staged": "^15",
madge: "^6.1.0",
mocha: "^11.7.5",
nyc: "^15.1.0",
prettier: "^3.8.1",
shx: "^0.4.0",
sinon: "^18",
"ts-node": "^10.9.2",
tsd: "^0.33.0",
typescript: "^5"
},
engines: {
node: ">=18.0.0"
},
files: [
"/lib"
],
homepage: "https://github.com/oclif/core",
keywords: [
"oclif",
"cli",
"command",
"command line",
"parser",
"args",
"argv"
],
license: "MIT",
exports: {
".": "./lib/index.js",
"./args": "./lib/args.js",
"./command": "./lib/command.js",
"./config": "./lib/config/index.js",
"./errors": "./lib/errors/index.js",
"./execute": "./lib/execute.js",
"./flags": "./lib/flags.js",
"./flush": "./lib/flush.js",
"./handle": "./lib/errors/handle.js",
"./help": "./lib/help/index.js",
"./hooks": "./lib/interfaces/hooks.js",
"./interfaces": "./lib/interfaces/index.js",
"./logger": "./lib/logger.js",
"./package.json": "./package.json",
"./parser": "./lib/parser/index.js",
"./performance": "./lib/performance.js",
"./run": "./lib/main.js",
"./settings": "./lib/settings.js",
"./util/ids": "./lib/util/ids.js",
"./ux": "./lib/ux/index.js"
},
repository: "oclif/core",
oclif: {
bin: "oclif",
devPlugins: [
"@oclif/plugin-help",
"@oclif/plugin-plugins"
]
},
publishConfig: {
access: "public"
},
scripts: {
build: "shx rm -rf lib && tsc",
compile: "tsc",
format: 'prettier --write "+(src|test)/**/*.+(ts|js|json)"',
lint: "eslint",
posttest: "yarn lint && yarn test:circular-deps",
prepack: "yarn run build",
prepare: "husky",
"test:circular-deps": "yarn build && madge lib/ -c",
"test:debug": 'nyc mocha --debug-brk --inspect "test/**/*.test.ts"',
"test:integration": 'mocha --forbid-only "test/**/*.integration.ts" --parallel --timeout 1200000',
"test:interoperability": "cross-env DEBUG=integration:* ts-node test/integration/interop.ts",
"test:perf": "ts-node test/perf/parser.perf.ts",
test: 'nyc mocha --forbid-only "test/**/*.test.ts" --parallel'
},
types: "lib/index.d.ts"
};
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/cache.js
var require_cache = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/cache.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
var node_fs_1 = __require("node:fs"), node_path_1 = __require("node:path"), Cache = class _Cache extends Map {
static instance;
constructor() {
super(), this.set("@oclif/core", this.getOclifCoreMeta());
}
static getInstance() {
return _Cache.instance || (_Cache.instance = new _Cache()), _Cache.instance;
}
get(key) {
return super.get(key);
}
getOclifCoreMeta() {
try {
return { name: "@oclif/core", version: require_package().version };
} catch {
try {
return {
name: "@oclif/core",
version: JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(__dirname, "..", "package.json"), "utf8")).version
};
} catch {
return { name: "@oclif/core", version: "unknown" };
}
}
}
};
exports.default = Cache;
}
});
// ../../node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/lib/utils.js
var require_utils = __commonJS({
"../../node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/lib/utils.js"(exports) {
"use strict";
init_cjs_shims();
var regExpChars = /[|\\{}()[\]^$+*?.]/g, hasOwnProperty = Object.prototype.hasOwnProperty, hasOwn = function(obj, key) {
return hasOwnProperty.apply(obj, [key]);
};
exports.escapeRegExpChars = function(string) {
return string ? String(string).replace(regExpChars, "\\$&") : "";
};
var _ENCODE_HTML_RULES = {
"&": "&",
"<": "<",
">": ">",
'"': """,
"'": "'"
}, _MATCH_HTML = /[&<>'"]/g;
function encode_char(c) {
return _ENCODE_HTML_RULES[c] || c;
}
var escapeFuncStr = `var _ENCODE_HTML_RULES = {
"&": "&"
, "<": "<"
, ">": ">"
, '"': """
, "'": "'"
}
, _MATCH_HTML = /[&<>'"]/g;
function encode_char(c) {
return _ENCODE_HTML_RULES[c] || c;
};
`;
exports.escapeXML = function(markup) {
return markup == null ? "" : String(markup).replace(_MATCH_HTML, encode_char);
};
function escapeXMLToString() {
return Function.prototype.toString.call(this) + `;
` + escapeFuncStr;
}
try {
typeof Object.defineProperty == "function" ? Object.defineProperty(exports.escapeXML, "toString", { value: escapeXMLToString }) : exports.escapeXML.toString = escapeXMLToString;
} catch {
console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)");
}
exports.shallowCopy = function(to, from) {
if (from = from || {}, to != null)
for (var p in from)
hasOwn(from, p) && (p === "__proto__" || p === "constructor" || (to[p] = from[p]));
return to;
};
exports.shallowCopyFromList = function(to, from, list) {
if (list = list || [], from = from || {}, to != null)
for (var i = 0; i < list.length; i++) {
var p = list[i];
if (typeof from[p] < "u") {
if (!hasOwn(from, p) || p === "__proto__" || p === "constructor")
continue;
to[p] = from[p];
}
}
return to;
};
exports.cache = {
_data: {},
set: function(key, val) {
this._data[key] = val;
},
get: function(key) {
return this._data[key];
},
remove: function(key) {
delete this._data[key];
},
reset: function() {
this._data = {};
}
};
exports.hyphenToCamel = function(str) {
return str.replace(/-[a-z]/g, function(match) {
return match[1].toUpperCase();
});
};
exports.createNullProtoObjWherePossible = (function() {
return typeof Object.create == "function" ? function() {
return /* @__PURE__ */ Object.create(null);
} : { __proto__: null } instanceof Object ? function() {
return {};
} : function() {
return { __proto__: null };
};
})();
exports.hasOwnOnlyObject = function(obj) {
var o = exports.createNullProtoObjWherePossible();
for (var p in obj)
hasOwn(obj, p) && (o[p] = obj[p]);
return o;
};
}
});
// ../../node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/package.json
var require_package2 = __commonJS({
"../../node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/package.json"(exports, module) {
module.exports = {
name: "ejs",
description: "Embedded JavaScript templates",
keywords: [
"template",
"engine",
"ejs"
],
version: "3.1.10",
author: "Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)",
license: "Apache-2.0",
bin: {
ejs: "./bin/cli.js"
},
main: "./lib/ejs.js",
jsdelivr: "ejs.min.js",
unpkg: "ejs.min.js",
repository: {
type: "git",
url: "git://github.com/mde/ejs.git"
},
bugs: "https://github.com/mde/ejs/issues",
homepage: "https://github.com/mde/ejs",
dependencies: {
jake: "^10.8.5"
},
devDependencies: {
browserify: "^16.5.1",
eslint: "^6.8.0",
"git-directory-deploy": "^1.5.1",
jsdoc: "^4.0.2",
"lru-cache": "^4.0.1",
mocha: "^10.2.0",
"uglify-js": "^3.3.16"
},
engines: {
node: ">=0.10.0"
},
scripts: {
test: "npx jake test"
}
};
}
});
// ../../node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/lib/ejs.js
var require_ejs = __commonJS({
"../../node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/lib/ejs.js"(exports) {
"use strict";
init_cjs_shims();
var fs = __require("fs"), path = __require("path"), utils = require_utils(), scopeOptionWarned = !1, _VERSION_STRING = require_package2().version, _DEFAULT_OPEN_DELIMITER = "<", _DEFAULT_CLOSE_DELIMITER = ">", _DEFAULT_DELIMITER = "%", _DEFAULT_LOCALS_NAME = "locals", _NAME = "ejs", _REGEX_STRING = "(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)", _OPTS_PASSABLE_WITH_DATA = [
"delimiter",
"scope",
"context",
"debug",
"compileDebug",
"client",
"_with",
"rmWhitespace",
"strict",
"filename",
"async"
], _OPTS_PASSABLE_WITH_DATA_EXPRESS = _OPTS_PASSABLE_WITH_DATA.concat("cache"), _BOM = /^\uFEFF/, _JS_IDENTIFIER = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/;
exports.cache = utils.cache;
exports.fileLoader = fs.readFileSync;
exports.localsName = _DEFAULT_LOCALS_NAME;
exports.promiseImpl = new Function("return this;")().Promise;
exports.resolveInclude = function(name, filename, isDir) {
var dirname = path.dirname, extname = path.extname, resolve = path.resolve, includePath = resolve(isDir ? filename : dirname(filename), name), ext = extname(name);
return ext || (includePath += ".ejs"), includePath;
};
function resolvePaths(name, paths) {
var filePath;
if (paths.some(function(v) {
return filePath = exports.resolveInclude(name, v, !0), fs.existsSync(filePath);
}))
return filePath;
}
function getIncludePath(path2, options) {
var includePath, filePath, views = options.views, match = /^[A-Za-z]+:\\|^\//.exec(path2);
if (match && match.length)
path2 = path2.replace(/^\/*/, ""), Array.isArray(options.root) ? includePath = resolvePaths(path2, options.root) : includePath = exports.resolveInclude(path2, options.root || "/", !0);
else if (options.filename && (filePath = exports.resolveInclude(path2, options.filename), fs.existsSync(filePath) && (includePath = filePath)), !includePath && Array.isArray(views) && (includePath = resolvePaths(path2, views)), !includePath && typeof options.includer != "function")
throw new Error('Could not find the include file "' + options.escapeFunction(path2) + '"');
return includePath;
}
function handleCache(options, template) {
var func, filename = options.filename, hasTemplate = arguments.length > 1;
if (options.cache) {
if (!filename)
throw new Error("cache option requires a filename");
if (func = exports.cache.get(filename), func)
return func;
hasTemplate || (template = fileLoader(filename).toString().replace(_BOM, ""));
} else if (!hasTemplate) {
if (!filename)
throw new Error("Internal EJS error: no file name or template provided");
template = fileLoader(filename).toString().replace(_BOM, "");
}
return func = exports.compile(template, options), options.cache && exports.cache.set(filename, func), func;
}
function tryHandleCache(options, data, cb) {
var result;
if (cb) {
try {
result = handleCache(options)(data);
} catch (err) {
return cb(err);
}
cb(null, result);
} else {
if (typeof exports.promiseImpl == "function")
return new exports.promiseImpl(function(resolve, reject) {
try {
result = handleCache(options)(data), resolve(result);
} catch (err) {
reject(err);
}
});
throw new Error("Please provide a callback function");
}
}
function fileLoader(filePath) {
return exports.fileLoader(filePath);
}
function includeFile(path2, options) {
var opts = utils.shallowCopy(utils.createNullProtoObjWherePossible(), options);
if (opts.filename = getIncludePath(path2, opts), typeof options.includer == "function") {
var includerResult = options.includer(path2, opts.filename);
if (includerResult && (includerResult.filename && (opts.filename = includerResult.filename), includerResult.template))
return handleCache(opts, includerResult.template);
}
return handleCache(opts);
}
function rethrow(err, str, flnm, lineno, esc) {
var lines = str.split(`
`), start = Math.max(lineno - 3, 0), end = Math.min(lines.length, lineno + 3), filename = esc(flnm), context = lines.slice(start, end).map(function(line, i) {
var curr = i + start + 1;
return (curr == lineno ? " >> " : " ") + curr + "| " + line;
}).join(`
`);
throw err.path = filename, err.message = (filename || "ejs") + ":" + lineno + `
` + context + `
` + err.message, err;
}
function stripSemi(str) {
return str.replace(/;(\s*$)/, "$1");
}
exports.compile = function(template, opts) {
var templ;
return opts && opts.scope && (scopeOptionWarned || (console.warn("`scope` option is deprecated and will be removed in EJS 3"), scopeOptionWarned = !0), opts.context || (opts.context = opts.scope), delete opts.scope), templ = new Template(template, opts), templ.compile();
};
exports.render = function(template, d, o) {
var data = d || utils.createNullProtoObjWherePossible(), opts = o || utils.createNullProtoObjWherePossible();
return arguments.length == 2 && utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA), handleCache(opts, template)(data);
};
exports.renderFile = function() {
var args = Array.prototype.slice.call(arguments), filename = args.shift(), cb, opts = { filename }, data, viewOpts;
return typeof arguments[arguments.length - 1] == "function" && (cb = args.pop()), args.length ? (data = args.shift(), args.length ? utils.shallowCopy(opts, args.pop()) : (data.settings && (data.settings.views && (opts.views = data.settings.views), data.settings["view cache"] && (opts.cache = !0), viewOpts = data.settings["view options"], viewOpts && utils.shallowCopy(opts, viewOpts)), utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA_EXPRESS)), opts.filename = filename) : data = utils.createNullProtoObjWherePossible(), tryHandleCache(opts, data, cb);
};
exports.Template = Template;
exports.clearCache = function() {
exports.cache.reset();
};
function Template(text, optsParam) {
var opts = utils.hasOwnOnlyObject(optsParam), options = utils.createNullProtoObjWherePossible();
this.templateText = text, this.mode = null, this.truncate = !1, this.currentLine = 1, this.source = "", options.client = opts.client || !1, options.escapeFunction = opts.escape || opts.escapeFunction || utils.escapeXML, options.compileDebug = opts.compileDebug !== !1, options.debug = !!opts.debug, options.filename = opts.filename, options.openDelimiter = opts.openDelimiter || exports.openDelimiter || _DEFAULT_OPEN_DELIMITER, options.closeDelimiter = opts.closeDelimiter || exports.closeDelimiter || _DEFAULT_CLOSE_DELIMITER, options.delimiter = opts.delimiter || exports.delimiter || _DEFAULT_DELIMITER, options.strict = opts.strict || !1, options.context = opts.context, options.cache = opts.cache || !1, options.rmWhitespace = opts.rmWhitespace, options.root = opts.root, options.includer = opts.includer, options.outputFunctionName = opts.outputFunctionName, options.localsName = opts.localsName || exports.localsName || _DEFAULT_LOCALS_NAME, options.views = opts.views, options.async = opts.async, options.destructuredLocals = opts.destructuredLocals, options.legacyInclude = typeof opts.legacyInclude < "u" ? !!opts.legacyInclude : !0, options.strict ? options._with = !1 : options._with = typeof opts._with < "u" ? opts._with : !0, this.opts = options, this.regex = this.createRegex();
}
Template.modes = {
EVAL: "eval",
ESCAPED: "escaped",
RAW: "raw",
COMMENT: "comment",
LITERAL: "literal"
};
Template.prototype = {
createRegex: function() {
var str = _REGEX_STRING, delim = utils.escapeRegExpChars(this.opts.delimiter), open = utils.escapeRegExpChars(this.opts.openDelimiter), close = utils.escapeRegExpChars(this.opts.closeDelimiter);
return str = str.replace(/%/g, delim).replace(/</g, open).replace(/>/g, close), new RegExp(str);
},
compile: function() {
var src, fn, opts = this.opts, prepended = "", appended = "", escapeFn = opts.escapeFunction, ctor, sanitizedFilename = opts.filename ? JSON.stringify(opts.filename) : "undefined";
if (!this.source) {
if (this.generateSource(), prepended += ` var __output = "";
function __append(s) { if (s !== undefined && s !== null) __output += s }
`, opts.outputFunctionName) {
if (!_JS_IDENTIFIER.test(opts.outputFunctionName))
throw new Error("outputFunctionName is not a valid JS identifier.");
prepended += " var " + opts.outputFunctionName + ` = __append;
`;
}
if (opts.localsName && !_JS_IDENTIFIER.test(opts.localsName))
throw new Error("localsName is not a valid JS identifier.");
if (opts.destructuredLocals && opts.destructuredLocals.length) {
for (var destructuring = " var __locals = (" + opts.localsName + ` || {}),
`, i = 0; i < opts.destructuredLocals.length; i++) {
var name = opts.destructuredLocals[i];
if (!_JS_IDENTIFIER.test(name))
throw new Error("destructuredLocals[" + i + "] is not a valid JS identifier.");
i > 0 && (destructuring += `,
`), destructuring += name + " = __locals." + name;
}
prepended += destructuring + `;
`;
}
opts._with !== !1 && (prepended += " with (" + opts.localsName + ` || {}) {
`, appended += ` }
`), appended += ` return __output;
`, this.source = prepended + this.source + appended;
}
opts.compileDebug ? src = `var __line = 1
, __lines = ` + JSON.stringify(this.templateText) + `
, __filename = ` + sanitizedFilename + `;
try {
` + this.source + `} catch (e) {
rethrow(e, __lines, __filename, __line, escapeFn);
}
` : src = this.source, opts.client && (src = "escapeFn = escapeFn || " + escapeFn.toString() + `;
` + src, opts.compileDebug && (src = "rethrow = rethrow || " + rethrow.toString() + `;
` + src)), opts.strict && (src = `"use strict";
` + src), opts.debug && console.log(src), opts.compileDebug && opts.filename && (src = src + `
//# sourceURL=` + sanitizedFilename + `
`);
try {
if (opts.async)
try {
ctor = new Function("return (async function(){}).constructor;")();
} catch (e) {
throw e instanceof SyntaxError ? new Error("This environment does not support async/await") : e;
}
else
ctor = Function;
fn = new ctor(opts.localsName + ", escapeFn, include, rethrow", src);
} catch (e) {
throw e instanceof SyntaxError && (opts.filename && (e.message += " in " + opts.filename), e.message += ` while compiling ejs
`, e.message += `If the above error is not helpful, you may want to try EJS-Lint:
`, e.message += "https://github.com/RyanZim/EJS-Lint", opts.async || (e.message += `
`, e.message += "Or, if you meant to create an async function, pass `async: true` as an option.")), e;
}
var returnedFn = opts.client ? fn : function(data) {
var include = function(path2, includeData) {
var d = utils.shallowCopy(utils.createNullProtoObjWherePossible(), data);
return includeData && (d = utils.shallowCopy(d, includeData)), includeFile(path2, opts)(d);
};
return fn.apply(
opts.context,
[data || utils.createNullProtoObjWherePossible(), escapeFn, include, rethrow]
);
};
if (opts.filename && typeof Object.defineProperty == "function") {
var filename = opts.filename, basename = path.basename(filename, path.extname(filename));
try {
Object.defineProperty(returnedFn, "name", {
value: basename,
writable: !1,
enumerable: !1,
configurable: !0
});
} catch {
}
}
return returnedFn;
},
generateSource: function() {
var opts = this.opts;
opts.rmWhitespace && (this.templateText = this.templateText.replace(/[\r\n]+/g, `
`).replace(/^\s+|\s+$/gm, "")), this.templateText = this.templateText.replace(/[ \t]*<%_/gm, "<%_").replace(/_%>[ \t]*/gm, "_%>");
var self = this, matches = this.parseTemplateText(), d = this.opts.delimiter, o = this.opts.openDelimiter, c = this.opts.closeDelimiter;
matches && matches.length && matches.forEach(function(line, index) {
var closing;
if (line.indexOf(o + d) === 0 && line.indexOf(o + d + d) !== 0 && (closing = matches[index + 2], !(closing == d + c || closing == "-" + d + c || closing == "_" + d + c)))
throw new Error('Could not find matching close tag for "' + line + '".');
self.scanLine(line);
});
},
parseTemplateText: function() {
for (var str = this.templateText, pat = this.regex, result = pat.exec(str), arr = [], firstPos; result; )
firstPos = result.index, firstPos !== 0 && (arr.push(str.substring(0, firstPos)), str = str.slice(firstPos)), arr.push(result[0]), str = str.slice(result[0].length), result = pat.exec(str);
return str && arr.push(str), arr;
},
_addOutput: function(line) {
if (this.truncate && (line = line.replace(/^(?:\r\n|\r|\n)/, ""), this.truncate = !1), !line)
return line;
line = line.replace(/\\/g, "\\\\"), line = line.replace(/\n/g, "\\n"), line = line.replace(/\r/g, "\\r"), line = line.replace(/"/g, '\\"'), this.source += ' ; __append("' + line + `")
`;
},
scanLine: function(line) {
var self = this, d = this.opts.delimiter, o = this.opts.openDelimiter, c = this.opts.closeDelimiter, newLineCount = 0;
switch (newLineCount = line.split(`
`).length - 1, line) {
case o + d:
case o + d + "_":
this.mode = Template.modes.EVAL;
break;
case o + d + "=":
this.mode = Template.modes.ESCAPED;
break;
case o + d + "-":
this.mode = Template.modes.RAW;
break;
case o + d + "#":
this.mode = Template.modes.COMMENT;
break;
case o + d + d:
this.mode = Template.modes.LITERAL, this.source += ' ; __append("' + line.replace(o + d + d, o + d) + `")
`;
break;
case d + d + c:
this.mode = Template.modes.LITERAL, this.source += ' ; __append("' + line.replace(d + d + c, d + c) + `")
`;
break;
case d + c:
case "-" + d + c:
case "_" + d + c:
this.mode == Template.modes.LITERAL && this._addOutput(line), this.mode = null, this.truncate = line.indexOf("-") === 0 || line.indexOf("_") === 0;
break;
default:
if (this.mode) {
switch (this.mode) {
case Template.modes.EVAL:
case Template.modes.ESCAPED:
case Template.modes.RAW:
line.lastIndexOf("//") > line.lastIndexOf(`
`) && (line += `
`);
}
switch (this.mode) {
// Just executing code
case Template.modes.EVAL:
this.source += " ; " + line + `
`;
break;
// Exec, esc, and output
case Template.modes.ESCAPED:
this.source += " ; __append(escapeFn(" + stripSemi(line) + `))
`;
break;
// Exec and output
case Template.modes.RAW:
this.source += " ; __append(" + stripSemi(line) + `)
`;
break;
case Template.modes.COMMENT:
break;
// Literal <%% mode, append as raw output
case Template.modes.LITERAL:
this._addOutput(line);
break;
}
} else
this._addOutput(line);
}
self.opts.compileDebug && newLineCount && (this.currentLine += newLineCount, this.source += " ; __line = " + this.currentLine + `
`);
}
};
exports.escapeXML = utils.escapeXML;
exports.__express = exports.renderFile;
exports.VERSION = _VERSION_STRING;
exports.name = _NAME;
typeof window < "u" && (window.ejs = exports);
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/logger.js
var require_logger = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/logger.js"(exports) {
"use strict";
init_cjs_shims();
var __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.getLogger = getLogger;
exports.makeDebug = makeDebug;
exports.setLogger = setLogger;
exports.clearLoggers = clearLoggers;
var debug_1 = __importDefault(require_src()), OCLIF_NS = "oclif";
function makeLogger(namespace = OCLIF_NS) {
let debug = (0, debug_1.default)(namespace);
return {
child: (ns, delimiter) => makeLogger(`${namespace}${delimiter ?? ":"}${ns}`),
debug,
error: (formatter, ...args) => makeLogger(`${namespace}:error`).debug(formatter, ...args),
info: debug,
namespace,
trace: debug,
warn: debug
};
}
var cachedLoggers = /* @__PURE__ */ new Map();
function getLogger(namespace) {
let rootLogger = cachedLoggers.get("root");
if (rootLogger || set(makeLogger(OCLIF_NS)), rootLogger = cachedLoggers.get("root"), namespace) {
let cachedLogger = cachedLoggers.get(namespace);
if (cachedLogger)
return cachedLogger;
let logger = rootLogger.child(namespace);
return cachedLoggers.set(namespace, logger), logger;
}
return rootLogger;
}
function ensureItMatchesInterface(newLogger) {
return typeof newLogger.child == "function" && typeof newLogger.debug == "function" && typeof newLogger.error == "function" && typeof newLogger.info == "function" && typeof newLogger.trace == "function" && typeof newLogger.warn == "function" && typeof newLogger.namespace == "string";
}
function set(newLogger) {
cachedLoggers.has(newLogger.namespace) || cachedLoggers.has("root") || (ensureItMatchesInterface(newLogger) ? (cachedLoggers.set(newLogger.namespace, newLogger), cachedLoggers.set("root", newLogger)) : process.emitWarning("Logger does not match the Logger interface. Using default logger."));
}
function makeDebug(namespace) {
return (formatter, ...args) => getLogger(namespace).debug(formatter, ...args);
}
function setLogger(loadOptions) {
loadOptions && typeof loadOptions != "string" && "logger" in loadOptions && loadOptions.logger ? set(loadOptions.logger) : set(makeLogger(OCLIF_NS));
}
function clearLoggers() {
cachedLoggers.clear();
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/ux/write.js
var require_write = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/ux/write.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.stderr = exports.stdout = void 0;
var node_util_1 = __require("node:util"), stdout = (str, ...args) => {
!str && args ? console.log((0, node_util_1.format)(...args)) : str ? console.log(typeof str == "string" ? (0, node_util_1.format)(str, ...args) : (0, node_util_1.format)(...str, ...args)) : console.log();
};
exports.stdout = stdout;
var stderr = (str, ...args) => {
!str && args ? console.error((0, node_util_1.format)(...args)) : str ? console.error(typeof str == "string" ? (0, node_util_1.format)(str, ...args) : (0, node_util_1.format)(...str, ...args)) : console.error();
};
exports.stderr = stderr;
}
});
// ../../node_modules/.pnpm/escape-string-regexp@4.0.0/node_modules/escape-string-regexp/index.js
var require_escape_string_regexp = __commonJS({
"../../node_modules/.pnpm/escape-string-regexp@4.0.0/node_modules/escape-string-regexp/index.js"(exports, module) {
"use strict";
init_cjs_shims();
module.exports = (string) => {
if (typeof string != "string")
throw new TypeError("Expected a string");
return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
};
}
});
// ../../node_modules/.pnpm/clean-stack@3.0.1/node_modules/clean-stack/index.js
var require_clean_stack = __commonJS({
"../../node_modules/.pnpm/clean-stack@3.0.1/node_modules/clean-stack/index.js"(exports, module) {
"use strict";
init_cjs_shims();
var os = __require("os"), escapeStringRegexp = require_escape_string_regexp(), extractPathRegex = /\s+at.*[(\s](.*)\)?/, pathRegex = /^(?:(?:(?:node|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/, homeDir = typeof os.homedir > "u" ? "" : os.homedir();
module.exports = (stack, { pretty = !1, basePath } = {}) => {
let basePathRegex = basePath && new RegExp(`(at | \\()${escapeStringRegexp(basePath)}`, "g");
return stack.replace(/\\/g, "/").split(`
`).filter((line) => {
let pathMatches = line.match(extractPathRegex);
if (pathMatches === null || !pathMatches[1])
return !0;
let match = pathMatches[1];
return match.includes(".app/Contents/Resources/electron.asar") || match.includes(".app/Contents/Resources/default_app.asar") ? !1 : !pathRegex.test(match);
}).filter((line) => line.trim() !== "").map((line) => (basePathRegex && (line = line.replace(basePathRegex, "$1")), pretty && (line = line.replace(extractPathRegex, (m, p1) => m.replace(p1, p1.replace(homeDir, "~")))), line)).join(`
`);
};
}
});
// ../../node_modules/.pnpm/indent-string@4.0.0/node_modules/indent-string/index.js
var require_indent_string = __commonJS({
"../../node_modules/.pnpm/indent-string@4.0.0/node_modules/indent-string/index.js"(exports, module) {
"use strict";
init_cjs_shims();
module.exports = (string, count = 1, options) => {
if (options = {
indent: " ",
includeEmptyLines: !1,
...options
}, typeof string != "string")
throw new TypeError(
`Expected \`input\` to be a \`string\`, got \`${typeof string}\``
);
if (typeof count != "number")
throw new TypeError(
`Expected \`count\` to be a \`number\`, got \`${typeof count}\``
);
if (typeof options.indent != "string")
throw new TypeError(
`Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\``
);
if (count === 0)
return string;
let regex = options.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm;
return string.replace(regex, options.indent.repeat(count));
};
}
});
// ../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js
var require_ansi_regex = __commonJS({
"../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js"(exports, module) {
"use strict";
init_cjs_shims();
module.exports = ({ onlyFirst = !1 } = {}) => {
let pattern = [
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
].join("|");
return new RegExp(pattern, onlyFirst ? void 0 : "g");
};
}
});
// ../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js
var require_strip_ansi = __commonJS({
"../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js"(exports, module) {
"use strict";
init_cjs_shims();
var ansiRegex = require_ansi_regex();
module.exports = (string) => typeof string == "string" ? string.replace(ansiRegex(), "") : string;
}
});
// ../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js
var require_is_fullwidth_code_point = __commonJS({
"../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js"(exports, module) {
"use strict";
init_cjs_shims();
var isFullwidthCodePoint = (codePoint) => Number.isNaN(codePoint) ? !1 : codePoint >= 4352 && (codePoint <= 4447 || // Hangul Jamo
codePoint === 9001 || // LEFT-POINTING ANGLE BRACKET
codePoint === 9002 || // RIGHT-POINTING ANGLE BRACKET
// CJK Radicals Supplement .. Enclosed CJK Letters and Months
11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
12880 <= codePoint && codePoint <= 19903 || // CJK Unified Ideographs .. Yi Radicals
19968 <= codePoint && codePoint <= 42182 || // Hangul Jamo Extended-A
43360 <= codePoint && codePoint <= 43388 || // Hangul Syllables
44032 <= codePoint && codePoint <= 55203 || // CJK Compatibility Ideographs
63744 <= codePoint && codePoint <= 64255 || // Vertical Forms
65040 <= codePoint && codePoint <= 65049 || // CJK Compatibility Forms .. Small Form Variants
65072 <= codePoint && codePoint <= 65131 || // Halfwidth and Fullwidth Forms
65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || // Kana Supplement
110592 <= codePoint && codePoint <= 110593 || // Enclosed Ideographic Supplement
127488 <= codePoint && codePoint <= 127569 || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
131072 <= codePoint && codePoint <= 262141);
module.exports = isFullwidthCodePoint;
module.exports.default = isFullwidthCodePoint;
}
});
// ../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js
var require_emoji_regex = __commonJS({
"../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js"(exports, module) {
"use strict";
init_cjs_shims();
module.exports = function() {
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
};
}
});
// ../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js
var require_string_width = __commonJS({
"../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js"(exports, module) {
"use strict";
init_cjs_shims();
var stripAnsi = require_strip_ansi(), isFullwidthCodePoint = require_is_fullwidth_code_point(), emojiRegex = require_emoji_regex(), stringWidth = (string) => {
if (typeof string != "string" || string.length === 0 || (string = stripAnsi(string), string.length === 0))
return 0;
string = string.replace(emojiRegex(), " ");
let width = 0;
for (let i = 0; i < string.length; i++) {
let code = string.codePointAt(i);
code <= 31 || code >= 127 && code <= 159 || code >= 768 && code <= 879 || (code > 65535 && i++, width += isFullwidthCodePoint(code) ? 2 : 1);
}
return width;
};
module.exports = stringWidth;
module.exports.default = stringWidth;
}
});
// ../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js
var require_color_name = __commonJS({
"../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js"(exports, module) {
"use strict";
init_cjs_shims();
module.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/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js
var require_conversions = __commonJS({
"../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"(exports, module) {
init_cjs_shims();
var cssKeywords = require_color_name(), reverseKeywords = {};
for (let 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"] }
};
module.exports = convert;
for (let 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);
let { 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) {
let r = rgb[0] / 255, g = rgb[1] / 255, b = rgb[2] / 255, min = Math.min(r, g, b), max = Math.max(r, g, b), delta = max - min, h, s;
max === min ? h = 0 : r === max ? h = (g - b) / delta : g === max ? h = 2 + (b - r) / delta : b === max && (h = 4 + (r - g) / delta), h = Math.min(h * 60, 360), h < 0 && (h += 360);
let l = (min + max) / 2;
return max === min ? s = 0 : l <= 0.5 ? s = delta / (max + min) : s = delta / (2 - max - min), [h, s * 100, l * 100];
};
convert.rgb.hsv = function(rgb) {
let rdif, gdif, bdif, h, s, r = rgb[0] / 255, g = rgb[1] / 255, b = rgb[2] / 255, v = Math.max(r, g, b), diff = v - Math.min(r, g, b), diffc = function(c) {
return (v - c) / 6 / diff + 1 / 2;
};
return diff === 0 ? (h = 0, s = 0) : (s = diff / v, rdif = diffc(r), gdif = diffc(g), bdif = diffc(b), r === v ? h = bdif - gdif : g === v ? h = 1 / 3 + rdif - bdif : b === v && (h = 2 / 3 + gdif - rdif), h < 0 ? h += 1 : h > 1 && (h -= 1)), [
h * 360,
s * 100,
v * 100
];
};
convert.rgb.hwb = function(rgb) {
let r = rgb[0], g = rgb[1], b = rgb[2], h = convert.rgb.hsl(rgb)[0], w = 1 / 255 * Math.min(r, Math.min(g, b));
return b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)), [h, w * 100, b * 100];
};
convert.rgb.cmyk = function(rgb) {
let r = rgb[0] / 255, g = rgb[1] / 255, b = rgb[2] / 255, 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 (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
}
convert.rgb.keyword = function(rgb) {
let reversed = reverseKeywords[rgb];
if (reversed)
return reversed;
let currentClosestDistance = 1 / 0, currentClosestKeyword;
for (let keyword of Object.keys(cssKeywords)) {
let value = cssKeywords[keyword], distance = comparativeDistance(rgb, value);
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, g = rgb[1] / 255, 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;
let x = r * 0.4124 + g * 0.3576 + b * 0.1805, y = r * 0.2126 + g * 0.7152 + b * 0.0722, z = r * 0.0193 + g * 0.1192 + b * 0.9505;
return [x * 100, y * 100, z * 100];
};
convert.rgb.lab = function(rgb) {
let xyz = convert.rgb.xyz(rgb), x = xyz[0], y = xyz[1], 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;
let l = 116 * y - 16, a = 500 * (x - y), b = 200 * (y - z);
return [l, a, b];
};
convert.hsl.rgb = function(hsl) {
let h = hsl[0] / 360, s = hsl[1] / 100, l = hsl[2] / 100, t2, t3, val;
if (s === 0)
return val = l * 255, [val, val, val];
l < 0.5 ? t2 = l * (1 + s) : t2 = l + s - l * s;
let t1 = 2 * l - t2, rgb = [0, 0, 0];
for (let i = 0; i < 3; i++)
t3 = h + 1 / 3 * -(i - 1), t3 < 0 && t3++, t3 > 1 && t3--, 6 * t3 < 1 ? val = t1 + (t2 - t1) * 6 * t3 : 2 * t3 < 1 ? val = t2 : 3 * t3 < 2 ? val = t1 + (t2 - t1) * (2 / 3 - t3) * 6 : val = t1, rgb[i] = val * 255;
return rgb;
};
convert.hsl.hsv = function(hsl) {
let h = hsl[0], s = hsl[1] / 100, l = hsl[2] / 100, smin = s, lmin = Math.max(l, 0.01);
l *= 2, s *= l <= 1 ? l : 2 - l, smin *= lmin <= 1 ? lmin : 2 - lmin;
let 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) {
let h = hsv[0] / 60, s = hsv[1] / 100, v = hsv[2] / 100, hi = Math.floor(h) % 6, f = h - Math.floor(h), p = 255 * v * (1 - s), q = 255 * v * (1 - s * f), t = 255 * v * (1 - s * (1 - f));
switch (v *= 255, 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) {
let h = hsv[0], s = hsv[1] / 100, v = hsv[2] / 100, vmin = Math.max(v, 0.01), sl, l;
l = (2 - s) * v;
let lmin = (2 - s) * vmin;
return sl = s * vmin, sl /= lmin <= 1 ? lmin : 2 - lmin, sl = sl || 0, l /= 2, [h, sl * 100, l * 100];
};
convert.hwb.rgb = function(hwb) {
let h = hwb[0] / 360, wh = hwb[1] / 100, bl = hwb[2] / 100, ratio = wh + bl, f;
ratio > 1 && (wh /= ratio, bl /= ratio);
let i = Math.floor(6 * h), v = 1 - bl;
f = 6 * h - i, (i & 1) !== 0 && (f = 1 - f);
let n = wh + f * (v - wh), r, g, 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) {
let c = cmyk[0] / 100, m = cmyk[1] / 100, y = cmyk[2] / 100, k = cmyk[3] / 100, 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) {
let x = xyz[0] / 100, y = xyz[1] / 100, z = xyz[2] / 100, r, g, b;
return 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), [r * 255, g * 255, b * 255];
};
convert.xyz.lab = function(xyz) {
let x = xyz[0], y = xyz[1], 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;
let l = 116 * y - 16, a = 500 * (x - y), b = 200 * (y - z);
return [l, a, b];
};
convert.lab.xyz = function(lab) {
let l = lab[0], a = lab[1], b = lab[2], x, y, z;
y = (l + 16) / 116, x = a / 500 + y, z = y - b / 200;
let y2 = y ** 3, x2 = x ** 3, z2 = z ** 3;
return 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, [x, y, z];
};
convert.lab.lch = function(lab) {
let l = lab[0], a = lab[1], b = lab[2], h;
h = Math.atan2(b, a) * 360 / 2 / Math.PI, h < 0 && (h += 360);
let c = Math.sqrt(a * a + b * b);
return [l, c, h];
};
convert.lch.lab = function(lch) {
let l = lch[0], c = lch[1], hr = lch[2] / 360 * 2 * Math.PI, a = c * Math.cos(hr), b = c * Math.sin(hr);
return [l, a, b];
};
convert.rgb.ansi16 = function(args, saturation = null) {
let [r, g, b] = args, value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
if (value = Math.round(value / 50), value === 0)
return 30;
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
return value === 2 && (ansi += 60), ansi;
};
convert.hsv.ansi16 = function(args) {
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
};
convert.rgb.ansi256 = function(args) {
let r = args[0], g = args[1], b = args[2];
return r === g && g === b ? r < 8 ? 16 : r > 248 ? 231 : Math.round((r - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
};
convert.ansi16.rgb = function(args) {
let color = args % 10;
if (color === 0 || color === 7)
return args > 50 && (color += 3.5), color = color / 10.5 * 255, [color, color, color];
let mult = (~~(args > 50) + 1) * 0.5, r = (color & 1) * mult * 255, g = (color >> 1 & 1) * mult * 255, b = (color >> 2 & 1) * mult * 255;
return [r, g, b];
};
convert.ansi256.rgb = function(args) {
if (args >= 232) {
let c = (args - 232) * 10 + 8;
return [c, c, c];
}
args -= 16;
let rem, r = Math.floor(args / 36) / 5 * 255, g = Math.floor((rem = args % 36) / 6) / 5 * 255, b = rem % 6 / 5 * 255;
return [r, g, b];
};
convert.rgb.hex = function(args) {
let string = (((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255)).toString(16).toUpperCase();
return "000000".substring(string.length) + string;
};
convert.hex.rgb = function(args) {
let match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
if (!match)
return [0, 0, 0];
let colorString = match[0];
match[0].length === 3 && (colorString = colorString.split("").map((char) => char + char).join(""));
let integer = parseInt(colorString, 16), r = integer >> 16 & 255, g = integer >> 8 & 255, b = integer & 255;
return [r, g, b];
};
convert.rgb.hcg = function(rgb) {
let r = rgb[0] / 255, g = rgb[1] / 255, b = rgb[2] / 255, max = Math.max(Math.max(r, g), b), min = Math.min(Math.min(r, g), b), chroma = max - min, grayscale, hue;
return chroma < 1 ? grayscale = min / (1 - chroma) : grayscale = 0, chroma <= 0 ? hue = 0 : max === r ? hue = (g - b) / chroma % 6 : max === g ? hue = 2 + (b - r) / chroma : hue = 4 + (r - g) / chroma, hue /= 6, hue %= 1, [hue * 360, chroma * 100, grayscale * 100];
};
convert.hsl.hcg = function(hsl) {
let s = hsl[1] / 100, l = hsl[2] / 100, c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l), f = 0;
return c < 1 && (f = (l - 0.5 * c) / (1 - c)), [hsl[0], c * 100, f * 100];
};
convert.hsv.hcg = function(hsv) {
let s = hsv[1] / 100, v = hsv[2] / 100, c = s * v, f = 0;
return c < 1 && (f = (v - c) / (1 - c)), [hsv[0], c * 100, f * 100];
};
convert.hcg.rgb = function(hcg) {
let h = hcg[0] / 360, c = hcg[1] / 100, g = hcg[2] / 100;
if (c === 0)
return [g * 255, g * 255, g * 255];
let pure = [0, 0, 0], hi = h % 1 * 6, v = hi % 1, w = 1 - v, 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 mg = (1 - c) * g, [
(c * pure[0] + mg) * 255,
(c * pure[1] + mg) * 255,
(c * pure[2] + mg) * 255
];
};
convert.hcg.hsv = function(hcg) {
let c = hcg[1] / 100, g = hcg[2] / 100, v = c + g * (1 - c), f = 0;
return v > 0 && (f = c / v), [hcg[0], f * 100, v * 100];
};
convert.hcg.hsl = function(hcg) {
let c = hcg[1] / 100, l = hcg[2] / 100 * (1 - c) + 0.5 * c, s = 0;
return l > 0 && l < 0.5 ? s = c / (2 * l) : l >= 0.5 && l < 1 && (s = c / (2 * (1 - l))), [hcg[0], s * 100, l * 100];
};
convert.hcg.hwb = function(hcg) {
let c = hcg[1] / 100, g = hcg[2] / 100, v = c + g * (1 - c);
return [hcg[0], (v - c) * 100, (1 - v) * 100];
};
convert.hwb.hcg = function(hwb) {
let w = hwb[1] / 100, v = 1 - hwb[2] / 100, c = v - w, g = 0;
return c < 1 && (g = (v - c) / (1 - c)), [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) {
let val = Math.round(gray[0] / 100 * 255) & 255, string = ((val << 16) + (val << 8) + val).toString(16).toUpperCase();
return "000000".substring(string.length) + string;
};
convert.rgb.gray = function(rgb) {
return [(rgb[0] + rgb[1] + rgb[2]) / 3 / 255 * 100];
};
}
});
// ../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js
var require_route = __commonJS({
"../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"(exports, module) {
init_cjs_shims();
var conversions = require_conversions();
function buildGraph() {
let graph = {}, 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) {
let graph = buildGraph(), queue = [fromModel];
for (graph[fromModel].distance = 0; queue.length; ) {
let current = queue.pop(), adjacents = Object.keys(conversions[current]);
for (let len = adjacents.length, i = 0; i < len; i++) {
let adjacent = adjacents[i], node = graph[adjacent];
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) {
let path = [graph[toModel].parent, toModel], fn = conversions[graph[toModel].parent][toModel], cur = graph[toModel].parent;
for (; graph[cur].parent; )
path.unshift(graph[cur].parent), fn = link(conversions[graph[cur].parent][cur], fn), cur = graph[cur].parent;
return fn.conversion = path, fn;
}
module.exports = function(fromModel) {
let graph = deriveBFS(fromModel), conversion = {}, models = Object.keys(graph);
for (let len = models.length, i = 0; i < len; i++) {
let toModel = models[i];
graph[toModel].parent !== null && (conversion[toModel] = wrapConversion(toModel, graph));
}
return conversion;
};
}
});
// ../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js
var require_color_convert = __commonJS({
"../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js"(exports, module) {
init_cjs_shims();
var conversions = require_conversions(), route = require_route(), convert = {}, models = Object.keys(conversions);
function wrapRaw(fn) {
let wrappedFn = function(...args) {
let arg0 = args[0];
return arg0 == null ? arg0 : (arg0.length > 1 && (args = arg0), fn(args));
};
return "conversion" in fn && (wrappedFn.conversion = fn.conversion), wrappedFn;
}
function wrapRounded(fn) {
let wrappedFn = function(...args) {
let arg0 = args[0];
if (arg0 == null)
return arg0;
arg0.length > 1 && (args = arg0);
let 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;
};
return "conversion" in fn && (wrappedFn.conversion = fn.conversion), wrappedFn;
}
models.forEach((fromModel) => {
convert[fromModel] = {}, Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels }), Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
let routes = route(fromModel);
Object.keys(routes).forEach((toModel) => {
let fn = routes[toModel];
convert[fromModel][toModel] = wrapRounded(fn), convert[fromModel][toModel].raw = wrapRaw(fn);
});
});
module.exports = convert;
}
});
// ../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js
var require_ansi_styles = __commonJS({
"../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js"(exports, module) {
"use strict";
init_cjs_shims();
var wrapAnsi16 = (fn, offset) => (...args) => `\x1B[${fn(...args) + offset}m`, wrapAnsi256 = (fn, offset) => (...args) => {
let code = fn(...args);
return `\x1B[${38 + offset};5;${code}m`;
}, wrapAnsi16m = (fn, offset) => (...args) => {
let rgb = fn(...args);
return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
}, ansi2ansi = (n) => n, rgb2rgb = (r, g, b) => [r, g, b], setLazyProperty = (object, property, get) => {
Object.defineProperty(object, property, {
get: () => {
let value = get();
return Object.defineProperty(object, property, {
value,
enumerable: !0,
configurable: !0
}), value;
},
enumerable: !0,
configurable: !0
});
}, colorConvert, makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
colorConvert === void 0 && (colorConvert = require_color_convert());
let offset = isBackground ? 10 : 0, styles = {};
for (let [sourceSpace, suite] of Object.entries(colorConvert)) {
let name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
sourceSpace === targetSpace ? styles[name] = wrap(identity, offset) : typeof suite == "object" && (styles[name] = wrap(suite[targetSpace], offset));
}
return styles;
};
function assembleStyles() {
let codes = /* @__PURE__ */ new Map(), 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 (let [groupName, group] of Object.entries(styles)) {
for (let [styleName, style] of Object.entries(group))
styles[styleName] = {
open: `\x1B[${style[0]}m`,
close: `\x1B[${style[1]}m`
}, group[styleName] = styles[styleName], codes.set(style[0], style[1]);
Object.defineProperty(styles, groupName, {
value: group,
enumerable: !1
});
}
return Object.defineProperty(styles, "codes", {
value: codes,
enumerable: !1
}), styles.color.close = "\x1B[39m", styles.bgColor.close = "\x1B[49m", setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, !1)), setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, !1)), setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, !1)), setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, !0)), setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, !0)), setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, !0)), styles;
}
Object.defineProperty(module, "exports", {
enumerable: !0,
get: assembleStyles
});
}
});
// ../../node_modules/.pnpm/wrap-ansi@7.0.0/node_modules/wrap-ansi/index.js
var require_wrap_ansi = __commonJS({
"../../node_modules/.pnpm/wrap-ansi@7.0.0/node_modules/wrap-ansi/index.js"(exports, module) {
"use strict";
init_cjs_shims();
var stringWidth = require_string_width(), stripAnsi = require_strip_ansi(), ansiStyles = require_ansi_styles(), ESCAPES = /* @__PURE__ */ new Set([
"\x1B",
"\x9B"
]), END_CODE = 39, ANSI_ESCAPE_BELL = "\x07", ANSI_CSI = "[", ANSI_OSC = "]", ANSI_SGR_TERMINATOR = "m", ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`, wrapAnsi = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`, wrapAnsiHyperlink = (uri) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`, wordLengths = (string) => string.split(" ").map((character) => stringWidth(character)), wrapWord = (rows, word, columns) => {
let characters = [...word], isInsideEscape = !1, isInsideLinkEscape = !1, visible = stringWidth(stripAnsi(rows[rows.length - 1]));
for (let [index, character] of characters.entries()) {
let characterLength = stringWidth(character);
if (visible + characterLength <= columns ? rows[rows.length - 1] += character : (rows.push(character), visible = 0), ESCAPES.has(character) && (isInsideEscape = !0, isInsideLinkEscape = characters.slice(index + 1).join("").startsWith(ANSI_ESCAPE_LINK)), isInsideEscape) {
isInsideLinkEscape ? character === ANSI_ESCAPE_BELL && (isInsideEscape = !1, isInsideLinkEscape = !1) : character === ANSI_SGR_TERMINATOR && (isInsideEscape = !1);
continue;
}
visible += characterLength, visible === columns && index < characters.length - 1 && (rows.push(""), visible = 0);
}
!visible && rows[rows.length - 1].length > 0 && rows.length > 1 && (rows[rows.length - 2] += rows.pop());
}, stringVisibleTrimSpacesRight = (string) => {
let words = string.split(" "), last = words.length;
for (; last > 0 && !(stringWidth(words[last - 1]) > 0); )
last--;
return last === words.length ? string : words.slice(0, last).join(" ") + words.slice(last).join("");
}, exec = (string, columns, options = {}) => {
if (options.trim !== !1 && string.trim() === "")
return "";
let returnValue = "", escapeCode, escapeUrl, lengths = wordLengths(string), rows = [""];
for (let [index, word] of string.split(" ").entries()) {
options.trim !== !1 && (rows[rows.length - 1] = rows[rows.length - 1].trimStart());
let rowLength = stringWidth(rows[rows.length - 1]);
if (index !== 0 && (rowLength >= columns && (options.wordWrap === !1 || options.trim === !1) && (rows.push(""), rowLength = 0), (rowLength > 0 || options.trim === !1) && (rows[rows.length - 1] += " ", rowLength++)), options.hard && lengths[index] > columns) {
let remainingColumns = columns - rowLength, breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
Math.floor((lengths[index] - 1) / columns) < breaksStartingThisLine && rows.push(""), wrapWord(rows, word, columns);
continue;
}
if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
if (options.wordWrap === !1 && rowLength < columns) {
wrapWord(rows, word, columns);
continue;
}
rows.push("");
}
if (rowLength + lengths[index] > columns && options.wordWrap === !1) {
wrapWord(rows, word, columns);
continue;
}
rows[rows.length - 1] += word;
}
options.trim !== !1 && (rows = rows.map(stringVisibleTrimSpacesRight));
let pre = [...rows.join(`
`)];
for (let [index, character] of pre.entries()) {
if (returnValue += character, ESCAPES.has(character)) {
let { groups } = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join("")) || { groups: {} };
if (groups.code !== void 0) {
let code2 = Number.parseFloat(groups.code);
escapeCode = code2 === END_CODE ? void 0 : code2;
} else groups.uri !== void 0 && (escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri);
}
let code = ansiStyles.codes.get(Number(escapeCode));
pre[index + 1] === `
` ? (escapeUrl && (returnValue += wrapAnsiHyperlink("")), escapeCode && code && (returnValue += wrapAnsi(code))) : character === `
` && (escapeCode && code && (returnValue += wrapAnsi(escapeCode)), escapeUrl && (returnValue += wrapAnsiHyperlink(escapeUrl)));
}
return returnValue;
};
module.exports = (string, columns, options) => String(string).normalize().replace(/\r\n/g, `
`).split(`
`).map((line) => exec(line, columns, options)).join(`
`);
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/settings.js
var require_settings = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/settings.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.settings = void 0;
globalThis.oclif || (globalThis.oclif = {});
exports.settings = globalThis.oclif;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/screen.js
var require_screen = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/screen.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.errtermwidth = exports.stdtermwidth = void 0;
var settings_1 = require_settings();
function termwidth(stream) {
if (!stream.isTTY)
return 80;
let width = stream.getWindowSize()[0];
return width < 1 ? 80 : width < 40 ? 40 : width;
}
var columns = Number.parseInt(process.env.OCLIF_COLUMNS, 10) || settings_1.settings.columns;
exports.stdtermwidth = columns || termwidth(process.stdout);
exports.errtermwidth = columns || termwidth(process.stderr);
}
});
// ../../node_modules/.pnpm/ansis@3.17.0/node_modules/ansis/index.js
var require_ansis = __commonJS({
"../../node_modules/.pnpm/ansis@3.17.0/node_modules/ansis/index.js"(exports, module) {
init_cjs_shims();
var { defineProperty: e, setPrototypeOf: t, create: r, keys: n } = Object, l = "", { round: s, max: i } = Math, o = (e2) => {
let [, t2] = /([a-f\d]{3,6})/i.exec(e2) || [], r2 = t2 ? t2.length : 0;
if (r2 === 3) t2 = t2[0] + t2[0] + t2[1] + t2[1] + t2[2] + t2[2];
else if (6 ^ r2) return [0, 0, 0];
let n2 = parseInt(t2, 16);
return [n2 >> 16 & 255, n2 >> 8 & 255, 255 & n2];
}, a = (e2, t2, r2) => e2 === t2 && t2 === r2 ? e2 < 8 ? 16 : e2 > 248 ? 231 : s((e2 - 8) / 247 * 24) + 232 : 16 + 36 * s(e2 / 51) + 6 * s(t2 / 51) + s(r2 / 51), c = (e2) => {
let t2, r2, n2, l2, o2;
return e2 < 8 ? 30 + e2 : e2 < 16 ? e2 - 8 + 90 : (e2 >= 232 ? t2 = r2 = n2 = (10 * (e2 - 232) + 8) / 255 : (o2 = (e2 -= 16) % 36, t2 = (e2 / 36 | 0) / 5, r2 = (o2 / 6 | 0) / 5, n2 = o2 % 6 / 5), l2 = 2 * i(t2, r2, n2), l2 ? 30 + (s(n2) << 2 | s(r2) << 1 | s(t2)) + (2 ^ l2 ? 0 : 60) : 30);
}, u = (() => {
let e2 = (e3) => i2.some(((t3) => e3.test(t3))), t2 = globalThis, r2 = t2.Deno, l2 = !!r2, s2 = t2.process || r2 || {}, i2 = s2.argv || s2.args || [], o2 = s2.env || {}, a2 = -1;
if (l2) try {
o2 = o2.toObject();
} catch {
a2 = 0;
}
let c2 = !!o2.PM2_HOME && !!o2.pm_id || o2.NEXT_RUNTIME?.includes("edge") || (l2 ? r2.isatty(1) : !!s2.stdout?.isTTY), u2 = "FORCE_COLOR", p2 = o2[u2], g2 = parseInt(p2), d2 = isNaN(g2) ? p2 === "false" ? 0 : -1 : g2, f2 = u2 in o2 && d2 || e2(/^-{1,2}color=?(true|always)?$/);
return f2 && (a2 = d2), a2 < 0 && (a2 = ((e3, t3, r3) => {
let l3 = e3.TERM, s3 = "," + n(e3).join(",");
return { "24bit": 3, truecolor: 3, ansi256: 2, ansi: 1 }[e3.COLORTERM] || (e3.TF_BUILD ? 1 : /,TEAMCI/.test(s3) ? 2 : e3.CI ? /,GIT(HUB|EA)/.test(s3) ? 3 : 1 : !t3 || /-mono|dumb/i.test(l3) ? 0 : r3 || /term-(kit|dir)/.test(l3) ? 3 : /-256/.test(l3) ? 2 : /scr|xterm|tty|ansi|color|[nm]ux|vt|cyg/.test(l3) ? 1 : 3);
})(o2, c2, (l2 ? r2.build.os : s2.platform) === "win32")), !d2 || o2.NO_COLOR || e2(/^-{1,2}(no-color|color=(false|never))$/) ? 0 : f2 && !a2 || t2.window?.chrome ? 3 : a2;
})(), p = u > 0, g = { open: l, close: l }, d = p ? (e2, t2) => ({ open: `\x1B[${e2}m`, close: `\x1B[${t2}m` }) : () => g, f = 39, b = 49, _ = (e2, t2) => (r2, n2, l2) => d(((e3, t3, r3) => c(a(e3, t3, r3)))(r2, n2, l2) + e2, t2), m = (e2) => (t2, r2, n2) => e2(a(t2, r2, n2)), y = (e2) => (t2) => e2(...o(t2)), h = (e2, t2, r2) => d(`38;2;${e2};${t2};${r2}`, f), O = (e2, t2, r2) => d(`48;2;${e2};${t2};${r2}`, b), $ = (e2) => d(`38;5;${e2}`, f), x = (e2) => d(`48;5;${e2}`, b);
u === 2 ? (h = m($), O = m(x)) : u === 1 && (h = _(0, f), O = _(10, b), $ = (e2) => d(c(e2), f), x = (e2) => d(c(e2) + 10, b));
var T, w = { ansi256: $, bgAnsi256: x, fg: $, bg: x, rgb: h, bgRgb: O, hex: y(h), bgHex: y(O), visible: g, reset: d(0, 0), bold: d(1, 22), dim: d(2, 22), italic: d(3, 23), underline: d(4, 24), inverse: d(7, 27), hidden: d(8, 28) }, R = "Bright", E = 30;
"black,red,green,yellow,blue,magenta,cyan,white".split(",").map(((e2) => {
T = "bg" + e2[0].toUpperCase() + e2.slice(1), w[e2] = d(E, f), w[e2 + R] = d(60 + E, f), w[T] = d(E + 10, b), w[T + R] = d(70 + E++, b);
})), w.grey = w.gray = d(90, f), w.bgGrey = w.bgGray = d(100, b), w.strikethrough = w.strike = d(9, 29);
var v, C = {}, I = ({ _p: e2 }, { open: r2, close: n2 }) => {
let s2 = (e3, ...t2) => {
if (!e3) {
if (r2 && r2 === n2) return r2;
if (e3 == null || l === e3) return l;
}
let i3 = e3.raw ? String.raw(e3, ...t2).replace(/\\n/g, `
`) : l + e3, o3 = s2._p, { _a: a2, _b: c2 } = o3;
if (i3.includes("\x1B")) for (; o3; ) {
let e4, t3 = o3.close, r3 = o3.open, n3 = t3.length, s3 = l, a3 = 0;
if (n3) {
for (; ~(e4 = i3.indexOf(t3, a3)); a3 = e4 + n3) s3 += i3.slice(a3, e4) + r3;
i3 = s3 + i3.slice(a3);
}
o3 = o3._p;
}
return i3.includes(`
`) && (i3 = i3.replace(/(\r?\n)/g, c2 + "$1" + a2)), a2 + i3 + c2;
}, i2 = r2, o2 = n2;
return e2 && (i2 = e2._a + r2, o2 = n2 + e2._b), t(s2, v), s2._p = { open: r2, close: n2, _a: i2, _b: o2, _p: e2 }, s2.open = i2, s2.close = o2, s2;
}, M = function() {
let n2 = { Ansis: M, isSupported: () => p, strip: (e2) => e2.replace(/[›][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, l), extend(l2) {
for (let t2 in l2) {
let r2 = l2[t2], n3 = (typeof r2)[0], s2 = n3 === "s" ? h(...o(r2)) : r2;
C[t2] = n3 === "f" ? { get() {
return (...e2) => I(this, r2(...e2));
} } : { get() {
let r3 = I(this, s2);
return e(this, t2, { value: r3 }), r3;
} };
}
return v = r({}, C), t(n2, v), n2;
} };
return n2.extend(w);
}, k = new M();
module.exports = k, k.default = k;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/interfaces/theme.js
var require_theme = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/interfaces/theme.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.STANDARD_ANSI = void 0;
exports.STANDARD_ANSI = [
"white",
"black",
"blue",
"yellow",
"green",
"red",
"magenta",
"cyan",
"gray",
"blackBright",
"redBright",
"greenBright",
"yellowBright",
"blueBright",
"magentaBright",
"cyanBright",
"whiteBright",
"bgBlack",
"bgRed",
"bgGreen",
"bgYellow",
"bgBlue",
"bgMagenta",
"bgCyan",
"bgWhite",
"bgGray",
"bgBlackBright",
"bgRedBright",
"bgGreenBright",
"bgYellowBright",
"bgBlueBright",
"bgMagentaBright",
"bgCyanBright",
"bgWhiteBright",
"bold",
"underline",
"dim",
"italic",
"strikethrough"
];
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/ux/supports-color.js
var require_supports_color2 = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/ux/supports-color.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.supportsColor = supportsColor;
var supports_color_1 = require_supports_color();
function supportsColor() {
return !!supports_color_1.stdout && !!supports_color_1.stderr;
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/ux/theme.js
var require_theme2 = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/ux/theme.js"(exports) {
"use strict";
init_cjs_shims();
var __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.colorize = colorize;
exports.parseTheme = parseTheme;
var ansis_1 = __importDefault(require_ansis()), theme_1 = require_theme(), supports_color_1 = require_supports_color2();
function isStandardAnsi(color) {
return theme_1.STANDARD_ANSI.includes(color);
}
function colorize(color, text) {
if (!color || !(0, supports_color_1.supportsColor)())
return text;
if (isStandardAnsi(color))
return ansis_1.default[color](text);
if (color.startsWith("#"))
return ansis_1.default.hex(color)(text);
if (color.startsWith("rgb")) {
let [red, green, blue] = color.slice(4, -1).split(",").map((c) => Number.parseInt(c.trim(), 10));
return ansis_1.default.rgb(red, green, blue)(text);
}
return text;
}
function parseTheme(theme) {
return Object.fromEntries(Object.entries(theme).map(([key, value]) => [key, typeof value == "string" ? isValid(value) : parseTheme(value)]).filter(([_, value]) => value));
}
function isValid(color) {
return color.startsWith("#") || color.startsWith("rgb") || isStandardAnsi(color) ? color : void 0;
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/errors/errors/cli.js
var require_cli = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/errors/errors/cli.js"(exports) {
"use strict";
init_cjs_shims();
var __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.CLIError = void 0;
exports.addOclifExitCode = addOclifExitCode;
var clean_stack_1 = __importDefault(require_clean_stack()), indent_string_1 = __importDefault(require_indent_string()), wrap_ansi_1 = __importDefault(require_wrap_ansi()), cache_1 = __importDefault(require_cache()), screen_1 = require_screen(), settings_1 = require_settings(), theme_1 = require_theme2();
function addOclifExitCode(error, options) {
return "oclif" in error || (error.oclif = {}), error.oclif.exit = options?.exit === void 0 ? cache_1.default.getInstance().get("exitCodes")?.default ?? 2 : options.exit, error;
}
var CLIError = class extends Error {
code;
oclif = {};
skipOclifErrorHandling;
suggestions;
constructor(error, options = {}) {
super(error instanceof Error ? error.message : error), addOclifExitCode(this, options), this.code = options.code, this.suggestions = options.suggestions;
}
// eslint-disable-next-line getter-return
get bang() {
try {
return (0, theme_1.colorize)("red", process.platform === "win32" ? "\xBB" : "\u203A");
} catch {
}
}
get stack() {
return (0, clean_stack_1.default)(super.stack, { pretty: !0 });
}
/**
* @deprecated `render` Errors display should be handled by display function, like pretty-print
* @returns {string} returns a string representing the display of the error
*/
render() {
if (settings_1.settings.debug)
return this.stack;
let output = `${this.name}: ${this.message}`;
return output = (0, wrap_ansi_1.default)(output, screen_1.errtermwidth - 6, { hard: !0, trim: !1 }), output = (0, indent_string_1.default)(output, 3), output = (0, indent_string_1.default)(output, 1, { includeEmptyLines: !0, indent: this.bang }), output = (0, indent_string_1.default)(output, 1), output;
}
};
exports.CLIError = CLIError;
(function(CLIError2) {
class Warn extends CLIError2 {
constructor(err) {
super(err instanceof Error ? err.message : err), this.name = "Warning";
}
// eslint-disable-next-line getter-return
get bang() {
try {
return (0, theme_1.colorize)("yellow", process.platform === "win32" ? "\xBB" : "\u203A");
} catch {
}
}
}
CLIError2.Warn = Warn;
})(CLIError || (exports.CLIError = CLIError = {}));
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/errors/errors/pretty-print.js
var require_pretty_print = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/errors/errors/pretty-print.js"(exports) {
"use strict";
init_cjs_shims();
var __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.applyPrettyPrintOptions = applyPrettyPrintOptions;
exports.default = prettyPrint;
var indent_string_1 = __importDefault(require_indent_string()), wrap_ansi_1 = __importDefault(require_wrap_ansi()), screen_1 = require_screen(), settings_1 = require_settings();
function applyPrettyPrintOptions(error, options) {
let prettyErrorKeys = ["message", "code", "ref", "suggestions"];
for (let key of prettyErrorKeys)
!(key in error) && options[key] && (error[key] = options[key]);
return error;
}
var formatSuggestions = (suggestions) => {
let label = "Try this:";
if (!suggestions || suggestions.length === 0)
return;
if (suggestions.length === 1)
return `${label} ${suggestions[0]}`;
let multiple = suggestions.map((suggestion) => `* ${suggestion}`).join(`
`);
return `${label}
${(0, indent_string_1.default)(multiple, 2)}`;
};
function prettyPrint(error) {
if (settings_1.settings.debug)
return error.stack;
let { bang, code, message, name: errorSuffix, ref, suggestions } = error, formattedHeader = message ? `${errorSuffix || "Error"}: ${message}` : void 0, formattedCode = code ? `Code: ${code}` : void 0, formattedSuggestions = formatSuggestions(suggestions), formattedReference = ref ? `Reference: ${ref}` : void 0, formatted = [formattedHeader, formattedCode, formattedSuggestions, formattedReference].filter(Boolean).join(`
`), output = (0, wrap_ansi_1.default)(formatted, screen_1.errtermwidth - 6, { hard: !0, trim: !1 });
return output = (0, indent_string_1.default)(output, 3), output = (0, indent_string_1.default)(output, 1, { includeEmptyLines: !0, indent: bang || "" }), output = (0, indent_string_1.default)(output, 1), output;
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/errors/error.js
var require_error = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/errors/error.js"(exports) {
"use strict";
init_cjs_shims();
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
k2 === void 0 && (k2 = k);
var desc = Object.getOwnPropertyDescriptor(m, k);
(!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) && (desc = { enumerable: !0, get: function() {
return m[k];
} }), Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
k2 === void 0 && (k2 = k), o[k2] = m[k];
})), __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: !0, value: v });
}) : function(o, v) {
o.default = v;
}), __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() {
var ownKeys = function(o) {
return ownKeys = Object.getOwnPropertyNames || function(o2) {
var ar = [];
for (var k in o2) Object.prototype.hasOwnProperty.call(o2, k) && (ar[ar.length] = k);
return ar;
}, ownKeys(o);
};
return function(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) k[i] !== "default" && __createBinding(result, mod, k[i]);
return __setModuleDefault(result, mod), result;
};
})();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.error = error;
var logger_1 = require_logger(), write_1 = require_write(), cli_1 = require_cli(), pretty_print_1 = __importStar(require_pretty_print());
function error(input, options = {}) {
let err;
if (typeof input == "string")
err = new cli_1.CLIError(input, options);
else if (input instanceof Error)
err = (0, cli_1.addOclifExitCode)(input, options);
else
throw new TypeError("first argument must be a string or instance of Error");
if (err = (0, pretty_print_1.applyPrettyPrintOptions)(err, options), options.exit === !1) {
let message = (0, pretty_print_1.default)(err);
message && (0, write_1.stderr)(message), err?.stack && (0, logger_1.getLogger)().error(err.stack);
} else
throw err;
}
exports.default = error;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/errors/errors/exit.js
var require_exit = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/errors/errors/exit.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.ExitError = void 0;
var cli_1 = require_cli(), ExitError = class extends cli_1.CLIError {
code = "EEXIT";
constructor(exitCode = 1) {
super(`EEXIT: ${exitCode}`, { exit: exitCode });
}
render() {
return "";
}
};
exports.ExitError = ExitError;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/errors/errors/module-load.js
var require_module_load = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/errors/errors/module-load.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.ModuleLoadError = void 0;
var cli_1 = require_cli(), ModuleLoadError = class extends cli_1.CLIError {
code = "MODULE_NOT_FOUND";
constructor(message) {
super(`[MODULE_NOT_FOUND] ${message}`, { exit: 1 }), this.name = "ModuleLoadError";
}
};
exports.ModuleLoadError = ModuleLoadError;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/errors/exit.js
var require_exit2 = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/errors/exit.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.exit = exit;
var exit_1 = require_exit();
function exit(code = 0) {
throw new exit_1.ExitError(code);
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/errors/warn.js
var require_warn = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/errors/warn.js"(exports) {
"use strict";
init_cjs_shims();
var __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.warn = warn;
exports.memoizedWarn = memoizedWarn;
var logger_1 = require_logger(), write_1 = require_write(), cli_1 = require_cli(), pretty_print_1 = __importDefault(require_pretty_print());
function warn(input) {
let err;
if (typeof input == "string")
err = new cli_1.CLIError.Warn(input);
else if (input instanceof Error)
err = (0, cli_1.addOclifExitCode)(input);
else
throw new TypeError("first argument must be a string or instance of Error");
let message = (0, pretty_print_1.default)(err);
message && (0, write_1.stderr)(message), err?.stack && (0, logger_1.getLogger)().error(err.stack);
}
var WARNINGS = /* @__PURE__ */ new Set();
function memoizedWarn(input) {
WARNINGS.has(input) || warn(input), WARNINGS.add(input);
}
exports.default = warn;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/read-tsconfig.js
var require_read_tsconfig = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/read-tsconfig.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.readTSConfig = readTSConfig;
var promises_1 = __require("node:fs/promises"), node_path_1 = __require("node:path"), warn_1 = require_warn(), logger_1 = require_logger(), util_1 = require_util(), debug = (0, logger_1.makeDebug)("read-tsconfig");
function resolve(root, name) {
try {
return __require.resolve(name, { paths: [root] });
} catch {
}
}
async function upUntil(path, test) {
let result;
try {
result = await test(path);
} catch {
result = !1;
}
if (result)
return path;
let parent = (0, node_path_1.dirname)(path);
if (parent !== path)
return upUntil(parent, test);
}
async function readTSConfig(root, tsconfigName = "tsconfig.json") {
let found = [], typescript;
try {
typescript = require_typescript();
} catch {
try {
typescript = __require(root + "/node_modules/typescript");
} catch {
}
}
if (!typescript) {
(0, warn_1.memoizedWarn)("Could not find typescript. Please ensure that typescript is a devDependency. Falling back to compiled source.");
return;
}
let read = async (path) => {
let localRoot = await upUntil(path, async (p) => (await (0, promises_1.readdir)(p)).includes("package.json"));
if (localRoot)
try {
let contents = await (0, promises_1.readFile)(path, "utf8"), parsed = typescript?.parseConfigFileTextToJson(path, contents).config;
if (found.push(parsed), parsed.extends) {
if (parsed.extends.startsWith(".")) {
let nextPath = resolve(localRoot, parsed.extends);
return nextPath ? read(nextPath) : void 0;
}
let resolved = resolve(localRoot, parsed.extends);
if (resolved)
return read(resolved);
}
return parsed;
} catch (error) {
debug(error);
}
};
return await read((0, node_path_1.join)(root, tsconfigName)), {
compilerOptions: (0, util_1.mergeNestedObjects)(found, "compilerOptions"),
"ts-node": (0, util_1.mergeNestedObjects)(found, "ts-node")
};
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/config/util.js
var require_util2 = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/config/util.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.collectUsableIds = void 0;
exports.makeDebug = makeDebug;
exports.getPermutations = getPermutations;
exports.getCommandIdPermutations = getCommandIdPermutations;
var logger_1 = require_logger();
function makeDebug(...scope) {
return (formatter, ...args) => (0, logger_1.getLogger)(["config", ...scope].join(":")).debug(formatter, ...args);
}
function getPermutations(arr) {
if (arr.length === 0)
return [];
if (arr.length === 1)
return [arr];
let output = [], partialPermutations = getPermutations(arr.slice(1)), first = arr[0];
for (let i = 0, len = partialPermutations.length; i < len; i++) {
let partial = partialPermutations[i];
for (let j = 0, len2 = partial.length; j <= len2; j++) {
let start = partial.slice(0, j), end = partial.slice(j), merged = [...start, first, ...end];
output.push(merged);
}
}
return output;
}
function getCommandIdPermutations(commandId) {
return getPermutations(commandId.split(":")).flatMap((c) => c.join(":"));
}
var collectUsableIds = (commandIds) => new Set(commandIds.flatMap((id) => id.split(":").map((_, i, a) => a.slice(0, i + 1).join(":"))));
exports.collectUsableIds = collectUsableIds;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/config/ts-path.js
var require_ts_path = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/config/ts-path.js"(exports) {
"use strict";
init_cjs_shims();
var __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.TS_CONFIGS = void 0;
exports.tsPath = tsPath;
var promises_1 = __require("node:fs/promises"), node_path_1 = __require("node:path"), node_url_1 = __require("node:url"), cache_1 = __importDefault(require_cache()), warn_1 = require_warn(), settings_1 = require_settings(), fs_1 = require_fs(), read_tsconfig_1 = require_read_tsconfig(), util_1 = require_util(), util_2 = require_util2(), debug = (0, util_2.makeDebug)("ts-path");
exports.TS_CONFIGS = {};
var REGISTERED = /* @__PURE__ */ new Set();
function determineRuntime() {
return process.execPath.split(node_path_1.sep).includes("bun") ? "bun" : process.execArgv.length === 0 ? "node" : process.execArgv[0] === "--require" && process.execArgv[1].split(node_path_1.sep).includes("ts-node") || process.execArgv[0].split(node_path_1.sep).includes("ts-node") ? "ts-node" : process.execArgv[0] === "--require" && process.execArgv[1].split(node_path_1.sep).includes("tsx") ? "tsx" : "node";
}
var RUN_TIME = determineRuntime();
function isErrno(error) {
return "code" in error && error.code === "ENOENT";
}
async function loadTSConfig(root) {
try {
if (exports.TS_CONFIGS[root])
return exports.TS_CONFIGS[root];
let tsconfig = await (0, read_tsconfig_1.readTSConfig)(root);
return tsconfig ? (debug("tsconfig: %O", tsconfig), exports.TS_CONFIGS[root] = tsconfig, exports.TS_CONFIGS[root]) : void 0;
} catch (error) {
if (isErrno(error))
return;
debug(`Could not parse tsconfig.json. Skipping typescript path lookup for ${root}.`), (0, warn_1.memoizedWarn)(`Could not parse tsconfig.json for ${root}. Falling back to compiled source.`);
}
}
async function registerTsx(root, moduleType) {
if (!REGISTERED.has(root))
try {
let apiPath = moduleType === "module" ? "tsx/esm/api" : "tsx/cjs/api", tsxPath = __require.resolve(apiPath, { paths: [root] });
if (!tsxPath)
return;
debug("registering tsx at", root), debug("tsx path:", tsxPath);
let { href } = (0, node_url_1.pathToFileURL)(tsxPath);
debug("tsx href:", href);
let { register } = await import(href);
debug("Successfully imported tsx"), register(), REGISTERED.add(root);
} catch (error) {
debug(`Could not find tsx. Skipping tsx registration for ${root}.`), debug(error);
}
}
async function registerTSNode(root, tsconfig) {
if (REGISTERED.has(root))
return;
debug("registering ts-node at", root);
let tsNodePath = __require.resolve("ts-node", { paths: [root, __dirname] });
debug("ts-node path:", tsNodePath);
let tsNode;
try {
tsNode = __require(tsNodePath), debug("Successfully required ts-node");
} catch (error) {
debug(`Could not find ts-node at ${tsNodePath}. Skipping ts-node registration for ${root}.`), debug(error), (0, warn_1.memoizedWarn)(`Could not find ts-node at ${tsNodePath}. Please ensure that ts-node is a devDependency. Falling back to compiled source.`);
return;
}
let typeRoots = [(0, node_path_1.join)(root, "node_modules", "@types")], rootDirs = [];
if (tsconfig.compilerOptions.rootDirs)
for (let r of tsconfig.compilerOptions.rootDirs)
rootDirs.push((0, node_path_1.join)(root, r));
else tsconfig.compilerOptions.rootDir ? rootDirs.push((0, node_path_1.join)(root, tsconfig.compilerOptions.rootDir)) : tsconfig.compilerOptions.baseUrl ? rootDirs.push((0, node_path_1.join)(root, tsconfig.compilerOptions.baseUrl)) : rootDirs.push((0, node_path_1.join)(root, "src"));
let { baseUrl, rootDir, ...rest } = tsconfig.compilerOptions, conf = {
compilerOptions: {
...rest,
rootDirs,
typeRoots
},
...tsconfig["ts-node"],
cwd: root,
esm: tsconfig["ts-node"]?.esm ?? !0,
experimentalSpecifierResolution: tsconfig["ts-node"]?.experimentalSpecifierResolution ?? "explicit",
scope: !0,
scopeDir: root,
skipProject: !0,
transpileOnly: !0
};
debug("ts-node options: %O", conf), tsNode.register(conf), REGISTERED.add(root);
}
function cannotTranspileEsm(rootPlugin, plugin, isProduction) {
return (isProduction || rootPlugin?.moduleType === "commonjs") && plugin?.moduleType === "module" && !plugin?.pjson.devDependencies?.tsx;
}
function cannotUseTsNode(root, plugin, isProduction) {
if (plugin?.moduleType !== "module" || isProduction)
return !1;
let nodeMajor = Number.parseInt(process.version.replace("v", "").split(".")[0], 10);
return RUN_TIME === "ts-node" && nodeMajor >= 20;
}
async function determinePath(root, orig, plugin) {
let tsconfig = await loadTSConfig(root);
if (!tsconfig)
return orig;
debug(`Determining path for ${orig}`), RUN_TIME === "bun" ? debug(`Skipping ts-node registration for ${root} because the runtime is: ${RUN_TIME}`) : (await registerTsx(root, plugin?.moduleType), await registerTSNode(root, tsconfig));
let { baseUrl, outDir, rootDir, rootDirs } = tsconfig.compilerOptions, rootDirPath = rootDir ?? (rootDirs ?? [])[0] ?? baseUrl;
if (!rootDirPath)
return debug(`no rootDir, rootDirs, or baseUrl specified in tsconfig.json. Returning default path ${orig}`), orig;
if (!outDir)
return debug(`no outDir specified in tsconfig.json. Returning default path ${orig}`), orig;
let lib = (0, node_path_1.join)(root, outDir), src = (0, node_path_1.join)(root, rootDirPath), relative = (0, node_path_1.relative)(lib, orig), out = (0, node_path_1.join)(src, relative).replace(/\.js$/, "");
return debug(`lib dir: ${lib}`), debug(`src dir: ${src}`), debug(`src directory to find: ${out}`), (0, fs_1.existsSync)(out) ? (debug(`Found source directory for ${orig} at ${out}`), out) : (await Promise.all([
(0, promises_1.access)(`${out}.ts`).then(() => `${out}.ts`).catch(() => !1),
(0, promises_1.access)(`${out}.tsx`).then(() => `${out}.tsx`).catch(() => !1)
])).some(Boolean) ? (debug(`Found source file for ${orig} at ${out}`), out) : (debug(`No source file found. Returning default path ${orig}`), (0, util_1.isProd)() || (0, warn_1.memoizedWarn)(`Could not find source for ${orig} based on tsconfig. Defaulting to compiled source.`), orig);
}
async function tsPath(root, orig, plugin) {
let rootPlugin = plugin?.options.isRoot ? plugin : cache_1.default.getInstance().get("rootPlugin");
if (!orig)
return orig;
orig = orig.startsWith(root) ? orig : (0, node_path_1.join)(root, orig);
let enableAutoTranspile = settings_1.settings.enableAutoTranspile ?? settings_1.settings.tsnodeEnabled;
if (enableAutoTranspile === !1)
return debug(`Skipping typescript path lookup for ${root} because enableAutoTranspile is explicitly set to false`), orig;
let isProduction = (0, util_1.isProd)();
if (enableAutoTranspile === void 0 && isProduction && plugin?.type !== "link")
return debug(`Skipping typescript path lookup for ${root} because NODE_ENV is NOT "test" or "development"`), orig;
if (cannotTranspileEsm(rootPlugin, plugin, isProduction)) {
debug(`Skipping typescript path lookup for ${root} because it's an ESM module (NODE_ENV: ${process.env.NODE_ENV}, root plugin module type: ${rootPlugin?.moduleType})`);
let warningIsDisabled = process.env.OCLIF_DISABLE_LINKED_ESM_WARNING && (0, util_1.isTruthy)(process.env.OCLIF_DISABLE_LINKED_ESM_WARNING);
return plugin?.type === "link" && !warningIsDisabled && (0, warn_1.memoizedWarn)(`${plugin?.name} is a linked ESM module and cannot be auto-transpiled. Existing compiled source will be used instead.`), orig;
}
if (cannotUseTsNode(root, plugin, isProduction))
return debug(`Skipping typescript path lookup for ${root} because ts-node is run in node version ${process.version}"`), (0, warn_1.memoizedWarn)("ts-node executable cannot transpile ESM in Node 20. Existing compiled source will be used instead. See https://github.com/oclif/core/issues/817."), orig;
try {
return await determinePath(root, orig, plugin);
} catch (error) {
return debug(error), orig;
}
}
}
});
// ../../node_modules/.pnpm/get-package-type@0.1.0/node_modules/get-package-type/is-node-modules.cjs
var require_is_node_modules = __commonJS({
"../../node_modules/.pnpm/get-package-type@0.1.0/node_modules/get-package-type/is-node-modules.cjs"(exports, module) {
"use strict";
init_cjs_shims();
var path = __require("path");
function isNodeModules(directory) {
let basename = path.basename(directory);
return path.sep === "\\" && (basename = basename.toLowerCase()), basename === "node_modules";
}
module.exports = isNodeModules;
}
});
// ../../node_modules/.pnpm/get-package-type@0.1.0/node_modules/get-package-type/cache.cjs
var require_cache2 = __commonJS({
"../../node_modules/.pnpm/get-package-type@0.1.0/node_modules/get-package-type/cache.cjs"(exports, module) {
"use strict";
init_cjs_shims();
module.exports = /* @__PURE__ */ new Map();
}
});
// ../../node_modules/.pnpm/get-package-type@0.1.0/node_modules/get-package-type/async.cjs
var require_async = __commonJS({
"../../node_modules/.pnpm/get-package-type@0.1.0/node_modules/get-package-type/async.cjs"(exports, module) {
"use strict";
init_cjs_shims();
var path = __require("path"), { promisify } = __require("util"), readFile = promisify(__require("fs").readFile), isNodeModules = require_is_node_modules(), resultsCache = require_cache2(), promiseCache = /* @__PURE__ */ new Map();
async function getDirectoryTypeActual(directory) {
if (isNodeModules(directory))
return "commonjs";
try {
return JSON.parse(await readFile(path.resolve(directory, "package.json"))).type || "commonjs";
} catch {
}
let parent = path.dirname(directory);
return parent === directory ? "commonjs" : getDirectoryType(parent);
}
async function getDirectoryType(directory) {
if (resultsCache.has(directory))
return resultsCache.get(directory);
if (promiseCache.has(directory))
return promiseCache.get(directory);
let promise = getDirectoryTypeActual(directory);
promiseCache.set(directory, promise);
let result = await promise;
return resultsCache.set(directory, result), promiseCache.delete(directory), result;
}
function getPackageType(filename) {
return getDirectoryType(path.resolve(path.dirname(filename)));
}
module.exports = getPackageType;
}
});
// ../../node_modules/.pnpm/get-package-type@0.1.0/node_modules/get-package-type/sync.cjs
var require_sync = __commonJS({
"../../node_modules/.pnpm/get-package-type@0.1.0/node_modules/get-package-type/sync.cjs"(exports, module) {
"use strict";
init_cjs_shims();
var path = __require("path"), { readFileSync } = __require("fs"), isNodeModules = require_is_node_modules(), resultsCache = require_cache2();
function getDirectoryTypeActual(directory) {
if (isNodeModules(directory))
return "commonjs";
try {
return JSON.parse(readFileSync(path.resolve(directory, "package.json"))).type || "commonjs";
} catch {
}
let parent = path.dirname(directory);
return parent === directory ? "commonjs" : getDirectoryType(parent);
}
function getDirectoryType(directory) {
if (resultsCache.has(directory))
return resultsCache.get(directory);
let result = getDirectoryTypeActual(directory);
return resultsCache.set(directory, result), result;
}
function getPackageTypeSync(filename) {
return getDirectoryType(path.resolve(path.dirname(filename)));
}
module.exports = getPackageTypeSync;
}
});
// ../../node_modules/.pnpm/get-package-type@0.1.0/node_modules/get-package-type/index.cjs
var require_get_package_type = __commonJS({
"../../node_modules/.pnpm/get-package-type@0.1.0/node_modules/get-package-type/index.cjs"(exports, module) {
"use strict";
init_cjs_shims();
var getPackageType = require_async(), getPackageTypeSync = require_sync();
module.exports = (filename) => getPackageType(filename);
module.exports.sync = getPackageTypeSync;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/module-loader.js
var require_module_loader = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/module-loader.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.load = load;
exports.loadWithData = loadWithData;
exports.loadWithDataFromManifest = loadWithDataFromManifest;
exports.isPathModule = isPathModule;
var getPackageType = require_get_package_type(), node_fs_1 = __require("node:fs"), node_path_1 = __require("node:path"), node_url_1 = __require("node:url"), ts_path_1 = require_ts_path(), module_load_1 = require_module_load(), fs_1 = require_fs(), SUPPORTED_EXTENSIONS = [".ts", ".js", ".mjs", ".cjs", ".mts", ".cts", ".tsx", ".jsx"], isPlugin = (config) => config.type !== void 0;
function handleError(error, isESM, path) {
throw error.code === "MODULE_NOT_FOUND" || error.code === "ERR_MODULE_NOT_FOUND" ? new module_load_1.ModuleLoadError(`${isESM ? "import()" : "require"} failed to load ${path}: ${error.message}`) : error;
}
async function load(config, modulePath) {
let filePath, isESM;
try {
return { filePath, isESM } = await resolvePath(config, modulePath), isESM ? await import((0, node_url_1.pathToFileURL)(filePath).href) : __require(filePath);
} catch (error) {
handleError(error, isESM, filePath ?? modulePath);
}
}
async function loadWithData(config, modulePath) {
let filePath, isESM;
try {
({ filePath, isESM } = await resolvePath(config, modulePath));
let module2 = isESM ? await import((0, node_url_1.pathToFileURL)(filePath).href) : __require(filePath);
return { filePath, isESM, module: module2 };
} catch (error) {
handleError(error, isESM, filePath ?? modulePath);
}
}
async function loadWithDataFromManifest(cached, modulePath) {
let { id, isESM, relativePath } = cached;
if (!relativePath)
throw new module_load_1.ModuleLoadError(`Cached command ${id} does not have a relative path`);
if (isESM === void 0)
throw new module_load_1.ModuleLoadError(`Cached command ${id} does not have the isESM property set`);
let filePath = (0, node_path_1.join)(modulePath, relativePath.join(node_path_1.sep));
try {
let module2 = isESM ? await import((0, node_url_1.pathToFileURL)(filePath).href) : __require(filePath);
return { filePath, isESM, module: module2 };
} catch (error) {
handleError(error, isESM, filePath ?? modulePath);
}
}
function isPathModule(filePath) {
switch ((0, node_path_1.extname)(filePath).toLowerCase()) {
case ".js":
case ".jsx":
case ".ts":
case ".tsx":
return getPackageType.sync(filePath) === "module";
case ".mjs":
case ".mts":
return !0;
default:
return !1;
}
}
async function resolvePath(config, modulePath) {
let isESM, filePath;
try {
filePath = __require.resolve(modulePath), isESM = isPathModule(filePath);
} catch {
filePath = (isPlugin(config) ? await (0, ts_path_1.tsPath)(config.root, modulePath, config) : await (0, ts_path_1.tsPath)(config.root, modulePath)) ?? modulePath;
let fileExists = !1, isDirectory = !1;
if ((0, fs_1.existsSync)(filePath)) {
fileExists = !0;
try {
(0, node_fs_1.lstatSync)(filePath)?.isDirectory?.() && (fileExists = !1, isDirectory = !0);
} catch {
}
}
if (!fileExists) {
let foundPath = findFile(filePath);
!foundPath && isDirectory && (foundPath = findFile((0, node_path_1.join)(filePath, "index"))), foundPath && (filePath = foundPath);
}
isESM = isPathModule(filePath);
}
return { filePath, isESM };
}
function findFile(filePath) {
for (let extension of SUPPORTED_EXTENSIONS) {
let testPath = `${filePath}${extension}`;
if ((0, fs_1.existsSync)(testPath))
return testPath;
}
return null;
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/symbols.js
var require_symbols = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/symbols.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.SINGLE_COMMAND_CLI_SYMBOL = void 0;
exports.SINGLE_COMMAND_CLI_SYMBOL = (/* @__PURE__ */ Symbol("SINGLE_COMMAND_CLI")).toString();
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/cache-default-value.js
var require_cache_default_value = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/cache-default-value.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.cacheDefaultValue = void 0;
var cacheDefaultValue = async (flagOrArg, respectNoCacheDefault) => {
if (!(respectNoCacheDefault && flagOrArg.noCacheDefault)) {
if (typeof flagOrArg.defaultHelp == "function")
try {
return await flagOrArg.defaultHelp({ flags: {}, options: flagOrArg });
} catch {
return;
}
if (typeof flagOrArg.default == "function")
try {
return await flagOrArg.default({ flags: {}, options: flagOrArg });
} catch {
}
else
return flagOrArg.default;
}
};
exports.cacheDefaultValue = cacheDefaultValue;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/ids.js
var require_ids = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/ids.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.toStandardizedId = toStandardizedId;
exports.toConfiguredId = toConfiguredId;
function toStandardizedId(commandID, config) {
return commandID.replaceAll(new RegExp(config.topicSeparator, "g"), ":");
}
function toConfiguredId(commandID, config) {
return commandID.replaceAll(new RegExp(":", "g"), config.topicSeparator || ":");
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/ux/action/base.js
var require_base = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/ux/action/base.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.ActionBase = void 0;
var node_util_1 = __require("node:util"), util_1 = require_util(), ActionBase = class {
std = "stderr";
stdmocks;
type;
stdmockOrigs = {
stderr: process.stderr.write,
stdout: process.stdout.write
};
get globals() {
globalThis.ux = globalThis.ux || {};
let globals = globalThis.ux;
return globals.action = globals.action || {}, globals;
}
get output() {
return this.globals.output;
}
set output(output) {
this.globals.output = output;
}
get running() {
return !!this.task;
}
get status() {
return this.task ? this.task.status : void 0;
}
set status(status) {
let { task } = this;
task && task.status !== status && (this._updateStatus(status, task.status), task.status = status);
}
get task() {
return this.globals.action.task;
}
set task(task) {
this.globals.action.task = task;
}
// flush mocked stdout/stderr
_flushStdout() {
try {
let output = "", std;
for (; this.stdmocks && this.stdmocks.length > 0; ) {
let cur = this.stdmocks.shift();
std = cur[0], this._write(std, cur[1]), output += cur[1][0].toString("utf8");
}
output && std && output.at(-1) !== `
` && this._write(std, `
`);
} catch (error) {
this._write("stderr", (0, node_util_1.inspect)(error));
}
}
_pause(_) {
throw new Error("not implemented");
}
_resume() {
this.task && this.start(this.task.action, this.task.status);
}
_start(_opts) {
throw new Error("not implemented");
}
// mock out stdout/stderr so it doesn't screw up the rendering
_stdout(toggle) {
try {
if (toggle) {
if (this.stdmocks)
return;
this.stdmockOrigs = {
stderr: process.stderr.write,
stdout: process.stdout.write
}, this.stdmocks = [], process.stdout.write = (...args) => (this.stdmocks.push(["stdout", args]), !0), process.stderr.write = (...args) => (this.stdmocks.push(["stderr", args]), !0);
} else {
if (!this.stdmocks)
return;
delete this.stdmocks, process.stdout.write = this.stdmockOrigs.stdout, process.stderr.write = this.stdmockOrigs.stderr;
}
} catch (error) {
this._write("stderr", (0, node_util_1.inspect)(error));
}
}
_stop(_) {
throw new Error("not implemented");
}
_updateStatus(_, __) {
}
// write to the real stdout/stderr
_write(std, s) {
switch (std) {
case "stderr": {
this.stdmockOrigs.stderr.apply(process.stderr, (0, util_1.castArray)(s));
break;
}
case "stdout": {
this.stdmockOrigs.stdout.apply(process.stdout, (0, util_1.castArray)(s));
break;
}
default:
throw new Error(`invalid std: ${std}`);
}
}
pause(fn, icon) {
let { task } = this, active = task && task.active;
task && active && (this._pause(icon), this._stdout(!1), task.active = !1);
let ret = fn();
return task && active && this._resume(), ret;
}
async pauseAsync(fn, icon) {
let { task } = this, active = task && task.active;
task && active && (this._pause(icon), this._stdout(!1), task.active = !1);
let ret = await fn();
return task && active && this._resume(), ret;
}
start(action, status, opts = {}) {
this.std = opts.stdout ? "stdout" : "stderr";
let task = { action, active: !!(this.task && this.task.active), status };
this.task = task, this._start(opts), task.active = !0, this._stdout(!0);
}
stop(msg = "done") {
let { task } = this;
task && (this._stop(msg), task.active = !1, this.task = void 0, this._stdout(!1));
}
};
exports.ActionBase = ActionBase;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/ux/action/simple.js
var require_simple = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/ux/action/simple.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
var base_1 = require_base(), SimpleAction = class extends base_1.ActionBase {
type = "simple";
_pause(icon) {
icon ? this._updateStatus(icon) : this._flush();
}
_resume() {
}
_start() {
this.task && this._render(this.task.action, this.task.status);
}
_stop(status) {
this.task && this._updateStatus(status, this.task.status, !0);
}
_updateStatus(status, prevStatus, newline = !1) {
this.task && (this.task.active && !prevStatus ? this._write(this.std, ` ${status}`) : this._write(this.std, `${this.task.action}... ${status}`), (newline || !prevStatus) && this._flush());
}
_flush() {
this._write(this.std, `
`), this._flushStdout();
}
_render(action, status) {
this.task && (this.task.active && this._flush(), this._write(this.std, status ? `${action}... ${status}` : `${action}...`));
}
};
exports.default = SimpleAction;
}
});
// ../../node_modules/.pnpm/ansi-escapes@4.3.2/node_modules/ansi-escapes/index.js
var require_ansi_escapes = __commonJS({
"../../node_modules/.pnpm/ansi-escapes@4.3.2/node_modules/ansi-escapes/index.js"(exports, module) {
"use strict";
init_cjs_shims();
var ansiEscapes = module.exports;
module.exports.default = ansiEscapes;
var ESC = "\x1B[", OSC = "\x1B]", BEL = "\x07", SEP = ";", isTerminalApp = process.env.TERM_PROGRAM === "Apple_Terminal";
ansiEscapes.cursorTo = (x, y) => {
if (typeof x != "number")
throw new TypeError("The `x` argument is required");
return typeof y != "number" ? ESC + (x + 1) + "G" : ESC + (y + 1) + ";" + (x + 1) + "H";
};
ansiEscapes.cursorMove = (x, y) => {
if (typeof x != "number")
throw new TypeError("The `x` argument is required");
let ret = "";
return x < 0 ? ret += ESC + -x + "D" : x > 0 && (ret += ESC + x + "C"), y < 0 ? ret += ESC + -y + "A" : y > 0 && (ret += ESC + y + "B"), ret;
};
ansiEscapes.cursorUp = (count = 1) => ESC + count + "A";
ansiEscapes.cursorDown = (count = 1) => ESC + count + "B";
ansiEscapes.cursorForward = (count = 1) => ESC + count + "C";
ansiEscapes.cursorBackward = (count = 1) => ESC + count + "D";
ansiEscapes.cursorLeft = ESC + "G";
ansiEscapes.cursorSavePosition = isTerminalApp ? "\x1B7" : ESC + "s";
ansiEscapes.cursorRestorePosition = isTerminalApp ? "\x1B8" : ESC + "u";
ansiEscapes.cursorGetPosition = ESC + "6n";
ansiEscapes.cursorNextLine = ESC + "E";
ansiEscapes.cursorPrevLine = ESC + "F";
ansiEscapes.cursorHide = ESC + "?25l";
ansiEscapes.cursorShow = ESC + "?25h";
ansiEscapes.eraseLines = (count) => {
let clear = "";
for (let i = 0; i < count; i++)
clear += ansiEscapes.eraseLine + (i < count - 1 ? ansiEscapes.cursorUp() : "");
return count && (clear += ansiEscapes.cursorLeft), clear;
};
ansiEscapes.eraseEndLine = ESC + "K";
ansiEscapes.eraseStartLine = ESC + "1K";
ansiEscapes.eraseLine = ESC + "2K";
ansiEscapes.eraseDown = ESC + "J";
ansiEscapes.eraseUp = ESC + "1J";
ansiEscapes.eraseScreen = ESC + "2J";
ansiEscapes.scrollUp = ESC + "S";
ansiEscapes.scrollDown = ESC + "T";
ansiEscapes.clearScreen = "\x1Bc";
ansiEscapes.clearTerminal = process.platform === "win32" ? `${ansiEscapes.eraseScreen}${ESC}0f` : (
// 1. Erases the screen (Only done in case `2` is not supported)
// 2. Erases the whole screen including scrollback buffer
// 3. Moves cursor to the top-left position
// More info: https://www.real-world-systems.com/docs/ANSIcode.html
`${ansiEscapes.eraseScreen}${ESC}3J${ESC}H`
);
ansiEscapes.beep = BEL;
ansiEscapes.link = (text, url) => [
OSC,
"8",
SEP,
SEP,
url,
BEL,
text,
OSC,
"8",
SEP,
SEP,
BEL
].join("");
ansiEscapes.image = (buffer, options = {}) => {
let ret = `${OSC}1337;File=inline=1`;
return options.width && (ret += `;width=${options.width}`), options.height && (ret += `;height=${options.height}`), options.preserveAspectRatio === !1 && (ret += ";preserveAspectRatio=0"), ret + ":" + buffer.toString("base64") + BEL;
};
ansiEscapes.iTerm = {
setCwd: (cwd = process.cwd()) => `${OSC}50;CurrentDir=${cwd}${BEL}`,
annotation: (message, options = {}) => {
let ret = `${OSC}1337;`, hasX = typeof options.x < "u", hasY = typeof options.y < "u";
if ((hasX || hasY) && !(hasX && hasY && typeof options.length < "u"))
throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");
return message = message.replace(/\|/g, ""), ret += options.isHidden ? "AddHiddenAnnotation=" : "AddAnnotation=", options.length > 0 ? ret += (hasX ? [message, options.length, options.x, options.y] : [options.length, message]).join("|") : ret += message, ret + BEL;
}
};
}
});
// ../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/spinners.json
var require_spinners = __commonJS({
"../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/spinners.json"(exports, module) {
module.exports = {
dots: {
interval: 80,
frames: [
"\u280B",
"\u2819",
"\u2839",
"\u2838",
"\u283C",
"\u2834",
"\u2826",
"\u2827",
"\u2807",
"\u280F"
]
},
dots2: {
interval: 80,
frames: [
"\u28FE",
"\u28FD",
"\u28FB",
"\u28BF",
"\u287F",
"\u28DF",
"\u28EF",
"\u28F7"
]
},
dots3: {
interval: 80,
frames: [
"\u280B",
"\u2819",
"\u281A",
"\u281E",
"\u2816",
"\u2826",
"\u2834",
"\u2832",
"\u2833",
"\u2813"
]
},
dots4: {
interval: 80,
frames: [
"\u2804",
"\u2806",
"\u2807",
"\u280B",
"\u2819",
"\u2838",
"\u2830",
"\u2820",
"\u2830",
"\u2838",
"\u2819",
"\u280B",
"\u2807",
"\u2806"
]
},
dots5: {
interval: 80,
frames: [
"\u280B",
"\u2819",
"\u281A",
"\u2812",
"\u2802",
"\u2802",
"\u2812",
"\u2832",
"\u2834",
"\u2826",
"\u2816",
"\u2812",
"\u2810",
"\u2810",
"\u2812",
"\u2813",
"\u280B"
]
},
dots6: {
interval: 80,
frames: [
"\u2801",
"\u2809",
"\u2819",
"\u281A",
"\u2812",
"\u2802",
"\u2802",
"\u2812",
"\u2832",
"\u2834",
"\u2824",
"\u2804",
"\u2804",
"\u2824",
"\u2834",
"\u2832",
"\u2812",
"\u2802",
"\u2802",
"\u2812",
"\u281A",
"\u2819",
"\u2809",
"\u2801"
]
},
dots7: {
interval: 80,
frames: [
"\u2808",
"\u2809",
"\u280B",
"\u2813",
"\u2812",
"\u2810",
"\u2810",
"\u2812",
"\u2816",
"\u2826",
"\u2824",
"\u2820",
"\u2820",
"\u2824",
"\u2826",
"\u2816",
"\u2812",
"\u2810",
"\u2810",
"\u2812",
"\u2813",
"\u280B",
"\u2809",
"\u2808"
]
},
dots8: {
interval: 80,
frames: [
"\u2801",
"\u2801",
"\u2809",
"\u2819",
"\u281A",
"\u2812",
"\u2802",
"\u2802",
"\u2812",
"\u2832",
"\u2834",
"\u2824",
"\u2804",
"\u2804",
"\u2824",
"\u2820",
"\u2820",
"\u2824",
"\u2826",
"\u2816",
"\u2812",
"\u2810",
"\u2810",
"\u2812",
"\u2813",
"\u280B",
"\u2809",
"\u2808",
"\u2808"
]
},
dots9: {
interval: 80,
frames: [
"\u28B9",
"\u28BA",
"\u28BC",
"\u28F8",
"\u28C7",
"\u2867",
"\u2857",
"\u284F"
]
},
dots10: {
interval: 80,
frames: [
"\u2884",
"\u2882",
"\u2881",
"\u2841",
"\u2848",
"\u2850",
"\u2860"
]
},
dots11: {
interval: 100,
frames: [
"\u2801",
"\u2802",
"\u2804",
"\u2840",
"\u2880",
"\u2820",
"\u2810",
"\u2808"
]
},
dots12: {
interval: 80,
frames: [
"\u2880\u2800",
"\u2840\u2800",
"\u2804\u2800",
"\u2882\u2800",
"\u2842\u2800",
"\u2805\u2800",
"\u2883\u2800",
"\u2843\u2800",
"\u280D\u2800",
"\u288B\u2800",
"\u284B\u2800",
"\u280D\u2801",
"\u288B\u2801",
"\u284B\u2801",
"\u280D\u2809",
"\u280B\u2809",
"\u280B\u2809",
"\u2809\u2819",
"\u2809\u2819",
"\u2809\u2829",
"\u2808\u2899",
"\u2808\u2859",
"\u2888\u2829",
"\u2840\u2899",
"\u2804\u2859",
"\u2882\u2829",
"\u2842\u2898",
"\u2805\u2858",
"\u2883\u2828",
"\u2843\u2890",
"\u280D\u2850",
"\u288B\u2820",
"\u284B\u2880",
"\u280D\u2841",
"\u288B\u2801",
"\u284B\u2801",
"\u280D\u2809",
"\u280B\u2809",
"\u280B\u2809",
"\u2809\u2819",
"\u2809\u2819",
"\u2809\u2829",
"\u2808\u2899",
"\u2808\u2859",
"\u2808\u2829",
"\u2800\u2899",
"\u2800\u2859",
"\u2800\u2829",
"\u2800\u2898",
"\u2800\u2858",
"\u2800\u2828",
"\u2800\u2890",
"\u2800\u2850",
"\u2800\u2820",
"\u2800\u2880",
"\u2800\u2840"
]
},
dots13: {
interval: 80,
frames: [
"\u28FC",
"\u28F9",
"\u28BB",
"\u283F",
"\u285F",
"\u28CF",
"\u28E7",
"\u28F6"
]
},
dots8Bit: {
interval: 80,
frames: [
"\u2800",
"\u2801",
"\u2802",
"\u2803",
"\u2804",
"\u2805",
"\u2806",
"\u2807",
"\u2840",
"\u2841",
"\u2842",
"\u2843",
"\u2844",
"\u2845",
"\u2846",
"\u2847",
"\u2808",
"\u2809",
"\u280A",
"\u280B",
"\u280C",
"\u280D",
"\u280E",
"\u280F",
"\u2848",
"\u2849",
"\u284A",
"\u284B",
"\u284C",
"\u284D",
"\u284E",
"\u284F",
"\u2810",
"\u2811",
"\u2812",
"\u2813",
"\u2814",
"\u2815",
"\u2816",
"\u2817",
"\u2850",
"\u2851",
"\u2852",
"\u2853",
"\u2854",
"\u2855",
"\u2856",
"\u2857",
"\u2818",
"\u2819",
"\u281A",
"\u281B",
"\u281C",
"\u281D",
"\u281E",
"\u281F",
"\u2858",
"\u2859",
"\u285A",
"\u285B",
"\u285C",
"\u285D",
"\u285E",
"\u285F",
"\u2820",
"\u2821",
"\u2822",
"\u2823",
"\u2824",
"\u2825",
"\u2826",
"\u2827",
"\u2860",
"\u2861",
"\u2862",
"\u2863",
"\u2864",
"\u2865",
"\u2866",
"\u2867",
"\u2828",
"\u2829",
"\u282A",
"\u282B",
"\u282C",
"\u282D",
"\u282E",
"\u282F",
"\u2868",
"\u2869",
"\u286A",
"\u286B",
"\u286C",
"\u286D",
"\u286E",
"\u286F",
"\u2830",
"\u2831",
"\u2832",
"\u2833",
"\u2834",
"\u2835",
"\u2836",
"\u2837",
"\u2870",
"\u2871",
"\u2872",
"\u2873",
"\u2874",
"\u2875",
"\u2876",
"\u2877",
"\u2838",
"\u2839",
"\u283A",
"\u283B",
"\u283C",
"\u283D",
"\u283E",
"\u283F",
"\u2878",
"\u2879",
"\u287A",
"\u287B",
"\u287C",
"\u287D",
"\u287E",
"\u287F",
"\u2880",
"\u2881",
"\u2882",
"\u2883",
"\u2884",
"\u2885",
"\u2886",
"\u2887",
"\u28C0",
"\u28C1",
"\u28C2",
"\u28C3",
"\u28C4",
"\u28C5",
"\u28C6",
"\u28C7",
"\u2888",
"\u2889",
"\u288A",
"\u288B",
"\u288C",
"\u288D",
"\u288E",
"\u288F",
"\u28C8",
"\u28C9",
"\u28CA",
"\u28CB",
"\u28CC",
"\u28CD",
"\u28CE",
"\u28CF",
"\u2890",
"\u2891",
"\u2892",
"\u2893",
"\u2894",
"\u2895",
"\u2896",
"\u2897",
"\u28D0",
"\u28D1",
"\u28D2",
"\u28D3",
"\u28D4",
"\u28D5",
"\u28D6",
"\u28D7",
"\u2898",
"\u2899",
"\u289A",
"\u289B",
"\u289C",
"\u289D",
"\u289E",
"\u289F",
"\u28D8",
"\u28D9",
"\u28DA",
"\u28DB",
"\u28DC",
"\u28DD",
"\u28DE",
"\u28DF",
"\u28A0",
"\u28A1",
"\u28A2",
"\u28A3",
"\u28A4",
"\u28A5",
"\u28A6",
"\u28A7",
"\u28E0",
"\u28E1",
"\u28E2",
"\u28E3",
"\u28E4",
"\u28E5",
"\u28E6",
"\u28E7",
"\u28A8",
"\u28A9",
"\u28AA",
"\u28AB",
"\u28AC",
"\u28AD",
"\u28AE",
"\u28AF",
"\u28E8",
"\u28E9",
"\u28EA",
"\u28EB",
"\u28EC",
"\u28ED",
"\u28EE",
"\u28EF",
"\u28B0",
"\u28B1",
"\u28B2",
"\u28B3",
"\u28B4",
"\u28B5",
"\u28B6",
"\u28B7",
"\u28F0",
"\u28F1",
"\u28F2",
"\u28F3",
"\u28F4",
"\u28F5",
"\u28F6",
"\u28F7",
"\u28B8",
"\u28B9",
"\u28BA",
"\u28BB",
"\u28BC",
"\u28BD",
"\u28BE",
"\u28BF",
"\u28F8",
"\u28F9",
"\u28FA",
"\u28FB",
"\u28FC",
"\u28FD",
"\u28FE",
"\u28FF"
]
},
sand: {
interval: 80,
frames: [
"\u2801",
"\u2802",
"\u2804",
"\u2840",
"\u2848",
"\u2850",
"\u2860",
"\u28C0",
"\u28C1",
"\u28C2",
"\u28C4",
"\u28CC",
"\u28D4",
"\u28E4",
"\u28E5",
"\u28E6",
"\u28EE",
"\u28F6",
"\u28F7",
"\u28FF",
"\u287F",
"\u283F",
"\u289F",
"\u281F",
"\u285B",
"\u281B",
"\u282B",
"\u288B",
"\u280B",
"\u280D",
"\u2849",
"\u2809",
"\u2811",
"\u2821",
"\u2881"
]
},
line: {
interval: 130,
frames: [
"-",
"\\",
"|",
"/"
]
},
line2: {
interval: 100,
frames: [
"\u2802",
"-",
"\u2013",
"\u2014",
"\u2013",
"-"
]
},
pipe: {
interval: 100,
frames: [
"\u2524",
"\u2518",
"\u2534",
"\u2514",
"\u251C",
"\u250C",
"\u252C",
"\u2510"
]
},
simpleDots: {
interval: 400,
frames: [
". ",
".. ",
"...",
" "
]
},
simpleDotsScrolling: {
interval: 200,
frames: [
". ",
".. ",
"...",
" ..",
" .",
" "
]
},
star: {
interval: 70,
frames: [
"\u2736",
"\u2738",
"\u2739",
"\u273A",
"\u2739",
"\u2737"
]
},
star2: {
interval: 80,
frames: [
"+",
"x",
"*"
]
},
flip: {
interval: 70,
frames: [
"_",
"_",
"_",
"-",
"`",
"`",
"'",
"\xB4",
"-",
"_",
"_",
"_"
]
},
hamburger: {
interval: 100,
frames: [
"\u2631",
"\u2632",
"\u2634"
]
},
growVertical: {
interval: 120,
frames: [
"\u2581",
"\u2583",
"\u2584",
"\u2585",
"\u2586",
"\u2587",
"\u2586",
"\u2585",
"\u2584",
"\u2583"
]
},
growHorizontal: {
interval: 120,
frames: [
"\u258F",
"\u258E",
"\u258D",
"\u258C",
"\u258B",
"\u258A",
"\u2589",
"\u258A",
"\u258B",
"\u258C",
"\u258D",
"\u258E"
]
},
balloon: {
interval: 140,
frames: [
" ",
".",
"o",
"O",
"@",
"*",
" "
]
},
balloon2: {
interval: 120,
frames: [
".",
"o",
"O",
"\xB0",
"O",
"o",
"."
]
},
noise: {
interval: 100,
frames: [
"\u2593",
"\u2592",
"\u2591"
]
},
bounce: {
interval: 120,
frames: [
"\u2801",
"\u2802",
"\u2804",
"\u2802"
]
},
boxBounce: {
interval: 120,
frames: [
"\u2596",
"\u2598",
"\u259D",
"\u2597"
]
},
boxBounce2: {
interval: 100,
frames: [
"\u258C",
"\u2580",
"\u2590",
"\u2584"
]
},
triangle: {
interval: 50,
frames: [
"\u25E2",
"\u25E3",
"\u25E4",
"\u25E5"
]
},
binary: {
interval: 80,
frames: [
"010010",
"001100",
"100101",
"111010",
"111101",
"010111",
"101011",
"111000",
"110011",
"110101"
]
},
arc: {
interval: 100,
frames: [
"\u25DC",
"\u25E0",
"\u25DD",
"\u25DE",
"\u25E1",
"\u25DF"
]
},
circle: {
interval: 120,
frames: [
"\u25E1",
"\u2299",
"\u25E0"
]
},
squareCorners: {
interval: 180,
frames: [
"\u25F0",
"\u25F3",
"\u25F2",
"\u25F1"
]
},
circleQuarters: {
interval: 120,
frames: [
"\u25F4",
"\u25F7",
"\u25F6",
"\u25F5"
]
},
circleHalves: {
interval: 50,
frames: [
"\u25D0",
"\u25D3",
"\u25D1",
"\u25D2"
]
},
squish: {
interval: 100,
frames: [
"\u256B",
"\u256A"
]
},
toggle: {
interval: 250,
frames: [
"\u22B6",
"\u22B7"
]
},
toggle2: {
interval: 80,
frames: [
"\u25AB",
"\u25AA"
]
},
toggle3: {
interval: 120,
frames: [
"\u25A1",
"\u25A0"
]
},
toggle4: {
interval: 100,
frames: [
"\u25A0",
"\u25A1",
"\u25AA",
"\u25AB"
]
},
toggle5: {
interval: 100,
frames: [
"\u25AE",
"\u25AF"
]
},
toggle6: {
interval: 300,
frames: [
"\u101D",
"\u1040"
]
},
toggle7: {
interval: 80,
frames: [
"\u29BE",
"\u29BF"
]
},
toggle8: {
interval: 100,
frames: [
"\u25CD",
"\u25CC"
]
},
toggle9: {
interval: 100,
frames: [
"\u25C9",
"\u25CE"
]
},
toggle10: {
interval: 100,
frames: [
"\u3282",
"\u3280",
"\u3281"
]
},
toggle11: {
interval: 50,
frames: [
"\u29C7",
"\u29C6"
]
},
toggle12: {
interval: 120,
frames: [
"\u2617",
"\u2616"
]
},
toggle13: {
interval: 80,
frames: [
"=",
"*",
"-"
]
},
arrow: {
interval: 100,
frames: [
"\u2190",
"\u2196",
"\u2191",
"\u2197",
"\u2192",
"\u2198",
"\u2193",
"\u2199"
]
},
arrow2: {
interval: 80,
frames: [
"\u2B06\uFE0F ",
"\u2197\uFE0F ",
"\u27A1\uFE0F ",
"\u2198\uFE0F ",
"\u2B07\uFE0F ",
"\u2199\uFE0F ",
"\u2B05\uFE0F ",
"\u2196\uFE0F "
]
},
arrow3: {
interval: 120,
frames: [
"\u25B9\u25B9\u25B9\u25B9\u25B9",
"\u25B8\u25B9\u25B9\u25B9\u25B9",
"\u25B9\u25B8\u25B9\u25B9\u25B9",
"\u25B9\u25B9\u25B8\u25B9\u25B9",
"\u25B9\u25B9\u25B9\u25B8\u25B9",
"\u25B9\u25B9\u25B9\u25B9\u25B8"
]
},
bouncingBar: {
interval: 80,
frames: [
"[ ]",
"[= ]",
"[== ]",
"[=== ]",
"[====]",
"[ ===]",
"[ ==]",
"[ =]",
"[ ]",
"[ =]",
"[ ==]",
"[ ===]",
"[====]",
"[=== ]",
"[== ]",
"[= ]"
]
},
bouncingBall: {
interval: 80,
frames: [
"( \u25CF )",
"( \u25CF )",
"( \u25CF )",
"( \u25CF )",
"( \u25CF)",
"( \u25CF )",
"( \u25CF )",
"( \u25CF )",
"( \u25CF )",
"(\u25CF )"
]
},
smiley: {
interval: 200,
frames: [
"\u{1F604} ",
"\u{1F61D} "
]
},
monkey: {
interval: 300,
frames: [
"\u{1F648} ",
"\u{1F648} ",
"\u{1F649} ",
"\u{1F64A} "
]
},
hearts: {
interval: 100,
frames: [
"\u{1F49B} ",
"\u{1F499} ",
"\u{1F49C} ",
"\u{1F49A} ",
"\u2764\uFE0F "
]
},
clock: {
interval: 100,
frames: [
"\u{1F55B} ",
"\u{1F550} ",
"\u{1F551} ",
"\u{1F552} ",
"\u{1F553} ",
"\u{1F554} ",
"\u{1F555} ",
"\u{1F556} ",
"\u{1F557} ",
"\u{1F558} ",
"\u{1F559} ",
"\u{1F55A} "
]
},
earth: {
interval: 180,
frames: [
"\u{1F30D} ",
"\u{1F30E} ",
"\u{1F30F} "
]
},
material: {
interval: 17,
frames: [
"\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581",
"\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581",
"\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581",
"\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581",
"\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581",
"\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581",
"\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581",
"\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581",
"\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581",
"\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581",
"\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588",
"\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588",
"\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588",
"\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588",
"\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588",
"\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588",
"\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588",
"\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581",
"\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581",
"\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581",
"\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581",
"\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
"\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"
]
},
moon: {
interval: 80,
frames: [
"\u{1F311} ",
"\u{1F312} ",
"\u{1F313} ",
"\u{1F314} ",
"\u{1F315} ",
"\u{1F316} ",
"\u{1F317} ",
"\u{1F318} "
]
},
runner: {
interval: 140,
frames: [
"\u{1F6B6} ",
"\u{1F3C3} "
]
},
pong: {
interval: 80,
frames: [
"\u2590\u2802 \u258C",
"\u2590\u2808 \u258C",
"\u2590 \u2802 \u258C",
"\u2590 \u2820 \u258C",
"\u2590 \u2840 \u258C",
"\u2590 \u2820 \u258C",
"\u2590 \u2802 \u258C",
"\u2590 \u2808 \u258C",
"\u2590 \u2802 \u258C",
"\u2590 \u2820 \u258C",
"\u2590 \u2840 \u258C",
"\u2590 \u2820 \u258C",
"\u2590 \u2802 \u258C",
"\u2590 \u2808 \u258C",
"\u2590 \u2802\u258C",
"\u2590 \u2820\u258C",
"\u2590 \u2840\u258C",
"\u2590 \u2820 \u258C",
"\u2590 \u2802 \u258C",
"\u2590 \u2808 \u258C",
"\u2590 \u2802 \u258C",
"\u2590 \u2820 \u258C",
"\u2590 \u2840 \u258C",
"\u2590 \u2820 \u258C",
"\u2590 \u2802 \u258C",
"\u2590 \u2808 \u258C",
"\u2590 \u2802 \u258C",
"\u2590 \u2820 \u258C",
"\u2590 \u2840 \u258C",
"\u2590\u2820 \u258C"
]
},
shark: {
interval: 120,
frames: [
"\u2590|\\____________\u258C",
"\u2590_|\\___________\u258C",
"\u2590__|\\__________\u258C",
"\u2590___|\\_________\u258C",
"\u2590____|\\________\u258C",
"\u2590_____|\\_______\u258C",
"\u2590______|\\______\u258C",
"\u2590_______|\\_____\u258C",
"\u2590________|\\____\u258C",
"\u2590_________|\\___\u258C",
"\u2590__________|\\__\u258C",
"\u2590___________|\\_\u258C",
"\u2590____________|\\\u258C",
"\u2590____________/|\u258C",
"\u2590___________/|_\u258C",
"\u2590__________/|__\u258C",
"\u2590_________/|___\u258C",
"\u2590________/|____\u258C",
"\u2590_______/|_____\u258C",
"\u2590______/|______\u258C",
"\u2590_____/|_______\u258C",
"\u2590____/|________\u258C",
"\u2590___/|_________\u258C",
"\u2590__/|__________\u258C",
"\u2590_/|___________\u258C",
"\u2590/|____________\u258C"
]
},
dqpb: {
interval: 100,
frames: [
"d",
"q",
"p",
"b"
]
},
weather: {
interval: 100,
frames: [
"\u2600\uFE0F ",
"\u2600\uFE0F ",
"\u2600\uFE0F ",
"\u{1F324} ",
"\u26C5\uFE0F ",
"\u{1F325} ",
"\u2601\uFE0F ",
"\u{1F327} ",
"\u{1F328} ",
"\u{1F327} ",
"\u{1F328} ",
"\u{1F327} ",
"\u{1F328} ",
"\u26C8 ",
"\u{1F328} ",
"\u{1F327} ",
"\u{1F328} ",
"\u2601\uFE0F ",
"\u{1F325} ",
"\u26C5\uFE0F ",
"\u{1F324} ",
"\u2600\uFE0F ",
"\u2600\uFE0F "
]
},
christmas: {
interval: 400,
frames: [
"\u{1F332}",
"\u{1F384}"
]
},
grenade: {
interval: 80,
frames: [
"\u060C ",
"\u2032 ",
" \xB4 ",
" \u203E ",
" \u2E0C",
" \u2E0A",
" |",
" \u204E",
" \u2055",
" \u0DF4 ",
" \u2053",
" ",
" ",
" "
]
},
point: {
interval: 125,
frames: [
"\u2219\u2219\u2219",
"\u25CF\u2219\u2219",
"\u2219\u25CF\u2219",
"\u2219\u2219\u25CF",
"\u2219\u2219\u2219"
]
},
layer: {
interval: 150,
frames: [
"-",
"=",
"\u2261"
]
},
betaWave: {
interval: 80,
frames: [
"\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2",
"\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2",
"\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2",
"\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2",
"\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2",
"\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2",
"\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"
]
},
fingerDance: {
interval: 160,
frames: [
"\u{1F918} ",
"\u{1F91F} ",
"\u{1F596} ",
"\u270B ",
"\u{1F91A} ",
"\u{1F446} "
]
},
fistBump: {
interval: 80,
frames: [
"\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ",
"\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ",
"\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ",
"\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ",
"\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ",
"\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ",
"\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "
]
},
soccerHeader: {
interval: 80,
frames: [
" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ",
"\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ",
"\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ",
"\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ",
"\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ",
"\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ",
"\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ",
"\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ",
"\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ",
"\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ",
"\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ",
"\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "
]
},
mindblown: {
interval: 160,
frames: [
"\u{1F610} ",
"\u{1F610} ",
"\u{1F62E} ",
"\u{1F62E} ",
"\u{1F626} ",
"\u{1F626} ",
"\u{1F627} ",
"\u{1F627} ",
"\u{1F92F} ",
"\u{1F4A5} ",
"\u2728 ",
"\u3000 ",
"\u3000 ",
"\u3000 "
]
},
speaker: {
interval: 160,
frames: [
"\u{1F508} ",
"\u{1F509} ",
"\u{1F50A} ",
"\u{1F509} "
]
},
orangePulse: {
interval: 100,
frames: [
"\u{1F538} ",
"\u{1F536} ",
"\u{1F7E0} ",
"\u{1F7E0} ",
"\u{1F536} "
]
},
bluePulse: {
interval: 100,
frames: [
"\u{1F539} ",
"\u{1F537} ",
"\u{1F535} ",
"\u{1F535} ",
"\u{1F537} "
]
},
orangeBluePulse: {
interval: 100,
frames: [
"\u{1F538} ",
"\u{1F536} ",
"\u{1F7E0} ",
"\u{1F7E0} ",
"\u{1F536} ",
"\u{1F539} ",
"\u{1F537} ",
"\u{1F535} ",
"\u{1F535} ",
"\u{1F537} "
]
},
timeTravel: {
interval: 100,
frames: [
"\u{1F55B} ",
"\u{1F55A} ",
"\u{1F559} ",
"\u{1F558} ",
"\u{1F557} ",
"\u{1F556} ",
"\u{1F555} ",
"\u{1F554} ",
"\u{1F553} ",
"\u{1F552} ",
"\u{1F551} ",
"\u{1F550} "
]
},
aesthetic: {
interval: 80,
frames: [
"\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1",
"\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1",
"\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1",
"\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1",
"\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1",
"\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1",
"\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0",
"\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"
]
},
dwarfFortress: {
interval: 80,
frames: [
" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
"\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
"\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
"\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
"\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
"\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
"\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
"\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
"\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
"\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u263A \u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2593\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2593\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2592\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2592\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2591\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2591\u2588\u2588\xA3\xA3\xA3 ",
" \u263A \u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2588\u2588\xA3\xA3\xA3 ",
" \u263A\u2593\u2588\xA3\xA3\xA3 ",
" \u263A\u2593\u2588\xA3\xA3\xA3 ",
" \u263A\u2592\u2588\xA3\xA3\xA3 ",
" \u263A\u2592\u2588\xA3\xA3\xA3 ",
" \u263A\u2591\u2588\xA3\xA3\xA3 ",
" \u263A\u2591\u2588\xA3\xA3\xA3 ",
" \u263A \u2588\xA3\xA3\xA3 ",
" \u263A\u2588\xA3\xA3\xA3 ",
" \u263A\u2588\xA3\xA3\xA3 ",
" \u263A\u2593\xA3\xA3\xA3 ",
" \u263A\u2593\xA3\xA3\xA3 ",
" \u263A\u2592\xA3\xA3\xA3 ",
" \u263A\u2592\xA3\xA3\xA3 ",
" \u263A\u2591\xA3\xA3\xA3 ",
" \u263A\u2591\xA3\xA3\xA3 ",
" \u263A \xA3\xA3\xA3 ",
" \u263A\xA3\xA3\xA3 ",
" \u263A\xA3\xA3\xA3 ",
" \u263A\u2593\xA3\xA3 ",
" \u263A\u2593\xA3\xA3 ",
" \u263A\u2592\xA3\xA3 ",
" \u263A\u2592\xA3\xA3 ",
" \u263A\u2591\xA3\xA3 ",
" \u263A\u2591\xA3\xA3 ",
" \u263A \xA3\xA3 ",
" \u263A\xA3\xA3 ",
" \u263A\xA3\xA3 ",
" \u263A\u2593\xA3 ",
" \u263A\u2593\xA3 ",
" \u263A\u2592\xA3 ",
" \u263A\u2592\xA3 ",
" \u263A\u2591\xA3 ",
" \u263A\u2591\xA3 ",
" \u263A \xA3 ",
" \u263A\xA3 ",
" \u263A\xA3 ",
" \u263A\u2593 ",
" \u263A\u2593 ",
" \u263A\u2592 ",
" \u263A\u2592 ",
" \u263A\u2591 ",
" \u263A\u2591 ",
" \u263A ",
" \u263A &",
" \u263A \u263C&",
" \u263A \u263C &",
" \u263A\u263C &",
" \u263A\u263C & ",
" \u203C & ",
" \u263A & ",
" \u203C & ",
" \u263A & ",
" \u203C & ",
" \u263A & ",
"\u203C & ",
" & ",
" & ",
" & \u2591 ",
" & \u2592 ",
" & \u2593 ",
" & \xA3 ",
" & \u2591\xA3 ",
" & \u2592\xA3 ",
" & \u2593\xA3 ",
" & \xA3\xA3 ",
" & \u2591\xA3\xA3 ",
" & \u2592\xA3\xA3 ",
"& \u2593\xA3\xA3 ",
"& \xA3\xA3\xA3 ",
" \u2591\xA3\xA3\xA3 ",
" \u2592\xA3\xA3\xA3 ",
" \u2593\xA3\xA3\xA3 ",
" \u2588\xA3\xA3\xA3 ",
" \u2591\u2588\xA3\xA3\xA3 ",
" \u2592\u2588\xA3\xA3\xA3 ",
" \u2593\u2588\xA3\xA3\xA3 ",
" \u2588\u2588\xA3\xA3\xA3 ",
" \u2591\u2588\u2588\xA3\xA3\xA3 ",
" \u2592\u2588\u2588\xA3\xA3\xA3 ",
" \u2593\u2588\u2588\xA3\xA3\xA3 ",
" \u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u2591\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u2592\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u2593\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "
]
}
};
}
});
// ../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/index.js
var require_cli_spinners = __commonJS({
"../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/index.js"(exports, module) {
"use strict";
init_cjs_shims();
var spinners = Object.assign({}, require_spinners()), spinnersList = Object.keys(spinners);
Object.defineProperty(spinners, "random", {
get() {
let randomIndex = Math.floor(Math.random() * spinnersList.length), spinnerName = spinnersList[randomIndex];
return spinners[spinnerName];
}
});
module.exports = spinners;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/ux/action/spinner.js
var require_spinner = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/ux/action/spinner.js"(exports) {
"use strict";
init_cjs_shims();
var __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, "__esModule", { value: !0 });
var ansiEscapes = require_ansi_escapes(), ansis_1 = __importDefault(require_ansis()), cli_spinners_1 = __importDefault(require_cli_spinners()), cache_1 = __importDefault(require_cache()), screen_1 = require_screen(), theme_1 = require_theme2(), base_1 = require_base(), SpinnerAction = class extends base_1.ActionBase {
type = "spinner";
color = "magenta";
frameIndex;
frames;
spinner;
constructor() {
super(), this.frames = this.getFrames(), this.frameIndex = 0;
}
_frame() {
let frame = this.frames[this.frameIndex];
return this.frameIndex = ++this.frameIndex % this.frames.length, this.colorize(frame);
}
_pause(icon) {
this.spinner && clearInterval(this.spinner), this._reset(), icon && this._render(` ${icon}`), this.output = void 0;
}
_start(opts) {
this.color = cache_1.default.getInstance().get("config")?.theme?.spinner ?? this.color, opts.style && (this.frames = this.getFrames(opts)), this._reset(), this.spinner && clearInterval(this.spinner), this._render(), this.spinner = setInterval((icon) => this._render.bind(this)(icon), process.platform === "win32" ? 500 : 100, "spinner"), this.spinner.unref();
}
_stop(status) {
this.task && (this.task.status = status), this.spinner && clearInterval(this.spinner), this._render(), this.output = void 0;
}
colorize(s) {
return (0, theme_1.colorize)(this.color, s);
}
_lines(s) {
return ansis_1.default.strip(s).split(`
`).map((l) => Math.ceil(l.length / screen_1.errtermwidth)).reduce((c, i) => c + i, 0);
}
_render(icon) {
if (!this.task)
return;
this._reset(), this._flushStdout();
let frame = icon === "spinner" ? ` ${this._frame()}` : icon || "", status = this.task.status ? ` ${this.task.status}` : "";
this.output = `${this.task.action}...${frame}${status}
`, this._write(this.std, this.output);
}
_reset() {
if (!this.output)
return;
let lines = this._lines(this.output);
this._write(this.std, ansiEscapes.cursorLeft + ansiEscapes.cursorUp(lines) + ansiEscapes.eraseDown), this.output = void 0;
}
getFrames(opts) {
return opts?.style ? cli_spinners_1.default[opts.style].frames : cli_spinners_1.default[process.platform === "win32" ? "line" : "dots2"].frames;
}
};
exports.default = SpinnerAction;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/ux/colorize-json.js
var require_colorize_json = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/ux/colorize-json.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.stringifyInput = stringifyInput;
exports.tokenize = tokenize;
exports.default = colorizeJson;
var theme_1 = require_theme2(), tokenTypes = [
{ regex: /^\s+/, tokenType: "whitespace" },
{ regex: /^[{}]/, tokenType: "brace" },
{ regex: /^[[\]]/, tokenType: "bracket" },
{ regex: /^:/, tokenType: "colon" },
{ regex: /^,/, tokenType: "comma" },
{ regex: /^-?\d+(?:\.\d+)?(?:e[+-]?\d+)?/i, tokenType: "number" },
{ regex: /^"(?:\\.|[^"\\])*"(?=\s*:)/, tokenType: "key" },
{ regex: /^"(?:\\.|[^"\\])*"/, tokenType: "string" },
{ regex: /^true|^false/, tokenType: "boolean" },
{ regex: /^null/, tokenType: "null" }
];
function stringify(value, replacer, spaces) {
return JSON.stringify(value, serializer(replacer, replacer), spaces);
}
function serializer(replacer, cycleReplacer) {
let stack = [], keys = [];
return cycleReplacer || (cycleReplacer = function(key, value) {
return stack[0] === value ? "[Circular ~]" : "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]";
}), function(key, value) {
if (stack.length > 0) {
let thisPos = stack.indexOf(this);
~thisPos ? stack.splice(thisPos + 1) : stack.push(this), ~thisPos ? keys.splice(thisPos, Number.POSITIVE_INFINITY, key) : keys.push(key), stack.includes(value) && (value = cycleReplacer.call(this, key, value));
} else
stack.push(value);
return replacer ? replacer.call(this, key, value) : value;
};
}
function stringifyInput(json, options) {
return options?.pretty ? stringify(typeof json == "string" ? JSON.parse(json) : json, void 0, 2) : typeof json == "string" ? json : stringify(json);
}
function tokenize(json, options) {
let input = stringifyInput(json, options), tokens = [], foundToken = !1;
do
for (let tokenType of tokenTypes) {
let match = tokenType.regex.exec(input);
if (match) {
tokens.push({ type: tokenType.tokenType, value: match[0] }), input = input.slice(match[0].length), foundToken = !0;
break;
}
}
while (hasRemainingTokens(input, foundToken));
return tokens;
}
function hasRemainingTokens(input, foundToken) {
return (input?.length ?? 0) > 0 && foundToken;
}
function colorizeJson(json, options) {
let opts = { ...options, pretty: options?.pretty ?? !0 };
return tokenize(json, opts).reduce((acc, token) => acc + (0, theme_1.colorize)(options?.theme?.[token.type], token.value), "");
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/ux/index.js
var require_ux = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/ux/index.js"(exports) {
"use strict";
init_cjs_shims();
var __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.ux = exports.action = exports.stdout = exports.stderr = exports.colorize = exports.colorizeJson = exports.warn = exports.exit = exports.error = void 0;
var error_1 = require_error(), exit_1 = require_exit2(), warn_1 = require_warn(), simple_1 = __importDefault(require_simple()), spinner_1 = __importDefault(require_spinner()), colorize_json_1 = __importDefault(require_colorize_json()), theme_1 = require_theme2(), write_1 = require_write(), error_2 = require_error();
Object.defineProperty(exports, "error", { enumerable: !0, get: function() {
return error_2.error;
} });
var exit_2 = require_exit2();
Object.defineProperty(exports, "exit", { enumerable: !0, get: function() {
return exit_2.exit;
} });
var warn_2 = require_warn();
Object.defineProperty(exports, "warn", { enumerable: !0, get: function() {
return warn_2.warn;
} });
var colorize_json_2 = require_colorize_json();
Object.defineProperty(exports, "colorizeJson", { enumerable: !0, get: function() {
return __importDefault(colorize_json_2).default;
} });
var theme_2 = require_theme2();
Object.defineProperty(exports, "colorize", { enumerable: !0, get: function() {
return theme_2.colorize;
} });
var write_2 = require_write();
Object.defineProperty(exports, "stderr", { enumerable: !0, get: function() {
return write_2.stderr;
} });
Object.defineProperty(exports, "stdout", { enumerable: !0, get: function() {
return write_2.stdout;
} });
var ACTION_TYPE = !!process.stderr.isTTY && !process.env.CI && !["dumb", "emacs-color"].includes(process.env.TERM) && "spinner" || "simple";
exports.action = ACTION_TYPE === "spinner" ? new spinner_1.default() : new simple_1.default();
exports.ux = {
action: exports.action,
/**
* Add color to text.
* @param color color to use. Can be hex code (e.g. `#ff0000`), rgb (e.g. `rgb(255, 255, 255)`) or a standard ansi color (e.g. `red`)
* @param text string to colorize
* @returns colorized string
*/
colorize: theme_1.colorize,
/**
* Add color to JSON.
*
* options
* pretty: set to true to pretty print the JSON (defaults to true)
* theme: theme to use for colorizing. See keys below for available options. All keys are optional and must be valid colors (e.g. hex code, rgb, or standard ansi color).
*
* Available theme keys:
* - brace
* - bracket
* - colon
* - comma
* - key
* - string
* - number
* - boolean
* - null
*/
colorizeJson: colorize_json_1.default,
/**
* Throw an error.
*
* If `exit` option is `false`, the error will be logged to stderr but not exit the process.
* If `exit` is set to a number, the process will exit with that code.
*/
error: error_1.error,
/**
* Exit the process with provided exit code (defaults to 0).
*/
exit: exit_1.exit,
/**
* Log a formatted string to stderr.
*
* See node's util.format() for formatting options.
*/
stderr: write_1.stderr,
/**
* Log a formatted string to stdout.
*
* See node's util.format() for formatting options.
*/
stdout: write_1.stdout,
/**
* Prints a pretty warning message to stderr.
*/
warn: warn_1.warn
};
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/ensure-arg-object.js
var require_ensure_arg_object = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/ensure-arg-object.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.ensureArgObject = ensureArgObject;
function ensureArgObject(args) {
return Array.isArray(args) ? (args ?? []).reduce((x, y) => ({ ...x, [y.name]: y }), {}) : args ?? {};
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/help/docopts.js
var require_docopts = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/help/docopts.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.DocOpts = void 0;
var ensure_arg_object_1 = require_ensure_arg_object(), DocOpts = class _DocOpts {
cmd;
flagList;
flagMap;
constructor(cmd) {
this.cmd = cmd, this.flagMap = {}, this.flagList = Object.entries(cmd.flags || {}).filter(([_, flag]) => !flag.hidden).map(([name, flag]) => (this.flagMap[name] = flag, flag));
}
static formatUsageType(flag, showFlagName, showOptions) {
if (flag.type !== "option")
return "";
let helpValues;
return flag.helpValue ? helpValues = typeof flag.helpValue == "string" ? [flag.helpValue] : flag.helpValue : flag.options ? helpValues = [showOptions ? flag.options.join("|") : "<option>"] : showFlagName ? helpValues = [flag.name] : helpValues = ["<value>"], helpValues.map((v) => `${v}${flag.multiple ? "..." : ""}`).join(" ");
}
static generate(cmd) {
return new _DocOpts(cmd).toString();
}
toString() {
let opts = ["<%= command.id %>"];
if (this.cmd.args) {
let suffix = this.cmd.strict === !1 ? "..." : "", a = Object.values((0, ensure_arg_object_1.ensureArgObject)(this.cmd.args)).filter((arg) => !arg.hidden).map((arg) => arg.required ? `${arg.name.toUpperCase()}${suffix}` : `[${arg.name.toUpperCase()}${suffix}]`) || [];
opts.push(...a);
}
try {
opts.push(...Object.values(this.groupFlagElements()));
} catch {
opts.push(...this.flagList.map((flag) => {
let name = flag.char ? `-${flag.char}` : `--${flag.name}`;
return flag.type === "boolean" ? name : `${name}=${_DocOpts.formatUsageType(flag, !1, !0)}`;
}));
}
return opts.join(" ");
}
combineElementsToFlag(elementMap, flagName, flagNames, unionString) {
if (!this.flagMap[flagName])
return;
let isRequired = this.flagMap[flagName]?.required;
(typeof isRequired != "boolean" || !isRequired) && (isRequired = flagNames.reduce((required, toCombine) => required || this.flagMap[toCombine]?.required || !1, !1));
for (let toCombine of flagNames)
elementMap[flagName] = `${elementMap[flagName] || ""}${unionString}${elementMap[toCombine] || ""}`, delete elementMap[toCombine], delete this.flagMap[toCombine];
elementMap[flagName] = isRequired ? `(${elementMap[flagName] || ""})` : `[${elementMap[flagName] || ""}]`, delete this.flagMap[flagName];
}
generateElements(elementMap = {}, flagGroups = []) {
let elementStrs = [];
for (let flag of flagGroups) {
let type = "", flagName = flag.char ? `-${flag.char}` : `--${flag.name}`;
flag.type === "option" && (type = ` ${_DocOpts.formatUsageType(flag, !1, !0)}`);
let element = `${flagName}${type}`;
elementMap[flag.name] = element, elementStrs.push(element);
}
return elementStrs;
}
groupFlagElements() {
let elementMap = {};
this.generateElements(elementMap, this.flagList.filter((flag) => flag.required)), this.generateElements(elementMap, this.flagList.filter((flag) => !flag.required));
for (let flag of this.flagList) {
Array.isArray(flag.dependsOn) && this.combineElementsToFlag(elementMap, flag.name, flag.dependsOn, " ");
let exclusive;
if (Array.isArray(flag.exclusive) && (exclusive = new Set(flag.exclusive)), Array.isArray(flag.combinable)) {
let combinableFlags = new Set(flag.combinable);
exclusive ??= /* @__PURE__ */ new Set();
for (let item of this.flagList)
flag !== item && !combinableFlags.has(item.name) && exclusive.add(item.name);
}
exclusive !== void 0 && exclusive.size > 0 && this.combineElementsToFlag(elementMap, flag.name, [...exclusive], " | ");
}
for (let remainingFlagName of Object.keys(this.flagMap)) {
let remainingFlag = this.flagMap[remainingFlagName] || {};
remainingFlag.required || (elementMap[remainingFlag.name] = `[${elementMap[remainingFlag.name] || ""}]`);
}
return elementMap;
}
};
exports.DocOpts = DocOpts;
}
});
// ../../node_modules/.pnpm/widest-line@3.1.0/node_modules/widest-line/index.js
var require_widest_line = __commonJS({
"../../node_modules/.pnpm/widest-line@3.1.0/node_modules/widest-line/index.js"(exports, module) {
"use strict";
init_cjs_shims();
var stringWidth = require_string_width(), widestLine = (input) => {
let max = 0;
for (let line of input.split(`
`))
max = Math.max(max, stringWidth(line));
return max;
};
module.exports = widestLine;
module.exports.default = widestLine;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/help/util.js
var require_util3 = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/help/util.js"(exports) {
"use strict";
init_cjs_shims();
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
k2 === void 0 && (k2 = k);
var desc = Object.getOwnPropertyDescriptor(m, k);
(!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) && (desc = { enumerable: !0, get: function() {
return m[k];
} }), Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
k2 === void 0 && (k2 = k), o[k2] = m[k];
})), __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: !0, value: v });
}) : function(o, v) {
o.default = v;
}), __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() {
var ownKeys = function(o) {
return ownKeys = Object.getOwnPropertyNames || function(o2) {
var ar = [];
for (var k in o2) Object.prototype.hasOwnProperty.call(o2, k) && (ar[ar.length] = k);
return ar;
}, ownKeys(o);
};
return function(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) k[i] !== "default" && __createBinding(result, mod, k[i]);
return __setModuleDefault(result, mod), result;
};
})();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.template = template;
exports.standardizeIDFromArgv = standardizeIDFromArgv;
exports.getHelpFlagAdditions = getHelpFlagAdditions;
exports.formatFlagDeprecationWarning = formatFlagDeprecationWarning;
exports.formatCommandDeprecationWarning = formatCommandDeprecationWarning;
exports.normalizeArgv = normalizeArgv;
var ejs = __importStar(require_ejs()), util_1 = require_util2(), ids_1 = require_ids();
function template(context) {
function render(t) {
return ejs.render(t, context);
}
return render;
}
var isFlag = (s) => s.startsWith("-"), isArgWithValue = (s) => s.includes("=");
function collateSpacedCmdIDFromArgs(argv, config) {
if (argv.length === 1)
return argv;
let id = ((argv2) => {
let ids = (0, util_1.collectUsableIds)(config.commandIDs), final = [], idPresent = (id2) => ids.has(id2), finalizeId = (s) => (s ? [...final, s] : final).filter(Boolean).join(":"), hasArgs = () => {
let id2 = finalizeId();
if (!id2)
return !1;
let cmd = config.findCommand(id2);
return !!(cmd && (cmd.strict === !1 || Object.keys(cmd.args ?? {}).length > 0));
};
for (let arg of argv2)
if (idPresent(finalizeId(arg)))
final.push(arg);
else {
if (isArgWithValue(arg) || isFlag(arg) || hasArgs())
break;
final.push(arg);
}
return finalizeId();
})(argv);
if (id) {
let argvSlice = argv.slice(id.split(":").length);
return [id, ...argvSlice];
}
return argv;
}
function standardizeIDFromArgv(argv, config) {
return argv.length === 0 || (config.topicSeparator === " " ? argv = collateSpacedCmdIDFromArgs(argv, config) : config.topicSeparator !== ":" && (argv[0] = (0, ids_1.toStandardizedId)(argv[0], config))), argv;
}
function getHelpFlagAdditions(config) {
let helpFlags = ["--help"], additionalHelpFlags = config.pjson.oclif.additionalHelpFlags ?? [];
return [...(/* @__PURE__ */ new Set([...additionalHelpFlags, ...helpFlags])).values()];
}
function formatFlagDeprecationWarning(flag, opts) {
let message = `The "${flag}" flag has been deprecated`;
return opts === !0 ? `${message}.` : opts.message ? opts.message : (opts.version && (message += ` and will be removed in version ${opts.version}`), message += opts.to ? `. Use "${opts.to}" instead.` : ".", message);
}
function formatCommandDeprecationWarning(command, opts) {
let message = `The "${command}" command has been deprecated`;
return opts ? opts.message ? opts.message : (opts.version && (message += ` and will be removed in version ${opts.version}`), message += opts.to ? `. Use "${opts.to}" instead.` : ".", message) : `${message}.`;
}
function normalizeArgv(config, argv = process.argv.slice(2)) {
return config.topicSeparator !== ":" && !argv[0]?.includes(":") && (argv = standardizeIDFromArgv(argv, config)), argv;
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/help/formatter.js
var require_formatter = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/help/formatter.js"(exports) {
"use strict";
init_cjs_shims();
var __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.HelpFormatter = void 0;
var ansis_1 = __importDefault(require_ansis()), indent_string_1 = __importDefault(require_indent_string()), string_width_1 = __importDefault(require_string_width()), widest_line_1 = __importDefault(require_widest_line()), wrap_ansi_1 = __importDefault(require_wrap_ansi()), screen_1 = require_screen(), theme_1 = require_theme2(), util_1 = require_util3(), HelpFormatter = class {
config;
indentSpacing = 2;
opts;
/**
* Takes a string and replaces `<%= prop =>` with the value of prop, where prop is anything on
* `config=Interfaces.Config` or `opts=Interface.HelpOptions`.
*
* ```javascript
* `<%= config.bin =>` // will resolve to the bin defined in `pjson.oclif`.
* ```
*/
render;
constructor(config, opts = {}) {
this.config = config, this.opts = { maxWidth: screen_1.stdtermwidth, ...opts }, this.render = (0, util_1.template)(this);
}
/**
* Indent by `this.indentSpacing`. The text should be wrap based on terminal width before indented.
*
* In order to call indent multiple times on the same set or text, the caller must wrap based on
* the number of times the text has been indented. For example.
*
* ```javascript
* const body = `main line\n${indent(wrap('indented example line', 4))}`
* const header = 'SECTION'
* console.log(`${header}\n${indent(wrap(body))}`
* ```
* will output
* ```
* SECTION
* main line
* indented example line
* ```
*
* If the terminal width was 24 and the `4` was not provided in the first wrap, it would like like the following.
* ```
* SECTION
* main line
* indented example
* line
* ```
* @param body the text to indent
* @param spacing the final number of spaces this text will be indented
* @returns the formatted indented text
*/
indent(body, spacing = this.indentSpacing) {
return (0, indent_string_1.default)(body, spacing);
}
renderList(input, opts) {
if (input.length === 0)
return "";
let renderMultiline = () => {
let output2 = "";
for (let [left, right] of input)
!left && !right || (left && (opts.stripAnsi && (left = ansis_1.default.strip(left)), output2 += this.wrap(left.trim(), opts.indentation)), right && (opts.stripAnsi && (right = ansis_1.default.strip(right)), output2 += `
`, output2 += this.indent(this.wrap(right.trim(), opts.indentation + 2), 4)), output2 += `
`);
return output2.trim();
};
if (opts.multiline)
return renderMultiline();
let maxLength = (0, widest_line_1.default)(input.map((i) => i[0]).join(`
`)), output = "", spacer = opts.spacer || `
`, cur = "";
for (let [left, r] of input) {
let right = r;
if (cur && (output += spacer, output += cur), cur = left || "", opts.stripAnsi && (cur = ansis_1.default.strip(cur)), !right) {
cur = cur.trim();
continue;
}
opts.stripAnsi && (right = ansis_1.default.strip(right)), right = this.wrap(right.trim(), opts.indentation + maxLength + 2);
let [first, ...lines] = right.split(`
`).map((s) => s.trim());
if (cur += " ".repeat(maxLength - (0, string_width_1.default)(cur) + 2), cur += first, lines.length !== 0) {
if (lines.length > 4)
return renderMultiline();
opts.spacer || (spacer = `
`), cur += `
`, cur += this.indent(lines.join(`
`), maxLength + 2);
}
}
return cur && (output += spacer, output += cur), output.trim();
}
section(header, body) {
let newBody;
if (typeof body == "string")
newBody = this.render(body);
else if (Array.isArray(body))
newBody = body.map((entry) => {
if ("name" in entry) {
let tableEntry = entry;
return [this.render(tableEntry.name), this.render(tableEntry.description)];
}
let [left, right] = entry;
return [this.render(left), right && this.render(right)];
});
else {
if ("header" in body)
return this.section(body.header, body.body);
newBody = body.map((entry) => [entry.name, entry.description]).map(([left, right]) => [this.render(left), right && this.render(right)]);
}
let output = [
(0, theme_1.colorize)(this.config?.theme?.sectionHeader, (0, theme_1.colorize)("bold", header)),
(0, theme_1.colorize)(this.config?.theme?.sectionDescription, this.indent(Array.isArray(newBody) ? this.renderList(newBody, { indentation: 2, stripAnsi: this.opts.stripAnsi }) : newBody))
].join(`
`);
return this.opts.stripAnsi ? ansis_1.default.strip(output) : output;
}
/**
* Wrap text according to `opts.maxWidth` which is typically set to the terminal width. All text
* will be rendered before bring wrapped, otherwise it could mess up the lengths.
*
* A terminal will automatically wrap text, so this method is primarily used for indented
* text. For indented text, specify the indentation so it is taken into account during wrapping.
*
* Here is an example of wrapping with indentation.
* ```
* <------ terminal window width ------>
* <---------- no indentation --------->
* This is my text that will be wrapped
* once it passes maxWidth.
*
* <- indent -><------ text space ----->
* This is my text that will
* be wrapped once it passes
* maxWidth.
*
* <-- indent not taken into account ->
* This is my text that will
* be wrapped
* once it passes maxWidth.
* ```
* @param body the text to wrap
* @param spacing the indentation size to subtract from the terminal width
* @returns the formatted wrapped text
*/
wrap(body, spacing = this.indentSpacing) {
return (0, wrap_ansi_1.default)(this.render(body), this.opts.maxWidth - spacing, { hard: !0 });
}
};
exports.HelpFormatter = HelpFormatter;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/help/command.js
var require_command = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/help/command.js"(exports) {
"use strict";
init_cjs_shims();
var __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.CommandHelp = void 0;
var ansis_1 = __importDefault(require_ansis()), ensure_arg_object_1 = require_ensure_arg_object(), ids_1 = require_ids(), util_1 = require_util(), theme_1 = require_theme2(), docopts_1 = require_docopts(), formatter_1 = require_formatter(), POSSIBLE_LINE_FEED = /\r\n|\n/;
function determineSortOrder(flagSortOrder) {
return flagSortOrder === "alphabetical" ? "alphabetical" : flagSortOrder === "none" ? "none" : "alphabetical";
}
var CommandHelp = class extends formatter_1.HelpFormatter {
command;
config;
opts;
constructor(command, config, opts) {
super(config, opts), this.command = command, this.config = config, this.opts = opts;
}
aliases(aliases) {
return !aliases || aliases.length === 0 ? void 0 : aliases.map((a) => [
(0, theme_1.colorize)(this.config?.theme?.dollarSign, "$"),
(0, theme_1.colorize)(this.config?.theme?.bin, this.config.bin),
(0, theme_1.colorize)(this.config?.theme?.alias, a)
].join(" ")).join(`
`);
}
arg(arg) {
let name = arg.name.toUpperCase();
return arg.required ? `${name}` : `[${name}]`;
}
args(args) {
if (args.filter((a) => a.description).length !== 0)
return args.map((a) => {
let name = this.command.strict === !1 ? `${a.name.toUpperCase()}...` : a.name.toUpperCase();
name = a.required ? `${name}` : `[${name}]`;
let description = a.description || "";
return a.default && (description = `${(0, theme_1.colorize)(this.config?.theme?.flagDefaultValue, `[default: ${a.default}]`)} ${description}`), a.options && (description = `${(0, theme_1.colorize)(this.config?.theme?.flagOptions, `(${a.options.join("|")})`)} ${description}`), [
(0, theme_1.colorize)(this.config?.theme?.flag, name),
description ? (0, theme_1.colorize)(this.config?.theme?.sectionDescription, description) : void 0
];
});
}
defaultUsage() {
return this.opts.docopts === void 0 || this.opts.docopts ? docopts_1.DocOpts.generate(this.command) : (0, util_1.compact)([
this.command.id,
Object.values(this.command.args ?? {})?.filter((a) => !a.hidden).map((a) => this.arg(a)).join(" ")
]).join(" ");
}
description() {
let cmd = this.command, description;
if (this.opts.hideCommandSummaryInDescription)
description = [(cmd.description || "").split(POSSIBLE_LINE_FEED).at(-1) ?? ""];
else if (cmd.description) {
let summary = cmd.summary ? `${cmd.summary}
` : null;
description = summary ? [...summary.split(POSSIBLE_LINE_FEED), ...(cmd.description || "").split(POSSIBLE_LINE_FEED)] : (cmd.description || "").split(POSSIBLE_LINE_FEED);
}
if (description)
return this.wrap(description.join(`
`));
}
examples(examples) {
return !examples || examples.length === 0 ? void 0 : (0, util_1.castArray)(examples).map((a) => {
let description, commands;
if (typeof a == "string") {
let lines = a.split(POSSIBLE_LINE_FEED).filter(Boolean);
if (lines.length >= 2 && !this.isCommand(lines[0]) && lines.slice(1).every((i) => this.isCommand(i)))
description = lines[0], commands = lines.slice(1);
else
return lines.map((line) => this.formatIfCommand(line)).join(`
`);
} else
description = a.description, commands = [a.command];
let multilineSeparator = this.config.platform === "win32" ? this.config.shell.includes("powershell") ? "`" : "^" : "\\", finalIndentedSpacing = this.indentSpacing * 2, multilineCommands = commands.map((c) => (
// First indent keeping room for escaped newlines
this.indent(this.wrap(this.formatIfCommand(c), finalIndentedSpacing + 4)).split(POSSIBLE_LINE_FEED).join(` ${multilineSeparator}
`)
)).join(`
`);
return `${this.wrap(description, finalIndentedSpacing)}
${multilineCommands}`;
}).join(`
`);
}
flagHelpLabel(flag, showOptions = !1) {
let label = flag.helpLabel;
if (!label) {
let labels = [];
labels.push(flag.char ? `-${flag.char[0]}` : " "), flag.name && (flag.type === "boolean" && flag.allowNo ? labels.push(`--[no-]${flag.name.trim()}`) : labels.push(`--${flag.name.trim()}`)), label = labels.join(flag.char ? (0, theme_1.colorize)(this.config?.theme?.flagSeparator, ", ") : " ");
}
if (flag.type === "option") {
let value = docopts_1.DocOpts.formatUsageType(flag, this.opts.showFlagNameInTitle ?? !1, this.opts.showFlagOptionsInTitle ?? showOptions);
value.includes("|") || (value = (0, theme_1.colorize)("underline", value)), label += `=${value}`;
}
return (0, theme_1.colorize)(this.config.theme?.flag, label);
}
flags(flags) {
if (flags.length === 0)
return;
let noChar = flags.reduce((previous, current) => previous && current.char === void 0, !0);
return flags.map((flag) => {
let left = this.flagHelpLabel(flag);
noChar && (left = left.replace(" ", ""));
let right = flag.summary || flag.description || "", metadata = [], canBeCached = !(this.opts.respectNoCacheDefault === !0 && flag.noCacheDefault === !0);
return flag.type === "option" ? (flag.default && canBeCached && metadata.push(`default: ${flag.default}`), flag.env && metadata.push(`env: ${flag.env}`)) : flag.type === "boolean" && flag.env && metadata.push(`env: ${flag.env}`), metadata.length > 0 && (right = `${(0, theme_1.colorize)(this.config?.theme?.flagDefaultValue, `[${metadata.join(", ")}]`)} ${right}`), flag.required && (right = `${(0, theme_1.colorize)(this.config?.theme?.flagRequired, "(required)")} ${right}`), flag.type === "option" && flag.options && !flag.helpValue && !this.opts.showFlagOptionsInTitle && (right += (0, theme_1.colorize)(this.config?.theme?.flagOptions, `
<options: ${flag.options.join("|")}>`)), [left, (0, theme_1.colorize)(this.config?.theme?.sectionDescription, right.trim())];
});
}
flagsDescriptions(flags) {
let flagsWithExtendedDescriptions = flags.filter((flag) => flag.summary && flag.description);
return flagsWithExtendedDescriptions.length === 0 ? void 0 : flagsWithExtendedDescriptions.map((flag) => {
let summary = flag.summary || "", flagHelp = this.flagHelpLabel(flag, !0);
return flag.char || (flagHelp = flagHelp.replace(" ", "")), flagHelp += flagHelp.length + summary.length + 2 < this.opts.maxWidth ? " " + summary : `
` + this.indent(this.wrap(summary, this.indentSpacing * 2)), `${flagHelp}
${this.indent(this.wrap(flag.description || "", this.indentSpacing * 2))}`;
}).join(`
`);
}
generate() {
let cmd = this.command, unsortedFlags = Object.entries(cmd.flags || {}).filter(([, v]) => !v.hidden).map(([k, v]) => (v.name = k, v)), flags = determineSortOrder(this.opts.flagSortOrder) === "alphabetical" ? (0, util_1.sortBy)(unsortedFlags, (f) => [!f.char, f.char, f.name]) : unsortedFlags, args = Object.values((0, ensure_arg_object_1.ensureArgObject)(cmd.args)).filter((a) => !a.hidden);
return (0, util_1.compact)(this.sections().map(({ generate, header }) => {
let body = generate({ args, cmd, flags }, header);
return Array.isArray(body) ? body.map((helpSection) => helpSection && helpSection.body && this.section(helpSection.header, helpSection.body)).join(`
`) : body && this.section(header, body);
})).join(`
`);
}
groupFlags(flags) {
let mainFlags = [], flagGroups = {};
for (let flag of flags) {
let group = flag.helpGroup;
group ? (flagGroups[group] || (flagGroups[group] = []), flagGroups[group].push(flag)) : mainFlags.push(flag);
}
return { flagGroups, mainFlags };
}
sections() {
let sections = [
{
generate: () => this.usage(),
header: this.opts.usageHeader || "USAGE"
},
{
generate: ({ args }, header) => [{ body: this.args(args), header }],
header: "ARGUMENTS"
},
{
generate: ({ flags }, header) => {
let { flagGroups, mainFlags } = this.groupFlags(flags), flagSections = [], mainFlagBody = this.flags(mainFlags);
mainFlagBody && flagSections.push({ body: mainFlagBody, header });
for (let [name, flags2] of Object.entries(flagGroups)) {
let body = this.flags(flags2);
body && flagSections.push({ body, header: `${name.toUpperCase()} ${header}` });
}
return (0, util_1.compact)(flagSections);
},
header: "FLAGS"
},
{
generate: () => this.description(),
header: "DESCRIPTION"
},
{
generate: ({ cmd }) => this.aliases(cmd.aliases),
header: "ALIASES"
},
{
generate: ({ cmd }) => {
let examples = cmd.examples || cmd.example;
return this.examples(examples);
},
header: "EXAMPLES"
},
{
generate: ({ flags }) => this.flagsDescriptions(flags),
header: "FLAG DESCRIPTIONS"
}
], allowedSections = this.opts.sections?.map((s) => s.toLowerCase());
return sections.filter(({ header }) => !allowedSections || allowedSections.includes(header.toLowerCase()));
}
usage() {
let { id, usage } = this.command, standardId = (0, ids_1.toStandardizedId)(id, this.config), configuredId = (0, ids_1.toConfiguredId)(id, this.config);
return (usage ? (0, util_1.castArray)(usage) : [this.defaultUsage()]).map((u) => {
let allowedSpacing = this.opts.maxWidth - this.indentSpacing, dollarSign = (0, theme_1.colorize)(this.config?.theme?.dollarSign, "$"), bin = (0, theme_1.colorize)(this.config?.theme?.bin, this.config.bin), command = (0, theme_1.colorize)(this.config?.theme?.command, "<%= command.id %>"), commandDescription = (0, theme_1.colorize)(this.config?.theme?.sectionDescription, u.replace("<%= command.id %>", "").replace(new RegExp(`^${standardId}`), "").replace(new RegExp(`^${configuredId}`), "").trim()), line = `${dollarSign} ${bin} ${command} ${commandDescription}`.trim();
if (line.length > allowedSpacing) {
let splitIndex = line.slice(0, Math.max(0, allowedSpacing)).lastIndexOf(" ");
return line.slice(0, Math.max(0, splitIndex)) + `
` + this.indent(this.wrap(line.slice(Math.max(0, splitIndex)), this.indentSpacing * 2));
}
return this.wrap(line);
}).join(`
`);
}
formatIfCommand(example) {
example = this.render(example);
let dollarSign = (0, theme_1.colorize)(this.config?.theme?.dollarSign, "$");
return example.startsWith(this.config.bin) ? `${dollarSign} ${example}` : example.startsWith(`$ ${this.config.bin}`) ? `${dollarSign}${example.replace("$", "")}` : example;
}
isCommand(example) {
return ansis_1.default.strip(this.formatIfCommand(example)).startsWith(`${(0, theme_1.colorize)(this.config?.theme?.dollarSign, "$")} ${this.config.bin}`);
}
};
exports.CommandHelp = CommandHelp;
exports.default = CommandHelp;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/help/root.js
var require_root = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/help/root.js"(exports) {
"use strict";
init_cjs_shims();
var __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, "__esModule", { value: !0 });
var ansis_1 = __importDefault(require_ansis()), util_1 = require_util(), theme_1 = require_theme2(), formatter_1 = require_formatter(), RootHelp = class extends formatter_1.HelpFormatter {
config;
opts;
constructor(config, opts) {
super(config, opts), this.config = config, this.opts = opts;
}
description() {
let description = this.config.pjson.oclif.description || this.config.pjson.description || "";
if (description = this.render(description), description = description.split(`
`).slice(1).join(`
`), !!description)
return this.section("DESCRIPTION", this.wrap((0, theme_1.colorize)(this.config?.theme?.sectionDescription, description)));
}
root() {
let description = this.config.pjson.oclif.description || this.config.pjson.description || "";
description = this.render(description), description = description.split(`
`)[0];
let output = (0, util_1.compact)([
(0, theme_1.colorize)(this.config?.theme?.commandSummary, description),
this.version(),
this.usage(),
this.description()
]).join(`
`);
return this.opts.stripAnsi && (output = ansis_1.default.strip(output)), output;
}
usage() {
return this.section(this.opts.usageHeader || "USAGE", this.wrap(`${(0, theme_1.colorize)(this.config?.theme?.dollarSign, "$")} ${(0, theme_1.colorize)(this.config?.theme?.bin, this.config.bin)} ${(0, theme_1.colorize)(this.config?.theme?.sectionDescription, "[COMMAND]")}`));
}
version() {
return this.section("VERSION", this.wrap((0, theme_1.colorize)(this.config?.theme?.version, this.config.userAgent)));
}
};
exports.default = RootHelp;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/help/index.js
var require_help = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/help/index.js"(exports) {
"use strict";
init_cjs_shims();
var __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.Help = exports.HelpBase = exports.standardizeIDFromArgv = exports.normalizeArgv = exports.getHelpFlagAdditions = exports.HelpFormatter = exports.CommandHelp = void 0;
exports.loadHelpClass = loadHelpClass;
var ansis_1 = __importDefault(require_ansis()), ts_path_1 = require_ts_path(), error_1 = require_error(), module_loader_1 = require_module_loader(), symbols_1 = require_symbols(), cache_default_value_1 = require_cache_default_value(), ids_1 = require_ids(), util_1 = require_util(), ux_1 = require_ux(), theme_1 = require_theme2(), command_1 = require_command(), formatter_1 = require_formatter(), root_1 = __importDefault(require_root()), util_2 = require_util3(), command_2 = require_command();
Object.defineProperty(exports, "CommandHelp", { enumerable: !0, get: function() {
return command_2.CommandHelp;
} });
var formatter_2 = require_formatter();
Object.defineProperty(exports, "HelpFormatter", { enumerable: !0, get: function() {
return formatter_2.HelpFormatter;
} });
var util_3 = require_util3();
Object.defineProperty(exports, "getHelpFlagAdditions", { enumerable: !0, get: function() {
return util_3.getHelpFlagAdditions;
} });
Object.defineProperty(exports, "normalizeArgv", { enumerable: !0, get: function() {
return util_3.normalizeArgv;
} });
Object.defineProperty(exports, "standardizeIDFromArgv", { enumerable: !0, get: function() {
return util_3.standardizeIDFromArgv;
} });
function getHelpSubject(args, config) {
let mergedHelpFlags = (0, util_2.getHelpFlagAdditions)(config);
for (let arg of args) {
if (arg === "--")
return;
if (!(mergedHelpFlags.includes(arg) || arg === "help"))
return arg.startsWith("-") ? void 0 : arg;
}
}
var HelpBase = class extends formatter_1.HelpFormatter {
constructor(config, opts = {}) {
super(config, opts), config.topicSeparator || (config.topicSeparator = ":");
}
};
exports.HelpBase = HelpBase;
var Help = class extends HelpBase {
CommandHelpClass = command_1.CommandHelp;
constructor(config, opts = {}) {
super(config, opts);
}
/*
* _topics is to work around Interfaces.topics mistakenly including commands that do
* not have children, as well as topics. A topic has children, either commands or other topics. When
* this is fixed upstream config.topics should return *only* topics with children,
* and this can be removed.
*/
get _topics() {
return this.config.topics.filter((topic) => this.config.topics.some((subTopic) => subTopic.name.includes(`${topic.name}:`)));
}
get sortedCommands() {
let { commands } = this.config;
return commands = commands.filter((c) => this.opts.all || !c.hidden), commands = (0, util_1.sortBy)(commands, (c) => c.id), commands = (0, util_1.uniqBy)(commands, (c) => c.id), commands;
}
get sortedTopics() {
let topics = this._topics;
return topics = topics.filter((t) => this.opts.all || !t.hidden), topics = (0, util_1.sortBy)(topics, (t) => t.name), topics = (0, util_1.uniqBy)(topics, (t) => t.name), topics;
}
command(command) {
return this.formatCommand(command);
}
description(c) {
let description = this.render(c.description || "");
return c.summary ? description : description.split(`
`).slice(1).join(`
`);
}
formatCommand(command) {
return this.config.topicSeparator !== ":" && (command.id = command.id.replaceAll(":", this.config.topicSeparator), command.aliases = command.aliases && command.aliases.map((a) => a.replaceAll(":", this.config.topicSeparator))), this.getCommandHelpClass(command).generate();
}
formatCommands(commands) {
if (commands.length === 0)
return "";
let body = this.renderList(commands.filter((c) => this.opts.hideAliasesFromRoot ? !c.aliases?.includes(c.id) : !0).map((c) => {
this.config.topicSeparator !== ":" && (c.id = c.id.replaceAll(":", this.config.topicSeparator));
let summary = this.summary(c);
return [
(0, theme_1.colorize)(this.config?.theme?.command, c.id),
summary && (0, theme_1.colorize)(this.config?.theme?.sectionDescription, ansis_1.default.strip(summary))
];
}), {
indentation: 2,
spacer: `
`,
stripAnsi: this.opts.stripAnsi
});
return this.section("COMMANDS", body);
}
formatRoot() {
return new root_1.default(this.config, this.opts).root();
}
formatTopic(topic) {
let description = this.render(topic.description || ""), summary = description.split(`
`)[0];
description = description.split(`
`).slice(1).join(`
`);
let topicID = `${topic.name}:COMMAND`;
this.config.topicSeparator !== ":" && (topicID = topicID.replaceAll(":", this.config.topicSeparator));
let output = (0, util_1.compact)([
(0, theme_1.colorize)(this.config?.theme?.commandSummary, summary),
this.section(this.opts.usageHeader || "USAGE", `${(0, theme_1.colorize)(this.config?.theme?.dollarSign, "$")} ${(0, theme_1.colorize)(this.config?.theme?.bin, this.config.bin)} ${topicID}`),
description && this.section("DESCRIPTION", this.wrap((0, theme_1.colorize)(this.config?.theme?.sectionDescription, description)))
]).join(`
`);
return this.opts.stripAnsi && (output = ansis_1.default.strip(output)), output + `
`;
}
formatTopics(topics) {
if (topics.length === 0)
return "";
let body = this.renderList(topics.map((c) => (this.config.topicSeparator !== ":" && (c.name = c.name.replaceAll(":", this.config.topicSeparator)), [
(0, theme_1.colorize)(this.config?.theme?.topic, c.name),
c.description && this.render((0, theme_1.colorize)(this.config?.theme?.sectionDescription, c.description.split(`
`)[0]))
])), {
indentation: 2,
spacer: `
`,
stripAnsi: this.opts.stripAnsi
});
return this.section("TOPICS", body);
}
getCommandHelpClass(command) {
return new this.CommandHelpClass(command, this.config, this.opts);
}
log(...args) {
return this.opts.sendToStderr ? ux_1.ux.stderr(args) : ux_1.ux.stdout(args);
}
async showCommandHelp(command) {
let name = command.id, depth = name.split(":").length, subTopics = this.sortedTopics.filter((t) => t.name.startsWith(name + ":") && t.name.split(":").length === depth + 1), subCommands = this.sortedCommands.filter((c) => c.id.startsWith(name + ":") && c.id.split(":").length === depth + 1), plugin = this.config.plugins.get(command.pluginName), state = this.config.pjson?.oclif?.state || plugin?.pjson?.oclif?.state || command.state;
if (state && this.log(state === "deprecated" ? `${(0, util_2.formatCommandDeprecationWarning)((0, ids_1.toConfiguredId)(name, this.config), command.deprecationOptions)}
` : `This command is in ${state}.
`), command.deprecateAliases && command.aliases.includes(name)) {
let actualCmd = this.config.commands.find((c) => c.aliases.includes(name)), actualCmdName = actualCmd ? (0, ids_1.toConfiguredId)(actualCmd.id, this.config) : "", opts = { ...command.deprecationOptions, ...actualCmd ? { to: actualCmdName } : {} };
this.log(`${(0, util_2.formatCommandDeprecationWarning)((0, ids_1.toConfiguredId)(name, this.config), opts)}
`);
}
let summary = this.summary(command);
if (summary && this.log(summary + `
`), this.log(this.formatCommand(command)), this.log(""), subTopics.length > 0 && (this.log(this.formatTopics(subTopics)), this.log("")), subCommands.length > 0) {
let aliases = [], uniqueSubCommands = subCommands.filter((p) => (aliases.push(...p.aliases), !aliases.includes(p.id)));
this.log(this.formatCommands(uniqueSubCommands)), this.log("");
}
}
async showHelp(argv) {
let originalArgv = argv.slice(1);
argv = argv.filter((arg) => !(0, util_2.getHelpFlagAdditions)(this.config).includes(arg)), this.config.topicSeparator !== ":" && (argv = (0, util_2.standardizeIDFromArgv)(argv, this.config));
let subject = getHelpSubject(argv, this.config);
if (!subject) {
if (this.config.isSingleCommandCLI) {
let rootCmd = this.config.findCommand(symbols_1.SINGLE_COMMAND_CLI_SYMBOL);
if (rootCmd) {
rootCmd.id = "", await this.showCommandHelp(rootCmd);
return;
}
}
await this.showRootHelp();
return;
}
let command = this.config.findCommand(subject);
if (command) {
if (command.id === symbols_1.SINGLE_COMMAND_CLI_SYMBOL && (command.id = ""), command.hasDynamicHelp && command.pluginType !== "jit") {
let loaded = await command.load();
for (let [name, flag] of Object.entries(loaded.flags ?? {}))
flag.type !== "boolean" && (command.flags[name].default = await (0, cache_default_value_1.cacheDefaultValue)(flag, !1));
await this.showCommandHelp(command);
} else
await this.showCommandHelp(command);
return;
}
let topic = this.config.findTopic(subject);
if (topic) {
await this.showTopicHelp(topic);
return;
}
if (this.config.flexibleTaxonomy) {
let matches = this.config.findMatches(subject, originalArgv);
if (matches.length > 0 && (await this.config.runHook("command_incomplete", {
argv: originalArgv.filter((o) => !subject.split(":").includes(o)),
id: subject,
matches
})).successes.length > 0)
return;
}
(0, error_1.error)(`Command ${subject} not found.`);
}
async showRootHelp() {
let rootTopics = this.sortedTopics, rootCommands = this.sortedCommands, state = this.config.pjson?.oclif?.state;
state && this.log(state === "deprecated" ? `${this.config.bin} is deprecated` : `${this.config.bin} is in ${state}.
`), this.log(this.formatRoot()), this.log(""), this.opts.all || (rootTopics = rootTopics.filter((t) => !t.name.includes(":")), rootCommands = rootCommands.filter((c) => !c.id.includes(":"))), rootTopics.length > 0 && (this.log(this.formatTopics(rootTopics)), this.log("")), rootCommands.length > 0 && (rootCommands = rootCommands.filter((c) => c.id), this.log(this.formatCommands(rootCommands)), this.log(""));
}
async showTopicHelp(topic) {
let { name } = topic, depth = name.split(":").length, subTopics = this.sortedTopics.filter((t) => t.name.startsWith(name + ":") && t.name.split(":").length === depth + 1), commands = this.sortedCommands.filter((c) => c.id.startsWith(name + ":") && c.id.split(":").length === depth + 1), state = this.config.pjson?.oclif?.state;
state && this.log(`This topic is in ${state}.
`), this.log(this.formatTopic(topic)), subTopics.length > 0 && (this.log(this.formatTopics(subTopics)), this.log("")), commands.length > 0 && (this.log(this.formatCommands(commands)), this.log(""));
}
summary(c) {
if (!(this.opts.sections && !this.opts.sections.map((s) => s.toLowerCase()).includes("summary")))
return c.summary ? (0, theme_1.colorize)(this.config?.theme?.commandSummary, this.render(c.summary.split(`
`)[0])) : c.description && (0, theme_1.colorize)(this.config?.theme?.commandSummary, this.render(c.description).split(`
`)[0]);
}
};
exports.Help = Help;
function extractClass(exported) {
return exported && exported.default ? exported.default : exported;
}
function determineLocation(helpClass) {
return typeof helpClass == "string" ? { identifier: "default", target: helpClass } : helpClass.identifier ? helpClass : { ...helpClass, identifier: "default" };
}
async function loadHelpClass(config) {
if (config.pjson.oclif?.helpClass) {
let { identifier, target } = determineLocation(config.pjson.oclif?.helpClass);
try {
let path = await (0, ts_path_1.tsPath)(config.root, target) ?? target, module2 = await (0, module_loader_1.load)(config, path), helpClass = module2[identifier] ?? (identifier === "default" ? extractClass(module2) : void 0);
return extractClass(helpClass);
} catch (error) {
throw new Error(`Unable to load configured help class "${target}", failed with message:
${error.message}`);
}
}
return Help;
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/errors/handle.js
var require_handle = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/errors/handle.js"(exports) {
"use strict";
init_cjs_shims();
var __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.Exit = void 0;
exports.handle = handle;
var clean_stack_1 = __importDefault(require_clean_stack()), cache_1 = __importDefault(require_cache()), index_1 = require_help(), logger_1 = require_logger(), cli_1 = require_cli(), exit_1 = require_exit(), pretty_print_1 = __importDefault(require_pretty_print());
exports.Exit = {
exit(code = 0) {
process.exit(code);
}
};
async function handle(err) {
try {
err || (err = new cli_1.CLIError("no error?")), err.message === "SIGINT" && exports.Exit.exit(1);
let shouldPrint = !(err instanceof exit_1.ExitError) && !err.skipOclifErrorHandling, pretty = (0, pretty_print_1.default)(err), stack = (0, clean_stack_1.default)(err.stack || "", { pretty: !0 });
if (shouldPrint) {
console.error(pretty ?? stack);
let config = cache_1.default.getInstance().get("config");
if (err.showHelp && err.parse?.input?.argv && config) {
let options = {
...config.pjson.oclif.helpOptions ?? config.pjson.helpOptions,
sections: ["flags", "usage", "arguments"],
sendToStderr: !0
}, help = new index_1.Help(config, options);
console.error(), await help.showHelp(process.argv.slice(2));
}
}
let exitCode = err.oclif?.exit ?? 1;
err.code !== "EEXIT" && stack && (0, logger_1.getLogger)().error(stack), exports.Exit.exit(exitCode);
} catch (error) {
console.error(err.stack), console.error(error.stack), exports.Exit.exit(1);
}
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/errors/index.js
var require_errors = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/errors/index.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.warn = exports.handle = exports.exit = exports.ModuleLoadError = exports.ExitError = exports.CLIError = exports.error = void 0;
var error_1 = require_error();
Object.defineProperty(exports, "error", { enumerable: !0, get: function() {
return error_1.error;
} });
var cli_1 = require_cli();
Object.defineProperty(exports, "CLIError", { enumerable: !0, get: function() {
return cli_1.CLIError;
} });
var exit_1 = require_exit();
Object.defineProperty(exports, "ExitError", { enumerable: !0, get: function() {
return exit_1.ExitError;
} });
var module_load_1 = require_module_load();
Object.defineProperty(exports, "ModuleLoadError", { enumerable: !0, get: function() {
return module_load_1.ModuleLoadError;
} });
var exit_2 = require_exit2();
Object.defineProperty(exports, "exit", { enumerable: !0, get: function() {
return exit_2.exit;
} });
var handle_1 = require_handle();
Object.defineProperty(exports, "handle", { enumerable: !0, get: function() {
return handle_1.handle;
} });
var warn_1 = require_warn();
Object.defineProperty(exports, "warn", { enumerable: !0, get: function() {
return warn_1.warn;
} });
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/performance.js
var require_performance = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/performance.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.Performance = exports.OCLIF_MARKER_OWNER = void 0;
var node_perf_hooks_1 = __require("node:perf_hooks"), logger_1 = require_logger(), settings_1 = require_settings();
exports.OCLIF_MARKER_OWNER = "@oclif/core";
var Marker = class {
owner;
name;
details;
method;
module;
scope;
stopped = !1;
startMarker;
stopMarker;
constructor(owner, name, details = {}) {
this.owner = owner, this.name = name, this.details = details, this.startMarker = `${this.name}-start`, this.stopMarker = `${this.name}-stop`;
let [caller, scope] = name.split("#"), [module2, method] = caller.split(".");
this.module = module2, this.method = method, this.scope = scope, node_perf_hooks_1.performance.mark(this.startMarker);
}
addDetails(details) {
this.details = { ...this.details, ...details };
}
measure() {
node_perf_hooks_1.performance.measure(this.name, this.startMarker, this.stopMarker);
}
stop() {
this.stopped = !0, node_perf_hooks_1.performance.mark(this.stopMarker);
}
}, Performance = class _Performance {
static _oclifPerf;
/* Key: marker.owner */
static _results = /* @__PURE__ */ new Map();
/* Key: marker.name */
static markers = /* @__PURE__ */ new Map();
/**
* Collect performance results into static Performance.results
*
* @returns Promise<void>
*/
static async collect() {
if (!_Performance.enabled || _Performance._results.size > 0)
return;
let markers = [..._Performance.markers.values()];
if (markers.length !== 0) {
for (let marker of markers.filter((m) => !m.stopped))
marker.stop();
return new Promise((resolve) => {
new node_perf_hooks_1.PerformanceObserver((items) => {
for (let entry of items.getEntries()) {
let marker = _Performance.markers.get(entry.name);
if (marker) {
let result = {
details: marker.details,
duration: entry.duration,
method: marker.method,
module: marker.module,
name: entry.name,
scope: marker.scope
}, existing = _Performance._results.get(marker.owner) ?? [];
_Performance._results.set(marker.owner, [...existing, result]);
}
}
let oclifResults = _Performance._results.get(exports.OCLIF_MARKER_OWNER) ?? [], command = oclifResults.find((r) => r.name.startsWith("config.runCommand")), commandLoadTime = command ? _Performance.getResult(exports.OCLIF_MARKER_OWNER, `plugin.findCommand#${command.details.plugin}.${command.details.command}`)?.duration ?? 0 : 0, pluginLoadTimes = Object.fromEntries(oclifResults.filter(({ name }) => name.startsWith("plugin.load#")).sort((a, b) => b.duration - a.duration).map(({ details, duration, scope }) => [scope, { details, duration }])), hookRunTimes = oclifResults.filter(({ name }) => name.startsWith("config.runHook#")).reduce((acc, perfResult) => {
let event = perfResult.details.event;
if (event)
acc[event] || (acc[event] = {}), acc[event][perfResult.scope] = perfResult.duration;
else {
let event2 = perfResult.scope;
acc[event2] || (acc[event2] = {}), acc[event2].total = perfResult.duration;
}
return acc;
}, {}), pluginLoadTimeByType = Object.fromEntries(oclifResults.filter(({ name }) => name.startsWith("config.loadPlugins#")).sort((a, b) => b.duration - a.duration).map(({ duration, scope }) => [scope, duration]));
_Performance._oclifPerf = {
hookRunTimes,
"oclif.commandLoadMs": commandLoadTime,
"oclif.commandRunMs": oclifResults.find(({ name }) => name.startsWith("config.runCommand#"))?.duration ?? 0,
"oclif.configLoadMs": _Performance.getResult(exports.OCLIF_MARKER_OWNER, "config.load")?.duration ?? 0,
"oclif.corePluginsLoadMs": pluginLoadTimeByType.core ?? 0,
"oclif.initHookMs": hookRunTimes.init?.total ?? 0,
"oclif.initMs": _Performance.getResult(exports.OCLIF_MARKER_OWNER, "main.run#init")?.duration ?? 0,
"oclif.linkedPluginsLoadMs": pluginLoadTimeByType.link ?? 0,
"oclif.postrunHookMs": hookRunTimes.postrun?.total ?? 0,
"oclif.prerunHookMs": hookRunTimes.prerun?.total ?? 0,
"oclif.runMs": _Performance.getResult(exports.OCLIF_MARKER_OWNER, "main.run")?.duration ?? 0,
"oclif.userPluginsLoadMs": pluginLoadTimeByType.user ?? 0,
pluginLoadTimes
}, resolve();
}).observe({ buffered: !0, entryTypes: ["measure"] });
for (let marker of markers)
try {
marker.measure();
} catch {
}
node_perf_hooks_1.performance.clearMarks();
});
}
}
/**
* Add debug logs for plugin loading performance
*/
static debug() {
if (!_Performance.enabled)
return;
let oclifDebug = (0, logger_1.makeDebug)("perf"), processUpTime = (process.uptime() * 1e3).toFixed(4);
oclifDebug("Process Uptime: %sms", processUpTime), oclifDebug("Oclif Time: %sms", _Performance.oclifPerf["oclif.runMs"].toFixed(4)), oclifDebug("Init Time: %sms", _Performance.oclifPerf["oclif.initMs"].toFixed(4)), oclifDebug("Config Load Time: %sms", _Performance.oclifPerf["oclif.configLoadMs"].toFixed(4)), oclifDebug(" \u2022 Root Plugin Load Time: %sms", _Performance.getResult(exports.OCLIF_MARKER_OWNER, "plugin.load#root")?.duration.toFixed(4) ?? 0), oclifDebug(" \u2022 Plugins Load Time: %sms", _Performance.getResult(exports.OCLIF_MARKER_OWNER, "config.loadAllPlugins")?.duration.toFixed(4) ?? 0), oclifDebug(" \u2022 Commands Load Time: %sms", _Performance.getResult(exports.OCLIF_MARKER_OWNER, "config.loadAllCommands")?.duration.toFixed(4) ?? 0), oclifDebug("Core Plugin Load Time: %sms", _Performance.oclifPerf["oclif.corePluginsLoadMs"].toFixed(4)), oclifDebug("User Plugin Load Time: %sms", _Performance.oclifPerf["oclif.userPluginsLoadMs"].toFixed(4)), oclifDebug("Linked Plugin Load Time: %sms", _Performance.oclifPerf["oclif.linkedPluginsLoadMs"].toFixed(4)), oclifDebug("Plugin Load Times:");
for (let [plugin, result] of Object.entries(_Performance.oclifPerf.pluginLoadTimes))
result.details.hasManifest ? oclifDebug(` ${plugin}: ${result.duration.toFixed(4)}ms`) : oclifDebug(` ${plugin}: ${result.duration.toFixed(4)}ms (no manifest!)`);
oclifDebug("Hook Run Times:");
for (let [event, runTimes] of Object.entries(_Performance.oclifPerf.hookRunTimes)) {
oclifDebug(` ${event}:`);
for (let [plugin, duration] of Object.entries(runTimes))
oclifDebug(` ${plugin}: ${duration.toFixed(4)}ms`);
}
oclifDebug("Command Load Time: %sms", _Performance.oclifPerf["oclif.commandLoadMs"].toFixed(4)), oclifDebug("Command Run Time: %sms", _Performance.oclifPerf["oclif.commandRunMs"].toFixed(4)), _Performance.oclifPerf["oclif.configLoadMs"] > _Performance.oclifPerf["oclif.runMs"] && oclifDebug("! Config load time is greater than total oclif time. This might mean that Config was instantiated before oclif was run.");
let nonCoreDebug = (0, logger_1.makeDebug)("non-oclif-perf"), nonCorePerf = _Performance.results;
if (nonCorePerf.size > 0) {
nonCoreDebug("Non-Core Performance Measurements:");
for (let [owner, results] of nonCorePerf) {
nonCoreDebug(` ${owner}:`);
for (let result of results)
nonCoreDebug(` ${result.name}: ${result.duration.toFixed(4)}ms`);
}
}
}
static getResult(owner, name) {
return _Performance._results.get(owner)?.find((r) => r.name === name);
}
/**
* Add a new performance marker
*
* @param owner An npm package like `@oclif/core` or `@salesforce/source-tracking`
* @param name Name of the marker. Use `module.method#scope` format
* @param details Arbitrary details to attach to the marker
* @returns Marker instance
*/
static mark(owner, name, details = {}) {
if (!_Performance.enabled)
return;
let marker = new Marker(owner, name, details);
return _Performance.markers.set(marker.name, marker), marker;
}
static get enabled() {
return settings_1.settings.performanceEnabled ?? !1;
}
static get oclifPerf() {
if (!_Performance.enabled)
return {};
if (_Performance._oclifPerf)
return _Performance._oclifPerf;
throw new Error("Perf results not available. Did you forget to call await Performance.collect()?");
}
/** returns a map of owner, PerfResult[]. Excludes oclif PerfResult, which you can get from oclifPerf */
static get results() {
return _Performance.enabled ? new Map([..._Performance._results.entries()].filter(([owner]) => owner !== exports.OCLIF_MARKER_OWNER)) : /* @__PURE__ */ new Map();
}
};
exports.Performance = Performance;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/determine-priority.js
var require_determine_priority = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/determine-priority.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.determinePriority = determinePriority;
function determinePriority(plugins, commands) {
return commands.sort((a, b) => {
let pluginAliasA = a.pluginAlias ?? "A-Cannot-Find-This", pluginAliasB = b.pluginAlias ?? "B-Cannot-Find-This", aIndex = plugins.indexOf(pluginAliasA), bIndex = plugins.indexOf(pluginAliasB);
return a.pluginType === "core" && b.pluginType === "core" ? aIndex - bIndex : b.pluginType === "core" && a.pluginType !== "core" ? 1 : a.pluginType === "core" && b.pluginType !== "core" ? -1 : a.pluginType === "jit" && b.pluginType !== "jit" ? 1 : b.pluginType === "jit" && a.pluginType !== "jit" ? -1 : 0;
})[0];
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/os.js
var require_os = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/os.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.getHomeDir = getHomeDir;
exports.getPlatform = getPlatform;
var node_os_1 = __require("node:os");
function getHomeDir() {
return (0, node_os_1.homedir)();
}
function getPlatform() {
return (0, node_os_1.platform)();
}
}
});
// ../../node_modules/.pnpm/balanced-match@4.0.3/node_modules/balanced-match/dist/commonjs/index.js
var require_commonjs = __commonJS({
"../../node_modules/.pnpm/balanced-match@4.0.3/node_modules/balanced-match/dist/commonjs/index.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.range = exports.balanced = void 0;
var balanced = (a, b, str) => {
let ma = a instanceof RegExp ? maybeMatch(a, str) : a, mb = b instanceof RegExp ? maybeMatch(b, str) : b, r = ma !== null && mb != null && (0, exports.range)(ma, mb, str);
return r && {
start: r[0],
end: r[1],
pre: str.slice(0, r[0]),
body: str.slice(r[0] + ma.length, r[1]),
post: str.slice(r[1] + mb.length)
};
};
exports.balanced = balanced;
var maybeMatch = (reg, str) => {
let m = str.match(reg);
return m ? m[0] : null;
}, range = (a, b, str) => {
let begs, beg, left, right, result, ai = str.indexOf(a), bi = str.indexOf(b, ai + 1), i = ai;
if (ai >= 0 && bi > 0) {
if (a === b)
return [ai, bi];
for (begs = [], left = str.length; i >= 0 && !result; ) {
if (i === ai)
begs.push(i), ai = str.indexOf(a, i + 1);
else if (begs.length === 1) {
let r = begs.pop();
r !== void 0 && (result = [r, bi]);
} else
beg = begs.pop(), beg !== void 0 && beg < left && (left = beg, right = bi), bi = str.indexOf(b, i + 1);
i = ai < bi && ai >= 0 ? ai : bi;
}
begs.length && right !== void 0 && (result = [left, right]);
}
return result;
};
exports.range = range;
}
});
// ../../node_modules/.pnpm/brace-expansion@5.0.6/node_modules/brace-expansion/dist/commonjs/index.js
var require_commonjs2 = __commonJS({
"../../node_modules/.pnpm/brace-expansion@5.0.6/node_modules/brace-expansion/dist/commonjs/index.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.EXPANSION_MAX = void 0;
exports.expand = expand;
var balanced_match_1 = require_commonjs(), escSlash = "\0SLASH" + Math.random() + "\0", escOpen = "\0OPEN" + Math.random() + "\0", escClose = "\0CLOSE" + Math.random() + "\0", escComma = "\0COMMA" + Math.random() + "\0", escPeriod = "\0PERIOD" + Math.random() + "\0", escSlashPattern = new RegExp(escSlash, "g"), escOpenPattern = new RegExp(escOpen, "g"), escClosePattern = new RegExp(escClose, "g"), escCommaPattern = new RegExp(escComma, "g"), escPeriodPattern = new RegExp(escPeriod, "g"), slashPattern = /\\\\/g, openPattern = /\\{/g, closePattern = /\\}/g, commaPattern = /\\,/g, periodPattern = /\\\./g;
exports.EXPANSION_MAX = 1e5;
function numeric(str) {
return isNaN(str) ? str.charCodeAt(0) : parseInt(str, 10);
}
function escapeBraces(str) {
return str.replace(slashPattern, escSlash).replace(openPattern, escOpen).replace(closePattern, escClose).replace(commaPattern, escComma).replace(periodPattern, escPeriod);
}
function unescapeBraces(str) {
return str.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, ".");
}
function parseCommaParts(str) {
if (!str)
return [""];
let parts = [], m = (0, balanced_match_1.balanced)("{", "}", str);
if (!m)
return str.split(",");
let { pre, body, post } = m, p = pre.split(",");
p[p.length - 1] += "{" + body + "}";
let postParts = parseCommaParts(post);
return post.length && (p[p.length - 1] += postParts.shift(), p.push.apply(p, postParts)), parts.push.apply(parts, p), parts;
}
function expand(str, options = {}) {
if (!str)
return [];
let { max = exports.EXPANSION_MAX } = options;
return str.slice(0, 2) === "{}" && (str = "\\{\\}" + str.slice(2)), expand_(escapeBraces(str), max, !0).map(unescapeBraces);
}
function embrace(str) {
return "{" + str + "}";
}
function isPadded(el) {
return /^-?0\d/.test(el);
}
function lte(i, y) {
return i <= y;
}
function gte(i, y) {
return i >= y;
}
function expand_(str, max, isTop) {
let expansions = [], m = (0, balanced_match_1.balanced)("{", "}", str);
if (!m)
return [str];
let pre = m.pre, post = m.post.length ? expand_(m.post, max, !1) : [""];
if (/\$$/.test(m.pre))
for (let k = 0; k < post.length && k < max; k++) {
let expansion = pre + "{" + m.body + "}" + post[k];
expansions.push(expansion);
}
else {
let isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body), isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body), isSequence = isNumericSequence || isAlphaSequence, isOptions = m.body.indexOf(",") >= 0;
if (!isSequence && !isOptions)
return m.post.match(/,(?!,).*\}/) ? (str = m.pre + "{" + m.body + escClose + m.post, expand_(str, max, !0)) : [str];
let n;
if (isSequence)
n = m.body.split(/\.\./);
else if (n = parseCommaParts(m.body), n.length === 1 && n[0] !== void 0 && (n = expand_(n[0], max, !1).map(embrace), n.length === 1))
return post.map((p) => m.pre + n[0] + p);
let N;
if (isSequence && n[0] !== void 0 && n[1] !== void 0) {
let x = numeric(n[0]), y = numeric(n[1]), width = Math.max(n[0].length, n[1].length), incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1, test = lte;
y < x && (incr *= -1, test = gte);
let pad = n.some(isPadded);
N = [];
for (let i = x; test(i, y) && N.length < max; i += incr) {
let c;
if (isAlphaSequence)
c = String.fromCharCode(i), c === "\\" && (c = "");
else if (c = String(i), pad) {
let need = width - c.length;
if (need > 0) {
let z = new Array(need + 1).join("0");
i < 0 ? c = "-" + z + c.slice(1) : c = z + c;
}
}
N.push(c);
}
} else {
N = [];
for (let j = 0; j < n.length; j++)
N.push.apply(N, expand_(n[j], max, !1));
}
for (let j = 0; j < N.length; j++)
for (let k = 0; k < post.length && expansions.length < max; k++) {
let expansion = pre + N[j] + post[k];
(!isTop || isSequence || expansion) && expansions.push(expansion);
}
}
return expansions;
}
}
});
// ../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js
var require_assert_valid_pattern = __commonJS({
"../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.assertValidPattern = void 0;
var MAX_PATTERN_LENGTH = 1024 * 64, assertValidPattern = (pattern) => {
if (typeof pattern != "string")
throw new TypeError("invalid pattern");
if (pattern.length > MAX_PATTERN_LENGTH)
throw new TypeError("pattern is too long");
};
exports.assertValidPattern = assertValidPattern;
}
});
// ../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/commonjs/brace-expressions.js
var require_brace_expressions = __commonJS({
"../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/commonjs/brace-expressions.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.parseClass = void 0;
var posixClasses = {
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", !0],
"[:alpha:]": ["\\p{L}\\p{Nl}", !0],
"[:ascii:]": ["\\x00-\\x7f", !1],
"[:blank:]": ["\\p{Zs}\\t", !0],
"[:cntrl:]": ["\\p{Cc}", !0],
"[:digit:]": ["\\p{Nd}", !0],
"[:graph:]": ["\\p{Z}\\p{C}", !0, !0],
"[:lower:]": ["\\p{Ll}", !0],
"[:print:]": ["\\p{C}", !0],
"[:punct:]": ["\\p{P}", !0],
"[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", !0],
"[:upper:]": ["\\p{Lu}", !0],
"[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", !0],
"[:xdigit:]": ["A-Fa-f0-9", !1]
}, braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&"), regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), rangesToString = (ranges) => ranges.join(""), parseClass = (glob, position) => {
let pos = position;
if (glob.charAt(pos) !== "[")
throw new Error("not in a brace expression");
let ranges = [], negs = [], i = pos + 1, sawStart = !1, uflag = !1, escaping = !1, negate = !1, endPos = pos, rangeStart = "";
WHILE: for (; i < glob.length; ) {
let c = glob.charAt(i);
if ((c === "!" || c === "^") && i === pos + 1) {
negate = !0, i++;
continue;
}
if (c === "]" && sawStart && !escaping) {
endPos = i + 1;
break;
}
if (sawStart = !0, c === "\\" && !escaping) {
escaping = !0, i++;
continue;
}
if (c === "[" && !escaping) {
for (let [cls, [unip, u, neg]] of Object.entries(posixClasses))
if (glob.startsWith(cls, i)) {
if (rangeStart)
return ["$.", !1, glob.length - pos, !0];
i += cls.length, neg ? negs.push(unip) : ranges.push(unip), uflag = uflag || u;
continue WHILE;
}
}
if (escaping = !1, rangeStart) {
c > rangeStart ? ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c)) : c === rangeStart && ranges.push(braceEscape(c)), rangeStart = "", i++;
continue;
}
if (glob.startsWith("-]", i + 1)) {
ranges.push(braceEscape(c + "-")), i += 2;
continue;
}
if (glob.startsWith("-", i + 1)) {
rangeStart = c, i += 2;
continue;
}
ranges.push(braceEscape(c)), i++;
}
if (endPos < i)
return ["", !1, 0, !1];
if (!ranges.length && !negs.length)
return ["$.", !1, glob.length - pos, !0];
if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
let r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
return [regexpEscape(r), !1, endPos - pos, !1];
}
let sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]", snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
return [ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs, uflag, endPos - pos, !0];
};
exports.parseClass = parseClass;
}
});
// ../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/commonjs/unescape.js
var require_unescape = __commonJS({
"../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/commonjs/unescape.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.unescape = void 0;
var unescape = (s, { windowsPathsNoEscape = !1, magicalBraces = !0 } = {}) => magicalBraces ? windowsPathsNoEscape ? s.replace(/\[([^/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\])\]/g, "$1$2").replace(/\\([^/])/g, "$1") : windowsPathsNoEscape ? s.replace(/\[([^/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1");
exports.unescape = unescape;
}
});
// ../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/commonjs/ast.js
var require_ast = __commonJS({
"../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/commonjs/ast.js"(exports) {
"use strict";
init_cjs_shims();
var _a;
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.AST = void 0;
var brace_expressions_js_1 = require_brace_expressions(), unescape_js_1 = require_unescape(), types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), isExtglobType = (c) => types.has(c), isExtglobAST = (c) => isExtglobType(c.type), adoptionMap = /* @__PURE__ */ new Map([
["!", ["@"]],
["?", ["?", "@"]],
["@", ["@"]],
["*", ["*", "+", "?", "@"]],
["+", ["+", "@"]]
]), adoptionWithSpaceMap = /* @__PURE__ */ new Map([
["!", ["?"]],
["@", ["?"]],
["+", ["?", "*"]]
]), adoptionAnyMap = /* @__PURE__ */ new Map([
["!", ["?", "@"]],
["?", ["?", "@"]],
["@", ["?", "@"]],
["*", ["*", "+", "?", "@"]],
["+", ["+", "@", "?", "*"]]
]), usurpMap = /* @__PURE__ */ new Map([
["!", /* @__PURE__ */ new Map([["!", "@"]])],
[
"?",
/* @__PURE__ */ new Map([
["*", "*"],
["+", "*"]
])
],
[
"@",
/* @__PURE__ */ new Map([
["!", "!"],
["?", "?"],
["@", "@"],
["*", "*"],
["+", "+"]
])
],
[
"+",
/* @__PURE__ */ new Map([
["?", "*"],
["*", "*"]
])
]
]), startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))", startNoDot = "(?!\\.)", addPatternStart = /* @__PURE__ */ new Set(["[", "."]), justDots = /* @__PURE__ */ new Set(["..", "."]), reSpecials = new Set("().*{}+?[]^$\\!"), regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), qmark = "[^/]", star = qmark + "*?", starNoEmpty = qmark + "+?", ID = 0, AST = class {
type;
#root;
#hasMagic;
#uflag = !1;
#parts = [];
#parent;
#parentIndex;
#negs;
#filledNegs = !1;
#options;
#toString;
// set to true if it's an extglob with no children
// (which really means one child of '')
#emptyExt = !1;
id = ++ID;
get depth() {
return (this.#parent?.depth ?? -1) + 1;
}
[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() {
return {
"@@type": "AST",
id: this.id,
type: this.type,
root: this.#root.id,
parent: this.#parent?.id,
depth: this.depth,
partsLength: this.#parts.length,
parts: this.#parts
};
}
constructor(type, parent, options = {}) {
this.type = type, type && (this.#hasMagic = !0), this.#parent = parent, this.#root = this.#parent ? this.#parent.#root : this, this.#options = this.#root === this ? options : this.#root.#options, this.#negs = this.#root === this ? [] : this.#root.#negs, type === "!" && !this.#root.#filledNegs && this.#negs.push(this), this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
}
get hasMagic() {
if (this.#hasMagic !== void 0)
return this.#hasMagic;
for (let p of this.#parts)
if (typeof p != "string" && (p.type || p.hasMagic))
return this.#hasMagic = !0;
return this.#hasMagic;
}
// reconstructs the pattern
toString() {
return this.#toString !== void 0 ? this.#toString : this.type ? this.#toString = this.type + "(" + this.#parts.map((p) => String(p)).join("|") + ")" : this.#toString = this.#parts.map((p) => String(p)).join("");
}
#fillNegs() {
if (this !== this.#root)
throw new Error("should only call on root");
if (this.#filledNegs)
return this;
this.toString(), this.#filledNegs = !0;
let n;
for (; n = this.#negs.pop(); ) {
if (n.type !== "!")
continue;
let p = n, pp = p.#parent;
for (; pp; ) {
for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++)
for (let part of n.#parts) {
if (typeof part == "string")
throw new Error("string part in extglob AST??");
part.copyIn(pp.#parts[i]);
}
p = pp, pp = p.#parent;
}
}
return this;
}
push(...parts) {
for (let p of parts)
if (p !== "") {
if (typeof p != "string" && !(p instanceof _a && p.#parent === this))
throw new Error("invalid part: " + p);
this.#parts.push(p);
}
}
toJSON() {
let ret = this.type === null ? this.#parts.slice().map((p) => typeof p == "string" ? p : p.toJSON()) : [this.type, ...this.#parts.map((p) => p.toJSON())];
return this.isStart() && !this.type && ret.unshift([]), this.isEnd() && (this === this.#root || this.#root.#filledNegs && this.#parent?.type === "!") && ret.push({}), ret;
}
isStart() {
if (this.#root === this)
return !0;
if (!this.#parent?.isStart())
return !1;
if (this.#parentIndex === 0)
return !0;
let p = this.#parent;
for (let i = 0; i < this.#parentIndex; i++) {
let pp = p.#parts[i];
if (!(pp instanceof _a && pp.type === "!"))
return !1;
}
return !0;
}
isEnd() {
if (this.#root === this || this.#parent?.type === "!")
return !0;
if (!this.#parent?.isEnd())
return !1;
if (!this.type)
return this.#parent?.isEnd();
let pl = this.#parent ? this.#parent.#parts.length : 0;
return this.#parentIndex === pl - 1;
}
copyIn(part) {
typeof part == "string" ? this.push(part) : this.push(part.clone(this));
}
clone(parent) {
let c = new _a(this.type, parent);
for (let p of this.#parts)
c.copyIn(p);
return c;
}
static #parseAST(str, ast, pos, opt, extDepth) {
let maxDepth = opt.maxExtglobRecursion ?? 2, escaping = !1, inBrace = !1, braceStart = -1, braceNeg = !1;
if (ast.type === null) {
let i2 = pos, acc2 = "";
for (; i2 < str.length; ) {
let c = str.charAt(i2++);
if (escaping || c === "\\") {
escaping = !escaping, acc2 += c;
continue;
}
if (inBrace) {
i2 === braceStart + 1 ? (c === "^" || c === "!") && (braceNeg = !0) : c === "]" && !(i2 === braceStart + 2 && braceNeg) && (inBrace = !1), acc2 += c;
continue;
} else if (c === "[") {
inBrace = !0, braceStart = i2, braceNeg = !1, acc2 += c;
continue;
}
if (!opt.noext && isExtglobType(c) && str.charAt(i2) === "(" && extDepth <= maxDepth) {
ast.push(acc2), acc2 = "";
let ext = new _a(c, ast);
i2 = _a.#parseAST(str, ext, i2, opt, extDepth + 1), ast.push(ext);
continue;
}
acc2 += c;
}
return ast.push(acc2), i2;
}
let i = pos + 1, part = new _a(null, ast), parts = [], acc = "";
for (; i < str.length; ) {
let c = str.charAt(i++);
if (escaping || c === "\\") {
escaping = !escaping, acc += c;
continue;
}
if (inBrace) {
i === braceStart + 1 ? (c === "^" || c === "!") && (braceNeg = !0) : c === "]" && !(i === braceStart + 2 && braceNeg) && (inBrace = !1), acc += c;
continue;
} else if (c === "[") {
inBrace = !0, braceStart = i, braceNeg = !1, acc += c;
continue;
}
if (!opt.noext && isExtglobType(c) && str.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
(extDepth <= maxDepth || ast && ast.#canAdoptType(c))) {
let depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
part.push(acc), acc = "";
let ext = new _a(c, part);
part.push(ext), i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);
continue;
}
if (c === "|") {
part.push(acc), acc = "", parts.push(part), part = new _a(null, ast);
continue;
}
if (c === ")")
return acc === "" && ast.#parts.length === 0 && (ast.#emptyExt = !0), part.push(acc), acc = "", ast.push(...parts, part), i;
acc += c;
}
return ast.type = null, ast.#hasMagic = void 0, ast.#parts = [str.substring(pos - 1)], i;
}
#canAdoptWithSpace(child) {
return this.#canAdopt(child, adoptionWithSpaceMap);
}
#canAdopt(child, map = adoptionMap) {
if (!child || typeof child != "object" || child.type !== null || child.#parts.length !== 1 || this.type === null)
return !1;
let gc = child.#parts[0];
return !gc || typeof gc != "object" || gc.type === null ? !1 : this.#canAdoptType(gc.type, map);
}
#canAdoptType(c, map = adoptionAnyMap) {
return !!map.get(this.type)?.includes(c);
}
#adoptWithSpace(child, index) {
let gc = child.#parts[0], blank = new _a(null, gc, this.options);
blank.#parts.push(""), gc.push(blank), this.#adopt(child, index);
}
#adopt(child, index) {
let gc = child.#parts[0];
this.#parts.splice(index, 1, ...gc.#parts);
for (let p of gc.#parts)
typeof p == "object" && (p.#parent = this);
this.#toString = void 0;
}
#canUsurpType(c) {
return !!usurpMap.get(this.type)?.has(c);
}
#canUsurp(child) {
if (!child || typeof child != "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1)
return !1;
let gc = child.#parts[0];
return !gc || typeof gc != "object" || gc.type === null ? !1 : this.#canUsurpType(gc.type);
}
#usurp(child) {
let m = usurpMap.get(this.type), gc = child.#parts[0], nt = m?.get(gc.type);
if (!nt)
return !1;
this.#parts = gc.#parts;
for (let p of this.#parts)
typeof p == "object" && (p.#parent = this);
this.type = nt, this.#toString = void 0, this.#emptyExt = !1;
}
static fromGlob(pattern, options = {}) {
let ast = new _a(null, void 0, options);
return _a.#parseAST(pattern, ast, 0, options, 0), ast;
}
// returns the regular expression if there's magic, or the unescaped
// string if not.
toMMPattern() {
if (this !== this.#root)
return this.#root.toMMPattern();
let glob = this.toString(), [re, body, hasMagic, uflag] = this.toRegExpSource();
if (!(hasMagic || this.#hasMagic || this.#options.nocase && !this.#options.nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase()))
return body;
let flags = (this.#options.nocase ? "i" : "") + (uflag ? "u" : "");
return Object.assign(new RegExp(`^${re}$`, flags), {
_src: re,
_glob: glob
});
}
get options() {
return this.#options;
}
// returns the string match, the regexp source, whether there's magic
// in the regexp (so a regular expression is required) and whether or
// not the uflag is needed for the regular expression (for posix classes)
// TODO: instead of injecting the start/end at this point, just return
// the BODY of the regexp, along with the start/end portions suitable
// for binding the start/end in either a joined full-path makeRe context
// (where we bind to (^|/), or a standalone matchPart context (where
// we bind to ^, and not /). Otherwise slashes get duped!
//
// In part-matching mode, the start is:
// - if not isStart: nothing
// - if traversal possible, but not allowed: ^(?!\.\.?$)
// - if dots allowed or not possible: ^
// - if dots possible and not allowed: ^(?!\.)
// end is:
// - if not isEnd(): nothing
// - else: $
//
// In full-path matching mode, we put the slash at the START of the
// pattern, so start is:
// - if first pattern: same as part-matching mode
// - if not isStart(): nothing
// - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
// - if dots allowed or not possible: /
// - if dots possible and not allowed: /(?!\.)
// end is:
// - if last pattern, same as part-matching mode
// - else nothing
//
// Always put the (?:$|/) on negated tails, though, because that has to be
// there to bind the end of the negated pattern portion, and it's easier to
// just stick it in now rather than try to inject it later in the middle of
// the pattern.
//
// We can just always return the same end, and leave it up to the caller
// to know whether it's going to be used joined or in parts.
// And, if the start is adjusted slightly, can do the same there:
// - if not isStart: nothing
// - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
// - if dots allowed or not possible: (?:/|^)
// - if dots possible and not allowed: (?:/|^)(?!\.)
//
// But it's better to have a simpler binding without a conditional, for
// performance, so probably better to return both start options.
//
// Then the caller just ignores the end if it's not the first pattern,
// and the start always gets applied.
//
// But that's always going to be $ if it's the ending pattern, or nothing,
// so the caller can just attach $ at the end of the pattern when building.
//
// So the todo is:
// - better detect what kind of start is needed
// - return both flavors of starting pattern
// - attach $ at the end of the pattern when creating the actual RegExp
//
// Ah, but wait, no, that all only applies to the root when the first pattern
// is not an extglob. If the first pattern IS an extglob, then we need all
// that dot prevention biz to live in the extglob portions, because eg
// +(*|.x*) can match .xy but not .yx.
//
// So, return the two flavors if it's #root and the first child is not an
// AST, otherwise leave it to the child AST to handle it, and there,
// use the (?:^|/) style of start binding.
//
// Even simplified further:
// - Since the start for a join is eg /(?!\.) and the start for a part
// is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
// or start or whatever) and prepend ^ or / at the Regexp construction.
toRegExpSource(allowDot) {
let dot = allowDot ?? !!this.#options.dot;
if (this.#root === this && (this.#flatten(), this.#fillNegs()), !isExtglobAST(this)) {
let noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s != "string"), src = this.#parts.map((p) => {
let [re, _, hasMagic, uflag] = typeof p == "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
return this.#hasMagic = this.#hasMagic || hasMagic, this.#uflag = this.#uflag || uflag, re;
}).join(""), start2 = "";
if (this.isStart() && typeof this.#parts[0] == "string" && !(this.#parts.length === 1 && justDots.has(this.#parts[0]))) {
let aps = addPatternStart, needNoTrav = (
// dots are allowed, and the pattern starts with [ or .
dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
src.startsWith("\\.\\.") && aps.has(src.charAt(4))
), needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
}
let end = "";
return this.isEnd() && this.#root.#filledNegs && this.#parent?.type === "!" && (end = "(?:$|\\/)"), [
start2 + src + end,
(0, unescape_js_1.unescape)(src),
this.#hasMagic = !!this.#hasMagic,
this.#uflag
];
}
let repeated = this.type === "*" || this.type === "+", start = this.type === "!" ? "(?:(?!(?:" : "(?:", body = this.#partsToRegExp(dot);
if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
let s = this.toString(), me = this;
return me.#parts = [s], me.type = null, me.#hasMagic = void 0, [s, (0, unescape_js_1.unescape)(this.toString()), !1, !1];
}
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(!0);
bodyDotAllowed === body && (bodyDotAllowed = ""), bodyDotAllowed && (body = `(?:${body})(?:${bodyDotAllowed})*?`);
let final = "";
if (this.type === "!" && this.#emptyExt)
final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
else {
let close = this.type === "!" ? (
// !() must match something,but !(x) can match ''
"))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")"
) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? ")?" : `)${this.type}`;
final = start + body + close;
}
return [
final,
(0, unescape_js_1.unescape)(body),
this.#hasMagic = !!this.#hasMagic,
this.#uflag
];
}
#flatten() {
if (isExtglobAST(this)) {
let iterations = 0, done = !1;
do {
done = !0;
for (let i = 0; i < this.#parts.length; i++) {
let c = this.#parts[i];
typeof c == "object" && (c.#flatten(), this.#canAdopt(c) ? (done = !1, this.#adopt(c, i)) : this.#canAdoptWithSpace(c) ? (done = !1, this.#adoptWithSpace(c, i)) : this.#canUsurp(c) && (done = !1, this.#usurp(c)));
}
} while (!done && ++iterations < 10);
} else
for (let p of this.#parts)
typeof p == "object" && p.#flatten();
this.#toString = void 0;
}
#partsToRegExp(dot) {
return this.#parts.map((p) => {
if (typeof p == "string")
throw new Error("string type in extglob ast??");
let [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
return this.#uflag = this.#uflag || uflag, re;
}).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
}
static #parseGlob(glob, hasMagic, noEmpty = !1) {
let escaping = !1, re = "", uflag = !1, inStar = !1;
for (let i = 0; i < glob.length; i++) {
let c = glob.charAt(i);
if (escaping) {
escaping = !1, re += (reSpecials.has(c) ? "\\" : "") + c;
continue;
}
if (c === "*") {
if (inStar)
continue;
inStar = !0, re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star, hasMagic = !0;
continue;
} else
inStar = !1;
if (c === "\\") {
i === glob.length - 1 ? re += "\\\\" : escaping = !0;
continue;
}
if (c === "[") {
let [src, needUflag, consumed, magic] = (0, brace_expressions_js_1.parseClass)(glob, i);
if (consumed) {
re += src, uflag = uflag || needUflag, i += consumed - 1, hasMagic = hasMagic || magic;
continue;
}
}
if (c === "?") {
re += qmark, hasMagic = !0;
continue;
}
re += regExpEscape(c);
}
return [re, (0, unescape_js_1.unescape)(glob), !!hasMagic, uflag];
}
};
exports.AST = AST;
_a = AST;
}
});
// ../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/commonjs/escape.js
var require_escape = __commonJS({
"../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/commonjs/escape.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.escape = void 0;
var escape = (s, { windowsPathsNoEscape = !1, magicalBraces = !1 } = {}) => magicalBraces ? windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&") : windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
exports.escape = escape;
}
});
// ../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/commonjs/index.js
var require_commonjs3 = __commonJS({
"../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/commonjs/index.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.unescape = exports.escape = exports.AST = exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0;
var brace_expansion_1 = require_commonjs2(), assert_valid_pattern_js_1 = require_assert_valid_pattern(), ast_js_1 = require_ast(), escape_js_1 = require_escape(), unescape_js_1 = require_unescape(), minimatch = (p, pattern, options = {}) => ((0, assert_valid_pattern_js_1.assertValidPattern)(pattern), !options.nocomment && pattern.charAt(0) === "#" ? !1 : new Minimatch(pattern, options).match(p));
exports.minimatch = minimatch;
var starDotExtRE = /^\*+([^+@!?*[(]*)$/, starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2), starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2), starDotExtTestNocase = (ext2) => (ext2 = ext2.toLowerCase(), (f) => !f.startsWith(".") && f.toLowerCase().endsWith(ext2)), starDotExtTestNocaseDot = (ext2) => (ext2 = ext2.toLowerCase(), (f) => f.toLowerCase().endsWith(ext2)), starDotStarRE = /^\*+\.\*+$/, starDotStarTest = (f) => !f.startsWith(".") && f.includes("."), starDotStarTestDot = (f) => f !== "." && f !== ".." && f.includes("."), dotStarRE = /^\.\*+$/, dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith("."), starRE = /^\*+$/, starTest = (f) => f.length !== 0 && !f.startsWith("."), starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..", qmarksRE = /^\?+([^+@!?*[(]*)?$/, qmarksTestNocase = ([$0, ext2 = ""]) => {
let noext = qmarksTestNoExt([$0]);
return ext2 ? (ext2 = ext2.toLowerCase(), (f) => noext(f) && f.toLowerCase().endsWith(ext2)) : noext;
}, qmarksTestNocaseDot = ([$0, ext2 = ""]) => {
let noext = qmarksTestNoExtDot([$0]);
return ext2 ? (ext2 = ext2.toLowerCase(), (f) => noext(f) && f.toLowerCase().endsWith(ext2)) : noext;
}, qmarksTestDot = ([$0, ext2 = ""]) => {
let noext = qmarksTestNoExtDot([$0]);
return ext2 ? (f) => noext(f) && f.endsWith(ext2) : noext;
}, qmarksTest = ([$0, ext2 = ""]) => {
let noext = qmarksTestNoExt([$0]);
return ext2 ? (f) => noext(f) && f.endsWith(ext2) : noext;
}, qmarksTestNoExt = ([$0]) => {
let len = $0.length;
return (f) => f.length === len && !f.startsWith(".");
}, qmarksTestNoExtDot = ([$0]) => {
let len = $0.length;
return (f) => f.length === len && f !== "." && f !== "..";
}, defaultPlatform = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix", path = {
win32: { sep: "\\" },
posix: { sep: "/" }
};
exports.sep = defaultPlatform === "win32" ? path.win32.sep : path.posix.sep;
exports.minimatch.sep = exports.sep;
exports.GLOBSTAR = /* @__PURE__ */ Symbol("globstar **");
exports.minimatch.GLOBSTAR = exports.GLOBSTAR;
var qmark = "[^/]", star = qmark + "*?", twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?", filter = (pattern, options = {}) => (p) => (0, exports.minimatch)(p, pattern, options);
exports.filter = filter;
exports.minimatch.filter = exports.filter;
var ext = (a, b = {}) => Object.assign({}, a, b), defaults = (def) => {
if (!def || typeof def != "object" || !Object.keys(def).length)
return exports.minimatch;
let orig = exports.minimatch;
return Object.assign((p, pattern, options = {}) => orig(p, pattern, ext(def, options)), {
Minimatch: class extends orig.Minimatch {
constructor(pattern, options = {}) {
super(pattern, ext(def, options));
}
static defaults(options) {
return orig.defaults(ext(def, options)).Minimatch;
}
},
AST: class extends orig.AST {
/* c8 ignore start */
constructor(type, parent, options = {}) {
super(type, parent, ext(def, options));
}
/* c8 ignore stop */
static fromGlob(pattern, options = {}) {
return orig.AST.fromGlob(pattern, ext(def, options));
}
},
unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
escape: (s, options = {}) => orig.escape(s, ext(def, options)),
filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
defaults: (options) => orig.defaults(ext(def, options)),
makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
sep: orig.sep,
GLOBSTAR: exports.GLOBSTAR
});
};
exports.defaults = defaults;
exports.minimatch.defaults = exports.defaults;
var braceExpand = (pattern, options = {}) => ((0, assert_valid_pattern_js_1.assertValidPattern)(pattern), options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern) ? [pattern] : (0, brace_expansion_1.expand)(pattern, { max: options.braceExpandMax }));
exports.braceExpand = braceExpand;
exports.minimatch.braceExpand = exports.braceExpand;
var makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
exports.makeRe = makeRe;
exports.minimatch.makeRe = exports.makeRe;
var match = (list, pattern, options = {}) => {
let mm = new Minimatch(pattern, options);
return list = list.filter((f) => mm.match(f)), mm.options.nonull && !list.length && list.push(pattern), list;
};
exports.match = match;
exports.minimatch.match = exports.match;
var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/, regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), Minimatch = class {
options;
set;
pattern;
windowsPathsNoEscape;
nonegate;
negate;
comment;
empty;
preserveMultipleSlashes;
partial;
globSet;
globParts;
nocase;
isWindows;
platform;
windowsNoMagicRoot;
maxGlobstarRecursion;
regexp;
constructor(pattern, options = {}) {
(0, assert_valid_pattern_js_1.assertValidPattern)(pattern), options = options || {}, this.options = options, this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200, this.pattern = pattern, this.platform = options.platform || defaultPlatform, this.isWindows = this.platform === "win32";
let awe = "allowWindowsEscape";
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options[awe] === !1, this.windowsPathsNoEscape && (this.pattern = this.pattern.replace(/\\/g, "/")), this.preserveMultipleSlashes = !!options.preserveMultipleSlashes, this.regexp = null, this.negate = !1, this.nonegate = !!options.nonegate, this.comment = !1, this.empty = !1, this.partial = !!options.partial, this.nocase = !!this.options.nocase, this.windowsNoMagicRoot = options.windowsNoMagicRoot !== void 0 ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase), this.globSet = [], this.globParts = [], this.set = [], this.make();
}
hasMagic() {
if (this.options.magicalBraces && this.set.length > 1)
return !0;
for (let pattern of this.set)
for (let part of pattern)
if (typeof part != "string")
return !0;
return !1;
}
debug(..._) {
}
make() {
let pattern = this.pattern, options = this.options;
if (!options.nocomment && pattern.charAt(0) === "#") {
this.comment = !0;
return;
}
if (!pattern) {
this.empty = !0;
return;
}
this.parseNegate(), this.globSet = [...new Set(this.braceExpand())], options.debug && (this.debug = (...args) => console.error(...args)), this.debug(this.pattern, this.globSet);
let rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
this.globParts = this.preprocess(rawGlobParts), this.debug(this.pattern, this.globParts);
let set = this.globParts.map((s, _, __) => {
if (this.isWindows && this.windowsNoMagicRoot) {
let isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]), isDrive = /^[a-z]:/i.test(s[0]);
if (isUNC)
return [
...s.slice(0, 4),
...s.slice(4).map((ss) => this.parse(ss))
];
if (isDrive)
return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
}
return s.map((ss) => this.parse(ss));
});
if (this.debug(this.pattern, set), this.set = set.filter((s) => s.indexOf(!1) === -1), this.isWindows)
for (let i = 0; i < this.set.length; i++) {
let p = this.set[i];
p[0] === "" && p[1] === "" && this.globParts[i][2] === "?" && typeof p[3] == "string" && /^[a-z]:$/i.test(p[3]) && (p[2] = "?");
}
this.debug(this.pattern, this.set);
}
// various transforms to equivalent pattern sets that are
// faster to process in a filesystem walk. The goal is to
// eliminate what we can, and push all ** patterns as far
// to the right as possible, even if it increases the number
// of patterns that we have to process.
preprocess(globParts) {
if (this.options.noglobstar)
for (let partset of globParts)
for (let j = 0; j < partset.length; j++)
partset[j] === "**" && (partset[j] = "*");
let { optimizationLevel = 1 } = this.options;
return optimizationLevel >= 2 ? (globParts = this.firstPhasePreProcess(globParts), globParts = this.secondPhasePreProcess(globParts)) : optimizationLevel >= 1 ? globParts = this.levelOneOptimize(globParts) : globParts = this.adjascentGlobstarOptimize(globParts), globParts;
}
// just get rid of adjascent ** portions
adjascentGlobstarOptimize(globParts) {
return globParts.map((parts) => {
let gs = -1;
for (; (gs = parts.indexOf("**", gs + 1)) !== -1; ) {
let i = gs;
for (; parts[i + 1] === "**"; )
i++;
i !== gs && parts.splice(gs, i - gs);
}
return parts;
});
}
// get rid of adjascent ** and resolve .. portions
levelOneOptimize(globParts) {
return globParts.map((parts) => (parts = parts.reduce((set, part) => {
let prev = set[set.length - 1];
return part === "**" && prev === "**" ? set : part === ".." && prev && prev !== ".." && prev !== "." && prev !== "**" ? (set.pop(), set) : (set.push(part), set);
}, []), parts.length === 0 ? [""] : parts));
}
levelTwoFileOptimize(parts) {
Array.isArray(parts) || (parts = this.slashSplit(parts));
let didSomething = !1;
do {
if (didSomething = !1, !this.preserveMultipleSlashes) {
for (let i = 1; i < parts.length - 1; i++) {
let p = parts[i];
i === 1 && p === "" && parts[0] === "" || (p === "." || p === "") && (didSomething = !0, parts.splice(i, 1), i--);
}
parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "") && (didSomething = !0, parts.pop());
}
let dd = 0;
for (; (dd = parts.indexOf("..", dd + 1)) !== -1; ) {
let p = parts[dd - 1];
p && p !== "." && p !== ".." && p !== "**" && !(this.isWindows && /^[a-z]:$/i.test(p)) && (didSomething = !0, parts.splice(dd - 1, 2), dd -= 2);
}
} while (didSomething);
return parts.length === 0 ? [""] : parts;
}
// First phase: single-pattern processing
// <pre> is 1 or more portions
// <rest> is 1 or more portions
// <p> is any portion other than ., .., '', or **
// <e> is . or ''
//
// **/.. is *brutal* for filesystem walking performance, because
// it effectively resets the recursive walk each time it occurs,
// and ** cannot be reduced out by a .. pattern part like a regexp
// or most strings (other than .., ., and '') can be.
//
// <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
// <pre>/<e>/<rest> -> <pre>/<rest>
// <pre>/<p>/../<rest> -> <pre>/<rest>
// **/**/<rest> -> **/<rest>
//
// **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
// this WOULD be allowed if ** did follow symlinks, or * didn't
firstPhasePreProcess(globParts) {
let didSomething = !1;
do {
didSomething = !1;
for (let parts of globParts) {
let gs = -1;
for (; (gs = parts.indexOf("**", gs + 1)) !== -1; ) {
let gss = gs;
for (; parts[gss + 1] === "**"; )
gss++;
gss > gs && parts.splice(gs + 1, gss - gs);
let next = parts[gs + 1], p = parts[gs + 2], p2 = parts[gs + 3];
if (next !== ".." || !p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..")
continue;
didSomething = !0, parts.splice(gs, 1);
let other = parts.slice(0);
other[gs] = "**", globParts.push(other), gs--;
}
if (!this.preserveMultipleSlashes) {
for (let i = 1; i < parts.length - 1; i++) {
let p = parts[i];
i === 1 && p === "" && parts[0] === "" || (p === "." || p === "") && (didSomething = !0, parts.splice(i, 1), i--);
}
parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "") && (didSomething = !0, parts.pop());
}
let dd = 0;
for (; (dd = parts.indexOf("..", dd + 1)) !== -1; ) {
let p = parts[dd - 1];
if (p && p !== "." && p !== ".." && p !== "**") {
didSomething = !0;
let splin = dd === 1 && parts[dd + 1] === "**" ? ["."] : [];
parts.splice(dd - 1, 2, ...splin), parts.length === 0 && parts.push(""), dd -= 2;
}
}
}
} while (didSomething);
return globParts;
}
// second phase: multi-pattern dedupes
// {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
// {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
// {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
//
// {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
// ^-- not valid because ** doens't follow symlinks
secondPhasePreProcess(globParts) {
for (let i = 0; i < globParts.length - 1; i++)
for (let j = i + 1; j < globParts.length; j++) {
let matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
if (matched) {
globParts[i] = [], globParts[j] = matched;
break;
}
}
return globParts.filter((gs) => gs.length);
}
partsMatch(a, b, emptyGSMatch = !1) {
let ai = 0, bi = 0, result = [], which = "";
for (; ai < a.length && bi < b.length; )
if (a[ai] === b[bi])
result.push(which === "b" ? b[bi] : a[ai]), ai++, bi++;
else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1])
result.push(a[ai]), ai++;
else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1])
result.push(b[bi]), bi++;
else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
if (which === "b")
return !1;
which = "a", result.push(a[ai]), ai++, bi++;
} else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
if (which === "a")
return !1;
which = "b", result.push(b[bi]), ai++, bi++;
} else
return !1;
return a.length === b.length && result;
}
parseNegate() {
if (this.nonegate)
return;
let pattern = this.pattern, negate = !1, negateOffset = 0;
for (let i = 0; i < pattern.length && pattern.charAt(i) === "!"; i++)
negate = !negate, negateOffset++;
negateOffset && (this.pattern = pattern.slice(negateOffset)), this.negate = negate;
}
// set partial to true to test if, for example,
// "/a/b" matches the start of "/*/b/*/d"
// Partial means, if you run out of file before you run
// out of pattern, then that's fine, as long as all
// the parts match.
matchOne(file, pattern, partial = !1) {
let fileStartIndex = 0, patternStartIndex = 0;
if (this.isWindows) {
let fileDrive = typeof file[0] == "string" && /^[a-z]:$/i.test(file[0]), fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]), patternDrive = typeof pattern[0] == "string" && /^[a-z]:$/i.test(pattern[0]), patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] == "string" && /^[a-z]:$/i.test(pattern[3]), fdi = fileUNC ? 3 : fileDrive ? 0 : void 0, pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
if (typeof fdi == "number" && typeof pdi == "number") {
let [fd, pd] = [
file[fdi],
pattern[pdi]
];
fd.toLowerCase() === pd.toLowerCase() && (pattern[pdi] = fd, patternStartIndex = pdi, fileStartIndex = fdi);
}
}
let { optimizationLevel = 1 } = this.options;
return optimizationLevel >= 2 && (file = this.levelTwoFileOptimize(file)), pattern.includes(exports.GLOBSTAR) ? this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex) : this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
}
#matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
let firstgs = pattern.indexOf(exports.GLOBSTAR, patternIndex), lastgs = pattern.lastIndexOf(exports.GLOBSTAR), [head, body, tail] = partial ? [
pattern.slice(patternIndex, firstgs),
pattern.slice(firstgs + 1),
[]
] : [
pattern.slice(patternIndex, firstgs),
pattern.slice(firstgs + 1, lastgs),
pattern.slice(lastgs + 1)
];
if (head.length) {
let fileHead = file.slice(fileIndex, fileIndex + head.length);
if (!this.#matchOne(fileHead, head, partial, 0, 0))
return !1;
fileIndex += head.length, patternIndex += head.length;
}
let fileTailMatch = 0;
if (tail.length) {
if (tail.length + fileIndex > file.length)
return !1;
let tailStart = file.length - tail.length;
if (this.#matchOne(file, tail, partial, tailStart, 0))
fileTailMatch = tail.length;
else {
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length || (tailStart--, !this.#matchOne(file, tail, partial, tailStart, 0)))
return !1;
fileTailMatch = tail.length + 1;
}
}
if (!body.length) {
let sawSome = !!fileTailMatch;
for (let i2 = fileIndex; i2 < file.length - fileTailMatch; i2++) {
let f = String(file[i2]);
if (sawSome = !0, f === "." || f === ".." || !this.options.dot && f.startsWith("."))
return !1;
}
return partial || sawSome;
}
let bodySegments = [[[], 0]], currentBody = bodySegments[0], nonGsParts = 0, nonGsPartsSums = [0];
for (let b of body)
b === exports.GLOBSTAR ? (nonGsPartsSums.push(nonGsParts), currentBody = [[], 0], bodySegments.push(currentBody)) : (currentBody[0].push(b), nonGsParts++);
let i = bodySegments.length - 1, fileLength = file.length - fileTailMatch;
for (let b of bodySegments)
b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
}
// return false for "nope, not matching"
// return null for "not matching, cannot keep trying"
#matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
let bs = bodySegments[bodyIndex];
if (!bs) {
for (let i = fileIndex; i < file.length; i++) {
sawTail = !0;
let f = file[i];
if (f === "." || f === ".." || !this.options.dot && f.startsWith("."))
return !1;
}
return sawTail;
}
let [body, after] = bs;
for (; fileIndex <= after; ) {
if (this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0) && globStarDepth < this.maxGlobstarRecursion) {
let sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
if (sub !== !1)
return sub;
}
let f = file[fileIndex];
if (f === "." || f === ".." || !this.options.dot && f.startsWith("."))
return !1;
fileIndex++;
}
return partial || null;
}
#matchOne(file, pattern, partial, fileIndex, patternIndex) {
let fi, pi, pl, fl;
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
this.debug("matchOne loop");
let p = pattern[pi], f = file[fi];
if (this.debug(pattern, p, f), p === !1 || p === exports.GLOBSTAR)
return !1;
let hit;
if (typeof p == "string" ? (hit = f === p, this.debug("string match", p, f, hit)) : (hit = p.test(f), this.debug("pattern match", p, f, hit)), !hit)
return !1;
}
if (fi === fl && pi === pl)
return !0;
if (fi === fl)
return partial;
if (pi === pl)
return fi === fl - 1 && file[fi] === "";
throw new Error("wtf?");
}
braceExpand() {
return (0, exports.braceExpand)(this.pattern, this.options);
}
parse(pattern) {
(0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
let options = this.options;
if (pattern === "**")
return exports.GLOBSTAR;
if (pattern === "")
return "";
let m, fastTest = null;
(m = pattern.match(starRE)) ? fastTest = options.dot ? starTestDot : starTest : (m = pattern.match(starDotExtRE)) ? fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m[1]) : (m = pattern.match(qmarksRE)) ? fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m) : (m = pattern.match(starDotStarRE)) ? fastTest = options.dot ? starDotStarTestDot : starDotStarTest : (m = pattern.match(dotStarRE)) && (fastTest = dotStarTest);
let re = ast_js_1.AST.fromGlob(pattern, this.options).toMMPattern();
return fastTest && typeof re == "object" && Reflect.defineProperty(re, "test", { value: fastTest }), re;
}
makeRe() {
if (this.regexp || this.regexp === !1)
return this.regexp;
let set = this.set;
if (!set.length)
return this.regexp = !1, this.regexp;
let options = this.options, twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot, flags = new Set(options.nocase ? ["i"] : []), re = set.map((pattern) => {
let pp = pattern.map((p) => {
if (p instanceof RegExp)
for (let f of p.flags.split(""))
flags.add(f);
return typeof p == "string" ? regExpEscape(p) : p === exports.GLOBSTAR ? exports.GLOBSTAR : p._src;
});
pp.forEach((p, i) => {
let next = pp[i + 1], prev = pp[i - 1];
p !== exports.GLOBSTAR || prev === exports.GLOBSTAR || (prev === void 0 ? next !== void 0 && next !== exports.GLOBSTAR ? pp[i + 1] = "(?:\\/|" + twoStar + "\\/)?" + next : pp[i] = twoStar : next === void 0 ? pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + ")?" : next !== exports.GLOBSTAR && (pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next, pp[i + 1] = exports.GLOBSTAR));
});
let filtered = pp.filter((p) => p !== exports.GLOBSTAR);
if (this.partial && filtered.length >= 1) {
let prefixes = [];
for (let i = 1; i <= filtered.length; i++)
prefixes.push(filtered.slice(0, i).join("/"));
return "(?:" + prefixes.join("|") + ")";
}
return filtered.join("/");
}).join("|"), [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
re = "^" + open + re + close + "$", this.partial && (re = "^(?:\\/|" + open + re.slice(1, -1) + close + ")$"), this.negate && (re = "^(?!" + re + ").+$");
try {
this.regexp = new RegExp(re, [...flags].join(""));
} catch {
this.regexp = !1;
}
return this.regexp;
}
slashSplit(p) {
return this.preserveMultipleSlashes ? p.split("/") : this.isWindows && /^\/\/[^/]+/.test(p) ? ["", ...p.split(/\/+/)] : p.split(/\/+/);
}
match(f, partial = this.partial) {
if (this.debug("match", f, this.pattern), this.comment)
return !1;
if (this.empty)
return f === "";
if (f === "/" && partial)
return !0;
let options = this.options;
this.isWindows && (f = f.split("\\").join("/"));
let ff = this.slashSplit(f);
this.debug(this.pattern, "split", ff);
let set = this.set;
this.debug(this.pattern, "set", set);
let filename = ff[ff.length - 1];
if (!filename)
for (let i = ff.length - 2; !filename && i >= 0; i--)
filename = ff[i];
for (let pattern of set) {
let file = ff;
if (options.matchBase && pattern.length === 1 && (file = [filename]), this.matchOne(file, pattern, partial))
return options.flipNegate ? !0 : !this.negate;
}
return options.flipNegate ? !1 : this.negate;
}
static defaults(def) {
return exports.minimatch.defaults(def).Minimatch;
}
};
exports.Minimatch = Minimatch;
var ast_js_2 = require_ast();
Object.defineProperty(exports, "AST", { enumerable: !0, get: function() {
return ast_js_2.AST;
} });
var escape_js_2 = require_escape();
Object.defineProperty(exports, "escape", { enumerable: !0, get: function() {
return escape_js_2.escape;
} });
var unescape_js_2 = require_unescape();
Object.defineProperty(exports, "unescape", { enumerable: !0, get: function() {
return unescape_js_2.unescape;
} });
exports.minimatch.AST = ast_js_1.AST;
exports.minimatch.Minimatch = Minimatch;
exports.minimatch.escape = escape_js_1.escape;
exports.minimatch.unescape = unescape_js_1.unescape;
}
});
// ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/constants.js
var require_constants = __commonJS({
"../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/constants.js"(exports, module) {
"use strict";
init_cjs_shims();
var WIN_NO_SLASH = "[^\\\\/]", ONE_CHAR = "(?=.)", QMARK = "[^/]", END_ANCHOR = "(?:\\/|$)", START_ANCHOR = "(?:^|\\/)", DOTS_SLASH = `\\.{1,2}${END_ANCHOR}`, NO_DOT = "(?!\\.)", NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`, NO_DOT_SLASH = `(?!\\.{0,1}${END_ANCHOR})`, NO_DOTS_SLASH = `(?!${DOTS_SLASH})`, QMARK_NO_DOT = "[^.\\/]", STAR = `${QMARK}*?`, SEP = "/", POSIX_CHARS = {
DOT_LITERAL: "\\.",
PLUS_LITERAL: "\\+",
QMARK_LITERAL: "\\?",
SLASH_LITERAL: "\\/",
ONE_CHAR,
QMARK,
END_ANCHOR,
DOTS_SLASH,
NO_DOT,
NO_DOTS,
NO_DOT_SLASH,
NO_DOTS_SLASH,
QMARK_NO_DOT,
STAR,
START_ANCHOR,
SEP
}, WINDOWS_CHARS = {
...POSIX_CHARS,
SLASH_LITERAL: "[\\\\/]",
QMARK: WIN_NO_SLASH,
STAR: `${WIN_NO_SLASH}*?`,
DOTS_SLASH: "\\.{1,2}(?:[\\\\/]|$)",
NO_DOT: "(?!\\.)",
NO_DOTS: "(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",
NO_DOT_SLASH: "(?!\\.{0,1}(?:[\\\\/]|$))",
NO_DOTS_SLASH: "(?!\\.{1,2}(?:[\\\\/]|$))",
QMARK_NO_DOT: "[^.\\\\/]",
START_ANCHOR: "(?:^|[\\\\/])",
END_ANCHOR: "(?:[\\\\/]|$)",
SEP: "\\"
}, POSIX_REGEX_SOURCE = {
__proto__: null,
alnum: "a-zA-Z0-9",
alpha: "a-zA-Z",
ascii: "\\x00-\\x7F",
blank: " \\t",
cntrl: "\\x00-\\x1F\\x7F",
digit: "0-9",
graph: "\\x21-\\x7E",
lower: "a-z",
print: "\\x20-\\x7E ",
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
space: " \\t\\r\\n\\v\\f",
upper: "A-Z",
word: "A-Za-z0-9_",
xdigit: "A-Fa-f0-9"
};
module.exports = {
DEFAULT_MAX_EXTGLOB_RECURSION: 0,
MAX_LENGTH: 1024 * 64,
POSIX_REGEX_SOURCE,
// regular expressions
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
// Replace globs with equivalent patterns to reduce parsing time.
REPLACEMENTS: {
__proto__: null,
"***": "*",
"**/**": "**",
"**/**/**": "**"
},
// Digits
CHAR_0: 48,
/* 0 */
CHAR_9: 57,
/* 9 */
// Alphabet chars.
CHAR_UPPERCASE_A: 65,
/* A */
CHAR_LOWERCASE_A: 97,
/* a */
CHAR_UPPERCASE_Z: 90,
/* Z */
CHAR_LOWERCASE_Z: 122,
/* z */
CHAR_LEFT_PARENTHESES: 40,
/* ( */
CHAR_RIGHT_PARENTHESES: 41,
/* ) */
CHAR_ASTERISK: 42,
/* * */
// Non-alphabetic chars.
CHAR_AMPERSAND: 38,
/* & */
CHAR_AT: 64,
/* @ */
CHAR_BACKWARD_SLASH: 92,
/* \ */
CHAR_CARRIAGE_RETURN: 13,
/* \r */
CHAR_CIRCUMFLEX_ACCENT: 94,
/* ^ */
CHAR_COLON: 58,
/* : */
CHAR_COMMA: 44,
/* , */
CHAR_DOT: 46,
/* . */
CHAR_DOUBLE_QUOTE: 34,
/* " */
CHAR_EQUAL: 61,
/* = */
CHAR_EXCLAMATION_MARK: 33,
/* ! */
CHAR_FORM_FEED: 12,
/* \f */
CHAR_FORWARD_SLASH: 47,
/* / */
CHAR_GRAVE_ACCENT: 96,
/* ` */
CHAR_HASH: 35,
/* # */
CHAR_HYPHEN_MINUS: 45,
/* - */
CHAR_LEFT_ANGLE_BRACKET: 60,
/* < */
CHAR_LEFT_CURLY_BRACE: 123,
/* { */
CHAR_LEFT_SQUARE_BRACKET: 91,
/* [ */
CHAR_LINE_FEED: 10,
/* \n */
CHAR_NO_BREAK_SPACE: 160,
/* \u00A0 */
CHAR_PERCENT: 37,
/* % */
CHAR_PLUS: 43,
/* + */
CHAR_QUESTION_MARK: 63,
/* ? */
CHAR_RIGHT_ANGLE_BRACKET: 62,
/* > */
CHAR_RIGHT_CURLY_BRACE: 125,
/* } */
CHAR_RIGHT_SQUARE_BRACKET: 93,
/* ] */
CHAR_SEMICOLON: 59,
/* ; */
CHAR_SINGLE_QUOTE: 39,
/* ' */
CHAR_SPACE: 32,
/* */
CHAR_TAB: 9,
/* \t */
CHAR_UNDERSCORE: 95,
/* _ */
CHAR_VERTICAL_LINE: 124,
/* | */
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
/* \uFEFF */
/**
* Create EXTGLOB_CHARS
*/
extglobChars(chars) {
return {
"!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
"?": { type: "qmark", open: "(?:", close: ")?" },
"+": { type: "plus", open: "(?:", close: ")+" },
"*": { type: "star", open: "(?:", close: ")*" },
"@": { type: "at", open: "(?:", close: ")" }
};
},
/**
* Create GLOB_CHARS
*/
globChars(win32) {
return win32 === !0 ? WINDOWS_CHARS : POSIX_CHARS;
}
};
}
});
// ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/utils.js
var require_utils2 = __commonJS({
"../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/utils.js"(exports) {
"use strict";
init_cjs_shims();
var {
REGEX_BACKSLASH,
REGEX_REMOVE_BACKSLASH,
REGEX_SPECIAL_CHARS,
REGEX_SPECIAL_CHARS_GLOBAL
} = require_constants();
exports.isObject = (val) => val !== null && typeof val == "object" && !Array.isArray(val);
exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
exports.isWindows = () => {
if (typeof navigator < "u" && navigator.platform) {
let platform = navigator.platform.toLowerCase();
return platform === "win32" || platform === "windows";
}
return typeof process < "u" && process.platform ? process.platform === "win32" : !1;
};
exports.removeBackslashes = (str) => str.replace(REGEX_REMOVE_BACKSLASH, (match) => match === "\\" ? "" : match);
exports.escapeLast = (input, char, lastIdx) => {
let idx = input.lastIndexOf(char, lastIdx);
return idx === -1 ? input : input[idx - 1] === "\\" ? exports.escapeLast(input, char, idx - 1) : `${input.slice(0, idx)}\\${input.slice(idx)}`;
};
exports.removePrefix = (input, state = {}) => {
let output = input;
return output.startsWith("./") && (output = output.slice(2), state.prefix = "./"), output;
};
exports.wrapOutput = (input, state = {}, options = {}) => {
let prepend = options.contains ? "" : "^", append = options.contains ? "" : "$", output = `${prepend}(?:${input})${append}`;
return state.negated === !0 && (output = `(?:^(?!${output}).*$)`), output;
};
exports.basename = (path, { windows } = {}) => {
let segs = path.split(windows ? /[\\/]/ : "/"), last = segs[segs.length - 1];
return last === "" ? segs[segs.length - 2] : last;
};
}
});
// ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/scan.js
var require_scan = __commonJS({
"../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/scan.js"(exports, module) {
"use strict";
init_cjs_shims();
var utils = require_utils2(), {
CHAR_ASTERISK,
/* * */
CHAR_AT,
/* @ */
CHAR_BACKWARD_SLASH,
/* \ */
CHAR_COMMA,
/* , */
CHAR_DOT,
/* . */
CHAR_EXCLAMATION_MARK,
/* ! */
CHAR_FORWARD_SLASH,
/* / */
CHAR_LEFT_CURLY_BRACE,
/* { */
CHAR_LEFT_PARENTHESES,
/* ( */
CHAR_LEFT_SQUARE_BRACKET,
/* [ */
CHAR_PLUS,
/* + */
CHAR_QUESTION_MARK,
/* ? */
CHAR_RIGHT_CURLY_BRACE,
/* } */
CHAR_RIGHT_PARENTHESES,
/* ) */
CHAR_RIGHT_SQUARE_BRACKET
/* ] */
} = require_constants(), isPathSeparator = (code) => code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH, depth = (token) => {
token.isPrefix !== !0 && (token.depth = token.isGlobstar ? 1 / 0 : 1);
}, scan = (input, options) => {
let opts = options || {}, length = input.length - 1, scanToEnd = opts.parts === !0 || opts.scanToEnd === !0, slashes = [], tokens = [], parts = [], str = input, index = -1, start = 0, lastIndex = 0, isBrace = !1, isBracket = !1, isGlob = !1, isExtglob = !1, isGlobstar = !1, braceEscaped = !1, backslashes = !1, negated = !1, negatedExtglob = !1, finished = !1, braces = 0, prev, code, token = { value: "", depth: 0, isGlob: !1 }, eos = () => index >= length, peek = () => str.charCodeAt(index + 1), advance = () => (prev = code, str.charCodeAt(++index));
for (; index < length; ) {
code = advance();
let next;
if (code === CHAR_BACKWARD_SLASH) {
backslashes = token.backslashes = !0, code = advance(), code === CHAR_LEFT_CURLY_BRACE && (braceEscaped = !0);
continue;
}
if (braceEscaped === !0 || code === CHAR_LEFT_CURLY_BRACE) {
for (braces++; eos() !== !0 && (code = advance()); ) {
if (code === CHAR_BACKWARD_SLASH) {
backslashes = token.backslashes = !0, advance();
continue;
}
if (code === CHAR_LEFT_CURLY_BRACE) {
braces++;
continue;
}
if (braceEscaped !== !0 && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
if (isBrace = token.isBrace = !0, isGlob = token.isGlob = !0, finished = !0, scanToEnd === !0)
continue;
break;
}
if (braceEscaped !== !0 && code === CHAR_COMMA) {
if (isBrace = token.isBrace = !0, isGlob = token.isGlob = !0, finished = !0, scanToEnd === !0)
continue;
break;
}
if (code === CHAR_RIGHT_CURLY_BRACE && (braces--, braces === 0)) {
braceEscaped = !1, isBrace = token.isBrace = !0, finished = !0;
break;
}
}
if (scanToEnd === !0)
continue;
break;
}
if (code === CHAR_FORWARD_SLASH) {
if (slashes.push(index), tokens.push(token), token = { value: "", depth: 0, isGlob: !1 }, finished === !0) continue;
if (prev === CHAR_DOT && index === start + 1) {
start += 2;
continue;
}
lastIndex = index + 1;
continue;
}
if (opts.noext !== !0 && (code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK) === !0 && peek() === CHAR_LEFT_PARENTHESES) {
if (isGlob = token.isGlob = !0, isExtglob = token.isExtglob = !0, finished = !0, code === CHAR_EXCLAMATION_MARK && index === start && (negatedExtglob = !0), scanToEnd === !0) {
for (; eos() !== !0 && (code = advance()); ) {
if (code === CHAR_BACKWARD_SLASH) {
backslashes = token.backslashes = !0, code = advance();
continue;
}
if (code === CHAR_RIGHT_PARENTHESES) {
isGlob = token.isGlob = !0, finished = !0;
break;
}
}
continue;
}
break;
}
if (code === CHAR_ASTERISK) {
if (prev === CHAR_ASTERISK && (isGlobstar = token.isGlobstar = !0), isGlob = token.isGlob = !0, finished = !0, scanToEnd === !0)
continue;
break;
}
if (code === CHAR_QUESTION_MARK) {
if (isGlob = token.isGlob = !0, finished = !0, scanToEnd === !0)
continue;
break;
}
if (code === CHAR_LEFT_SQUARE_BRACKET) {
for (; eos() !== !0 && (next = advance()); ) {
if (next === CHAR_BACKWARD_SLASH) {
backslashes = token.backslashes = !0, advance();
continue;
}
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
isBracket = token.isBracket = !0, isGlob = token.isGlob = !0, finished = !0;
break;
}
}
if (scanToEnd === !0)
continue;
break;
}
if (opts.nonegate !== !0 && code === CHAR_EXCLAMATION_MARK && index === start) {
negated = token.negated = !0, start++;
continue;
}
if (opts.noparen !== !0 && code === CHAR_LEFT_PARENTHESES) {
if (isGlob = token.isGlob = !0, scanToEnd === !0) {
for (; eos() !== !0 && (code = advance()); ) {
if (code === CHAR_LEFT_PARENTHESES) {
backslashes = token.backslashes = !0, code = advance();
continue;
}
if (code === CHAR_RIGHT_PARENTHESES) {
finished = !0;
break;
}
}
continue;
}
break;
}
if (isGlob === !0) {
if (finished = !0, scanToEnd === !0)
continue;
break;
}
}
opts.noext === !0 && (isExtglob = !1, isGlob = !1);
let base = str, prefix = "", glob = "";
start > 0 && (prefix = str.slice(0, start), str = str.slice(start), lastIndex -= start), base && isGlob === !0 && lastIndex > 0 ? (base = str.slice(0, lastIndex), glob = str.slice(lastIndex)) : isGlob === !0 ? (base = "", glob = str) : base = str, base && base !== "" && base !== "/" && base !== str && isPathSeparator(base.charCodeAt(base.length - 1)) && (base = base.slice(0, -1)), opts.unescape === !0 && (glob && (glob = utils.removeBackslashes(glob)), base && backslashes === !0 && (base = utils.removeBackslashes(base)));
let state = {
prefix,
input,
start,
base,
glob,
isBrace,
isBracket,
isGlob,
isExtglob,
isGlobstar,
negated,
negatedExtglob
};
if (opts.tokens === !0 && (state.maxDepth = 0, isPathSeparator(code) || tokens.push(token), state.tokens = tokens), opts.parts === !0 || opts.tokens === !0) {
let prevIndex;
for (let idx = 0; idx < slashes.length; idx++) {
let n = prevIndex ? prevIndex + 1 : start, i = slashes[idx], value = input.slice(n, i);
opts.tokens && (idx === 0 && start !== 0 ? (tokens[idx].isPrefix = !0, tokens[idx].value = prefix) : tokens[idx].value = value, depth(tokens[idx]), state.maxDepth += tokens[idx].depth), (idx !== 0 || value !== "") && parts.push(value), prevIndex = i;
}
if (prevIndex && prevIndex + 1 < input.length) {
let value = input.slice(prevIndex + 1);
parts.push(value), opts.tokens && (tokens[tokens.length - 1].value = value, depth(tokens[tokens.length - 1]), state.maxDepth += tokens[tokens.length - 1].depth);
}
state.slashes = slashes, state.parts = parts;
}
return state;
};
module.exports = scan;
}
});
// ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/parse.js
var require_parse = __commonJS({
"../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/parse.js"(exports, module) {
"use strict";
init_cjs_shims();
var constants = require_constants(), utils = require_utils2(), {
MAX_LENGTH,
POSIX_REGEX_SOURCE,
REGEX_NON_SPECIAL_CHARS,
REGEX_SPECIAL_CHARS_BACKREF,
REPLACEMENTS
} = constants, expandRange = (args, options) => {
if (typeof options.expandRange == "function")
return options.expandRange(...args, options);
args.sort();
let value = `[${args.join("-")}]`;
try {
new RegExp(value);
} catch {
return args.map((v) => utils.escapeRegex(v)).join("..");
}
return value;
}, syntaxError = (type, char) => `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`, splitTopLevel = (input) => {
let parts = [], bracket = 0, paren = 0, quote = 0, value = "", escaped = !1;
for (let ch of input) {
if (escaped === !0) {
value += ch, escaped = !1;
continue;
}
if (ch === "\\") {
value += ch, escaped = !0;
continue;
}
if (ch === '"') {
quote = quote === 1 ? 0 : 1, value += ch;
continue;
}
if (quote === 0) {
if (ch === "[")
bracket++;
else if (ch === "]" && bracket > 0)
bracket--;
else if (bracket === 0) {
if (ch === "(")
paren++;
else if (ch === ")" && paren > 0)
paren--;
else if (ch === "|" && paren === 0) {
parts.push(value), value = "";
continue;
}
}
}
value += ch;
}
return parts.push(value), parts;
}, isPlainBranch = (branch) => {
let escaped = !1;
for (let ch of branch) {
if (escaped === !0) {
escaped = !1;
continue;
}
if (ch === "\\") {
escaped = !0;
continue;
}
if (/[?*+@!()[\]{}]/.test(ch))
return !1;
}
return !0;
}, normalizeSimpleBranch = (branch) => {
let value = branch.trim(), changed = !0;
for (; changed === !0; )
changed = !1, /^@\([^\\()[\]{}|]+\)$/.test(value) && (value = value.slice(2, -1), changed = !0);
if (isPlainBranch(value))
return value.replace(/\\(.)/g, "$1");
}, hasRepeatedCharPrefixOverlap = (branches) => {
let values = branches.map(normalizeSimpleBranch).filter(Boolean);
for (let i = 0; i < values.length; i++)
for (let j = i + 1; j < values.length; j++) {
let a = values[i], b = values[j], char = a[0];
if (!(!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) && (a === b || a.startsWith(b) || b.startsWith(a)))
return !0;
}
return !1;
}, parseRepeatedExtglob = (pattern, requireEnd = !0) => {
if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(")
return;
let bracket = 0, paren = 0, quote = 0, escaped = !1;
for (let i = 1; i < pattern.length; i++) {
let ch = pattern[i];
if (escaped === !0) {
escaped = !1;
continue;
}
if (ch === "\\") {
escaped = !0;
continue;
}
if (ch === '"') {
quote = quote === 1 ? 0 : 1;
continue;
}
if (quote !== 1) {
if (ch === "[") {
bracket++;
continue;
}
if (ch === "]" && bracket > 0) {
bracket--;
continue;
}
if (!(bracket > 0)) {
if (ch === "(") {
paren++;
continue;
}
if (ch === ")" && (paren--, paren === 0))
return requireEnd === !0 && i !== pattern.length - 1 ? void 0 : {
type: pattern[0],
body: pattern.slice(2, i),
end: i
};
}
}
}
}, buildCharClassStar = (chars) => `${chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`}*`, getStarExtglobSequenceChars = (pattern) => {
let index = 0, chars = [];
for (; index < pattern.length; ) {
let match = parseRepeatedExtglob(pattern.slice(index), !1);
if (!match || match.type !== "*")
return;
let branches = splitTopLevel(match.body).map((branch2) => branch2.trim());
if (branches.length !== 1)
return;
let branch = normalizeSimpleBranch(branches[0]);
if (!branch || branch.length !== 1)
return;
chars.push(branch), index += match.end + 1;
}
if (!(chars.length < 1))
return chars;
}, repeatedExtglobRecursion = (pattern) => {
let depth = 0, value = pattern.trim(), match = parseRepeatedExtglob(value);
for (; match; )
depth++, value = match.body.trim(), match = parseRepeatedExtglob(value);
return depth;
}, analyzeRepeatedExtglob = (body, options) => {
if (options.maxExtglobRecursion === !1)
return { risky: !1 };
let max = typeof options.maxExtglobRecursion == "number" ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION, branches = splitTopLevel(body).map((branch) => branch.trim());
if (branches.length > 1 && (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)))
return { risky: !0 };
let safeChars = [], sawStarSequence = !1, combinable = !0;
for (let branch of branches) {
let chars = getStarExtglobSequenceChars(branch);
if (chars) {
sawStarSequence = !0, safeChars.push(...chars);
continue;
}
let literal = normalizeSimpleBranch(branch);
if (literal && literal.length === 1) {
safeChars.push(literal);
continue;
}
if (combinable = !1, repeatedExtglobRecursion(branch) > max)
return { risky: !0 };
}
return sawStarSequence ? combinable ? { risky: !0, safeOutput: buildCharClassStar([...new Set(safeChars)]) } : { risky: !0 } : { risky: !1 };
}, parse = (input, options) => {
if (typeof input != "string")
throw new TypeError("Expected a string");
input = REPLACEMENTS[input] || input;
let opts = { ...options }, max = typeof opts.maxLength == "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH, len = input.length;
if (len > max)
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
let bos = { type: "bos", value: "", output: opts.prepend || "" }, tokens = [bos], capture = opts.capture ? "" : "?:", PLATFORM_CHARS = constants.globChars(opts.windows), EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS), {
DOT_LITERAL,
PLUS_LITERAL,
SLASH_LITERAL,
ONE_CHAR,
DOTS_SLASH,
NO_DOT,
NO_DOT_SLASH,
NO_DOTS_SLASH,
QMARK,
QMARK_NO_DOT,
STAR,
START_ANCHOR
} = PLATFORM_CHARS, globstar = (opts2) => `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`, nodot = opts.dot ? "" : NO_DOT, qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT, star = opts.bash === !0 ? globstar(opts) : STAR;
opts.capture && (star = `(${star})`), typeof opts.noext == "boolean" && (opts.noextglob = opts.noext);
let state = {
input,
index: -1,
start: 0,
dot: opts.dot === !0,
consumed: "",
output: "",
prefix: "",
backtrack: !1,
negated: !1,
brackets: 0,
braces: 0,
parens: 0,
quotes: 0,
globstar: !1,
tokens
};
input = utils.removePrefix(input, state), len = input.length;
let extglobs = [], braces = [], stack = [], prev = bos, value, eos = () => state.index === len - 1, peek = state.peek = (n = 1) => input[state.index + n], advance = state.advance = () => input[++state.index] || "", remaining = () => input.slice(state.index + 1), consume = (value2 = "", num = 0) => {
state.consumed += value2, state.index += num;
}, append = (token) => {
state.output += token.output != null ? token.output : token.value, consume(token.value);
}, negate = () => {
let count = 1;
for (; peek() === "!" && (peek(2) !== "(" || peek(3) === "?"); )
advance(), state.start++, count++;
return count % 2 === 0 ? !1 : (state.negated = !0, state.start++, !0);
}, increment = (type) => {
state[type]++, stack.push(type);
}, decrement = (type) => {
state[type]--, stack.pop();
}, push = (tok) => {
if (prev.type === "globstar") {
let isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace"), isExtglob = tok.extglob === !0 || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob && (state.output = state.output.slice(0, -prev.output.length), prev.type = "star", prev.value = "*", prev.output = star, state.output += prev.output);
}
if (extglobs.length && tok.type !== "paren" && (extglobs[extglobs.length - 1].inner += tok.value), (tok.value || tok.output) && append(tok), prev && prev.type === "text" && tok.type === "text") {
prev.output = (prev.output || prev.value) + tok.value, prev.value += tok.value;
return;
}
tok.prev = prev, tokens.push(tok), prev = tok;
}, extglobOpen = (type, value2) => {
let token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
token.prev = prev, token.parens = state.parens, token.output = state.output, token.startIndex = state.index, token.tokensIndex = tokens.length;
let output = (opts.capture ? "(" : "") + token.open;
increment("parens"), push({ type, value: value2, output: state.output ? "" : ONE_CHAR }), push({ type: "paren", extglob: !0, value: advance(), output }), extglobs.push(token);
}, extglobClose = (token) => {
let literal = input.slice(token.startIndex, state.index + 1), body = input.slice(token.startIndex + 2, state.index), analysis = analyzeRepeatedExtglob(body, opts);
if ((token.type === "plus" || token.type === "star") && analysis.risky) {
let safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0, open = tokens[token.tokensIndex];
open.type = "text", open.value = literal, open.output = safeOutput || utils.escapeRegex(literal);
for (let i = token.tokensIndex + 1; i < tokens.length; i++)
tokens[i].value = "", tokens[i].output = "", delete tokens[i].suffix;
state.output = token.output + open.output, state.backtrack = !0, push({ type: "paren", extglob: !0, value, output: "" }), decrement("parens");
return;
}
let output = token.close + (opts.capture ? ")" : ""), rest;
if (token.type === "negate") {
let extglobStar = star;
if (token.inner && token.inner.length > 1 && token.inner.includes("/") && (extglobStar = globstar(opts)), (extglobStar !== star || eos() || /^\)+$/.test(remaining())) && (output = token.close = `)$))${extglobStar}`), token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
let expression = parse(rest, { ...options, fastpaths: !1 }).output;
output = token.close = `)${expression})${extglobStar})`;
}
token.prev.type === "bos" && (state.negatedExtglob = !0);
}
push({ type: "paren", extglob: !0, value, output }), decrement("parens");
};
if (opts.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(input)) {
let backslashes = !1, output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => first === "\\" ? (backslashes = !0, m) : first === "?" ? esc ? esc + first + (rest ? QMARK.repeat(rest.length) : "") : index === 0 ? qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "") : QMARK.repeat(chars.length) : first === "." ? DOT_LITERAL.repeat(chars.length) : first === "*" ? esc ? esc + first + (rest ? star : "") : star : esc ? m : `\\${m}`);
return backslashes === !0 && (opts.unescape === !0 ? output = output.replace(/\\/g, "") : output = output.replace(/\\+/g, (m) => m.length % 2 === 0 ? "\\\\" : m ? "\\" : "")), output === input && opts.contains === !0 ? (state.output = input, state) : (state.output = utils.wrapOutput(output, state, options), state);
}
for (; !eos(); ) {
if (value = advance(), value === "\0")
continue;
if (value === "\\") {
let next = peek();
if (next === "/" && opts.bash !== !0 || next === "." || next === ";")
continue;
if (!next) {
value += "\\", push({ type: "text", value });
continue;
}
let match = /^\\+/.exec(remaining()), slashes = 0;
if (match && match[0].length > 2 && (slashes = match[0].length, state.index += slashes, slashes % 2 !== 0 && (value += "\\")), opts.unescape === !0 ? value = advance() : value += advance(), state.brackets === 0) {
push({ type: "text", value });
continue;
}
}
if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
if (opts.posix !== !1 && value === ":") {
let inner = prev.value.slice(1);
if (inner.includes("[") && (prev.posix = !0, inner.includes(":"))) {
let idx = prev.value.lastIndexOf("["), pre = prev.value.slice(0, idx), rest2 = prev.value.slice(idx + 2), posix = POSIX_REGEX_SOURCE[rest2];
if (posix) {
prev.value = pre + posix, state.backtrack = !0, advance(), !bos.output && tokens.indexOf(prev) === 1 && (bos.output = ONE_CHAR);
continue;
}
}
}
(value === "[" && peek() !== ":" || value === "-" && peek() === "]") && (value = `\\${value}`), value === "]" && (prev.value === "[" || prev.value === "[^") && (value = `\\${value}`), opts.posix === !0 && value === "!" && prev.value === "[" && (value = "^"), prev.value += value, append({ value });
continue;
}
if (state.quotes === 1 && value !== '"') {
value = utils.escapeRegex(value), prev.value += value, append({ value });
continue;
}
if (value === '"') {
state.quotes = state.quotes === 1 ? 0 : 1, opts.keepQuotes === !0 && push({ type: "text", value });
continue;
}
if (value === "(") {
increment("parens"), push({ type: "paren", value });
continue;
}
if (value === ")") {
if (state.parens === 0 && opts.strictBrackets === !0)
throw new SyntaxError(syntaxError("opening", "("));
let extglob = extglobs[extglobs.length - 1];
if (extglob && state.parens === extglob.parens + 1) {
extglobClose(extglobs.pop());
continue;
}
push({ type: "paren", value, output: state.parens ? ")" : "\\)" }), decrement("parens");
continue;
}
if (value === "[") {
if (opts.nobracket === !0 || !remaining().includes("]")) {
if (opts.nobracket !== !0 && opts.strictBrackets === !0)
throw new SyntaxError(syntaxError("closing", "]"));
value = `\\${value}`;
} else
increment("brackets");
push({ type: "bracket", value });
continue;
}
if (value === "]") {
if (opts.nobracket === !0 || prev && prev.type === "bracket" && prev.value.length === 1) {
push({ type: "text", value, output: `\\${value}` });
continue;
}
if (state.brackets === 0) {
if (opts.strictBrackets === !0)
throw new SyntaxError(syntaxError("opening", "["));
push({ type: "text", value, output: `\\${value}` });
continue;
}
decrement("brackets");
let prevValue = prev.value.slice(1);
if (prev.posix !== !0 && prevValue[0] === "^" && !prevValue.includes("/") && (value = `/${value}`), prev.value += value, append({ value }), opts.literalBrackets === !1 || utils.hasRegexChars(prevValue))
continue;
let escaped = utils.escapeRegex(prev.value);
if (state.output = state.output.slice(0, -prev.value.length), opts.literalBrackets === !0) {
state.output += escaped, prev.value = escaped;
continue;
}
prev.value = `(${capture}${escaped}|${prev.value})`, state.output += prev.value;
continue;
}
if (value === "{" && opts.nobrace !== !0) {
increment("braces");
let open = {
type: "brace",
value,
output: "(",
outputIndex: state.output.length,
tokensIndex: state.tokens.length
};
braces.push(open), push(open);
continue;
}
if (value === "}") {
let brace = braces[braces.length - 1];
if (opts.nobrace === !0 || !brace) {
push({ type: "text", value, output: value });
continue;
}
let output = ")";
if (brace.dots === !0) {
let arr = tokens.slice(), range = [];
for (let i = arr.length - 1; i >= 0 && (tokens.pop(), arr[i].type !== "brace"); i--)
arr[i].type !== "dots" && range.unshift(arr[i].value);
output = expandRange(range, opts), state.backtrack = !0;
}
if (brace.comma !== !0 && brace.dots !== !0) {
let out = state.output.slice(0, brace.outputIndex), toks = state.tokens.slice(brace.tokensIndex);
brace.value = brace.output = "\\{", value = output = "\\}", state.output = out;
for (let t of toks)
state.output += t.output || t.value;
}
push({ type: "brace", value, output }), decrement("braces"), braces.pop();
continue;
}
if (value === "|") {
extglobs.length > 0 && extglobs[extglobs.length - 1].conditions++, push({ type: "text", value });
continue;
}
if (value === ",") {
let output = value, brace = braces[braces.length - 1];
brace && stack[stack.length - 1] === "braces" && (brace.comma = !0, output = "|"), push({ type: "comma", value, output });
continue;
}
if (value === "/") {
if (prev.type === "dot" && state.index === state.start + 1) {
state.start = state.index + 1, state.consumed = "", state.output = "", tokens.pop(), prev = bos;
continue;
}
push({ type: "slash", value, output: SLASH_LITERAL });
continue;
}
if (value === ".") {
if (state.braces > 0 && prev.type === "dot") {
prev.value === "." && (prev.output = DOT_LITERAL);
let brace = braces[braces.length - 1];
prev.type = "dots", prev.output += value, prev.value += value, brace.dots = !0;
continue;
}
if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
push({ type: "text", value, output: DOT_LITERAL });
continue;
}
push({ type: "dot", value, output: DOT_LITERAL });
continue;
}
if (value === "?") {
if (!(prev && prev.value === "(") && opts.noextglob !== !0 && peek() === "(" && peek(2) !== "?") {
extglobOpen("qmark", value);
continue;
}
if (prev && prev.type === "paren") {
let next = peek(), output = value;
(prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) && (output = `\\${value}`), push({ type: "text", value, output });
continue;
}
if (opts.dot !== !0 && (prev.type === "slash" || prev.type === "bos")) {
push({ type: "qmark", value, output: QMARK_NO_DOT });
continue;
}
push({ type: "qmark", value, output: QMARK });
continue;
}
if (value === "!") {
if (opts.noextglob !== !0 && peek() === "(" && (peek(2) !== "?" || !/[!=<:]/.test(peek(3)))) {
extglobOpen("negate", value);
continue;
}
if (opts.nonegate !== !0 && state.index === 0) {
negate();
continue;
}
}
if (value === "+") {
if (opts.noextglob !== !0 && peek() === "(" && peek(2) !== "?") {
extglobOpen("plus", value);
continue;
}
if (prev && prev.value === "(" || opts.regex === !1) {
push({ type: "plus", value, output: PLUS_LITERAL });
continue;
}
if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
push({ type: "plus", value });
continue;
}
push({ type: "plus", value: PLUS_LITERAL });
continue;
}
if (value === "@") {
if (opts.noextglob !== !0 && peek() === "(" && peek(2) !== "?") {
push({ type: "at", extglob: !0, value, output: "" });
continue;
}
push({ type: "text", value });
continue;
}
if (value !== "*") {
(value === "$" || value === "^") && (value = `\\${value}`);
let match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
match && (value += match[0], state.index += match[0].length), push({ type: "text", value });
continue;
}
if (prev && (prev.type === "globstar" || prev.star === !0)) {
prev.type = "star", prev.star = !0, prev.value += value, prev.output = star, state.backtrack = !0, state.globstar = !0, consume(value);
continue;
}
let rest = remaining();
if (opts.noextglob !== !0 && /^\([^?]/.test(rest)) {
extglobOpen("star", value);
continue;
}
if (prev.type === "star") {
if (opts.noglobstar === !0) {
consume(value);
continue;
}
let prior = prev.prev, before = prior.prev, isStart = prior.type === "slash" || prior.type === "bos", afterStar = before && (before.type === "star" || before.type === "globstar");
if (opts.bash === !0 && (!isStart || rest[0] && rest[0] !== "/")) {
push({ type: "star", value, output: "" });
continue;
}
let isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace"), isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
push({ type: "star", value, output: "" });
continue;
}
for (; rest.slice(0, 3) === "/**"; ) {
let after = input[state.index + 4];
if (after && after !== "/")
break;
rest = rest.slice(3), consume("/**", 3);
}
if (prior.type === "bos" && eos()) {
prev.type = "globstar", prev.value += value, prev.output = globstar(opts), state.output = prev.output, state.globstar = !0, consume(value);
continue;
}
if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
state.output = state.output.slice(0, -(prior.output + prev.output).length), prior.output = `(?:${prior.output}`, prev.type = "globstar", prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)"), prev.value += value, state.globstar = !0, state.output += prior.output + prev.output, consume(value);
continue;
}
if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
let end = rest[1] !== void 0 ? "|$" : "";
state.output = state.output.slice(0, -(prior.output + prev.output).length), prior.output = `(?:${prior.output}`, prev.type = "globstar", prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`, prev.value += value, state.output += prior.output + prev.output, state.globstar = !0, consume(value + advance()), push({ type: "slash", value: "/", output: "" });
continue;
}
if (prior.type === "bos" && rest[0] === "/") {
prev.type = "globstar", prev.value += value, prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`, state.output = prev.output, state.globstar = !0, consume(value + advance()), push({ type: "slash", value: "/", output: "" });
continue;
}
state.output = state.output.slice(0, -prev.output.length), prev.type = "globstar", prev.output = globstar(opts), prev.value += value, state.output += prev.output, state.globstar = !0, consume(value);
continue;
}
let token = { type: "star", value, output: star };
if (opts.bash === !0) {
token.output = ".*?", (prev.type === "bos" || prev.type === "slash") && (token.output = nodot + token.output), push(token);
continue;
}
if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === !0) {
token.output = value, push(token);
continue;
}
(state.index === state.start || prev.type === "slash" || prev.type === "dot") && (prev.type === "dot" ? (state.output += NO_DOT_SLASH, prev.output += NO_DOT_SLASH) : opts.dot === !0 ? (state.output += NO_DOTS_SLASH, prev.output += NO_DOTS_SLASH) : (state.output += nodot, prev.output += nodot), peek() !== "*" && (state.output += ONE_CHAR, prev.output += ONE_CHAR)), push(token);
}
for (; state.brackets > 0; ) {
if (opts.strictBrackets === !0) throw new SyntaxError(syntaxError("closing", "]"));
state.output = utils.escapeLast(state.output, "["), decrement("brackets");
}
for (; state.parens > 0; ) {
if (opts.strictBrackets === !0) throw new SyntaxError(syntaxError("closing", ")"));
state.output = utils.escapeLast(state.output, "("), decrement("parens");
}
for (; state.braces > 0; ) {
if (opts.strictBrackets === !0) throw new SyntaxError(syntaxError("closing", "}"));
state.output = utils.escapeLast(state.output, "{"), decrement("braces");
}
if (opts.strictSlashes !== !0 && (prev.type === "star" || prev.type === "bracket") && push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` }), state.backtrack === !0) {
state.output = "";
for (let token of state.tokens)
state.output += token.output != null ? token.output : token.value, token.suffix && (state.output += token.suffix);
}
return state;
};
parse.fastpaths = (input, options) => {
let opts = { ...options }, max = typeof opts.maxLength == "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH, len = input.length;
if (len > max)
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
input = REPLACEMENTS[input] || input;
let {
DOT_LITERAL,
SLASH_LITERAL,
ONE_CHAR,
DOTS_SLASH,
NO_DOT,
NO_DOTS,
NO_DOTS_SLASH,
STAR,
START_ANCHOR
} = constants.globChars(opts.windows), nodot = opts.dot ? NO_DOTS : NO_DOT, slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT, capture = opts.capture ? "" : "?:", state = { negated: !1, prefix: "" }, star = opts.bash === !0 ? ".*?" : STAR;
opts.capture && (star = `(${star})`);
let globstar = (opts2) => opts2.noglobstar === !0 ? star : `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`, create = (str) => {
switch (str) {
case "*":
return `${nodot}${ONE_CHAR}${star}`;
case ".*":
return `${DOT_LITERAL}${ONE_CHAR}${star}`;
case "*.*":
return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
case "*/*":
return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
case "**":
return nodot + globstar(opts);
case "**/*":
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
case "**/*.*":
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
case "**/.*":
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
default: {
let match = /^(.*?)\.(\w+)$/.exec(str);
if (!match) return;
let source2 = create(match[1]);
return source2 ? source2 + DOT_LITERAL + match[2] : void 0;
}
}
}, output = utils.removePrefix(input, state), source = create(output);
return source && opts.strictSlashes !== !0 && (source += `${SLASH_LITERAL}?`), source;
};
module.exports = parse;
}
});
// ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/picomatch.js
var require_picomatch = __commonJS({
"../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/picomatch.js"(exports, module) {
"use strict";
init_cjs_shims();
var scan = require_scan(), parse = require_parse(), utils = require_utils2(), constants = require_constants(), isObject = (val) => val && typeof val == "object" && !Array.isArray(val), picomatch = (glob, options, returnState = !1) => {
if (Array.isArray(glob)) {
let fns = glob.map((input) => picomatch(input, options, returnState));
return (str) => {
for (let isMatch of fns) {
let state2 = isMatch(str);
if (state2) return state2;
}
return !1;
};
}
let isState = isObject(glob) && glob.tokens && glob.input;
if (glob === "" || typeof glob != "string" && !isState)
throw new TypeError("Expected pattern to be a non-empty string");
let opts = options || {}, posix = opts.windows, regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, !1, !0), state = regex.state;
delete regex.state;
let isIgnored = () => !1;
if (opts.ignore) {
let ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
}
let matcher = (input, returnObject = !1) => {
let { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }), result = { glob, state, regex, posix, input, output, match, isMatch };
return typeof opts.onResult == "function" && opts.onResult(result), isMatch === !1 ? (result.isMatch = !1, returnObject ? result : !1) : isIgnored(input) ? (typeof opts.onIgnore == "function" && opts.onIgnore(result), result.isMatch = !1, returnObject ? result : !1) : (typeof opts.onMatch == "function" && opts.onMatch(result), returnObject ? result : !0);
};
return returnState && (matcher.state = state), matcher;
};
picomatch.test = (input, regex, options, { glob, posix } = {}) => {
if (typeof input != "string")
throw new TypeError("Expected input to be a string");
if (input === "")
return { isMatch: !1, output: "" };
let opts = options || {}, format = opts.format || (posix ? utils.toPosixSlashes : null), match = input === glob, output = match && format ? format(input) : input;
return match === !1 && (output = format ? format(input) : input, match = output === glob), (match === !1 || opts.capture === !0) && (opts.matchBase === !0 || opts.basename === !0 ? match = picomatch.matchBase(input, regex, options, posix) : match = regex.exec(output)), { isMatch: !!match, match, output };
};
picomatch.matchBase = (input, glob, options, posix = options && options.windows) => (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(utils.basename(input, { windows: posix }));
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
picomatch.parse = (pattern, options) => Array.isArray(pattern) ? pattern.map((p) => picomatch.parse(p, options)) : parse(pattern, { ...options, fastpaths: !1 });
picomatch.scan = (input, options) => scan(input, options);
picomatch.compileRe = (state, options, returnOutput = !1, returnState = !1) => {
if (returnOutput === !0)
return state.output;
let opts = options || {}, prepend = opts.contains ? "" : "^", append = opts.contains ? "" : "$", source = `${prepend}(?:${state.output})${append}`;
state && state.negated === !0 && (source = `^(?!${source}).*$`);
let regex = picomatch.toRegex(source, options);
return returnState === !0 && (regex.state = state), regex;
};
picomatch.makeRe = (input, options = {}, returnOutput = !1, returnState = !1) => {
if (!input || typeof input != "string")
throw new TypeError("Expected a non-empty string");
let parsed = { negated: !1, fastpaths: !0 };
return options.fastpaths !== !1 && (input[0] === "." || input[0] === "*") && (parsed.output = parse.fastpaths(input, options)), parsed.output || (parsed = parse(input, options)), picomatch.compileRe(parsed, options, returnOutput, returnState);
};
picomatch.toRegex = (source, options) => {
try {
let opts = options || {};
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
} catch (err) {
if (options && options.debug === !0) throw err;
return /$^/;
}
};
picomatch.constants = constants;
module.exports = picomatch;
}
});
// ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/index.js
var require_picomatch2 = __commonJS({
"../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/index.js"(exports, module) {
"use strict";
init_cjs_shims();
var pico = require_picomatch(), utils = require_utils2();
function picomatch(glob, options, returnState = !1) {
return options && (options.windows === null || options.windows === void 0) && (options = { ...options, windows: utils.isWindows() }), pico(glob, options, returnState);
}
Object.assign(picomatch, pico);
module.exports = picomatch;
}
});
// ../../node_modules/.pnpm/fdir@6.5.0_picomatch@4.0.5/node_modules/fdir/dist/index.cjs
var require_dist = __commonJS({
"../../node_modules/.pnpm/fdir@6.5.0_picomatch@4.0.5/node_modules/fdir/dist/index.cjs"(exports) {
init_cjs_shims();
var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __copyProps = (to, from, except, desc) => {
if (from && typeof from == "object" || typeof from == "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++)
key = keys[i], !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
get: ((k) => from[k]).bind(null, key),
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
return to;
}, __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
value: mod,
enumerable: !0
}) : target, mod)), path = __toESM(__require("path")), fs = __toESM(__require("fs"));
function cleanPath(path$1) {
let normalized = (0, path.normalize)(path$1);
return normalized.length > 1 && normalized[normalized.length - 1] === path.sep && (normalized = normalized.substring(0, normalized.length - 1)), normalized;
}
var SLASHES_REGEX = /[\\/]/g;
function convertSlashes(path$1, separator) {
return path$1.replace(SLASHES_REGEX, separator);
}
var WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
function isRootDirectory(path$1) {
return path$1 === "/" || WINDOWS_ROOT_DIR_REGEX.test(path$1);
}
function normalizePath(path$1, options) {
let { resolvePaths, normalizePath: normalizePath$1, pathSeparator } = options, pathNeedsCleaning = process.platform === "win32" && path$1.includes("/") || path$1.startsWith(".");
if (resolvePaths && (path$1 = (0, path.resolve)(path$1)), (normalizePath$1 || pathNeedsCleaning) && (path$1 = cleanPath(path$1)), path$1 === ".") return "";
let needsSeperator = path$1[path$1.length - 1] !== pathSeparator;
return convertSlashes(needsSeperator ? path$1 + pathSeparator : path$1, pathSeparator);
}
function joinPathWithBasePath(filename, directoryPath) {
return directoryPath + filename;
}
function joinPathWithRelativePath(root, options) {
return function(filename, directoryPath) {
return directoryPath.startsWith(root) ? directoryPath.slice(root.length) + filename : convertSlashes((0, path.relative)(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename;
};
}
function joinPath(filename) {
return filename;
}
function joinDirectoryPath(filename, directoryPath, separator) {
return directoryPath + filename + separator;
}
function build$7(root, options) {
let { relativePaths, includeBasePath } = options;
return relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath;
}
function pushDirectoryWithRelativePath(root) {
return function(directoryPath, paths) {
paths.push(directoryPath.substring(root.length) || ".");
};
}
function pushDirectoryFilterWithRelativePath(root) {
return function(directoryPath, paths, filters) {
let relativePath = directoryPath.substring(root.length) || ".";
filters.every((filter) => filter(relativePath, !0)) && paths.push(relativePath);
};
}
var pushDirectory = (directoryPath, paths) => {
paths.push(directoryPath || ".");
}, pushDirectoryFilter = (directoryPath, paths, filters) => {
let path$1 = directoryPath || ".";
filters.every((filter) => filter(path$1, !0)) && paths.push(path$1);
}, empty$2 = () => {
};
function build$6(root, options) {
let { includeDirs, filters, relativePaths } = options;
return includeDirs ? relativePaths ? filters && filters.length ? pushDirectoryFilterWithRelativePath(root) : pushDirectoryWithRelativePath(root) : filters && filters.length ? pushDirectoryFilter : pushDirectory : empty$2;
}
var pushFileFilterAndCount = (filename, _paths, counts, filters) => {
filters.every((filter) => filter(filename, !1)) && counts.files++;
}, pushFileFilter = (filename, paths, _counts, filters) => {
filters.every((filter) => filter(filename, !1)) && paths.push(filename);
}, pushFileCount = (_filename, _paths, counts, _filters) => {
counts.files++;
}, pushFile = (filename, paths) => {
paths.push(filename);
}, empty$1 = () => {
};
function build$5(options) {
let { excludeFiles, filters, onlyCounts } = options;
return excludeFiles ? empty$1 : filters && filters.length ? onlyCounts ? pushFileFilterAndCount : pushFileFilter : onlyCounts ? pushFileCount : pushFile;
}
var getArray = (paths) => paths, getArrayGroup = () => [""].slice(0, 0);
function build$4(options) {
return options.group ? getArrayGroup : getArray;
}
var groupFiles = (groups, directory, files) => {
groups.push({
directory,
files,
dir: directory
});
}, empty = () => {
};
function build$3(options) {
return options.group ? groupFiles : empty;
}
var resolveSymlinksAsync = function(path$1, state, callback$1) {
let { queue, fs: fs$1, options: { suppressErrors } } = state;
queue.enqueue(), fs$1.realpath(path$1, (error, resolvedPath) => {
if (error) return queue.dequeue(suppressErrors ? null : error, state);
fs$1.stat(resolvedPath, (error$1, stat) => {
if (error$1) return queue.dequeue(suppressErrors ? null : error$1, state);
if (stat.isDirectory() && isRecursive(path$1, resolvedPath, state)) return queue.dequeue(null, state);
callback$1(stat, resolvedPath), queue.dequeue(null, state);
});
});
}, resolveSymlinks = function(path$1, state, callback$1) {
let { queue, fs: fs$1, options: { suppressErrors } } = state;
queue.enqueue();
try {
let resolvedPath = fs$1.realpathSync(path$1), stat = fs$1.statSync(resolvedPath);
if (stat.isDirectory() && isRecursive(path$1, resolvedPath, state)) return;
callback$1(stat, resolvedPath);
} catch (e) {
if (!suppressErrors) throw e;
}
};
function build$2(options, isSynchronous) {
return !options.resolveSymlinks || options.excludeSymlinks ? null : isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
}
function isRecursive(path$1, resolved, state) {
if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
let parent = (0, path.dirname)(path$1), depth = 1;
for (; parent !== state.root && depth < 2; ) {
let resolvedPath = state.symlinks.get(parent);
!!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath)) ? depth++ : parent = (0, path.dirname)(parent);
}
return state.symlinks.set(path$1, resolved), depth > 1;
}
function isRecursiveUsingRealPaths(resolved, state) {
return state.visited.includes(resolved + state.options.pathSeparator);
}
var onlyCountsSync = (state) => state.counts, groupsSync = (state) => state.groups, defaultSync = (state) => state.paths, limitFilesSync = (state) => state.paths.slice(0, state.options.maxFiles), onlyCountsAsync = (state, error, callback$1) => (report(error, callback$1, state.counts, state.options.suppressErrors), null), defaultAsync = (state, error, callback$1) => (report(error, callback$1, state.paths, state.options.suppressErrors), null), limitFilesAsync = (state, error, callback$1) => (report(error, callback$1, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors), null), groupsAsync = (state, error, callback$1) => (report(error, callback$1, state.groups, state.options.suppressErrors), null);
function report(error, callback$1, output, suppressErrors) {
callback$1(error && !suppressErrors ? error : null, output);
}
function build$1(options, isSynchronous) {
let { onlyCounts, group, maxFiles } = options;
return onlyCounts ? isSynchronous ? onlyCountsSync : onlyCountsAsync : group ? isSynchronous ? groupsSync : groupsAsync : maxFiles ? isSynchronous ? limitFilesSync : limitFilesAsync : isSynchronous ? defaultSync : defaultAsync;
}
var readdirOpts = { withFileTypes: !0 }, walkAsync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
if (state.queue.enqueue(), currentDepth < 0) return state.queue.dequeue(null, state);
let { fs: fs$1 } = state;
state.visited.push(crawlPath), state.counts.directories++, fs$1.readdir(crawlPath || ".", readdirOpts, (error, entries = []) => {
callback$1(entries, directoryPath, currentDepth), state.queue.dequeue(state.options.suppressErrors ? null : error, state);
});
}, walkSync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
let { fs: fs$1 } = state;
if (currentDepth < 0) return;
state.visited.push(crawlPath), state.counts.directories++;
let entries = [];
try {
entries = fs$1.readdirSync(crawlPath || ".", readdirOpts);
} catch (e) {
if (!state.options.suppressErrors) throw e;
}
callback$1(entries, directoryPath, currentDepth);
};
function build(isSynchronous) {
return isSynchronous ? walkSync : walkAsync;
}
var Queue = class {
count = 0;
constructor(onQueueEmpty) {
this.onQueueEmpty = onQueueEmpty;
}
enqueue() {
return this.count++, this.count;
}
dequeue(error, output) {
this.onQueueEmpty && (--this.count <= 0 || error) && (this.onQueueEmpty(error, output), error && (output.controller.abort(), this.onQueueEmpty = void 0));
}
}, Counter = class {
_files = 0;
_directories = 0;
set files(num) {
this._files = num;
}
get files() {
return this._files;
}
set directories(num) {
this._directories = num;
}
get directories() {
return this._directories;
}
/**
* @deprecated use `directories` instead
*/
/* c8 ignore next 3 */
get dirs() {
return this._directories;
}
}, Aborter = class {
aborted = !1;
abort() {
this.aborted = !0;
}
}, Walker = class {
root;
isSynchronous;
state;
joinPath;
pushDirectory;
pushFile;
getArray;
groupFiles;
resolveSymlink;
walkDirectory;
callbackInvoker;
constructor(root, options, callback$1) {
this.isSynchronous = !callback$1, this.callbackInvoker = build$1(options, this.isSynchronous), this.root = normalizePath(root, options), this.state = {
root: isRootDirectory(this.root) ? this.root : this.root.slice(0, -1),
paths: [""].slice(0, 0),
groups: [],
counts: new Counter(),
options,
queue: new Queue((error, state) => this.callbackInvoker(state, error, callback$1)),
symlinks: /* @__PURE__ */ new Map(),
visited: [""].slice(0, 0),
controller: new Aborter(),
fs: options.fs || fs
}, this.joinPath = build$7(this.root, options), this.pushDirectory = build$6(this.root, options), this.pushFile = build$5(options), this.getArray = build$4(options), this.groupFiles = build$3(options), this.resolveSymlink = build$2(options, this.isSynchronous), this.walkDirectory = build(this.isSynchronous);
}
start() {
return this.pushDirectory(this.root, this.state.paths, this.state.options.filters), this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk), this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
}
walk = (entries, directoryPath, depth) => {
let { paths, options: { filters, resolveSymlinks: resolveSymlinks$1, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator }, controller } = this.state;
if (controller.aborted || signal && signal.aborted || maxFiles && paths.length > maxFiles) return;
let files = this.getArray(this.state.paths);
for (let i = 0; i < entries.length; ++i) {
let entry = entries[i];
if (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks$1 && !excludeSymlinks) {
let filename = this.joinPath(entry.name, directoryPath);
this.pushFile(filename, files, this.state.counts, filters);
} else if (entry.isDirectory()) {
let path$1 = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
if (exclude && exclude(entry.name, path$1)) continue;
this.pushDirectory(path$1, paths, filters), this.walkDirectory(this.state, path$1, path$1, depth - 1, this.walk);
} else if (this.resolveSymlink && entry.isSymbolicLink()) {
let path$1 = joinPathWithBasePath(entry.name, directoryPath);
this.resolveSymlink(path$1, this.state, (stat, resolvedPath) => {
if (stat.isDirectory()) {
if (resolvedPath = normalizePath(resolvedPath, this.state.options), exclude && exclude(entry.name, useRealPaths ? resolvedPath : path$1 + pathSeparator)) return;
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path$1 + pathSeparator, depth - 1, this.walk);
} else {
resolvedPath = useRealPaths ? resolvedPath : path$1;
let filename = (0, path.basename)(resolvedPath), directoryPath$1 = normalizePath((0, path.dirname)(resolvedPath), this.state.options);
resolvedPath = this.joinPath(filename, directoryPath$1), this.pushFile(resolvedPath, files, this.state.counts, filters);
}
});
}
}
this.groupFiles(this.state.groups, directoryPath, files);
};
};
function promise(root, options) {
return new Promise((resolve$1, reject) => {
callback(root, options, (err, output) => {
if (err) return reject(err);
resolve$1(output);
});
});
}
function callback(root, options, callback$1) {
new Walker(root, options, callback$1).start();
}
function sync(root, options) {
return new Walker(root, options).start();
}
var APIBuilder = class {
constructor(root, options) {
this.root = root, this.options = options;
}
withPromise() {
return promise(this.root, this.options);
}
withCallback(cb) {
callback(this.root, this.options, cb);
}
sync() {
return sync(this.root, this.options);
}
}, pm = null;
try {
__require.resolve("picomatch"), pm = require_picomatch2();
} catch {
}
var Builder = class {
globCache = {};
options = {
maxDepth: 1 / 0,
suppressErrors: !0,
pathSeparator: path.sep,
filters: []
};
globFunction;
constructor(options) {
this.options = {
...this.options,
...options
}, this.globFunction = this.options.globFunction;
}
group() {
return this.options.group = !0, this;
}
withPathSeparator(separator) {
return this.options.pathSeparator = separator, this;
}
withBasePath() {
return this.options.includeBasePath = !0, this;
}
withRelativePaths() {
return this.options.relativePaths = !0, this;
}
withDirs() {
return this.options.includeDirs = !0, this;
}
withMaxDepth(depth) {
return this.options.maxDepth = depth, this;
}
withMaxFiles(limit) {
return this.options.maxFiles = limit, this;
}
withFullPaths() {
return this.options.resolvePaths = !0, this.options.includeBasePath = !0, this;
}
withErrors() {
return this.options.suppressErrors = !1, this;
}
withSymlinks({ resolvePaths = !0 } = {}) {
return this.options.resolveSymlinks = !0, this.options.useRealPaths = resolvePaths, this.withFullPaths();
}
withAbortSignal(signal) {
return this.options.signal = signal, this;
}
normalize() {
return this.options.normalizePath = !0, this;
}
filter(predicate) {
return this.options.filters.push(predicate), this;
}
onlyDirs() {
return this.options.excludeFiles = !0, this.options.includeDirs = !0, this;
}
exclude(predicate) {
return this.options.exclude = predicate, this;
}
onlyCounts() {
return this.options.onlyCounts = !0, this;
}
crawl(root) {
return new APIBuilder(root || ".", this.options);
}
withGlobFunction(fn) {
return this.globFunction = fn, this;
}
/**
* @deprecated Pass options using the constructor instead:
* ```ts
* new fdir(options).crawl("/path/to/root");
* ```
* This method will be removed in v7.0
*/
/* c8 ignore next 4 */
crawlWithOptions(root, options) {
return this.options = {
...this.options,
...options
}, new APIBuilder(root || ".", this.options);
}
glob(...patterns) {
return this.globFunction ? this.globWithOptions(patterns) : this.globWithOptions(patterns, { dot: !0 });
}
globWithOptions(patterns, ...options) {
let globFn = this.globFunction || pm;
if (!globFn) throw new Error("Please specify a glob function to use glob matching.");
var isMatch = this.globCache[patterns.join("\0")];
return isMatch || (isMatch = globFn(patterns, ...options), this.globCache[patterns.join("\0")] = isMatch), this.options.filters.push((path$1) => isMatch(path$1)), this;
}
};
exports.fdir = Builder;
}
});
// ../../node_modules/.pnpm/tinyglobby@0.2.16/node_modules/tinyglobby/dist/index.cjs
var require_dist2 = __commonJS({
"../../node_modules/.pnpm/tinyglobby@0.2.16/node_modules/tinyglobby/dist/index.cjs"(exports) {
init_cjs_shims();
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __copyProps = (to, from, except, desc) => {
if (from && typeof from == "object" || typeof from == "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++)
key = keys[i], !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
get: ((k) => from[k]).bind(null, key),
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
return to;
}, __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
value: mod,
enumerable: !0
}) : target, mod)), fs = __require("fs"), path = __require("path"), url = __require("url"), fdir = require_dist(), picomatch = require_picomatch2();
picomatch = __toESM(picomatch);
var isReadonlyArray = Array.isArray, BACKSLASHES = /\\/g, isWin = process.platform === "win32", ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
function getPartialMatcher(patterns, options = {}) {
let patternsCount = patterns.length, patternsParts = Array(patternsCount), matchers = Array(patternsCount), i, j;
for (i = 0; i < patternsCount; i++) {
let parts = splitPattern(patterns[i]);
patternsParts[i] = parts;
let partsCount = parts.length, partMatchers = Array(partsCount);
for (j = 0; j < partsCount; j++) partMatchers[j] = (0, picomatch.default)(parts[j], options);
matchers[i] = partMatchers;
}
return (input) => {
let inputParts = input.split("/");
if (inputParts[0] === ".." && ONLY_PARENT_DIRECTORIES.test(input)) return !0;
for (i = 0; i < patternsCount; i++) {
let patternParts = patternsParts[i], matcher = matchers[i], inputPatternCount = inputParts.length, minParts = Math.min(inputPatternCount, patternParts.length);
for (j = 0; j < minParts; ) {
let part = patternParts[j];
if (part.includes("/")) return !0;
if (!matcher[j](inputParts[j])) break;
if (!options.noglobstar && part === "**") return !0;
j++;
}
if (j === inputPatternCount) return !0;
}
return !1;
};
}
var WIN32_ROOT_DIR = /^[A-Z]:\/$/i, isRoot = isWin ? (p) => WIN32_ROOT_DIR.test(p) : (p) => p === "/";
function buildFormat(cwd, root, absolute) {
if (cwd === root || root.startsWith(`${cwd}/`)) {
if (absolute) {
let start = cwd.length + +!isRoot(cwd);
return (p, isDir) => p.slice(start, isDir ? -1 : void 0) || ".";
}
let prefix = root.slice(cwd.length + 1);
return prefix ? (p, isDir) => {
if (p === ".") return prefix;
let result = `${prefix}/${p}`;
return isDir ? result.slice(0, -1) : result;
} : (p, isDir) => isDir && p !== "." ? p.slice(0, -1) : p;
}
return absolute ? (p) => path.posix.relative(cwd, p) || "." : (p) => path.posix.relative(cwd, `${root}/${p}`) || ".";
}
function buildRelative(cwd, root) {
if (root.startsWith(`${cwd}/`)) {
let prefix = root.slice(cwd.length + 1);
return (p) => `${prefix}/${p}`;
}
return (p) => {
let result = path.posix.relative(cwd, `${root}/${p}`);
return p[p.length - 1] === "/" && result !== "" ? `${result}/` : result || ".";
};
}
var splitPatternOptions = { parts: !0 };
function splitPattern(path$1) {
var _result$parts;
let result = picomatch.default.scan(path$1, splitPatternOptions);
return !((_result$parts = result.parts) === null || _result$parts === void 0) && _result$parts.length ? result.parts : [path$1];
}
var ESCAPED_WIN32_BACKSLASHES = /\\(?![()[\]{}!+@])/g;
function convertPosixPathToPattern(path$2) {
return escapePosixPath(path$2);
}
function convertWin32PathToPattern(path$3) {
return escapeWin32Path(path$3).replace(ESCAPED_WIN32_BACKSLASHES, "/");
}
var convertPathToPattern = isWin ? convertWin32PathToPattern : convertPosixPathToPattern, POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g, WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g, escapePosixPath = (path$4) => path$4.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&"), escapeWin32Path = (path$5) => path$5.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&"), escapePath = isWin ? escapeWin32Path : escapePosixPath;
function isDynamicPattern(pattern, options) {
if (options?.caseSensitiveMatch === !1) return !0;
let scan = picomatch.default.scan(pattern);
return scan.isGlob || scan.negated;
}
function log(...tasks) {
console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString("es")}]`, ...tasks);
}
function ensureStringArray(value) {
return typeof value == "string" ? [value] : value ?? [];
}
var PARENT_DIRECTORY = /^(\/?\.\.)+/, ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g;
function normalizePattern(pattern, opts, props, isIgnore) {
var _PARENT_DIRECTORY$exe;
let cwd = opts.cwd, result = pattern;
pattern[pattern.length - 1] === "/" && (result = pattern.slice(0, -1)), result[result.length - 1] !== "*" && opts.expandDirectories && (result += "/**");
let escapedCwd = escapePath(cwd);
result = (0, path.isAbsolute)(result.replace(ESCAPING_BACKSLASHES, "")) ? path.posix.relative(escapedCwd, result) : path.posix.normalize(result);
let parentDir = (_PARENT_DIRECTORY$exe = PARENT_DIRECTORY.exec(result)) === null || _PARENT_DIRECTORY$exe === void 0 ? void 0 : _PARENT_DIRECTORY$exe[0], parts = splitPattern(result);
if (parentDir) {
let n = (parentDir.length + 1) / 3, i = 0, cwdParts = escapedCwd.split("/");
for (; i < n && parts[i + n] === cwdParts[cwdParts.length + i - n]; )
result = result.slice(0, (n - i - 1) * 3) + result.slice((n - i) * 3 + parts[i + n].length + 1) || ".", i++;
let potentialRoot = path.posix.join(cwd, parentDir.slice(i * 3));
potentialRoot[0] !== "." && props.root.length > potentialRoot.length && (props.root = potentialRoot, props.depthOffset = -n + i);
}
if (!isIgnore && props.depthOffset >= 0) {
var _props$commonPath;
(_props$commonPath = props.commonPath) !== null && _props$commonPath !== void 0 || (props.commonPath = parts);
let newCommonPath = [], length = Math.min(props.commonPath.length, parts.length);
for (let i = 0; i < length; i++) {
let part = parts[i];
if (part === "**" && !parts[i + 1]) {
newCommonPath.pop();
break;
}
if (i === parts.length - 1 || part !== props.commonPath[i] || isDynamicPattern(part)) break;
newCommonPath.push(part);
}
props.depthOffset = newCommonPath.length, props.commonPath = newCommonPath, props.root = newCommonPath.length > 0 ? path.posix.join(cwd, ...newCommonPath) : cwd;
}
return result;
}
function processPatterns(options, patterns, props) {
let matchPatterns = [], ignorePatterns = [];
for (let pattern of options.ignore)
pattern && (pattern[0] !== "!" || pattern[1] === "(") && ignorePatterns.push(normalizePattern(pattern, options, props, !0));
for (let pattern of patterns)
pattern && (pattern[0] !== "!" || pattern[1] === "(" ? matchPatterns.push(normalizePattern(pattern, options, props, !1)) : (pattern[1] !== "!" || pattern[2] === "(") && ignorePatterns.push(normalizePattern(pattern.slice(1), options, props, !0)));
return {
match: matchPatterns,
ignore: ignorePatterns
};
}
function buildCrawler(options, patterns) {
let cwd = options.cwd, props = {
root: cwd,
depthOffset: 0
}, processed = processPatterns(options, patterns, props);
options.debug && log("internal processing patterns:", processed);
let { absolute, caseSensitiveMatch, debug, dot, followSymbolicLinks, onlyDirectories } = options, root = props.root.replace(BACKSLASHES, ""), matchOptions = {
dot,
nobrace: options.braceExpansion === !1,
nocase: !caseSensitiveMatch,
noextglob: options.extglob === !1,
noglobstar: options.globstar === !1,
posix: !0
}, matcher = (0, picomatch.default)(processed.match, matchOptions), ignore = (0, picomatch.default)(processed.ignore, matchOptions), partialMatcher = getPartialMatcher(processed.match, matchOptions), format = buildFormat(cwd, root, absolute), excludeFormatter = absolute ? format : buildFormat(cwd, root, !0), excludePredicate = (_, p) => {
let relativePath = excludeFormatter(p, !0);
return relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
}, maxDepth;
options.deep !== void 0 && (maxDepth = Math.round(options.deep - props.depthOffset));
let crawler = new fdir.fdir({
filters: [debug ? (p, isDirectory) => {
let path2 = format(p, isDirectory), matches = matcher(path2) && !ignore(path2);
return matches && log(`matched ${path2}`), matches;
} : (p, isDirectory) => {
let path2 = format(p, isDirectory);
return matcher(path2) && !ignore(path2);
}],
exclude: debug ? (_, p) => {
let skipped = excludePredicate(_, p);
return log(`${skipped ? "skipped" : "crawling"} ${p}`), skipped;
} : excludePredicate,
fs: options.fs,
pathSeparator: "/",
relativePaths: !absolute,
resolvePaths: absolute,
includeBasePath: absolute,
resolveSymlinks: followSymbolicLinks,
excludeSymlinks: !followSymbolicLinks,
excludeFiles: onlyDirectories,
includeDirs: onlyDirectories || !options.onlyFiles,
maxDepth,
signal: options.signal
}).crawl(root);
return options.debug && log("internal properties:", {
...props,
root
}), [crawler, cwd !== root && !absolute && buildRelative(cwd, root)];
}
function formatPaths(paths, mapper) {
if (mapper) for (let i = paths.length - 1; i >= 0; i--) paths[i] = mapper(paths[i]);
return paths;
}
var defaultOptions = {
caseSensitiveMatch: !0,
cwd: process.cwd(),
debug: !!process.env.TINYGLOBBY_DEBUG,
expandDirectories: !0,
followSymbolicLinks: !0,
onlyFiles: !0
};
function getOptions(options) {
let opts = {
...defaultOptions,
...options
};
return opts.cwd = (opts.cwd instanceof URL ? (0, url.fileURLToPath)(opts.cwd) : (0, path.resolve)(opts.cwd)).replace(BACKSLASHES, "/"), opts.ignore = ensureStringArray(opts.ignore), opts.fs && (opts.fs = {
readdir: opts.fs.readdir || fs.readdir,
readdirSync: opts.fs.readdirSync || fs.readdirSync,
realpath: opts.fs.realpath || fs.realpath,
realpathSync: opts.fs.realpathSync || fs.realpathSync,
stat: opts.fs.stat || fs.stat,
statSync: opts.fs.statSync || fs.statSync
}), opts.debug && log("globbing with options:", opts), opts;
}
function getCrawler(globInput, inputOptions = {}) {
var _ref;
if (globInput && inputOptions?.patterns) throw new Error("Cannot pass patterns as both an argument and an option");
let isModern = isReadonlyArray(globInput) || typeof globInput == "string", patterns = ensureStringArray((_ref = isModern ? globInput : globInput.patterns) !== null && _ref !== void 0 ? _ref : "**/*"), options = getOptions(isModern ? inputOptions : globInput);
return patterns.length > 0 ? buildCrawler(options, patterns) : [];
}
async function glob(globInput, options) {
let [crawler, relative] = getCrawler(globInput, options);
return crawler ? formatPaths(await crawler.withPromise(), relative) : [];
}
function globSync(globInput, options) {
let [crawler, relative] = getCrawler(globInput, options);
return crawler ? formatPaths(crawler.sync(), relative) : [];
}
exports.convertPathToPattern = convertPathToPattern;
exports.escapePath = escapePath;
exports.glob = glob;
exports.globSync = globSync;
exports.isDynamicPattern = isDynamicPattern;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/flags.js
var require_flags = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/flags.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.help = exports.version = exports.string = exports.url = exports.file = exports.directory = exports.integer = void 0;
exports.custom = custom;
exports.boolean = boolean;
exports.option = option;
var node_url_1 = __require("node:url"), errors_1 = require_errors(), help_1 = require_help(), fs_1 = require_fs();
function custom(defaults) {
return (options = {}) => ({
parse: async (input, _ctx, _opts) => input,
...defaults,
...options,
input: [],
multiple: !!(options.multiple === void 0 ? defaults?.multiple ?? !1 : options.multiple),
type: "option"
});
}
function boolean(options = {}) {
return {
parse: async (b, _) => b,
...options,
allowNo: !!options.allowNo,
type: "boolean"
};
}
exports.integer = custom({
async parse(input, _, opts) {
if (!/^-?\d+$/.test(input))
throw new errors_1.CLIError(`Expected an integer but received: ${input}`);
let num = Number.parseInt(input, 10);
if (opts.min !== void 0 && num < opts.min)
throw new errors_1.CLIError(`Expected an integer greater than or equal to ${opts.min} but received: ${input}`);
if (opts.max !== void 0 && num > opts.max)
throw new errors_1.CLIError(`Expected an integer less than or equal to ${opts.max} but received: ${input}`);
return num;
}
});
exports.directory = custom({
async parse(input, _, opts) {
return opts.exists ? (0, fs_1.dirExists)(input) : input;
}
});
exports.file = custom({
async parse(input, _, opts) {
return opts.exists ? (0, fs_1.fileExists)(input) : input;
}
});
exports.url = custom({
async parse(input) {
try {
return new node_url_1.URL(input);
} catch {
throw new errors_1.CLIError(`Expected a valid url but received: ${input}`);
}
}
});
exports.string = custom();
var version = (opts = {}) => boolean({
description: "Show CLI version.",
...opts,
async parse(_, ctx) {
ctx.log(ctx.config.userAgent), ctx.exit(0);
}
});
exports.version = version;
var help = (opts = {}) => boolean({
description: "Show CLI help.",
...opts,
async parse(_, cmd) {
let Help = await (0, help_1.loadHelpClass)(cmd.config);
await new Help(cmd.config, cmd.config.pjson.oclif.helpOptions ?? cmd.config.pjson.helpOptions).showHelp(cmd.id ? [cmd.id, ...cmd.argv] : cmd.argv), cmd.exit(0);
}
});
exports.help = help;
function option(defaults) {
return (options = {}) => ({
parse: async (input, _ctx, _opts) => input,
...defaults,
...options,
input: [],
multiple: !!(options.multiple === void 0 ? defaults.multiple : options.multiple),
type: "option"
});
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/aggregate-flags.js
var require_aggregate_flags = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/aggregate-flags.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.aggregateFlags = aggregateFlags;
var flags_1 = require_flags(), json = (0, flags_1.boolean)({
description: "Format output as json.",
helpGroup: "GLOBAL"
});
function aggregateFlags(flags, baseFlags, enableJsonFlag) {
let combinedFlags = { ...baseFlags, ...flags };
return enableJsonFlag ? { json, ...combinedFlags } : combinedFlags;
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/cache-command.js
var require_cache_command = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/cache-command.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.cacheCommand = cacheCommand;
var aggregate_flags_1 = require_aggregate_flags(), cache_default_value_1 = require_cache_default_value(), ensure_arg_object_1 = require_ensure_arg_object(), util_1 = require_util();
function mergePrototype(result, cmd) {
let proto = Object.getPrototypeOf(cmd), filteredProto = (0, util_1.pickBy)(proto, (v) => v !== void 0);
return Object.keys(proto).length > 0 ? mergePrototype({ ...filteredProto, ...result }, proto) : result;
}
async function cacheFlags(cmdFlags, respectNoCacheDefault) {
let promises = Object.entries(cmdFlags).map(async ([name, flag]) => [
name,
{
aliases: flag.aliases,
char: flag.char,
charAliases: flag.charAliases,
combinable: flag.combinable,
dependsOn: flag.dependsOn,
deprecateAliases: flag.deprecateAliases,
deprecated: flag.deprecated,
description: flag.description,
env: flag.env,
exclusive: flag.exclusive,
helpGroup: flag.helpGroup,
helpLabel: flag.helpLabel,
hidden: flag.hidden,
name,
noCacheDefault: flag.noCacheDefault,
relationships: flag.relationships,
required: flag.required,
summary: flag.summary,
...flag.type === "boolean" ? {
allowNo: flag.allowNo,
type: flag.type
} : {
default: await (0, cache_default_value_1.cacheDefaultValue)(flag, respectNoCacheDefault),
delimiter: flag.delimiter,
hasDynamicHelp: typeof flag.defaultHelp == "function",
helpValue: flag.helpValue,
multiple: flag.multiple,
options: flag.options,
type: flag.type
}
}
]);
return Object.fromEntries(await Promise.all(promises));
}
async function cacheArgs(cmdArgs, respectNoCacheDefault) {
let promises = Object.entries(cmdArgs).map(async ([name, arg]) => [
name,
{
default: await (0, cache_default_value_1.cacheDefaultValue)(arg, respectNoCacheDefault),
description: arg.description,
hidden: arg.hidden,
name,
noCacheDefault: arg.noCacheDefault,
options: arg.options,
required: arg.required
}
]);
return Object.fromEntries(await Promise.all(promises));
}
async function cacheCommand(uncachedCmd, plugin, respectNoCacheDefault = !1) {
let cmd = mergePrototype(uncachedCmd, uncachedCmd), uncachedFlags = cmd.flags ?? cmd._flags, uncachedBaseFlags = cmd.baseFlags ?? cmd._baseFlags, [flags, args] = await Promise.all([
cacheFlags((0, aggregate_flags_1.aggregateFlags)(uncachedFlags, uncachedBaseFlags, cmd.enableJsonFlag), respectNoCacheDefault),
cacheArgs((0, ensure_arg_object_1.ensureArgObject)(cmd.args), respectNoCacheDefault)
]), stdProperties = {
// Replace all spaces in aliases with colons to standardize them.
aliases: (cmd.aliases ?? []).map((a) => a.replaceAll(" ", ":")),
args,
deprecateAliases: cmd.deprecateAliases,
deprecationOptions: cmd.deprecationOptions,
description: cmd.description,
// Support both `examples` and `example` for backwards compatibility.
examples: cmd.examples ?? cmd.example,
flags,
hasDynamicHelp: Object.values(flags).some((f) => f.hasDynamicHelp),
hidden: cmd.hidden,
hiddenAliases: cmd.hiddenAliases ?? [],
id: cmd.id,
pluginAlias: plugin && plugin.alias,
pluginName: plugin && plugin.name,
pluginType: plugin && plugin.type,
state: cmd.state,
strict: cmd.strict,
summary: cmd.summary,
usage: cmd.usage
}, ignoreCommandProperties = [
"plugin",
"_flags",
"_enableJsonFlag",
"_globalFlags",
"_baseFlags",
"baseFlags",
"_--",
"_base"
], stdKeysAndIgnored = /* @__PURE__ */ new Set([...ignoreCommandProperties, ...Object.keys(stdProperties)]), keysToAdd = Object.keys(cmd).filter((property) => !stdKeysAndIgnored.has(property)), additionalProperties = Object.fromEntries(keysToAdd.map((key) => [key, cmd[key]]));
return { ...stdProperties, ...additionalProperties };
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/find-root.js
var require_find_root = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/find-root.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.debug = debug;
exports.findRoot = findRoot;
var node_path_1 = __require("node:path"), logger_1 = require_logger(), fs_1 = require_fs();
function debug(...scope) {
return (formatter, ...args) => (0, logger_1.getLogger)(["find-root", ...scope].join(":")).debug(formatter, ...args);
}
function* up(from) {
for (; (0, node_path_1.dirname)(from) !== from; )
yield from, from = (0, node_path_1.dirname)(from);
yield from;
}
async function findPluginRoot(root, name) {
if (debug(name ?? "root-plugin")(`Finding root starting at ${root}`), name) {
for (let next of up(root))
if (next.endsWith((0, node_path_1.basename)(name)))
return debug(name)("Found root based on plugin name!"), next;
}
for (let next of up(root))
if (!((0, node_path_1.basename)((0, node_path_1.dirname)(next)) === "bin" && ["dev", "dev.cmd", "dev.js", "run", "run.cmd", "run.js"].includes((0, node_path_1.basename)(next))))
try {
let cur = (0, node_path_1.join)(next, "package.json");
if (debug(name ?? "root-plugin")(`Checking ${cur}`), await (0, fs_1.safeReadJson)(cur))
return debug(name ?? "root-plugin")("Found root by traversing up from starting point!"), (0, node_path_1.dirname)(cur);
} catch {
}
}
async function findRootLegacy(name, root) {
debug(name ?? "root-plugin")("Finding root using legacy method");
for (let next of up(root)) {
let cur;
if (name) {
if (cur = (0, node_path_1.join)(next, "node_modules", name, "package.json"), await (0, fs_1.safeReadJson)(cur))
return (0, node_path_1.dirname)(cur);
if ((await (0, fs_1.safeReadJson)((0, node_path_1.join)(next, "package.json")))?.name === name)
return next;
} else if (cur = (0, node_path_1.join)(next, "package.json"), await (0, fs_1.safeReadJson)(cur))
return (0, node_path_1.dirname)(cur);
}
}
var pnp;
function maybeRequirePnpApi(root) {
if (pnp)
return pnp;
try {
return pnp = __require(__require.resolve("pnpapi", { paths: [root] })), pnp;
} catch {
}
}
var getKey = (locator) => JSON.stringify(locator), isPeerDependency = (pkg, parentPkg, name) => getKey(pkg?.packageDependencies.get(name)) === getKey(parentPkg?.packageDependencies.get(name));
function findPnpRoot(name, root) {
if (maybeRequirePnpApi(root), !pnp)
return;
debug(name)("Finding root for using pnp method");
let seen = /* @__PURE__ */ new Set(), traverseDependencyTree = (locator, parentPkg) => {
let key = getKey(locator);
if (seen.has(key))
return;
let pkg = pnp.getPackageInformation(locator);
if (locator.name === name)
return pkg.packageLocation;
seen.add(key);
for (let [name2, referencish] of pkg.packageDependencies) {
if (referencish === null || parentPkg !== null && isPeerDependency(pkg, parentPkg, name2))
continue;
let childLocator = pnp.getLocator(name2, referencish), foundSomething = traverseDependencyTree(childLocator, pkg);
if (foundSomething)
return foundSomething;
}
seen.delete(key);
};
for (let locator of pnp.getDependencyTreeRoots()) {
let foundSomething = traverseDependencyTree(locator);
if (foundSomething)
return foundSomething;
}
}
async function findRoot(name, root) {
if (name) {
debug(name)(`Finding root using ${root}`);
let pkgPath;
try {
pkgPath = __require.resolve(name, { paths: [root] }), debug(name)("Found starting point with require.resolve");
} catch {
debug(name)("require.resolve could not find plugin starting point");
}
if (pkgPath) {
let found3 = await findPluginRoot((0, node_path_1.dirname)(pkgPath), name);
if (found3)
return debug(name)(`Found root at ${found3}`), found3;
}
let found2 = process.versions.pnp ? findPnpRoot(name, root) : await findRootLegacy(name, root);
return debug(name)(found2 ? `Found root at ${found2}` : "No root found!"), found2;
}
debug("root-plugin")(`Finding root plugin using ${root}`);
let found = await findPluginRoot(root);
return debug("root-plugin")(found ? `Found root at ${found}` : "No root found!"), found;
}
}
});
// ../../node_modules/.pnpm/lilconfig@3.1.3/node_modules/lilconfig/src/index.js
var require_src2 = __commonJS({
"../../node_modules/.pnpm/lilconfig@3.1.3/node_modules/lilconfig/src/index.js"(exports, module) {
init_cjs_shims();
var path = __require("path"), fs = __require("fs"), os = __require("os"), url = __require("url"), fsReadFileAsync = fs.promises.readFile;
function getDefaultSearchPlaces(name, sync) {
return [
"package.json",
`.${name}rc.json`,
`.${name}rc.js`,
`.${name}rc.cjs`,
...sync ? [] : [`.${name}rc.mjs`],
`.config/${name}rc`,
`.config/${name}rc.json`,
`.config/${name}rc.js`,
`.config/${name}rc.cjs`,
...sync ? [] : [`.config/${name}rc.mjs`],
`${name}.config.js`,
`${name}.config.cjs`,
...sync ? [] : [`${name}.config.mjs`]
];
}
function parentDir(p) {
return path.dirname(p) || path.sep;
}
var jsonLoader = (_, content) => JSON.parse(content), requireFunc = typeof __webpack_require__ == "function" ? __non_webpack_require__ : __require, defaultLoadersSync = Object.freeze({
".js": requireFunc,
".json": requireFunc,
".cjs": requireFunc,
noExt: jsonLoader
});
module.exports.defaultLoadersSync = defaultLoadersSync;
var dynamicImport = async (id) => {
try {
return (await import(url.pathToFileURL(id).href)).default;
} catch (e) {
try {
return requireFunc(id);
} catch (requireE) {
throw requireE.code === "ERR_REQUIRE_ESM" || requireE instanceof SyntaxError && requireE.toString().includes("Cannot use import statement outside a module") ? e : requireE;
}
}
}, defaultLoaders = Object.freeze({
".js": dynamicImport,
".mjs": dynamicImport,
".cjs": dynamicImport,
".json": jsonLoader,
noExt: jsonLoader
});
module.exports.defaultLoaders = defaultLoaders;
function getOptions(name, options, sync) {
let conf = {
stopDir: os.homedir(),
searchPlaces: getDefaultSearchPlaces(name, sync),
ignoreEmptySearchPlaces: !0,
cache: !0,
transform: (x) => x,
packageProp: [name],
...options,
loaders: {
...sync ? defaultLoadersSync : defaultLoaders,
...options.loaders
}
};
return conf.searchPlaces.forEach((place) => {
let key = path.extname(place) || "noExt", loader = conf.loaders[key];
if (!loader)
throw new Error(`Missing loader for extension "${place}"`);
if (typeof loader != "function")
throw new Error(
`Loader for extension "${place}" is not a function: Received ${typeof loader}.`
);
}), conf;
}
function getPackageProp(props, obj) {
return typeof props == "string" && props in obj ? obj[props] : (Array.isArray(props) ? props : props.split(".")).reduce(
(acc, prop) => acc === void 0 ? acc : acc[prop],
obj
) || null;
}
function validateFilePath(filepath) {
if (!filepath) throw new Error("load must pass a non-empty string");
}
function validateLoader(loader, ext) {
if (!loader) throw new Error(`No loader specified for extension "${ext}"`);
if (typeof loader != "function") throw new Error("loader is not a function");
}
var makeEmplace = (enableCache) => (c, filepath, res) => (enableCache && c.set(filepath, res), res);
module.exports.lilconfig = function(name, options) {
let {
ignoreEmptySearchPlaces,
loaders,
packageProp,
searchPlaces,
stopDir,
transform,
cache
} = getOptions(name, options ?? {}, !1), searchCache = /* @__PURE__ */ new Map(), loadCache = /* @__PURE__ */ new Map(), emplace = makeEmplace(cache);
return {
async search(searchFrom = process.cwd()) {
let result = {
config: null,
filepath: ""
}, visited = /* @__PURE__ */ new Set(), dir = searchFrom;
dirLoop: for (; ; ) {
if (cache) {
let r = searchCache.get(dir);
if (r !== void 0) {
for (let p of visited) searchCache.set(p, r);
return r;
}
visited.add(dir);
}
for (let searchPlace of searchPlaces) {
let filepath = path.join(dir, searchPlace);
try {
await fs.promises.access(filepath);
} catch {
continue;
}
let content = String(await fsReadFileAsync(filepath)), loaderKey = path.extname(searchPlace) || "noExt", loader = loaders[loaderKey];
if (searchPlace === "package.json") {
let pkg = await loader(filepath, content), maybeConfig = getPackageProp(packageProp, pkg);
if (maybeConfig != null) {
result.config = maybeConfig, result.filepath = filepath;
break dirLoop;
}
continue;
}
let isEmpty = content.trim() === "";
if (!(isEmpty && ignoreEmptySearchPlaces)) {
isEmpty ? (result.isEmpty = !0, result.config = void 0) : (validateLoader(loader, loaderKey), result.config = await loader(filepath, content)), result.filepath = filepath;
break dirLoop;
}
}
if (dir === stopDir || dir === parentDir(dir)) break dirLoop;
dir = parentDir(dir);
}
let transformed = (
// not found
result.filepath === "" && result.config === null ? transform(null) : transform(result)
);
if (cache)
for (let p of visited) searchCache.set(p, transformed);
return transformed;
},
async load(filepath) {
validateFilePath(filepath);
let absPath = path.resolve(process.cwd(), filepath);
if (cache && loadCache.has(absPath))
return loadCache.get(absPath);
let { base, ext } = path.parse(absPath), loaderKey = ext || "noExt", loader = loaders[loaderKey];
validateLoader(loader, loaderKey);
let content = String(await fsReadFileAsync(absPath));
if (base === "package.json") {
let pkg = await loader(absPath, content);
return emplace(
loadCache,
absPath,
transform({
config: getPackageProp(packageProp, pkg),
filepath: absPath
})
);
}
let result = {
config: null,
filepath: absPath
}, isEmpty = content.trim() === "";
return isEmpty && ignoreEmptySearchPlaces ? emplace(
loadCache,
absPath,
transform({
config: void 0,
filepath: absPath,
isEmpty: !0
})
) : (result.config = isEmpty ? void 0 : await loader(absPath, content), emplace(
loadCache,
absPath,
transform(isEmpty ? { ...result, isEmpty, config: void 0 } : result)
));
},
clearLoadCache() {
cache && loadCache.clear();
},
clearSearchCache() {
cache && searchCache.clear();
},
clearCaches() {
cache && (loadCache.clear(), searchCache.clear());
}
};
};
module.exports.lilconfigSync = function(name, options) {
let {
ignoreEmptySearchPlaces,
loaders,
packageProp,
searchPlaces,
stopDir,
transform,
cache
} = getOptions(name, options ?? {}, !0), searchCache = /* @__PURE__ */ new Map(), loadCache = /* @__PURE__ */ new Map(), emplace = makeEmplace(cache);
return {
search(searchFrom = process.cwd()) {
let result = {
config: null,
filepath: ""
}, visited = /* @__PURE__ */ new Set(), dir = searchFrom;
dirLoop: for (; ; ) {
if (cache) {
let r = searchCache.get(dir);
if (r !== void 0) {
for (let p of visited) searchCache.set(p, r);
return r;
}
visited.add(dir);
}
for (let searchPlace of searchPlaces) {
let filepath = path.join(dir, searchPlace);
try {
fs.accessSync(filepath);
} catch {
continue;
}
let loaderKey = path.extname(searchPlace) || "noExt", loader = loaders[loaderKey], content = String(fs.readFileSync(filepath));
if (searchPlace === "package.json") {
let pkg = loader(filepath, content), maybeConfig = getPackageProp(packageProp, pkg);
if (maybeConfig != null) {
result.config = maybeConfig, result.filepath = filepath;
break dirLoop;
}
continue;
}
let isEmpty = content.trim() === "";
if (!(isEmpty && ignoreEmptySearchPlaces)) {
isEmpty ? (result.isEmpty = !0, result.config = void 0) : (validateLoader(loader, loaderKey), result.config = loader(filepath, content)), result.filepath = filepath;
break dirLoop;
}
}
if (dir === stopDir || dir === parentDir(dir)) break dirLoop;
dir = parentDir(dir);
}
let transformed = (
// not found
result.filepath === "" && result.config === null ? transform(null) : transform(result)
);
if (cache)
for (let p of visited) searchCache.set(p, transformed);
return transformed;
},
load(filepath) {
validateFilePath(filepath);
let absPath = path.resolve(process.cwd(), filepath);
if (cache && loadCache.has(absPath))
return loadCache.get(absPath);
let { base, ext } = path.parse(absPath), loaderKey = ext || "noExt", loader = loaders[loaderKey];
validateLoader(loader, loaderKey);
let content = String(fs.readFileSync(absPath));
if (base === "package.json") {
let pkg = loader(absPath, content);
return transform({
config: getPackageProp(packageProp, pkg),
filepath: absPath
});
}
let result = {
config: null,
filepath: absPath
}, isEmpty = content.trim() === "";
return isEmpty && ignoreEmptySearchPlaces ? emplace(
loadCache,
absPath,
transform({
filepath: absPath,
config: void 0,
isEmpty: !0
})
) : (result.config = isEmpty ? void 0 : loader(absPath, content), emplace(
loadCache,
absPath,
transform(isEmpty ? { ...result, isEmpty, config: void 0 } : result)
));
},
clearLoadCache() {
cache && loadCache.clear();
},
clearSearchCache() {
cache && searchCache.clear();
},
clearCaches() {
cache && (loadCache.clear(), searchCache.clear());
}
};
};
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/read-pjson.js
var require_read_pjson = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/util/read-pjson.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.readPjson = readPjson;
var lilconfig_1 = require_src2(), node_path_1 = __require("node:path"), logger_1 = require_logger(), fs_1 = require_fs(), debug = (0, logger_1.makeDebug)("read-pjson");
async function readPjson(path) {
let pjsonPath = (0, node_path_1.join)(path, "package.json");
if (process.env.OCLIF_DISABLE_RC)
return debug("OCLIF_DISABLE_RC is set, skipping rc search"), (0, fs_1.readJson)(pjsonPath);
let pjson = await (0, fs_1.readJson)(pjsonPath);
if (pjson.oclif)
return debug(`found oclif config in ${pjsonPath}`), pjson;
debug(`searching for oclif config in ${path}`);
let result = await (0, lilconfig_1.lilconfig)("oclif", {
/**
* Remove the following from the defaults:
* - package.json
* - any files under .config/
*/
searchPlaces: [
".oclifrc",
".oclifrc.json",
".oclifrc.js",
".oclifrc.mjs",
".oclifrc.cjs",
"oclif.config.js",
"oclif.config.mjs",
"oclif.config.cjs"
],
stopDir: path
}).search(path);
return result?.config ? (debug(`found oclif config for ${path}: %O`, result), {
...pjson,
oclif: result?.config ?? {}
}) : (debug(`no oclif config found in ${path}`), pjson);
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/config/plugin.js
var require_plugin = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/config/plugin.js"(exports) {
"use strict";
init_cjs_shims();
var __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.Plugin = void 0;
var node_path_1 = __require("node:path"), node_util_1 = __require("node:util"), tinyglobby_1 = require_dist2(), cache_1 = __importDefault(require_cache()), errors_1 = require_errors(), module_loader_1 = require_module_loader(), performance_1 = require_performance(), symbols_1 = require_symbols(), cache_command_1 = require_cache_command(), find_root_1 = require_find_root(), fs_1 = require_fs(), read_pjson_1 = require_read_pjson(), util_1 = require_util(), ts_path_1 = require_ts_path(), util_2 = require_util2(), _pjson = cache_1.default.getInstance().get("@oclif/core");
function topicsToArray(input, base) {
return input ? (base = base ? `${base}:` : "", Array.isArray(input) ? [...input, input.flatMap((t) => topicsToArray(t.subtopics, `${base}${t.name}`))] : Object.keys(input).flatMap((k) => (input[k].name = k, [{ ...input[k], name: `${base}${k}` }, ...topicsToArray(input[k].subtopics, `${base}${input[k].name}`)]))) : [];
}
var cachedCommandCanBeUsed = (manifest, id) => !!(manifest?.commands[id] && "isESM" in manifest.commands[id] && "relativePath" in manifest.commands[id]), searchForCommandClass = (cmd) => typeof cmd.run == "function" ? cmd : cmd.default && cmd.default.run ? cmd.default : Object.values(cmd).find((cmd2) => typeof cmd2.run == "function"), ensureCommandClass = (cmd) => {
if (cmd && typeof cmd.run == "function")
return cmd;
}, GLOB_PATTERNS = [
"**/*.+(js|cjs|mjs|ts|tsx|mts|cts)",
"!**/*.+(d.ts|test.ts|test.js|spec.ts|spec.js|d.mts|d.cts)?(x)"
];
function processCommandIds(files) {
return files.map((file) => {
let p = (0, node_path_1.parse)(file), topics = p.dir.split("/"), command = p.name !== "index" && p.name, id = [...topics, command].filter(Boolean).join(":");
return id === "" ? symbols_1.SINGLE_COMMAND_CLI_SYMBOL : id;
});
}
function determineCommandDiscoveryOptions(commandDiscovery) {
if (commandDiscovery) {
if (typeof commandDiscovery == "string")
return { globPatterns: GLOB_PATTERNS, strategy: "pattern", target: commandDiscovery };
if (!commandDiscovery.target)
throw new errors_1.CLIError("`oclif.commandDiscovery.target` is required.");
if (!commandDiscovery.strategy)
throw new errors_1.CLIError("`oclif.commandDiscovery.strategy` is required.");
return commandDiscovery.strategy === "explicit" && !commandDiscovery.identifier && (commandDiscovery.identifier = "default"), commandDiscovery;
}
}
function determineHookOptions(hook) {
return typeof hook == "string" ? { identifier: "default", target: hook } : hook.identifier ? hook : { ...hook, identifier: "default" };
}
var Plugin = class {
options;
_base = `${_pjson.name}@${_pjson.version}`;
_debug = (0, util_2.makeDebug)();
alias;
alreadyLoaded = !1;
children = [];
commandIDs = [];
// This will be initialized in the _manifest() method, which gets called in the load() method.
commands;
commandsDir;
hasManifest = !1;
hooks;
isRoot = !1;
manifest;
moduleType;
name;
parent;
pjson;
root;
tag;
type;
valid = !1;
version;
commandCache;
commandDiscoveryOpts;
flexibleTaxonomy;
constructor(options) {
this.options = options;
}
get topics() {
return topicsToArray(this.pjson.oclif.topics || {});
}
async findCommand(id, opts = {}) {
let marker = performance_1.Performance.mark(performance_1.OCLIF_MARKER_OWNER, `plugin.findCommand#${this.name}.${id}`, {
id,
plugin: this.name
}), cmd = await (async () => {
if (this.commandDiscoveryOpts?.strategy === "pattern") {
let commandsDir = await this.getCommandsDir();
if (!commandsDir)
return;
let module2, isESM, filePath;
try {
({ filePath, isESM, module: module2 } = cachedCommandCanBeUsed(this.manifest, id) ? await (0, module_loader_1.loadWithDataFromManifest)(this.manifest.commands[id], this.root) : await (0, module_loader_1.loadWithData)(this, (0, node_path_1.join)(commandsDir ?? this.pjson.oclif.commands, ...id.split(":")))), this._debug(isESM ? "(import)" : "(require)", filePath);
} catch (error) {
if (!opts.must && error.code === "MODULE_NOT_FOUND")
return;
throw error;
}
let cmd2 = searchForCommandClass(module2);
return cmd2 ? (cmd2.id = id, cmd2.plugin = this, cmd2.isESM = isESM, cmd2.relativePath = (0, node_path_1.relative)(this.root, filePath || "").split(node_path_1.sep), cmd2) : void 0;
}
if (this.commandDiscoveryOpts?.strategy === "single" || this.commandDiscoveryOpts?.strategy === "explicit") {
let commandCache = await this.loadCommandsFromTarget(), cmd2 = ensureCommandClass(commandCache?.[id]);
return cmd2 ? (cmd2.id = id, cmd2.plugin = this, cmd2) : void 0;
}
})();
return !cmd && opts.must && (0, errors_1.error)(`command ${id} not found`), marker?.stop(), cmd;
}
// eslint-disable-next-line complexity
async load() {
this.type = this.options.type ?? "core", this.tag = this.options.tag, this.isRoot = this.options.isRoot ?? !1, this.options.parent && (this.parent = this.options.parent);
let root = this.options.pjson && this.options.isRoot ? this.options.root : this.type === "link" && !this.parent ? this.options.root : await (0, find_root_1.findRoot)(this.options.name, this.options.root);
if (!root)
throw new errors_1.CLIError(`could not find package.json with ${(0, node_util_1.inspect)(this.options)}`);
if (this.root = root, this._debug(`loading ${this.type} plugin from ${root}`), this.pjson = this.options.pjson ?? await (0, read_pjson_1.readPjson)(root), this.flexibleTaxonomy = this.options?.flexibleTaxonomy || this.pjson.oclif?.flexibleTaxonomy || !1, this.moduleType = this.pjson.type === "module" ? "module" : "commonjs", this.name = this.pjson.name, this.alias = this.options.name ?? this.pjson.name, !this.name)
throw new errors_1.CLIError(`no name in package.json (${root})`);
this._debug = (0, util_2.makeDebug)(this.name), this.version = this.pjson.version, this.pjson.oclif ? this.valid = !0 : this.pjson.oclif = this.pjson["cli-engine"] || {}, this.hooks = Object.fromEntries(Object.entries(this.pjson.oclif.hooks ?? {}).map(([k, v]) => [
k,
(0, util_1.castArray)(v).map((v2) => determineHookOptions(v2))
])), this.commandDiscoveryOpts = determineCommandDiscoveryOptions(this.pjson.oclif?.commands), this._debug("command discovery options", this.commandDiscoveryOpts), this.manifest = await this._manifest(), this.commands = Object.entries(this.manifest.commands).map(([id, c]) => ({
...c,
load: async () => this.findCommand(id, { must: !0 }),
pluginAlias: this.alias,
pluginType: c.pluginType === "jit" ? "jit" : this.type
})).sort((a, b) => a.id.localeCompare(b.id));
}
async _manifest() {
let ignoreManifest = !!this.options.ignoreManifest, errorOnManifestCreate = !!this.options.errorOnManifestCreate, respectNoCacheDefault = !!this.options.respectNoCacheDefault, readManifest = async (dotfile = !1) => {
try {
let p = (0, node_path_1.join)(this.root, `${dotfile ? "." : ""}oclif.manifest.json`), manifest2 = await (0, fs_1.readJson)(p);
if (!process.env.OCLIF_NEXT_VERSION && manifest2.version.split("-")[0] !== this.version.split("-")[0])
process.emitWarning(`Mismatched version in ${this.name} plugin manifest. Expected: ${this.version} Received: ${manifest2.version}
This usually means you have an oclif.manifest.json file that should be deleted in development. This file should be automatically generated when publishing.`);
else
return this._debug("using manifest from", p), this.hasManifest = !0, manifest2;
} catch (error) {
if (error.code === "ENOENT") {
if (!dotfile)
return readManifest(!0);
} else
this.warn(error, "readManifest");
}
}, marker = performance_1.Performance.mark(performance_1.OCLIF_MARKER_OWNER, `plugin.manifest#${this.name}`, { plugin: this.name });
if (!ignoreManifest) {
let manifest2 = await readManifest();
if (manifest2)
return marker?.addDetails({ commandCount: Object.keys(manifest2.commands).length, fromCache: !0 }), marker?.stop(), this.commandIDs = Object.keys(manifest2.commands), manifest2;
}
this.commandIDs = await this.getCommandIDs();
let manifest = {
commands: (await Promise.all(this.commandIDs.map(async (id) => {
try {
let found = await this.findCommand(id, { must: !0 }), cached = await (0, cache_command_1.cacheCommand)(found, this, respectNoCacheDefault);
if (cached.id = id, this.flexibleTaxonomy) {
let permutations = (0, util_2.getCommandIdPermutations)(id), aliasPermutations = cached.aliases.flatMap((a) => (0, util_2.getCommandIdPermutations)(a));
return [id, { ...cached, aliasPermutations, permutations }];
}
return [id, cached];
} catch (error) {
let scope = `findCommand (${id})`;
if (!errorOnManifestCreate)
this.warn(error, scope);
else
throw this.addErrorScope(error, scope);
}
}))).filter((f) => !!f).reduce((commands, [id, c]) => (commands[id] = c, commands), {}),
version: this.version
};
return marker?.addDetails({ commandCount: Object.keys(manifest.commands).length, fromCache: !1 }), marker?.stop(), manifest;
}
addErrorScope(err, scope) {
return err.name = err.name ?? (0, node_util_1.inspect)(err).trim(), err.detail = (0, util_1.compact)([
err.detail,
`module: ${this._base}`,
scope && `task: ${scope}`,
`plugin: ${this.name}`,
`root: ${this.root}`,
...err.code ? [`code: ${err.code}`] : [],
...err.message ? [`message: ${err.message}`] : [],
"See more details with DEBUG=*"
]).join(`
`), err;
}
async getCommandIDs() {
let marker = performance_1.Performance.mark(performance_1.OCLIF_MARKER_OWNER, `plugin.getCommandIDs#${this.name}`, { plugin: this.name }), ids;
switch (this.commandDiscoveryOpts?.strategy) {
case "explicit": {
ids = await this.getCommandIdsFromTarget() ?? [];
break;
}
case "pattern": {
ids = await this.getCommandIdsFromPattern();
break;
}
case "single": {
ids = await this.getCommandIdsFromTarget() ?? [];
break;
}
default:
ids = [];
}
return this._debug("found commands", ids), marker?.addDetails({ count: ids.length }), marker?.stop(), ids;
}
async getCommandIdsFromPattern() {
let commandsDir = await this.getCommandsDir();
if (!commandsDir)
return [];
this._debug(`loading IDs from ${commandsDir}`);
let files = await (0, tinyglobby_1.glob)(this.commandDiscoveryOpts?.globPatterns ?? GLOB_PATTERNS, { cwd: commandsDir });
return processCommandIds(files);
}
async getCommandIdsFromTarget() {
if (await this.loadCommandsFromTarget())
return Object.entries(await this.loadCommandsFromTarget() ?? []).filter(([, cmd]) => ensureCommandClass(cmd)).map(([id]) => id);
}
async getCommandsDir() {
return this.commandsDir ? this.commandsDir : (this.commandsDir = await (0, ts_path_1.tsPath)(this.root, this.commandDiscoveryOpts?.target, this), this.commandsDir);
}
async loadCommandsFromTarget() {
if (this.commandCache)
return this.commandCache;
if (this.commandDiscoveryOpts?.strategy === "explicit" && this.commandDiscoveryOpts.target) {
let filePath = await (0, ts_path_1.tsPath)(this.root, this.commandDiscoveryOpts.target, this), module2 = await (0, module_loader_1.load)(this, filePath);
return this.commandCache = module2[this.commandDiscoveryOpts?.identifier ?? "default"] ?? {}, this.commandCache;
}
if (this.commandDiscoveryOpts?.strategy === "single" && this.commandDiscoveryOpts.target) {
let filePath = await (0, ts_path_1.tsPath)(this.root, this.commandDiscoveryOpts?.target ?? this.root, this), module2 = await (0, module_loader_1.load)(this, filePath);
return this.commandCache = { [symbols_1.SINGLE_COMMAND_CLI_SYMBOL]: searchForCommandClass(module2) }, this.commandCache;
}
}
warn(err, scope) {
typeof err == "string" && (err = new Error(err));
let warning = this.addErrorScope(err, scope);
process.emitWarning(warning.name, warning);
}
};
exports.Plugin = Plugin;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/config/plugin-loader.js
var require_plugin_loader = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/config/plugin-loader.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
var minimatch_1 = require_commonjs3(), node_path_1 = __require("node:path"), performance_1 = require_performance(), fs_1 = require_fs(), util_1 = require_util(), plugin_1 = require_plugin(), util_2 = require_util2(), debug = (0, util_2.makeDebug)();
function findMatchingDependencies(dependencies, patterns) {
return Object.keys(dependencies).filter((p) => patterns.some((w) => (0, minimatch_1.minimatch)(p, w)));
}
var PluginLoader = class {
options;
errors = [];
plugins = /* @__PURE__ */ new Map();
pluginsProvided = !1;
constructor(options) {
this.options = options, options.plugins && (this.pluginsProvided = !0, this.plugins = Array.isArray(options.plugins) ? new Map(options.plugins.map((p) => [p.name, p])) : options.plugins);
}
async loadChildren(opts) {
return (!this.pluginsProvided || opts.force) && (await this.loadUserPlugins(opts), await this.loadDevPlugins(opts), await this.loadCorePlugins(opts)), { errors: this.errors, plugins: this.plugins };
}
async loadRoot({ pjson }) {
let rootPlugin;
if (this.pluginsProvided) {
let plugins = [...this.plugins.values()];
rootPlugin = plugins.find((p) => p.root === this.options.root) ?? plugins[0];
} else {
let marker = performance_1.Performance.mark(performance_1.OCLIF_MARKER_OWNER, "plugin.load#root");
rootPlugin = new plugin_1.Plugin({ isRoot: !0, pjson, root: this.options.root }), await rootPlugin.load(), marker?.addDetails({
commandCount: rootPlugin.commands.length,
hasManifest: rootPlugin.hasManifest ?? !1,
name: rootPlugin.name,
topicCount: rootPlugin.topics.length,
type: rootPlugin.type,
usesMain: !!rootPlugin.pjson.main
}), marker?.stop();
}
return this.plugins.set(rootPlugin.name, rootPlugin), rootPlugin;
}
async loadCorePlugins(opts) {
let { plugins: corePlugins } = opts.rootPlugin.pjson.oclif;
if (corePlugins) {
let plugins = findMatchingDependencies(opts.rootPlugin.pjson.dependencies ?? {}, corePlugins);
await this.loadPlugins(opts.rootPlugin.root, "core", plugins);
}
let { core: pluginAdditionsCore, path } = opts.pluginAdditions ?? { core: [] };
if (pluginAdditionsCore)
if (path) {
let pjson = await (0, fs_1.readJson)((0, node_path_1.join)(path, "package.json")), plugins = findMatchingDependencies(pjson.dependencies ?? {}, pluginAdditionsCore);
await this.loadPlugins(path, "core", plugins);
} else {
let plugins = findMatchingDependencies(opts.rootPlugin.pjson.dependencies ?? {}, pluginAdditionsCore);
await this.loadPlugins(opts.rootPlugin.root, "core", plugins);
}
}
async loadDevPlugins(opts) {
if (opts.devPlugins !== !1) {
if ((0, util_1.isProd)())
return;
try {
let { devPlugins } = opts.rootPlugin.pjson.oclif;
if (devPlugins) {
let allDeps = { ...opts.rootPlugin.pjson.dependencies, ...opts.rootPlugin.pjson.devDependencies }, plugins = findMatchingDependencies(allDeps ?? {}, devPlugins);
await this.loadPlugins(opts.rootPlugin.root, "dev", plugins);
}
let { dev: pluginAdditionsDev, path } = opts.pluginAdditions ?? { core: [] };
if (pluginAdditionsDev)
if (path) {
let pjson = await (0, fs_1.readJson)((0, node_path_1.join)(path, "package.json")), allDeps = { ...pjson.dependencies, ...pjson.devDependencies }, plugins = findMatchingDependencies(allDeps ?? {}, pluginAdditionsDev);
await this.loadPlugins(path, "dev", plugins);
} else {
let allDeps = { ...opts.rootPlugin.pjson.dependencies, ...opts.rootPlugin.pjson.devDependencies }, plugins = findMatchingDependencies(allDeps ?? {}, pluginAdditionsDev);
await this.loadPlugins(opts.rootPlugin.root, "dev", plugins);
}
} catch (error) {
process.emitWarning(error);
}
}
}
async loadPlugins(root, type, plugins, parent) {
if (!plugins || plugins.length === 0)
return;
let mark = performance_1.Performance.mark(performance_1.OCLIF_MARKER_OWNER, `config.loadPlugins#${type}`);
debug("loading plugins", plugins), await Promise.all((plugins || []).map(async (plugin) => {
try {
let name = typeof plugin == "string" ? plugin : plugin.name, opts = {
name,
root,
type
};
if (typeof plugin != "string" && (opts.tag = plugin.tag || opts.tag, opts.root = plugin.root || opts.root, opts.url = plugin.url), parent && (opts.parent = parent), this.plugins.has(name))
return;
let pluginMarker = performance_1.Performance.mark(performance_1.OCLIF_MARKER_OWNER, `plugin.load#${name}`), instance = new plugin_1.Plugin(opts);
if (await instance.load(), pluginMarker?.addDetails({
commandCount: instance.commands.length,
hasManifest: instance.hasManifest,
name: instance.name,
topicCount: instance.topics.length,
type: instance.type,
usesMain: !!instance.pjson.main
}), pluginMarker?.stop(), this.plugins.set(instance.name, instance), parent && (instance.parent = parent, parent.children || (parent.children = []), parent.children.push(instance)), instance.pjson.oclif.plugins) {
let allDeps = type === "dev" ? { ...instance.pjson.dependencies, ...instance.pjson.devDependencies } : instance.pjson.dependencies, plugins2 = findMatchingDependencies(allDeps ?? {}, instance.pjson.oclif.plugins);
await this.loadPlugins(instance.root, type, plugins2, instance);
}
} catch (error) {
this.errors.push(error);
}
})), mark?.addDetails({ pluginCount: plugins.length }), mark?.stop();
}
async loadUserPlugins(opts) {
if (opts.userPlugins !== !1)
try {
let userPJSONPath = (0, node_path_1.join)(opts.dataDir, "package.json");
debug("reading user plugins pjson %s", userPJSONPath);
let pjson = await (0, fs_1.readJson)(userPJSONPath, !1);
pjson.oclif || (pjson.oclif = { schema: 1 }), pjson.oclif.plugins || (pjson.oclif.plugins = []), await this.loadPlugins(userPJSONPath, "user", pjson.oclif.plugins.filter((p) => p.type === "user")), await this.loadPlugins(userPJSONPath, "link", pjson.oclif.plugins.filter((p) => p.type === "link"));
} catch (error) {
error.code !== "ENOENT" && process.emitWarning(error);
}
}
};
exports.default = PluginLoader;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/config/config.js
var require_config = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/config/config.js"(exports, module) {
"use strict";
init_cjs_shims();
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
k2 === void 0 && (k2 = k);
var desc = Object.getOwnPropertyDescriptor(m, k);
(!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) && (desc = { enumerable: !0, get: function() {
return m[k];
} }), Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
k2 === void 0 && (k2 = k), o[k2] = m[k];
})), __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: !0, value: v });
}) : function(o, v) {
o.default = v;
}), __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() {
var ownKeys = function(o) {
return ownKeys = Object.getOwnPropertyNames || function(o2) {
var ar = [];
for (var k in o2) Object.prototype.hasOwnProperty.call(o2, k) && (ar[ar.length] = k);
return ar;
}, ownKeys(o);
};
return function(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) k[i] !== "default" && __createBinding(result, mod, k[i]);
return __setModuleDefault(result, mod), result;
};
})(), __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.Config = void 0;
var ejs = __importStar(require_ejs()), is_wsl_1 = __importDefault(require_is_wsl()), node_os_1 = __require("node:os"), node_path_1 = __require("node:path"), node_url_1 = __require("node:url"), cache_1 = __importDefault(require_cache()), errors_1 = require_errors(), util_1 = require_util3(), logger_1 = require_logger(), module_loader_1 = require_module_loader(), performance_1 = require_performance(), settings_1 = require_settings(), determine_priority_1 = require_determine_priority(), fs_1 = require_fs(), ids_1 = require_ids(), os_1 = require_os(), util_2 = require_util(), ux_1 = require_ux(), theme_1 = require_theme2(), plugin_loader_1 = __importDefault(require_plugin_loader()), ts_path_1 = require_ts_path(), util_3 = require_util2(), debug = (0, util_3.makeDebug)(), _pjson = cache_1.default.getInstance().get("@oclif/core"), BASE = `${_pjson.name}@${_pjson.version}`, ROOT_ONLY_HOOKS = /* @__PURE__ */ new Set(["preparse"]);
function displayWarnings() {
process.listenerCount("warning") > 1 || process.on("warning", (warning) => {
console.error(warning.stack), warning.detail && console.error(warning.detail);
});
}
function channelFromVersion(version) {
let m = version.match(/[^-]+(?:-([^.]+))?/);
return m && m[1] || "stable";
}
function isConfig(o) {
return o && !!o._base;
}
var Permutations = class extends Map {
validPermutations = /* @__PURE__ */ new Map();
add(permutation, commandId) {
this.validPermutations.set(permutation, commandId);
for (let id of (0, util_3.collectUsableIds)([permutation]))
this.has(id) ? this.set(id, this.get(id).add(commandId)) : this.set(id, /* @__PURE__ */ new Set([commandId]));
}
get(key) {
return super.get(key) ?? /* @__PURE__ */ new Set();
}
getAllValid() {
return [...this.validPermutations.keys()];
}
getValid(key) {
return this.validPermutations.get(key);
}
hasValid(key) {
return this.validPermutations.has(key);
}
}, Config = class _Config {
options;
arch;
bin;
binAliases;
binPath;
cacheDir;
channel;
configDir;
dataDir;
dirname;
flexibleTaxonomy;
home;
isSingleCommandCLI = !1;
name;
npmRegistry;
nsisCustomization;
pjson;
platform;
plugins = /* @__PURE__ */ new Map();
root;
shell;
theme;
topicSeparator = ":";
updateConfig;
userAgent;
userPJSON;
valid;
version;
warned = !1;
windows;
_base = BASE;
_commandIDs;
_commands = /* @__PURE__ */ new Map();
_topics = /* @__PURE__ */ new Map();
commandPermutations = new Permutations();
pluginLoader;
rootPlugin;
topicPermutations = new Permutations();
constructor(options) {
this.options = options;
}
static async load(opts = module.filename || __dirname) {
if ((0, logger_1.setLogger)(opts), typeof opts == "string" && opts.startsWith("file://") && (opts = (0, node_url_1.fileURLToPath)(opts)), typeof opts == "string" && (opts = { root: opts }), isConfig(opts)) {
if (BASE !== opts._base) {
debug(`reloading config from ${opts._base} to ${BASE}`);
let config2 = new _Config({ ...opts.options, plugins: opts.plugins });
return await config2.load(), config2;
}
return opts;
}
let config = new _Config(opts);
return await config.load(), config;
}
get commandIDs() {
return this._commandIDs ? this._commandIDs : (this._commandIDs = this.commands.map((c) => c.id), this._commandIDs);
}
get commands() {
return [...this._commands.values()];
}
get isProd() {
return (0, util_2.isProd)();
}
static get rootPlugin() {
return this.rootPlugin;
}
get topics() {
return [...this._topics.values()];
}
get versionDetails() {
let [cliVersion, architecture, nodeVersion] = this.userAgent.split(" ");
return {
architecture,
cliVersion,
nodeVersion,
osVersion: `${(0, node_os_1.type)()} ${(0, node_os_1.release)()}`,
pluginVersions: Object.fromEntries([...this.plugins.values()].map((p) => [p.name, { root: p.root, type: p.type, version: p.version }])),
rootPath: this.root,
shell: this.shell
};
}
_shell() {
let shellPath, { COMSPEC } = process.env, SHELL = process.env.SHELL ?? (0, node_os_1.userInfo)().shell?.split(node_path_1.sep)?.pop();
return SHELL ? shellPath = SHELL.split("/") : this.windows && (process.title.toLowerCase().includes("powershell") || process.title.toLowerCase().includes("pwsh")) ? shellPath = ["powershell"] : this.windows && (process.title.toLowerCase().includes("command prompt") || process.title.toLowerCase().includes("cmd")) ? shellPath = ["cmd.exe"] : this.windows && COMSPEC ? shellPath = COMSPEC.split(/\\|\//) : shellPath = ["unknown"], shellPath.at(-1) ?? "unknown";
}
dir(category) {
let base = process.env[`XDG_${category.toUpperCase()}_HOME`] || this.windows && process.env.LOCALAPPDATA || (0, node_path_1.join)(this.home, category === "data" ? ".local/share" : "." + category);
return (0, node_path_1.join)(base, this.dirname);
}
findCommand(id, opts = {}) {
let lookupId = this.getCmdLookupId(id), command = this._commands.get(lookupId);
return opts.must && !command && (0, errors_1.error)(`command ${lookupId} not found`), command;
}
/**
* Find all command ids that include the provided command id.
*
* For example, if the command ids are:
* - foo:bar:baz
* - one:two:three
*
* `bar` would return `foo:bar:baz`
*
* @param partialCmdId string
* @param argv string[] process.argv containing the flags and arguments provided by the user
* @returns string[]
*/
findMatches(partialCmdId, argv) {
let flags = argv.filter((arg) => !(0, util_1.getHelpFlagAdditions)(this).includes(arg) && arg.startsWith("-")).map((a) => a.replaceAll("-", ""));
return [...this.commandPermutations.get(partialCmdId)].map((k) => this._commands.get(k)).filter((command) => {
let cmdFlags = Object.entries(command.flags).flatMap(([flag, def]) => def.char ? [def.char, flag] : [flag]);
return flags.every((f) => cmdFlags.includes(f));
});
}
findTopic(name, opts = {}) {
let lookupId = this.getTopicLookupId(name), topic = this._topics.get(lookupId);
if (topic)
return topic;
if (opts.must)
throw new Error(`topic ${name} not found`);
}
/**
* Returns an array of all command ids. If flexible taxonomy is enabled then all permutations will be appended to the array.
* @returns string[]
*/
getAllCommandIDs() {
return this.getAllCommands().map((c) => c.id);
}
/**
* Returns an array of all commands. If flexible taxonomy is enabled then all permutations will be appended to the array.
* @returns Command.Loadable[]
*/
getAllCommands() {
let commands = [...this._commands.values()], validPermutations = [...this.commandPermutations.getAllValid()];
for (let permutation of validPermutations)
if (!this._commands.has(permutation)) {
let cmd = this._commands.get(this.getCmdLookupId(permutation));
commands.push({ ...cmd, id: permutation });
}
return commands;
}
getPluginsList() {
return [...this.plugins.values()];
}
// eslint-disable-next-line complexity
async load() {
settings_1.settings.performanceEnabled = (settings_1.settings.performanceEnabled === void 0 ? this.options.enablePerf : settings_1.settings.performanceEnabled) ?? !1, settings_1.settings.debug && displayWarnings(), (0, logger_1.setLogger)(this.options);
let marker = performance_1.Performance.mark(performance_1.OCLIF_MARKER_OWNER, "config.load");
this.pluginLoader = new plugin_loader_1.default({ plugins: this.options.plugins, root: this.options.root }), this.rootPlugin = await this.pluginLoader.loadRoot({ pjson: this.options.pjson });
let cache = cache_1.default.getInstance();
cache.set("rootPlugin", this.rootPlugin), cache.set("exitCodes", this.rootPlugin.pjson.oclif.exitCodes ?? {}), this.root = this.rootPlugin.root, this.pjson = this.rootPlugin.pjson, this.plugins.set(this.rootPlugin.name, this.rootPlugin), this.root = this.rootPlugin.root, this.pjson = this.rootPlugin.pjson, this.name = this.pjson.name, this.version = this.options.version || this.pjson.version || "0.0.0", this.channel = this.options.channel || channelFromVersion(this.version), this.valid = this.rootPlugin.valid, this.arch = (0, node_os_1.arch)() === "ia32" ? "x86" : (0, node_os_1.arch)(), this.platform = is_wsl_1.default ? "wsl" : (0, os_1.getPlatform)(), this.windows = this.platform === "win32", this.bin = this.pjson.oclif.bin || this.name, this.binAliases = this.pjson.oclif.binAliases, this.nsisCustomization = this.pjson.oclif.nsisCustomization, this.dirname = this.pjson.oclif.dirname || this.name, this.flexibleTaxonomy = this.pjson.oclif.flexibleTaxonomy || !1, this.pjson.oclif.topicSeparator && [" ", ":"].includes(this.pjson.oclif.topicSeparator) && (this.topicSeparator = this.pjson.oclif.topicSeparator), this.platform === "win32" && (this.dirname = this.dirname.replace("/", "\\")), this.userAgent = `${this.name}/${this.version} ${this.platform}-${this.arch} node-${process.version}`, this.shell = this._shell(), this.home = process.env.HOME || this.windows && this.windowsHome() || (0, os_1.getHomeDir)() || (0, node_os_1.tmpdir)(), this.cacheDir = this.scopedEnvVar("CACHE_DIR") || this.macosCacheDir() || this.dir("cache"), this.configDir = this.scopedEnvVar("CONFIG_DIR") || this.dir("config"), this.dataDir = this.scopedEnvVar("DATA_DIR") || this.dir("data"), this.binPath = this.scopedEnvVar("BINPATH"), this.npmRegistry = this.scopedEnvVar("NPM_REGISTRY") || this.pjson.oclif.npmRegistry, this.theme = await this.loadTheme(), this.updateConfig = {
...this.pjson.oclif.update,
node: this.pjson.oclif.update?.node ?? {},
s3: this.buildS3Config()
}, this.isSingleCommandCLI = !!(typeof this.pjson.oclif.commands != "string" && this.pjson.oclif.commands?.strategy === "single" && this.pjson.oclif.commands?.target), this.maybeAdjustDebugSetting(), await this.loadPluginsAndCommands(), debug("config done"), marker?.addDetails({
commandPermutations: this.commands.length,
commands: [...this.plugins.values()].reduce((acc, p) => acc + p.commands.length, 0),
plugins: this.plugins.size,
topics: this.topics.length
}), marker?.stop();
}
async loadPluginsAndCommands(opts) {
let pluginsMarker = performance_1.Performance.mark(performance_1.OCLIF_MARKER_OWNER, "config.loadAllPlugins"), { errors, plugins } = await this.pluginLoader.loadChildren({
dataDir: this.dataDir,
devPlugins: this.options.devPlugins,
force: opts?.force ?? !1,
pluginAdditions: this.options.pluginAdditions,
rootPlugin: this.rootPlugin,
userPlugins: this.options.userPlugins
});
this.plugins = plugins, pluginsMarker?.stop();
let commandsMarker = performance_1.Performance.mark(performance_1.OCLIF_MARKER_OWNER, "config.loadAllCommands");
for (let plugin of this.plugins.values())
this.loadCommands(plugin), this.loadTopics(plugin);
commandsMarker?.stop();
for (let error of errors)
this.warn(error);
}
async loadTheme() {
if (this.scopedEnvVarTrue("DISABLE_THEME"))
return;
let userThemeFile = (0, node_path_1.resolve)(this.configDir, "theme.json"), getDefaultTheme = async () => {
if (this.pjson.oclif.theme)
return typeof this.pjson.oclif.theme == "string" ? (0, fs_1.safeReadJson)((0, node_path_1.resolve)(this.root, this.pjson.oclif.theme)) : this.pjson.oclif.theme;
}, [defaultTheme, userTheme] = await Promise.all([
getDefaultTheme(),
(0, fs_1.safeReadJson)(userThemeFile)
]), merged = { ...defaultTheme, ...userTheme };
return Object.keys(merged).length > 0 ? (0, theme_1.parseTheme)(merged) : void 0;
}
macosCacheDir() {
return this.platform === "darwin" && (0, node_path_1.join)(this.home, "Library", "Caches", this.dirname) || void 0;
}
async runCommand(id, argv = [], cachedCommand = null) {
let marker = performance_1.Performance.mark(performance_1.OCLIF_MARKER_OWNER, `config.runCommand#${id}`);
debug("runCommand %s %o", id, argv);
let c = cachedCommand ?? this.findCommand(id);
if (!c) {
let matches = this.flexibleTaxonomy ? this.findMatches(id, argv) : [], hookResult = this.flexibleTaxonomy && matches.length > 0 ? await this.runHook("command_incomplete", { argv, id, matches }) : await this.runHook("command_not_found", { argv, id });
if (hookResult.successes[0])
return hookResult.successes[0].result;
throw hookResult.failures[0] ? hookResult.failures[0].error : new errors_1.CLIError(`command ${id} not found`);
}
if (this.isJitPluginCommand(c)) {
let pluginName = c.pluginName, pluginVersion = this.pjson.oclif.jitPlugins[pluginName], jitResult = await this.runHook("jit_plugin_not_installed", {
argv,
command: c,
id,
pluginName,
pluginVersion
});
if (jitResult.failures[0])
throw jitResult.failures[0].error;
if (jitResult.successes[0])
await this.loadPluginsAndCommands({ force: !0 }), c = this.findCommand(id) ?? c;
else {
let result2 = await this.runHook("command_not_found", { argv, id });
if (result2.successes[0])
return result2.successes[0].result;
throw result2.failures[0] ? result2.failures[0].error : new errors_1.CLIError(`command ${id} not found`);
}
}
let command = await c.load();
await this.runHook("prerun", { argv, Command: command });
let result = await command.run(argv, this);
if (c.id === "plugins:uninstall")
for (let arg of argv)
this.plugins.delete(arg);
return await this.runHook("postrun", { argv, Command: command, result }), marker?.addDetails({ command: id, plugin: c.pluginName }), marker?.stop(), result;
}
async runHook(event, opts, timeout, captureErrors) {
let marker = performance_1.Performance.mark(performance_1.OCLIF_MARKER_OWNER, `config.runHook#${event}`);
debug("start %s hook", event);
let search = (m) => typeof m == "function" ? m : m.default && typeof m.default == "function" ? m.default : Object.values(m).find((m2) => typeof m2 == "function"), withTimeout = async (ms, promise) => {
let id, timeout2 = new Promise((_, reject) => {
id = setTimeout(() => {
reject(new Error(`Timed out after ${ms} ms.`));
}, ms).unref();
});
return Promise.race([promise, timeout2]).then((result) => (clearTimeout(id), result));
}, final = {
failures: [],
successes: []
}, promises = (ROOT_ONLY_HOOKS.has(event) ? [this.rootPlugin] : [...this.plugins.values()]).map(async (p) => {
let debug2 = (0, logger_1.makeDebug)([p.name, "hooks", event].join(":")), context = {
config: this,
debug: debug2,
error(message, options = {}) {
(0, errors_1.error)(message, options);
},
exit(code = 0) {
(0, errors_1.exit)(code);
},
log(message, ...args) {
ux_1.ux.stdout(message, ...args);
},
warn(message) {
(0, errors_1.warn)(message);
}
}, hooks = p.hooks[event] || [];
for (let hook of hooks) {
let marker2 = performance_1.Performance.mark(performance_1.OCLIF_MARKER_OWNER, `config.runHook#${p.name}(${hook.target})`);
try {
let { filePath, isESM, module: module2 } = await (0, module_loader_1.loadWithData)(p, await (0, ts_path_1.tsPath)(p.root, hook.target, p));
debug2("start", isESM ? "(import)" : "(require)", filePath);
let hookFn = module2[hook.identifier] ?? (hook.identifier === "default" ? search(module2) : void 0);
if (!hookFn) {
debug2("No hook found for hook definition:", hook);
continue;
}
let result = timeout ? await withTimeout(timeout, hookFn.call(context, { ...opts, config: this, context })) : await hookFn.call(context, { ...opts, config: this, context });
final.successes.push({ plugin: p, result }), p.name === "@oclif/plugin-legacy" && event === "init" && this.insertLegacyPlugins(result), debug2("done");
} catch (error) {
if (final.failures.push({ error, plugin: p }), debug2(error), !captureErrors && error.oclif?.exit !== void 0 && error.oclif?.exit !== 0 && error.code !== "MODULE_NOT_FOUND")
throw error;
}
marker2?.addDetails({
event,
hook: hook.target,
plugin: p.name
}), marker2?.stop();
}
});
return await Promise.all(promises), debug("%s hook done", event), marker?.stop(), final;
}
s3Key(type, ext, options = {}) {
typeof ext == "object" ? options = ext : ext && (options.ext = ext);
let template = this.updateConfig.s3?.templates?.[options.platform ? "target" : "vanilla"][type] ?? "";
return ejs.render(template, { ...this, ...options });
}
s3Url(key) {
let { host } = this.updateConfig.s3 ?? { host: void 0 };
if (!host)
throw new Error("no s3 host is set");
let url = new node_url_1.URL(host);
return url.pathname = (0, node_path_1.join)(url.pathname, key), url.toString();
}
scopedEnvVar(k) {
return process.env[this.scopedEnvVarKeys(k).find((k2) => process.env[k2])];
}
/**
* this DOES NOT account for bin aliases, use scopedEnvVarKeys instead which will account for bin aliases
* @param k {string}, the unscoped key you want to get the value for
* @returns {string} returns the env var key
*/
scopedEnvVarKey(k) {
return [this.bin, k].map((p) => p.replaceAll("@", "").replaceAll(/[/-]/g, "_")).join("_").toUpperCase();
}
/**
* gets the scoped env var keys for a given key, including bin aliases
* @param k {string}, the env key e.g. 'debug'
* @returns {string[]} e.g. ['SF_DEBUG', 'SFDX_DEBUG']
*/
scopedEnvVarKeys(k) {
return [this.bin, ...this.binAliases ?? []].filter(Boolean).map((alias) => [alias.replaceAll("@", "").replaceAll(/[/-]/g, "_"), k].join("_").toUpperCase());
}
scopedEnvVarTrue(k) {
let v = this.scopedEnvVar(k);
return v === "1" || v === "true";
}
windowsHome() {
return this.windowsHomedriveHome() || this.windowsUserprofileHome();
}
windowsHomedriveHome() {
return process.env.HOMEDRIVE && process.env.HOMEPATH && (0, node_path_1.join)(process.env.HOMEDRIVE, process.env.HOMEPATH);
}
windowsUserprofileHome() {
return process.env.USERPROFILE;
}
buildS3Config() {
let s3 = this.pjson.oclif.update?.s3, bucket = this.scopedEnvVar("S3_BUCKET") ?? s3?.bucket, host = s3?.host ?? (bucket && `https://${bucket}.s3.amazonaws.com`), templates = {
...s3?.templates,
target: {
baseDir: "<%- bin %>",
manifest: "<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- platform %>-<%- arch %>",
unversioned: "<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- bin %>-<%- platform %>-<%- arch %><%- ext %>",
versioned: "<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- bin %>-v<%- version %>/<%- bin %>-v<%- version %>-<%- platform %>-<%- arch %><%- ext %>",
...s3?.templates && s3?.templates.target
},
vanilla: {
baseDir: "<%- bin %>",
manifest: "<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %>version",
unversioned: "<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- bin %><%- ext %>",
versioned: "<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- bin %>-v<%- version %>/<%- bin %>-v<%- version %><%- ext %>",
...s3?.templates && s3?.templates.vanilla
}
};
return {
bucket,
host,
templates
};
}
getCmdLookupId(id) {
return this._commands.has(id) ? id : this.commandPermutations.hasValid(id) ? this.commandPermutations.getValid(id) : id;
}
getTopicLookupId(id) {
return this._topics.has(id) ? id : this.topicPermutations.hasValid(id) ? this.topicPermutations.getValid(id) : id;
}
/**
* Insert legacy plugins
*
* Replace invalid CLI plugins (cli-engine plugins, mostly Heroku) loaded via `this.loadPlugins`
* with oclif-compatible ones returned by @oclif/plugin-legacy init hook.
*
* @param plugins array of oclif-compatible plugins
*/
insertLegacyPlugins(plugins) {
for (let plugin of plugins) {
this.plugins.set(plugin.name, plugin);
for (let cmd of plugin.commands ?? []) {
this._commands.delete(cmd.id);
for (let alias of [...cmd.aliases ?? [], ...cmd.hiddenAliases ?? []])
this._commands.delete(alias);
}
this.loadCommands(plugin);
}
}
isJitPluginCommand(c) {
return Object.keys(this.pjson.oclif.jitPlugins ?? {}).includes(c.pluginName ?? "") && !!(c?.pluginName && !this.plugins.has(c.pluginName));
}
loadCommands(plugin) {
let marker = performance_1.Performance.mark(performance_1.OCLIF_MARKER_OWNER, `config.loadCommands#${plugin.name}`, { plugin: plugin.name });
for (let command of plugin.commands) {
if (this._commands.has(command.id)) {
let prioritizedCommand = (0, determine_priority_1.determinePriority)(this.pjson.oclif.plugins ?? [], [
this._commands.get(command.id),
command
]);
this._commands.set(prioritizedCommand.id, prioritizedCommand);
} else
this._commands.set(command.id, command);
let permutations = this.flexibleTaxonomy && command.permutations === void 0 ? (0, util_3.getCommandIdPermutations)(command.id) : command.permutations ?? [command.id];
for (let permutation of permutations)
this.commandPermutations.add(permutation, command.id);
let handleAlias = (alias, hidden = !1) => {
let aliasWithDefaultTopicSeparator = (0, ids_1.toStandardizedId)(alias, this);
if (this._commands.has(aliasWithDefaultTopicSeparator)) {
let prioritizedCommand = (0, determine_priority_1.determinePriority)(this.pjson.oclif.plugins ?? [], [
this._commands.get(aliasWithDefaultTopicSeparator),
command
]);
this._commands.set(aliasWithDefaultTopicSeparator, {
...prioritizedCommand,
id: aliasWithDefaultTopicSeparator
});
} else
this._commands.set(aliasWithDefaultTopicSeparator, { ...command, hidden, id: aliasWithDefaultTopicSeparator });
let aliasPermutations = this.flexibleTaxonomy && command.aliasPermutations === void 0 ? (0, util_3.getCommandIdPermutations)(aliasWithDefaultTopicSeparator) : command.permutations ?? [aliasWithDefaultTopicSeparator];
for (let permutation of aliasPermutations)
this.commandPermutations.add(permutation, command.id);
};
for (let alias of command.aliases ?? [])
handleAlias(alias);
for (let alias of command.hiddenAliases ?? [])
handleAlias(alias, !0);
}
marker?.addDetails({ commandCount: plugin.commands.length }), marker?.stop();
}
loadTopics(plugin) {
let marker = performance_1.Performance.mark(performance_1.OCLIF_MARKER_OWNER, `config.loadTopics#${plugin.name}`, { plugin: plugin.name });
for (let topic of (0, util_2.compact)(plugin.topics)) {
let existing = this._topics.get(topic.name);
existing ? (existing.description = topic.description || existing.description, existing.hidden = existing.hidden || topic.hidden) : this._topics.set(topic.name, topic);
let permutations = this.flexibleTaxonomy ? (0, util_3.getCommandIdPermutations)(topic.name) : [topic.name];
for (let permutation of permutations)
this.topicPermutations.add(permutation, topic.name);
}
for (let c of plugin.commands.filter((c2) => !c2.hidden)) {
let parts = c.id.split(":");
for (; parts.length > 0; ) {
let name = parts.join(":");
name && !this._topics.has(name) && this._topics.set(name, { description: c.summary || c.description, name }), parts.pop();
}
}
marker?.stop();
}
maybeAdjustDebugSetting() {
this.scopedEnvVarTrue("DEBUG") && (settings_1.settings.debug = !0, displayWarnings());
}
warn(err, scope) {
if (!this.warned) {
if (typeof err == "string") {
process.emitWarning(err);
return;
}
if (err instanceof Error) {
let modifiedErr = err;
modifiedErr.name = `${err.name} Plugin: ${this.name}`, modifiedErr.detail = (0, util_2.compact)([
err.detail,
`module: ${this._base}`,
scope && `task: ${scope}`,
`plugin: ${this.name}`,
`root: ${this.root}`,
"See more details with DEBUG=*"
]).join(`
`), process.emitWarning(err);
return;
}
process.emitWarning("Config.warn expected either a string or Error, but instead received an object"), err.name = `${err.name} Plugin: ${this.name}`, err.detail = (0, util_2.compact)([
err.detail,
`module: ${this._base}`,
scope && `task: ${scope}`,
`plugin: ${this.name}`,
`root: ${this.root}`,
"See more details with DEBUG=*"
]).join(`
`), process.emitWarning(JSON.stringify(err));
}
}
};
exports.Config = Config;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/config/index.js
var require_config2 = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/config/index.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.tsPath = exports.Plugin = exports.Config = void 0;
var config_1 = require_config();
Object.defineProperty(exports, "Config", { enumerable: !0, get: function() {
return config_1.Config;
} });
var plugin_1 = require_plugin();
Object.defineProperty(exports, "Plugin", { enumerable: !0, get: function() {
return plugin_1.Plugin;
} });
var ts_path_1 = require_ts_path();
Object.defineProperty(exports, "tsPath", { enumerable: !0, get: function() {
return ts_path_1.tsPath;
} });
}
});
// ../../node_modules/.pnpm/wordwrap@1.0.0/node_modules/wordwrap/index.js
var require_wordwrap = __commonJS({
"../../node_modules/.pnpm/wordwrap@1.0.0/node_modules/wordwrap/index.js"(exports, module) {
init_cjs_shims();
var wordwrap = module.exports = function(start, stop, params) {
typeof start == "object" && (params = start, start = params.start, stop = params.stop), typeof stop == "object" && (params = stop, start = start || params.start, stop = void 0), stop || (stop = start, start = 0), params || (params = {});
var mode = params.mode || "soft", re = mode === "hard" ? /\b/ : /(\S+\s+)/;
return function(text) {
var chunks = text.toString().split(re).reduce(function(acc, x) {
if (mode === "hard")
for (var i = 0; i < x.length; i += stop - start)
acc.push(x.slice(i, i + stop - start));
else acc.push(x);
return acc;
}, []);
return chunks.reduce(function(lines, rawChunk) {
if (rawChunk === "") return lines;
var chunk = rawChunk.replace(/\t/g, " "), i = lines.length - 1;
if (lines[i].length + chunk.length > stop)
lines[i] = lines[i].replace(/\s+$/, ""), chunk.split(/\n/).forEach(function(c) {
lines.push(
new Array(start + 1).join(" ") + c.replace(/^\s+/, "")
);
});
else if (chunk.match(/\n/)) {
var xs = chunk.split(/\n/);
lines[i] += xs.shift(), xs.forEach(function(c) {
lines.push(
new Array(start + 1).join(" ") + c.replace(/^\s+/, "")
);
});
} else
lines[i] += chunk;
return lines;
}, [new Array(start + 1).join(" ")]).join(`
`);
};
};
wordwrap.soft = wordwrap;
wordwrap.hard = function(start, stop) {
return wordwrap(start, stop, { mode: "hard" });
};
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/ux/list.js
var require_list = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/ux/list.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.default = renderList;
var wordwrap = require_wordwrap(), screen_1 = require_screen(), util_1 = require_util();
function linewrap(length, s) {
return wordwrap(length, screen_1.stdtermwidth, {
skipScheme: "ansi-color"
})(s).trim();
}
function renderList(items) {
if (items.length === 0)
return "";
let maxLength = (0, util_1.maxBy)(items, (item) => item[0].length)?.[0].length ?? 0;
return items.map((i) => {
let left = i[0], right = i[1];
return right ? (left = left.padEnd(maxLength), right = linewrap(maxLength + 2, right), `${left} ${right}`) : left;
}).join(`
`);
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/parser/errors.js
var require_errors2 = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/parser/errors.js"(exports) {
"use strict";
init_cjs_shims();
var __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.FailedFlagValidationError = exports.ArgInvalidOptionError = exports.FlagInvalidOptionError = exports.NonExistentFlagsError = exports.UnexpectedArgsError = exports.RequiredArgsError = exports.InvalidArgsSpecError = exports.CLIParseError = exports.CLIError = void 0;
var cache_1 = __importDefault(require_cache()), errors_1 = require_errors(), util_1 = require_util(), list_1 = __importDefault(require_list()), theme_1 = require_theme2(), errors_2 = require_errors();
Object.defineProperty(exports, "CLIError", { enumerable: !0, get: function() {
return errors_2.CLIError;
} });
var CLIParseError = class extends errors_1.CLIError {
parse;
showHelp = !1;
constructor(options) {
options.message += `
See more help with --help`, super(options.message, { exit: options.exit }), this.parse = options.parse;
}
};
exports.CLIParseError = CLIParseError;
var InvalidArgsSpecError = class extends CLIParseError {
args;
constructor({ args, exit, parse }) {
let message = "Invalid argument spec", namedArgs = Object.values(args).filter((a) => a.name);
if (namedArgs.length > 0) {
let list = (0, list_1.default)(namedArgs.map((a) => [`${a.name} (${a.required ? "required" : "optional"})`, a.description]));
message += `:
${list}`;
}
super({ exit: cache_1.default.getInstance().get("exitCodes")?.invalidArgsSpec ?? exit, message, parse }), this.args = args;
}
};
exports.InvalidArgsSpecError = InvalidArgsSpecError;
var RequiredArgsError = class extends CLIParseError {
args;
constructor({ args, exit, flagsWithMultiple, parse }) {
let message = `Missing ${args.length} required arg${args.length === 1 ? "" : "s"}`, namedArgs = args.filter((a) => a.name);
if (namedArgs.length > 0) {
let list = (0, list_1.default)(namedArgs.map((a) => {
let description = a.options ? `(${a.options.join("|")}) ${a.description}` : a.description;
return [a.name, description];
}));
message += `:
${list}`;
}
if (flagsWithMultiple?.length) {
let flags = flagsWithMultiple.map((f) => `--${f}`).join(", ");
message += `
Note: ${flags} allow${flagsWithMultiple.length === 1 ? "s" : ""} multiple values. Because of this you need to provide all arguments before providing ${flagsWithMultiple.length === 1 ? "that flag" : "those flags"}.`, message += `
Alternatively, you can use "--" to signify the end of the flags and the beginning of arguments.`;
}
super({ exit: cache_1.default.getInstance().get("exitCodes")?.requiredArgs ?? exit, message, parse }), this.args = args, this.showHelp = !0;
}
};
exports.RequiredArgsError = RequiredArgsError;
var UnexpectedArgsError = class extends CLIParseError {
args;
constructor({ args, exit, parse }) {
let message = `Unexpected argument${args.length === 1 ? "" : "s"}: ${args.join(", ")}`;
super({ exit: cache_1.default.getInstance().get("exitCodes")?.unexpectedArgs ?? exit, message, parse }), this.args = args, this.showHelp = !0;
}
};
exports.UnexpectedArgsError = UnexpectedArgsError;
var NonExistentFlagsError = class extends CLIParseError {
flags;
constructor({ exit, flags, parse }) {
let message = `Nonexistent flag${flags.length === 1 ? "" : "s"}: ${flags.join(", ")}`;
super({ exit: cache_1.default.getInstance().get("exitCodes")?.nonExistentFlag ?? exit, message, parse }), this.flags = flags, this.showHelp = !0;
}
};
exports.NonExistentFlagsError = NonExistentFlagsError;
var FlagInvalidOptionError = class extends CLIParseError {
constructor(flag, input) {
let message = `Expected --${flag.name}=${input} to be one of: ${flag.options.join(", ")}`;
super({ message, parse: {} });
}
};
exports.FlagInvalidOptionError = FlagInvalidOptionError;
var ArgInvalidOptionError = class extends CLIParseError {
constructor(arg, input) {
let message = `Expected ${input} to be one of: ${arg.options.join(", ")}`;
super({ message, parse: {} });
}
};
exports.ArgInvalidOptionError = ArgInvalidOptionError;
var FailedFlagValidationError = class extends CLIParseError {
constructor({ exit, failed, parse }) {
let reasons = failed.map((r) => r.reason), deduped = (0, util_1.uniq)(reasons), message = `The following ${deduped.length === 1 ? "error" : "errors"} occurred:
${(0, theme_1.colorize)("dim", deduped.join(`
`))}`;
super({ exit: cache_1.default.getInstance().get("exitCodes")?.failedFlagValidation ?? exit, message, parse });
}
};
exports.FailedFlagValidationError = FailedFlagValidationError;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/parser/parse.js
var require_parse2 = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/parser/parse.js"(exports) {
"use strict";
init_cjs_shims();
var __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.Parser = exports.readStdin = void 0;
var node_os_1 = __require("node:os"), node_readline_1 = __require("node:readline"), cache_1 = __importDefault(require_cache()), logger_1 = require_logger(), util_1 = require_util(), errors_1 = require_errors2(), debug;
try {
debug = process.env.CLI_FLAGS_DEBUG === "1" ? (0, logger_1.makeDebug)("parser") : () => {
};
} catch {
debug = () => {
};
}
var readStdin = async () => {
let { stdin, stdout } = process;
return stdin.isTTY ? null : globalThis.oclif?.stdinCache ? (debug("resolved stdin from global cache", globalThis.oclif.stdinCache), globalThis.oclif.stdinCache) : new Promise((resolve) => {
let lines = [], ac = new AbortController(), { signal } = ac, timeout = setTimeout(() => ac.abort(), 10), rl = (0, node_readline_1.createInterface)({
input: stdin,
output: stdout,
terminal: !1
});
rl.on("line", (line) => {
lines.push(line);
}), rl.once("close", () => {
let result = lines.join(node_os_1.EOL);
clearTimeout(timeout), debug("resolved from stdin", result), globalThis.oclif = { ...globalThis.oclif, stdinCache: result }, resolve(result);
}), signal.addEventListener("abort", () => {
debug("stdin aborted"), clearTimeout(timeout), rl.close(), resolve(null);
}, { once: !0 });
});
};
exports.readStdin = readStdin;
function isNegativeNumber(input) {
return /^-\d/g.test(input);
}
var validateOptions = (flag, input) => {
if (flag.options && !flag.options.includes(input))
throw new errors_1.FlagInvalidOptionError(flag, input);
return input;
}, NEGATION = "--no-", Parser = class {
input;
argv;
booleanFlags;
context;
currentFlag;
flagAliases;
raw = [];
constructor(input) {
this.input = input, this.context = input.context ?? {}, this.argv = [...input.argv], this._setNames(), this.booleanFlags = (0, util_1.pickBy)(input.flags, (f) => f.type === "boolean"), this.flagAliases = Object.fromEntries(Object.values(input.flags).flatMap((flag) => [...flag.aliases ?? [], ...flag.charAliases ?? []].map((a) => [a, flag])));
}
get _argTokens() {
return this.raw.filter((o) => o.type === "arg");
}
async parse() {
this._debugInput();
let parseFlag = async (arg) => {
let { isLong, name } = this.findFlag(arg);
if (!name) {
let i = arg.indexOf("=");
if (i !== -1) {
let sliced = arg.slice(i + 1);
this.argv.unshift(sliced);
let equalsParsed = await parseFlag(arg.slice(0, i));
return equalsParsed || this.argv.shift(), equalsParsed;
}
return !1;
}
let flag = this.input.flags[name];
if (flag.type === "option") {
if (!flag.multiple && this.raw.some((o) => o.type === "flag" && o.flag === name))
throw new errors_1.CLIError(`Flag --${name} can only be specified once`);
this.currentFlag = flag;
let input = isLong || arg.length < 3 ? this.argv.shift() : arg.slice(arg[2] === "=" ? 3 : 2);
if (flag.allowStdin === "only" && input !== "-" && input !== void 0 && !this.findFlag(input).name)
throw new errors_1.CLIError(`Flag --${name} can only be read from stdin. The value must be "-" or not provided at all.`);
if (flag.allowStdin && input === "-" || flag.allowStdin === "only") {
let stdin = await (0, exports.readStdin)();
stdin && (input = stdin.trim());
}
if (typeof input != "string" || this.findFlag(input).name)
throw flag.options ? new errors_1.CLIError(`Flag --${name} expects one of these values: ${flag.options.join(", ")}`) : new errors_1.CLIError(`Flag --${name} expects a value`);
this.raw.push({ flag: flag.name, input, type: "flag" });
} else
this.raw.push({ flag: flag.name, input: arg, type: "flag" }), !isLong && arg.length > 2 && this.argv.unshift(`-${arg.slice(2)}`);
return !0;
}, parsingFlags = !0, nonExistentFlags = [], dashdash = !1, originalArgv = [...this.argv];
for (; this.argv.length > 0; ) {
let input = this.argv.shift();
if (parsingFlags && input.startsWith("-") && input !== "-") {
if (this.input["--"] !== !1 && input === "--") {
parsingFlags = !1;
continue;
}
if (await parseFlag(input))
continue;
if (input === "--") {
dashdash = !0;
continue;
}
if (this.input["--"] !== !1 && !isNegativeNumber(input)) {
nonExistentFlags.push(input);
continue;
}
}
if (parsingFlags && this.currentFlag && this.currentFlag.multiple && !this.currentFlag.multipleNonGreedy) {
this.raw.push({ flag: this.currentFlag.name, input, type: "flag" });
continue;
}
let arg = Object.keys(this.input.args)[this._argTokens.length];
this.raw.push({ arg, input, type: "arg" });
}
let [{ args, argv }, { flags, metadata }] = await Promise.all([this._args(), this._flags()]);
this._debugOutput(argv, args, flags);
let unsortedArgv = dashdash ? [...argv, ...nonExistentFlags, "--"] : [...argv, ...nonExistentFlags];
return {
args,
argv: unsortedArgv.sort((a, b) => originalArgv.indexOf(a) - originalArgv.indexOf(b)),
flags,
metadata,
nonExistentFlags,
raw: this.raw
};
}
async _args() {
let argv = [], args = {}, tokens = this._argTokens, stdinRead = !1, ctx = this.context;
for (let [name, arg] of Object.entries(this.input.args)) {
let token = tokens.find((t) => t.arg === name);
if (ctx.token = token, token) {
if (arg.options && !arg.options.includes(token.input))
throw new errors_1.ArgInvalidOptionError(arg, token.input);
let parsed = await arg.parse(token.input, ctx, arg);
argv.push(parsed), args[token.arg] = parsed;
} else if (!arg.ignoreStdin && !stdinRead) {
let stdin = await (0, exports.readStdin)();
if (stdin) {
stdin = stdin.trim();
let parsed = await arg.parse(stdin, ctx, arg);
argv.push(parsed), args[name] = parsed;
}
stdinRead = !0;
}
if (!args[name] && (arg.default || arg.default === !1))
if (typeof arg.default == "function") {
let f = await arg.default();
argv.push(f), args[name] = f;
} else
argv.push(arg.default), args[name] = arg.default;
}
for (let token of tokens)
args[token.arg] === void 0 && argv.push(token.input);
return { args, argv };
}
_debugInput() {
debug("input: %s", this.argv.join(" "));
let args = Object.keys(this.input.args);
args.length > 0 && debug("available args: %s", args.join(" ")), Object.keys(this.input.flags).length !== 0 && debug("available flags: %s", Object.keys(this.input.flags).map((f) => `--${f}`).join(" "));
}
_debugOutput(args, flags, argv) {
argv.length > 0 && debug("argv: %o", argv), Object.keys(args).length > 0 && debug("args: %o", args), Object.keys(flags).length > 0 && debug("flags: %o", flags);
}
async _flags() {
let parseFlagOrThrowError = async (input, flag, context, token) => {
if (!flag.parse)
return input;
let ctx = {
...context,
error: context?.error,
exit: context?.exit,
jsonEnabled: context?.jsonEnabled,
log: context?.log,
logToStderr: context?.logToStderr,
token,
warn: context?.warn
};
try {
return flag.type === "boolean" ? await flag.parse(input, ctx, flag) : await flag.parse(input, ctx, flag);
} catch (error) {
throw error.message = `Parsing --${flag.name}
${error.message}
See more help with --help`, cache_1.default.getInstance().get("exitCodes")?.failedFlagParsing && (error.oclif = { exit: cache_1.default.getInstance().get("exitCodes")?.failedFlagParsing }), error;
}
}, addValueFunction = (fws) => {
if (fws.tokens?.length) {
if (fws.inputFlag.flag.type === "boolean" && (0, util_1.last)(fws.tokens)?.input) {
let doesNotContainNegation = (i) => {
let possibleNegations = [i.inputFlag.name, ...i.inputFlag.flag.aliases ?? []].map((n) => `${NEGATION}${n}`), input = (0, util_1.last)(i.tokens)?.input;
return input ? !possibleNegations.includes(input) : !0;
};
return {
...fws,
valueFunction: async (i) => parseFlagOrThrowError(doesNotContainNegation(i), i.inputFlag.flag, this.context, (0, util_1.last)(i.tokens))
};
}
if (fws.inputFlag.flag.type === "option" && fws.inputFlag.flag.delimiter && fws.inputFlag.flag.multiple) {
let makeDelimiter = (delimiter) => new RegExp(`(?<!\\\\)${delimiter}`);
return {
...fws,
valueFunction: async (i) => (await Promise.all((i.tokens ?? []).flatMap((token) => token.input.split(makeDelimiter(i.inputFlag.flag.delimiter ?? ","))).map((v) => v.trim().replaceAll(new RegExp(`\\\\${i.inputFlag.flag.delimiter}`, "g"), i.inputFlag.flag.delimiter ?? ",").replace(/^"(.*)"$/, "$1").replace(/^'(.*)'$/, "$1")).map(async (v) => parseFlagOrThrowError(v, i.inputFlag.flag, this.context, {
...(0, util_1.last)(i.tokens),
input: v
})))).map((v) => validateOptions(i.inputFlag.flag, v))
};
}
if (fws.inputFlag.flag.type === "option" && fws.inputFlag.flag.multiple)
return {
...fws,
valueFunction: async (i) => Promise.all((fws.tokens ?? []).map((token) => parseFlagOrThrowError(validateOptions(i.inputFlag.flag, token.input), i.inputFlag.flag, this.context, token)))
};
if (fws.inputFlag.flag.type === "option")
return {
...fws,
valueFunction: async (i) => parseFlagOrThrowError(validateOptions(i.inputFlag.flag, (0, util_1.last)(fws.tokens)?.input), i.inputFlag.flag, this.context, (0, util_1.last)(fws.tokens))
};
}
if (fws.inputFlag.flag.env && process.env[fws.inputFlag.flag.env]) {
let valueFromEnv = process.env[fws.inputFlag.flag.env];
if (fws.inputFlag.flag.type === "option" && valueFromEnv)
return {
...fws,
valueFunction: async (i) => parseFlagOrThrowError(validateOptions(i.inputFlag.flag, valueFromEnv), i.inputFlag.flag, this.context)
};
if (fws.inputFlag.flag.type === "boolean")
return {
...fws,
valueFunction: async (i) => (0, util_1.isTruthy)(process.env[i.inputFlag.flag.env] ?? "false")
};
}
return typeof fws.inputFlag.flag.default !== void 0 ? {
...fws,
metadata: { setFromDefault: !0 },
valueFunction: typeof fws.inputFlag.flag.default == "function" ? (i, allFlags = {}) => fws.inputFlag.flag.default({ flags: allFlags, options: i.inputFlag.flag }) : async () => fws.inputFlag.flag.default
} : fws;
}, addHelpFunction = (fws) => fws.inputFlag.flag.type === "option" && fws.inputFlag.flag.defaultHelp ? {
...fws,
helpFunction: typeof fws.inputFlag.flag.defaultHelp == "function" ? (i, flags, ...context) => (
// @ts-expect-error flag type isn't specific enough to know defaultHelp will definitely be there
i.inputFlag.flag.defaultHelp({ flags, options: i.inputFlag }, ...context)
) : (
// @ts-expect-error flag type isn't specific enough to know defaultHelp will definitely be there
(i) => i.inputFlag.flag.defaultHelp
)
} : fws, addDefaultHelp = async (fwsArray) => {
let valueReferenceForHelp = fwsArrayToObject(flagsWithAllValues.filter((fws) => !fws.metadata?.setFromDefault));
return Promise.all(fwsArray.map(async (fws) => {
try {
if (fws.helpFunction)
return {
...fws,
metadata: {
...fws.metadata,
defaultHelp: await fws.helpFunction?.(fws, valueReferenceForHelp, this.context)
}
};
} catch {
}
return fws;
}));
}, fwsArrayToObject = (fwsArray) => Object.fromEntries(fwsArray.filter((fws) => fws.value !== void 0).map((fws) => [fws.inputFlag.name, fws.value])), flagTokenMap = this.mapAndValidateFlags(), flagsWithValues = await Promise.all(Object.entries(this.input.flags).filter(([name, flag]) => flag.type === "boolean" || flag.env || flag.default !== void 0 || "defaultHelp" in flag || flagTokenMap.has(name)).map(([name, flag]) => ({ inputFlag: { flag, name }, tokens: flagTokenMap.get(name) })).map((fws) => addValueFunction(fws)).filter((fws) => fws.valueFunction !== void 0).map((fws) => addHelpFunction(fws)).map(async (fws) => fws.metadata?.setFromDefault ? fws : { ...fws, value: await fws.valueFunction?.(fws) })), valueReference = fwsArrayToObject(flagsWithValues.filter((fws) => !fws.metadata?.setFromDefault)), flagsWithAllValues = await Promise.all(flagsWithValues.map(async (fws) => fws.metadata?.setFromDefault ? { ...fws, value: await fws.valueFunction?.(fws, valueReference) } : fws)), finalFlags = flagsWithAllValues.some((fws) => typeof fws.helpFunction == "function") ? await addDefaultHelp(flagsWithAllValues) : flagsWithAllValues;
return {
flags: fwsArrayToObject(finalFlags),
metadata: {
flags: Object.fromEntries(finalFlags.filter((fws) => fws.metadata).map((fws) => [fws.inputFlag.name, fws.metadata]))
}
};
}
_setNames() {
for (let k of Object.keys(this.input.flags))
this.input.flags[k].name = k;
for (let k of Object.keys(this.input.args))
this.input.args[k].name = k;
}
findFlag(arg) {
let isLong = arg.startsWith("--"), short = isLong ? !1 : arg.startsWith("-"), name = isLong ? this.findLongFlag(arg) : short ? this.findShortFlag(arg) : void 0;
return { isLong, name };
}
findLongFlag(arg) {
let name = arg.slice(2);
if (this.input.flags[name])
return name;
if (this.flagAliases[name])
return this.flagAliases[name].name;
if (arg.startsWith(NEGATION)) {
let flag = this.booleanFlags[arg.slice(NEGATION.length)];
if (flag && flag.allowNo)
return flag.name;
let flagAlias = this.flagAliases[arg.slice(NEGATION.length)];
if (flagAlias && flagAlias.type === "boolean" && flagAlias.allowNo)
return flagAlias.name;
}
}
findShortFlag([_, char]) {
return this.flagAliases[char] ? this.flagAliases[char].name : Object.keys(this.input.flags).find((k) => this.input.flags[k].char === char && char !== void 0 && this.input.flags[k].char !== void 0);
}
mapAndValidateFlags() {
let flagTokenMap = /* @__PURE__ */ new Map();
for (let token of this.raw.filter((o) => o.type === "flag")) {
if (!(token.flag in this.input.flags))
throw new errors_1.CLIError(`Unexpected flag ${token.flag}`);
let existing = flagTokenMap.get(token.flag) ?? [];
flagTokenMap.set(token.flag, [...existing, token]);
}
return flagTokenMap;
}
};
exports.Parser = Parser;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/parser/validate.js
var require_validate = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/parser/validate.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.validate = validate;
var util_1 = require_util(), errors_1 = require_errors2();
async function validate(parse) {
let cachedResolvedFlags;
function validateArgs() {
if (parse.output.nonExistentFlags?.length > 0)
throw new errors_1.NonExistentFlagsError({
flags: parse.output.nonExistentFlags,
parse
});
let maxArgs = Object.keys(parse.input.args).length;
if (parse.input.strict && parse.output.argv.length > maxArgs) {
let extras = parse.output.argv.slice(maxArgs);
throw new errors_1.UnexpectedArgsError({
args: extras,
parse
});
}
let missingRequiredArgs = [], hasOptional = !1;
for (let [name, arg] of Object.entries(parse.input.args)) {
if (!arg.required)
hasOptional = !0;
else if (hasOptional)
throw new errors_1.InvalidArgsSpecError({
args: parse.input.args,
parse
});
arg.required && parse.output.args[name] === void 0 && missingRequiredArgs.push(arg);
}
if (missingRequiredArgs.length > 0) {
let flagsWithMultiple = Object.entries(parse.input.flags).filter(([_, flagDef]) => flagDef.type === "option" && !!flagDef.multiple).map(([name]) => name);
throw new errors_1.RequiredArgsError({
args: missingRequiredArgs,
flagsWithMultiple,
parse
});
}
}
async function validateFlags() {
let promises = Object.entries(parse.input.flags).flatMap(([name, flag]) => parse.output.flags[name] !== void 0 ? [
...flag.relationships ? validateRelationships(name, flag) : [],
...flag.dependsOn ? [validateDependsOn(name, flag.dependsOn)] : [],
...flag.exclusive ? [validateExclusive(name, flag.exclusive)] : [],
...flag.combinable ? [validateCombinable(name, flag.combinable)] : [],
...flag.exactlyOne ? [validateExactlyOne(name, flag.exactlyOne)] : []
] : flag.required ? [{ name, reason: `Missing required flag ${name}`, status: "failed", validationFn: "required" }] : flag.exactlyOne && flag.exactlyOne.length > 0 ? [validateExactlyOneAcrossFlags(flag)] : flag.atLeastOne && flag.atLeastOne.length > 0 ? [validateAtLeastOneAcrossFlags(flag)] : []), failed = (await Promise.all(promises)).filter((r) => r.status === "failed");
if (failed.length > 0)
throw new errors_1.FailedFlagValidationError({
failed,
parse
});
}
async function resolveFlags(flags) {
if (cachedResolvedFlags)
return cachedResolvedFlags;
let promises = flags.map(async (flag) => typeof flag == "string" ? [flag, parse.output.flags[flag]] : await flag.when(parse.output.flags) ? [flag.name, parse.output.flags[flag.name]] : null), resolved = await Promise.all(promises);
return cachedResolvedFlags = Object.fromEntries(resolved.filter((r) => r !== null)), cachedResolvedFlags;
}
let getPresentFlags = (flags) => Object.keys(flags).filter((key) => key !== void 0);
function validateExactlyOneAcrossFlags(flag) {
let base = { name: flag.name, validationFn: "validateExactlyOneAcrossFlags" };
if (Object.entries(parse.input.flags).map((entry) => entry[0]).filter((flagName) => parse.output.flags[flagName] !== void 0).filter((flagName) => flag.exactlyOne && flag.exactlyOne.includes(flagName)).length === 0) {
let reason = `Exactly one of the following must be provided: ${(0, util_1.uniq)(flag.exactlyOne?.map((flag2) => `--${flag2}`) ?? []).join(", ")}`;
return { ...base, reason, status: "failed" };
}
return { ...base, status: "success" };
}
function validateAtLeastOneAcrossFlags(flag) {
let base = { name: flag.name, validationFn: "validateAtLeastOneAcrossFlags" };
if (Object.entries(parse.input.flags).map((entry) => entry[0]).filter((flagName) => parse.output.flags[flagName] !== void 0).filter((flagName) => flag.atLeastOne && flag.atLeastOne.includes(flagName)).length === 0) {
let reason = `At least one of the following must be provided: ${(0, util_1.uniq)(flag.atLeastOne?.map((flag2) => `--${flag2}`) ?? []).join(", ")}`;
return { ...base, reason, status: "failed" };
}
return { ...base, status: "success" };
}
async function validateExclusive(name, flags) {
let base = { name, validationFn: "validateExclusive" }, resolved = await resolveFlags(flags), keys = getPresentFlags(resolved);
for (let flag of keys)
if (!(parse.output.metadata.flags && parse.output.metadata.flags[flag]?.setFromDefault) && !(parse.output.metadata.flags && parse.output.metadata.flags[name]?.setFromDefault) && parse.output.flags[flag] !== void 0) {
let flagValue = parse.output.metadata.flags?.[flag]?.defaultHelp ?? parse.output.flags[flag];
return {
...base,
reason: `--${flag}=${flagValue} cannot also be provided when using --${name}`,
status: "failed"
};
}
return { ...base, status: "success" };
}
async function validateCombinable(name, flags) {
let base = { name, validationFn: "validateCombinable" }, combinableFlags = new Set(flags.map((flag) => typeof flag == "string" ? flag : flag.name)), resolved = await resolveFlags(flags);
for (let flag of Object.keys(parse.output.flags))
if (!(parse.output.metadata.flags && parse.output.metadata.flags[flag]?.setFromDefault) && !(parse.output.metadata.flags && parse.output.metadata.flags[name]?.setFromDefault) && flag !== name && parse.output.flags[flag] !== void 0 && !combinableFlags.has(flag)) {
let formattedFlags = Object.keys(resolved).map((f) => `--${f}`).join(", ");
return {
...base,
reason: `Only the following can be provided when using --${name}: ${formattedFlags}`,
status: "failed"
};
}
return { ...base, status: "success" };
}
async function validateExactlyOne(name, flags) {
let base = { name, validationFn: "validateExactlyOne" }, resolved = await resolveFlags(flags), keys = getPresentFlags(resolved);
for (let flag of keys)
if (flag !== name && parse.output.flags[flag] !== void 0)
return { ...base, reason: `--${flag} cannot also be provided when using --${name}`, status: "failed" };
return { ...base, status: "success" };
}
async function validateDependsOn(name, flags) {
let base = { name, validationFn: "validateDependsOn" }, resolved = await resolveFlags(flags);
if (!Object.values(resolved).every((val) => val !== void 0)) {
let formattedFlags = Object.keys(resolved).map((f) => `--${f}`).join(", ");
return {
...base,
reason: `All of the following must be provided when using --${name}: ${formattedFlags}`,
status: "failed"
};
}
return { ...base, status: "success" };
}
async function validateSome(name, flags) {
let base = { name, validationFn: "validateSome" }, resolved = await resolveFlags(flags);
if (!Object.values(resolved).some(Boolean)) {
let formattedFlags = Object.keys(resolved).map((f) => `--${f}`).join(", ");
return {
...base,
reason: `One of the following must be provided when using --${name}: ${formattedFlags}`,
status: "failed"
};
}
return { ...base, status: "success" };
}
function validateRelationships(name, flag) {
return (flag.relationships ?? []).map((relationship) => {
switch (relationship.type) {
case "all":
return validateDependsOn(name, relationship.flags);
case "none":
return validateExclusive(name, relationship.flags);
case "only":
return validateCombinable(name, relationship.flags);
case "some":
return validateSome(name, relationship.flags);
default:
throw new Error(`Unknown relationship type: ${relationship.type}`);
}
});
}
return validateArgs(), validateFlags();
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/parser/help.js
var require_help2 = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/parser/help.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.flagUsage = flagUsage;
exports.flagUsages = flagUsages;
var util_1 = require_util(), ux_1 = require_ux();
function flagUsage(flag, options = {}) {
let label = [];
flag.helpLabel ? label.push(flag.helpLabel) : (flag.char && label.push(`-${flag.char}`), flag.name && label.push(` --${flag.name}`));
let usage = flag.type === "option" ? ` ${flag.name.toUpperCase()}` : "", description = flag.summary || flag.description || "";
return options.displayRequired && flag.required && (description = `(required) ${description}`), description = description ? (0, ux_1.colorize)("dim", description) : void 0, [` ${label.join(",").trim()}${usage}`, description];
}
function flagUsages(flags, options = {}) {
return flags.length === 0 ? [] : (0, util_1.sortBy)(flags, (f) => [f.char ? -1 : 1, f.char, f.name]).map((f) => flagUsage(f, options));
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/parser/index.js
var require_parser = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/parser/index.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.validate = exports.flagUsages = void 0;
exports.parse = parse;
var parse_1 = require_parse2(), validate_1 = require_validate(), help_1 = require_help2();
Object.defineProperty(exports, "flagUsages", { enumerable: !0, get: function() {
return help_1.flagUsages;
} });
var validate_2 = require_validate();
Object.defineProperty(exports, "validate", { enumerable: !0, get: function() {
return validate_2.validate;
} });
async function parse(argv, options) {
let input = {
"--": options["--"],
args: options.args ?? {},
argv,
context: options.context,
flags: options.flags ?? {},
strict: options.strict !== !1
}, output = await new parse_1.Parser(input).parse();
return await (0, validate_1.validate)({ input, output }), output;
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/command.js
var require_command2 = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/command.js"(exports) {
"use strict";
init_cjs_shims();
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
k2 === void 0 && (k2 = k);
var desc = Object.getOwnPropertyDescriptor(m, k);
(!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) && (desc = { enumerable: !0, get: function() {
return m[k];
} }), Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
k2 === void 0 && (k2 = k), o[k2] = m[k];
})), __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: !0, value: v });
}) : function(o, v) {
o.default = v;
}), __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() {
var ownKeys = function(o) {
return ownKeys = Object.getOwnPropertyNames || function(o2) {
var ar = [];
for (var k in o2) Object.prototype.hasOwnProperty.call(o2, k) && (ar[ar.length] = k);
return ar;
}, ownKeys(o);
};
return function(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) k[i] !== "default" && __createBinding(result, mod, k[i]);
return __setModuleDefault(result, mod), result;
};
})(), __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.Command = void 0;
var node_url_1 = __require("node:url"), node_util_1 = __require("node:util"), cache_1 = __importDefault(require_cache()), config_1 = require_config2(), Errors = __importStar(require_errors()), util_1 = require_util3(), logger_1 = require_logger(), Parser = __importStar(require_parser()), aggregate_flags_1 = require_aggregate_flags(), ids_1 = require_ids(), util_2 = require_util(), ux_1 = require_ux(), pjson = cache_1.default.getInstance().get("@oclif/core");
process.stdout.on("error", (err) => {
if (!(err && err.code === "EPIPE"))
throw err;
});
var Command = class {
argv;
config;
static _base = `${pjson.name}@${pjson.version}`;
/** An array of aliases for this command. */
static aliases = [];
/** An order-dependent object of arguments for the command */
static args = {};
static baseFlags;
/**
* Emit deprecation warning when a command alias is used
*/
static deprecateAliases;
static deprecationOptions;
/**
* A full description of how to use the command.
*
* If no summary, the first line of the description will be used as the summary.
*/
static description;
static enableJsonFlag = !1;
/**
* An array of examples to show at the end of the command's help.
*
* IF only a string is provided, it will try to look for a line that starts
* with the cmd.bin as the example command and the rest as the description.
* If found, the command will be formatted appropriately.
*
* ```
* EXAMPLES:
* A description of a particular use case.
*
* $ <%= config.bin => command flags
* ```
*/
static examples;
/** A hash of flags for the command */
static flags;
static hasDynamicHelp = !1;
static help;
/** Hide the command from help */
static hidden;
/** An array of aliases for this command that are hidden from help. */
static hiddenAliases = [];
/** A command ID, used mostly in error or verbose reporting. */
static id;
static plugin;
static pluginAlias;
static pluginName;
static pluginType;
/** Mark the command as a given state (e.g. beta or deprecated) in help */
static state;
/** When set to false, allows a variable amount of arguments */
static strict = !0;
/**
* The tweet-sized description for your class, used in a parent-commands
* sub-command listing and as the header for the command help.
*/
static summary;
/**
* An override string (or strings) for the default usage documentation.
*/
static usage;
debug;
id;
parsed = !1;
constructor(argv, config) {
this.argv = argv, this.config = config, this.id = this.ctor.id;
try {
this.debug = (0, logger_1.makeDebug)(this.id ? `${this.config.bin}:${this.id}` : this.config.bin);
} catch {
this.debug = () => {
};
}
}
/**
* instantiate and run the command
*
* @param {Command.Class} this - the command class
* @param {string[]} argv argv
* @param {LoadOptions} opts options
* @returns {Promise<unknown>} result
*/
static async run(argv, opts) {
argv || (argv = process.argv.slice(2)), typeof opts == "string" && opts.startsWith("file://") && (opts = (0, node_url_1.fileURLToPath)(opts));
let config = await config_1.Config.load(opts || __require.main?.filename || __dirname), cache = cache_1.default.getInstance();
cache.has("config") || cache.set("config", config);
let cmd = new this(argv, config);
if (!cmd.id) {
let id = cmd.constructor.name.toLowerCase();
cmd.id = id, cmd.ctor.id = id;
}
return cmd._run();
}
get ctor() {
return this.constructor;
}
async _run() {
let err, result;
try {
this.removeEnvVar("REDIRECTED"), await this.init(), result = await this.run();
} catch (error) {
err = error, await this.catch(error);
} finally {
await this.finally(err);
}
return result && this.jsonEnabled() && this.logJson(this.toSuccessJson(result)), !this.parsed && !(0, util_2.isProd)() && process.emitWarning(`Command ${this.id} did not parse its arguments. Did you forget to call 'this.parse'?`, {
code: "UnparsedCommand"
}), result;
}
async catch(err) {
if (process.exitCode = process.exitCode ?? err.exitCode ?? 1, this.jsonEnabled())
this.logJson(this.toErrorJson(err));
else {
if (!err.message)
throw err;
try {
ux_1.ux.action.stop(ux_1.ux.colorize("bold", ux_1.ux.colorize("red", "!")));
} catch {
}
throw err;
}
}
error(input, options = {}) {
return Errors.error(input, options);
}
exit(code = 0) {
Errors.exit(code);
}
async finally(_) {
}
async init() {
this.debug("init version: %s argv: %o", this.ctor._base, this.argv);
let g = globalThis;
g["http-call"] = g["http-call"] || {}, g["http-call"].userAgent = this.config.userAgent, this.warnIfCommandDeprecated();
}
/**
* Determine if the command is being run with the --json flag in a command that supports it.
*
* @returns {boolean} true if the command supports json and the --json flag is present
*/
jsonEnabled() {
if (!this.ctor?.enableJsonFlag)
return !1;
if (this.config.scopedEnvVar?.("CONTENT_TYPE")?.toLowerCase() === "json")
return !0;
let passThroughIndex = this.argv.indexOf("--"), jsonIndex = this.argv.indexOf("--json");
return passThroughIndex === -1 ? (
// If '--' is not present, then check for `--json` in this.argv
jsonIndex !== -1
) : (
// If '--' is present, return true only the --json flag exists and is before the '--'
jsonIndex !== -1 && jsonIndex < passThroughIndex
);
}
log(message = "", ...args) {
this.jsonEnabled() || (message = typeof message == "string" ? message : (0, node_util_1.inspect)(message), ux_1.ux.stdout(message, ...args));
}
logJson(json) {
ux_1.ux.stdout(ux_1.ux.colorizeJson(json, { pretty: !0, theme: this.config.theme?.json }));
}
logToStderr(message = "", ...args) {
this.jsonEnabled() || (message = typeof message == "string" ? message : (0, node_util_1.inspect)(message), ux_1.ux.stderr(message, ...args));
}
async parse(options, argv = this.argv) {
options || (options = this.ctor);
let opts = {
context: this,
...options,
flags: (0, aggregate_flags_1.aggregateFlags)(options.flags, options.baseFlags, options.enableJsonFlag)
}, hookResult = await this.config.runHook("preparse", { argv: [...argv], options: opts }), argvToParse = hookResult.successes?.length ? hookResult.successes.find((s) => s.plugin.root === cache_1.default.getInstance().get("rootPlugin")?.root)?.result ?? argv : argv;
this.argv = [...argvToParse];
let results = await Parser.parse(argvToParse, opts);
return this.warnIfFlagDeprecated(results.flags ?? {}), this.parsed = !0, results;
}
toErrorJson(err) {
return { error: err };
}
toSuccessJson(result) {
return result;
}
warn(input) {
return this.jsonEnabled() || Errors.warn(input), input;
}
warnIfCommandDeprecated() {
let [id] = (0, util_1.normalizeArgv)(this.config);
if (this.ctor.deprecateAliases && this.ctor.aliases.includes(id)) {
let cmdName = (0, ids_1.toConfiguredId)(this.ctor.id, this.config), aliasName = (0, ids_1.toConfiguredId)(id, this.config);
this.warn((0, util_1.formatCommandDeprecationWarning)(aliasName, { to: cmdName }));
}
if (this.ctor.state === "deprecated") {
let cmdName = (0, ids_1.toConfiguredId)(this.ctor.id, this.config);
this.warn((0, util_1.formatCommandDeprecationWarning)(cmdName, this.ctor.deprecationOptions));
}
}
warnIfFlagDeprecated(flags) {
let allFlags = (0, aggregate_flags_1.aggregateFlags)(this.ctor.flags, this.ctor.baseFlags, this.ctor.enableJsonFlag);
for (let flag of Object.keys(flags)) {
let flagDef = allFlags[flag], deprecated = flagDef?.deprecated;
if (deprecated && this.warn((0, util_1.formatFlagDeprecationWarning)(flag, deprecated)), flagDef?.deprecateAliases) {
let aliases = (0, util_2.uniq)([...flagDef?.aliases ?? [], ...flagDef?.charAliases ?? []]).map((a) => a.length === 1 ? `-${a}` : `--${a}`);
if (aliases.length === 0)
return;
let foundAliases = aliases.filter((alias) => this.argv.includes(alias));
for (let alias of foundAliases) {
let preferredUsage = `--${flagDef?.name}`;
flagDef?.char && (preferredUsage += ` | -${flagDef?.char}`), this.warn((0, util_1.formatFlagDeprecationWarning)(alias, { to: preferredUsage }));
}
}
}
}
removeEnvVar(envVar) {
let keys = [];
try {
keys.push(...this.config.scopedEnvVarKeys(envVar));
} catch {
keys.push(this.config.scopedEnvVarKey(envVar));
}
keys.map((key) => delete process.env[key]);
}
};
exports.Command = Command;
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/flush.js
var require_flush = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/flush.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.flush = flush;
var error_1 = require_error();
function timeout(p, ms) {
function wait(ms2, unref = !1) {
return new Promise((resolve) => {
let t = setTimeout(() => resolve(null), ms2);
unref && t.unref();
});
}
return Promise.race([p, wait(ms, !0).then(() => (0, error_1.error)("timed out"))]);
}
async function _flush() {
let p = new Promise((resolve) => {
process.stdout.once("drain", () => resolve(null));
});
if (!process.stdout.write(""))
return p;
}
async function flush(ms = 1e4) {
await timeout(_flush(), ms);
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/main.js
var require_main = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/main.js"(exports) {
"use strict";
init_cjs_shims();
var __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.versionAddition = exports.helpAddition = void 0;
exports.run = run;
var node_url_1 = __require("node:url"), cache_1 = __importDefault(require_cache()), config_1 = require_config2(), help_1 = require_help(), logger_1 = require_logger(), performance_1 = require_performance(), symbols_1 = require_symbols(), ux_1 = require_ux(), helpAddition = (argv, config) => {
if (argv.length === 0 && !config.isSingleCommandCLI)
return !0;
let mergedHelpFlags = (0, help_1.getHelpFlagAdditions)(config);
for (let arg of argv) {
if (mergedHelpFlags.includes(arg))
return !0;
if (arg === "--")
return !1;
}
return !1;
};
exports.helpAddition = helpAddition;
var versionAddition = (argv, config) => {
let additionalVersionFlags = config?.pjson.oclif.additionalVersionFlags ?? [];
return !![...(/* @__PURE__ */ new Set(["--version", ...additionalVersionFlags])).values()].includes(argv[0]);
};
exports.versionAddition = versionAddition;
async function run(argv, options) {
let marker = performance_1.Performance.mark(performance_1.OCLIF_MARKER_OWNER, "main.run"), initMarker = performance_1.Performance.mark(performance_1.OCLIF_MARKER_OWNER, "main.run#init"), showHelp = async (argv2) => {
let Help = await (0, help_1.loadHelpClass)(config);
await new Help(config, config.pjson.oclif.helpOptions ?? config.pjson.helpOptions).showHelp(argv2);
};
(0, logger_1.setLogger)(options);
let { debug } = (0, logger_1.getLogger)("main");
debug(`process.execPath: ${process.execPath}`), debug(`process.execArgv: ${process.execArgv}`), debug("process.argv: %O", process.argv), argv = argv ?? process.argv.slice(2), options && (typeof options == "string" && options.startsWith("file://") || options instanceof node_url_1.URL) && (options = (0, node_url_1.fileURLToPath)(options));
let config = await config_1.Config.load(options ?? __require.main?.filename ?? __dirname);
cache_1.default.getInstance().set("config", config), config.isSingleCommandCLI && (argv = [symbols_1.SINGLE_COMMAND_CLI_SYMBOL, ...argv]);
let [id, ...argvSlice] = (0, help_1.normalizeArgv)(config, argv), runFinally = async (cmd2, error) => {
marker?.stop(), initMarker?.stopped || initMarker?.stop(), await performance_1.Performance.collect(), performance_1.Performance.debug(), await config.runHook("finally", { argv: argvSlice, Command: cmd2, error, id });
};
if (await config.runHook("init", { argv: argvSlice, id }), (0, exports.versionAddition)(argv, config)) {
ux_1.ux.stdout(config.userAgent), await runFinally();
return;
}
if ((0, exports.helpAddition)(argv, config)) {
await showHelp(argv), await runFinally();
return;
}
let cmd = config.findCommand(id);
if (!cmd && (config.flexibleTaxonomy ? null : config.findTopic(id))) {
await showHelp([id]), await runFinally();
return;
}
initMarker?.stop();
let err;
try {
return await config.runCommand(id, argvSlice, cmd);
} catch (error) {
throw err = error, error;
} finally {
await runFinally(cmd, err);
}
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/execute.js
var require_execute = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/execute.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.execute = execute;
var errors_1 = require_errors(), handle_1 = require_handle(), flush_1 = require_flush(), main_1 = require_main(), settings_1 = require_settings();
async function execute(options) {
if (!options.dir && !options.loadOptions)
throw new errors_1.CLIError("dir or loadOptions is required.");
return options.development && (process.env.NODE_ENV = "development", settings_1.settings.debug = !0), (0, main_1.run)(options.args ?? process.argv.slice(2), options.loadOptions ?? options.dir).then(async (result) => ((0, flush_1.flush)(), result)).catch(async (error) => (0, handle_1.handle)(error));
}
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/interfaces/index.js
var require_interfaces = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/interfaces/index.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", { value: !0 });
}
});
// ../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/index.js
var require_lib = __commonJS({
"../../node_modules/.pnpm/@oclif+core@4.8.3/node_modules/@oclif/core/lib/index.js"(exports) {
init_cjs_shims();
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
k2 === void 0 && (k2 = k);
var desc = Object.getOwnPropertyDescriptor(m, k);
(!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) && (desc = { enumerable: !0, get: function() {
return m[k];
} }), Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
k2 === void 0 && (k2 = k), o[k2] = m[k];
})), __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: !0, value: v });
}) : function(o, v) {
o.default = v;
}), __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() {
var ownKeys = function(o) {
return ownKeys = Object.getOwnPropertyNames || function(o2) {
var ar = [];
for (var k in o2) Object.prototype.hasOwnProperty.call(o2, k) && (ar[ar.length] = k);
return ar;
}, ownKeys(o);
};
return function(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) k[i] !== "default" && __createBinding(result, mod, k[i]);
return __setModuleDefault(result, mod), result;
};
})();
Object.defineProperty(exports, "__esModule", { value: !0 });
exports.ux = exports.toStandardizedId = exports.toConfiguredId = exports.settings = exports.Performance = exports.Parser = exports.ModuleLoader = exports.getLogger = exports.Interfaces = exports.loadHelpClass = exports.HelpBase = exports.Help = exports.CommandHelp = exports.flush = exports.Flags = exports.execute = exports.handle = exports.Errors = exports.Plugin = exports.Config = exports.Command = exports.Args = void 0;
var util_1 = require_util();
function checkCWD() {
try {
process.cwd();
} catch (error) {
error.code === "ENOENT" && process.stderr.write(`WARNING: current directory does not exist
`);
}
}
function checkNodeVersion() {
if (!(process.env.OCLIF_DISABLE_ENGINE_WARNING && (0, util_1.isTruthy)(process.env.OCLIF_DISABLE_ENGINE_WARNING)))
try {
let path = __require("node:path"), semver = require_semver(), root = path.join(__dirname, ".."), pjson = __require(path.join(root, "package.json"));
semver.satisfies(process.versions.node, pjson.engines.node) || process.emitWarning(`Node version must be ${pjson.engines.node} to use this CLI. Current node version: ${process.versions.node}`);
} catch {
}
}
checkCWD();
checkNodeVersion();
exports.Args = __importStar(require_args());
var command_1 = require_command2();
Object.defineProperty(exports, "Command", { enumerable: !0, get: function() {
return command_1.Command;
} });
var config_1 = require_config2();
Object.defineProperty(exports, "Config", { enumerable: !0, get: function() {
return config_1.Config;
} });
Object.defineProperty(exports, "Plugin", { enumerable: !0, get: function() {
return config_1.Plugin;
} });
exports.Errors = __importStar(require_errors());
var handle_1 = require_handle();
Object.defineProperty(exports, "handle", { enumerable: !0, get: function() {
return handle_1.handle;
} });
var execute_1 = require_execute();
Object.defineProperty(exports, "execute", { enumerable: !0, get: function() {
return execute_1.execute;
} });
exports.Flags = __importStar(require_flags());
var flush_1 = require_flush();
Object.defineProperty(exports, "flush", { enumerable: !0, get: function() {
return flush_1.flush;
} });
var help_1 = require_help();
Object.defineProperty(exports, "CommandHelp", { enumerable: !0, get: function() {
return help_1.CommandHelp;
} });
Object.defineProperty(exports, "Help", { enumerable: !0, get: function() {
return help_1.Help;
} });
Object.defineProperty(exports, "HelpBase", { enumerable: !0, get: function() {
return help_1.HelpBase;
} });
Object.defineProperty(exports, "loadHelpClass", { enumerable: !0, get: function() {
return help_1.loadHelpClass;
} });
exports.Interfaces = __importStar(require_interfaces());
var logger_1 = require_logger();
Object.defineProperty(exports, "getLogger", { enumerable: !0, get: function() {
return logger_1.getLogger;
} });
var main_1 = require_main();
Object.defineProperty(exports, "run", { enumerable: !0, get: function() {
return main_1.run;
} });
exports.ModuleLoader = __importStar(require_module_loader());
exports.Parser = __importStar(require_parser());
var performance_1 = require_performance();
Object.defineProperty(exports, "Performance", { enumerable: !0, get: function() {
return performance_1.Performance;
} });
var settings_1 = require_settings();
Object.defineProperty(exports, "settings", { enumerable: !0, get: function() {
return settings_1.settings;
} });
var ids_1 = require_ids();
Object.defineProperty(exports, "toConfiguredId", { enumerable: !0, get: function() {
return ids_1.toConfiguredId;
} });
Object.defineProperty(exports, "toStandardizedId", { enumerable: !0, get: function() {
return ids_1.toStandardizedId;
} });
var ux_1 = require_ux();
Object.defineProperty(exports, "ux", { enumerable: !0, get: function() {
return ux_1.ux;
} });
}
});
export {
require_ansi_styles,
require_commonjs3 as require_commonjs,
require_lib
};
/*! Bundled license information:
ejs/lib/ejs.js:
(**
* @file Embedded JavaScript templating engine. {@link http://ejs.co}
* @author Matthew Eernisse <mde@fleegix.org>
* @author Tiancheng "Timothy" Gu <timothygu99@gmail.com>
* @project EJS
* @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0}
*)
*/
//# sourceMappingURL=chunk-E43EDJOG.js.map