vite-plus 1.2.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/AGENTS.md +4 -0
  2. package/LICENSE +1 -849
  3. package/README.md +1 -1
  4. package/bin/vpx +9 -0
  5. package/binding/index.cjs +59 -54
  6. package/binding/index.d.cts +132 -2
  7. package/dist/{agent-KeDc6vmg.js → agent-D8oxxhVR.js} +7 -9
  8. package/dist/bin.js +27 -34
  9. package/dist/{cli-parse-DHE8NrBU.js → cli-parse-aeUeFDlC.js} +2 -3
  10. package/dist/command-TjS_6y9O.js +1 -0
  11. package/dist/{command-CguLh2KL.js → command-rY79K5NI.js} +40 -42
  12. package/dist/{comparison-CmVirWIW-DUGaiYqF.js → comparison-CmVirWIW-UlEf2maz.js} +1 -2
  13. package/dist/config/bin.js +8 -10
  14. package/dist/{constants-BW3g7VnD.js → constants-DRUnJ_Dz.js} +4 -6
  15. package/dist/create/bin.d.ts +4 -8
  16. package/dist/create/bin.js +64 -68
  17. package/dist/{define-config-CIlk9scU.js → define-config-ChwJcu5e.js} +6 -9
  18. package/dist/{define-config-Dq_23Eyr.cjs → define-config-Cv2P6NT2.cjs} +8 -13
  19. package/dist/{define-config-Bexdd6RZ.d.ts → define-config-rPhYIFSn.d.ts} +1 -11
  20. package/dist/define-config.cjs +1 -1
  21. package/dist/define-config.d.ts +1 -1
  22. package/dist/define-config.js +1 -1
  23. package/dist/{dist-Bi7ZEK3c.js → dist-Bs0SObNC.js} +77 -149
  24. package/dist/{dist-Cqz8OtiO.js → dist-CdkMvIiQ.js} +11 -5
  25. package/dist/dist-zDZV5eEc.js +3 -0
  26. package/dist/{documentation-DqcZSthV.js → documentation-cv_y0Auv.js} +1 -2
  27. package/dist/{editor-b1XUwt9v.js → editor-ClL78D8u.js} +1492 -4211
  28. package/dist/{help-BmKpeOP9.js → help-B03t_iQ4.js} +1 -2
  29. package/dist/hooks/bin.js +4 -5
  30. package/dist/{hooks-DhwsWb46.js → hooks-xRcJPc-O.js} +5 -4
  31. package/dist/index.cjs +2 -3
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.js +1 -1
  34. package/dist/{json-JP24qHUF.js → json-kl84kDyH.js} +9 -18
  35. package/dist/lint-plugins.cjs +1 -1
  36. package/dist/migration/bin.js +719 -184
  37. package/dist/migration/compat/worker.js +4 -6
  38. package/dist/{oxlint-plugin-config-Dx-ZY2MN.js → oxlint-plugin-config-BVpqYdcC.js} +3 -4
  39. package/dist/oxlint-plugin.d.ts +0 -2
  40. package/dist/oxlint-plugin.js +6 -7
  41. package/dist/{pack-BK38MLVZ.d.ts → pack-ARPFMefW.d.ts} +0 -2
  42. package/dist/pack-bin.d.ts +1 -3
  43. package/dist/pack-bin.js +3 -4
  44. package/dist/pack.d.ts +1 -1
  45. package/dist/{package-BP16iQby.js → package-DzsomcUD.js} +10 -95
  46. package/dist/{package-overrides-D1RcXSFl.js → package-overrides-Ci8GXouY.js} +5 -8
  47. package/dist/picomatch-DEUoj81q.js +1916 -0
  48. package/dist/{prompts-BGpQtC5z.js → prompts-GL1vj0wk.js} +113 -239
  49. package/dist/{protocol-D99W10Qi.js → protocol-CkNmY-Mr.js} +1 -2
  50. package/dist/{report-NhQk8VHb.js → report-DLHO30yZ.js} +2 -2
  51. package/dist/{resolve-vite-config-x47JetlI.js → resolve-vite-config-Dn5896A4.js} +9 -25
  52. package/dist/resolve-vite-config-QO6cC0SP.js +1 -0
  53. package/dist/{rolldown-runtime-CMFfr-1z.js → rolldown-runtime-DegdyBIC.js} +2 -3
  54. package/dist/script-esm-hooks.d.ts +8 -0
  55. package/dist/script-esm-hooks.js +24 -0
  56. package/dist/script-hooks-9Fof5UMY.js +176 -0
  57. package/dist/script-preload.cjs +468 -0
  58. package/dist/script-register.d.ts +1 -0
  59. package/dist/script-register.js +22 -0
  60. package/dist/script-watch.d.ts +1 -0
  61. package/dist/script-watch.js +1908 -0
  62. package/dist/staged/bin.js +81 -2011
  63. package/dist/sync-versions/bin.js +29 -50
  64. package/dist/sync-versions/bin.mjs +117 -224
  65. package/dist/{terminal-MKGAuy-p.js → terminal-BcuPUy-j.js} +1 -2
  66. package/dist/toolchain.js +36 -10
  67. package/dist/toolchain.json +36 -10
  68. package/dist/{tsconfig-C5PnJfW4.js → tsconfig-Do6MAG_f.js} +1 -1
  69. package/dist/{tsconfig-D2DzAQ_D.js → tsconfig-LE_mAwe_.js} +8 -10
  70. package/dist/version.d.ts +1 -3
  71. package/dist/version.js +5 -6
  72. package/dist/versions.js +5 -5
  73. package/dist/{vitest-ecosystem-BU0AqZq-.js → vitest-ecosystem-BeEYz-qF.js} +1 -2
  74. package/dist/{vitest-v5-entry-points-DthU1e_O.js → vitest-v5-entry-points-NyJsFeux.js} +1 -2
  75. package/dist/vpx-bin.d.ts +1 -0
  76. package/dist/vpx-bin.js +232 -0
  77. package/dist/vpx-script-EXgV5QOf.js +434 -0
  78. package/docs/config/run.md +4 -0
  79. package/docs/guide/check.md +1 -0
  80. package/docs/guide/ci.md +13 -3
  81. package/docs/guide/create.md +34 -0
  82. package/docs/guide/env.md +27 -13
  83. package/docs/guide/global-cli.md +52 -0
  84. package/docs/guide/local-cli.md +4 -4
  85. package/docs/guide/migrate-rules.md +48 -5
  86. package/docs/guide/migrate.md +6 -6
  87. package/docs/guide/package-management.md +19 -2
  88. package/docs/guide/test.md +1 -1
  89. package/docs/guide/vitest-v5.md +2 -2
  90. package/docs/guide/vpx.md +170 -9
  91. package/package.json +32 -29
  92. package/dist/command-DaRqSNpP.js +0 -1
  93. package/dist/dist-CBWGibx8.js +0 -3
  94. package/dist/resolve-vite-config-CGzlyhGr.js +0 -1
