提交学习笔记专用
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.

6882 lines
229 KiB

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