@opendesign-plus-test/plugins 0.0.1-rc.1 → 0.0.1-rc.10

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.
@@ -0,0 +1,1372 @@
1
+ var Ht = Object.defineProperty;
2
+ var St = (i) => {
3
+ throw TypeError(i);
4
+ };
5
+ var Jt = (i, t, e) => t in i ? Ht(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
6
+ var $ = (i, t, e) => Jt(i, typeof t != "symbol" ? t + "" : t, e), at = (i, t, e) => t.has(i) || St("Cannot " + e);
7
+ var o = (i, t, e) => (at(i, t, "read from private field"), e ? e.call(i) : t.get(i)), v = (i, t, e) => t.has(i) ? St("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), E = (i, t, e, s) => (at(i, t, "write to private field"), s ? s.call(i, e) : t.set(i, e), e), x = (i, t, e) => (at(i, t, "access private method"), e);
8
+ var ht = (i, t, e, s) => ({
9
+ set _(n) {
10
+ E(i, t, n, e);
11
+ },
12
+ get _() {
13
+ return o(i, t, s);
14
+ }
15
+ });
16
+ const vt = (i, t, e) => {
17
+ const s = i instanceof RegExp ? Et(i, e) : i, n = t instanceof RegExp ? Et(t, e) : t, r = s !== null && n != null && Vt(s, n, e);
18
+ return r && {
19
+ start: r[0],
20
+ end: r[1],
21
+ pre: e.slice(0, r[0]),
22
+ body: e.slice(r[0] + s.length, r[1]),
23
+ post: e.slice(r[1] + n.length)
24
+ };
25
+ }, Et = (i, t) => {
26
+ const e = t.match(i);
27
+ return e ? e[0] : null;
28
+ }, Vt = (i, t, e) => {
29
+ let s, n, r, c, f, p = e.indexOf(i), a = e.indexOf(t, p + 1), h = p;
30
+ if (p >= 0 && a > 0) {
31
+ if (i === t)
32
+ return [p, a];
33
+ for (s = [], r = e.length; h >= 0 && !f; ) {
34
+ if (h === p)
35
+ s.push(h), p = e.indexOf(i, h + 1);
36
+ else if (s.length === 1) {
37
+ const l = s.pop();
38
+ l !== void 0 && (f = [l, a]);
39
+ } else
40
+ n = s.pop(), n !== void 0 && n < r && (r = n, c = a), a = e.indexOf(t, h + 1);
41
+ h = p < a && p >= 0 ? p : a;
42
+ }
43
+ s.length && c !== void 0 && (f = [r, c]);
44
+ }
45
+ return f;
46
+ }, Rt = "\0SLASH" + Math.random() + "\0", jt = "\0OPEN" + Math.random() + "\0", yt = "\0CLOSE" + Math.random() + "\0", Pt = "\0COMMA" + Math.random() + "\0", Ct = "\0PERIOD" + Math.random() + "\0", Xt = new RegExp(Rt, "g"), Qt = new RegExp(jt, "g"), Kt = new RegExp(yt, "g"), Yt = new RegExp(Pt, "g"), te = new RegExp(Ct, "g"), ee = /\\\\/g, se = /\\{/g, ne = /\\}/g, ie = /\\,/g, re = /\\\./g, oe = 1e5;
47
+ function ft(i) {
48
+ return isNaN(i) ? i.charCodeAt(0) : parseInt(i, 10);
49
+ }
50
+ function ce(i) {
51
+ return i.replace(ee, Rt).replace(se, jt).replace(ne, yt).replace(ie, Pt).replace(re, Ct);
52
+ }
53
+ function le(i) {
54
+ return i.replace(Xt, "\\").replace(Qt, "{").replace(Kt, "}").replace(Yt, ",").replace(te, ".");
55
+ }
56
+ function Wt(i) {
57
+ if (!i)
58
+ return [""];
59
+ const t = [], e = vt("{", "}", i);
60
+ if (!e)
61
+ return i.split(",");
62
+ const { pre: s, body: n, post: r } = e, c = s.split(",");
63
+ c[c.length - 1] += "{" + n + "}";
64
+ const f = Wt(r);
65
+ return r.length && (c[c.length - 1] += f.shift(), c.push.apply(c, f)), t.push.apply(t, c), t;
66
+ }
67
+ function ae(i, t = {}) {
68
+ if (!i)
69
+ return [];
70
+ const { max: e = oe } = t;
71
+ return i.slice(0, 2) === "{}" && (i = "\\{\\}" + i.slice(2)), tt(ce(i), e, !0).map(le);
72
+ }
73
+ function he(i) {
74
+ return "{" + i + "}";
75
+ }
76
+ function fe(i) {
77
+ return /^-?0\d/.test(i);
78
+ }
79
+ function ue(i, t) {
80
+ return i <= t;
81
+ }
82
+ function pe(i, t) {
83
+ return i >= t;
84
+ }
85
+ function tt(i, t, e) {
86
+ const s = [], n = vt("{", "}", i);
87
+ if (!n)
88
+ return [i];
89
+ const r = n.pre, c = n.post.length ? tt(n.post, t, !1) : [""];
90
+ if (/\$$/.test(n.pre))
91
+ for (let f = 0; f < c.length && f < t; f++) {
92
+ const p = r + "{" + n.body + "}" + c[f];
93
+ s.push(p);
94
+ }
95
+ else {
96
+ const f = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body), p = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body), a = f || p, h = n.body.indexOf(",") >= 0;
97
+ if (!a && !h)
98
+ return n.post.match(/,(?!,).*\}/) ? (i = n.pre + "{" + n.body + yt + n.post, tt(i, t, !0)) : [i];
99
+ let l;
100
+ if (a)
101
+ l = n.body.split(/\.\./);
102
+ else if (l = Wt(n.body), l.length === 1 && l[0] !== void 0 && (l = tt(l[0], t, !1).map(he), l.length === 1))
103
+ return c.map((g) => n.pre + l[0] + g);
104
+ let u;
105
+ if (a && l[0] !== void 0 && l[1] !== void 0) {
106
+ const g = ft(l[0]), w = ft(l[1]), b = Math.max(l[0].length, l[1].length);
107
+ let P = l.length === 3 && l[2] !== void 0 ? Math.max(Math.abs(ft(l[2])), 1) : 1, T = ue;
108
+ w < g && (P *= -1, T = pe);
109
+ const S = l.some(fe);
110
+ u = [];
111
+ for (let m = g; T(m, w); m += P) {
112
+ let y;
113
+ if (p)
114
+ y = String.fromCharCode(m), y === "\\" && (y = "");
115
+ else if (y = String(m), S) {
116
+ const k = b - y.length;
117
+ if (k > 0) {
118
+ const C = new Array(k + 1).join("0");
119
+ m < 0 ? y = "-" + C + y.slice(1) : y = C + y;
120
+ }
121
+ }
122
+ u.push(y);
123
+ }
124
+ } else {
125
+ u = [];
126
+ for (let g = 0; g < l.length; g++)
127
+ u.push.apply(u, tt(l[g], t, !1));
128
+ }
129
+ for (let g = 0; g < u.length; g++)
130
+ for (let w = 0; w < c.length && s.length < t; w++) {
131
+ const b = r + u[g] + c[w];
132
+ (!e || a || b) && s.push(b);
133
+ }
134
+ }
135
+ return s;
136
+ }
137
+ const ge = 1024 * 64, ot = (i) => {
138
+ if (typeof i != "string")
139
+ throw new TypeError("invalid pattern");
140
+ if (i.length > ge)
141
+ throw new TypeError("pattern is too long");
142
+ }, de = {
143
+ "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", !0],
144
+ "[:alpha:]": ["\\p{L}\\p{Nl}", !0],
145
+ "[:ascii:]": ["\\x00-\\x7f", !1],
146
+ "[:blank:]": ["\\p{Zs}\\t", !0],
147
+ "[:cntrl:]": ["\\p{Cc}", !0],
148
+ "[:digit:]": ["\\p{Nd}", !0],
149
+ "[:graph:]": ["\\p{Z}\\p{C}", !0, !0],
150
+ "[:lower:]": ["\\p{Ll}", !0],
151
+ "[:print:]": ["\\p{C}", !0],
152
+ "[:punct:]": ["\\p{P}", !0],
153
+ "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", !0],
154
+ "[:upper:]": ["\\p{Lu}", !0],
155
+ "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", !0],
156
+ "[:xdigit:]": ["A-Fa-f0-9", !1]
157
+ }, Y = (i) => i.replace(/[[\]\\-]/g, "\\$&"), me = (i) => i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), bt = (i) => i.join(""), ye = (i, t) => {
158
+ const e = t;
159
+ if (i.charAt(e) !== "[")
160
+ throw new Error("not in a brace expression");
161
+ const s = [], n = [];
162
+ let r = e + 1, c = !1, f = !1, p = !1, a = !1, h = e, l = "";
163
+ t: for (; r < i.length; ) {
164
+ const b = i.charAt(r);
165
+ if ((b === "!" || b === "^") && r === e + 1) {
166
+ a = !0, r++;
167
+ continue;
168
+ }
169
+ if (b === "]" && c && !p) {
170
+ h = r + 1;
171
+ break;
172
+ }
173
+ if (c = !0, b === "\\" && !p) {
174
+ p = !0, r++;
175
+ continue;
176
+ }
177
+ if (b === "[" && !p) {
178
+ for (const [P, [T, N, S]] of Object.entries(de))
179
+ if (i.startsWith(P, r)) {
180
+ if (l)
181
+ return ["$.", !1, i.length - e, !0];
182
+ r += P.length, S ? n.push(T) : s.push(T), f = f || N;
183
+ continue t;
184
+ }
185
+ }
186
+ if (p = !1, l) {
187
+ b > l ? s.push(Y(l) + "-" + Y(b)) : b === l && s.push(Y(b)), l = "", r++;
188
+ continue;
189
+ }
190
+ if (i.startsWith("-]", r + 1)) {
191
+ s.push(Y(b + "-")), r += 2;
192
+ continue;
193
+ }
194
+ if (i.startsWith("-", r + 1)) {
195
+ l = b, r += 2;
196
+ continue;
197
+ }
198
+ s.push(Y(b)), r++;
199
+ }
200
+ if (h < r)
201
+ return ["", !1, 0, !1];
202
+ if (!s.length && !n.length)
203
+ return ["$.", !1, i.length - e, !0];
204
+ if (n.length === 0 && s.length === 1 && /^\\?.$/.test(s[0]) && !a) {
205
+ const b = s[0].length === 2 ? s[0].slice(-1) : s[0];
206
+ return [me(b), !1, h - e, !1];
207
+ }
208
+ const u = "[" + (a ? "^" : "") + bt(s) + "]", g = "[" + (a ? "" : "^") + bt(n) + "]";
209
+ return [s.length && n.length ? "(" + u + "|" + g + ")" : s.length ? u : g, f, h - e, !0];
210
+ }, et = (i, { windowsPathsNoEscape: t = !1, magicalBraces: e = !0 } = {}) => e ? t ? i.replace(/\[([^/\\])\]/g, "$1") : i.replace(/((?!\\).|^)\[([^/\\])\]/g, "$1$2").replace(/\\([^/])/g, "$1") : t ? i.replace(/\[([^/\\{}])\]/g, "$1") : i.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1");
211
+ var D;
212
+ const we = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), ut = (i) => we.has(i), xt = (i) => ut(i.type), Se = /* @__PURE__ */ new Map([
213
+ ["!", ["@"]],
214
+ ["?", ["?", "@"]],
215
+ ["@", ["@"]],
216
+ ["*", ["*", "+", "?", "@"]],
217
+ ["+", ["+", "@"]]
218
+ ]), Ee = /* @__PURE__ */ new Map([
219
+ ["!", ["?"]],
220
+ ["@", ["?"]],
221
+ ["+", ["?", "*"]]
222
+ ]), be = /* @__PURE__ */ new Map([
223
+ ["!", ["?", "@"]],
224
+ ["?", ["?", "@"]],
225
+ ["@", ["?", "@"]],
226
+ ["*", ["*", "+", "?", "@"]],
227
+ ["+", ["+", "@", "?", "*"]]
228
+ ]), Mt = /* @__PURE__ */ new Map([
229
+ ["!", /* @__PURE__ */ new Map([["!", "@"]])],
230
+ [
231
+ "?",
232
+ /* @__PURE__ */ new Map([
233
+ ["*", "*"],
234
+ ["+", "*"]
235
+ ])
236
+ ],
237
+ [
238
+ "@",
239
+ /* @__PURE__ */ new Map([
240
+ ["!", "!"],
241
+ ["?", "?"],
242
+ ["@", "@"],
243
+ ["*", "*"],
244
+ ["+", "+"]
245
+ ])
246
+ ],
247
+ [
248
+ "+",
249
+ /* @__PURE__ */ new Map([
250
+ ["?", "*"],
251
+ ["*", "*"]
252
+ ])
253
+ ]
254
+ ]), xe = "(?!(?:^|/)\\.\\.?(?:$|/))", st = "(?!\\.)", Me = /* @__PURE__ */ new Set(["[", "."]), Ne = /* @__PURE__ */ new Set(["..", "."]), Ae = new Set("().*{}+?[]^$\\!"), $e = (i) => i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), wt = "[^/]", Nt = wt + "*?", At = wt + "+?";
255
+ let Oe = 0;
256
+ var O, R, F, d, A, B, H, I, z, G, Q, M, Dt, Z, nt, Lt, pt, it, kt, gt, _t, qt, zt, rt, dt, Gt;
257
+ class ct {
258
+ constructor(t, e, s = {}) {
259
+ v(this, M);
260
+ $(this, "type");
261
+ v(this, O);
262
+ v(this, R);
263
+ v(this, F, !1);
264
+ v(this, d, []);
265
+ v(this, A);
266
+ v(this, B);
267
+ v(this, H);
268
+ v(this, I, !1);
269
+ v(this, z);
270
+ v(this, G);
271
+ // set to true if it's an extglob with no children
272
+ // (which really means one child of '')
273
+ v(this, Q, !1);
274
+ $(this, "id", ++Oe);
275
+ this.type = t, t && E(this, R, !0), E(this, A, e), E(this, O, o(this, A) ? o(o(this, A), O) : this), E(this, z, o(this, O) === this ? s : o(o(this, O), z)), E(this, H, o(this, O) === this ? [] : o(o(this, O), H)), t === "!" && !o(o(this, O), I) && o(this, H).push(this), E(this, B, o(this, A) ? o(o(this, A), d).length : 0);
276
+ }
277
+ get depth() {
278
+ var t;
279
+ return (((t = o(this, A)) == null ? void 0 : t.depth) ?? -1) + 1;
280
+ }
281
+ [Symbol.for("nodejs.util.inspect.custom")]() {
282
+ var t;
283
+ return {
284
+ "@@type": "AST",
285
+ id: this.id,
286
+ type: this.type,
287
+ root: o(this, O).id,
288
+ parent: (t = o(this, A)) == null ? void 0 : t.id,
289
+ depth: this.depth,
290
+ partsLength: o(this, d).length,
291
+ parts: o(this, d)
292
+ };
293
+ }
294
+ get hasMagic() {
295
+ if (o(this, R) !== void 0)
296
+ return o(this, R);
297
+ for (const t of o(this, d))
298
+ if (typeof t != "string" && (t.type || t.hasMagic))
299
+ return E(this, R, !0);
300
+ return o(this, R);
301
+ }
302
+ // reconstructs the pattern
303
+ toString() {
304
+ return o(this, G) !== void 0 ? o(this, G) : this.type ? E(this, G, this.type + "(" + o(this, d).map((t) => String(t)).join("|") + ")") : E(this, G, o(this, d).map((t) => String(t)).join(""));
305
+ }
306
+ push(...t) {
307
+ for (const e of t)
308
+ if (e !== "") {
309
+ if (typeof e != "string" && !(e instanceof D && o(e, A) === this))
310
+ throw new Error("invalid part: " + e);
311
+ o(this, d).push(e);
312
+ }
313
+ }
314
+ toJSON() {
315
+ var e;
316
+ const t = this.type === null ? o(this, d).slice().map((s) => typeof s == "string" ? s : s.toJSON()) : [this.type, ...o(this, d).map((s) => s.toJSON())];
317
+ return this.isStart() && !this.type && t.unshift([]), this.isEnd() && (this === o(this, O) || o(o(this, O), I) && ((e = o(this, A)) == null ? void 0 : e.type) === "!") && t.push({}), t;
318
+ }
319
+ isStart() {
320
+ var e;
321
+ if (o(this, O) === this)
322
+ return !0;
323
+ if (!((e = o(this, A)) != null && e.isStart()))
324
+ return !1;
325
+ if (o(this, B) === 0)
326
+ return !0;
327
+ const t = o(this, A);
328
+ for (let s = 0; s < o(this, B); s++) {
329
+ const n = o(t, d)[s];
330
+ if (!(n instanceof D && n.type === "!"))
331
+ return !1;
332
+ }
333
+ return !0;
334
+ }
335
+ isEnd() {
336
+ var e, s, n;
337
+ if (o(this, O) === this || ((e = o(this, A)) == null ? void 0 : e.type) === "!")
338
+ return !0;
339
+ if (!((s = o(this, A)) != null && s.isEnd()))
340
+ return !1;
341
+ if (!this.type)
342
+ return (n = o(this, A)) == null ? void 0 : n.isEnd();
343
+ const t = o(this, A) ? o(o(this, A), d).length : 0;
344
+ return o(this, B) === t - 1;
345
+ }
346
+ copyIn(t) {
347
+ typeof t == "string" ? this.push(t) : this.push(t.clone(this));
348
+ }
349
+ clone(t) {
350
+ const e = new D(this.type, t);
351
+ for (const s of o(this, d))
352
+ e.copyIn(s);
353
+ return e;
354
+ }
355
+ static fromGlob(t, e = {}) {
356
+ var n;
357
+ const s = new D(null, void 0, e);
358
+ return x(n = D, Z, nt).call(n, t, s, 0, e, 0), s;
359
+ }
360
+ // returns the regular expression if there's magic, or the unescaped
361
+ // string if not.
362
+ toMMPattern() {
363
+ if (this !== o(this, O))
364
+ return o(this, O).toMMPattern();
365
+ const t = this.toString(), [e, s, n, r] = this.toRegExpSource();
366
+ if (!(n || o(this, R) || o(this, z).nocase && !o(this, z).nocaseMagicOnly && t.toUpperCase() !== t.toLowerCase()))
367
+ return s;
368
+ const f = (o(this, z).nocase ? "i" : "") + (r ? "u" : "");
369
+ return Object.assign(new RegExp(`^${e}$`, f), {
370
+ _src: e,
371
+ _glob: t
372
+ });
373
+ }
374
+ get options() {
375
+ return o(this, z);
376
+ }
377
+ // returns the string match, the regexp source, whether there's magic
378
+ // in the regexp (so a regular expression is required) and whether or
379
+ // not the uflag is needed for the regular expression (for posix classes)
380
+ // TODO: instead of injecting the start/end at this point, just return
381
+ // the BODY of the regexp, along with the start/end portions suitable
382
+ // for binding the start/end in either a joined full-path makeRe context
383
+ // (where we bind to (^|/), or a standalone matchPart context (where
384
+ // we bind to ^, and not /). Otherwise slashes get duped!
385
+ //
386
+ // In part-matching mode, the start is:
387
+ // - if not isStart: nothing
388
+ // - if traversal possible, but not allowed: ^(?!\.\.?$)
389
+ // - if dots allowed or not possible: ^
390
+ // - if dots possible and not allowed: ^(?!\.)
391
+ // end is:
392
+ // - if not isEnd(): nothing
393
+ // - else: $
394
+ //
395
+ // In full-path matching mode, we put the slash at the START of the
396
+ // pattern, so start is:
397
+ // - if first pattern: same as part-matching mode
398
+ // - if not isStart(): nothing
399
+ // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
400
+ // - if dots allowed or not possible: /
401
+ // - if dots possible and not allowed: /(?!\.)
402
+ // end is:
403
+ // - if last pattern, same as part-matching mode
404
+ // - else nothing
405
+ //
406
+ // Always put the (?:$|/) on negated tails, though, because that has to be
407
+ // there to bind the end of the negated pattern portion, and it's easier to
408
+ // just stick it in now rather than try to inject it later in the middle of
409
+ // the pattern.
410
+ //
411
+ // We can just always return the same end, and leave it up to the caller
412
+ // to know whether it's going to be used joined or in parts.
413
+ // And, if the start is adjusted slightly, can do the same there:
414
+ // - if not isStart: nothing
415
+ // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
416
+ // - if dots allowed or not possible: (?:/|^)
417
+ // - if dots possible and not allowed: (?:/|^)(?!\.)
418
+ //
419
+ // But it's better to have a simpler binding without a conditional, for
420
+ // performance, so probably better to return both start options.
421
+ //
422
+ // Then the caller just ignores the end if it's not the first pattern,
423
+ // and the start always gets applied.
424
+ //
425
+ // But that's always going to be $ if it's the ending pattern, or nothing,
426
+ // so the caller can just attach $ at the end of the pattern when building.
427
+ //
428
+ // So the todo is:
429
+ // - better detect what kind of start is needed
430
+ // - return both flavors of starting pattern
431
+ // - attach $ at the end of the pattern when creating the actual RegExp
432
+ //
433
+ // Ah, but wait, no, that all only applies to the root when the first pattern
434
+ // is not an extglob. If the first pattern IS an extglob, then we need all
435
+ // that dot prevention biz to live in the extglob portions, because eg
436
+ // +(*|.x*) can match .xy but not .yx.
437
+ //
438
+ // So, return the two flavors if it's #root and the first child is not an
439
+ // AST, otherwise leave it to the child AST to handle it, and there,
440
+ // use the (?:^|/) style of start binding.
441
+ //
442
+ // Even simplified further:
443
+ // - Since the start for a join is eg /(?!\.) and the start for a part
444
+ // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
445
+ // or start or whatever) and prepend ^ or / at the Regexp construction.
446
+ toRegExpSource(t) {
447
+ var p;
448
+ const e = t ?? !!o(this, z).dot;
449
+ if (o(this, O) === this && (x(this, M, rt).call(this), x(this, M, Dt).call(this)), !xt(this)) {
450
+ const a = this.isStart() && this.isEnd() && !o(this, d).some((w) => typeof w != "string"), h = o(this, d).map((w) => {
451
+ var S;
452
+ const [b, P, T, N] = typeof w == "string" ? x(S = D, Z, Gt).call(S, w, o(this, R), a) : w.toRegExpSource(t);
453
+ return E(this, R, o(this, R) || T), E(this, F, o(this, F) || N), b;
454
+ }).join("");
455
+ let l = "";
456
+ if (this.isStart() && typeof o(this, d)[0] == "string" && !(o(this, d).length === 1 && Ne.has(o(this, d)[0]))) {
457
+ const b = Me, P = (
458
+ // dots are allowed, and the pattern starts with [ or .
459
+ e && b.has(h.charAt(0)) || // the pattern starts with \., and then [ or .
460
+ h.startsWith("\\.") && b.has(h.charAt(2)) || // the pattern starts with \.\., and then [ or .
461
+ h.startsWith("\\.\\.") && b.has(h.charAt(4))
462
+ ), T = !e && !t && b.has(h.charAt(0));
463
+ l = P ? xe : T ? st : "";
464
+ }
465
+ let u = "";
466
+ return this.isEnd() && o(o(this, O), I) && ((p = o(this, A)) == null ? void 0 : p.type) === "!" && (u = "(?:$|\\/)"), [
467
+ l + h + u,
468
+ et(h),
469
+ E(this, R, !!o(this, R)),
470
+ o(this, F)
471
+ ];
472
+ }
473
+ const s = this.type === "*" || this.type === "+", n = this.type === "!" ? "(?:(?!(?:" : "(?:";
474
+ let r = x(this, M, dt).call(this, e);
475
+ if (this.isStart() && this.isEnd() && !r && this.type !== "!") {
476
+ const a = this.toString(), h = this;
477
+ return E(h, d, [a]), h.type = null, E(h, R, void 0), [a, et(this.toString()), !1, !1];
478
+ }
479
+ let c = !s || t || e || !st ? "" : x(this, M, dt).call(this, !0);
480
+ c === r && (c = ""), c && (r = `(?:${r})(?:${c})*?`);
481
+ let f = "";
482
+ if (this.type === "!" && o(this, Q))
483
+ f = (this.isStart() && !e ? st : "") + At;
484
+ else {
485
+ const a = this.type === "!" ? (
486
+ // !() must match something,but !(x) can match ''
487
+ "))" + (this.isStart() && !e && !t ? st : "") + Nt + ")"
488
+ ) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && c ? ")" : this.type === "*" && c ? ")?" : `)${this.type}`;
489
+ f = n + r + a;
490
+ }
491
+ return [
492
+ f,
493
+ et(r),
494
+ E(this, R, !!o(this, R)),
495
+ o(this, F)
496
+ ];
497
+ }
498
+ }
499
+ O = new WeakMap(), R = new WeakMap(), F = new WeakMap(), d = new WeakMap(), A = new WeakMap(), B = new WeakMap(), H = new WeakMap(), I = new WeakMap(), z = new WeakMap(), G = new WeakMap(), Q = new WeakMap(), M = new WeakSet(), Dt = function() {
500
+ if (this !== o(this, O))
501
+ throw new Error("should only call on root");
502
+ if (o(this, I))
503
+ return this;
504
+ this.toString(), E(this, I, !0);
505
+ let t;
506
+ for (; t = o(this, H).pop(); ) {
507
+ if (t.type !== "!")
508
+ continue;
509
+ let e = t, s = o(e, A);
510
+ for (; s; ) {
511
+ for (let n = o(e, B) + 1; !s.type && n < o(s, d).length; n++)
512
+ for (const r of o(t, d)) {
513
+ if (typeof r == "string")
514
+ throw new Error("string part in extglob AST??");
515
+ r.copyIn(o(s, d)[n]);
516
+ }
517
+ e = s, s = o(e, A);
518
+ }
519
+ }
520
+ return this;
521
+ }, Z = new WeakSet(), nt = function(t, e, s, n, r) {
522
+ var b, P, T, N;
523
+ const c = n.maxExtglobRecursion ?? 2;
524
+ let f = !1, p = !1, a = -1, h = !1;
525
+ if (e.type === null) {
526
+ let S = s, m = "";
527
+ for (; S < t.length; ) {
528
+ const y = t.charAt(S++);
529
+ if (f || y === "\\") {
530
+ f = !f, m += y;
531
+ continue;
532
+ }
533
+ if (p) {
534
+ S === a + 1 ? (y === "^" || y === "!") && (h = !0) : y === "]" && !(S === a + 2 && h) && (p = !1), m += y;
535
+ continue;
536
+ } else if (y === "[") {
537
+ p = !0, a = S, h = !1, m += y;
538
+ continue;
539
+ }
540
+ if (!n.noext && ut(y) && t.charAt(S) === "(" && r <= c) {
541
+ e.push(m), m = "";
542
+ const C = new D(y, e);
543
+ S = x(b = D, Z, nt).call(b, t, C, S, n, r + 1), e.push(C);
544
+ continue;
545
+ }
546
+ m += y;
547
+ }
548
+ return e.push(m), S;
549
+ }
550
+ let l = s + 1, u = new D(null, e);
551
+ const g = [];
552
+ let w = "";
553
+ for (; l < t.length; ) {
554
+ const S = t.charAt(l++);
555
+ if (f || S === "\\") {
556
+ f = !f, w += S;
557
+ continue;
558
+ }
559
+ if (p) {
560
+ l === a + 1 ? (S === "^" || S === "!") && (h = !0) : S === "]" && !(l === a + 2 && h) && (p = !1), w += S;
561
+ continue;
562
+ } else if (S === "[") {
563
+ p = !0, a = l, h = !1, w += S;
564
+ continue;
565
+ }
566
+ if (!n.noext && ut(S) && t.charAt(l) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
567
+ (r <= c || e && x(P = e, M, it).call(P, S))) {
568
+ const y = e && x(T = e, M, it).call(T, S) ? 0 : 1;
569
+ u.push(w), w = "";
570
+ const k = new D(S, u);
571
+ u.push(k), l = x(N = D, Z, nt).call(N, t, k, l, n, r + y);
572
+ continue;
573
+ }
574
+ if (S === "|") {
575
+ u.push(w), w = "", g.push(u), u = new D(null, e);
576
+ continue;
577
+ }
578
+ if (S === ")")
579
+ return w === "" && o(e, d).length === 0 && E(e, Q, !0), u.push(w), w = "", e.push(...g, u), l;
580
+ w += S;
581
+ }
582
+ return e.type = null, E(e, R, void 0), E(e, d, [t.substring(s - 1)]), l;
583
+ }, Lt = function(t) {
584
+ return x(this, M, pt).call(this, t, Ee);
585
+ }, pt = function(t, e = Se) {
586
+ if (!t || typeof t != "object" || t.type !== null || o(t, d).length !== 1 || this.type === null)
587
+ return !1;
588
+ const s = o(t, d)[0];
589
+ return !s || typeof s != "object" || s.type === null ? !1 : x(this, M, it).call(this, s.type, e);
590
+ }, it = function(t, e = be) {
591
+ var s;
592
+ return !!((s = e.get(this.type)) != null && s.includes(t));
593
+ }, kt = function(t, e) {
594
+ const s = o(t, d)[0], n = new D(null, s, this.options);
595
+ o(n, d).push(""), s.push(n), x(this, M, gt).call(this, t, e);
596
+ }, gt = function(t, e) {
597
+ const s = o(t, d)[0];
598
+ o(this, d).splice(e, 1, ...o(s, d));
599
+ for (const n of o(s, d))
600
+ typeof n == "object" && E(n, A, this);
601
+ E(this, G, void 0);
602
+ }, _t = function(t) {
603
+ const e = Mt.get(this.type);
604
+ return !!(e != null && e.has(t));
605
+ }, qt = function(t) {
606
+ if (!t || typeof t != "object" || t.type !== null || o(t, d).length !== 1 || this.type === null || o(this, d).length !== 1)
607
+ return !1;
608
+ const e = o(t, d)[0];
609
+ return !e || typeof e != "object" || e.type === null ? !1 : x(this, M, _t).call(this, e.type);
610
+ }, zt = function(t) {
611
+ const e = Mt.get(this.type), s = o(t, d)[0], n = e == null ? void 0 : e.get(s.type);
612
+ if (!n)
613
+ return !1;
614
+ E(this, d, o(s, d));
615
+ for (const r of o(this, d))
616
+ typeof r == "object" && E(r, A, this);
617
+ this.type = n, E(this, G, void 0), E(this, Q, !1);
618
+ }, rt = function() {
619
+ var t, e;
620
+ if (xt(this)) {
621
+ let s = 0, n = !1;
622
+ do {
623
+ n = !0;
624
+ for (let r = 0; r < o(this, d).length; r++) {
625
+ const c = o(this, d)[r];
626
+ typeof c == "object" && (x(e = c, M, rt).call(e), x(this, M, pt).call(this, c) ? (n = !1, x(this, M, gt).call(this, c, r)) : x(this, M, Lt).call(this, c) ? (n = !1, x(this, M, kt).call(this, c, r)) : x(this, M, qt).call(this, c) && (n = !1, x(this, M, zt).call(this, c)));
627
+ }
628
+ } while (!n && ++s < 10);
629
+ } else
630
+ for (const s of o(this, d))
631
+ typeof s == "object" && x(t = s, M, rt).call(t);
632
+ E(this, G, void 0);
633
+ }, dt = function(t) {
634
+ return o(this, d).map((e) => {
635
+ if (typeof e == "string")
636
+ throw new Error("string type in extglob ast??");
637
+ const [s, n, r, c] = e.toRegExpSource(t);
638
+ return E(this, F, o(this, F) || c), s;
639
+ }).filter((e) => !(this.isStart() && this.isEnd()) || !!e).join("|");
640
+ }, Gt = function(t, e, s = !1) {
641
+ let n = !1, r = "", c = !1, f = !1;
642
+ for (let p = 0; p < t.length; p++) {
643
+ const a = t.charAt(p);
644
+ if (n) {
645
+ n = !1, r += (Ae.has(a) ? "\\" : "") + a;
646
+ continue;
647
+ }
648
+ if (a === "*") {
649
+ if (f)
650
+ continue;
651
+ f = !0, r += s && /^[*]+$/.test(t) ? At : Nt, e = !0;
652
+ continue;
653
+ } else
654
+ f = !1;
655
+ if (a === "\\") {
656
+ p === t.length - 1 ? r += "\\\\" : n = !0;
657
+ continue;
658
+ }
659
+ if (a === "[") {
660
+ const [h, l, u, g] = ye(t, p);
661
+ if (u) {
662
+ r += h, c = c || l, p += u - 1, e = e || g;
663
+ continue;
664
+ }
665
+ }
666
+ if (a === "?") {
667
+ r += wt, e = !0;
668
+ continue;
669
+ }
670
+ r += $e(a);
671
+ }
672
+ return [r, et(t), !!e, c];
673
+ }, v(ct, Z);
674
+ D = ct;
675
+ const Te = (i, { windowsPathsNoEscape: t = !1, magicalBraces: e = !1 } = {}) => e ? t ? i.replace(/[?*()[\]{}]/g, "[$&]") : i.replace(/[?*()[\]\\{}]/g, "\\$&") : t ? i.replace(/[?*()[\]]/g, "[$&]") : i.replace(/[?*()[\]\\]/g, "\\$&"), j = (i, t, e = {}) => (ot(t), !e.nocomment && t.charAt(0) === "#" ? !1 : new lt(t, e).match(i)), ve = /^\*+([^+@!?*[(]*)$/, Re = (i) => (t) => !t.startsWith(".") && t.endsWith(i), je = (i) => (t) => t.endsWith(i), Pe = (i) => (i = i.toLowerCase(), (t) => !t.startsWith(".") && t.toLowerCase().endsWith(i)), Ce = (i) => (i = i.toLowerCase(), (t) => t.toLowerCase().endsWith(i)), We = /^\*+\.\*+$/, De = (i) => !i.startsWith(".") && i.includes("."), Le = (i) => i !== "." && i !== ".." && i.includes("."), ke = /^\.\*+$/, _e = (i) => i !== "." && i !== ".." && i.startsWith("."), qe = /^\*+$/, ze = (i) => i.length !== 0 && !i.startsWith("."), Ge = (i) => i.length !== 0 && i !== "." && i !== "..", Fe = /^\?+([^+@!?*[(]*)?$/, Be = ([i, t = ""]) => {
676
+ const e = Ft([i]);
677
+ return t ? (t = t.toLowerCase(), (s) => e(s) && s.toLowerCase().endsWith(t)) : e;
678
+ }, Ie = ([i, t = ""]) => {
679
+ const e = Bt([i]);
680
+ return t ? (t = t.toLowerCase(), (s) => e(s) && s.toLowerCase().endsWith(t)) : e;
681
+ }, Ue = ([i, t = ""]) => {
682
+ const e = Bt([i]);
683
+ return t ? (s) => e(s) && s.endsWith(t) : e;
684
+ }, Ze = ([i, t = ""]) => {
685
+ const e = Ft([i]);
686
+ return t ? (s) => e(s) && s.endsWith(t) : e;
687
+ }, Ft = ([i]) => {
688
+ const t = i.length;
689
+ return (e) => e.length === t && !e.startsWith(".");
690
+ }, Bt = ([i]) => {
691
+ const t = i.length;
692
+ return (e) => e.length === t && e !== "." && e !== "..";
693
+ }, It = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix", $t = {
694
+ win32: { sep: "\\" },
695
+ posix: { sep: "/" }
696
+ }, He = It === "win32" ? $t.win32.sep : $t.posix.sep;
697
+ j.sep = He;
698
+ const W = Symbol("globstar **");
699
+ j.GLOBSTAR = W;
700
+ const Je = "[^/]", Ve = Je + "*?", Xe = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", Qe = "(?:(?!(?:\\/|^)\\.).)*?", Ke = (i, t = {}) => (e) => j(e, i, t);
701
+ j.filter = Ke;
702
+ const q = (i, t = {}) => Object.assign({}, i, t), Ye = (i) => {
703
+ if (!i || typeof i != "object" || !Object.keys(i).length)
704
+ return j;
705
+ const t = j;
706
+ return Object.assign((s, n, r = {}) => t(s, n, q(i, r)), {
707
+ Minimatch: class extends t.Minimatch {
708
+ constructor(n, r = {}) {
709
+ super(n, q(i, r));
710
+ }
711
+ static defaults(n) {
712
+ return t.defaults(q(i, n)).Minimatch;
713
+ }
714
+ },
715
+ AST: class extends t.AST {
716
+ /* c8 ignore start */
717
+ constructor(n, r, c = {}) {
718
+ super(n, r, q(i, c));
719
+ }
720
+ /* c8 ignore stop */
721
+ static fromGlob(n, r = {}) {
722
+ return t.AST.fromGlob(n, q(i, r));
723
+ }
724
+ },
725
+ unescape: (s, n = {}) => t.unescape(s, q(i, n)),
726
+ escape: (s, n = {}) => t.escape(s, q(i, n)),
727
+ filter: (s, n = {}) => t.filter(s, q(i, n)),
728
+ defaults: (s) => t.defaults(q(i, s)),
729
+ makeRe: (s, n = {}) => t.makeRe(s, q(i, n)),
730
+ braceExpand: (s, n = {}) => t.braceExpand(s, q(i, n)),
731
+ match: (s, n, r = {}) => t.match(s, n, q(i, r)),
732
+ sep: t.sep,
733
+ GLOBSTAR: W
734
+ });
735
+ };
736
+ j.defaults = Ye;
737
+ const Ut = (i, t = {}) => (ot(i), t.nobrace || !/\{(?:(?!\{).)*\}/.test(i) ? [i] : ae(i, { max: t.braceExpandMax }));
738
+ j.braceExpand = Ut;
739
+ const ts = (i, t = {}) => new lt(i, t).makeRe();
740
+ j.makeRe = ts;
741
+ const es = (i, t, e = {}) => {
742
+ const s = new lt(t, e);
743
+ return i = i.filter((n) => s.match(n)), s.options.nonull && !i.length && i.push(t), i;
744
+ };
745
+ j.match = es;
746
+ const Ot = /[?*]|[+@!]\(.*?\)|\[|\]/, ss = (i) => i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
747
+ var _, Zt, mt, X;
748
+ class lt {
749
+ constructor(t, e = {}) {
750
+ v(this, _);
751
+ $(this, "options");
752
+ $(this, "set");
753
+ $(this, "pattern");
754
+ $(this, "windowsPathsNoEscape");
755
+ $(this, "nonegate");
756
+ $(this, "negate");
757
+ $(this, "comment");
758
+ $(this, "empty");
759
+ $(this, "preserveMultipleSlashes");
760
+ $(this, "partial");
761
+ $(this, "globSet");
762
+ $(this, "globParts");
763
+ $(this, "nocase");
764
+ $(this, "isWindows");
765
+ $(this, "platform");
766
+ $(this, "windowsNoMagicRoot");
767
+ $(this, "maxGlobstarRecursion");
768
+ $(this, "regexp");
769
+ ot(t), e = e || {}, this.options = e, this.maxGlobstarRecursion = e.maxGlobstarRecursion ?? 200, this.pattern = t, this.platform = e.platform || It, this.isWindows = this.platform === "win32";
770
+ const s = "allowWindowsEscape";
771
+ this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e[s] === !1, this.windowsPathsNoEscape && (this.pattern = this.pattern.replace(/\\/g, "/")), this.preserveMultipleSlashes = !!e.preserveMultipleSlashes, this.regexp = null, this.negate = !1, this.nonegate = !!e.nonegate, this.comment = !1, this.empty = !1, this.partial = !!e.partial, this.nocase = !!this.options.nocase, this.windowsNoMagicRoot = e.windowsNoMagicRoot !== void 0 ? e.windowsNoMagicRoot : !!(this.isWindows && this.nocase), this.globSet = [], this.globParts = [], this.set = [], this.make();
772
+ }
773
+ hasMagic() {
774
+ if (this.options.magicalBraces && this.set.length > 1)
775
+ return !0;
776
+ for (const t of this.set)
777
+ for (const e of t)
778
+ if (typeof e != "string")
779
+ return !0;
780
+ return !1;
781
+ }
782
+ debug(...t) {
783
+ }
784
+ make() {
785
+ const t = this.pattern, e = this.options;
786
+ if (!e.nocomment && t.charAt(0) === "#") {
787
+ this.comment = !0;
788
+ return;
789
+ }
790
+ if (!t) {
791
+ this.empty = !0;
792
+ return;
793
+ }
794
+ this.parseNegate(), this.globSet = [...new Set(this.braceExpand())], e.debug && (this.debug = (...r) => console.error(...r)), this.debug(this.pattern, this.globSet);
795
+ const s = this.globSet.map((r) => this.slashSplit(r));
796
+ this.globParts = this.preprocess(s), this.debug(this.pattern, this.globParts);
797
+ let n = this.globParts.map((r, c, f) => {
798
+ if (this.isWindows && this.windowsNoMagicRoot) {
799
+ const p = r[0] === "" && r[1] === "" && (r[2] === "?" || !Ot.test(r[2])) && !Ot.test(r[3]), a = /^[a-z]:/i.test(r[0]);
800
+ if (p)
801
+ return [
802
+ ...r.slice(0, 4),
803
+ ...r.slice(4).map((h) => this.parse(h))
804
+ ];
805
+ if (a)
806
+ return [r[0], ...r.slice(1).map((h) => this.parse(h))];
807
+ }
808
+ return r.map((p) => this.parse(p));
809
+ });
810
+ if (this.debug(this.pattern, n), this.set = n.filter((r) => r.indexOf(!1) === -1), this.isWindows)
811
+ for (let r = 0; r < this.set.length; r++) {
812
+ const c = this.set[r];
813
+ c[0] === "" && c[1] === "" && this.globParts[r][2] === "?" && typeof c[3] == "string" && /^[a-z]:$/i.test(c[3]) && (c[2] = "?");
814
+ }
815
+ this.debug(this.pattern, this.set);
816
+ }
817
+ // various transforms to equivalent pattern sets that are
818
+ // faster to process in a filesystem walk. The goal is to
819
+ // eliminate what we can, and push all ** patterns as far
820
+ // to the right as possible, even if it increases the number
821
+ // of patterns that we have to process.
822
+ preprocess(t) {
823
+ if (this.options.noglobstar)
824
+ for (const s of t)
825
+ for (let n = 0; n < s.length; n++)
826
+ s[n] === "**" && (s[n] = "*");
827
+ const { optimizationLevel: e = 1 } = this.options;
828
+ return e >= 2 ? (t = this.firstPhasePreProcess(t), t = this.secondPhasePreProcess(t)) : e >= 1 ? t = this.levelOneOptimize(t) : t = this.adjascentGlobstarOptimize(t), t;
829
+ }
830
+ // just get rid of adjascent ** portions
831
+ adjascentGlobstarOptimize(t) {
832
+ return t.map((e) => {
833
+ let s = -1;
834
+ for (; (s = e.indexOf("**", s + 1)) !== -1; ) {
835
+ let n = s;
836
+ for (; e[n + 1] === "**"; )
837
+ n++;
838
+ n !== s && e.splice(s, n - s);
839
+ }
840
+ return e;
841
+ });
842
+ }
843
+ // get rid of adjascent ** and resolve .. portions
844
+ levelOneOptimize(t) {
845
+ return t.map((e) => (e = e.reduce((s, n) => {
846
+ const r = s[s.length - 1];
847
+ return n === "**" && r === "**" ? s : n === ".." && r && r !== ".." && r !== "." && r !== "**" ? (s.pop(), s) : (s.push(n), s);
848
+ }, []), e.length === 0 ? [""] : e));
849
+ }
850
+ levelTwoFileOptimize(t) {
851
+ Array.isArray(t) || (t = this.slashSplit(t));
852
+ let e = !1;
853
+ do {
854
+ if (e = !1, !this.preserveMultipleSlashes) {
855
+ for (let n = 1; n < t.length - 1; n++) {
856
+ const r = t[n];
857
+ n === 1 && r === "" && t[0] === "" || (r === "." || r === "") && (e = !0, t.splice(n, 1), n--);
858
+ }
859
+ t[0] === "." && t.length === 2 && (t[1] === "." || t[1] === "") && (e = !0, t.pop());
860
+ }
861
+ let s = 0;
862
+ for (; (s = t.indexOf("..", s + 1)) !== -1; ) {
863
+ const n = t[s - 1];
864
+ n && n !== "." && n !== ".." && n !== "**" && !(this.isWindows && /^[a-z]:$/i.test(n)) && (e = !0, t.splice(s - 1, 2), s -= 2);
865
+ }
866
+ } while (e);
867
+ return t.length === 0 ? [""] : t;
868
+ }
869
+ // First phase: single-pattern processing
870
+ // <pre> is 1 or more portions
871
+ // <rest> is 1 or more portions
872
+ // <p> is any portion other than ., .., '', or **
873
+ // <e> is . or ''
874
+ //
875
+ // **/.. is *brutal* for filesystem walking performance, because
876
+ // it effectively resets the recursive walk each time it occurs,
877
+ // and ** cannot be reduced out by a .. pattern part like a regexp
878
+ // or most strings (other than .., ., and '') can be.
879
+ //
880
+ // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
881
+ // <pre>/<e>/<rest> -> <pre>/<rest>
882
+ // <pre>/<p>/../<rest> -> <pre>/<rest>
883
+ // **/**/<rest> -> **/<rest>
884
+ //
885
+ // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
886
+ // this WOULD be allowed if ** did follow symlinks, or * didn't
887
+ firstPhasePreProcess(t) {
888
+ let e = !1;
889
+ do {
890
+ e = !1;
891
+ for (let s of t) {
892
+ let n = -1;
893
+ for (; (n = s.indexOf("**", n + 1)) !== -1; ) {
894
+ let c = n;
895
+ for (; s[c + 1] === "**"; )
896
+ c++;
897
+ c > n && s.splice(n + 1, c - n);
898
+ let f = s[n + 1];
899
+ const p = s[n + 2], a = s[n + 3];
900
+ if (f !== ".." || !p || p === "." || p === ".." || !a || a === "." || a === "..")
901
+ continue;
902
+ e = !0, s.splice(n, 1);
903
+ const h = s.slice(0);
904
+ h[n] = "**", t.push(h), n--;
905
+ }
906
+ if (!this.preserveMultipleSlashes) {
907
+ for (let c = 1; c < s.length - 1; c++) {
908
+ const f = s[c];
909
+ c === 1 && f === "" && s[0] === "" || (f === "." || f === "") && (e = !0, s.splice(c, 1), c--);
910
+ }
911
+ s[0] === "." && s.length === 2 && (s[1] === "." || s[1] === "") && (e = !0, s.pop());
912
+ }
913
+ let r = 0;
914
+ for (; (r = s.indexOf("..", r + 1)) !== -1; ) {
915
+ const c = s[r - 1];
916
+ if (c && c !== "." && c !== ".." && c !== "**") {
917
+ e = !0;
918
+ const p = r === 1 && s[r + 1] === "**" ? ["."] : [];
919
+ s.splice(r - 1, 2, ...p), s.length === 0 && s.push(""), r -= 2;
920
+ }
921
+ }
922
+ }
923
+ } while (e);
924
+ return t;
925
+ }
926
+ // second phase: multi-pattern dedupes
927
+ // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
928
+ // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
929
+ // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
930
+ //
931
+ // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
932
+ // ^-- not valid because ** doens't follow symlinks
933
+ secondPhasePreProcess(t) {
934
+ for (let e = 0; e < t.length - 1; e++)
935
+ for (let s = e + 1; s < t.length; s++) {
936
+ const n = this.partsMatch(t[e], t[s], !this.preserveMultipleSlashes);
937
+ if (n) {
938
+ t[e] = [], t[s] = n;
939
+ break;
940
+ }
941
+ }
942
+ return t.filter((e) => e.length);
943
+ }
944
+ partsMatch(t, e, s = !1) {
945
+ let n = 0, r = 0, c = [], f = "";
946
+ for (; n < t.length && r < e.length; )
947
+ if (t[n] === e[r])
948
+ c.push(f === "b" ? e[r] : t[n]), n++, r++;
949
+ else if (s && t[n] === "**" && e[r] === t[n + 1])
950
+ c.push(t[n]), n++;
951
+ else if (s && e[r] === "**" && t[n] === e[r + 1])
952
+ c.push(e[r]), r++;
953
+ else if (t[n] === "*" && e[r] && (this.options.dot || !e[r].startsWith(".")) && e[r] !== "**") {
954
+ if (f === "b")
955
+ return !1;
956
+ f = "a", c.push(t[n]), n++, r++;
957
+ } else if (e[r] === "*" && t[n] && (this.options.dot || !t[n].startsWith(".")) && t[n] !== "**") {
958
+ if (f === "a")
959
+ return !1;
960
+ f = "b", c.push(e[r]), n++, r++;
961
+ } else
962
+ return !1;
963
+ return t.length === e.length && c;
964
+ }
965
+ parseNegate() {
966
+ if (this.nonegate)
967
+ return;
968
+ const t = this.pattern;
969
+ let e = !1, s = 0;
970
+ for (let n = 0; n < t.length && t.charAt(n) === "!"; n++)
971
+ e = !e, s++;
972
+ s && (this.pattern = t.slice(s)), this.negate = e;
973
+ }
974
+ // set partial to true to test if, for example,
975
+ // "/a/b" matches the start of "/*/b/*/d"
976
+ // Partial means, if you run out of file before you run
977
+ // out of pattern, then that's fine, as long as all
978
+ // the parts match.
979
+ matchOne(t, e, s = !1) {
980
+ let n = 0, r = 0;
981
+ if (this.isWindows) {
982
+ const f = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), p = !f && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]), a = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]), h = !a && e[0] === "" && e[1] === "" && e[2] === "?" && typeof e[3] == "string" && /^[a-z]:$/i.test(e[3]), l = p ? 3 : f ? 0 : void 0, u = h ? 3 : a ? 0 : void 0;
983
+ if (typeof l == "number" && typeof u == "number") {
984
+ const [g, w] = [
985
+ t[l],
986
+ e[u]
987
+ ];
988
+ g.toLowerCase() === w.toLowerCase() && (e[u] = g, r = u, n = l);
989
+ }
990
+ }
991
+ const { optimizationLevel: c = 1 } = this.options;
992
+ return c >= 2 && (t = this.levelTwoFileOptimize(t)), e.includes(W) ? x(this, _, Zt).call(this, t, e, s, n, r) : x(this, _, X).call(this, t, e, s, n, r);
993
+ }
994
+ braceExpand() {
995
+ return Ut(this.pattern, this.options);
996
+ }
997
+ parse(t) {
998
+ ot(t);
999
+ const e = this.options;
1000
+ if (t === "**")
1001
+ return W;
1002
+ if (t === "")
1003
+ return "";
1004
+ let s, n = null;
1005
+ (s = t.match(qe)) ? n = e.dot ? Ge : ze : (s = t.match(ve)) ? n = (e.nocase ? e.dot ? Ce : Pe : e.dot ? je : Re)(s[1]) : (s = t.match(Fe)) ? n = (e.nocase ? e.dot ? Ie : Be : e.dot ? Ue : Ze)(s) : (s = t.match(We)) ? n = e.dot ? Le : De : (s = t.match(ke)) && (n = _e);
1006
+ const r = ct.fromGlob(t, this.options).toMMPattern();
1007
+ return n && typeof r == "object" && Reflect.defineProperty(r, "test", { value: n }), r;
1008
+ }
1009
+ makeRe() {
1010
+ if (this.regexp || this.regexp === !1)
1011
+ return this.regexp;
1012
+ const t = this.set;
1013
+ if (!t.length)
1014
+ return this.regexp = !1, this.regexp;
1015
+ const e = this.options, s = e.noglobstar ? Ve : e.dot ? Xe : Qe, n = new Set(e.nocase ? ["i"] : []);
1016
+ let r = t.map((p) => {
1017
+ const a = p.map((l) => {
1018
+ if (l instanceof RegExp)
1019
+ for (const u of l.flags.split(""))
1020
+ n.add(u);
1021
+ return typeof l == "string" ? ss(l) : l === W ? W : l._src;
1022
+ });
1023
+ a.forEach((l, u) => {
1024
+ const g = a[u + 1], w = a[u - 1];
1025
+ l !== W || w === W || (w === void 0 ? g !== void 0 && g !== W ? a[u + 1] = "(?:\\/|" + s + "\\/)?" + g : a[u] = s : g === void 0 ? a[u - 1] = w + "(?:\\/|\\/" + s + ")?" : g !== W && (a[u - 1] = w + "(?:\\/|\\/" + s + "\\/)" + g, a[u + 1] = W));
1026
+ });
1027
+ const h = a.filter((l) => l !== W);
1028
+ if (this.partial && h.length >= 1) {
1029
+ const l = [];
1030
+ for (let u = 1; u <= h.length; u++)
1031
+ l.push(h.slice(0, u).join("/"));
1032
+ return "(?:" + l.join("|") + ")";
1033
+ }
1034
+ return h.join("/");
1035
+ }).join("|");
1036
+ const [c, f] = t.length > 1 ? ["(?:", ")"] : ["", ""];
1037
+ r = "^" + c + r + f + "$", this.partial && (r = "^(?:\\/|" + c + r.slice(1, -1) + f + ")$"), this.negate && (r = "^(?!" + r + ").+$");
1038
+ try {
1039
+ this.regexp = new RegExp(r, [...n].join(""));
1040
+ } catch {
1041
+ this.regexp = !1;
1042
+ }
1043
+ return this.regexp;
1044
+ }
1045
+ slashSplit(t) {
1046
+ return this.preserveMultipleSlashes ? t.split("/") : this.isWindows && /^\/\/[^/]+/.test(t) ? ["", ...t.split(/\/+/)] : t.split(/\/+/);
1047
+ }
1048
+ match(t, e = this.partial) {
1049
+ if (this.debug("match", t, this.pattern), this.comment)
1050
+ return !1;
1051
+ if (this.empty)
1052
+ return t === "";
1053
+ if (t === "/" && e)
1054
+ return !0;
1055
+ const s = this.options;
1056
+ this.isWindows && (t = t.split("\\").join("/"));
1057
+ const n = this.slashSplit(t);
1058
+ this.debug(this.pattern, "split", n);
1059
+ const r = this.set;
1060
+ this.debug(this.pattern, "set", r);
1061
+ let c = n[n.length - 1];
1062
+ if (!c)
1063
+ for (let f = n.length - 2; !c && f >= 0; f--)
1064
+ c = n[f];
1065
+ for (const f of r) {
1066
+ let p = n;
1067
+ if (s.matchBase && f.length === 1 && (p = [c]), this.matchOne(p, f, e))
1068
+ return s.flipNegate ? !0 : !this.negate;
1069
+ }
1070
+ return s.flipNegate ? !1 : this.negate;
1071
+ }
1072
+ static defaults(t) {
1073
+ return j.defaults(t).Minimatch;
1074
+ }
1075
+ }
1076
+ _ = new WeakSet(), Zt = function(t, e, s, n, r) {
1077
+ const c = e.indexOf(W, r), f = e.lastIndexOf(W), [p, a, h] = s ? [
1078
+ e.slice(r, c),
1079
+ e.slice(c + 1),
1080
+ []
1081
+ ] : [
1082
+ e.slice(r, c),
1083
+ e.slice(c + 1, f),
1084
+ e.slice(f + 1)
1085
+ ];
1086
+ if (p.length) {
1087
+ const N = t.slice(n, n + p.length);
1088
+ if (!x(this, _, X).call(this, N, p, s, 0, 0))
1089
+ return !1;
1090
+ n += p.length, r += p.length;
1091
+ }
1092
+ let l = 0;
1093
+ if (h.length) {
1094
+ if (h.length + n > t.length)
1095
+ return !1;
1096
+ let N = t.length - h.length;
1097
+ if (x(this, _, X).call(this, t, h, s, N, 0))
1098
+ l = h.length;
1099
+ else {
1100
+ if (t[t.length - 1] !== "" || n + h.length === t.length || (N--, !x(this, _, X).call(this, t, h, s, N, 0)))
1101
+ return !1;
1102
+ l = h.length + 1;
1103
+ }
1104
+ }
1105
+ if (!a.length) {
1106
+ let N = !!l;
1107
+ for (let S = n; S < t.length - l; S++) {
1108
+ const m = String(t[S]);
1109
+ if (N = !0, m === "." || m === ".." || !this.options.dot && m.startsWith("."))
1110
+ return !1;
1111
+ }
1112
+ return s || N;
1113
+ }
1114
+ const u = [[[], 0]];
1115
+ let g = u[0], w = 0;
1116
+ const b = [0];
1117
+ for (const N of a)
1118
+ N === W ? (b.push(w), g = [[], 0], u.push(g)) : (g[0].push(N), w++);
1119
+ let P = u.length - 1;
1120
+ const T = t.length - l;
1121
+ for (const N of u)
1122
+ N[1] = T - (b[P--] + N[0].length);
1123
+ return !!x(this, _, mt).call(this, t, u, n, 0, s, 0, !!l);
1124
+ }, // return false for "nope, not matching"
1125
+ // return null for "not matching, cannot keep trying"
1126
+ mt = function(t, e, s, n, r, c, f) {
1127
+ const p = e[n];
1128
+ if (!p) {
1129
+ for (let l = s; l < t.length; l++) {
1130
+ f = !0;
1131
+ const u = t[l];
1132
+ if (u === "." || u === ".." || !this.options.dot && u.startsWith("."))
1133
+ return !1;
1134
+ }
1135
+ return f;
1136
+ }
1137
+ const [a, h] = p;
1138
+ for (; s <= h; ) {
1139
+ if (x(this, _, X).call(this, t.slice(0, s + a.length), a, r, s, 0) && c < this.maxGlobstarRecursion) {
1140
+ const g = x(this, _, mt).call(this, t, e, s + a.length, n + 1, r, c + 1, f);
1141
+ if (g !== !1)
1142
+ return g;
1143
+ }
1144
+ const u = t[s];
1145
+ if (u === "." || u === ".." || !this.options.dot && u.startsWith("."))
1146
+ return !1;
1147
+ s++;
1148
+ }
1149
+ return r || null;
1150
+ }, X = function(t, e, s, n, r) {
1151
+ let c, f, p, a;
1152
+ for (c = n, f = r, a = t.length, p = e.length; c < a && f < p; c++, f++) {
1153
+ this.debug("matchOne loop");
1154
+ let h = e[f], l = t[c];
1155
+ if (this.debug(e, h, l), h === !1 || h === W)
1156
+ return !1;
1157
+ let u;
1158
+ if (typeof h == "string" ? (u = l === h, this.debug("string match", h, l, u)) : (u = h.test(l), this.debug("pattern match", h, l, u)), !u)
1159
+ return !1;
1160
+ }
1161
+ if (c === a && f === p)
1162
+ return !0;
1163
+ if (c === a)
1164
+ return s;
1165
+ if (f === p)
1166
+ return c === a - 1 && t[c] === "";
1167
+ throw new Error("wtf?");
1168
+ };
1169
+ j.AST = ct;
1170
+ j.Minimatch = lt;
1171
+ j.escape = Te;
1172
+ j.unescape = et;
1173
+ class ns {
1174
+ constructor(t) {
1175
+ $(this, "value");
1176
+ $(this, "next");
1177
+ this.value = t;
1178
+ }
1179
+ }
1180
+ var L, U, J;
1181
+ class is {
1182
+ constructor() {
1183
+ v(this, L);
1184
+ v(this, U);
1185
+ v(this, J);
1186
+ this.clear();
1187
+ }
1188
+ enqueue(t) {
1189
+ const e = new ns(t);
1190
+ o(this, L) ? (o(this, U).next = e, E(this, U, e)) : (E(this, L, e), E(this, U, e)), ht(this, J)._++;
1191
+ }
1192
+ dequeue() {
1193
+ const t = o(this, L);
1194
+ if (t)
1195
+ return E(this, L, o(this, L).next), ht(this, J)._--, o(this, L) || E(this, U, void 0), t.value;
1196
+ }
1197
+ peek() {
1198
+ if (o(this, L))
1199
+ return o(this, L).value;
1200
+ }
1201
+ clear() {
1202
+ E(this, L, void 0), E(this, U, void 0), E(this, J, 0);
1203
+ }
1204
+ get size() {
1205
+ return o(this, J);
1206
+ }
1207
+ *[Symbol.iterator]() {
1208
+ let t = o(this, L);
1209
+ for (; t; )
1210
+ yield t.value, t = t.next;
1211
+ }
1212
+ *drain() {
1213
+ for (; o(this, L); )
1214
+ yield this.dequeue();
1215
+ }
1216
+ }
1217
+ L = new WeakMap(), U = new WeakMap(), J = new WeakMap();
1218
+ function rs(i) {
1219
+ let t = !1;
1220
+ if (typeof i == "object" && ({ concurrency: i, rejectOnClear: t = !1 } = i), Tt(i), typeof t != "boolean")
1221
+ throw new TypeError("Expected `rejectOnClear` to be a boolean");
1222
+ const e = new is();
1223
+ let s = 0;
1224
+ const n = () => {
1225
+ s < i && e.size > 0 && (s++, e.dequeue().run());
1226
+ }, r = () => {
1227
+ s--, n();
1228
+ }, c = async (a, h, l) => {
1229
+ const u = (async () => a(...l))();
1230
+ h(u);
1231
+ try {
1232
+ await u;
1233
+ } catch {
1234
+ }
1235
+ r();
1236
+ }, f = (a, h, l, u) => {
1237
+ const g = { reject: l };
1238
+ new Promise((w) => {
1239
+ g.run = w, e.enqueue(g);
1240
+ }).then(c.bind(void 0, a, h, u)), s < i && n();
1241
+ }, p = (a, ...h) => new Promise((l, u) => {
1242
+ f(a, l, u, h);
1243
+ });
1244
+ return Object.defineProperties(p, {
1245
+ activeCount: {
1246
+ get: () => s
1247
+ },
1248
+ pendingCount: {
1249
+ get: () => e.size
1250
+ },
1251
+ clearQueue: {
1252
+ value() {
1253
+ if (!t) {
1254
+ e.clear();
1255
+ return;
1256
+ }
1257
+ const a = AbortSignal.abort().reason;
1258
+ for (; e.size > 0; )
1259
+ e.dequeue().reject(a);
1260
+ }
1261
+ },
1262
+ concurrency: {
1263
+ get: () => i,
1264
+ set(a) {
1265
+ Tt(a), i = a, queueMicrotask(() => {
1266
+ for (; s < i && e.size > 0; )
1267
+ n();
1268
+ });
1269
+ }
1270
+ },
1271
+ map: {
1272
+ async value(a, h) {
1273
+ const l = Array.from(a, (u, g) => this(h, u, g));
1274
+ return Promise.all(l);
1275
+ }
1276
+ }
1277
+ }), p;
1278
+ }
1279
+ function Tt(i) {
1280
+ if (!((Number.isInteger(i) || i === Number.POSITIVE_INFINITY) && i > 0))
1281
+ throw new TypeError("Expected `concurrency` to be a number from 1 and up");
1282
+ }
1283
+ function os(i) {
1284
+ if (i.length < 2) return "never";
1285
+ const t = [...i].sort((n, r) => n - r);
1286
+ let e = 0;
1287
+ for (let n = 1; n < t.length; n++)
1288
+ e += t[n] - t[n - 1];
1289
+ const s = e / (t.length - 1) / 864e5;
1290
+ return s <= 1 ? "daily" : s <= 7 ? "weekly" : s <= 30 ? "monthly" : s <= 365 ? "yearly" : "never";
1291
+ }
1292
+ function hs(i) {
1293
+ const t = i.pageEntryPattern;
1294
+ let e = i.rootDir ?? "", s = i.outputFile ?? "";
1295
+ const n = i.concurrency ?? 20, r = i.commitCount ?? 10, c = i.ignoreDeps ? Array.isArray(i.ignoreDeps) ? i.ignoreDeps : [i.ignoreDeps] : [], f = {};
1296
+ let p;
1297
+ return {
1298
+ name: "vite-last-modified",
1299
+ async configResolved(a) {
1300
+ const { resolve: h } = await import("./__vite-browser-external-BDMct_Gn.js");
1301
+ p = a.build.ssr, e || (e = a.root), s || (s = h(e, "last-modified.json"));
1302
+ },
1303
+ async buildEnd() {
1304
+ if (p || process.env.NODE_ENV !== "production")
1305
+ return;
1306
+ const { exec: a } = await import("./__vite-browser-external-BDMct_Gn.js"), h = await import("./__vite-browser-external-BDMct_Gn.js"), { promisify: l } = await import("./__vite-browser-external-BDMct_Gn.js"), u = l(a), g = /* @__PURE__ */ new Map(), w = rs(n), b = (m) => {
1307
+ if (g.has(m))
1308
+ return g.get(m);
1309
+ const y = w(async () => {
1310
+ try {
1311
+ const k = m.includes("?") ? m.slice(0, m.indexOf("?")) : m, C = h.relative(e, k).replace(/\\/g, "/"), { stdout: V } = await u(`git log --follow -n ${r} --format=%at -- "${C}"`, { cwd: e });
1312
+ return V.trim() ? V.trim().split(`
1313
+ `).map((K) => parseInt(K, 10) * 1e3) : [];
1314
+ } catch {
1315
+ return [];
1316
+ }
1317
+ });
1318
+ return g.set(m, y), y;
1319
+ }, P = (m, y) => {
1320
+ if (y.has(m)) return;
1321
+ y.add(m);
1322
+ const k = this.getModuleInfo(m);
1323
+ if (k)
1324
+ for (const C of k.importedIds) {
1325
+ if (C.includes("node_modules") || !C.startsWith(e))
1326
+ continue;
1327
+ const V = C.slice(e.length).replace(/^\/?/, "").split("?")[0];
1328
+ c.some((K) => j(V, K, { dot: !0 })) || P(C, y);
1329
+ }
1330
+ }, T = [...this.getModuleIds()].filter((m) => {
1331
+ if (!m.startsWith(e))
1332
+ return !1;
1333
+ const y = m.slice(e.length).replace(/^\//, "");
1334
+ return typeof t == "string" ? j(y, t, { dot: !0 }) : t.test(y);
1335
+ });
1336
+ if (T.length === 0) {
1337
+ console.warn("[lastModifiedPlugin] No MD files found in module graph");
1338
+ return;
1339
+ }
1340
+ console.log("[lastModifiedPlugin] start collect entry files deps");
1341
+ let N = /* @__PURE__ */ new Map();
1342
+ for (const m of T) {
1343
+ const y = /* @__PURE__ */ new Set();
1344
+ P(m, y), N.set(m, y);
1345
+ }
1346
+ if (console.log(`[lastModifiedPlugin] Analyzed ${T.length} entry files`), typeof i.modifyDepMap == "function") {
1347
+ const m = await i.modifyDepMap(N);
1348
+ m && m instanceof Map && (N = m);
1349
+ }
1350
+ const S = /* @__PURE__ */ new Set();
1351
+ for (const m of N.values())
1352
+ for (const y of m)
1353
+ S.add(y);
1354
+ await Promise.all([...S].map(b));
1355
+ for (const [m, y] of N) {
1356
+ const k = m.slice(e.length).replace(/^\//, ""), C = (await Promise.all([...y].map(b))).flat(), V = C.length > 0 ? Math.max(...C) : 0, K = os(C);
1357
+ f[k] = { lastmod: V, changefreq: K };
1358
+ }
1359
+ },
1360
+ async closeBundle() {
1361
+ const { writeFileSync: a } = await import("./__vite-browser-external-BDMct_Gn.js");
1362
+ if (p || process.env.NODE_ENV !== "production")
1363
+ return;
1364
+ const h = Object.fromEntries(Object.entries(f).sort(([l], [u]) => l.localeCompare(u)));
1365
+ a(s, JSON.stringify(h, null, 2), "utf8"), console.log(`[lastModifiedPlugin] Written ${s}`);
1366
+ }
1367
+ };
1368
+ }
1369
+ export {
1370
+ hs as g,
1371
+ j as m
1372
+ };