tinker-token-usage 0.1.4 → 0.1.5

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.
@@ -1,167 +1,167 @@
1
- var pe = Object.defineProperty;
2
- var he = (t, s, e) => s in t ? pe(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e;
3
- var B = (t, s, e) => he(t, typeof s != "symbol" ? s + "" : s, e);
4
- import * as ge from "fs";
5
- import { statSync as ye, stat as de, realpathSync as Ae, realpath as Re, readdirSync as _e, readdir as Se } from "fs";
6
- import { sep as Ft, basename as Ee, dirname as St, resolve as Mt, normalize as be, relative as me, posix as tt, isAbsolute as xe } from "path";
7
- import { fileURLToPath as Ce } from "url";
8
- import { createRequire as $e } from "module";
9
- var wt = /* @__PURE__ */ $e(import.meta.url);
10
- function ve(t) {
11
- let s = be(t);
12
- return s.length > 1 && s[s.length - 1] === Ft && (s = s.substring(0, s.length - 1)), s;
1
+ var he = Object.defineProperty;
2
+ var ge = (t, s, e) => s in t ? he(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e;
3
+ var N = (t, s, e) => ge(t, typeof s != "symbol" ? s + "" : s, e);
4
+ import * as de from "fs";
5
+ import { statSync as ye, stat as Ae, realpathSync as Re, realpath as _e, readdirSync as Ee, readdir as Se } from "fs";
6
+ import { sep as Gt, basename as be, dirname as bt, resolve as Wt, normalize as me, relative as xe, posix as tt, isAbsolute as Ce } from "path";
7
+ import { fileURLToPath as $e } from "url";
8
+ import { createRequire as ve } from "module";
9
+ var Ht = /* @__PURE__ */ ve(import.meta.url);
10
+ function we(t) {
11
+ let s = me(t);
12
+ return s.length > 1 && s[s.length - 1] === Gt && (s = s.substring(0, s.length - 1)), s;
13
13
  }
14
- const we = /[\\/]/g;
15
- function Gt(t, s) {
16
- return t.replace(we, s);
14
+ const Oe = /[\\/]/g;
15
+ function Ut(t, s) {
16
+ return t.replace(Oe, s);
17
17
  }
18
- const Oe = /^[a-z]:[\\/]$/i;
19
- function He(t) {
20
- return t === "/" || Oe.test(t);
18
+ const He = /^[a-z]:[\\/]$/i;
19
+ function Le(t) {
20
+ return t === "/" || He.test(t);
21
21
  }
22
- function ht(t, s) {
22
+ function yt(t, s) {
23
23
  const { resolvePaths: e, normalizePath: r, pathSeparator: o } = s, n = process.platform === "win32" && t.includes("/") || t.startsWith(".");
24
- if (e && (t = Mt(t)), (r || n) && (t = ve(t)), t === ".") return "";
24
+ if (e && (t = Wt(t)), (r || n) && (t = we(t)), t === ".") return "";
25
25
  const i = t[t.length - 1] !== o;
26
- return Gt(i ? t + o : t, o);
26
+ return Ut(i ? t + o : t, o);
27
27
  }
28
- function Wt(t, s) {
28
+ function qt(t, s) {
29
29
  return s + t;
30
30
  }
31
- function Le(t, s) {
31
+ function Te(t, s) {
32
32
  return function(e, r) {
33
- return r.startsWith(t) ? r.slice(t.length) + e : Gt(me(t, r), s.pathSeparator) + s.pathSeparator + e;
33
+ return r.startsWith(t) ? r.slice(t.length) + e : Ut(xe(t, r), s.pathSeparator) + s.pathSeparator + e;
34
34
  };
35
35
  }
36
- function Te(t) {
36
+ function ke(t) {
37
37
  return t;
38
38
  }
39
- function ke(t, s, e) {
39
+ function Pe(t, s, e) {
40
40
  return s + t + e;
41
41
  }
42
- function Pe(t, s) {
42
+ function De(t, s) {
43
43
  const { relativePaths: e, includeBasePath: r } = s;
44
- return e && t ? Le(t, s) : r ? Wt : Te;
44
+ return e && t ? Te(t, s) : r ? qt : ke;
45
45
  }
46
- function De(t) {
46
+ function Ie(t) {
47
47
  return function(s, e) {
48
48
  e.push(s.substring(t.length) || ".");
49
49
  };
50
50
  }
51
- function Ie(t) {
51
+ function Ne(t) {
52
52
  return function(s, e, r) {
53
53
  const o = s.substring(t.length) || ".";
54
54
  r.every((n) => n(o, !0)) && e.push(o);
55
55
  };
56
56
  }
57
- const Ne = (t, s) => {
57
+ const Be = (t, s) => {
58
58
  s.push(t || ".");
59
- }, Be = (t, s, e) => {
59
+ }, Fe = (t, s, e) => {
60
60
  const r = t || ".";
61
61
  e.every((o) => o(r, !0)) && s.push(r);
62
- }, Fe = () => {
62
+ }, Me = () => {
63
63
  };
64
- function Me(t, s) {
64
+ function Ge(t, s) {
65
65
  const { includeDirs: e, filters: r, relativePaths: o } = s;
66
- return e ? o ? r && r.length ? Ie(t) : De(t) : r && r.length ? Be : Ne : Fe;
66
+ return e ? o ? r && r.length ? Ne(t) : Ie(t) : r && r.length ? Fe : Be : Me;
67
67
  }
68
- const Ge = (t, s, e, r) => {
68
+ const We = (t, s, e, r) => {
69
69
  r.every((o) => o(t, !1)) && e.files++;
70
- }, We = (t, s, e, r) => {
71
- r.every((o) => o(t, !1)) && s.push(t);
72
70
  }, Ue = (t, s, e, r) => {
71
+ r.every((o) => o(t, !1)) && s.push(t);
72
+ }, qe = (t, s, e, r) => {
73
73
  e.files++;
74
- }, qe = (t, s) => {
74
+ }, Ke = (t, s) => {
75
75
  s.push(t);
76
- }, Ke = () => {
76
+ }, Xe = () => {
77
77
  };
78
- function Xe(t) {
78
+ function je(t) {
79
79
  const { excludeFiles: s, filters: e, onlyCounts: r } = t;
80
- return s ? Ke : e && e.length ? r ? Ge : We : r ? Ue : qe;
80
+ return s ? Xe : e && e.length ? r ? We : Ue : r ? qe : Ke;
81
81
  }
82
- const je = (t) => t, Qe = () => [""].slice(0, 0);
83
- function ze(t) {
84
- return t.group ? Qe : je;
82
+ const Qe = (t) => t, ze = () => [""].slice(0, 0);
83
+ function Ye(t) {
84
+ return t.group ? ze : Qe;
85
85
  }
86
- const Ye = (t, s, e) => {
86
+ const Ze = (t, s, e) => {
87
87
  t.push({
88
88
  directory: s,
89
89
  files: e,
90
90
  dir: s
91
91
  });
92
- }, Ze = () => {
92
+ }, Ve = () => {
93
93
  };
94
- function Ve(t) {
95
- return t.group ? Ye : Ze;
94
+ function Je(t) {
95
+ return t.group ? Ze : Ve;
96
96
  }
97
- const Je = function(t, s, e) {
97
+ const ts = function(t, s, e) {
98
98
  const { queue: r, fs: o, options: { suppressErrors: n } } = s;
99
99
  r.enqueue(), o.realpath(t, (i, l) => {
100
100
  if (i) return r.dequeue(n ? null : i, s);
101
101
  o.stat(l, (h, g) => {
102
102
  if (h) return r.dequeue(n ? null : h, s);
103
- if (g.isDirectory() && Ut(t, l, s)) return r.dequeue(null, s);
103
+ if (g.isDirectory() && Kt(t, l, s)) return r.dequeue(null, s);
104
104
  e(g, l), r.dequeue(null, s);
105
105
  });
106
106
  });
107
- }, ts = function(t, s, e) {
107
+ }, es = function(t, s, e) {
108
108
  const { queue: r, fs: o, options: { suppressErrors: n } } = s;
109
109
  r.enqueue();
110
110
  try {
111
111
  const i = o.realpathSync(t), l = o.statSync(i);
112
- if (l.isDirectory() && Ut(t, i, s)) return;
112
+ if (l.isDirectory() && Kt(t, i, s)) return;
113
113
  e(l, i);
114
114
  } catch (i) {
115
115
  if (!n) throw i;
116
116
  }
117
117
  };
118
- function es(t, s) {
119
- return !t.resolveSymlinks || t.excludeSymlinks ? null : s ? ts : Je;
118
+ function ss(t, s) {
119
+ return !t.resolveSymlinks || t.excludeSymlinks ? null : s ? es : ts;
120
120
  }
121
- function Ut(t, s, e) {
122
- if (e.options.useRealPaths) return ss(s, e);
123
- let r = St(t), o = 1;
121
+ function Kt(t, s, e) {
122
+ if (e.options.useRealPaths) return ns(s, e);
123
+ let r = bt(t), o = 1;
124
124
  for (; r !== e.root && o < 2; ) {
125
125
  const n = e.symlinks.get(r);
126
- !!n && (n === s || n.startsWith(s) || s.startsWith(n)) ? o++ : r = St(r);
126
+ !!n && (n === s || n.startsWith(s) || s.startsWith(n)) ? o++ : r = bt(r);
127
127
  }
128
128
  return e.symlinks.set(t, s), o > 1;
129
129
  }
130
- function ss(t, s) {
130
+ function ns(t, s) {
131
131
  return s.visited.includes(t + s.options.pathSeparator);
132
132
  }
133
- const ns = (t) => t.counts, rs = (t) => t.groups, os = (t) => t.paths, is = (t) => t.paths.slice(0, t.options.maxFiles), us = (t, s, e) => (lt(s, e, t.counts, t.options.suppressErrors), null), as = (t, s, e) => (lt(s, e, t.paths, t.options.suppressErrors), null), cs = (t, s, e) => (lt(s, e, t.paths.slice(0, t.options.maxFiles), t.options.suppressErrors), null), ls = (t, s, e) => (lt(s, e, t.groups, t.options.suppressErrors), null);
134
- function lt(t, s, e, r) {
133
+ const rs = (t) => t.counts, os = (t) => t.groups, is = (t) => t.paths, us = (t) => t.paths.slice(0, t.options.maxFiles), as = (t, s, e) => (ht(s, e, t.counts, t.options.suppressErrors), null), cs = (t, s, e) => (ht(s, e, t.paths, t.options.suppressErrors), null), ls = (t, s, e) => (ht(s, e, t.paths.slice(0, t.options.maxFiles), t.options.suppressErrors), null), fs = (t, s, e) => (ht(s, e, t.groups, t.options.suppressErrors), null);
134
+ function ht(t, s, e, r) {
135
135
  s(t && !r ? t : null, e);
136
136
  }
137
- function fs(t, s) {
137
+ function ps(t, s) {
138
138
  const { onlyCounts: e, group: r, maxFiles: o } = t;
139
- return e ? s ? ns : us : r ? s ? rs : ls : o ? s ? is : cs : s ? os : as;
139
+ return e ? s ? rs : as : r ? s ? os : fs : o ? s ? us : ls : s ? is : cs;
140
140
  }
141
- const qt = { withFileTypes: !0 }, ps = (t, s, e, r, o) => {
141
+ const Xt = { withFileTypes: !0 }, hs = (t, s, e, r, o) => {
142
142
  if (t.queue.enqueue(), r < 0) return t.queue.dequeue(null, t);
143
143
  const { fs: n } = t;
144
- t.visited.push(s), t.counts.directories++, n.readdir(s || ".", qt, (i, l = []) => {
144
+ t.visited.push(s), t.counts.directories++, n.readdir(s || ".", Xt, (i, l = []) => {
145
145
  o(l, e, r), t.queue.dequeue(t.options.suppressErrors ? null : i, t);
146
146
  });
147
- }, hs = (t, s, e, r, o) => {
147
+ }, gs = (t, s, e, r, o) => {
148
148
  const { fs: n } = t;
149
149
  if (r < 0) return;
150
150
  t.visited.push(s), t.counts.directories++;
151
151
  let i = [];
152
152
  try {
153
- i = n.readdirSync(s || ".", qt);
153
+ i = n.readdirSync(s || ".", Xt);
154
154
  } catch (l) {
155
155
  if (!t.options.suppressErrors) throw l;
156
156
  }
157
157
  o(i, e, r);
158
158
  };
159
- function gs(t) {
160
- return t ? hs : ps;
159
+ function ds(t) {
160
+ return t ? gs : hs;
161
161
  }
162
162
  var ys = class {
163
163
  constructor(t) {
164
- B(this, "count", 0);
164
+ N(this, "count", 0);
165
165
  this.onQueueEmpty = t;
166
166
  }
167
167
  enqueue() {
@@ -170,10 +170,10 @@ var ys = class {
170
170
  dequeue(t, s) {
171
171
  this.onQueueEmpty && (--this.count <= 0 || t) && (this.onQueueEmpty(t, s), t && (s.controller.abort(), this.onQueueEmpty = void 0));
172
172
  }
173
- }, ds = class {
173
+ }, As = class {
174
174
  constructor() {
175
- B(this, "_files", 0);
176
- B(this, "_directories", 0);
175
+ N(this, "_files", 0);
176
+ N(this, "_directories", 0);
177
177
  }
178
178
  set files(t) {
179
179
  this._files = t;
@@ -194,29 +194,29 @@ var ys = class {
194
194
  get dirs() {
195
195
  return this._directories;
196
196
  }
197
- }, As = class {
197
+ }, Rs = class {
198
198
  constructor() {
199
- B(this, "aborted", !1);
199
+ N(this, "aborted", !1);
200
200
  }
201
201
  abort() {
202
202
  this.aborted = !0;
203
203
  }
204
- }, Kt = class {
204
+ }, jt = class {
205
205
  constructor(t, s, e) {
206
- B(this, "root");
207
- B(this, "isSynchronous");
208
- B(this, "state");
209
- B(this, "joinPath");
210
- B(this, "pushDirectory");
211
- B(this, "pushFile");
212
- B(this, "getArray");
213
- B(this, "groupFiles");
214
- B(this, "resolveSymlink");
215
- B(this, "walkDirectory");
216
- B(this, "callbackInvoker");
217
- B(this, "walk", (t, s, e) => {
218
- const { paths: r, options: { filters: o, resolveSymlinks: n, excludeSymlinks: i, exclude: l, maxFiles: h, signal: g, useRealPaths: d, pathSeparator: A }, controller: S } = this.state;
219
- if (S.aborted || g && g.aborted || h && r.length > h) return;
206
+ N(this, "root");
207
+ N(this, "isSynchronous");
208
+ N(this, "state");
209
+ N(this, "joinPath");
210
+ N(this, "pushDirectory");
211
+ N(this, "pushFile");
212
+ N(this, "getArray");
213
+ N(this, "groupFiles");
214
+ N(this, "resolveSymlink");
215
+ N(this, "walkDirectory");
216
+ N(this, "callbackInvoker");
217
+ N(this, "walk", (t, s, e) => {
218
+ const { paths: r, options: { filters: o, resolveSymlinks: n, excludeSymlinks: i, exclude: l, maxFiles: h, signal: g, useRealPaths: d, pathSeparator: A }, controller: E } = this.state;
219
+ if (E.aborted || g && g.aborted || h && r.length > h) return;
220
220
  const x = this.getArray(this.state.paths);
221
221
  for (let y = 0; y < t.length; ++y) {
222
222
  const C = t[y];
@@ -224,85 +224,85 @@ var ys = class {
224
224
  const T = this.joinPath(C.name, s);
225
225
  this.pushFile(T, x, this.state.counts, o);
226
226
  } else if (C.isDirectory()) {
227
- let T = ke(C.name, s, this.state.options.pathSeparator);
227
+ let T = Pe(C.name, s, this.state.options.pathSeparator);
228
228
  if (l && l(C.name, T)) continue;
229
229
  this.pushDirectory(T, r, o), this.walkDirectory(this.state, T, T, e - 1, this.walk);
230
230
  } else if (this.resolveSymlink && C.isSymbolicLink()) {
231
- let T = Wt(C.name, s);
232
- this.resolveSymlink(T, this.state, (G, _) => {
233
- if (G.isDirectory()) {
234
- if (_ = ht(_, this.state.options), l && l(C.name, d ? _ : T + A)) return;
231
+ let T = qt(C.name, s);
232
+ this.resolveSymlink(T, this.state, (W, _) => {
233
+ if (W.isDirectory()) {
234
+ if (_ = yt(_, this.state.options), l && l(C.name, d ? _ : T + A)) return;
235
235
  this.walkDirectory(this.state, _, d ? _ : T + A, e - 1, this.walk);
236
236
  } else {
237
237
  _ = d ? _ : T;
238
- const M = Ee(_), X = ht(St(_), this.state.options);
239
- _ = this.joinPath(M, X), this.pushFile(_, x, this.state.counts, o);
238
+ const M = be(_), j = yt(bt(_), this.state.options);
239
+ _ = this.joinPath(M, j), this.pushFile(_, x, this.state.counts, o);
240
240
  }
241
241
  });
242
242
  }
243
243
  }
244
244
  this.groupFiles(this.state.groups, s, x);
245
245
  });
246
- this.isSynchronous = !e, this.callbackInvoker = fs(s, this.isSynchronous), this.root = ht(t, s), this.state = {
247
- root: He(this.root) ? this.root : this.root.slice(0, -1),
246
+ this.isSynchronous = !e, this.callbackInvoker = ps(s, this.isSynchronous), this.root = yt(t, s), this.state = {
247
+ root: Le(this.root) ? this.root : this.root.slice(0, -1),
248
248
  paths: [""].slice(0, 0),
249
249
  groups: [],
250
- counts: new ds(),
250
+ counts: new As(),
251
251
  options: s,
252
252
  queue: new ys((r, o) => this.callbackInvoker(o, r, e)),
253
253
  symlinks: /* @__PURE__ */ new Map(),
254
254
  visited: [""].slice(0, 0),
255
- controller: new As(),
256
- fs: s.fs || ge
257
- }, this.joinPath = Pe(this.root, s), this.pushDirectory = Me(this.root, s), this.pushFile = Xe(s), this.getArray = ze(s), this.groupFiles = Ve(s), this.resolveSymlink = es(s, this.isSynchronous), this.walkDirectory = gs(this.isSynchronous);
255
+ controller: new Rs(),
256
+ fs: s.fs || de
257
+ }, this.joinPath = De(this.root, s), this.pushDirectory = Ge(this.root, s), this.pushFile = je(s), this.getArray = Ye(s), this.groupFiles = Je(s), this.resolveSymlink = ss(s, this.isSynchronous), this.walkDirectory = ds(this.isSynchronous);
258
258
  }
259
259
  start() {
260
260
  return this.pushDirectory(this.root, this.state.paths, this.state.options.filters), this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk), this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
261
261
  }
262
262
  };
263
- function Rs(t, s) {
263
+ function _s(t, s) {
264
264
  return new Promise((e, r) => {
265
- Xt(t, s, (o, n) => {
265
+ Qt(t, s, (o, n) => {
266
266
  if (o) return r(o);
267
267
  e(n);
268
268
  });
269
269
  });
270
270
  }
271
- function Xt(t, s, e) {
272
- new Kt(t, s, e).start();
271
+ function Qt(t, s, e) {
272
+ new jt(t, s, e).start();
273
273
  }
274
- function _s(t, s) {
275
- return new Kt(t, s).start();
274
+ function Es(t, s) {
275
+ return new jt(t, s).start();
276
276
  }
277
- var Ot = class {
277
+ var Lt = class {
278
278
  constructor(t, s) {
279
279
  this.root = t, this.options = s;
280
280
  }
281
281
  withPromise() {
282
- return Rs(this.root, this.options);
282
+ return _s(this.root, this.options);
283
283
  }
284
284
  withCallback(t) {
285
- Xt(this.root, this.options, t);
285
+ Qt(this.root, this.options, t);
286
286
  }
287
287
  sync() {
288
- return _s(this.root, this.options);
288
+ return Es(this.root, this.options);
289
289
  }
290
290
  };
291
- let jt = null;
291
+ let zt = null;
292
292
  try {
293
- wt.resolve("picomatch"), jt = wt("picomatch");
293
+ Ht.resolve("picomatch"), zt = Ht("picomatch");
294
294
  } catch {
295
295
  }
296
296
  var Ss = class {
297
297
  constructor(t) {
298
- B(this, "globCache", {});
299
- B(this, "options", {
298
+ N(this, "globCache", {});
299
+ N(this, "options", {
300
300
  maxDepth: 1 / 0,
301
301
  suppressErrors: !0,
302
- pathSeparator: Ft,
302
+ pathSeparator: Gt,
303
303
  filters: []
304
304
  });
305
- B(this, "globFunction");
305
+ N(this, "globFunction");
306
306
  this.options = {
307
307
  ...this.options,
308
308
  ...t
@@ -357,7 +357,7 @@ var Ss = class {
357
357
  return this.options.onlyCounts = !0, this;
358
358
  }
359
359
  crawl(t) {
360
- return new Ot(t || ".", this.options);
360
+ return new Lt(t || ".", this.options);
361
361
  }
362
362
  withGlobFunction(t) {
363
363
  return this.globFunction = t, this;
@@ -374,54 +374,54 @@ var Ss = class {
374
374
  return this.options = {
375
375
  ...this.options,
376
376
  ...s
377
- }, new Ot(t || ".", this.options);
377
+ }, new Lt(t || ".", this.options);
378
378
  }
379
379
  glob(...t) {
380
380
  return this.globFunction ? this.globWithOptions(t) : this.globWithOptions(t, { dot: !0 });
381
381
  }
382
382
  globWithOptions(t, ...s) {
383
- const e = this.globFunction || jt;
383
+ const e = this.globFunction || zt;
384
384
  if (!e) throw new Error("Please specify a glob function to use glob matching.");
385
385
  var r = this.globCache[t.join("\0")];
386
386
  return r || (r = e(t, ...s), this.globCache[t.join("\0")] = r), this.options.filters.push((o) => r(o)), this;
387
387
  }
388
388
  };
389
- function Es(t) {
389
+ function bs(t) {
390
390
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
391
391
  }
392
- var it = {};
393
- const z = "\\\\/", Ht = `[^${z}]`, bs = 0, Z = "\\.", ms = "\\+", xs = "\\?", ft = "\\/", Cs = "(?=.)", Qt = "[^/]", mt = `(?:${ft}|$)`, zt = `(?:^|${ft})`, xt = `${Z}{1,2}${mt}`, $s = `(?!${Z})`, vs = `(?!${zt}${xt})`, ws = `(?!${Z}{0,1}${mt})`, Os = `(?!${xt})`, Hs = `[^.${ft}]`, Ls = `${Qt}*?`, Ts = "/", Yt = {
394
- DOT_LITERAL: Z,
395
- PLUS_LITERAL: ms,
396
- QMARK_LITERAL: xs,
397
- SLASH_LITERAL: ft,
398
- ONE_CHAR: Cs,
399
- QMARK: Qt,
400
- END_ANCHOR: mt,
401
- DOTS_SLASH: xt,
402
- NO_DOT: $s,
403
- NO_DOTS: vs,
404
- NO_DOT_SLASH: ws,
405
- NO_DOTS_SLASH: Os,
406
- QMARK_NO_DOT: Hs,
407
- STAR: Ls,
408
- START_ANCHOR: zt,
409
- SEP: Ts
410
- }, ks = {
411
- ...Yt,
392
+ var ct = {};
393
+ const z = "\\\\/", Tt = `[^${z}]`, ms = 0, Y = "\\.", xs = "\\+", Cs = "\\?", gt = "\\/", $s = "(?=.)", Yt = "[^/]", Ct = `(?:${gt}|$)`, Zt = `(?:^|${gt})`, $t = `${Y}{1,2}${Ct}`, vs = `(?!${Y})`, ws = `(?!${Zt}${$t})`, Os = `(?!${Y}{0,1}${Ct})`, Hs = `(?!${$t})`, Ls = `[^.${gt}]`, Ts = `${Yt}*?`, ks = "/", Vt = {
394
+ DOT_LITERAL: Y,
395
+ PLUS_LITERAL: xs,
396
+ QMARK_LITERAL: Cs,
397
+ SLASH_LITERAL: gt,
398
+ ONE_CHAR: $s,
399
+ QMARK: Yt,
400
+ END_ANCHOR: Ct,
401
+ DOTS_SLASH: $t,
402
+ NO_DOT: vs,
403
+ NO_DOTS: ws,
404
+ NO_DOT_SLASH: Os,
405
+ NO_DOTS_SLASH: Hs,
406
+ QMARK_NO_DOT: Ls,
407
+ STAR: Ts,
408
+ START_ANCHOR: Zt,
409
+ SEP: ks
410
+ }, Ps = {
411
+ ...Vt,
412
412
  SLASH_LITERAL: `[${z}]`,
413
- QMARK: Ht,
414
- STAR: `${Ht}*?`,
415
- DOTS_SLASH: `${Z}{1,2}(?:[${z}]|$)`,
416
- NO_DOT: `(?!${Z})`,
417
- NO_DOTS: `(?!(?:^|[${z}])${Z}{1,2}(?:[${z}]|$))`,
418
- NO_DOT_SLASH: `(?!${Z}{0,1}(?:[${z}]|$))`,
419
- NO_DOTS_SLASH: `(?!${Z}{1,2}(?:[${z}]|$))`,
413
+ QMARK: Tt,
414
+ STAR: `${Tt}*?`,
415
+ DOTS_SLASH: `${Y}{1,2}(?:[${z}]|$)`,
416
+ NO_DOT: `(?!${Y})`,
417
+ NO_DOTS: `(?!(?:^|[${z}])${Y}{1,2}(?:[${z}]|$))`,
418
+ NO_DOT_SLASH: `(?!${Y}{0,1}(?:[${z}]|$))`,
419
+ NO_DOTS_SLASH: `(?!${Y}{1,2}(?:[${z}]|$))`,
420
420
  QMARK_NO_DOT: `[^.${z}]`,
421
421
  START_ANCHOR: `(?:^|[${z}])`,
422
422
  END_ANCHOR: `(?:[${z}]|$)`,
423
423
  SEP: "\\"
424
- }, Ps = {
424
+ }, Ds = {
425
425
  __proto__: null,
426
426
  alnum: "a-zA-Z0-9",
427
427
  alpha: "a-zA-Z",
@@ -438,10 +438,10 @@ const z = "\\\\/", Ht = `[^${z}]`, bs = 0, Z = "\\.", ms = "\\+", xs = "\\?", ft
438
438
  word: "A-Za-z0-9_",
439
439
  xdigit: "A-Fa-f0-9"
440
440
  };
441
- var pt = {
442
- DEFAULT_MAX_EXTGLOB_RECURSION: bs,
441
+ var dt = {
442
+ DEFAULT_MAX_EXTGLOB_RECURSION: ms,
443
443
  MAX_LENGTH: 1024 * 64,
444
- POSIX_REGEX_SOURCE: Ps,
444
+ POSIX_REGEX_SOURCE: Ds,
445
445
  // regular expressions
446
446
  REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
447
447
  REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
@@ -561,7 +561,7 @@ var pt = {
561
561
  * Create GLOB_CHARS
562
562
  */
563
563
  globChars(t) {
564
- return t === !0 ? ks : Yt;
564
+ return t === !0 ? Ps : Vt;
565
565
  }
566
566
  };
567
567
  (function(t) {
@@ -570,7 +570,7 @@ var pt = {
570
570
  REGEX_REMOVE_BACKSLASH: e,
571
571
  REGEX_SPECIAL_CHARS: r,
572
572
  REGEX_SPECIAL_CHARS_GLOBAL: o
573
- } = pt;
573
+ } = dt;
574
574
  t.isObject = (n) => n !== null && typeof n == "object" && !Array.isArray(n), t.hasRegexChars = (n) => r.test(n), t.isRegexChar = (n) => n.length === 1 && t.hasRegexChars(n), t.escapeRegex = (n) => n.replace(o, "\\$1"), t.toPosixSlashes = (n) => n.replace(s, "/"), t.isWindows = () => {
575
575
  if (typeof navigator < "u" && navigator.platform) {
576
576
  const n = navigator.platform.toLowerCase();
@@ -591,73 +591,73 @@ var pt = {
591
591
  const l = n.split(i ? /[\\/]/ : "/"), h = l[l.length - 1];
592
592
  return h === "" ? l[l.length - 2] : h;
593
593
  };
594
- })(it);
595
- const Lt = it, {
596
- CHAR_ASTERISK: gt,
594
+ })(ct);
595
+ const kt = ct, {
596
+ CHAR_ASTERISK: At,
597
597
  /* * */
598
- CHAR_AT: Ds,
598
+ CHAR_AT: Is,
599
599
  /* @ */
600
- CHAR_BACKWARD_SLASH: st,
600
+ CHAR_BACKWARD_SLASH: rt,
601
601
  /* \ */
602
- CHAR_COMMA: Is,
602
+ CHAR_COMMA: Ns,
603
603
  /* , */
604
- CHAR_DOT: yt,
604
+ CHAR_DOT: Rt,
605
605
  /* . */
606
- CHAR_EXCLAMATION_MARK: dt,
606
+ CHAR_EXCLAMATION_MARK: _t,
607
607
  /* ! */
608
- CHAR_FORWARD_SLASH: Zt,
608
+ CHAR_FORWARD_SLASH: Jt,
609
609
  /* / */
610
- CHAR_LEFT_CURLY_BRACE: At,
610
+ CHAR_LEFT_CURLY_BRACE: Et,
611
611
  /* { */
612
- CHAR_LEFT_PARENTHESES: Rt,
612
+ CHAR_LEFT_PARENTHESES: ft,
613
613
  /* ( */
614
- CHAR_LEFT_SQUARE_BRACKET: Ns,
614
+ CHAR_LEFT_SQUARE_BRACKET: Bs,
615
615
  /* [ */
616
- CHAR_PLUS: Bs,
616
+ CHAR_PLUS: Fs,
617
617
  /* + */
618
- CHAR_QUESTION_MARK: Tt,
618
+ CHAR_QUESTION_MARK: Pt,
619
619
  /* ? */
620
- CHAR_RIGHT_CURLY_BRACE: Fs,
620
+ CHAR_RIGHT_CURLY_BRACE: Ms,
621
621
  /* } */
622
- CHAR_RIGHT_PARENTHESES: kt,
622
+ CHAR_RIGHT_PARENTHESES: Dt,
623
623
  /* ) */
624
- CHAR_RIGHT_SQUARE_BRACKET: Ms
624
+ CHAR_RIGHT_SQUARE_BRACKET: Gs
625
625
  /* ] */
626
- } = pt, Pt = (t) => t === Zt || t === st, Dt = (t) => {
626
+ } = dt, It = (t) => t === Jt || t === rt, Nt = (t) => {
627
627
  t.isPrefix !== !0 && (t.depth = t.isGlobstar ? 1 / 0 : 1);
628
- }, Gs = (t, s) => {
629
- const e = s || {}, r = t.length - 1, o = e.parts === !0 || e.scanToEnd === !0, n = [], i = [], l = [];
630
- let h = t, g = -1, d = 0, A = 0, S = !1, x = !1, y = !1, C = !1, T = !1, G = !1, _ = !1, M = !1, X = !1, P = !1, O = 0, v, R, m = { value: "", depth: 0, isGlob: !1 };
631
- const c = () => g >= r, W = () => h.charCodeAt(g + 1), N = () => (v = R, h.charCodeAt(++g));
628
+ }, Ws = (t, s) => {
629
+ const e = s || {}, r = t.length - 1, o = e.parts === !0 || e.tokens === !0 || e.scanToEnd === !0, n = [], i = [], l = [];
630
+ let h = t, g = -1, d = 0, A = 0, E = !1, x = !1, y = !1, C = !1, T = !1, W = !1, _ = !1, M = !1, j = !1, k = !1, O = 0, v, R, m = { value: "", depth: 0, isGlob: !1 };
631
+ const u = () => g >= r, G = () => h.charCodeAt(g + 1), I = () => (v = R, h.charCodeAt(++g));
632
632
  for (; g < r; ) {
633
- R = N();
633
+ R = I();
634
634
  let $;
635
- if (R === st) {
636
- _ = m.backslashes = !0, R = N(), R === At && (G = !0);
635
+ if (R === rt) {
636
+ _ = m.backslashes = !0, R = I(), R === Et && (W = !0);
637
637
  continue;
638
638
  }
639
- if (G === !0 || R === At) {
640
- for (O++; c() !== !0 && (R = N()); ) {
641
- if (R === st) {
642
- _ = m.backslashes = !0, N();
639
+ if (W === !0 || R === Et) {
640
+ for (O++; u() !== !0 && (R = I()); ) {
641
+ if (R === rt) {
642
+ _ = m.backslashes = !0, I();
643
643
  continue;
644
644
  }
645
- if (R === At) {
645
+ if (R === Et) {
646
646
  O++;
647
647
  continue;
648
648
  }
649
- if (G !== !0 && R === yt && (R = N()) === yt) {
650
- if (S = m.isBrace = !0, y = m.isGlob = !0, P = !0, o === !0)
649
+ if (W !== !0 && R === Rt && (R = I()) === Rt) {
650
+ if (E = m.isBrace = !0, y = m.isGlob = !0, k = !0, o === !0)
651
651
  continue;
652
652
  break;
653
653
  }
654
- if (G !== !0 && R === Is) {
655
- if (S = m.isBrace = !0, y = m.isGlob = !0, P = !0, o === !0)
654
+ if (W !== !0 && R === Ns) {
655
+ if (E = m.isBrace = !0, y = m.isGlob = !0, k = !0, o === !0)
656
656
  continue;
657
657
  break;
658
658
  }
659
- if (R === Fs && (O--, O === 0)) {
660
- G = !1, S = m.isBrace = !0, P = !0;
659
+ if (R === Ms && (O--, O === 0)) {
660
+ W = !1, E = m.isBrace = !0, k = !0;
661
661
  break;
662
662
  }
663
663
  }
@@ -665,24 +665,29 @@ const Lt = it, {
665
665
  continue;
666
666
  break;
667
667
  }
668
- if (R === Zt) {
669
- if (n.push(g), i.push(m), m = { value: "", depth: 0, isGlob: !1 }, P === !0) continue;
670
- if (v === yt && g === d + 1) {
668
+ if (R === Jt) {
669
+ if (n.push(g), i.push(m), m = { value: "", depth: 0, isGlob: !1 }, k === !0) continue;
670
+ if (v === Rt && g === d + 1) {
671
671
  d += 2;
672
672
  continue;
673
673
  }
674
674
  A = g + 1;
675
675
  continue;
676
676
  }
677
- if (e.noext !== !0 && (R === Bs || R === Ds || R === gt || R === Tt || R === dt) === !0 && W() === Rt) {
678
- if (y = m.isGlob = !0, C = m.isExtglob = !0, P = !0, R === dt && g === d && (X = !0), o === !0) {
679
- for (; c() !== !0 && (R = N()); ) {
680
- if (R === st) {
681
- _ = m.backslashes = !0, R = N();
677
+ if (e.noext !== !0 && (R === Fs || R === Is || R === At || R === Pt || R === _t) === !0 && G() === ft) {
678
+ if (y = m.isGlob = !0, C = m.isExtglob = !0, k = !0, R === _t && g === d && (j = !0), o === !0) {
679
+ let q = 0;
680
+ for (; u() !== !0 && (R = I()); ) {
681
+ if (R === rt) {
682
+ _ = m.backslashes = !0, I();
683
+ continue;
684
+ }
685
+ if (R === ft) {
686
+ q++;
682
687
  continue;
683
688
  }
684
- if (R === kt) {
685
- y = m.isGlob = !0, P = !0;
689
+ if (R === Dt && --q === 0) {
690
+ k = !0;
686
691
  break;
687
692
  }
688
693
  }
@@ -690,24 +695,24 @@ const Lt = it, {
690
695
  }
691
696
  break;
692
697
  }
693
- if (R === gt) {
694
- if (v === gt && (T = m.isGlobstar = !0), y = m.isGlob = !0, P = !0, o === !0)
698
+ if (R === At) {
699
+ if (v === At && (T = m.isGlobstar = !0), y = m.isGlob = !0, k = !0, o === !0)
695
700
  continue;
696
701
  break;
697
702
  }
698
- if (R === Tt) {
699
- if (y = m.isGlob = !0, P = !0, o === !0)
703
+ if (R === Pt) {
704
+ if (y = m.isGlob = !0, k = !0, o === !0)
700
705
  continue;
701
706
  break;
702
707
  }
703
- if (R === Ns) {
704
- for (; c() !== !0 && ($ = N()); ) {
705
- if ($ === st) {
706
- _ = m.backslashes = !0, N();
708
+ if (R === Bs) {
709
+ for (; u() !== !0 && ($ = I()); ) {
710
+ if ($ === rt) {
711
+ _ = m.backslashes = !0, I();
707
712
  continue;
708
713
  }
709
- if ($ === Ms) {
710
- x = m.isBracket = !0, y = m.isGlob = !0, P = !0;
714
+ if ($ === Gs) {
715
+ x = m.isBracket = !0, y = m.isGlob = !0, k = !0;
711
716
  break;
712
717
  }
713
718
  }
@@ -715,19 +720,24 @@ const Lt = it, {
715
720
  continue;
716
721
  break;
717
722
  }
718
- if (e.nonegate !== !0 && R === dt && g === d) {
723
+ if (e.nonegate !== !0 && R === _t && g === d) {
719
724
  M = m.negated = !0, d++;
720
725
  continue;
721
726
  }
722
- if (e.noparen !== !0 && R === Rt) {
727
+ if (e.noparen !== !0 && R === ft) {
723
728
  if (y = m.isGlob = !0, o === !0) {
724
- for (; c() !== !0 && (R = N()); ) {
725
- if (R === Rt) {
726
- _ = m.backslashes = !0, R = N();
729
+ let U = 1;
730
+ for (; u() !== !0 && (R = I()); ) {
731
+ if (R === rt) {
732
+ _ = m.backslashes = !0, I();
727
733
  continue;
728
734
  }
729
- if (R === kt) {
730
- P = !0;
735
+ if (R === ft) {
736
+ U++;
737
+ continue;
738
+ }
739
+ if (R === Dt && --U === 0) {
740
+ k = !0;
731
741
  break;
732
742
  }
733
743
  }
@@ -736,50 +746,47 @@ const Lt = it, {
736
746
  break;
737
747
  }
738
748
  if (y === !0) {
739
- if (P = !0, o === !0)
749
+ if (k = !0, o === !0)
740
750
  continue;
741
751
  break;
742
752
  }
743
753
  }
744
754
  e.noext === !0 && (C = !1, y = !1);
745
- let D = h, a = "", u = "";
746
- d > 0 && (a = h.slice(0, d), h = h.slice(d), A -= d), D && y === !0 && A > 0 ? (D = h.slice(0, A), u = h.slice(A)) : y === !0 ? (D = "", u = h) : D = h, D && D !== "" && D !== "/" && D !== h && Pt(D.charCodeAt(D.length - 1)) && (D = D.slice(0, -1)), e.unescape === !0 && (u && (u = Lt.removeBackslashes(u)), D && _ === !0 && (D = Lt.removeBackslashes(D)));
747
- const q = {
748
- prefix: a,
755
+ let P = h, c = "", a = "";
756
+ d > 0 && (c = h.slice(0, d), h = h.slice(d), A -= d), P && y === !0 && A > 0 ? (P = h.slice(0, A), a = h.slice(A)) : y === !0 ? (P = "", a = h) : P = h, P && P !== "" && P !== "/" && P !== h && It(P.charCodeAt(P.length - 1)) && (P = P.slice(0, -1)), e.unescape === !0 && (a && (a = kt.removeBackslashes(a)), P && _ === !0 && (P = kt.removeBackslashes(P)));
757
+ const X = {
758
+ prefix: c,
749
759
  input: t,
750
760
  start: d,
751
- base: D,
752
- glob: u,
753
- isBrace: S,
761
+ base: P,
762
+ glob: a,
763
+ isBrace: E,
754
764
  isBracket: x,
755
765
  isGlob: y,
756
766
  isExtglob: C,
757
767
  isGlobstar: T,
758
768
  negated: M,
759
- negatedExtglob: X
769
+ negatedExtglob: j
760
770
  };
761
- if (e.tokens === !0 && (q.maxDepth = 0, Pt(R) || i.push(m), q.tokens = i), e.parts === !0 || e.tokens === !0) {
771
+ if (e.tokens === !0 && (X.maxDepth = 0, It(R) || i.push(m), X.tokens = i), e.parts === !0 || e.tokens === !0) {
762
772
  let $;
763
- for (let k = 0; k < n.length; k++) {
764
- const Y = $ ? $ + 1 : d, K = n[k], V = t.slice(Y, K);
765
- e.tokens && (k === 0 && d !== 0 ? (i[k].isPrefix = !0, i[k].value = a) : i[k].value = V, Dt(i[k]), q.maxDepth += i[k].depth), (k !== 0 || V !== "") && l.push(V), $ = K;
766
- }
767
- if ($ && $ + 1 < t.length) {
768
- const k = t.slice($ + 1);
769
- l.push(k), e.tokens && (i[i.length - 1].value = k, Dt(i[i.length - 1]), q.maxDepth += i[i.length - 1].depth);
773
+ for (let B = 0; B < n.length; B++) {
774
+ const et = $ !== void 0 ? $ + 1 : d, ot = n[B], V = t.slice(et, ot);
775
+ e.tokens && (B === 0 && d !== 0 ? (i[B].isPrefix = !0, i[B].value = c) : i[B].value = V, Nt(i[B]), X.maxDepth += i[B].depth), ot >= d && (l.push(V), $ = ot);
770
776
  }
771
- q.slashes = n, q.parts = l;
777
+ const U = $ !== void 0 ? $ + 1 : d, q = t.slice(U);
778
+ l.push(q), e.tokens && $ && $ + 1 < t.length && (i[i.length - 1].value = q, Nt(i[i.length - 1]), X.maxDepth += i[i.length - 1].depth), X.slashes = n, X.parts = l;
772
779
  }
773
- return q;
780
+ return X;
774
781
  };
775
- var Ws = Gs;
776
- const rt = pt, U = it, {
777
- MAX_LENGTH: ct,
778
- POSIX_REGEX_SOURCE: Us,
779
- REGEX_NON_SPECIAL_CHARS: qs,
780
- REGEX_SPECIAL_CHARS_BACKREF: Ks,
781
- REPLACEMENTS: Vt
782
- } = rt, Xs = (t, s) => {
782
+ var Us = Ws;
783
+ const ut = dt, K = ct, {
784
+ MAX_LENGTH: pt,
785
+ POSIX_REGEX_SOURCE: qs,
786
+ REGEX_NON_SPECIAL_CHARS: Ks,
787
+ REGEX_SPECIAL_CHARS_BACKREF: Xs,
788
+ REPLACEMENTS: te
789
+ } = ut, js = (t, s) => {
783
790
  if (typeof s.expandRange == "function")
784
791
  return s.expandRange(...t, s);
785
792
  t.sort();
@@ -787,10 +794,10 @@ const rt = pt, U = it, {
787
794
  try {
788
795
  new RegExp(e);
789
796
  } catch {
790
- return t.map((o) => U.escapeRegex(o)).join("..");
797
+ return t.map((o) => K.escapeRegex(o)).join("..");
791
798
  }
792
799
  return e;
793
- }, et = (t, s) => `Missing ${t}: "${s}" - use "\\\\${s}" to match literal characters`, Jt = (t) => {
800
+ }, nt = (t, s) => `Missing ${t}: "${s}" - use "\\\\${s}" to match literal characters`, ee = (t) => {
794
801
  const s = [];
795
802
  let e = 0, r = 0, o = 0, n = "", i = !1;
796
803
  for (const l of t) {
@@ -825,7 +832,7 @@ const rt = pt, U = it, {
825
832
  n += l;
826
833
  }
827
834
  return s.push(n), s;
828
- }, js = (t) => {
835
+ }, Qs = (t) => {
829
836
  let s = !1;
830
837
  for (const e of t) {
831
838
  if (s === !0) {
@@ -840,14 +847,14 @@ const rt = pt, U = it, {
840
847
  return !1;
841
848
  }
842
849
  return !0;
843
- }, Ct = (t) => {
850
+ }, vt = (t) => {
844
851
  let s = t.trim(), e = !0;
845
852
  for (; e === !0; )
846
853
  e = !1, /^@\([^\\()[\]{}|]+\)$/.test(s) && (s = s.slice(2, -1), e = !0);
847
- if (js(s))
854
+ if (Qs(s))
848
855
  return s.replace(/\\(.)/g, "$1");
849
- }, Qs = (t) => {
850
- const s = t.map(Ct).filter(Boolean);
856
+ }, zs = (t) => {
857
+ const s = t.map(vt).filter(Boolean);
851
858
  for (let e = 0; e < s.length; e++)
852
859
  for (let r = e + 1; r < s.length; r++) {
853
860
  const o = s[e], n = s[r], i = o[0];
@@ -855,7 +862,7 @@ const rt = pt, U = it, {
855
862
  return !0;
856
863
  }
857
864
  return !1;
858
- }, Et = (t, s = !0) => {
865
+ }, mt = (t, s = !0) => {
859
866
  if (t[0] !== "+" && t[0] !== "*" || t[1] !== "(")
860
867
  return;
861
868
  let e = 0, r = 0, o = 0, n = !1;
@@ -896,76 +903,76 @@ const rt = pt, U = it, {
896
903
  }
897
904
  }
898
905
  }
899
- }, zs = (t) => `${t.length === 1 ? U.escapeRegex(t[0]) : `[${t.map((e) => U.escapeRegex(e)).join("")}]`}*`, Ys = (t) => {
906
+ }, Ys = (t) => `${t.length === 1 ? K.escapeRegex(t[0]) : `[${t.map((e) => K.escapeRegex(e)).join("")}]`}*`, Zs = (t) => {
900
907
  let s = 0;
901
908
  const e = [];
902
909
  for (; s < t.length; ) {
903
- const r = Et(t.slice(s), !1);
910
+ const r = mt(t.slice(s), !1);
904
911
  if (!r || r.type !== "*")
905
912
  return;
906
- const o = Jt(r.body).map((i) => i.trim());
913
+ const o = ee(r.body).map((i) => i.trim());
907
914
  if (o.length !== 1)
908
915
  return;
909
- const n = Ct(o[0]);
916
+ const n = vt(o[0]);
910
917
  if (!n || n.length !== 1)
911
918
  return;
912
919
  e.push(n), s += r.end + 1;
913
920
  }
914
921
  if (!(e.length < 1))
915
922
  return e;
916
- }, Zs = (t) => {
917
- let s = 0, e = t.trim(), r = Et(e);
923
+ }, Vs = (t) => {
924
+ let s = 0, e = t.trim(), r = mt(e);
918
925
  for (; r; )
919
- s++, e = r.body.trim(), r = Et(e);
926
+ s++, e = r.body.trim(), r = mt(e);
920
927
  return s;
921
- }, Vs = (t, s) => {
928
+ }, Js = (t, s) => {
922
929
  if (s.maxExtglobRecursion === !1)
923
930
  return { risky: !1 };
924
- const e = typeof s.maxExtglobRecursion == "number" ? s.maxExtglobRecursion : rt.DEFAULT_MAX_EXTGLOB_RECURSION, r = Jt(t).map((l) => l.trim());
925
- if (r.length > 1 && (r.some((l) => l === "") || r.some((l) => /^[*?]+$/.test(l)) || Qs(r)))
931
+ const e = typeof s.maxExtglobRecursion == "number" ? s.maxExtglobRecursion : ut.DEFAULT_MAX_EXTGLOB_RECURSION, r = ee(t).map((l) => l.trim());
932
+ if (r.length > 1 && (r.some((l) => l === "") || r.some((l) => /^[*?]+$/.test(l)) || zs(r)))
926
933
  return { risky: !0 };
927
934
  const o = [];
928
935
  let n = !1, i = !0;
929
936
  for (const l of r) {
930
- const h = Ys(l);
937
+ const h = Zs(l);
931
938
  if (h) {
932
939
  n = !0, o.push(...h);
933
940
  continue;
934
941
  }
935
- const g = Ct(l);
942
+ const g = vt(l);
936
943
  if (g && g.length === 1) {
937
944
  o.push(g);
938
945
  continue;
939
946
  }
940
- if (i = !1, Zs(l) > e)
947
+ if (i = !1, Vs(l) > e)
941
948
  return { risky: !0 };
942
949
  }
943
- return n ? i ? { risky: !0, safeOutput: zs([...new Set(o)]) } : { risky: !0 } : { risky: !1 };
944
- }, $t = (t, s) => {
950
+ return n ? i ? { risky: !0, safeOutput: Ys([...new Set(o)]) } : { risky: !0 } : { risky: !1 };
951
+ }, wt = (t, s) => {
945
952
  if (typeof t != "string")
946
953
  throw new TypeError("Expected a string");
947
- t = Vt[t] || t;
948
- const e = { ...s }, r = typeof e.maxLength == "number" ? Math.min(ct, e.maxLength) : ct;
954
+ t = te[t] || t;
955
+ const e = { ...s }, r = typeof e.maxLength == "number" ? Math.min(pt, e.maxLength) : pt;
949
956
  let o = t.length;
950
957
  if (o > r)
951
958
  throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${r}`);
952
- const n = { type: "bos", value: "", output: e.prepend || "" }, i = [n], l = e.capture ? "" : "?:", h = rt.globChars(e.windows), g = rt.extglobChars(h), {
959
+ const n = { type: "bos", value: "", output: e.prepend || "" }, i = [n], l = e.capture ? "" : "?:", h = ut.globChars(e.windows), g = ut.extglobChars(h), {
953
960
  DOT_LITERAL: d,
954
961
  PLUS_LITERAL: A,
955
- SLASH_LITERAL: S,
962
+ SLASH_LITERAL: E,
956
963
  ONE_CHAR: x,
957
964
  DOTS_SLASH: y,
958
965
  NO_DOT: C,
959
966
  NO_DOT_SLASH: T,
960
- NO_DOTS_SLASH: G,
967
+ NO_DOTS_SLASH: W,
961
968
  QMARK: _,
962
969
  QMARK_NO_DOT: M,
963
- STAR: X,
964
- START_ANCHOR: P
965
- } = h, O = (p) => `(${l}(?:(?!${P}${p.dot ? y : d}).)*?)`, v = e.dot ? "" : C, R = e.dot ? _ : M;
966
- let m = e.bash === !0 ? O(e) : X;
970
+ STAR: j,
971
+ START_ANCHOR: k
972
+ } = h, O = (p) => `(${l}(?:(?!${k}${p.dot ? y : d}).)*?)`, v = e.dot ? "" : C, R = e.dot ? _ : M;
973
+ let m = e.bash === !0 ? O(e) : j;
967
974
  e.capture && (m = `(${m})`), typeof e.noext == "boolean" && (e.noextglob = e.noext);
968
- const c = {
975
+ const u = {
969
976
  input: t,
970
977
  index: -1,
971
978
  start: 0,
@@ -982,166 +989,166 @@ const rt = pt, U = it, {
982
989
  globstar: !1,
983
990
  tokens: i
984
991
  };
985
- t = U.removePrefix(t, c), o = t.length;
986
- const W = [], N = [], D = [];
987
- let a = n, u;
988
- const q = () => c.index === o - 1, $ = c.peek = (p = 1) => t[c.index + p], k = c.advance = () => t[++c.index] || "", Y = () => t.slice(c.index + 1), K = (p = "", L = 0) => {
989
- c.consumed += p, c.index += L;
990
- }, V = (p) => {
991
- c.output += p.output != null ? p.output : p.value, K(p.value);
992
- }, le = () => {
992
+ t = K.removePrefix(t, u), o = t.length;
993
+ const G = [], I = [], P = [];
994
+ let c = n, a;
995
+ const X = () => u.index === o - 1, $ = u.peek = (p = 1) => t[u.index + p], U = u.advance = () => t[++u.index] || "", q = () => t.slice(u.index + 1), B = (p = "", L = 0) => {
996
+ u.consumed += p, u.index += L;
997
+ }, et = (p) => {
998
+ u.output += p.output != null ? p.output : p.value, B(p.value);
999
+ }, ot = () => {
993
1000
  let p = 1;
994
1001
  for (; $() === "!" && ($(2) !== "(" || $(3) === "?"); )
995
- k(), c.start++, p++;
996
- return p % 2 === 0 ? !1 : (c.negated = !0, c.start++, !0);
997
- }, ut = (p) => {
998
- c[p]++, D.push(p);
999
- }, J = (p) => {
1000
- c[p]--, D.pop();
1001
- }, E = (p) => {
1002
- if (a.type === "globstar") {
1003
- const L = c.braces > 0 && (p.type === "comma" || p.type === "brace"), f = p.extglob === !0 || W.length && (p.type === "pipe" || p.type === "paren");
1004
- p.type !== "slash" && p.type !== "paren" && !L && !f && (c.output = c.output.slice(0, -a.output.length), a.type = "star", a.value = "*", a.output = m, c.output += a.output);
1002
+ U(), u.start++, p++;
1003
+ return p % 2 === 0 ? !1 : (u.negated = !0, u.start++, !0);
1004
+ }, V = (p) => {
1005
+ u[p]++, P.push(p);
1006
+ }, Z = (p) => {
1007
+ u[p]--, P.pop();
1008
+ }, S = (p) => {
1009
+ if (c.type === "globstar") {
1010
+ const L = u.braces > 0 && (p.type === "comma" || p.type === "brace"), f = p.extglob === !0 || G.length && (p.type === "pipe" || p.type === "paren");
1011
+ p.type !== "slash" && p.type !== "paren" && !L && !f && (u.output = u.output.slice(0, -c.output.length), c.type = "star", c.value = "*", c.output = m, u.output += c.output);
1005
1012
  }
1006
- if (W.length && p.type !== "paren" && (W[W.length - 1].inner += p.value), (p.value || p.output) && V(p), a && a.type === "text" && p.type === "text") {
1007
- a.output = (a.output || a.value) + p.value, a.value += p.value;
1013
+ if (G.length && p.type !== "paren" && (G[G.length - 1].inner += p.value), (p.value || p.output) && et(p), c && c.type === "text" && p.type === "text") {
1014
+ c.output = (c.output || c.value) + p.value, c.value += p.value;
1008
1015
  return;
1009
1016
  }
1010
- p.prev = a, i.push(p), a = p;
1011
- }, at = (p, L) => {
1017
+ p.prev = c, i.push(p), c = p;
1018
+ }, lt = (p, L) => {
1012
1019
  const f = { ...g[L], conditions: 1, inner: "" };
1013
- f.prev = a, f.parens = c.parens, f.output = c.output, f.startIndex = c.index, f.tokensIndex = i.length;
1020
+ f.prev = c, f.parens = u.parens, f.output = u.output, f.startIndex = u.index, f.tokensIndex = i.length;
1014
1021
  const b = (e.capture ? "(" : "") + f.open;
1015
- ut("parens"), E({ type: p, value: L, output: c.output ? "" : x }), E({ type: "paren", extglob: !0, value: k(), output: b }), W.push(f);
1016
- }, fe = (p) => {
1017
- const L = t.slice(p.startIndex, c.index + 1), f = t.slice(p.startIndex + 2, c.index), b = Vs(f, e);
1022
+ V("parens"), S({ type: p, value: L, output: u.output ? "" : x }), S({ type: "paren", extglob: !0, value: U(), output: b }), G.push(f);
1023
+ }, pe = (p) => {
1024
+ const L = t.slice(p.startIndex, u.index + 1), f = t.slice(p.startIndex + 2, u.index), b = Js(f, e);
1018
1025
  if ((p.type === "plus" || p.type === "star") && b.risky) {
1019
- const w = b.safeOutput ? (p.output ? "" : x) + (e.capture ? `(${b.safeOutput})` : b.safeOutput) : void 0, j = i[p.tokensIndex];
1020
- j.type = "text", j.value = L, j.output = w || U.escapeRegex(L);
1021
- for (let Q = p.tokensIndex + 1; Q < i.length; Q++)
1022
- i[Q].value = "", i[Q].output = "", delete i[Q].suffix;
1023
- c.output = p.output + j.output, c.backtrack = !0, E({ type: "paren", extglob: !0, value: u, output: "" }), J("parens");
1026
+ const w = b.safeOutput ? (p.output ? "" : x) + (e.capture ? `(${b.safeOutput})` : b.safeOutput) : void 0, Q = i[p.tokensIndex];
1027
+ Q.type = "text", Q.value = L, Q.output = w || K.escapeRegex(L);
1028
+ for (let J = p.tokensIndex + 1; J < i.length; J++)
1029
+ i[J].value = "", i[J].output = "", delete i[J].suffix;
1030
+ u.output = p.output + Q.output, u.backtrack = !0, S({ type: "paren", extglob: !0, value: a, output: "" }), Z("parens");
1024
1031
  return;
1025
1032
  }
1026
1033
  let H = p.close + (e.capture ? ")" : ""), F;
1027
1034
  if (p.type === "negate") {
1028
1035
  let w = m;
1029
- if (p.inner && p.inner.length > 1 && p.inner.includes("/") && (w = O(e)), (w !== m || q() || /^\)+$/.test(Y())) && (H = p.close = `)$))${w}`), p.inner.includes("*") && (F = Y()) && /^\.[^\\/.]+$/.test(F)) {
1030
- const j = $t(F, { ...s, fastpaths: !1 }).output;
1031
- H = p.close = `)${j})${w})`;
1036
+ if (p.inner && p.inner.length > 1 && p.inner.includes("/") && (w = O(e)), (w !== m || X() || /^\)+$/.test(q())) && (H = p.close = `)$))${w}`), p.inner.includes("*") && (F = q()) && /^\.[^\\/.]+$/.test(F)) {
1037
+ const Q = wt(F, { ...s, fastpaths: !1 }).output;
1038
+ H = p.close = `)${Q})${w})`;
1032
1039
  }
1033
- p.prev.type === "bos" && (c.negatedExtglob = !0);
1040
+ p.prev.type === "bos" && (u.negatedExtglob = !0);
1034
1041
  }
1035
- E({ type: "paren", extglob: !0, value: u, output: H }), J("parens");
1042
+ S({ type: "paren", extglob: !0, value: a, output: H }), Z("parens");
1036
1043
  };
1037
1044
  if (e.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(t)) {
1038
- let p = !1, L = t.replace(Ks, (f, b, H, F, w, j) => F === "\\" ? (p = !0, f) : F === "?" ? b ? b + F + (w ? _.repeat(w.length) : "") : j === 0 ? R + (w ? _.repeat(w.length) : "") : _.repeat(H.length) : F === "." ? d.repeat(H.length) : F === "*" ? b ? b + F + (w ? m : "") : m : b ? f : `\\${f}`);
1039
- return p === !0 && (e.unescape === !0 ? L = L.replace(/\\/g, "") : L = L.replace(/\\+/g, (f) => f.length % 2 === 0 ? "\\\\" : f ? "\\" : "")), L === t && e.contains === !0 ? (c.output = t, c) : (c.output = U.wrapOutput(L, c, s), c);
1045
+ let p = !1, L = t.replace(Xs, (f, b, H, F, w, Q) => F === "\\" ? (p = !0, f) : F === "?" ? b ? b + F + (w ? _.repeat(w.length) : "") : Q === 0 ? R + (w ? _.repeat(w.length) : "") : _.repeat(H.length) : F === "." ? d.repeat(H.length) : F === "*" ? b ? b + F + (w ? m : "") : m : b ? f : `\\${f}`);
1046
+ return p === !0 && (e.unescape === !0 ? L = L.replace(/\\/g, "") : L = L.replace(/\\+/g, (f) => f.length % 2 === 0 ? "\\\\" : f ? "\\" : "")), L === t && e.contains === !0 ? (u.output = t, u) : (u.output = K.wrapOutput(L, u, s), u);
1040
1047
  }
1041
- for (; !q(); ) {
1042
- if (u = k(), u === "\0")
1048
+ for (; !X(); ) {
1049
+ if (a = U(), a === "\0")
1043
1050
  continue;
1044
- if (u === "\\") {
1051
+ if (a === "\\") {
1045
1052
  const f = $();
1046
1053
  if (f === "/" && e.bash !== !0 || f === "." || f === ";")
1047
1054
  continue;
1048
1055
  if (!f) {
1049
- u += "\\", E({ type: "text", value: u });
1056
+ a += "\\", S({ type: "text", value: a });
1050
1057
  continue;
1051
1058
  }
1052
- const b = /^\\+/.exec(Y());
1059
+ const b = /^\\+/.exec(q());
1053
1060
  let H = 0;
1054
- if (b && b[0].length > 2 && (H = b[0].length, c.index += H, H % 2 !== 0 && (u += "\\")), e.unescape === !0 ? u = k() : u += k(), c.brackets === 0) {
1055
- E({ type: "text", value: u });
1061
+ if (b && b[0].length > 2 && (H = b[0].length, u.index += H, H % 2 !== 0 && (a += "\\")), e.unescape === !0 ? a = U() : a += U(), u.brackets === 0) {
1062
+ S({ type: "text", value: a });
1056
1063
  continue;
1057
1064
  }
1058
1065
  }
1059
- if (c.brackets > 0 && (u !== "]" || a.value === "[" || a.value === "[^")) {
1060
- if (e.posix !== !1 && u === ":") {
1061
- const f = a.value.slice(1);
1062
- if (f.includes("[") && (a.posix = !0, f.includes(":"))) {
1063
- const b = a.value.lastIndexOf("["), H = a.value.slice(0, b), F = a.value.slice(b + 2), w = Us[F];
1066
+ if (u.brackets > 0 && (a !== "]" || c.value === "[" || c.value === "[^")) {
1067
+ if (e.posix !== !1 && a === ":") {
1068
+ const f = c.value.slice(1);
1069
+ if (f.includes("[") && (c.posix = !0, f.includes(":"))) {
1070
+ const b = c.value.lastIndexOf("["), H = c.value.slice(0, b), F = c.value.slice(b + 2), w = qs[F];
1064
1071
  if (w) {
1065
- a.value = H + w, c.backtrack = !0, k(), !n.output && i.indexOf(a) === 1 && (n.output = x);
1072
+ c.value = H + w, u.backtrack = !0, U(), !n.output && i.indexOf(c) === 1 && (n.output = x);
1066
1073
  continue;
1067
1074
  }
1068
1075
  }
1069
1076
  }
1070
- (u === "[" && $() !== ":" || u === "-" && $() === "]") && (u = `\\${u}`), u === "]" && (a.value === "[" || a.value === "[^") && (u = `\\${u}`), e.posix === !0 && u === "!" && a.value === "[" && (u = "^"), a.value += u, V({ value: u });
1077
+ (a === "[" && $() !== ":" || a === "-" && $() === "]") && (a = `\\${a}`), a === "]" && (c.value === "[" || c.value === "[^") && (a = `\\${a}`), e.posix === !0 && a === "!" && c.value === "[" && (a = "^"), c.value += a, et({ value: a });
1071
1078
  continue;
1072
1079
  }
1073
- if (c.quotes === 1 && u !== '"') {
1074
- u = U.escapeRegex(u), a.value += u, V({ value: u });
1080
+ if (u.quotes === 1 && a !== '"') {
1081
+ a = K.escapeRegex(a), c.value += a, et({ value: a });
1075
1082
  continue;
1076
1083
  }
1077
- if (u === '"') {
1078
- c.quotes = c.quotes === 1 ? 0 : 1, e.keepQuotes === !0 && E({ type: "text", value: u });
1084
+ if (a === '"') {
1085
+ u.quotes = u.quotes === 1 ? 0 : 1, e.keepQuotes === !0 && S({ type: "text", value: a });
1079
1086
  continue;
1080
1087
  }
1081
- if (u === "(") {
1082
- ut("parens"), E({ type: "paren", value: u });
1088
+ if (a === "(") {
1089
+ V("parens"), S({ type: "paren", value: a });
1083
1090
  continue;
1084
1091
  }
1085
- if (u === ")") {
1086
- if (c.parens === 0 && e.strictBrackets === !0)
1087
- throw new SyntaxError(et("opening", "("));
1088
- const f = W[W.length - 1];
1089
- if (f && c.parens === f.parens + 1) {
1090
- fe(W.pop());
1092
+ if (a === ")") {
1093
+ if (u.parens === 0 && e.strictBrackets === !0)
1094
+ throw new SyntaxError(nt("opening", "("));
1095
+ const f = G[G.length - 1];
1096
+ if (f && u.parens === f.parens + 1) {
1097
+ pe(G.pop());
1091
1098
  continue;
1092
1099
  }
1093
- E({ type: "paren", value: u, output: c.parens ? ")" : "\\)" }), J("parens");
1100
+ S({ type: "paren", value: a, output: u.parens ? ")" : "\\)" }), Z("parens");
1094
1101
  continue;
1095
1102
  }
1096
- if (u === "[") {
1097
- if (e.nobracket === !0 || !Y().includes("]")) {
1103
+ if (a === "[") {
1104
+ if (e.nobracket === !0 || !q().includes("]")) {
1098
1105
  if (e.nobracket !== !0 && e.strictBrackets === !0)
1099
- throw new SyntaxError(et("closing", "]"));
1100
- u = `\\${u}`;
1106
+ throw new SyntaxError(nt("closing", "]"));
1107
+ a = `\\${a}`;
1101
1108
  } else
1102
- ut("brackets");
1103
- E({ type: "bracket", value: u });
1109
+ V("brackets");
1110
+ S({ type: "bracket", value: a });
1104
1111
  continue;
1105
1112
  }
1106
- if (u === "]") {
1107
- if (e.nobracket === !0 || a && a.type === "bracket" && a.value.length === 1) {
1108
- E({ type: "text", value: u, output: `\\${u}` });
1113
+ if (a === "]") {
1114
+ if (e.nobracket === !0 || c && c.type === "bracket" && c.value.length === 1) {
1115
+ S({ type: "text", value: a, output: `\\${a}` });
1109
1116
  continue;
1110
1117
  }
1111
- if (c.brackets === 0) {
1118
+ if (u.brackets === 0) {
1112
1119
  if (e.strictBrackets === !0)
1113
- throw new SyntaxError(et("opening", "["));
1114
- E({ type: "text", value: u, output: `\\${u}` });
1120
+ throw new SyntaxError(nt("opening", "["));
1121
+ S({ type: "text", value: a, output: `\\${a}` });
1115
1122
  continue;
1116
1123
  }
1117
- J("brackets");
1118
- const f = a.value.slice(1);
1119
- if (a.posix !== !0 && f[0] === "^" && !f.includes("/") && (u = `/${u}`), a.value += u, V({ value: u }), e.literalBrackets === !1 || U.hasRegexChars(f))
1124
+ Z("brackets");
1125
+ const f = c.value.slice(1);
1126
+ if (c.posix !== !0 && f[0] === "^" && !f.includes("/") && (a = `/${a}`), c.value += a, et({ value: a }), e.literalBrackets === !1 || K.hasRegexChars(f))
1120
1127
  continue;
1121
- const b = U.escapeRegex(a.value);
1122
- if (c.output = c.output.slice(0, -a.value.length), e.literalBrackets === !0) {
1123
- c.output += b, a.value = b;
1128
+ const b = K.escapeRegex(c.value);
1129
+ if (u.output = u.output.slice(0, -c.value.length), e.literalBrackets === !0) {
1130
+ u.output += b, c.value = b;
1124
1131
  continue;
1125
1132
  }
1126
- a.value = `(${l}${b}|${a.value})`, c.output += a.value;
1133
+ c.value = `(${l}${b}|${c.value})`, u.output += c.value;
1127
1134
  continue;
1128
1135
  }
1129
- if (u === "{" && e.nobrace !== !0) {
1130
- ut("braces");
1136
+ if (a === "{" && e.nobrace !== !0) {
1137
+ V("braces");
1131
1138
  const f = {
1132
1139
  type: "brace",
1133
- value: u,
1140
+ value: a,
1134
1141
  output: "(",
1135
- outputIndex: c.output.length,
1136
- tokensIndex: c.tokens.length
1142
+ outputIndex: u.output.length,
1143
+ tokensIndex: u.tokens.length
1137
1144
  };
1138
- N.push(f), E(f);
1145
+ I.push(f), S(f);
1139
1146
  continue;
1140
1147
  }
1141
- if (u === "}") {
1142
- const f = N[N.length - 1];
1148
+ if (a === "}") {
1149
+ const f = I[I.length - 1];
1143
1150
  if (e.nobrace === !0 || !f) {
1144
- E({ type: "text", value: u, output: u });
1151
+ S({ type: "text", value: a, output: a });
1145
1152
  continue;
1146
1153
  }
1147
1154
  let b = ")";
@@ -1149,192 +1156,193 @@ const rt = pt, U = it, {
1149
1156
  const H = i.slice(), F = [];
1150
1157
  for (let w = H.length - 1; w >= 0 && (i.pop(), H[w].type !== "brace"); w--)
1151
1158
  H[w].type !== "dots" && F.unshift(H[w].value);
1152
- b = Xs(F, e), c.backtrack = !0;
1159
+ b = js(F, e), u.backtrack = !0;
1153
1160
  }
1154
1161
  if (f.comma !== !0 && f.dots !== !0) {
1155
- const H = c.output.slice(0, f.outputIndex), F = c.tokens.slice(f.tokensIndex);
1156
- f.value = f.output = "\\{", u = b = "\\}", c.output = H;
1162
+ const H = u.output.slice(0, f.outputIndex), F = u.tokens.slice(f.tokensIndex);
1163
+ f.value = f.output = "\\{", a = b = "\\}", u.output = H;
1157
1164
  for (const w of F)
1158
- c.output += w.output || w.value;
1165
+ u.output += w.output || w.value;
1159
1166
  }
1160
- E({ type: "brace", value: u, output: b }), J("braces"), N.pop();
1167
+ S({ type: "brace", value: a, output: b }), Z("braces"), I.pop();
1161
1168
  continue;
1162
1169
  }
1163
- if (u === "|") {
1164
- W.length > 0 && W[W.length - 1].conditions++, E({ type: "text", value: u });
1170
+ if (a === "|") {
1171
+ G.length > 0 && G[G.length - 1].conditions++, S({ type: "text", value: a });
1165
1172
  continue;
1166
1173
  }
1167
- if (u === ",") {
1168
- let f = u;
1169
- const b = N[N.length - 1];
1170
- b && D[D.length - 1] === "braces" && (b.comma = !0, f = "|"), E({ type: "comma", value: u, output: f });
1174
+ if (a === ",") {
1175
+ let f = a;
1176
+ const b = I[I.length - 1];
1177
+ b && P[P.length - 1] === "braces" && (b.comma = !0, f = "|"), S({ type: "comma", value: a, output: f });
1171
1178
  continue;
1172
1179
  }
1173
- if (u === "/") {
1174
- if (a.type === "dot" && c.index === c.start + 1) {
1175
- c.start = c.index + 1, c.consumed = "", c.output = "", i.pop(), a = n;
1180
+ if (a === "/") {
1181
+ if (c.type === "dot" && u.index === u.start + 1) {
1182
+ u.start = u.index + 1, u.consumed = "", u.output = "", i.pop(), c = n;
1176
1183
  continue;
1177
1184
  }
1178
- E({ type: "slash", value: u, output: S });
1185
+ S({ type: "slash", value: a, output: E });
1179
1186
  continue;
1180
1187
  }
1181
- if (u === ".") {
1182
- if (c.braces > 0 && a.type === "dot") {
1183
- a.value === "." && (a.output = d);
1184
- const f = N[N.length - 1];
1185
- a.type = "dots", a.output += u, a.value += u, f.dots = !0;
1188
+ if (a === ".") {
1189
+ if (u.braces > 0 && c.type === "dot") {
1190
+ c.value === "." && (c.output = d);
1191
+ const f = I[I.length - 1];
1192
+ c.type = "dots", c.output += a, c.value += a, f.dots = !0;
1186
1193
  continue;
1187
1194
  }
1188
- if (c.braces + c.parens === 0 && a.type !== "bos" && a.type !== "slash") {
1189
- E({ type: "text", value: u, output: d });
1195
+ if (u.braces + u.parens === 0 && c.type !== "bos" && c.type !== "slash") {
1196
+ S({ type: "text", value: a, output: d });
1190
1197
  continue;
1191
1198
  }
1192
- E({ type: "dot", value: u, output: d });
1199
+ S({ type: "dot", value: a, output: d });
1193
1200
  continue;
1194
1201
  }
1195
- if (u === "?") {
1196
- if (!(a && a.value === "(") && e.noextglob !== !0 && $() === "(" && $(2) !== "?") {
1197
- at("qmark", u);
1202
+ if (a === "?") {
1203
+ if (!(c && c.value === "(") && e.noextglob !== !0 && $() === "(" && $(2) !== "?") {
1204
+ lt("qmark", a);
1198
1205
  continue;
1199
1206
  }
1200
- if (a && a.type === "paren") {
1207
+ if (c && c.type === "paren") {
1201
1208
  const b = $();
1202
- let H = u;
1203
- (a.value === "(" && !/[!=<:]/.test(b) || b === "<" && !/<([!=]|\w+>)/.test(Y())) && (H = `\\${u}`), E({ type: "text", value: u, output: H });
1209
+ let H = a;
1210
+ (c.value === "(" && !/[!=<:]/.test(b) || b === "<" && !/<([!=]|\w+>)/.test(q())) && (H = `\\${a}`), S({ type: "text", value: a, output: H });
1204
1211
  continue;
1205
1212
  }
1206
- if (e.dot !== !0 && (a.type === "slash" || a.type === "bos")) {
1207
- E({ type: "qmark", value: u, output: M });
1213
+ if (e.dot !== !0 && (c.type === "slash" || c.type === "bos")) {
1214
+ S({ type: "qmark", value: a, output: M });
1208
1215
  continue;
1209
1216
  }
1210
- E({ type: "qmark", value: u, output: _ });
1217
+ S({ type: "qmark", value: a, output: _ });
1211
1218
  continue;
1212
1219
  }
1213
- if (u === "!") {
1220
+ if (a === "!") {
1214
1221
  if (e.noextglob !== !0 && $() === "(" && ($(2) !== "?" || !/[!=<:]/.test($(3)))) {
1215
- at("negate", u);
1222
+ lt("negate", a);
1216
1223
  continue;
1217
1224
  }
1218
- if (e.nonegate !== !0 && c.index === 0) {
1219
- le();
1225
+ if (e.nonegate !== !0 && u.index === 0) {
1226
+ ot();
1220
1227
  continue;
1221
1228
  }
1222
1229
  }
1223
- if (u === "+") {
1230
+ if (a === "+") {
1224
1231
  if (e.noextglob !== !0 && $() === "(" && $(2) !== "?") {
1225
- at("plus", u);
1232
+ lt("plus", a);
1226
1233
  continue;
1227
1234
  }
1228
- if (a && a.value === "(" || e.regex === !1) {
1229
- E({ type: "plus", value: u, output: A });
1235
+ if (c && c.value === "(" || e.regex === !1) {
1236
+ S({ type: "plus", value: a, output: A });
1230
1237
  continue;
1231
1238
  }
1232
- if (a && (a.type === "bracket" || a.type === "paren" || a.type === "brace") || c.parens > 0) {
1233
- E({ type: "plus", value: u });
1239
+ if (c && (c.type === "bracket" || c.type === "paren" || c.type === "brace") || u.parens > 0) {
1240
+ S({ type: "plus", value: a });
1234
1241
  continue;
1235
1242
  }
1236
- E({ type: "plus", value: A });
1243
+ S({ type: "plus", value: A });
1237
1244
  continue;
1238
1245
  }
1239
- if (u === "@") {
1246
+ if (a === "@") {
1240
1247
  if (e.noextglob !== !0 && $() === "(" && $(2) !== "?") {
1241
- E({ type: "at", extglob: !0, value: u, output: "" });
1248
+ S({ type: "at", extglob: !0, value: a, output: "" });
1242
1249
  continue;
1243
1250
  }
1244
- E({ type: "text", value: u });
1251
+ S({ type: "text", value: a });
1245
1252
  continue;
1246
1253
  }
1247
- if (u !== "*") {
1248
- (u === "$" || u === "^") && (u = `\\${u}`);
1249
- const f = qs.exec(Y());
1250
- f && (u += f[0], c.index += f[0].length), E({ type: "text", value: u });
1254
+ if (a !== "*") {
1255
+ (a === "$" || a === "^") && (a = `\\${a}`);
1256
+ const f = Ks.exec(q());
1257
+ f && (a += f[0], u.index += f[0].length), S({ type: "text", value: a });
1251
1258
  continue;
1252
1259
  }
1253
- if (a && (a.type === "globstar" || a.star === !0)) {
1254
- a.type = "star", a.star = !0, a.value += u, a.output = m, c.backtrack = !0, c.globstar = !0, K(u);
1260
+ if (c && (c.type === "globstar" || c.star === !0)) {
1261
+ c.type = "star", c.star = !0, c.value += a, c.output = m, u.backtrack = !0, u.globstar = !0, B(a);
1255
1262
  continue;
1256
1263
  }
1257
- let p = Y();
1264
+ let p = q();
1258
1265
  if (e.noextglob !== !0 && /^\([^?]/.test(p)) {
1259
- at("star", u);
1266
+ lt("star", a);
1260
1267
  continue;
1261
1268
  }
1262
- if (a.type === "star") {
1269
+ if (c.type === "star") {
1263
1270
  if (e.noglobstar === !0) {
1264
- K(u);
1271
+ B(a);
1265
1272
  continue;
1266
1273
  }
1267
- const f = a.prev, b = f.prev, H = f.type === "slash" || f.type === "bos", F = b && (b.type === "star" || b.type === "globstar");
1274
+ const f = c.prev, b = f.prev, H = f.type === "slash" || f.type === "bos", F = b && (b.type === "star" || b.type === "globstar");
1268
1275
  if (e.bash === !0 && (!H || p[0] && p[0] !== "/")) {
1269
- E({ type: "star", value: u, output: "" });
1276
+ S({ type: "star", value: a, output: "" });
1270
1277
  continue;
1271
1278
  }
1272
- const w = c.braces > 0 && (f.type === "comma" || f.type === "brace"), j = W.length && (f.type === "pipe" || f.type === "paren");
1273
- if (!H && f.type !== "paren" && !w && !j) {
1274
- E({ type: "star", value: u, output: "" });
1279
+ const w = u.braces > 0 && (f.type === "comma" || f.type === "brace"), Q = G.length && (f.type === "pipe" || f.type === "paren");
1280
+ if (!H && f.type !== "paren" && !w && !Q) {
1281
+ S({ type: "star", value: a, output: "" });
1275
1282
  continue;
1276
1283
  }
1277
1284
  for (; p.slice(0, 3) === "/**"; ) {
1278
- const Q = t[c.index + 4];
1279
- if (Q && Q !== "/")
1285
+ const st = t[u.index + 4];
1286
+ if (st && st !== "/")
1280
1287
  break;
1281
- p = p.slice(3), K("/**", 3);
1288
+ p = p.slice(3), B("/**", 3);
1282
1289
  }
1283
- if (f.type === "bos" && q()) {
1284
- a.type = "globstar", a.value += u, a.output = O(e), c.output = a.output, c.globstar = !0, K(u);
1290
+ const J = X() || u.parens > 0 && p === ")".repeat(u.parens) && !G.some((st) => st.type === "negate");
1291
+ if (f.type === "bos" && X()) {
1292
+ c.type = "globstar", c.value += a, c.output = O(e), u.output = c.output, u.globstar = !0, B(a);
1285
1293
  continue;
1286
1294
  }
1287
- if (f.type === "slash" && f.prev.type !== "bos" && !F && q()) {
1288
- c.output = c.output.slice(0, -(f.output + a.output).length), f.output = `(?:${f.output}`, a.type = "globstar", a.output = O(e) + (e.strictSlashes ? ")" : "|$)"), a.value += u, c.globstar = !0, c.output += f.output + a.output, K(u);
1295
+ if (f.type === "slash" && f.prev.type !== "bos" && !F && J) {
1296
+ u.output = u.output.slice(0, -(f.output + c.output).length), f.output = `(?:${f.output}`, c.type = "globstar", c.output = O(e) + (e.strictSlashes ? ")" : "|$)"), c.value += a, u.globstar = !0, u.output += f.output + c.output, B(a);
1289
1297
  continue;
1290
1298
  }
1291
1299
  if (f.type === "slash" && f.prev.type !== "bos" && p[0] === "/") {
1292
- const Q = p[1] !== void 0 ? "|$" : "";
1293
- c.output = c.output.slice(0, -(f.output + a.output).length), f.output = `(?:${f.output}`, a.type = "globstar", a.output = `${O(e)}${S}|${S}${Q})`, a.value += u, c.output += f.output + a.output, c.globstar = !0, K(u + k()), E({ type: "slash", value: "/", output: "" });
1300
+ const st = p[1] !== void 0 ? "|$" : "";
1301
+ u.output = u.output.slice(0, -(f.output + c.output).length), f.output = `(?:${f.output}`, c.type = "globstar", c.output = `${O(e)}${E}|${E}${st})`, c.value += a, u.output += f.output + c.output, u.globstar = !0, B(a + U()), S({ type: "slash", value: "/", output: "" });
1294
1302
  continue;
1295
1303
  }
1296
1304
  if (f.type === "bos" && p[0] === "/") {
1297
- a.type = "globstar", a.value += u, a.output = `(?:^|${S}|${O(e)}${S})`, c.output = a.output, c.globstar = !0, K(u + k()), E({ type: "slash", value: "/", output: "" });
1305
+ c.type = "globstar", c.value += a, c.output = `(?:^|${E}|${O(e)}${E})`, u.output = c.output, u.globstar = !0, B(a + U()), S({ type: "slash", value: "/", output: "" });
1298
1306
  continue;
1299
1307
  }
1300
- c.output = c.output.slice(0, -a.output.length), a.type = "globstar", a.output = O(e), a.value += u, c.output += a.output, c.globstar = !0, K(u);
1308
+ u.output = u.output.slice(0, -c.output.length), c.type = "globstar", c.output = O(e), c.value += a, u.output += c.output, u.globstar = !0, B(a);
1301
1309
  continue;
1302
1310
  }
1303
- const L = { type: "star", value: u, output: m };
1311
+ const L = { type: "star", value: a, output: m };
1304
1312
  if (e.bash === !0) {
1305
- L.output = ".*?", (a.type === "bos" || a.type === "slash") && (L.output = v + L.output), E(L);
1313
+ L.output = ".*?", (c.type === "bos" || c.type === "slash") && (L.output = v + L.output), S(L);
1306
1314
  continue;
1307
1315
  }
1308
- if (a && (a.type === "bracket" || a.type === "paren") && e.regex === !0) {
1309
- L.output = u, E(L);
1316
+ if (c && (c.type === "bracket" || c.type === "paren") && e.regex === !0) {
1317
+ L.output = a, S(L);
1310
1318
  continue;
1311
1319
  }
1312
- (c.index === c.start || a.type === "slash" || a.type === "dot") && (a.type === "dot" ? (c.output += T, a.output += T) : e.dot === !0 ? (c.output += G, a.output += G) : (c.output += v, a.output += v), $() !== "*" && (c.output += x, a.output += x)), E(L);
1320
+ (u.index === u.start || c.type === "slash" || c.type === "dot") && (c.type === "dot" ? (u.output += T, c.output += T) : e.dot === !0 ? (u.output += W, c.output += W) : (u.output += v, c.output += v), $() !== "*" && (u.output += x, c.output += x)), S(L);
1313
1321
  }
1314
- for (; c.brackets > 0; ) {
1315
- if (e.strictBrackets === !0) throw new SyntaxError(et("closing", "]"));
1316
- c.output = U.escapeLast(c.output, "["), J("brackets");
1322
+ for (; u.brackets > 0; ) {
1323
+ if (e.strictBrackets === !0) throw new SyntaxError(nt("closing", "]"));
1324
+ u.output = K.escapeLast(u.output, "["), Z("brackets");
1317
1325
  }
1318
- for (; c.parens > 0; ) {
1319
- if (e.strictBrackets === !0) throw new SyntaxError(et("closing", ")"));
1320
- c.output = U.escapeLast(c.output, "("), J("parens");
1326
+ for (; u.parens > 0; ) {
1327
+ if (e.strictBrackets === !0) throw new SyntaxError(nt("closing", ")"));
1328
+ u.output = K.escapeLast(u.output, "("), Z("parens");
1321
1329
  }
1322
- for (; c.braces > 0; ) {
1323
- if (e.strictBrackets === !0) throw new SyntaxError(et("closing", "}"));
1324
- c.output = U.escapeLast(c.output, "{"), J("braces");
1330
+ for (; u.braces > 0; ) {
1331
+ if (e.strictBrackets === !0) throw new SyntaxError(nt("closing", "}"));
1332
+ u.output = K.escapeLast(u.output, "{"), Z("braces");
1325
1333
  }
1326
- if (e.strictSlashes !== !0 && (a.type === "star" || a.type === "bracket") && E({ type: "maybe_slash", value: "", output: `${S}?` }), c.backtrack === !0) {
1327
- c.output = "";
1328
- for (const p of c.tokens)
1329
- c.output += p.output != null ? p.output : p.value, p.suffix && (c.output += p.suffix);
1334
+ if (e.strictSlashes !== !0 && (c.type === "star" || c.type === "bracket") && S({ type: "maybe_slash", value: "", output: `${E}?` }), u.backtrack === !0) {
1335
+ u.output = "";
1336
+ for (const p of u.tokens)
1337
+ u.output += p.output != null ? p.output : p.value, p.suffix && (u.output += p.suffix);
1330
1338
  }
1331
- return c;
1339
+ return u;
1332
1340
  };
1333
- $t.fastpaths = (t, s) => {
1334
- const e = { ...s }, r = typeof e.maxLength == "number" ? Math.min(ct, e.maxLength) : ct, o = t.length;
1341
+ wt.fastpaths = (t, s) => {
1342
+ const e = { ...s }, r = typeof e.maxLength == "number" ? Math.min(pt, e.maxLength) : pt, o = t.length;
1335
1343
  if (o > r)
1336
1344
  throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${r}`);
1337
- t = Vt[t] || t;
1345
+ t = te[t] || t;
1338
1346
  const {
1339
1347
  DOT_LITERAL: n,
1340
1348
  SLASH_LITERAL: i,
@@ -1343,12 +1351,12 @@ $t.fastpaths = (t, s) => {
1343
1351
  NO_DOT: g,
1344
1352
  NO_DOTS: d,
1345
1353
  NO_DOTS_SLASH: A,
1346
- STAR: S,
1354
+ STAR: E,
1347
1355
  START_ANCHOR: x
1348
- } = rt.globChars(e.windows), y = e.dot ? d : g, C = e.dot ? A : g, T = e.capture ? "" : "?:", G = { negated: !1, prefix: "" };
1349
- let _ = e.bash === !0 ? ".*?" : S;
1356
+ } = ut.globChars(e.windows), y = e.dot ? d : g, C = e.dot ? A : g, T = e.capture ? "" : "?:", W = { negated: !1, prefix: "" };
1357
+ let _ = e.bash === !0 ? ".*?" : E;
1350
1358
  e.capture && (_ = `(${_})`);
1351
- const M = (v) => v.noglobstar === !0 ? _ : `(${T}(?:(?!${x}${v.dot ? h : n}).)*?)`, X = (v) => {
1359
+ const M = (v) => v.noglobstar === !0 ? _ : `(${T}(?:(?!${x}${v.dot ? h : n}).)*?)`, j = (v) => {
1352
1360
  switch (v) {
1353
1361
  case "*":
1354
1362
  return `${y}${l}${_}`;
@@ -1369,71 +1377,71 @@ $t.fastpaths = (t, s) => {
1369
1377
  default: {
1370
1378
  const R = /^(.*?)\.(\w+)$/.exec(v);
1371
1379
  if (!R) return;
1372
- const m = X(R[1]);
1380
+ const m = j(R[1]);
1373
1381
  return m ? m + n + R[2] : void 0;
1374
1382
  }
1375
1383
  }
1376
- }, P = U.removePrefix(t, G);
1377
- let O = X(P);
1384
+ }, k = K.removePrefix(t, W);
1385
+ let O = j(k);
1378
1386
  return O && e.strictSlashes !== !0 && (O += `${i}?`), O;
1379
1387
  };
1380
- var Js = $t;
1381
- const tn = Ws, bt = Js, te = it, en = pt, sn = (t) => t && typeof t == "object" && !Array.isArray(t), I = (t, s, e = !1) => {
1388
+ var tn = wt;
1389
+ const en = Us, xt = tn, se = ct, sn = dt, nn = (t) => t && typeof t == "object" && !Array.isArray(t), D = (t, s, e = !1) => {
1382
1390
  if (Array.isArray(t)) {
1383
- const d = t.map((S) => I(S, s, e));
1384
- return (S) => {
1391
+ const d = t.map((E) => D(E, s, e));
1392
+ return (E) => {
1385
1393
  for (const x of d) {
1386
- const y = x(S);
1394
+ const y = x(E);
1387
1395
  if (y) return y;
1388
1396
  }
1389
1397
  return !1;
1390
1398
  };
1391
1399
  }
1392
- const r = sn(t) && t.tokens && t.input;
1400
+ const r = nn(t) && t.tokens && t.input;
1393
1401
  if (t === "" || typeof t != "string" && !r)
1394
1402
  throw new TypeError("Expected pattern to be a non-empty string");
1395
- const o = s || {}, n = o.windows, i = r ? I.compileRe(t, s) : I.makeRe(t, s, !1, !0), l = i.state;
1403
+ const o = s || {}, n = o.windows, i = r ? D.compileRe(t, s) : D.makeRe(t, s, !1, !0), l = i.state;
1396
1404
  delete i.state;
1397
1405
  let h = () => !1;
1398
1406
  if (o.ignore) {
1399
1407
  const d = { ...s, ignore: null, onMatch: null, onResult: null };
1400
- h = I(o.ignore, d, e);
1408
+ h = D(o.ignore, d, e);
1401
1409
  }
1402
1410
  const g = (d, A = !1) => {
1403
- const { isMatch: S, match: x, output: y } = I.test(d, i, s, { glob: t, posix: n }), C = { glob: t, state: l, regex: i, posix: n, input: d, output: y, match: x, isMatch: S };
1404
- return typeof o.onResult == "function" && o.onResult(C), S === !1 ? (C.isMatch = !1, A ? C : !1) : h(d) ? (typeof o.onIgnore == "function" && o.onIgnore(C), C.isMatch = !1, A ? C : !1) : (typeof o.onMatch == "function" && o.onMatch(C), A ? C : !0);
1411
+ const { isMatch: E, match: x, output: y } = D.test(d, i, s, { glob: t, posix: n }), C = { glob: t, state: l, regex: i, posix: n, input: d, output: y, match: x, isMatch: E };
1412
+ return typeof o.onResult == "function" && o.onResult(C), E === !1 ? (C.isMatch = !1, A ? C : !1) : h(d) ? (typeof o.onIgnore == "function" && o.onIgnore(C), C.isMatch = !1, A ? C : !1) : (typeof o.onMatch == "function" && o.onMatch(C), A ? C : !0);
1405
1413
  };
1406
1414
  return e && (g.state = l), g;
1407
1415
  };
1408
- I.test = (t, s, e, { glob: r, posix: o } = {}) => {
1416
+ D.test = (t, s, e, { glob: r, posix: o } = {}) => {
1409
1417
  if (typeof t != "string")
1410
1418
  throw new TypeError("Expected input to be a string");
1411
1419
  if (t === "")
1412
1420
  return { isMatch: !1, output: "" };
1413
- const n = e || {}, i = n.format || (o ? te.toPosixSlashes : null);
1421
+ const n = e || {}, i = n.format || (o ? se.toPosixSlashes : null);
1414
1422
  let l = t === r, h = l && i ? i(t) : t;
1415
- return l === !1 && (h = i ? i(t) : t, l = h === r), (l === !1 || n.capture === !0) && (n.matchBase === !0 || n.basename === !0 ? l = I.matchBase(t, s, e, o) : l = s.exec(h)), { isMatch: !!l, match: l, output: h };
1423
+ return l === !1 && (h = i ? i(t) : t, l = h === r), (l === !1 || n.capture === !0) && (n.matchBase === !0 || n.basename === !0 ? l = D.matchBase(t, s, e, o) : l = s.exec(h)), { isMatch: !!l, match: l, output: h };
1416
1424
  };
1417
- I.matchBase = (t, s, e, r = e && e.windows) => (s instanceof RegExp ? s : I.makeRe(s, e)).test(te.basename(t, { windows: r }));
1418
- I.isMatch = (t, s, e) => I(s, e)(t);
1419
- I.parse = (t, s) => Array.isArray(t) ? t.map((e) => I.parse(e, s)) : bt(t, { ...s, fastpaths: !1 });
1420
- I.scan = (t, s) => tn(t, s);
1421
- I.compileRe = (t, s, e = !1, r = !1) => {
1425
+ D.matchBase = (t, s, e, r = e && e.windows) => (s instanceof RegExp ? s : D.makeRe(s, e)).test(se.basename(t, { windows: r }));
1426
+ D.isMatch = (t, s, e) => D(s, e)(t);
1427
+ D.parse = (t, s) => Array.isArray(t) ? t.map((e) => D.parse(e, s)) : xt(t, { ...s, fastpaths: !1 });
1428
+ D.scan = (t, s) => en(t, s);
1429
+ D.compileRe = (t, s, e = !1, r = !1) => {
1422
1430
  if (e === !0)
1423
1431
  return t.output;
1424
1432
  const o = s || {}, n = o.contains ? "" : "^", i = o.contains ? "" : "$";
1425
1433
  let l = `${n}(?:${t.output})${i}`;
1426
1434
  t && t.negated === !0 && (l = `^(?!${l}).*$`);
1427
- const h = I.toRegex(l, s);
1435
+ const h = D.toRegex(l, s);
1428
1436
  return r === !0 && (h.state = t), h;
1429
1437
  };
1430
- I.makeRe = (t, s = {}, e = !1, r = !1) => {
1438
+ D.makeRe = (t, s = {}, e = !1, r = !1) => {
1431
1439
  if (!t || typeof t != "string")
1432
1440
  throw new TypeError("Expected a non-empty string");
1433
1441
  let o = { negated: !1, fastpaths: !0 };
1434
- return s.fastpaths !== !1 && (t[0] === "." || t[0] === "*") && (o.output = bt.fastpaths(t, s)), o.output || (o = bt(t, s)), I.compileRe(o, s, e, r);
1442
+ return s.fastpaths !== !1 && (t[0] === "." || t[0] === "*") && (o.output = xt.fastpaths(t, s)), o.output || (o = xt(t, s)), D.compileRe(o, s, e, r);
1435
1443
  };
1436
- I.toRegex = (t, s) => {
1444
+ D.toRegex = (t, s) => {
1437
1445
  try {
1438
1446
  const e = s || {};
1439
1447
  return new RegExp(t, e.flags || (e.nocase ? "i" : ""));
@@ -1442,31 +1450,31 @@ I.toRegex = (t, s) => {
1442
1450
  return /$^/;
1443
1451
  }
1444
1452
  };
1445
- I.constants = en;
1446
- var nn = I;
1447
- const ee = nn, rn = it;
1448
- function se(t, s, e = !1) {
1449
- return s && (s.windows === null || s.windows === void 0) && (s = { ...s, windows: rn.isWindows() }), ee(t, s, e);
1453
+ D.constants = sn;
1454
+ var rn = D;
1455
+ const ne = rn, on = ct;
1456
+ function re(t, s, e = !1) {
1457
+ return s && (s.windows === null || s.windows === void 0) && (s = { ...s, windows: on.isWindows() }), ne(t, s, e);
1450
1458
  }
1451
- Object.assign(se, ee);
1452
- var on = se;
1453
- const ot = /* @__PURE__ */ Es(on), un = Array.isArray, ne = /\\/g, an = /^[A-Za-z]:$/, vt = process.platform === "win32", cn = /^(\/?\.\.)+$/;
1454
- function ln(t, s = {}) {
1459
+ Object.assign(re, ne);
1460
+ var un = re;
1461
+ const at = /* @__PURE__ */ bs(un), an = Array.isArray, oe = /\\/g, cn = /^[A-Za-z]:$/, Ot = process.platform === "win32", ln = /^(\/?\.\.)+$/;
1462
+ function fn(t, s = {}) {
1455
1463
  const e = t.length, r = Array(e), o = Array(e);
1456
1464
  let n, i;
1457
1465
  for (n = 0; n < e; n++) {
1458
- const l = re(t[n]);
1466
+ const l = ie(t[n]);
1459
1467
  r[n] = l;
1460
1468
  const h = l.length, g = Array(h);
1461
- for (i = 0; i < h; i++) g[i] = ot(l[i], s);
1469
+ for (i = 0; i < h; i++) g[i] = at(l[i], s);
1462
1470
  o[n] = g;
1463
1471
  }
1464
1472
  return (l) => {
1465
1473
  const h = l.split("/");
1466
- if (h[0] === ".." && cn.test(l)) return !0;
1474
+ if (h[0] === ".." && ln.test(l)) return !0;
1467
1475
  for (n = 0; n < e; n++) {
1468
- const g = r[n], d = o[n], A = h.length, S = Math.min(A, g.length);
1469
- for (i = 0; i < S; ) {
1476
+ const g = r[n], d = o[n], A = h.length, E = Math.min(A, g.length);
1477
+ for (i = 0; i < E; ) {
1470
1478
  const x = g[i];
1471
1479
  if (x.includes("/")) return !0;
1472
1480
  if (!d[i](h[i])) break;
@@ -1478,11 +1486,11 @@ function ln(t, s = {}) {
1478
1486
  return !1;
1479
1487
  };
1480
1488
  }
1481
- const fn = /^[A-Z]:\/$/i, pn = vt ? (t) => fn.test(t) : (t) => t === "/";
1482
- function It(t, s, e) {
1489
+ const pn = /^[A-Z]:\/$/i, hn = Ot ? (t) => pn.test(t) : (t) => t === "/";
1490
+ function Bt(t, s, e) {
1483
1491
  if (t === s || s.startsWith(`${t}/`)) {
1484
1492
  if (e) {
1485
- const o = t.length + +!pn(t);
1493
+ const o = t.length + +!hn(t);
1486
1494
  return (n, i) => n.slice(o, i ? -1 : void 0) || ".";
1487
1495
  }
1488
1496
  const r = s.slice(t.length + 1);
@@ -1494,7 +1502,7 @@ function It(t, s, e) {
1494
1502
  }
1495
1503
  return e ? (r) => tt.relative(t, r) || "." : (r) => tt.relative(t, `${s}/${r}`) || ".";
1496
1504
  }
1497
- function hn(t, s) {
1505
+ function gn(t, s) {
1498
1506
  if (s.startsWith(`${t}/`)) {
1499
1507
  const e = s.slice(t.length + 1);
1500
1508
  return (r) => `${e}/${r}`;
@@ -1504,110 +1512,110 @@ function hn(t, s) {
1504
1512
  return e[e.length - 1] === "/" && r !== "" ? `${r}/` : r || ".";
1505
1513
  };
1506
1514
  }
1507
- function Nt(t) {
1508
- return t.replace(an, (s) => `${s}/`);
1515
+ function Ft(t) {
1516
+ return t.replace(cn, (s) => `${s}/`);
1509
1517
  }
1510
- const gn = { parts: !0 };
1511
- function re(t) {
1518
+ const dn = { parts: !0 };
1519
+ function ie(t) {
1512
1520
  var s;
1513
- const e = ot.scan(t, gn);
1521
+ const e = at.scan(t, dn);
1514
1522
  return !((s = e.parts) === null || s === void 0) && s.length ? e.parts : [t];
1515
1523
  }
1516
1524
  const yn = /\\(?![()[\]{}!+@])/g;
1517
- function dn(t) {
1518
- return oe(t);
1519
- }
1520
1525
  function An(t) {
1521
- return ie(t).replace(yn, "/");
1526
+ return ue(t);
1527
+ }
1528
+ function Rn(t) {
1529
+ return ae(t).replace(yn, "/");
1522
1530
  }
1523
- const Tn = vt ? An : dn, Rn = new RegExp("(?<!\\\\)([()[\\]{}*?|]|^!|[!+@](?=\\()|\\\\(?![()[\\]{}!*+?@|]))", "g"), _n = new RegExp("(?<!\\\\)([()[\\]{}]|^!|[!+@](?=\\())", "g"), oe = (t) => t.replace(Rn, "\\$&"), ie = (t) => t.replace(_n, "\\$&"), Sn = vt ? ie : oe;
1524
- function En(t, s) {
1531
+ const kn = Ot ? Rn : An, _n = new RegExp("(?<!\\\\)([()[\\]{}*?|]|^!|[!+@](?=\\()|\\\\(?![()[\\]{}!*+?@|]))", "g"), En = new RegExp("(?<!\\\\)([()[\\]{}]|^!|[!+@](?=\\())", "g"), ue = (t) => t.replace(_n, "\\$&"), ae = (t) => t.replace(En, "\\$&"), Sn = Ot ? ae : ue;
1532
+ function bn(t, s) {
1525
1533
  if ((s == null ? void 0 : s.caseSensitiveMatch) === !1) return !0;
1526
- const e = ot.scan(t);
1534
+ const e = at.scan(t);
1527
1535
  return e.isGlob || e.negated;
1528
1536
  }
1529
- function nt(...t) {
1537
+ function it(...t) {
1530
1538
  console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString("es")}]`, ...t);
1531
1539
  }
1532
- function ue(t) {
1540
+ function ce(t) {
1533
1541
  return typeof t == "string" ? [t] : t ?? [];
1534
1542
  }
1535
- const bn = /^(\/?\.\.)+/, mn = /\\(?=[()[\]{}!*+?@|])/g;
1536
- function _t(t, s, e, r) {
1543
+ const mn = /^(\/?\.\.)+/, xn = /\\(?=[()[\]{}!*+?@|])/g;
1544
+ function St(t, s, e, r) {
1537
1545
  var o;
1538
1546
  const n = s.cwd;
1539
1547
  let i = t;
1540
1548
  t[t.length - 1] === "/" && (i = t.slice(0, -1)), i[i.length - 1] !== "*" && s.expandDirectories && (i += "/**");
1541
1549
  const l = Sn(n);
1542
- i = xe(i.replace(mn, "")) ? tt.relative(l, i) : tt.normalize(i);
1543
- const h = (o = bn.exec(i)) === null || o === void 0 ? void 0 : o[0], g = re(i);
1550
+ i = Ce(i.replace(xn, "")) ? tt.relative(l, i) : tt.normalize(i);
1551
+ const h = (o = mn.exec(i)) === null || o === void 0 ? void 0 : o[0], g = ie(i);
1544
1552
  if (h) {
1545
1553
  const A = (h.length + 1) / 3;
1546
- let S = 0;
1554
+ let E = 0;
1547
1555
  const x = l.split("/");
1548
- for (; S < A && g[S + A] === x[x.length + S - A]; )
1549
- i = i.slice(0, (A - S - 1) * 3) + i.slice((A - S) * 3 + g[S + A].length + 1) || ".", S++;
1550
- const y = tt.join(n, h.slice(S * 3));
1551
- y[0] !== "." && e.root.length > y.length && (e.root = Nt(y), e.depthOffset = -A + S);
1556
+ for (; E < A && g[E + A] === x[x.length + E - A]; )
1557
+ i = i.slice(0, (A - E - 1) * 3) + i.slice((A - E) * 3 + g[E + A].length + 1) || ".", E++;
1558
+ const y = tt.join(n, h.slice(E * 3));
1559
+ y[0] !== "." && e.root.length > y.length && (e.root = Ft(y), e.depthOffset = -A + E);
1552
1560
  }
1553
1561
  if (!r && e.depthOffset >= 0) {
1554
1562
  var d;
1555
1563
  (d = e.commonPath) !== null && d !== void 0 || (e.commonPath = g);
1556
- const A = [], S = Math.min(e.commonPath.length, g.length);
1557
- for (let x = 0; x < S; x++) {
1564
+ const A = [], E = Math.min(e.commonPath.length, g.length);
1565
+ for (let x = 0; x < E; x++) {
1558
1566
  const y = g[x];
1559
1567
  if (y === "**" && !g[x + 1]) {
1560
1568
  A.pop();
1561
1569
  break;
1562
1570
  }
1563
- if (x === g.length - 1 || y !== e.commonPath[x] || En(y)) break;
1571
+ if (x === g.length - 1 || y !== e.commonPath[x] || bn(y)) break;
1564
1572
  A.push(y);
1565
1573
  }
1566
- e.depthOffset = A.length, e.commonPath = A, e.root = Nt(A.length > 0 ? tt.join(n, ...A) : n);
1574
+ e.depthOffset = A.length, e.commonPath = A, e.root = Ft(A.length > 0 ? tt.join(n, ...A) : n);
1567
1575
  }
1568
1576
  return i;
1569
1577
  }
1570
- function xn(t, s, e) {
1578
+ function Cn(t, s, e) {
1571
1579
  const r = [], o = [];
1572
1580
  for (const n of t.ignore)
1573
- n && (n[0] !== "!" || n[1] === "(") && o.push(_t(n, t, e, !0));
1581
+ n && (n[0] !== "!" || n[1] === "(") && o.push(St(n, t, e, !0));
1574
1582
  for (const n of s)
1575
- n && (n[0] !== "!" || n[1] === "(" ? r.push(_t(n, t, e, !1)) : (n[1] !== "!" || n[2] === "(") && o.push(_t(n.slice(1), t, e, !0)));
1583
+ n && (n[0] !== "!" || n[1] === "(" ? r.push(St(n, t, e, !1)) : (n[1] !== "!" || n[2] === "(") && o.push(St(n.slice(1), t, e, !0)));
1576
1584
  return {
1577
1585
  match: r,
1578
1586
  ignore: o
1579
1587
  };
1580
1588
  }
1581
- function Cn(t, s) {
1589
+ function $n(t, s) {
1582
1590
  const e = t.cwd, r = {
1583
1591
  root: e,
1584
1592
  depthOffset: 0
1585
- }, o = xn(t, s, r);
1586
- t.debug && nt("internal processing patterns:", o);
1587
- const { absolute: n, caseSensitiveMatch: i, debug: l, dot: h, followSymbolicLinks: g, onlyDirectories: d } = t, A = r.root.replace(ne, ""), S = {
1593
+ }, o = Cn(t, s, r);
1594
+ t.debug && it("internal processing patterns:", o);
1595
+ const { absolute: n, caseSensitiveMatch: i, debug: l, dot: h, followSymbolicLinks: g, onlyDirectories: d } = t, A = r.root.replace(oe, ""), E = {
1588
1596
  dot: h,
1589
1597
  nobrace: t.braceExpansion === !1,
1590
1598
  nocase: !i,
1591
1599
  noextglob: t.extglob === !1,
1592
1600
  noglobstar: t.globstar === !1,
1593
1601
  posix: !0
1594
- }, x = ot(o.match, S), y = ot(o.ignore, S), C = ln(o.match, S), T = It(e, A, n), G = n ? T : It(e, A, !0), _ = (P, O) => {
1595
- const v = G(O, !0);
1602
+ }, x = at(o.match, E), y = at(o.ignore, E), C = fn(o.match, E), T = Bt(e, A, n), W = n ? T : Bt(e, A, !0), _ = (k, O) => {
1603
+ const v = W(O, !0);
1596
1604
  return v !== "." && !C(v) || y(v);
1597
1605
  };
1598
1606
  let M;
1599
1607
  t.deep !== void 0 && (M = Math.round(t.deep - r.depthOffset));
1600
- const X = new Ss({
1601
- filters: [l ? (P, O) => {
1602
- const v = T(P, O), R = x(v) && !y(v);
1603
- return R && nt(`matched ${v}`), R;
1604
- } : (P, O) => {
1605
- const v = T(P, O);
1608
+ const j = new Ss({
1609
+ filters: [l ? (k, O) => {
1610
+ const v = T(k, O), R = x(v) && !y(v);
1611
+ return R && it(`matched ${v}`), R;
1612
+ } : (k, O) => {
1613
+ const v = T(k, O);
1606
1614
  return x(v) && !y(v);
1607
1615
  }],
1608
- exclude: l ? (P, O) => {
1609
- const v = _(P, O);
1610
- return nt(`${v ? "skipped" : "crawling"} ${O}`), v;
1616
+ exclude: l ? (k, O) => {
1617
+ const v = _(k, O);
1618
+ return it(`${v ? "skipped" : "crawling"} ${O}`), v;
1611
1619
  } : _,
1612
1620
  fs: t.fs,
1613
1621
  pathSeparator: "/",
@@ -1621,52 +1629,52 @@ function Cn(t, s) {
1621
1629
  maxDepth: M,
1622
1630
  signal: t.signal
1623
1631
  }).crawl(A);
1624
- return t.debug && nt("internal properties:", {
1632
+ return t.debug && it("internal properties:", {
1625
1633
  ...r,
1626
1634
  root: A
1627
- }), [X, e !== A && !n && hn(e, A)];
1635
+ }), [j, e !== A && !n && gn(e, A)];
1628
1636
  }
1629
- function ae(t, s) {
1637
+ function le(t, s) {
1630
1638
  if (s) for (let e = t.length - 1; e >= 0; e--) t[e] = s(t[e]);
1631
1639
  return t;
1632
1640
  }
1633
- const Bt = {
1641
+ const Mt = {
1634
1642
  caseSensitiveMatch: !0,
1635
1643
  debug: !!process.env.TINYGLOBBY_DEBUG,
1636
1644
  expandDirectories: !0,
1637
1645
  followSymbolicLinks: !0,
1638
1646
  onlyFiles: !0
1639
1647
  };
1640
- function $n(t) {
1648
+ function vn(t) {
1641
1649
  const s = Object.assign({}, t);
1642
- for (const e in Bt) s[e] === void 0 && Object.assign(s, { [e]: Bt[e] });
1643
- return s.cwd = (s.cwd instanceof URL ? Ce(s.cwd) : Mt(s.cwd || process.cwd())).replace(ne, "/"), s.ignore = ue(s.ignore), s.fs && (s.fs = {
1650
+ for (const e in Mt) s[e] === void 0 && Object.assign(s, { [e]: Mt[e] });
1651
+ return s.cwd = (s.cwd instanceof URL ? $e(s.cwd) : Wt(s.cwd || process.cwd())).replace(oe, "/"), s.ignore = ce(s.ignore), s.fs && (s.fs = {
1644
1652
  readdir: s.fs.readdir || Se,
1645
- readdirSync: s.fs.readdirSync || _e,
1646
- realpath: s.fs.realpath || Re,
1647
- realpathSync: s.fs.realpathSync || Ae,
1648
- stat: s.fs.stat || de,
1653
+ readdirSync: s.fs.readdirSync || Ee,
1654
+ realpath: s.fs.realpath || _e,
1655
+ realpathSync: s.fs.realpathSync || Re,
1656
+ stat: s.fs.stat || Ae,
1649
1657
  statSync: s.fs.statSync || ye
1650
- }), s.debug && nt("globbing with options:", s), s;
1658
+ }), s.debug && it("globbing with options:", s), s;
1651
1659
  }
1652
- function ce(t, s = {}) {
1660
+ function fe(t, s = {}) {
1653
1661
  var e;
1654
1662
  if (t && (s != null && s.patterns)) throw new Error("Cannot pass patterns as both an argument and an option");
1655
- const r = un(t) || typeof t == "string", o = ue((e = r ? t : t.patterns) !== null && e !== void 0 ? e : "**/*"), n = $n(r ? s : t);
1656
- return o.length > 0 ? Cn(n, o) : [];
1663
+ const r = an(t) || typeof t == "string", o = ce((e = r ? t : t.patterns) !== null && e !== void 0 ? e : "**/*"), n = vn(r ? s : t);
1664
+ return o.length > 0 ? $n(n, o) : [];
1657
1665
  }
1658
- async function kn(t, s) {
1659
- const [e, r] = ce(t, s);
1660
- return e ? ae(await e.withPromise(), r) : [];
1666
+ async function Pn(t, s) {
1667
+ const [e, r] = fe(t, s);
1668
+ return e ? le(await e.withPromise(), r) : [];
1661
1669
  }
1662
- function Pn(t, s) {
1663
- const [e, r] = ce(t, s);
1664
- return e ? ae(e.sync(), r) : [];
1670
+ function Dn(t, s) {
1671
+ const [e, r] = fe(t, s);
1672
+ return e ? le(e.sync(), r) : [];
1665
1673
  }
1666
1674
  export {
1667
- Tn as convertPathToPattern,
1675
+ kn as convertPathToPattern,
1668
1676
  Sn as escapePath,
1669
- kn as glob,
1670
- Pn as globSync,
1671
- En as isDynamicPattern
1677
+ Pn as glob,
1678
+ Dn as globSync,
1679
+ bn as isDynamicPattern
1672
1680
  };