commit c1b84d20ae57c894f8913c93dc0c239deb940574 Author: taoya7 <569781231@qq.com> Date: Fri Dec 27 11:41:33 2024 +0800 打包 diff --git a/main.js b/main.js new file mode 100644 index 0000000..b514995 --- /dev/null +++ b/main.js @@ -0,0 +1,57 @@ +const os = require('os'); +const process = require('process'); + +// 存储一些数据来模拟内存使用 +let memoryUsage = []; + +// 优雅关闭处理 +process.on('SIGTERM', () => { + console.log('收到 SIGTERM 信号,准备关闭...'); + console.log('清理资源...'); + memoryUsage = []; + process.exit(0); +}); + +// 输出系统信息的函数 +function printSystemInfo() { + const used = process.memoryUsage(); + + console.log('\n--- 系统信息 ---'); + console.log('时间:', new Date().toISOString()); + console.log('进程 ID:', process.pid); + console.log('Node.js 版本:', process.version); + console.log('平台:', process.platform); + console.log('CPU 架构:', process.arch); + console.log('可用内存:', Math.round(os.freemem() / 1024 / 1024), 'MB'); + console.log('总内存:', Math.round(os.totalmem() / 1024 / 1024), 'MB'); + console.log('CPU 负载:', os.loadavg()); + console.log('进程内存使用:'); + console.log(`- 堆总大小: ${Math.round(used.heapTotal / 1024 / 1024)} MB`); + console.log(`- 堆使用: ${Math.round(used.heapUsed / 1024 / 1024)} MB`); + console.log(`- RSS: ${Math.round(used.rss / 1024 / 1024)} MB`); + console.log('------------------------\n'); +} + +// 模拟一些内存使用 +function simulateMemoryUsage() { + const data = Buffer.alloc(1024 * 1024); // 分配 1MB + memoryUsage.push(data); + + // 保持最多使用 100MB + if (memoryUsage.length > 100) { + memoryUsage.shift(); + } +} + +// 主循环 +console.log('脚本启动...'); +console.log('使用 CTRL+C 或发送 SIGTERM 信号来停止'); + +// 每5秒执行一次 +setInterval(() => { + printSystemInfo(); + simulateMemoryUsage(); +}, 5000); + +// 立即执行一次 +printSystemInfo(); \ No newline at end of file diff --git a/node_modules/.bin/tsx b/node_modules/.bin/tsx new file mode 100755 index 0000000..a5ae8a7 --- /dev/null +++ b/node_modules/.bin/tsx @@ -0,0 +1,17 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -z "$NODE_PATH" ]; then + export NODE_PATH="/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/node_modules:/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/node_modules:/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/tsx@4.19.2/node_modules:/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/node_modules" +else + export NODE_PATH="/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/node_modules:/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/node_modules:/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/tsx@4.19.2/node_modules:/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/node_modules:$NODE_PATH" +fi +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../tsx/dist/cli.mjs" "$@" +else + exec node "$basedir/../tsx/dist/cli.mjs" "$@" +fi diff --git a/node_modules/.modules.yaml b/node_modules/.modules.yaml new file mode 100644 index 0000000..8e78fb9 --- /dev/null +++ b/node_modules/.modules.yaml @@ -0,0 +1,100 @@ +hoistPattern: + - '*' +hoistedDependencies: + /@esbuild/aix-ppc64/0.23.1: + '@esbuild/aix-ppc64': private + /@esbuild/android-arm/0.23.1: + '@esbuild/android-arm': private + /@esbuild/android-arm64/0.23.1: + '@esbuild/android-arm64': private + /@esbuild/android-x64/0.23.1: + '@esbuild/android-x64': private + /@esbuild/darwin-arm64/0.23.1: + '@esbuild/darwin-arm64': private + /@esbuild/darwin-x64/0.23.1: + '@esbuild/darwin-x64': private + /@esbuild/freebsd-arm64/0.23.1: + '@esbuild/freebsd-arm64': private + /@esbuild/freebsd-x64/0.23.1: + '@esbuild/freebsd-x64': private + /@esbuild/linux-arm/0.23.1: + '@esbuild/linux-arm': private + /@esbuild/linux-arm64/0.23.1: + '@esbuild/linux-arm64': private + /@esbuild/linux-ia32/0.23.1: + '@esbuild/linux-ia32': private + /@esbuild/linux-loong64/0.23.1: + '@esbuild/linux-loong64': private + /@esbuild/linux-mips64el/0.23.1: + '@esbuild/linux-mips64el': private + /@esbuild/linux-ppc64/0.23.1: + '@esbuild/linux-ppc64': private + /@esbuild/linux-riscv64/0.23.1: + '@esbuild/linux-riscv64': private + /@esbuild/linux-s390x/0.23.1: + '@esbuild/linux-s390x': private + /@esbuild/linux-x64/0.23.1: + '@esbuild/linux-x64': private + /@esbuild/netbsd-x64/0.23.1: + '@esbuild/netbsd-x64': private + /@esbuild/openbsd-arm64/0.23.1: + '@esbuild/openbsd-arm64': private + /@esbuild/openbsd-x64/0.23.1: + '@esbuild/openbsd-x64': private + /@esbuild/sunos-x64/0.23.1: + '@esbuild/sunos-x64': private + /@esbuild/win32-arm64/0.23.1: + '@esbuild/win32-arm64': private + /@esbuild/win32-ia32/0.23.1: + '@esbuild/win32-ia32': private + /@esbuild/win32-x64/0.23.1: + '@esbuild/win32-x64': private + /esbuild/0.23.1: + esbuild: private + /fsevents/2.3.3: + fsevents: private + /get-tsconfig/4.8.1: + get-tsconfig: private + /resolve-pkg-maps/1.0.0: + resolve-pkg-maps: private +included: + dependencies: true + devDependencies: true + optionalDependencies: true +injectedDeps: {} +layoutVersion: 5 +nodeLinker: isolated +packageManager: pnpm@8.10.2 +pendingBuilds: [] +prunedAt: Fri, 27 Dec 2024 03:40:52 GMT +publicHoistPattern: + - '*eslint*' + - '*prettier*' +registries: + default: https://registry.npmmirror.com/ +skipped: + - /@esbuild/aix-ppc64/0.23.1 + - /@esbuild/android-arm/0.23.1 + - /@esbuild/android-arm64/0.23.1 + - /@esbuild/android-x64/0.23.1 + - /@esbuild/darwin-x64/0.23.1 + - /@esbuild/freebsd-arm64/0.23.1 + - /@esbuild/freebsd-x64/0.23.1 + - /@esbuild/linux-arm/0.23.1 + - /@esbuild/linux-arm64/0.23.1 + - /@esbuild/linux-ia32/0.23.1 + - /@esbuild/linux-loong64/0.23.1 + - /@esbuild/linux-mips64el/0.23.1 + - /@esbuild/linux-ppc64/0.23.1 + - /@esbuild/linux-riscv64/0.23.1 + - /@esbuild/linux-s390x/0.23.1 + - /@esbuild/linux-x64/0.23.1 + - /@esbuild/netbsd-x64/0.23.1 + - /@esbuild/openbsd-arm64/0.23.1 + - /@esbuild/openbsd-x64/0.23.1 + - /@esbuild/sunos-x64/0.23.1 + - /@esbuild/win32-arm64/0.23.1 + - /@esbuild/win32-ia32/0.23.1 + - /@esbuild/win32-x64/0.23.1 +storeDir: /Users/taollin/Library/pnpm/store/v3 +virtualStoreDir: .pnpm diff --git a/node_modules/.pnpm/@esbuild+darwin-arm64@0.23.1/node_modules/@esbuild/darwin-arm64/README.md b/node_modules/.pnpm/@esbuild+darwin-arm64@0.23.1/node_modules/@esbuild/darwin-arm64/README.md new file mode 100644 index 0000000..c2c0398 --- /dev/null +++ b/node_modules/.pnpm/@esbuild+darwin-arm64@0.23.1/node_modules/@esbuild/darwin-arm64/README.md @@ -0,0 +1,3 @@ +# esbuild + +This is the macOS ARM 64-bit binary for esbuild, a JavaScript bundler and minifier. See https://github.com/evanw/esbuild for details. diff --git a/node_modules/.pnpm/@esbuild+darwin-arm64@0.23.1/node_modules/@esbuild/darwin-arm64/bin/esbuild b/node_modules/.pnpm/@esbuild+darwin-arm64@0.23.1/node_modules/@esbuild/darwin-arm64/bin/esbuild new file mode 100755 index 0000000..df59084 Binary files /dev/null and b/node_modules/.pnpm/@esbuild+darwin-arm64@0.23.1/node_modules/@esbuild/darwin-arm64/bin/esbuild differ diff --git a/node_modules/.pnpm/@esbuild+darwin-arm64@0.23.1/node_modules/@esbuild/darwin-arm64/package.json b/node_modules/.pnpm/@esbuild+darwin-arm64@0.23.1/node_modules/@esbuild/darwin-arm64/package.json new file mode 100644 index 0000000..8ad9d31 --- /dev/null +++ b/node_modules/.pnpm/@esbuild+darwin-arm64@0.23.1/node_modules/@esbuild/darwin-arm64/package.json @@ -0,0 +1,20 @@ +{ + "name": "@esbuild/darwin-arm64", + "version": "0.23.1", + "description": "The macOS ARM 64-bit binary for esbuild, a JavaScript bundler.", + "repository": { + "type": "git", + "url": "git+https://github.com/evanw/esbuild.git" + }, + "license": "MIT", + "preferUnplugged": true, + "engines": { + "node": ">=18" + }, + "os": [ + "darwin" + ], + "cpu": [ + "arm64" + ] +} diff --git a/node_modules/.pnpm/esbuild@0.23.1/node_modules/@esbuild/darwin-arm64 b/node_modules/.pnpm/esbuild@0.23.1/node_modules/@esbuild/darwin-arm64 new file mode 120000 index 0000000..e4cacef --- /dev/null +++ b/node_modules/.pnpm/esbuild@0.23.1/node_modules/@esbuild/darwin-arm64 @@ -0,0 +1 @@ +../../../@esbuild+darwin-arm64@0.23.1/node_modules/@esbuild/darwin-arm64 \ No newline at end of file diff --git a/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/LICENSE.md b/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/LICENSE.md new file mode 100644 index 0000000..2027e8d --- /dev/null +++ b/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Evan Wallace + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/README.md b/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/README.md new file mode 100644 index 0000000..93863d1 --- /dev/null +++ b/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/README.md @@ -0,0 +1,3 @@ +# esbuild + +This is a JavaScript bundler and minifier. See https://github.com/evanw/esbuild and the [JavaScript API documentation](https://esbuild.github.io/api/) for details. diff --git a/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/bin/esbuild b/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/bin/esbuild new file mode 100755 index 0000000..df59084 Binary files /dev/null and b/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/bin/esbuild differ diff --git a/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/install.js b/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/install.js new file mode 100644 index 0000000..86b6c43 --- /dev/null +++ b/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/install.js @@ -0,0 +1,286 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); + +// lib/npm/node-platform.ts +var fs = require("fs"); +var os = require("os"); +var path = require("path"); +var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH; +var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild"; +var knownWindowsPackages = { + "win32 arm64 LE": "@esbuild/win32-arm64", + "win32 ia32 LE": "@esbuild/win32-ia32", + "win32 x64 LE": "@esbuild/win32-x64" +}; +var knownUnixlikePackages = { + "aix ppc64 BE": "@esbuild/aix-ppc64", + "android arm64 LE": "@esbuild/android-arm64", + "darwin arm64 LE": "@esbuild/darwin-arm64", + "darwin x64 LE": "@esbuild/darwin-x64", + "freebsd arm64 LE": "@esbuild/freebsd-arm64", + "freebsd x64 LE": "@esbuild/freebsd-x64", + "linux arm LE": "@esbuild/linux-arm", + "linux arm64 LE": "@esbuild/linux-arm64", + "linux ia32 LE": "@esbuild/linux-ia32", + "linux mips64el LE": "@esbuild/linux-mips64el", + "linux ppc64 LE": "@esbuild/linux-ppc64", + "linux riscv64 LE": "@esbuild/linux-riscv64", + "linux s390x BE": "@esbuild/linux-s390x", + "linux x64 LE": "@esbuild/linux-x64", + "linux loong64 LE": "@esbuild/linux-loong64", + "netbsd x64 LE": "@esbuild/netbsd-x64", + "openbsd arm64 LE": "@esbuild/openbsd-arm64", + "openbsd x64 LE": "@esbuild/openbsd-x64", + "sunos x64 LE": "@esbuild/sunos-x64" +}; +var knownWebAssemblyFallbackPackages = { + "android arm LE": "@esbuild/android-arm", + "android x64 LE": "@esbuild/android-x64" +}; +function pkgAndSubpathForCurrentPlatform() { + let pkg; + let subpath; + let isWASM = false; + let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`; + if (platformKey in knownWindowsPackages) { + pkg = knownWindowsPackages[platformKey]; + subpath = "esbuild.exe"; + } else if (platformKey in knownUnixlikePackages) { + pkg = knownUnixlikePackages[platformKey]; + subpath = "bin/esbuild"; + } else if (platformKey in knownWebAssemblyFallbackPackages) { + pkg = knownWebAssemblyFallbackPackages[platformKey]; + subpath = "bin/esbuild"; + isWASM = true; + } else { + throw new Error(`Unsupported platform: ${platformKey}`); + } + return { pkg, subpath, isWASM }; +} +function downloadedBinPath(pkg, subpath) { + const esbuildLibDir = path.dirname(require.resolve("esbuild")); + return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`); +} + +// lib/npm/node-install.ts +var fs2 = require("fs"); +var os2 = require("os"); +var path2 = require("path"); +var zlib = require("zlib"); +var https = require("https"); +var child_process = require("child_process"); +var versionFromPackageJSON = require(path2.join(__dirname, "package.json")).version; +var toPath = path2.join(__dirname, "bin", "esbuild"); +var isToPathJS = true; +function validateBinaryVersion(...command) { + command.push("--version"); + let stdout; + try { + stdout = child_process.execFileSync(command.shift(), command, { + // Without this, this install script strangely crashes with the error + // "EACCES: permission denied, write" but only on Ubuntu Linux when node is + // installed from the Snap Store. This is not a problem when you download + // the official version of node. The problem appears to be that stderr + // (i.e. file descriptor 2) isn't writable? + // + // More info: + // - https://snapcraft.io/ (what the Snap Store is) + // - https://nodejs.org/dist/ (download the official version of node) + // - https://github.com/evanw/esbuild/issues/1711#issuecomment-1027554035 + // + stdio: "pipe" + }).toString().trim(); + } catch (err) { + if (os2.platform() === "darwin" && /_SecTrustEvaluateWithError/.test(err + "")) { + let os3 = "this version of macOS"; + try { + os3 = "macOS " + child_process.execFileSync("sw_vers", ["-productVersion"]).toString().trim(); + } catch { + } + throw new Error(`The "esbuild" package cannot be installed because ${os3} is too outdated. + +The Go compiler (which esbuild relies on) no longer supports ${os3}, +which means the "esbuild" binary executable can't be run. You can either: + + * Update your version of macOS to one that the Go compiler supports + * Use the "esbuild-wasm" package instead of the "esbuild" package + * Build esbuild yourself using an older version of the Go compiler +`); + } + throw err; + } + if (stdout !== versionFromPackageJSON) { + throw new Error(`Expected ${JSON.stringify(versionFromPackageJSON)} but got ${JSON.stringify(stdout)}`); + } +} +function isYarn() { + const { npm_config_user_agent } = process.env; + if (npm_config_user_agent) { + return /\byarn\//.test(npm_config_user_agent); + } + return false; +} +function fetch(url) { + return new Promise((resolve, reject) => { + https.get(url, (res) => { + if ((res.statusCode === 301 || res.statusCode === 302) && res.headers.location) + return fetch(res.headers.location).then(resolve, reject); + if (res.statusCode !== 200) + return reject(new Error(`Server responded with ${res.statusCode}`)); + let chunks = []; + res.on("data", (chunk) => chunks.push(chunk)); + res.on("end", () => resolve(Buffer.concat(chunks))); + }).on("error", reject); + }); +} +function extractFileFromTarGzip(buffer, subpath) { + try { + buffer = zlib.unzipSync(buffer); + } catch (err) { + throw new Error(`Invalid gzip data in archive: ${err && err.message || err}`); + } + let str = (i, n) => String.fromCharCode(...buffer.subarray(i, i + n)).replace(/\0.*$/, ""); + let offset = 0; + subpath = `package/${subpath}`; + while (offset < buffer.length) { + let name = str(offset, 100); + let size = parseInt(str(offset + 124, 12), 8); + offset += 512; + if (!isNaN(size)) { + if (name === subpath) return buffer.subarray(offset, offset + size); + offset += size + 511 & ~511; + } + } + throw new Error(`Could not find ${JSON.stringify(subpath)} in archive`); +} +function installUsingNPM(pkg, subpath, binPath) { + const env = { ...process.env, npm_config_global: void 0 }; + const esbuildLibDir = path2.dirname(require.resolve("esbuild")); + const installDir = path2.join(esbuildLibDir, "npm-install"); + fs2.mkdirSync(installDir); + try { + fs2.writeFileSync(path2.join(installDir, "package.json"), "{}"); + child_process.execSync( + `npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${versionFromPackageJSON}`, + { cwd: installDir, stdio: "pipe", env } + ); + const installedBinPath = path2.join(installDir, "node_modules", pkg, subpath); + fs2.renameSync(installedBinPath, binPath); + } finally { + try { + removeRecursive(installDir); + } catch { + } + } +} +function removeRecursive(dir) { + for (const entry of fs2.readdirSync(dir)) { + const entryPath = path2.join(dir, entry); + let stats; + try { + stats = fs2.lstatSync(entryPath); + } catch { + continue; + } + if (stats.isDirectory()) removeRecursive(entryPath); + else fs2.unlinkSync(entryPath); + } + fs2.rmdirSync(dir); +} +function applyManualBinaryPathOverride(overridePath) { + const pathString = JSON.stringify(overridePath); + fs2.writeFileSync(toPath, `#!/usr/bin/env node +require('child_process').execFileSync(${pathString}, process.argv.slice(2), { stdio: 'inherit' }); +`); + const libMain = path2.join(__dirname, "lib", "main.js"); + const code = fs2.readFileSync(libMain, "utf8"); + fs2.writeFileSync(libMain, `var ESBUILD_BINARY_PATH = ${pathString}; +${code}`); +} +function maybeOptimizePackage(binPath) { + if (os2.platform() !== "win32" && !isYarn()) { + const tempPath = path2.join(__dirname, "bin-esbuild"); + try { + fs2.linkSync(binPath, tempPath); + fs2.renameSync(tempPath, toPath); + isToPathJS = false; + fs2.unlinkSync(tempPath); + } catch { + } + } +} +async function downloadDirectlyFromNPM(pkg, subpath, binPath) { + const url = `https://registry.npmjs.org/${pkg}/-/${pkg.replace("@esbuild/", "")}-${versionFromPackageJSON}.tgz`; + console.error(`[esbuild] Trying to download ${JSON.stringify(url)}`); + try { + fs2.writeFileSync(binPath, extractFileFromTarGzip(await fetch(url), subpath)); + fs2.chmodSync(binPath, 493); + } catch (e) { + console.error(`[esbuild] Failed to download ${JSON.stringify(url)}: ${e && e.message || e}`); + throw e; + } +} +async function checkAndPreparePackage() { + if (isValidBinaryPath(ESBUILD_BINARY_PATH)) { + if (!fs2.existsSync(ESBUILD_BINARY_PATH)) { + console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`); + } else { + applyManualBinaryPathOverride(ESBUILD_BINARY_PATH); + return; + } + } + const { pkg, subpath } = pkgAndSubpathForCurrentPlatform(); + let binPath; + try { + binPath = require.resolve(`${pkg}/${subpath}`); + } catch (e) { + console.error(`[esbuild] Failed to find package "${pkg}" on the file system + +This can happen if you use the "--no-optional" flag. The "optionalDependencies" +package.json feature is used by esbuild to install the correct binary executable +for your current platform. This install script will now attempt to work around +this. If that fails, you need to remove the "--no-optional" flag to use esbuild. +`); + binPath = downloadedBinPath(pkg, subpath); + try { + console.error(`[esbuild] Trying to install package "${pkg}" using npm`); + installUsingNPM(pkg, subpath, binPath); + } catch (e2) { + console.error(`[esbuild] Failed to install package "${pkg}" using npm: ${e2 && e2.message || e2}`); + try { + await downloadDirectlyFromNPM(pkg, subpath, binPath); + } catch (e3) { + throw new Error(`Failed to install package "${pkg}"`); + } + } + } + maybeOptimizePackage(binPath); +} +checkAndPreparePackage().then(() => { + if (isToPathJS) { + validateBinaryVersion(process.execPath, toPath); + } else { + validateBinaryVersion(toPath); + } +}); diff --git a/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/lib/main.d.ts b/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/lib/main.d.ts new file mode 100644 index 0000000..c705307 --- /dev/null +++ b/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/lib/main.d.ts @@ -0,0 +1,705 @@ +export type Platform = 'browser' | 'node' | 'neutral' +export type Format = 'iife' | 'cjs' | 'esm' +export type Loader = 'base64' | 'binary' | 'copy' | 'css' | 'dataurl' | 'default' | 'empty' | 'file' | 'js' | 'json' | 'jsx' | 'local-css' | 'text' | 'ts' | 'tsx' +export type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent' +export type Charset = 'ascii' | 'utf8' +export type Drop = 'console' | 'debugger' + +interface CommonOptions { + /** Documentation: https://esbuild.github.io/api/#sourcemap */ + sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both' + /** Documentation: https://esbuild.github.io/api/#legal-comments */ + legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external' + /** Documentation: https://esbuild.github.io/api/#source-root */ + sourceRoot?: string + /** Documentation: https://esbuild.github.io/api/#sources-content */ + sourcesContent?: boolean + + /** Documentation: https://esbuild.github.io/api/#format */ + format?: Format + /** Documentation: https://esbuild.github.io/api/#global-name */ + globalName?: string + /** Documentation: https://esbuild.github.io/api/#target */ + target?: string | string[] + /** Documentation: https://esbuild.github.io/api/#supported */ + supported?: Record + /** Documentation: https://esbuild.github.io/api/#platform */ + platform?: Platform + + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleProps?: RegExp + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + reserveProps?: RegExp + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleQuoted?: boolean + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleCache?: Record + /** Documentation: https://esbuild.github.io/api/#drop */ + drop?: Drop[] + /** Documentation: https://esbuild.github.io/api/#drop-labels */ + dropLabels?: string[] + /** Documentation: https://esbuild.github.io/api/#minify */ + minify?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifyWhitespace?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifyIdentifiers?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifySyntax?: boolean + /** Documentation: https://esbuild.github.io/api/#line-limit */ + lineLimit?: number + /** Documentation: https://esbuild.github.io/api/#charset */ + charset?: Charset + /** Documentation: https://esbuild.github.io/api/#tree-shaking */ + treeShaking?: boolean + /** Documentation: https://esbuild.github.io/api/#ignore-annotations */ + ignoreAnnotations?: boolean + + /** Documentation: https://esbuild.github.io/api/#jsx */ + jsx?: 'transform' | 'preserve' | 'automatic' + /** Documentation: https://esbuild.github.io/api/#jsx-factory */ + jsxFactory?: string + /** Documentation: https://esbuild.github.io/api/#jsx-fragment */ + jsxFragment?: string + /** Documentation: https://esbuild.github.io/api/#jsx-import-source */ + jsxImportSource?: string + /** Documentation: https://esbuild.github.io/api/#jsx-development */ + jsxDev?: boolean + /** Documentation: https://esbuild.github.io/api/#jsx-side-effects */ + jsxSideEffects?: boolean + + /** Documentation: https://esbuild.github.io/api/#define */ + define?: { [key: string]: string } + /** Documentation: https://esbuild.github.io/api/#pure */ + pure?: string[] + /** Documentation: https://esbuild.github.io/api/#keep-names */ + keepNames?: boolean + + /** Documentation: https://esbuild.github.io/api/#color */ + color?: boolean + /** Documentation: https://esbuild.github.io/api/#log-level */ + logLevel?: LogLevel + /** Documentation: https://esbuild.github.io/api/#log-limit */ + logLimit?: number + /** Documentation: https://esbuild.github.io/api/#log-override */ + logOverride?: Record + + /** Documentation: https://esbuild.github.io/api/#tsconfig-raw */ + tsconfigRaw?: string | TsconfigRaw +} + +export interface TsconfigRaw { + compilerOptions?: { + alwaysStrict?: boolean + baseUrl?: string + experimentalDecorators?: boolean + importsNotUsedAsValues?: 'remove' | 'preserve' | 'error' + jsx?: 'preserve' | 'react-native' | 'react' | 'react-jsx' | 'react-jsxdev' + jsxFactory?: string + jsxFragmentFactory?: string + jsxImportSource?: string + paths?: Record + preserveValueImports?: boolean + strict?: boolean + target?: string + useDefineForClassFields?: boolean + verbatimModuleSyntax?: boolean + } +} + +export interface BuildOptions extends CommonOptions { + /** Documentation: https://esbuild.github.io/api/#bundle */ + bundle?: boolean + /** Documentation: https://esbuild.github.io/api/#splitting */ + splitting?: boolean + /** Documentation: https://esbuild.github.io/api/#preserve-symlinks */ + preserveSymlinks?: boolean + /** Documentation: https://esbuild.github.io/api/#outfile */ + outfile?: string + /** Documentation: https://esbuild.github.io/api/#metafile */ + metafile?: boolean + /** Documentation: https://esbuild.github.io/api/#outdir */ + outdir?: string + /** Documentation: https://esbuild.github.io/api/#outbase */ + outbase?: string + /** Documentation: https://esbuild.github.io/api/#external */ + external?: string[] + /** Documentation: https://esbuild.github.io/api/#packages */ + packages?: 'bundle' | 'external' + /** Documentation: https://esbuild.github.io/api/#alias */ + alias?: Record + /** Documentation: https://esbuild.github.io/api/#loader */ + loader?: { [ext: string]: Loader } + /** Documentation: https://esbuild.github.io/api/#resolve-extensions */ + resolveExtensions?: string[] + /** Documentation: https://esbuild.github.io/api/#main-fields */ + mainFields?: string[] + /** Documentation: https://esbuild.github.io/api/#conditions */ + conditions?: string[] + /** Documentation: https://esbuild.github.io/api/#write */ + write?: boolean + /** Documentation: https://esbuild.github.io/api/#allow-overwrite */ + allowOverwrite?: boolean + /** Documentation: https://esbuild.github.io/api/#tsconfig */ + tsconfig?: string + /** Documentation: https://esbuild.github.io/api/#out-extension */ + outExtension?: { [ext: string]: string } + /** Documentation: https://esbuild.github.io/api/#public-path */ + publicPath?: string + /** Documentation: https://esbuild.github.io/api/#entry-names */ + entryNames?: string + /** Documentation: https://esbuild.github.io/api/#chunk-names */ + chunkNames?: string + /** Documentation: https://esbuild.github.io/api/#asset-names */ + assetNames?: string + /** Documentation: https://esbuild.github.io/api/#inject */ + inject?: string[] + /** Documentation: https://esbuild.github.io/api/#banner */ + banner?: { [type: string]: string } + /** Documentation: https://esbuild.github.io/api/#footer */ + footer?: { [type: string]: string } + /** Documentation: https://esbuild.github.io/api/#entry-points */ + entryPoints?: string[] | Record | { in: string, out: string }[] + /** Documentation: https://esbuild.github.io/api/#stdin */ + stdin?: StdinOptions + /** Documentation: https://esbuild.github.io/plugins/ */ + plugins?: Plugin[] + /** Documentation: https://esbuild.github.io/api/#working-directory */ + absWorkingDir?: string + /** Documentation: https://esbuild.github.io/api/#node-paths */ + nodePaths?: string[]; // The "NODE_PATH" variable from Node.js +} + +export interface StdinOptions { + contents: string | Uint8Array + resolveDir?: string + sourcefile?: string + loader?: Loader +} + +export interface Message { + id: string + pluginName: string + text: string + location: Location | null + notes: Note[] + + /** + * Optional user-specified data that is passed through unmodified. You can + * use this to stash the original error, for example. + */ + detail: any +} + +export interface Note { + text: string + location: Location | null +} + +export interface Location { + file: string + namespace: string + /** 1-based */ + line: number + /** 0-based, in bytes */ + column: number + /** in bytes */ + length: number + lineText: string + suggestion: string +} + +export interface OutputFile { + path: string + contents: Uint8Array + hash: string + /** "contents" as text (changes automatically with "contents") */ + readonly text: string +} + +export interface BuildResult { + errors: Message[] + warnings: Message[] + /** Only when "write: false" */ + outputFiles: OutputFile[] | (ProvidedOptions['write'] extends false ? never : undefined) + /** Only when "metafile: true" */ + metafile: Metafile | (ProvidedOptions['metafile'] extends true ? never : undefined) + /** Only when "mangleCache" is present */ + mangleCache: Record | (ProvidedOptions['mangleCache'] extends Object ? never : undefined) +} + +export interface BuildFailure extends Error { + errors: Message[] + warnings: Message[] +} + +/** Documentation: https://esbuild.github.io/api/#serve-arguments */ +export interface ServeOptions { + port?: number + host?: string + servedir?: string + keyfile?: string + certfile?: string + fallback?: string + onRequest?: (args: ServeOnRequestArgs) => void +} + +export interface ServeOnRequestArgs { + remoteAddress: string + method: string + path: string + status: number + /** The time to generate the response, not to send it */ + timeInMS: number +} + +/** Documentation: https://esbuild.github.io/api/#serve-return-values */ +export interface ServeResult { + port: number + host: string +} + +export interface TransformOptions extends CommonOptions { + /** Documentation: https://esbuild.github.io/api/#sourcefile */ + sourcefile?: string + /** Documentation: https://esbuild.github.io/api/#loader */ + loader?: Loader + /** Documentation: https://esbuild.github.io/api/#banner */ + banner?: string + /** Documentation: https://esbuild.github.io/api/#footer */ + footer?: string +} + +export interface TransformResult { + code: string + map: string + warnings: Message[] + /** Only when "mangleCache" is present */ + mangleCache: Record | (ProvidedOptions['mangleCache'] extends Object ? never : undefined) + /** Only when "legalComments" is "external" */ + legalComments: string | (ProvidedOptions['legalComments'] extends 'external' ? never : undefined) +} + +export interface TransformFailure extends Error { + errors: Message[] + warnings: Message[] +} + +export interface Plugin { + name: string + setup: (build: PluginBuild) => (void | Promise) +} + +export interface PluginBuild { + /** Documentation: https://esbuild.github.io/plugins/#build-options */ + initialOptions: BuildOptions + + /** Documentation: https://esbuild.github.io/plugins/#resolve */ + resolve(path: string, options?: ResolveOptions): Promise + + /** Documentation: https://esbuild.github.io/plugins/#on-start */ + onStart(callback: () => + (OnStartResult | null | void | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-end */ + onEnd(callback: (result: BuildResult) => + (OnEndResult | null | void | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-resolve */ + onResolve(options: OnResolveOptions, callback: (args: OnResolveArgs) => + (OnResolveResult | null | undefined | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-load */ + onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) => + (OnLoadResult | null | undefined | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-dispose */ + onDispose(callback: () => void): void + + // This is a full copy of the esbuild library in case you need it + esbuild: { + context: typeof context, + build: typeof build, + buildSync: typeof buildSync, + transform: typeof transform, + transformSync: typeof transformSync, + formatMessages: typeof formatMessages, + formatMessagesSync: typeof formatMessagesSync, + analyzeMetafile: typeof analyzeMetafile, + analyzeMetafileSync: typeof analyzeMetafileSync, + initialize: typeof initialize, + version: typeof version, + } +} + +/** Documentation: https://esbuild.github.io/plugins/#resolve-options */ +export interface ResolveOptions { + pluginName?: string + importer?: string + namespace?: string + resolveDir?: string + kind?: ImportKind + pluginData?: any + with?: Record +} + +/** Documentation: https://esbuild.github.io/plugins/#resolve-results */ +export interface ResolveResult { + errors: Message[] + warnings: Message[] + + path: string + external: boolean + sideEffects: boolean + namespace: string + suffix: string + pluginData: any +} + +export interface OnStartResult { + errors?: PartialMessage[] + warnings?: PartialMessage[] +} + +export interface OnEndResult { + errors?: PartialMessage[] + warnings?: PartialMessage[] +} + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-options */ +export interface OnResolveOptions { + filter: RegExp + namespace?: string +} + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-arguments */ +export interface OnResolveArgs { + path: string + importer: string + namespace: string + resolveDir: string + kind: ImportKind + pluginData: any + with: Record +} + +export type ImportKind = + | 'entry-point' + + // JS + | 'import-statement' + | 'require-call' + | 'dynamic-import' + | 'require-resolve' + + // CSS + | 'import-rule' + | 'composes-from' + | 'url-token' + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-results */ +export interface OnResolveResult { + pluginName?: string + + errors?: PartialMessage[] + warnings?: PartialMessage[] + + path?: string + external?: boolean + sideEffects?: boolean + namespace?: string + suffix?: string + pluginData?: any + + watchFiles?: string[] + watchDirs?: string[] +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-options */ +export interface OnLoadOptions { + filter: RegExp + namespace?: string +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-arguments */ +export interface OnLoadArgs { + path: string + namespace: string + suffix: string + pluginData: any + with: Record +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-results */ +export interface OnLoadResult { + pluginName?: string + + errors?: PartialMessage[] + warnings?: PartialMessage[] + + contents?: string | Uint8Array + resolveDir?: string + loader?: Loader + pluginData?: any + + watchFiles?: string[] + watchDirs?: string[] +} + +export interface PartialMessage { + id?: string + pluginName?: string + text?: string + location?: Partial | null + notes?: PartialNote[] + detail?: any +} + +export interface PartialNote { + text?: string + location?: Partial | null +} + +/** Documentation: https://esbuild.github.io/api/#metafile */ +export interface Metafile { + inputs: { + [path: string]: { + bytes: number + imports: { + path: string + kind: ImportKind + external?: boolean + original?: string + with?: Record + }[] + format?: 'cjs' | 'esm' + with?: Record + } + } + outputs: { + [path: string]: { + bytes: number + inputs: { + [path: string]: { + bytesInOutput: number + } + } + imports: { + path: string + kind: ImportKind | 'file-loader' + external?: boolean + }[] + exports: string[] + entryPoint?: string + cssBundle?: string + } + } +} + +export interface FormatMessagesOptions { + kind: 'error' | 'warning' + color?: boolean + terminalWidth?: number +} + +export interface AnalyzeMetafileOptions { + color?: boolean + verbose?: boolean +} + +export interface WatchOptions { +} + +export interface BuildContext { + /** Documentation: https://esbuild.github.io/api/#rebuild */ + rebuild(): Promise> + + /** Documentation: https://esbuild.github.io/api/#watch */ + watch(options?: WatchOptions): Promise + + /** Documentation: https://esbuild.github.io/api/#serve */ + serve(options?: ServeOptions): Promise + + cancel(): Promise + dispose(): Promise +} + +// This is a TypeScript type-level function which replaces any keys in "In" +// that aren't in "Out" with "never". We use this to reject properties with +// typos in object literals. See: https://stackoverflow.com/questions/49580725 +type SameShape = In & { [Key in Exclude]: never } + +/** + * This function invokes the "esbuild" command-line tool for you. It returns a + * promise that either resolves with a "BuildResult" object or rejects with a + * "BuildFailure" object. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function build(options: SameShape): Promise> + +/** + * This is the advanced long-running form of "build" that supports additional + * features such as watch mode and a local development server. + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function context(options: SameShape): Promise> + +/** + * This function transforms a single JavaScript file. It can be used to minify + * JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript + * to older JavaScript. It returns a promise that is either resolved with a + * "TransformResult" object or rejected with a "TransformFailure" object. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#transform + */ +export declare function transform(input: string | Uint8Array, options?: SameShape): Promise> + +/** + * Converts log messages to formatted message strings suitable for printing in + * the terminal. This allows you to reuse the built-in behavior of esbuild's + * log message formatter. This is a batch-oriented API for efficiency. + * + * - Works in node: yes + * - Works in browser: yes + */ +export declare function formatMessages(messages: PartialMessage[], options: FormatMessagesOptions): Promise + +/** + * Pretty-prints an analysis of the metafile JSON to a string. This is just for + * convenience to be able to match esbuild's pretty-printing exactly. If you want + * to customize it, you can just inspect the data in the metafile yourself. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#analyze + */ +export declare function analyzeMetafile(metafile: Metafile | string, options?: AnalyzeMetafileOptions): Promise + +/** + * A synchronous version of "build". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function buildSync(options: SameShape): BuildResult + +/** + * A synchronous version of "transform". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#transform + */ +export declare function transformSync(input: string | Uint8Array, options?: SameShape): TransformResult + +/** + * A synchronous version of "formatMessages". + * + * - Works in node: yes + * - Works in browser: no + */ +export declare function formatMessagesSync(messages: PartialMessage[], options: FormatMessagesOptions): string[] + +/** + * A synchronous version of "analyzeMetafile". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#analyze + */ +export declare function analyzeMetafileSync(metafile: Metafile | string, options?: AnalyzeMetafileOptions): string + +/** + * This configures the browser-based version of esbuild. It is necessary to + * call this first and wait for the returned promise to be resolved before + * making other API calls when using esbuild in the browser. + * + * - Works in node: yes + * - Works in browser: yes ("options" is required) + * + * Documentation: https://esbuild.github.io/api/#browser + */ +export declare function initialize(options: InitializeOptions): Promise + +export interface InitializeOptions { + /** + * The URL of the "esbuild.wasm" file. This must be provided when running + * esbuild in the browser. + */ + wasmURL?: string | URL + + /** + * The result of calling "new WebAssembly.Module(buffer)" where "buffer" + * is a typed array or ArrayBuffer containing the binary code of the + * "esbuild.wasm" file. + * + * You can use this as an alternative to "wasmURL" for environments where it's + * not possible to download the WebAssembly module. + */ + wasmModule?: WebAssembly.Module + + /** + * By default esbuild runs the WebAssembly-based browser API in a web worker + * to avoid blocking the UI thread. This can be disabled by setting "worker" + * to false. + */ + worker?: boolean +} + +export let version: string + +// Call this function to terminate esbuild's child process. The child process +// is not terminated and re-created after each API call because it's more +// efficient to keep it around when there are multiple API calls. +// +// In node this happens automatically before the parent node process exits. So +// you only need to call this if you know you will not make any more esbuild +// API calls and you want to clean up resources. +// +// Unlike node, Deno lacks the necessary APIs to clean up child processes +// automatically. You must manually call stop() in Deno when you're done +// using esbuild or Deno will continue running forever. +// +// Another reason you might want to call this is if you are using esbuild from +// within a Deno test. Deno fails tests that create a child process without +// killing it before the test ends, so you have to call this function (and +// await the returned promise) in every Deno test that uses esbuild. +export declare function stop(): Promise + +// Note: These declarations exist to avoid type errors when you omit "dom" from +// "lib" in your "tsconfig.json" file. TypeScript confusingly declares the +// global "WebAssembly" type in "lib.dom.d.ts" even though it has nothing to do +// with the browser DOM and is present in many non-browser JavaScript runtimes +// (e.g. node and deno). Declaring it here allows esbuild's API to be used in +// these scenarios. +// +// There's an open issue about getting this problem corrected (although these +// declarations will need to remain even if this is fixed for backward +// compatibility with older TypeScript versions): +// +// https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/826 +// +declare global { + namespace WebAssembly { + interface Module { + } + } + interface URL { + } +} diff --git a/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/lib/main.js b/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/lib/main.js new file mode 100644 index 0000000..a6d03ae --- /dev/null +++ b/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/lib/main.js @@ -0,0 +1,2244 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// lib/npm/node.ts +var node_exports = {}; +__export(node_exports, { + analyzeMetafile: () => analyzeMetafile, + analyzeMetafileSync: () => analyzeMetafileSync, + build: () => build, + buildSync: () => buildSync, + context: () => context, + default: () => node_default, + formatMessages: () => formatMessages, + formatMessagesSync: () => formatMessagesSync, + initialize: () => initialize, + stop: () => stop, + transform: () => transform, + transformSync: () => transformSync, + version: () => version +}); +module.exports = __toCommonJS(node_exports); + +// lib/shared/stdio_protocol.ts +function encodePacket(packet) { + let visit = (value) => { + if (value === null) { + bb.write8(0); + } else if (typeof value === "boolean") { + bb.write8(1); + bb.write8(+value); + } else if (typeof value === "number") { + bb.write8(2); + bb.write32(value | 0); + } else if (typeof value === "string") { + bb.write8(3); + bb.write(encodeUTF8(value)); + } else if (value instanceof Uint8Array) { + bb.write8(4); + bb.write(value); + } else if (value instanceof Array) { + bb.write8(5); + bb.write32(value.length); + for (let item of value) { + visit(item); + } + } else { + let keys = Object.keys(value); + bb.write8(6); + bb.write32(keys.length); + for (let key of keys) { + bb.write(encodeUTF8(key)); + visit(value[key]); + } + } + }; + let bb = new ByteBuffer(); + bb.write32(0); + bb.write32(packet.id << 1 | +!packet.isRequest); + visit(packet.value); + writeUInt32LE(bb.buf, bb.len - 4, 0); + return bb.buf.subarray(0, bb.len); +} +function decodePacket(bytes) { + let visit = () => { + switch (bb.read8()) { + case 0: + return null; + case 1: + return !!bb.read8(); + case 2: + return bb.read32(); + case 3: + return decodeUTF8(bb.read()); + case 4: + return bb.read(); + case 5: { + let count = bb.read32(); + let value2 = []; + for (let i = 0; i < count; i++) { + value2.push(visit()); + } + return value2; + } + case 6: { + let count = bb.read32(); + let value2 = {}; + for (let i = 0; i < count; i++) { + value2[decodeUTF8(bb.read())] = visit(); + } + return value2; + } + default: + throw new Error("Invalid packet"); + } + }; + let bb = new ByteBuffer(bytes); + let id = bb.read32(); + let isRequest = (id & 1) === 0; + id >>>= 1; + let value = visit(); + if (bb.ptr !== bytes.length) { + throw new Error("Invalid packet"); + } + return { id, isRequest, value }; +} +var ByteBuffer = class { + constructor(buf = new Uint8Array(1024)) { + this.buf = buf; + this.len = 0; + this.ptr = 0; + } + _write(delta) { + if (this.len + delta > this.buf.length) { + let clone = new Uint8Array((this.len + delta) * 2); + clone.set(this.buf); + this.buf = clone; + } + this.len += delta; + return this.len - delta; + } + write8(value) { + let offset = this._write(1); + this.buf[offset] = value; + } + write32(value) { + let offset = this._write(4); + writeUInt32LE(this.buf, value, offset); + } + write(bytes) { + let offset = this._write(4 + bytes.length); + writeUInt32LE(this.buf, bytes.length, offset); + this.buf.set(bytes, offset + 4); + } + _read(delta) { + if (this.ptr + delta > this.buf.length) { + throw new Error("Invalid packet"); + } + this.ptr += delta; + return this.ptr - delta; + } + read8() { + return this.buf[this._read(1)]; + } + read32() { + return readUInt32LE(this.buf, this._read(4)); + } + read() { + let length = this.read32(); + let bytes = new Uint8Array(length); + let ptr = this._read(bytes.length); + bytes.set(this.buf.subarray(ptr, ptr + length)); + return bytes; + } +}; +var encodeUTF8; +var decodeUTF8; +var encodeInvariant; +if (typeof TextEncoder !== "undefined" && typeof TextDecoder !== "undefined") { + let encoder = new TextEncoder(); + let decoder = new TextDecoder(); + encodeUTF8 = (text) => encoder.encode(text); + decodeUTF8 = (bytes) => decoder.decode(bytes); + encodeInvariant = 'new TextEncoder().encode("")'; +} else if (typeof Buffer !== "undefined") { + encodeUTF8 = (text) => Buffer.from(text); + decodeUTF8 = (bytes) => { + let { buffer, byteOffset, byteLength } = bytes; + return Buffer.from(buffer, byteOffset, byteLength).toString(); + }; + encodeInvariant = 'Buffer.from("")'; +} else { + throw new Error("No UTF-8 codec found"); +} +if (!(encodeUTF8("") instanceof Uint8Array)) + throw new Error(`Invariant violation: "${encodeInvariant} instanceof Uint8Array" is incorrectly false + +This indicates that your JavaScript environment is broken. You cannot use +esbuild in this environment because esbuild relies on this invariant. This +is not a problem with esbuild. You need to fix your environment instead. +`); +function readUInt32LE(buffer, offset) { + return buffer[offset++] | buffer[offset++] << 8 | buffer[offset++] << 16 | buffer[offset++] << 24; +} +function writeUInt32LE(buffer, value, offset) { + buffer[offset++] = value; + buffer[offset++] = value >> 8; + buffer[offset++] = value >> 16; + buffer[offset++] = value >> 24; +} + +// lib/shared/common.ts +var quote = JSON.stringify; +var buildLogLevelDefault = "warning"; +var transformLogLevelDefault = "silent"; +function validateTarget(target) { + validateStringValue(target, "target"); + if (target.indexOf(",") >= 0) throw new Error(`Invalid target: ${target}`); + return target; +} +var canBeAnything = () => null; +var mustBeBoolean = (value) => typeof value === "boolean" ? null : "a boolean"; +var mustBeString = (value) => typeof value === "string" ? null : "a string"; +var mustBeRegExp = (value) => value instanceof RegExp ? null : "a RegExp object"; +var mustBeInteger = (value) => typeof value === "number" && value === (value | 0) ? null : "an integer"; +var mustBeFunction = (value) => typeof value === "function" ? null : "a function"; +var mustBeArray = (value) => Array.isArray(value) ? null : "an array"; +var mustBeObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? null : "an object"; +var mustBeEntryPoints = (value) => typeof value === "object" && value !== null ? null : "an array or an object"; +var mustBeWebAssemblyModule = (value) => value instanceof WebAssembly.Module ? null : "a WebAssembly.Module"; +var mustBeObjectOrNull = (value) => typeof value === "object" && !Array.isArray(value) ? null : "an object or null"; +var mustBeStringOrBoolean = (value) => typeof value === "string" || typeof value === "boolean" ? null : "a string or a boolean"; +var mustBeStringOrObject = (value) => typeof value === "string" || typeof value === "object" && value !== null && !Array.isArray(value) ? null : "a string or an object"; +var mustBeStringOrArray = (value) => typeof value === "string" || Array.isArray(value) ? null : "a string or an array"; +var mustBeStringOrUint8Array = (value) => typeof value === "string" || value instanceof Uint8Array ? null : "a string or a Uint8Array"; +var mustBeStringOrURL = (value) => typeof value === "string" || value instanceof URL ? null : "a string or a URL"; +function getFlag(object, keys, key, mustBeFn) { + let value = object[key]; + keys[key + ""] = true; + if (value === void 0) return void 0; + let mustBe = mustBeFn(value); + if (mustBe !== null) throw new Error(`${quote(key)} must be ${mustBe}`); + return value; +} +function checkForInvalidFlags(object, keys, where) { + for (let key in object) { + if (!(key in keys)) { + throw new Error(`Invalid option ${where}: ${quote(key)}`); + } + } +} +function validateInitializeOptions(options) { + let keys = /* @__PURE__ */ Object.create(null); + let wasmURL = getFlag(options, keys, "wasmURL", mustBeStringOrURL); + let wasmModule = getFlag(options, keys, "wasmModule", mustBeWebAssemblyModule); + let worker = getFlag(options, keys, "worker", mustBeBoolean); + checkForInvalidFlags(options, keys, "in initialize() call"); + return { + wasmURL, + wasmModule, + worker + }; +} +function validateMangleCache(mangleCache) { + let validated; + if (mangleCache !== void 0) { + validated = /* @__PURE__ */ Object.create(null); + for (let key in mangleCache) { + let value = mangleCache[key]; + if (typeof value === "string" || value === false) { + validated[key] = value; + } else { + throw new Error(`Expected ${quote(key)} in mangle cache to map to either a string or false`); + } + } + } + return validated; +} +function pushLogFlags(flags, options, keys, isTTY2, logLevelDefault) { + let color = getFlag(options, keys, "color", mustBeBoolean); + let logLevel = getFlag(options, keys, "logLevel", mustBeString); + let logLimit = getFlag(options, keys, "logLimit", mustBeInteger); + if (color !== void 0) flags.push(`--color=${color}`); + else if (isTTY2) flags.push(`--color=true`); + flags.push(`--log-level=${logLevel || logLevelDefault}`); + flags.push(`--log-limit=${logLimit || 0}`); +} +function validateStringValue(value, what, key) { + if (typeof value !== "string") { + throw new Error(`Expected value for ${what}${key !== void 0 ? " " + quote(key) : ""} to be a string, got ${typeof value} instead`); + } + return value; +} +function pushCommonFlags(flags, options, keys) { + let legalComments = getFlag(options, keys, "legalComments", mustBeString); + let sourceRoot = getFlag(options, keys, "sourceRoot", mustBeString); + let sourcesContent = getFlag(options, keys, "sourcesContent", mustBeBoolean); + let target = getFlag(options, keys, "target", mustBeStringOrArray); + let format = getFlag(options, keys, "format", mustBeString); + let globalName = getFlag(options, keys, "globalName", mustBeString); + let mangleProps = getFlag(options, keys, "mangleProps", mustBeRegExp); + let reserveProps = getFlag(options, keys, "reserveProps", mustBeRegExp); + let mangleQuoted = getFlag(options, keys, "mangleQuoted", mustBeBoolean); + let minify = getFlag(options, keys, "minify", mustBeBoolean); + let minifySyntax = getFlag(options, keys, "minifySyntax", mustBeBoolean); + let minifyWhitespace = getFlag(options, keys, "minifyWhitespace", mustBeBoolean); + let minifyIdentifiers = getFlag(options, keys, "minifyIdentifiers", mustBeBoolean); + let lineLimit = getFlag(options, keys, "lineLimit", mustBeInteger); + let drop = getFlag(options, keys, "drop", mustBeArray); + let dropLabels = getFlag(options, keys, "dropLabels", mustBeArray); + let charset = getFlag(options, keys, "charset", mustBeString); + let treeShaking = getFlag(options, keys, "treeShaking", mustBeBoolean); + let ignoreAnnotations = getFlag(options, keys, "ignoreAnnotations", mustBeBoolean); + let jsx = getFlag(options, keys, "jsx", mustBeString); + let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString); + let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString); + let jsxImportSource = getFlag(options, keys, "jsxImportSource", mustBeString); + let jsxDev = getFlag(options, keys, "jsxDev", mustBeBoolean); + let jsxSideEffects = getFlag(options, keys, "jsxSideEffects", mustBeBoolean); + let define = getFlag(options, keys, "define", mustBeObject); + let logOverride = getFlag(options, keys, "logOverride", mustBeObject); + let supported = getFlag(options, keys, "supported", mustBeObject); + let pure = getFlag(options, keys, "pure", mustBeArray); + let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean); + let platform = getFlag(options, keys, "platform", mustBeString); + let tsconfigRaw = getFlag(options, keys, "tsconfigRaw", mustBeStringOrObject); + if (legalComments) flags.push(`--legal-comments=${legalComments}`); + if (sourceRoot !== void 0) flags.push(`--source-root=${sourceRoot}`); + if (sourcesContent !== void 0) flags.push(`--sources-content=${sourcesContent}`); + if (target) { + if (Array.isArray(target)) flags.push(`--target=${Array.from(target).map(validateTarget).join(",")}`); + else flags.push(`--target=${validateTarget(target)}`); + } + if (format) flags.push(`--format=${format}`); + if (globalName) flags.push(`--global-name=${globalName}`); + if (platform) flags.push(`--platform=${platform}`); + if (tsconfigRaw) flags.push(`--tsconfig-raw=${typeof tsconfigRaw === "string" ? tsconfigRaw : JSON.stringify(tsconfigRaw)}`); + if (minify) flags.push("--minify"); + if (minifySyntax) flags.push("--minify-syntax"); + if (minifyWhitespace) flags.push("--minify-whitespace"); + if (minifyIdentifiers) flags.push("--minify-identifiers"); + if (lineLimit) flags.push(`--line-limit=${lineLimit}`); + if (charset) flags.push(`--charset=${charset}`); + if (treeShaking !== void 0) flags.push(`--tree-shaking=${treeShaking}`); + if (ignoreAnnotations) flags.push(`--ignore-annotations`); + if (drop) for (let what of drop) flags.push(`--drop:${validateStringValue(what, "drop")}`); + if (dropLabels) flags.push(`--drop-labels=${Array.from(dropLabels).map((what) => validateStringValue(what, "dropLabels")).join(",")}`); + if (mangleProps) flags.push(`--mangle-props=${mangleProps.source}`); + if (reserveProps) flags.push(`--reserve-props=${reserveProps.source}`); + if (mangleQuoted !== void 0) flags.push(`--mangle-quoted=${mangleQuoted}`); + if (jsx) flags.push(`--jsx=${jsx}`); + if (jsxFactory) flags.push(`--jsx-factory=${jsxFactory}`); + if (jsxFragment) flags.push(`--jsx-fragment=${jsxFragment}`); + if (jsxImportSource) flags.push(`--jsx-import-source=${jsxImportSource}`); + if (jsxDev) flags.push(`--jsx-dev`); + if (jsxSideEffects) flags.push(`--jsx-side-effects`); + if (define) { + for (let key in define) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid define: ${key}`); + flags.push(`--define:${key}=${validateStringValue(define[key], "define", key)}`); + } + } + if (logOverride) { + for (let key in logOverride) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid log override: ${key}`); + flags.push(`--log-override:${key}=${validateStringValue(logOverride[key], "log override", key)}`); + } + } + if (supported) { + for (let key in supported) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid supported: ${key}`); + const value = supported[key]; + if (typeof value !== "boolean") throw new Error(`Expected value for supported ${quote(key)} to be a boolean, got ${typeof value} instead`); + flags.push(`--supported:${key}=${value}`); + } + } + if (pure) for (let fn of pure) flags.push(`--pure:${validateStringValue(fn, "pure")}`); + if (keepNames) flags.push(`--keep-names`); +} +function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeDefault) { + var _a2; + let flags = []; + let entries = []; + let keys = /* @__PURE__ */ Object.create(null); + let stdinContents = null; + let stdinResolveDir = null; + pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); + pushCommonFlags(flags, options, keys); + let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); + let bundle = getFlag(options, keys, "bundle", mustBeBoolean); + let splitting = getFlag(options, keys, "splitting", mustBeBoolean); + let preserveSymlinks = getFlag(options, keys, "preserveSymlinks", mustBeBoolean); + let metafile = getFlag(options, keys, "metafile", mustBeBoolean); + let outfile = getFlag(options, keys, "outfile", mustBeString); + let outdir = getFlag(options, keys, "outdir", mustBeString); + let outbase = getFlag(options, keys, "outbase", mustBeString); + let tsconfig = getFlag(options, keys, "tsconfig", mustBeString); + let resolveExtensions = getFlag(options, keys, "resolveExtensions", mustBeArray); + let nodePathsInput = getFlag(options, keys, "nodePaths", mustBeArray); + let mainFields = getFlag(options, keys, "mainFields", mustBeArray); + let conditions = getFlag(options, keys, "conditions", mustBeArray); + let external = getFlag(options, keys, "external", mustBeArray); + let packages = getFlag(options, keys, "packages", mustBeString); + let alias = getFlag(options, keys, "alias", mustBeObject); + let loader = getFlag(options, keys, "loader", mustBeObject); + let outExtension = getFlag(options, keys, "outExtension", mustBeObject); + let publicPath = getFlag(options, keys, "publicPath", mustBeString); + let entryNames = getFlag(options, keys, "entryNames", mustBeString); + let chunkNames = getFlag(options, keys, "chunkNames", mustBeString); + let assetNames = getFlag(options, keys, "assetNames", mustBeString); + let inject = getFlag(options, keys, "inject", mustBeArray); + let banner = getFlag(options, keys, "banner", mustBeObject); + let footer = getFlag(options, keys, "footer", mustBeObject); + let entryPoints = getFlag(options, keys, "entryPoints", mustBeEntryPoints); + let absWorkingDir = getFlag(options, keys, "absWorkingDir", mustBeString); + let stdin = getFlag(options, keys, "stdin", mustBeObject); + let write = (_a2 = getFlag(options, keys, "write", mustBeBoolean)) != null ? _a2 : writeDefault; + let allowOverwrite = getFlag(options, keys, "allowOverwrite", mustBeBoolean); + let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); + keys.plugins = true; + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (sourcemap) flags.push(`--sourcemap${sourcemap === true ? "" : `=${sourcemap}`}`); + if (bundle) flags.push("--bundle"); + if (allowOverwrite) flags.push("--allow-overwrite"); + if (splitting) flags.push("--splitting"); + if (preserveSymlinks) flags.push("--preserve-symlinks"); + if (metafile) flags.push(`--metafile`); + if (outfile) flags.push(`--outfile=${outfile}`); + if (outdir) flags.push(`--outdir=${outdir}`); + if (outbase) flags.push(`--outbase=${outbase}`); + if (tsconfig) flags.push(`--tsconfig=${tsconfig}`); + if (packages) flags.push(`--packages=${packages}`); + if (resolveExtensions) { + let values = []; + for (let value of resolveExtensions) { + validateStringValue(value, "resolve extension"); + if (value.indexOf(",") >= 0) throw new Error(`Invalid resolve extension: ${value}`); + values.push(value); + } + flags.push(`--resolve-extensions=${values.join(",")}`); + } + if (publicPath) flags.push(`--public-path=${publicPath}`); + if (entryNames) flags.push(`--entry-names=${entryNames}`); + if (chunkNames) flags.push(`--chunk-names=${chunkNames}`); + if (assetNames) flags.push(`--asset-names=${assetNames}`); + if (mainFields) { + let values = []; + for (let value of mainFields) { + validateStringValue(value, "main field"); + if (value.indexOf(",") >= 0) throw new Error(`Invalid main field: ${value}`); + values.push(value); + } + flags.push(`--main-fields=${values.join(",")}`); + } + if (conditions) { + let values = []; + for (let value of conditions) { + validateStringValue(value, "condition"); + if (value.indexOf(",") >= 0) throw new Error(`Invalid condition: ${value}`); + values.push(value); + } + flags.push(`--conditions=${values.join(",")}`); + } + if (external) for (let name of external) flags.push(`--external:${validateStringValue(name, "external")}`); + if (alias) { + for (let old in alias) { + if (old.indexOf("=") >= 0) throw new Error(`Invalid package name in alias: ${old}`); + flags.push(`--alias:${old}=${validateStringValue(alias[old], "alias", old)}`); + } + } + if (banner) { + for (let type in banner) { + if (type.indexOf("=") >= 0) throw new Error(`Invalid banner file type: ${type}`); + flags.push(`--banner:${type}=${validateStringValue(banner[type], "banner", type)}`); + } + } + if (footer) { + for (let type in footer) { + if (type.indexOf("=") >= 0) throw new Error(`Invalid footer file type: ${type}`); + flags.push(`--footer:${type}=${validateStringValue(footer[type], "footer", type)}`); + } + } + if (inject) for (let path3 of inject) flags.push(`--inject:${validateStringValue(path3, "inject")}`); + if (loader) { + for (let ext in loader) { + if (ext.indexOf("=") >= 0) throw new Error(`Invalid loader extension: ${ext}`); + flags.push(`--loader:${ext}=${validateStringValue(loader[ext], "loader", ext)}`); + } + } + if (outExtension) { + for (let ext in outExtension) { + if (ext.indexOf("=") >= 0) throw new Error(`Invalid out extension: ${ext}`); + flags.push(`--out-extension:${ext}=${validateStringValue(outExtension[ext], "out extension", ext)}`); + } + } + if (entryPoints) { + if (Array.isArray(entryPoints)) { + for (let i = 0, n = entryPoints.length; i < n; i++) { + let entryPoint = entryPoints[i]; + if (typeof entryPoint === "object" && entryPoint !== null) { + let entryPointKeys = /* @__PURE__ */ Object.create(null); + let input = getFlag(entryPoint, entryPointKeys, "in", mustBeString); + let output = getFlag(entryPoint, entryPointKeys, "out", mustBeString); + checkForInvalidFlags(entryPoint, entryPointKeys, "in entry point at index " + i); + if (input === void 0) throw new Error('Missing property "in" for entry point at index ' + i); + if (output === void 0) throw new Error('Missing property "out" for entry point at index ' + i); + entries.push([output, input]); + } else { + entries.push(["", validateStringValue(entryPoint, "entry point at index " + i)]); + } + } + } else { + for (let key in entryPoints) { + entries.push([key, validateStringValue(entryPoints[key], "entry point", key)]); + } + } + } + if (stdin) { + let stdinKeys = /* @__PURE__ */ Object.create(null); + let contents = getFlag(stdin, stdinKeys, "contents", mustBeStringOrUint8Array); + let resolveDir = getFlag(stdin, stdinKeys, "resolveDir", mustBeString); + let sourcefile = getFlag(stdin, stdinKeys, "sourcefile", mustBeString); + let loader2 = getFlag(stdin, stdinKeys, "loader", mustBeString); + checkForInvalidFlags(stdin, stdinKeys, 'in "stdin" object'); + if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); + if (loader2) flags.push(`--loader=${loader2}`); + if (resolveDir) stdinResolveDir = resolveDir; + if (typeof contents === "string") stdinContents = encodeUTF8(contents); + else if (contents instanceof Uint8Array) stdinContents = contents; + } + let nodePaths = []; + if (nodePathsInput) { + for (let value of nodePathsInput) { + value += ""; + nodePaths.push(value); + } + } + return { + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir, + nodePaths, + mangleCache: validateMangleCache(mangleCache) + }; +} +function flagsForTransformOptions(callName, options, isTTY2, logLevelDefault) { + let flags = []; + let keys = /* @__PURE__ */ Object.create(null); + pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); + pushCommonFlags(flags, options, keys); + let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); + let sourcefile = getFlag(options, keys, "sourcefile", mustBeString); + let loader = getFlag(options, keys, "loader", mustBeString); + let banner = getFlag(options, keys, "banner", mustBeString); + let footer = getFlag(options, keys, "footer", mustBeString); + let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (sourcemap) flags.push(`--sourcemap=${sourcemap === true ? "external" : sourcemap}`); + if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); + if (loader) flags.push(`--loader=${loader}`); + if (banner) flags.push(`--banner=${banner}`); + if (footer) flags.push(`--footer=${footer}`); + return { + flags, + mangleCache: validateMangleCache(mangleCache) + }; +} +function createChannel(streamIn) { + const requestCallbacksByKey = {}; + const closeData = { didClose: false, reason: "" }; + let responseCallbacks = {}; + let nextRequestID = 0; + let nextBuildKey = 0; + let stdout = new Uint8Array(16 * 1024); + let stdoutUsed = 0; + let readFromStdout = (chunk) => { + let limit = stdoutUsed + chunk.length; + if (limit > stdout.length) { + let swap = new Uint8Array(limit * 2); + swap.set(stdout); + stdout = swap; + } + stdout.set(chunk, stdoutUsed); + stdoutUsed += chunk.length; + let offset = 0; + while (offset + 4 <= stdoutUsed) { + let length = readUInt32LE(stdout, offset); + if (offset + 4 + length > stdoutUsed) { + break; + } + offset += 4; + handleIncomingPacket(stdout.subarray(offset, offset + length)); + offset += length; + } + if (offset > 0) { + stdout.copyWithin(0, offset, stdoutUsed); + stdoutUsed -= offset; + } + }; + let afterClose = (error) => { + closeData.didClose = true; + if (error) closeData.reason = ": " + (error.message || error); + const text = "The service was stopped" + closeData.reason; + for (let id in responseCallbacks) { + responseCallbacks[id](text, null); + } + responseCallbacks = {}; + }; + let sendRequest = (refs, value, callback) => { + if (closeData.didClose) return callback("The service is no longer running" + closeData.reason, null); + let id = nextRequestID++; + responseCallbacks[id] = (error, response) => { + try { + callback(error, response); + } finally { + if (refs) refs.unref(); + } + }; + if (refs) refs.ref(); + streamIn.writeToStdin(encodePacket({ id, isRequest: true, value })); + }; + let sendResponse = (id, value) => { + if (closeData.didClose) throw new Error("The service is no longer running" + closeData.reason); + streamIn.writeToStdin(encodePacket({ id, isRequest: false, value })); + }; + let handleRequest = async (id, request) => { + try { + if (request.command === "ping") { + sendResponse(id, {}); + return; + } + if (typeof request.key === "number") { + const requestCallbacks = requestCallbacksByKey[request.key]; + if (!requestCallbacks) { + return; + } + const callback = requestCallbacks[request.command]; + if (callback) { + await callback(id, request); + return; + } + } + throw new Error(`Invalid command: ` + request.command); + } catch (e) { + const errors = [extractErrorMessageV8(e, streamIn, null, void 0, "")]; + try { + sendResponse(id, { errors }); + } catch { + } + } + }; + let isFirstPacket = true; + let handleIncomingPacket = (bytes) => { + if (isFirstPacket) { + isFirstPacket = false; + let binaryVersion = String.fromCharCode(...bytes); + if (binaryVersion !== "0.23.1") { + throw new Error(`Cannot start service: Host version "${"0.23.1"}" does not match binary version ${quote(binaryVersion)}`); + } + return; + } + let packet = decodePacket(bytes); + if (packet.isRequest) { + handleRequest(packet.id, packet.value); + } else { + let callback = responseCallbacks[packet.id]; + delete responseCallbacks[packet.id]; + if (packet.value.error) callback(packet.value.error, {}); + else callback(null, packet.value); + } + }; + let buildOrContext = ({ callName, refs, options, isTTY: isTTY2, defaultWD: defaultWD2, callback }) => { + let refCount = 0; + const buildKey = nextBuildKey++; + const requestCallbacks = {}; + const buildRefs = { + ref() { + if (++refCount === 1) { + if (refs) refs.ref(); + } + }, + unref() { + if (--refCount === 0) { + delete requestCallbacksByKey[buildKey]; + if (refs) refs.unref(); + } + } + }; + requestCallbacksByKey[buildKey] = requestCallbacks; + buildRefs.ref(); + buildOrContextImpl( + callName, + buildKey, + sendRequest, + sendResponse, + buildRefs, + streamIn, + requestCallbacks, + options, + isTTY2, + defaultWD2, + (err, res) => { + try { + callback(err, res); + } finally { + buildRefs.unref(); + } + } + ); + }; + let transform2 = ({ callName, refs, input, options, isTTY: isTTY2, fs: fs3, callback }) => { + const details = createObjectStash(); + let start = (inputPath) => { + try { + if (typeof input !== "string" && !(input instanceof Uint8Array)) + throw new Error('The input to "transform" must be a string or a Uint8Array'); + let { + flags, + mangleCache + } = flagsForTransformOptions(callName, options, isTTY2, transformLogLevelDefault); + let request = { + command: "transform", + flags, + inputFS: inputPath !== null, + input: inputPath !== null ? encodeUTF8(inputPath) : typeof input === "string" ? encodeUTF8(input) : input + }; + if (mangleCache) request.mangleCache = mangleCache; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + let errors = replaceDetailsInMessages(response.errors, details); + let warnings = replaceDetailsInMessages(response.warnings, details); + let outstanding = 1; + let next = () => { + if (--outstanding === 0) { + let result = { + warnings, + code: response.code, + map: response.map, + mangleCache: void 0, + legalComments: void 0 + }; + if ("legalComments" in response) result.legalComments = response == null ? void 0 : response.legalComments; + if (response.mangleCache) result.mangleCache = response == null ? void 0 : response.mangleCache; + callback(null, result); + } + }; + if (errors.length > 0) return callback(failureErrorWithLog("Transform failed", errors, warnings), null); + if (response.codeFS) { + outstanding++; + fs3.readFile(response.code, (err, contents) => { + if (err !== null) { + callback(err, null); + } else { + response.code = contents; + next(); + } + }); + } + if (response.mapFS) { + outstanding++; + fs3.readFile(response.map, (err, contents) => { + if (err !== null) { + callback(err, null); + } else { + response.map = contents; + next(); + } + }); + } + next(); + }); + } catch (e) { + let flags = []; + try { + pushLogFlags(flags, options, {}, isTTY2, transformLogLevelDefault); + } catch { + } + const error = extractErrorMessageV8(e, streamIn, details, void 0, ""); + sendRequest(refs, { command: "error", flags, error }, () => { + error.detail = details.load(error.detail); + callback(failureErrorWithLog("Transform failed", [error], []), null); + }); + } + }; + if ((typeof input === "string" || input instanceof Uint8Array) && input.length > 1024 * 1024) { + let next = start; + start = () => fs3.writeFile(input, next); + } + start(null); + }; + let formatMessages2 = ({ callName, refs, messages, options, callback }) => { + if (!options) throw new Error(`Missing second argument in ${callName}() call`); + let keys = {}; + let kind = getFlag(options, keys, "kind", mustBeString); + let color = getFlag(options, keys, "color", mustBeBoolean); + let terminalWidth = getFlag(options, keys, "terminalWidth", mustBeInteger); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (kind === void 0) throw new Error(`Missing "kind" in ${callName}() call`); + if (kind !== "error" && kind !== "warning") throw new Error(`Expected "kind" to be "error" or "warning" in ${callName}() call`); + let request = { + command: "format-msgs", + messages: sanitizeMessages(messages, "messages", null, "", terminalWidth), + isWarning: kind === "warning" + }; + if (color !== void 0) request.color = color; + if (terminalWidth !== void 0) request.terminalWidth = terminalWidth; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + callback(null, response.messages); + }); + }; + let analyzeMetafile2 = ({ callName, refs, metafile, options, callback }) => { + if (options === void 0) options = {}; + let keys = {}; + let color = getFlag(options, keys, "color", mustBeBoolean); + let verbose = getFlag(options, keys, "verbose", mustBeBoolean); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + let request = { + command: "analyze-metafile", + metafile + }; + if (color !== void 0) request.color = color; + if (verbose !== void 0) request.verbose = verbose; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + callback(null, response.result); + }); + }; + return { + readFromStdout, + afterClose, + service: { + buildOrContext, + transform: transform2, + formatMessages: formatMessages2, + analyzeMetafile: analyzeMetafile2 + } + }; +} +function buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, options, isTTY2, defaultWD2, callback) { + const details = createObjectStash(); + const isContext = callName === "context"; + const handleError = (e, pluginName) => { + const flags = []; + try { + pushLogFlags(flags, options, {}, isTTY2, buildLogLevelDefault); + } catch { + } + const message = extractErrorMessageV8(e, streamIn, details, void 0, pluginName); + sendRequest(refs, { command: "error", flags, error: message }, () => { + message.detail = details.load(message.detail); + callback(failureErrorWithLog(isContext ? "Context failed" : "Build failed", [message], []), null); + }); + }; + let plugins; + if (typeof options === "object") { + const value = options.plugins; + if (value !== void 0) { + if (!Array.isArray(value)) return handleError(new Error(`"plugins" must be an array`), ""); + plugins = value; + } + } + if (plugins && plugins.length > 0) { + if (streamIn.isSync) return handleError(new Error("Cannot use plugins in synchronous API calls"), ""); + handlePlugins( + buildKey, + sendRequest, + sendResponse, + refs, + streamIn, + requestCallbacks, + options, + plugins, + details + ).then( + (result) => { + if (!result.ok) return handleError(result.error, result.pluginName); + try { + buildOrContextContinue(result.requestPlugins, result.runOnEndCallbacks, result.scheduleOnDisposeCallbacks); + } catch (e) { + handleError(e, ""); + } + }, + (e) => handleError(e, "") + ); + return; + } + try { + buildOrContextContinue(null, (result, done) => done([], []), () => { + }); + } catch (e) { + handleError(e, ""); + } + function buildOrContextContinue(requestPlugins, runOnEndCallbacks, scheduleOnDisposeCallbacks) { + const writeDefault = streamIn.hasFS; + const { + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir, + nodePaths, + mangleCache + } = flagsForBuildOptions(callName, options, isTTY2, buildLogLevelDefault, writeDefault); + if (write && !streamIn.hasFS) throw new Error(`The "write" option is unavailable in this environment`); + const request = { + command: "build", + key: buildKey, + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir: absWorkingDir || defaultWD2, + nodePaths, + context: isContext + }; + if (requestPlugins) request.plugins = requestPlugins; + if (mangleCache) request.mangleCache = mangleCache; + const buildResponseToResult = (response, callback2) => { + const result = { + errors: replaceDetailsInMessages(response.errors, details), + warnings: replaceDetailsInMessages(response.warnings, details), + outputFiles: void 0, + metafile: void 0, + mangleCache: void 0 + }; + const originalErrors = result.errors.slice(); + const originalWarnings = result.warnings.slice(); + if (response.outputFiles) result.outputFiles = response.outputFiles.map(convertOutputFiles); + if (response.metafile) result.metafile = JSON.parse(response.metafile); + if (response.mangleCache) result.mangleCache = response.mangleCache; + if (response.writeToStdout !== void 0) console.log(decodeUTF8(response.writeToStdout).replace(/\n$/, "")); + runOnEndCallbacks(result, (onEndErrors, onEndWarnings) => { + if (originalErrors.length > 0 || onEndErrors.length > 0) { + const error = failureErrorWithLog("Build failed", originalErrors.concat(onEndErrors), originalWarnings.concat(onEndWarnings)); + return callback2(error, null, onEndErrors, onEndWarnings); + } + callback2(null, result, onEndErrors, onEndWarnings); + }); + }; + let latestResultPromise; + let provideLatestResult; + if (isContext) + requestCallbacks["on-end"] = (id, request2) => new Promise((resolve) => { + buildResponseToResult(request2, (err, result, onEndErrors, onEndWarnings) => { + const response = { + errors: onEndErrors, + warnings: onEndWarnings + }; + if (provideLatestResult) provideLatestResult(err, result); + latestResultPromise = void 0; + provideLatestResult = void 0; + sendResponse(id, response); + resolve(); + }); + }); + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + if (!isContext) { + return buildResponseToResult(response, (err, res) => { + scheduleOnDisposeCallbacks(); + return callback(err, res); + }); + } + if (response.errors.length > 0) { + return callback(failureErrorWithLog("Context failed", response.errors, response.warnings), null); + } + let didDispose = false; + const result = { + rebuild: () => { + if (!latestResultPromise) latestResultPromise = new Promise((resolve, reject) => { + let settlePromise; + provideLatestResult = (err, result2) => { + if (!settlePromise) settlePromise = () => err ? reject(err) : resolve(result2); + }; + const triggerAnotherBuild = () => { + const request2 = { + command: "rebuild", + key: buildKey + }; + sendRequest(refs, request2, (error2, response2) => { + if (error2) { + reject(new Error(error2)); + } else if (settlePromise) { + settlePromise(); + } else { + triggerAnotherBuild(); + } + }); + }; + triggerAnotherBuild(); + }); + return latestResultPromise; + }, + watch: (options2 = {}) => new Promise((resolve, reject) => { + if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`); + const keys = {}; + checkForInvalidFlags(options2, keys, `in watch() call`); + const request2 = { + command: "watch", + key: buildKey + }; + sendRequest(refs, request2, (error2) => { + if (error2) reject(new Error(error2)); + else resolve(void 0); + }); + }), + serve: (options2 = {}) => new Promise((resolve, reject) => { + if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`); + const keys = {}; + const port = getFlag(options2, keys, "port", mustBeInteger); + const host = getFlag(options2, keys, "host", mustBeString); + const servedir = getFlag(options2, keys, "servedir", mustBeString); + const keyfile = getFlag(options2, keys, "keyfile", mustBeString); + const certfile = getFlag(options2, keys, "certfile", mustBeString); + const fallback = getFlag(options2, keys, "fallback", mustBeString); + const onRequest = getFlag(options2, keys, "onRequest", mustBeFunction); + checkForInvalidFlags(options2, keys, `in serve() call`); + const request2 = { + command: "serve", + key: buildKey, + onRequest: !!onRequest + }; + if (port !== void 0) request2.port = port; + if (host !== void 0) request2.host = host; + if (servedir !== void 0) request2.servedir = servedir; + if (keyfile !== void 0) request2.keyfile = keyfile; + if (certfile !== void 0) request2.certfile = certfile; + if (fallback !== void 0) request2.fallback = fallback; + sendRequest(refs, request2, (error2, response2) => { + if (error2) return reject(new Error(error2)); + if (onRequest) { + requestCallbacks["serve-request"] = (id, request3) => { + onRequest(request3.args); + sendResponse(id, {}); + }; + } + resolve(response2); + }); + }), + cancel: () => new Promise((resolve) => { + if (didDispose) return resolve(); + const request2 = { + command: "cancel", + key: buildKey + }; + sendRequest(refs, request2, () => { + resolve(); + }); + }), + dispose: () => new Promise((resolve) => { + if (didDispose) return resolve(); + didDispose = true; + const request2 = { + command: "dispose", + key: buildKey + }; + sendRequest(refs, request2, () => { + resolve(); + scheduleOnDisposeCallbacks(); + refs.unref(); + }); + }) + }; + refs.ref(); + callback(null, result); + }); + } +} +var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, initialOptions, plugins, details) => { + let onStartCallbacks = []; + let onEndCallbacks = []; + let onResolveCallbacks = {}; + let onLoadCallbacks = {}; + let onDisposeCallbacks = []; + let nextCallbackID = 0; + let i = 0; + let requestPlugins = []; + let isSetupDone = false; + plugins = [...plugins]; + for (let item of plugins) { + let keys = {}; + if (typeof item !== "object") throw new Error(`Plugin at index ${i} must be an object`); + const name = getFlag(item, keys, "name", mustBeString); + if (typeof name !== "string" || name === "") throw new Error(`Plugin at index ${i} is missing a name`); + try { + let setup = getFlag(item, keys, "setup", mustBeFunction); + if (typeof setup !== "function") throw new Error(`Plugin is missing a setup function`); + checkForInvalidFlags(item, keys, `on plugin ${quote(name)}`); + let plugin = { + name, + onStart: false, + onEnd: false, + onResolve: [], + onLoad: [] + }; + i++; + let resolve = (path3, options = {}) => { + if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed'); + if (typeof path3 !== "string") throw new Error(`The path to resolve must be a string`); + let keys2 = /* @__PURE__ */ Object.create(null); + let pluginName = getFlag(options, keys2, "pluginName", mustBeString); + let importer = getFlag(options, keys2, "importer", mustBeString); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + let resolveDir = getFlag(options, keys2, "resolveDir", mustBeString); + let kind = getFlag(options, keys2, "kind", mustBeString); + let pluginData = getFlag(options, keys2, "pluginData", canBeAnything); + let importAttributes = getFlag(options, keys2, "with", mustBeObject); + checkForInvalidFlags(options, keys2, "in resolve() call"); + return new Promise((resolve2, reject) => { + const request = { + command: "resolve", + path: path3, + key: buildKey, + pluginName: name + }; + if (pluginName != null) request.pluginName = pluginName; + if (importer != null) request.importer = importer; + if (namespace != null) request.namespace = namespace; + if (resolveDir != null) request.resolveDir = resolveDir; + if (kind != null) request.kind = kind; + else throw new Error(`Must specify "kind" when calling "resolve"`); + if (pluginData != null) request.pluginData = details.store(pluginData); + if (importAttributes != null) request.with = sanitizeStringMap(importAttributes, "with"); + sendRequest(refs, request, (error, response) => { + if (error !== null) reject(new Error(error)); + else resolve2({ + errors: replaceDetailsInMessages(response.errors, details), + warnings: replaceDetailsInMessages(response.warnings, details), + path: response.path, + external: response.external, + sideEffects: response.sideEffects, + namespace: response.namespace, + suffix: response.suffix, + pluginData: details.load(response.pluginData) + }); + }); + }); + }; + let promise = setup({ + initialOptions, + resolve, + onStart(callback) { + let registeredText = `This error came from the "onStart" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart"); + onStartCallbacks.push({ name, callback, note: registeredNote }); + plugin.onStart = true; + }, + onEnd(callback) { + let registeredText = `This error came from the "onEnd" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onEnd"); + onEndCallbacks.push({ name, callback, note: registeredNote }); + plugin.onEnd = true; + }, + onResolve(options, callback) { + let registeredText = `This error came from the "onResolve" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onResolve"); + let keys2 = {}; + let filter = getFlag(options, keys2, "filter", mustBeRegExp); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + checkForInvalidFlags(options, keys2, `in onResolve() call for plugin ${quote(name)}`); + if (filter == null) throw new Error(`onResolve() call is missing a filter`); + let id = nextCallbackID++; + onResolveCallbacks[id] = { name, callback, note: registeredNote }; + plugin.onResolve.push({ id, filter: filter.source, namespace: namespace || "" }); + }, + onLoad(options, callback) { + let registeredText = `This error came from the "onLoad" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onLoad"); + let keys2 = {}; + let filter = getFlag(options, keys2, "filter", mustBeRegExp); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + checkForInvalidFlags(options, keys2, `in onLoad() call for plugin ${quote(name)}`); + if (filter == null) throw new Error(`onLoad() call is missing a filter`); + let id = nextCallbackID++; + onLoadCallbacks[id] = { name, callback, note: registeredNote }; + plugin.onLoad.push({ id, filter: filter.source, namespace: namespace || "" }); + }, + onDispose(callback) { + onDisposeCallbacks.push(callback); + }, + esbuild: streamIn.esbuild + }); + if (promise) await promise; + requestPlugins.push(plugin); + } catch (e) { + return { ok: false, error: e, pluginName: name }; + } + } + requestCallbacks["on-start"] = async (id, request) => { + details.clear(); + let response = { errors: [], warnings: [] }; + await Promise.all(onStartCallbacks.map(async ({ name, callback, note }) => { + try { + let result = await callback(); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onStart() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + checkForInvalidFlags(result, keys, `from onStart() callback in plugin ${quote(name)}`); + if (errors != null) response.errors.push(...sanitizeMessages(errors, "errors", details, name, void 0)); + if (warnings != null) response.warnings.push(...sanitizeMessages(warnings, "warnings", details, name, void 0)); + } + } catch (e) { + response.errors.push(extractErrorMessageV8(e, streamIn, details, note && note(), name)); + } + })); + sendResponse(id, response); + }; + requestCallbacks["on-resolve"] = async (id, request) => { + let response = {}, name = "", callback, note; + for (let id2 of request.ids) { + try { + ({ name, callback, note } = onResolveCallbacks[id2]); + let result = await callback({ + path: request.path, + importer: request.importer, + namespace: request.namespace, + resolveDir: request.resolveDir, + kind: request.kind, + pluginData: details.load(request.pluginData), + with: request.with + }); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onResolve() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let pluginName = getFlag(result, keys, "pluginName", mustBeString); + let path3 = getFlag(result, keys, "path", mustBeString); + let namespace = getFlag(result, keys, "namespace", mustBeString); + let suffix = getFlag(result, keys, "suffix", mustBeString); + let external = getFlag(result, keys, "external", mustBeBoolean); + let sideEffects = getFlag(result, keys, "sideEffects", mustBeBoolean); + let pluginData = getFlag(result, keys, "pluginData", canBeAnything); + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); + let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); + checkForInvalidFlags(result, keys, `from onResolve() callback in plugin ${quote(name)}`); + response.id = id2; + if (pluginName != null) response.pluginName = pluginName; + if (path3 != null) response.path = path3; + if (namespace != null) response.namespace = namespace; + if (suffix != null) response.suffix = suffix; + if (external != null) response.external = external; + if (sideEffects != null) response.sideEffects = sideEffects; + if (pluginData != null) response.pluginData = details.store(pluginData); + if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); + if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); + break; + } + } catch (e) { + response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; + break; + } + } + sendResponse(id, response); + }; + requestCallbacks["on-load"] = async (id, request) => { + let response = {}, name = "", callback, note; + for (let id2 of request.ids) { + try { + ({ name, callback, note } = onLoadCallbacks[id2]); + let result = await callback({ + path: request.path, + namespace: request.namespace, + suffix: request.suffix, + pluginData: details.load(request.pluginData), + with: request.with + }); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onLoad() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let pluginName = getFlag(result, keys, "pluginName", mustBeString); + let contents = getFlag(result, keys, "contents", mustBeStringOrUint8Array); + let resolveDir = getFlag(result, keys, "resolveDir", mustBeString); + let pluginData = getFlag(result, keys, "pluginData", canBeAnything); + let loader = getFlag(result, keys, "loader", mustBeString); + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); + let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); + checkForInvalidFlags(result, keys, `from onLoad() callback in plugin ${quote(name)}`); + response.id = id2; + if (pluginName != null) response.pluginName = pluginName; + if (contents instanceof Uint8Array) response.contents = contents; + else if (contents != null) response.contents = encodeUTF8(contents); + if (resolveDir != null) response.resolveDir = resolveDir; + if (pluginData != null) response.pluginData = details.store(pluginData); + if (loader != null) response.loader = loader; + if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); + if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); + break; + } + } catch (e) { + response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; + break; + } + } + sendResponse(id, response); + }; + let runOnEndCallbacks = (result, done) => done([], []); + if (onEndCallbacks.length > 0) { + runOnEndCallbacks = (result, done) => { + (async () => { + const onEndErrors = []; + const onEndWarnings = []; + for (const { name, callback, note } of onEndCallbacks) { + let newErrors; + let newWarnings; + try { + const value = await callback(result); + if (value != null) { + if (typeof value !== "object") throw new Error(`Expected onEnd() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let errors = getFlag(value, keys, "errors", mustBeArray); + let warnings = getFlag(value, keys, "warnings", mustBeArray); + checkForInvalidFlags(value, keys, `from onEnd() callback in plugin ${quote(name)}`); + if (errors != null) newErrors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) newWarnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + } + } catch (e) { + newErrors = [extractErrorMessageV8(e, streamIn, details, note && note(), name)]; + } + if (newErrors) { + onEndErrors.push(...newErrors); + try { + result.errors.push(...newErrors); + } catch { + } + } + if (newWarnings) { + onEndWarnings.push(...newWarnings); + try { + result.warnings.push(...newWarnings); + } catch { + } + } + } + done(onEndErrors, onEndWarnings); + })(); + }; + } + let scheduleOnDisposeCallbacks = () => { + for (const cb of onDisposeCallbacks) { + setTimeout(() => cb(), 0); + } + }; + isSetupDone = true; + return { + ok: true, + requestPlugins, + runOnEndCallbacks, + scheduleOnDisposeCallbacks + }; +}; +function createObjectStash() { + const map = /* @__PURE__ */ new Map(); + let nextID = 0; + return { + clear() { + map.clear(); + }, + load(id) { + return map.get(id); + }, + store(value) { + if (value === void 0) return -1; + const id = nextID++; + map.set(id, value); + return id; + } + }; +} +function extractCallerV8(e, streamIn, ident) { + let note; + let tried = false; + return () => { + if (tried) return note; + tried = true; + try { + let lines = (e.stack + "").split("\n"); + lines.splice(1, 1); + let location = parseStackLinesV8(streamIn, lines, ident); + if (location) { + note = { text: e.message, location }; + return note; + } + } catch { + } + }; +} +function extractErrorMessageV8(e, streamIn, stash, note, pluginName) { + let text = "Internal error"; + let location = null; + try { + text = (e && e.message || e) + ""; + } catch { + } + try { + location = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), ""); + } catch { + } + return { id: "", pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 }; +} +function parseStackLinesV8(streamIn, lines, ident) { + let at = " at "; + if (streamIn.readFileSync && !lines[0].startsWith(at) && lines[1].startsWith(at)) { + for (let i = 1; i < lines.length; i++) { + let line = lines[i]; + if (!line.startsWith(at)) continue; + line = line.slice(at.length); + while (true) { + let match = /^(?:new |async )?\S+ \((.*)\)$/.exec(line); + if (match) { + line = match[1]; + continue; + } + match = /^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(line); + if (match) { + line = match[1]; + continue; + } + match = /^(\S+):(\d+):(\d+)$/.exec(line); + if (match) { + let contents; + try { + contents = streamIn.readFileSync(match[1], "utf8"); + } catch { + break; + } + let lineText = contents.split(/\r\n|\r|\n|\u2028|\u2029/)[+match[2] - 1] || ""; + let column = +match[3] - 1; + let length = lineText.slice(column, column + ident.length) === ident ? ident.length : 0; + return { + file: match[1], + namespace: "file", + line: +match[2], + column: encodeUTF8(lineText.slice(0, column)).length, + length: encodeUTF8(lineText.slice(column, column + length)).length, + lineText: lineText + "\n" + lines.slice(1).join("\n"), + suggestion: "" + }; + } + break; + } + } + } + return null; +} +function failureErrorWithLog(text, errors, warnings) { + let limit = 5; + text += errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i) => { + if (i === limit) return "\n..."; + if (!e.location) return ` +error: ${e.text}`; + let { file, line, column } = e.location; + let pluginText = e.pluginName ? `[plugin: ${e.pluginName}] ` : ""; + return ` +${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`; + }).join(""); + let error = new Error(text); + for (const [key, value] of [["errors", errors], ["warnings", warnings]]) { + Object.defineProperty(error, key, { + configurable: true, + enumerable: true, + get: () => value, + set: (value2) => Object.defineProperty(error, key, { + configurable: true, + enumerable: true, + value: value2 + }) + }); + } + return error; +} +function replaceDetailsInMessages(messages, stash) { + for (const message of messages) { + message.detail = stash.load(message.detail); + } + return messages; +} +function sanitizeLocation(location, where, terminalWidth) { + if (location == null) return null; + let keys = {}; + let file = getFlag(location, keys, "file", mustBeString); + let namespace = getFlag(location, keys, "namespace", mustBeString); + let line = getFlag(location, keys, "line", mustBeInteger); + let column = getFlag(location, keys, "column", mustBeInteger); + let length = getFlag(location, keys, "length", mustBeInteger); + let lineText = getFlag(location, keys, "lineText", mustBeString); + let suggestion = getFlag(location, keys, "suggestion", mustBeString); + checkForInvalidFlags(location, keys, where); + if (lineText) { + const relevantASCII = lineText.slice( + 0, + (column && column > 0 ? column : 0) + (length && length > 0 ? length : 0) + (terminalWidth && terminalWidth > 0 ? terminalWidth : 80) + ); + if (!/[\x7F-\uFFFF]/.test(relevantASCII) && !/\n/.test(lineText)) { + lineText = relevantASCII; + } + } + return { + file: file || "", + namespace: namespace || "", + line: line || 0, + column: column || 0, + length: length || 0, + lineText: lineText || "", + suggestion: suggestion || "" + }; +} +function sanitizeMessages(messages, property, stash, fallbackPluginName, terminalWidth) { + let messagesClone = []; + let index = 0; + for (const message of messages) { + let keys = {}; + let id = getFlag(message, keys, "id", mustBeString); + let pluginName = getFlag(message, keys, "pluginName", mustBeString); + let text = getFlag(message, keys, "text", mustBeString); + let location = getFlag(message, keys, "location", mustBeObjectOrNull); + let notes = getFlag(message, keys, "notes", mustBeArray); + let detail = getFlag(message, keys, "detail", canBeAnything); + let where = `in element ${index} of "${property}"`; + checkForInvalidFlags(message, keys, where); + let notesClone = []; + if (notes) { + for (const note of notes) { + let noteKeys = {}; + let noteText = getFlag(note, noteKeys, "text", mustBeString); + let noteLocation = getFlag(note, noteKeys, "location", mustBeObjectOrNull); + checkForInvalidFlags(note, noteKeys, where); + notesClone.push({ + text: noteText || "", + location: sanitizeLocation(noteLocation, where, terminalWidth) + }); + } + } + messagesClone.push({ + id: id || "", + pluginName: pluginName || fallbackPluginName, + text: text || "", + location: sanitizeLocation(location, where, terminalWidth), + notes: notesClone, + detail: stash ? stash.store(detail) : -1 + }); + index++; + } + return messagesClone; +} +function sanitizeStringArray(values, property) { + const result = []; + for (const value of values) { + if (typeof value !== "string") throw new Error(`${quote(property)} must be an array of strings`); + result.push(value); + } + return result; +} +function sanitizeStringMap(map, property) { + const result = /* @__PURE__ */ Object.create(null); + for (const key in map) { + const value = map[key]; + if (typeof value !== "string") throw new Error(`key ${quote(key)} in object ${quote(property)} must be a string`); + result[key] = value; + } + return result; +} +function convertOutputFiles({ path: path3, contents, hash }) { + let text = null; + return { + path: path3, + contents, + hash, + get text() { + const binary = this.contents; + if (text === null || binary !== contents) { + contents = binary; + text = decodeUTF8(binary); + } + return text; + } + }; +} + +// lib/npm/node-platform.ts +var fs = require("fs"); +var os = require("os"); +var path = require("path"); +var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH; +var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild"; +var packageDarwin_arm64 = "@esbuild/darwin-arm64"; +var packageDarwin_x64 = "@esbuild/darwin-x64"; +var knownWindowsPackages = { + "win32 arm64 LE": "@esbuild/win32-arm64", + "win32 ia32 LE": "@esbuild/win32-ia32", + "win32 x64 LE": "@esbuild/win32-x64" +}; +var knownUnixlikePackages = { + "aix ppc64 BE": "@esbuild/aix-ppc64", + "android arm64 LE": "@esbuild/android-arm64", + "darwin arm64 LE": "@esbuild/darwin-arm64", + "darwin x64 LE": "@esbuild/darwin-x64", + "freebsd arm64 LE": "@esbuild/freebsd-arm64", + "freebsd x64 LE": "@esbuild/freebsd-x64", + "linux arm LE": "@esbuild/linux-arm", + "linux arm64 LE": "@esbuild/linux-arm64", + "linux ia32 LE": "@esbuild/linux-ia32", + "linux mips64el LE": "@esbuild/linux-mips64el", + "linux ppc64 LE": "@esbuild/linux-ppc64", + "linux riscv64 LE": "@esbuild/linux-riscv64", + "linux s390x BE": "@esbuild/linux-s390x", + "linux x64 LE": "@esbuild/linux-x64", + "linux loong64 LE": "@esbuild/linux-loong64", + "netbsd x64 LE": "@esbuild/netbsd-x64", + "openbsd arm64 LE": "@esbuild/openbsd-arm64", + "openbsd x64 LE": "@esbuild/openbsd-x64", + "sunos x64 LE": "@esbuild/sunos-x64" +}; +var knownWebAssemblyFallbackPackages = { + "android arm LE": "@esbuild/android-arm", + "android x64 LE": "@esbuild/android-x64" +}; +function pkgAndSubpathForCurrentPlatform() { + let pkg; + let subpath; + let isWASM = false; + let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`; + if (platformKey in knownWindowsPackages) { + pkg = knownWindowsPackages[platformKey]; + subpath = "esbuild.exe"; + } else if (platformKey in knownUnixlikePackages) { + pkg = knownUnixlikePackages[platformKey]; + subpath = "bin/esbuild"; + } else if (platformKey in knownWebAssemblyFallbackPackages) { + pkg = knownWebAssemblyFallbackPackages[platformKey]; + subpath = "bin/esbuild"; + isWASM = true; + } else { + throw new Error(`Unsupported platform: ${platformKey}`); + } + return { pkg, subpath, isWASM }; +} +function pkgForSomeOtherPlatform() { + const libMainJS = require.resolve("esbuild"); + const nodeModulesDirectory = path.dirname(path.dirname(path.dirname(libMainJS))); + if (path.basename(nodeModulesDirectory) === "node_modules") { + for (const unixKey in knownUnixlikePackages) { + try { + const pkg = knownUnixlikePackages[unixKey]; + if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg; + } catch { + } + } + for (const windowsKey in knownWindowsPackages) { + try { + const pkg = knownWindowsPackages[windowsKey]; + if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg; + } catch { + } + } + } + return null; +} +function downloadedBinPath(pkg, subpath) { + const esbuildLibDir = path.dirname(require.resolve("esbuild")); + return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`); +} +function generateBinPath() { + if (isValidBinaryPath(ESBUILD_BINARY_PATH)) { + if (!fs.existsSync(ESBUILD_BINARY_PATH)) { + console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`); + } else { + return { binPath: ESBUILD_BINARY_PATH, isWASM: false }; + } + } + const { pkg, subpath, isWASM } = pkgAndSubpathForCurrentPlatform(); + let binPath; + try { + binPath = require.resolve(`${pkg}/${subpath}`); + } catch (e) { + binPath = downloadedBinPath(pkg, subpath); + if (!fs.existsSync(binPath)) { + try { + require.resolve(pkg); + } catch { + const otherPkg = pkgForSomeOtherPlatform(); + if (otherPkg) { + let suggestions = ` +Specifically the "${otherPkg}" package is present but this platform +needs the "${pkg}" package instead. People often get into this +situation by installing esbuild on Windows or macOS and copying "node_modules" +into a Docker image that runs Linux, or by copying "node_modules" between +Windows and WSL environments. + +If you are installing with npm, you can try not copying the "node_modules" +directory when you copy the files over, and running "npm ci" or "npm install" +on the destination platform after the copy. Or you could consider using yarn +instead of npm which has built-in support for installing a package on multiple +platforms simultaneously. + +If you are installing with yarn, you can try listing both this platform and the +other platform in your ".yarnrc.yml" file using the "supportedArchitectures" +feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures +Keep in mind that this means multiple copies of esbuild will be present. +`; + if (pkg === packageDarwin_x64 && otherPkg === packageDarwin_arm64 || pkg === packageDarwin_arm64 && otherPkg === packageDarwin_x64) { + suggestions = ` +Specifically the "${otherPkg}" package is present but this platform +needs the "${pkg}" package instead. People often get into this +situation by installing esbuild with npm running inside of Rosetta 2 and then +trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta +2 is Apple's on-the-fly x86_64-to-arm64 translation service). + +If you are installing with npm, you can try ensuring that both npm and node are +not running under Rosetta 2 and then reinstalling esbuild. This likely involves +changing how you installed npm and/or node. For example, installing node with +the universal installer here should work: https://nodejs.org/en/download/. Or +you could consider using yarn instead of npm which has built-in support for +installing a package on multiple platforms simultaneously. + +If you are installing with yarn, you can try listing both "arm64" and "x64" +in your ".yarnrc.yml" file using the "supportedArchitectures" feature: +https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures +Keep in mind that this means multiple copies of esbuild will be present. +`; + } + throw new Error(` +You installed esbuild for another platform than the one you're currently using. +This won't work because esbuild is written with native code and needs to +install a platform-specific binary executable. +${suggestions} +Another alternative is to use the "esbuild-wasm" package instead, which works +the same way on all platforms. But it comes with a heavy performance cost and +can sometimes be 10x slower than the "esbuild" package, so you may also not +want to do that. +`); + } + throw new Error(`The package "${pkg}" could not be found, and is needed by esbuild. + +If you are installing esbuild with npm, make sure that you don't specify the +"--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature +of "package.json" is used by esbuild to install the correct binary executable +for your current platform.`); + } + throw e; + } + } + if (/\.zip\//.test(binPath)) { + let pnpapi; + try { + pnpapi = require("pnpapi"); + } catch (e) { + } + if (pnpapi) { + const root = pnpapi.getPackageInformation(pnpapi.topLevel).packageLocation; + const binTargetPath = path.join( + root, + "node_modules", + ".cache", + "esbuild", + `pnpapi-${pkg.replace("/", "-")}-${"0.23.1"}-${path.basename(subpath)}` + ); + if (!fs.existsSync(binTargetPath)) { + fs.mkdirSync(path.dirname(binTargetPath), { recursive: true }); + fs.copyFileSync(binPath, binTargetPath); + fs.chmodSync(binTargetPath, 493); + } + return { binPath: binTargetPath, isWASM }; + } + } + return { binPath, isWASM }; +} + +// lib/npm/node.ts +var child_process = require("child_process"); +var crypto = require("crypto"); +var path2 = require("path"); +var fs2 = require("fs"); +var os2 = require("os"); +var tty = require("tty"); +var worker_threads; +if (process.env.ESBUILD_WORKER_THREADS !== "0") { + try { + worker_threads = require("worker_threads"); + } catch { + } + let [major, minor] = process.versions.node.split("."); + if ( + // { + if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) { + throw new Error( + `The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle. + +More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.` + ); + } + if (false) { + return ["node", [path2.join(__dirname, "..", "bin", "esbuild")]]; + } else { + const { binPath, isWASM } = generateBinPath(); + if (isWASM) { + return ["node", [binPath]]; + } else { + return [binPath, []]; + } + } +}; +var isTTY = () => tty.isatty(2); +var fsSync = { + readFile(tempFile, callback) { + try { + let contents = fs2.readFileSync(tempFile, "utf8"); + try { + fs2.unlinkSync(tempFile); + } catch { + } + callback(null, contents); + } catch (err) { + callback(err, null); + } + }, + writeFile(contents, callback) { + try { + let tempFile = randomFileName(); + fs2.writeFileSync(tempFile, contents); + callback(tempFile); + } catch { + callback(null); + } + } +}; +var fsAsync = { + readFile(tempFile, callback) { + try { + fs2.readFile(tempFile, "utf8", (err, contents) => { + try { + fs2.unlink(tempFile, () => callback(err, contents)); + } catch { + callback(err, contents); + } + }); + } catch (err) { + callback(err, null); + } + }, + writeFile(contents, callback) { + try { + let tempFile = randomFileName(); + fs2.writeFile(tempFile, contents, (err) => err !== null ? callback(null) : callback(tempFile)); + } catch { + callback(null); + } + } +}; +var version = "0.23.1"; +var build = (options) => ensureServiceIsRunning().build(options); +var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions); +var transform = (input, options) => ensureServiceIsRunning().transform(input, options); +var formatMessages = (messages, options) => ensureServiceIsRunning().formatMessages(messages, options); +var analyzeMetafile = (messages, options) => ensureServiceIsRunning().analyzeMetafile(messages, options); +var buildSync = (options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.buildSync(options); + } + let result; + runServiceSync((service) => service.buildOrContext({ + callName: "buildSync", + refs: null, + options, + isTTY: isTTY(), + defaultWD, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var transformSync = (input, options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.transformSync(input, options); + } + let result; + runServiceSync((service) => service.transform({ + callName: "transformSync", + refs: null, + input, + options: options || {}, + isTTY: isTTY(), + fs: fsSync, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var formatMessagesSync = (messages, options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.formatMessagesSync(messages, options); + } + let result; + runServiceSync((service) => service.formatMessages({ + callName: "formatMessagesSync", + refs: null, + messages, + options, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var analyzeMetafileSync = (metafile, options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.analyzeMetafileSync(metafile, options); + } + let result; + runServiceSync((service) => service.analyzeMetafile({ + callName: "analyzeMetafileSync", + refs: null, + metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), + options, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var stop = () => { + if (stopService) stopService(); + if (workerThreadService) workerThreadService.stop(); + return Promise.resolve(); +}; +var initializeWasCalled = false; +var initialize = (options) => { + options = validateInitializeOptions(options || {}); + if (options.wasmURL) throw new Error(`The "wasmURL" option only works in the browser`); + if (options.wasmModule) throw new Error(`The "wasmModule" option only works in the browser`); + if (options.worker) throw new Error(`The "worker" option only works in the browser`); + if (initializeWasCalled) throw new Error('Cannot call "initialize" more than once'); + ensureServiceIsRunning(); + initializeWasCalled = true; + return Promise.resolve(); +}; +var defaultWD = process.cwd(); +var longLivedService; +var stopService; +var ensureServiceIsRunning = () => { + if (longLivedService) return longLivedService; + let [command, args] = esbuildCommandAndArgs(); + let child = child_process.spawn(command, args.concat(`--service=${"0.23.1"}`, "--ping"), { + windowsHide: true, + stdio: ["pipe", "pipe", "inherit"], + cwd: defaultWD + }); + let { readFromStdout, afterClose, service } = createChannel({ + writeToStdin(bytes) { + child.stdin.write(bytes, (err) => { + if (err) afterClose(err); + }); + }, + readFileSync: fs2.readFileSync, + isSync: false, + hasFS: true, + esbuild: node_exports + }); + child.stdin.on("error", afterClose); + child.on("error", afterClose); + const stdin = child.stdin; + const stdout = child.stdout; + stdout.on("data", readFromStdout); + stdout.on("end", afterClose); + stopService = () => { + stdin.destroy(); + stdout.destroy(); + child.kill(); + initializeWasCalled = false; + longLivedService = void 0; + stopService = void 0; + }; + let refCount = 0; + child.unref(); + if (stdin.unref) { + stdin.unref(); + } + if (stdout.unref) { + stdout.unref(); + } + const refs = { + ref() { + if (++refCount === 1) child.ref(); + }, + unref() { + if (--refCount === 0) child.unref(); + } + }; + longLivedService = { + build: (options) => new Promise((resolve, reject) => { + service.buildOrContext({ + callName: "build", + refs, + options, + isTTY: isTTY(), + defaultWD, + callback: (err, res) => err ? reject(err) : resolve(res) + }); + }), + context: (options) => new Promise((resolve, reject) => service.buildOrContext({ + callName: "context", + refs, + options, + isTTY: isTTY(), + defaultWD, + callback: (err, res) => err ? reject(err) : resolve(res) + })), + transform: (input, options) => new Promise((resolve, reject) => service.transform({ + callName: "transform", + refs, + input, + options: options || {}, + isTTY: isTTY(), + fs: fsAsync, + callback: (err, res) => err ? reject(err) : resolve(res) + })), + formatMessages: (messages, options) => new Promise((resolve, reject) => service.formatMessages({ + callName: "formatMessages", + refs, + messages, + options, + callback: (err, res) => err ? reject(err) : resolve(res) + })), + analyzeMetafile: (metafile, options) => new Promise((resolve, reject) => service.analyzeMetafile({ + callName: "analyzeMetafile", + refs, + metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), + options, + callback: (err, res) => err ? reject(err) : resolve(res) + })) + }; + return longLivedService; +}; +var runServiceSync = (callback) => { + let [command, args] = esbuildCommandAndArgs(); + let stdin = new Uint8Array(); + let { readFromStdout, afterClose, service } = createChannel({ + writeToStdin(bytes) { + if (stdin.length !== 0) throw new Error("Must run at most one command"); + stdin = bytes; + }, + isSync: true, + hasFS: true, + esbuild: node_exports + }); + callback(service); + let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.23.1"}`), { + cwd: defaultWD, + windowsHide: true, + input: stdin, + // We don't know how large the output could be. If it's too large, the + // command will fail with ENOBUFS. Reserve 16mb for now since that feels + // like it should be enough. Also allow overriding this with an environment + // variable. + maxBuffer: +process.env.ESBUILD_MAX_BUFFER || 16 * 1024 * 1024 + }); + readFromStdout(stdout); + afterClose(null); +}; +var randomFileName = () => { + return path2.join(os2.tmpdir(), `esbuild-${crypto.randomBytes(32).toString("hex")}`); +}; +var workerThreadService = null; +var startWorkerThreadService = (worker_threads2) => { + let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel(); + let worker = new worker_threads2.Worker(__filename, { + workerData: { workerPort, defaultWD, esbuildVersion: "0.23.1" }, + transferList: [workerPort], + // From node's documentation: https://nodejs.org/api/worker_threads.html + // + // Take care when launching worker threads from preload scripts (scripts loaded + // and run using the `-r` command line flag). Unless the `execArgv` option is + // explicitly set, new Worker threads automatically inherit the command line flags + // from the running process and will preload the same preload scripts as the main + // thread. If the preload script unconditionally launches a worker thread, every + // thread spawned will spawn another until the application crashes. + // + execArgv: [] + }); + let nextID = 0; + let fakeBuildError = (text) => { + let error = new Error(`Build failed with 1 error: +error: ${text}`); + let errors = [{ id: "", pluginName: "", text, location: null, notes: [], detail: void 0 }]; + error.errors = errors; + error.warnings = []; + return error; + }; + let validateBuildSyncOptions = (options) => { + if (!options) return; + let plugins = options.plugins; + if (plugins && plugins.length > 0) throw fakeBuildError(`Cannot use plugins in synchronous API calls`); + }; + let applyProperties = (object, properties) => { + for (let key in properties) { + object[key] = properties[key]; + } + }; + let runCallSync = (command, args) => { + let id = nextID++; + let sharedBuffer = new SharedArrayBuffer(8); + let sharedBufferView = new Int32Array(sharedBuffer); + let msg = { sharedBuffer, id, command, args }; + worker.postMessage(msg); + let status = Atomics.wait(sharedBufferView, 0, 0); + if (status !== "ok" && status !== "not-equal") throw new Error("Internal error: Atomics.wait() failed: " + status); + let { message: { id: id2, resolve, reject, properties } } = worker_threads2.receiveMessageOnPort(mainPort); + if (id !== id2) throw new Error(`Internal error: Expected id ${id} but got id ${id2}`); + if (reject) { + applyProperties(reject, properties); + throw reject; + } + return resolve; + }; + worker.unref(); + return { + buildSync(options) { + validateBuildSyncOptions(options); + return runCallSync("build", [options]); + }, + transformSync(input, options) { + return runCallSync("transform", [input, options]); + }, + formatMessagesSync(messages, options) { + return runCallSync("formatMessages", [messages, options]); + }, + analyzeMetafileSync(metafile, options) { + return runCallSync("analyzeMetafile", [metafile, options]); + }, + stop() { + worker.terminate(); + workerThreadService = null; + } + }; +}; +var startSyncServiceWorker = () => { + let workerPort = worker_threads.workerData.workerPort; + let parentPort = worker_threads.parentPort; + let extractProperties = (object) => { + let properties = {}; + if (object && typeof object === "object") { + for (let key in object) { + properties[key] = object[key]; + } + } + return properties; + }; + try { + let service = ensureServiceIsRunning(); + defaultWD = worker_threads.workerData.defaultWD; + parentPort.on("message", (msg) => { + (async () => { + let { sharedBuffer, id, command, args } = msg; + let sharedBufferView = new Int32Array(sharedBuffer); + try { + switch (command) { + case "build": + workerPort.postMessage({ id, resolve: await service.build(args[0]) }); + break; + case "transform": + workerPort.postMessage({ id, resolve: await service.transform(args[0], args[1]) }); + break; + case "formatMessages": + workerPort.postMessage({ id, resolve: await service.formatMessages(args[0], args[1]) }); + break; + case "analyzeMetafile": + workerPort.postMessage({ id, resolve: await service.analyzeMetafile(args[0], args[1]) }); + break; + default: + throw new Error(`Invalid command: ${command}`); + } + } catch (reject) { + workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); + } + Atomics.add(sharedBufferView, 0, 1); + Atomics.notify(sharedBufferView, 0, Infinity); + })(); + }); + } catch (reject) { + parentPort.on("message", (msg) => { + let { sharedBuffer, id } = msg; + let sharedBufferView = new Int32Array(sharedBuffer); + workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); + Atomics.add(sharedBufferView, 0, 1); + Atomics.notify(sharedBufferView, 0, Infinity); + }); + } +}; +if (isInternalWorkerThread) { + startSyncServiceWorker(); +} +var node_default = node_exports; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + analyzeMetafile, + analyzeMetafileSync, + build, + buildSync, + context, + formatMessages, + formatMessagesSync, + initialize, + stop, + transform, + transformSync, + version +}); diff --git a/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/node_modules/.bin/esbuild b/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/node_modules/.bin/esbuild new file mode 100755 index 0000000..5c5fbd0 --- /dev/null +++ b/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/node_modules/.bin/esbuild @@ -0,0 +1,14 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -z "$NODE_PATH" ]; then + export NODE_PATH="/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/bin/node_modules:/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/node_modules:/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/esbuild@0.23.1/node_modules:/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/node_modules" +else + export NODE_PATH="/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/bin/node_modules:/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/node_modules:/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/esbuild@0.23.1/node_modules:/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/node_modules:$NODE_PATH" +fi +"$basedir/../../bin/esbuild" "$@" +exit $? diff --git a/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/package.json b/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/package.json new file mode 100644 index 0000000..aaef74b --- /dev/null +++ b/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/package.json @@ -0,0 +1,47 @@ +{ + "name": "esbuild", + "version": "0.23.1", + "description": "An extremely fast JavaScript and CSS bundler and minifier.", + "repository": { + "type": "git", + "url": "git+https://github.com/evanw/esbuild.git" + }, + "scripts": { + "postinstall": "node install.js" + }, + "main": "lib/main.js", + "types": "lib/main.d.ts", + "engines": { + "node": ">=18" + }, + "bin": { + "esbuild": "bin/esbuild" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.23.1", + "@esbuild/android-arm": "0.23.1", + "@esbuild/android-arm64": "0.23.1", + "@esbuild/android-x64": "0.23.1", + "@esbuild/darwin-arm64": "0.23.1", + "@esbuild/darwin-x64": "0.23.1", + "@esbuild/freebsd-arm64": "0.23.1", + "@esbuild/freebsd-x64": "0.23.1", + "@esbuild/linux-arm": "0.23.1", + "@esbuild/linux-arm64": "0.23.1", + "@esbuild/linux-ia32": "0.23.1", + "@esbuild/linux-loong64": "0.23.1", + "@esbuild/linux-mips64el": "0.23.1", + "@esbuild/linux-ppc64": "0.23.1", + "@esbuild/linux-riscv64": "0.23.1", + "@esbuild/linux-s390x": "0.23.1", + "@esbuild/linux-x64": "0.23.1", + "@esbuild/netbsd-x64": "0.23.1", + "@esbuild/openbsd-arm64": "0.23.1", + "@esbuild/openbsd-x64": "0.23.1", + "@esbuild/sunos-x64": "0.23.1", + "@esbuild/win32-arm64": "0.23.1", + "@esbuild/win32-ia32": "0.23.1", + "@esbuild/win32-x64": "0.23.1" + }, + "license": "MIT" +} diff --git a/node_modules/.pnpm/fsevents@2.3.3/node_modules/fsevents/LICENSE b/node_modules/.pnpm/fsevents@2.3.3/node_modules/fsevents/LICENSE new file mode 100644 index 0000000..5d70441 --- /dev/null +++ b/node_modules/.pnpm/fsevents@2.3.3/node_modules/fsevents/LICENSE @@ -0,0 +1,22 @@ +MIT License +----------- + +Copyright (C) 2010-2020 by Philipp Dunkel, Ben Noordhuis, Elan Shankar, Paul Miller + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/.pnpm/fsevents@2.3.3/node_modules/fsevents/README.md b/node_modules/.pnpm/fsevents@2.3.3/node_modules/fsevents/README.md new file mode 100644 index 0000000..50373a0 --- /dev/null +++ b/node_modules/.pnpm/fsevents@2.3.3/node_modules/fsevents/README.md @@ -0,0 +1,89 @@ +# fsevents + +Native access to MacOS FSEvents in [Node.js](https://nodejs.org/) + +The FSEvents API in MacOS allows applications to register for notifications of +changes to a given directory tree. It is a very fast and lightweight alternative +to kqueue. + +This is a low-level library. For a cross-platform file watching module that +uses fsevents, check out [Chokidar](https://github.com/paulmillr/chokidar). + +## Usage + +```sh +npm install fsevents +``` + +Supports only **Node.js v8.16 and higher**. + +```js +const fsevents = require('fsevents'); + +// To start observation +const stop = fsevents.watch(__dirname, (path, flags, id) => { + const info = fsevents.getInfo(path, flags); +}); + +// To end observation +stop(); +``` + +> **Important note:** The API behaviour is slightly different from typical JS APIs. The `stop` function **must** be +> retrieved and stored somewhere, even if you don't plan to stop the watcher. If you forget it, the garbage collector +> will eventually kick in, the watcher will be unregistered, and your callbacks won't be called anymore. + +The callback passed as the second parameter to `.watch` get's called whenever the operating system detects a +a change in the file system. It takes three arguments: + +###### `fsevents.watch(dirname: string, (path: string, flags: number, id: string) => void): () => Promise` + + * `path: string` - the item in the filesystem that have been changed + * `flags: number` - a numeric value describing what the change was + * `id: string` - an unique-id identifying this specific event + + Returns closer callback which when called returns a Promise resolving when the watcher process has been shut down. + +###### `fsevents.getInfo(path: string, flags: number, id: string): FsEventInfo` + +The `getInfo` function takes the `path`, `flags` and `id` arguments and converts those parameters into a structure +that is easier to digest to determine what the change was. + +The `FsEventsInfo` has the following shape: + +```js +/** + * @typedef {'created'|'modified'|'deleted'|'moved'|'root-changed'|'cloned'|'unknown'} FsEventsEvent + * @typedef {'file'|'directory'|'symlink'} FsEventsType + */ +{ + "event": "created", // {FsEventsEvent} + "path": "file.txt", + "type": "file", // {FsEventsType} + "changes": { + "inode": true, // Had iNode Meta-Information changed + "finder": false, // Had Finder Meta-Data changed + "access": false, // Had access permissions changed + "xattrs": false // Had xAttributes changed + }, + "flags": 0x100000000 +} +``` + +## Changelog + +- v2.3 supports Apple Silicon ARM CPUs +- v2 supports node 8.16+ and reduces package size massively +- v1.2.8 supports node 6+ +- v1.2.7 supports node 4+ + +## Troubleshooting + +- I'm getting `EBADPLATFORM` `Unsupported platform for fsevents` error. +- It's fine, nothing is broken. fsevents is macos-only. Other platforms are skipped. If you want to hide this warning, report a bug to NPM bugtracker asking them to hide ebadplatform warnings by default. + +## License + +The MIT License Copyright (C) 2010-2020 by Philipp Dunkel, Ben Noordhuis, Elan Shankar, Paul Miller — see LICENSE file. + +Visit our [GitHub page](https://github.com/fsevents/fsevents) and [NPM Page](https://npmjs.org/package/fsevents) diff --git a/node_modules/.pnpm/fsevents@2.3.3/node_modules/fsevents/fsevents.d.ts b/node_modules/.pnpm/fsevents@2.3.3/node_modules/fsevents/fsevents.d.ts new file mode 100644 index 0000000..2723c04 --- /dev/null +++ b/node_modules/.pnpm/fsevents@2.3.3/node_modules/fsevents/fsevents.d.ts @@ -0,0 +1,46 @@ +declare type Event = "created" | "cloned" | "modified" | "deleted" | "moved" | "root-changed" | "unknown"; +declare type Type = "file" | "directory" | "symlink"; +declare type FileChanges = { + inode: boolean; + finder: boolean; + access: boolean; + xattrs: boolean; +}; +declare type Info = { + event: Event; + path: string; + type: Type; + changes: FileChanges; + flags: number; +}; +declare type WatchHandler = (path: string, flags: number, id: string) => void; +export declare function watch(path: string, handler: WatchHandler): () => Promise; +export declare function watch(path: string, since: number, handler: WatchHandler): () => Promise; +export declare function getInfo(path: string, flags: number): Info; +export declare const constants: { + None: 0x00000000; + MustScanSubDirs: 0x00000001; + UserDropped: 0x00000002; + KernelDropped: 0x00000004; + EventIdsWrapped: 0x00000008; + HistoryDone: 0x00000010; + RootChanged: 0x00000020; + Mount: 0x00000040; + Unmount: 0x00000080; + ItemCreated: 0x00000100; + ItemRemoved: 0x00000200; + ItemInodeMetaMod: 0x00000400; + ItemRenamed: 0x00000800; + ItemModified: 0x00001000; + ItemFinderInfoMod: 0x00002000; + ItemChangeOwner: 0x00004000; + ItemXattrMod: 0x00008000; + ItemIsFile: 0x00010000; + ItemIsDir: 0x00020000; + ItemIsSymlink: 0x00040000; + ItemIsHardlink: 0x00100000; + ItemIsLastHardlink: 0x00200000; + OwnEvent: 0x00080000; + ItemCloned: 0x00400000; +}; +export {}; diff --git a/node_modules/.pnpm/fsevents@2.3.3/node_modules/fsevents/fsevents.js b/node_modules/.pnpm/fsevents@2.3.3/node_modules/fsevents/fsevents.js new file mode 100644 index 0000000..198da98 --- /dev/null +++ b/node_modules/.pnpm/fsevents@2.3.3/node_modules/fsevents/fsevents.js @@ -0,0 +1,83 @@ +/* + ** © 2020 by Philipp Dunkel, Ben Noordhuis, Elan Shankar, Paul Miller + ** Licensed under MIT License. + */ + +/* jshint node:true */ +"use strict"; + +if (process.platform !== "darwin") { + throw new Error(`Module 'fsevents' is not compatible with platform '${process.platform}'`); +} + +const Native = require("./fsevents.node"); +const events = Native.constants; + +function watch(path, since, handler) { + if (typeof path !== "string") { + throw new TypeError(`fsevents argument 1 must be a string and not a ${typeof path}`); + } + if ("function" === typeof since && "undefined" === typeof handler) { + handler = since; + since = Native.flags.SinceNow; + } + if (typeof since !== "number") { + throw new TypeError(`fsevents argument 2 must be a number and not a ${typeof since}`); + } + if (typeof handler !== "function") { + throw new TypeError(`fsevents argument 3 must be a function and not a ${typeof handler}`); + } + + let instance = Native.start(Native.global, path, since, handler); + if (!instance) throw new Error(`could not watch: ${path}`); + return () => { + const result = instance ? Promise.resolve(instance).then(Native.stop) : Promise.resolve(undefined); + instance = undefined; + return result; + }; +} + +function getInfo(path, flags) { + return { + path, + flags, + event: getEventType(flags), + type: getFileType(flags), + changes: getFileChanges(flags), + }; +} + +function getFileType(flags) { + if (events.ItemIsFile & flags) return "file"; + if (events.ItemIsDir & flags) return "directory"; + if (events.MustScanSubDirs & flags) return "directory"; + if (events.ItemIsSymlink & flags) return "symlink"; +} +function anyIsTrue(obj) { + for (let key in obj) { + if (obj[key]) return true; + } + return false; +} +function getEventType(flags) { + if (events.ItemRemoved & flags) return "deleted"; + if (events.ItemRenamed & flags) return "moved"; + if (events.ItemCreated & flags) return "created"; + if (events.ItemModified & flags) return "modified"; + if (events.RootChanged & flags) return "root-changed"; + if (events.ItemCloned & flags) return "cloned"; + if (anyIsTrue(flags)) return "modified"; + return "unknown"; +} +function getFileChanges(flags) { + return { + inode: !!(events.ItemInodeMetaMod & flags), + finder: !!(events.ItemFinderInfoMod & flags), + access: !!(events.ItemChangeOwner & flags), + xattrs: !!(events.ItemXattrMod & flags), + }; +} + +exports.watch = watch; +exports.getInfo = getInfo; +exports.constants = events; diff --git a/node_modules/.pnpm/fsevents@2.3.3/node_modules/fsevents/fsevents.node b/node_modules/.pnpm/fsevents@2.3.3/node_modules/fsevents/fsevents.node new file mode 100755 index 0000000..1cc3345 Binary files /dev/null and b/node_modules/.pnpm/fsevents@2.3.3/node_modules/fsevents/fsevents.node differ diff --git a/node_modules/.pnpm/fsevents@2.3.3/node_modules/fsevents/package.json b/node_modules/.pnpm/fsevents@2.3.3/node_modules/fsevents/package.json new file mode 100644 index 0000000..5d0ee15 --- /dev/null +++ b/node_modules/.pnpm/fsevents@2.3.3/node_modules/fsevents/package.json @@ -0,0 +1,62 @@ +{ + "name": "fsevents", + "version": "2.3.3", + "description": "Native Access to MacOS FSEvents", + "main": "fsevents.js", + "types": "fsevents.d.ts", + "os": [ + "darwin" + ], + "files": [ + "fsevents.d.ts", + "fsevents.js", + "fsevents.node" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + }, + "scripts": { + "clean": "node-gyp clean && rm -f fsevents.node", + "build": "node-gyp clean && rm -f fsevents.node && node-gyp rebuild && node-gyp clean", + "test": "/bin/bash ./test.sh 2>/dev/null", + "prepublishOnly": "npm run build" + }, + "repository": { + "type": "git", + "url": "https://github.com/fsevents/fsevents.git" + }, + "keywords": [ + "fsevents", + "mac" + ], + "contributors": [ + { + "name": "Philipp Dunkel", + "email": "pip@pipobscure.com" + }, + { + "name": "Ben Noordhuis", + "email": "info@bnoordhuis.nl" + }, + { + "name": "Elan Shankar", + "email": "elan.shanker@gmail.com" + }, + { + "name": "Miroslav Bajtoš", + "email": "mbajtoss@gmail.com" + }, + { + "name": "Paul Miller", + "url": "https://paulmillr.com" + } + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/fsevents/fsevents/issues" + }, + "homepage": "https://github.com/fsevents/fsevents", + "devDependencies": { + "node-gyp": "^9.4.0" + } +} diff --git a/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/get-tsconfig/LICENSE b/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/get-tsconfig/LICENSE new file mode 100644 index 0000000..51e4fd8 --- /dev/null +++ b/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/get-tsconfig/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Hiroki Osame + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/get-tsconfig/README.md b/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/get-tsconfig/README.md new file mode 100644 index 0000000..c49c662 --- /dev/null +++ b/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/get-tsconfig/README.md @@ -0,0 +1,231 @@ +

+ +

+

+ get-tsconfig +
+ +

+ +Find and parse `tsconfig.json` files. + +### Features +- Zero dependency (not even TypeScript) +- Tested against TypeScript for correctness +- Supports comments & dangling commas in `tsconfig.json` +- Resolves [`extends`](https://www.typescriptlang.org/tsconfig/#extends) +- Fully typed `tsconfig.json` +- Validates and throws parsing errors +- Tiny! `7 kB` Minified + Gzipped + +
+ +

+ + +

+

Already a sponsor? Join the discussion in the Development repo!

+ +## Install + +```bash +npm install get-tsconfig +``` + +## Why? +For TypeScript related tooling to correctly parse `tsconfig.json` file without depending on TypeScript. + +## API + +### getTsconfig(searchPath?, configName?, cache?) +Searches for a `tsconfig.json` file and parses it. Returns `null` if a config file cannot be found, or an object containing the path and parsed TSConfig object if found. + +Returns: + +```ts +type TsconfigResult = { + + /** + * The path to the tsconfig.json file + */ + path: string + + /** + * The resolved tsconfig.json file + */ + config: TsConfigJsonResolved +} +``` + +#### searchPath +Type: `string` + +Default: `process.cwd()` + +Accepts a path to a file or directory to search up for a `tsconfig.json` file. + +#### configName +Type: `string` + +Default: `tsconfig.json` + +The file name of the TypeScript config file. + +#### cache +Type: `Map` + +Default: `new Map()` + +Optional cache for fs operations. + +#### Example + +```ts +import { getTsconfig } from 'get-tsconfig' + +// Searches for tsconfig.json starting in the current directory +console.log(getTsconfig()) + +// Find tsconfig.json from a TypeScript file path +console.log(getTsconfig('./path/to/index.ts')) + +// Find tsconfig.json from a directory file path +console.log(getTsconfig('./path/to/directory')) + +// Explicitly pass in tsconfig.json path +console.log(getTsconfig('./path/to/tsconfig.json')) + +// Search for jsconfig.json - https://code.visualstudio.com/docs/languages/jsconfig +console.log(getTsconfig('.', 'jsconfig.json')) +``` + +--- + +### parseTsconfig(tsconfigPath, cache?) +The `tsconfig.json` parser used internally by `getTsconfig`. Returns the parsed tsconfig as `TsConfigJsonResolved`. + +#### tsconfigPath +Type: `string` + +Required path to the tsconfig file. + +#### cache +Type: `Map` + +Default: `new Map()` + +Optional cache for fs operations. + +#### Example + +```ts +import { parseTsconfig } from 'get-tsconfig' + +// Must pass in a path to an existing tsconfig.json file +console.log(parseTsconfig('./path/to/tsconfig.custom.json')) +``` + +### createFileMatcher(tsconfig: TsconfigResult, caseSensitivePaths?: boolean) + +Given a `tsconfig.json` file, it returns a file-matcher function that determines whether it should apply to a file path. + +```ts +type FileMatcher = (filePath: string) => TsconfigResult['config'] | undefined +``` + +#### tsconfig +Type: `TsconfigResult` + +Pass in the return value from `getTsconfig`, or a `TsconfigResult` object. + +#### caseSensitivePaths +Type: `boolean` + +By default, it uses [`is-fs-case-sensitive`](https://github.com/privatenumber/is-fs-case-sensitive) to detect whether the file-system is case-sensitive. + +Pass in `true` to make it case-sensitive. + +#### Example + +For example, if it's called with a `tsconfig.json` file that has `include`/`exclude`/`files` defined, the file-matcher will return the config for files that match `include`/`files`, and return `undefined` for files that don't match or match `exclude`. + +```ts +const tsconfig = getTsconfig() +const fileMatcher = tsconfig && createFileMatcher(tsconfig) + +/* + * Returns tsconfig.json if it matches the file, + * undefined if not + */ +const configForFile = fileMatcher?.('/path/to/file.ts') +const distCode = compileTypescript({ + code: sourceCode, + tsconfig: configForFile +}) +``` + +--- + +### createPathsMatcher(tsconfig: TsconfigResult) + +Given a tsconfig with [`compilerOptions.paths`](https://www.typescriptlang.org/tsconfig#paths) defined, it returns a matcher function. + +The matcher function accepts an [import specifier (the path to resolve)](https://nodejs.org/api/esm.html#terminology), checks it against `compilerOptions.paths`, and returns an array of possible paths to check: +```ts +function pathsMatcher(specifier: string): string[] +``` + +This function only returns possible paths and doesn't actually do any resolution. This helps increase compatibility wtih file/build systems which usually have their own resolvers. + +#### Example + +```ts +import { getTsconfig, createPathsMatcher } from 'get-tsconfig' + +const tsconfig = getTsconfig() +const pathsMatcher = createPathsMatcher(tsconfig) + +const exampleResolver = (request: string) => { + if (pathsMatcher) { + const tryPaths = pathsMatcher(request) + + // Check if paths in `tryPaths` exist + } +} +``` + +## FAQ + +### How can I use TypeScript to parse `tsconfig.json`? +This package is a re-implementation of TypeScript's `tsconfig.json` parser. + +However, if you already have TypeScript as a dependency, you can simply use it's API: + +```ts +import { + sys as tsSys, + findConfigFile, + readConfigFile, + parseJsonConfigFileContent +} from 'typescript' + +// Find tsconfig.json file +const tsconfigPath = findConfigFile(process.cwd(), tsSys.fileExists, 'tsconfig.json') + +// Read tsconfig.json file +const tsconfigFile = readConfigFile(tsconfigPath, tsSys.readFile) + +// Resolve extends +const parsedTsconfig = parseJsonConfigFileContent( + tsconfigFile.config, + tsSys, + path.dirname(tsconfigPath) +) +``` + +## Sponsors +

+ + + +

diff --git a/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/get-tsconfig/dist/index.cjs b/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/get-tsconfig/dist/index.cjs new file mode 100755 index 0000000..8375303 --- /dev/null +++ b/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/get-tsconfig/dist/index.cjs @@ -0,0 +1,7 @@ +"use strict";var ve=Object.defineProperty;var l=(e,t)=>ve(e,"name",{value:t,configurable:!0});var a=require("node:path"),ee=require("node:fs"),Te=require("node:module"),Ae=require("resolve-pkg-maps"),Oe=require("fs");function B(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}l(B,"slash");const M=l(e=>{const t=ee[e];return(i,...n)=>{const s=`${e}:${n.join(":")}`;let o=i==null?void 0:i.get(s);return o===void 0&&(o=Reflect.apply(t,ee,n),i==null||i.set(s,o)),o}},"cacheFs"),F=M("existsSync"),je=M("readFileSync"),d=M("statSync"),ne=l((e,t,i)=>{for(;;){const n=a.posix.join(e,t);if(F(i,n))return n;const s=a.dirname(e);if(s===e)return;e=s}},"findUp"),R=/^\.{1,2}(\/.*)?$/,J=l(e=>{const t=B(e);return R.test(t)?t:`./${t}`},"normalizeRelativePath");function _e(e,t=!1){const i=e.length;let n=0,s="",o=0,r=16,c=0,u=0,p=0,T=0,w=0;function O(f,m){let g=0,y=0;for(;g=48&&j<=57)y=y*16+j-48;else if(j>=65&&j<=70)y=y*16+j-65+10;else if(j>=97&&j<=102)y=y*16+j-97+10;else break;n++,g++}return g=i){f+=e.substring(m,n),w=2;break}const g=e.charCodeAt(n);if(g===34){f+=e.substring(m,n),n++;break}if(g===92){if(f+=e.substring(m,n),n++,n>=i){w=2;break}switch(e.charCodeAt(n++)){case 34:f+='"';break;case 92:f+="\\";break;case 47:f+="/";break;case 98:f+="\b";break;case 102:f+="\f";break;case 110:f+=` +`;break;case 114:f+="\r";break;case 116:f+=" ";break;case 117:const j=O(4,!0);j>=0?f+=String.fromCharCode(j):w=4;break;default:w=5}m=n;continue}if(g>=0&&g<=31)if(h(g)){f+=e.substring(m,n),w=2;break}else w=6;n++}return f}l(b,"scanString");function $(){if(s="",w=0,o=n,u=c,T=p,n>=i)return o=i,r=17;let f=e.charCodeAt(n);if(G(f)){do n++,s+=String.fromCharCode(f),f=e.charCodeAt(n);while(G(f));return r=15}if(h(f))return n++,s+=String.fromCharCode(f),f===13&&e.charCodeAt(n)===10&&(n++,s+=` +`),c++,p=n,r=14;switch(f){case 123:return n++,r=1;case 125:return n++,r=2;case 91:return n++,r=3;case 93:return n++,r=4;case 58:return n++,r=6;case 44:return n++,r=5;case 34:return n++,s=b(),r=10;case 47:const m=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n=12&&f<=15);return f}return l(E,"scanNextNonTrivia"),{setPosition:v,getPosition:l(()=>n,"getPosition"),scan:t?E:$,getToken:l(()=>r,"getToken"),getTokenValue:l(()=>s,"getTokenValue"),getTokenOffset:l(()=>o,"getTokenOffset"),getTokenLength:l(()=>n-o,"getTokenLength"),getTokenStartLine:l(()=>u,"getTokenStartLine"),getTokenStartCharacter:l(()=>o-T,"getTokenStartCharacter"),getTokenError:l(()=>w,"getTokenError")}}l(_e,"createScanner");function G(e){return e===32||e===9}l(G,"isWhiteSpace");function h(e){return e===10||e===13}l(h,"isLineBreak");function N(e){return e>=48&&e<=57}l(N,"isDigit");var te;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(te||(te={})),new Array(20).fill(0).map((e,t)=>" ".repeat(t));const D=200;new Array(D).fill(0).map((e,t)=>` +`+" ".repeat(t)),new Array(D).fill(0).map((e,t)=>"\r"+" ".repeat(t)),new Array(D).fill(0).map((e,t)=>`\r +`+" ".repeat(t)),new Array(D).fill(0).map((e,t)=>` +`+" ".repeat(t)),new Array(D).fill(0).map((e,t)=>"\r"+" ".repeat(t)),new Array(D).fill(0).map((e,t)=>`\r +`+" ".repeat(t));var I;(function(e){e.DEFAULT={allowTrailingComma:!1}})(I||(I={}));function $e(e,t=[],i=I.DEFAULT){let n=null,s=[];const o=[];function r(u){Array.isArray(s)?s.push(u):n!==null&&(s[n]=u)}return l(r,"onValue"),ye(e,{onObjectBegin:l(()=>{const u={};r(u),o.push(s),s=u,n=null},"onObjectBegin"),onObjectProperty:l(u=>{n=u},"onObjectProperty"),onObjectEnd:l(()=>{s=o.pop()},"onObjectEnd"),onArrayBegin:l(()=>{const u=[];r(u),o.push(s),s=u,n=null},"onArrayBegin"),onArrayEnd:l(()=>{s=o.pop()},"onArrayEnd"),onLiteralValue:r,onError:l((u,p,T)=>{t.push({error:u,offset:p,length:T})},"onError")},i),s[0]}l($e,"parse$1");function ye(e,t,i=I.DEFAULT){const n=_e(e,!1),s=[];function o(k){return k?()=>k(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}l(o,"toNoArgVisit");function r(k){return k?()=>k(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>s.slice()):()=>!0}l(r,"toNoArgVisitWithPath");function c(k){return k?_=>k(_,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}l(c,"toOneArgVisit");function u(k){return k?_=>k(_,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>s.slice()):()=>!0}l(u,"toOneArgVisitWithPath");const p=r(t.onObjectBegin),T=u(t.onObjectProperty),w=o(t.onObjectEnd),O=r(t.onArrayBegin),v=o(t.onArrayEnd),A=u(t.onLiteralValue),b=c(t.onSeparator),$=o(t.onComment),U=c(t.onError),E=i&&i.disallowComments,f=i&&i.allowTrailingComma;function m(){for(;;){const k=n.scan();switch(n.getTokenError()){case 4:g(14);break;case 5:g(15);break;case 3:g(13);break;case 1:E||g(11);break;case 2:g(12);break;case 6:g(16);break}switch(k){case 12:case 13:E?g(10):$();break;case 16:g(1);break;case 15:case 14:break;default:return k}}}l(m,"scanNext");function g(k,_=[],C=[]){if(U(k),_.length+C.length>0){let P=n.getToken();for(;P!==17;){if(_.indexOf(P)!==-1){m();break}else if(C.indexOf(P)!==-1)break;P=m()}}}l(g,"handleError");function y(k){const _=n.getTokenValue();return k?A(_):(T(_),s.push(_)),m(),!0}l(y,"parseString");function j(){switch(n.getToken()){case 11:const k=n.getTokenValue();let _=Number(k);isNaN(_)&&(g(2),_=0),A(_);break;case 7:A(null);break;case 8:A(!0);break;case 9:A(!1);break;default:return!1}return m(),!0}l(j,"parseLiteral");function ke(){return n.getToken()!==10?(g(3,[],[2,5]),!1):(y(!1),n.getToken()===6?(b(":"),m(),V()||g(4,[],[2,5])):g(5,[],[2,5]),s.pop(),!0)}l(ke,"parseProperty");function be(){p(),m();let k=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(k||g(4,[],[]),b(","),m(),n.getToken()===2&&f)break}else k&&g(6,[],[]);ke()||g(4,[],[2,5]),k=!0}return w(),n.getToken()!==2?g(7,[2],[]):m(),!0}l(be,"parseObject");function we(){O(),m();let k=!0,_=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(_||g(4,[],[]),b(","),m(),n.getToken()===4&&f)break}else _&&g(6,[],[]);k?(s.push(0),k=!1):s[s.length-1]++,V()||g(4,[],[4,5]),_=!0}return v(),k||s.pop(),n.getToken()!==4?g(8,[4],[]):m(),!0}l(we,"parseArray");function V(){switch(n.getToken()){case 3:return we();case 1:return be();case 10:return y(!0);default:return j()}}return l(V,"parseValue"),m(),n.getToken()===17?i.allowEmptyContent?!0:(g(4,[],[]),!1):V()?(n.getToken()!==17&&g(9,[],[]),!0):(g(4,[],[]),!1)}l(ye,"visit");var ie;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(ie||(ie={}));var se;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(se||(se={}));const Be=$e;var oe;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(oe||(oe={}));const le=l((e,t)=>Be(je(t,e,"utf8")),"readJsonc"),z=Symbol("implicitBaseUrl"),L="${configDir}",Fe=l(()=>{const{findPnpApi:e}=Te;return e&&e(process.cwd())},"getPnpApi"),Q=l((e,t,i,n)=>{const s=`resolveFromPackageJsonPath:${e}:${t}:${i}`;if(n!=null&&n.has(s))return n.get(s);const o=le(e,n);if(!o)return;let r=t||"tsconfig.json";if(!i&&o.exports)try{const[c]=Ae.resolveExports(o.exports,t,["require","types"]);r=c}catch{return!1}else!t&&o.tsconfig&&(r=o.tsconfig);return r=a.join(e,"..",r),n==null||n.set(s,r),r},"resolveFromPackageJsonPath"),q="package.json",H="tsconfig.json",Le=l((e,t,i)=>{let n=e;if(e===".."&&(n=a.join(n,H)),e[0]==="."&&(n=a.resolve(t,n)),a.isAbsolute(n)){if(F(i,n)){if(d(i,n).isFile())return n}else if(!n.endsWith(".json")){const v=`${n}.json`;if(F(i,v))return v}return}const[s,...o]=e.split("/"),r=s[0]==="@"?`${s}/${o.shift()}`:s,c=o.join("/"),u=Fe();if(u){const{resolveRequest:v}=u;try{if(r===e){const A=v(a.join(r,q),t);if(A){const b=Q(A,c,!1,i);if(b&&F(i,b))return b}}else{let A;try{A=v(e,t,{extensions:[".json"]})}catch{A=v(a.join(e,H),t)}if(A)return A}}catch{}}const p=ne(a.resolve(t),a.join("node_modules",r),i);if(!p||!d(i,p).isDirectory())return;const T=a.join(p,q);if(F(i,T)){const v=Q(T,c,!1,i);if(v===!1)return;if(v&&F(i,v)&&d(i,v).isFile())return v}const w=a.join(p,c),O=w.endsWith(".json");if(!O){const v=`${w}.json`;if(F(i,v))return v}if(F(i,w)){if(d(i,w).isDirectory()){const v=a.join(w,q);if(F(i,v)){const b=Q(v,"",!0,i);if(b&&F(i,b))return b}const A=a.join(w,H);if(F(i,A))return A}else if(O)return w}},"resolveExtendsPath"),X=l((e,t)=>J(a.relative(e,t)),"pathRelative"),re=["files","include","exclude"],Ue=l((e,t,i,n)=>{const s=Le(e,t,n);if(!s)throw new Error(`File '${e}' not found.`);if(i.has(s))throw new Error(`Circularity detected while resolving configuration: ${s}`);i.add(s);const o=a.dirname(s),r=ue(s,n,i);delete r.references;const{compilerOptions:c}=r;if(c){const{baseUrl:u}=c;u&&!u.startsWith(L)&&(c.baseUrl=B(a.relative(t,a.join(o,u)))||"./");let{outDir:p}=c;p&&(p.startsWith(L)||(p=a.relative(t,a.join(o,p))),c.outDir=B(p)||"./")}for(const u of re){const p=r[u];p&&(r[u]=p.map(T=>T.startsWith(L)?T:B(a.relative(t,a.join(o,T)))))}return r},"resolveExtends"),Ee=["outDir","declarationDir"],ue=l((e,t,i=new Set)=>{let n;try{n=le(e,t)||{}}catch{throw new Error(`Cannot resolve tsconfig at path: ${e}`)}if(typeof n!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);const s=a.dirname(e);if(n.compilerOptions){const{compilerOptions:o}=n;o.paths&&!o.baseUrl&&(o[z]=s)}if(n.extends){const o=Array.isArray(n.extends)?n.extends:[n.extends];delete n.extends;for(const r of o.reverse()){const c=Ue(r,s,new Set(i),t),u={...c,...n,compilerOptions:{...c.compilerOptions,...n.compilerOptions}};c.watchOptions&&(u.watchOptions={...c.watchOptions,...n.watchOptions}),n=u}}if(n.compilerOptions){const{compilerOptions:o}=n,r=["baseUrl","rootDir"];for(const c of r){const u=o[c];if(u&&!u.startsWith(L)){const p=a.resolve(s,u),T=X(s,p);o[c]=T}}for(const c of Ee){let u=o[c];u&&(Array.isArray(n.exclude)||(n.exclude=[]),n.exclude.includes(u)||n.exclude.push(u),u.startsWith(L)||(u=J(u)),o[c]=u)}}else n.compilerOptions={};if(n.include?(n.include=n.include.map(B),n.files&&delete n.files):n.files&&(n.files=n.files.map(o=>o.startsWith(L)?o:J(o))),n.watchOptions){const{watchOptions:o}=n;o.excludeDirectories&&(o.excludeDirectories=o.excludeDirectories.map(r=>B(a.resolve(s,r))))}return n},"_parseTsconfig"),S=l((e,t)=>{if(e.startsWith(L))return B(a.join(t,e.slice(L.length)))},"interpolateConfigDir"),Ne=["outDir","declarationDir","outFile","rootDir","baseUrl","tsBuildInfoFile"],ce=l((e,t=new Map)=>{const i=a.resolve(e),n=ue(i,t),s=a.dirname(i),{compilerOptions:o}=n;if(o){for(const c of Ne){const u=o[c];if(u){const p=S(u,s);o[c]=p?X(s,p):u}}for(const c of["rootDirs","typeRoots"]){const u=o[c];u&&(o[c]=u.map(p=>{const T=S(p,s);return T?X(s,T):p}))}const{paths:r}=o;if(r)for(const c of Object.keys(r))r[c]=r[c].map(u=>{var p;return(p=S(u,s))!=null?p:u})}for(const r of re){const c=n[r];c&&(n[r]=c.map(u=>{var p;return(p=S(u,s))!=null?p:u}))}return n},"parseTsconfig"),De=l((e=process.cwd(),t="tsconfig.json",i=new Map)=>{const n=ne(B(e),t,i);if(!n)return null;const s=ce(n,i);return{path:n,config:s}},"getTsconfig"),he=/\*/g,fe=l((e,t)=>{const i=e.match(he);if(i&&i.length>1)throw new Error(t)},"assertStarCount"),Pe=l(e=>{if(e.includes("*")){const[t,i]=e.split("*");return{prefix:t,suffix:i}}return e},"parsePattern"),de=l(({prefix:e,suffix:t},i)=>i.startsWith(e)&&i.endsWith(t),"isPatternMatch"),Ie=l((e,t,i)=>Object.entries(e).map(([n,s])=>(fe(n,`Pattern '${n}' can have at most one '*' character.`),{pattern:Pe(n),substitutions:s.map(o=>{if(fe(o,`Substitution '${o}' in pattern '${n}' can have at most one '*' character.`),!t&&!R.test(o))throw new Error("Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?");return a.resolve(i,o)})})),"parsePaths"),Se=l(e=>{const{compilerOptions:t}=e.config;if(!t)return null;const{baseUrl:i,paths:n}=t;if(!i&&!n)return null;const s=z in t&&t[z],o=a.resolve(a.dirname(e.path),i||s||"."),r=n?Ie(n,i,o):[];return c=>{if(R.test(c))return[];const u=[];for(const O of r){if(O.pattern===c)return O.substitutions.map(B);typeof O.pattern!="string"&&u.push(O)}let p,T=-1;for(const O of u)de(O.pattern,c)&&O.pattern.prefix.length>T&&(T=O.pattern.prefix.length,p=O);if(!p)return i?[B(a.join(o,c))]:[];const w=c.slice(p.pattern.prefix.length,c.length-p.pattern.suffix.length);return p.substitutions.map(O=>B(O.replace("*",w)))}},"createPathsMatcher"),pe=l(e=>{let t="";for(let i=0;iMath.floor(Math.random()*26),"m"),Me=l(e=>Array.from({length:e},()=>String.fromCodePoint(Ve()+(Math.random()>.5?xe:We))).join(""),"S"),Re=l((e=Oe)=>{const t=process.execPath;if(e.existsSync(t))return!e.existsSync(pe(t));const i=`/${Me(10)}`;e.writeFileSync(i,"");const n=!e.existsSync(pe(i));return e.unlinkSync(i),n},"l"),{join:x}=a.posix,Y={ts:[".ts",".tsx",".d.ts"],cts:[".cts",".d.cts"],mts:[".mts",".d.mts"]},Je=l(e=>{const t=[...Y.ts],i=[...Y.cts],n=[...Y.mts];return e!=null&&e.allowJs&&(t.push(".js",".jsx"),i.push(".cjs"),n.push(".mjs")),[...t,...i,...n]},"getSupportedExtensions"),Ge=l(e=>{const t=[];if(!e)return t;const{outDir:i,declarationDir:n}=e;return i&&t.push(i),n&&t.push(n),t},"getDefaultExcludeSpec"),ae=l(e=>e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`),"escapeForRegexp"),ze=["node_modules","bower_components","jspm_packages"],Z=`(?!(${ze.join("|")})(/|$))`,Qe=/(?:^|\/)[^.*?]+$/,ge="**/*",W="[^/]",K="[^./]",me=process.platform==="win32",qe=l(({config:e,path:t},i=Re())=>{if("extends"in e)throw new Error("tsconfig#extends must be resolved. Use getTsconfig or parseTsconfig to resolve it.");if(!a.isAbsolute(t))throw new Error("The tsconfig path must be absolute");me&&(t=B(t));const n=a.dirname(t),{files:s,include:o,exclude:r,compilerOptions:c}=e,u=s==null?void 0:s.map(b=>x(n,b)),p=Je(c),T=i?"":"i",O=(r||Ge(c)).map(b=>{const $=x(n,b),U=ae($).replaceAll(String.raw`\*\*/`,"(.+/)?").replaceAll(String.raw`\*`,`${W}*`).replaceAll(String.raw`\?`,W);return new RegExp(`^${U}($|/)`,T)}),v=s||o?o:[ge],A=v?v.map(b=>{let $=x(n,b);Qe.test($)&&($=x($,ge));const U=ae($).replaceAll(String.raw`/\*\*`,`(/${Z}${K}${W}*)*?`).replaceAll(/(\/)?\\\*/g,(E,f)=>{const m=`(${K}|(\\.(?!min\\.js$))?)*`;return f?`/${Z}${K}${m}`:m}).replaceAll(/(\/)?\\\?/g,(E,f)=>{const m=W;return f?`/${Z}${m}`:m});return new RegExp(`^${U}$`,T)}):void 0;return b=>{if(!a.isAbsolute(b))throw new Error("filePath must be absolute");if(me&&(b=B(b)),u!=null&&u.includes(b))return e;if(!(!p.some($=>b.endsWith($))||O.some($=>$.test(b)))&&A&&A.some($=>$.test(b)))return e}},"createFilesMatcher");exports.createFilesMatcher=qe,exports.createPathsMatcher=Se,exports.getTsconfig=De,exports.parseTsconfig=ce; diff --git a/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/get-tsconfig/dist/index.d.cts b/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/get-tsconfig/dist/index.d.cts new file mode 100644 index 0000000..2a63412 --- /dev/null +++ b/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/get-tsconfig/dist/index.d.cts @@ -0,0 +1,1344 @@ +declare global { + // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged. + interface SymbolConstructor { + readonly observable: symbol; + } +} + +/** +Returns a boolean for whether the two given types are equal. + +@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650 +@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796 + +Use-cases: +- If you want to make a conditional branch based on the result of a comparison of two types. + +@example +``` +import type {IsEqual} from 'type-fest'; + +// This type returns a boolean for whether the given array includes the given item. +// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal. +type Includes = + Value extends readonly [Value[0], ...infer rest] + ? IsEqual extends true + ? true + : Includes + : false; +``` + +@category Type Guard +@category Utilities +*/ +type IsEqual = + (() => G extends A ? 1 : 2) extends + (() => G extends B ? 1 : 2) + ? true + : false; + +/** +Filter out keys from an object. + +Returns `never` if `Exclude` is strictly equal to `Key`. +Returns `never` if `Key` extends `Exclude`. +Returns `Key` otherwise. + +@example +``` +type Filtered = Filter<'foo', 'foo'>; +//=> never +``` + +@example +``` +type Filtered = Filter<'bar', string>; +//=> never +``` + +@example +``` +type Filtered = Filter<'bar', 'foo'>; +//=> 'bar' +``` + +@see {Except} +*/ +type Filter = IsEqual extends true ? never : (KeyType extends ExcludeType ? never : KeyType); + +type ExceptOptions = { + /** + Disallow assigning non-specified properties. + + Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`. + + @default false + */ + requireExactProps?: boolean; +}; + +/** +Create a type from an object type without certain keys. + +We recommend setting the `requireExactProps` option to `true`. + +This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically. + +This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)). + +@example +``` +import type {Except} from 'type-fest'; + +type Foo = { + a: number; + b: string; +}; + +type FooWithoutA = Except; +//=> {b: string} + +const fooWithoutA: FooWithoutA = {a: 1, b: '2'}; +//=> errors: 'a' does not exist in type '{ b: string; }' + +type FooWithoutB = Except; +//=> {a: number} & Partial> + +const fooWithoutB: FooWithoutB = {a: 1, b: '2'}; +//=> errors at 'b': Type 'string' is not assignable to type 'undefined'. +``` + +@category Object +*/ +type Except = { + [KeyType in keyof ObjectType as Filter]: ObjectType[KeyType]; +} & (Options['requireExactProps'] extends true + ? Partial> + : {}); + +declare namespace TsConfigJson { + namespace CompilerOptions { + export type JSX = + | 'preserve' + | 'react' + | 'react-jsx' + | 'react-jsxdev' + | 'react-native'; + + export type Module = + | 'CommonJS' + | 'AMD' + | 'System' + | 'UMD' + | 'ES6' + | 'ES2015' + | 'ES2020' + | 'ES2022' + | 'ESNext' + | 'Node16' + | 'NodeNext' + | 'Preserve' + | 'None' + // Lowercase alternatives + | 'commonjs' + | 'amd' + | 'system' + | 'umd' + | 'es6' + | 'es2015' + | 'es2020' + | 'es2022' + | 'esnext' + | 'node16' + | 'nodenext' + | 'preserve' + | 'none'; + + export type NewLine = + | 'CRLF' + | 'LF' + // Lowercase alternatives + | 'crlf' + | 'lf'; + + export type Target = + | 'ES3' + | 'ES5' + | 'ES6' + | 'ES2015' + | 'ES2016' + | 'ES2017' + | 'ES2018' + | 'ES2019' + | 'ES2020' + | 'ES2021' + | 'ES2022' + | 'ESNext' + // Lowercase alternatives + | 'es3' + | 'es5' + | 'es6' + | 'es2015' + | 'es2016' + | 'es2017' + | 'es2018' + | 'es2019' + | 'es2020' + | 'es2021' + | 'es2022' + | 'esnext'; + + // eslint-disable-next-line unicorn/prevent-abbreviations + export type Lib = + | 'ES5' + | 'ES6' + | 'ES7' + | 'ES2015' + | 'ES2015.Collection' + | 'ES2015.Core' + | 'ES2015.Generator' + | 'ES2015.Iterable' + | 'ES2015.Promise' + | 'ES2015.Proxy' + | 'ES2015.Reflect' + | 'ES2015.Symbol.WellKnown' + | 'ES2015.Symbol' + | 'ES2016' + | 'ES2016.Array.Include' + | 'ES2017' + | 'ES2017.Intl' + | 'ES2017.Object' + | 'ES2017.SharedMemory' + | 'ES2017.String' + | 'ES2017.TypedArrays' + | 'ES2018' + | 'ES2018.AsyncGenerator' + | 'ES2018.AsyncIterable' + | 'ES2018.Intl' + | 'ES2018.Promise' + | 'ES2018.Regexp' + | 'ES2019' + | 'ES2019.Array' + | 'ES2019.Object' + | 'ES2019.String' + | 'ES2019.Symbol' + | 'ES2020' + | 'ES2020.BigInt' + | 'ES2020.Promise' + | 'ES2020.String' + | 'ES2020.Symbol.WellKnown' + | 'ES2020.SharedMemory' + | 'ES2020.Intl' + | 'ES2021' + | 'ES2021.Promise' + | 'ES2021.String' + | 'ES2021.WeakRef' + | 'ES2022' + | 'ES2022.Array' + | 'ES2022.Error' + | 'ES2022.Intl' + | 'ES2022.Object' + | 'ES2022.SharedMemory' + | 'ES2022.String' + | 'ES2022.RegExp' + | 'ESNext' + | 'ESNext.Array' + | 'ESNext.AsyncIterable' + | 'ESNext.BigInt' + | 'ESNext.Intl' + | 'ESNext.Promise' + | 'ESNext.String' + | 'ESNext.Symbol' + | 'ESNext.WeakRef' + | 'DOM' + | 'DOM.Iterable' + | 'ScriptHost' + | 'WebWorker' + | 'WebWorker.ImportScripts' + | 'WebWorker.Iterable' + // Lowercase alternatives + | 'es5' + | 'es6' + | 'es7' + | 'es2015' + | 'es2015.collection' + | 'es2015.core' + | 'es2015.generator' + | 'es2015.iterable' + | 'es2015.promise' + | 'es2015.proxy' + | 'es2015.reflect' + | 'es2015.symbol.wellknown' + | 'es2015.symbol' + | 'es2016' + | 'es2016.array.include' + | 'es2017' + | 'es2017.intl' + | 'es2017.object' + | 'es2017.sharedmemory' + | 'es2017.string' + | 'es2017.typedarrays' + | 'es2018' + | 'es2018.asyncgenerator' + | 'es2018.asynciterable' + | 'es2018.intl' + | 'es2018.promise' + | 'es2018.regexp' + | 'es2019' + | 'es2019.array' + | 'es2019.object' + | 'es2019.string' + | 'es2019.symbol' + | 'es2020' + | 'es2020.bigint' + | 'es2020.promise' + | 'es2020.string' + | 'es2020.symbol.wellknown' + | 'es2020.sharedmemory' + | 'es2020.intl' + | 'es2021' + | 'es2021.promise' + | 'es2021.string' + | 'es2021.weakref' + | 'es2022' + | 'es2022.array' + | 'es2022.error' + | 'es2022.intl' + | 'es2022.object' + | 'es2022.sharedmemory' + | 'es2022.string' + | 'es2022.regexp' + | 'esnext' + | 'esnext.array' + | 'esnext.asynciterable' + | 'esnext.bigint' + | 'esnext.intl' + | 'esnext.promise' + | 'esnext.string' + | 'esnext.symbol' + | 'esnext.weakref' + | 'dom' + | 'dom.iterable' + | 'scripthost' + | 'webworker' + | 'webworker.importscripts' + | 'webworker.iterable'; + + export type Plugin = { + /** + Plugin name. + */ + name: string; + }; + + export type ImportsNotUsedAsValues = + | 'remove' + | 'preserve' + | 'error'; + + export type FallbackPolling = + | 'fixedPollingInterval' + | 'priorityPollingInterval' + | 'dynamicPriorityPolling' + | 'fixedInterval' + | 'priorityInterval' + | 'dynamicPriority' + | 'fixedChunkSize'; + + export type WatchDirectory = + | 'useFsEvents' + | 'fixedPollingInterval' + | 'dynamicPriorityPolling' + | 'fixedChunkSizePolling'; + + export type WatchFile = + | 'fixedPollingInterval' + | 'priorityPollingInterval' + | 'dynamicPriorityPolling' + | 'useFsEvents' + | 'useFsEventsOnParentDirectory' + | 'fixedChunkSizePolling'; + + export type ModuleResolution = + | 'classic' + | 'node' + | 'node10' + | 'node16' + | 'nodenext' + | 'bundler' + // Pascal-cased alternatives + | 'Classic' + | 'Node' + | 'Node10' + | 'Node16' + | 'NodeNext' + | 'Bundler'; + + export type ModuleDetection = + | 'auto' + | 'legacy' + | 'force'; + + export type IgnoreDeprecations = '5.0'; + } + + export type CompilerOptions = { + /** + The character set of the input files. + + @default 'utf8' + @deprecated This option will be removed in TypeScript 5.5. + */ + charset?: string; + + /** + Enables building for project references. + + @default true + */ + composite?: boolean; + + /** + Generates corresponding d.ts files. + + @default false + */ + declaration?: boolean; + + /** + Specify output directory for generated declaration files. + */ + declarationDir?: string; + + /** + Show diagnostic information. + + @default false + */ + diagnostics?: boolean; + + /** + Reduce the number of projects loaded automatically by TypeScript. + + @default false + */ + disableReferencedProjectLoad?: boolean; + + /** + Enforces using indexed accessors for keys declared using an indexed type. + + @default false + */ + noPropertyAccessFromIndexSignature?: boolean; + + /** + Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. + + @default false + */ + emitBOM?: boolean; + + /** + Only emit `.d.ts` declaration files. + + @default false + */ + emitDeclarationOnly?: boolean; + + /** + Differentiate between undefined and not present when type checking. + + @default false + */ + exactOptionalPropertyTypes?: boolean; + + /** + Enable incremental compilation. + + @default `composite` + */ + incremental?: boolean; + + /** + Specify file to store incremental compilation information. + + @default '.tsbuildinfo' + */ + tsBuildInfoFile?: string; + + /** + Emit a single file with source maps instead of having a separate file. + + @default false + */ + inlineSourceMap?: boolean; + + /** + Emit the source alongside the sourcemaps within a single file. + + Requires `--inlineSourceMap` to be set. + + @default false + */ + inlineSources?: boolean; + + /** + Specify what JSX code is generated. + + @default 'preserve' + */ + jsx?: CompilerOptions.JSX; + + /** + Specifies the object invoked for `createElement` and `__spread` when targeting `'react'` JSX emit. + + @default 'React' + */ + reactNamespace?: string; + + /** + Specify the JSX factory function to use when targeting React JSX emit, e.g. `React.createElement` or `h`. + + @default 'React.createElement' + */ + jsxFactory?: string; + + /** + Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. + + @default 'React.Fragment' + */ + jsxFragmentFactory?: string; + + /** + Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`. + + @default 'react' + */ + jsxImportSource?: string; + + /** + Print names of files part of the compilation. + + @default false + */ + listFiles?: boolean; + + /** + Specifies the location where debugger should locate map files instead of generated locations. + */ + mapRoot?: string; + + /** + Specify module code generation: 'None', 'CommonJS', 'AMD', 'System', 'UMD', 'ES6', 'ES2015' or 'ESNext'. Only 'AMD' and 'System' can be used in conjunction with `--outFile`. 'ES6' and 'ES2015' values may be used when targeting 'ES5' or lower. + + @default ['ES3', 'ES5'].includes(target) ? 'CommonJS' : 'ES6' + */ + module?: CompilerOptions.Module; + + /** + Specifies module resolution strategy: 'node' (Node) or 'classic' (TypeScript pre 1.6). + + @default ['AMD', 'System', 'ES6'].includes(module) ? 'classic' : 'node' + */ + moduleResolution?: CompilerOptions.ModuleResolution; + + /** + Specifies the end of line sequence to be used when emitting files: 'crlf' (Windows) or 'lf' (Unix). + + @default 'LF' + */ + newLine?: CompilerOptions.NewLine; + + /** + Do not emit output. + + @default false + */ + noEmit?: boolean; + + /** + Do not generate custom helper functions like `__extends` in compiled output. + + @default false + */ + noEmitHelpers?: boolean; + + /** + Do not emit outputs if any type checking errors were reported. + + @default false + */ + noEmitOnError?: boolean; + + /** + Warn on expressions and declarations with an implied 'any' type. + + @default false + */ + noImplicitAny?: boolean; + + /** + Raise error on 'this' expressions with an implied any type. + + @default false + */ + noImplicitThis?: boolean; + + /** + Report errors on unused locals. + + @default false + */ + noUnusedLocals?: boolean; + + /** + Report errors on unused parameters. + + @default false + */ + noUnusedParameters?: boolean; + + /** + Do not include the default library file (lib.d.ts). + + @default false + */ + noLib?: boolean; + + /** + Do not add triple-slash references or module import targets to the list of compiled files. + + @default false + */ + noResolve?: boolean; + + /** + Disable strict checking of generic signatures in function types. + + @default false + @deprecated This option will be removed in TypeScript 5.5. + */ + noStrictGenericChecks?: boolean; + + /** + @deprecated use `skipLibCheck` instead. + */ + skipDefaultLibCheck?: boolean; + + /** + Skip type checking of declaration files. + + @default false + */ + skipLibCheck?: boolean; + + /** + Concatenate and emit output to single file. + */ + outFile?: string; + + /** + Redirect output structure to the directory. + */ + outDir?: string; + + /** + Do not erase const enum declarations in generated code. + + @default false + */ + preserveConstEnums?: boolean; + + /** + Do not resolve symlinks to their real path; treat a symlinked file like a real one. + + @default false + */ + preserveSymlinks?: boolean; + + /** + Keep outdated console output in watch mode instead of clearing the screen. + + @default false + */ + preserveWatchOutput?: boolean; + + /** + Stylize errors and messages using color and context (experimental). + + @default true // Unless piping to another program or redirecting output to a file. + */ + pretty?: boolean; + + /** + Do not emit comments to output. + + @default false + */ + removeComments?: boolean; + + /** + Specifies the root directory of input files. + + Use to control the output directory structure with `--outDir`. + */ + rootDir?: string; + + /** + Unconditionally emit imports for unresolved files. + + @default false + */ + isolatedModules?: boolean; + + /** + Generates corresponding '.map' file. + + @default false + */ + sourceMap?: boolean; + + /** + Specifies the location where debugger should locate TypeScript files instead of source locations. + */ + sourceRoot?: string; + + /** + Suppress excess property checks for object literals. + + @default false + @deprecated This option will be removed in TypeScript 5.5. + */ + suppressExcessPropertyErrors?: boolean; + + /** + Suppress noImplicitAny errors for indexing objects lacking index signatures. + + @default false + @deprecated This option will be removed in TypeScript 5.5. + */ + suppressImplicitAnyIndexErrors?: boolean; + + /** + Do not emit declarations for code that has an `@internal` annotation. + */ + stripInternal?: boolean; + + /** + Specify ECMAScript target version. + + @default 'es3' + */ + target?: CompilerOptions.Target; + + /** + Default catch clause variables as `unknown` instead of `any`. + + @default false + */ + useUnknownInCatchVariables?: boolean; + + /** + Watch input files. + + @default false + @deprecated Use watchOptions instead. + */ + watch?: boolean; + + /** + Specify the polling strategy to use when the system runs out of or doesn't support native file watchers. + + @deprecated Use watchOptions.fallbackPolling instead. + */ + fallbackPolling?: CompilerOptions.FallbackPolling; + + /** + Specify the strategy for watching directories under systems that lack recursive file-watching functionality. + + @default 'useFsEvents' + @deprecated Use watchOptions.watchDirectory instead. + */ + watchDirectory?: CompilerOptions.WatchDirectory; + + /** + Specify the strategy for watching individual files. + + @default 'useFsEvents' + @deprecated Use watchOptions.watchFile instead. + */ + watchFile?: CompilerOptions.WatchFile; + + /** + Enables experimental support for ES7 decorators. + + @default false + */ + experimentalDecorators?: boolean; + + /** + Emit design-type metadata for decorated declarations in source. + + @default false + */ + emitDecoratorMetadata?: boolean; + + /** + Do not report errors on unused labels. + + @default false + */ + allowUnusedLabels?: boolean; + + /** + Report error when not all code paths in function return a value. + + @default false + */ + noImplicitReturns?: boolean; + + /** + Add `undefined` to a type when accessed using an index. + + @default false + */ + noUncheckedIndexedAccess?: boolean; + + /** + Report errors for fallthrough cases in switch statement. + + @default false + */ + noFallthroughCasesInSwitch?: boolean; + + /** + Ensure overriding members in derived classes are marked with an override modifier. + + @default false + */ + noImplicitOverride?: boolean; + + /** + Do not report errors on unreachable code. + + @default false + */ + allowUnreachableCode?: boolean; + + /** + Disallow inconsistently-cased references to the same file. + + @default true + */ + forceConsistentCasingInFileNames?: boolean; + + /** + Emit a v8 CPU profile of the compiler run for debugging. + + @default 'profile.cpuprofile' + */ + generateCpuProfile?: string; + + /** + Base directory to resolve non-relative module names. + */ + baseUrl?: string; + + /** + Specify path mapping to be computed relative to baseUrl option. + */ + paths?: Record; + + /** + List of TypeScript language server plugins to load. + */ + plugins?: CompilerOptions.Plugin[]; + + /** + Specify list of root directories to be used when resolving modules. + */ + rootDirs?: string[]; + + /** + Specify list of directories for type definition files to be included. + */ + typeRoots?: string[]; + + /** + Type declaration files to be included in compilation. + */ + types?: string[]; + + /** + Enable tracing of the name resolution process. + + @default false + */ + traceResolution?: boolean; + + /** + Allow javascript files to be compiled. + + @default false + */ + allowJs?: boolean; + + /** + Do not truncate error messages. + + @default false + */ + noErrorTruncation?: boolean; + + /** + Allow default imports from modules with no default export. This does not affect code emit, just typechecking. + + @default module === 'system' || esModuleInterop + */ + allowSyntheticDefaultImports?: boolean; + + /** + Do not emit `'use strict'` directives in module output. + + @default false + @deprecated This option will be removed in TypeScript 5.5. + */ + noImplicitUseStrict?: boolean; + + /** + Enable to list all emitted files. + + @default false + */ + listEmittedFiles?: boolean; + + /** + Disable size limit for JavaScript project. + + @default false + */ + disableSizeLimit?: boolean; + + /** + List of library files to be included in the compilation. + */ + lib?: CompilerOptions.Lib[]; + + /** + Enable strict null checks. + + @default false + */ + strictNullChecks?: boolean; + + /** + The maximum dependency depth to search under `node_modules` and load JavaScript files. Only applicable with `--allowJs`. + + @default 0 + */ + maxNodeModuleJsDepth?: number; + + /** + Import emit helpers (e.g. `__extends`, `__rest`, etc..) from tslib. + + @default false + */ + importHelpers?: boolean; + + /** + Specify emit/checking behavior for imports that are only used for types. + + @default 'remove' + @deprecated Use `verbatimModuleSyntax` instead. + */ + importsNotUsedAsValues?: CompilerOptions.ImportsNotUsedAsValues; + + /** + Parse in strict mode and emit `'use strict'` for each source file. + + @default false + */ + alwaysStrict?: boolean; + + /** + Enable all strict type checking options. + + @default false + */ + strict?: boolean; + + /** + Enable stricter checking of of the `bind`, `call`, and `apply` methods on functions. + + @default false + */ + strictBindCallApply?: boolean; + + /** + Provide full support for iterables in `for-of`, spread, and destructuring when targeting `ES5` or `ES3`. + + @default false + */ + downlevelIteration?: boolean; + + /** + Report errors in `.js` files. + + @default false + */ + checkJs?: boolean; + + /** + Disable bivariant parameter checking for function types. + + @default false + */ + strictFunctionTypes?: boolean; + + /** + Ensure non-undefined class properties are initialized in the constructor. + + @default false + */ + strictPropertyInitialization?: boolean; + + /** + Emit `__importStar` and `__importDefault` helpers for runtime Babel ecosystem compatibility and enable `--allowSyntheticDefaultImports` for typesystem compatibility. + + @default false + */ + esModuleInterop?: boolean; + + /** + Allow accessing UMD globals from modules. + + @default false + */ + allowUmdGlobalAccess?: boolean; + + /** + Resolve `keyof` to string valued property names only (no numbers or symbols). + + @default false + @deprecated This option will be removed in TypeScript 5.5. + */ + keyofStringsOnly?: boolean; + + /** + Emit ECMAScript standard class fields. + + @default false + */ + useDefineForClassFields?: boolean; + + /** + Generates a sourcemap for each corresponding `.d.ts` file. + + @default false + */ + declarationMap?: boolean; + + /** + Include modules imported with `.json` extension. + + @default false + */ + resolveJsonModule?: boolean; + + /** + Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it. + + @default false + */ + assumeChangesOnlyAffectDirectDependencies?: boolean; + + /** + Output more detailed compiler performance information after building. + + @default false + */ + extendedDiagnostics?: boolean; + + /** + Print names of files that are part of the compilation and then stop processing. + + @default false + */ + listFilesOnly?: boolean; + + /** + Disable preferring source files instead of declaration files when referencing composite projects. + + @default true if composite, false otherwise + */ + disableSourceOfProjectReferenceRedirect?: boolean; + + /** + Opt a project out of multi-project reference checking when editing. + + @default false + */ + disableSolutionSearching?: boolean; + + /** + Print names of files which TypeScript sees as a part of your project and the reason they are part of the compilation. + + @default false + */ + explainFiles?: boolean; + + /** + Preserve unused imported values in the JavaScript output that would otherwise be removed. + + @default true + @deprecated Use `verbatimModuleSyntax` instead. + */ + preserveValueImports?: boolean; + + /** + List of file name suffixes to search when resolving a module. + */ + moduleSuffixes?: string[]; + + /** + Control what method is used to detect module-format JS files. + + @default 'auto' + */ + moduleDetection?: CompilerOptions.ModuleDetection; + + /** + Allows TypeScript files to import each other with a TypeScript-specific extension like .ts, .mts, or .tsx. + + @default false + */ + allowImportingTsExtensions?: boolean; + + /** + Forces TypeScript to consult the exports field of package.json files if it ever reads from a package in node_modules. + + @default false + */ + resolvePackageJsonExports?: boolean; + + /** + Forces TypeScript to consult the imports field of package.json files when performing a lookup that starts with # from a file whose ancestor directory contains a package.json. + + @default false + */ + resolvePackageJsonImports?: boolean; + + /** + Suppress errors for file formats that TypeScript does not understand. + + @default false + */ + allowArbitraryExtensions?: boolean; + + /** + List of additional conditions that should succeed when TypeScript resolves from package.json. + */ + customConditions?: string[]; + + /** + Anything that uses the type modifier is dropped entirely. + + @default false + */ + verbatimModuleSyntax?: boolean; + + /** + Suppress deprecation warnings + */ + ignoreDeprecations?: CompilerOptions.IgnoreDeprecations; + }; + + namespace WatchOptions { + export type WatchFileKind = + | 'FixedPollingInterval' + | 'PriorityPollingInterval' + | 'DynamicPriorityPolling' + | 'FixedChunkSizePolling' + | 'UseFsEvents' + | 'UseFsEventsOnParentDirectory'; + + export type WatchDirectoryKind = + | 'UseFsEvents' + | 'FixedPollingInterval' + | 'DynamicPriorityPolling' + | 'FixedChunkSizePolling'; + + export type PollingWatchKind = + | 'FixedInterval' + | 'PriorityInterval' + | 'DynamicPriority' + | 'FixedChunkSize'; + } + + export type WatchOptions = { + + /** + Specify the strategy for watching individual files. + + @default 'UseFsEvents' + */ + watchFile?: WatchOptions.WatchFileKind | Lowercase; + + /** + Specify the strategy for watching directories under systems that lack recursive file-watching functionality. + + @default 'UseFsEvents' + */ + watchDirectory?: WatchOptions.WatchDirectoryKind | Lowercase; + + /** + Specify the polling strategy to use when the system runs out of or doesn't support native file watchers. + */ + fallbackPolling?: WatchOptions.PollingWatchKind | Lowercase; + + /** + Enable synchronous updates on directory watchers for platforms that don't support recursive watching natively. + */ + synchronousWatchDirectory?: boolean; + + /** + Specifies a list of directories to exclude from watch + */ + excludeDirectories?: string[]; + + /** + Specifies a list of files to exclude from watch + */ + excludeFiles?: string[]; + }; + + /** + Auto type (.d.ts) acquisition options for this project. + */ + export type TypeAcquisition = { + /** + Enable auto type acquisition. + */ + enable?: boolean; + + /** + Specifies a list of type declarations to be included in auto type acquisition. For example, `['jquery', 'lodash']`. + */ + include?: string[]; + + /** + Specifies a list of type declarations to be excluded from auto type acquisition. For example, `['jquery', 'lodash']`. + */ + exclude?: string[]; + }; + + export type References = { + /** + A normalized path on disk. + */ + path: string; + + /** + The path as the user originally wrote it. + */ + originalPath?: string; + + /** + True if the output of this reference should be prepended to the output of this project. + + Only valid for `--outFile` compilations. + @deprecated This option will be removed in TypeScript 5.5. + */ + prepend?: boolean; + + /** + True if it is intended that this reference form a circularity. + */ + circular?: boolean; + }; +} + +/** +Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) (TypeScript 3.7). + +@category File +*/ +type TsConfigJson = { + /** + Instructs the TypeScript compiler how to compile `.ts` files. + */ + compilerOptions?: TsConfigJson.CompilerOptions; + + /** + Instructs the TypeScript compiler how to watch files. + */ + watchOptions?: TsConfigJson.WatchOptions; + + /** + Auto type (.d.ts) acquisition options for this project. + */ + typeAcquisition?: TsConfigJson.TypeAcquisition; + + /** + Enable Compile-on-Save for this project. + */ + compileOnSave?: boolean; + + /** + Path to base configuration file to inherit from. + */ + extends?: string | string[]; + + /** + If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`. When a `files` property is specified, only those files and those specified by `include` are included. + */ + files?: string[]; + + /** + Specifies a list of files to be excluded from compilation. The `exclude` property only affects the files included via the `include` property and not the `files` property. + + Glob patterns require TypeScript version 2.0 or later. + */ + exclude?: string[]; + + /** + Specifies a list of glob patterns that match files to be included in compilation. + + If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`. + */ + include?: string[]; + + /** + Referenced projects. + */ + references?: TsConfigJson.References[]; +}; + +type TsConfigJsonResolved = Except; +type TsConfigResult = { + /** + * The path to the tsconfig.json file + */ + path: string; + /** + * The resolved tsconfig.json file + */ + config: TsConfigJsonResolved; +}; +type Cache = Map; + +declare const getTsconfig: (searchPath?: string, configName?: string, cache?: Cache) => TsConfigResult | null; + +declare const parseTsconfig: (tsconfigPath: string, cache?: Cache) => TsConfigJsonResolved; + +/** + * Reference: + * https://github.com/microsoft/TypeScript/blob/3ccbe804f850f40d228d3c875be952d94d39aa1d/src/compiler/moduleNameResolver.ts#L2465 + */ +declare const createPathsMatcher: (tsconfig: TsConfigResult) => ((specifier: string) => string[]) | null; + +type FileMatcher = (filePath: string) => (TsConfigJsonResolved | undefined); +declare const createFilesMatcher: ({ config, path: tsconfigPath, }: TsConfigResult, caseSensitivePaths?: boolean) => FileMatcher; + +export { type Cache, type FileMatcher, TsConfigJson, type TsConfigJsonResolved, type TsConfigResult, createFilesMatcher, createPathsMatcher, getTsconfig, parseTsconfig }; diff --git a/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/get-tsconfig/dist/index.d.mts b/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/get-tsconfig/dist/index.d.mts new file mode 100644 index 0000000..2a63412 --- /dev/null +++ b/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/get-tsconfig/dist/index.d.mts @@ -0,0 +1,1344 @@ +declare global { + // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged. + interface SymbolConstructor { + readonly observable: symbol; + } +} + +/** +Returns a boolean for whether the two given types are equal. + +@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650 +@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796 + +Use-cases: +- If you want to make a conditional branch based on the result of a comparison of two types. + +@example +``` +import type {IsEqual} from 'type-fest'; + +// This type returns a boolean for whether the given array includes the given item. +// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal. +type Includes = + Value extends readonly [Value[0], ...infer rest] + ? IsEqual extends true + ? true + : Includes + : false; +``` + +@category Type Guard +@category Utilities +*/ +type IsEqual = + (() => G extends A ? 1 : 2) extends + (() => G extends B ? 1 : 2) + ? true + : false; + +/** +Filter out keys from an object. + +Returns `never` if `Exclude` is strictly equal to `Key`. +Returns `never` if `Key` extends `Exclude`. +Returns `Key` otherwise. + +@example +``` +type Filtered = Filter<'foo', 'foo'>; +//=> never +``` + +@example +``` +type Filtered = Filter<'bar', string>; +//=> never +``` + +@example +``` +type Filtered = Filter<'bar', 'foo'>; +//=> 'bar' +``` + +@see {Except} +*/ +type Filter = IsEqual extends true ? never : (KeyType extends ExcludeType ? never : KeyType); + +type ExceptOptions = { + /** + Disallow assigning non-specified properties. + + Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`. + + @default false + */ + requireExactProps?: boolean; +}; + +/** +Create a type from an object type without certain keys. + +We recommend setting the `requireExactProps` option to `true`. + +This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically. + +This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)). + +@example +``` +import type {Except} from 'type-fest'; + +type Foo = { + a: number; + b: string; +}; + +type FooWithoutA = Except; +//=> {b: string} + +const fooWithoutA: FooWithoutA = {a: 1, b: '2'}; +//=> errors: 'a' does not exist in type '{ b: string; }' + +type FooWithoutB = Except; +//=> {a: number} & Partial> + +const fooWithoutB: FooWithoutB = {a: 1, b: '2'}; +//=> errors at 'b': Type 'string' is not assignable to type 'undefined'. +``` + +@category Object +*/ +type Except = { + [KeyType in keyof ObjectType as Filter]: ObjectType[KeyType]; +} & (Options['requireExactProps'] extends true + ? Partial> + : {}); + +declare namespace TsConfigJson { + namespace CompilerOptions { + export type JSX = + | 'preserve' + | 'react' + | 'react-jsx' + | 'react-jsxdev' + | 'react-native'; + + export type Module = + | 'CommonJS' + | 'AMD' + | 'System' + | 'UMD' + | 'ES6' + | 'ES2015' + | 'ES2020' + | 'ES2022' + | 'ESNext' + | 'Node16' + | 'NodeNext' + | 'Preserve' + | 'None' + // Lowercase alternatives + | 'commonjs' + | 'amd' + | 'system' + | 'umd' + | 'es6' + | 'es2015' + | 'es2020' + | 'es2022' + | 'esnext' + | 'node16' + | 'nodenext' + | 'preserve' + | 'none'; + + export type NewLine = + | 'CRLF' + | 'LF' + // Lowercase alternatives + | 'crlf' + | 'lf'; + + export type Target = + | 'ES3' + | 'ES5' + | 'ES6' + | 'ES2015' + | 'ES2016' + | 'ES2017' + | 'ES2018' + | 'ES2019' + | 'ES2020' + | 'ES2021' + | 'ES2022' + | 'ESNext' + // Lowercase alternatives + | 'es3' + | 'es5' + | 'es6' + | 'es2015' + | 'es2016' + | 'es2017' + | 'es2018' + | 'es2019' + | 'es2020' + | 'es2021' + | 'es2022' + | 'esnext'; + + // eslint-disable-next-line unicorn/prevent-abbreviations + export type Lib = + | 'ES5' + | 'ES6' + | 'ES7' + | 'ES2015' + | 'ES2015.Collection' + | 'ES2015.Core' + | 'ES2015.Generator' + | 'ES2015.Iterable' + | 'ES2015.Promise' + | 'ES2015.Proxy' + | 'ES2015.Reflect' + | 'ES2015.Symbol.WellKnown' + | 'ES2015.Symbol' + | 'ES2016' + | 'ES2016.Array.Include' + | 'ES2017' + | 'ES2017.Intl' + | 'ES2017.Object' + | 'ES2017.SharedMemory' + | 'ES2017.String' + | 'ES2017.TypedArrays' + | 'ES2018' + | 'ES2018.AsyncGenerator' + | 'ES2018.AsyncIterable' + | 'ES2018.Intl' + | 'ES2018.Promise' + | 'ES2018.Regexp' + | 'ES2019' + | 'ES2019.Array' + | 'ES2019.Object' + | 'ES2019.String' + | 'ES2019.Symbol' + | 'ES2020' + | 'ES2020.BigInt' + | 'ES2020.Promise' + | 'ES2020.String' + | 'ES2020.Symbol.WellKnown' + | 'ES2020.SharedMemory' + | 'ES2020.Intl' + | 'ES2021' + | 'ES2021.Promise' + | 'ES2021.String' + | 'ES2021.WeakRef' + | 'ES2022' + | 'ES2022.Array' + | 'ES2022.Error' + | 'ES2022.Intl' + | 'ES2022.Object' + | 'ES2022.SharedMemory' + | 'ES2022.String' + | 'ES2022.RegExp' + | 'ESNext' + | 'ESNext.Array' + | 'ESNext.AsyncIterable' + | 'ESNext.BigInt' + | 'ESNext.Intl' + | 'ESNext.Promise' + | 'ESNext.String' + | 'ESNext.Symbol' + | 'ESNext.WeakRef' + | 'DOM' + | 'DOM.Iterable' + | 'ScriptHost' + | 'WebWorker' + | 'WebWorker.ImportScripts' + | 'WebWorker.Iterable' + // Lowercase alternatives + | 'es5' + | 'es6' + | 'es7' + | 'es2015' + | 'es2015.collection' + | 'es2015.core' + | 'es2015.generator' + | 'es2015.iterable' + | 'es2015.promise' + | 'es2015.proxy' + | 'es2015.reflect' + | 'es2015.symbol.wellknown' + | 'es2015.symbol' + | 'es2016' + | 'es2016.array.include' + | 'es2017' + | 'es2017.intl' + | 'es2017.object' + | 'es2017.sharedmemory' + | 'es2017.string' + | 'es2017.typedarrays' + | 'es2018' + | 'es2018.asyncgenerator' + | 'es2018.asynciterable' + | 'es2018.intl' + | 'es2018.promise' + | 'es2018.regexp' + | 'es2019' + | 'es2019.array' + | 'es2019.object' + | 'es2019.string' + | 'es2019.symbol' + | 'es2020' + | 'es2020.bigint' + | 'es2020.promise' + | 'es2020.string' + | 'es2020.symbol.wellknown' + | 'es2020.sharedmemory' + | 'es2020.intl' + | 'es2021' + | 'es2021.promise' + | 'es2021.string' + | 'es2021.weakref' + | 'es2022' + | 'es2022.array' + | 'es2022.error' + | 'es2022.intl' + | 'es2022.object' + | 'es2022.sharedmemory' + | 'es2022.string' + | 'es2022.regexp' + | 'esnext' + | 'esnext.array' + | 'esnext.asynciterable' + | 'esnext.bigint' + | 'esnext.intl' + | 'esnext.promise' + | 'esnext.string' + | 'esnext.symbol' + | 'esnext.weakref' + | 'dom' + | 'dom.iterable' + | 'scripthost' + | 'webworker' + | 'webworker.importscripts' + | 'webworker.iterable'; + + export type Plugin = { + /** + Plugin name. + */ + name: string; + }; + + export type ImportsNotUsedAsValues = + | 'remove' + | 'preserve' + | 'error'; + + export type FallbackPolling = + | 'fixedPollingInterval' + | 'priorityPollingInterval' + | 'dynamicPriorityPolling' + | 'fixedInterval' + | 'priorityInterval' + | 'dynamicPriority' + | 'fixedChunkSize'; + + export type WatchDirectory = + | 'useFsEvents' + | 'fixedPollingInterval' + | 'dynamicPriorityPolling' + | 'fixedChunkSizePolling'; + + export type WatchFile = + | 'fixedPollingInterval' + | 'priorityPollingInterval' + | 'dynamicPriorityPolling' + | 'useFsEvents' + | 'useFsEventsOnParentDirectory' + | 'fixedChunkSizePolling'; + + export type ModuleResolution = + | 'classic' + | 'node' + | 'node10' + | 'node16' + | 'nodenext' + | 'bundler' + // Pascal-cased alternatives + | 'Classic' + | 'Node' + | 'Node10' + | 'Node16' + | 'NodeNext' + | 'Bundler'; + + export type ModuleDetection = + | 'auto' + | 'legacy' + | 'force'; + + export type IgnoreDeprecations = '5.0'; + } + + export type CompilerOptions = { + /** + The character set of the input files. + + @default 'utf8' + @deprecated This option will be removed in TypeScript 5.5. + */ + charset?: string; + + /** + Enables building for project references. + + @default true + */ + composite?: boolean; + + /** + Generates corresponding d.ts files. + + @default false + */ + declaration?: boolean; + + /** + Specify output directory for generated declaration files. + */ + declarationDir?: string; + + /** + Show diagnostic information. + + @default false + */ + diagnostics?: boolean; + + /** + Reduce the number of projects loaded automatically by TypeScript. + + @default false + */ + disableReferencedProjectLoad?: boolean; + + /** + Enforces using indexed accessors for keys declared using an indexed type. + + @default false + */ + noPropertyAccessFromIndexSignature?: boolean; + + /** + Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. + + @default false + */ + emitBOM?: boolean; + + /** + Only emit `.d.ts` declaration files. + + @default false + */ + emitDeclarationOnly?: boolean; + + /** + Differentiate between undefined and not present when type checking. + + @default false + */ + exactOptionalPropertyTypes?: boolean; + + /** + Enable incremental compilation. + + @default `composite` + */ + incremental?: boolean; + + /** + Specify file to store incremental compilation information. + + @default '.tsbuildinfo' + */ + tsBuildInfoFile?: string; + + /** + Emit a single file with source maps instead of having a separate file. + + @default false + */ + inlineSourceMap?: boolean; + + /** + Emit the source alongside the sourcemaps within a single file. + + Requires `--inlineSourceMap` to be set. + + @default false + */ + inlineSources?: boolean; + + /** + Specify what JSX code is generated. + + @default 'preserve' + */ + jsx?: CompilerOptions.JSX; + + /** + Specifies the object invoked for `createElement` and `__spread` when targeting `'react'` JSX emit. + + @default 'React' + */ + reactNamespace?: string; + + /** + Specify the JSX factory function to use when targeting React JSX emit, e.g. `React.createElement` or `h`. + + @default 'React.createElement' + */ + jsxFactory?: string; + + /** + Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. + + @default 'React.Fragment' + */ + jsxFragmentFactory?: string; + + /** + Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`. + + @default 'react' + */ + jsxImportSource?: string; + + /** + Print names of files part of the compilation. + + @default false + */ + listFiles?: boolean; + + /** + Specifies the location where debugger should locate map files instead of generated locations. + */ + mapRoot?: string; + + /** + Specify module code generation: 'None', 'CommonJS', 'AMD', 'System', 'UMD', 'ES6', 'ES2015' or 'ESNext'. Only 'AMD' and 'System' can be used in conjunction with `--outFile`. 'ES6' and 'ES2015' values may be used when targeting 'ES5' or lower. + + @default ['ES3', 'ES5'].includes(target) ? 'CommonJS' : 'ES6' + */ + module?: CompilerOptions.Module; + + /** + Specifies module resolution strategy: 'node' (Node) or 'classic' (TypeScript pre 1.6). + + @default ['AMD', 'System', 'ES6'].includes(module) ? 'classic' : 'node' + */ + moduleResolution?: CompilerOptions.ModuleResolution; + + /** + Specifies the end of line sequence to be used when emitting files: 'crlf' (Windows) or 'lf' (Unix). + + @default 'LF' + */ + newLine?: CompilerOptions.NewLine; + + /** + Do not emit output. + + @default false + */ + noEmit?: boolean; + + /** + Do not generate custom helper functions like `__extends` in compiled output. + + @default false + */ + noEmitHelpers?: boolean; + + /** + Do not emit outputs if any type checking errors were reported. + + @default false + */ + noEmitOnError?: boolean; + + /** + Warn on expressions and declarations with an implied 'any' type. + + @default false + */ + noImplicitAny?: boolean; + + /** + Raise error on 'this' expressions with an implied any type. + + @default false + */ + noImplicitThis?: boolean; + + /** + Report errors on unused locals. + + @default false + */ + noUnusedLocals?: boolean; + + /** + Report errors on unused parameters. + + @default false + */ + noUnusedParameters?: boolean; + + /** + Do not include the default library file (lib.d.ts). + + @default false + */ + noLib?: boolean; + + /** + Do not add triple-slash references or module import targets to the list of compiled files. + + @default false + */ + noResolve?: boolean; + + /** + Disable strict checking of generic signatures in function types. + + @default false + @deprecated This option will be removed in TypeScript 5.5. + */ + noStrictGenericChecks?: boolean; + + /** + @deprecated use `skipLibCheck` instead. + */ + skipDefaultLibCheck?: boolean; + + /** + Skip type checking of declaration files. + + @default false + */ + skipLibCheck?: boolean; + + /** + Concatenate and emit output to single file. + */ + outFile?: string; + + /** + Redirect output structure to the directory. + */ + outDir?: string; + + /** + Do not erase const enum declarations in generated code. + + @default false + */ + preserveConstEnums?: boolean; + + /** + Do not resolve symlinks to their real path; treat a symlinked file like a real one. + + @default false + */ + preserveSymlinks?: boolean; + + /** + Keep outdated console output in watch mode instead of clearing the screen. + + @default false + */ + preserveWatchOutput?: boolean; + + /** + Stylize errors and messages using color and context (experimental). + + @default true // Unless piping to another program or redirecting output to a file. + */ + pretty?: boolean; + + /** + Do not emit comments to output. + + @default false + */ + removeComments?: boolean; + + /** + Specifies the root directory of input files. + + Use to control the output directory structure with `--outDir`. + */ + rootDir?: string; + + /** + Unconditionally emit imports for unresolved files. + + @default false + */ + isolatedModules?: boolean; + + /** + Generates corresponding '.map' file. + + @default false + */ + sourceMap?: boolean; + + /** + Specifies the location where debugger should locate TypeScript files instead of source locations. + */ + sourceRoot?: string; + + /** + Suppress excess property checks for object literals. + + @default false + @deprecated This option will be removed in TypeScript 5.5. + */ + suppressExcessPropertyErrors?: boolean; + + /** + Suppress noImplicitAny errors for indexing objects lacking index signatures. + + @default false + @deprecated This option will be removed in TypeScript 5.5. + */ + suppressImplicitAnyIndexErrors?: boolean; + + /** + Do not emit declarations for code that has an `@internal` annotation. + */ + stripInternal?: boolean; + + /** + Specify ECMAScript target version. + + @default 'es3' + */ + target?: CompilerOptions.Target; + + /** + Default catch clause variables as `unknown` instead of `any`. + + @default false + */ + useUnknownInCatchVariables?: boolean; + + /** + Watch input files. + + @default false + @deprecated Use watchOptions instead. + */ + watch?: boolean; + + /** + Specify the polling strategy to use when the system runs out of or doesn't support native file watchers. + + @deprecated Use watchOptions.fallbackPolling instead. + */ + fallbackPolling?: CompilerOptions.FallbackPolling; + + /** + Specify the strategy for watching directories under systems that lack recursive file-watching functionality. + + @default 'useFsEvents' + @deprecated Use watchOptions.watchDirectory instead. + */ + watchDirectory?: CompilerOptions.WatchDirectory; + + /** + Specify the strategy for watching individual files. + + @default 'useFsEvents' + @deprecated Use watchOptions.watchFile instead. + */ + watchFile?: CompilerOptions.WatchFile; + + /** + Enables experimental support for ES7 decorators. + + @default false + */ + experimentalDecorators?: boolean; + + /** + Emit design-type metadata for decorated declarations in source. + + @default false + */ + emitDecoratorMetadata?: boolean; + + /** + Do not report errors on unused labels. + + @default false + */ + allowUnusedLabels?: boolean; + + /** + Report error when not all code paths in function return a value. + + @default false + */ + noImplicitReturns?: boolean; + + /** + Add `undefined` to a type when accessed using an index. + + @default false + */ + noUncheckedIndexedAccess?: boolean; + + /** + Report errors for fallthrough cases in switch statement. + + @default false + */ + noFallthroughCasesInSwitch?: boolean; + + /** + Ensure overriding members in derived classes are marked with an override modifier. + + @default false + */ + noImplicitOverride?: boolean; + + /** + Do not report errors on unreachable code. + + @default false + */ + allowUnreachableCode?: boolean; + + /** + Disallow inconsistently-cased references to the same file. + + @default true + */ + forceConsistentCasingInFileNames?: boolean; + + /** + Emit a v8 CPU profile of the compiler run for debugging. + + @default 'profile.cpuprofile' + */ + generateCpuProfile?: string; + + /** + Base directory to resolve non-relative module names. + */ + baseUrl?: string; + + /** + Specify path mapping to be computed relative to baseUrl option. + */ + paths?: Record; + + /** + List of TypeScript language server plugins to load. + */ + plugins?: CompilerOptions.Plugin[]; + + /** + Specify list of root directories to be used when resolving modules. + */ + rootDirs?: string[]; + + /** + Specify list of directories for type definition files to be included. + */ + typeRoots?: string[]; + + /** + Type declaration files to be included in compilation. + */ + types?: string[]; + + /** + Enable tracing of the name resolution process. + + @default false + */ + traceResolution?: boolean; + + /** + Allow javascript files to be compiled. + + @default false + */ + allowJs?: boolean; + + /** + Do not truncate error messages. + + @default false + */ + noErrorTruncation?: boolean; + + /** + Allow default imports from modules with no default export. This does not affect code emit, just typechecking. + + @default module === 'system' || esModuleInterop + */ + allowSyntheticDefaultImports?: boolean; + + /** + Do not emit `'use strict'` directives in module output. + + @default false + @deprecated This option will be removed in TypeScript 5.5. + */ + noImplicitUseStrict?: boolean; + + /** + Enable to list all emitted files. + + @default false + */ + listEmittedFiles?: boolean; + + /** + Disable size limit for JavaScript project. + + @default false + */ + disableSizeLimit?: boolean; + + /** + List of library files to be included in the compilation. + */ + lib?: CompilerOptions.Lib[]; + + /** + Enable strict null checks. + + @default false + */ + strictNullChecks?: boolean; + + /** + The maximum dependency depth to search under `node_modules` and load JavaScript files. Only applicable with `--allowJs`. + + @default 0 + */ + maxNodeModuleJsDepth?: number; + + /** + Import emit helpers (e.g. `__extends`, `__rest`, etc..) from tslib. + + @default false + */ + importHelpers?: boolean; + + /** + Specify emit/checking behavior for imports that are only used for types. + + @default 'remove' + @deprecated Use `verbatimModuleSyntax` instead. + */ + importsNotUsedAsValues?: CompilerOptions.ImportsNotUsedAsValues; + + /** + Parse in strict mode and emit `'use strict'` for each source file. + + @default false + */ + alwaysStrict?: boolean; + + /** + Enable all strict type checking options. + + @default false + */ + strict?: boolean; + + /** + Enable stricter checking of of the `bind`, `call`, and `apply` methods on functions. + + @default false + */ + strictBindCallApply?: boolean; + + /** + Provide full support for iterables in `for-of`, spread, and destructuring when targeting `ES5` or `ES3`. + + @default false + */ + downlevelIteration?: boolean; + + /** + Report errors in `.js` files. + + @default false + */ + checkJs?: boolean; + + /** + Disable bivariant parameter checking for function types. + + @default false + */ + strictFunctionTypes?: boolean; + + /** + Ensure non-undefined class properties are initialized in the constructor. + + @default false + */ + strictPropertyInitialization?: boolean; + + /** + Emit `__importStar` and `__importDefault` helpers for runtime Babel ecosystem compatibility and enable `--allowSyntheticDefaultImports` for typesystem compatibility. + + @default false + */ + esModuleInterop?: boolean; + + /** + Allow accessing UMD globals from modules. + + @default false + */ + allowUmdGlobalAccess?: boolean; + + /** + Resolve `keyof` to string valued property names only (no numbers or symbols). + + @default false + @deprecated This option will be removed in TypeScript 5.5. + */ + keyofStringsOnly?: boolean; + + /** + Emit ECMAScript standard class fields. + + @default false + */ + useDefineForClassFields?: boolean; + + /** + Generates a sourcemap for each corresponding `.d.ts` file. + + @default false + */ + declarationMap?: boolean; + + /** + Include modules imported with `.json` extension. + + @default false + */ + resolveJsonModule?: boolean; + + /** + Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it. + + @default false + */ + assumeChangesOnlyAffectDirectDependencies?: boolean; + + /** + Output more detailed compiler performance information after building. + + @default false + */ + extendedDiagnostics?: boolean; + + /** + Print names of files that are part of the compilation and then stop processing. + + @default false + */ + listFilesOnly?: boolean; + + /** + Disable preferring source files instead of declaration files when referencing composite projects. + + @default true if composite, false otherwise + */ + disableSourceOfProjectReferenceRedirect?: boolean; + + /** + Opt a project out of multi-project reference checking when editing. + + @default false + */ + disableSolutionSearching?: boolean; + + /** + Print names of files which TypeScript sees as a part of your project and the reason they are part of the compilation. + + @default false + */ + explainFiles?: boolean; + + /** + Preserve unused imported values in the JavaScript output that would otherwise be removed. + + @default true + @deprecated Use `verbatimModuleSyntax` instead. + */ + preserveValueImports?: boolean; + + /** + List of file name suffixes to search when resolving a module. + */ + moduleSuffixes?: string[]; + + /** + Control what method is used to detect module-format JS files. + + @default 'auto' + */ + moduleDetection?: CompilerOptions.ModuleDetection; + + /** + Allows TypeScript files to import each other with a TypeScript-specific extension like .ts, .mts, or .tsx. + + @default false + */ + allowImportingTsExtensions?: boolean; + + /** + Forces TypeScript to consult the exports field of package.json files if it ever reads from a package in node_modules. + + @default false + */ + resolvePackageJsonExports?: boolean; + + /** + Forces TypeScript to consult the imports field of package.json files when performing a lookup that starts with # from a file whose ancestor directory contains a package.json. + + @default false + */ + resolvePackageJsonImports?: boolean; + + /** + Suppress errors for file formats that TypeScript does not understand. + + @default false + */ + allowArbitraryExtensions?: boolean; + + /** + List of additional conditions that should succeed when TypeScript resolves from package.json. + */ + customConditions?: string[]; + + /** + Anything that uses the type modifier is dropped entirely. + + @default false + */ + verbatimModuleSyntax?: boolean; + + /** + Suppress deprecation warnings + */ + ignoreDeprecations?: CompilerOptions.IgnoreDeprecations; + }; + + namespace WatchOptions { + export type WatchFileKind = + | 'FixedPollingInterval' + | 'PriorityPollingInterval' + | 'DynamicPriorityPolling' + | 'FixedChunkSizePolling' + | 'UseFsEvents' + | 'UseFsEventsOnParentDirectory'; + + export type WatchDirectoryKind = + | 'UseFsEvents' + | 'FixedPollingInterval' + | 'DynamicPriorityPolling' + | 'FixedChunkSizePolling'; + + export type PollingWatchKind = + | 'FixedInterval' + | 'PriorityInterval' + | 'DynamicPriority' + | 'FixedChunkSize'; + } + + export type WatchOptions = { + + /** + Specify the strategy for watching individual files. + + @default 'UseFsEvents' + */ + watchFile?: WatchOptions.WatchFileKind | Lowercase; + + /** + Specify the strategy for watching directories under systems that lack recursive file-watching functionality. + + @default 'UseFsEvents' + */ + watchDirectory?: WatchOptions.WatchDirectoryKind | Lowercase; + + /** + Specify the polling strategy to use when the system runs out of or doesn't support native file watchers. + */ + fallbackPolling?: WatchOptions.PollingWatchKind | Lowercase; + + /** + Enable synchronous updates on directory watchers for platforms that don't support recursive watching natively. + */ + synchronousWatchDirectory?: boolean; + + /** + Specifies a list of directories to exclude from watch + */ + excludeDirectories?: string[]; + + /** + Specifies a list of files to exclude from watch + */ + excludeFiles?: string[]; + }; + + /** + Auto type (.d.ts) acquisition options for this project. + */ + export type TypeAcquisition = { + /** + Enable auto type acquisition. + */ + enable?: boolean; + + /** + Specifies a list of type declarations to be included in auto type acquisition. For example, `['jquery', 'lodash']`. + */ + include?: string[]; + + /** + Specifies a list of type declarations to be excluded from auto type acquisition. For example, `['jquery', 'lodash']`. + */ + exclude?: string[]; + }; + + export type References = { + /** + A normalized path on disk. + */ + path: string; + + /** + The path as the user originally wrote it. + */ + originalPath?: string; + + /** + True if the output of this reference should be prepended to the output of this project. + + Only valid for `--outFile` compilations. + @deprecated This option will be removed in TypeScript 5.5. + */ + prepend?: boolean; + + /** + True if it is intended that this reference form a circularity. + */ + circular?: boolean; + }; +} + +/** +Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) (TypeScript 3.7). + +@category File +*/ +type TsConfigJson = { + /** + Instructs the TypeScript compiler how to compile `.ts` files. + */ + compilerOptions?: TsConfigJson.CompilerOptions; + + /** + Instructs the TypeScript compiler how to watch files. + */ + watchOptions?: TsConfigJson.WatchOptions; + + /** + Auto type (.d.ts) acquisition options for this project. + */ + typeAcquisition?: TsConfigJson.TypeAcquisition; + + /** + Enable Compile-on-Save for this project. + */ + compileOnSave?: boolean; + + /** + Path to base configuration file to inherit from. + */ + extends?: string | string[]; + + /** + If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`. When a `files` property is specified, only those files and those specified by `include` are included. + */ + files?: string[]; + + /** + Specifies a list of files to be excluded from compilation. The `exclude` property only affects the files included via the `include` property and not the `files` property. + + Glob patterns require TypeScript version 2.0 or later. + */ + exclude?: string[]; + + /** + Specifies a list of glob patterns that match files to be included in compilation. + + If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`. + */ + include?: string[]; + + /** + Referenced projects. + */ + references?: TsConfigJson.References[]; +}; + +type TsConfigJsonResolved = Except; +type TsConfigResult = { + /** + * The path to the tsconfig.json file + */ + path: string; + /** + * The resolved tsconfig.json file + */ + config: TsConfigJsonResolved; +}; +type Cache = Map; + +declare const getTsconfig: (searchPath?: string, configName?: string, cache?: Cache) => TsConfigResult | null; + +declare const parseTsconfig: (tsconfigPath: string, cache?: Cache) => TsConfigJsonResolved; + +/** + * Reference: + * https://github.com/microsoft/TypeScript/blob/3ccbe804f850f40d228d3c875be952d94d39aa1d/src/compiler/moduleNameResolver.ts#L2465 + */ +declare const createPathsMatcher: (tsconfig: TsConfigResult) => ((specifier: string) => string[]) | null; + +type FileMatcher = (filePath: string) => (TsConfigJsonResolved | undefined); +declare const createFilesMatcher: ({ config, path: tsconfigPath, }: TsConfigResult, caseSensitivePaths?: boolean) => FileMatcher; + +export { type Cache, type FileMatcher, TsConfigJson, type TsConfigJsonResolved, type TsConfigResult, createFilesMatcher, createPathsMatcher, getTsconfig, parseTsconfig }; diff --git a/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/get-tsconfig/dist/index.mjs b/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/get-tsconfig/dist/index.mjs new file mode 100755 index 0000000..eda5a8c --- /dev/null +++ b/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/get-tsconfig/dist/index.mjs @@ -0,0 +1,7 @@ +var ve=Object.defineProperty;var l=(e,t)=>ve(e,"name",{value:t,configurable:!0});import a from"node:path";import ee from"node:fs";import Te from"node:module";import{resolveExports as Ae}from"resolve-pkg-maps";import Oe from"fs";function B(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}l(B,"slash");const R=l(e=>{const t=ee[e];return(i,...n)=>{const o=`${e}:${n.join(":")}`;let s=i==null?void 0:i.get(o);return s===void 0&&(s=Reflect.apply(t,ee,n),i==null||i.set(o,s)),s}},"cacheFs"),F=R("existsSync"),je=R("readFileSync"),P=R("statSync"),ne=l((e,t,i)=>{for(;;){const n=a.posix.join(e,t);if(F(i,n))return n;const o=a.dirname(e);if(o===e)return;e=o}},"findUp"),J=/^\.{1,2}(\/.*)?$/,M=l(e=>{const t=B(e);return J.test(t)?t:`./${t}`},"normalizeRelativePath");function _e(e,t=!1){const i=e.length;let n=0,o="",s=0,r=16,f=0,u=0,p=0,T=0,w=0;function O(c,m){let g=0,y=0;for(;g=48&&j<=57)y=y*16+j-48;else if(j>=65&&j<=70)y=y*16+j-65+10;else if(j>=97&&j<=102)y=y*16+j-97+10;else break;n++,g++}return g=i){c+=e.substring(m,n),w=2;break}const g=e.charCodeAt(n);if(g===34){c+=e.substring(m,n),n++;break}if(g===92){if(c+=e.substring(m,n),n++,n>=i){w=2;break}switch(e.charCodeAt(n++)){case 34:c+='"';break;case 92:c+="\\";break;case 47:c+="/";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+=` +`;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:const j=O(4,!0);j>=0?c+=String.fromCharCode(j):w=4;break;default:w=5}m=n;continue}if(g>=0&&g<=31)if(h(g)){c+=e.substring(m,n),w=2;break}else w=6;n++}return c}l(b,"scanString");function $(){if(o="",w=0,s=n,u=f,T=p,n>=i)return s=i,r=17;let c=e.charCodeAt(n);if(G(c)){do n++,o+=String.fromCharCode(c),c=e.charCodeAt(n);while(G(c));return r=15}if(h(c))return n++,o+=String.fromCharCode(c),c===13&&e.charCodeAt(n)===10&&(n++,o+=` +`),f++,p=n,r=14;switch(c){case 123:return n++,r=1;case 125:return n++,r=2;case 91:return n++,r=3;case 93:return n++,r=4;case 58:return n++,r=6;case 44:return n++,r=5;case 34:return n++,o=b(),r=10;case 47:const m=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n=12&&c<=15);return c}return l(E,"scanNextNonTrivia"),{setPosition:v,getPosition:l(()=>n,"getPosition"),scan:t?E:$,getToken:l(()=>r,"getToken"),getTokenValue:l(()=>o,"getTokenValue"),getTokenOffset:l(()=>s,"getTokenOffset"),getTokenLength:l(()=>n-s,"getTokenLength"),getTokenStartLine:l(()=>u,"getTokenStartLine"),getTokenStartCharacter:l(()=>s-T,"getTokenStartCharacter"),getTokenError:l(()=>w,"getTokenError")}}l(_e,"createScanner");function G(e){return e===32||e===9}l(G,"isWhiteSpace");function h(e){return e===10||e===13}l(h,"isLineBreak");function N(e){return e>=48&&e<=57}l(N,"isDigit");var te;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(te||(te={})),new Array(20).fill(0).map((e,t)=>" ".repeat(t));const D=200;new Array(D).fill(0).map((e,t)=>` +`+" ".repeat(t)),new Array(D).fill(0).map((e,t)=>"\r"+" ".repeat(t)),new Array(D).fill(0).map((e,t)=>`\r +`+" ".repeat(t)),new Array(D).fill(0).map((e,t)=>` +`+" ".repeat(t)),new Array(D).fill(0).map((e,t)=>"\r"+" ".repeat(t)),new Array(D).fill(0).map((e,t)=>`\r +`+" ".repeat(t));var x;(function(e){e.DEFAULT={allowTrailingComma:!1}})(x||(x={}));function $e(e,t=[],i=x.DEFAULT){let n=null,o=[];const s=[];function r(u){Array.isArray(o)?o.push(u):n!==null&&(o[n]=u)}return l(r,"onValue"),ye(e,{onObjectBegin:l(()=>{const u={};r(u),s.push(o),o=u,n=null},"onObjectBegin"),onObjectProperty:l(u=>{n=u},"onObjectProperty"),onObjectEnd:l(()=>{o=s.pop()},"onObjectEnd"),onArrayBegin:l(()=>{const u=[];r(u),s.push(o),o=u,n=null},"onArrayBegin"),onArrayEnd:l(()=>{o=s.pop()},"onArrayEnd"),onLiteralValue:r,onError:l((u,p,T)=>{t.push({error:u,offset:p,length:T})},"onError")},i),o[0]}l($e,"parse$1");function ye(e,t,i=x.DEFAULT){const n=_e(e,!1),o=[];function s(k){return k?()=>k(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}l(s,"toNoArgVisit");function r(k){return k?()=>k(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice()):()=>!0}l(r,"toNoArgVisitWithPath");function f(k){return k?_=>k(_,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}l(f,"toOneArgVisit");function u(k){return k?_=>k(_,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice()):()=>!0}l(u,"toOneArgVisitWithPath");const p=r(t.onObjectBegin),T=u(t.onObjectProperty),w=s(t.onObjectEnd),O=r(t.onArrayBegin),v=s(t.onArrayEnd),A=u(t.onLiteralValue),b=f(t.onSeparator),$=s(t.onComment),U=f(t.onError),E=i&&i.disallowComments,c=i&&i.allowTrailingComma;function m(){for(;;){const k=n.scan();switch(n.getTokenError()){case 4:g(14);break;case 5:g(15);break;case 3:g(13);break;case 1:E||g(11);break;case 2:g(12);break;case 6:g(16);break}switch(k){case 12:case 13:E?g(10):$();break;case 16:g(1);break;case 15:case 14:break;default:return k}}}l(m,"scanNext");function g(k,_=[],C=[]){if(U(k),_.length+C.length>0){let d=n.getToken();for(;d!==17;){if(_.indexOf(d)!==-1){m();break}else if(C.indexOf(d)!==-1)break;d=m()}}}l(g,"handleError");function y(k){const _=n.getTokenValue();return k?A(_):(T(_),o.push(_)),m(),!0}l(y,"parseString");function j(){switch(n.getToken()){case 11:const k=n.getTokenValue();let _=Number(k);isNaN(_)&&(g(2),_=0),A(_);break;case 7:A(null);break;case 8:A(!0);break;case 9:A(!1);break;default:return!1}return m(),!0}l(j,"parseLiteral");function ke(){return n.getToken()!==10?(g(3,[],[2,5]),!1):(y(!1),n.getToken()===6?(b(":"),m(),V()||g(4,[],[2,5])):g(5,[],[2,5]),o.pop(),!0)}l(ke,"parseProperty");function be(){p(),m();let k=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(k||g(4,[],[]),b(","),m(),n.getToken()===2&&c)break}else k&&g(6,[],[]);ke()||g(4,[],[2,5]),k=!0}return w(),n.getToken()!==2?g(7,[2],[]):m(),!0}l(be,"parseObject");function we(){O(),m();let k=!0,_=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(_||g(4,[],[]),b(","),m(),n.getToken()===4&&c)break}else _&&g(6,[],[]);k?(o.push(0),k=!1):o[o.length-1]++,V()||g(4,[],[4,5]),_=!0}return v(),k||o.pop(),n.getToken()!==4?g(8,[4],[]):m(),!0}l(we,"parseArray");function V(){switch(n.getToken()){case 3:return we();case 1:return be();case 10:return y(!0);default:return j()}}return l(V,"parseValue"),m(),n.getToken()===17?i.allowEmptyContent?!0:(g(4,[],[]),!1):V()?(n.getToken()!==17&&g(9,[],[]),!0):(g(4,[],[]),!1)}l(ye,"visit");var ie;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(ie||(ie={}));var oe;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(oe||(oe={}));const Be=$e;var se;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(se||(se={}));const le=l((e,t)=>Be(je(t,e,"utf8")),"readJsonc"),z=Symbol("implicitBaseUrl"),L="${configDir}",Fe=l(()=>{const{findPnpApi:e}=Te;return e&&e(process.cwd())},"getPnpApi"),Q=l((e,t,i,n)=>{const o=`resolveFromPackageJsonPath:${e}:${t}:${i}`;if(n!=null&&n.has(o))return n.get(o);const s=le(e,n);if(!s)return;let r=t||"tsconfig.json";if(!i&&s.exports)try{const[f]=Ae(s.exports,t,["require","types"]);r=f}catch{return!1}else!t&&s.tsconfig&&(r=s.tsconfig);return r=a.join(e,"..",r),n==null||n.set(o,r),r},"resolveFromPackageJsonPath"),H="package.json",X="tsconfig.json",Le=l((e,t,i)=>{let n=e;if(e===".."&&(n=a.join(n,X)),e[0]==="."&&(n=a.resolve(t,n)),a.isAbsolute(n)){if(F(i,n)){if(P(i,n).isFile())return n}else if(!n.endsWith(".json")){const v=`${n}.json`;if(F(i,v))return v}return}const[o,...s]=e.split("/"),r=o[0]==="@"?`${o}/${s.shift()}`:o,f=s.join("/"),u=Fe();if(u){const{resolveRequest:v}=u;try{if(r===e){const A=v(a.join(r,H),t);if(A){const b=Q(A,f,!1,i);if(b&&F(i,b))return b}}else{let A;try{A=v(e,t,{extensions:[".json"]})}catch{A=v(a.join(e,X),t)}if(A)return A}}catch{}}const p=ne(a.resolve(t),a.join("node_modules",r),i);if(!p||!P(i,p).isDirectory())return;const T=a.join(p,H);if(F(i,T)){const v=Q(T,f,!1,i);if(v===!1)return;if(v&&F(i,v)&&P(i,v).isFile())return v}const w=a.join(p,f),O=w.endsWith(".json");if(!O){const v=`${w}.json`;if(F(i,v))return v}if(F(i,w)){if(P(i,w).isDirectory()){const v=a.join(w,H);if(F(i,v)){const b=Q(v,"",!0,i);if(b&&F(i,b))return b}const A=a.join(w,X);if(F(i,A))return A}else if(O)return w}},"resolveExtendsPath"),Y=l((e,t)=>M(a.relative(e,t)),"pathRelative"),re=["files","include","exclude"],Ue=l((e,t,i,n)=>{const o=Le(e,t,n);if(!o)throw new Error(`File '${e}' not found.`);if(i.has(o))throw new Error(`Circularity detected while resolving configuration: ${o}`);i.add(o);const s=a.dirname(o),r=ue(o,n,i);delete r.references;const{compilerOptions:f}=r;if(f){const{baseUrl:u}=f;u&&!u.startsWith(L)&&(f.baseUrl=B(a.relative(t,a.join(s,u)))||"./");let{outDir:p}=f;p&&(p.startsWith(L)||(p=a.relative(t,a.join(s,p))),f.outDir=B(p)||"./")}for(const u of re){const p=r[u];p&&(r[u]=p.map(T=>T.startsWith(L)?T:B(a.relative(t,a.join(s,T)))))}return r},"resolveExtends"),Ee=["outDir","declarationDir"],ue=l((e,t,i=new Set)=>{let n;try{n=le(e,t)||{}}catch{throw new Error(`Cannot resolve tsconfig at path: ${e}`)}if(typeof n!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);const o=a.dirname(e);if(n.compilerOptions){const{compilerOptions:s}=n;s.paths&&!s.baseUrl&&(s[z]=o)}if(n.extends){const s=Array.isArray(n.extends)?n.extends:[n.extends];delete n.extends;for(const r of s.reverse()){const f=Ue(r,o,new Set(i),t),u={...f,...n,compilerOptions:{...f.compilerOptions,...n.compilerOptions}};f.watchOptions&&(u.watchOptions={...f.watchOptions,...n.watchOptions}),n=u}}if(n.compilerOptions){const{compilerOptions:s}=n,r=["baseUrl","rootDir"];for(const f of r){const u=s[f];if(u&&!u.startsWith(L)){const p=a.resolve(o,u),T=Y(o,p);s[f]=T}}for(const f of Ee){let u=s[f];u&&(Array.isArray(n.exclude)||(n.exclude=[]),n.exclude.includes(u)||n.exclude.push(u),u.startsWith(L)||(u=M(u)),s[f]=u)}}else n.compilerOptions={};if(n.include?(n.include=n.include.map(B),n.files&&delete n.files):n.files&&(n.files=n.files.map(s=>s.startsWith(L)?s:M(s))),n.watchOptions){const{watchOptions:s}=n;s.excludeDirectories&&(s.excludeDirectories=s.excludeDirectories.map(r=>B(a.resolve(o,r))))}return n},"_parseTsconfig"),I=l((e,t)=>{if(e.startsWith(L))return B(a.join(t,e.slice(L.length)))},"interpolateConfigDir"),Ne=["outDir","declarationDir","outFile","rootDir","baseUrl","tsBuildInfoFile"],fe=l((e,t=new Map)=>{const i=a.resolve(e),n=ue(i,t),o=a.dirname(i),{compilerOptions:s}=n;if(s){for(const f of Ne){const u=s[f];if(u){const p=I(u,o);s[f]=p?Y(o,p):u}}for(const f of["rootDirs","typeRoots"]){const u=s[f];u&&(s[f]=u.map(p=>{const T=I(p,o);return T?Y(o,T):p}))}const{paths:r}=s;if(r)for(const f of Object.keys(r))r[f]=r[f].map(u=>{var p;return(p=I(u,o))!=null?p:u})}for(const r of re){const f=n[r];f&&(n[r]=f.map(u=>{var p;return(p=I(u,o))!=null?p:u}))}return n},"parseTsconfig"),De=l((e=process.cwd(),t="tsconfig.json",i=new Map)=>{const n=ne(B(e),t,i);if(!n)return null;const o=fe(n,i);return{path:n,config:o}},"getTsconfig"),he=/\*/g,ce=l((e,t)=>{const i=e.match(he);if(i&&i.length>1)throw new Error(t)},"assertStarCount"),de=l(e=>{if(e.includes("*")){const[t,i]=e.split("*");return{prefix:t,suffix:i}}return e},"parsePattern"),Pe=l(({prefix:e,suffix:t},i)=>i.startsWith(e)&&i.endsWith(t),"isPatternMatch"),xe=l((e,t,i)=>Object.entries(e).map(([n,o])=>(ce(n,`Pattern '${n}' can have at most one '*' character.`),{pattern:de(n),substitutions:o.map(s=>{if(ce(s,`Substitution '${s}' in pattern '${n}' can have at most one '*' character.`),!t&&!J.test(s))throw new Error("Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?");return a.resolve(i,s)})})),"parsePaths"),Ie=l(e=>{const{compilerOptions:t}=e.config;if(!t)return null;const{baseUrl:i,paths:n}=t;if(!i&&!n)return null;const o=z in t&&t[z],s=a.resolve(a.dirname(e.path),i||o||"."),r=n?xe(n,i,s):[];return f=>{if(J.test(f))return[];const u=[];for(const O of r){if(O.pattern===f)return O.substitutions.map(B);typeof O.pattern!="string"&&u.push(O)}let p,T=-1;for(const O of u)Pe(O.pattern,f)&&O.pattern.prefix.length>T&&(T=O.pattern.prefix.length,p=O);if(!p)return i?[B(a.join(s,f))]:[];const w=f.slice(p.pattern.prefix.length,f.length-p.pattern.suffix.length);return p.substitutions.map(O=>B(O.replace("*",w)))}},"createPathsMatcher"),pe=l(e=>{let t="";for(let i=0;iMath.floor(Math.random()*26),"m"),Re=l(e=>Array.from({length:e},()=>String.fromCodePoint(Ve()+(Math.random()>.5?Se:We))).join(""),"S"),Je=l((e=Oe)=>{const t=process.execPath;if(e.existsSync(t))return!e.existsSync(pe(t));const i=`/${Re(10)}`;e.writeFileSync(i,"");const n=!e.existsSync(pe(i));return e.unlinkSync(i),n},"l"),{join:S}=a.posix,Z={ts:[".ts",".tsx",".d.ts"],cts:[".cts",".d.cts"],mts:[".mts",".d.mts"]},Me=l(e=>{const t=[...Z.ts],i=[...Z.cts],n=[...Z.mts];return e!=null&&e.allowJs&&(t.push(".js",".jsx"),i.push(".cjs"),n.push(".mjs")),[...t,...i,...n]},"getSupportedExtensions"),Ge=l(e=>{const t=[];if(!e)return t;const{outDir:i,declarationDir:n}=e;return i&&t.push(i),n&&t.push(n),t},"getDefaultExcludeSpec"),ae=l(e=>e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`),"escapeForRegexp"),ze=["node_modules","bower_components","jspm_packages"],q=`(?!(${ze.join("|")})(/|$))`,Qe=/(?:^|\/)[^.*?]+$/,ge="**/*",W="[^/]",K="[^./]",me=process.platform==="win32",He=l(({config:e,path:t},i=Je())=>{if("extends"in e)throw new Error("tsconfig#extends must be resolved. Use getTsconfig or parseTsconfig to resolve it.");if(!a.isAbsolute(t))throw new Error("The tsconfig path must be absolute");me&&(t=B(t));const n=a.dirname(t),{files:o,include:s,exclude:r,compilerOptions:f}=e,u=o==null?void 0:o.map(b=>S(n,b)),p=Me(f),T=i?"":"i",O=(r||Ge(f)).map(b=>{const $=S(n,b),U=ae($).replaceAll(String.raw`\*\*/`,"(.+/)?").replaceAll(String.raw`\*`,`${W}*`).replaceAll(String.raw`\?`,W);return new RegExp(`^${U}($|/)`,T)}),v=o||s?s:[ge],A=v?v.map(b=>{let $=S(n,b);Qe.test($)&&($=S($,ge));const U=ae($).replaceAll(String.raw`/\*\*`,`(/${q}${K}${W}*)*?`).replaceAll(/(\/)?\\\*/g,(E,c)=>{const m=`(${K}|(\\.(?!min\\.js$))?)*`;return c?`/${q}${K}${m}`:m}).replaceAll(/(\/)?\\\?/g,(E,c)=>{const m=W;return c?`/${q}${m}`:m});return new RegExp(`^${U}$`,T)}):void 0;return b=>{if(!a.isAbsolute(b))throw new Error("filePath must be absolute");if(me&&(b=B(b)),u!=null&&u.includes(b))return e;if(!(!p.some($=>b.endsWith($))||O.some($=>$.test(b)))&&A&&A.some($=>$.test(b)))return e}},"createFilesMatcher");export{He as createFilesMatcher,Ie as createPathsMatcher,De as getTsconfig,fe as parseTsconfig}; diff --git a/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/get-tsconfig/package.json b/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/get-tsconfig/package.json new file mode 100644 index 0000000..be89d9f --- /dev/null +++ b/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/get-tsconfig/package.json @@ -0,0 +1,46 @@ +{ + "name": "get-tsconfig", + "version": "4.8.1", + "description": "Find and parse the tsconfig.json file from a directory path", + "keywords": [ + "get-tsconfig", + "get", + "typescript", + "tsconfig", + "tsconfig.json" + ], + "license": "MIT", + "repository": "privatenumber/get-tsconfig", + "funding": "https://github.com/privatenumber/get-tsconfig?sponsor=1", + "author": { + "name": "Hiroki Osame", + "email": "hiroki.osame@gmail.com" + }, + "files": [ + "dist" + ], + "type": "module", + "main": "./dist/index.cjs", + "module": "./dist/index.mjs", + "types": "./dist/index.d.cts", + "exports": { + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + }, + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + } + }, + "imports": { + "#get-tsconfig": { + "types": "./src/index.ts", + "development": "./src/index.ts", + "default": "./dist/index.mjs" + } + }, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + } +} \ No newline at end of file diff --git a/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/resolve-pkg-maps b/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/resolve-pkg-maps new file mode 120000 index 0000000..ffbf03a --- /dev/null +++ b/node_modules/.pnpm/get-tsconfig@4.8.1/node_modules/resolve-pkg-maps @@ -0,0 +1 @@ +../../resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps \ No newline at end of file diff --git a/node_modules/.pnpm/lock.yaml b/node_modules/.pnpm/lock.yaml new file mode 100644 index 0000000..439a949 --- /dev/null +++ b/node_modules/.pnpm/lock.yaml @@ -0,0 +1,289 @@ +lockfileVersion: '6.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +devDependencies: + tsx: + specifier: ^4.19.2 + version: 4.19.2 + +packages: + + /@esbuild/aix-ppc64@0.23.1: + resolution: {integrity: sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm64@0.23.1: + resolution: {integrity: sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm@0.23.1: + resolution: {integrity: sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-x64@0.23.1: + resolution: {integrity: sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-arm64@0.23.1: + resolution: {integrity: sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-x64@0.23.1: + resolution: {integrity: sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-arm64@0.23.1: + resolution: {integrity: sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-x64@0.23.1: + resolution: {integrity: sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm64@0.23.1: + resolution: {integrity: sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm@0.23.1: + resolution: {integrity: sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ia32@0.23.1: + resolution: {integrity: sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64@0.23.1: + resolution: {integrity: sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-mips64el@0.23.1: + resolution: {integrity: sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ppc64@0.23.1: + resolution: {integrity: sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-riscv64@0.23.1: + resolution: {integrity: sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-s390x@0.23.1: + resolution: {integrity: sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-x64@0.23.1: + resolution: {integrity: sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/netbsd-x64@0.23.1: + resolution: {integrity: sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/openbsd-arm64@0.23.1: + resolution: {integrity: sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/openbsd-x64@0.23.1: + resolution: {integrity: sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/sunos-x64@0.23.1: + resolution: {integrity: sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-arm64@0.23.1: + resolution: {integrity: sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-ia32@0.23.1: + resolution: {integrity: sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-x64@0.23.1: + resolution: {integrity: sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild@0.23.1: + resolution: {integrity: sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==} + engines: {node: '>=18'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/aix-ppc64': 0.23.1 + '@esbuild/android-arm': 0.23.1 + '@esbuild/android-arm64': 0.23.1 + '@esbuild/android-x64': 0.23.1 + '@esbuild/darwin-arm64': 0.23.1 + '@esbuild/darwin-x64': 0.23.1 + '@esbuild/freebsd-arm64': 0.23.1 + '@esbuild/freebsd-x64': 0.23.1 + '@esbuild/linux-arm': 0.23.1 + '@esbuild/linux-arm64': 0.23.1 + '@esbuild/linux-ia32': 0.23.1 + '@esbuild/linux-loong64': 0.23.1 + '@esbuild/linux-mips64el': 0.23.1 + '@esbuild/linux-ppc64': 0.23.1 + '@esbuild/linux-riscv64': 0.23.1 + '@esbuild/linux-s390x': 0.23.1 + '@esbuild/linux-x64': 0.23.1 + '@esbuild/netbsd-x64': 0.23.1 + '@esbuild/openbsd-arm64': 0.23.1 + '@esbuild/openbsd-x64': 0.23.1 + '@esbuild/sunos-x64': 0.23.1 + '@esbuild/win32-arm64': 0.23.1 + '@esbuild/win32-ia32': 0.23.1 + '@esbuild/win32-x64': 0.23.1 + dev: true + + /fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /get-tsconfig@4.8.1: + resolution: {integrity: sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==} + dependencies: + resolve-pkg-maps: 1.0.0 + dev: true + + /resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + dev: true + + /tsx@4.19.2: + resolution: {integrity: sha512-pOUl6Vo2LUq/bSa8S5q7b91cgNSjctn9ugq/+Mvow99qW6x/UZYwzxy/3NmqoT66eHYfCVvFvACC58UBPFf28g==} + engines: {node: '>=18.0.0'} + hasBin: true + dependencies: + esbuild: 0.23.1 + get-tsconfig: 4.8.1 + optionalDependencies: + fsevents: 2.3.3 + dev: true diff --git a/node_modules/.pnpm/node_modules/.bin/esbuild b/node_modules/.pnpm/node_modules/.bin/esbuild new file mode 100755 index 0000000..d9910b9 --- /dev/null +++ b/node_modules/.pnpm/node_modules/.bin/esbuild @@ -0,0 +1,14 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -z "$NODE_PATH" ]; then + export NODE_PATH="/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/bin/node_modules:/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/node_modules:/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/esbuild@0.23.1/node_modules:/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/node_modules" +else + export NODE_PATH="/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/bin/node_modules:/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/esbuild@0.23.1/node_modules/esbuild/node_modules:/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/esbuild@0.23.1/node_modules:/Users/taollin/Desktop/test/docker-time/node_modules/.pnpm/node_modules:$NODE_PATH" +fi +"$basedir/../esbuild/bin/esbuild" "$@" +exit $? diff --git a/node_modules/.pnpm/node_modules/@esbuild/darwin-arm64 b/node_modules/.pnpm/node_modules/@esbuild/darwin-arm64 new file mode 120000 index 0000000..911500b --- /dev/null +++ b/node_modules/.pnpm/node_modules/@esbuild/darwin-arm64 @@ -0,0 +1 @@ +../../@esbuild+darwin-arm64@0.23.1/node_modules/@esbuild/darwin-arm64 \ No newline at end of file diff --git a/node_modules/.pnpm/node_modules/esbuild b/node_modules/.pnpm/node_modules/esbuild new file mode 120000 index 0000000..46df6e6 --- /dev/null +++ b/node_modules/.pnpm/node_modules/esbuild @@ -0,0 +1 @@ +../esbuild@0.23.1/node_modules/esbuild \ No newline at end of file diff --git a/node_modules/.pnpm/node_modules/fsevents b/node_modules/.pnpm/node_modules/fsevents new file mode 120000 index 0000000..8528285 --- /dev/null +++ b/node_modules/.pnpm/node_modules/fsevents @@ -0,0 +1 @@ +../fsevents@2.3.3/node_modules/fsevents \ No newline at end of file diff --git a/node_modules/.pnpm/node_modules/get-tsconfig b/node_modules/.pnpm/node_modules/get-tsconfig new file mode 120000 index 0000000..97f809c --- /dev/null +++ b/node_modules/.pnpm/node_modules/get-tsconfig @@ -0,0 +1 @@ +../get-tsconfig@4.8.1/node_modules/get-tsconfig \ No newline at end of file diff --git a/node_modules/.pnpm/node_modules/resolve-pkg-maps b/node_modules/.pnpm/node_modules/resolve-pkg-maps new file mode 120000 index 0000000..5206c96 --- /dev/null +++ b/node_modules/.pnpm/node_modules/resolve-pkg-maps @@ -0,0 +1 @@ +../resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps \ No newline at end of file diff --git a/node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/LICENSE b/node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/LICENSE new file mode 100644 index 0000000..51e4fd8 --- /dev/null +++ b/node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Hiroki Osame + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/README.md b/node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/README.md new file mode 100644 index 0000000..2469b1b --- /dev/null +++ b/node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/README.md @@ -0,0 +1,216 @@ +# resolve-pkg-maps + +Utils to resolve `package.json` subpath & conditional [`exports`](https://nodejs.org/api/packages.html#exports)/[`imports`](https://nodejs.org/api/packages.html#imports) in resolvers. + +Implements the [ESM resolution algorithm](https://nodejs.org/api/esm.html#resolver-algorithm-specification). Tested [against Node.js](/tests/) for accuracy. + +Support this project by ⭐️ starring and sharing it. [Follow me](https://github.com/privatenumber) to see what other cool projects I'm working on! ❤️ + +## Usage + +### Resolving `exports` + +_utils/package.json_ +```json5 +{ + // ... + "exports": { + "./reverse": { + "require": "./file.cjs", + "default": "./file.mjs" + } + }, + // ... +} +``` + +```ts +import { resolveExports } from 'resolve-pkg-maps' + +const [packageName, packageSubpath] = parseRequest('utils/reverse') + +const resolvedPaths: string[] = resolveExports( + getPackageJson(packageName).exports, + packageSubpath, + ['import', ...otherConditions] +) +// => ['./file.mjs'] +``` + +### Resolving `imports` + +_package.json_ +```json5 +{ + // ... + "imports": { + "#supports-color": { + "node": "./index.js", + "default": "./browser.js" + } + }, + // ... +} +``` + +```ts +import { resolveImports } from 'resolve-pkg-maps' + +const resolvedPaths: string[] = resolveImports( + getPackageJson('.').imports, + '#supports-color', + ['node', ...otherConditions] +) +// => ['./index.js'] +``` + +## API + +### resolveExports(exports, request, conditions) + +Returns: `string[]` + +Resolves the `request` based on `exports` and `conditions`. Returns an array of paths (e.g. in case a fallback array is matched). + +#### exports + +Type: +```ts +type Exports = PathOrMap | readonly PathOrMap[] + +type PathOrMap = string | PathConditionsMap + +type PathConditionsMap = { + [condition: string]: PathConditions | null +} +``` + +The [`exports` property](https://nodejs.org/api/packages.html#exports) value in `package.json`. + +#### request + +Type: `string` + +The package subpath to resolve. Assumes a normalized path is passed in (eg. [repeating slashes `//`](https://github.com/nodejs/node/issues/44316)). + +It _should not_ start with `/` or `./`. + +Example: if the full import path is `some-package/subpath/file`, the request is `subpath/file`. + + +#### conditions + +Type: `readonly string[]` + +An array of conditions to use when resolving the request. For reference, Node.js's default conditions are [`['node', 'import']`](https://nodejs.org/api/esm.html#:~:text=defaultConditions%20is%20the%20conditional%20environment%20name%20array%2C%20%5B%22node%22%2C%20%22import%22%5D.). + +The order of this array does not matter; the order of condition keys in the export map is what matters instead. + +Not all conditions in the array need to be met to resolve the request. It just needs enough to resolve to a path. + +--- + +### resolveImports(imports, request, conditions) + +Returns: `string[]` + +Resolves the `request` based on `imports` and `conditions`. Returns an array of paths (e.g. in case a fallback array is matched). + +#### imports + +Type: +```ts +type Imports = { + [condition: string]: PathOrMap | readonly PathOrMap[] | null +} + +type PathOrMap = string | Imports +``` + +The [`imports` property](https://nodejs.org/api/packages.html#imports) value in `package.json`. + + +#### request + +Type: `string` + +The request resolve. Assumes a normalized path is passed in (eg. [repeating slashes `//`](https://github.com/nodejs/node/issues/44316)). + +> **Note:** In Node.js, imports resolutions are limited to requests prefixed with `#`. However, this package does not enforce that requirement in case you want to add custom support for non-prefixed entries. + +#### conditions + +Type: `readonly string[]` + +An array of conditions to use when resolving the request. For reference, Node.js's default conditions are [`['node', 'import']`](https://nodejs.org/api/esm.html#:~:text=defaultConditions%20is%20the%20conditional%20environment%20name%20array%2C%20%5B%22node%22%2C%20%22import%22%5D.). + +The order of this array does not matter; the order of condition keys in the import map is what matters instead. + +Not all conditions in the array need to be met to resolve the request. It just needs enough to resolve to a path. + +--- + +### Errors + +#### `ERR_PACKAGE_PATH_NOT_EXPORTED` + - If the request is not exported by the export map + +#### `ERR_PACKAGE_IMPORT_NOT_DEFINED` + - If the request is not defined by the import map + +#### `ERR_INVALID_PACKAGE_CONFIG` + + - If an object contains properties that are both paths and conditions (e.g. start with and without `.`) + - If an object contains numeric properties + +#### `ERR_INVALID_PACKAGE_TARGET` + - If a resolved exports path is not a valid path (e.g. not relative or has protocol) + - If a resolved path includes `..` or `node_modules` + - If a resolved path is a type that cannot be parsed + +## FAQ + +### Why do the APIs return an array of paths? + +`exports`/`imports` supports passing in a [fallback array](https://github.com/jkrems/proposal-pkg-exports/#:~:text=Whenever%20there%20is,to%20new%20cases.) to provide fallback paths if the previous one is invalid: + +```json5 +{ + "exports": { + "./feature": [ + "./file.js", + "./fallback.js" + ] + } +} +``` + +Node.js's implementation [picks the first valid path (without attempting to resolve it)](https://github.com/nodejs/node/issues/44282#issuecomment-1220151715) and throws an error if it can't be resolved. Node.js's fallback array is designed for [forward compatibility with features](https://github.com/jkrems/proposal-pkg-exports/#:~:text=providing%20forwards%20compatiblitiy%20for%20new%20features) (e.g. protocols) that can be immediately/inexpensively validated: + +```json5 +{ + "exports": { + "./core-polyfill": ["std:core-module", "./core-polyfill.js"] + } +} +``` + +However, [Webpack](https://webpack.js.org/guides/package-exports/#alternatives) and [TypeScript](https://github.com/microsoft/TypeScript/blob/71e852922888337ef51a0e48416034a94a6c34d9/src/compiler/moduleSpecifiers.ts#L695) have deviated from this behavior and attempts to resolve the next path if a path cannot be resolved. + +By returning an array of matched paths instead of just the first one, the user can decide which behavior to adopt. + +### How is it different from [`resolve.exports`](https://github.com/lukeed/resolve.exports)? + +`resolve.exports` only resolves `exports`, whereas this package resolves both `exports` & `imports`. This comparison will only cover resolving `exports`. + +- Despite it's name, `resolve.exports` handles more than just `exports`. It takes in the entire `package.json` object to handle resolving `.` and [self-references](https://nodejs.org/api/packages.html#self-referencing-a-package-using-its-name). This package only accepts `exports`/`imports` maps from `package.json` and is scoped to only resolving what's defined in the maps. + +- `resolve.exports` accepts the full request (e.g. `foo/bar`), whereas this package only accepts the requested subpath (e.g. `bar`). + +- `resolve.exports` only returns the first result in a fallback array. This package returns an array of results for the user to decide how to handle it. + +- `resolve.exports` supports [subpath folder mapping](https://nodejs.org/docs/latest-v16.x/api/packages.html#subpath-folder-mappings) (deprecated in Node.js v16 & removed in v17) but seems to [have a bug](https://github.com/lukeed/resolve.exports/issues/7). This package does not support subpath folder mapping because Node.js has removed it in favor of using subpath patterns. + +- Neither resolvers rely on a file-system + +This package also addresses many of the bugs in `resolve.exports`, demonstrated in [this test](/tests/exports/compare-resolve.exports.ts). diff --git a/node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.cjs b/node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.cjs new file mode 100755 index 0000000..6fe6ba8 --- /dev/null +++ b/node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const d=r=>r!==null&&typeof r=="object",s=(r,t)=>Object.assign(new Error(`[${r}]: ${t}`),{code:r}),g="ERR_INVALID_PACKAGE_CONFIG",E="ERR_INVALID_PACKAGE_TARGET",I="ERR_PACKAGE_PATH_NOT_EXPORTED",P="ERR_PACKAGE_IMPORT_NOT_DEFINED",R=/^\d+$/,O=/^(\.{1,2}|node_modules)$/i,u=/\/|\\/;var h=(r=>(r.Export="exports",r.Import="imports",r))(h||{});const f=(r,t,n,o,c)=>{if(t==null)return[];if(typeof t=="string"){const[e,...i]=t.split(u);if(e===".."||i.some(l=>O.test(l)))throw s(E,`Invalid "${r}" target "${t}" defined in the package config`);return[c?t.replace(/\*/g,c):t]}if(Array.isArray(t))return t.flatMap(e=>f(r,e,n,o,c));if(d(t)){for(const e of Object.keys(t)){if(R.test(e))throw s(g,"Cannot contain numeric property keys");if(e==="default"||o.includes(e))return f(r,t[e],n,o,c)}return[]}throw s(E,`Invalid "${r}" target "${t}"`)},a="*",v=(r,t)=>{const n=r.indexOf(a),o=t.indexOf(a);return n===o?t.length>r.length:o>n};function A(r,t){if(!t.includes(a)&&r.hasOwnProperty(t))return[t];let n,o;for(const c of Object.keys(r))if(c.includes(a)){const[e,i,l]=c.split(a);if(l===void 0&&t.startsWith(e)&&t.endsWith(i)){const _=t.slice(e.length,-i.length||void 0);_&&(!n||v(n,c))&&(n=c,o=_)}}return[n,o]}const p=r=>Object.keys(r).reduce((t,n)=>{const o=n===""||n[0]!==".";if(t===void 0||t===o)return o;throw s(g,'"exports" cannot contain some keys starting with "." and some not')},void 0),w=/^\w+:/,m=(r,t,n)=>{if(!r)throw new Error('"exports" is required');t=t===""?".":`./${t}`,(typeof r=="string"||Array.isArray(r)||d(r)&&p(r))&&(r={".":r});const[o,c]=A(r,t),e=f(h.Export,r[o],t,n,c);if(e.length===0)throw s(I,t==="."?'No "exports" main defined':`Package subpath '${t}' is not defined by "exports"`);for(const i of e)if(!i.startsWith("./")&&!w.test(i))throw s(E,`Invalid "exports" target "${i}" defined in the package config`);return e},T=(r,t,n)=>{if(!r)throw new Error('"imports" is required');const[o,c]=A(r,t),e=f(h.Import,r[o],t,n,c);if(e.length===0)throw s(P,`Package import specifier "${t}" is not defined in package`);return e};exports.resolveExports=m,exports.resolveImports=T; diff --git a/node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.d.cts b/node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.d.cts new file mode 100644 index 0000000..fc84489 --- /dev/null +++ b/node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.d.cts @@ -0,0 +1,11 @@ +type PathConditionsMap = { + [condition: string]: PathConditions | null; +}; +type PathOrMap = string | PathConditionsMap; +type PathConditions = PathOrMap | readonly PathOrMap[]; + +declare const resolveExports: (exports: PathConditions, request: string, conditions: readonly string[]) => string[]; + +declare const resolveImports: (imports: PathConditionsMap, request: string, conditions: readonly string[]) => string[]; + +export { PathConditions, PathConditionsMap, resolveExports, resolveImports }; diff --git a/node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.d.mts b/node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.d.mts new file mode 100644 index 0000000..fc84489 --- /dev/null +++ b/node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.d.mts @@ -0,0 +1,11 @@ +type PathConditionsMap = { + [condition: string]: PathConditions | null; +}; +type PathOrMap = string | PathConditionsMap; +type PathConditions = PathOrMap | readonly PathOrMap[]; + +declare const resolveExports: (exports: PathConditions, request: string, conditions: readonly string[]) => string[]; + +declare const resolveImports: (imports: PathConditionsMap, request: string, conditions: readonly string[]) => string[]; + +export { PathConditions, PathConditionsMap, resolveExports, resolveImports }; diff --git a/node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.mjs b/node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.mjs new file mode 100755 index 0000000..d2a3be5 --- /dev/null +++ b/node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.mjs @@ -0,0 +1 @@ +const A=r=>r!==null&&typeof r=="object",a=(r,t)=>Object.assign(new Error(`[${r}]: ${t}`),{code:r}),_="ERR_INVALID_PACKAGE_CONFIG",E="ERR_INVALID_PACKAGE_TARGET",I="ERR_PACKAGE_PATH_NOT_EXPORTED",P="ERR_PACKAGE_IMPORT_NOT_DEFINED",R=/^\d+$/,O=/^(\.{1,2}|node_modules)$/i,w=/\/|\\/;var h=(r=>(r.Export="exports",r.Import="imports",r))(h||{});const f=(r,t,e,o,c)=>{if(t==null)return[];if(typeof t=="string"){const[n,...i]=t.split(w);if(n===".."||i.some(l=>O.test(l)))throw a(E,`Invalid "${r}" target "${t}" defined in the package config`);return[c?t.replace(/\*/g,c):t]}if(Array.isArray(t))return t.flatMap(n=>f(r,n,e,o,c));if(A(t)){for(const n of Object.keys(t)){if(R.test(n))throw a(_,"Cannot contain numeric property keys");if(n==="default"||o.includes(n))return f(r,t[n],e,o,c)}return[]}throw a(E,`Invalid "${r}" target "${t}"`)},s="*",m=(r,t)=>{const e=r.indexOf(s),o=t.indexOf(s);return e===o?t.length>r.length:o>e};function d(r,t){if(!t.includes(s)&&r.hasOwnProperty(t))return[t];let e,o;for(const c of Object.keys(r))if(c.includes(s)){const[n,i,l]=c.split(s);if(l===void 0&&t.startsWith(n)&&t.endsWith(i)){const g=t.slice(n.length,-i.length||void 0);g&&(!e||m(e,c))&&(e=c,o=g)}}return[e,o]}const p=r=>Object.keys(r).reduce((t,e)=>{const o=e===""||e[0]!==".";if(t===void 0||t===o)return o;throw a(_,'"exports" cannot contain some keys starting with "." and some not')},void 0),u=/^\w+:/,v=(r,t,e)=>{if(!r)throw new Error('"exports" is required');t=t===""?".":`./${t}`,(typeof r=="string"||Array.isArray(r)||A(r)&&p(r))&&(r={".":r});const[o,c]=d(r,t),n=f(h.Export,r[o],t,e,c);if(n.length===0)throw a(I,t==="."?'No "exports" main defined':`Package subpath '${t}' is not defined by "exports"`);for(const i of n)if(!i.startsWith("./")&&!u.test(i))throw a(E,`Invalid "exports" target "${i}" defined in the package config`);return n},T=(r,t,e)=>{if(!r)throw new Error('"imports" is required');const[o,c]=d(r,t),n=f(h.Import,r[o],t,e,c);if(n.length===0)throw a(P,`Package import specifier "${t}" is not defined in package`);return n};export{v as resolveExports,T as resolveImports}; diff --git a/node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/package.json b/node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/package.json new file mode 100644 index 0000000..720d984 --- /dev/null +++ b/node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/package.json @@ -0,0 +1,42 @@ +{ + "name": "resolve-pkg-maps", + "version": "1.0.0", + "description": "Resolve package.json exports & imports maps", + "keywords": [ + "node.js", + "package.json", + "exports", + "imports" + ], + "license": "MIT", + "repository": "privatenumber/resolve-pkg-maps", + "funding": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1", + "author": { + "name": "Hiroki Osame", + "email": "hiroki.osame@gmail.com" + }, + "type": "module", + "files": [ + "dist" + ], + "main": "./dist/index.cjs", + "module": "./dist/index.mjs", + "types": "./dist/index.d.cts", + "exports": { + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + }, + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + } + }, + "imports": { + "#resolve-pkg-maps": { + "types": "./src/index.ts", + "development": "./src/index.ts", + "default": "./dist/index.mjs" + } + } +} \ No newline at end of file diff --git a/node_modules/.pnpm/tsx@4.19.2/node_modules/esbuild b/node_modules/.pnpm/tsx@4.19.2/node_modules/esbuild new file mode 120000 index 0000000..134748e --- /dev/null +++ b/node_modules/.pnpm/tsx@4.19.2/node_modules/esbuild @@ -0,0 +1 @@ +../../esbuild@0.23.1/node_modules/esbuild \ No newline at end of file diff --git a/node_modules/.pnpm/tsx@4.19.2/node_modules/fsevents b/node_modules/.pnpm/tsx@4.19.2/node_modules/fsevents new file mode 120000 index 0000000..d4d74fa --- /dev/null +++ b/node_modules/.pnpm/tsx@4.19.2/node_modules/fsevents @@ -0,0 +1 @@ +../../fsevents@2.3.3/node_modules/fsevents \ No newline at end of file diff --git a/node_modules/.pnpm/tsx@4.19.2/node_modules/get-tsconfig b/node_modules/.pnpm/tsx@4.19.2/node_modules/get-tsconfig new file mode 120000 index 0000000..c487007 --- /dev/null +++ b/node_modules/.pnpm/tsx@4.19.2/node_modules/get-tsconfig @@ -0,0 +1 @@ +../../get-tsconfig@4.8.1/node_modules/get-tsconfig \ No newline at end of file diff --git a/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/LICENSE b/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/LICENSE new file mode 100644 index 0000000..bf183d2 --- /dev/null +++ b/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Hiroki Osame + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/README.md b/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/README.md new file mode 100644 index 0000000..b269d1c --- /dev/null +++ b/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/README.md @@ -0,0 +1,32 @@ +

+
+ + + tsx + +

+ +

+ +

+TypeScript Execute (tsx): The easiest way to run TypeScript in Node.js +

+Documentation    |    Getting started → +

+ +
+ +

+ + +

+

Already a sponsor? Join the discussion in the Development repo!

+ +## Sponsors + +

+ + + +

+ diff --git a/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/cjs/api/index.cjs b/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/cjs/api/index.cjs new file mode 100755 index 0000000..96ed398 --- /dev/null +++ b/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/cjs/api/index.cjs @@ -0,0 +1 @@ +"use strict";require("../../get-pipe-path-BoR10qr8.cjs");var r=require("../../register-DCnOAxY2.cjs"),e=require("../../require-DBpSESet.cjs");require("module"),require("node:path"),require("../../temporary-directory-B83uKxJF.cjs"),require("node:os"),require("node:module"),require("node:url"),require("get-tsconfig"),require("node:fs"),require("../../index-B4SIRlEU.cjs"),require("esbuild"),require("node:crypto"),require("../../client-D6NvIMSC.cjs"),require("node:net"),exports.register=r.register,exports.require=e.tsxRequire; diff --git a/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/cjs/api/index.d.cts b/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/cjs/api/index.d.cts new file mode 100644 index 0000000..7868f9a --- /dev/null +++ b/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/cjs/api/index.d.cts @@ -0,0 +1,35 @@ +import { R as RequiredProperty } from '../../types-Cxp8y2TL.js'; + +type RegisterOptions = { + namespace?: string; +}; +type Unregister = () => void; +type ScopedRequire = (id: string, fromFile: string | URL) => any; +type ScopedResolve = (id: string, fromFile: string | URL, resolveOptions?: { + paths?: string[] | undefined; +}) => string; +type NamespacedUnregister = Unregister & { + require: ScopedRequire; + resolve: ScopedResolve; + unregister: Unregister; +}; +type Register = { + (options: RequiredProperty): NamespacedUnregister; + (options?: RegisterOptions): Unregister; +}; +declare const register: Register; + +declare const tsxRequire: { + (id: string, fromFile: string | URL): any; + resolve: { + (id: string, fromFile: string | URL, options?: { + paths?: string[] | undefined; + }): string; + paths: (request: string) => string[] | null; + }; + main: NodeJS.Module | undefined; + extensions: NodeJS.RequireExtensions; + cache: NodeJS.Dict; +}; + +export { register, tsxRequire as require }; diff --git a/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/cjs/api/index.d.mts b/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/cjs/api/index.d.mts new file mode 100644 index 0000000..7868f9a --- /dev/null +++ b/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/cjs/api/index.d.mts @@ -0,0 +1,35 @@ +import { R as RequiredProperty } from '../../types-Cxp8y2TL.js'; + +type RegisterOptions = { + namespace?: string; +}; +type Unregister = () => void; +type ScopedRequire = (id: string, fromFile: string | URL) => any; +type ScopedResolve = (id: string, fromFile: string | URL, resolveOptions?: { + paths?: string[] | undefined; +}) => string; +type NamespacedUnregister = Unregister & { + require: ScopedRequire; + resolve: ScopedResolve; + unregister: Unregister; +}; +type Register = { + (options: RequiredProperty): NamespacedUnregister; + (options?: RegisterOptions): Unregister; +}; +declare const register: Register; + +declare const tsxRequire: { + (id: string, fromFile: string | URL): any; + resolve: { + (id: string, fromFile: string | URL, options?: { + paths?: string[] | undefined; + }): string; + paths: (request: string) => string[] | null; + }; + main: NodeJS.Module | undefined; + extensions: NodeJS.RequireExtensions; + cache: NodeJS.Dict; +}; + +export { register, tsxRequire as require }; diff --git a/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/cjs/api/index.mjs b/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/cjs/api/index.mjs new file mode 100755 index 0000000..358e143 --- /dev/null +++ b/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/cjs/api/index.mjs @@ -0,0 +1 @@ +import"../../get-pipe-path-BHW2eJdv.mjs";import{r as d}from"../../register-C3TE0KFF.mjs";import{t as j}from"../../require-BnyFnlmk.mjs";import"module";import"node:path";import"../../temporary-directory-CwHp0_NW.mjs";import"node:os";import"node:module";import"node:url";import"get-tsconfig";import"node:fs";import"../../index-DlKgSVBb.mjs";import"esbuild";import"node:crypto";import"../../client-BQVF1NaW.mjs";import"node:net";export{d as register,j as require}; diff --git a/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/cjs/index.cjs b/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/cjs/index.cjs new file mode 100755 index 0000000..4f438e8 --- /dev/null +++ b/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/cjs/index.cjs @@ -0,0 +1 @@ +"use strict";var r=require("../register-DCnOAxY2.cjs");require("../get-pipe-path-BoR10qr8.cjs"),require("module"),require("node:path"),require("../temporary-directory-B83uKxJF.cjs"),require("node:os"),require("node:module"),require("node:url"),require("get-tsconfig"),require("node:fs"),require("../index-B4SIRlEU.cjs"),require("esbuild"),require("node:crypto"),require("../client-D6NvIMSC.cjs"),require("node:net"),r.register(); diff --git a/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/cjs/index.mjs b/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/cjs/index.mjs new file mode 100755 index 0000000..8aabe2e --- /dev/null +++ b/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/cjs/index.mjs @@ -0,0 +1 @@ +import{r}from"../register-C3TE0KFF.mjs";import"../get-pipe-path-BHW2eJdv.mjs";import"module";import"node:path";import"../temporary-directory-CwHp0_NW.mjs";import"node:os";import"node:module";import"node:url";import"get-tsconfig";import"node:fs";import"../index-DlKgSVBb.mjs";import"esbuild";import"node:crypto";import"../client-BQVF1NaW.mjs";import"node:net";r(); diff --git a/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/cli.cjs b/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/cli.cjs new file mode 100755 index 0000000..01488c4 --- /dev/null +++ b/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/cli.cjs @@ -0,0 +1,54 @@ +"use strict";var $s=Object.defineProperty;var a=(t,e)=>$s(t,"name",{value:e,configurable:!0});var Et=require("node:os"),Ts=require("tty"),xs=require("esbuild"),Os=require("./package-Da8mCwBa.cjs"),he=require("./get-pipe-path-BoR10qr8.cjs"),Ru=require("node:url"),Ns=require("child_process"),z=require("path"),De=require("fs"),je=require("./node-features-roYmp9jK.cjs"),Hs=require("node:path"),Ls=require("events"),Ae=require("util"),Is=require("stream"),bu=require("os"),Ps=require("node:net"),pt=require("node:fs"),ks=require("./temporary-directory-B83uKxJF.cjs");require("module");const Ms="known-flag",Gs="unknown-flag",Ws="argument",{stringify:ye}=JSON,js=/\B([A-Z])/g,Us=a(t=>t.replace(js,"-$1").toLowerCase(),"v$1"),{hasOwnProperty:Ks}=Object.prototype,we=a((t,e)=>Ks.call(t,e),"w$2"),Vs=a(t=>Array.isArray(t),"L$2"),vu=a(t=>typeof t=="function"?[t,!1]:Vs(t)?[t[0],!0]:vu(t.type),"b$2"),zs=a((t,e)=>t===Boolean?e!=="false":e,"d$2"),Ys=a((t,e)=>typeof e=="boolean"?e:t===Number&&e===""?Number.NaN:t(e),"m$1"),qs=/[\s.:=]/,Xs=a(t=>{const e=`Flag name ${ye(t)}`;if(t.length===0)throw new Error(`${e} cannot be empty`);if(t.length===1)throw new Error(`${e} must be longer than a character`);const u=t.match(qs);if(u)throw new Error(`${e} cannot contain ${ye(u?.[0])}`)},"B"),Qs=a(t=>{const e={},u=a((r,s)=>{if(we(e,r))throw new Error(`Duplicate flags named ${ye(r)}`);e[r]=s},"r");for(const r in t){if(!we(t,r))continue;Xs(r);const s=t[r],n=[[],...vu(s),s];u(r,n);const i=Us(r);if(r!==i&&u(i,n),"alias"in s&&typeof s.alias=="string"){const{alias:D}=s,o=`Flag alias ${ye(D)} for flag ${ye(r)}`;if(D.length===0)throw new Error(`${o} cannot be empty`);if(D.length>1)throw new Error(`${o} must be a single character`);u(D,n)}}return e},"K$1"),Zs=a((t,e)=>{const u={};for(const r in t){if(!we(t,r))continue;const[s,,n,i]=e[r];if(s.length===0&&"default"in i){let{default:D}=i;typeof D=="function"&&(D=D()),u[r]=D}else u[r]=n?s:s.pop()}return u},"_$2"),Ue="--",Js=/[.:=]/,en=/^-{1,2}\w/,tn=a(t=>{if(!en.test(t))return;const e=!t.startsWith(Ue);let u=t.slice(e?1:2),r;const s=u.match(Js);if(s){const{index:n}=s;r=u.slice(n+1),u=u.slice(0,n)}return[u,r,e]},"N"),un=a((t,{onFlag:e,onArgument:u})=>{let r;const s=a((n,i)=>{if(typeof r!="function")return!0;r(n,i),r=void 0},"o");for(let n=0;n{for(const[u,r,s]of e.reverse()){if(r){const n=t[u];let i=n.slice(0,r);if(s||(i+=n.slice(r+1)),i!=="-"){t[u]=i;continue}}t.splice(u,1)}},"E"),Su=a((t,e=process.argv.slice(2),{ignore:u}={})=>{const r=[],s=Qs(t),n={},i=[];return i[Ue]=[],un(e,{onFlag(D,o,c){const f=we(s,D);if(!u?.(f?Ms:Gs,D,o)){if(f){const[h,l]=s[D],p=zs(l,o),C=a((g,y)=>{r.push(c),y&&r.push(y),h.push(Ys(l,g||""))},"p");return p===void 0?C:C(p)}we(n,D)||(n[D]=[]),n[D].push(o===void 0?!0:o),r.push(c)}},onArgument(D,o,c){u?.(Ws,e[o[0]])||(i.push(...D),c?(i[Ue]=D,e.splice(o[0])):r.push(o))}}),rn(e,r),{flags:Zs(t,s),unknownFlags:n,_:i}},"U$2");var sn=Object.create,Ke=Object.defineProperty,nn=Object.defineProperties,Dn=Object.getOwnPropertyDescriptor,on=Object.getOwnPropertyDescriptors,an=Object.getOwnPropertyNames,Bu=Object.getOwnPropertySymbols,ln=Object.getPrototypeOf,$u=Object.prototype.hasOwnProperty,cn=Object.prototype.propertyIsEnumerable,Tu=a((t,e,u)=>e in t?Ke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):t[e]=u,"W$1"),Ve=a((t,e)=>{for(var u in e||(e={}))$u.call(e,u)&&Tu(t,u,e[u]);if(Bu)for(var u of Bu(e))cn.call(e,u)&&Tu(t,u,e[u]);return t},"p"),Ct=a((t,e)=>nn(t,on(e)),"c"),fn=a(t=>Ke(t,"__esModule",{value:!0}),"nD"),hn=a((t,e)=>()=>(t&&(e=t(t=0)),e),"rD"),dn=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"iD"),En=a((t,e,u,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of an(e))!$u.call(t,s)&&s!=="default"&&Ke(t,s,{get:a(()=>e[s],"get"),enumerable:!(r=Dn(e,s))||r.enumerable});return t},"oD"),pn=a((t,e)=>En(fn(Ke(t!=null?sn(ln(t)):{},"default",{value:t,enumerable:!0})),t),"BD"),K=hn(()=>{}),Cn=dn((t,e)=>{K(),e.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\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])|\uD83C[\uDF3E\uDF73\uDF7C\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\uDF7C\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\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\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\uDF7C\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\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\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\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\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-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*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\u26A7\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-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\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[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});K(),K(),K();var Fn=a(t=>{var e,u,r;let s=(e=process.stdout.columns)!=null?e:Number.POSITIVE_INFINITY;return typeof t=="function"&&(t=t(s)),t||(t={}),Array.isArray(t)?{columns:t,stdoutColumns:s}:{columns:(u=t.columns)!=null?u:[],stdoutColumns:(r=t.stdoutColumns)!=null?r:s}},"v");K(),K(),K(),K(),K();function gn({onlyFirst:t=!1}={}){let e=["[\\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(e,t?void 0:"g")}a(gn,"w$1");function xu(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(gn(),"")}a(xu,"d$1"),K();function mn(t){return Number.isInteger(t)?t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141):!1}a(mn,"y$1");var _n=pn(Cn());function oe(t){if(typeof t!="string"||t.length===0||(t=xu(t),t.length===0))return 0;t=t.replace((0,_n.default)()," ");let e=0;for(let u=0;u=127&&r<=159||r>=768&&r<=879||(r>65535&&u++,e+=mn(r)?2:1)}return e}a(oe,"g");var Ou=a(t=>Math.max(...t.split(` +`).map(oe)),"b$1"),An=a(t=>{let e=[];for(let u of t){let{length:r}=u,s=r-e.length;for(let n=0;ne[n]&&(e[n]=i)}}return e},"k$1");K();var Nu=/^\d+%$/,Hu={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},yn=a((t,e)=>{var u;let r=[];for(let s=0;s=e){let o=i-e,c=Math.ceil(u.paddingLeft/s*o),f=o-c;u.paddingLeft-=c,u.paddingRight-=f,u.horizontalPadding=u.paddingLeft+u.paddingRight}u.paddingLeftString=u.paddingLeft?" ".repeat(u.paddingLeft):"",u.paddingRightString=u.paddingRight?" ".repeat(u.paddingRight):"";let D=e-u.horizontalPadding;u.width=Math.max(Math.min(u.width,D),n)}}a(wn,"aD");var Lu=a(()=>Object.assign([],{columns:0}),"G$1");function Rn(t,e){let u=[Lu()],[r]=u;for(let s of t){let n=s.width+s.horizontalPadding;r.columns+n>e&&(r=Lu(),u.push(r)),r.push(s),r.columns+=n}for(let s of u){let n=s.reduce((l,p)=>l+p.width+p.horizontalPadding,0),i=e-n;if(i===0)continue;let D=s.filter(l=>"autoOverflow"in l),o=D.filter(l=>l.autoOverflow>0),c=o.reduce((l,p)=>l+p.autoOverflow,0),f=Math.min(c,i);for(let l of o){let p=Math.floor(l.autoOverflow/c*f);l.width+=p,i-=p}let h=Math.floor(i/D.length);for(let l=0;le=>`\x1B[${e+t}m`,"U$1"),Pu=a((t=0)=>e=>`\x1B[${38+t};5;${e}m`,"V$1"),ku=a((t=0)=>(e,u,r)=>`\x1B[${38+t};2;${e};${u};${r}m`,"Y");function vn(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],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],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[u,r]of Object.entries(e)){for(let[s,n]of Object.entries(r))e[s]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},r[s]=e[s],t.set(n[0],n[1]);Object.defineProperty(e,u,{value:r,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi=Iu(),e.color.ansi256=Pu(),e.color.ansi16m=ku(),e.bgColor.ansi=Iu(Ft),e.bgColor.ansi256=Pu(Ft),e.bgColor.ansi16m=ku(Ft),Object.defineProperties(e,{rgbToAnsi256:{value:a((u,r,s)=>u===r&&r===s?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(r/255*5)+Math.round(s/255*5),"value"),enumerable:!1},hexToRgb:{value:a(u=>{let r=/(?[a-f\d]{6}|[a-f\d]{3})/i.exec(u.toString(16));if(!r)return[0,0,0];let{colorString:s}=r.groups;s.length===3&&(s=s.split("").map(i=>i+i).join(""));let n=Number.parseInt(s,16);return[n>>16&255,n>>8&255,n&255]},"value"),enumerable:!1},hexToAnsi256:{value:a(u=>e.rgbToAnsi256(...e.hexToRgb(u)),"value"),enumerable:!1},ansi256ToAnsi:{value:a(u=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let r,s,n;if(u>=232)r=((u-232)*10+8)/255,s=r,n=r;else{u-=16;let o=u%36;r=Math.floor(u/36)/5,s=Math.floor(o/6)/5,n=o%6/5}let i=Math.max(r,s,n)*2;if(i===0)return 30;let D=30+(Math.round(n)<<2|Math.round(s)<<1|Math.round(r));return i===2&&(D+=60),D},"value"),enumerable:!1},rgbToAnsi:{value:a((u,r,s)=>e.ansi256ToAnsi(e.rgbToAnsi256(u,r,s)),"value"),enumerable:!1},hexToAnsi:{value:a(u=>e.ansi256ToAnsi(e.hexToAnsi256(u)),"value"),enumerable:!1}}),e}a(vn,"AD");var Sn=vn(),Bn=Sn,ze=new Set(["\x1B","\x9B"]),$n=39,gt="\x07",Mu="[",Tn="]",Gu="m",mt=`${Tn}8;;`,Wu=a(t=>`${ze.values().next().value}${Mu}${t}${Gu}`,"J$1"),ju=a(t=>`${ze.values().next().value}${mt}${t}${gt}`,"Q"),xn=a(t=>t.split(" ").map(e=>oe(e)),"hD"),_t=a((t,e,u)=>{let r=[...e],s=!1,n=!1,i=oe(xu(t[t.length-1]));for(let[D,o]of r.entries()){let c=oe(o);if(i+c<=u?t[t.length-1]+=o:(t.push(o),i=0),ze.has(o)&&(s=!0,n=r.slice(D+1).join("").startsWith(mt)),s){n?o===gt&&(s=!1,n=!1):o===Gu&&(s=!1);continue}i+=c,i===u&&D0&&t.length>1&&(t[t.length-2]+=t.pop())},"S$1"),On=a(t=>{let e=t.split(" "),u=e.length;for(;u>0&&!(oe(e[u-1])>0);)u--;return u===e.length?t:e.slice(0,u).join(" ")+e.slice(u).join("")},"cD"),Nn=a((t,e,u={})=>{if(u.trim!==!1&&t.trim()==="")return"";let r="",s,n,i=xn(t),D=[""];for(let[c,f]of t.split(" ").entries()){u.trim!==!1&&(D[D.length-1]=D[D.length-1].trimStart());let h=oe(D[D.length-1]);if(c!==0&&(h>=e&&(u.wordWrap===!1||u.trim===!1)&&(D.push(""),h=0),(h>0||u.trim===!1)&&(D[D.length-1]+=" ",h++)),u.hard&&i[c]>e){let l=e-h,p=1+Math.floor((i[c]-l-1)/e);Math.floor((i[c]-1)/e)e&&h>0&&i[c]>0){if(u.wordWrap===!1&&he&&u.wordWrap===!1){_t(D,f,e);continue}D[D.length-1]+=f}u.trim!==!1&&(D=D.map(c=>On(c)));let o=[...D.join(` +`)];for(let[c,f]of o.entries()){if(r+=f,ze.has(f)){let{groups:l}=new RegExp(`(?:\\${Mu}(?\\d+)m|\\${mt}(?.*)${gt})`).exec(o.slice(c).join(""))||{groups:{}};if(l.code!==void 0){let p=Number.parseFloat(l.code);s=p===$n?void 0:p}else l.uri!==void 0&&(n=l.uri.length===0?void 0:l.uri)}let h=Bn.codes.get(Number(s));o[c+1]===` +`?(n&&(r+=ju("")),s&&h&&(r+=Wu(h))):f===` +`&&(s&&h&&(r+=Wu(s)),n&&(r+=ju(n)))}return r},"dD");function Hn(t,e,u){return String(t).normalize().replace(/\r\n/g,` +`).split(` +`).map(r=>Nn(r,e,u)).join(` +`)}a(Hn,"T$1");var Uu=a(t=>Array.from({length:t}).fill(""),"X");function Ln(t,e){let u=[],r=0;for(let s of t){let n=0,i=s.map(o=>{var c;let f=(c=e[r])!=null?c:"";r+=1,o.preprocess&&(f=o.preprocess(f)),Ou(f)>o.width&&(f=Hn(f,o.width,{hard:!0}));let h=f.split(` +`);if(o.postprocess){let{postprocess:l}=o;h=h.map((p,C)=>l.call(o,p,C))}return o.paddingTop&&h.unshift(...Uu(o.paddingTop)),o.paddingBottom&&h.push(...Uu(o.paddingBottom)),h.length>n&&(n=h.length),Ct(Ve({},o),{lines:h})}),D=[];for(let o=0;o{var h;let l=(h=f.lines[o])!=null?h:"",p=Number.isFinite(f.width)?" ".repeat(f.width-oe(l)):"",C=f.paddingLeftString;return f.align==="right"&&(C+=p),C+=l,f.align==="left"&&(C+=p),C+f.paddingRightString}).join("");D.push(c)}u.push(D.join(` +`))}return u.join(` +`)}a(Ln,"P");function In(t,e){if(!t||t.length===0)return"";let u=An(t),r=u.length;if(r===0)return"";let{stdoutColumns:s,columns:n}=Fn(e);if(n.length>r)throw new Error(`${n.length} columns defined, but only ${r} columns found`);let i=bn(s,n,u);return t.map(D=>Ln(i,D)).join(` +`)}a(In,"mD"),K();var Pn=["<",">","=",">=","<="];function kn(t){if(!Pn.includes(t))throw new TypeError(`Invalid breakpoint operator: ${t}`)}a(kn,"xD");function Mn(t){let e=Object.keys(t).map(u=>{let[r,s]=u.split(" ");kn(r);let n=Number.parseInt(s,10);if(Number.isNaN(n))throw new TypeError(`Invalid breakpoint value: ${s}`);let i=t[u];return{operator:r,breakpoint:n,value:i}}).sort((u,r)=>r.breakpoint-u.breakpoint);return u=>{var r;return(r=e.find(({operator:s,breakpoint:n})=>s==="="&&u===n||s===">"&&u>n||s==="<"&&u="&&u>=n||s==="<="&&u<=n))==null?void 0:r.value}}a(Mn,"wD");const Gn=a(t=>t.replace(/[\W_]([a-z\d])?/gi,(e,u)=>u?u.toUpperCase():""),"S"),Wn=a(t=>t.replace(/\B([A-Z])/g,"-$1").toLowerCase(),"q"),jn={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:a(t=>t.trim(),"preprocess")},{width:"100%",paddingLeft:2,paddingBottom:1}],"> 0":{stdoutColumns:1e3,columns:[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"content-width"}]}};function Un(t){let e=!1;return{type:"table",data:{tableData:Object.keys(t).sort((u,r)=>u.localeCompare(r)).map(u=>{const r=t[u],s="alias"in r;return s&&(e=!0),{name:u,flag:r,flagFormatted:`--${Wn(u)}`,aliasesEnabled:e,aliasFormatted:s?`-${r.alias}`:void 0}}).map(u=>(u.aliasesEnabled=e,[{type:"flagName",data:u},{type:"flagDescription",data:u}])),tableBreakpoints:jn}}}a(Un,"D");const Ku=a(t=>!t||(t.version??(t.help?t.help.version:void 0)),"A"),Vu=a(t=>{const e="parent"in t&&t.parent?.name;return(e?`${e} `:"")+t.name},"C");function Kn(t){const e=[];t.name&&e.push(Vu(t));const u=Ku(t)??("parent"in t&&Ku(t.parent));if(u&&e.push(`v${u}`),e.length!==0)return{id:"name",type:"text",data:`${e.join(" ")} +`}}a(Kn,"R");function Vn(t){const{help:e}=t;if(!(!e||!e.description))return{id:"description",type:"text",data:`${e.description} +`}}a(Vn,"L");function zn(t){const e=t.help||{};if("usage"in e)return e.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(e.usage)?e.usage.join(` +`):e.usage}}:void 0;if(t.name){const u=[],r=[Vu(t)];if(t.flags&&Object.keys(t.flags).length>0&&r.push("[flags...]"),t.parameters&&t.parameters.length>0){const{parameters:s}=t,n=s.indexOf("--"),i=n>-1&&s.slice(n+1).some(D=>D.startsWith("<"));r.push(s.map(D=>D!=="--"?D:i?"--":"[--]").join(" "))}if(r.length>1&&u.push(r.join(" ")),"commands"in t&&t.commands?.length&&u.push(`${t.name} `),u.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:u.join(` +`)}}}}a(zn,"T");function Yn(t){return!("commands"in t)||!t.commands?.length?void 0:{id:"commands",type:"section",data:{title:"Commands:",body:{type:"table",data:{tableData:t.commands.map(e=>[e.options.name,e.options.help?e.options.help.description:""]),tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}a(Yn,"_");function qn(t){if(!(!t.flags||Object.keys(t.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:Un(t.flags),indentBody:0}}}a(qn,"k");function Xn(t){const{help:e}=t;if(!e||!e.examples||e.examples.length===0)return;let{examples:u}=e;if(Array.isArray(u)&&(u=u.join(` +`)),u)return{id:"examples",type:"section",data:{title:"Examples:",body:u}}}a(Xn,"F");function Qn(t){if(!("alias"in t)||!t.alias)return;const{alias:e}=t;return{id:"aliases",type:"section",data:{title:"Aliases:",body:Array.isArray(e)?e.join(", "):e}}}a(Qn,"H");const Zn=a(t=>[Kn,Vn,zn,Yn,qn,Xn,Qn].map(e=>e(t)).filter(Boolean),"U"),Jn=Ts.WriteStream.prototype.hasColors();class ei{static{a(this,"M")}text(e){return e}bold(e){return Jn?`\x1B[1m${e}\x1B[22m`:e.toLocaleUpperCase()}indentText({text:e,spaces:u}){return e.replace(/^/gm," ".repeat(u))}heading(e){return this.bold(e)}section({title:e,body:u,indentBody:r=2}){return`${(e?`${this.heading(e)} +`:"")+(u?this.indentText({text:this.render(u),spaces:r}):"")} +`}table({tableData:e,tableOptions:u,tableBreakpoints:r}){return In(e.map(s=>s.map(n=>this.render(n))),r?Mn(r):u)}flagParameter(e){return e===Boolean?"":e===String?"":e===Number?"":Array.isArray(e)?this.flagParameter(e[0]):""}flagOperator(e){return" "}flagName(e){const{flag:u,flagFormatted:r,aliasesEnabled:s,aliasFormatted:n}=e;let i="";if(n?i+=`${n}, `:s&&(i+=" "),i+=r,"placeholder"in u&&typeof u.placeholder=="string")i+=`${this.flagOperator(e)}${u.placeholder}`;else{const D=this.flagParameter("type"in u?u.type:u);D&&(i+=`${this.flagOperator(e)}${D}`)}return i}flagDefault(e){return JSON.stringify(e)}flagDescription({flag:e}){let u="description"in e?e.description??"":"";if("default"in e){let{default:r}=e;typeof r=="function"&&(r=r()),r&&(u+=` (default: ${this.flagDefault(r)})`)}return u}render(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(u=>this.render(u)).join(` +`);if("type"in e&&this[e.type]){const u=this[e.type];if(typeof u=="function")return u.call(this,e.data)}throw new Error(`Invalid node type: ${JSON.stringify(e)}`)}}const At=/^[\w.-]+$/,{stringify:ee}=JSON,ti=/[|\\{}()[\]^$+*?.]/;function yt(t){const e=[];let u,r;for(const s of t){if(r)throw new Error(`Invalid parameter: Spread parameter ${ee(r)} must be last`);const n=s[0],i=s[s.length-1];let D;if(n==="<"&&i===">"&&(D=!0,u))throw new Error(`Invalid parameter: Required parameter ${ee(s)} cannot come after optional parameter ${ee(u)}`);if(n==="["&&i==="]"&&(D=!1,u=s),D===void 0)throw new Error(`Invalid parameter: ${ee(s)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let o=s.slice(1,-1);const c=o.slice(-3)==="...";c&&(r=s,o=o.slice(0,-3));const f=o.match(ti);if(f)throw new Error(`Invalid parameter: ${ee(s)}. Invalid character found ${ee(f[0])}`);e.push({name:o,required:D,spread:c})}return e}a(yt,"w");function wt(t,e,u,r){for(let s=0;s{console.log(e.version)},"f");if(n&&o.flags.version===!0)return c(),process.exit(0);const f=new ei,h=D&&i?.render?i.render:C=>f.render(C),l=a(C=>{const g=Zn({...e,...C?{help:C}:{},flags:s});console.log(h(g,f))},"u");if(D&&o.flags.help===!0)return l(),process.exit(0);if(e.parameters){let{parameters:C}=e,g=o._;const y=C.indexOf("--"),B=C.slice(y+1),H=Object.create(null);if(y>-1&&B.length>0){C=C.slice(0,y);const $=o._["--"];g=g.slice(0,-$.length||void 0),wt(H,yt(C),g,l),wt(H,yt(B),$,l)}else wt(H,yt(C),g,l);Object.assign(o._,H)}const p={...o,showVersion:c,showHelp:l};return typeof u=="function"&&u(p),{command:t,...p}}a(zu,"x");function ri(t,e){const u=new Map;for(const r of e){const s=[r.options.name],{alias:n}=r.options;n&&(Array.isArray(n)?s.push(...n):s.push(n));for(const i of s){if(u.has(i))throw new Error(`Duplicate command name found: ${ee(i)}`);u.set(i,r)}}return u.get(t)}a(ri,"z");function Yu(t,e,u=process.argv.slice(2)){if(!t)throw new Error("Options is required");if("name"in t&&(!t.name||!At.test(t.name)))throw new Error(`Invalid script name: ${ee(t.name)}`);const r=u[0];if(t.commands&&At.test(r)){const s=ri(r,t.commands);if(s)return zu(s.options.name,{...s.options,parent:t},s.callback,u.slice(1))}return zu(void 0,t,e,u)}a(Yu,"Z");function si(t,e){if(!t)throw new Error("Command options are required");const{name:u}=t;if(t.name===void 0)throw new Error("Command name is required");if(!At.test(u))throw new Error(`Invalid command name ${JSON.stringify(u)}. Command names must be one word.`);return{options:t,callback:e}}a(si,"G");var ni=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ii(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}a(ii,"getDefaultExportFromCjs");var de={exports:{}},Rt,qu;function Di(){if(qu)return Rt;qu=1,Rt=r,r.sync=s;var t=De;function e(n,i){var D=i.pathExt!==void 0?i.pathExt:process.env.PATHEXT;if(!D||(D=D.split(";"),D.indexOf("")!==-1))return!0;for(var o=0;oObject.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),er=a((t,e)=>{const u=e.colon||ci,r=t.match(/\//)||Ee&&t.match(/\\/)?[""]:[...Ee?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(u)],s=Ee?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",n=Ee?s.split(u):[""];return Ee&&t.indexOf(".")!==-1&&n[0]!==""&&n.unshift(""),{pathEnv:r,pathExt:n,pathExtExe:s}},"getPathInfo"),tr=a((t,e,u)=>{typeof e=="function"&&(u=e,e={}),e||(e={});const{pathEnv:r,pathExt:s,pathExtExe:n}=er(t,e),i=[],D=a(c=>new Promise((f,h)=>{if(c===r.length)return e.all&&i.length?f(i):h(Ju(t));const l=r[c],p=/^".*"$/.test(l)?l.slice(1,-1):l,C=Qu.join(p,t),g=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+C:C;f(o(g,c,0))}),"step"),o=a((c,f,h)=>new Promise((l,p)=>{if(h===s.length)return l(D(f+1));const C=s[h];Zu(c+C,{pathExt:n},(g,y)=>{if(!g&&y)if(e.all)i.push(c+C);else return l(c+C);return l(o(c,f,h+1))})}),"subStep");return u?D(0).then(c=>u(null,c),u):D(0)},"which$1"),fi=a((t,e)=>{e=e||{};const{pathEnv:u,pathExt:r,pathExtExe:s}=er(t,e),n=[];for(let i=0;i{const e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"},"pathKey");St.exports=ur,St.exports.default=ur;var di=St.exports;const rr=z,Ei=hi,pi=di;function sr(t,e){const u=t.options.env||process.env,r=process.cwd(),s=t.options.cwd!=null,n=s&&process.chdir!==void 0&&!process.chdir.disabled;if(n)try{process.chdir(t.options.cwd)}catch{}let i;try{i=Ei.sync(t.command,{path:u[pi({env:u})],pathExt:e?rr.delimiter:void 0})}catch{}finally{n&&process.chdir(r)}return i&&(i=rr.resolve(s?t.options.cwd:"",i)),i}a(sr,"resolveCommandAttempt");function Ci(t){return sr(t)||sr(t,!0)}a(Ci,"resolveCommand$1");var Fi=Ci,Bt={};const $t=/([()\][%!^"`<>&|;, *?])/g;function gi(t){return t=t.replace($t,"^$1"),t}a(gi,"escapeCommand");function mi(t,e){return t=`${t}`,t=t.replace(/(\\*)"/g,'$1$1\\"'),t=t.replace(/(\\*)$/,"$1$1"),t=`"${t}"`,t=t.replace($t,"^$1"),e&&(t=t.replace($t,"^$1")),t}a(mi,"escapeArgument"),Bt.command=gi,Bt.argument=mi;var _i=/^#!(.*)/;const Ai=_i;var yi=a((t="")=>{const e=t.match(Ai);if(!e)return null;const[u,r]=e[0].replace(/#! ?/,"").split(" "),s=u.split("/").pop();return s==="env"?r:r?`${s} ${r}`:s},"shebangCommand$1");const Tt=De,wi=yi;function Ri(t){const u=Buffer.alloc(150);let r;try{r=Tt.openSync(t,"r"),Tt.readSync(r,u,0,150,0),Tt.closeSync(r)}catch{}return wi(u.toString())}a(Ri,"readShebang$1");var bi=Ri;const vi=z,nr=Fi,ir=Bt,Si=bi,Bi=process.platform==="win32",$i=/\.(?:com|exe)$/i,Ti=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function xi(t){t.file=nr(t);const e=t.file&&Si(t.file);return e?(t.args.unshift(t.file),t.command=e,nr(t)):t.file}a(xi,"detectShebang");function Oi(t){if(!Bi)return t;const e=xi(t),u=!$i.test(e);if(t.options.forceShell||u){const r=Ti.test(e);t.command=vi.normalize(t.command),t.command=ir.command(t.command),t.args=t.args.map(n=>ir.argument(n,r));const s=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${s}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}a(Oi,"parseNonShell");function Ni(t,e,u){e&&!Array.isArray(e)&&(u=e,e=null),e=e?e.slice(0):[],u=Object.assign({},u);const r={command:t,args:e,options:u,file:void 0,original:{command:t,args:e}};return u.shell?r:Oi(r)}a(Ni,"parse$5");var Hi=Ni;const xt=process.platform==="win32";function Ot(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}a(Ot,"notFoundError");function Li(t,e){if(!xt)return;const u=t.emit;t.emit=function(r,s){if(r==="exit"){const n=Dr(s,e);if(n)return u.call(t,"error",n)}return u.apply(t,arguments)}}a(Li,"hookChildProcess");function Dr(t,e){return xt&&t===1&&!e.file?Ot(e.original,"spawn"):null}a(Dr,"verifyENOENT");function Ii(t,e){return xt&&t===1&&!e.file?Ot(e.original,"spawnSync"):null}a(Ii,"verifyENOENTSync");var Pi={hookChildProcess:Li,verifyENOENT:Dr,verifyENOENTSync:Ii,notFoundError:Ot};const or=Ns,Nt=Hi,Ht=Pi;function ar(t,e,u){const r=Nt(t,e,u),s=or.spawn(r.command,r.args,r.options);return Ht.hookChildProcess(s,r),s}a(ar,"spawn");function ki(t,e,u){const r=Nt(t,e,u),s=or.spawnSync(r.command,r.args,r.options);return s.error=s.error||Ht.verifyENOENTSync(s.status,r),s}a(ki,"spawnSync"),de.exports=ar,de.exports.spawn=ar,de.exports.sync=ki,de.exports._parse=Nt,de.exports._enoent=Ht;var Mi=de.exports,Gi=ii(Mi);const lr=a((t,e)=>{const u={...process.env},r=["inherit","inherit","inherit"];process.send&&r.push("ipc"),e&&(e.noCache&&(u.TSX_DISABLE_CACHE="1"),e.tsconfigPath&&(u.TSX_TSCONFIG_PATH=e.tsconfigPath));const s=t.filter(n=>n!=="-i"&&n!=="--interactive").length===0;return Gi(process.execPath,["--require",he.require.resolve("./preflight.cjs"),...s?["--require",he.require.resolve("./patch-repl.cjs")]:[],je.isFeatureSupported(je.moduleRegister)?"--import":"--loader",Ru.pathToFileURL(he.require.resolve("./loader.mjs")).toString(),...t],{stdio:r,env:u})},"run");var qe={};const Wi=z,te="\\\\/",cr=`[^${te}]`,ue="\\.",ji="\\+",Ui="\\?",Xe="\\/",Ki="(?=.)",fr="[^/]",Lt=`(?:${Xe}|$)`,hr=`(?:^|${Xe})`,It=`${ue}{1,2}${Lt}`,Vi=`(?!${ue})`,zi=`(?!${hr}${It})`,Yi=`(?!${ue}{0,1}${Lt})`,qi=`(?!${It})`,Xi=`[^.${Xe}]`,Qi=`${fr}*?`,dr={DOT_LITERAL:ue,PLUS_LITERAL:ji,QMARK_LITERAL:Ui,SLASH_LITERAL:Xe,ONE_CHAR:Ki,QMARK:fr,END_ANCHOR:Lt,DOTS_SLASH:It,NO_DOT:Vi,NO_DOTS:zi,NO_DOT_SLASH:Yi,NO_DOTS_SLASH:qi,QMARK_NO_DOT:Xi,STAR:Qi,START_ANCHOR:hr},Zi={...dr,SLASH_LITERAL:`[${te}]`,QMARK:cr,STAR:`${cr}*?`,DOTS_SLASH:`${ue}{1,2}(?:[${te}]|$)`,NO_DOT:`(?!${ue})`,NO_DOTS:`(?!(?:^|[${te}])${ue}{1,2}(?:[${te}]|$))`,NO_DOT_SLASH:`(?!${ue}{0,1}(?:[${te}]|$))`,NO_DOTS_SLASH:`(?!${ue}{1,2}(?:[${te}]|$))`,QMARK_NO_DOT:`[^.${te}]`,START_ANCHOR:`(?:^|[${te}])`,END_ANCHOR:`(?:[${te}]|$)`},Ji={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"};var Qe={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Ji,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,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,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,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,CHAR_NO_BREAK_SPACE:160,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,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Wi.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Zi:dr}};(function(t){const e=z,u=process.platform==="win32",{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_GLOBAL:i}=Qe;t.isObject=D=>D!==null&&typeof D=="object"&&!Array.isArray(D),t.hasRegexChars=D=>n.test(D),t.isRegexChar=D=>D.length===1&&t.hasRegexChars(D),t.escapeRegex=D=>D.replace(i,"\\$1"),t.toPosixSlashes=D=>D.replace(r,"/"),t.removeBackslashes=D=>D.replace(s,o=>o==="\\"?"":o),t.supportsLookbehinds=()=>{const D=process.version.slice(1).split(".").map(Number);return D.length===3&&D[0]>=9||D[0]===8&&D[1]>=10},t.isWindows=D=>D&&typeof D.windows=="boolean"?D.windows:u===!0||e.sep==="\\",t.escapeLast=(D,o,c)=>{const f=D.lastIndexOf(o,c);return f===-1?D:D[f-1]==="\\"?t.escapeLast(D,o,f-1):`${D.slice(0,f)}\\${D.slice(f)}`},t.removePrefix=(D,o={})=>{let c=D;return c.startsWith("./")&&(c=c.slice(2),o.prefix="./"),c},t.wrapOutput=(D,o={},c={})=>{const f=c.contains?"":"^",h=c.contains?"":"$";let l=`${f}(?:${D})${h}`;return o.negated===!0&&(l=`(?:^(?!${l}).*$)`),l}})(qe);const Er=qe,{CHAR_ASTERISK:Pt,CHAR_AT:eD,CHAR_BACKWARD_SLASH:Re,CHAR_COMMA:tD,CHAR_DOT:kt,CHAR_EXCLAMATION_MARK:Mt,CHAR_FORWARD_SLASH:pr,CHAR_LEFT_CURLY_BRACE:Gt,CHAR_LEFT_PARENTHESES:Wt,CHAR_LEFT_SQUARE_BRACKET:uD,CHAR_PLUS:rD,CHAR_QUESTION_MARK:Cr,CHAR_RIGHT_CURLY_BRACE:sD,CHAR_RIGHT_PARENTHESES:Fr,CHAR_RIGHT_SQUARE_BRACKET:nD}=Qe,gr=a(t=>t===pr||t===Re,"isPathSeparator"),mr=a(t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},"depth"),iD=a((t,e)=>{const u=e||{},r=t.length-1,s=u.parts===!0||u.scanToEnd===!0,n=[],i=[],D=[];let o=t,c=-1,f=0,h=0,l=!1,p=!1,C=!1,g=!1,y=!1,B=!1,H=!1,$=!1,Q=!1,G=!1,se=0,W,A,v={value:"",depth:0,isGlob:!1};const M=a(()=>c>=r,"eos"),F=a(()=>o.charCodeAt(c+1),"peek"),O=a(()=>(W=A,o.charCodeAt(++c)),"advance");for(;c0&&(ne=o.slice(0,f),o=o.slice(f),h-=f),T&&C===!0&&h>0?(T=o.slice(0,h),d=o.slice(h)):C===!0?(T="",d=o):T=o,T&&T!==""&&T!=="/"&&T!==o&&gr(T.charCodeAt(T.length-1))&&(T=T.slice(0,-1)),u.unescape===!0&&(d&&(d=Er.removeBackslashes(d)),T&&H===!0&&(T=Er.removeBackslashes(T)));const E={prefix:ne,input:t,start:f,base:T,glob:d,isBrace:l,isBracket:p,isGlob:C,isExtglob:g,isGlobstar:y,negated:$,negatedExtglob:Q};if(u.tokens===!0&&(E.maxDepth=0,gr(A)||i.push(v),E.tokens=i),u.parts===!0||u.tokens===!0){let j;for(let b=0;b{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();const u=`[${t.join("-")}]`;try{new RegExp(u)}catch{return t.map(s=>Y.escapeRegex(s)).join("..")}return u},"expandRange"),pe=a((t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,"syntaxError"),jt=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=_r[t]||t;const u={...e},r=typeof u.maxLength=="number"?Math.min(Je,u.maxLength):Je;let s=t.length;if(s>r)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${r}`);const n={type:"bos",value:"",output:u.prepend||""},i=[n],D=u.capture?"":"?:",o=Y.isWindows(e),c=Ze.globChars(o),f=Ze.extglobChars(c),{DOT_LITERAL:h,PLUS_LITERAL:l,SLASH_LITERAL:p,ONE_CHAR:C,DOTS_SLASH:g,NO_DOT:y,NO_DOT_SLASH:B,NO_DOTS_SLASH:H,QMARK:$,QMARK_NO_DOT:Q,STAR:G,START_ANCHOR:se}=c,W=a(_=>`(${D}(?:(?!${se}${_.dot?g:h}).)*?)`,"globstar"),A=u.dot?"":y,v=u.dot?$:Q;let M=u.bash===!0?W(u):G;u.capture&&(M=`(${M})`),typeof u.noext=="boolean"&&(u.noextglob=u.noext);const F={input:t,index:-1,start:0,dot:u.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};t=Y.removePrefix(t,F),s=t.length;const O=[],T=[],ne=[];let d=n,E;const j=a(()=>F.index===s-1,"eos"),b=F.peek=(_=1)=>t[F.index+_],Z=F.advance=()=>t[++F.index]||"",J=a(()=>t.slice(F.index+1),"remaining"),V=a((_="",x=0)=>{F.consumed+=_,F.index+=x},"consume"),ke=a(_=>{F.output+=_.output!=null?_.output:_.value,V(_.value)},"append"),Ss=a(()=>{let _=1;for(;b()==="!"&&(b(2)!=="("||b(3)==="?");)Z(),F.start++,_++;return _%2===0?!1:(F.negated=!0,F.start++,!0)},"negate"),Me=a(_=>{F[_]++,ne.push(_)},"increment"),ie=a(_=>{F[_]--,ne.pop()},"decrement"),R=a(_=>{if(d.type==="globstar"){const x=F.braces>0&&(_.type==="comma"||_.type==="brace"),m=_.extglob===!0||O.length&&(_.type==="pipe"||_.type==="paren");_.type!=="slash"&&_.type!=="paren"&&!x&&!m&&(F.output=F.output.slice(0,-d.output.length),d.type="star",d.value="*",d.output=M,F.output+=d.output)}if(O.length&&_.type!=="paren"&&(O[O.length-1].inner+=_.value),(_.value||_.output)&&ke(_),d&&d.type==="text"&&_.type==="text"){d.value+=_.value,d.output=(d.output||"")+_.value;return}_.prev=d,i.push(_),d=_},"push"),Ge=a((_,x)=>{const m={...f[x],conditions:1,inner:""};m.prev=d,m.parens=F.parens,m.output=F.output;const w=(u.capture?"(":"")+m.open;Me("parens"),R({type:_,value:x,output:F.output?"":C}),R({type:"paren",extglob:!0,value:Z(),output:w}),O.push(m)},"extglobOpen"),Bs=a(_=>{let x=_.close+(u.capture?")":""),m;if(_.type==="negate"){let w=M;if(_.inner&&_.inner.length>1&&_.inner.includes("/")&&(w=W(u)),(w!==M||j()||/^\)+$/.test(J()))&&(x=_.close=`)$))${w}`),_.inner.includes("*")&&(m=J())&&/^\.[^\\/.]+$/.test(m)){const N=jt(m,{...e,fastpaths:!1}).output;x=_.close=`)${N})${w})`}_.prev.type==="bos"&&(F.negatedExtglob=!0)}R({type:"paren",extglob:!0,value:E,output:x}),ie("parens")},"extglobClose");if(u.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let _=!1,x=t.replace(lD,(m,w,N,U,I,dt)=>U==="\\"?(_=!0,m):U==="?"?w?w+U+(I?$.repeat(I.length):""):dt===0?v+(I?$.repeat(I.length):""):$.repeat(N.length):U==="."?h.repeat(N.length):U==="*"?w?w+U+(I?M:""):M:w?m:`\\${m}`);return _===!0&&(u.unescape===!0?x=x.replace(/\\/g,""):x=x.replace(/\\+/g,m=>m.length%2===0?"\\\\":m?"\\":"")),x===t&&u.contains===!0?(F.output=t,F):(F.output=Y.wrapOutput(x,F,e),F)}for(;!j();){if(E=Z(),E==="\0")continue;if(E==="\\"){const m=b();if(m==="/"&&u.bash!==!0||m==="."||m===";")continue;if(!m){E+="\\",R({type:"text",value:E});continue}const w=/^\\+/.exec(J());let N=0;if(w&&w[0].length>2&&(N=w[0].length,F.index+=N,N%2!==0&&(E+="\\")),u.unescape===!0?E=Z():E+=Z(),F.brackets===0){R({type:"text",value:E});continue}}if(F.brackets>0&&(E!=="]"||d.value==="["||d.value==="[^")){if(u.posix!==!1&&E===":"){const m=d.value.slice(1);if(m.includes("[")&&(d.posix=!0,m.includes(":"))){const w=d.value.lastIndexOf("["),N=d.value.slice(0,w),U=d.value.slice(w+2),I=oD[U];if(I){d.value=N+I,F.backtrack=!0,Z(),!n.output&&i.indexOf(d)===1&&(n.output=C);continue}}}(E==="["&&b()!==":"||E==="-"&&b()==="]")&&(E=`\\${E}`),E==="]"&&(d.value==="["||d.value==="[^")&&(E=`\\${E}`),u.posix===!0&&E==="!"&&d.value==="["&&(E="^"),d.value+=E,ke({value:E});continue}if(F.quotes===1&&E!=='"'){E=Y.escapeRegex(E),d.value+=E,ke({value:E});continue}if(E==='"'){F.quotes=F.quotes===1?0:1,u.keepQuotes===!0&&R({type:"text",value:E});continue}if(E==="("){Me("parens"),R({type:"paren",value:E});continue}if(E===")"){if(F.parens===0&&u.strictBrackets===!0)throw new SyntaxError(pe("opening","("));const m=O[O.length-1];if(m&&F.parens===m.parens+1){Bs(O.pop());continue}R({type:"paren",value:E,output:F.parens?")":"\\)"}),ie("parens");continue}if(E==="["){if(u.nobracket===!0||!J().includes("]")){if(u.nobracket!==!0&&u.strictBrackets===!0)throw new SyntaxError(pe("closing","]"));E=`\\${E}`}else Me("brackets");R({type:"bracket",value:E});continue}if(E==="]"){if(u.nobracket===!0||d&&d.type==="bracket"&&d.value.length===1){R({type:"text",value:E,output:`\\${E}`});continue}if(F.brackets===0){if(u.strictBrackets===!0)throw new SyntaxError(pe("opening","["));R({type:"text",value:E,output:`\\${E}`});continue}ie("brackets");const m=d.value.slice(1);if(d.posix!==!0&&m[0]==="^"&&!m.includes("/")&&(E=`/${E}`),d.value+=E,ke({value:E}),u.literalBrackets===!1||Y.hasRegexChars(m))continue;const w=Y.escapeRegex(d.value);if(F.output=F.output.slice(0,-d.value.length),u.literalBrackets===!0){F.output+=w,d.value=w;continue}d.value=`(${D}${w}|${d.value})`,F.output+=d.value;continue}if(E==="{"&&u.nobrace!==!0){Me("braces");const m={type:"brace",value:E,output:"(",outputIndex:F.output.length,tokensIndex:F.tokens.length};T.push(m),R(m);continue}if(E==="}"){const m=T[T.length-1];if(u.nobrace===!0||!m){R({type:"text",value:E,output:E});continue}let w=")";if(m.dots===!0){const N=i.slice(),U=[];for(let I=N.length-1;I>=0&&(i.pop(),N[I].type!=="brace");I--)N[I].type!=="dots"&&U.unshift(N[I].value);w=cD(U,u),F.backtrack=!0}if(m.comma!==!0&&m.dots!==!0){const N=F.output.slice(0,m.outputIndex),U=F.tokens.slice(m.tokensIndex);m.value=m.output="\\{",E=w="\\}",F.output=N;for(const I of U)F.output+=I.output||I.value}R({type:"brace",value:E,output:w}),ie("braces"),T.pop();continue}if(E==="|"){O.length>0&&O[O.length-1].conditions++,R({type:"text",value:E});continue}if(E===","){let m=E;const w=T[T.length-1];w&&ne[ne.length-1]==="braces"&&(w.comma=!0,m="|"),R({type:"comma",value:E,output:m});continue}if(E==="/"){if(d.type==="dot"&&F.index===F.start+1){F.start=F.index+1,F.consumed="",F.output="",i.pop(),d=n;continue}R({type:"slash",value:E,output:p});continue}if(E==="."){if(F.braces>0&&d.type==="dot"){d.value==="."&&(d.output=h);const m=T[T.length-1];d.type="dots",d.output+=E,d.value+=E,m.dots=!0;continue}if(F.braces+F.parens===0&&d.type!=="bos"&&d.type!=="slash"){R({type:"text",value:E,output:h});continue}R({type:"dot",value:E,output:h});continue}if(E==="?"){if(!(d&&d.value==="(")&&u.noextglob!==!0&&b()==="("&&b(2)!=="?"){Ge("qmark",E);continue}if(d&&d.type==="paren"){const w=b();let N=E;if(w==="<"&&!Y.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(d.value==="("&&!/[!=<:]/.test(w)||w==="<"&&!/<([!=]|\w+>)/.test(J()))&&(N=`\\${E}`),R({type:"text",value:E,output:N});continue}if(u.dot!==!0&&(d.type==="slash"||d.type==="bos")){R({type:"qmark",value:E,output:Q});continue}R({type:"qmark",value:E,output:$});continue}if(E==="!"){if(u.noextglob!==!0&&b()==="("&&(b(2)!=="?"||!/[!=<:]/.test(b(3)))){Ge("negate",E);continue}if(u.nonegate!==!0&&F.index===0){Ss();continue}}if(E==="+"){if(u.noextglob!==!0&&b()==="("&&b(2)!=="?"){Ge("plus",E);continue}if(d&&d.value==="("||u.regex===!1){R({type:"plus",value:E,output:l});continue}if(d&&(d.type==="bracket"||d.type==="paren"||d.type==="brace")||F.parens>0){R({type:"plus",value:E});continue}R({type:"plus",value:l});continue}if(E==="@"){if(u.noextglob!==!0&&b()==="("&&b(2)!=="?"){R({type:"at",extglob:!0,value:E,output:""});continue}R({type:"text",value:E});continue}if(E!=="*"){(E==="$"||E==="^")&&(E=`\\${E}`);const m=aD.exec(J());m&&(E+=m[0],F.index+=m[0].length),R({type:"text",value:E});continue}if(d&&(d.type==="globstar"||d.star===!0)){d.type="star",d.star=!0,d.value+=E,d.output=M,F.backtrack=!0,F.globstar=!0,V(E);continue}let _=J();if(u.noextglob!==!0&&/^\([^?]/.test(_)){Ge("star",E);continue}if(d.type==="star"){if(u.noglobstar===!0){V(E);continue}const m=d.prev,w=m.prev,N=m.type==="slash"||m.type==="bos",U=w&&(w.type==="star"||w.type==="globstar");if(u.bash===!0&&(!N||_[0]&&_[0]!=="/")){R({type:"star",value:E,output:""});continue}const I=F.braces>0&&(m.type==="comma"||m.type==="brace"),dt=O.length&&(m.type==="pipe"||m.type==="paren");if(!N&&m.type!=="paren"&&!I&&!dt){R({type:"star",value:E,output:""});continue}for(;_.slice(0,3)==="/**";){const We=t[F.index+4];if(We&&We!=="/")break;_=_.slice(3),V("/**",3)}if(m.type==="bos"&&j()){d.type="globstar",d.value+=E,d.output=W(u),F.output=d.output,F.globstar=!0,V(E);continue}if(m.type==="slash"&&m.prev.type!=="bos"&&!U&&j()){F.output=F.output.slice(0,-(m.output+d.output).length),m.output=`(?:${m.output}`,d.type="globstar",d.output=W(u)+(u.strictSlashes?")":"|$)"),d.value+=E,F.globstar=!0,F.output+=m.output+d.output,V(E);continue}if(m.type==="slash"&&m.prev.type!=="bos"&&_[0]==="/"){const We=_[1]!==void 0?"|$":"";F.output=F.output.slice(0,-(m.output+d.output).length),m.output=`(?:${m.output}`,d.type="globstar",d.output=`${W(u)}${p}|${p}${We})`,d.value+=E,F.output+=m.output+d.output,F.globstar=!0,V(E+Z()),R({type:"slash",value:"/",output:""});continue}if(m.type==="bos"&&_[0]==="/"){d.type="globstar",d.value+=E,d.output=`(?:^|${p}|${W(u)}${p})`,F.output=d.output,F.globstar=!0,V(E+Z()),R({type:"slash",value:"/",output:""});continue}F.output=F.output.slice(0,-d.output.length),d.type="globstar",d.output=W(u),d.value+=E,F.output+=d.output,F.globstar=!0,V(E);continue}const x={type:"star",value:E,output:M};if(u.bash===!0){x.output=".*?",(d.type==="bos"||d.type==="slash")&&(x.output=A+x.output),R(x);continue}if(d&&(d.type==="bracket"||d.type==="paren")&&u.regex===!0){x.output=E,R(x);continue}(F.index===F.start||d.type==="slash"||d.type==="dot")&&(d.type==="dot"?(F.output+=B,d.output+=B):u.dot===!0?(F.output+=H,d.output+=H):(F.output+=A,d.output+=A),b()!=="*"&&(F.output+=C,d.output+=C)),R(x)}for(;F.brackets>0;){if(u.strictBrackets===!0)throw new SyntaxError(pe("closing","]"));F.output=Y.escapeLast(F.output,"["),ie("brackets")}for(;F.parens>0;){if(u.strictBrackets===!0)throw new SyntaxError(pe("closing",")"));F.output=Y.escapeLast(F.output,"("),ie("parens")}for(;F.braces>0;){if(u.strictBrackets===!0)throw new SyntaxError(pe("closing","}"));F.output=Y.escapeLast(F.output,"{"),ie("braces")}if(u.strictSlashes!==!0&&(d.type==="star"||d.type==="bracket")&&R({type:"maybe_slash",value:"",output:`${p}?`}),F.backtrack===!0){F.output="";for(const _ of F.tokens)F.output+=_.output!=null?_.output:_.value,_.suffix&&(F.output+=_.suffix)}return F},"parse$3");jt.fastpaths=(t,e)=>{const u={...e},r=typeof u.maxLength=="number"?Math.min(Je,u.maxLength):Je,s=t.length;if(s>r)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${r}`);t=_r[t]||t;const n=Y.isWindows(e),{DOT_LITERAL:i,SLASH_LITERAL:D,ONE_CHAR:o,DOTS_SLASH:c,NO_DOT:f,NO_DOTS:h,NO_DOTS_SLASH:l,STAR:p,START_ANCHOR:C}=Ze.globChars(n),g=u.dot?h:f,y=u.dot?l:f,B=u.capture?"":"?:",H={negated:!1,prefix:""};let $=u.bash===!0?".*?":p;u.capture&&($=`(${$})`);const Q=a(A=>A.noglobstar===!0?$:`(${B}(?:(?!${C}${A.dot?c:i}).)*?)`,"globstar"),G=a(A=>{switch(A){case"*":return`${g}${o}${$}`;case".*":return`${i}${o}${$}`;case"*.*":return`${g}${$}${i}${o}${$}`;case"*/*":return`${g}${$}${D}${o}${y}${$}`;case"**":return g+Q(u);case"**/*":return`(?:${g}${Q(u)}${D})?${y}${o}${$}`;case"**/*.*":return`(?:${g}${Q(u)}${D})?${y}${$}${i}${o}${$}`;case"**/.*":return`(?:${g}${Q(u)}${D})?${i}${o}${$}`;default:{const v=/^(.*?)\.(\w+)$/.exec(A);if(!v)return;const M=G(v[1]);return M?M+i+v[2]:void 0}}},"create"),se=Y.removePrefix(t,H);let W=G(se);return W&&u.strictSlashes!==!0&&(W+=`${D}?`),W};var fD=jt;const hD=z,dD=DD,Ut=fD,Kt=qe,ED=Qe,pD=a(t=>t&&typeof t=="object"&&!Array.isArray(t),"isObject$1"),L=a((t,e,u=!1)=>{if(Array.isArray(t)){const f=t.map(l=>L(l,e,u));return a(l=>{for(const p of f){const C=p(l);if(C)return C}return!1},"arrayMatcher")}const r=pD(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");const s=e||{},n=Kt.isWindows(e),i=r?L.compileRe(t,e):L.makeRe(t,e,!1,!0),D=i.state;delete i.state;let o=a(()=>!1,"isIgnored");if(s.ignore){const f={...e,ignore:null,onMatch:null,onResult:null};o=L(s.ignore,f,u)}const c=a((f,h=!1)=>{const{isMatch:l,match:p,output:C}=L.test(f,i,e,{glob:t,posix:n}),g={glob:t,state:D,regex:i,posix:n,input:f,output:C,match:p,isMatch:l};return typeof s.onResult=="function"&&s.onResult(g),l===!1?(g.isMatch=!1,h?g:!1):o(f)?(typeof s.onIgnore=="function"&&s.onIgnore(g),g.isMatch=!1,h?g:!1):(typeof s.onMatch=="function"&&s.onMatch(g),h?g:!0)},"matcher");return u&&(c.state=D),c},"picomatch$3");L.test=(t,e,u,{glob:r,posix:s}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};const n=u||{},i=n.format||(s?Kt.toPosixSlashes:null);let D=t===r,o=D&&i?i(t):t;return D===!1&&(o=i?i(t):t,D=o===r),(D===!1||n.capture===!0)&&(n.matchBase===!0||n.basename===!0?D=L.matchBase(t,e,u,s):D=e.exec(o)),{isMatch:!!D,match:D,output:o}},L.matchBase=(t,e,u,r=Kt.isWindows(u))=>(e instanceof RegExp?e:L.makeRe(e,u)).test(hD.basename(t)),L.isMatch=(t,e,u)=>L(e,u)(t),L.parse=(t,e)=>Array.isArray(t)?t.map(u=>L.parse(u,e)):Ut(t,{...e,fastpaths:!1}),L.scan=(t,e)=>dD(t,e),L.compileRe=(t,e,u=!1,r=!1)=>{if(u===!0)return t.output;const s=e||{},n=s.contains?"":"^",i=s.contains?"":"$";let D=`${n}(?:${t.output})${i}`;t&&t.negated===!0&&(D=`^(?!${D}).*$`);const o=L.toRegex(D,e);return r===!0&&(o.state=t),o},L.makeRe=(t,e={},u=!1,r=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(s.output=Ut.fastpaths(t,e)),s.output||(s=Ut(t,e)),L.compileRe(s,e,u,r)},L.toRegex=(t,e)=>{try{const u=e||{};return new RegExp(t,u.flags||(u.nocase?"i":""))}catch(u){if(e&&e.debug===!0)throw u;return/$^/}},L.constants=ED;var CD=L,Ar=CD;const be=De,{Readable:FD}=Is,ve=z,{promisify:et}=Ae,Vt=Ar,gD=et(be.readdir),mD=et(be.stat),yr=et(be.lstat),_D=et(be.realpath),AD="!",wr="READDIRP_RECURSIVE_ERROR",yD=new Set(["ENOENT","EPERM","EACCES","ELOOP",wr]),zt="files",Rr="directories",tt="files_directories",ut="all",br=[zt,Rr,tt,ut],wD=a(t=>yD.has(t.code),"isNormalFlowError"),[vr,RD]=process.versions.node.split(".").slice(0,2).map(t=>Number.parseInt(t,10)),bD=process.platform==="win32"&&(vr>10||vr===10&&RD>=5),Sr=a(t=>{if(t!==void 0){if(typeof t=="function")return t;if(typeof t=="string"){const e=Vt(t.trim());return u=>e(u.basename)}if(Array.isArray(t)){const e=[],u=[];for(const r of t){const s=r.trim();s.charAt(0)===AD?u.push(Vt(s.slice(1))):e.push(Vt(s))}return u.length>0?e.length>0?r=>e.some(s=>s(r.basename))&&!u.some(s=>s(r.basename)):r=>!u.some(s=>s(r.basename)):r=>e.some(s=>s(r.basename))}}},"normalizeFilter");class ht extends FD{static{a(this,"ReaddirpStream")}static get defaultOptions(){return{root:".",fileFilter:a(e=>!0,"fileFilter"),directoryFilter:a(e=>!0,"directoryFilter"),type:zt,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});const u={...ht.defaultOptions,...e},{root:r,type:s}=u;this._fileFilter=Sr(u.fileFilter),this._directoryFilter=Sr(u.directoryFilter);const n=u.lstat?yr:mD;bD?this._stat=i=>n(i,{bigint:!0}):this._stat=n,this._maxDepth=u.depth,this._wantsDir=[Rr,tt,ut].includes(s),this._wantsFile=[zt,tt,ut].includes(s),this._wantsEverything=s===ut,this._root=ve.resolve(r),this._isDirent="Dirent"in be&&!u.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(r,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){const{path:u,depth:r,files:s=[]}=this.parent||{};if(s.length>0){const n=s.splice(0,e).map(i=>this._formatEntry(i,u));for(const i of await Promise.all(n)){if(this.destroyed)return;const D=await this._getEntryType(i);D==="directory"&&this._directoryFilter(i)?(r<=this._maxDepth&&this.parents.push(this._exploreDir(i.fullPath,r+1)),this._wantsDir&&(this.push(i),e--)):(D==="file"||this._includeAsFile(i))&&this._fileFilter(i)&&this._wantsFile&&(this.push(i),e--)}}else{const n=this.parents.pop();if(!n){this.push(null);break}if(this.parent=await n,this.destroyed)return}}}catch(u){this.destroy(u)}finally{this.reading=!1}}}async _exploreDir(e,u){let r;try{r=await gD(e,this._rdOptions)}catch(s){this._onError(s)}return{files:r,depth:u,path:e}}async _formatEntry(e,u){let r;try{const s=this._isDirent?e.name:e,n=ve.resolve(ve.join(u,s));r={path:ve.relative(this._root,n),fullPath:n,basename:s},r[this._statsProp]=this._isDirent?e:await this._stat(n)}catch(s){this._onError(s)}return r}_onError(e){wD(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){const u=e&&e[this._statsProp];if(u){if(u.isFile())return"file";if(u.isDirectory())return"directory";if(u&&u.isSymbolicLink()){const r=e.fullPath;try{const s=await _D(r),n=await yr(s);if(n.isFile())return"file";if(n.isDirectory()){const i=s.length;if(r.startsWith(s)&&r.substr(i,1)===ve.sep){const D=new Error(`Circular symlink detected: "${r}" points to "${s}"`);return D.code=wr,this._onError(D)}return"directory"}}catch(s){this._onError(s)}}}}_includeAsFile(e){const u=e&&e[this._statsProp];return u&&this._wantsEverything&&!u.isDirectory()}}const Ce=a((t,e={})=>{let u=e.entryType||e.type;if(u==="both"&&(u=tt),u&&(e.type=u),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(u&&!br.includes(u))throw new Error(`readdirp: Invalid type passed. Use one of ${br.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new ht(e)},"readdirp$1"),vD=a((t,e={})=>new Promise((u,r)=>{const s=[];Ce(t,e).on("data",n=>s.push(n)).on("end",()=>u(s)).on("error",n=>r(n))}),"readdirpPromise");Ce.promise=vD,Ce.ReaddirpStream=ht,Ce.default=Ce;var SD=Ce,Yt={exports:{}};/*! + * normalize-path + * + * Copyright (c) 2014-2018, Jon Schlinkert. + * Released under the MIT License. + */var Br=a(function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return"/";var u=t.length;if(u<=1)return t;var r="";if(u>4&&t[3]==="\\"){var s=t[2];(s==="?"||s===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),r="//")}var n=t.split(/[/\\]+/);return e!==!1&&n[n.length-1]===""&&n.pop(),r+n.join("/")},"normalizePath$2"),BD=Yt.exports;Object.defineProperty(BD,"__esModule",{value:!0});const $r=Ar,$D=Br,Tr="!",TD={returnIndex:!1},xD=a(t=>Array.isArray(t)?t:[t],"arrify$1"),OD=a((t,e)=>{if(typeof t=="function")return t;if(typeof t=="string"){const u=$r(t,e);return r=>t===r||u(r)}return t instanceof RegExp?u=>t.test(u):u=>!1},"createPattern"),xr=a((t,e,u,r)=>{const s=Array.isArray(u),n=s?u[0]:u;if(!s&&typeof n!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(n));const i=$D(n,!1);for(let o=0;o{if(t==null)throw new TypeError("anymatch: specify first argument");const r=typeof u=="boolean"?{returnIndex:u}:u,s=r.returnIndex||!1,n=xD(t),i=n.filter(o=>typeof o=="string"&&o.charAt(0)===Tr).map(o=>o.slice(1)).map(o=>$r(o,r)),D=n.filter(o=>typeof o!="string"||typeof o=="string"&&o.charAt(0)!==Tr).map(o=>OD(o,r));return e==null?(o,c=!1)=>xr(D,i,o,typeof c=="boolean"?c:!1):xr(D,i,e,s)},"anymatch$1");qt.default=qt,Yt.exports=qt;var ND=Yt.exports;/*! + * is-extglob + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + */var HD=a(function(e){if(typeof e!="string"||e==="")return!1;for(var u;u=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(u[2])return!0;e=e.slice(u.index+u[0].length)}return!1},"isExtglob");/*! + * is-glob + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */var LD=HD,Or={"{":"}","(":")","[":"]"},ID=a(function(t){if(t[0]==="!")return!0;for(var e=0,u=-2,r=-2,s=-2,n=-2,i=-2;ee&&(i===-1||i>r||(i=t.indexOf("\\",e),i===-1||i>r)))||s!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(s=t.indexOf("}",e),s>e&&(i=t.indexOf("\\",e),i===-1||i>s))||n!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(n=t.indexOf(")",e),n>e&&(i=t.indexOf("\\",e),i===-1||i>n))||u!==-1&&t[e]==="("&&t[e+1]!=="|"&&(uu&&(i=t.indexOf("\\",u),i===-1||i>n))))return!0;if(t[e]==="\\"){var D=t[e+1];e+=2;var o=Or[D];if(o){var c=t.indexOf(o,e);c!==-1&&(e=c+1)}if(t[e]==="!")return!0}else e++}return!1},"strictCheck"),PD=a(function(t){if(t[0]==="!")return!0;for(var e=0;etypeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1,t.find=(e,u)=>e.nodes.find(r=>r.type===u),t.exceedsLimit=(e,u,r=1,s)=>s===!1||!t.isInteger(e)||!t.isInteger(u)?!1:(Number(u)-Number(e))/Number(r)>=s,t.escapeNode=(e,u=0,r)=>{let s=e.nodes[u];s&&(r&&s.type===r||s.type==="open"||s.type==="close")&&s.escaped!==!0&&(s.value="\\"+s.value,s.escaped=!0)},t.encloseBrace=e=>e.type!=="brace"||e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0),t.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1,t.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0,t.reduce=e=>e.reduce((u,r)=>(r.type==="text"&&u.push(r.value),r.type==="range"&&(r.type="text"),u),[]),t.flatten=(...e)=>{const u=[],r=a(s=>{for(let n=0;n{let u=a((r,s={})=>{let n=e.escapeInvalid&&Hr.isInvalidBrace(s),i=r.invalid===!0&&e.escapeInvalid===!0,D="";if(r.value)return(n||i)&&Hr.isOpenOrClose(r)?"\\"+r.value:r.value;if(r.value)return r.value;if(r.nodes)for(let o of r.nodes)D+=u(o);return D},"stringify");return u(t)},"stringify$4");/*! + * is-number + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Released under the MIT License. + */var zD=a(function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1},"isNumber$2");/*! + * to-regex-range + * + * Copyright (c) 2015-present, Jon Schlinkert. + * Released under the MIT License. + */const Lr=zD,ae=a((t,e,u)=>{if(Lr(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(Lr(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...u};typeof r.strictZeros=="boolean"&&(r.relaxZeros=r.strictZeros===!1);let s=String(r.relaxZeros),n=String(r.shorthand),i=String(r.capture),D=String(r.wrap),o=t+":"+e+"="+s+n+i+D;if(ae.cache.hasOwnProperty(o))return ae.cache[o].result;let c=Math.min(t,e),f=Math.max(t,e);if(Math.abs(c-f)===1){let g=t+"|"+e;return r.capture?`(${g})`:r.wrap===!1?g:`(?:${g})`}let h=Wr(t)||Wr(e),l={min:t,max:e,a:c,b:f},p=[],C=[];if(h&&(l.isPadded=h,l.maxLen=String(l.max).length),c<0){let g=f<0?Math.abs(f):1;C=Ir(g,Math.abs(c),l,r),c=l.a=0}return f>=0&&(p=Ir(c,f,l,r)),l.negatives=C,l.positives=p,l.result=YD(C,p),r.capture===!0?l.result=`(${l.result})`:r.wrap!==!1&&p.length+C.length>1&&(l.result=`(?:${l.result})`),ae.cache[o]=l,l.result},"toRegexRange$1");function YD(t,e,u){let r=Zt(t,e,"-",!1)||[],s=Zt(e,t,"",!1)||[],n=Zt(t,e,"-?",!0)||[];return r.concat(n).concat(s).join("|")}a(YD,"collatePatterns");function qD(t,e){let u=1,r=1,s=kr(t,u),n=new Set([e]);for(;t<=s&&s<=e;)n.add(s),u+=1,s=kr(t,u);for(s=Mr(e+1,r)-1;t1&&D.count.pop(),D.count.push(f.count[0]),D.string=D.pattern+Gr(D.count),i=c+1;continue}u.isPadded&&(h=eo(c,u,r)),f.string=h+f.pattern+Gr(f.count),n.push(f),i=c+1,D=f}return n}a(Ir,"splitToPatterns");function Zt(t,e,u,r,s){let n=[];for(let i of t){let{string:D}=i;!r&&!Pr(e,"string",D)&&n.push(u+D),r&&Pr(e,"string",D)&&n.push(u+D)}return n}a(Zt,"filterPatterns");function QD(t,e){let u=[];for(let r=0;re?1:e>t?-1:0}a(ZD,"compare");function Pr(t,e,u){return t.some(r=>r[e]===u)}a(Pr,"contains");function kr(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}a(kr,"countNines");function Mr(t,e){return t-t%Math.pow(10,e)}a(Mr,"countZeros");function Gr(t){let[e=0,u=""]=t;return u||e>1?`{${e+(u?","+u:"")}}`:""}a(Gr,"toQuantifier");function JD(t,e,u){return`[${t}${e-t===1?"":"-"}${e}]`}a(JD,"toCharacterClass");function Wr(t){return/^-?(0+)\d/.test(t)}a(Wr,"hasPadding");function eo(t,e,u){if(!e.isPadded)return t;let r=Math.abs(e.maxLen-String(t).length),s=u.relaxZeros!==!1;switch(r){case 0:return"";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${r}}`:`0{${r}}`}}a(eo,"padZeros"),ae.cache={},ae.clearCache=()=>ae.cache={};var to=ae;/*! + * fill-range + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Licensed under the MIT License. + */const uo=Ae,jr=to,Ur=a(t=>t!==null&&typeof t=="object"&&!Array.isArray(t),"isObject"),ro=a(t=>e=>t===!0?Number(e):String(e),"transform"),Jt=a(t=>typeof t=="number"||typeof t=="string"&&t!=="","isValidValue"),Se=a(t=>Number.isInteger(+t),"isNumber"),eu=a(t=>{let e=`${t}`,u=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++u]==="0";);return u>0},"zeros"),so=a((t,e,u)=>typeof t=="string"||typeof e=="string"?!0:u.stringify===!0,"stringify$3"),no=a((t,e,u)=>{if(e>0){let r=t[0]==="-"?"-":"";r&&(t=t.slice(1)),t=r+t.padStart(r?e-1:e,"0")}return u===!1?String(t):t},"pad"),Kr=a((t,e)=>{let u=t[0]==="-"?"-":"";for(u&&(t=t.slice(1),e--);t.length{t.negatives.sort((i,D)=>iD?1:0),t.positives.sort((i,D)=>iD?1:0);let u=e.capture?"":"?:",r="",s="",n;return t.positives.length&&(r=t.positives.join("|")),t.negatives.length&&(s=`-(${u}${t.negatives.join("|")})`),r&&s?n=`${r}|${s}`:n=r||s,e.wrap?`(${u}${n})`:n},"toSequence"),Vr=a((t,e,u,r)=>{if(u)return jr(t,e,{wrap:!1,...r});let s=String.fromCharCode(t);if(t===e)return s;let n=String.fromCharCode(e);return`[${s}-${n}]`},"toRange"),zr=a((t,e,u)=>{if(Array.isArray(t)){let r=u.wrap===!0,s=u.capture?"":"?:";return r?`(${s}${t.join("|")})`:t.join("|")}return jr(t,e,u)},"toRegex"),Yr=a((...t)=>new RangeError("Invalid range arguments: "+uo.inspect(...t)),"rangeError"),qr=a((t,e,u)=>{if(u.strictRanges===!0)throw Yr([t,e]);return[]},"invalidRange"),Do=a((t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},"invalidStep"),oo=a((t,e,u=1,r={})=>{let s=Number(t),n=Number(e);if(!Number.isInteger(s)||!Number.isInteger(n)){if(r.strictRanges===!0)throw Yr([t,e]);return[]}s===0&&(s=0),n===0&&(n=0);let i=s>n,D=String(t),o=String(e),c=String(u);u=Math.max(Math.abs(u),1);let f=eu(D)||eu(o)||eu(c),h=f?Math.max(D.length,o.length,c.length):0,l=f===!1&&so(t,e,r)===!1,p=r.transform||ro(l);if(r.toRegex&&u===1)return Vr(Kr(t,h),Kr(e,h),!0,r);let C={negatives:[],positives:[]},g=a(H=>C[H<0?"negatives":"positives"].push(Math.abs(H)),"push"),y=[],B=0;for(;i?s>=n:s<=n;)r.toRegex===!0&&u>1?g(s):y.push(no(p(s,B),h,l)),s=i?s-u:s+u,B++;return r.toRegex===!0?u>1?io(C,r):zr(y,null,{wrap:!1,...r}):y},"fillNumbers"),ao=a((t,e,u=1,r={})=>{if(!Se(t)&&t.length>1||!Se(e)&&e.length>1)return qr(t,e,r);let s=r.transform||(l=>String.fromCharCode(l)),n=`${t}`.charCodeAt(0),i=`${e}`.charCodeAt(0),D=n>i,o=Math.min(n,i),c=Math.max(n,i);if(r.toRegex&&u===1)return Vr(o,c,!1,r);let f=[],h=0;for(;D?n>=i:n<=i;)f.push(s(n,h)),n=D?n-u:n+u,h++;return r.toRegex===!0?zr(f,null,{wrap:!1,options:r}):f},"fillLetters"),st=a((t,e,u,r={})=>{if(e==null&&Jt(t))return[t];if(!Jt(t)||!Jt(e))return qr(t,e,r);if(typeof u=="function")return st(t,e,1,{transform:u});if(Ur(u))return st(t,e,0,u);let s={...r};return s.capture===!0&&(s.wrap=!0),u=u||s.step||1,Se(u)?Se(t)&&Se(e)?oo(t,e,u,s):ao(t,e,Math.max(Math.abs(u),1),s):u!=null&&!Ur(u)?Do(u,s):st(t,e,1,u)},"fill$2");var Xr=st;const lo=Xr,Qr=rt,co=a((t,e={})=>{let u=a((r,s={})=>{let n=Qr.isInvalidBrace(s),i=r.invalid===!0&&e.escapeInvalid===!0,D=n===!0||i===!0,o=e.escapeInvalid===!0?"\\":"",c="";if(r.isOpen===!0||r.isClose===!0)return o+r.value;if(r.type==="open")return D?o+r.value:"(";if(r.type==="close")return D?o+r.value:")";if(r.type==="comma")return r.prev.type==="comma"?"":D?r.value:"|";if(r.value)return r.value;if(r.nodes&&r.ranges>0){let f=Qr.reduce(r.nodes),h=lo(...f,{...e,wrap:!1,toRegex:!0});if(h.length!==0)return f.length>1&&h.length>1?`(${h})`:h}if(r.nodes)for(let f of r.nodes)c+=u(f,r);return c},"walk");return u(t)},"compile$1");var fo=co;const ho=Xr,Zr=Qt,Fe=rt,le=a((t="",e="",u=!1)=>{let r=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return u?Fe.flatten(e).map(s=>`{${s}}`):e;for(let s of t)if(Array.isArray(s))for(let n of s)r.push(le(n,e,u));else for(let n of e)u===!0&&typeof n=="string"&&(n=`{${n}}`),r.push(Array.isArray(n)?le(s,n,u):s+n);return Fe.flatten(r)},"append"),Eo=a((t,e={})=>{let u=e.rangeLimit===void 0?1e3:e.rangeLimit,r=a((s,n={})=>{s.queue=[];let i=n,D=n.queue;for(;i.type!=="brace"&&i.type!=="root"&&i.parent;)i=i.parent,D=i.queue;if(s.invalid||s.dollar){D.push(le(D.pop(),Zr(s,e)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){D.push(le(D.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let h=Fe.reduce(s.nodes);if(Fe.exceedsLimit(...h,e.step,u))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let l=ho(...h,e);l.length===0&&(l=Zr(s,e)),D.push(le(D.pop(),l)),s.nodes=[];return}let o=Fe.encloseBrace(s),c=s.queue,f=s;for(;f.type!=="brace"&&f.type!=="root"&&f.parent;)f=f.parent,c=f.queue;for(let h=0;h",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};const Fo=Qt,{MAX_LENGTH:Jr,CHAR_BACKSLASH:tu,CHAR_BACKTICK:go,CHAR_COMMA:mo,CHAR_DOT:_o,CHAR_LEFT_PARENTHESES:Ao,CHAR_RIGHT_PARENTHESES:yo,CHAR_LEFT_CURLY_BRACE:wo,CHAR_RIGHT_CURLY_BRACE:Ro,CHAR_LEFT_SQUARE_BRACKET:es,CHAR_RIGHT_SQUARE_BRACKET:ts,CHAR_DOUBLE_QUOTE:bo,CHAR_SINGLE_QUOTE:vo,CHAR_NO_BREAK_SPACE:So,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Bo}=Co,$o=a((t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let u=e||{},r=typeof u.maxLength=="number"?Math.min(Jr,u.maxLength):Jr;if(t.length>r)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${r})`);let s={type:"root",input:t,nodes:[]},n=[s],i=s,D=s,o=0,c=t.length,f=0,h=0,l;const p=a(()=>t[f++],"advance"),C=a(g=>{if(g.type==="text"&&D.type==="dot"&&(D.type="text"),D&&D.type==="text"&&g.type==="text"){D.value+=g.value;return}return i.nodes.push(g),g.parent=i,g.prev=D,D=g,g},"push");for(C({type:"bos"});f0){if(i.ranges>0){i.ranges=0;let g=i.nodes.shift();i.nodes=[g,{type:"text",value:Fo(i)}]}C({type:"comma",value:l}),i.commas++;continue}if(l===_o&&h>0&&i.commas===0){let g=i.nodes;if(h===0||g.length===0){C({type:"text",value:l});continue}if(D.type==="dot"){if(i.range=[],D.value+=l,D.type="range",i.nodes.length!==3&&i.nodes.length!==5){i.invalid=!0,i.ranges=0,D.type="text";continue}i.ranges++,i.args=[];continue}if(D.type==="range"){g.pop();let y=g[g.length-1];y.value+=D.value+l,D=y,i.ranges--;continue}C({type:"dot",value:l});continue}C({type:"text",value:l})}do if(i=n.pop(),i.type!=="root"){i.nodes.forEach(B=>{B.nodes||(B.type==="open"&&(B.isOpen=!0),B.type==="close"&&(B.isClose=!0),B.nodes||(B.type="text"),B.invalid=!0)});let g=n[n.length-1],y=g.nodes.indexOf(i);g.nodes.splice(y,1,...i.nodes)}while(n.length>0);return C({type:"eos"}),s},"parse$1");var To=$o;const us=Qt,xo=fo,Oo=po,No=To,q=a((t,e={})=>{let u=[];if(Array.isArray(t))for(let r of t){let s=q.create(r,e);Array.isArray(s)?u.push(...s):u.push(s)}else u=[].concat(q.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(u=[...new Set(u)]),u},"braces$1");q.parse=(t,e={})=>No(t,e),q.stringify=(t,e={})=>us(typeof t=="string"?q.parse(t,e):t,e),q.compile=(t,e={})=>(typeof t=="string"&&(t=q.parse(t,e)),xo(t,e)),q.expand=(t,e={})=>{typeof t=="string"&&(t=q.parse(t,e));let u=Oo(t,e);return e.noempty===!0&&(u=u.filter(Boolean)),e.nodupes===!0&&(u=[...new Set(u)]),u},q.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?q.compile(t,e):q.expand(t,e);var Ho=q,Lo=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"],Io=Lo;const Po=z,ko=Io,Mo=new Set(ko);var Go=a(t=>Mo.has(Po.extname(t).slice(1).toLowerCase()),"isBinaryPath$1"),nt={};(function(t){const{sep:e}=z,{platform:u}=process,r=bu;t.EV_ALL="all",t.EV_READY="ready",t.EV_ADD="add",t.EV_CHANGE="change",t.EV_ADD_DIR="addDir",t.EV_UNLINK="unlink",t.EV_UNLINK_DIR="unlinkDir",t.EV_RAW="raw",t.EV_ERROR="error",t.STR_DATA="data",t.STR_END="end",t.STR_CLOSE="close",t.FSEVENT_CREATED="created",t.FSEVENT_MODIFIED="modified",t.FSEVENT_DELETED="deleted",t.FSEVENT_MOVED="moved",t.FSEVENT_CLONED="cloned",t.FSEVENT_UNKNOWN="unknown",t.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1,t.FSEVENT_TYPE_FILE="file",t.FSEVENT_TYPE_DIRECTORY="directory",t.FSEVENT_TYPE_SYMLINK="symlink",t.KEY_LISTENERS="listeners",t.KEY_ERR="errHandlers",t.KEY_RAW="rawEmitters",t.HANDLER_KEYS=[t.KEY_LISTENERS,t.KEY_ERR,t.KEY_RAW],t.DOT_SLASH=`.${e}`,t.BACK_SLASH_RE=/\\/g,t.DOUBLE_SLASH_RE=/\/\//,t.SLASH_OR_BACK_SLASH_RE=/[/\\]/,t.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,t.REPLACER_RE=/^\.[/\\]/,t.SLASH="/",t.SLASH_SLASH="//",t.BRACE_START="{",t.BANG="!",t.ONE_DOT=".",t.TWO_DOTS="..",t.STAR="*",t.GLOBSTAR="**",t.ROOT_GLOBSTAR="/**/*",t.SLASH_GLOBSTAR="/**",t.DIR_SUFFIX="Dir",t.ANYMATCH_OPTS={dot:!0},t.STRING_TYPE="string",t.FUNCTION_TYPE="function",t.EMPTY_STR="",t.EMPTY_FN=()=>{},t.IDENTITY_FN=s=>s,t.isWindows=u==="win32",t.isMacos=u==="darwin",t.isLinux=u==="linux",t.isIBMi=r.type()==="OS400"})(nt);const re=De,P=z,{promisify:Be}=Ae,Wo=Go,{isWindows:jo,isLinux:Uo,EMPTY_FN:Ko,EMPTY_STR:Vo,KEY_LISTENERS:ge,KEY_ERR:uu,KEY_RAW:$e,HANDLER_KEYS:zo,EV_CHANGE:it,EV_ADD:Dt,EV_ADD_DIR:Yo,EV_ERROR:rs,STR_DATA:qo,STR_END:Xo,BRACE_START:Qo,STAR:Zo}=nt,Jo="watch",ea=Be(re.open),ss=Be(re.stat),ta=Be(re.lstat),ua=Be(re.close),ru=Be(re.realpath),ra={lstat:ta,stat:ss},su=a((t,e)=>{t instanceof Set?t.forEach(e):e(t)},"foreach"),Te=a((t,e,u)=>{let r=t[e];r instanceof Set||(t[e]=r=new Set([r])),r.add(u)},"addAndConvert"),sa=a(t=>e=>{const u=t[e];u instanceof Set?u.clear():delete t[e]},"clearItem"),xe=a((t,e,u)=>{const r=t[e];r instanceof Set?r.delete(u):r===u&&delete t[e]},"delFromSet"),ns=a(t=>t instanceof Set?t.size===0:!t,"isEmptySet"),ot=new Map;function is(t,e,u,r,s){const n=a((i,D)=>{u(t),s(i,D,{watchedPath:t}),D&&t!==D&&at(P.resolve(t,D),ge,P.join(t,D))},"handleEvent");try{return re.watch(t,e,n)}catch(i){r(i)}}a(is,"createFsWatchInstance");const at=a((t,e,u,r,s)=>{const n=ot.get(t);n&&su(n[e],i=>{i(u,r,s)})},"fsWatchBroadcast"),na=a((t,e,u,r)=>{const{listener:s,errHandler:n,rawEmitter:i}=r;let D=ot.get(e),o;if(!u.persistent)return o=is(t,u,s,n,i),o.close.bind(o);if(D)Te(D,ge,s),Te(D,uu,n),Te(D,$e,i);else{if(o=is(t,u,at.bind(null,e,ge),n,at.bind(null,e,$e)),!o)return;o.on(rs,async c=>{const f=at.bind(null,e,uu);if(D.watcherUnusable=!0,jo&&c.code==="EPERM")try{const h=await ea(t,"r");await ua(h),f(c)}catch{}else f(c)}),D={listeners:s,errHandlers:n,rawEmitters:i,watcher:o},ot.set(e,D)}return()=>{xe(D,ge,s),xe(D,uu,n),xe(D,$e,i),ns(D.listeners)&&(D.watcher.close(),ot.delete(e),zo.forEach(sa(D)),D.watcher=void 0,Object.freeze(D))}},"setFsWatchListener"),nu=new Map,ia=a((t,e,u,r)=>{const{listener:s,rawEmitter:n}=r;let i=nu.get(e);const D=i&&i.options;return D&&(D.persistentu.interval)&&(i.listeners,i.rawEmitters,re.unwatchFile(e),i=void 0),i?(Te(i,ge,s),Te(i,$e,n)):(i={listeners:s,rawEmitters:n,options:u,watcher:re.watchFile(e,u,(o,c)=>{su(i.rawEmitters,h=>{h(it,e,{curr:o,prev:c})});const f=o.mtimeMs;(o.size!==c.size||f>c.mtimeMs||f===0)&&su(i.listeners,h=>h(t,o))})},nu.set(e,i)),()=>{xe(i,ge,s),xe(i,$e,n),ns(i.listeners)&&(nu.delete(e),re.unwatchFile(e),i.options=i.watcher=void 0,Object.freeze(i))}},"setFsWatchFileListener");let Da=class{static{a(this,"NodeFsHandler")}constructor(e){this.fsw=e,this._boundHandleError=u=>e._handleError(u)}_watchWithNodeFs(e,u){const r=this.fsw.options,s=P.dirname(e),n=P.basename(e);this.fsw._getWatchedDir(s).add(n);const D=P.resolve(e),o={persistent:r.persistent};u||(u=Ko);let c;return r.usePolling?(o.interval=r.enableBinaryInterval&&Wo(n)?r.binaryInterval:r.interval,c=ia(e,D,o,{listener:u,rawEmitter:this.fsw._emitRaw})):c=na(e,D,o,{listener:u,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),c}_handleFile(e,u,r){if(this.fsw.closed)return;const s=P.dirname(e),n=P.basename(e),i=this.fsw._getWatchedDir(s);let D=u;if(i.has(n))return;const o=a(async(f,h)=>{if(this.fsw._throttle(Jo,e,5)){if(!h||h.mtimeMs===0)try{const l=await ss(e);if(this.fsw.closed)return;const p=l.atimeMs,C=l.mtimeMs;(!p||p<=C||C!==D.mtimeMs)&&this.fsw._emit(it,e,l),Uo&&D.ino!==l.ino?(this.fsw._closeFile(f),D=l,this.fsw._addPathCloser(f,this._watchWithNodeFs(e,o))):D=l}catch{this.fsw._remove(s,n)}else if(i.has(n)){const l=h.atimeMs,p=h.mtimeMs;(!l||l<=p||p!==D.mtimeMs)&&this.fsw._emit(it,e,h),D=h}}},"listener"),c=this._watchWithNodeFs(e,o);if(!(r&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(Dt,e,0))return;this.fsw._emit(Dt,e,u)}return c}async _handleSymlink(e,u,r,s){if(this.fsw.closed)return;const n=e.fullPath,i=this.fsw._getWatchedDir(u);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let D;try{D=await ru(r)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(i.has(s)?this.fsw._symlinkPaths.get(n)!==D&&(this.fsw._symlinkPaths.set(n,D),this.fsw._emit(it,r,e.stats)):(i.add(s),this.fsw._symlinkPaths.set(n,D),this.fsw._emit(Dt,r,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(n))return!0;this.fsw._symlinkPaths.set(n,!0)}_handleRead(e,u,r,s,n,i,D){if(e=P.join(e,Vo),!r.hasGlob&&(D=this.fsw._throttle("readdir",e,1e3),!D))return;const o=this.fsw._getWatchedDir(r.path),c=new Set;let f=this.fsw._readdirp(e,{fileFilter:a(h=>r.filterPath(h),"fileFilter"),directoryFilter:a(h=>r.filterDir(h),"directoryFilter"),depth:0}).on(qo,async h=>{if(this.fsw.closed){f=void 0;return}const l=h.path;let p=P.join(e,l);if(c.add(l),!(h.stats.isSymbolicLink()&&await this._handleSymlink(h,e,p,l))){if(this.fsw.closed){f=void 0;return}(l===s||!s&&!o.has(l))&&(this.fsw._incrReadyCount(),p=P.join(n,P.relative(n,p)),this._addToNodeFs(p,u,r,i+1))}}).on(rs,this._boundHandleError);return new Promise(h=>f.once(Xo,()=>{if(this.fsw.closed){f=void 0;return}const l=D?D.clear():!1;h(),o.getChildren().filter(p=>p!==e&&!c.has(p)&&(!r.hasGlob||r.filterPath({fullPath:P.resolve(e,p)}))).forEach(p=>{this.fsw._remove(e,p)}),f=void 0,l&&this._handleRead(e,!1,r,s,n,i,D)}))}async _handleDir(e,u,r,s,n,i,D){const o=this.fsw._getWatchedDir(P.dirname(e)),c=o.has(P.basename(e));!(r&&this.fsw.options.ignoreInitial)&&!n&&!c&&(!i.hasGlob||i.globFilter(e))&&this.fsw._emit(Yo,e,u),o.add(P.basename(e)),this.fsw._getWatchedDir(e);let f,h;const l=this.fsw.options.depth;if((l==null||s<=l)&&!this.fsw._symlinkPaths.has(D)){if(!n&&(await this._handleRead(e,r,i,n,e,s,f),this.fsw.closed))return;h=this._watchWithNodeFs(e,(p,C)=>{C&&C.mtimeMs===0||this._handleRead(p,!1,i,n,e,s,f)})}return h}async _addToNodeFs(e,u,r,s,n){const i=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return i(),!1;const D=this.fsw._getWatchHelpers(e,s);!D.hasGlob&&r&&(D.hasGlob=r.hasGlob,D.globFilter=r.globFilter,D.filterPath=o=>r.filterPath(o),D.filterDir=o=>r.filterDir(o));try{const o=await ra[D.statMethod](D.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(D.watchPath,o))return i(),!1;const c=this.fsw.options.followSymlinks&&!e.includes(Zo)&&!e.includes(Qo);let f;if(o.isDirectory()){const h=P.resolve(e),l=c?await ru(e):e;if(this.fsw.closed||(f=await this._handleDir(D.watchPath,o,u,s,n,D,l),this.fsw.closed))return;h!==l&&l!==void 0&&this.fsw._symlinkPaths.set(h,l)}else if(o.isSymbolicLink()){const h=c?await ru(e):e;if(this.fsw.closed)return;const l=P.dirname(D.watchPath);if(this.fsw._getWatchedDir(l).add(D.watchPath),this.fsw._emit(Dt,D.watchPath,o),f=await this._handleDir(l,o,u,s,e,D,h),this.fsw.closed)return;h!==void 0&&this.fsw._symlinkPaths.set(P.resolve(e),h)}else f=this._handleFile(D.watchPath,o,u);return i(),this.fsw._addPathCloser(e,f),!1}catch(o){if(this.fsw._handleError(o))return i(),e}}};var oa=Da,iu={exports:{}};const Du=De,k=z,{promisify:ou}=Ae;let me;try{me=he.require("fsevents")}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t)}if(me){const t=process.version.match(/v(\d+)\.(\d+)/);if(t&&t[1]&&t[2]){const e=Number.parseInt(t[1],10),u=Number.parseInt(t[2],10);e===8&&u<16&&(me=void 0)}}const{EV_ADD:au,EV_CHANGE:aa,EV_ADD_DIR:Ds,EV_UNLINK:lt,EV_ERROR:la,STR_DATA:ca,STR_END:fa,FSEVENT_CREATED:ha,FSEVENT_MODIFIED:da,FSEVENT_DELETED:Ea,FSEVENT_MOVED:pa,FSEVENT_UNKNOWN:Ca,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:Fa,FSEVENT_TYPE_FILE:ga,FSEVENT_TYPE_DIRECTORY:Oe,FSEVENT_TYPE_SYMLINK:os,ROOT_GLOBSTAR:as,DIR_SUFFIX:ma,DOT_SLASH:ls,FUNCTION_TYPE:lu,EMPTY_FN:_a,IDENTITY_FN:Aa}=nt,ya=a(t=>isNaN(t)?{}:{depth:t},"Depth"),cu=ou(Du.stat),wa=ou(Du.lstat),cs=ou(Du.realpath),Ra={stat:cu,lstat:wa},ce=new Map,ba=10,va=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),Sa=a((t,e)=>({stop:me.watch(t,e)}),"createFSEventsInstance");function Ba(t,e,u,r){let s=k.extname(e)?k.dirname(e):e;const n=k.dirname(s);let i=ce.get(s);$a(n)&&(s=n);const D=k.resolve(t),o=D!==e,c=a((h,l,p)=>{o&&(h=h.replace(e,D)),(h===D||!h.indexOf(D+k.sep))&&u(h,l,p)},"filteredListener");let f=!1;for(const h of ce.keys())if(e.indexOf(k.resolve(h)+k.sep)===0){s=h,i=ce.get(s),f=!0;break}return i||f?i.listeners.add(c):(i={listeners:new Set([c]),rawEmitter:r,watcher:Sa(s,(h,l)=>{if(!i.listeners.size||l&Fa)return;const p=me.getInfo(h,l);i.listeners.forEach(C=>{C(h,l,p)}),i.rawEmitter(p.event,h,p)})},ce.set(s,i)),()=>{const h=i.listeners;if(h.delete(c),!h.size&&(ce.delete(s),i.watcher))return i.watcher.stop().then(()=>{i.rawEmitter=i.watcher=void 0,Object.freeze(i)})}}a(Ba,"setFSEventsListener");const $a=a(t=>{let e=0;for(const u of ce.keys())if(u.indexOf(t)===0&&(e++,e>=ba))return!0;return!1},"couldConsolidate"),Ta=a(()=>me&&ce.size<128,"canUse"),fu=a((t,e)=>{let u=0;for(;!t.indexOf(e)&&(t=k.dirname(t))!==e;)u++;return u},"calcDepth"),fs=a((t,e)=>t.type===Oe&&e.isDirectory()||t.type===os&&e.isSymbolicLink()||t.type===ga&&e.isFile(),"sameTypes");let xa=class{static{a(this,"FsEventsHandler")}constructor(e){this.fsw=e}checkIgnored(e,u){const r=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,u))return r.add(e),u&&u.isDirectory()&&r.add(e+as),!0;r.delete(e),r.delete(e+as)}addOrChange(e,u,r,s,n,i,D,o){const c=n.has(i)?aa:au;this.handleEvent(c,e,u,r,s,n,i,D,o)}async checkExists(e,u,r,s,n,i,D,o){try{const c=await cu(e);if(this.fsw.closed)return;fs(D,c)?this.addOrChange(e,u,r,s,n,i,D,o):this.handleEvent(lt,e,u,r,s,n,i,D,o)}catch(c){c.code==="EACCES"?this.addOrChange(e,u,r,s,n,i,D,o):this.handleEvent(lt,e,u,r,s,n,i,D,o)}}handleEvent(e,u,r,s,n,i,D,o,c){if(!(this.fsw.closed||this.checkIgnored(u)))if(e===lt){const f=o.type===Oe;(f||i.has(D))&&this.fsw._remove(n,D,f)}else{if(e===au){if(o.type===Oe&&this.fsw._getWatchedDir(u),o.type===os&&c.followSymlinks){const h=c.depth===void 0?void 0:fu(r,s)+1;return this._addToFsEvents(u,!1,!0,h)}this.fsw._getWatchedDir(n).add(D)}const f=o.type===Oe?e+ma:e;this.fsw._emit(f,u),f===Ds&&this._addToFsEvents(u,!1,!0)}}_watchWithFsEvents(e,u,r,s){if(this.fsw.closed||this.fsw._isIgnored(e))return;const n=this.fsw.options,D=Ba(e,u,a(async(o,c,f)=>{if(this.fsw.closed||n.depth!==void 0&&fu(o,u)>n.depth)return;const h=r(k.join(e,k.relative(e,o)));if(s&&!s(h))return;const l=k.dirname(h),p=k.basename(h),C=this.fsw._getWatchedDir(f.type===Oe?h:l);if(va.has(c)||f.event===Ca)if(typeof n.ignored===lu){let g;try{g=await cu(h)}catch{}if(this.fsw.closed||this.checkIgnored(h,g))return;fs(f,g)?this.addOrChange(h,o,u,l,C,p,f,n):this.handleEvent(lt,h,o,u,l,C,p,f,n)}else this.checkExists(h,o,u,l,C,p,f,n);else switch(f.event){case ha:case da:return this.addOrChange(h,o,u,l,C,p,f,n);case Ea:case pa:return this.checkExists(h,o,u,l,C,p,f,n)}},"watchCallback"),this.fsw._emitRaw);return this.fsw._emitReady(),D}async _handleFsEventsSymlink(e,u,r,s){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(u))){this.fsw._symlinkPaths.set(u,!0),this.fsw._incrReadyCount();try{const n=await cs(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(n))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(n||e,i=>{let D=e;return n&&n!==ls?D=i.replace(n,e):i!==ls&&(D=k.join(e,i)),r(D)},!1,s)}catch(n){if(this.fsw._handleError(n))return this.fsw._emitReady()}}}emitAdd(e,u,r,s,n){const i=r(e),D=u.isDirectory(),o=this.fsw._getWatchedDir(k.dirname(i)),c=k.basename(i);D&&this.fsw._getWatchedDir(i),!o.has(c)&&(o.add(c),(!s.ignoreInitial||n===!0)&&this.fsw._emit(D?Ds:au,i,u))}initWatch(e,u,r,s){if(this.fsw.closed)return;const n=this._watchWithFsEvents(r.watchPath,k.resolve(e||r.watchPath),s,r.globFilter);this.fsw._addPathCloser(u,n)}async _addToFsEvents(e,u,r,s){if(this.fsw.closed)return;const n=this.fsw.options,i=typeof u===lu?u:Aa,D=this.fsw._getWatchHelpers(e);try{const o=await Ra[D.statMethod](D.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(D.watchPath,o))throw null;if(o.isDirectory()){if(D.globFilter||this.emitAdd(i(e),o,i,n,r),s&&s>n.depth)return;this.fsw._readdirp(D.watchPath,{fileFilter:a(c=>D.filterPath(c),"fileFilter"),directoryFilter:a(c=>D.filterDir(c),"directoryFilter"),...ya(n.depth-(s||0))}).on(ca,c=>{if(this.fsw.closed||c.stats.isDirectory()&&!D.filterPath(c))return;const f=k.join(D.watchPath,c.path),{fullPath:h}=c;if(D.followSymlinks&&c.stats.isSymbolicLink()){const l=n.depth===void 0?void 0:fu(f,k.resolve(D.watchPath))+1;this._handleFsEventsSymlink(f,h,i,l)}else this.emitAdd(f,c.stats,i,n,r)}).on(la,_a).on(fa,()=>{this.fsw._emitReady()})}else this.emitAdd(D.watchPath,o,i,n,r),this.fsw._emitReady()}catch(o){(!o||this.fsw._handleError(o))&&(this.fsw._emitReady(),this.fsw._emitReady())}if(n.persistent&&r!==!0)if(typeof u===lu)this.initWatch(void 0,e,D,i);else{let o;try{o=await cs(D.watchPath)}catch{}this.initWatch(o,e,D,i)}}};iu.exports=xa,iu.exports.canUse=Ta;var Oa=iu.exports;const{EventEmitter:Na}=Ls,hu=De,S=z,{promisify:hs}=Ae,Ha=SD,du=ND.default,La=VD,Eu=Nr,Ia=Ho,Pa=Br,ka=oa,ds=Oa,{EV_ALL:pu,EV_READY:Ma,EV_ADD:ct,EV_CHANGE:Ne,EV_UNLINK:Es,EV_ADD_DIR:Ga,EV_UNLINK_DIR:Wa,EV_RAW:ja,EV_ERROR:Cu,STR_CLOSE:Ua,STR_END:Ka,BACK_SLASH_RE:Va,DOUBLE_SLASH_RE:ps,SLASH_OR_BACK_SLASH_RE:za,DOT_RE:Ya,REPLACER_RE:qa,SLASH:Fu,SLASH_SLASH:Xa,BRACE_START:Qa,BANG:gu,ONE_DOT:Cs,TWO_DOTS:Za,GLOBSTAR:Ja,SLASH_GLOBSTAR:mu,ANYMATCH_OPTS:_u,STRING_TYPE:Au,FUNCTION_TYPE:el,EMPTY_STR:yu,EMPTY_FN:tl,isWindows:ul,isMacos:rl,isIBMi:sl}=nt,nl=hs(hu.stat),il=hs(hu.readdir),wu=a((t=[])=>Array.isArray(t)?t:[t],"arrify"),Fs=a((t,e=[])=>(t.forEach(u=>{Array.isArray(u)?Fs(u,e):e.push(u)}),e),"flatten"),gs=a(t=>{const e=Fs(wu(t));if(!e.every(u=>typeof u===Au))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(_s)},"unifyPaths"),ms=a(t=>{let e=t.replace(Va,Fu),u=!1;for(e.startsWith(Xa)&&(u=!0);e.match(ps);)e=e.replace(ps,Fu);return u&&(e=Fu+e),e},"toUnix"),_s=a(t=>ms(S.normalize(ms(t))),"normalizePathToUnix"),As=a((t=yu)=>e=>typeof e!==Au?e:_s(S.isAbsolute(e)?e:S.join(t,e)),"normalizeIgnored"),Dl=a((t,e)=>S.isAbsolute(t)?t:t.startsWith(gu)?gu+S.join(e,t.slice(1)):S.join(e,t),"getAbsolutePath"),X=a((t,e)=>t[e]===void 0,"undef");class ol{static{a(this,"DirEntry")}constructor(e,u){this.path=e,this._removeWatcher=u,this.items=new Set}add(e){const{items:u}=this;u&&e!==Cs&&e!==Za&&u.add(e)}async remove(e){const{items:u}=this;if(!u||(u.delete(e),u.size>0))return;const r=this.path;try{await il(r)}catch{this._removeWatcher&&this._removeWatcher(S.dirname(r),S.basename(r))}}has(e){const{items:u}=this;if(u)return u.has(e)}getChildren(){const{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}}const al="stat",ll="lstat";class cl{static{a(this,"WatchHelper")}constructor(e,u,r,s){this.fsw=s,this.path=e=e.replace(qa,yu),this.watchPath=u,this.fullWatchPath=S.resolve(u),this.hasGlob=u!==e,e===yu&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&r?void 0:!1,this.globFilter=this.hasGlob?du(e,void 0,_u):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(n=>{n.length>1&&n.pop()}),this.followSymlinks=r,this.statMethod=r?al:ll}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return S.join(this.watchPath,S.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){const{stats:u}=e;if(u&&u.isSymbolicLink())return this.filterDir(e);const r=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===el?this.globFilter(r):!0)&&this.fsw._isntIgnored(r,u)&&this.fsw._hasReadPermissions(u)}getDirParts(e){if(!this.hasGlob)return[];const u=[];return(e.includes(Qa)?Ia.expand(e):[e]).forEach(s=>{u.push(S.relative(this.watchPath,s).split(za))}),u}filterDir(e){if(this.hasGlob){const u=this.getDirParts(this.checkGlobSymlink(e));let r=!1;this.unmatchedGlob=!this.dirParts.some(s=>s.every((n,i)=>(n===Ja&&(r=!0),r||!u[0][i]||du(n,u[0][i],_u))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}}class fl extends Na{static{a(this,"FSWatcher")}constructor(e){super();const u={};e&&Object.assign(u,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,X(u,"persistent")&&(u.persistent=!0),X(u,"ignoreInitial")&&(u.ignoreInitial=!1),X(u,"ignorePermissionErrors")&&(u.ignorePermissionErrors=!1),X(u,"interval")&&(u.interval=100),X(u,"binaryInterval")&&(u.binaryInterval=300),X(u,"disableGlobbing")&&(u.disableGlobbing=!1),u.enableBinaryInterval=u.binaryInterval!==u.interval,X(u,"useFsEvents")&&(u.useFsEvents=!u.usePolling),ds.canUse()||(u.useFsEvents=!1),X(u,"usePolling")&&!u.useFsEvents&&(u.usePolling=rl),sl&&(u.usePolling=!0);const s=process.env.CHOKIDAR_USEPOLLING;if(s!==void 0){const o=s.toLowerCase();o==="false"||o==="0"?u.usePolling=!1:o==="true"||o==="1"?u.usePolling=!0:u.usePolling=!!o}const n=process.env.CHOKIDAR_INTERVAL;n&&(u.interval=Number.parseInt(n,10)),X(u,"atomic")&&(u.atomic=!u.usePolling&&!u.useFsEvents),u.atomic&&(this._pendingUnlinks=new Map),X(u,"followSymlinks")&&(u.followSymlinks=!0),X(u,"awaitWriteFinish")&&(u.awaitWriteFinish=!1),u.awaitWriteFinish===!0&&(u.awaitWriteFinish={});const i=u.awaitWriteFinish;i&&(i.stabilityThreshold||(i.stabilityThreshold=2e3),i.pollInterval||(i.pollInterval=100),this._pendingWrites=new Map),u.ignored&&(u.ignored=wu(u.ignored));let D=0;this._emitReady=()=>{D++,D>=this._readyCount&&(this._emitReady=tl,this._readyEmitted=!0,process.nextTick(()=>this.emit(Ma)))},this._emitRaw=(...o)=>this.emit(ja,...o),this._readyEmitted=!1,this.options=u,u.useFsEvents?this._fsEventsHandler=new ds(this):this._nodeFsHandler=new ka(this),Object.freeze(u)}add(e,u,r){const{cwd:s,disableGlobbing:n}=this.options;this.closed=!1;let i=gs(e);return s&&(i=i.map(D=>{const o=Dl(D,s);return n||!Eu(D)?o:Pa(o)})),i=i.filter(D=>D.startsWith(gu)?(this._ignoredPaths.add(D.slice(1)),!1):(this._ignoredPaths.delete(D),this._ignoredPaths.delete(D+mu),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=i.length),this.options.persistent&&(this._readyCount+=i.length),i.forEach(D=>this._fsEventsHandler._addToFsEvents(D))):(this._readyCount||(this._readyCount=0),this._readyCount+=i.length,Promise.all(i.map(async D=>{const o=await this._nodeFsHandler._addToNodeFs(D,!r,0,0,u);return o&&this._emitReady(),o})).then(D=>{this.closed||D.filter(o=>o).forEach(o=>{this.add(S.dirname(o),S.basename(u||o))})})),this}unwatch(e){if(this.closed)return this;const u=gs(e),{cwd:r}=this.options;return u.forEach(s=>{!S.isAbsolute(s)&&!this._closers.has(s)&&(r&&(s=S.join(r,s)),s=S.resolve(s)),this._closePath(s),this._ignoredPaths.add(s),this._watched.has(s)&&this._ignoredPaths.add(s+mu),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();const e=[];return this._closers.forEach(u=>u.forEach(r=>{const s=r();s instanceof Promise&&e.push(s)})),this._streams.forEach(u=>u.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(u=>u.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(u=>{this[`_${u}`].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){const e={};return this._watched.forEach((u,r)=>{const s=this.options.cwd?S.relative(this.options.cwd,r):r;e[s||Cs]=u.getChildren().sort()}),e}emitWithAll(e,u){this.emit(...u),e!==Cu&&this.emit(pu,...u)}async _emit(e,u,r,s,n){if(this.closed)return;const i=this.options;ul&&(u=S.normalize(u)),i.cwd&&(u=S.relative(i.cwd,u));const D=[e,u];n!==void 0?D.push(r,s,n):s!==void 0?D.push(r,s):r!==void 0&&D.push(r);const o=i.awaitWriteFinish;let c;if(o&&(c=this._pendingWrites.get(u)))return c.lastChange=new Date,this;if(i.atomic){if(e===Es)return this._pendingUnlinks.set(u,D),setTimeout(()=>{this._pendingUnlinks.forEach((f,h)=>{this.emit(...f),this.emit(pu,...f),this._pendingUnlinks.delete(h)})},typeof i.atomic=="number"?i.atomic:100),this;e===ct&&this._pendingUnlinks.has(u)&&(e=D[0]=Ne,this._pendingUnlinks.delete(u))}if(o&&(e===ct||e===Ne)&&this._readyEmitted){const f=a((h,l)=>{h?(e=D[0]=Cu,D[1]=h,this.emitWithAll(e,D)):l&&(D.length>2?D[2]=l:D.push(l),this.emitWithAll(e,D))},"awfEmit");return this._awaitWriteFinish(u,o.stabilityThreshold,e,f),this}if(e===Ne&&!this._throttle(Ne,u,50))return this;if(i.alwaysStat&&r===void 0&&(e===ct||e===Ga||e===Ne)){const f=i.cwd?S.join(i.cwd,u):u;let h;try{h=await nl(f)}catch{}if(!h||this.closed)return;D.push(h)}return this.emitWithAll(e,D),this}_handleError(e){const u=e&&e.code;return e&&u!=="ENOENT"&&u!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||u!=="EPERM"&&u!=="EACCES")&&this.emit(Cu,e),e||this.closed}_throttle(e,u,r){this._throttled.has(e)||this._throttled.set(e,new Map);const s=this._throttled.get(e),n=s.get(u);if(n)return n.count++,!1;let i;const D=a(()=>{const c=s.get(u),f=c?c.count:0;return s.delete(u),clearTimeout(i),c&&clearTimeout(c.timeoutObject),f},"clear");i=setTimeout(D,r);const o={timeoutObject:i,clear:D,count:0};return s.set(u,o),o}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,u,r,s){let n,i=e;this.options.cwd&&!S.isAbsolute(e)&&(i=S.join(this.options.cwd,e));const D=new Date,o=a(c=>{hu.stat(i,(f,h)=>{if(f||!this._pendingWrites.has(e)){f&&f.code!=="ENOENT"&&s(f);return}const l=Number(new Date);c&&h.size!==c.size&&(this._pendingWrites.get(e).lastChange=l);const p=this._pendingWrites.get(e);l-p.lastChange>=u?(this._pendingWrites.delete(e),s(void 0,h)):n=setTimeout(o,this.options.awaitWriteFinish.pollInterval,h)})},"awaitWriteFinish");this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:D,cancelWait:a(()=>(this._pendingWrites.delete(e),clearTimeout(n),r),"cancelWait")}),n=setTimeout(o,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,u){if(this.options.atomic&&Ya.test(e))return!0;if(!this._userIgnored){const{cwd:r}=this.options,s=this.options.ignored,n=s&&s.map(As(r)),i=wu(n).filter(o=>typeof o===Au&&!Eu(o)).map(o=>o+mu),D=this._getGlobIgnored().map(As(r)).concat(n,i);this._userIgnored=du(D,void 0,_u)}return this._userIgnored([e,u])}_isntIgnored(e,u){return!this._isIgnored(e,u)}_getWatchHelpers(e,u){const r=u||this.options.disableGlobbing||!Eu(e)?e:La(e),s=this.options.followSymlinks;return new cl(e,r,s,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));const u=S.resolve(e);return this._watched.has(u)||this._watched.set(u,new ol(u,this._boundRemove)),this._watched.get(u)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;const r=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(r.toString(8)[0],10))}_remove(e,u,r){const s=S.join(e,u),n=S.resolve(s);if(r=r??(this._watched.has(s)||this._watched.has(n)),!this._throttle("remove",s,100))return;!r&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,u,!0),this._getWatchedDir(s).getChildren().forEach(l=>this._remove(s,l));const o=this._getWatchedDir(e),c=o.has(u);o.remove(u),this._symlinkPaths.has(n)&&this._symlinkPaths.delete(n);let f=s;if(this.options.cwd&&(f=S.relative(this.options.cwd,s)),this.options.awaitWriteFinish&&this._pendingWrites.has(f)&&this._pendingWrites.get(f).cancelWait()===ct)return;this._watched.delete(s),this._watched.delete(n);const h=r?Wa:Es;c&&!this._isIgnored(s)&&this._emit(h,s),this.options.useFsEvents||this._closePath(s)}_closePath(e){this._closeFile(e);const u=S.dirname(e);this._getWatchedDir(u).remove(S.basename(e))}_closeFile(e){const u=this._closers.get(e);u&&(u.forEach(r=>r()),this._closers.delete(e))}_addPathCloser(e,u){if(!u)return;let r=this._closers.get(e);r||(r=[],this._closers.set(e,r)),r.push(u)}_readdirp(e,u){if(this.closed)return;const r={type:pu,alwaysStat:!0,lstat:!0,...u};let s=Ha(e,r);return this._streams.add(s),s.once(Ua,()=>{s=void 0}),s.once(Ka,()=>{s&&(this._streams.delete(s),s=void 0)}),s}}const hl=a((t,e)=>{const u=new fl(e);return u.add(t),u},"watch");var dl=hl;let fe=!0;const _e=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let He=0;if(_e.process&&_e.process.env&&_e.process.stdout){const{FORCE_COLOR:t,NODE_DISABLE_COLORS:e,NO_COLOR:u,TERM:r,COLORTERM:s}=_e.process.env;e||u||t==="0"?fe=!1:t==="1"||t==="2"||t==="3"?fe=!0:r==="dumb"?fe=!1:"CI"in _e.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(n=>n in _e.process.env)?fe=!0:fe=process.stdout.isTTY,fe&&(process.platform==="win32"||s&&(s==="truecolor"||s==="24bit")?He=3:r&&(r.endsWith("-256color")||r.endsWith("256"))?He=2:He=1)}let ys={enabled:fe,supportLevel:He};function Le(t,e,u=1){const r=`\x1B[${t}m`,s=`\x1B[${e}m`,n=new RegExp(`\\x1b\\[${e}m`,"g");return i=>ys.enabled&&ys.supportLevel>=u?r+(""+i).replace(n,r)+s:""+i}a(Le,"kolorist");const Ie=Le(33,39),El=Le(90,39),pl=Le(92,39),Cl=Le(95,39),Fl=Le(96,39),ft=a((t=!0)=>{let e=!1;return u=>{if(e||u==="unknown-flag")return!0;if(u==="argument")return e=!0,t}},"ignoreAfterArgument"),ws=a((t,e=process.argv.slice(2))=>(Su(t,e,{ignore:ft()}),e),"removeArgvFlags"),gl=a(t=>{let e=Buffer.alloc(0);return u=>{for(e=Buffer.concat([e,u]);e.length>4;){const r=e.readInt32BE(0);if(e.length>=4+r){const s=e.slice(4,4+r);t(s),e=e.slice(4+r)}else break}}},"bufferData"),Rs=a(async()=>{const t=Ps.createServer(u=>{u.on("data",gl(r=>{const s=JSON.parse(r.toString());t.emit("data",s)}))}),e=he.getPipePath(process.pid);return await pt.promises.mkdir(ks.tmpdir,{recursive:!0}),await pt.promises.rm(e,{force:!0}),await new Promise((u,r)=>{t.listen(e,u),t.on("error",r)}),t.unref(),process.on("exit",()=>{if(t.close(),!he.isWindows)try{pt.rmSync(e)}catch{}}),t},"createIpcServer"),ml=a(()=>new Date().toLocaleTimeString(),"currentTime"),Pe=a((...t)=>console.log(El(ml()),Fl("[tsx]"),...t),"log"),_l="\x1Bc",Al=a((t,e)=>{let u;return function(){u&&clearTimeout(u),u=setTimeout(()=>Reflect.apply(t,this,arguments),e)}},"debounce"),bs={noCache:{type:Boolean,description:"Disable caching",default:!1},tsconfig:{type:String,description:"Custom tsconfig.json path"},clearScreen:{type:Boolean,description:"Clearing the screen on rerun",default:!0},ignore:{type:[String],description:"Paths & globs to exclude from being watched (Deprecated: use --exclude)"},include:{type:[String],description:"Additional paths & globs to watch"},exclude:{type:[String],description:"Paths & globs to exclude from being watched"}},yl=si({name:"watch",parameters:["