storybook
Version:
Storybook: Develop, document, and test UI components in isolation
1,244 lines (1,224 loc) • 864 kB
JavaScript
import CJS_COMPAT_NODE_URL_yr66iw5gef from 'node:url';
import CJS_COMPAT_NODE_PATH_yr66iw5gef from 'node:path';
import CJS_COMPAT_NODE_MODULE_yr66iw5gef from "node:module";
var __filename = CJS_COMPAT_NODE_URL_yr66iw5gef.fileURLToPath(import.meta.url);
var __dirname = CJS_COMPAT_NODE_PATH_yr66iw5gef.dirname(__filename);
var require = CJS_COMPAT_NODE_MODULE_yr66iw5gef.createRequire(import.meta.url);
// ------------------------------------------------------------
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
// ------------------------------------------------------------
import {
versions_default
} from "./chunk-4FAPWW5I.js";
import {
require_picomatch
} from "./chunk-4X3VTYIW.js";
import {
logger
} from "./chunk-VUIYVJKC.js";
import {
any,
from,
invariant,
up,
up2
} from "./chunk-2IIRK2OT.js";
import {
importModule,
resolveModulePath,
resolvePackageDir,
safeResolveModule
} from "./chunk-Q6B5LJGA.js";
import {
join,
parse,
resolve
} from "./chunk-VBZIULNK.js";
import {
glob,
globSync
} from "./chunk-F2RDEFFH.js";
import {
slash
} from "./chunk-GVOXGNOU.js";
import {
require_dist
} from "./chunk-76KIYDRU.js";
import {
require_picocolors
} from "./chunk-RZ2YFNVH.js";
import {
__commonJS,
__esm,
__export,
__require,
__toCommonJS,
__toESM
} from "./chunk-J4VC4I2M.js";
// ../node_modules/resolve/lib/homedir.js
var require_homedir = __commonJS({
"../node_modules/resolve/lib/homedir.js"(exports, module) {
"use strict";
var os3 = __require("os");
module.exports = os3.homedir || function() {
var home = process.env.HOME, user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME;
return process.platform === "win32" ? process.env.USERPROFILE || process.env.HOMEDRIVE + process.env.HOMEPATH || home || null : process.platform === "darwin" ? home || (user ? "/Users/" + user : null) : process.platform === "linux" ? home || (process.getuid() === 0 ? "/root" : user ? "/home/" + user : null) : home || null;
};
}
});
// ../node_modules/resolve/lib/caller.js
var require_caller = __commonJS({
"../node_modules/resolve/lib/caller.js"(exports, module) {
module.exports = function() {
var origPrepareStackTrace = Error.prepareStackTrace;
Error.prepareStackTrace = function(_, stack2) {
return stack2;
};
var stack = new Error().stack;
return Error.prepareStackTrace = origPrepareStackTrace, stack[2].getFileName();
};
}
});
// ../node_modules/path-parse/index.js
var require_path_parse = __commonJS({
"../node_modules/path-parse/index.js"(exports, module) {
"use strict";
var isWindows = process.platform === "win32", splitWindowsRe = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/, win32 = {};
function win32SplitPath(filename) {
return splitWindowsRe.exec(filename).slice(1);
}
win32.parse = function(pathString) {
if (typeof pathString != "string")
throw new TypeError(
"Parameter 'pathString' must be a string, not " + typeof pathString
);
var allParts = win32SplitPath(pathString);
if (!allParts || allParts.length !== 5)
throw new TypeError("Invalid path '" + pathString + "'");
return {
root: allParts[1],
dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1),
base: allParts[2],
ext: allParts[4],
name: allParts[3]
};
};
var splitPathRe = /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/, posix5 = {};
function posixSplitPath(filename) {
return splitPathRe.exec(filename).slice(1);
}
posix5.parse = function(pathString) {
if (typeof pathString != "string")
throw new TypeError(
"Parameter 'pathString' must be a string, not " + typeof pathString
);
var allParts = posixSplitPath(pathString);
if (!allParts || allParts.length !== 5)
throw new TypeError("Invalid path '" + pathString + "'");
return {
root: allParts[1],
dir: allParts[0].slice(0, -1),
base: allParts[2],
ext: allParts[4],
name: allParts[3]
};
};
isWindows ? module.exports = win32.parse : module.exports = posix5.parse;
module.exports.posix = posix5.parse;
module.exports.win32 = win32.parse;
}
});
// ../node_modules/resolve/lib/node-modules-paths.js
var require_node_modules_paths = __commonJS({
"../node_modules/resolve/lib/node-modules-paths.js"(exports, module) {
var path4 = __require("path"), parse4 = path4.parse || require_path_parse(), driveLetterRegex = /^([A-Za-z]:)/, uncPathRegex = /^\\\\/, getNodeModulesDirs = function(absoluteStart, modules) {
var prefix = "/";
driveLetterRegex.test(absoluteStart) ? prefix = "" : uncPathRegex.test(absoluteStart) && (prefix = "\\\\");
for (var paths = [absoluteStart], parsed = parse4(absoluteStart); parsed.dir !== paths[paths.length - 1]; )
paths.push(parsed.dir), parsed = parse4(parsed.dir);
return paths.reduce(function(dirs, aPath) {
return dirs.concat(modules.map(function(moduleDir) {
return path4.resolve(prefix, aPath, moduleDir);
}));
}, []);
};
module.exports = function(start, opts, request) {
var modules = opts && opts.moduleDirectory ? [].concat(opts.moduleDirectory) : ["node_modules"];
if (opts && typeof opts.paths == "function")
return opts.paths(
request,
start,
function() {
return getNodeModulesDirs(start, modules);
},
opts
);
var dirs = getNodeModulesDirs(start, modules);
return opts && opts.paths ? dirs.concat(opts.paths) : dirs;
};
}
});
// ../node_modules/resolve/lib/normalize-options.js
var require_normalize_options = __commonJS({
"../node_modules/resolve/lib/normalize-options.js"(exports, module) {
var path4 = __require("path");
module.exports = function(_, opts) {
if (opts = opts || {}, opts.forceNodeResolution || !process.versions.pnp)
return opts;
let { findPnpApi } = __require("module"), runPnpResolution = (request, basedir) => {
let parts = request.match(/^((?:@[^/]+\/)?[^/]+)(\/.*)?/);
if (!parts)
throw new Error(`Assertion failed: Expected the "resolve" package to call the "paths" callback with package names only (got "${request}")`);
basedir.charAt(basedir.length - 1) !== "/" && (basedir = path4.join(basedir, "/"));
let api = findPnpApi(basedir);
if (api === null)
return;
let manifestPath;
try {
manifestPath = api.resolveToUnqualified(`${parts[1]}/package.json`, basedir, { considerBuiltins: !1 });
} catch {
return null;
}
if (manifestPath === null)
throw new Error(`Assertion failed: The resolution thinks that "${parts[1]}" is a Node builtin`);
let packagePath = path4.dirname(manifestPath), unqualifiedPath = typeof parts[2] < "u" ? path4.join(packagePath, parts[2]) : packagePath;
return { packagePath, unqualifiedPath };
}, runPnpResolutionOnArray = (request, paths2) => {
for (let i = 0; i < paths2.length; i++) {
let resolution = runPnpResolution(request, paths2[i]);
if (resolution || i === paths2.length - 1)
return resolution;
}
return null;
}, originalPaths = Array.isArray(opts.paths) ? opts.paths : [], packageIterator = (request, basedir, getCandidates, opts2) => {
let pathsToTest = [basedir].concat(originalPaths), resolution = runPnpResolutionOnArray(request, pathsToTest);
return resolution == null ? getCandidates() : [resolution.unqualifiedPath];
}, paths = (request, basedir, getNodeModulePaths, opts2) => {
let pathsToTest = [basedir].concat(originalPaths), resolution = runPnpResolutionOnArray(request, pathsToTest);
if (resolution == null)
return getNodeModulePaths().concat(originalPaths);
let nodeModules = path4.dirname(resolution.packagePath);
return request.match(/^@[^/]+\//) && (nodeModules = path4.dirname(nodeModules)), [nodeModules];
}, isInsideIterator = !1;
return opts.__skipPackageIterator || (opts.packageIterator = function(request, basedir, getCandidates, opts2) {
isInsideIterator = !0;
try {
return packageIterator(request, basedir, getCandidates, opts2);
} finally {
isInsideIterator = !1;
}
}), opts.paths = function(request, basedir, getNodeModulePaths, opts2) {
return isInsideIterator ? getNodeModulePaths().concat(originalPaths) : paths(request, basedir, getNodeModulePaths, opts2);
}, opts;
};
}
});
// ../node_modules/function-bind/implementation.js
var require_implementation = __commonJS({
"../node_modules/function-bind/implementation.js"(exports, module) {
"use strict";
var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ", toStr = Object.prototype.toString, max = Math.max, funcType = "[object Function]", concatty = function(a, b) {
for (var arr = [], i = 0; i < a.length; i += 1)
arr[i] = a[i];
for (var j = 0; j < b.length; j += 1)
arr[j + a.length] = b[j];
return arr;
}, slicy = function(arrLike, offset) {
for (var arr = [], i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1)
arr[j] = arrLike[i];
return arr;
}, joiny = function(arr, joiner) {
for (var str = "", i = 0; i < arr.length; i += 1)
str += arr[i], i + 1 < arr.length && (str += joiner);
return str;
};
module.exports = function(that) {
var target = this;
if (typeof target != "function" || toStr.apply(target) !== funcType)
throw new TypeError(ERROR_MESSAGE + target);
for (var args = slicy(arguments, 1), bound, binder = function() {
if (this instanceof bound) {
var result = target.apply(
this,
concatty(args, arguments)
);
return Object(result) === result ? result : this;
}
return target.apply(
that,
concatty(args, arguments)
);
}, boundLength = max(0, target.length - args.length), boundArgs = [], i = 0; i < boundLength; i++)
boundArgs[i] = "$" + i;
if (bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder), target.prototype) {
var Empty = function() {
};
Empty.prototype = target.prototype, bound.prototype = new Empty(), Empty.prototype = null;
}
return bound;
};
}
});
// ../node_modules/function-bind/index.js
var require_function_bind = __commonJS({
"../node_modules/function-bind/index.js"(exports, module) {
"use strict";
var implementation = require_implementation();
module.exports = Function.prototype.bind || implementation;
}
});
// ../node_modules/hasown/index.js
var require_hasown = __commonJS({
"../node_modules/hasown/index.js"(exports, module) {
"use strict";
var call = Function.prototype.call, $hasOwn = Object.prototype.hasOwnProperty, bind = require_function_bind();
module.exports = bind.call(call, $hasOwn);
}
});
// ../node_modules/is-core-module/core.json
var require_core = __commonJS({
"../node_modules/is-core-module/core.json"(exports, module) {
module.exports = {
assert: !0,
"node:assert": [">= 14.18 && < 15", ">= 16"],
"assert/strict": ">= 15",
"node:assert/strict": ">= 16",
async_hooks: ">= 8",
"node:async_hooks": [">= 14.18 && < 15", ">= 16"],
buffer_ieee754: ">= 0.5 && < 0.9.7",
buffer: !0,
"node:buffer": [">= 14.18 && < 15", ">= 16"],
child_process: !0,
"node:child_process": [">= 14.18 && < 15", ">= 16"],
cluster: ">= 0.5",
"node:cluster": [">= 14.18 && < 15", ">= 16"],
console: !0,
"node:console": [">= 14.18 && < 15", ">= 16"],
constants: !0,
"node:constants": [">= 14.18 && < 15", ">= 16"],
crypto: !0,
"node:crypto": [">= 14.18 && < 15", ">= 16"],
_debug_agent: ">= 1 && < 8",
_debugger: "< 8",
dgram: !0,
"node:dgram": [">= 14.18 && < 15", ">= 16"],
diagnostics_channel: [">= 14.17 && < 15", ">= 15.1"],
"node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"],
dns: !0,
"node:dns": [">= 14.18 && < 15", ">= 16"],
"dns/promises": ">= 15",
"node:dns/promises": ">= 16",
domain: ">= 0.7.12",
"node:domain": [">= 14.18 && < 15", ">= 16"],
events: !0,
"node:events": [">= 14.18 && < 15", ">= 16"],
freelist: "< 6",
fs: !0,
"node:fs": [">= 14.18 && < 15", ">= 16"],
"fs/promises": [">= 10 && < 10.1", ">= 14"],
"node:fs/promises": [">= 14.18 && < 15", ">= 16"],
_http_agent: ">= 0.11.1",
"node:_http_agent": [">= 14.18 && < 15", ">= 16"],
_http_client: ">= 0.11.1",
"node:_http_client": [">= 14.18 && < 15", ">= 16"],
_http_common: ">= 0.11.1",
"node:_http_common": [">= 14.18 && < 15", ">= 16"],
_http_incoming: ">= 0.11.1",
"node:_http_incoming": [">= 14.18 && < 15", ">= 16"],
_http_outgoing: ">= 0.11.1",
"node:_http_outgoing": [">= 14.18 && < 15", ">= 16"],
_http_server: ">= 0.11.1",
"node:_http_server": [">= 14.18 && < 15", ">= 16"],
http: !0,
"node:http": [">= 14.18 && < 15", ">= 16"],
http2: ">= 8.8",
"node:http2": [">= 14.18 && < 15", ">= 16"],
https: !0,
"node:https": [">= 14.18 && < 15", ">= 16"],
inspector: ">= 8",
"node:inspector": [">= 14.18 && < 15", ">= 16"],
"inspector/promises": [">= 19"],
"node:inspector/promises": [">= 19"],
_linklist: "< 8",
module: !0,
"node:module": [">= 14.18 && < 15", ">= 16"],
net: !0,
"node:net": [">= 14.18 && < 15", ">= 16"],
"node-inspect/lib/_inspect": ">= 7.6 && < 12",
"node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12",
"node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12",
os: !0,
"node:os": [">= 14.18 && < 15", ">= 16"],
path: !0,
"node:path": [">= 14.18 && < 15", ">= 16"],
"path/posix": ">= 15.3",
"node:path/posix": ">= 16",
"path/win32": ">= 15.3",
"node:path/win32": ">= 16",
perf_hooks: ">= 8.5",
"node:perf_hooks": [">= 14.18 && < 15", ">= 16"],
process: ">= 1",
"node:process": [">= 14.18 && < 15", ">= 16"],
punycode: ">= 0.5",
"node:punycode": [">= 14.18 && < 15", ">= 16"],
querystring: !0,
"node:querystring": [">= 14.18 && < 15", ">= 16"],
readline: !0,
"node:readline": [">= 14.18 && < 15", ">= 16"],
"readline/promises": ">= 17",
"node:readline/promises": ">= 17",
repl: !0,
"node:repl": [">= 14.18 && < 15", ">= 16"],
"node:sea": [">= 20.12 && < 21", ">= 21.7"],
smalloc: ">= 0.11.5 && < 3",
"node:sqlite": [">= 22.13 && < 23", ">= 23.4"],
_stream_duplex: ">= 0.9.4",
"node:_stream_duplex": [">= 14.18 && < 15", ">= 16"],
_stream_transform: ">= 0.9.4",
"node:_stream_transform": [">= 14.18 && < 15", ">= 16"],
_stream_wrap: ">= 1.4.1",
"node:_stream_wrap": [">= 14.18 && < 15", ">= 16"],
_stream_passthrough: ">= 0.9.4",
"node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"],
_stream_readable: ">= 0.9.4",
"node:_stream_readable": [">= 14.18 && < 15", ">= 16"],
_stream_writable: ">= 0.9.4",
"node:_stream_writable": [">= 14.18 && < 15", ">= 16"],
stream: !0,
"node:stream": [">= 14.18 && < 15", ">= 16"],
"stream/consumers": ">= 16.7",
"node:stream/consumers": ">= 16.7",
"stream/promises": ">= 15",
"node:stream/promises": ">= 16",
"stream/web": ">= 16.5",
"node:stream/web": ">= 16.5",
string_decoder: !0,
"node:string_decoder": [">= 14.18 && < 15", ">= 16"],
sys: [">= 0.4 && < 0.7", ">= 0.8"],
"node:sys": [">= 14.18 && < 15", ">= 16"],
"test/reporters": ">= 19.9 && < 20.2",
"node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"],
"test/mock_loader": ">= 22.3 && < 22.7",
"node:test/mock_loader": ">= 22.3 && < 22.7",
"node:test": [">= 16.17 && < 17", ">= 18"],
timers: !0,
"node:timers": [">= 14.18 && < 15", ">= 16"],
"timers/promises": ">= 15",
"node:timers/promises": ">= 16",
_tls_common: ">= 0.11.13",
"node:_tls_common": [">= 14.18 && < 15", ">= 16"],
_tls_legacy: ">= 0.11.3 && < 10",
_tls_wrap: ">= 0.11.3",
"node:_tls_wrap": [">= 14.18 && < 15", ">= 16"],
tls: !0,
"node:tls": [">= 14.18 && < 15", ">= 16"],
trace_events: ">= 10",
"node:trace_events": [">= 14.18 && < 15", ">= 16"],
tty: !0,
"node:tty": [">= 14.18 && < 15", ">= 16"],
url: !0,
"node:url": [">= 14.18 && < 15", ">= 16"],
util: !0,
"node:util": [">= 14.18 && < 15", ">= 16"],
"util/types": ">= 15.3",
"node:util/types": ">= 16",
"v8/tools/arguments": ">= 10 && < 12",
"v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"],
"v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"],
"v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"],
"v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"],
"v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"],
"v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"],
v8: ">= 1",
"node:v8": [">= 14.18 && < 15", ">= 16"],
vm: !0,
"node:vm": [">= 14.18 && < 15", ">= 16"],
wasi: [">= 13.4 && < 13.5", ">= 18.17 && < 19", ">= 20"],
"node:wasi": [">= 18.17 && < 19", ">= 20"],
worker_threads: ">= 11.7",
"node:worker_threads": [">= 14.18 && < 15", ">= 16"],
zlib: ">= 0.5",
"node:zlib": [">= 14.18 && < 15", ">= 16"]
};
}
});
// ../node_modules/is-core-module/index.js
var require_is_core_module = __commonJS({
"../node_modules/is-core-module/index.js"(exports, module) {
"use strict";
var hasOwn = require_hasown();
function specifierIncluded(current, specifier) {
for (var nodeParts = current.split("."), parts = specifier.split(" "), op = parts.length > 1 ? parts[0] : "=", versionParts = (parts.length > 1 ? parts[1] : parts[0]).split("."), i = 0; i < 3; ++i) {
var cur = parseInt(nodeParts[i] || 0, 10), ver = parseInt(versionParts[i] || 0, 10);
if (cur !== ver)
return op === "<" ? cur < ver : op === ">=" ? cur >= ver : !1;
}
return op === ">=";
}
function matchesRange(current, range) {
var specifiers = range.split(/ ?&& ?/);
if (specifiers.length === 0)
return !1;
for (var i = 0; i < specifiers.length; ++i)
if (!specifierIncluded(current, specifiers[i]))
return !1;
return !0;
}
function versionIncluded(nodeVersion, specifierValue) {
if (typeof specifierValue == "boolean")
return specifierValue;
var current = typeof nodeVersion > "u" ? process.versions && process.versions.node : nodeVersion;
if (typeof current != "string")
throw new TypeError(typeof nodeVersion > "u" ? "Unable to determine current node version" : "If provided, a valid node version is required");
if (specifierValue && typeof specifierValue == "object") {
for (var i = 0; i < specifierValue.length; ++i)
if (matchesRange(current, specifierValue[i]))
return !0;
return !1;
}
return matchesRange(current, specifierValue);
}
var data = require_core();
module.exports = function(x, nodeVersion) {
return hasOwn(data, x) && versionIncluded(nodeVersion, data[x]);
};
}
});
// ../node_modules/resolve/lib/async.js
var require_async = __commonJS({
"../node_modules/resolve/lib/async.js"(exports, module) {
var fs = __require("fs"), getHomedir = require_homedir(), path4 = __require("path"), caller = require_caller(), nodeModulesPaths = require_node_modules_paths(), normalizeOptions = require_normalize_options(), isCore = require_is_core_module(), realpathFS = process.platform !== "win32" && fs.realpath && typeof fs.realpath.native == "function" ? fs.realpath.native : fs.realpath, relativePathRegex = /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/, windowsDriveRegex = /^\w:[/\\]*$/, nodeModulesRegex = /[/\\]node_modules[/\\]*$/, homedir = getHomedir(), defaultPaths = function() {
return [
path4.join(homedir, ".node_modules"),
path4.join(homedir, ".node_libraries")
];
}, defaultIsFile = function(file, cb) {
fs.stat(file, function(err, stat) {
return err ? err.code === "ENOENT" || err.code === "ENOTDIR" ? cb(null, !1) : cb(err) : cb(null, stat.isFile() || stat.isFIFO());
});
}, defaultIsDir = function(dir, cb) {
fs.stat(dir, function(err, stat) {
return err ? err.code === "ENOENT" || err.code === "ENOTDIR" ? cb(null, !1) : cb(err) : cb(null, stat.isDirectory());
});
}, defaultRealpath = function(x, cb) {
realpathFS(x, function(realpathErr, realPath) {
realpathErr && realpathErr.code !== "ENOENT" ? cb(realpathErr) : cb(null, realpathErr ? x : realPath);
});
}, maybeRealpath = function(realpath2, x, opts, cb) {
opts && opts.preserveSymlinks === !1 ? realpath2(x, cb) : cb(null, x);
}, defaultReadPackage = function(readFile7, pkgfile, cb) {
readFile7(pkgfile, function(readFileErr, body) {
if (readFileErr) cb(readFileErr);
else
try {
var pkg = JSON.parse(body);
cb(null, pkg);
} catch {
cb(null);
}
});
}, getPackageCandidates = function(x, start, opts) {
for (var dirs = nodeModulesPaths(start, opts, x), i = 0; i < dirs.length; i++)
dirs[i] = path4.join(dirs[i], x);
return dirs;
};
module.exports = function(x, options, callback2) {
var cb = callback2, opts = options;
if (typeof options == "function" && (cb = opts, opts = {}), typeof x != "string") {
var err = new TypeError("Path must be a string.");
return process.nextTick(function() {
cb(err);
});
}
opts = normalizeOptions(x, opts);
var isFile = opts.isFile || defaultIsFile, isDirectory2 = opts.isDirectory || defaultIsDir, readFile7 = opts.readFile || fs.readFile, realpath2 = opts.realpath || defaultRealpath, readPackage = opts.readPackage || defaultReadPackage;
if (opts.readFile && opts.readPackage) {
var conflictErr = new TypeError("`readFile` and `readPackage` are mutually exclusive.");
return process.nextTick(function() {
cb(conflictErr);
});
}
var packageIterator = opts.packageIterator, extensions = opts.extensions || [".js"], includeCoreModules = opts.includeCoreModules !== !1, basedir = opts.basedir || path4.dirname(caller()), parent = opts.filename || basedir;
opts.paths = opts.paths || defaultPaths();
var absoluteStart = path4.resolve(basedir);
maybeRealpath(
realpath2,
absoluteStart,
opts,
function(err2, realStart) {
err2 ? cb(err2) : init(realStart);
}
);
var res;
function init(basedir2) {
if (relativePathRegex.test(x))
res = path4.resolve(basedir2, x), (x === "." || x === ".." || x.slice(-1) === "/") && (res += "/"), x.slice(-1) === "/" && res === basedir2 ? loadAsDirectory(res, opts.package, onfile) : loadAsFile(res, opts.package, onfile);
else {
if (includeCoreModules && isCore(x))
return cb(null, x);
loadNodeModules(x, basedir2, function(err2, n, pkg) {
if (err2) cb(err2);
else {
if (n)
return maybeRealpath(realpath2, n, opts, function(err3, realN) {
err3 ? cb(err3) : cb(null, realN, pkg);
});
var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
moduleError.code = "MODULE_NOT_FOUND", cb(moduleError);
}
});
}
}
function onfile(err2, m, pkg) {
err2 ? cb(err2) : m ? cb(null, m, pkg) : loadAsDirectory(res, function(err3, d, pkg2) {
if (err3) cb(err3);
else if (d)
maybeRealpath(realpath2, d, opts, function(err4, realD) {
err4 ? cb(err4) : cb(null, realD, pkg2);
});
else {
var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
moduleError.code = "MODULE_NOT_FOUND", cb(moduleError);
}
});
}
function loadAsFile(x2, thePackage, callback3) {
var loadAsFilePackage = thePackage, cb2 = callback3;
typeof loadAsFilePackage == "function" && (cb2 = loadAsFilePackage, loadAsFilePackage = void 0);
var exts = [""].concat(extensions);
load2(exts, x2, loadAsFilePackage);
function load2(exts2, x3, loadPackage) {
if (exts2.length === 0) return cb2(null, void 0, loadPackage);
var file = x3 + exts2[0], pkg = loadPackage;
pkg ? onpkg(null, pkg) : loadpkg(path4.dirname(file), onpkg);
function onpkg(err2, pkg_, dir) {
if (pkg = pkg_, err2) return cb2(err2);
if (dir && pkg && opts.pathFilter) {
var rfile = path4.relative(dir, file), rel = rfile.slice(0, rfile.length - exts2[0].length), r = opts.pathFilter(pkg, x3, rel);
if (r) return load2(
[""].concat(extensions.slice()),
path4.resolve(dir, r),
pkg
);
}
isFile(file, onex);
}
function onex(err2, ex) {
if (err2) return cb2(err2);
if (ex) return cb2(null, file, pkg);
load2(exts2.slice(1), x3, pkg);
}
}
}
function loadpkg(dir, cb2) {
if (dir === "" || dir === "/" || process.platform === "win32" && windowsDriveRegex.test(dir) || nodeModulesRegex.test(dir)) return cb2(null);
maybeRealpath(realpath2, dir, opts, function(unwrapErr, pkgdir) {
if (unwrapErr) return loadpkg(path4.dirname(dir), cb2);
var pkgfile = path4.join(pkgdir, "package.json");
isFile(pkgfile, function(err2, ex) {
if (!ex) return loadpkg(path4.dirname(dir), cb2);
readPackage(readFile7, pkgfile, function(err3, pkgParam) {
err3 && cb2(err3);
var pkg = pkgParam;
pkg && opts.packageFilter && (pkg = opts.packageFilter(pkg, pkgfile)), cb2(null, pkg, dir);
});
});
});
}
function loadAsDirectory(x2, loadAsDirectoryPackage, callback3) {
var cb2 = callback3, fpkg = loadAsDirectoryPackage;
typeof fpkg == "function" && (cb2 = fpkg, fpkg = opts.package), maybeRealpath(realpath2, x2, opts, function(unwrapErr, pkgdir) {
if (unwrapErr) return cb2(unwrapErr);
var pkgfile = path4.join(pkgdir, "package.json");
isFile(pkgfile, function(err2, ex) {
if (err2) return cb2(err2);
if (!ex) return loadAsFile(path4.join(x2, "index"), fpkg, cb2);
readPackage(readFile7, pkgfile, function(err3, pkgParam) {
if (err3) return cb2(err3);
var pkg = pkgParam;
if (pkg && opts.packageFilter && (pkg = opts.packageFilter(pkg, pkgfile)), pkg && pkg.main) {
if (typeof pkg.main != "string") {
var mainError = new TypeError("package \u201C" + pkg.name + "\u201D `main` must be a string");
return mainError.code = "INVALID_PACKAGE_MAIN", cb2(mainError);
}
(pkg.main === "." || pkg.main === "./") && (pkg.main = "index"), loadAsFile(path4.resolve(x2, pkg.main), pkg, function(err4, m, pkg2) {
if (err4) return cb2(err4);
if (m) return cb2(null, m, pkg2);
if (!pkg2) return loadAsFile(path4.join(x2, "index"), pkg2, cb2);
var dir = path4.resolve(x2, pkg2.main);
loadAsDirectory(dir, pkg2, function(err5, n, pkg3) {
if (err5) return cb2(err5);
if (n) return cb2(null, n, pkg3);
loadAsFile(path4.join(x2, "index"), pkg3, cb2);
});
});
return;
}
loadAsFile(path4.join(x2, "/index"), pkg, cb2);
});
});
});
}
function processDirs(cb2, dirs) {
if (dirs.length === 0) return cb2(null, void 0);
var dir = dirs[0];
isDirectory2(path4.dirname(dir), isdir);
function isdir(err2, isdir2) {
if (err2) return cb2(err2);
if (!isdir2) return processDirs(cb2, dirs.slice(1));
loadAsFile(dir, opts.package, onfile2);
}
function onfile2(err2, m, pkg) {
if (err2) return cb2(err2);
if (m) return cb2(null, m, pkg);
loadAsDirectory(dir, opts.package, ondir);
}
function ondir(err2, n, pkg) {
if (err2) return cb2(err2);
if (n) return cb2(null, n, pkg);
processDirs(cb2, dirs.slice(1));
}
}
function loadNodeModules(x2, start, cb2) {
var thunk = function() {
return getPackageCandidates(x2, start, opts);
};
processDirs(
cb2,
packageIterator ? packageIterator(x2, start, thunk, opts) : thunk()
);
}
};
}
});
// ../node_modules/resolve/lib/core.json
var require_core2 = __commonJS({
"../node_modules/resolve/lib/core.json"(exports, module) {
module.exports = {
assert: !0,
"node:assert": [">= 14.18 && < 15", ">= 16"],
"assert/strict": ">= 15",
"node:assert/strict": ">= 16",
async_hooks: ">= 8",
"node:async_hooks": [">= 14.18 && < 15", ">= 16"],
buffer_ieee754: ">= 0.5 && < 0.9.7",
buffer: !0,
"node:buffer": [">= 14.18 && < 15", ">= 16"],
child_process: !0,
"node:child_process": [">= 14.18 && < 15", ">= 16"],
cluster: ">= 0.5",
"node:cluster": [">= 14.18 && < 15", ">= 16"],
console: !0,
"node:console": [">= 14.18 && < 15", ">= 16"],
constants: !0,
"node:constants": [">= 14.18 && < 15", ">= 16"],
crypto: !0,
"node:crypto": [">= 14.18 && < 15", ">= 16"],
_debug_agent: ">= 1 && < 8",
_debugger: "< 8",
dgram: !0,
"node:dgram": [">= 14.18 && < 15", ">= 16"],
diagnostics_channel: [">= 14.17 && < 15", ">= 15.1"],
"node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"],
dns: !0,
"node:dns": [">= 14.18 && < 15", ">= 16"],
"dns/promises": ">= 15",
"node:dns/promises": ">= 16",
domain: ">= 0.7.12",
"node:domain": [">= 14.18 && < 15", ">= 16"],
events: !0,
"node:events": [">= 14.18 && < 15", ">= 16"],
freelist: "< 6",
fs: !0,
"node:fs": [">= 14.18 && < 15", ">= 16"],
"fs/promises": [">= 10 && < 10.1", ">= 14"],
"node:fs/promises": [">= 14.18 && < 15", ">= 16"],
_http_agent: ">= 0.11.1",
"node:_http_agent": [">= 14.18 && < 15", ">= 16"],
_http_client: ">= 0.11.1",
"node:_http_client": [">= 14.18 && < 15", ">= 16"],
_http_common: ">= 0.11.1",
"node:_http_common": [">= 14.18 && < 15", ">= 16"],
_http_incoming: ">= 0.11.1",
"node:_http_incoming": [">= 14.18 && < 15", ">= 16"],
_http_outgoing: ">= 0.11.1",
"node:_http_outgoing": [">= 14.18 && < 15", ">= 16"],
_http_server: ">= 0.11.1",
"node:_http_server": [">= 14.18 && < 15", ">= 16"],
http: !0,
"node:http": [">= 14.18 && < 15", ">= 16"],
http2: ">= 8.8",
"node:http2": [">= 14.18 && < 15", ">= 16"],
https: !0,
"node:https": [">= 14.18 && < 15", ">= 16"],
inspector: ">= 8",
"node:inspector": [">= 14.18 && < 15", ">= 16"],
"inspector/promises": [">= 19"],
"node:inspector/promises": [">= 19"],
_linklist: "< 8",
module: !0,
"node:module": [">= 14.18 && < 15", ">= 16"],
net: !0,
"node:net": [">= 14.18 && < 15", ">= 16"],
"node-inspect/lib/_inspect": ">= 7.6 && < 12",
"node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12",
"node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12",
os: !0,
"node:os": [">= 14.18 && < 15", ">= 16"],
path: !0,
"node:path": [">= 14.18 && < 15", ">= 16"],
"path/posix": ">= 15.3",
"node:path/posix": ">= 16",
"path/win32": ">= 15.3",
"node:path/win32": ">= 16",
perf_hooks: ">= 8.5",
"node:perf_hooks": [">= 14.18 && < 15", ">= 16"],
process: ">= 1",
"node:process": [">= 14.18 && < 15", ">= 16"],
punycode: ">= 0.5",
"node:punycode": [">= 14.18 && < 15", ">= 16"],
querystring: !0,
"node:querystring": [">= 14.18 && < 15", ">= 16"],
readline: !0,
"node:readline": [">= 14.18 && < 15", ">= 16"],
"readline/promises": ">= 17",
"node:readline/promises": ">= 17",
repl: !0,
"node:repl": [">= 14.18 && < 15", ">= 16"],
"node:sea": [">= 20.12 && < 21", ">= 21.7"],
smalloc: ">= 0.11.5 && < 3",
"node:sqlite": [">= 22.13 && < 23", ">= 23.4"],
_stream_duplex: ">= 0.9.4",
"node:_stream_duplex": [">= 14.18 && < 15", ">= 16"],
_stream_transform: ">= 0.9.4",
"node:_stream_transform": [">= 14.18 && < 15", ">= 16"],
_stream_wrap: ">= 1.4.1",
"node:_stream_wrap": [">= 14.18 && < 15", ">= 16"],
_stream_passthrough: ">= 0.9.4",
"node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"],
_stream_readable: ">= 0.9.4",
"node:_stream_readable": [">= 14.18 && < 15", ">= 16"],
_stream_writable: ">= 0.9.4",
"node:_stream_writable": [">= 14.18 && < 15", ">= 16"],
stream: !0,
"node:stream": [">= 14.18 && < 15", ">= 16"],
"stream/consumers": ">= 16.7",
"node:stream/consumers": ">= 16.7",
"stream/promises": ">= 15",
"node:stream/promises": ">= 16",
"stream/web": ">= 16.5",
"node:stream/web": ">= 16.5",
string_decoder: !0,
"node:string_decoder": [">= 14.18 && < 15", ">= 16"],
sys: [">= 0.4 && < 0.7", ">= 0.8"],
"node:sys": [">= 14.18 && < 15", ">= 16"],
"test/reporters": ">= 19.9 && < 20.2",
"node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"],
"test/mock_loader": ">= 22.3 && < 22.7",
"node:test/mock_loader": ">= 22.3 && < 22.7",
"node:test": [">= 16.17 && < 17", ">= 18"],
timers: !0,
"node:timers": [">= 14.18 && < 15", ">= 16"],
"timers/promises": ">= 15",
"node:timers/promises": ">= 16",
_tls_common: ">= 0.11.13",
"node:_tls_common": [">= 14.18 && < 15", ">= 16"],
_tls_legacy: ">= 0.11.3 && < 10",
_tls_wrap: ">= 0.11.3",
"node:_tls_wrap": [">= 14.18 && < 15", ">= 16"],
tls: !0,
"node:tls": [">= 14.18 && < 15", ">= 16"],
trace_events: ">= 10",
"node:trace_events": [">= 14.18 && < 15", ">= 16"],
tty: !0,
"node:tty": [">= 14.18 && < 15", ">= 16"],
url: !0,
"node:url": [">= 14.18 && < 15", ">= 16"],
util: !0,
"node:util": [">= 14.18 && < 15", ">= 16"],
"util/types": ">= 15.3",
"node:util/types": ">= 16",
"v8/tools/arguments": ">= 10 && < 12",
"v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"],
"v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"],
"v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"],
"v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"],
"v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"],
"v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"],
v8: ">= 1",
"node:v8": [">= 14.18 && < 15", ">= 16"],
vm: !0,
"node:vm": [">= 14.18 && < 15", ">= 16"],
wasi: [">= 13.4 && < 13.5", ">= 18.17 && < 19", ">= 20"],
"node:wasi": [">= 18.17 && < 19", ">= 20"],
worker_threads: ">= 11.7",
"node:worker_threads": [">= 14.18 && < 15", ">= 16"],
zlib: ">= 0.5",
"node:zlib": [">= 14.18 && < 15", ">= 16"]
};
}
});
// ../node_modules/resolve/lib/core.js
var require_core3 = __commonJS({
"../node_modules/resolve/lib/core.js"(exports, module) {
"use strict";
var isCoreModule = require_is_core_module(), data = require_core2(), core = {};
for (mod in data)
Object.prototype.hasOwnProperty.call(data, mod) && (core[mod] = isCoreModule(mod));
var mod;
module.exports = core;
}
});
// ../node_modules/resolve/lib/is-core.js
var require_is_core = __commonJS({
"../node_modules/resolve/lib/is-core.js"(exports, module) {
var isCoreModule = require_is_core_module();
module.exports = function(x) {
return isCoreModule(x);
};
}
});
// ../node_modules/resolve/lib/sync.js
var require_sync = __commonJS({
"../node_modules/resolve/lib/sync.js"(exports, module) {
var isCore = require_is_core_module(), fs = __require("fs"), path4 = __require("path"), getHomedir = require_homedir(), caller = require_caller(), nodeModulesPaths = require_node_modules_paths(), normalizeOptions = require_normalize_options(), realpathFS = process.platform !== "win32" && fs.realpathSync && typeof fs.realpathSync.native == "function" ? fs.realpathSync.native : fs.realpathSync, relativePathRegex = /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/, windowsDriveRegex = /^\w:[/\\]*$/, nodeModulesRegex = /[/\\]node_modules[/\\]*$/, homedir = getHomedir(), defaultPaths = function() {
return [
path4.join(homedir, ".node_modules"),
path4.join(homedir, ".node_libraries")
];
}, defaultIsFile = function(file) {
try {
var stat = fs.statSync(file, { throwIfNoEntry: !1 });
} catch (e) {
if (e && (e.code === "ENOENT" || e.code === "ENOTDIR")) return !1;
throw e;
}
return !!stat && (stat.isFile() || stat.isFIFO());
}, defaultIsDir = function(dir) {
try {
var stat = fs.statSync(dir, { throwIfNoEntry: !1 });
} catch (e) {
if (e && (e.code === "ENOENT" || e.code === "ENOTDIR")) return !1;
throw e;
}
return !!stat && stat.isDirectory();
}, defaultRealpathSync = function(x) {
try {
return realpathFS(x);
} catch (realpathErr) {
if (realpathErr.code !== "ENOENT")
throw realpathErr;
}
return x;
}, maybeRealpathSync = function(realpathSync, x, opts) {
return opts && opts.preserveSymlinks === !1 ? realpathSync(x) : x;
}, defaultReadPackageSync = function(readFileSync11, pkgfile) {
var body = readFileSync11(pkgfile);
try {
var pkg = JSON.parse(body);
return pkg;
} catch {
}
}, getPackageCandidates = function(x, start, opts) {
for (var dirs = nodeModulesPaths(start, opts, x), i = 0; i < dirs.length; i++)
dirs[i] = path4.join(dirs[i], x);
return dirs;
};
module.exports = function(x, options) {
if (typeof x != "string")
throw new TypeError("Path must be a string.");
var opts = normalizeOptions(x, options), isFile = opts.isFile || defaultIsFile, readFileSync11 = opts.readFileSync || fs.readFileSync, isDirectory2 = opts.isDirectory || defaultIsDir, realpathSync = opts.realpathSync || defaultRealpathSync, readPackageSync = opts.readPackageSync || defaultReadPackageSync;
if (opts.readFileSync && opts.readPackageSync)
throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");
var packageIterator = opts.packageIterator, extensions = opts.extensions || [".js"], includeCoreModules = opts.includeCoreModules !== !1, basedir = opts.basedir || path4.dirname(caller()), parent = opts.filename || basedir;
opts.paths = opts.paths || defaultPaths();
var absoluteStart = maybeRealpathSync(realpathSync, path4.resolve(basedir), opts);
if (relativePathRegex.test(x)) {
var res = path4.resolve(absoluteStart, x);
(x === "." || x === ".." || x.slice(-1) === "/") && (res += "/");
var m = loadAsFileSync(res) || loadAsDirectorySync(res);
if (m) return maybeRealpathSync(realpathSync, m, opts);
} else {
if (includeCoreModules && isCore(x))
return x;
var n = loadNodeModulesSync(x, absoluteStart);
if (n) return maybeRealpathSync(realpathSync, n, opts);
}
var err = new Error("Cannot find module '" + x + "' from '" + parent + "'");
throw err.code = "MODULE_NOT_FOUND", err;
function loadAsFileSync(x2) {
var pkg = loadpkg(path4.dirname(x2));
if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {
var rfile = path4.relative(pkg.dir, x2), r = opts.pathFilter(pkg.pkg, x2, rfile);
r && (x2 = path4.resolve(pkg.dir, r));
}
if (isFile(x2))
return x2;
for (var i = 0; i < extensions.length; i++) {
var file = x2 + extensions[i];
if (isFile(file))
return file;
}
}
function loadpkg(dir) {
if (!(dir === "" || dir === "/") && !(process.platform === "win32" && windowsDriveRegex.test(dir)) && !nodeModulesRegex.test(dir)) {
var pkgfile = path4.join(maybeRealpathSync(realpathSync, dir, opts), "package.json");
if (!isFile(pkgfile))
return loadpkg(path4.dirname(dir));
var pkg = readPackageSync(readFileSync11, pkgfile);
return pkg && opts.packageFilter && (pkg = opts.packageFilter(
pkg,
/*pkgfile,*/
dir
)), { pkg, dir };
}
}
function loadAsDirectorySync(x2) {
var pkgfile = path4.join(maybeRealpathSync(realpathSync, x2, opts), "/package.json");
if (isFile(pkgfile)) {
try {
var pkg = readPackageSync(readFileSync11, pkgfile);
} catch {
}
if (pkg && opts.packageFilter && (pkg = opts.packageFilter(
pkg,
/*pkgfile,*/
x2
)), pkg && pkg.main) {
if (typeof pkg.main != "string") {
var mainError = new TypeError("package \u201C" + pkg.name + "\u201D `main` must be a string");
throw mainError.code = "INVALID_PACKAGE_MAIN", mainError;
}
(pkg.main === "." || pkg.main === "./") && (pkg.main = "index");
try {
var m2 = loadAsFileSync(path4.resolve(x2, pkg.main));
if (m2) return m2;
var n2 = loadAsDirectorySync(path4.resolve(x2, pkg.main));
if (n2) return n2;
} catch {
}
}
}
return loadAsFileSync(path4.join(x2, "/index"));
}
function loadNodeModulesSync(x2, start) {
for (var thunk = function() {
return getPackageCandidates(x2, start, opts);
}, dirs = packageIterator ? packageIterator(x2, start, thunk, opts) : thunk(), i = 0; i < dirs.length; i++) {
var dir = dirs[i];
if (isDirectory2(path4.dirname(dir))) {
var m2 = loadAsFileSync(dir);
if (m2) return m2;
var n2 = loadAsDirectorySync(dir);
if (n2) return n2;
}
}
}
};
}
});
// ../node_modules/resolve/index.js
var require_resolve = __commonJS({
"../node_modules/resolve/index.js"(exports, module) {
var async = require_async();
async.core = require_core3();
async.isCore = require_is_core();
async.sync = require_sync();
module.exports = async;
}
});
// ../node_modules/tinyglobby/node_modules/picomatch/lib/constants.js
var require_constants = __commonJS({
"../node_modules/tinyglobby/node_modules/picomatch/lib/constants.js"(exports, module) {
"use strict";
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 = {
alnum: "a-zA-Z0-9",
alpha: "a-zA-Z",
ascii: "\\x00-\\x7F",
blank: " \\t",
cntrl: "\\x00-\\x1F\\x7F",
digit: "0-9",
graph: "\\x21-\\x7E",
lower: "a-z",
print: "\\x20-\\x7E ",
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
space: " \\t\\r\\n\\v\\f",
upper: "A-Z",
word: "A-Za-z0-9_",
xdigit: "A-Fa-f0-9"
};
module.exports = {
MAX_LENGTH: 1024 * 64,
POSIX_REGEX_SOURCE,
// regular expressions
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
// Replace globs with equivalent patterns to reduce parsing time.
REPLACEMENTS: {
__proto__: null,
"***": "*",
"**/**": "**",
"**/**/**": "**"
},
// Digits
CHAR_0: 48,
/* 0 */
CHAR_9: 57,
/* 9 */
// Alphabet chars.
CHAR_UPPERCASE_A: 65,
/* A */
CHAR_LOWERCASE_A: 97,
/* a */
CHAR_UPPERCASE_Z: 90,
/* Z */
CHAR_LOWERCASE_Z: 122,
/* z */
CHAR_LEFT_PARENTHESES: 40,
/* ( */
CHAR_RIGHT_PARENTHESES: 41,
/* ) */
CHAR_ASTERISK: 42,
/* * */
// Non-alphabetic chars.
CHAR_AMPERSAND: 38,
/* & */
CHAR_AT: 64,
/* @ */
CHAR_BACKWARD_SLASH: 92,
/* \ */
CHAR_CARRIAGE_RETURN: 13,
/* \r */
CHAR_CIRCUMFLEX_ACCENT: 94,
/* ^ */
CHAR_COLON: 58,
/* : */
CHAR_COMMA: 44,
/* , */
CHAR_DOT: 46,
/* . */
CHAR_DOUBLE_QUOTE: 34,
/* " */
CHAR_EQUAL: 61,
/* = */
CHAR_EXCLAMATION_MARK: 33,
/* ! */
CHAR_FORM_FEED: 12,
/* \f */
CHAR_FORWARD_SLASH: 47,
/* / */
CHAR_GRAVE_ACCENT: 96,
/* ` */
CHAR_HASH: 35,
/* # */
CHAR_HYPHEN_MINUS: 45,
/* - */
CHAR_LEFT_ANGLE_BRACKET: 60,
/* < */
CHAR_LEFT_CURLY_BRACE: 123,
/* { */
CHAR_LEFT_SQUARE_BRACKET: 91,
/* [ */
CHAR_LINE_FEED: 10,
/* \n */
CHAR_NO_BREAK_SPACE: 160,
/* \u00A0 */
CHAR_PERCENT: 37,
/* % */
CHAR_PLUS: 43,
/* + */
CHAR_QUESTION_MARK: 63,
/* ? */
CHAR_RIGHT_ANGLE_BRACKET: 62,
/* > */
CHAR_RIGHT_CURLY_BRACE: 125,
/* } */
CHAR_RIGHT_SQUARE_BRACKET: 93,
/* ] */
CHAR_SEMICOLON: 59,
/* ; */
CHAR_SINGLE_QUOTE: 39,
/* ' */
CHAR_SPACE: 32,
/* */
CHAR_TAB: 9,
/* \t */
CHAR_UNDERSCORE: 95,
/* _ */
CHAR_VERTICAL_LINE: 124,
/* | */
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
/* \uFEFF */
/**
* Create EXTGLOB_CHARS
*/
extglobChars(chars) {
return {
"!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
"?": { type: "qmark", open: "(?:", close: ")?" },
"+": { type: "plus", open: "(?:", close: ")+" },
"*": { type: "star", open: "(?:", close: ")*" },
"@": { type: "at", open: "(?:", close: ")" }
};
},
/**
* Create GLOB_CHARS
*/
globChars(win32) {
return win32 === !0 ? WINDOWS_CHARS : POSIX_CHARS;
}
};
}
});
// ../node_modules/tinyglobby/node_modules/picomatch/lib/utils.js
var require_utils = __commonJS({
"../node_modules/tinyglobby/node_modules/picomatch/lib/utils.js"(exports) {
"use strict";
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.platf