提交学习笔记专用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

6874 lines
228 KiB

  1. import { createRequire } from "node:module";
  2. import fs from "node:fs";
  3. import path, { dirname, resolve } from "node:path";
  4. import { fileURLToPath } from "node:url";
  5. import { createViteServerRpc } from "@vue/devtools-core";
  6. import { getViteRpcServer, setViteServerContext } from "@vue/devtools-kit";
  7. import sirv from "sirv";
  8. import { normalizePath } from "vite";
  9. import Inspect from "vite-plugin-inspect";
  10. import VueInspector from "vite-plugin-vue-inspector";
  11. import fsp from "node:fs/promises";
  12. //#region rolldown:runtime
  13. var __create = Object.create;
  14. var __defProp = Object.defineProperty;
  15. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  16. var __getOwnPropNames = Object.getOwnPropertyNames;
  17. var __getProtoOf = Object.getPrototypeOf;
  18. var __hasOwnProp = Object.prototype.hasOwnProperty;
  19. var __commonJS = (cb, mod) => function() {
  20. return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  21. };
  22. var __copyProps = (to, from, except, desc) => {
  23. if (from && typeof from === "object" || typeof from === "function") for (var keys$1 = __getOwnPropNames(from), i = 0, n = keys$1.length, key; i < n; i++) {
  24. key = keys$1[i];
  25. if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
  26. get: ((k) => from[k]).bind(null, key),
  27. enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
  28. });
  29. }
  30. return to;
  31. };
  32. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
  33. value: mod,
  34. enumerable: true
  35. }) : target, mod));
  36. var __require = /* @__PURE__ */ createRequire(import.meta.url);
  37. //#endregion
  38. //#region ../../node_modules/.pnpm/kolorist@1.8.0/node_modules/kolorist/dist/esm/index.mjs
  39. let enabled = true;
  40. const globalVar = typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {};
  41. /**
  42. * Detect how much colors the current terminal supports
  43. */
  44. let supportLevel = 0;
  45. if (globalVar.process && globalVar.process.env && globalVar.process.stdout) {
  46. const { FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, COLORTERM } = globalVar.process.env;
  47. if (NODE_DISABLE_COLORS || NO_COLOR || FORCE_COLOR === "0") enabled = false;
  48. else if (FORCE_COLOR === "1" || FORCE_COLOR === "2" || FORCE_COLOR === "3") enabled = true;
  49. else if (TERM === "dumb") enabled = false;
  50. else if ("CI" in globalVar.process.env && [
  51. "TRAVIS",
  52. "CIRCLECI",
  53. "APPVEYOR",
  54. "GITLAB_CI",
  55. "GITHUB_ACTIONS",
  56. "BUILDKITE",
  57. "DRONE"
  58. ].some((vendor) => vendor in globalVar.process.env)) enabled = true;
  59. else enabled = process.stdout.isTTY;
  60. if (enabled) if (process.platform === "win32") supportLevel = 3;
  61. else if (COLORTERM && (COLORTERM === "truecolor" || COLORTERM === "24bit")) supportLevel = 3;
  62. else if (TERM && (TERM.endsWith("-256color") || TERM.endsWith("256"))) supportLevel = 2;
  63. else supportLevel = 1;
  64. }
  65. let options = {
  66. enabled,
  67. supportLevel
  68. };
  69. function kolorist(start, end, level = 1) {
  70. const open = `\x1b[${start}m`;
  71. const close = `\x1b[${end}m`;
  72. const regex = new RegExp(`\\x1b\\[${end}m`, "g");
  73. return (str) => {
  74. return options.enabled && options.supportLevel >= level ? open + ("" + str).replace(regex, open) + close : "" + str;
  75. };
  76. }
  77. const reset = kolorist(0, 0);
  78. const bold = kolorist(1, 22);
  79. const dim = kolorist(2, 22);
  80. const italic = kolorist(3, 23);
  81. const underline = kolorist(4, 24);
  82. const inverse = kolorist(7, 27);
  83. const hidden = kolorist(8, 28);
  84. const strikethrough = kolorist(9, 29);
  85. const black = kolorist(30, 39);
  86. const red = kolorist(31, 39);
  87. const green = kolorist(32, 39);
  88. const yellow = kolorist(33, 39);
  89. const blue = kolorist(34, 39);
  90. const magenta = kolorist(35, 39);
  91. const cyan = kolorist(36, 39);
  92. const white = kolorist(97, 39);
  93. const gray = kolorist(90, 39);
  94. const lightGray = kolorist(37, 39);
  95. const lightRed = kolorist(91, 39);
  96. const lightGreen = kolorist(92, 39);
  97. const lightYellow = kolorist(93, 39);
  98. const lightBlue = kolorist(94, 39);
  99. const lightMagenta = kolorist(95, 39);
  100. const lightCyan = kolorist(96, 39);
  101. const bgBlack = kolorist(40, 49);
  102. const bgRed = kolorist(41, 49);
  103. const bgGreen = kolorist(42, 49);
  104. const bgYellow = kolorist(43, 49);
  105. const bgBlue = kolorist(44, 49);
  106. const bgMagenta = kolorist(45, 49);
  107. const bgCyan = kolorist(46, 49);
  108. const bgWhite = kolorist(107, 49);
  109. const bgGray = kolorist(100, 49);
  110. const bgLightRed = kolorist(101, 49);
  111. const bgLightGreen = kolorist(102, 49);
  112. const bgLightYellow = kolorist(103, 49);
  113. const bgLightBlue = kolorist(104, 49);
  114. const bgLightMagenta = kolorist(105, 49);
  115. const bgLightCyan = kolorist(106, 49);
  116. const bgLightGray = kolorist(47, 49);
  117. //#endregion
  118. //#region src/dir.ts
  119. const DIR_DIST = typeof __dirname !== "undefined" ? __dirname : dirname(fileURLToPath(import.meta.url));
  120. const DIR_CLIENT = resolve(DIR_DIST, "../client");
  121. //#endregion
  122. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js
  123. var require_array = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js": ((exports) => {
  124. Object.defineProperty(exports, "__esModule", { value: true });
  125. function flatten(items) {
  126. return items.reduce((collection, item) => [].concat(collection, item), []);
  127. }
  128. exports.flatten = flatten;
  129. function splitWhen(items, predicate) {
  130. const result = [[]];
  131. let groupIndex = 0;
  132. for (const item of items) if (predicate(item)) {
  133. groupIndex++;
  134. result[groupIndex] = [];
  135. } else result[groupIndex].push(item);
  136. return result;
  137. }
  138. exports.splitWhen = splitWhen;
  139. }) });
  140. //#endregion
  141. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/errno.js
  142. var require_errno = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/errno.js": ((exports) => {
  143. Object.defineProperty(exports, "__esModule", { value: true });
  144. function isEnoentCodeError(error) {
  145. return error.code === "ENOENT";
  146. }
  147. exports.isEnoentCodeError = isEnoentCodeError;
  148. }) });
  149. //#endregion
  150. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/fs.js
  151. var require_fs$3 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/fs.js": ((exports) => {
  152. Object.defineProperty(exports, "__esModule", { value: true });
  153. var DirentFromStats$1 = class {
  154. constructor(name, stats) {
  155. this.name = name;
  156. this.isBlockDevice = stats.isBlockDevice.bind(stats);
  157. this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
  158. this.isDirectory = stats.isDirectory.bind(stats);
  159. this.isFIFO = stats.isFIFO.bind(stats);
  160. this.isFile = stats.isFile.bind(stats);
  161. this.isSocket = stats.isSocket.bind(stats);
  162. this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
  163. }
  164. };
  165. function createDirentFromStats$1(name, stats) {
  166. return new DirentFromStats$1(name, stats);
  167. }
  168. exports.createDirentFromStats = createDirentFromStats$1;
  169. }) });
  170. //#endregion
  171. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/path.js
  172. var require_path = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/path.js": ((exports) => {
  173. Object.defineProperty(exports, "__esModule", { value: true });
  174. const os$1 = __require("os");
  175. const path$10 = __require("path");
  176. const IS_WINDOWS_PLATFORM = os$1.platform() === "win32";
  177. const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
  178. /**
  179. * All non-escaped special characters.
  180. * Posix: ()*?[]{|}, !+@ before (, ! at the beginning, \\ before non-special characters.
  181. * Windows: (){}[], !+@ before (, ! at the beginning.
  182. */
  183. const POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
  184. const WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g;
  185. /**
  186. * The device path (\\.\ or \\?\).
  187. * https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#dos-device-paths
  188. */
  189. const DOS_DEVICE_PATH_RE = /^\\\\([.?])/;
  190. /**
  191. * All backslashes except those escaping special characters.
  192. * Windows: !()+@{}
  193. * https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions
  194. */
  195. const WINDOWS_BACKSLASHES_RE = /\\(?![!()+@[\]{}])/g;
  196. /**
  197. * Designed to work only with simple paths: `dir\\file`.
  198. */
  199. function unixify(filepath) {
  200. return filepath.replace(/\\/g, "/");
  201. }
  202. exports.unixify = unixify;
  203. function makeAbsolute(cwd$1, filepath) {
  204. return path$10.resolve(cwd$1, filepath);
  205. }
  206. exports.makeAbsolute = makeAbsolute;
  207. function removeLeadingDotSegment(entry) {
  208. if (entry.charAt(0) === ".") {
  209. const secondCharactery = entry.charAt(1);
  210. if (secondCharactery === "/" || secondCharactery === "\\") return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
  211. }
  212. return entry;
  213. }
  214. exports.removeLeadingDotSegment = removeLeadingDotSegment;
  215. exports.escape = IS_WINDOWS_PLATFORM ? escapeWindowsPath : escapePosixPath;
  216. function escapeWindowsPath(pattern$1) {
  217. return pattern$1.replace(WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2");
  218. }
  219. exports.escapeWindowsPath = escapeWindowsPath;
  220. function escapePosixPath(pattern$1) {
  221. return pattern$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2");
  222. }
  223. exports.escapePosixPath = escapePosixPath;
  224. exports.convertPathToPattern = IS_WINDOWS_PLATFORM ? convertWindowsPathToPattern : convertPosixPathToPattern;
  225. function convertWindowsPathToPattern(filepath) {
  226. return escapeWindowsPath(filepath).replace(DOS_DEVICE_PATH_RE, "//$1").replace(WINDOWS_BACKSLASHES_RE, "/");
  227. }
  228. exports.convertWindowsPathToPattern = convertWindowsPathToPattern;
  229. function convertPosixPathToPattern(filepath) {
  230. return escapePosixPath(filepath);
  231. }
  232. exports.convertPosixPathToPattern = convertPosixPathToPattern;
  233. }) });
  234. //#endregion
  235. //#region ../../node_modules/.pnpm/is-extglob@2.1.1/node_modules/is-extglob/index.js
  236. var require_is_extglob = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/is-extglob@2.1.1/node_modules/is-extglob/index.js": ((exports, module) => {
  237. /*!
  238. * is-extglob <https://github.com/jonschlinkert/is-extglob>
  239. *
  240. * Copyright (c) 2014-2016, Jon Schlinkert.
  241. * Licensed under the MIT License.
  242. */
  243. module.exports = function isExtglob$1(str) {
  244. if (typeof str !== "string" || str === "") return false;
  245. var match;
  246. while (match = /(\\).|([@?!+*]\(.*\))/g.exec(str)) {
  247. if (match[2]) return true;
  248. str = str.slice(match.index + match[0].length);
  249. }
  250. return false;
  251. };
  252. }) });
  253. //#endregion
  254. //#region ../../node_modules/.pnpm/is-glob@4.0.3/node_modules/is-glob/index.js
  255. var require_is_glob = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/is-glob@4.0.3/node_modules/is-glob/index.js": ((exports, module) => {
  256. /*!
  257. * is-glob <https://github.com/jonschlinkert/is-glob>
  258. *
  259. * Copyright (c) 2014-2017, Jon Schlinkert.
  260. * Released under the MIT License.
  261. */
  262. var isExtglob = require_is_extglob();
  263. var chars = {
  264. "{": "}",
  265. "(": ")",
  266. "[": "]"
  267. };
  268. var strictCheck = function(str) {
  269. if (str[0] === "!") return true;
  270. var index = 0;
  271. var pipeIndex = -2;
  272. var closeSquareIndex = -2;
  273. var closeCurlyIndex = -2;
  274. var closeParenIndex = -2;
  275. var backSlashIndex = -2;
  276. while (index < str.length) {
  277. if (str[index] === "*") return true;
  278. if (str[index + 1] === "?" && /[\].+)]/.test(str[index])) return true;
  279. if (closeSquareIndex !== -1 && str[index] === "[" && str[index + 1] !== "]") {
  280. if (closeSquareIndex < index) closeSquareIndex = str.indexOf("]", index);
  281. if (closeSquareIndex > index) {
  282. if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) return true;
  283. backSlashIndex = str.indexOf("\\", index);
  284. if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) return true;
  285. }
  286. }
  287. if (closeCurlyIndex !== -1 && str[index] === "{" && str[index + 1] !== "}") {
  288. closeCurlyIndex = str.indexOf("}", index);
  289. if (closeCurlyIndex > index) {
  290. backSlashIndex = str.indexOf("\\", index);
  291. if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) return true;
  292. }
  293. }
  294. if (closeParenIndex !== -1 && str[index] === "(" && str[index + 1] === "?" && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ")") {
  295. closeParenIndex = str.indexOf(")", index);
  296. if (closeParenIndex > index) {
  297. backSlashIndex = str.indexOf("\\", index);
  298. if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) return true;
  299. }
  300. }
  301. if (pipeIndex !== -1 && str[index] === "(" && str[index + 1] !== "|") {
  302. if (pipeIndex < index) pipeIndex = str.indexOf("|", index);
  303. if (pipeIndex !== -1 && str[pipeIndex + 1] !== ")") {
  304. closeParenIndex = str.indexOf(")", pipeIndex);
  305. if (closeParenIndex > pipeIndex) {
  306. backSlashIndex = str.indexOf("\\", pipeIndex);
  307. if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) return true;
  308. }
  309. }
  310. }
  311. if (str[index] === "\\") {
  312. var open = str[index + 1];
  313. index += 2;
  314. var close = chars[open];
  315. if (close) {
  316. var n = str.indexOf(close, index);
  317. if (n !== -1) index = n + 1;
  318. }
  319. if (str[index] === "!") return true;
  320. } else index++;
  321. }
  322. return false;
  323. };
  324. var relaxedCheck = function(str) {
  325. if (str[0] === "!") return true;
  326. var index = 0;
  327. while (index < str.length) {
  328. if (/[*?{}()[\]]/.test(str[index])) return true;
  329. if (str[index] === "\\") {
  330. var open = str[index + 1];
  331. index += 2;
  332. var close = chars[open];
  333. if (close) {
  334. var n = str.indexOf(close, index);
  335. if (n !== -1) index = n + 1;
  336. }
  337. if (str[index] === "!") return true;
  338. } else index++;
  339. }
  340. return false;
  341. };
  342. module.exports = function isGlob$1(str, options$1) {
  343. if (typeof str !== "string" || str === "") return false;
  344. if (isExtglob(str)) return true;
  345. var check = strictCheck;
  346. if (options$1 && options$1.strict === false) check = relaxedCheck;
  347. return check(str);
  348. };
  349. }) });
  350. //#endregion
  351. //#region ../../node_modules/.pnpm/glob-parent@5.1.2/node_modules/glob-parent/index.js
  352. var require_glob_parent = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/glob-parent@5.1.2/node_modules/glob-parent/index.js": ((exports, module) => {
  353. var isGlob = require_is_glob();
  354. var pathPosixDirname = __require("path").posix.dirname;
  355. var isWin32 = __require("os").platform() === "win32";
  356. var slash = "/";
  357. var backslash = /\\/g;
  358. var enclosure = /[\{\[].*[\}\]]$/;
  359. var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
  360. var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
  361. /**
  362. * @param {string} str
  363. * @param {Object} opts
  364. * @param {boolean} [opts.flipBackslashes=true]
  365. * @returns {string}
  366. */
  367. module.exports = function globParent$1(str, opts) {
  368. if (Object.assign({ flipBackslashes: true }, opts).flipBackslashes && isWin32 && str.indexOf(slash) < 0) str = str.replace(backslash, slash);
  369. if (enclosure.test(str)) str += slash;
  370. str += "a";
  371. do
  372. str = pathPosixDirname(str);
  373. while (isGlob(str) || globby.test(str));
  374. return str.replace(escaped, "$1");
  375. };
  376. }) });
  377. //#endregion
  378. //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/utils.js
  379. var require_utils$3 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/utils.js": ((exports) => {
  380. exports.isInteger = (num) => {
  381. if (typeof num === "number") return Number.isInteger(num);
  382. if (typeof num === "string" && num.trim() !== "") return Number.isInteger(Number(num));
  383. return false;
  384. };
  385. /**
  386. * Find a node of the given type
  387. */
  388. exports.find = (node, type) => node.nodes.find((node$1) => node$1.type === type);
  389. /**
  390. * Find a node of the given type
  391. */
  392. exports.exceedsLimit = (min, max, step = 1, limit) => {
  393. if (limit === false) return false;
  394. if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
  395. return (Number(max) - Number(min)) / Number(step) >= limit;
  396. };
  397. /**
  398. * Escape the given node with '\\' before node.value
  399. */
  400. exports.escapeNode = (block, n = 0, type) => {
  401. const node = block.nodes[n];
  402. if (!node) return;
  403. if (type && node.type === type || node.type === "open" || node.type === "close") {
  404. if (node.escaped !== true) {
  405. node.value = "\\" + node.value;
  406. node.escaped = true;
  407. }
  408. }
  409. };
  410. /**
  411. * Returns true if the given brace node should be enclosed in literal braces
  412. */
  413. exports.encloseBrace = (node) => {
  414. if (node.type !== "brace") return false;
  415. if (node.commas >> 0 + node.ranges >> 0 === 0) {
  416. node.invalid = true;
  417. return true;
  418. }
  419. return false;
  420. };
  421. /**
  422. * Returns true if a brace node is invalid.
  423. */
  424. exports.isInvalidBrace = (block) => {
  425. if (block.type !== "brace") return false;
  426. if (block.invalid === true || block.dollar) return true;
  427. if (block.commas >> 0 + block.ranges >> 0 === 0) {
  428. block.invalid = true;
  429. return true;
  430. }
  431. if (block.open !== true || block.close !== true) {
  432. block.invalid = true;
  433. return true;
  434. }
  435. return false;
  436. };
  437. /**
  438. * Returns true if a node is an open or close node
  439. */
  440. exports.isOpenOrClose = (node) => {
  441. if (node.type === "open" || node.type === "close") return true;
  442. return node.open === true || node.close === true;
  443. };
  444. /**
  445. * Reduce an array of text nodes.
  446. */
  447. exports.reduce = (nodes) => nodes.reduce((acc, node) => {
  448. if (node.type === "text") acc.push(node.value);
  449. if (node.type === "range") node.type = "text";
  450. return acc;
  451. }, []);
  452. /**
  453. * Flatten an array
  454. */
  455. exports.flatten = (...args) => {
  456. const result = [];
  457. const flat = (arr) => {
  458. for (let i = 0; i < arr.length; i++) {
  459. const ele = arr[i];
  460. if (Array.isArray(ele)) {
  461. flat(ele);
  462. continue;
  463. }
  464. if (ele !== void 0) result.push(ele);
  465. }
  466. return result;
  467. };
  468. flat(args);
  469. return result;
  470. };
  471. }) });
  472. //#endregion
  473. //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/stringify.js
  474. var require_stringify = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/stringify.js": ((exports, module) => {
  475. const utils$16 = require_utils$3();
  476. module.exports = (ast, options$1 = {}) => {
  477. const stringify$4 = (node, parent = {}) => {
  478. const invalidBlock = options$1.escapeInvalid && utils$16.isInvalidBrace(parent);
  479. const invalidNode = node.invalid === true && options$1.escapeInvalid === true;
  480. let output = "";
  481. if (node.value) {
  482. if ((invalidBlock || invalidNode) && utils$16.isOpenOrClose(node)) return "\\" + node.value;
  483. return node.value;
  484. }
  485. if (node.value) return node.value;
  486. if (node.nodes) for (const child of node.nodes) output += stringify$4(child);
  487. return output;
  488. };
  489. return stringify$4(ast);
  490. };
  491. }) });
  492. //#endregion
  493. //#region ../../node_modules/.pnpm/is-number@7.0.0/node_modules/is-number/index.js
  494. var require_is_number = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/is-number@7.0.0/node_modules/is-number/index.js": ((exports, module) => {
  495. module.exports = function(num) {
  496. if (typeof num === "number") return num - num === 0;
  497. if (typeof num === "string" && num.trim() !== "") return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
  498. return false;
  499. };
  500. }) });
  501. //#endregion
  502. //#region ../../node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.js
  503. var require_to_regex_range = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.js": ((exports, module) => {
  504. const isNumber$1 = require_is_number();
  505. const toRegexRange$1 = (min, max, options$1) => {
  506. if (isNumber$1(min) === false) throw new TypeError("toRegexRange: expected the first argument to be a number");
  507. if (max === void 0 || min === max) return String(min);
  508. if (isNumber$1(max) === false) throw new TypeError("toRegexRange: expected the second argument to be a number.");
  509. let opts = {
  510. relaxZeros: true,
  511. ...options$1
  512. };
  513. if (typeof opts.strictZeros === "boolean") opts.relaxZeros = opts.strictZeros === false;
  514. let relax = String(opts.relaxZeros);
  515. let shorthand = String(opts.shorthand);
  516. let capture = String(opts.capture);
  517. let wrap = String(opts.wrap);
  518. let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap;
  519. if (toRegexRange$1.cache.hasOwnProperty(cacheKey)) return toRegexRange$1.cache[cacheKey].result;
  520. let a = Math.min(min, max);
  521. let b = Math.max(min, max);
  522. if (Math.abs(a - b) === 1) {
  523. let result = min + "|" + max;
  524. if (opts.capture) return `(${result})`;
  525. if (opts.wrap === false) return result;
  526. return `(?:${result})`;
  527. }
  528. let isPadded = hasPadding(min) || hasPadding(max);
  529. let state = {
  530. min,
  531. max,
  532. a,
  533. b
  534. };
  535. let positives = [];
  536. let negatives = [];
  537. if (isPadded) {
  538. state.isPadded = isPadded;
  539. state.maxLen = String(state.max).length;
  540. }
  541. if (a < 0) {
  542. negatives = splitToPatterns(b < 0 ? Math.abs(b) : 1, Math.abs(a), state, opts);
  543. a = state.a = 0;
  544. }
  545. if (b >= 0) positives = splitToPatterns(a, b, state, opts);
  546. state.negatives = negatives;
  547. state.positives = positives;
  548. state.result = collatePatterns(negatives, positives, opts);
  549. if (opts.capture === true) state.result = `(${state.result})`;
  550. else if (opts.wrap !== false && positives.length + negatives.length > 1) state.result = `(?:${state.result})`;
  551. toRegexRange$1.cache[cacheKey] = state;
  552. return state.result;
  553. };
  554. function collatePatterns(neg, pos, options$1) {
  555. let onlyNegative = filterPatterns(neg, pos, "-", false, options$1) || [];
  556. let onlyPositive = filterPatterns(pos, neg, "", false, options$1) || [];
  557. let intersected = filterPatterns(neg, pos, "-?", true, options$1) || [];
  558. return onlyNegative.concat(intersected).concat(onlyPositive).join("|");
  559. }
  560. function splitToRanges(min, max) {
  561. let nines = 1;
  562. let zeros$1 = 1;
  563. let stop = countNines(min, nines);
  564. let stops = new Set([max]);
  565. while (min <= stop && stop <= max) {
  566. stops.add(stop);
  567. nines += 1;
  568. stop = countNines(min, nines);
  569. }
  570. stop = countZeros(max + 1, zeros$1) - 1;
  571. while (min < stop && stop <= max) {
  572. stops.add(stop);
  573. zeros$1 += 1;
  574. stop = countZeros(max + 1, zeros$1) - 1;
  575. }
  576. stops = [...stops];
  577. stops.sort(compare);
  578. return stops;
  579. }
  580. /**
  581. * Convert a range to a regex pattern
  582. * @param {Number} `start`
  583. * @param {Number} `stop`
  584. * @return {String}
  585. */
  586. function rangeToPattern(start, stop, options$1) {
  587. if (start === stop) return {
  588. pattern: start,
  589. count: [],
  590. digits: 0
  591. };
  592. let zipped = zip(start, stop);
  593. let digits = zipped.length;
  594. let pattern$1 = "";
  595. let count = 0;
  596. for (let i = 0; i < digits; i++) {
  597. let [startDigit, stopDigit] = zipped[i];
  598. if (startDigit === stopDigit) pattern$1 += startDigit;
  599. else if (startDigit !== "0" || stopDigit !== "9") pattern$1 += toCharacterClass(startDigit, stopDigit, options$1);
  600. else count++;
  601. }
  602. if (count) pattern$1 += options$1.shorthand === true ? "\\d" : "[0-9]";
  603. return {
  604. pattern: pattern$1,
  605. count: [count],
  606. digits
  607. };
  608. }
  609. function splitToPatterns(min, max, tok, options$1) {
  610. let ranges = splitToRanges(min, max);
  611. let tokens = [];
  612. let start = min;
  613. let prev;
  614. for (let i = 0; i < ranges.length; i++) {
  615. let max$1 = ranges[i];
  616. let obj = rangeToPattern(String(start), String(max$1), options$1);
  617. let zeros$1 = "";
  618. if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
  619. if (prev.count.length > 1) prev.count.pop();
  620. prev.count.push(obj.count[0]);
  621. prev.string = prev.pattern + toQuantifier(prev.count);
  622. start = max$1 + 1;
  623. continue;
  624. }
  625. if (tok.isPadded) zeros$1 = padZeros(max$1, tok, options$1);
  626. obj.string = zeros$1 + obj.pattern + toQuantifier(obj.count);
  627. tokens.push(obj);
  628. start = max$1 + 1;
  629. prev = obj;
  630. }
  631. return tokens;
  632. }
  633. function filterPatterns(arr, comparison, prefix, intersection, options$1) {
  634. let result = [];
  635. for (let ele of arr) {
  636. let { string: string$1 } = ele;
  637. if (!intersection && !contains(comparison, "string", string$1)) result.push(prefix + string$1);
  638. if (intersection && contains(comparison, "string", string$1)) result.push(prefix + string$1);
  639. }
  640. return result;
  641. }
  642. /**
  643. * Zip strings
  644. */
  645. function zip(a, b) {
  646. let arr = [];
  647. for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
  648. return arr;
  649. }
  650. function compare(a, b) {
  651. return a > b ? 1 : b > a ? -1 : 0;
  652. }
  653. function contains(arr, key, val) {
  654. return arr.some((ele) => ele[key] === val);
  655. }
  656. function countNines(min, len) {
  657. return Number(String(min).slice(0, -len) + "9".repeat(len));
  658. }
  659. function countZeros(integer, zeros$1) {
  660. return integer - integer % Math.pow(10, zeros$1);
  661. }
  662. function toQuantifier(digits) {
  663. let [start = 0, stop = ""] = digits;
  664. if (stop || start > 1) return `{${start + (stop ? "," + stop : "")}}`;
  665. return "";
  666. }
  667. function toCharacterClass(a, b, options$1) {
  668. return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
  669. }
  670. function hasPadding(str) {
  671. return /^-?(0+)\d/.test(str);
  672. }
  673. function padZeros(value, tok, options$1) {
  674. if (!tok.isPadded) return value;
  675. let diff = Math.abs(tok.maxLen - String(value).length);
  676. let relax = options$1.relaxZeros !== false;
  677. switch (diff) {
  678. case 0: return "";
  679. case 1: return relax ? "0?" : "0";
  680. case 2: return relax ? "0{0,2}" : "00";
  681. default: return relax ? `0{0,${diff}}` : `0{${diff}}`;
  682. }
  683. }
  684. /**
  685. * Cache
  686. */
  687. toRegexRange$1.cache = {};
  688. toRegexRange$1.clearCache = () => toRegexRange$1.cache = {};
  689. /**
  690. * Expose `toRegexRange`
  691. */
  692. module.exports = toRegexRange$1;
  693. }) });
  694. //#endregion
  695. //#region ../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js
  696. var require_fill_range = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js": ((exports, module) => {
  697. const util$1 = __require("util");
  698. const toRegexRange = require_to_regex_range();
  699. const isObject$1 = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
  700. const transform = (toNumber) => {
  701. return (value) => toNumber === true ? Number(value) : String(value);
  702. };
  703. const isValidValue = (value) => {
  704. return typeof value === "number" || typeof value === "string" && value !== "";
  705. };
  706. const isNumber = (num) => Number.isInteger(+num);
  707. const zeros = (input) => {
  708. let value = `${input}`;
  709. let index = -1;
  710. if (value[0] === "-") value = value.slice(1);
  711. if (value === "0") return false;
  712. while (value[++index] === "0");
  713. return index > 0;
  714. };
  715. const stringify$3 = (start, end, options$1) => {
  716. if (typeof start === "string" || typeof end === "string") return true;
  717. return options$1.stringify === true;
  718. };
  719. const pad = (input, maxLength, toNumber) => {
  720. if (maxLength > 0) {
  721. let dash = input[0] === "-" ? "-" : "";
  722. if (dash) input = input.slice(1);
  723. input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0");
  724. }
  725. if (toNumber === false) return String(input);
  726. return input;
  727. };
  728. const toMaxLen = (input, maxLength) => {
  729. let negative = input[0] === "-" ? "-" : "";
  730. if (negative) {
  731. input = input.slice(1);
  732. maxLength--;
  733. }
  734. while (input.length < maxLength) input = "0" + input;
  735. return negative ? "-" + input : input;
  736. };
  737. const toSequence = (parts, options$1, maxLen) => {
  738. parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
  739. parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
  740. let prefix = options$1.capture ? "" : "?:";
  741. let positives = "";
  742. let negatives = "";
  743. let result;
  744. if (parts.positives.length) positives = parts.positives.map((v) => toMaxLen(String(v), maxLen)).join("|");
  745. if (parts.negatives.length) negatives = `-(${prefix}${parts.negatives.map((v) => toMaxLen(String(v), maxLen)).join("|")})`;
  746. if (positives && negatives) result = `${positives}|${negatives}`;
  747. else result = positives || negatives;
  748. if (options$1.wrap) return `(${prefix}${result})`;
  749. return result;
  750. };
  751. const toRange = (a, b, isNumbers, options$1) => {
  752. if (isNumbers) return toRegexRange(a, b, {
  753. wrap: false,
  754. ...options$1
  755. });
  756. let start = String.fromCharCode(a);
  757. if (a === b) return start;
  758. return `[${start}-${String.fromCharCode(b)}]`;
  759. };
  760. const toRegex = (start, end, options$1) => {
  761. if (Array.isArray(start)) {
  762. let wrap = options$1.wrap === true;
  763. let prefix = options$1.capture ? "" : "?:";
  764. return wrap ? `(${prefix}${start.join("|")})` : start.join("|");
  765. }
  766. return toRegexRange(start, end, options$1);
  767. };
  768. const rangeError = (...args) => {
  769. return /* @__PURE__ */ new RangeError("Invalid range arguments: " + util$1.inspect(...args));
  770. };
  771. const invalidRange = (start, end, options$1) => {
  772. if (options$1.strictRanges === true) throw rangeError([start, end]);
  773. return [];
  774. };
  775. const invalidStep = (step, options$1) => {
  776. if (options$1.strictRanges === true) throw new TypeError(`Expected step "${step}" to be a number`);
  777. return [];
  778. };
  779. const fillNumbers = (start, end, step = 1, options$1 = {}) => {
  780. let a = Number(start);
  781. let b = Number(end);
  782. if (!Number.isInteger(a) || !Number.isInteger(b)) {
  783. if (options$1.strictRanges === true) throw rangeError([start, end]);
  784. return [];
  785. }
  786. if (a === 0) a = 0;
  787. if (b === 0) b = 0;
  788. let descending = a > b;
  789. let startString = String(start);
  790. let endString = String(end);
  791. let stepString = String(step);
  792. step = Math.max(Math.abs(step), 1);
  793. let padded = zeros(startString) || zeros(endString) || zeros(stepString);
  794. let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
  795. let toNumber = padded === false && stringify$3(start, end, options$1) === false;
  796. let format = options$1.transform || transform(toNumber);
  797. if (options$1.toRegex && step === 1) return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options$1);
  798. let parts = {
  799. negatives: [],
  800. positives: []
  801. };
  802. let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
  803. let range = [];
  804. let index = 0;
  805. while (descending ? a >= b : a <= b) {
  806. if (options$1.toRegex === true && step > 1) push(a);
  807. else range.push(pad(format(a, index), maxLen, toNumber));
  808. a = descending ? a - step : a + step;
  809. index++;
  810. }
  811. if (options$1.toRegex === true) return step > 1 ? toSequence(parts, options$1, maxLen) : toRegex(range, null, {
  812. wrap: false,
  813. ...options$1
  814. });
  815. return range;
  816. };
  817. const fillLetters = (start, end, step = 1, options$1 = {}) => {
  818. if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) return invalidRange(start, end, options$1);
  819. let format = options$1.transform || ((val) => String.fromCharCode(val));
  820. let a = `${start}`.charCodeAt(0);
  821. let b = `${end}`.charCodeAt(0);
  822. let descending = a > b;
  823. let min = Math.min(a, b);
  824. let max = Math.max(a, b);
  825. if (options$1.toRegex && step === 1) return toRange(min, max, false, options$1);
  826. let range = [];
  827. let index = 0;
  828. while (descending ? a >= b : a <= b) {
  829. range.push(format(a, index));
  830. a = descending ? a - step : a + step;
  831. index++;
  832. }
  833. if (options$1.toRegex === true) return toRegex(range, null, {
  834. wrap: false,
  835. options: options$1
  836. });
  837. return range;
  838. };
  839. const fill$2 = (start, end, step, options$1 = {}) => {
  840. if (end == null && isValidValue(start)) return [start];
  841. if (!isValidValue(start) || !isValidValue(end)) return invalidRange(start, end, options$1);
  842. if (typeof step === "function") return fill$2(start, end, 1, { transform: step });
  843. if (isObject$1(step)) return fill$2(start, end, 0, step);
  844. let opts = { ...options$1 };
  845. if (opts.capture === true) opts.wrap = true;
  846. step = step || opts.step || 1;
  847. if (!isNumber(step)) {
  848. if (step != null && !isObject$1(step)) return invalidStep(step, opts);
  849. return fill$2(start, end, 1, step);
  850. }
  851. if (isNumber(start) && isNumber(end)) return fillNumbers(start, end, step, opts);
  852. return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
  853. };
  854. module.exports = fill$2;
  855. }) });
  856. //#endregion
  857. //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/compile.js
  858. var require_compile = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/compile.js": ((exports, module) => {
  859. const fill$1 = require_fill_range();
  860. const utils$15 = require_utils$3();
  861. const compile$1 = (ast, options$1 = {}) => {
  862. const walk$1 = (node, parent = {}) => {
  863. const invalidBlock = utils$15.isInvalidBrace(parent);
  864. const invalidNode = node.invalid === true && options$1.escapeInvalid === true;
  865. const invalid = invalidBlock === true || invalidNode === true;
  866. const prefix = options$1.escapeInvalid === true ? "\\" : "";
  867. let output = "";
  868. if (node.isOpen === true) return prefix + node.value;
  869. if (node.isClose === true) {
  870. console.log("node.isClose", prefix, node.value);
  871. return prefix + node.value;
  872. }
  873. if (node.type === "open") return invalid ? prefix + node.value : "(";
  874. if (node.type === "close") return invalid ? prefix + node.value : ")";
  875. if (node.type === "comma") return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
  876. if (node.value) return node.value;
  877. if (node.nodes && node.ranges > 0) {
  878. const args = utils$15.reduce(node.nodes);
  879. const range = fill$1(...args, {
  880. ...options$1,
  881. wrap: false,
  882. toRegex: true,
  883. strictZeros: true
  884. });
  885. if (range.length !== 0) return args.length > 1 && range.length > 1 ? `(${range})` : range;
  886. }
  887. if (node.nodes) for (const child of node.nodes) output += walk$1(child, node);
  888. return output;
  889. };
  890. return walk$1(ast);
  891. };
  892. module.exports = compile$1;
  893. }) });
  894. //#endregion
  895. //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/expand.js
  896. var require_expand = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/expand.js": ((exports, module) => {
  897. const fill = require_fill_range();
  898. const stringify$2 = require_stringify();
  899. const utils$14 = require_utils$3();
  900. const append = (queue = "", stash = "", enclose = false) => {
  901. const result = [];
  902. queue = [].concat(queue);
  903. stash = [].concat(stash);
  904. if (!stash.length) return queue;
  905. if (!queue.length) return enclose ? utils$14.flatten(stash).map((ele) => `{${ele}}`) : stash;
  906. for (const item of queue) if (Array.isArray(item)) for (const value of item) result.push(append(value, stash, enclose));
  907. else for (let ele of stash) {
  908. if (enclose === true && typeof ele === "string") ele = `{${ele}}`;
  909. result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
  910. }
  911. return utils$14.flatten(result);
  912. };
  913. const expand$1 = (ast, options$1 = {}) => {
  914. const rangeLimit = options$1.rangeLimit === void 0 ? 1e3 : options$1.rangeLimit;
  915. const walk$1 = (node, parent = {}) => {
  916. node.queue = [];
  917. let p = parent;
  918. let q = parent.queue;
  919. while (p.type !== "brace" && p.type !== "root" && p.parent) {
  920. p = p.parent;
  921. q = p.queue;
  922. }
  923. if (node.invalid || node.dollar) {
  924. q.push(append(q.pop(), stringify$2(node, options$1)));
  925. return;
  926. }
  927. if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
  928. q.push(append(q.pop(), ["{}"]));
  929. return;
  930. }
  931. if (node.nodes && node.ranges > 0) {
  932. const args = utils$14.reduce(node.nodes);
  933. if (utils$14.exceedsLimit(...args, options$1.step, rangeLimit)) throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
  934. let range = fill(...args, options$1);
  935. if (range.length === 0) range = stringify$2(node, options$1);
  936. q.push(append(q.pop(), range));
  937. node.nodes = [];
  938. return;
  939. }
  940. const enclose = utils$14.encloseBrace(node);
  941. let queue = node.queue;
  942. let block = node;
  943. while (block.type !== "brace" && block.type !== "root" && block.parent) {
  944. block = block.parent;
  945. queue = block.queue;
  946. }
  947. for (let i = 0; i < node.nodes.length; i++) {
  948. const child = node.nodes[i];
  949. if (child.type === "comma" && node.type === "brace") {
  950. if (i === 1) queue.push("");
  951. queue.push("");
  952. continue;
  953. }
  954. if (child.type === "close") {
  955. q.push(append(q.pop(), queue, enclose));
  956. continue;
  957. }
  958. if (child.value && child.type !== "open") {
  959. queue.push(append(queue.pop(), child.value));
  960. continue;
  961. }
  962. if (child.nodes) walk$1(child, node);
  963. }
  964. return queue;
  965. };
  966. return utils$14.flatten(walk$1(ast));
  967. };
  968. module.exports = expand$1;
  969. }) });
  970. //#endregion
  971. //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/constants.js
  972. var require_constants$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/constants.js": ((exports, module) => {
  973. module.exports = {
  974. MAX_LENGTH: 1e4,
  975. CHAR_0: "0",
  976. CHAR_9: "9",
  977. CHAR_UPPERCASE_A: "A",
  978. CHAR_LOWERCASE_A: "a",
  979. CHAR_UPPERCASE_Z: "Z",
  980. CHAR_LOWERCASE_Z: "z",
  981. CHAR_LEFT_PARENTHESES: "(",
  982. CHAR_RIGHT_PARENTHESES: ")",
  983. CHAR_ASTERISK: "*",
  984. CHAR_AMPERSAND: "&",
  985. CHAR_AT: "@",
  986. CHAR_BACKSLASH: "\\",
  987. CHAR_BACKTICK: "`",
  988. CHAR_CARRIAGE_RETURN: "\r",
  989. CHAR_CIRCUMFLEX_ACCENT: "^",
  990. CHAR_COLON: ":",
  991. CHAR_COMMA: ",",
  992. CHAR_DOLLAR: "$",
  993. CHAR_DOT: ".",
  994. CHAR_DOUBLE_QUOTE: "\"",
  995. CHAR_EQUAL: "=",
  996. CHAR_EXCLAMATION_MARK: "!",
  997. CHAR_FORM_FEED: "\f",
  998. CHAR_FORWARD_SLASH: "/",
  999. CHAR_HASH: "#",
  1000. CHAR_HYPHEN_MINUS: "-",
  1001. CHAR_LEFT_ANGLE_BRACKET: "<",
  1002. CHAR_LEFT_CURLY_BRACE: "{",
  1003. CHAR_LEFT_SQUARE_BRACKET: "[",
  1004. CHAR_LINE_FEED: "\n",
  1005. CHAR_NO_BREAK_SPACE: "\xA0",
  1006. CHAR_PERCENT: "%",
  1007. CHAR_PLUS: "+",
  1008. CHAR_QUESTION_MARK: "?",
  1009. CHAR_RIGHT_ANGLE_BRACKET: ">",
  1010. CHAR_RIGHT_CURLY_BRACE: "}",
  1011. CHAR_RIGHT_SQUARE_BRACKET: "]",
  1012. CHAR_SEMICOLON: ";",
  1013. CHAR_SINGLE_QUOTE: "'",
  1014. CHAR_SPACE: " ",
  1015. CHAR_TAB: " ",
  1016. CHAR_UNDERSCORE: "_",
  1017. CHAR_VERTICAL_LINE: "|",
  1018. CHAR_ZERO_WIDTH_NOBREAK_SPACE: ""
  1019. };
  1020. }) });
  1021. //#endregion
  1022. //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/parse.js
  1023. var require_parse$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/parse.js": ((exports, module) => {
  1024. const stringify$1 = require_stringify();
  1025. /**
  1026. * Constants
  1027. */
  1028. const { MAX_LENGTH: MAX_LENGTH$1, CHAR_BACKSLASH, CHAR_BACKTICK, CHAR_COMMA: CHAR_COMMA$1, CHAR_DOT: CHAR_DOT$1, CHAR_LEFT_PARENTHESES: CHAR_LEFT_PARENTHESES$1, CHAR_RIGHT_PARENTHESES: CHAR_RIGHT_PARENTHESES$1, CHAR_LEFT_CURLY_BRACE: CHAR_LEFT_CURLY_BRACE$1, CHAR_RIGHT_CURLY_BRACE: CHAR_RIGHT_CURLY_BRACE$1, CHAR_LEFT_SQUARE_BRACKET: CHAR_LEFT_SQUARE_BRACKET$1, CHAR_RIGHT_SQUARE_BRACKET: CHAR_RIGHT_SQUARE_BRACKET$1, CHAR_DOUBLE_QUOTE, CHAR_SINGLE_QUOTE, CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_NOBREAK_SPACE } = require_constants$2();
  1029. /**
  1030. * parse
  1031. */
  1032. const parse$3 = (input, options$1 = {}) => {
  1033. if (typeof input !== "string") throw new TypeError("Expected a string");
  1034. const opts = options$1 || {};
  1035. const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1;
  1036. if (input.length > max) throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
  1037. const ast = {
  1038. type: "root",
  1039. input,
  1040. nodes: []
  1041. };
  1042. const stack = [ast];
  1043. let block = ast;
  1044. let prev = ast;
  1045. let brackets = 0;
  1046. const length = input.length;
  1047. let index = 0;
  1048. let depth$1 = 0;
  1049. let value;
  1050. /**
  1051. * Helpers
  1052. */
  1053. const advance = () => input[index++];
  1054. const push = (node) => {
  1055. if (node.type === "text" && prev.type === "dot") prev.type = "text";
  1056. if (prev && prev.type === "text" && node.type === "text") {
  1057. prev.value += node.value;
  1058. return;
  1059. }
  1060. block.nodes.push(node);
  1061. node.parent = block;
  1062. node.prev = prev;
  1063. prev = node;
  1064. return node;
  1065. };
  1066. push({ type: "bos" });
  1067. while (index < length) {
  1068. block = stack[stack.length - 1];
  1069. value = advance();
  1070. /**
  1071. * Invalid chars
  1072. */
  1073. if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) continue;
  1074. /**
  1075. * Escaped chars
  1076. */
  1077. if (value === CHAR_BACKSLASH) {
  1078. push({
  1079. type: "text",
  1080. value: (options$1.keepEscaping ? value : "") + advance()
  1081. });
  1082. continue;
  1083. }
  1084. /**
  1085. * Right square bracket (literal): ']'
  1086. */
  1087. if (value === CHAR_RIGHT_SQUARE_BRACKET$1) {
  1088. push({
  1089. type: "text",
  1090. value: "\\" + value
  1091. });
  1092. continue;
  1093. }
  1094. /**
  1095. * Left square bracket: '['
  1096. */
  1097. if (value === CHAR_LEFT_SQUARE_BRACKET$1) {
  1098. brackets++;
  1099. let next;
  1100. while (index < length && (next = advance())) {
  1101. value += next;
  1102. if (next === CHAR_LEFT_SQUARE_BRACKET$1) {
  1103. brackets++;
  1104. continue;
  1105. }
  1106. if (next === CHAR_BACKSLASH) {
  1107. value += advance();
  1108. continue;
  1109. }
  1110. if (next === CHAR_RIGHT_SQUARE_BRACKET$1) {
  1111. brackets--;
  1112. if (brackets === 0) break;
  1113. }
  1114. }
  1115. push({
  1116. type: "text",
  1117. value
  1118. });
  1119. continue;
  1120. }
  1121. /**
  1122. * Parentheses
  1123. */
  1124. if (value === CHAR_LEFT_PARENTHESES$1) {
  1125. block = push({
  1126. type: "paren",
  1127. nodes: []
  1128. });
  1129. stack.push(block);
  1130. push({
  1131. type: "text",
  1132. value
  1133. });
  1134. continue;
  1135. }
  1136. if (value === CHAR_RIGHT_PARENTHESES$1) {
  1137. if (block.type !== "paren") {
  1138. push({
  1139. type: "text",
  1140. value
  1141. });
  1142. continue;
  1143. }
  1144. block = stack.pop();
  1145. push({
  1146. type: "text",
  1147. value
  1148. });
  1149. block = stack[stack.length - 1];
  1150. continue;
  1151. }
  1152. /**
  1153. * Quotes: '|"|`
  1154. */
  1155. if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
  1156. const open = value;
  1157. let next;
  1158. if (options$1.keepQuotes !== true) value = "";
  1159. while (index < length && (next = advance())) {
  1160. if (next === CHAR_BACKSLASH) {
  1161. value += next + advance();
  1162. continue;
  1163. }
  1164. if (next === open) {
  1165. if (options$1.keepQuotes === true) value += next;
  1166. break;
  1167. }
  1168. value += next;
  1169. }
  1170. push({
  1171. type: "text",
  1172. value
  1173. });
  1174. continue;
  1175. }
  1176. /**
  1177. * Left curly brace: '{'
  1178. */
  1179. if (value === CHAR_LEFT_CURLY_BRACE$1) {
  1180. depth$1++;
  1181. block = push({
  1182. type: "brace",
  1183. open: true,
  1184. close: false,
  1185. dollar: prev.value && prev.value.slice(-1) === "$" || block.dollar === true,
  1186. depth: depth$1,
  1187. commas: 0,
  1188. ranges: 0,
  1189. nodes: []
  1190. });
  1191. stack.push(block);
  1192. push({
  1193. type: "open",
  1194. value
  1195. });
  1196. continue;
  1197. }
  1198. /**
  1199. * Right curly brace: '}'
  1200. */
  1201. if (value === CHAR_RIGHT_CURLY_BRACE$1) {
  1202. if (block.type !== "brace") {
  1203. push({
  1204. type: "text",
  1205. value
  1206. });
  1207. continue;
  1208. }
  1209. const type = "close";
  1210. block = stack.pop();
  1211. block.close = true;
  1212. push({
  1213. type,
  1214. value
  1215. });
  1216. depth$1--;
  1217. block = stack[stack.length - 1];
  1218. continue;
  1219. }
  1220. /**
  1221. * Comma: ','
  1222. */
  1223. if (value === CHAR_COMMA$1 && depth$1 > 0) {
  1224. if (block.ranges > 0) {
  1225. block.ranges = 0;
  1226. block.nodes = [block.nodes.shift(), {
  1227. type: "text",
  1228. value: stringify$1(block)
  1229. }];
  1230. }
  1231. push({
  1232. type: "comma",
  1233. value
  1234. });
  1235. block.commas++;
  1236. continue;
  1237. }
  1238. /**
  1239. * Dot: '.'
  1240. */
  1241. if (value === CHAR_DOT$1 && depth$1 > 0 && block.commas === 0) {
  1242. const siblings = block.nodes;
  1243. if (depth$1 === 0 || siblings.length === 0) {
  1244. push({
  1245. type: "text",
  1246. value
  1247. });
  1248. continue;
  1249. }
  1250. if (prev.type === "dot") {
  1251. block.range = [];
  1252. prev.value += value;
  1253. prev.type = "range";
  1254. if (block.nodes.length !== 3 && block.nodes.length !== 5) {
  1255. block.invalid = true;
  1256. block.ranges = 0;
  1257. prev.type = "text";
  1258. continue;
  1259. }
  1260. block.ranges++;
  1261. block.args = [];
  1262. continue;
  1263. }
  1264. if (prev.type === "range") {
  1265. siblings.pop();
  1266. const before = siblings[siblings.length - 1];
  1267. before.value += prev.value + value;
  1268. prev = before;
  1269. block.ranges--;
  1270. continue;
  1271. }
  1272. push({
  1273. type: "dot",
  1274. value
  1275. });
  1276. continue;
  1277. }
  1278. /**
  1279. * Text
  1280. */
  1281. push({
  1282. type: "text",
  1283. value
  1284. });
  1285. }
  1286. do {
  1287. block = stack.pop();
  1288. if (block.type !== "root") {
  1289. block.nodes.forEach((node) => {
  1290. if (!node.nodes) {
  1291. if (node.type === "open") node.isOpen = true;
  1292. if (node.type === "close") node.isClose = true;
  1293. if (!node.nodes) node.type = "text";
  1294. node.invalid = true;
  1295. }
  1296. });
  1297. const parent = stack[stack.length - 1];
  1298. const index$1 = parent.nodes.indexOf(block);
  1299. parent.nodes.splice(index$1, 1, ...block.nodes);
  1300. }
  1301. } while (stack.length > 0);
  1302. push({ type: "eos" });
  1303. return ast;
  1304. };
  1305. module.exports = parse$3;
  1306. }) });
  1307. //#endregion
  1308. //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/index.js
  1309. var require_braces = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/index.js": ((exports, module) => {
  1310. const stringify = require_stringify();
  1311. const compile = require_compile();
  1312. const expand = require_expand();
  1313. const parse$2 = require_parse$1();
  1314. /**
  1315. * Expand the given pattern or create a regex-compatible string.
  1316. *
  1317. * ```js
  1318. * const braces = require('braces');
  1319. * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)']
  1320. * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c']
  1321. * ```
  1322. * @param {String} `str`
  1323. * @param {Object} `options`
  1324. * @return {String}
  1325. * @api public
  1326. */
  1327. const braces$1 = (input, options$1 = {}) => {
  1328. let output = [];
  1329. if (Array.isArray(input)) for (const pattern$1 of input) {
  1330. const result = braces$1.create(pattern$1, options$1);
  1331. if (Array.isArray(result)) output.push(...result);
  1332. else output.push(result);
  1333. }
  1334. else output = [].concat(braces$1.create(input, options$1));
  1335. if (options$1 && options$1.expand === true && options$1.nodupes === true) output = [...new Set(output)];
  1336. return output;
  1337. };
  1338. /**
  1339. * Parse the given `str` with the given `options`.
  1340. *
  1341. * ```js
  1342. * // braces.parse(pattern, [, options]);
  1343. * const ast = braces.parse('a/{b,c}/d');
  1344. * console.log(ast);
  1345. * ```
  1346. * @param {String} pattern Brace pattern to parse
  1347. * @param {Object} options
  1348. * @return {Object} Returns an AST
  1349. * @api public
  1350. */
  1351. braces$1.parse = (input, options$1 = {}) => parse$2(input, options$1);
  1352. /**
  1353. * Creates a braces string from an AST, or an AST node.
  1354. *
  1355. * ```js
  1356. * const braces = require('braces');
  1357. * let ast = braces.parse('foo/{a,b}/bar');
  1358. * console.log(stringify(ast.nodes[2])); //=> '{a,b}'
  1359. * ```
  1360. * @param {String} `input` Brace pattern or AST.
  1361. * @param {Object} `options`
  1362. * @return {Array} Returns an array of expanded values.
  1363. * @api public
  1364. */
  1365. braces$1.stringify = (input, options$1 = {}) => {
  1366. if (typeof input === "string") return stringify(braces$1.parse(input, options$1), options$1);
  1367. return stringify(input, options$1);
  1368. };
  1369. /**
  1370. * Compiles a brace pattern into a regex-compatible, optimized string.
  1371. * This method is called by the main [braces](#braces) function by default.
  1372. *
  1373. * ```js
  1374. * const braces = require('braces');
  1375. * console.log(braces.compile('a/{b,c}/d'));
  1376. * //=> ['a/(b|c)/d']
  1377. * ```
  1378. * @param {String} `input` Brace pattern or AST.
  1379. * @param {Object} `options`
  1380. * @return {Array} Returns an array of expanded values.
  1381. * @api public
  1382. */
  1383. braces$1.compile = (input, options$1 = {}) => {
  1384. if (typeof input === "string") input = braces$1.parse(input, options$1);
  1385. return compile(input, options$1);
  1386. };
  1387. /**
  1388. * Expands a brace pattern into an array. This method is called by the
  1389. * main [braces](#braces) function when `options.expand` is true. Before
  1390. * using this method it's recommended that you read the [performance notes](#performance))
  1391. * and advantages of using [.compile](#compile) instead.
  1392. *
  1393. * ```js
  1394. * const braces = require('braces');
  1395. * console.log(braces.expand('a/{b,c}/d'));
  1396. * //=> ['a/b/d', 'a/c/d'];
  1397. * ```
  1398. * @param {String} `pattern` Brace pattern
  1399. * @param {Object} `options`
  1400. * @return {Array} Returns an array of expanded values.
  1401. * @api public
  1402. */
  1403. braces$1.expand = (input, options$1 = {}) => {
  1404. if (typeof input === "string") input = braces$1.parse(input, options$1);
  1405. let result = expand(input, options$1);
  1406. if (options$1.noempty === true) result = result.filter(Boolean);
  1407. if (options$1.nodupes === true) result = [...new Set(result)];
  1408. return result;
  1409. };
  1410. /**
  1411. * Processes a brace pattern and returns either an expanded array
  1412. * (if `options.expand` is true), a highly optimized regex-compatible string.
  1413. * This method is called by the main [braces](#braces) function.
  1414. *
  1415. * ```js
  1416. * const braces = require('braces');
  1417. * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}'))
  1418. * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)'
  1419. * ```
  1420. * @param {String} `pattern` Brace pattern
  1421. * @param {Object} `options`
  1422. * @return {Array} Returns an array of expanded values.
  1423. * @api public
  1424. */
  1425. braces$1.create = (input, options$1 = {}) => {
  1426. if (input === "" || input.length < 3) return [input];
  1427. return options$1.expand !== true ? braces$1.compile(input, options$1) : braces$1.expand(input, options$1);
  1428. };
  1429. /**
  1430. * Expose "braces"
  1431. */
  1432. module.exports = braces$1;
  1433. }) });
  1434. //#endregion
  1435. //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js
  1436. var require_constants$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js": ((exports, module) => {
  1437. const path$9 = __require("path");
  1438. const WIN_SLASH = "\\\\/";
  1439. const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
  1440. /**
  1441. * Posix glob regex
  1442. */
  1443. const DOT_LITERAL = "\\.";
  1444. const PLUS_LITERAL = "\\+";
  1445. const QMARK_LITERAL = "\\?";
  1446. const SLASH_LITERAL = "\\/";
  1447. const ONE_CHAR = "(?=.)";
  1448. const QMARK = "[^/]";
  1449. const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
  1450. const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
  1451. const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
  1452. const POSIX_CHARS = {
  1453. DOT_LITERAL,
  1454. PLUS_LITERAL,
  1455. QMARK_LITERAL,
  1456. SLASH_LITERAL,
  1457. ONE_CHAR,
  1458. QMARK,
  1459. END_ANCHOR,
  1460. DOTS_SLASH,
  1461. NO_DOT: `(?!${DOT_LITERAL})`,
  1462. NO_DOTS: `(?!${START_ANCHOR}${DOTS_SLASH})`,
  1463. NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`,
  1464. NO_DOTS_SLASH: `(?!${DOTS_SLASH})`,
  1465. QMARK_NO_DOT: `[^.${SLASH_LITERAL}]`,
  1466. STAR: `${QMARK}*?`,
  1467. START_ANCHOR
  1468. };
  1469. /**
  1470. * Windows glob regex
  1471. */
  1472. const WINDOWS_CHARS = {
  1473. ...POSIX_CHARS,
  1474. SLASH_LITERAL: `[${WIN_SLASH}]`,
  1475. QMARK: WIN_NO_SLASH,
  1476. STAR: `${WIN_NO_SLASH}*?`,
  1477. DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
  1478. NO_DOT: `(?!${DOT_LITERAL})`,
  1479. NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
  1480. NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
  1481. NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
  1482. QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
  1483. START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
  1484. END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
  1485. };
  1486. /**
  1487. * POSIX Bracket Regex
  1488. */
  1489. const POSIX_REGEX_SOURCE$1 = {
  1490. alnum: "a-zA-Z0-9",
  1491. alpha: "a-zA-Z",
  1492. ascii: "\\x00-\\x7F",
  1493. blank: " \\t",
  1494. cntrl: "\\x00-\\x1F\\x7F",
  1495. digit: "0-9",
  1496. graph: "\\x21-\\x7E",
  1497. lower: "a-z",
  1498. print: "\\x20-\\x7E ",
  1499. punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
  1500. space: " \\t\\r\\n\\v\\f",
  1501. upper: "A-Z",
  1502. word: "A-Za-z0-9_",
  1503. xdigit: "A-Fa-f0-9"
  1504. };
  1505. module.exports = {
  1506. MAX_LENGTH: 1024 * 64,
  1507. POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1,
  1508. REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
  1509. REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
  1510. REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
  1511. REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
  1512. REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
  1513. REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
  1514. REPLACEMENTS: {
  1515. "***": "*",
  1516. "**/**": "**",
  1517. "**/**/**": "**"
  1518. },
  1519. CHAR_0: 48,
  1520. CHAR_9: 57,
  1521. CHAR_UPPERCASE_A: 65,
  1522. CHAR_LOWERCASE_A: 97,
  1523. CHAR_UPPERCASE_Z: 90,
  1524. CHAR_LOWERCASE_Z: 122,
  1525. CHAR_LEFT_PARENTHESES: 40,
  1526. CHAR_RIGHT_PARENTHESES: 41,
  1527. CHAR_ASTERISK: 42,
  1528. CHAR_AMPERSAND: 38,
  1529. CHAR_AT: 64,
  1530. CHAR_BACKWARD_SLASH: 92,
  1531. CHAR_CARRIAGE_RETURN: 13,
  1532. CHAR_CIRCUMFLEX_ACCENT: 94,
  1533. CHAR_COLON: 58,
  1534. CHAR_COMMA: 44,
  1535. CHAR_DOT: 46,
  1536. CHAR_DOUBLE_QUOTE: 34,
  1537. CHAR_EQUAL: 61,
  1538. CHAR_EXCLAMATION_MARK: 33,
  1539. CHAR_FORM_FEED: 12,
  1540. CHAR_FORWARD_SLASH: 47,
  1541. CHAR_GRAVE_ACCENT: 96,
  1542. CHAR_HASH: 35,
  1543. CHAR_HYPHEN_MINUS: 45,
  1544. CHAR_LEFT_ANGLE_BRACKET: 60,
  1545. CHAR_LEFT_CURLY_BRACE: 123,
  1546. CHAR_LEFT_SQUARE_BRACKET: 91,
  1547. CHAR_LINE_FEED: 10,
  1548. CHAR_NO_BREAK_SPACE: 160,
  1549. CHAR_PERCENT: 37,
  1550. CHAR_PLUS: 43,
  1551. CHAR_QUESTION_MARK: 63,
  1552. CHAR_RIGHT_ANGLE_BRACKET: 62,
  1553. CHAR_RIGHT_CURLY_BRACE: 125,
  1554. CHAR_RIGHT_SQUARE_BRACKET: 93,
  1555. CHAR_SEMICOLON: 59,
  1556. CHAR_SINGLE_QUOTE: 39,
  1557. CHAR_SPACE: 32,
  1558. CHAR_TAB: 9,
  1559. CHAR_UNDERSCORE: 95,
  1560. CHAR_VERTICAL_LINE: 124,
  1561. CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
  1562. SEP: path$9.sep,
  1563. extglobChars(chars$1) {
  1564. return {
  1565. "!": {
  1566. type: "negate",
  1567. open: "(?:(?!(?:",
  1568. close: `))${chars$1.STAR})`
  1569. },
  1570. "?": {
  1571. type: "qmark",
  1572. open: "(?:",
  1573. close: ")?"
  1574. },
  1575. "+": {
  1576. type: "plus",
  1577. open: "(?:",
  1578. close: ")+"
  1579. },
  1580. "*": {
  1581. type: "star",
  1582. open: "(?:",
  1583. close: ")*"
  1584. },
  1585. "@": {
  1586. type: "at",
  1587. open: "(?:",
  1588. close: ")"
  1589. }
  1590. };
  1591. },
  1592. globChars(win32$1) {
  1593. return win32$1 === true ? WINDOWS_CHARS : POSIX_CHARS;
  1594. }
  1595. };
  1596. }) });
  1597. //#endregion
  1598. //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js
  1599. var require_utils$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js": ((exports) => {
  1600. const path$8 = __require("path");
  1601. const win32 = process.platform === "win32";
  1602. const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants$1();
  1603. exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
  1604. exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
  1605. exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
  1606. exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
  1607. exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
  1608. exports.removeBackslashes = (str) => {
  1609. return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
  1610. return match === "\\" ? "" : match;
  1611. });
  1612. };
  1613. exports.supportsLookbehinds = () => {
  1614. const segs = process.version.slice(1).split(".").map(Number);
  1615. if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) return true;
  1616. return false;
  1617. };
  1618. exports.isWindows = (options$1) => {
  1619. if (options$1 && typeof options$1.windows === "boolean") return options$1.windows;
  1620. return win32 === true || path$8.sep === "\\";
  1621. };
  1622. exports.escapeLast = (input, char, lastIdx) => {
  1623. const idx = input.lastIndexOf(char, lastIdx);
  1624. if (idx === -1) return input;
  1625. if (input[idx - 1] === "\\") return exports.escapeLast(input, char, idx - 1);
  1626. return `${input.slice(0, idx)}\\${input.slice(idx)}`;
  1627. };
  1628. exports.removePrefix = (input, state = {}) => {
  1629. let output = input;
  1630. if (output.startsWith("./")) {
  1631. output = output.slice(2);
  1632. state.prefix = "./";
  1633. }
  1634. return output;
  1635. };
  1636. exports.wrapOutput = (input, state = {}, options$1 = {}) => {
  1637. let output = `${options$1.contains ? "" : "^"}(?:${input})${options$1.contains ? "" : "$"}`;
  1638. if (state.negated === true) output = `(?:^(?!${output}).*$)`;
  1639. return output;
  1640. };
  1641. }) });
  1642. //#endregion
  1643. //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/scan.js
  1644. var require_scan = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/scan.js": ((exports, module) => {
  1645. const utils$13 = require_utils$2();
  1646. const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants$1();
  1647. const isPathSeparator = (code) => {
  1648. return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
  1649. };
  1650. const depth = (token) => {
  1651. if (token.isPrefix !== true) token.depth = token.isGlobstar ? Infinity : 1;
  1652. };
  1653. /**
  1654. * Quickly scans a glob pattern and returns an object with a handful of
  1655. * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
  1656. * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
  1657. * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
  1658. *
  1659. * ```js
  1660. * const pm = require('picomatch');
  1661. * console.log(pm.scan('foo/bar/*.js'));
  1662. * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
  1663. * ```
  1664. * @param {String} `str`
  1665. * @param {Object} `options`
  1666. * @return {Object} Returns an object with tokens and regex source string.
  1667. * @api public
  1668. */
  1669. const scan$1 = (input, options$1) => {
  1670. const opts = options$1 || {};
  1671. const length = input.length - 1;
  1672. const scanToEnd = opts.parts === true || opts.scanToEnd === true;
  1673. const slashes = [];
  1674. const tokens = [];
  1675. const parts = [];
  1676. let str = input;
  1677. let index = -1;
  1678. let start = 0;
  1679. let lastIndex = 0;
  1680. let isBrace = false;
  1681. let isBracket = false;
  1682. let isGlob$1 = false;
  1683. let isExtglob$1 = false;
  1684. let isGlobstar = false;
  1685. let braceEscaped = false;
  1686. let backslashes = false;
  1687. let negated = false;
  1688. let negatedExtglob = false;
  1689. let finished = false;
  1690. let braces$2 = 0;
  1691. let prev;
  1692. let code;
  1693. let token = {
  1694. value: "",
  1695. depth: 0,
  1696. isGlob: false
  1697. };
  1698. const eos = () => index >= length;
  1699. const peek = () => str.charCodeAt(index + 1);
  1700. const advance = () => {
  1701. prev = code;
  1702. return str.charCodeAt(++index);
  1703. };
  1704. while (index < length) {
  1705. code = advance();
  1706. let next;
  1707. if (code === CHAR_BACKWARD_SLASH) {
  1708. backslashes = token.backslashes = true;
  1709. code = advance();
  1710. if (code === CHAR_LEFT_CURLY_BRACE) braceEscaped = true;
  1711. continue;
  1712. }
  1713. if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
  1714. braces$2++;
  1715. while (eos() !== true && (code = advance())) {
  1716. if (code === CHAR_BACKWARD_SLASH) {
  1717. backslashes = token.backslashes = true;
  1718. advance();
  1719. continue;
  1720. }
  1721. if (code === CHAR_LEFT_CURLY_BRACE) {
  1722. braces$2++;
  1723. continue;
  1724. }
  1725. if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
  1726. isBrace = token.isBrace = true;
  1727. isGlob$1 = token.isGlob = true;
  1728. finished = true;
  1729. if (scanToEnd === true) continue;
  1730. break;
  1731. }
  1732. if (braceEscaped !== true && code === CHAR_COMMA) {
  1733. isBrace = token.isBrace = true;
  1734. isGlob$1 = token.isGlob = true;
  1735. finished = true;
  1736. if (scanToEnd === true) continue;
  1737. break;
  1738. }
  1739. if (code === CHAR_RIGHT_CURLY_BRACE) {
  1740. braces$2--;
  1741. if (braces$2 === 0) {
  1742. braceEscaped = false;
  1743. isBrace = token.isBrace = true;
  1744. finished = true;
  1745. break;
  1746. }
  1747. }
  1748. }
  1749. if (scanToEnd === true) continue;
  1750. break;
  1751. }
  1752. if (code === CHAR_FORWARD_SLASH) {
  1753. slashes.push(index);
  1754. tokens.push(token);
  1755. token = {
  1756. value: "",
  1757. depth: 0,
  1758. isGlob: false
  1759. };
  1760. if (finished === true) continue;
  1761. if (prev === CHAR_DOT && index === start + 1) {
  1762. start += 2;
  1763. continue;
  1764. }
  1765. lastIndex = index + 1;
  1766. continue;
  1767. }
  1768. if (opts.noext !== true) {
  1769. if ((code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK) === true && peek() === CHAR_LEFT_PARENTHESES) {
  1770. isGlob$1 = token.isGlob = true;
  1771. isExtglob$1 = token.isExtglob = true;
  1772. finished = true;
  1773. if (code === CHAR_EXCLAMATION_MARK && index === start) negatedExtglob = true;
  1774. if (scanToEnd === true) {
  1775. while (eos() !== true && (code = advance())) {
  1776. if (code === CHAR_BACKWARD_SLASH) {
  1777. backslashes = token.backslashes = true;
  1778. code = advance();
  1779. continue;
  1780. }
  1781. if (code === CHAR_RIGHT_PARENTHESES) {
  1782. isGlob$1 = token.isGlob = true;
  1783. finished = true;
  1784. break;
  1785. }
  1786. }
  1787. continue;
  1788. }
  1789. break;
  1790. }
  1791. }
  1792. if (code === CHAR_ASTERISK) {
  1793. if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
  1794. isGlob$1 = token.isGlob = true;
  1795. finished = true;
  1796. if (scanToEnd === true) continue;
  1797. break;
  1798. }
  1799. if (code === CHAR_QUESTION_MARK) {
  1800. isGlob$1 = token.isGlob = true;
  1801. finished = true;
  1802. if (scanToEnd === true) continue;
  1803. break;
  1804. }
  1805. if (code === CHAR_LEFT_SQUARE_BRACKET) {
  1806. while (eos() !== true && (next = advance())) {
  1807. if (next === CHAR_BACKWARD_SLASH) {
  1808. backslashes = token.backslashes = true;
  1809. advance();
  1810. continue;
  1811. }
  1812. if (next === CHAR_RIGHT_SQUARE_BRACKET) {
  1813. isBracket = token.isBracket = true;
  1814. isGlob$1 = token.isGlob = true;
  1815. finished = true;
  1816. break;
  1817. }
  1818. }
  1819. if (scanToEnd === true) continue;
  1820. break;
  1821. }
  1822. if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
  1823. negated = token.negated = true;
  1824. start++;
  1825. continue;
  1826. }
  1827. if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
  1828. isGlob$1 = token.isGlob = true;
  1829. if (scanToEnd === true) {
  1830. while (eos() !== true && (code = advance())) {
  1831. if (code === CHAR_LEFT_PARENTHESES) {
  1832. backslashes = token.backslashes = true;
  1833. code = advance();
  1834. continue;
  1835. }
  1836. if (code === CHAR_RIGHT_PARENTHESES) {
  1837. finished = true;
  1838. break;
  1839. }
  1840. }
  1841. continue;
  1842. }
  1843. break;
  1844. }
  1845. if (isGlob$1 === true) {
  1846. finished = true;
  1847. if (scanToEnd === true) continue;
  1848. break;
  1849. }
  1850. }
  1851. if (opts.noext === true) {
  1852. isExtglob$1 = false;
  1853. isGlob$1 = false;
  1854. }
  1855. let base = str;
  1856. let prefix = "";
  1857. let glob = "";
  1858. if (start > 0) {
  1859. prefix = str.slice(0, start);
  1860. str = str.slice(start);
  1861. lastIndex -= start;
  1862. }
  1863. if (base && isGlob$1 === true && lastIndex > 0) {
  1864. base = str.slice(0, lastIndex);
  1865. glob = str.slice(lastIndex);
  1866. } else if (isGlob$1 === true) {
  1867. base = "";
  1868. glob = str;
  1869. } else base = str;
  1870. if (base && base !== "" && base !== "/" && base !== str) {
  1871. if (isPathSeparator(base.charCodeAt(base.length - 1))) base = base.slice(0, -1);
  1872. }
  1873. if (opts.unescape === true) {
  1874. if (glob) glob = utils$13.removeBackslashes(glob);
  1875. if (base && backslashes === true) base = utils$13.removeBackslashes(base);
  1876. }
  1877. const state = {
  1878. prefix,
  1879. input,
  1880. start,
  1881. base,
  1882. glob,
  1883. isBrace,
  1884. isBracket,
  1885. isGlob: isGlob$1,
  1886. isExtglob: isExtglob$1,
  1887. isGlobstar,
  1888. negated,
  1889. negatedExtglob
  1890. };
  1891. if (opts.tokens === true) {
  1892. state.maxDepth = 0;
  1893. if (!isPathSeparator(code)) tokens.push(token);
  1894. state.tokens = tokens;
  1895. }
  1896. if (opts.parts === true || opts.tokens === true) {
  1897. let prevIndex;
  1898. for (let idx = 0; idx < slashes.length; idx++) {
  1899. const n = prevIndex ? prevIndex + 1 : start;
  1900. const i = slashes[idx];
  1901. const value = input.slice(n, i);
  1902. if (opts.tokens) {
  1903. if (idx === 0 && start !== 0) {
  1904. tokens[idx].isPrefix = true;
  1905. tokens[idx].value = prefix;
  1906. } else tokens[idx].value = value;
  1907. depth(tokens[idx]);
  1908. state.maxDepth += tokens[idx].depth;
  1909. }
  1910. if (idx !== 0 || value !== "") parts.push(value);
  1911. prevIndex = i;
  1912. }
  1913. if (prevIndex && prevIndex + 1 < input.length) {
  1914. const value = input.slice(prevIndex + 1);
  1915. parts.push(value);
  1916. if (opts.tokens) {
  1917. tokens[tokens.length - 1].value = value;
  1918. depth(tokens[tokens.length - 1]);
  1919. state.maxDepth += tokens[tokens.length - 1].depth;
  1920. }
  1921. }
  1922. state.slashes = slashes;
  1923. state.parts = parts;
  1924. }
  1925. return state;
  1926. };
  1927. module.exports = scan$1;
  1928. }) });
  1929. //#endregion
  1930. //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.js
  1931. var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.js": ((exports, module) => {
  1932. const constants$1 = require_constants$1();
  1933. const utils$12 = require_utils$2();
  1934. /**
  1935. * Constants
  1936. */
  1937. const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants$1;
  1938. /**
  1939. * Helpers
  1940. */
  1941. const expandRange = (args, options$1) => {
  1942. if (typeof options$1.expandRange === "function") return options$1.expandRange(...args, options$1);
  1943. args.sort();
  1944. const value = `[${args.join("-")}]`;
  1945. try {
  1946. new RegExp(value);
  1947. } catch (ex) {
  1948. return args.map((v) => utils$12.escapeRegex(v)).join("..");
  1949. }
  1950. return value;
  1951. };
  1952. /**
  1953. * Create the message for a syntax error
  1954. */
  1955. const syntaxError = (type, char) => {
  1956. return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
  1957. };
  1958. /**
  1959. * Parse the given input string.
  1960. * @param {String} input
  1961. * @param {Object} options
  1962. * @return {Object}
  1963. */
  1964. const parse$1 = (input, options$1) => {
  1965. if (typeof input !== "string") throw new TypeError("Expected a string");
  1966. input = REPLACEMENTS[input] || input;
  1967. const opts = { ...options$1 };
  1968. const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
  1969. let len = input.length;
  1970. if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
  1971. const bos = {
  1972. type: "bos",
  1973. value: "",
  1974. output: opts.prepend || ""
  1975. };
  1976. const tokens = [bos];
  1977. const capture = opts.capture ? "" : "?:";
  1978. const win32$1 = utils$12.isWindows(options$1);
  1979. const PLATFORM_CHARS = constants$1.globChars(win32$1);
  1980. const EXTGLOB_CHARS = constants$1.extglobChars(PLATFORM_CHARS);
  1981. const { DOT_LITERAL: DOT_LITERAL$1, PLUS_LITERAL: PLUS_LITERAL$1, SLASH_LITERAL: SLASH_LITERAL$1, ONE_CHAR: ONE_CHAR$1, DOTS_SLASH: DOTS_SLASH$1, NO_DOT, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK: QMARK$1, QMARK_NO_DOT, STAR, START_ANCHOR: START_ANCHOR$1 } = PLATFORM_CHARS;
  1982. const globstar = (opts$1) => {
  1983. return `(${capture}(?:(?!${START_ANCHOR$1}${opts$1.dot ? DOTS_SLASH$1 : DOT_LITERAL$1}).)*?)`;
  1984. };
  1985. const nodot = opts.dot ? "" : NO_DOT;
  1986. const qmarkNoDot = opts.dot ? QMARK$1 : QMARK_NO_DOT;
  1987. let star = opts.bash === true ? globstar(opts) : STAR;
  1988. if (opts.capture) star = `(${star})`;
  1989. if (typeof opts.noext === "boolean") opts.noextglob = opts.noext;
  1990. const state = {
  1991. input,
  1992. index: -1,
  1993. start: 0,
  1994. dot: opts.dot === true,
  1995. consumed: "",
  1996. output: "",
  1997. prefix: "",
  1998. backtrack: false,
  1999. negated: false,
  2000. brackets: 0,
  2001. braces: 0,
  2002. parens: 0,
  2003. quotes: 0,
  2004. globstar: false,
  2005. tokens
  2006. };
  2007. input = utils$12.removePrefix(input, state);
  2008. len = input.length;
  2009. const extglobs = [];
  2010. const braces$2 = [];
  2011. const stack = [];
  2012. let prev = bos;
  2013. let value;
  2014. /**
  2015. * Tokenizing helpers
  2016. */
  2017. const eos = () => state.index === len - 1;
  2018. const peek = state.peek = (n = 1) => input[state.index + n];
  2019. const advance = state.advance = () => input[++state.index] || "";
  2020. const remaining = () => input.slice(state.index + 1);
  2021. const consume = (value$1 = "", num = 0) => {
  2022. state.consumed += value$1;
  2023. state.index += num;
  2024. };
  2025. const append$1 = (token) => {
  2026. state.output += token.output != null ? token.output : token.value;
  2027. consume(token.value);
  2028. };
  2029. const negate = () => {
  2030. let count = 1;
  2031. while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
  2032. advance();
  2033. state.start++;
  2034. count++;
  2035. }
  2036. if (count % 2 === 0) return false;
  2037. state.negated = true;
  2038. state.start++;
  2039. return true;
  2040. };
  2041. const increment = (type) => {
  2042. state[type]++;
  2043. stack.push(type);
  2044. };
  2045. const decrement = (type) => {
  2046. state[type]--;
  2047. stack.pop();
  2048. };
  2049. /**
  2050. * Push tokens onto the tokens array. This helper speeds up
  2051. * tokenizing by 1) helping us avoid backtracking as much as possible,
  2052. * and 2) helping us avoid creating extra tokens when consecutive
  2053. * characters are plain text. This improves performance and simplifies
  2054. * lookbehinds.
  2055. */
  2056. const push = (tok) => {
  2057. if (prev.type === "globstar") {
  2058. const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
  2059. const isExtglob$1 = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
  2060. if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob$1) {
  2061. state.output = state.output.slice(0, -prev.output.length);
  2062. prev.type = "star";
  2063. prev.value = "*";
  2064. prev.output = star;
  2065. state.output += prev.output;
  2066. }
  2067. }
  2068. if (extglobs.length && tok.type !== "paren") extglobs[extglobs.length - 1].inner += tok.value;
  2069. if (tok.value || tok.output) append$1(tok);
  2070. if (prev && prev.type === "text" && tok.type === "text") {
  2071. prev.value += tok.value;
  2072. prev.output = (prev.output || "") + tok.value;
  2073. return;
  2074. }
  2075. tok.prev = prev;
  2076. tokens.push(tok);
  2077. prev = tok;
  2078. };
  2079. const extglobOpen = (type, value$1) => {
  2080. const token = {
  2081. ...EXTGLOB_CHARS[value$1],
  2082. conditions: 1,
  2083. inner: ""
  2084. };
  2085. token.prev = prev;
  2086. token.parens = state.parens;
  2087. token.output = state.output;
  2088. const output = (opts.capture ? "(" : "") + token.open;
  2089. increment("parens");
  2090. push({
  2091. type,
  2092. value: value$1,
  2093. output: state.output ? "" : ONE_CHAR$1
  2094. });
  2095. push({
  2096. type: "paren",
  2097. extglob: true,
  2098. value: advance(),
  2099. output
  2100. });
  2101. extglobs.push(token);
  2102. };
  2103. const extglobClose = (token) => {
  2104. let output = token.close + (opts.capture ? ")" : "");
  2105. let rest;
  2106. if (token.type === "negate") {
  2107. let extglobStar = star;
  2108. if (token.inner && token.inner.length > 1 && token.inner.includes("/")) extglobStar = globstar(opts);
  2109. if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) output = token.close = `)$))${extglobStar}`;
  2110. if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) output = token.close = `)${parse$1(rest, {
  2111. ...options$1,
  2112. fastpaths: false
  2113. }).output})${extglobStar})`;
  2114. if (token.prev.type === "bos") state.negatedExtglob = true;
  2115. }
  2116. push({
  2117. type: "paren",
  2118. extglob: true,
  2119. value,
  2120. output
  2121. });
  2122. decrement("parens");
  2123. };
  2124. /**
  2125. * Fast paths
  2126. */
  2127. if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
  2128. let backslashes = false;
  2129. let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars$1, first, rest, index) => {
  2130. if (first === "\\") {
  2131. backslashes = true;
  2132. return m;
  2133. }
  2134. if (first === "?") {
  2135. if (esc) return esc + first + (rest ? QMARK$1.repeat(rest.length) : "");
  2136. if (index === 0) return qmarkNoDot + (rest ? QMARK$1.repeat(rest.length) : "");
  2137. return QMARK$1.repeat(chars$1.length);
  2138. }
  2139. if (first === ".") return DOT_LITERAL$1.repeat(chars$1.length);
  2140. if (first === "*") {
  2141. if (esc) return esc + first + (rest ? star : "");
  2142. return star;
  2143. }
  2144. return esc ? m : `\\${m}`;
  2145. });
  2146. if (backslashes === true) if (opts.unescape === true) output = output.replace(/\\/g, "");
  2147. else output = output.replace(/\\+/g, (m) => {
  2148. return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
  2149. });
  2150. if (output === input && opts.contains === true) {
  2151. state.output = input;
  2152. return state;
  2153. }
  2154. state.output = utils$12.wrapOutput(output, state, options$1);
  2155. return state;
  2156. }
  2157. /**
  2158. * Tokenize input until we reach end-of-string
  2159. */
  2160. while (!eos()) {
  2161. value = advance();
  2162. if (value === "\0") continue;
  2163. /**
  2164. * Escaped characters
  2165. */
  2166. if (value === "\\") {
  2167. const next = peek();
  2168. if (next === "/" && opts.bash !== true) continue;
  2169. if (next === "." || next === ";") continue;
  2170. if (!next) {
  2171. value += "\\";
  2172. push({
  2173. type: "text",
  2174. value
  2175. });
  2176. continue;
  2177. }
  2178. const match = /^\\+/.exec(remaining());
  2179. let slashes = 0;
  2180. if (match && match[0].length > 2) {
  2181. slashes = match[0].length;
  2182. state.index += slashes;
  2183. if (slashes % 2 !== 0) value += "\\";
  2184. }
  2185. if (opts.unescape === true) value = advance();
  2186. else value += advance();
  2187. if (state.brackets === 0) {
  2188. push({
  2189. type: "text",
  2190. value
  2191. });
  2192. continue;
  2193. }
  2194. }
  2195. /**
  2196. * If we're inside a regex character class, continue
  2197. * until we reach the closing bracket.
  2198. */
  2199. if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
  2200. if (opts.posix !== false && value === ":") {
  2201. const inner = prev.value.slice(1);
  2202. if (inner.includes("[")) {
  2203. prev.posix = true;
  2204. if (inner.includes(":")) {
  2205. const idx = prev.value.lastIndexOf("[");
  2206. const pre = prev.value.slice(0, idx);
  2207. const posix = POSIX_REGEX_SOURCE[prev.value.slice(idx + 2)];
  2208. if (posix) {
  2209. prev.value = pre + posix;
  2210. state.backtrack = true;
  2211. advance();
  2212. if (!bos.output && tokens.indexOf(prev) === 1) bos.output = ONE_CHAR$1;
  2213. continue;
  2214. }
  2215. }
  2216. }
  2217. }
  2218. if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") value = `\\${value}`;
  2219. if (value === "]" && (prev.value === "[" || prev.value === "[^")) value = `\\${value}`;
  2220. if (opts.posix === true && value === "!" && prev.value === "[") value = "^";
  2221. prev.value += value;
  2222. append$1({ value });
  2223. continue;
  2224. }
  2225. /**
  2226. * If we're inside a quoted string, continue
  2227. * until we reach the closing double quote.
  2228. */
  2229. if (state.quotes === 1 && value !== "\"") {
  2230. value = utils$12.escapeRegex(value);
  2231. prev.value += value;
  2232. append$1({ value });
  2233. continue;
  2234. }
  2235. /**
  2236. * Double quotes
  2237. */
  2238. if (value === "\"") {
  2239. state.quotes = state.quotes === 1 ? 0 : 1;
  2240. if (opts.keepQuotes === true) push({
  2241. type: "text",
  2242. value
  2243. });
  2244. continue;
  2245. }
  2246. /**
  2247. * Parentheses
  2248. */
  2249. if (value === "(") {
  2250. increment("parens");
  2251. push({
  2252. type: "paren",
  2253. value
  2254. });
  2255. continue;
  2256. }
  2257. if (value === ")") {
  2258. if (state.parens === 0 && opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "("));
  2259. const extglob = extglobs[extglobs.length - 1];
  2260. if (extglob && state.parens === extglob.parens + 1) {
  2261. extglobClose(extglobs.pop());
  2262. continue;
  2263. }
  2264. push({
  2265. type: "paren",
  2266. value,
  2267. output: state.parens ? ")" : "\\)"
  2268. });
  2269. decrement("parens");
  2270. continue;
  2271. }
  2272. /**
  2273. * Square brackets
  2274. */
  2275. if (value === "[") {
  2276. if (opts.nobracket === true || !remaining().includes("]")) {
  2277. if (opts.nobracket !== true && opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
  2278. value = `\\${value}`;
  2279. } else increment("brackets");
  2280. push({
  2281. type: "bracket",
  2282. value
  2283. });
  2284. continue;
  2285. }
  2286. if (value === "]") {
  2287. if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
  2288. push({
  2289. type: "text",
  2290. value,
  2291. output: `\\${value}`
  2292. });
  2293. continue;
  2294. }
  2295. if (state.brackets === 0) {
  2296. if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "["));
  2297. push({
  2298. type: "text",
  2299. value,
  2300. output: `\\${value}`
  2301. });
  2302. continue;
  2303. }
  2304. decrement("brackets");
  2305. const prevValue = prev.value.slice(1);
  2306. if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) value = `/${value}`;
  2307. prev.value += value;
  2308. append$1({ value });
  2309. if (opts.literalBrackets === false || utils$12.hasRegexChars(prevValue)) continue;
  2310. const escaped$1 = utils$12.escapeRegex(prev.value);
  2311. state.output = state.output.slice(0, -prev.value.length);
  2312. if (opts.literalBrackets === true) {
  2313. state.output += escaped$1;
  2314. prev.value = escaped$1;
  2315. continue;
  2316. }
  2317. prev.value = `(${capture}${escaped$1}|${prev.value})`;
  2318. state.output += prev.value;
  2319. continue;
  2320. }
  2321. /**
  2322. * Braces
  2323. */
  2324. if (value === "{" && opts.nobrace !== true) {
  2325. increment("braces");
  2326. const open = {
  2327. type: "brace",
  2328. value,
  2329. output: "(",
  2330. outputIndex: state.output.length,
  2331. tokensIndex: state.tokens.length
  2332. };
  2333. braces$2.push(open);
  2334. push(open);
  2335. continue;
  2336. }
  2337. if (value === "}") {
  2338. const brace = braces$2[braces$2.length - 1];
  2339. if (opts.nobrace === true || !brace) {
  2340. push({
  2341. type: "text",
  2342. value,
  2343. output: value
  2344. });
  2345. continue;
  2346. }
  2347. let output = ")";
  2348. if (brace.dots === true) {
  2349. const arr = tokens.slice();
  2350. const range = [];
  2351. for (let i = arr.length - 1; i >= 0; i--) {
  2352. tokens.pop();
  2353. if (arr[i].type === "brace") break;
  2354. if (arr[i].type !== "dots") range.unshift(arr[i].value);
  2355. }
  2356. output = expandRange(range, opts);
  2357. state.backtrack = true;
  2358. }
  2359. if (brace.comma !== true && brace.dots !== true) {
  2360. const out = state.output.slice(0, brace.outputIndex);
  2361. const toks = state.tokens.slice(brace.tokensIndex);
  2362. brace.value = brace.output = "\\{";
  2363. value = output = "\\}";
  2364. state.output = out;
  2365. for (const t of toks) state.output += t.output || t.value;
  2366. }
  2367. push({
  2368. type: "brace",
  2369. value,
  2370. output
  2371. });
  2372. decrement("braces");
  2373. braces$2.pop();
  2374. continue;
  2375. }
  2376. /**
  2377. * Pipes
  2378. */
  2379. if (value === "|") {
  2380. if (extglobs.length > 0) extglobs[extglobs.length - 1].conditions++;
  2381. push({
  2382. type: "text",
  2383. value
  2384. });
  2385. continue;
  2386. }
  2387. /**
  2388. * Commas
  2389. */
  2390. if (value === ",") {
  2391. let output = value;
  2392. const brace = braces$2[braces$2.length - 1];
  2393. if (brace && stack[stack.length - 1] === "braces") {
  2394. brace.comma = true;
  2395. output = "|";
  2396. }
  2397. push({
  2398. type: "comma",
  2399. value,
  2400. output
  2401. });
  2402. continue;
  2403. }
  2404. /**
  2405. * Slashes
  2406. */
  2407. if (value === "/") {
  2408. if (prev.type === "dot" && state.index === state.start + 1) {
  2409. state.start = state.index + 1;
  2410. state.consumed = "";
  2411. state.output = "";
  2412. tokens.pop();
  2413. prev = bos;
  2414. continue;
  2415. }
  2416. push({
  2417. type: "slash",
  2418. value,
  2419. output: SLASH_LITERAL$1
  2420. });
  2421. continue;
  2422. }
  2423. /**
  2424. * Dots
  2425. */
  2426. if (value === ".") {
  2427. if (state.braces > 0 && prev.type === "dot") {
  2428. if (prev.value === ".") prev.output = DOT_LITERAL$1;
  2429. const brace = braces$2[braces$2.length - 1];
  2430. prev.type = "dots";
  2431. prev.output += value;
  2432. prev.value += value;
  2433. brace.dots = true;
  2434. continue;
  2435. }
  2436. if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
  2437. push({
  2438. type: "text",
  2439. value,
  2440. output: DOT_LITERAL$1
  2441. });
  2442. continue;
  2443. }
  2444. push({
  2445. type: "dot",
  2446. value,
  2447. output: DOT_LITERAL$1
  2448. });
  2449. continue;
  2450. }
  2451. /**
  2452. * Question marks
  2453. */
  2454. if (value === "?") {
  2455. if (!(prev && prev.value === "(") && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
  2456. extglobOpen("qmark", value);
  2457. continue;
  2458. }
  2459. if (prev && prev.type === "paren") {
  2460. const next = peek();
  2461. let output = value;
  2462. if (next === "<" && !utils$12.supportsLookbehinds()) throw new Error("Node.js v10 or higher is required for regex lookbehinds");
  2463. if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) output = `\\${value}`;
  2464. push({
  2465. type: "text",
  2466. value,
  2467. output
  2468. });
  2469. continue;
  2470. }
  2471. if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
  2472. push({
  2473. type: "qmark",
  2474. value,
  2475. output: QMARK_NO_DOT
  2476. });
  2477. continue;
  2478. }
  2479. push({
  2480. type: "qmark",
  2481. value,
  2482. output: QMARK$1
  2483. });
  2484. continue;
  2485. }
  2486. /**
  2487. * Exclamation
  2488. */
  2489. if (value === "!") {
  2490. if (opts.noextglob !== true && peek() === "(") {
  2491. if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
  2492. extglobOpen("negate", value);
  2493. continue;
  2494. }
  2495. }
  2496. if (opts.nonegate !== true && state.index === 0) {
  2497. negate();
  2498. continue;
  2499. }
  2500. }
  2501. /**
  2502. * Plus
  2503. */
  2504. if (value === "+") {
  2505. if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
  2506. extglobOpen("plus", value);
  2507. continue;
  2508. }
  2509. if (prev && prev.value === "(" || opts.regex === false) {
  2510. push({
  2511. type: "plus",
  2512. value,
  2513. output: PLUS_LITERAL$1
  2514. });
  2515. continue;
  2516. }
  2517. if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
  2518. push({
  2519. type: "plus",
  2520. value
  2521. });
  2522. continue;
  2523. }
  2524. push({
  2525. type: "plus",
  2526. value: PLUS_LITERAL$1
  2527. });
  2528. continue;
  2529. }
  2530. /**
  2531. * Plain text
  2532. */
  2533. if (value === "@") {
  2534. if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
  2535. push({
  2536. type: "at",
  2537. extglob: true,
  2538. value,
  2539. output: ""
  2540. });
  2541. continue;
  2542. }
  2543. push({
  2544. type: "text",
  2545. value
  2546. });
  2547. continue;
  2548. }
  2549. /**
  2550. * Plain text
  2551. */
  2552. if (value !== "*") {
  2553. if (value === "$" || value === "^") value = `\\${value}`;
  2554. const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
  2555. if (match) {
  2556. value += match[0];
  2557. state.index += match[0].length;
  2558. }
  2559. push({
  2560. type: "text",
  2561. value
  2562. });
  2563. continue;
  2564. }
  2565. /**
  2566. * Stars
  2567. */
  2568. if (prev && (prev.type === "globstar" || prev.star === true)) {
  2569. prev.type = "star";
  2570. prev.star = true;
  2571. prev.value += value;
  2572. prev.output = star;
  2573. state.backtrack = true;
  2574. state.globstar = true;
  2575. consume(value);
  2576. continue;
  2577. }
  2578. let rest = remaining();
  2579. if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
  2580. extglobOpen("star", value);
  2581. continue;
  2582. }
  2583. if (prev.type === "star") {
  2584. if (opts.noglobstar === true) {
  2585. consume(value);
  2586. continue;
  2587. }
  2588. const prior = prev.prev;
  2589. const before = prior.prev;
  2590. const isStart = prior.type === "slash" || prior.type === "bos";
  2591. const afterStar = before && (before.type === "star" || before.type === "globstar");
  2592. if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
  2593. push({
  2594. type: "star",
  2595. value,
  2596. output: ""
  2597. });
  2598. continue;
  2599. }
  2600. const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
  2601. const isExtglob$1 = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
  2602. if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob$1) {
  2603. push({
  2604. type: "star",
  2605. value,
  2606. output: ""
  2607. });
  2608. continue;
  2609. }
  2610. while (rest.slice(0, 3) === "/**") {
  2611. const after = input[state.index + 4];
  2612. if (after && after !== "/") break;
  2613. rest = rest.slice(3);
  2614. consume("/**", 3);
  2615. }
  2616. if (prior.type === "bos" && eos()) {
  2617. prev.type = "globstar";
  2618. prev.value += value;
  2619. prev.output = globstar(opts);
  2620. state.output = prev.output;
  2621. state.globstar = true;
  2622. consume(value);
  2623. continue;
  2624. }
  2625. if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
  2626. state.output = state.output.slice(0, -(prior.output + prev.output).length);
  2627. prior.output = `(?:${prior.output}`;
  2628. prev.type = "globstar";
  2629. prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
  2630. prev.value += value;
  2631. state.globstar = true;
  2632. state.output += prior.output + prev.output;
  2633. consume(value);
  2634. continue;
  2635. }
  2636. if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
  2637. const end = rest[1] !== void 0 ? "|$" : "";
  2638. state.output = state.output.slice(0, -(prior.output + prev.output).length);
  2639. prior.output = `(?:${prior.output}`;
  2640. prev.type = "globstar";
  2641. prev.output = `${globstar(opts)}${SLASH_LITERAL$1}|${SLASH_LITERAL$1}${end})`;
  2642. prev.value += value;
  2643. state.output += prior.output + prev.output;
  2644. state.globstar = true;
  2645. consume(value + advance());
  2646. push({
  2647. type: "slash",
  2648. value: "/",
  2649. output: ""
  2650. });
  2651. continue;
  2652. }
  2653. if (prior.type === "bos" && rest[0] === "/") {
  2654. prev.type = "globstar";
  2655. prev.value += value;
  2656. prev.output = `(?:^|${SLASH_LITERAL$1}|${globstar(opts)}${SLASH_LITERAL$1})`;
  2657. state.output = prev.output;
  2658. state.globstar = true;
  2659. consume(value + advance());
  2660. push({
  2661. type: "slash",
  2662. value: "/",
  2663. output: ""
  2664. });
  2665. continue;
  2666. }
  2667. state.output = state.output.slice(0, -prev.output.length);
  2668. prev.type = "globstar";
  2669. prev.output = globstar(opts);
  2670. prev.value += value;
  2671. state.output += prev.output;
  2672. state.globstar = true;
  2673. consume(value);
  2674. continue;
  2675. }
  2676. const token = {
  2677. type: "star",
  2678. value,
  2679. output: star
  2680. };
  2681. if (opts.bash === true) {
  2682. token.output = ".*?";
  2683. if (prev.type === "bos" || prev.type === "slash") token.output = nodot + token.output;
  2684. push(token);
  2685. continue;
  2686. }
  2687. if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
  2688. token.output = value;
  2689. push(token);
  2690. continue;
  2691. }
  2692. if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
  2693. if (prev.type === "dot") {
  2694. state.output += NO_DOT_SLASH;
  2695. prev.output += NO_DOT_SLASH;
  2696. } else if (opts.dot === true) {
  2697. state.output += NO_DOTS_SLASH;
  2698. prev.output += NO_DOTS_SLASH;
  2699. } else {
  2700. state.output += nodot;
  2701. prev.output += nodot;
  2702. }
  2703. if (peek() !== "*") {
  2704. state.output += ONE_CHAR$1;
  2705. prev.output += ONE_CHAR$1;
  2706. }
  2707. }
  2708. push(token);
  2709. }
  2710. while (state.brackets > 0) {
  2711. if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
  2712. state.output = utils$12.escapeLast(state.output, "[");
  2713. decrement("brackets");
  2714. }
  2715. while (state.parens > 0) {
  2716. if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", ")"));
  2717. state.output = utils$12.escapeLast(state.output, "(");
  2718. decrement("parens");
  2719. }
  2720. while (state.braces > 0) {
  2721. if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "}"));
  2722. state.output = utils$12.escapeLast(state.output, "{");
  2723. decrement("braces");
  2724. }
  2725. if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) push({
  2726. type: "maybe_slash",
  2727. value: "",
  2728. output: `${SLASH_LITERAL$1}?`
  2729. });
  2730. if (state.backtrack === true) {
  2731. state.output = "";
  2732. for (const token of state.tokens) {
  2733. state.output += token.output != null ? token.output : token.value;
  2734. if (token.suffix) state.output += token.suffix;
  2735. }
  2736. }
  2737. return state;
  2738. };
  2739. /**
  2740. * Fast paths for creating regular expressions for common glob patterns.
  2741. * This can significantly speed up processing and has very little downside
  2742. * impact when none of the fast paths match.
  2743. */
  2744. parse$1.fastpaths = (input, options$1) => {
  2745. const opts = { ...options$1 };
  2746. const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
  2747. const len = input.length;
  2748. if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
  2749. input = REPLACEMENTS[input] || input;
  2750. const win32$1 = utils$12.isWindows(options$1);
  2751. const { DOT_LITERAL: DOT_LITERAL$1, SLASH_LITERAL: SLASH_LITERAL$1, ONE_CHAR: ONE_CHAR$1, DOTS_SLASH: DOTS_SLASH$1, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR: START_ANCHOR$1 } = constants$1.globChars(win32$1);
  2752. const nodot = opts.dot ? NO_DOTS : NO_DOT;
  2753. const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
  2754. const capture = opts.capture ? "" : "?:";
  2755. const state = {
  2756. negated: false,
  2757. prefix: ""
  2758. };
  2759. let star = opts.bash === true ? ".*?" : STAR;
  2760. if (opts.capture) star = `(${star})`;
  2761. const globstar = (opts$1) => {
  2762. if (opts$1.noglobstar === true) return star;
  2763. return `(${capture}(?:(?!${START_ANCHOR$1}${opts$1.dot ? DOTS_SLASH$1 : DOT_LITERAL$1}).)*?)`;
  2764. };
  2765. const create = (str) => {
  2766. switch (str) {
  2767. case "*": return `${nodot}${ONE_CHAR$1}${star}`;
  2768. case ".*": return `${DOT_LITERAL$1}${ONE_CHAR$1}${star}`;
  2769. case "*.*": return `${nodot}${star}${DOT_LITERAL$1}${ONE_CHAR$1}${star}`;
  2770. case "*/*": return `${nodot}${star}${SLASH_LITERAL$1}${ONE_CHAR$1}${slashDot}${star}`;
  2771. case "**": return nodot + globstar(opts);
  2772. case "**/*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL$1})?${slashDot}${ONE_CHAR$1}${star}`;
  2773. case "**/*.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL$1})?${slashDot}${star}${DOT_LITERAL$1}${ONE_CHAR$1}${star}`;
  2774. case "**/.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL$1})?${DOT_LITERAL$1}${ONE_CHAR$1}${star}`;
  2775. default: {
  2776. const match = /^(.*?)\.(\w+)$/.exec(str);
  2777. if (!match) return;
  2778. const source$1 = create(match[1]);
  2779. if (!source$1) return;
  2780. return source$1 + DOT_LITERAL$1 + match[2];
  2781. }
  2782. }
  2783. };
  2784. let source = create(utils$12.removePrefix(input, state));
  2785. if (source && opts.strictSlashes !== true) source += `${SLASH_LITERAL$1}?`;
  2786. return source;
  2787. };
  2788. module.exports = parse$1;
  2789. }) });
  2790. //#endregion
  2791. //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js
  2792. var require_picomatch$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js": ((exports, module) => {
  2793. const path$7 = __require("path");
  2794. const scan = require_scan();
  2795. const parse = require_parse();
  2796. const utils$11 = require_utils$2();
  2797. const constants = require_constants$1();
  2798. const isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
  2799. /**
  2800. * Creates a matcher function from one or more glob patterns. The
  2801. * returned function takes a string to match as its first argument,
  2802. * and returns true if the string is a match. The returned matcher
  2803. * function also takes a boolean as the second argument that, when true,
  2804. * returns an object with additional information.
  2805. *
  2806. * ```js
  2807. * const picomatch = require('picomatch');
  2808. * // picomatch(glob[, options]);
  2809. *
  2810. * const isMatch = picomatch('*.!(*a)');
  2811. * console.log(isMatch('a.a')); //=> false
  2812. * console.log(isMatch('a.b')); //=> true
  2813. * ```
  2814. * @name picomatch
  2815. * @param {String|Array} `globs` One or more glob patterns.
  2816. * @param {Object=} `options`
  2817. * @return {Function=} Returns a matcher function.
  2818. * @api public
  2819. */
  2820. const picomatch$1 = (glob, options$1, returnState = false) => {
  2821. if (Array.isArray(glob)) {
  2822. const fns = glob.map((input) => picomatch$1(input, options$1, returnState));
  2823. const arrayMatcher = (str) => {
  2824. for (const isMatch of fns) {
  2825. const state$1 = isMatch(str);
  2826. if (state$1) return state$1;
  2827. }
  2828. return false;
  2829. };
  2830. return arrayMatcher;
  2831. }
  2832. const isState = isObject(glob) && glob.tokens && glob.input;
  2833. if (glob === "" || typeof glob !== "string" && !isState) throw new TypeError("Expected pattern to be a non-empty string");
  2834. const opts = options$1 || {};
  2835. const posix = utils$11.isWindows(options$1);
  2836. const regex = isState ? picomatch$1.compileRe(glob, options$1) : picomatch$1.makeRe(glob, options$1, false, true);
  2837. const state = regex.state;
  2838. delete regex.state;
  2839. let isIgnored = () => false;
  2840. if (opts.ignore) {
  2841. const ignoreOpts = {
  2842. ...options$1,
  2843. ignore: null,
  2844. onMatch: null,
  2845. onResult: null
  2846. };
  2847. isIgnored = picomatch$1(opts.ignore, ignoreOpts, returnState);
  2848. }
  2849. const matcher = (input, returnObject = false) => {
  2850. const { isMatch, match, output } = picomatch$1.test(input, regex, options$1, {
  2851. glob,
  2852. posix
  2853. });
  2854. const result = {
  2855. glob,
  2856. state,
  2857. regex,
  2858. posix,
  2859. input,
  2860. output,
  2861. match,
  2862. isMatch
  2863. };
  2864. if (typeof opts.onResult === "function") opts.onResult(result);
  2865. if (isMatch === false) {
  2866. result.isMatch = false;
  2867. return returnObject ? result : false;
  2868. }
  2869. if (isIgnored(input)) {
  2870. if (typeof opts.onIgnore === "function") opts.onIgnore(result);
  2871. result.isMatch = false;
  2872. return returnObject ? result : false;
  2873. }
  2874. if (typeof opts.onMatch === "function") opts.onMatch(result);
  2875. return returnObject ? result : true;
  2876. };
  2877. if (returnState) matcher.state = state;
  2878. return matcher;
  2879. };
  2880. /**
  2881. * Test `input` with the given `regex`. This is used by the main
  2882. * `picomatch()` function to test the input string.
  2883. *
  2884. * ```js
  2885. * const picomatch = require('picomatch');
  2886. * // picomatch.test(input, regex[, options]);
  2887. *
  2888. * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
  2889. * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
  2890. * ```
  2891. * @param {String} `input` String to test.
  2892. * @param {RegExp} `regex`
  2893. * @return {Object} Returns an object with matching info.
  2894. * @api public
  2895. */
  2896. picomatch$1.test = (input, regex, options$1, { glob, posix } = {}) => {
  2897. if (typeof input !== "string") throw new TypeError("Expected input to be a string");
  2898. if (input === "") return {
  2899. isMatch: false,
  2900. output: ""
  2901. };
  2902. const opts = options$1 || {};
  2903. const format = opts.format || (posix ? utils$11.toPosixSlashes : null);
  2904. let match = input === glob;
  2905. let output = match && format ? format(input) : input;
  2906. if (match === false) {
  2907. output = format ? format(input) : input;
  2908. match = output === glob;
  2909. }
  2910. if (match === false || opts.capture === true) if (opts.matchBase === true || opts.basename === true) match = picomatch$1.matchBase(input, regex, options$1, posix);
  2911. else match = regex.exec(output);
  2912. return {
  2913. isMatch: Boolean(match),
  2914. match,
  2915. output
  2916. };
  2917. };
  2918. /**
  2919. * Match the basename of a filepath.
  2920. *
  2921. * ```js
  2922. * const picomatch = require('picomatch');
  2923. * // picomatch.matchBase(input, glob[, options]);
  2924. * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
  2925. * ```
  2926. * @param {String} `input` String to test.
  2927. * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
  2928. * @return {Boolean}
  2929. * @api public
  2930. */
  2931. picomatch$1.matchBase = (input, glob, options$1, posix = utils$11.isWindows(options$1)) => {
  2932. return (glob instanceof RegExp ? glob : picomatch$1.makeRe(glob, options$1)).test(path$7.basename(input));
  2933. };
  2934. /**
  2935. * Returns true if **any** of the given glob `patterns` match the specified `string`.
  2936. *
  2937. * ```js
  2938. * const picomatch = require('picomatch');
  2939. * // picomatch.isMatch(string, patterns[, options]);
  2940. *
  2941. * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
  2942. * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
  2943. * ```
  2944. * @param {String|Array} str The string to test.
  2945. * @param {String|Array} patterns One or more glob patterns to use for matching.
  2946. * @param {Object} [options] See available [options](#options).
  2947. * @return {Boolean} Returns true if any patterns match `str`
  2948. * @api public
  2949. */
  2950. picomatch$1.isMatch = (str, patterns, options$1) => picomatch$1(patterns, options$1)(str);
  2951. /**
  2952. * Parse a glob pattern to create the source string for a regular
  2953. * expression.
  2954. *
  2955. * ```js
  2956. * const picomatch = require('picomatch');
  2957. * const result = picomatch.parse(pattern[, options]);
  2958. * ```
  2959. * @param {String} `pattern`
  2960. * @param {Object} `options`
  2961. * @return {Object} Returns an object with useful properties and output to be used as a regex source string.
  2962. * @api public
  2963. */
  2964. picomatch$1.parse = (pattern$1, options$1) => {
  2965. if (Array.isArray(pattern$1)) return pattern$1.map((p) => picomatch$1.parse(p, options$1));
  2966. return parse(pattern$1, {
  2967. ...options$1,
  2968. fastpaths: false
  2969. });
  2970. };
  2971. /**
  2972. * Scan a glob pattern to separate the pattern into segments.
  2973. *
  2974. * ```js
  2975. * const picomatch = require('picomatch');
  2976. * // picomatch.scan(input[, options]);
  2977. *
  2978. * const result = picomatch.scan('!./foo/*.js');
  2979. * console.log(result);
  2980. * { prefix: '!./',
  2981. * input: '!./foo/*.js',
  2982. * start: 3,
  2983. * base: 'foo',
  2984. * glob: '*.js',
  2985. * isBrace: false,
  2986. * isBracket: false,
  2987. * isGlob: true,
  2988. * isExtglob: false,
  2989. * isGlobstar: false,
  2990. * negated: true }
  2991. * ```
  2992. * @param {String} `input` Glob pattern to scan.
  2993. * @param {Object} `options`
  2994. * @return {Object} Returns an object with
  2995. * @api public
  2996. */
  2997. picomatch$1.scan = (input, options$1) => scan(input, options$1);
  2998. /**
  2999. * Compile a regular expression from the `state` object returned by the
  3000. * [parse()](#parse) method.
  3001. *
  3002. * @param {Object} `state`
  3003. * @param {Object} `options`
  3004. * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
  3005. * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
  3006. * @return {RegExp}
  3007. * @api public
  3008. */
  3009. picomatch$1.compileRe = (state, options$1, returnOutput = false, returnState = false) => {
  3010. if (returnOutput === true) return state.output;
  3011. const opts = options$1 || {};
  3012. const prepend = opts.contains ? "" : "^";
  3013. const append$1 = opts.contains ? "" : "$";
  3014. let source = `${prepend}(?:${state.output})${append$1}`;
  3015. if (state && state.negated === true) source = `^(?!${source}).*$`;
  3016. const regex = picomatch$1.toRegex(source, options$1);
  3017. if (returnState === true) regex.state = state;
  3018. return regex;
  3019. };
  3020. /**
  3021. * Create a regular expression from a parsed glob pattern.
  3022. *
  3023. * ```js
  3024. * const picomatch = require('picomatch');
  3025. * const state = picomatch.parse('*.js');
  3026. * // picomatch.compileRe(state[, options]);
  3027. *
  3028. * console.log(picomatch.compileRe(state));
  3029. * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
  3030. * ```
  3031. * @param {String} `state` The object returned from the `.parse` method.
  3032. * @param {Object} `options`
  3033. * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
  3034. * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
  3035. * @return {RegExp} Returns a regex created from the given pattern.
  3036. * @api public
  3037. */
  3038. picomatch$1.makeRe = (input, options$1 = {}, returnOutput = false, returnState = false) => {
  3039. if (!input || typeof input !== "string") throw new TypeError("Expected a non-empty string");
  3040. let parsed = {
  3041. negated: false,
  3042. fastpaths: true
  3043. };
  3044. if (options$1.fastpaths !== false && (input[0] === "." || input[0] === "*")) parsed.output = parse.fastpaths(input, options$1);
  3045. if (!parsed.output) parsed = parse(input, options$1);
  3046. return picomatch$1.compileRe(parsed, options$1, returnOutput, returnState);
  3047. };
  3048. /**
  3049. * Create a regular expression from the given regex source string.
  3050. *
  3051. * ```js
  3052. * const picomatch = require('picomatch');
  3053. * // picomatch.toRegex(source[, options]);
  3054. *
  3055. * const { output } = picomatch.parse('*.js');
  3056. * console.log(picomatch.toRegex(output));
  3057. * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
  3058. * ```
  3059. * @param {String} `source` Regular expression source string.
  3060. * @param {Object} `options`
  3061. * @return {RegExp}
  3062. * @api public
  3063. */
  3064. picomatch$1.toRegex = (source, options$1) => {
  3065. try {
  3066. const opts = options$1 || {};
  3067. return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
  3068. } catch (err) {
  3069. if (options$1 && options$1.debug === true) throw err;
  3070. return /$^/;
  3071. }
  3072. };
  3073. /**
  3074. * Picomatch constants.
  3075. * @return {Object}
  3076. */
  3077. picomatch$1.constants = constants;
  3078. /**
  3079. * Expose "picomatch"
  3080. */
  3081. module.exports = picomatch$1;
  3082. }) });
  3083. //#endregion
  3084. //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/index.js
  3085. var require_picomatch = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/index.js": ((exports, module) => {
  3086. module.exports = require_picomatch$1();
  3087. }) });
  3088. //#endregion
  3089. //#region ../../node_modules/.pnpm/micromatch@4.0.8/node_modules/micromatch/index.js
  3090. var require_micromatch = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/micromatch@4.0.8/node_modules/micromatch/index.js": ((exports, module) => {
  3091. const util = __require("util");
  3092. const braces = require_braces();
  3093. const picomatch = require_picomatch();
  3094. const utils$10 = require_utils$2();
  3095. const isEmptyString = (v) => v === "" || v === "./";
  3096. const hasBraces = (v) => {
  3097. const index = v.indexOf("{");
  3098. return index > -1 && v.indexOf("}", index) > -1;
  3099. };
  3100. /**
  3101. * Returns an array of strings that match one or more glob patterns.
  3102. *
  3103. * ```js
  3104. * const mm = require('micromatch');
  3105. * // mm(list, patterns[, options]);
  3106. *
  3107. * console.log(mm(['a.js', 'a.txt'], ['*.js']));
  3108. * //=> [ 'a.js' ]
  3109. * ```
  3110. * @param {String|Array<string>} `list` List of strings to match.
  3111. * @param {String|Array<string>} `patterns` One or more glob patterns to use for matching.
  3112. * @param {Object} `options` See available [options](#options)
  3113. * @return {Array} Returns an array of matches
  3114. * @summary false
  3115. * @api public
  3116. */
  3117. const micromatch$1 = (list, patterns, options$1) => {
  3118. patterns = [].concat(patterns);
  3119. list = [].concat(list);
  3120. let omit = /* @__PURE__ */ new Set();
  3121. let keep = /* @__PURE__ */ new Set();
  3122. let items = /* @__PURE__ */ new Set();
  3123. let negatives = 0;
  3124. let onResult = (state) => {
  3125. items.add(state.output);
  3126. if (options$1 && options$1.onResult) options$1.onResult(state);
  3127. };
  3128. for (let i = 0; i < patterns.length; i++) {
  3129. let isMatch = picomatch(String(patterns[i]), {
  3130. ...options$1,
  3131. onResult
  3132. }, true);
  3133. let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
  3134. if (negated) negatives++;
  3135. for (let item of list) {
  3136. let matched = isMatch(item, true);
  3137. if (!(negated ? !matched.isMatch : matched.isMatch)) continue;
  3138. if (negated) omit.add(matched.output);
  3139. else {
  3140. omit.delete(matched.output);
  3141. keep.add(matched.output);
  3142. }
  3143. }
  3144. }
  3145. let matches = (negatives === patterns.length ? [...items] : [...keep]).filter((item) => !omit.has(item));
  3146. if (options$1 && matches.length === 0) {
  3147. if (options$1.failglob === true) throw new Error(`No matches found for "${patterns.join(", ")}"`);
  3148. if (options$1.nonull === true || options$1.nullglob === true) return options$1.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
  3149. }
  3150. return matches;
  3151. };
  3152. /**
  3153. * Backwards compatibility
  3154. */
  3155. micromatch$1.match = micromatch$1;
  3156. /**
  3157. * Returns a matcher function from the given glob `pattern` and `options`.
  3158. * The returned function takes a string to match as its only argument and returns
  3159. * true if the string is a match.
  3160. *
  3161. * ```js
  3162. * const mm = require('micromatch');
  3163. * // mm.matcher(pattern[, options]);
  3164. *
  3165. * const isMatch = mm.matcher('*.!(*a)');
  3166. * console.log(isMatch('a.a')); //=> false
  3167. * console.log(isMatch('a.b')); //=> true
  3168. * ```
  3169. * @param {String} `pattern` Glob pattern
  3170. * @param {Object} `options`
  3171. * @return {Function} Returns a matcher function.
  3172. * @api public
  3173. */
  3174. micromatch$1.matcher = (pattern$1, options$1) => picomatch(pattern$1, options$1);
  3175. /**
  3176. * Returns true if **any** of the given glob `patterns` match the specified `string`.
  3177. *
  3178. * ```js
  3179. * const mm = require('micromatch');
  3180. * // mm.isMatch(string, patterns[, options]);
  3181. *
  3182. * console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true
  3183. * console.log(mm.isMatch('a.a', 'b.*')); //=> false
  3184. * ```
  3185. * @param {String} `str` The string to test.
  3186. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  3187. * @param {Object} `[options]` See available [options](#options).
  3188. * @return {Boolean} Returns true if any patterns match `str`
  3189. * @api public
  3190. */
  3191. micromatch$1.isMatch = (str, patterns, options$1) => picomatch(patterns, options$1)(str);
  3192. /**
  3193. * Backwards compatibility
  3194. */
  3195. micromatch$1.any = micromatch$1.isMatch;
  3196. /**
  3197. * Returns a list of strings that _**do not match any**_ of the given `patterns`.
  3198. *
  3199. * ```js
  3200. * const mm = require('micromatch');
  3201. * // mm.not(list, patterns[, options]);
  3202. *
  3203. * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a'));
  3204. * //=> ['b.b', 'c.c']
  3205. * ```
  3206. * @param {Array} `list` Array of strings to match.
  3207. * @param {String|Array} `patterns` One or more glob pattern to use for matching.
  3208. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  3209. * @return {Array} Returns an array of strings that **do not match** the given patterns.
  3210. * @api public
  3211. */
  3212. micromatch$1.not = (list, patterns, options$1 = {}) => {
  3213. patterns = [].concat(patterns).map(String);
  3214. let result = /* @__PURE__ */ new Set();
  3215. let items = [];
  3216. let onResult = (state) => {
  3217. if (options$1.onResult) options$1.onResult(state);
  3218. items.push(state.output);
  3219. };
  3220. let matches = new Set(micromatch$1(list, patterns, {
  3221. ...options$1,
  3222. onResult
  3223. }));
  3224. for (let item of items) if (!matches.has(item)) result.add(item);
  3225. return [...result];
  3226. };
  3227. /**
  3228. * Returns true if the given `string` contains the given pattern. Similar
  3229. * to [.isMatch](#isMatch) but the pattern can match any part of the string.
  3230. *
  3231. * ```js
  3232. * var mm = require('micromatch');
  3233. * // mm.contains(string, pattern[, options]);
  3234. *
  3235. * console.log(mm.contains('aa/bb/cc', '*b'));
  3236. * //=> true
  3237. * console.log(mm.contains('aa/bb/cc', '*d'));
  3238. * //=> false
  3239. * ```
  3240. * @param {String} `str` The string to match.
  3241. * @param {String|Array} `patterns` Glob pattern to use for matching.
  3242. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  3243. * @return {Boolean} Returns true if any of the patterns matches any part of `str`.
  3244. * @api public
  3245. */
  3246. micromatch$1.contains = (str, pattern$1, options$1) => {
  3247. if (typeof str !== "string") throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
  3248. if (Array.isArray(pattern$1)) return pattern$1.some((p) => micromatch$1.contains(str, p, options$1));
  3249. if (typeof pattern$1 === "string") {
  3250. if (isEmptyString(str) || isEmptyString(pattern$1)) return false;
  3251. if (str.includes(pattern$1) || str.startsWith("./") && str.slice(2).includes(pattern$1)) return true;
  3252. }
  3253. return micromatch$1.isMatch(str, pattern$1, {
  3254. ...options$1,
  3255. contains: true
  3256. });
  3257. };
  3258. /**
  3259. * Filter the keys of the given object with the given `glob` pattern
  3260. * and `options`. Does not attempt to match nested keys. If you need this feature,
  3261. * use [glob-object][] instead.
  3262. *
  3263. * ```js
  3264. * const mm = require('micromatch');
  3265. * // mm.matchKeys(object, patterns[, options]);
  3266. *
  3267. * const obj = { aa: 'a', ab: 'b', ac: 'c' };
  3268. * console.log(mm.matchKeys(obj, '*b'));
  3269. * //=> { ab: 'b' }
  3270. * ```
  3271. * @param {Object} `object` The object with keys to filter.
  3272. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  3273. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  3274. * @return {Object} Returns an object with only keys that match the given patterns.
  3275. * @api public
  3276. */
  3277. micromatch$1.matchKeys = (obj, patterns, options$1) => {
  3278. if (!utils$10.isObject(obj)) throw new TypeError("Expected the first argument to be an object");
  3279. let keys$1 = micromatch$1(Object.keys(obj), patterns, options$1);
  3280. let res = {};
  3281. for (let key of keys$1) res[key] = obj[key];
  3282. return res;
  3283. };
  3284. /**
  3285. * Returns true if some of the strings in the given `list` match any of the given glob `patterns`.
  3286. *
  3287. * ```js
  3288. * const mm = require('micromatch');
  3289. * // mm.some(list, patterns[, options]);
  3290. *
  3291. * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
  3292. * // true
  3293. * console.log(mm.some(['foo.js'], ['*.js', '!foo.js']));
  3294. * // false
  3295. * ```
  3296. * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found.
  3297. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  3298. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  3299. * @return {Boolean} Returns true if any `patterns` matches any of the strings in `list`
  3300. * @api public
  3301. */
  3302. micromatch$1.some = (list, patterns, options$1) => {
  3303. let items = [].concat(list);
  3304. for (let pattern$1 of [].concat(patterns)) {
  3305. let isMatch = picomatch(String(pattern$1), options$1);
  3306. if (items.some((item) => isMatch(item))) return true;
  3307. }
  3308. return false;
  3309. };
  3310. /**
  3311. * Returns true if every string in the given `list` matches
  3312. * any of the given glob `patterns`.
  3313. *
  3314. * ```js
  3315. * const mm = require('micromatch');
  3316. * // mm.every(list, patterns[, options]);
  3317. *
  3318. * console.log(mm.every('foo.js', ['foo.js']));
  3319. * // true
  3320. * console.log(mm.every(['foo.js', 'bar.js'], ['*.js']));
  3321. * // true
  3322. * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
  3323. * // false
  3324. * console.log(mm.every(['foo.js'], ['*.js', '!foo.js']));
  3325. * // false
  3326. * ```
  3327. * @param {String|Array} `list` The string or array of strings to test.
  3328. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  3329. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  3330. * @return {Boolean} Returns true if all `patterns` matches all of the strings in `list`
  3331. * @api public
  3332. */
  3333. micromatch$1.every = (list, patterns, options$1) => {
  3334. let items = [].concat(list);
  3335. for (let pattern$1 of [].concat(patterns)) {
  3336. let isMatch = picomatch(String(pattern$1), options$1);
  3337. if (!items.every((item) => isMatch(item))) return false;
  3338. }
  3339. return true;
  3340. };
  3341. /**
  3342. * Returns true if **all** of the given `patterns` match
  3343. * the specified string.
  3344. *
  3345. * ```js
  3346. * const mm = require('micromatch');
  3347. * // mm.all(string, patterns[, options]);
  3348. *
  3349. * console.log(mm.all('foo.js', ['foo.js']));
  3350. * // true
  3351. *
  3352. * console.log(mm.all('foo.js', ['*.js', '!foo.js']));
  3353. * // false
  3354. *
  3355. * console.log(mm.all('foo.js', ['*.js', 'foo.js']));
  3356. * // true
  3357. *
  3358. * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js']));
  3359. * // true
  3360. * ```
  3361. * @param {String|Array} `str` The string to test.
  3362. * @param {String|Array} `patterns` One or more glob patterns to use for matching.
  3363. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  3364. * @return {Boolean} Returns true if any patterns match `str`
  3365. * @api public
  3366. */
  3367. micromatch$1.all = (str, patterns, options$1) => {
  3368. if (typeof str !== "string") throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
  3369. return [].concat(patterns).every((p) => picomatch(p, options$1)(str));
  3370. };
  3371. /**
  3372. * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match.
  3373. *
  3374. * ```js
  3375. * const mm = require('micromatch');
  3376. * // mm.capture(pattern, string[, options]);
  3377. *
  3378. * console.log(mm.capture('test/*.js', 'test/foo.js'));
  3379. * //=> ['foo']
  3380. * console.log(mm.capture('test/*.js', 'foo/bar.css'));
  3381. * //=> null
  3382. * ```
  3383. * @param {String} `glob` Glob pattern to use for matching.
  3384. * @param {String} `input` String to match
  3385. * @param {Object} `options` See available [options](#options) for changing how matches are performed
  3386. * @return {Array|null} Returns an array of captures if the input matches the glob pattern, otherwise `null`.
  3387. * @api public
  3388. */
  3389. micromatch$1.capture = (glob, input, options$1) => {
  3390. let posix = utils$10.isWindows(options$1);
  3391. let match = picomatch.makeRe(String(glob), {
  3392. ...options$1,
  3393. capture: true
  3394. }).exec(posix ? utils$10.toPosixSlashes(input) : input);
  3395. if (match) return match.slice(1).map((v) => v === void 0 ? "" : v);
  3396. };
  3397. /**
  3398. * Create a regular expression from the given glob `pattern`.
  3399. *
  3400. * ```js
  3401. * const mm = require('micromatch');
  3402. * // mm.makeRe(pattern[, options]);
  3403. *
  3404. * console.log(mm.makeRe('*.js'));
  3405. * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/
  3406. * ```
  3407. * @param {String} `pattern` A glob pattern to convert to regex.
  3408. * @param {Object} `options`
  3409. * @return {RegExp} Returns a regex created from the given pattern.
  3410. * @api public
  3411. */
  3412. micromatch$1.makeRe = (...args) => picomatch.makeRe(...args);
  3413. /**
  3414. * Scan a glob pattern to separate the pattern into segments. Used
  3415. * by the [split](#split) method.
  3416. *
  3417. * ```js
  3418. * const mm = require('micromatch');
  3419. * const state = mm.scan(pattern[, options]);
  3420. * ```
  3421. * @param {String} `pattern`
  3422. * @param {Object} `options`
  3423. * @return {Object} Returns an object with
  3424. * @api public
  3425. */
  3426. micromatch$1.scan = (...args) => picomatch.scan(...args);
  3427. /**
  3428. * Parse a glob pattern to create the source string for a regular
  3429. * expression.
  3430. *
  3431. * ```js
  3432. * const mm = require('micromatch');
  3433. * const state = mm.parse(pattern[, options]);
  3434. * ```
  3435. * @param {String} `glob`
  3436. * @param {Object} `options`
  3437. * @return {Object} Returns an object with useful properties and output to be used as regex source string.
  3438. * @api public
  3439. */
  3440. micromatch$1.parse = (patterns, options$1) => {
  3441. let res = [];
  3442. for (let pattern$1 of [].concat(patterns || [])) for (let str of braces(String(pattern$1), options$1)) res.push(picomatch.parse(str, options$1));
  3443. return res;
  3444. };
  3445. /**
  3446. * Process the given brace `pattern`.
  3447. *
  3448. * ```js
  3449. * const { braces } = require('micromatch');
  3450. * console.log(braces('foo/{a,b,c}/bar'));
  3451. * //=> [ 'foo/(a|b|c)/bar' ]
  3452. *
  3453. * console.log(braces('foo/{a,b,c}/bar', { expand: true }));
  3454. * //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ]
  3455. * ```
  3456. * @param {String} `pattern` String with brace pattern to process.
  3457. * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options.
  3458. * @return {Array}
  3459. * @api public
  3460. */
  3461. micromatch$1.braces = (pattern$1, options$1) => {
  3462. if (typeof pattern$1 !== "string") throw new TypeError("Expected a string");
  3463. if (options$1 && options$1.nobrace === true || !hasBraces(pattern$1)) return [pattern$1];
  3464. return braces(pattern$1, options$1);
  3465. };
  3466. /**
  3467. * Expand braces
  3468. */
  3469. micromatch$1.braceExpand = (pattern$1, options$1) => {
  3470. if (typeof pattern$1 !== "string") throw new TypeError("Expected a string");
  3471. return micromatch$1.braces(pattern$1, {
  3472. ...options$1,
  3473. expand: true
  3474. });
  3475. };
  3476. /**
  3477. * Expose micromatch
  3478. */
  3479. micromatch$1.hasBraces = hasBraces;
  3480. module.exports = micromatch$1;
  3481. }) });
  3482. //#endregion
  3483. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/pattern.js
  3484. var require_pattern = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/pattern.js": ((exports) => {
  3485. Object.defineProperty(exports, "__esModule", { value: true });
  3486. const path$6 = __require("path");
  3487. const globParent = require_glob_parent();
  3488. const micromatch = require_micromatch();
  3489. const GLOBSTAR = "**";
  3490. const ESCAPE_SYMBOL = "\\";
  3491. const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
  3492. const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/;
  3493. const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;
  3494. const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/;
  3495. const BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./;
  3496. /**
  3497. * Matches a sequence of two or more consecutive slashes, excluding the first two slashes at the beginning of the string.
  3498. * The latter is due to the presence of the device path at the beginning of the UNC path.
  3499. */
  3500. const DOUBLE_SLASH_RE = /(?!^)\/{2,}/g;
  3501. function isStaticPattern(pattern$1, options$1 = {}) {
  3502. return !isDynamicPattern(pattern$1, options$1);
  3503. }
  3504. exports.isStaticPattern = isStaticPattern;
  3505. function isDynamicPattern(pattern$1, options$1 = {}) {
  3506. /**
  3507. * A special case with an empty string is necessary for matching patterns that start with a forward slash.
  3508. * An empty string cannot be a dynamic pattern.
  3509. * For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'.
  3510. */
  3511. if (pattern$1 === "") return false;
  3512. /**
  3513. * When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
  3514. * filepath directly (without read directory).
  3515. */
  3516. if (options$1.caseSensitiveMatch === false || pattern$1.includes(ESCAPE_SYMBOL)) return true;
  3517. if (COMMON_GLOB_SYMBOLS_RE.test(pattern$1) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern$1) || REGEX_GROUP_SYMBOLS_RE.test(pattern$1)) return true;
  3518. if (options$1.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern$1)) return true;
  3519. if (options$1.braceExpansion !== false && hasBraceExpansion(pattern$1)) return true;
  3520. return false;
  3521. }
  3522. exports.isDynamicPattern = isDynamicPattern;
  3523. function hasBraceExpansion(pattern$1) {
  3524. const openingBraceIndex = pattern$1.indexOf("{");
  3525. if (openingBraceIndex === -1) return false;
  3526. const closingBraceIndex = pattern$1.indexOf("}", openingBraceIndex + 1);
  3527. if (closingBraceIndex === -1) return false;
  3528. const braceContent = pattern$1.slice(openingBraceIndex, closingBraceIndex);
  3529. return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent);
  3530. }
  3531. function convertToPositivePattern(pattern$1) {
  3532. return isNegativePattern(pattern$1) ? pattern$1.slice(1) : pattern$1;
  3533. }
  3534. exports.convertToPositivePattern = convertToPositivePattern;
  3535. function convertToNegativePattern(pattern$1) {
  3536. return "!" + pattern$1;
  3537. }
  3538. exports.convertToNegativePattern = convertToNegativePattern;
  3539. function isNegativePattern(pattern$1) {
  3540. return pattern$1.startsWith("!") && pattern$1[1] !== "(";
  3541. }
  3542. exports.isNegativePattern = isNegativePattern;
  3543. function isPositivePattern(pattern$1) {
  3544. return !isNegativePattern(pattern$1);
  3545. }
  3546. exports.isPositivePattern = isPositivePattern;
  3547. function getNegativePatterns(patterns) {
  3548. return patterns.filter(isNegativePattern);
  3549. }
  3550. exports.getNegativePatterns = getNegativePatterns;
  3551. function getPositivePatterns$1(patterns) {
  3552. return patterns.filter(isPositivePattern);
  3553. }
  3554. exports.getPositivePatterns = getPositivePatterns$1;
  3555. /**
  3556. * Returns patterns that can be applied inside the current directory.
  3557. *
  3558. * @example
  3559. * // ['./*', '*', 'a/*']
  3560. * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
  3561. */
  3562. function getPatternsInsideCurrentDirectory(patterns) {
  3563. return patterns.filter((pattern$1) => !isPatternRelatedToParentDirectory(pattern$1));
  3564. }
  3565. exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory;
  3566. /**
  3567. * Returns patterns to be expanded relative to (outside) the current directory.
  3568. *
  3569. * @example
  3570. * // ['../*', './../*']
  3571. * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
  3572. */
  3573. function getPatternsOutsideCurrentDirectory(patterns) {
  3574. return patterns.filter(isPatternRelatedToParentDirectory);
  3575. }
  3576. exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory;
  3577. function isPatternRelatedToParentDirectory(pattern$1) {
  3578. return pattern$1.startsWith("..") || pattern$1.startsWith("./..");
  3579. }
  3580. exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory;
  3581. function getBaseDirectory(pattern$1) {
  3582. return globParent(pattern$1, { flipBackslashes: false });
  3583. }
  3584. exports.getBaseDirectory = getBaseDirectory;
  3585. function hasGlobStar(pattern$1) {
  3586. return pattern$1.includes(GLOBSTAR);
  3587. }
  3588. exports.hasGlobStar = hasGlobStar;
  3589. function endsWithSlashGlobStar(pattern$1) {
  3590. return pattern$1.endsWith("/" + GLOBSTAR);
  3591. }
  3592. exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
  3593. function isAffectDepthOfReadingPattern(pattern$1) {
  3594. const basename = path$6.basename(pattern$1);
  3595. return endsWithSlashGlobStar(pattern$1) || isStaticPattern(basename);
  3596. }
  3597. exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
  3598. function expandPatternsWithBraceExpansion(patterns) {
  3599. return patterns.reduce((collection, pattern$1) => {
  3600. return collection.concat(expandBraceExpansion(pattern$1));
  3601. }, []);
  3602. }
  3603. exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
  3604. function expandBraceExpansion(pattern$1) {
  3605. const patterns = micromatch.braces(pattern$1, {
  3606. expand: true,
  3607. nodupes: true,
  3608. keepEscaping: true
  3609. });
  3610. /**
  3611. * Sort the patterns by length so that the same depth patterns are processed side by side.
  3612. * `a/{b,}/{c,}/*` `['a///*', 'a/b//*', 'a//c/*', 'a/b/c/*']`
  3613. */
  3614. patterns.sort((a, b) => a.length - b.length);
  3615. /**
  3616. * Micromatch can return an empty string in the case of patterns like `{a,}`.
  3617. */
  3618. return patterns.filter((pattern$2) => pattern$2 !== "");
  3619. }
  3620. exports.expandBraceExpansion = expandBraceExpansion;
  3621. function getPatternParts(pattern$1, options$1) {
  3622. let { parts } = micromatch.scan(pattern$1, Object.assign(Object.assign({}, options$1), { parts: true }));
  3623. /**
  3624. * The scan method returns an empty array in some cases.
  3625. * See micromatch/picomatch#58 for more details.
  3626. */
  3627. if (parts.length === 0) parts = [pattern$1];
  3628. /**
  3629. * The scan method does not return an empty part for the pattern with a forward slash.
  3630. * This is another part of micromatch/picomatch#58.
  3631. */
  3632. if (parts[0].startsWith("/")) {
  3633. parts[0] = parts[0].slice(1);
  3634. parts.unshift("");
  3635. }
  3636. return parts;
  3637. }
  3638. exports.getPatternParts = getPatternParts;
  3639. function makeRe(pattern$1, options$1) {
  3640. return micromatch.makeRe(pattern$1, options$1);
  3641. }
  3642. exports.makeRe = makeRe;
  3643. function convertPatternsToRe(patterns, options$1) {
  3644. return patterns.map((pattern$1) => makeRe(pattern$1, options$1));
  3645. }
  3646. exports.convertPatternsToRe = convertPatternsToRe;
  3647. function matchAny(entry, patternsRe) {
  3648. return patternsRe.some((patternRe) => patternRe.test(entry));
  3649. }
  3650. exports.matchAny = matchAny;
  3651. /**
  3652. * This package only works with forward slashes as a path separator.
  3653. * Because of this, we cannot use the standard `path.normalize` method, because on Windows platform it will use of backslashes.
  3654. */
  3655. function removeDuplicateSlashes(pattern$1) {
  3656. return pattern$1.replace(DOUBLE_SLASH_RE, "/");
  3657. }
  3658. exports.removeDuplicateSlashes = removeDuplicateSlashes;
  3659. function partitionAbsoluteAndRelative(patterns) {
  3660. const absolute = [];
  3661. const relative$1 = [];
  3662. for (const pattern$1 of patterns) if (isAbsolute$1(pattern$1)) absolute.push(pattern$1);
  3663. else relative$1.push(pattern$1);
  3664. return [absolute, relative$1];
  3665. }
  3666. exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
  3667. function isAbsolute$1(pattern$1) {
  3668. return path$6.isAbsolute(pattern$1);
  3669. }
  3670. exports.isAbsolute = isAbsolute$1;
  3671. }) });
  3672. //#endregion
  3673. //#region ../../node_modules/.pnpm/merge2@1.4.1/node_modules/merge2/index.js
  3674. var require_merge2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/merge2@1.4.1/node_modules/merge2/index.js": ((exports, module) => {
  3675. const PassThrough = __require("stream").PassThrough;
  3676. const slice = Array.prototype.slice;
  3677. module.exports = merge2$1;
  3678. function merge2$1() {
  3679. const streamsQueue = [];
  3680. const args = slice.call(arguments);
  3681. let merging = false;
  3682. let options$1 = args[args.length - 1];
  3683. if (options$1 && !Array.isArray(options$1) && options$1.pipe == null) args.pop();
  3684. else options$1 = {};
  3685. const doEnd = options$1.end !== false;
  3686. const doPipeError = options$1.pipeError === true;
  3687. if (options$1.objectMode == null) options$1.objectMode = true;
  3688. if (options$1.highWaterMark == null) options$1.highWaterMark = 64 * 1024;
  3689. const mergedStream = PassThrough(options$1);
  3690. function addStream() {
  3691. for (let i = 0, len = arguments.length; i < len; i++) streamsQueue.push(pauseStreams(arguments[i], options$1));
  3692. mergeStream();
  3693. return this;
  3694. }
  3695. function mergeStream() {
  3696. if (merging) return;
  3697. merging = true;
  3698. let streams = streamsQueue.shift();
  3699. if (!streams) {
  3700. process.nextTick(endStream);
  3701. return;
  3702. }
  3703. if (!Array.isArray(streams)) streams = [streams];
  3704. let pipesCount = streams.length + 1;
  3705. function next() {
  3706. if (--pipesCount > 0) return;
  3707. merging = false;
  3708. mergeStream();
  3709. }
  3710. function pipe(stream$1) {
  3711. function onend() {
  3712. stream$1.removeListener("merge2UnpipeEnd", onend);
  3713. stream$1.removeListener("end", onend);
  3714. if (doPipeError) stream$1.removeListener("error", onerror);
  3715. next();
  3716. }
  3717. function onerror(err) {
  3718. mergedStream.emit("error", err);
  3719. }
  3720. if (stream$1._readableState.endEmitted) return next();
  3721. stream$1.on("merge2UnpipeEnd", onend);
  3722. stream$1.on("end", onend);
  3723. if (doPipeError) stream$1.on("error", onerror);
  3724. stream$1.pipe(mergedStream, { end: false });
  3725. stream$1.resume();
  3726. }
  3727. for (let i = 0; i < streams.length; i++) pipe(streams[i]);
  3728. next();
  3729. }
  3730. function endStream() {
  3731. merging = false;
  3732. mergedStream.emit("queueDrain");
  3733. if (doEnd) mergedStream.end();
  3734. }
  3735. mergedStream.setMaxListeners(0);
  3736. mergedStream.add = addStream;
  3737. mergedStream.on("unpipe", function(stream$1) {
  3738. stream$1.emit("merge2UnpipeEnd");
  3739. });
  3740. if (args.length) addStream.apply(null, args);
  3741. return mergedStream;
  3742. }
  3743. function pauseStreams(streams, options$1) {
  3744. if (!Array.isArray(streams)) {
  3745. if (!streams._readableState && streams.pipe) streams = streams.pipe(PassThrough(options$1));
  3746. if (!streams._readableState || !streams.pause || !streams.pipe) throw new Error("Only readable stream can be merged.");
  3747. streams.pause();
  3748. } else for (let i = 0, len = streams.length; i < len; i++) streams[i] = pauseStreams(streams[i], options$1);
  3749. return streams;
  3750. }
  3751. }) });
  3752. //#endregion
  3753. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/stream.js
  3754. var require_stream$3 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/stream.js": ((exports) => {
  3755. Object.defineProperty(exports, "__esModule", { value: true });
  3756. const merge2 = require_merge2();
  3757. function merge(streams) {
  3758. const mergedStream = merge2(streams);
  3759. streams.forEach((stream$1) => {
  3760. stream$1.once("error", (error) => mergedStream.emit("error", error));
  3761. });
  3762. mergedStream.once("close", () => propagateCloseEventToSources(streams));
  3763. mergedStream.once("end", () => propagateCloseEventToSources(streams));
  3764. return mergedStream;
  3765. }
  3766. exports.merge = merge;
  3767. function propagateCloseEventToSources(streams) {
  3768. streams.forEach((stream$1) => stream$1.emit("close"));
  3769. }
  3770. }) });
  3771. //#endregion
  3772. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/string.js
  3773. var require_string = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/string.js": ((exports) => {
  3774. Object.defineProperty(exports, "__esModule", { value: true });
  3775. function isString(input) {
  3776. return typeof input === "string";
  3777. }
  3778. exports.isString = isString;
  3779. function isEmpty(input) {
  3780. return input === "";
  3781. }
  3782. exports.isEmpty = isEmpty;
  3783. }) });
  3784. //#endregion
  3785. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/index.js
  3786. var require_utils$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/index.js": ((exports) => {
  3787. Object.defineProperty(exports, "__esModule", { value: true });
  3788. const array = require_array();
  3789. exports.array = array;
  3790. const errno = require_errno();
  3791. exports.errno = errno;
  3792. const fs$7 = require_fs$3();
  3793. exports.fs = fs$7;
  3794. const path$5 = require_path();
  3795. exports.path = path$5;
  3796. const pattern = require_pattern();
  3797. exports.pattern = pattern;
  3798. const stream = require_stream$3();
  3799. exports.stream = stream;
  3800. const string = require_string();
  3801. exports.string = string;
  3802. }) });
  3803. //#endregion
  3804. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/managers/tasks.js
  3805. var require_tasks = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/managers/tasks.js": ((exports) => {
  3806. Object.defineProperty(exports, "__esModule", { value: true });
  3807. const utils$9 = require_utils$1();
  3808. function generate(input, settings) {
  3809. const patterns = processPatterns(input, settings);
  3810. const ignore = processPatterns(settings.ignore, settings);
  3811. const positivePatterns = getPositivePatterns(patterns);
  3812. const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
  3813. const staticPatterns = positivePatterns.filter((pattern$1) => utils$9.pattern.isStaticPattern(pattern$1, settings));
  3814. const dynamicPatterns = positivePatterns.filter((pattern$1) => utils$9.pattern.isDynamicPattern(pattern$1, settings));
  3815. const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, false);
  3816. const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, true);
  3817. return staticTasks.concat(dynamicTasks);
  3818. }
  3819. exports.generate = generate;
  3820. function processPatterns(input, settings) {
  3821. let patterns = input;
  3822. /**
  3823. * The original pattern like `{,*,**,a/*}` can lead to problems checking the depth when matching entry
  3824. * and some problems with the micromatch package (see fast-glob issues: #365, #394).
  3825. *
  3826. * To solve this problem, we expand all patterns containing brace expansion. This can lead to a slight slowdown
  3827. * in matching in the case of a large set of patterns after expansion.
  3828. */
  3829. if (settings.braceExpansion) patterns = utils$9.pattern.expandPatternsWithBraceExpansion(patterns);
  3830. /**
  3831. * If the `baseNameMatch` option is enabled, we must add globstar to patterns, so that they can be used
  3832. * at any nesting level.
  3833. *
  3834. * We do this here, because otherwise we have to complicate the filtering logic. For example, we need to change
  3835. * the pattern in the filter before creating a regular expression. There is no need to change the patterns
  3836. * in the application. Only on the input.
  3837. */
  3838. if (settings.baseNameMatch) patterns = patterns.map((pattern$1) => pattern$1.includes("/") ? pattern$1 : `**/${pattern$1}`);
  3839. /**
  3840. * This method also removes duplicate slashes that may have been in the pattern or formed as a result of expansion.
  3841. */
  3842. return patterns.map((pattern$1) => utils$9.pattern.removeDuplicateSlashes(pattern$1));
  3843. }
  3844. /**
  3845. * Returns tasks grouped by basic pattern directories.
  3846. *
  3847. * Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately.
  3848. * This is necessary because directory traversal starts at the base directory and goes deeper.
  3849. */
  3850. function convertPatternsToTasks(positive, negative, dynamic) {
  3851. const tasks = [];
  3852. const patternsOutsideCurrentDirectory = utils$9.pattern.getPatternsOutsideCurrentDirectory(positive);
  3853. const patternsInsideCurrentDirectory = utils$9.pattern.getPatternsInsideCurrentDirectory(positive);
  3854. const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory);
  3855. const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory);
  3856. tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic));
  3857. if ("." in insideCurrentDirectoryGroup) tasks.push(convertPatternGroupToTask(".", patternsInsideCurrentDirectory, negative, dynamic));
  3858. else tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic));
  3859. return tasks;
  3860. }
  3861. exports.convertPatternsToTasks = convertPatternsToTasks;
  3862. function getPositivePatterns(patterns) {
  3863. return utils$9.pattern.getPositivePatterns(patterns);
  3864. }
  3865. exports.getPositivePatterns = getPositivePatterns;
  3866. function getNegativePatternsAsPositive(patterns, ignore) {
  3867. return utils$9.pattern.getNegativePatterns(patterns).concat(ignore).map(utils$9.pattern.convertToPositivePattern);
  3868. }
  3869. exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
  3870. function groupPatternsByBaseDirectory(patterns) {
  3871. return patterns.reduce((collection, pattern$1) => {
  3872. const base = utils$9.pattern.getBaseDirectory(pattern$1);
  3873. if (base in collection) collection[base].push(pattern$1);
  3874. else collection[base] = [pattern$1];
  3875. return collection;
  3876. }, {});
  3877. }
  3878. exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
  3879. function convertPatternGroupsToTasks(positive, negative, dynamic) {
  3880. return Object.keys(positive).map((base) => {
  3881. return convertPatternGroupToTask(base, positive[base], negative, dynamic);
  3882. });
  3883. }
  3884. exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
  3885. function convertPatternGroupToTask(base, positive, negative, dynamic) {
  3886. return {
  3887. dynamic,
  3888. positive,
  3889. negative,
  3890. base,
  3891. patterns: [].concat(positive, negative.map(utils$9.pattern.convertToNegativePattern))
  3892. };
  3893. }
  3894. exports.convertPatternGroupToTask = convertPatternGroupToTask;
  3895. }) });
  3896. //#endregion
  3897. //#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/async.js
  3898. var require_async$5 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/async.js": ((exports) => {
  3899. Object.defineProperty(exports, "__esModule", { value: true });
  3900. function read$3(path$11, settings, callback) {
  3901. settings.fs.lstat(path$11, (lstatError, lstat) => {
  3902. if (lstatError !== null) {
  3903. callFailureCallback$2(callback, lstatError);
  3904. return;
  3905. }
  3906. if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
  3907. callSuccessCallback$2(callback, lstat);
  3908. return;
  3909. }
  3910. settings.fs.stat(path$11, (statError, stat$1) => {
  3911. if (statError !== null) {
  3912. if (settings.throwErrorOnBrokenSymbolicLink) {
  3913. callFailureCallback$2(callback, statError);
  3914. return;
  3915. }
  3916. callSuccessCallback$2(callback, lstat);
  3917. return;
  3918. }
  3919. if (settings.markSymbolicLink) stat$1.isSymbolicLink = () => true;
  3920. callSuccessCallback$2(callback, stat$1);
  3921. });
  3922. });
  3923. }
  3924. exports.read = read$3;
  3925. function callFailureCallback$2(callback, error) {
  3926. callback(error);
  3927. }
  3928. function callSuccessCallback$2(callback, result) {
  3929. callback(null, result);
  3930. }
  3931. }) });
  3932. //#endregion
  3933. //#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/sync.js
  3934. var require_sync$5 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/sync.js": ((exports) => {
  3935. Object.defineProperty(exports, "__esModule", { value: true });
  3936. function read$2(path$11, settings) {
  3937. const lstat = settings.fs.lstatSync(path$11);
  3938. if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) return lstat;
  3939. try {
  3940. const stat$1 = settings.fs.statSync(path$11);
  3941. if (settings.markSymbolicLink) stat$1.isSymbolicLink = () => true;
  3942. return stat$1;
  3943. } catch (error) {
  3944. if (!settings.throwErrorOnBrokenSymbolicLink) return lstat;
  3945. throw error;
  3946. }
  3947. }
  3948. exports.read = read$2;
  3949. }) });
  3950. //#endregion
  3951. //#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/adapters/fs.js
  3952. var require_fs$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/adapters/fs.js": ((exports) => {
  3953. Object.defineProperty(exports, "__esModule", { value: true });
  3954. exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
  3955. const fs$6 = __require("fs");
  3956. exports.FILE_SYSTEM_ADAPTER = {
  3957. lstat: fs$6.lstat,
  3958. stat: fs$6.stat,
  3959. lstatSync: fs$6.lstatSync,
  3960. statSync: fs$6.statSync
  3961. };
  3962. function createFileSystemAdapter$1(fsMethods) {
  3963. if (fsMethods === void 0) return exports.FILE_SYSTEM_ADAPTER;
  3964. return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
  3965. }
  3966. exports.createFileSystemAdapter = createFileSystemAdapter$1;
  3967. }) });
  3968. //#endregion
  3969. //#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.js
  3970. var require_settings$3 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.js": ((exports) => {
  3971. Object.defineProperty(exports, "__esModule", { value: true });
  3972. const fs$5 = require_fs$2();
  3973. var Settings$3 = class {
  3974. constructor(_options = {}) {
  3975. this._options = _options;
  3976. this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
  3977. this.fs = fs$5.createFileSystemAdapter(this._options.fs);
  3978. this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
  3979. this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
  3980. }
  3981. _getValue(option, value) {
  3982. return option !== null && option !== void 0 ? option : value;
  3983. }
  3984. };
  3985. exports.default = Settings$3;
  3986. }) });
  3987. //#endregion
  3988. //#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/index.js
  3989. var require_out$3 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/index.js": ((exports) => {
  3990. Object.defineProperty(exports, "__esModule", { value: true });
  3991. const async$1 = require_async$5();
  3992. const sync$1 = require_sync$5();
  3993. const settings_1$3 = require_settings$3();
  3994. exports.Settings = settings_1$3.default;
  3995. function stat(path$11, optionsOrSettingsOrCallback, callback) {
  3996. if (typeof optionsOrSettingsOrCallback === "function") {
  3997. async$1.read(path$11, getSettings$2(), optionsOrSettingsOrCallback);
  3998. return;
  3999. }
  4000. async$1.read(path$11, getSettings$2(optionsOrSettingsOrCallback), callback);
  4001. }
  4002. exports.stat = stat;
  4003. function statSync(path$11, optionsOrSettings) {
  4004. const settings = getSettings$2(optionsOrSettings);
  4005. return sync$1.read(path$11, settings);
  4006. }
  4007. exports.statSync = statSync;
  4008. function getSettings$2(settingsOrOptions = {}) {
  4009. if (settingsOrOptions instanceof settings_1$3.default) return settingsOrOptions;
  4010. return new settings_1$3.default(settingsOrOptions);
  4011. }
  4012. }) });
  4013. //#endregion
  4014. //#region ../../node_modules/.pnpm/queue-microtask@1.2.3/node_modules/queue-microtask/index.js
  4015. var require_queue_microtask = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/queue-microtask@1.2.3/node_modules/queue-microtask/index.js": ((exports, module) => {
  4016. /*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
  4017. let promise;
  4018. module.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => {
  4019. throw err;
  4020. }, 0));
  4021. }) });
  4022. //#endregion
  4023. //#region ../../node_modules/.pnpm/run-parallel@1.2.0/node_modules/run-parallel/index.js
  4024. var require_run_parallel = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/run-parallel@1.2.0/node_modules/run-parallel/index.js": ((exports, module) => {
  4025. /*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
  4026. module.exports = runParallel;
  4027. const queueMicrotask$1 = require_queue_microtask();
  4028. function runParallel(tasks, cb) {
  4029. let results, pending, keys$1;
  4030. let isSync = true;
  4031. if (Array.isArray(tasks)) {
  4032. results = [];
  4033. pending = tasks.length;
  4034. } else {
  4035. keys$1 = Object.keys(tasks);
  4036. results = {};
  4037. pending = keys$1.length;
  4038. }
  4039. function done(err) {
  4040. function end() {
  4041. if (cb) cb(err, results);
  4042. cb = null;
  4043. }
  4044. if (isSync) queueMicrotask$1(end);
  4045. else end();
  4046. }
  4047. function each(i, err, result) {
  4048. results[i] = result;
  4049. if (--pending === 0 || err) done(err);
  4050. }
  4051. if (!pending) done(null);
  4052. else if (keys$1) keys$1.forEach(function(key) {
  4053. tasks[key](function(err, result) {
  4054. each(key, err, result);
  4055. });
  4056. });
  4057. else tasks.forEach(function(task, i) {
  4058. task(function(err, result) {
  4059. each(i, err, result);
  4060. });
  4061. });
  4062. isSync = false;
  4063. }
  4064. }) });
  4065. //#endregion
  4066. //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/constants.js
  4067. var require_constants = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/constants.js": ((exports) => {
  4068. Object.defineProperty(exports, "__esModule", { value: true });
  4069. const NODE_PROCESS_VERSION_PARTS = process.versions.node.split(".");
  4070. if (NODE_PROCESS_VERSION_PARTS[0] === void 0 || NODE_PROCESS_VERSION_PARTS[1] === void 0) throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);
  4071. const MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10);
  4072. const MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10);
  4073. const SUPPORTED_MAJOR_VERSION = 10;
  4074. const SUPPORTED_MINOR_VERSION = 10;
  4075. const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION;
  4076. const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION;
  4077. /**
  4078. * IS `true` for Node.js 10.10 and greater.
  4079. */
  4080. exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR;
  4081. }) });
  4082. //#endregion
  4083. //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/fs.js
  4084. var require_fs$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/fs.js": ((exports) => {
  4085. Object.defineProperty(exports, "__esModule", { value: true });
  4086. var DirentFromStats = class {
  4087. constructor(name, stats) {
  4088. this.name = name;
  4089. this.isBlockDevice = stats.isBlockDevice.bind(stats);
  4090. this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
  4091. this.isDirectory = stats.isDirectory.bind(stats);
  4092. this.isFIFO = stats.isFIFO.bind(stats);
  4093. this.isFile = stats.isFile.bind(stats);
  4094. this.isSocket = stats.isSocket.bind(stats);
  4095. this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
  4096. }
  4097. };
  4098. function createDirentFromStats(name, stats) {
  4099. return new DirentFromStats(name, stats);
  4100. }
  4101. exports.createDirentFromStats = createDirentFromStats;
  4102. }) });
  4103. //#endregion
  4104. //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/index.js
  4105. var require_utils = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/index.js": ((exports) => {
  4106. Object.defineProperty(exports, "__esModule", { value: true });
  4107. const fs$4 = require_fs$1();
  4108. exports.fs = fs$4;
  4109. }) });
  4110. //#endregion
  4111. //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/common.js
  4112. var require_common$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/common.js": ((exports) => {
  4113. Object.defineProperty(exports, "__esModule", { value: true });
  4114. function joinPathSegments$1(a, b, separator) {
  4115. /**
  4116. * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`).
  4117. */
  4118. if (a.endsWith(separator)) return a + b;
  4119. return a + separator + b;
  4120. }
  4121. exports.joinPathSegments = joinPathSegments$1;
  4122. }) });
  4123. //#endregion
  4124. //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/async.js
  4125. var require_async$4 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/async.js": ((exports) => {
  4126. Object.defineProperty(exports, "__esModule", { value: true });
  4127. const fsStat$5 = require_out$3();
  4128. const rpl = require_run_parallel();
  4129. const constants_1$1 = require_constants();
  4130. const utils$8 = require_utils();
  4131. const common$4 = require_common$1();
  4132. function read$1(directory, settings, callback) {
  4133. if (!settings.stats && constants_1$1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
  4134. readdirWithFileTypes$1(directory, settings, callback);
  4135. return;
  4136. }
  4137. readdir$1(directory, settings, callback);
  4138. }
  4139. exports.read = read$1;
  4140. function readdirWithFileTypes$1(directory, settings, callback) {
  4141. settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
  4142. if (readdirError !== null) {
  4143. callFailureCallback$1(callback, readdirError);
  4144. return;
  4145. }
  4146. const entries = dirents.map((dirent) => ({
  4147. dirent,
  4148. name: dirent.name,
  4149. path: common$4.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
  4150. }));
  4151. if (!settings.followSymbolicLinks) {
  4152. callSuccessCallback$1(callback, entries);
  4153. return;
  4154. }
  4155. rpl(entries.map((entry) => makeRplTaskEntry(entry, settings)), (rplError, rplEntries) => {
  4156. if (rplError !== null) {
  4157. callFailureCallback$1(callback, rplError);
  4158. return;
  4159. }
  4160. callSuccessCallback$1(callback, rplEntries);
  4161. });
  4162. });
  4163. }
  4164. exports.readdirWithFileTypes = readdirWithFileTypes$1;
  4165. function makeRplTaskEntry(entry, settings) {
  4166. return (done) => {
  4167. if (!entry.dirent.isSymbolicLink()) {
  4168. done(null, entry);
  4169. return;
  4170. }
  4171. settings.fs.stat(entry.path, (statError, stats) => {
  4172. if (statError !== null) {
  4173. if (settings.throwErrorOnBrokenSymbolicLink) {
  4174. done(statError);
  4175. return;
  4176. }
  4177. done(null, entry);
  4178. return;
  4179. }
  4180. entry.dirent = utils$8.fs.createDirentFromStats(entry.name, stats);
  4181. done(null, entry);
  4182. });
  4183. };
  4184. }
  4185. function readdir$1(directory, settings, callback) {
  4186. settings.fs.readdir(directory, (readdirError, names) => {
  4187. if (readdirError !== null) {
  4188. callFailureCallback$1(callback, readdirError);
  4189. return;
  4190. }
  4191. rpl(names.map((name) => {
  4192. const path$11 = common$4.joinPathSegments(directory, name, settings.pathSegmentSeparator);
  4193. return (done) => {
  4194. fsStat$5.stat(path$11, settings.fsStatSettings, (error, stats) => {
  4195. if (error !== null) {
  4196. done(error);
  4197. return;
  4198. }
  4199. const entry = {
  4200. name,
  4201. path: path$11,
  4202. dirent: utils$8.fs.createDirentFromStats(name, stats)
  4203. };
  4204. if (settings.stats) entry.stats = stats;
  4205. done(null, entry);
  4206. });
  4207. };
  4208. }), (rplError, entries) => {
  4209. if (rplError !== null) {
  4210. callFailureCallback$1(callback, rplError);
  4211. return;
  4212. }
  4213. callSuccessCallback$1(callback, entries);
  4214. });
  4215. });
  4216. }
  4217. exports.readdir = readdir$1;
  4218. function callFailureCallback$1(callback, error) {
  4219. callback(error);
  4220. }
  4221. function callSuccessCallback$1(callback, result) {
  4222. callback(null, result);
  4223. }
  4224. }) });
  4225. //#endregion
  4226. //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/sync.js
  4227. var require_sync$4 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/sync.js": ((exports) => {
  4228. Object.defineProperty(exports, "__esModule", { value: true });
  4229. const fsStat$4 = require_out$3();
  4230. const constants_1 = require_constants();
  4231. const utils$7 = require_utils();
  4232. const common$3 = require_common$1();
  4233. function read(directory, settings) {
  4234. if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) return readdirWithFileTypes(directory, settings);
  4235. return readdir(directory, settings);
  4236. }
  4237. exports.read = read;
  4238. function readdirWithFileTypes(directory, settings) {
  4239. return settings.fs.readdirSync(directory, { withFileTypes: true }).map((dirent) => {
  4240. const entry = {
  4241. dirent,
  4242. name: dirent.name,
  4243. path: common$3.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
  4244. };
  4245. if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) try {
  4246. const stats = settings.fs.statSync(entry.path);
  4247. entry.dirent = utils$7.fs.createDirentFromStats(entry.name, stats);
  4248. } catch (error) {
  4249. if (settings.throwErrorOnBrokenSymbolicLink) throw error;
  4250. }
  4251. return entry;
  4252. });
  4253. }
  4254. exports.readdirWithFileTypes = readdirWithFileTypes;
  4255. function readdir(directory, settings) {
  4256. return settings.fs.readdirSync(directory).map((name) => {
  4257. const entryPath = common$3.joinPathSegments(directory, name, settings.pathSegmentSeparator);
  4258. const stats = fsStat$4.statSync(entryPath, settings.fsStatSettings);
  4259. const entry = {
  4260. name,
  4261. path: entryPath,
  4262. dirent: utils$7.fs.createDirentFromStats(name, stats)
  4263. };
  4264. if (settings.stats) entry.stats = stats;
  4265. return entry;
  4266. });
  4267. }
  4268. exports.readdir = readdir;
  4269. }) });
  4270. //#endregion
  4271. //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/adapters/fs.js
  4272. var require_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/adapters/fs.js": ((exports) => {
  4273. Object.defineProperty(exports, "__esModule", { value: true });
  4274. exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
  4275. const fs$3 = __require("fs");
  4276. exports.FILE_SYSTEM_ADAPTER = {
  4277. lstat: fs$3.lstat,
  4278. stat: fs$3.stat,
  4279. lstatSync: fs$3.lstatSync,
  4280. statSync: fs$3.statSync,
  4281. readdir: fs$3.readdir,
  4282. readdirSync: fs$3.readdirSync
  4283. };
  4284. function createFileSystemAdapter(fsMethods) {
  4285. if (fsMethods === void 0) return exports.FILE_SYSTEM_ADAPTER;
  4286. return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
  4287. }
  4288. exports.createFileSystemAdapter = createFileSystemAdapter;
  4289. }) });
  4290. //#endregion
  4291. //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.js
  4292. var require_settings$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.js": ((exports) => {
  4293. Object.defineProperty(exports, "__esModule", { value: true });
  4294. const path$4 = __require("path");
  4295. const fsStat$3 = require_out$3();
  4296. const fs$2 = require_fs();
  4297. var Settings$2 = class {
  4298. constructor(_options = {}) {
  4299. this._options = _options;
  4300. this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
  4301. this.fs = fs$2.createFileSystemAdapter(this._options.fs);
  4302. this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$4.sep);
  4303. this.stats = this._getValue(this._options.stats, false);
  4304. this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
  4305. this.fsStatSettings = new fsStat$3.Settings({
  4306. followSymbolicLink: this.followSymbolicLinks,
  4307. fs: this.fs,
  4308. throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink
  4309. });
  4310. }
  4311. _getValue(option, value) {
  4312. return option !== null && option !== void 0 ? option : value;
  4313. }
  4314. };
  4315. exports.default = Settings$2;
  4316. }) });
  4317. //#endregion
  4318. //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/index.js
  4319. var require_out$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/index.js": ((exports) => {
  4320. Object.defineProperty(exports, "__esModule", { value: true });
  4321. const async = require_async$4();
  4322. const sync = require_sync$4();
  4323. const settings_1$2 = require_settings$2();
  4324. exports.Settings = settings_1$2.default;
  4325. function scandir(path$11, optionsOrSettingsOrCallback, callback) {
  4326. if (typeof optionsOrSettingsOrCallback === "function") {
  4327. async.read(path$11, getSettings$1(), optionsOrSettingsOrCallback);
  4328. return;
  4329. }
  4330. async.read(path$11, getSettings$1(optionsOrSettingsOrCallback), callback);
  4331. }
  4332. exports.scandir = scandir;
  4333. function scandirSync(path$11, optionsOrSettings) {
  4334. const settings = getSettings$1(optionsOrSettings);
  4335. return sync.read(path$11, settings);
  4336. }
  4337. exports.scandirSync = scandirSync;
  4338. function getSettings$1(settingsOrOptions = {}) {
  4339. if (settingsOrOptions instanceof settings_1$2.default) return settingsOrOptions;
  4340. return new settings_1$2.default(settingsOrOptions);
  4341. }
  4342. }) });
  4343. //#endregion
  4344. //#region ../../node_modules/.pnpm/reusify@1.1.0/node_modules/reusify/reusify.js
  4345. var require_reusify = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/reusify@1.1.0/node_modules/reusify/reusify.js": ((exports, module) => {
  4346. function reusify$1(Constructor) {
  4347. var head = new Constructor();
  4348. var tail = head;
  4349. function get() {
  4350. var current = head;
  4351. if (current.next) head = current.next;
  4352. else {
  4353. head = new Constructor();
  4354. tail = head;
  4355. }
  4356. current.next = null;
  4357. return current;
  4358. }
  4359. function release(obj) {
  4360. tail.next = obj;
  4361. tail = obj;
  4362. }
  4363. return {
  4364. get,
  4365. release
  4366. };
  4367. }
  4368. module.exports = reusify$1;
  4369. }) });
  4370. //#endregion
  4371. //#region ../../node_modules/.pnpm/fastq@1.19.1/node_modules/fastq/queue.js
  4372. var require_queue = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fastq@1.19.1/node_modules/fastq/queue.js": ((exports, module) => {
  4373. var reusify = require_reusify();
  4374. function fastqueue(context, worker, _concurrency) {
  4375. if (typeof context === "function") {
  4376. _concurrency = worker;
  4377. worker = context;
  4378. context = null;
  4379. }
  4380. if (!(_concurrency >= 1)) throw new Error("fastqueue concurrency must be equal to or greater than 1");
  4381. var cache = reusify(Task);
  4382. var queueHead = null;
  4383. var queueTail = null;
  4384. var _running = 0;
  4385. var errorHandler = null;
  4386. var self$1 = {
  4387. push,
  4388. drain: noop,
  4389. saturated: noop,
  4390. pause,
  4391. paused: false,
  4392. get concurrency() {
  4393. return _concurrency;
  4394. },
  4395. set concurrency(value) {
  4396. if (!(value >= 1)) throw new Error("fastqueue concurrency must be equal to or greater than 1");
  4397. _concurrency = value;
  4398. if (self$1.paused) return;
  4399. for (; queueHead && _running < _concurrency;) {
  4400. _running++;
  4401. release();
  4402. }
  4403. },
  4404. running,
  4405. resume,
  4406. idle,
  4407. length,
  4408. getQueue,
  4409. unshift,
  4410. empty: noop,
  4411. kill,
  4412. killAndDrain,
  4413. error
  4414. };
  4415. return self$1;
  4416. function running() {
  4417. return _running;
  4418. }
  4419. function pause() {
  4420. self$1.paused = true;
  4421. }
  4422. function length() {
  4423. var current = queueHead;
  4424. var counter = 0;
  4425. while (current) {
  4426. current = current.next;
  4427. counter++;
  4428. }
  4429. return counter;
  4430. }
  4431. function getQueue() {
  4432. var current = queueHead;
  4433. var tasks = [];
  4434. while (current) {
  4435. tasks.push(current.value);
  4436. current = current.next;
  4437. }
  4438. return tasks;
  4439. }
  4440. function resume() {
  4441. if (!self$1.paused) return;
  4442. self$1.paused = false;
  4443. if (queueHead === null) {
  4444. _running++;
  4445. release();
  4446. return;
  4447. }
  4448. for (; queueHead && _running < _concurrency;) {
  4449. _running++;
  4450. release();
  4451. }
  4452. }
  4453. function idle() {
  4454. return _running === 0 && self$1.length() === 0;
  4455. }
  4456. function push(value, done) {
  4457. var current = cache.get();
  4458. current.context = context;
  4459. current.release = release;
  4460. current.value = value;
  4461. current.callback = done || noop;
  4462. current.errorHandler = errorHandler;
  4463. if (_running >= _concurrency || self$1.paused) if (queueTail) {
  4464. queueTail.next = current;
  4465. queueTail = current;
  4466. } else {
  4467. queueHead = current;
  4468. queueTail = current;
  4469. self$1.saturated();
  4470. }
  4471. else {
  4472. _running++;
  4473. worker.call(context, current.value, current.worked);
  4474. }
  4475. }
  4476. function unshift(value, done) {
  4477. var current = cache.get();
  4478. current.context = context;
  4479. current.release = release;
  4480. current.value = value;
  4481. current.callback = done || noop;
  4482. current.errorHandler = errorHandler;
  4483. if (_running >= _concurrency || self$1.paused) if (queueHead) {
  4484. current.next = queueHead;
  4485. queueHead = current;
  4486. } else {
  4487. queueHead = current;
  4488. queueTail = current;
  4489. self$1.saturated();
  4490. }
  4491. else {
  4492. _running++;
  4493. worker.call(context, current.value, current.worked);
  4494. }
  4495. }
  4496. function release(holder) {
  4497. if (holder) cache.release(holder);
  4498. var next = queueHead;
  4499. if (next && _running <= _concurrency) if (!self$1.paused) {
  4500. if (queueTail === queueHead) queueTail = null;
  4501. queueHead = next.next;
  4502. next.next = null;
  4503. worker.call(context, next.value, next.worked);
  4504. if (queueTail === null) self$1.empty();
  4505. } else _running--;
  4506. else if (--_running === 0) self$1.drain();
  4507. }
  4508. function kill() {
  4509. queueHead = null;
  4510. queueTail = null;
  4511. self$1.drain = noop;
  4512. }
  4513. function killAndDrain() {
  4514. queueHead = null;
  4515. queueTail = null;
  4516. self$1.drain();
  4517. self$1.drain = noop;
  4518. }
  4519. function error(handler) {
  4520. errorHandler = handler;
  4521. }
  4522. }
  4523. function noop() {}
  4524. function Task() {
  4525. this.value = null;
  4526. this.callback = noop;
  4527. this.next = null;
  4528. this.release = noop;
  4529. this.context = null;
  4530. this.errorHandler = null;
  4531. var self$1 = this;
  4532. this.worked = function worked(err, result) {
  4533. var callback = self$1.callback;
  4534. var errorHandler = self$1.errorHandler;
  4535. var val = self$1.value;
  4536. self$1.value = null;
  4537. self$1.callback = noop;
  4538. if (self$1.errorHandler) errorHandler(err, val);
  4539. callback.call(self$1.context, err, result);
  4540. self$1.release(self$1);
  4541. };
  4542. }
  4543. function queueAsPromised(context, worker, _concurrency) {
  4544. if (typeof context === "function") {
  4545. _concurrency = worker;
  4546. worker = context;
  4547. context = null;
  4548. }
  4549. function asyncWrapper(arg, cb) {
  4550. worker.call(this, arg).then(function(res) {
  4551. cb(null, res);
  4552. }, cb);
  4553. }
  4554. var queue = fastqueue(context, asyncWrapper, _concurrency);
  4555. var pushCb = queue.push;
  4556. var unshiftCb = queue.unshift;
  4557. queue.push = push;
  4558. queue.unshift = unshift;
  4559. queue.drained = drained;
  4560. return queue;
  4561. function push(value) {
  4562. var p = new Promise(function(resolve$2, reject) {
  4563. pushCb(value, function(err, result) {
  4564. if (err) {
  4565. reject(err);
  4566. return;
  4567. }
  4568. resolve$2(result);
  4569. });
  4570. });
  4571. p.catch(noop);
  4572. return p;
  4573. }
  4574. function unshift(value) {
  4575. var p = new Promise(function(resolve$2, reject) {
  4576. unshiftCb(value, function(err, result) {
  4577. if (err) {
  4578. reject(err);
  4579. return;
  4580. }
  4581. resolve$2(result);
  4582. });
  4583. });
  4584. p.catch(noop);
  4585. return p;
  4586. }
  4587. function drained() {
  4588. return new Promise(function(resolve$2) {
  4589. process.nextTick(function() {
  4590. if (queue.idle()) resolve$2();
  4591. else {
  4592. var previousDrain = queue.drain;
  4593. queue.drain = function() {
  4594. if (typeof previousDrain === "function") previousDrain();
  4595. resolve$2();
  4596. queue.drain = previousDrain;
  4597. };
  4598. }
  4599. });
  4600. });
  4601. }
  4602. }
  4603. module.exports = fastqueue;
  4604. module.exports.promise = queueAsPromised;
  4605. }) });
  4606. //#endregion
  4607. //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/common.js
  4608. var require_common = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/common.js": ((exports) => {
  4609. Object.defineProperty(exports, "__esModule", { value: true });
  4610. function isFatalError(settings, error) {
  4611. if (settings.errorFilter === null) return true;
  4612. return !settings.errorFilter(error);
  4613. }
  4614. exports.isFatalError = isFatalError;
  4615. function isAppliedFilter(filter, value) {
  4616. return filter === null || filter(value);
  4617. }
  4618. exports.isAppliedFilter = isAppliedFilter;
  4619. function replacePathSegmentSeparator(filepath, separator) {
  4620. return filepath.split(/[/\\]/).join(separator);
  4621. }
  4622. exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
  4623. function joinPathSegments(a, b, separator) {
  4624. if (a === "") return b;
  4625. /**
  4626. * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`).
  4627. */
  4628. if (a.endsWith(separator)) return a + b;
  4629. return a + separator + b;
  4630. }
  4631. exports.joinPathSegments = joinPathSegments;
  4632. }) });
  4633. //#endregion
  4634. //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/reader.js
  4635. var require_reader$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/reader.js": ((exports) => {
  4636. Object.defineProperty(exports, "__esModule", { value: true });
  4637. const common$2 = require_common();
  4638. var Reader$1 = class {
  4639. constructor(_root, _settings) {
  4640. this._root = _root;
  4641. this._settings = _settings;
  4642. this._root = common$2.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator);
  4643. }
  4644. };
  4645. exports.default = Reader$1;
  4646. }) });
  4647. //#endregion
  4648. //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/async.js
  4649. var require_async$3 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/async.js": ((exports) => {
  4650. Object.defineProperty(exports, "__esModule", { value: true });
  4651. const events_1 = __require("events");
  4652. const fsScandir$2 = require_out$2();
  4653. const fastq = require_queue();
  4654. const common$1 = require_common();
  4655. const reader_1$4 = require_reader$1();
  4656. var AsyncReader = class extends reader_1$4.default {
  4657. constructor(_root, _settings) {
  4658. super(_root, _settings);
  4659. this._settings = _settings;
  4660. this._scandir = fsScandir$2.scandir;
  4661. this._emitter = new events_1.EventEmitter();
  4662. this._queue = fastq(this._worker.bind(this), this._settings.concurrency);
  4663. this._isFatalError = false;
  4664. this._isDestroyed = false;
  4665. this._queue.drain = () => {
  4666. if (!this._isFatalError) this._emitter.emit("end");
  4667. };
  4668. }
  4669. read() {
  4670. this._isFatalError = false;
  4671. this._isDestroyed = false;
  4672. setImmediate(() => {
  4673. this._pushToQueue(this._root, this._settings.basePath);
  4674. });
  4675. return this._emitter;
  4676. }
  4677. get isDestroyed() {
  4678. return this._isDestroyed;
  4679. }
  4680. destroy() {
  4681. if (this._isDestroyed) throw new Error("The reader is already destroyed");
  4682. this._isDestroyed = true;
  4683. this._queue.killAndDrain();
  4684. }
  4685. onEntry(callback) {
  4686. this._emitter.on("entry", callback);
  4687. }
  4688. onError(callback) {
  4689. this._emitter.once("error", callback);
  4690. }
  4691. onEnd(callback) {
  4692. this._emitter.once("end", callback);
  4693. }
  4694. _pushToQueue(directory, base) {
  4695. const queueItem = {
  4696. directory,
  4697. base
  4698. };
  4699. this._queue.push(queueItem, (error) => {
  4700. if (error !== null) this._handleError(error);
  4701. });
  4702. }
  4703. _worker(item, done) {
  4704. this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => {
  4705. if (error !== null) {
  4706. done(error, void 0);
  4707. return;
  4708. }
  4709. for (const entry of entries) this._handleEntry(entry, item.base);
  4710. done(null, void 0);
  4711. });
  4712. }
  4713. _handleError(error) {
  4714. if (this._isDestroyed || !common$1.isFatalError(this._settings, error)) return;
  4715. this._isFatalError = true;
  4716. this._isDestroyed = true;
  4717. this._emitter.emit("error", error);
  4718. }
  4719. _handleEntry(entry, base) {
  4720. if (this._isDestroyed || this._isFatalError) return;
  4721. const fullpath = entry.path;
  4722. if (base !== void 0) entry.path = common$1.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
  4723. if (common$1.isAppliedFilter(this._settings.entryFilter, entry)) this._emitEntry(entry);
  4724. if (entry.dirent.isDirectory() && common$1.isAppliedFilter(this._settings.deepFilter, entry)) this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
  4725. }
  4726. _emitEntry(entry) {
  4727. this._emitter.emit("entry", entry);
  4728. }
  4729. };
  4730. exports.default = AsyncReader;
  4731. }) });
  4732. //#endregion
  4733. //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/async.js
  4734. var require_async$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/async.js": ((exports) => {
  4735. Object.defineProperty(exports, "__esModule", { value: true });
  4736. const async_1$4 = require_async$3();
  4737. var AsyncProvider = class {
  4738. constructor(_root, _settings) {
  4739. this._root = _root;
  4740. this._settings = _settings;
  4741. this._reader = new async_1$4.default(this._root, this._settings);
  4742. this._storage = [];
  4743. }
  4744. read(callback) {
  4745. this._reader.onError((error) => {
  4746. callFailureCallback(callback, error);
  4747. });
  4748. this._reader.onEntry((entry) => {
  4749. this._storage.push(entry);
  4750. });
  4751. this._reader.onEnd(() => {
  4752. callSuccessCallback(callback, this._storage);
  4753. });
  4754. this._reader.read();
  4755. }
  4756. };
  4757. exports.default = AsyncProvider;
  4758. function callFailureCallback(callback, error) {
  4759. callback(error);
  4760. }
  4761. function callSuccessCallback(callback, entries) {
  4762. callback(null, entries);
  4763. }
  4764. }) });
  4765. //#endregion
  4766. //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/stream.js
  4767. var require_stream$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/stream.js": ((exports) => {
  4768. Object.defineProperty(exports, "__esModule", { value: true });
  4769. const stream_1$5 = __require("stream");
  4770. const async_1$3 = require_async$3();
  4771. var StreamProvider = class {
  4772. constructor(_root, _settings) {
  4773. this._root = _root;
  4774. this._settings = _settings;
  4775. this._reader = new async_1$3.default(this._root, this._settings);
  4776. this._stream = new stream_1$5.Readable({
  4777. objectMode: true,
  4778. read: () => {},
  4779. destroy: () => {
  4780. if (!this._reader.isDestroyed) this._reader.destroy();
  4781. }
  4782. });
  4783. }
  4784. read() {
  4785. this._reader.onError((error) => {
  4786. this._stream.emit("error", error);
  4787. });
  4788. this._reader.onEntry((entry) => {
  4789. this._stream.push(entry);
  4790. });
  4791. this._reader.onEnd(() => {
  4792. this._stream.push(null);
  4793. });
  4794. this._reader.read();
  4795. return this._stream;
  4796. }
  4797. };
  4798. exports.default = StreamProvider;
  4799. }) });
  4800. //#endregion
  4801. //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/sync.js
  4802. var require_sync$3 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/sync.js": ((exports) => {
  4803. Object.defineProperty(exports, "__esModule", { value: true });
  4804. const fsScandir$1 = require_out$2();
  4805. const common = require_common();
  4806. const reader_1$3 = require_reader$1();
  4807. var SyncReader = class extends reader_1$3.default {
  4808. constructor() {
  4809. super(...arguments);
  4810. this._scandir = fsScandir$1.scandirSync;
  4811. this._storage = [];
  4812. this._queue = /* @__PURE__ */ new Set();
  4813. }
  4814. read() {
  4815. this._pushToQueue(this._root, this._settings.basePath);
  4816. this._handleQueue();
  4817. return this._storage;
  4818. }
  4819. _pushToQueue(directory, base) {
  4820. this._queue.add({
  4821. directory,
  4822. base
  4823. });
  4824. }
  4825. _handleQueue() {
  4826. for (const item of this._queue.values()) this._handleDirectory(item.directory, item.base);
  4827. }
  4828. _handleDirectory(directory, base) {
  4829. try {
  4830. const entries = this._scandir(directory, this._settings.fsScandirSettings);
  4831. for (const entry of entries) this._handleEntry(entry, base);
  4832. } catch (error) {
  4833. this._handleError(error);
  4834. }
  4835. }
  4836. _handleError(error) {
  4837. if (!common.isFatalError(this._settings, error)) return;
  4838. throw error;
  4839. }
  4840. _handleEntry(entry, base) {
  4841. const fullpath = entry.path;
  4842. if (base !== void 0) entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
  4843. if (common.isAppliedFilter(this._settings.entryFilter, entry)) this._pushToStorage(entry);
  4844. if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
  4845. }
  4846. _pushToStorage(entry) {
  4847. this._storage.push(entry);
  4848. }
  4849. };
  4850. exports.default = SyncReader;
  4851. }) });
  4852. //#endregion
  4853. //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/sync.js
  4854. var require_sync$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/sync.js": ((exports) => {
  4855. Object.defineProperty(exports, "__esModule", { value: true });
  4856. const sync_1$3 = require_sync$3();
  4857. var SyncProvider = class {
  4858. constructor(_root, _settings) {
  4859. this._root = _root;
  4860. this._settings = _settings;
  4861. this._reader = new sync_1$3.default(this._root, this._settings);
  4862. }
  4863. read() {
  4864. return this._reader.read();
  4865. }
  4866. };
  4867. exports.default = SyncProvider;
  4868. }) });
  4869. //#endregion
  4870. //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.js
  4871. var require_settings$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.js": ((exports) => {
  4872. Object.defineProperty(exports, "__esModule", { value: true });
  4873. const path$3 = __require("path");
  4874. const fsScandir = require_out$2();
  4875. var Settings$1 = class {
  4876. constructor(_options = {}) {
  4877. this._options = _options;
  4878. this.basePath = this._getValue(this._options.basePath, void 0);
  4879. this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY);
  4880. this.deepFilter = this._getValue(this._options.deepFilter, null);
  4881. this.entryFilter = this._getValue(this._options.entryFilter, null);
  4882. this.errorFilter = this._getValue(this._options.errorFilter, null);
  4883. this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$3.sep);
  4884. this.fsScandirSettings = new fsScandir.Settings({
  4885. followSymbolicLinks: this._options.followSymbolicLinks,
  4886. fs: this._options.fs,
  4887. pathSegmentSeparator: this._options.pathSegmentSeparator,
  4888. stats: this._options.stats,
  4889. throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink
  4890. });
  4891. }
  4892. _getValue(option, value) {
  4893. return option !== null && option !== void 0 ? option : value;
  4894. }
  4895. };
  4896. exports.default = Settings$1;
  4897. }) });
  4898. //#endregion
  4899. //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/index.js
  4900. var require_out$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/index.js": ((exports) => {
  4901. Object.defineProperty(exports, "__esModule", { value: true });
  4902. const async_1$2 = require_async$2();
  4903. const stream_1$4 = require_stream$2();
  4904. const sync_1$2 = require_sync$2();
  4905. const settings_1$1 = require_settings$1();
  4906. exports.Settings = settings_1$1.default;
  4907. function walk(directory, optionsOrSettingsOrCallback, callback) {
  4908. if (typeof optionsOrSettingsOrCallback === "function") {
  4909. new async_1$2.default(directory, getSettings()).read(optionsOrSettingsOrCallback);
  4910. return;
  4911. }
  4912. new async_1$2.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);
  4913. }
  4914. exports.walk = walk;
  4915. function walkSync(directory, optionsOrSettings) {
  4916. const settings = getSettings(optionsOrSettings);
  4917. return new sync_1$2.default(directory, settings).read();
  4918. }
  4919. exports.walkSync = walkSync;
  4920. function walkStream(directory, optionsOrSettings) {
  4921. const settings = getSettings(optionsOrSettings);
  4922. return new stream_1$4.default(directory, settings).read();
  4923. }
  4924. exports.walkStream = walkStream;
  4925. function getSettings(settingsOrOptions = {}) {
  4926. if (settingsOrOptions instanceof settings_1$1.default) return settingsOrOptions;
  4927. return new settings_1$1.default(settingsOrOptions);
  4928. }
  4929. }) });
  4930. //#endregion
  4931. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/reader.js
  4932. var require_reader = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/reader.js": ((exports) => {
  4933. Object.defineProperty(exports, "__esModule", { value: true });
  4934. const path$2 = __require("path");
  4935. const fsStat$2 = require_out$3();
  4936. const utils$6 = require_utils$1();
  4937. var Reader = class {
  4938. constructor(_settings) {
  4939. this._settings = _settings;
  4940. this._fsStatSettings = new fsStat$2.Settings({
  4941. followSymbolicLink: this._settings.followSymbolicLinks,
  4942. fs: this._settings.fs,
  4943. throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
  4944. });
  4945. }
  4946. _getFullEntryPath(filepath) {
  4947. return path$2.resolve(this._settings.cwd, filepath);
  4948. }
  4949. _makeEntry(stats, pattern$1) {
  4950. const entry = {
  4951. name: pattern$1,
  4952. path: pattern$1,
  4953. dirent: utils$6.fs.createDirentFromStats(pattern$1, stats)
  4954. };
  4955. if (this._settings.stats) entry.stats = stats;
  4956. return entry;
  4957. }
  4958. _isFatalError(error) {
  4959. return !utils$6.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
  4960. }
  4961. };
  4962. exports.default = Reader;
  4963. }) });
  4964. //#endregion
  4965. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/stream.js
  4966. var require_stream$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/stream.js": ((exports) => {
  4967. Object.defineProperty(exports, "__esModule", { value: true });
  4968. const stream_1$3 = __require("stream");
  4969. const fsStat$1 = require_out$3();
  4970. const fsWalk$2 = require_out$1();
  4971. const reader_1$2 = require_reader();
  4972. var ReaderStream = class extends reader_1$2.default {
  4973. constructor() {
  4974. super(...arguments);
  4975. this._walkStream = fsWalk$2.walkStream;
  4976. this._stat = fsStat$1.stat;
  4977. }
  4978. dynamic(root, options$1) {
  4979. return this._walkStream(root, options$1);
  4980. }
  4981. static(patterns, options$1) {
  4982. const filepaths = patterns.map(this._getFullEntryPath, this);
  4983. const stream$1 = new stream_1$3.PassThrough({ objectMode: true });
  4984. stream$1._write = (index, _enc, done) => {
  4985. return this._getEntry(filepaths[index], patterns[index], options$1).then((entry) => {
  4986. if (entry !== null && options$1.entryFilter(entry)) stream$1.push(entry);
  4987. if (index === filepaths.length - 1) stream$1.end();
  4988. done();
  4989. }).catch(done);
  4990. };
  4991. for (let i = 0; i < filepaths.length; i++) stream$1.write(i);
  4992. return stream$1;
  4993. }
  4994. _getEntry(filepath, pattern$1, options$1) {
  4995. return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern$1)).catch((error) => {
  4996. if (options$1.errorFilter(error)) return null;
  4997. throw error;
  4998. });
  4999. }
  5000. _getStat(filepath) {
  5001. return new Promise((resolve$2, reject) => {
  5002. this._stat(filepath, this._fsStatSettings, (error, stats) => {
  5003. return error === null ? resolve$2(stats) : reject(error);
  5004. });
  5005. });
  5006. }
  5007. };
  5008. exports.default = ReaderStream;
  5009. }) });
  5010. //#endregion
  5011. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/async.js
  5012. var require_async$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/async.js": ((exports) => {
  5013. Object.defineProperty(exports, "__esModule", { value: true });
  5014. const fsWalk$1 = require_out$1();
  5015. const reader_1$1 = require_reader();
  5016. const stream_1$2 = require_stream$1();
  5017. var ReaderAsync = class extends reader_1$1.default {
  5018. constructor() {
  5019. super(...arguments);
  5020. this._walkAsync = fsWalk$1.walk;
  5021. this._readerStream = new stream_1$2.default(this._settings);
  5022. }
  5023. dynamic(root, options$1) {
  5024. return new Promise((resolve$2, reject) => {
  5025. this._walkAsync(root, options$1, (error, entries) => {
  5026. if (error === null) resolve$2(entries);
  5027. else reject(error);
  5028. });
  5029. });
  5030. }
  5031. async static(patterns, options$1) {
  5032. const entries = [];
  5033. const stream$1 = this._readerStream.static(patterns, options$1);
  5034. return new Promise((resolve$2, reject) => {
  5035. stream$1.once("error", reject);
  5036. stream$1.on("data", (entry) => entries.push(entry));
  5037. stream$1.once("end", () => resolve$2(entries));
  5038. });
  5039. }
  5040. };
  5041. exports.default = ReaderAsync;
  5042. }) });
  5043. //#endregion
  5044. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/matchers/matcher.js
  5045. var require_matcher = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/matchers/matcher.js": ((exports) => {
  5046. Object.defineProperty(exports, "__esModule", { value: true });
  5047. const utils$5 = require_utils$1();
  5048. var Matcher = class {
  5049. constructor(_patterns, _settings, _micromatchOptions) {
  5050. this._patterns = _patterns;
  5051. this._settings = _settings;
  5052. this._micromatchOptions = _micromatchOptions;
  5053. this._storage = [];
  5054. this._fillStorage();
  5055. }
  5056. _fillStorage() {
  5057. for (const pattern$1 of this._patterns) {
  5058. const segments = this._getPatternSegments(pattern$1);
  5059. const sections = this._splitSegmentsIntoSections(segments);
  5060. this._storage.push({
  5061. complete: sections.length <= 1,
  5062. pattern: pattern$1,
  5063. segments,
  5064. sections
  5065. });
  5066. }
  5067. }
  5068. _getPatternSegments(pattern$1) {
  5069. return utils$5.pattern.getPatternParts(pattern$1, this._micromatchOptions).map((part) => {
  5070. if (!utils$5.pattern.isDynamicPattern(part, this._settings)) return {
  5071. dynamic: false,
  5072. pattern: part
  5073. };
  5074. return {
  5075. dynamic: true,
  5076. pattern: part,
  5077. patternRe: utils$5.pattern.makeRe(part, this._micromatchOptions)
  5078. };
  5079. });
  5080. }
  5081. _splitSegmentsIntoSections(segments) {
  5082. return utils$5.array.splitWhen(segments, (segment) => segment.dynamic && utils$5.pattern.hasGlobStar(segment.pattern));
  5083. }
  5084. };
  5085. exports.default = Matcher;
  5086. }) });
  5087. //#endregion
  5088. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/matchers/partial.js
  5089. var require_partial = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/matchers/partial.js": ((exports) => {
  5090. Object.defineProperty(exports, "__esModule", { value: true });
  5091. const matcher_1 = require_matcher();
  5092. var PartialMatcher = class extends matcher_1.default {
  5093. match(filepath) {
  5094. const parts = filepath.split("/");
  5095. const levels = parts.length;
  5096. const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
  5097. for (const pattern$1 of patterns) {
  5098. const section = pattern$1.sections[0];
  5099. /**
  5100. * In this case, the pattern has a globstar and we must read all directories unconditionally,
  5101. * but only if the level has reached the end of the first group.
  5102. *
  5103. * fixtures/{a,b}/**
  5104. * ^ true/false ^ always true
  5105. */
  5106. if (!pattern$1.complete && levels > section.length) return true;
  5107. if (parts.every((part, index) => {
  5108. const segment = pattern$1.segments[index];
  5109. if (segment.dynamic && segment.patternRe.test(part)) return true;
  5110. if (!segment.dynamic && segment.pattern === part) return true;
  5111. return false;
  5112. })) return true;
  5113. }
  5114. return false;
  5115. }
  5116. };
  5117. exports.default = PartialMatcher;
  5118. }) });
  5119. //#endregion
  5120. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/deep.js
  5121. var require_deep = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/deep.js": ((exports) => {
  5122. Object.defineProperty(exports, "__esModule", { value: true });
  5123. const utils$4 = require_utils$1();
  5124. const partial_1 = require_partial();
  5125. var DeepFilter = class {
  5126. constructor(_settings, _micromatchOptions) {
  5127. this._settings = _settings;
  5128. this._micromatchOptions = _micromatchOptions;
  5129. }
  5130. getFilter(basePath, positive, negative) {
  5131. const matcher = this._getMatcher(positive);
  5132. const negativeRe = this._getNegativePatternsRe(negative);
  5133. return (entry) => this._filter(basePath, entry, matcher, negativeRe);
  5134. }
  5135. _getMatcher(patterns) {
  5136. return new partial_1.default(patterns, this._settings, this._micromatchOptions);
  5137. }
  5138. _getNegativePatternsRe(patterns) {
  5139. const affectDepthOfReadingPatterns = patterns.filter(utils$4.pattern.isAffectDepthOfReadingPattern);
  5140. return utils$4.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
  5141. }
  5142. _filter(basePath, entry, matcher, negativeRe) {
  5143. if (this._isSkippedByDeep(basePath, entry.path)) return false;
  5144. if (this._isSkippedSymbolicLink(entry)) return false;
  5145. const filepath = utils$4.path.removeLeadingDotSegment(entry.path);
  5146. if (this._isSkippedByPositivePatterns(filepath, matcher)) return false;
  5147. return this._isSkippedByNegativePatterns(filepath, negativeRe);
  5148. }
  5149. _isSkippedByDeep(basePath, entryPath) {
  5150. /**
  5151. * Avoid unnecessary depth calculations when it doesn't matter.
  5152. */
  5153. if (this._settings.deep === Infinity) return false;
  5154. return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
  5155. }
  5156. _getEntryLevel(basePath, entryPath) {
  5157. const entryPathDepth = entryPath.split("/").length;
  5158. if (basePath === "") return entryPathDepth;
  5159. return entryPathDepth - basePath.split("/").length;
  5160. }
  5161. _isSkippedSymbolicLink(entry) {
  5162. return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
  5163. }
  5164. _isSkippedByPositivePatterns(entryPath, matcher) {
  5165. return !this._settings.baseNameMatch && !matcher.match(entryPath);
  5166. }
  5167. _isSkippedByNegativePatterns(entryPath, patternsRe) {
  5168. return !utils$4.pattern.matchAny(entryPath, patternsRe);
  5169. }
  5170. };
  5171. exports.default = DeepFilter;
  5172. }) });
  5173. //#endregion
  5174. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/entry.js
  5175. var require_entry$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/entry.js": ((exports) => {
  5176. Object.defineProperty(exports, "__esModule", { value: true });
  5177. const utils$3 = require_utils$1();
  5178. var EntryFilter = class {
  5179. constructor(_settings, _micromatchOptions) {
  5180. this._settings = _settings;
  5181. this._micromatchOptions = _micromatchOptions;
  5182. this.index = /* @__PURE__ */ new Map();
  5183. }
  5184. getFilter(positive, negative) {
  5185. const [absoluteNegative, relativeNegative] = utils$3.pattern.partitionAbsoluteAndRelative(negative);
  5186. const patterns = {
  5187. positive: { all: utils$3.pattern.convertPatternsToRe(positive, this._micromatchOptions) },
  5188. negative: {
  5189. absolute: utils$3.pattern.convertPatternsToRe(absoluteNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })),
  5190. relative: utils$3.pattern.convertPatternsToRe(relativeNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true }))
  5191. }
  5192. };
  5193. return (entry) => this._filter(entry, patterns);
  5194. }
  5195. _filter(entry, patterns) {
  5196. const filepath = utils$3.path.removeLeadingDotSegment(entry.path);
  5197. if (this._settings.unique && this._isDuplicateEntry(filepath)) return false;
  5198. if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) return false;
  5199. const isMatched = this._isMatchToPatternsSet(filepath, patterns, entry.dirent.isDirectory());
  5200. if (this._settings.unique && isMatched) this._createIndexRecord(filepath);
  5201. return isMatched;
  5202. }
  5203. _isDuplicateEntry(filepath) {
  5204. return this.index.has(filepath);
  5205. }
  5206. _createIndexRecord(filepath) {
  5207. this.index.set(filepath, void 0);
  5208. }
  5209. _onlyFileFilter(entry) {
  5210. return this._settings.onlyFiles && !entry.dirent.isFile();
  5211. }
  5212. _onlyDirectoryFilter(entry) {
  5213. return this._settings.onlyDirectories && !entry.dirent.isDirectory();
  5214. }
  5215. _isMatchToPatternsSet(filepath, patterns, isDirectory) {
  5216. if (!this._isMatchToPatterns(filepath, patterns.positive.all, isDirectory)) return false;
  5217. if (this._isMatchToPatterns(filepath, patterns.negative.relative, isDirectory)) return false;
  5218. if (this._isMatchToAbsoluteNegative(filepath, patterns.negative.absolute, isDirectory)) return false;
  5219. return true;
  5220. }
  5221. _isMatchToAbsoluteNegative(filepath, patternsRe, isDirectory) {
  5222. if (patternsRe.length === 0) return false;
  5223. const fullpath = utils$3.path.makeAbsolute(this._settings.cwd, filepath);
  5224. return this._isMatchToPatterns(fullpath, patternsRe, isDirectory);
  5225. }
  5226. _isMatchToPatterns(filepath, patternsRe, isDirectory) {
  5227. if (patternsRe.length === 0) return false;
  5228. const isMatched = utils$3.pattern.matchAny(filepath, patternsRe);
  5229. if (!isMatched && isDirectory) return utils$3.pattern.matchAny(filepath + "/", patternsRe);
  5230. return isMatched;
  5231. }
  5232. };
  5233. exports.default = EntryFilter;
  5234. }) });
  5235. //#endregion
  5236. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/error.js
  5237. var require_error = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/error.js": ((exports) => {
  5238. Object.defineProperty(exports, "__esModule", { value: true });
  5239. const utils$2 = require_utils$1();
  5240. var ErrorFilter = class {
  5241. constructor(_settings) {
  5242. this._settings = _settings;
  5243. }
  5244. getFilter() {
  5245. return (error) => this._isNonFatalError(error);
  5246. }
  5247. _isNonFatalError(error) {
  5248. return utils$2.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
  5249. }
  5250. };
  5251. exports.default = ErrorFilter;
  5252. }) });
  5253. //#endregion
  5254. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/transformers/entry.js
  5255. var require_entry = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/transformers/entry.js": ((exports) => {
  5256. Object.defineProperty(exports, "__esModule", { value: true });
  5257. const utils$1 = require_utils$1();
  5258. var EntryTransformer = class {
  5259. constructor(_settings) {
  5260. this._settings = _settings;
  5261. }
  5262. getTransformer() {
  5263. return (entry) => this._transform(entry);
  5264. }
  5265. _transform(entry) {
  5266. let filepath = entry.path;
  5267. if (this._settings.absolute) {
  5268. filepath = utils$1.path.makeAbsolute(this._settings.cwd, filepath);
  5269. filepath = utils$1.path.unixify(filepath);
  5270. }
  5271. if (this._settings.markDirectories && entry.dirent.isDirectory()) filepath += "/";
  5272. if (!this._settings.objectMode) return filepath;
  5273. return Object.assign(Object.assign({}, entry), { path: filepath });
  5274. }
  5275. };
  5276. exports.default = EntryTransformer;
  5277. }) });
  5278. //#endregion
  5279. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/provider.js
  5280. var require_provider = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/provider.js": ((exports) => {
  5281. Object.defineProperty(exports, "__esModule", { value: true });
  5282. const path$1 = __require("path");
  5283. const deep_1 = require_deep();
  5284. const entry_1 = require_entry$1();
  5285. const error_1 = require_error();
  5286. const entry_2 = require_entry();
  5287. var Provider = class {
  5288. constructor(_settings) {
  5289. this._settings = _settings;
  5290. this.errorFilter = new error_1.default(this._settings);
  5291. this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
  5292. this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
  5293. this.entryTransformer = new entry_2.default(this._settings);
  5294. }
  5295. _getRootDirectory(task) {
  5296. return path$1.resolve(this._settings.cwd, task.base);
  5297. }
  5298. _getReaderOptions(task) {
  5299. const basePath = task.base === "." ? "" : task.base;
  5300. return {
  5301. basePath,
  5302. pathSegmentSeparator: "/",
  5303. concurrency: this._settings.concurrency,
  5304. deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
  5305. entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
  5306. errorFilter: this.errorFilter.getFilter(),
  5307. followSymbolicLinks: this._settings.followSymbolicLinks,
  5308. fs: this._settings.fs,
  5309. stats: this._settings.stats,
  5310. throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
  5311. transform: this.entryTransformer.getTransformer()
  5312. };
  5313. }
  5314. _getMicromatchOptions() {
  5315. return {
  5316. dot: this._settings.dot,
  5317. matchBase: this._settings.baseNameMatch,
  5318. nobrace: !this._settings.braceExpansion,
  5319. nocase: !this._settings.caseSensitiveMatch,
  5320. noext: !this._settings.extglob,
  5321. noglobstar: !this._settings.globstar,
  5322. posix: true,
  5323. strictSlashes: false
  5324. };
  5325. }
  5326. };
  5327. exports.default = Provider;
  5328. }) });
  5329. //#endregion
  5330. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/async.js
  5331. var require_async = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/async.js": ((exports) => {
  5332. Object.defineProperty(exports, "__esModule", { value: true });
  5333. const async_1$1 = require_async$1();
  5334. const provider_1$2 = require_provider();
  5335. var ProviderAsync = class extends provider_1$2.default {
  5336. constructor() {
  5337. super(...arguments);
  5338. this._reader = new async_1$1.default(this._settings);
  5339. }
  5340. async read(task) {
  5341. const root = this._getRootDirectory(task);
  5342. const options$1 = this._getReaderOptions(task);
  5343. return (await this.api(root, task, options$1)).map((entry) => options$1.transform(entry));
  5344. }
  5345. api(root, task, options$1) {
  5346. if (task.dynamic) return this._reader.dynamic(root, options$1);
  5347. return this._reader.static(task.patterns, options$1);
  5348. }
  5349. };
  5350. exports.default = ProviderAsync;
  5351. }) });
  5352. //#endregion
  5353. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/stream.js
  5354. var require_stream = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/stream.js": ((exports) => {
  5355. Object.defineProperty(exports, "__esModule", { value: true });
  5356. const stream_1$1 = __require("stream");
  5357. const stream_2 = require_stream$1();
  5358. const provider_1$1 = require_provider();
  5359. var ProviderStream = class extends provider_1$1.default {
  5360. constructor() {
  5361. super(...arguments);
  5362. this._reader = new stream_2.default(this._settings);
  5363. }
  5364. read(task) {
  5365. const root = this._getRootDirectory(task);
  5366. const options$1 = this._getReaderOptions(task);
  5367. const source = this.api(root, task, options$1);
  5368. const destination = new stream_1$1.Readable({
  5369. objectMode: true,
  5370. read: () => {}
  5371. });
  5372. source.once("error", (error) => destination.emit("error", error)).on("data", (entry) => destination.emit("data", options$1.transform(entry))).once("end", () => destination.emit("end"));
  5373. destination.once("close", () => source.destroy());
  5374. return destination;
  5375. }
  5376. api(root, task, options$1) {
  5377. if (task.dynamic) return this._reader.dynamic(root, options$1);
  5378. return this._reader.static(task.patterns, options$1);
  5379. }
  5380. };
  5381. exports.default = ProviderStream;
  5382. }) });
  5383. //#endregion
  5384. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/sync.js
  5385. var require_sync$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/sync.js": ((exports) => {
  5386. Object.defineProperty(exports, "__esModule", { value: true });
  5387. const fsStat = require_out$3();
  5388. const fsWalk = require_out$1();
  5389. const reader_1 = require_reader();
  5390. var ReaderSync = class extends reader_1.default {
  5391. constructor() {
  5392. super(...arguments);
  5393. this._walkSync = fsWalk.walkSync;
  5394. this._statSync = fsStat.statSync;
  5395. }
  5396. dynamic(root, options$1) {
  5397. return this._walkSync(root, options$1);
  5398. }
  5399. static(patterns, options$1) {
  5400. const entries = [];
  5401. for (const pattern$1 of patterns) {
  5402. const filepath = this._getFullEntryPath(pattern$1);
  5403. const entry = this._getEntry(filepath, pattern$1, options$1);
  5404. if (entry === null || !options$1.entryFilter(entry)) continue;
  5405. entries.push(entry);
  5406. }
  5407. return entries;
  5408. }
  5409. _getEntry(filepath, pattern$1, options$1) {
  5410. try {
  5411. const stats = this._getStat(filepath);
  5412. return this._makeEntry(stats, pattern$1);
  5413. } catch (error) {
  5414. if (options$1.errorFilter(error)) return null;
  5415. throw error;
  5416. }
  5417. }
  5418. _getStat(filepath) {
  5419. return this._statSync(filepath, this._fsStatSettings);
  5420. }
  5421. };
  5422. exports.default = ReaderSync;
  5423. }) });
  5424. //#endregion
  5425. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/sync.js
  5426. var require_sync = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/sync.js": ((exports) => {
  5427. Object.defineProperty(exports, "__esModule", { value: true });
  5428. const sync_1$1 = require_sync$1();
  5429. const provider_1 = require_provider();
  5430. var ProviderSync = class extends provider_1.default {
  5431. constructor() {
  5432. super(...arguments);
  5433. this._reader = new sync_1$1.default(this._settings);
  5434. }
  5435. read(task) {
  5436. const root = this._getRootDirectory(task);
  5437. const options$1 = this._getReaderOptions(task);
  5438. return this.api(root, task, options$1).map(options$1.transform);
  5439. }
  5440. api(root, task, options$1) {
  5441. if (task.dynamic) return this._reader.dynamic(root, options$1);
  5442. return this._reader.static(task.patterns, options$1);
  5443. }
  5444. };
  5445. exports.default = ProviderSync;
  5446. }) });
  5447. //#endregion
  5448. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/settings.js
  5449. var require_settings = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/settings.js": ((exports) => {
  5450. Object.defineProperty(exports, "__esModule", { value: true });
  5451. exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
  5452. const fs$1 = __require("fs");
  5453. const os = __require("os");
  5454. /**
  5455. * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
  5456. * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107
  5457. */
  5458. const CPU_COUNT = Math.max(os.cpus().length, 1);
  5459. exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
  5460. lstat: fs$1.lstat,
  5461. lstatSync: fs$1.lstatSync,
  5462. stat: fs$1.stat,
  5463. statSync: fs$1.statSync,
  5464. readdir: fs$1.readdir,
  5465. readdirSync: fs$1.readdirSync
  5466. };
  5467. var Settings = class {
  5468. constructor(_options = {}) {
  5469. this._options = _options;
  5470. this.absolute = this._getValue(this._options.absolute, false);
  5471. this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
  5472. this.braceExpansion = this._getValue(this._options.braceExpansion, true);
  5473. this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
  5474. this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
  5475. this.cwd = this._getValue(this._options.cwd, process.cwd());
  5476. this.deep = this._getValue(this._options.deep, Infinity);
  5477. this.dot = this._getValue(this._options.dot, false);
  5478. this.extglob = this._getValue(this._options.extglob, true);
  5479. this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
  5480. this.fs = this._getFileSystemMethods(this._options.fs);
  5481. this.globstar = this._getValue(this._options.globstar, true);
  5482. this.ignore = this._getValue(this._options.ignore, []);
  5483. this.markDirectories = this._getValue(this._options.markDirectories, false);
  5484. this.objectMode = this._getValue(this._options.objectMode, false);
  5485. this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
  5486. this.onlyFiles = this._getValue(this._options.onlyFiles, true);
  5487. this.stats = this._getValue(this._options.stats, false);
  5488. this.suppressErrors = this._getValue(this._options.suppressErrors, false);
  5489. this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
  5490. this.unique = this._getValue(this._options.unique, true);
  5491. if (this.onlyDirectories) this.onlyFiles = false;
  5492. if (this.stats) this.objectMode = true;
  5493. this.ignore = [].concat(this.ignore);
  5494. }
  5495. _getValue(option, value) {
  5496. return option === void 0 ? value : option;
  5497. }
  5498. _getFileSystemMethods(methods$1 = {}) {
  5499. return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods$1);
  5500. }
  5501. };
  5502. exports.default = Settings;
  5503. }) });
  5504. //#endregion
  5505. //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/index.js
  5506. var require_out = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/index.js": ((exports, module) => {
  5507. const taskManager = require_tasks();
  5508. const async_1 = require_async();
  5509. const stream_1 = require_stream();
  5510. const sync_1 = require_sync();
  5511. const settings_1 = require_settings();
  5512. const utils = require_utils$1();
  5513. async function FastGlob(source, options$1) {
  5514. assertPatternsInput(source);
  5515. const works = getWorks(source, async_1.default, options$1);
  5516. const result = await Promise.all(works);
  5517. return utils.array.flatten(result);
  5518. }
  5519. (function(FastGlob$1) {
  5520. FastGlob$1.glob = FastGlob$1;
  5521. FastGlob$1.globSync = sync$2;
  5522. FastGlob$1.globStream = stream$1;
  5523. FastGlob$1.async = FastGlob$1;
  5524. function sync$2(source, options$1) {
  5525. assertPatternsInput(source);
  5526. const works = getWorks(source, sync_1.default, options$1);
  5527. return utils.array.flatten(works);
  5528. }
  5529. FastGlob$1.sync = sync$2;
  5530. function stream$1(source, options$1) {
  5531. assertPatternsInput(source);
  5532. const works = getWorks(source, stream_1.default, options$1);
  5533. /**
  5534. * The stream returned by the provider cannot work with an asynchronous iterator.
  5535. * To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams.
  5536. * This affects performance (+25%). I don't see best solution right now.
  5537. */
  5538. return utils.stream.merge(works);
  5539. }
  5540. FastGlob$1.stream = stream$1;
  5541. function generateTasks(source, options$1) {
  5542. assertPatternsInput(source);
  5543. const patterns = [].concat(source);
  5544. const settings = new settings_1.default(options$1);
  5545. return taskManager.generate(patterns, settings);
  5546. }
  5547. FastGlob$1.generateTasks = generateTasks;
  5548. function isDynamicPattern$1(source, options$1) {
  5549. assertPatternsInput(source);
  5550. const settings = new settings_1.default(options$1);
  5551. return utils.pattern.isDynamicPattern(source, settings);
  5552. }
  5553. FastGlob$1.isDynamicPattern = isDynamicPattern$1;
  5554. function escapePath(source) {
  5555. assertPatternsInput(source);
  5556. return utils.path.escape(source);
  5557. }
  5558. FastGlob$1.escapePath = escapePath;
  5559. function convertPathToPattern(source) {
  5560. assertPatternsInput(source);
  5561. return utils.path.convertPathToPattern(source);
  5562. }
  5563. FastGlob$1.convertPathToPattern = convertPathToPattern;
  5564. (function(posix) {
  5565. function escapePath$1(source) {
  5566. assertPatternsInput(source);
  5567. return utils.path.escapePosixPath(source);
  5568. }
  5569. posix.escapePath = escapePath$1;
  5570. function convertPathToPattern$1(source) {
  5571. assertPatternsInput(source);
  5572. return utils.path.convertPosixPathToPattern(source);
  5573. }
  5574. posix.convertPathToPattern = convertPathToPattern$1;
  5575. })(FastGlob$1.posix || (FastGlob$1.posix = {}));
  5576. (function(win32$1) {
  5577. function escapePath$1(source) {
  5578. assertPatternsInput(source);
  5579. return utils.path.escapeWindowsPath(source);
  5580. }
  5581. win32$1.escapePath = escapePath$1;
  5582. function convertPathToPattern$1(source) {
  5583. assertPatternsInput(source);
  5584. return utils.path.convertWindowsPathToPattern(source);
  5585. }
  5586. win32$1.convertPathToPattern = convertPathToPattern$1;
  5587. })(FastGlob$1.win32 || (FastGlob$1.win32 = {}));
  5588. })(FastGlob || (FastGlob = {}));
  5589. function getWorks(source, _Provider, options$1) {
  5590. const patterns = [].concat(source);
  5591. const settings = new settings_1.default(options$1);
  5592. const tasks = taskManager.generate(patterns, settings);
  5593. const provider = new _Provider(settings);
  5594. return tasks.map(provider.read, provider);
  5595. }
  5596. function assertPatternsInput(input) {
  5597. if (![].concat(input).every((item) => utils.string.isString(item) && !utils.string.isEmpty(item))) throw new TypeError("Patterns must be a string (non empty) or an array of strings");
  5598. }
  5599. module.exports = FastGlob;
  5600. }) });
  5601. //#endregion
  5602. //#region ../../node_modules/.pnpm/image-meta@0.2.2/node_modules/image-meta/dist/index.mjs
  5603. var import_out = /* @__PURE__ */ __toESM(require_out(), 1);
  5604. const decoder = new TextDecoder();
  5605. const toUTF8String = (input, start = 0, end = input.length) => decoder.decode(input.slice(start, end));
  5606. const toHexString = (input, start = 0, end = input.length) => input.slice(start, end).reduce((memo, i) => memo + ("0" + i.toString(16)).slice(-2), "");
  5607. const readInt16LE = (input, offset = 0) => {
  5608. const val = input[offset] + input[offset + 1] * 2 ** 8;
  5609. return val | (val & 2 ** 15) * 131070;
  5610. };
  5611. const readUInt16BE = (input, offset = 0) => input[offset] * 2 ** 8 + input[offset + 1];
  5612. const readUInt16LE = (input, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8;
  5613. const readUInt24LE = (input, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8 + input[offset + 2] * 2 ** 16;
  5614. const readInt32LE = (input, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8 + input[offset + 2] * 2 ** 16 + (input[offset + 3] << 24);
  5615. const readUInt32BE = (input, offset = 0) => input[offset] * 2 ** 24 + input[offset + 1] * 2 ** 16 + input[offset + 2] * 2 ** 8 + input[offset + 3];
  5616. const readUInt32LE = (input, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8 + input[offset + 2] * 2 ** 16 + input[offset + 3] * 2 ** 24;
  5617. const methods = {
  5618. readUInt16BE,
  5619. readUInt16LE,
  5620. readUInt32BE,
  5621. readUInt32LE
  5622. };
  5623. function readUInt(input, bits, offset, isBigEndian) {
  5624. offset = offset || 0;
  5625. const endian = isBigEndian ? "BE" : "LE";
  5626. return methods["readUInt" + bits + endian](input, offset);
  5627. }
  5628. const BMP = {
  5629. validate: (input) => toUTF8String(input, 0, 2) === "BM",
  5630. calculate: (input) => ({
  5631. height: Math.abs(readInt32LE(input, 22)),
  5632. width: readUInt32LE(input, 18)
  5633. })
  5634. };
  5635. const TYPE_ICON = 1;
  5636. const SIZE_HEADER$1 = 6;
  5637. const SIZE_IMAGE_ENTRY = 16;
  5638. function getSizeFromOffset(input, offset) {
  5639. const value = input[offset];
  5640. return value === 0 ? 256 : value;
  5641. }
  5642. function getImageSize$1(input, imageIndex) {
  5643. const offset = SIZE_HEADER$1 + imageIndex * SIZE_IMAGE_ENTRY;
  5644. return {
  5645. height: getSizeFromOffset(input, offset + 1),
  5646. width: getSizeFromOffset(input, offset)
  5647. };
  5648. }
  5649. const ICO = {
  5650. validate(input) {
  5651. const reserved = readUInt16LE(input, 0);
  5652. const imageCount = readUInt16LE(input, 4);
  5653. if (reserved !== 0 || imageCount === 0) return false;
  5654. return readUInt16LE(input, 2) === TYPE_ICON;
  5655. },
  5656. calculate(input) {
  5657. const nbImages = readUInt16LE(input, 4);
  5658. const imageSize = getImageSize$1(input, 0);
  5659. if (nbImages === 1) return imageSize;
  5660. const imgs = [imageSize];
  5661. for (let imageIndex = 1; imageIndex < nbImages; imageIndex += 1) imgs.push(getImageSize$1(input, imageIndex));
  5662. return {
  5663. height: imageSize.height,
  5664. images: imgs,
  5665. width: imageSize.width
  5666. };
  5667. }
  5668. };
  5669. const TYPE_CURSOR = 2;
  5670. const CUR = {
  5671. validate(input) {
  5672. const reserved = readUInt16LE(input, 0);
  5673. const imageCount = readUInt16LE(input, 4);
  5674. if (reserved !== 0 || imageCount === 0) return false;
  5675. return readUInt16LE(input, 2) === TYPE_CURSOR;
  5676. },
  5677. calculate: (input) => ICO.calculate(input)
  5678. };
  5679. const DDS = {
  5680. validate: (input) => readUInt32LE(input, 0) === 542327876,
  5681. calculate: (input) => ({
  5682. height: readUInt32LE(input, 12),
  5683. width: readUInt32LE(input, 16)
  5684. })
  5685. };
  5686. const gifRegexp = /^GIF8[79]a/;
  5687. const GIF = {
  5688. validate: (input) => gifRegexp.test(toUTF8String(input, 0, 6)),
  5689. calculate: (input) => ({
  5690. height: readUInt16LE(input, 8),
  5691. width: readUInt16LE(input, 6)
  5692. })
  5693. };
  5694. const HEIC = {
  5695. validate: (input) => {
  5696. const ftypBox = findBox$1(input, "ftyp");
  5697. if (!ftypBox) return false;
  5698. const majorBrand = toUTF8String(input, ftypBox.offset + 8, ftypBox.offset + 12);
  5699. return [
  5700. "heic",
  5701. "heix",
  5702. "hevc",
  5703. "hevx",
  5704. "mif1",
  5705. "msf1"
  5706. ].includes(majorBrand);
  5707. },
  5708. calculate: (input) => {
  5709. const metaBox = findBox$1(input, "meta");
  5710. if (!metaBox) throw new TypeError("heic: meta box not found");
  5711. const iprpBox = findBox$1(input, "iprp", metaBox.offset + 12, metaBox.offset + metaBox.size);
  5712. if (!iprpBox) throw new TypeError("heic: iprp box not found");
  5713. const ipcoBox = findBox$1(input, "ipco", iprpBox.offset + 8, iprpBox.offset + iprpBox.size);
  5714. if (!ipcoBox) throw new TypeError("heic: ipco box not found");
  5715. const dimensions = findAllBoxes(input, "ispe", ipcoBox.offset + 8, ipcoBox.offset + ipcoBox.size).map((box) => ({
  5716. width: readUInt32BE(input, box.offset + 12),
  5717. height: readUInt32BE(input, box.offset + 16)
  5718. }));
  5719. if (dimensions.length === 0) throw new TypeError("heic: ispe box not found");
  5720. let largestDimension = dimensions[0];
  5721. for (let i = 1; i < dimensions.length; i++) {
  5722. const curr = dimensions[i];
  5723. if (curr.width * curr.height > largestDimension.width * largestDimension.height) largestDimension = curr;
  5724. }
  5725. return largestDimension;
  5726. }
  5727. };
  5728. function findBox$1(input, type, startOffset = 0, endOffset = input.length) {
  5729. let offset = startOffset;
  5730. while (offset < endOffset) {
  5731. const size = readUInt32BE(input, offset);
  5732. if (toUTF8String(input, offset + 4, offset + 8) === type) return {
  5733. offset,
  5734. size
  5735. };
  5736. if (size <= 0 || offset + size > endOffset) break;
  5737. offset += size;
  5738. }
  5739. }
  5740. function findAllBoxes(input, type, startOffset = 0, endOffset = input.length) {
  5741. let offset = startOffset;
  5742. const boxes = [];
  5743. while (offset < endOffset) {
  5744. const size = readUInt32BE(input, offset);
  5745. if (toUTF8String(input, offset + 4, offset + 8) === type) boxes.push({
  5746. offset,
  5747. size
  5748. });
  5749. if (size <= 0 || offset + size > endOffset) break;
  5750. offset += size;
  5751. }
  5752. return boxes;
  5753. }
  5754. const SIZE_HEADER = 8;
  5755. const FILE_LENGTH_OFFSET = 4;
  5756. const ENTRY_LENGTH_OFFSET = 4;
  5757. const ICON_TYPE_SIZE = {
  5758. ICON: 32,
  5759. "ICN#": 32,
  5760. "icm#": 16,
  5761. icm4: 16,
  5762. icm8: 16,
  5763. "ics#": 16,
  5764. ics4: 16,
  5765. ics8: 16,
  5766. is32: 16,
  5767. s8mk: 16,
  5768. icp4: 16,
  5769. icl4: 32,
  5770. icl8: 32,
  5771. il32: 32,
  5772. l8mk: 32,
  5773. icp5: 32,
  5774. ic11: 32,
  5775. ich4: 48,
  5776. ich8: 48,
  5777. ih32: 48,
  5778. h8mk: 48,
  5779. icp6: 64,
  5780. ic12: 32,
  5781. it32: 128,
  5782. t8mk: 128,
  5783. ic07: 128,
  5784. ic08: 256,
  5785. ic13: 256,
  5786. ic09: 512,
  5787. ic14: 512,
  5788. ic10: 1024
  5789. };
  5790. function readImageHeader(input, imageOffset) {
  5791. const imageLengthOffset = imageOffset + ENTRY_LENGTH_OFFSET;
  5792. return [toUTF8String(input, imageOffset, imageLengthOffset), readUInt32BE(input, imageLengthOffset)];
  5793. }
  5794. function getImageSize(type) {
  5795. const size = ICON_TYPE_SIZE[type];
  5796. return {
  5797. width: size,
  5798. height: size,
  5799. type
  5800. };
  5801. }
  5802. const ICNS = {
  5803. validate: (input) => toUTF8String(input, 0, 4) === "icns",
  5804. calculate(input) {
  5805. const inputLength = input.length;
  5806. const fileLength = readUInt32BE(input, FILE_LENGTH_OFFSET);
  5807. let imageOffset = SIZE_HEADER;
  5808. let imageHeader = readImageHeader(input, imageOffset);
  5809. let imageSize = getImageSize(imageHeader[0]);
  5810. imageOffset += imageHeader[1];
  5811. if (imageOffset === fileLength) return imageSize;
  5812. const result = {
  5813. height: imageSize.height,
  5814. images: [imageSize],
  5815. width: imageSize.width
  5816. };
  5817. while (imageOffset < fileLength && imageOffset < inputLength) {
  5818. imageHeader = readImageHeader(input, imageOffset);
  5819. imageSize = getImageSize(imageHeader[0]);
  5820. imageOffset += imageHeader[1];
  5821. result.images.push(imageSize);
  5822. }
  5823. return result;
  5824. }
  5825. };
  5826. const J2C = {
  5827. validate: (input) => toHexString(input, 0, 4) === "ff4fff51",
  5828. calculate: (input) => ({
  5829. height: readUInt32BE(input, 12),
  5830. width: readUInt32BE(input, 8)
  5831. })
  5832. };
  5833. const BoxTypes = {
  5834. ftyp: "66747970",
  5835. jp2h: "6a703268",
  5836. jp__: "6a502020",
  5837. rreq: "72726571"
  5838. };
  5839. const calculateRREQLength = (box) => {
  5840. const unit = box[0];
  5841. let offset = 1 + 2 * unit;
  5842. const flagsLength = readUInt16BE(box, offset) * (2 + unit);
  5843. offset = offset + 2 + flagsLength;
  5844. const featuresLength = readUInt16BE(box, offset) * (16 + unit);
  5845. return offset + 2 + featuresLength;
  5846. };
  5847. const parseIHDR = (box) => {
  5848. return {
  5849. height: readUInt32BE(box, 4),
  5850. width: readUInt32BE(box, 8)
  5851. };
  5852. };
  5853. const JP2 = {
  5854. validate(input) {
  5855. const signature = toHexString(input, 4, 8);
  5856. const signatureLength = readUInt32BE(input, 0);
  5857. if (signature !== BoxTypes.jp__ || signatureLength < 1) return false;
  5858. const ftypeBoxStart = signatureLength + 4;
  5859. const ftypBoxLength = readUInt32BE(input, signatureLength);
  5860. return toHexString(input.slice(ftypeBoxStart, ftypeBoxStart + ftypBoxLength), 0, 4) === BoxTypes.ftyp;
  5861. },
  5862. calculate(input) {
  5863. const signatureLength = readUInt32BE(input, 0);
  5864. const ftypBoxLength = readUInt16BE(input, signatureLength + 2);
  5865. let offset = signatureLength + 4 + ftypBoxLength;
  5866. switch (toHexString(input, offset, offset + 4)) {
  5867. case BoxTypes.rreq:
  5868. offset = offset + 4 + 4 + calculateRREQLength(input.slice(offset + 4));
  5869. return parseIHDR(input.slice(offset + 8, offset + 24));
  5870. case BoxTypes.jp2h: return parseIHDR(input.slice(offset + 8, offset + 24));
  5871. default: throw new TypeError("Unsupported header found: " + toUTF8String(input, offset, offset + 4));
  5872. }
  5873. }
  5874. };
  5875. const EXIF_MARKER = "45786966";
  5876. const APP1_DATA_SIZE_BYTES = 2;
  5877. const EXIF_HEADER_BYTES = 6;
  5878. const TIFF_BYTE_ALIGN_BYTES = 2;
  5879. const BIG_ENDIAN_BYTE_ALIGN = "4d4d";
  5880. const LITTLE_ENDIAN_BYTE_ALIGN = "4949";
  5881. const IDF_ENTRY_BYTES = 12;
  5882. const NUM_DIRECTORY_ENTRIES_BYTES = 2;
  5883. function isEXIF(input) {
  5884. return toHexString(input, 2, 6) === EXIF_MARKER;
  5885. }
  5886. function extractSize(input, index) {
  5887. return {
  5888. height: readUInt16BE(input, index),
  5889. width: readUInt16BE(input, index + 2)
  5890. };
  5891. }
  5892. function extractOrientation(exifBlock, isBigEndian) {
  5893. const offset = EXIF_HEADER_BYTES + 8;
  5894. const idfDirectoryEntries = readUInt(exifBlock, 16, offset, isBigEndian);
  5895. for (let directoryEntryNumber = 0; directoryEntryNumber < idfDirectoryEntries; directoryEntryNumber++) {
  5896. const start = offset + NUM_DIRECTORY_ENTRIES_BYTES + directoryEntryNumber * IDF_ENTRY_BYTES;
  5897. const end = start + IDF_ENTRY_BYTES;
  5898. if (start > exifBlock.length) return;
  5899. const block = exifBlock.slice(start, end);
  5900. if (readUInt(block, 16, 0, isBigEndian) === 274) {
  5901. if (readUInt(block, 16, 2, isBigEndian) !== 3) return;
  5902. if (readUInt(block, 32, 4, isBigEndian) !== 1) return;
  5903. return readUInt(block, 16, 8, isBigEndian);
  5904. }
  5905. }
  5906. }
  5907. function validateExifBlock(input, index) {
  5908. const exifBlock = input.slice(APP1_DATA_SIZE_BYTES, index);
  5909. const byteAlign = toHexString(exifBlock, EXIF_HEADER_BYTES, EXIF_HEADER_BYTES + TIFF_BYTE_ALIGN_BYTES);
  5910. const isBigEndian = byteAlign === BIG_ENDIAN_BYTE_ALIGN;
  5911. if (isBigEndian || byteAlign === LITTLE_ENDIAN_BYTE_ALIGN) return extractOrientation(exifBlock, isBigEndian);
  5912. }
  5913. function validateInput(input, index) {
  5914. if (index > input.length) throw new TypeError("Corrupt JPG, exceeded buffer limits");
  5915. if (input[index] !== 255) throw new TypeError("Invalid JPG, marker table corrupted");
  5916. }
  5917. const JPG = {
  5918. validate: (input) => toHexString(input, 0, 2) === "ffd8",
  5919. calculate(input) {
  5920. input = input.slice(4);
  5921. let orientation;
  5922. let next;
  5923. while (input.length > 0) {
  5924. const i = readUInt16BE(input, 0);
  5925. if (isEXIF(input)) orientation = validateExifBlock(input, i);
  5926. validateInput(input, i);
  5927. next = input[i + 1];
  5928. if (next === 192 || next === 193 || next === 194) {
  5929. const size = extractSize(input, i + 5);
  5930. if (!orientation) return size;
  5931. return {
  5932. height: size.height,
  5933. orientation,
  5934. width: size.width
  5935. };
  5936. }
  5937. input = input.slice(i + 2);
  5938. }
  5939. throw new TypeError("Invalid JPG, no size found");
  5940. }
  5941. };
  5942. const KTX = {
  5943. validate: (input) => toUTF8String(input, 1, 7) === "KTX 11",
  5944. calculate: (input) => ({
  5945. height: readUInt32LE(input, 40),
  5946. width: readUInt32LE(input, 36)
  5947. })
  5948. };
  5949. const pngSignature = "PNG\r\n\n";
  5950. const pngImageHeaderChunkName = "IHDR";
  5951. const pngFriedChunkName = "CgBI";
  5952. const PNG = {
  5953. validate(input) {
  5954. if (pngSignature === toUTF8String(input, 1, 8)) {
  5955. let chunkName = toUTF8String(input, 12, 16);
  5956. if (chunkName === pngFriedChunkName) chunkName = toUTF8String(input, 28, 32);
  5957. if (chunkName !== pngImageHeaderChunkName) throw new TypeError("Invalid PNG");
  5958. return true;
  5959. }
  5960. return false;
  5961. },
  5962. calculate(input) {
  5963. if (toUTF8String(input, 12, 16) === pngFriedChunkName) return {
  5964. height: readUInt32BE(input, 36),
  5965. width: readUInt32BE(input, 32)
  5966. };
  5967. return {
  5968. height: readUInt32BE(input, 20),
  5969. width: readUInt32BE(input, 16)
  5970. };
  5971. }
  5972. };
  5973. const PNMTypes = {
  5974. P1: "pbm/ascii",
  5975. P2: "pgm/ascii",
  5976. P3: "ppm/ascii",
  5977. P4: "pbm",
  5978. P5: "pgm",
  5979. P6: "ppm",
  5980. P7: "pam",
  5981. PF: "pfm"
  5982. };
  5983. const handlers = {
  5984. default: (lines) => {
  5985. let dimensions = [];
  5986. while (lines.length > 0) {
  5987. const line = lines.shift();
  5988. if (line[0] === "#") continue;
  5989. dimensions = line.split(" ");
  5990. break;
  5991. }
  5992. if (dimensions.length === 2) return {
  5993. height: Number.parseInt(dimensions[1], 10),
  5994. width: Number.parseInt(dimensions[0], 10)
  5995. };
  5996. else throw new TypeError("Invalid PNM");
  5997. },
  5998. pam: (lines) => {
  5999. const size = {};
  6000. while (lines.length > 0) {
  6001. const line = lines.shift();
  6002. if (line.length > 16 || (line.codePointAt(0) || 0) > 128) continue;
  6003. const [key, value] = line.split(" ");
  6004. if (key && value) size[key.toLowerCase()] = Number.parseInt(value, 10);
  6005. if (size.height && size.width) break;
  6006. }
  6007. if (size.height && size.width) return {
  6008. height: size.height,
  6009. width: size.width
  6010. };
  6011. else throw new TypeError("Invalid PAM");
  6012. }
  6013. };
  6014. const PNM = {
  6015. validate: (input) => toUTF8String(input, 0, 2) in PNMTypes,
  6016. calculate(input) {
  6017. const type = PNMTypes[toUTF8String(input, 0, 2)];
  6018. const lines = toUTF8String(input, 3).split(/[\n\r]+/);
  6019. return (handlers[type] || handlers.default)(lines);
  6020. }
  6021. };
  6022. const PSD = {
  6023. validate: (input) => toUTF8String(input, 0, 4) === "8BPS",
  6024. calculate: (input) => ({
  6025. height: readUInt32BE(input, 14),
  6026. width: readUInt32BE(input, 18)
  6027. })
  6028. };
  6029. const svgReg = /<svg\s([^"'>]|"[^"]*"|'[^']*')*>/;
  6030. const extractorRegExps = {
  6031. height: /\sheight=(["'])([^%]+?)\1/,
  6032. root: svgReg,
  6033. viewbox: /\sviewbox=(["'])(.+?)\1/i,
  6034. width: /\swidth=(["'])([^%]+?)\1/
  6035. };
  6036. const INCH_CM = 2.54;
  6037. const units = {
  6038. in: 96,
  6039. cm: 96 / INCH_CM,
  6040. em: 16,
  6041. ex: 8,
  6042. m: 96 / INCH_CM * 100,
  6043. mm: 96 / INCH_CM / 10,
  6044. pc: 96 / 72 / 12,
  6045. pt: 96 / 72,
  6046. px: 1
  6047. };
  6048. const unitsReg = /* @__PURE__ */ new RegExp(`^([0-9.]+(?:e\\d+)?)(${Object.keys(units).join("|")})?$`);
  6049. function parseLength(len) {
  6050. const m = unitsReg.exec(len);
  6051. if (!m) return;
  6052. return Math.round(Number(m[1]) * (units[m[2]] || 1));
  6053. }
  6054. function parseViewbox(viewbox) {
  6055. const bounds = viewbox.split(" ");
  6056. return {
  6057. height: parseLength(bounds[3]),
  6058. width: parseLength(bounds[2])
  6059. };
  6060. }
  6061. function parseAttributes(root) {
  6062. const width = root.match(extractorRegExps.width);
  6063. const height = root.match(extractorRegExps.height);
  6064. const viewbox = root.match(extractorRegExps.viewbox);
  6065. return {
  6066. height: height && parseLength(height[2]),
  6067. viewbox: viewbox && parseViewbox(viewbox[2]),
  6068. width: width && parseLength(width[2])
  6069. };
  6070. }
  6071. function calculateByDimensions(attrs) {
  6072. return {
  6073. height: attrs.height,
  6074. width: attrs.width
  6075. };
  6076. }
  6077. function calculateByViewbox(attrs, viewbox) {
  6078. const ratio = viewbox.width / viewbox.height;
  6079. if (attrs.width) return {
  6080. height: Math.floor(attrs.width / ratio),
  6081. width: attrs.width
  6082. };
  6083. if (attrs.height) return {
  6084. height: attrs.height,
  6085. width: Math.floor(attrs.height * ratio)
  6086. };
  6087. return {
  6088. height: viewbox.height,
  6089. width: viewbox.width
  6090. };
  6091. }
  6092. const SVG = {
  6093. validate: (input) => svgReg.test(toUTF8String(input, 0, 1e3)),
  6094. calculate(input) {
  6095. const root = toUTF8String(input).match(extractorRegExps.root);
  6096. if (root) {
  6097. const attrs = parseAttributes(root[0]);
  6098. if (attrs.width && attrs.height) return calculateByDimensions(attrs);
  6099. if (attrs.viewbox) return calculateByViewbox(attrs, attrs.viewbox);
  6100. }
  6101. throw new TypeError("Invalid SVG");
  6102. }
  6103. };
  6104. const TGA = {
  6105. validate(input) {
  6106. return readUInt16LE(input, 0) === 0 && readUInt16LE(input, 4) === 0;
  6107. },
  6108. calculate(input) {
  6109. return {
  6110. height: readUInt16LE(input, 14),
  6111. width: readUInt16LE(input, 12)
  6112. };
  6113. }
  6114. };
  6115. function readIFD(buffer, isBigEndian) {
  6116. const ifdOffset = readUInt(buffer, 32, 4, isBigEndian);
  6117. let bufferSize = 1024;
  6118. const fileSize = buffer.length;
  6119. if (ifdOffset + bufferSize > fileSize) bufferSize = fileSize - ifdOffset - 10;
  6120. return buffer.slice(ifdOffset + 2, ifdOffset + 2 + bufferSize);
  6121. }
  6122. function readValue(buffer, isBigEndian) {
  6123. const low = readUInt(buffer, 16, 8, isBigEndian);
  6124. return (readUInt(buffer, 16, 10, isBigEndian) << 16) + low;
  6125. }
  6126. function nextTag(buffer) {
  6127. if (buffer.length > 24) return buffer.slice(12);
  6128. }
  6129. function extractTags(buffer, isBigEndian) {
  6130. const tags = {};
  6131. let temp = buffer;
  6132. while (temp && temp.length > 0) {
  6133. const code = readUInt(temp, 16, 0, isBigEndian);
  6134. const type = readUInt(temp, 16, 2, isBigEndian);
  6135. const length = readUInt(temp, 32, 4, isBigEndian);
  6136. if (code === 0) break;
  6137. else {
  6138. if (length === 1 && (type === 3 || type === 4)) tags[code] = readValue(temp, isBigEndian);
  6139. temp = nextTag(temp);
  6140. }
  6141. }
  6142. return tags;
  6143. }
  6144. function determineEndianness(input) {
  6145. const signature = toUTF8String(input, 0, 2);
  6146. if (signature === "II") return "LE";
  6147. else if (signature === "MM") return "BE";
  6148. }
  6149. const signatures = /* @__PURE__ */ new Set(["49492a00", "4d4d002a"]);
  6150. const TIFF = {
  6151. validate: (input) => signatures.has(toHexString(input, 0, 4)),
  6152. calculate(input) {
  6153. const isBigEndian = determineEndianness(input) === "BE";
  6154. const tags = extractTags(readIFD(input, isBigEndian), isBigEndian);
  6155. const width = tags[256];
  6156. const height = tags[257];
  6157. if (!width || !height) throw new TypeError("Invalid Tiff. Missing tags");
  6158. return {
  6159. height,
  6160. width
  6161. };
  6162. }
  6163. };
  6164. function calculateExtended(input) {
  6165. return {
  6166. height: 1 + readUInt24LE(input, 7),
  6167. width: 1 + readUInt24LE(input, 4)
  6168. };
  6169. }
  6170. function calculateLossless(input) {
  6171. return {
  6172. height: 1 + ((input[4] & 15) << 10 | input[3] << 2 | (input[2] & 192) >> 6),
  6173. width: 1 + ((input[2] & 63) << 8 | input[1])
  6174. };
  6175. }
  6176. function calculateLossy(input) {
  6177. return {
  6178. height: readInt16LE(input, 8) & 16383,
  6179. width: readInt16LE(input, 6) & 16383
  6180. };
  6181. }
  6182. const WEBP = {
  6183. validate(input) {
  6184. const riffHeader = toUTF8String(input, 0, 4) === "RIFF";
  6185. const webpHeader = toUTF8String(input, 8, 12) === "WEBP";
  6186. const vp8Header = toUTF8String(input, 12, 15) === "VP8";
  6187. return riffHeader && webpHeader && vp8Header;
  6188. },
  6189. calculate(input) {
  6190. const chunkHeader = toUTF8String(input, 12, 16);
  6191. input = input.slice(20, 30);
  6192. if (chunkHeader === "VP8X") {
  6193. const extendedHeader = input[0];
  6194. const validStart = (extendedHeader & 192) === 0;
  6195. const validEnd = (extendedHeader & 1) === 0;
  6196. if (validStart && validEnd) return calculateExtended(input);
  6197. else throw new TypeError("Invalid WebP");
  6198. }
  6199. if (chunkHeader === "VP8 " && input[0] !== 47) return calculateLossy(input);
  6200. const signature = toHexString(input, 3, 6);
  6201. if (chunkHeader === "VP8L" && signature !== "9d012a") return calculateLossless(input);
  6202. throw new TypeError("Invalid WebP");
  6203. }
  6204. };
  6205. const AVIF = {
  6206. validate: (input) => toUTF8String(input, 8, 12) === "avif",
  6207. calculate: (input) => {
  6208. const metaBox = findBox(input, "meta");
  6209. const iprpBox = findBox(input, "iprp", metaBox.offset + 12, metaBox.offset + metaBox.size);
  6210. const ipcoBox = findBox(input, "ipco", iprpBox.offset + 8, iprpBox.offset + iprpBox.size);
  6211. const ispeBox = findBox(input, "ispe", ipcoBox.offset + 8, ipcoBox.offset + ipcoBox.size);
  6212. return {
  6213. width: readUInt32BE(input, ispeBox.offset + 12),
  6214. height: readUInt32BE(input, ispeBox.offset + 16)
  6215. };
  6216. }
  6217. };
  6218. function findBox(input, type, startOffset = 0, endOffset = input.length) {
  6219. for (let offset = startOffset; offset < endOffset;) {
  6220. const size = readUInt32BE(input, offset);
  6221. if (toUTF8String(input, offset + 4, offset + 8) === type) return {
  6222. offset,
  6223. size
  6224. };
  6225. if (size <= 0 || offset + size > endOffset) break;
  6226. offset += size;
  6227. }
  6228. throw new Error(`${type} box not found`);
  6229. }
  6230. const typeHandlers = {
  6231. bmp: BMP,
  6232. cur: CUR,
  6233. dds: DDS,
  6234. gif: GIF,
  6235. heic: HEIC,
  6236. icns: ICNS,
  6237. ico: ICO,
  6238. j2c: J2C,
  6239. jp2: JP2,
  6240. jpg: JPG,
  6241. ktx: KTX,
  6242. png: PNG,
  6243. pnm: PNM,
  6244. psd: PSD,
  6245. svg: SVG,
  6246. tga: TGA,
  6247. tiff: TIFF,
  6248. webp: WEBP,
  6249. avif: AVIF
  6250. };
  6251. const keys = Object.keys(typeHandlers);
  6252. const firstBytes = {
  6253. 56: "psd",
  6254. 66: "bmp",
  6255. 68: "dds",
  6256. 71: "gif",
  6257. 73: "tiff",
  6258. 77: "tiff",
  6259. 82: "webp",
  6260. 105: "icns",
  6261. 137: "png",
  6262. 255: "jpg"
  6263. };
  6264. function detector(input) {
  6265. const byte = input[0];
  6266. if (byte in firstBytes) {
  6267. const type = firstBytes[byte];
  6268. if (type && typeHandlers[type].validate(input)) return type;
  6269. }
  6270. return keys.find((key) => typeHandlers[key].validate(input));
  6271. }
  6272. function imageMeta(input) {
  6273. if (!(input instanceof Uint8Array)) throw new TypeError("Input should be a Uint8Array");
  6274. const type = detector(input);
  6275. if (type !== void 0 && type in typeHandlers) {
  6276. const size = typeHandlers[type].calculate(input);
  6277. if (size !== void 0) {
  6278. size.type = type;
  6279. return size;
  6280. }
  6281. }
  6282. throw new TypeError(`Unsupported file type: ${type}`);
  6283. }
  6284. //#endregion
  6285. //#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
  6286. const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
  6287. function normalizeWindowsPath(input = "") {
  6288. if (!input) return input;
  6289. return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
  6290. }
  6291. const _UNC_REGEX = /^[/\\]{2}/;
  6292. const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
  6293. const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
  6294. const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
  6295. const normalize = function(path$11) {
  6296. if (path$11.length === 0) return ".";
  6297. path$11 = normalizeWindowsPath(path$11);
  6298. const isUNCPath = path$11.match(_UNC_REGEX);
  6299. const isPathAbsolute = isAbsolute(path$11);
  6300. const trailingSeparator = path$11[path$11.length - 1] === "/";
  6301. path$11 = normalizeString(path$11, !isPathAbsolute);
  6302. if (path$11.length === 0) {
  6303. if (isPathAbsolute) return "/";
  6304. return trailingSeparator ? "./" : ".";
  6305. }
  6306. if (trailingSeparator) path$11 += "/";
  6307. if (_DRIVE_LETTER_RE.test(path$11)) path$11 += "/";
  6308. if (isUNCPath) {
  6309. if (!isPathAbsolute) return `//./${path$11}`;
  6310. return `//${path$11}`;
  6311. }
  6312. return isPathAbsolute && !isAbsolute(path$11) ? `/${path$11}` : path$11;
  6313. };
  6314. const join = function(...segments) {
  6315. let path$11 = "";
  6316. for (const seg of segments) {
  6317. if (!seg) continue;
  6318. if (path$11.length > 0) {
  6319. const pathTrailing = path$11[path$11.length - 1] === "/";
  6320. const segLeading = seg[0] === "/";
  6321. if (pathTrailing && segLeading) path$11 += seg.slice(1);
  6322. else path$11 += pathTrailing || segLeading ? seg : `/${seg}`;
  6323. } else path$11 += seg;
  6324. }
  6325. return normalize(path$11);
  6326. };
  6327. function cwd() {
  6328. if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
  6329. return "/";
  6330. }
  6331. const resolve$1 = function(...arguments_) {
  6332. arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
  6333. let resolvedPath = "";
  6334. let resolvedAbsolute = false;
  6335. for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
  6336. const path$11 = index >= 0 ? arguments_[index] : cwd();
  6337. if (!path$11 || path$11.length === 0) continue;
  6338. resolvedPath = `${path$11}/${resolvedPath}`;
  6339. resolvedAbsolute = isAbsolute(path$11);
  6340. }
  6341. resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
  6342. if (resolvedAbsolute && !isAbsolute(resolvedPath)) return `/${resolvedPath}`;
  6343. return resolvedPath.length > 0 ? resolvedPath : ".";
  6344. };
  6345. function normalizeString(path$11, allowAboveRoot) {
  6346. let res = "";
  6347. let lastSegmentLength = 0;
  6348. let lastSlash = -1;
  6349. let dots = 0;
  6350. let char = null;
  6351. for (let index = 0; index <= path$11.length; ++index) {
  6352. if (index < path$11.length) char = path$11[index];
  6353. else if (char === "/") break;
  6354. else char = "/";
  6355. if (char === "/") {
  6356. if (lastSlash === index - 1 || dots === 1);
  6357. else if (dots === 2) {
  6358. if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
  6359. if (res.length > 2) {
  6360. const lastSlashIndex = res.lastIndexOf("/");
  6361. if (lastSlashIndex === -1) {
  6362. res = "";
  6363. lastSegmentLength = 0;
  6364. } else {
  6365. res = res.slice(0, lastSlashIndex);
  6366. lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
  6367. }
  6368. lastSlash = index;
  6369. dots = 0;
  6370. continue;
  6371. } else if (res.length > 0) {
  6372. res = "";
  6373. lastSegmentLength = 0;
  6374. lastSlash = index;
  6375. dots = 0;
  6376. continue;
  6377. }
  6378. }
  6379. if (allowAboveRoot) {
  6380. res += res.length > 0 ? "/.." : "..";
  6381. lastSegmentLength = 2;
  6382. }
  6383. } else {
  6384. if (res.length > 0) res += `/${path$11.slice(lastSlash + 1, index)}`;
  6385. else res = path$11.slice(lastSlash + 1, index);
  6386. lastSegmentLength = index - lastSlash - 1;
  6387. }
  6388. lastSlash = index;
  6389. dots = 0;
  6390. } else if (char === "." && dots !== -1) ++dots;
  6391. else dots = -1;
  6392. }
  6393. return res;
  6394. }
  6395. const isAbsolute = function(p) {
  6396. return _IS_ABSOLUTE_RE.test(p);
  6397. };
  6398. const relative = function(from, to) {
  6399. const _from = resolve$1(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
  6400. const _to = resolve$1(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
  6401. if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) return _to.join("/");
  6402. const _fromCopy = [..._from];
  6403. for (const segment of _fromCopy) {
  6404. if (_to[0] !== segment) break;
  6405. _from.shift();
  6406. _to.shift();
  6407. }
  6408. return [..._from.map(() => ".."), ..._to].join("/");
  6409. };
  6410. //#endregion
  6411. //#region ../../node_modules/.pnpm/perfect-debounce@2.0.0/node_modules/perfect-debounce/dist/index.mjs
  6412. const DEBOUNCE_DEFAULTS = { trailing: true };
  6413. /**
  6414. Debounce functions
  6415. @param fn - Promise-returning/async function to debounce.
  6416. @param wait - Milliseconds to wait before calling `fn`. Default value is 25ms
  6417. @returns A function that delays calling `fn` until after `wait` milliseconds have elapsed since the last time it was called.
  6418. @example
  6419. ```
  6420. import { debounce } from 'perfect-debounce';
  6421. const expensiveCall = async input => input;
  6422. const debouncedFn = debounce(expensiveCall, 200);
  6423. for (const number of [1, 2, 3]) {
  6424. console.log(await debouncedFn(number));
  6425. }
  6426. //=> 1
  6427. //=> 2
  6428. //=> 3
  6429. ```
  6430. */
  6431. function debounce(fn, wait = 25, options$1 = {}) {
  6432. options$1 = {
  6433. ...DEBOUNCE_DEFAULTS,
  6434. ...options$1
  6435. };
  6436. if (!Number.isFinite(wait)) throw new TypeError("Expected `wait` to be a finite number");
  6437. let leadingValue;
  6438. let timeout;
  6439. let resolveList = [];
  6440. let currentPromise;
  6441. let trailingArgs;
  6442. const applyFn = (_this, args) => {
  6443. currentPromise = _applyPromised(fn, _this, args);
  6444. currentPromise.finally(() => {
  6445. currentPromise = null;
  6446. if (options$1.trailing && trailingArgs && !timeout) {
  6447. const promise$1 = applyFn(_this, trailingArgs);
  6448. trailingArgs = null;
  6449. return promise$1;
  6450. }
  6451. });
  6452. return currentPromise;
  6453. };
  6454. const debounced = function(...args) {
  6455. if (options$1.trailing) trailingArgs = args;
  6456. if (currentPromise) return currentPromise;
  6457. return new Promise((resolve$2) => {
  6458. const shouldCallNow = !timeout && options$1.leading;
  6459. clearTimeout(timeout);
  6460. timeout = setTimeout(() => {
  6461. timeout = null;
  6462. const promise$1 = options$1.leading ? leadingValue : applyFn(this, args);
  6463. trailingArgs = null;
  6464. for (const _resolve of resolveList) _resolve(promise$1);
  6465. resolveList = [];
  6466. }, wait);
  6467. if (shouldCallNow) {
  6468. leadingValue = applyFn(this, args);
  6469. resolve$2(leadingValue);
  6470. } else resolveList.push(resolve$2);
  6471. });
  6472. };
  6473. const _clearTimeout = (timer) => {
  6474. if (timer) {
  6475. clearTimeout(timer);
  6476. timeout = null;
  6477. }
  6478. };
  6479. debounced.isPending = () => !!timeout;
  6480. debounced.cancel = () => {
  6481. _clearTimeout(timeout);
  6482. resolveList = [];
  6483. trailingArgs = null;
  6484. };
  6485. debounced.flush = () => {
  6486. _clearTimeout(timeout);
  6487. if (!trailingArgs || currentPromise) return;
  6488. const args = trailingArgs;
  6489. trailingArgs = null;
  6490. return applyFn(this, args);
  6491. };
  6492. return debounced;
  6493. }
  6494. async function _applyPromised(fn, _this, args) {
  6495. return await fn.apply(_this, args);
  6496. }
  6497. //#endregion
  6498. //#region src/rpc/assets.ts
  6499. function guessType(path$11) {
  6500. if (/\.(?:png|jpe?g|jxl|gif|svg|webp|avif|ico|bmp|tiff?)$/i.test(path$11)) return "image";
  6501. if (/\.(?:mp4|webm|ogv|mov|avi|flv|wmv|mpg|mpeg|mkv|3gp|3g2|ts|mts|m2ts|vob|ogm|ogx|rm|rmvb|asf|amv|divx|m4v|svi|viv|f4v|f4p|f4a|f4b)$/i.test(path$11)) return "video";
  6502. if (/\.(?:mp3|wav|ogg|flac|aac|wma|alac|ape|ac3|dts|tta|opus|amr|aiff|au|mid|midi|ra|rm|wv|weba|dss|spx|vox|tak|dsf|dff|dsd|cda)$/i.test(path$11)) return "audio";
  6503. if (/\.(?:woff2?|eot|ttf|otf|ttc|pfa|pfb|pfm|afm)/i.test(path$11)) return "font";
  6504. if (/\.(?:json[5c]?|te?xt|[mc]?[jt]sx?|md[cx]?|markdown|ya?ml|toml)/i.test(path$11)) return "text";
  6505. if (/\.wasm/i.test(path$11)) return "wasm";
  6506. return "other";
  6507. }
  6508. function getAssetsFunctions(ctx) {
  6509. const { server, config } = ctx;
  6510. const _imageMetaCache = /* @__PURE__ */ new Map();
  6511. let cache = null;
  6512. async function scan$2() {
  6513. const dir = resolve$1(config.root);
  6514. const baseURL = config.base;
  6515. const publicDir = config.publicDir;
  6516. const relativePublicDir = publicDir === "" ? "" : `${relative(dir, publicDir)}/`;
  6517. const files = await (0, import_out.default)([
  6518. "**/*.(png|jpg|jpeg|gif|svg|webp|avif|ico|bmp|tiff)",
  6519. "**/*.(mp4|webm|ogv|mov|avi|flv|wmv|mpg|mpeg|mkv|3gp|3g2|m2ts|vob|ogm|ogx|rm|rmvb|asf|amv|divx|m4v|svi|viv|f4v|f4p|f4a|f4b)",
  6520. "**/*.(mp3|wav|ogg|flac|aac|wma|alac|ape|ac3|dts|tta|opus|amr|aiff|au|mid|midi|ra|rm|wv|weba|dss|spx|vox|tak|dsf|dff|dsd|cda)",
  6521. "**/*.(woff2?|eot|ttf|otf|ttc|pfa|pfb|pfm|afm)",
  6522. "**/*.(json|json5|jsonc|txt|text|tsx|jsx|md|mdx|mdc|markdown|yaml|yml|toml)",
  6523. "**/*.wasm"
  6524. ], {
  6525. cwd: dir,
  6526. onlyFiles: true,
  6527. caseSensitiveMatch: false,
  6528. ignore: [
  6529. "**/node_modules/**",
  6530. "**/dist/**",
  6531. "**/package-lock.*",
  6532. "**/pnpm-lock.*",
  6533. "**/pnpm-workspace.*"
  6534. ]
  6535. });
  6536. cache = await Promise.all(files.map(async (relativePath) => {
  6537. const filePath = resolve$1(dir, relativePath);
  6538. const stat$1 = await fsp.lstat(filePath);
  6539. const path$11 = relativePath.replace(relativePublicDir, "");
  6540. return {
  6541. path: path$11,
  6542. relativePath,
  6543. publicPath: join(baseURL, path$11),
  6544. filePath,
  6545. type: guessType(relativePath),
  6546. size: stat$1.size,
  6547. mtime: stat$1.mtimeMs
  6548. };
  6549. }));
  6550. return cache;
  6551. }
  6552. async function getAssetImporters(url) {
  6553. const importers = [];
  6554. const module$1 = await server.moduleGraph.getModuleByUrl(url);
  6555. if (module$1) for (const importer of module$1.importers) importers.push({
  6556. url: importer.url,
  6557. id: importer.id
  6558. });
  6559. return importers;
  6560. }
  6561. const debouncedAssetsUpdated = debounce(() => {
  6562. var _ref;
  6563. getViteRpcServer === null || getViteRpcServer === void 0 || (_ref = getViteRpcServer()) === null || _ref === void 0 || (_ref = _ref.broadcast) === null || _ref === void 0 || _ref.emit("assetsUpdated");
  6564. }, 100);
  6565. server.watcher.on("all", (event) => {
  6566. if (event !== "change") debouncedAssetsUpdated();
  6567. });
  6568. return {
  6569. async getStaticAssets() {
  6570. return await scan$2();
  6571. },
  6572. async getAssetImporters(url) {
  6573. return await getAssetImporters(url);
  6574. },
  6575. async getImageMeta(filepath) {
  6576. if (_imageMetaCache.has(filepath)) return _imageMetaCache.get(filepath);
  6577. try {
  6578. const meta = imageMeta(await fsp.readFile(filepath));
  6579. _imageMetaCache.set(filepath, meta);
  6580. return meta;
  6581. } catch (e) {
  6582. _imageMetaCache.set(filepath, void 0);
  6583. console.error(e);
  6584. return;
  6585. }
  6586. },
  6587. async getTextAssetContent(filepath, limit = 300) {
  6588. try {
  6589. return (await fsp.readFile(filepath, "utf-8")).slice(0, limit);
  6590. } catch (e) {
  6591. console.error(e);
  6592. return;
  6593. }
  6594. }
  6595. };
  6596. }
  6597. //#endregion
  6598. //#region src/rpc/get-config.ts
  6599. function getConfigFunctions(ctx) {
  6600. return { getRoot() {
  6601. return ctx.config.root;
  6602. } };
  6603. }
  6604. //#endregion
  6605. //#region src/rpc/graph.ts
  6606. function getGraphFunctions(ctx) {
  6607. const { rpc, server } = ctx;
  6608. const debouncedModuleUpdated = debounce(() => {
  6609. var _ref;
  6610. getViteRpcServer === null || getViteRpcServer === void 0 || (_ref = getViteRpcServer()) === null || _ref === void 0 || (_ref = _ref.broadcast) === null || _ref === void 0 || _ref.emit("graphModuleUpdated");
  6611. }, 100);
  6612. server.middlewares.use((_, __, next) => {
  6613. debouncedModuleUpdated();
  6614. next();
  6615. });
  6616. return { async getGraphModules() {
  6617. const meta = await rpc.getMetadata();
  6618. const modules = (meta ? await rpc.getModulesList({
  6619. vite: meta === null || meta === void 0 ? void 0 : meta.instances[0].vite,
  6620. env: meta === null || meta === void 0 ? void 0 : meta.instances[0].environments[0]
  6621. }) : null) || [];
  6622. const filteredModules = modules.filter((m) => {
  6623. return m.id.match(/\.(vue|js|ts|jsx|tsx|html|json)($|\?v=)/);
  6624. });
  6625. return filteredModules.map((i) => {
  6626. function searchForVueDeps(id, seen = /* @__PURE__ */ new Set()) {
  6627. if (seen.has(id)) return [];
  6628. seen.add(id);
  6629. const module$1 = modules.find((m) => m.id === id);
  6630. if (!module$1) return [];
  6631. return module$1.deps.flatMap((i$1) => {
  6632. if (filteredModules.find((m) => m.id === i$1)) return [i$1];
  6633. return searchForVueDeps(i$1, seen);
  6634. });
  6635. }
  6636. return {
  6637. id: i.id,
  6638. deps: searchForVueDeps(i.id)
  6639. };
  6640. });
  6641. } };
  6642. }
  6643. //#endregion
  6644. //#region src/rpc/index.ts
  6645. function getRpcFunctions(ctx) {
  6646. return {
  6647. heartbeat() {
  6648. return true;
  6649. },
  6650. ...getAssetsFunctions(ctx),
  6651. ...getConfigFunctions(ctx),
  6652. ...getGraphFunctions(ctx)
  6653. };
  6654. }
  6655. //#endregion
  6656. //#region src/utils.ts
  6657. function removeUrlQuery(url) {
  6658. return url.replace(/\?.*$/, "");
  6659. }
  6660. //#endregion
  6661. //#region src/vite.ts
  6662. function getVueDevtoolsPath() {
  6663. return normalizePath(path.dirname(fileURLToPath(import.meta.url))).replace(/\/dist$/, "//src");
  6664. }
  6665. const toggleComboKeysMap = {
  6666. option: process.platform === "darwin" ? "Option(⌥)" : "Alt(⌥)",
  6667. meta: "Command(⌘)",
  6668. shift: "Shift(⇧)"
  6669. };
  6670. function normalizeComboKeyPrint(toggleComboKey) {
  6671. return toggleComboKey.split("-").map((key) => toggleComboKeysMap[key] || key[0].toUpperCase() + key.slice(1)).join(dim("+"));
  6672. }
  6673. const devtoolsNextResourceSymbol = "?__vue-devtools-next-resource";
  6674. const defaultOptions = {
  6675. appendTo: "",
  6676. componentInspector: true,
  6677. launchEditor: process.env.LAUNCH_EDITOR ?? "code"
  6678. };
  6679. function mergeOptions(options$1) {
  6680. return Object.assign({}, defaultOptions, options$1);
  6681. }
  6682. function VitePluginVueDevTools(options$1) {
  6683. const vueDevtoolsPath = getVueDevtoolsPath();
  6684. const inspect = Inspect({ silent: true });
  6685. const pluginOptions = mergeOptions(options$1 ?? {});
  6686. let config;
  6687. function configureServer(server) {
  6688. const base = server.config.base || "/";
  6689. server.middlewares.use(`${base}__devtools__`, sirv(DIR_CLIENT, {
  6690. single: true,
  6691. dev: true,
  6692. setHeaders(response) {
  6693. if (config.server.headers == null) return;
  6694. Object.entries(config.server.headers).forEach(([key, value]) => {
  6695. if (value == null) return;
  6696. response.setHeader(key, value);
  6697. });
  6698. }
  6699. }));
  6700. setViteServerContext(server);
  6701. createViteServerRpc(getRpcFunctions({
  6702. rpc: inspect.api.rpc,
  6703. server,
  6704. config
  6705. }));
  6706. const _printUrls = server.printUrls;
  6707. const colorUrl = (url) => cyan(url.replace(/:(\d+)\//, (_, port) => `:${bold(port)}/`));
  6708. server.printUrls = () => {
  6709. const urls = server.resolvedUrls;
  6710. const keys$1 = normalizeComboKeyPrint("option-shift-d");
  6711. _printUrls();
  6712. for (const url of urls.local) {
  6713. const devtoolsUrl = url.endsWith("/") ? `${url}__devtools__/` : `${url}/__devtools__/`;
  6714. console.log(` ${green("➜")} ${bold("Vue DevTools")}: ${green(`Open ${colorUrl(`${devtoolsUrl}`)} as a separate window`)}`);
  6715. }
  6716. console.log(` ${green("➜")} ${bold("Vue DevTools")}: ${green(`Press ${yellow(keys$1)} in App to toggle the Vue DevTools`)}`);
  6717. };
  6718. }
  6719. const devtoolsOptionsImportee = "virtual:vue-devtools-options";
  6720. const resolvedDevtoolsOptions = `\0${devtoolsOptionsImportee}`;
  6721. const plugin = {
  6722. name: "vite-plugin-vue-devtools",
  6723. enforce: "pre",
  6724. apply: "serve",
  6725. configResolved(resolvedConfig) {
  6726. config = resolvedConfig;
  6727. },
  6728. configureServer(server) {
  6729. configureServer(server);
  6730. },
  6731. async resolveId(importee) {
  6732. if (importee === devtoolsOptionsImportee) return resolvedDevtoolsOptions;
  6733. else if (importee.startsWith("virtual:vue-devtools-path:")) return `${importee.replace("virtual:vue-devtools-path:", `${vueDevtoolsPath}/`)}${devtoolsNextResourceSymbol}`;
  6734. },
  6735. async load(id) {
  6736. if (id === resolvedDevtoolsOptions) return `export default ${JSON.stringify({
  6737. base: config.base,
  6738. componentInspector: pluginOptions.componentInspector
  6739. })}`;
  6740. else if (id.endsWith(devtoolsNextResourceSymbol)) {
  6741. const filename = removeUrlQuery(id);
  6742. return await fs.promises.readFile(filename, "utf-8");
  6743. }
  6744. },
  6745. transform(code, id, options$2) {
  6746. if (options$2 === null || options$2 === void 0 ? void 0 : options$2.ssr) return;
  6747. const { appendTo } = pluginOptions;
  6748. const [filename] = id.split("?", 2);
  6749. if (appendTo && (typeof appendTo === "string" && filename.endsWith(appendTo) || appendTo instanceof RegExp && appendTo.test(filename))) code = `import 'virtual:vue-devtools-path:overlay.js';\n${code}`;
  6750. return code;
  6751. },
  6752. transformIndexHtml(html) {
  6753. if (pluginOptions.appendTo) return;
  6754. return {
  6755. html,
  6756. tags: [{
  6757. tag: "script",
  6758. injectTo: "head-prepend",
  6759. attrs: {
  6760. type: "module",
  6761. src: `${config.base || "/"}@id/virtual:vue-devtools-path:overlay.js`
  6762. }
  6763. }, pluginOptions.componentInspector && {
  6764. tag: "script",
  6765. injectTo: "head-prepend",
  6766. launchEditor: pluginOptions.launchEditor,
  6767. attrs: {
  6768. type: "module",
  6769. src: `${config.base || "/"}@id/virtual:vue-inspector-path:load.js`
  6770. }
  6771. }].filter(Boolean)
  6772. };
  6773. },
  6774. async buildEnd() {}
  6775. };
  6776. return [
  6777. inspect,
  6778. pluginOptions.componentInspector && VueInspector({
  6779. toggleComboKey: "",
  6780. toggleButtonVisibility: "never",
  6781. launchEditor: pluginOptions.launchEditor,
  6782. ...typeof pluginOptions.componentInspector === "boolean" ? {} : pluginOptions.componentInspector,
  6783. appendTo: pluginOptions.appendTo || "manually"
  6784. }),
  6785. plugin
  6786. ].filter(Boolean);
  6787. }
  6788. //#endregion
  6789. export { VitePluginVueDevTools as default };