@@ -0,0 +1,1916 @@
1
+ import { t as __commonJSMin } from "./rolldown-runtime-DegdyBIC.js";
2
+ // ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/lib/constants.js
3
+ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4
+ const WIN_SLASH = "\\\\/";
5
+ const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
6
+ const DEFAULT_MAX_EXTGLOB_RECURSION = 0;
7
+ /**
8
+ * Posix glob regex
9
+ */
10
+ const DOT_LITERAL = "\\.";
11
+ const PLUS_LITERAL = "\\+";
12
+ const QMARK_LITERAL = "\\?";
13
+ const SLASH_LITERAL = "\\/";
14
+ const ONE_CHAR = "(?=.)";
15
+ const QMARK = "[^/]";
16
+ const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
17
+ const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
18
+ const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
19
+ const POSIX_CHARS = {
20
+ DOT_LITERAL,
21
+ PLUS_LITERAL,
22
+ QMARK_LITERAL,
23
+ SLASH_LITERAL,
24
+ ONE_CHAR,
25
+ QMARK,
26
+ END_ANCHOR,
27
+ DOTS_SLASH,
28
+ NO_DOT: `(?!${DOT_LITERAL})`,
29
+ NO_DOTS: `(?!${START_ANCHOR}${DOTS_SLASH})`,
30
+ NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`,
31
+ NO_DOTS_SLASH: `(?!${DOTS_SLASH})`,
32
+ QMARK_NO_DOT: `[^.${SLASH_LITERAL}]`,
33
+ STAR: `${QMARK}*?`,
34
+ START_ANCHOR,
35
+ SEP: "/"
36
+ };
37
+ /**
38
+ * Windows glob regex
39
+ */
40
+ const WINDOWS_CHARS = {
41
+ ...POSIX_CHARS,
42
+ SLASH_LITERAL: `[${WIN_SLASH}]`,
43
+ QMARK: WIN_NO_SLASH,
44
+ STAR: `${WIN_NO_SLASH}*?`,
45
+ DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
46
+ NO_DOT: `(?!${DOT_LITERAL})`,
47
+ NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
48
+ NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
49
+ NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
50
+ QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
51
+ START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
52
+ END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
53
+ SEP: "\\"
54
+ };
55
+ module.exports = {
56
+ DEFAULT_MAX_EXTGLOB_RECURSION,
57
+ MAX_LENGTH: 65536,
58
+ POSIX_REGEX_SOURCE: {
59
+ __proto__: null,
60
+ alnum: "a-zA-Z0-9",
61
+ alpha: "a-zA-Z",
62
+ ascii: "\\x00-\\x7F",
63
+ blank: " \\t",
64
+ cntrl: "\\x00-\\x1F\\x7F",
65
+ digit: "0-9",
66
+ graph: "\\x21-\\x7E",
67
+ lower: "a-z",
68
+ print: "\\x20-\\x7E ",
69
+ punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
70
+ space: " \\t\\r\\n\\v\\f",
71
+ upper: "A-Z",
72
+ word: "A-Za-z0-9_",
73
+ xdigit: "A-Fa-f0-9"
74
+ },
75
+ REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
76
+ REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
77
+ REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
78
+ REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
79
+ REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
80
+ REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
81
+ REPLACEMENTS: {
82
+ __proto__: null,
83
+ "***": "*",
84
+ "**/**": "**",
85
+ "**/**/**": "**"
86
+ },
87
+ CHAR_0: 48,
88
+ CHAR_9: 57,
89
+ CHAR_UPPERCASE_A: 65,
90
+ CHAR_LOWERCASE_A: 97,
91
+ CHAR_UPPERCASE_Z: 90,
92
+ CHAR_LOWERCASE_Z: 122,
93
+ CHAR_LEFT_PARENTHESES: 40,
94
+ CHAR_RIGHT_PARENTHESES: 41,
95
+ CHAR_ASTERISK: 42,
96
+ CHAR_AMPERSAND: 38,
97
+ CHAR_AT: 64,
98
+ CHAR_BACKWARD_SLASH: 92,
99
+ CHAR_CARRIAGE_RETURN: 13,
100
+ CHAR_CIRCUMFLEX_ACCENT: 94,
101
+ CHAR_COLON: 58,
102
+ CHAR_COMMA: 44,
103
+ CHAR_DOT: 46,
104
+ CHAR_DOUBLE_QUOTE: 34,
105
+ CHAR_EQUAL: 61,
106
+ CHAR_EXCLAMATION_MARK: 33,
107
+ CHAR_FORM_FEED: 12,
108
+ CHAR_FORWARD_SLASH: 47,
109
+ CHAR_GRAVE_ACCENT: 96,
110
+ CHAR_HASH: 35,
111
+ CHAR_HYPHEN_MINUS: 45,
112
+ CHAR_LEFT_ANGLE_BRACKET: 60,
113
+ CHAR_LEFT_CURLY_BRACE: 123,
114
+ CHAR_LEFT_SQUARE_BRACKET: 91,
115
+ CHAR_LINE_FEED: 10,
116
+ CHAR_NO_BREAK_SPACE: 160,
117
+ CHAR_PERCENT: 37,
118
+ CHAR_PLUS: 43,
119
+ CHAR_QUESTION_MARK: 63,
120
+ CHAR_RIGHT_ANGLE_BRACKET: 62,
121
+ CHAR_RIGHT_CURLY_BRACE: 125,
122
+ CHAR_RIGHT_SQUARE_BRACKET: 93,
123
+ CHAR_SEMICOLON: 59,
124
+ CHAR_SINGLE_QUOTE: 39,
125
+ CHAR_SPACE: 32,
126
+ CHAR_TAB: 9,
127
+ CHAR_UNDERSCORE: 95,
128
+ CHAR_VERTICAL_LINE: 124,
129
+ CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
130
+ /**
131
+ * Create EXTGLOB_CHARS
132
+ */
133
+ extglobChars(chars) {
134
+ return {
135
+ "!": {
136
+ type: "negate",
137
+ open: "(?:(?!(?:",
138
+ close: `))${chars.STAR})`
139
+ },
140
+ "?": {
141
+ type: "qmark",
142
+ open: "(?:",
143
+ close: ")?"
144
+ },
145
+ "+": {
146
+ type: "plus",
147
+ open: "(?:",
148
+ close: ")+"
149
+ },
150
+ "*": {
151
+ type: "star",
152
+ open: "(?:",
153
+ close: ")*"
154
+ },
155
+ "@": {
156
+ type: "at",
157
+ open: "(?:",
158
+ close: ")"
159
+ }
160
+ };
161
+ },
162
+ /**
163
+ * Create GLOB_CHARS
164
+ */
165
+ globChars(win32) {
166
+ return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
167
+ }
168
+ };
169
+ }));
170
+ // ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/lib/utils.js
171
+ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
172
+ const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants();
173
+ exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
174
+ exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
175
+ exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
176
+ exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
177
+ exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
178
+ exports.isWindows = () => {
179
+ if (typeof navigator !== "undefined" && navigator.platform) {
180
+ const platform = navigator.platform.toLowerCase();
181
+ return platform === "win32" || platform === "windows";
182
+ }
183
+ if (typeof process !== "undefined" && process.platform) return process.platform === "win32";
184
+ return false;
185
+ };
186
+ exports.removeBackslashes = (str) => {
187
+ return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
188
+ return match === "\\" ? "" : match;
189
+ });
190
+ };
191
+ exports.escapeLast = (input, char, lastIdx) => {
192
+ const idx = input.lastIndexOf(char, lastIdx);
193
+ if (idx === -1) return input;
194
+ if (input[idx - 1] === "\\") return exports.escapeLast(input, char, idx - 1);
195
+ return `${input.slice(0, idx)}\\${input.slice(idx)}`;
196
+ };
197
+ exports.removePrefix = (input, state = {}) => {
198
+ let output = input;
199
+ if (output.startsWith("./")) {
200
+ output = output.slice(2);
201
+ state.prefix = "./";
202
+ }
203
+ return output;
204
+ };
205
+ exports.wrapOutput = (input, state = {}, options = {}) => {
206
+ let output = `${options.contains ? "" : "^"}(?:${input})${options.contains ? "" : "$"}`;
207
+ if (state.negated === true) output = `(?:^(?!${output}).*$)`;
208
+ return output;
209
+ };
210
+ exports.basename = (path, { windows } = {}) => {
211
+ const segs = path.split(windows ? /[\\/]/ : "/");
212
+ const last = segs[segs.length - 1];
213
+ if (last === "") return segs[segs.length - 2];
214
+ return last;
215
+ };
216
+ }));
217
+ // ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/lib/scan.js
218
+ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
219
+ const utils = require_utils();
220
+ 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();
221
+ const isPathSeparator = (code) => {
222
+ return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
223
+ };
224
+ const depth = (token) => {
225
+ if (token.isPrefix !== true) token.depth = token.isGlobstar ? Infinity : 1;
226
+ };
227
+ /**
228
+ * Quickly scans a glob pattern and returns an object with a handful of
229
+ * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
230
+ * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
231
+ * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
232
+ *
233
+ * ```js
234
+ * const pm = require('picomatch');
235
+ * console.log(pm.scan('foo/bar/*.js'));
236
+ * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
237
+ * ```
238
+ * @param {String} `str`
239
+ * @param {Object} `options`
240
+ * @return {Object} Returns an object with tokens and regex source string.
241
+ * @api public
242
+ */
243
+ const scan = (input, options) => {
244
+ const opts = options || {};
245
+ const length = input.length - 1;
246
+ const scanToEnd = opts.parts === true || opts.tokens === true || opts.scanToEnd === true;
247
+ const slashes = [];
248
+ const tokens = [];
249
+ const parts = [];
250
+ let str = input;
251
+ let index = -1;
252
+ let start = 0;
253
+ let lastIndex = 0;
254
+ let isBrace = false;
255
+ let isBracket = false;
256
+ let isGlob = false;
257
+ let isExtglob = false;
258
+ let isGlobstar = false;
259
+ let braceEscaped = false;
260
+ let backslashes = false;
261
+ let negated = false;
262
+ let negatedExtglob = false;
263
+ let finished = false;
264
+ let braces = 0;
265
+ let prev;
266
+ let code;
267
+ let token = {
268
+ value: "",
269
+ depth: 0,
270
+ isGlob: false
271
+ };
272
+ const eos = () => index >= length;
273
+ const peek = () => str.charCodeAt(index + 1);
274
+ const advance = () => {
275
+ prev = code;
276
+ return str.charCodeAt(++index);
277
+ };
278
+ while (index < length) {
279
+ code = advance();
280
+ let next;
281
+ if (code === CHAR_BACKWARD_SLASH) {
282
+ backslashes = token.backslashes = true;
283
+ code = advance();
284
+ if (code === CHAR_LEFT_CURLY_BRACE) braceEscaped = true;
285
+ continue;
286
+ }
287
+ if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
288
+ braces++;
289
+ while (eos() !== true && (code = advance())) {
290
+ if (code === CHAR_BACKWARD_SLASH) {
291
+ backslashes = token.backslashes = true;
292
+ advance();
293
+ continue;
294
+ }
295
+ if (code === CHAR_LEFT_CURLY_BRACE) {
296
+ braces++;
297
+ continue;
298
+ }
299
+ if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
300
+ isBrace = token.isBrace = true;
301
+ isGlob = token.isGlob = true;
302
+ finished = true;
303
+ if (scanToEnd === true) continue;
304
+ break;
305
+ }
306
+ if (braceEscaped !== true && code === CHAR_COMMA) {
307
+ isBrace = token.isBrace = true;
308
+ isGlob = token.isGlob = true;
309
+ finished = true;
310
+ if (scanToEnd === true) continue;
311
+ break;
312
+ }
313
+ if (code === CHAR_RIGHT_CURLY_BRACE) {
314
+ braces--;
315
+ if (braces === 0) {
316
+ braceEscaped = false;
317
+ isBrace = token.isBrace = true;
318
+ finished = true;
319
+ break;
320
+ }
321
+ }
322
+ }
323
+ if (scanToEnd === true) continue;
324
+ break;
325
+ }
326
+ if (code === CHAR_FORWARD_SLASH) {
327
+ slashes.push(index);
328
+ tokens.push(token);
329
+ token = {
330
+ value: "",
331
+ depth: 0,
332
+ isGlob: false
333
+ };
334
+ if (finished === true) continue;
335
+ if (prev === CHAR_DOT && index === start + 1) {
336
+ start += 2;
337
+ continue;
338
+ }
339
+ lastIndex = index + 1;
340
+ continue;
341
+ }
342
+ if (opts.noext !== true) {
343
+ if ((code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK) === true && peek() === CHAR_LEFT_PARENTHESES) {
344
+ isGlob = token.isGlob = true;
345
+ isExtglob = token.isExtglob = true;
346
+ finished = true;
347
+ if (code === CHAR_EXCLAMATION_MARK && index === start) negatedExtglob = true;
348
+ if (scanToEnd === true) {
349
+ let parens = 0;
350
+ while (eos() !== true && (code = advance())) {
351
+ if (code === CHAR_BACKWARD_SLASH) {
352
+ backslashes = token.backslashes = true;
353
+ advance();
354
+ continue;
355
+ }
356
+ if (code === CHAR_LEFT_PARENTHESES) {
357
+ parens++;
358
+ continue;
359
+ }
360
+ if (code === CHAR_RIGHT_PARENTHESES && --parens === 0) {
361
+ finished = true;
362
+ break;
363
+ }
364
+ }
365
+ continue;
366
+ }
367
+ break;
368
+ }
369
+ }
370
+ if (code === CHAR_ASTERISK) {
371
+ if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
372
+ isGlob = token.isGlob = true;
373
+ finished = true;
374
+ if (scanToEnd === true) continue;
375
+ break;
376
+ }
377
+ if (code === CHAR_QUESTION_MARK) {
378
+ isGlob = token.isGlob = true;
379
+ finished = true;
380
+ if (scanToEnd === true) continue;
381
+ break;
382
+ }
383
+ if (code === CHAR_LEFT_SQUARE_BRACKET) {
384
+ while (eos() !== true && (next = advance())) {
385
+ if (next === CHAR_BACKWARD_SLASH) {
386
+ backslashes = token.backslashes = true;
387
+ advance();
388
+ continue;
389
+ }
390
+ if (next === CHAR_RIGHT_SQUARE_BRACKET) {
391
+ isBracket = token.isBracket = true;
392
+ isGlob = token.isGlob = true;
393
+ finished = true;
394
+ break;
395
+ }
396
+ }
397
+ if (scanToEnd === true) continue;
398
+ break;
399
+ }
400
+ if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
401
+ negated = token.negated = true;
402
+ start++;
403
+ continue;
404
+ }
405
+ if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
406
+ isGlob = token.isGlob = true;
407
+ if (scanToEnd === true) {
408
+ let parens = 1;
409
+ while (eos() !== true && (code = advance())) {
410
+ if (code === CHAR_BACKWARD_SLASH) {
411
+ backslashes = token.backslashes = true;
412
+ advance();
413
+ continue;
414
+ }
415
+ if (code === CHAR_LEFT_PARENTHESES) {
416
+ parens++;
417
+ continue;
418
+ }
419
+ if (code === CHAR_RIGHT_PARENTHESES && --parens === 0) {
420
+ finished = true;
421
+ break;
422
+ }
423
+ }
424
+ continue;
425
+ }
426
+ break;
427
+ }
428
+ if (isGlob === true) {
429
+ finished = true;
430
+ if (scanToEnd === true) continue;
431
+ break;
432
+ }
433
+ }
434
+ if (opts.noext === true) {
435
+ isExtglob = false;
436
+ isGlob = false;
437
+ }
438
+ let base = str;
439
+ let prefix = "";
440
+ let glob = "";
441
+ if (start > 0) {
442
+ prefix = str.slice(0, start);
443
+ str = str.slice(start);
444
+ lastIndex -= start;
445
+ }
446
+ if (base && isGlob === true && lastIndex > 0) {
447
+ base = str.slice(0, lastIndex);
448
+ glob = str.slice(lastIndex);
449
+ } else if (isGlob === true) {
450
+ base = "";
451
+ glob = str;
452
+ } else base = str;
453
+ if (base && base !== "" && base !== "/" && base !== str) {
454
+ if (isPathSeparator(base.charCodeAt(base.length - 1))) base = base.slice(0, -1);
455
+ }
456
+ if (opts.unescape === true) {
457
+ if (glob) glob = utils.removeBackslashes(glob);
458
+ if (base && backslashes === true) base = utils.removeBackslashes(base);
459
+ }
460
+ const state = {
461
+ prefix,
462
+ input,
463
+ start,
464
+ base,
465
+ glob,
466
+ isBrace,
467
+ isBracket,
468
+ isGlob,
469
+ isExtglob,
470
+ isGlobstar,
471
+ negated,
472
+ negatedExtglob
473
+ };
474
+ if (opts.tokens === true) {
475
+ state.maxDepth = 0;
476
+ if (!isPathSeparator(code)) tokens.push(token);
477
+ state.tokens = tokens;
478
+ }
479
+ if (opts.parts === true || opts.tokens === true) {
480
+ let prevIndex;
481
+ for (let idx = 0; idx < slashes.length; idx++) {
482
+ const n = prevIndex !== void 0 ? prevIndex + 1 : start;
483
+ const i = slashes[idx];
484
+ const value = input.slice(n, i);
485
+ if (opts.tokens) {
486
+ if (idx === 0 && start !== 0) {
487
+ tokens[idx].isPrefix = true;
488
+ tokens[idx].value = prefix;
489
+ } else tokens[idx].value = value;
490
+ depth(tokens[idx]);
491
+ state.maxDepth += tokens[idx].depth;
492
+ }
493
+ if (i >= start) {
494
+ parts.push(value);
495
+ prevIndex = i;
496
+ }
497
+ }
498
+ const n = prevIndex !== void 0 ? prevIndex + 1 : start;
499
+ const value = input.slice(n);
500
+ parts.push(value);
501
+ if (opts.tokens && prevIndex && prevIndex + 1 < input.length) {
502
+ tokens[tokens.length - 1].value = value;
503
+ depth(tokens[tokens.length - 1]);
504
+ state.maxDepth += tokens[tokens.length - 1].depth;
505
+ }
506
+ state.slashes = slashes;
507
+ state.parts = parts;
508
+ }
509
+ return state;
510
+ };
511
+ module.exports = scan;
512
+ }));
513
+ // ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/lib/parse.js
514
+ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
515
+ const constants = require_constants();
516
+ const utils = require_utils();
517
+ /**
518
+ * Constants
519
+ */
520
+ const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants;
521
+ /**
522
+ * Helpers
523
+ */
524
+ const expandRange = (args, options) => {
525
+ if (typeof options.expandRange === "function") return options.expandRange(...args, options);
526
+ args.sort();
527
+ const value = `[${args.join("-")}]`;
528
+ try {
529
+ new RegExp(value);
530
+ } catch (ex) {
531
+ return args.map((v) => utils.escapeRegex(v)).join("..");
532
+ }
533
+ return value;
534
+ };
535
+ /**
536
+ * Create the message for a syntax error
537
+ */
538
+ const syntaxError = (type, char) => {
539
+ return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
540
+ };
541
+ const splitTopLevel = (input) => {
542
+ const parts = [];
543
+ let bracket = 0;
544
+ let paren = 0;
545
+ let quote = 0;
546
+ let value = "";
547
+ let escaped = false;
548
+ for (const ch of input) {
549
+ if (escaped === true) {
550
+ value += ch;
551
+ escaped = false;
552
+ continue;
553
+ }
554
+ if (ch === "\\") {
555
+ value += ch;
556
+ escaped = true;
557
+ continue;
558
+ }
559
+ if (ch === "\"") {
560
+ quote = quote === 1 ? 0 : 1;
561
+ value += ch;
562
+ continue;
563
+ }
564
+ if (quote === 0) {
565
+ if (ch === "[") bracket++;
566
+ else if (ch === "]" && bracket > 0) bracket--;
567
+ else if (bracket === 0) {
568
+ if (ch === "(") paren++;
569
+ else if (ch === ")" && paren > 0) paren--;
570
+ else if (ch === "|" && paren === 0) {
571
+ parts.push(value);
572
+ value = "";
573
+ continue;
574
+ }
575
+ }
576
+ }
577
+ value += ch;
578
+ }
579
+ parts.push(value);
580
+ return parts;
581
+ };
582
+ const isPlainBranch = (branch) => {
583
+ let escaped = false;
584
+ for (const ch of branch) {
585
+ if (escaped === true) {
586
+ escaped = false;
587
+ continue;
588
+ }
589
+ if (ch === "\\") {
590
+ escaped = true;
591
+ continue;
592
+ }
593
+ if (/[?*+@!()[\]{}]/.test(ch)) return false;
594
+ }
595
+ return true;
596
+ };
597
+ const normalizeSimpleBranch = (branch) => {
598
+ let value = branch.trim();
599
+ let changed = true;
600
+ while (changed === true) {
601
+ changed = false;
602
+ if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
603
+ value = value.slice(2, -1);
604
+ changed = true;
605
+ }
606
+ }
607
+ if (!isPlainBranch(value)) return;
608
+ return value.replace(/\\(.)/g, "$1");
609
+ };
610
+ const hasRepeatedCharPrefixOverlap = (branches) => {
611
+ const values = branches.map(normalizeSimpleBranch).filter(Boolean);
612
+ for (let i = 0; i < values.length; i++) for (let j = i + 1; j < values.length; j++) {
613
+ const a = values[i];
614
+ const b = values[j];
615
+ const char = a[0];
616
+ if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) continue;
617
+ if (a === b || a.startsWith(b) || b.startsWith(a)) return true;
618
+ }
619
+ return false;
620
+ };
621
+ const parseRepeatedExtglob = (pattern, requireEnd = true) => {
622
+ if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") return;
623
+ let bracket = 0;
624
+ let paren = 0;
625
+ let quote = 0;
626
+ let escaped = false;
627
+ for (let i = 1; i < pattern.length; i++) {
628
+ const ch = pattern[i];
629
+ if (escaped === true) {
630
+ escaped = false;
631
+ continue;
632
+ }
633
+ if (ch === "\\") {
634
+ escaped = true;
635
+ continue;
636
+ }
637
+ if (ch === "\"") {
638
+ quote = quote === 1 ? 0 : 1;
639
+ continue;
640
+ }
641
+ if (quote === 1) continue;
642
+ if (ch === "[") {
643
+ bracket++;
644
+ continue;
645
+ }
646
+ if (ch === "]" && bracket > 0) {
647
+ bracket--;
648
+ continue;
649
+ }
650
+ if (bracket > 0) continue;
651
+ if (ch === "(") {
652
+ paren++;
653
+ continue;
654
+ }
655
+ if (ch === ")") {
656
+ paren--;
657
+ if (paren === 0) {
658
+ if (requireEnd === true && i !== pattern.length - 1) return;
659
+ return {
660
+ type: pattern[0],
661
+ body: pattern.slice(2, i),
662
+ end: i
663
+ };
664
+ }
665
+ }
666
+ }
667
+ };
668
+ const buildCharClassStar = (chars) => {
669
+ return `${chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`}*`;
670
+ };
671
+ const getStarExtglobSequenceChars = (pattern) => {
672
+ let index = 0;
673
+ const chars = [];
674
+ while (index < pattern.length) {
675
+ const match = parseRepeatedExtglob(pattern.slice(index), false);
676
+ if (!match || match.type !== "*") return;
677
+ const branches = splitTopLevel(match.body).map((branch) => branch.trim());
678
+ if (branches.length !== 1) return;
679
+ const branch = normalizeSimpleBranch(branches[0]);
680
+ if (!branch || branch.length !== 1) return;
681
+ chars.push(branch);
682
+ index += match.end + 1;
683
+ }
684
+ if (chars.length < 1) return;
685
+ return chars;
686
+ };
687
+ const repeatedExtglobRecursion = (pattern) => {
688
+ let depth = 0;
689
+ let value = pattern.trim();
690
+ let match = parseRepeatedExtglob(value);
691
+ while (match) {
692
+ depth++;
693
+ value = match.body.trim();
694
+ match = parseRepeatedExtglob(value);
695
+ }
696
+ return depth;
697
+ };
698
+ const analyzeRepeatedExtglob = (body, options) => {
699
+ if (options.maxExtglobRecursion === false) return { risky: false };
700
+ const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
701
+ const branches = splitTopLevel(body).map((branch) => branch.trim());
702
+ if (branches.length > 1) {
703
+ if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) return { risky: true };
704
+ }
705
+ const safeChars = [];
706
+ let sawStarSequence = false;
707
+ let combinable = true;
708
+ for (const branch of branches) {
709
+ const chars = getStarExtglobSequenceChars(branch);
710
+ if (chars) {
711
+ sawStarSequence = true;
712
+ safeChars.push(...chars);
713
+ continue;
714
+ }
715
+ const literal = normalizeSimpleBranch(branch);
716
+ if (literal && literal.length === 1) {
717
+ safeChars.push(literal);
718
+ continue;
719
+ }
720
+ combinable = false;
721
+ if (repeatedExtglobRecursion(branch) > max) return { risky: true };
722
+ }
723
+ if (sawStarSequence) return combinable ? {
724
+ risky: true,
725
+ safeOutput: buildCharClassStar([...new Set(safeChars)])
726
+ } : { risky: true };
727
+ return { risky: false };
728
+ };
729
+ /**
730
+ * Parse the given input string.
731
+ * @param {String} input
732
+ * @param {Object} options
733
+ * @return {Object}
734
+ */
735
+ const parse = (input, options) => {
736
+ if (typeof input !== "string") throw new TypeError("Expected a string");
737
+ input = REPLACEMENTS[input] || input;
738
+ const opts = { ...options };
739
+ const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
740
+ let len = input.length;
741
+ if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
742
+ const bos = {
743
+ type: "bos",
744
+ value: "",
745
+ output: opts.prepend || ""
746
+ };
747
+ const tokens = [bos];
748
+ const capture = opts.capture ? "" : "?:";
749
+ const PLATFORM_CHARS = constants.globChars(opts.windows);
750
+ const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
751
+ const { DOT_LITERAL, PLUS_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK, QMARK_NO_DOT, STAR, START_ANCHOR } = PLATFORM_CHARS;
752
+ const globstar = (opts) => {
753
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
754
+ };
755
+ const nodot = opts.dot ? "" : NO_DOT;
756
+ const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
757
+ let star = opts.bash === true ? globstar(opts) : STAR;
758
+ if (opts.capture) star = `(${star})`;
759
+ if (typeof opts.noext === "boolean") opts.noextglob = opts.noext;
760
+ const state = {
761
+ input,
762
+ index: -1,
763
+ start: 0,
764
+ dot: opts.dot === true,
765
+ consumed: "",
766
+ output: "",
767
+ prefix: "",
768
+ backtrack: false,
769
+ negated: false,
770
+ brackets: 0,
771
+ braces: 0,
772
+ parens: 0,
773
+ quotes: 0,
774
+ globstar: false,
775
+ tokens
776
+ };
777
+ input = utils.removePrefix(input, state);
778
+ len = input.length;
779
+ const extglobs = [];
780
+ const braces = [];
781
+ const stack = [];
782
+ let prev = bos;
783
+ let value;
784
+ /**
785
+ * Tokenizing helpers
786
+ */
787
+ const eos = () => state.index === len - 1;
788
+ const peek = state.peek = (n = 1) => input[state.index + n];
789
+ const advance = state.advance = () => input[++state.index] || "";
790
+ const remaining = () => input.slice(state.index + 1);
791
+ const consume = (value = "", num = 0) => {
792
+ state.consumed += value;
793
+ state.index += num;
794
+ };
795
+ const append = (token) => {
796
+ state.output += token.output != null ? token.output : token.value;
797
+ consume(token.value);
798
+ };
799
+ const negate = () => {
800
+ let count = 1;
801
+ while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
802
+ advance();
803
+ state.start++;
804
+ count++;
805
+ }
806
+ if (count % 2 === 0) return false;
807
+ state.negated = true;
808
+ state.start++;
809
+ return true;
810
+ };
811
+ const increment = (type) => {
812
+ state[type]++;
813
+ stack.push(type);
814
+ };
815
+ const decrement = (type) => {
816
+ state[type]--;
817
+ stack.pop();
818
+ };
819
+ /**
820
+ * Push tokens onto the tokens array. This helper speeds up
821
+ * tokenizing by 1) helping us avoid backtracking as much as possible,
822
+ * and 2) helping us avoid creating extra tokens when consecutive
823
+ * characters are plain text. This improves performance and simplifies
824
+ * lookbehinds.
825
+ */
826
+ const push = (tok) => {
827
+ if (prev.type === "globstar") {
828
+ const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
829
+ const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
830
+ if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
831
+ state.output = state.output.slice(0, -prev.output.length);
832
+ prev.type = "star";
833
+ prev.value = "*";
834
+ prev.output = star;
835
+ state.output += prev.output;
836
+ }
837
+ }
838
+ if (extglobs.length && tok.type !== "paren") extglobs[extglobs.length - 1].inner += tok.value;
839
+ if (tok.value || tok.output) append(tok);
840
+ if (prev && prev.type === "text" && tok.type === "text") {
841
+ prev.output = (prev.output || prev.value) + tok.value;
842
+ prev.value += tok.value;
843
+ return;
844
+ }
845
+ tok.prev = prev;
846
+ tokens.push(tok);
847
+ prev = tok;
848
+ };
849
+ const extglobOpen = (type, value) => {
850
+ const token = {
851
+ ...EXTGLOB_CHARS[value],
852
+ conditions: 1,
853
+ inner: ""
854
+ };
855
+ token.prev = prev;
856
+ token.parens = state.parens;
857
+ token.output = state.output;
858
+ token.startIndex = state.index;
859
+ token.tokensIndex = tokens.length;
860
+ const output = (opts.capture ? "(" : "") + token.open;
861
+ increment("parens");
862
+ push({
863
+ type,
864
+ value,
865
+ output: state.output ? "" : ONE_CHAR
866
+ });
867
+ push({
868
+ type: "paren",
869
+ extglob: true,
870
+ value: advance(),
871
+ output
872
+ });
873
+ extglobs.push(token);
874
+ };
875
+ const extglobClose = (token) => {
876
+ const literal = input.slice(token.startIndex, state.index + 1);
877
+ const body = input.slice(token.startIndex + 2, state.index);
878
+ const analysis = analyzeRepeatedExtglob(body, opts);
879
+ if ((token.type === "plus" || token.type === "star") && analysis.risky) {
880
+ const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
881
+ const open = tokens[token.tokensIndex];
882
+ open.type = "text";
883
+ open.value = literal;
884
+ open.output = safeOutput || utils.escapeRegex(literal);
885
+ for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
886
+ tokens[i].value = "";
887
+ tokens[i].output = "";
888
+ delete tokens[i].suffix;
889
+ }
890
+ state.output = token.output + open.output;
891
+ state.backtrack = true;
892
+ push({
893
+ type: "paren",
894
+ extglob: true,
895
+ value,
896
+ output: ""
897
+ });
898
+ decrement("parens");
899
+ return;
900
+ }
901
+ let output = token.close + (opts.capture ? ")" : "");
902
+ let rest;
903
+ if (token.type === "negate") {
904
+ let extglobStar = star;
905
+ if (token.inner && token.inner.length > 1 && token.inner.includes("/")) extglobStar = globstar(opts);
906
+ if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) output = token.close = `)$))${extglobStar}`;
907
+ if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) output = token.close = `)${parse(rest, {
908
+ ...options,
909
+ fastpaths: false
910
+ }).output})${extglobStar})`;
911
+ if (token.prev.type === "bos") state.negatedExtglob = true;
912
+ }
913
+ push({
914
+ type: "paren",
915
+ extglob: true,
916
+ value,
917
+ output
918
+ });
919
+ decrement("parens");
920
+ };
921
+ /**
922
+ * Fast paths
923
+ */
924
+ if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
925
+ let backslashes = false;
926
+ let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
927
+ if (first === "\\") {
928
+ backslashes = true;
929
+ return m;
930
+ }
931
+ if (first === "?") {
932
+ if (esc) return esc + first + (rest ? QMARK.repeat(rest.length) : "");
933
+ if (index === 0) return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
934
+ return QMARK.repeat(chars.length);
935
+ }
936
+ if (first === ".") return DOT_LITERAL.repeat(chars.length);
937
+ if (first === "*") {
938
+ if (esc) return esc + first + (rest ? star : "");
939
+ return star;
940
+ }
941
+ return esc ? m : `\\${m}`;
942
+ });
943
+ if (backslashes === true) {
944
+ if (opts.unescape === true) output = output.replace(/\\/g, "");
945
+ else output = output.replace(/\\+/g, (m) => {
946
+ return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
947
+ });
948
+ }
949
+ if (output === input && opts.contains === true) {
950
+ state.output = input;
951
+ return state;
952
+ }
953
+ state.output = utils.wrapOutput(output, state, options);
954
+ return state;
955
+ }
956
+ /**
957
+ * Tokenize input until we reach end-of-string
958
+ */
959
+ while (!eos()) {
960
+ value = advance();
961
+ if (value === "\0") continue;
962
+ /**
963
+ * Escaped characters
964
+ */
965
+ if (value === "\\") {
966
+ const next = peek();
967
+ if (next === "/" && opts.bash !== true) continue;
968
+ if (next === "." || next === ";") continue;
969
+ if (!next) {
970
+ value += "\\";
971
+ push({
972
+ type: "text",
973
+ value
974
+ });
975
+ continue;
976
+ }
977
+ const match = /^\\+/.exec(remaining());
978
+ let slashes = 0;
979
+ if (match && match[0].length > 2) {
980
+ slashes = match[0].length;
981
+ state.index += slashes;
982
+ if (slashes % 2 !== 0) value += "\\";
983
+ }
984
+ if (opts.unescape === true) value = advance();
985
+ else value += advance();
986
+ if (state.brackets === 0) {
987
+ push({
988
+ type: "text",
989
+ value
990
+ });
991
+ continue;
992
+ }
993
+ }
994
+ /**
995
+ * If we're inside a regex character class, continue
996
+ * until we reach the closing bracket.
997
+ */
998
+ if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
999
+ if (opts.posix !== false && value === ":") {
1000
+ const inner = prev.value.slice(1);
1001
+ if (inner.includes("[")) {
1002
+ prev.posix = true;
1003
+ if (inner.includes(":")) {
1004
+ const idx = prev.value.lastIndexOf("[");
1005
+ const pre = prev.value.slice(0, idx);
1006
+ const rest = prev.value.slice(idx + 2);
1007
+ const posix = POSIX_REGEX_SOURCE[rest];
1008
+ if (posix) {
1009
+ prev.value = pre + posix;
1010
+ state.backtrack = true;
1011
+ advance();
1012
+ if (!bos.output && tokens.indexOf(prev) === 1) bos.output = ONE_CHAR;
1013
+ continue;
1014
+ }
1015
+ }
1016
+ }
1017
+ }
1018
+ if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") value = `\\${value}`;
1019
+ if (value === "]" && (prev.value === "[" || prev.value === "[^")) value = `\\${value}`;
1020
+ if (opts.posix === true && value === "!" && prev.value === "[") value = "^";
1021
+ prev.value += value;
1022
+ append({ value });
1023
+ continue;
1024
+ }
1025
+ /**
1026
+ * If we're inside a quoted string, continue
1027
+ * until we reach the closing double quote.
1028
+ */
1029
+ if (state.quotes === 1 && value !== "\"") {
1030
+ value = utils.escapeRegex(value);
1031
+ prev.value += value;
1032
+ append({ value });
1033
+ continue;
1034
+ }
1035
+ /**
1036
+ * Double quotes
1037
+ */
1038
+ if (value === "\"") {
1039
+ state.quotes = state.quotes === 1 ? 0 : 1;
1040
+ if (opts.keepQuotes === true) push({
1041
+ type: "text",
1042
+ value
1043
+ });
1044
+ continue;
1045
+ }
1046
+ /**
1047
+ * Parentheses
1048
+ */
1049
+ if (value === "(") {
1050
+ increment("parens");
1051
+ push({
1052
+ type: "paren",
1053
+ value
1054
+ });
1055
+ continue;
1056
+ }
1057
+ if (value === ")") {
1058
+ if (state.parens === 0 && opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "("));
1059
+ const extglob = extglobs[extglobs.length - 1];
1060
+ if (extglob && state.parens === extglob.parens + 1) {
1061
+ extglobClose(extglobs.pop());
1062
+ continue;
1063
+ }
1064
+ push({
1065
+ type: "paren",
1066
+ value,
1067
+ output: state.parens ? ")" : "\\)"
1068
+ });
1069
+ decrement("parens");
1070
+ continue;
1071
+ }
1072
+ /**
1073
+ * Square brackets
1074
+ */
1075
+ if (value === "[") {
1076
+ if (opts.nobracket === true || !remaining().includes("]")) {
1077
+ if (opts.nobracket !== true && opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
1078
+ value = `\\${value}`;
1079
+ } else increment("brackets");
1080
+ push({
1081
+ type: "bracket",
1082
+ value
1083
+ });
1084
+ continue;
1085
+ }
1086
+ if (value === "]") {
1087
+ if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
1088
+ push({
1089
+ type: "text",
1090
+ value,
1091
+ output: `\\${value}`
1092
+ });
1093
+ continue;
1094
+ }
1095
+ if (state.brackets === 0) {
1096
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "["));
1097
+ push({
1098
+ type: "text",
1099
+ value,
1100
+ output: `\\${value}`
1101
+ });
1102
+ continue;
1103
+ }
1104
+ decrement("brackets");
1105
+ const prevValue = prev.value.slice(1);
1106
+ if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) value = `/${value}`;
1107
+ prev.value += value;
1108
+ append({ value });
1109
+ if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) continue;
1110
+ const escaped = utils.escapeRegex(prev.value);
1111
+ state.output = state.output.slice(0, -prev.value.length);
1112
+ if (opts.literalBrackets === true) {
1113
+ state.output += escaped;
1114
+ prev.value = escaped;
1115
+ continue;
1116
+ }
1117
+ prev.value = `(${capture}${escaped}|${prev.value})`;
1118
+ state.output += prev.value;
1119
+ continue;
1120
+ }
1121
+ /**
1122
+ * Braces
1123
+ */
1124
+ if (value === "{" && opts.nobrace !== true) {
1125
+ increment("braces");
1126
+ const open = {
1127
+ type: "brace",
1128
+ value,
1129
+ output: "(",
1130
+ outputIndex: state.output.length,
1131
+ tokensIndex: state.tokens.length
1132
+ };
1133
+ braces.push(open);
1134
+ push(open);
1135
+ continue;
1136
+ }
1137
+ if (value === "}") {
1138
+ const brace = braces[braces.length - 1];
1139
+ if (opts.nobrace === true || !brace) {
1140
+ push({
1141
+ type: "text",
1142
+ value,
1143
+ output: value
1144
+ });
1145
+ continue;
1146
+ }
1147
+ let output = ")";
1148
+ if (brace.dots === true) {
1149
+ const arr = tokens.slice();
1150
+ const range = [];
1151
+ for (let i = arr.length - 1; i >= 0; i--) {
1152
+ tokens.pop();
1153
+ if (arr[i].type === "brace") break;
1154
+ if (arr[i].type !== "dots") range.unshift(arr[i].value);
1155
+ }
1156
+ output = expandRange(range, opts);
1157
+ state.backtrack = true;
1158
+ }
1159
+ if (brace.comma !== true && brace.dots !== true) {
1160
+ const out = state.output.slice(0, brace.outputIndex);
1161
+ const toks = state.tokens.slice(brace.tokensIndex);
1162
+ brace.value = brace.output = "\\{";
1163
+ value = output = "\\}";
1164
+ state.output = out;
1165
+ for (const t of toks) state.output += t.output || t.value;
1166
+ }
1167
+ push({
1168
+ type: "brace",
1169
+ value,
1170
+ output
1171
+ });
1172
+ decrement("braces");
1173
+ braces.pop();
1174
+ continue;
1175
+ }
1176
+ /**
1177
+ * Pipes
1178
+ */
1179
+ if (value === "|") {
1180
+ if (extglobs.length > 0) extglobs[extglobs.length - 1].conditions++;
1181
+ push({
1182
+ type: "text",
1183
+ value
1184
+ });
1185
+ continue;
1186
+ }
1187
+ /**
1188
+ * Commas
1189
+ */
1190
+ if (value === ",") {
1191
+ let output = value;
1192
+ const brace = braces[braces.length - 1];
1193
+ if (brace && stack[stack.length - 1] === "braces") {
1194
+ brace.comma = true;
1195
+ output = "|";
1196
+ }
1197
+ push({
1198
+ type: "comma",
1199
+ value,
1200
+ output
1201
+ });
1202
+ continue;
1203
+ }
1204
+ /**
1205
+ * Slashes
1206
+ */
1207
+ if (value === "/") {
1208
+ if (prev.type === "dot" && state.index === state.start + 1) {
1209
+ state.start = state.index + 1;
1210
+ state.consumed = "";
1211
+ state.output = "";
1212
+ tokens.pop();
1213
+ prev = bos;
1214
+ continue;
1215
+ }
1216
+ push({
1217
+ type: "slash",
1218
+ value,
1219
+ output: SLASH_LITERAL
1220
+ });
1221
+ continue;
1222
+ }
1223
+ /**
1224
+ * Dots
1225
+ */
1226
+ if (value === ".") {
1227
+ if (state.braces > 0 && prev.type === "dot") {
1228
+ if (prev.value === ".") prev.output = DOT_LITERAL;
1229
+ const brace = braces[braces.length - 1];
1230
+ prev.type = "dots";
1231
+ prev.output += value;
1232
+ prev.value += value;
1233
+ brace.dots = true;
1234
+ continue;
1235
+ }
1236
+ if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
1237
+ push({
1238
+ type: "text",
1239
+ value,
1240
+ output: DOT_LITERAL
1241
+ });
1242
+ continue;
1243
+ }
1244
+ push({
1245
+ type: "dot",
1246
+ value,
1247
+ output: DOT_LITERAL
1248
+ });
1249
+ continue;
1250
+ }
1251
+ /**
1252
+ * Question marks
1253
+ */
1254
+ if (value === "?") {
1255
+ if (!(prev && prev.value === "(") && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
1256
+ extglobOpen("qmark", value);
1257
+ continue;
1258
+ }
1259
+ if (prev && prev.type === "paren") {
1260
+ const next = peek();
1261
+ let output = value;
1262
+ if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) output = `\\${value}`;
1263
+ push({
1264
+ type: "text",
1265
+ value,
1266
+ output
1267
+ });
1268
+ continue;
1269
+ }
1270
+ if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
1271
+ push({
1272
+ type: "qmark",
1273
+ value,
1274
+ output: QMARK_NO_DOT
1275
+ });
1276
+ continue;
1277
+ }
1278
+ push({
1279
+ type: "qmark",
1280
+ value,
1281
+ output: QMARK
1282
+ });
1283
+ continue;
1284
+ }
1285
+ /**
1286
+ * Exclamation
1287
+ */
1288
+ if (value === "!") {
1289
+ if (opts.noextglob !== true && peek() === "(") {
1290
+ if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
1291
+ extglobOpen("negate", value);
1292
+ continue;
1293
+ }
1294
+ }
1295
+ if (opts.nonegate !== true && state.index === 0) {
1296
+ negate();
1297
+ continue;
1298
+ }
1299
+ }
1300
+ /**
1301
+ * Plus
1302
+ */
1303
+ if (value === "+") {
1304
+ if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
1305
+ extglobOpen("plus", value);
1306
+ continue;
1307
+ }
1308
+ if (prev && prev.value === "(" || opts.regex === false) {
1309
+ push({
1310
+ type: "plus",
1311
+ value,
1312
+ output: PLUS_LITERAL
1313
+ });
1314
+ continue;
1315
+ }
1316
+ if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
1317
+ push({
1318
+ type: "plus",
1319
+ value
1320
+ });
1321
+ continue;
1322
+ }
1323
+ push({
1324
+ type: "plus",
1325
+ value: PLUS_LITERAL
1326
+ });
1327
+ continue;
1328
+ }
1329
+ /**
1330
+ * Plain text
1331
+ */
1332
+ if (value === "@") {
1333
+ if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
1334
+ push({
1335
+ type: "at",
1336
+ extglob: true,
1337
+ value,
1338
+ output: ""
1339
+ });
1340
+ continue;
1341
+ }
1342
+ push({
1343
+ type: "text",
1344
+ value
1345
+ });
1346
+ continue;
1347
+ }
1348
+ /**
1349
+ * Plain text
1350
+ */
1351
+ if (value !== "*") {
1352
+ if (value === "$" || value === "^") value = `\\${value}`;
1353
+ const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
1354
+ if (match) {
1355
+ value += match[0];
1356
+ state.index += match[0].length;
1357
+ }
1358
+ push({
1359
+ type: "text",
1360
+ value
1361
+ });
1362
+ continue;
1363
+ }
1364
+ /**
1365
+ * Stars
1366
+ */
1367
+ if (prev && (prev.type === "globstar" || prev.star === true)) {
1368
+ prev.type = "star";
1369
+ prev.star = true;
1370
+ prev.value += value;
1371
+ prev.output = star;
1372
+ state.backtrack = true;
1373
+ state.globstar = true;
1374
+ consume(value);
1375
+ continue;
1376
+ }
1377
+ let rest = remaining();
1378
+ if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
1379
+ extglobOpen("star", value);
1380
+ continue;
1381
+ }
1382
+ if (prev.type === "star") {
1383
+ if (opts.noglobstar === true) {
1384
+ consume(value);
1385
+ continue;
1386
+ }
1387
+ const prior = prev.prev;
1388
+ const before = prior.prev;
1389
+ const isStart = prior.type === "slash" || prior.type === "bos";
1390
+ const afterStar = before && (before.type === "star" || before.type === "globstar");
1391
+ if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
1392
+ push({
1393
+ type: "star",
1394
+ value,
1395
+ output: ""
1396
+ });
1397
+ continue;
1398
+ }
1399
+ const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
1400
+ const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
1401
+ if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
1402
+ push({
1403
+ type: "star",
1404
+ value,
1405
+ output: ""
1406
+ });
1407
+ continue;
1408
+ }
1409
+ while (rest.slice(0, 3) === "/**") {
1410
+ const after = input[state.index + 4];
1411
+ if (after && after !== "/") break;
1412
+ rest = rest.slice(3);
1413
+ consume("/**", 3);
1414
+ }
1415
+ const isEnd = eos() || state.parens > 0 && rest === ")".repeat(state.parens) && !extglobs.some((extglob) => extglob.type === "negate");
1416
+ if (prior.type === "bos" && eos()) {
1417
+ prev.type = "globstar";
1418
+ prev.value += value;
1419
+ prev.output = globstar(opts);
1420
+ state.output = prev.output;
1421
+ state.globstar = true;
1422
+ consume(value);
1423
+ continue;
1424
+ }
1425
+ if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && isEnd) {
1426
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
1427
+ prior.output = `(?:${prior.output}`;
1428
+ prev.type = "globstar";
1429
+ prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
1430
+ prev.value += value;
1431
+ state.globstar = true;
1432
+ state.output += prior.output + prev.output;
1433
+ consume(value);
1434
+ continue;
1435
+ }
1436
+ if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
1437
+ const end = rest[1] !== void 0 ? "|$" : "";
1438
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
1439
+ prior.output = `(?:${prior.output}`;
1440
+ prev.type = "globstar";
1441
+ prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
1442
+ prev.value += value;
1443
+ state.output += prior.output + prev.output;
1444
+ state.globstar = true;
1445
+ consume(value + advance());
1446
+ push({
1447
+ type: "slash",
1448
+ value: "/",
1449
+ output: ""
1450
+ });
1451
+ continue;
1452
+ }
1453
+ if (prior.type === "bos" && rest[0] === "/") {
1454
+ prev.type = "globstar";
1455
+ prev.value += value;
1456
+ prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
1457
+ state.output = prev.output;
1458
+ state.globstar = true;
1459
+ consume(value + advance());
1460
+ push({
1461
+ type: "slash",
1462
+ value: "/",
1463
+ output: ""
1464
+ });
1465
+ continue;
1466
+ }
1467
+ state.output = state.output.slice(0, -prev.output.length);
1468
+ prev.type = "globstar";
1469
+ prev.output = globstar(opts);
1470
+ prev.value += value;
1471
+ state.output += prev.output;
1472
+ state.globstar = true;
1473
+ consume(value);
1474
+ continue;
1475
+ }
1476
+ const token = {
1477
+ type: "star",
1478
+ value,
1479
+ output: star
1480
+ };
1481
+ if (opts.bash === true) {
1482
+ token.output = ".*?";
1483
+ if (prev.type === "bos" || prev.type === "slash") token.output = nodot + token.output;
1484
+ push(token);
1485
+ continue;
1486
+ }
1487
+ if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
1488
+ token.output = value;
1489
+ push(token);
1490
+ continue;
1491
+ }
1492
+ if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
1493
+ if (prev.type === "dot") {
1494
+ state.output += NO_DOT_SLASH;
1495
+ prev.output += NO_DOT_SLASH;
1496
+ } else if (opts.dot === true) {
1497
+ state.output += NO_DOTS_SLASH;
1498
+ prev.output += NO_DOTS_SLASH;
1499
+ } else {
1500
+ state.output += nodot;
1501
+ prev.output += nodot;
1502
+ }
1503
+ if (peek() !== "*") {
1504
+ state.output += ONE_CHAR;
1505
+ prev.output += ONE_CHAR;
1506
+ }
1507
+ }
1508
+ push(token);
1509
+ }
1510
+ while (state.brackets > 0) {
1511
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
1512
+ state.output = utils.escapeLast(state.output, "[");
1513
+ decrement("brackets");
1514
+ }
1515
+ while (state.parens > 0) {
1516
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", ")"));
1517
+ state.output = utils.escapeLast(state.output, "(");
1518
+ decrement("parens");
1519
+ }
1520
+ while (state.braces > 0) {
1521
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "}"));
1522
+ state.output = utils.escapeLast(state.output, "{");
1523
+ decrement("braces");
1524
+ }
1525
+ if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) push({
1526
+ type: "maybe_slash",
1527
+ value: "",
1528
+ output: `${SLASH_LITERAL}?`
1529
+ });
1530
+ if (state.backtrack === true) {
1531
+ state.output = "";
1532
+ for (const token of state.tokens) {
1533
+ state.output += token.output != null ? token.output : token.value;
1534
+ if (token.suffix) state.output += token.suffix;
1535
+ }
1536
+ }
1537
+ return state;
1538
+ };
1539
+ /**
1540
+ * Fast paths for creating regular expressions for common glob patterns.
1541
+ * This can significantly speed up processing and has very little downside
1542
+ * impact when none of the fast paths match.
1543
+ */
1544
+ parse.fastpaths = (input, options) => {
1545
+ const opts = { ...options };
1546
+ const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
1547
+ const len = input.length;
1548
+ if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
1549
+ input = REPLACEMENTS[input] || input;
1550
+ const { DOT_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR } = constants.globChars(opts.windows);
1551
+ const nodot = opts.dot ? NO_DOTS : NO_DOT;
1552
+ const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
1553
+ const capture = opts.capture ? "" : "?:";
1554
+ const state = {
1555
+ negated: false,
1556
+ prefix: ""
1557
+ };
1558
+ let star = opts.bash === true ? ".*?" : STAR;
1559
+ if (opts.capture) star = `(${star})`;
1560
+ const globstar = (opts) => {
1561
+ if (opts.noglobstar === true) return star;
1562
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
1563
+ };
1564
+ const create = (str) => {
1565
+ switch (str) {
1566
+ case "*": return `${nodot}${ONE_CHAR}${star}`;
1567
+ case ".*": return `${DOT_LITERAL}${ONE_CHAR}${star}`;
1568
+ case "*.*": return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
1569
+ case "*/*": return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
1570
+ case "**": return nodot + globstar(opts);
1571
+ case "**/*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
1572
+ case "**/*.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
1573
+ case "**/.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
1574
+ default: {
1575
+ const match = /^(.*?)\.(\w+)$/.exec(str);
1576
+ if (!match) return;
1577
+ const source = create(match[1]);
1578
+ if (!source) return;
1579
+ return source + DOT_LITERAL + match[2];
1580
+ }
1581
+ }
1582
+ };
1583
+ let source = create(utils.removePrefix(input, state));
1584
+ if (source && opts.strictSlashes !== true) source += `${SLASH_LITERAL}?`;
1585
+ return source;
1586
+ };
1587
+ module.exports = parse;
1588
+ }));
1589
+ // ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/lib/picomatch.js
1590
+ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1591
+ const scan = require_scan();
1592
+ const parse = require_parse();
1593
+ const utils = require_utils();
1594
+ const constants = require_constants();
1595
+ const isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
1596
+ /**
1597
+ * Creates a matcher function from one or more glob patterns. The
1598
+ * returned function takes a string to match as its first argument,
1599
+ * and returns true if the string is a match. The returned matcher
1600
+ * function also takes a boolean as the second argument that, when true,
1601
+ * returns an object with additional information.
1602
+ *
1603
+ * ```js
1604
+ * const picomatch = require('picomatch');
1605
+ * // picomatch(glob[, options]);
1606
+ *
1607
+ * const isMatch = picomatch('*.!(*a)');
1608
+ * console.log(isMatch('a.a')); //=> false
1609
+ * console.log(isMatch('a.b')); //=> true
1610
+ *
1611
+ * // For environments without `node.js`, `picomatch/posix` provides you a dependency-free matcher, without automatic OS detection.
1612
+ * const picomatch = require('picomatch/posix');
1613
+ * // the same API, defaulting to posix paths
1614
+ * const isMatch = picomatch('a/*');
1615
+ * console.log(isMatch('a\\b')); //=> false
1616
+ * console.log(isMatch('a/b')); //=> true
1617
+ *
1618
+ * // you can still configure the matcher function to accept windows paths
1619
+ * const isMatch = picomatch('a/*', { options: windows });
1620
+ * console.log(isMatch('a\\b')); //=> true
1621
+ * console.log(isMatch('a/b')); //=> true
1622
+ * ```
1623
+ * @name picomatch
1624
+ * @param {String|Array} `globs` One or more glob patterns.
1625
+ * @param {Object=} `options`
1626
+ * @return {Function=} Returns a matcher function.
1627
+ * @api public
1628
+ */
1629
+ const picomatch = (glob, options, returnState = false) => {
1630
+ if (Array.isArray(glob)) {
1631
+ const fns = glob.map((input) => picomatch(input, options, returnState));
1632
+ const arrayMatcher = (str) => {
1633
+ for (const isMatch of fns) {
1634
+ const state = isMatch(str);
1635
+ if (state) return state;
1636
+ }
1637
+ return false;
1638
+ };
1639
+ return arrayMatcher;
1640
+ }
1641
+ const isState = isObject(glob) && glob.tokens && glob.input;
1642
+ if (glob === "" || typeof glob !== "string" && !isState) throw new TypeError("Expected pattern to be a non-empty string");
1643
+ const opts = options || {};
1644
+ const posix = opts.windows;
1645
+ const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
1646
+ const state = regex.state;
1647
+ delete regex.state;
1648
+ let isIgnored = () => false;
1649
+ if (opts.ignore) {
1650
+ const ignoreOpts = {
1651
+ ...options,
1652
+ ignore: null,
1653
+ onMatch: null,
1654
+ onResult: null
1655
+ };
1656
+ isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
1657
+ }
1658
+ const matcher = (input, returnObject = false) => {
1659
+ const { isMatch, match, output } = picomatch.test(input, regex, options, {
1660
+ glob,
1661
+ posix
1662
+ });
1663
+ const result = {
1664
+ glob,
1665
+ state,
1666
+ regex,
1667
+ posix,
1668
+ input,
1669
+ output,
1670
+ match,
1671
+ isMatch
1672
+ };
1673
+ if (typeof opts.onResult === "function") opts.onResult(result);
1674
+ if (isMatch === false) {
1675
+ result.isMatch = false;
1676
+ return returnObject ? result : false;
1677
+ }
1678
+ if (isIgnored(input)) {
1679
+ if (typeof opts.onIgnore === "function") opts.onIgnore(result);
1680
+ result.isMatch = false;
1681
+ return returnObject ? result : false;
1682
+ }
1683
+ if (typeof opts.onMatch === "function") opts.onMatch(result);
1684
+ return returnObject ? result : true;
1685
+ };
1686
+ if (returnState) matcher.state = state;
1687
+ return matcher;
1688
+ };
1689
+ /**
1690
+ * Test `input` with the given `regex`. This is used by the main
1691
+ * `picomatch()` function to test the input string.
1692
+ *
1693
+ * ```js
1694
+ * const picomatch = require('picomatch');
1695
+ * // picomatch.test(input, regex[, options]);
1696
+ *
1697
+ * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
1698
+ * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
1699
+ * ```
1700
+ * @param {String} `input` String to test.
1701
+ * @param {RegExp} `regex`
1702
+ * @return {Object} Returns an object with matching info.
1703
+ * @api public
1704
+ */
1705
+ picomatch.test = (input, regex, options, { glob, posix } = {}) => {
1706
+ if (typeof input !== "string") throw new TypeError("Expected input to be a string");
1707
+ if (input === "") return {
1708
+ isMatch: false,
1709
+ output: ""
1710
+ };
1711
+ const opts = options || {};
1712
+ const format = opts.format || (posix ? utils.toPosixSlashes : null);
1713
+ let match = input === glob;
1714
+ let output = match && format ? format(input) : input;
1715
+ if (match === false) {
1716
+ output = format ? format(input) : input;
1717
+ match = output === glob;
1718
+ }
1719
+ if (match === false || opts.capture === true) {
1720
+ if (opts.matchBase === true || opts.basename === true) match = picomatch.matchBase(input, regex, options, posix);
1721
+ else match = regex.exec(output);
1722
+ }
1723
+ return {
1724
+ isMatch: Boolean(match),
1725
+ match,
1726
+ output
1727
+ };
1728
+ };
1729
+ /**
1730
+ * Match the basename of a filepath.
1731
+ *
1732
+ * ```js
1733
+ * const picomatch = require('picomatch');
1734
+ * // picomatch.matchBase(input, glob[, options]);
1735
+ * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
1736
+ * ```
1737
+ * @param {String} `input` String to test.
1738
+ * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
1739
+ * @return {Boolean}
1740
+ * @api public
1741
+ */
1742
+ picomatch.matchBase = (input, glob, options, posix = options && options.windows) => {
1743
+ return (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(utils.basename(input, { windows: posix }));
1744
+ };
1745
+ /**
1746
+ * Returns true if **any** of the given glob `patterns` match the specified `string`.
1747
+ *
1748
+ * ```js
1749
+ * const picomatch = require('picomatch');
1750
+ * // picomatch.isMatch(string, patterns[, options]);
1751
+ *
1752
+ * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
1753
+ * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
1754
+ * ```
1755
+ * @param {String|Array} str The string to test.
1756
+ * @param {String|Array} patterns One or more glob patterns to use for matching.
1757
+ * @param {Object} [options] See available [options](#options).
1758
+ * @return {Boolean} Returns true if any patterns match `str`
1759
+ * @api public
1760
+ */
1761
+ picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
1762
+ /**
1763
+ * Parse a glob pattern to create the source string for a regular
1764
+ * expression.
1765
+ *
1766
+ * ```js
1767
+ * const picomatch = require('picomatch');
1768
+ * const result = picomatch.parse(pattern[, options]);
1769
+ * ```
1770
+ * @param {String} `pattern`
1771
+ * @param {Object} `options`
1772
+ * @return {Object} Returns an object with useful properties and output to be used as a regex source string.
1773
+ * @api public
1774
+ */
1775
+ picomatch.parse = (pattern, options) => {
1776
+ if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
1777
+ return parse(pattern, {
1778
+ ...options,
1779
+ fastpaths: false
1780
+ });
1781
+ };
1782
+ /**
1783
+ * Scan a glob pattern to separate the pattern into segments.
1784
+ *
1785
+ * ```js
1786
+ * const picomatch = require('picomatch');
1787
+ * // picomatch.scan(input[, options]);
1788
+ *
1789
+ * const result = picomatch.scan('!./foo/*.js');
1790
+ * console.log(result);
1791
+ * { prefix: '!./',
1792
+ * input: '!./foo/*.js',
1793
+ * start: 3,
1794
+ * base: 'foo',
1795
+ * glob: '*.js',
1796
+ * isBrace: false,
1797
+ * isBracket: false,
1798
+ * isGlob: true,
1799
+ * isExtglob: false,
1800
+ * isGlobstar: false,
1801
+ * negated: true }
1802
+ * ```
1803
+ * @param {String} `input` Glob pattern to scan.
1804
+ * @param {Object} `options`
1805
+ * @return {Object} Returns an object with
1806
+ * @api public
1807
+ */
1808
+ picomatch.scan = (input, options) => scan(input, options);
1809
+ /**
1810
+ * Compile a regular expression from the `state` object returned by the
1811
+ * [parse()](#parse) method.
1812
+ *
1813
+ * ```js
1814
+ * const picomatch = require('picomatch');
1815
+ * const state = picomatch.parse('*.js');
1816
+ * // picomatch.compileRe(state[, options]);
1817
+ *
1818
+ * console.log(picomatch.compileRe(state));
1819
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
1820
+ * ```
1821
+ * @param {Object} `state`
1822
+ * @param {Object} `options`
1823
+ * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
1824
+ * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
1825
+ * @return {RegExp}
1826
+ * @api public
1827
+ */
1828
+ picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
1829
+ if (returnOutput === true) return state.output;
1830
+ const opts = options || {};
1831
+ const prepend = opts.contains ? "" : "^";
1832
+ const append = opts.contains ? "" : "$";
1833
+ let source = `${prepend}(?:${state.output})${append}`;
1834
+ if (state && state.negated === true) source = `^(?!${source}).*$`;
1835
+ const regex = picomatch.toRegex(source, options);
1836
+ if (returnState === true) regex.state = state;
1837
+ return regex;
1838
+ };
1839
+ /**
1840
+ * Create a regular expression from a parsed glob pattern.
1841
+ *
1842
+ * ```js
1843
+ * const picomatch = require('picomatch');
1844
+ * // picomatch.makeRe(state[, options]);
1845
+ *
1846
+ * const result = picomatch.makeRe('*.js');
1847
+ * console.log(result);
1848
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
1849
+ * ```
1850
+ * @param {String} `state` The object returned from the `.parse` method.
1851
+ * @param {Object} `options`
1852
+ * @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.
1853
+ * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
1854
+ * @return {RegExp} Returns a regex created from the given pattern.
1855
+ * @api public
1856
+ */
1857
+ picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
1858
+ if (!input || typeof input !== "string") throw new TypeError("Expected a non-empty string");
1859
+ let parsed = {
1860
+ negated: false,
1861
+ fastpaths: true
1862
+ };
1863
+ if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) parsed.output = parse.fastpaths(input, options);
1864
+ if (!parsed.output) parsed = parse(input, options);
1865
+ return picomatch.compileRe(parsed, options, returnOutput, returnState);
1866
+ };
1867
+ /**
1868
+ * Create a regular expression from the given regex source string.
1869
+ *
1870
+ * ```js
1871
+ * const picomatch = require('picomatch');
1872
+ * // picomatch.toRegex(source[, options]);
1873
+ *
1874
+ * const { output } = picomatch.parse('*.js');
1875
+ * console.log(picomatch.toRegex(output));
1876
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
1877
+ * ```
1878
+ * @param {String} `source` Regular expression source string.
1879
+ * @param {Object} `options`
1880
+ * @return {RegExp}
1881
+ * @api public
1882
+ */
1883
+ picomatch.toRegex = (source, options) => {
1884
+ try {
1885
+ const opts = options || {};
1886
+ return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
1887
+ } catch (err) {
1888
+ if (options && options.debug === true) throw err;
1889
+ return /$^/;
1890
+ }
1891
+ };
1892
+ /**
1893
+ * Picomatch constants.
1894
+ * @return {Object}
1895
+ */
1896
+ picomatch.constants = constants;
1897
+ /**
1898
+ * Expose "picomatch"
1899
+ */
1900
+ module.exports = picomatch;
1901
+ }));
1902
+ // ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/index.js
1903
+ var require_picomatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1904
+ const pico = require_picomatch$1();
1905
+ const utils = require_utils();
1906
+ function picomatch(glob, options, returnState = false) {
1907
+ if (options && (options.windows === null || options.windows === void 0)) options = {
1908
+ ...options,
1909
+ windows: utils.isWindows()
1910
+ };
1911
+ return pico(glob, options, returnState);
1912
+ }
1913
+ Object.assign(picomatch, pico);
1914
+ module.exports = picomatch;
1915
+ }));
1916
+ export { require_picomatch as t };