opfs-worker 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  class g extends Error {
2
- constructor(t, e, n, r) {
3
- super(t, { cause: r }), this.code = e, this.path = n, this.name = "OPFSError";
2
+ constructor(t, e, n, i) {
3
+ super(t, { cause: i }), this.code = e, this.path = n, this.name = "OPFSError";
4
4
  }
5
5
  }
6
6
  class it extends g {
@@ -8,46 +8,46 @@ class it extends g {
8
8
  super("OPFS is not supported in this browser", "OPFS_NOT_SUPPORTED", void 0, t);
9
9
  }
10
10
  }
11
- class ye extends g {
11
+ class me extends g {
12
12
  constructor(t) {
13
13
  super("OPFS is not mounted", "OPFS_NOT_MOUNTED", void 0, t);
14
14
  }
15
15
  }
16
- class Ee extends g {
16
+ class we extends g {
17
17
  constructor(t, e, n) {
18
18
  super(t, "INVALID_PATH", e, n);
19
19
  }
20
20
  }
21
- class Se extends g {
21
+ class ye extends g {
22
22
  constructor(t, e) {
23
23
  super(`File not found: ${t}`, "FILE_NOT_FOUND", t, e);
24
24
  }
25
25
  }
26
- class xe extends g {
26
+ class Ee extends g {
27
27
  constructor(t, e) {
28
28
  super(`Directory not found: ${t}`, "DIRECTORY_NOT_FOUND", t, e);
29
29
  }
30
30
  }
31
- class Oe extends g {
31
+ class Se extends g {
32
32
  constructor(t, e, n) {
33
33
  super(`Permission denied for ${e} on: ${t}`, "PERMISSION_DENIED", t, n);
34
34
  }
35
35
  }
36
- class Ne extends g {
36
+ class xe extends g {
37
37
  constructor(t, e, n) {
38
38
  super(t, "STORAGE_ERROR", e, n);
39
39
  }
40
40
  }
41
- class be extends g {
41
+ class Ne extends g {
42
42
  constructor(t, e, n) {
43
43
  super(`Operation timed out: ${t}`, "TIMEOUT_ERROR", e, n);
44
44
  }
45
45
  }
46
- function Ae(s, t, e, n) {
47
- const r = `${s.toUpperCase()}_FAILED`;
48
- return new g(`Failed to ${s} file descriptor: ${t}`, r, e, n);
46
+ function Oe(s, t, e, n) {
47
+ const i = `${s.toUpperCase()}_FAILED`;
48
+ return new g(`Failed to ${s} file descriptor: ${t}`, i, e, n);
49
49
  }
50
- function ot(s, t) {
50
+ function rt(s, t) {
51
51
  const e = t?.path, n = t?.isDirectory;
52
52
  switch (s.name) {
53
53
  case "InvalidStateError":
@@ -73,101 +73,238 @@ function ot(s, t) {
73
73
  return new g(`I/O error: ${e || "unknown"}`, "EIO", e, s);
74
74
  }
75
75
  }
76
- const H = (s, t, e) => {
77
- const n = s instanceof RegExp ? W(s, e) : s, r = t instanceof RegExp ? W(t, e) : t, i = n !== null && r != null && ct(n, r, e);
78
- return i && {
79
- start: i[0],
80
- end: i[1],
81
- pre: e.slice(0, i[0]),
82
- body: e.slice(i[0] + n.length, i[1]),
83
- post: e.slice(i[1] + r.length)
76
+ const ot = [
77
+ // Images
78
+ ".jpg",
79
+ ".jpeg",
80
+ ".png",
81
+ ".gif",
82
+ ".bmp",
83
+ ".webp",
84
+ ".ico",
85
+ ".tiff",
86
+ ".tga",
87
+ // Audio
88
+ ".mp3",
89
+ ".wav",
90
+ ".ogg",
91
+ ".flac",
92
+ ".aac",
93
+ ".wma",
94
+ ".m4a",
95
+ // Video
96
+ ".mp4",
97
+ ".avi",
98
+ ".mov",
99
+ ".wmv",
100
+ ".flv",
101
+ ".webm",
102
+ ".mkv",
103
+ ".m4v",
104
+ // Documents
105
+ ".pdf",
106
+ ".doc",
107
+ ".docx",
108
+ ".xls",
109
+ ".xlsx",
110
+ ".ppt",
111
+ ".pptx",
112
+ // Archives
113
+ ".zip",
114
+ ".rar",
115
+ ".7z",
116
+ ".tar",
117
+ ".gz",
118
+ ".bz2",
119
+ // Executables
120
+ ".exe",
121
+ ".dll",
122
+ ".so",
123
+ ".dylib",
124
+ // Other binary formats
125
+ ".dat",
126
+ ".db",
127
+ ".sqlite",
128
+ ".bin",
129
+ ".obj",
130
+ ".fbx",
131
+ ".3ds"
132
+ ];
133
+ function be(s) {
134
+ const t = s.lastIndexOf(".");
135
+ if (t <= 0)
136
+ return !0;
137
+ const e = s.slice(t).toLowerCase();
138
+ return ot.includes(e);
139
+ }
140
+ function ct(s, t = "utf-8") {
141
+ switch (t) {
142
+ case "utf8":
143
+ case "utf-8":
144
+ return new TextEncoder().encode(s);
145
+ case "utf16le":
146
+ case "utf-16le":
147
+ case "ucs2":
148
+ case "ucs-2":
149
+ return at(s);
150
+ case "ascii":
151
+ return ut(s);
152
+ case "latin1":
153
+ return lt(s);
154
+ case "binary":
155
+ return Uint8Array.from(s, (e) => e.charCodeAt(0));
156
+ case "base64":
157
+ return Uint8Array.from(atob(s), (e) => e.charCodeAt(0));
158
+ case "hex":
159
+ if (!/^[\da-f]+$/i.test(s) || s.length % 2 !== 0)
160
+ throw new g("Invalid hex string", "INVALID_HEX_FORMAT");
161
+ return Uint8Array.from(s.match(/.{1,2}/g).map((e) => parseInt(e, 16)));
162
+ default:
163
+ return console.warn("Encoding not supported, falling back to UTF-8"), new TextEncoder().encode(s);
164
+ }
165
+ }
166
+ function Ae(s, t = "utf-8") {
167
+ switch (t) {
168
+ case "utf8":
169
+ case "utf-8":
170
+ return new TextDecoder().decode(s);
171
+ case "utf16le":
172
+ case "utf-16le":
173
+ case "ucs2":
174
+ case "ucs-2":
175
+ return ht(s);
176
+ case "latin1":
177
+ return String.fromCharCode(...s);
178
+ case "ascii":
179
+ return String.fromCharCode(...s.map((e) => e & 127));
180
+ case "base64":
181
+ return btoa(String.fromCharCode(...s));
182
+ case "hex":
183
+ return Array.from(s).map((e) => e.toString(16).padStart(2, "0")).join("");
184
+ default:
185
+ return console.warn("Unsupported encoding, falling back to UTF-8"), new TextDecoder().decode(s);
186
+ }
187
+ }
188
+ function at(s) {
189
+ const t = new Uint8Array(s.length * 2);
190
+ for (let e = 0; e < s.length; e++) {
191
+ const n = s.charCodeAt(e);
192
+ t[e * 2] = n & 255, t[e * 2 + 1] = n >> 8;
193
+ }
194
+ return t;
195
+ }
196
+ function ht(s) {
197
+ s.length % 2 !== 0 && (console.warn("Invalid UTF-16LE buffer length, truncating last byte"), s = s.slice(0, s.length - 1));
198
+ const t = new Uint16Array(s.buffer, s.byteOffset, s.byteLength / 2);
199
+ return String.fromCharCode(...t);
200
+ }
201
+ function lt(s) {
202
+ const t = new Uint8Array(s.length);
203
+ for (let e = 0; e < s.length; e++)
204
+ t[e] = s.charCodeAt(e) & 255;
205
+ return t;
206
+ }
207
+ function ut(s) {
208
+ const t = new Uint8Array(s.length);
209
+ for (let e = 0; e < s.length; e++)
210
+ t[e] = s.charCodeAt(e) & 127;
211
+ return t;
212
+ }
213
+ const G = (s, t, e) => {
214
+ const n = s instanceof RegExp ? W(s, e) : s, i = t instanceof RegExp ? W(t, e) : t, r = n !== null && i != null && ft(n, i, e);
215
+ return r && {
216
+ start: r[0],
217
+ end: r[1],
218
+ pre: e.slice(0, r[0]),
219
+ body: e.slice(r[0] + n.length, r[1]),
220
+ post: e.slice(r[1] + i.length)
84
221
  };
85
222
  }, W = (s, t) => {
86
223
  const e = t.match(s);
87
224
  return e ? e[0] : null;
88
- }, ct = (s, t, e) => {
89
- let n, r, i, o, l, a = e.indexOf(s), h = e.indexOf(t, a + 1), c = a;
90
- if (a >= 0 && h > 0) {
225
+ }, ft = (s, t, e) => {
226
+ let n, i, r, o, a, h = e.indexOf(s), l = e.indexOf(t, h + 1), c = h;
227
+ if (h >= 0 && l > 0) {
91
228
  if (s === t)
92
- return [a, h];
93
- for (n = [], i = e.length; c >= 0 && !l; ) {
94
- if (c === a)
95
- n.push(c), a = e.indexOf(s, c + 1);
229
+ return [h, l];
230
+ for (n = [], r = e.length; c >= 0 && !a; ) {
231
+ if (c === h)
232
+ n.push(c), h = e.indexOf(s, c + 1);
96
233
  else if (n.length === 1) {
97
234
  const p = n.pop();
98
- p !== void 0 && (l = [p, h]);
235
+ p !== void 0 && (a = [p, l]);
99
236
  } else
100
- r = n.pop(), r !== void 0 && r < i && (i = r, o = h), h = e.indexOf(t, c + 1);
101
- c = a < h && a >= 0 ? a : h;
237
+ i = n.pop(), i !== void 0 && i < r && (r = i, o = l), l = e.indexOf(t, c + 1);
238
+ c = h < l && h >= 0 ? h : l;
102
239
  }
103
- n.length && o !== void 0 && (l = [i, o]);
240
+ n.length && o !== void 0 && (a = [r, o]);
104
241
  }
105
- return l;
106
- }, V = "\0SLASH" + Math.random() + "\0", Z = "\0OPEN" + Math.random() + "\0", L = "\0CLOSE" + Math.random() + "\0", Y = "\0COMMA" + Math.random() + "\0", J = "\0PERIOD" + Math.random() + "\0", at = new RegExp(V, "g"), lt = new RegExp(Z, "g"), ht = new RegExp(L, "g"), ut = new RegExp(Y, "g"), ft = new RegExp(J, "g"), pt = /\\\\/g, dt = /\\{/g, gt = /\\}/g, mt = /\\,/g, wt = /\\./g;
242
+ return a;
243
+ }, H = "\0SLASH" + Math.random() + "\0", V = "\0OPEN" + Math.random() + "\0", L = "\0CLOSE" + Math.random() + "\0", Z = "\0COMMA" + Math.random() + "\0", Y = "\0PERIOD" + Math.random() + "\0", pt = new RegExp(H, "g"), dt = new RegExp(V, "g"), gt = new RegExp(L, "g"), mt = new RegExp(Z, "g"), wt = new RegExp(Y, "g"), yt = /\\\\/g, Et = /\\{/g, St = /\\}/g, xt = /\\,/g, Nt = /\\./g;
107
244
  function D(s) {
108
245
  return isNaN(s) ? s.charCodeAt(0) : parseInt(s, 10);
109
246
  }
110
- function yt(s) {
111
- return s.replace(pt, V).replace(dt, Z).replace(gt, L).replace(mt, Y).replace(wt, J);
247
+ function Ot(s) {
248
+ return s.replace(yt, H).replace(Et, V).replace(St, L).replace(xt, Z).replace(Nt, Y);
112
249
  }
113
- function Et(s) {
114
- return s.replace(at, "\\").replace(lt, "{").replace(ht, "}").replace(ut, ",").replace(ft, ".");
250
+ function bt(s) {
251
+ return s.replace(pt, "\\").replace(dt, "{").replace(gt, "}").replace(mt, ",").replace(wt, ".");
115
252
  }
116
- function X(s) {
253
+ function J(s) {
117
254
  if (!s)
118
255
  return [""];
119
- const t = [], e = H("{", "}", s);
256
+ const t = [], e = G("{", "}", s);
120
257
  if (!e)
121
258
  return s.split(",");
122
- const { pre: n, body: r, post: i } = e, o = n.split(",");
123
- o[o.length - 1] += "{" + r + "}";
124
- const l = X(i);
125
- return i.length && (o[o.length - 1] += l.shift(), o.push.apply(o, l)), t.push.apply(t, o), t;
259
+ const { pre: n, body: i, post: r } = e, o = n.split(",");
260
+ o[o.length - 1] += "{" + i + "}";
261
+ const a = J(r);
262
+ return r.length && (o[o.length - 1] += a.shift(), o.push.apply(o, a)), t.push.apply(t, o), t;
126
263
  }
127
- function St(s) {
128
- return s ? (s.slice(0, 2) === "{}" && (s = "\\{\\}" + s.slice(2)), T(yt(s), !0).map(Et)) : [];
264
+ function At(s) {
265
+ return s ? (s.slice(0, 2) === "{}" && (s = "\\{\\}" + s.slice(2)), T(Ot(s), !0).map(bt)) : [];
129
266
  }
130
- function xt(s) {
267
+ function vt(s) {
131
268
  return "{" + s + "}";
132
269
  }
133
- function Ot(s) {
270
+ function $t(s) {
134
271
  return /^-?0\d/.test(s);
135
272
  }
136
- function Nt(s, t) {
273
+ function Tt(s, t) {
137
274
  return s <= t;
138
275
  }
139
- function bt(s, t) {
276
+ function Mt(s, t) {
140
277
  return s >= t;
141
278
  }
142
279
  function T(s, t) {
143
- const e = [], n = H("{", "}", s);
280
+ const e = [], n = G("{", "}", s);
144
281
  if (!n)
145
282
  return [s];
146
- const r = n.pre, i = n.post.length ? T(n.post, !1) : [""];
283
+ const i = n.pre, r = n.post.length ? T(n.post, !1) : [""];
147
284
  if (/\$$/.test(n.pre))
148
- for (let o = 0; o < i.length; o++) {
149
- const l = r + "{" + n.body + "}" + i[o];
150
- e.push(l);
285
+ for (let o = 0; o < r.length; o++) {
286
+ const a = i + "{" + n.body + "}" + r[o];
287
+ e.push(a);
151
288
  }
152
289
  else {
153
- const o = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body), l = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body), a = o || l, h = n.body.indexOf(",") >= 0;
154
- if (!a && !h)
290
+ const o = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body), a = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body), h = o || a, l = n.body.indexOf(",") >= 0;
291
+ if (!h && !l)
155
292
  return n.post.match(/,(?!,).*\}/) ? (s = n.pre + "{" + n.body + L + n.post, T(s)) : [s];
156
293
  let c;
157
- if (a)
294
+ if (h)
158
295
  c = n.body.split(/\.\./);
159
- else if (c = X(n.body), c.length === 1 && c[0] !== void 0 && (c = T(c[0], !1).map(xt), c.length === 1))
160
- return i.map((f) => n.pre + c[0] + f);
296
+ else if (c = J(n.body), c.length === 1 && c[0] !== void 0 && (c = T(c[0], !1).map(vt), c.length === 1))
297
+ return r.map((f) => n.pre + c[0] + f);
161
298
  let p;
162
- if (a && c[0] !== void 0 && c[1] !== void 0) {
299
+ if (h && c[0] !== void 0 && c[1] !== void 0) {
163
300
  const f = D(c[0]), u = D(c[1]), m = Math.max(c[0].length, c[1].length);
164
- let d = c.length === 3 && c[2] !== void 0 ? Math.abs(D(c[2])) : 1, S = Nt;
165
- u < f && (d *= -1, S = bt);
166
- const A = c.some(Ot);
301
+ let d = c.length === 3 && c[2] !== void 0 ? Math.abs(D(c[2])) : 1, S = Tt;
302
+ u < f && (d *= -1, S = Mt);
303
+ const A = c.some($t);
167
304
  p = [];
168
305
  for (let x = f; S(x, u); x += d) {
169
306
  let w;
170
- if (l)
307
+ if (a)
171
308
  w = String.fromCharCode(x), w === "\\" && (w = "");
172
309
  else if (w = String(x), A) {
173
310
  const v = m - w.length;
@@ -184,19 +321,19 @@ function T(s, t) {
184
321
  p.push.apply(p, T(c[f], !1));
185
322
  }
186
323
  for (let f = 0; f < p.length; f++)
187
- for (let u = 0; u < i.length; u++) {
188
- const m = r + p[f] + i[u];
189
- (!t || a || m) && e.push(m);
324
+ for (let u = 0; u < r.length; u++) {
325
+ const m = i + p[f] + r[u];
326
+ (!t || h || m) && e.push(m);
190
327
  }
191
328
  }
192
329
  return e;
193
330
  }
194
- const At = 1024 * 64, C = (s) => {
331
+ const Pt = 1024 * 64, C = (s) => {
195
332
  if (typeof s != "string")
196
333
  throw new TypeError("invalid pattern");
197
- if (s.length > At)
334
+ if (s.length > Pt)
198
335
  throw new TypeError("pattern is too long");
199
- }, vt = {
336
+ }, Rt = {
200
337
  "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", !0],
201
338
  "[:alpha:]": ["\\p{L}\\p{Nl}", !0],
202
339
  "[:ascii:]": ["\\x00-\\x7f", !1],
@@ -211,77 +348,77 @@ const At = 1024 * 64, C = (s) => {
211
348
  "[:upper:]": ["\\p{Lu}", !0],
212
349
  "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", !0],
213
350
  "[:xdigit:]": ["A-Fa-f0-9", !1]
214
- }, $ = (s) => s.replace(/[[\]\\-]/g, "\\$&"), $t = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), j = (s) => s.join(""), Tt = (s, t) => {
351
+ }, $ = (s) => s.replace(/[[\]\\-]/g, "\\$&"), Ct = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), j = (s) => s.join(""), It = (s, t) => {
215
352
  const e = t;
216
353
  if (s.charAt(e) !== "[")
217
354
  throw new Error("not in a brace expression");
218
- const n = [], r = [];
219
- let i = e + 1, o = !1, l = !1, a = !1, h = !1, c = e, p = "";
220
- t: for (; i < s.length; ) {
221
- const d = s.charAt(i);
222
- if ((d === "!" || d === "^") && i === e + 1) {
223
- h = !0, i++;
355
+ const n = [], i = [];
356
+ let r = e + 1, o = !1, a = !1, h = !1, l = !1, c = e, p = "";
357
+ t: for (; r < s.length; ) {
358
+ const d = s.charAt(r);
359
+ if ((d === "!" || d === "^") && r === e + 1) {
360
+ l = !0, r++;
224
361
  continue;
225
362
  }
226
- if (d === "]" && o && !a) {
227
- c = i + 1;
363
+ if (d === "]" && o && !h) {
364
+ c = r + 1;
228
365
  break;
229
366
  }
230
- if (o = !0, d === "\\" && !a) {
231
- a = !0, i++;
367
+ if (o = !0, d === "\\" && !h) {
368
+ h = !0, r++;
232
369
  continue;
233
370
  }
234
- if (d === "[" && !a) {
235
- for (const [S, [b, A, x]] of Object.entries(vt))
236
- if (s.startsWith(S, i)) {
371
+ if (d === "[" && !h) {
372
+ for (const [S, [b, A, x]] of Object.entries(Rt))
373
+ if (s.startsWith(S, r)) {
237
374
  if (p)
238
375
  return ["$.", !1, s.length - e, !0];
239
- i += S.length, x ? r.push(b) : n.push(b), l = l || A;
376
+ r += S.length, x ? i.push(b) : n.push(b), a = a || A;
240
377
  continue t;
241
378
  }
242
379
  }
243
- if (a = !1, p) {
244
- d > p ? n.push($(p) + "-" + $(d)) : d === p && n.push($(d)), p = "", i++;
380
+ if (h = !1, p) {
381
+ d > p ? n.push($(p) + "-" + $(d)) : d === p && n.push($(d)), p = "", r++;
245
382
  continue;
246
383
  }
247
- if (s.startsWith("-]", i + 1)) {
248
- n.push($(d + "-")), i += 2;
384
+ if (s.startsWith("-]", r + 1)) {
385
+ n.push($(d + "-")), r += 2;
249
386
  continue;
250
387
  }
251
- if (s.startsWith("-", i + 1)) {
252
- p = d, i += 2;
388
+ if (s.startsWith("-", r + 1)) {
389
+ p = d, r += 2;
253
390
  continue;
254
391
  }
255
- n.push($(d)), i++;
392
+ n.push($(d)), r++;
256
393
  }
257
- if (c < i)
394
+ if (c < r)
258
395
  return ["", !1, 0, !1];
259
- if (!n.length && !r.length)
396
+ if (!n.length && !i.length)
260
397
  return ["$.", !1, s.length - e, !0];
261
- if (r.length === 0 && n.length === 1 && /^\\?.$/.test(n[0]) && !h) {
398
+ if (i.length === 0 && n.length === 1 && /^\\?.$/.test(n[0]) && !l) {
262
399
  const d = n[0].length === 2 ? n[0].slice(-1) : n[0];
263
- return [$t(d), !1, c - e, !1];
400
+ return [Ct(d), !1, c - e, !1];
264
401
  }
265
- const f = "[" + (h ? "^" : "") + j(n) + "]", u = "[" + (h ? "" : "^") + j(r) + "]";
266
- return [n.length && r.length ? "(" + f + "|" + u + ")" : n.length ? f : u, l, c - e, !0];
267
- }, M = (s, { windowsPathsNoEscape: t = !1 } = {}) => t ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1"), Mt = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), z = (s) => Mt.has(s), Pt = "(?!(?:^|/)\\.\\.?(?:$|/))", R = "(?!\\.)", Rt = /* @__PURE__ */ new Set(["[", "."]), Ct = /* @__PURE__ */ new Set(["..", "."]), It = new Set("().*{}+?[]^$\\!"), Dt = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), F = "[^/]", _ = F + "*?", B = F + "+?";
402
+ const f = "[" + (l ? "^" : "") + j(n) + "]", u = "[" + (l ? "" : "^") + j(i) + "]";
403
+ return [n.length && i.length ? "(" + f + "|" + u + ")" : n.length ? f : u, a, c - e, !0];
404
+ }, M = (s, { windowsPathsNoEscape: t = !1 } = {}) => t ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1"), Dt = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), U = (s) => Dt.has(s), Lt = "(?!(?:^|/)\\.\\.?(?:$|/))", R = "(?!\\.)", kt = /* @__PURE__ */ new Set(["[", "."]), Ft = /* @__PURE__ */ new Set(["..", "."]), Wt = new Set("().*{}+?[]^$\\!"), jt = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), k = "[^/]", z = k + "*?", _ = k + "+?";
268
405
  class E {
269
406
  type;
270
407
  #s;
271
408
  #n;
272
- #i = !1;
409
+ #r = !1;
273
410
  #t = [];
274
411
  #e;
275
412
  #o;
276
413
  #a;
277
414
  #c = !1;
278
- #r;
279
- #l;
415
+ #i;
416
+ #h;
280
417
  // set to true if it's an extglob with no children
281
418
  // (which really means one child of '')
282
419
  #u = !1;
283
420
  constructor(t, e, n = {}) {
284
- this.type = t, t && (this.#n = !0), this.#e = e, this.#s = this.#e ? this.#e.#s : this, this.#r = this.#s === this ? n : this.#s.#r, this.#a = this.#s === this ? [] : this.#s.#a, t === "!" && !this.#s.#c && this.#a.push(this), this.#o = this.#e ? this.#e.#t.length : 0;
421
+ this.type = t, t && (this.#n = !0), this.#e = e, this.#s = this.#e ? this.#e.#s : this, this.#i = this.#s === this ? n : this.#s.#i, this.#a = this.#s === this ? [] : this.#s.#a, t === "!" && !this.#s.#c && this.#a.push(this), this.#o = this.#e ? this.#e.#t.length : 0;
285
422
  }
286
423
  get hasMagic() {
287
424
  if (this.#n !== void 0)
@@ -293,7 +430,7 @@ class E {
293
430
  }
294
431
  // reconstructs the pattern
295
432
  toString() {
296
- return this.#l !== void 0 ? this.#l : this.type ? this.#l = this.type + "(" + this.#t.map((t) => String(t)).join("|") + ")" : this.#l = this.#t.map((t) => String(t)).join("");
433
+ return this.#h !== void 0 ? this.#h : this.type ? this.#h = this.type + "(" + this.#t.map((t) => String(t)).join("|") + ")" : this.#h = this.#t.map((t) => String(t)).join("");
297
434
  }
298
435
  #p() {
299
436
  if (this !== this.#s)
@@ -307,11 +444,11 @@ class E {
307
444
  continue;
308
445
  let e = t, n = e.#e;
309
446
  for (; n; ) {
310
- for (let r = e.#o + 1; !n.type && r < n.#t.length; r++)
311
- for (const i of t.#t) {
312
- if (typeof i == "string")
447
+ for (let i = e.#o + 1; !n.type && i < n.#t.length; i++)
448
+ for (const r of t.#t) {
449
+ if (typeof r == "string")
313
450
  throw new Error("string part in extglob AST??");
314
- i.copyIn(n.#t[r]);
451
+ r.copyIn(n.#t[i]);
315
452
  }
316
453
  e = n, n = e.#e;
317
454
  }
@@ -364,53 +501,53 @@ class E {
364
501
  e.copyIn(n);
365
502
  return e;
366
503
  }
367
- static #h(t, e, n, r) {
368
- let i = !1, o = !1, l = -1, a = !1;
504
+ static #l(t, e, n, i) {
505
+ let r = !1, o = !1, a = -1, h = !1;
369
506
  if (e.type === null) {
370
507
  let u = n, m = "";
371
508
  for (; u < t.length; ) {
372
509
  const d = t.charAt(u++);
373
- if (i || d === "\\") {
374
- i = !i, m += d;
510
+ if (r || d === "\\") {
511
+ r = !r, m += d;
375
512
  continue;
376
513
  }
377
514
  if (o) {
378
- u === l + 1 ? (d === "^" || d === "!") && (a = !0) : d === "]" && !(u === l + 2 && a) && (o = !1), m += d;
515
+ u === a + 1 ? (d === "^" || d === "!") && (h = !0) : d === "]" && !(u === a + 2 && h) && (o = !1), m += d;
379
516
  continue;
380
517
  } else if (d === "[") {
381
- o = !0, l = u, a = !1, m += d;
518
+ o = !0, a = u, h = !1, m += d;
382
519
  continue;
383
520
  }
384
- if (!r.noext && z(d) && t.charAt(u) === "(") {
521
+ if (!i.noext && U(d) && t.charAt(u) === "(") {
385
522
  e.push(m), m = "";
386
523
  const S = new E(d, e);
387
- u = E.#h(t, S, u, r), e.push(S);
524
+ u = E.#l(t, S, u, i), e.push(S);
388
525
  continue;
389
526
  }
390
527
  m += d;
391
528
  }
392
529
  return e.push(m), u;
393
530
  }
394
- let h = n + 1, c = new E(null, e);
531
+ let l = n + 1, c = new E(null, e);
395
532
  const p = [];
396
533
  let f = "";
397
- for (; h < t.length; ) {
398
- const u = t.charAt(h++);
399
- if (i || u === "\\") {
400
- i = !i, f += u;
534
+ for (; l < t.length; ) {
535
+ const u = t.charAt(l++);
536
+ if (r || u === "\\") {
537
+ r = !r, f += u;
401
538
  continue;
402
539
  }
403
540
  if (o) {
404
- h === l + 1 ? (u === "^" || u === "!") && (a = !0) : u === "]" && !(h === l + 2 && a) && (o = !1), f += u;
541
+ l === a + 1 ? (u === "^" || u === "!") && (h = !0) : u === "]" && !(l === a + 2 && h) && (o = !1), f += u;
405
542
  continue;
406
543
  } else if (u === "[") {
407
- o = !0, l = h, a = !1, f += u;
544
+ o = !0, a = l, h = !1, f += u;
408
545
  continue;
409
546
  }
410
- if (z(u) && t.charAt(h) === "(") {
547
+ if (U(u) && t.charAt(l) === "(") {
411
548
  c.push(f), f = "";
412
549
  const m = new E(u, c);
413
- c.push(m), h = E.#h(t, m, h, r);
550
+ c.push(m), l = E.#l(t, m, l, i);
414
551
  continue;
415
552
  }
416
553
  if (u === "|") {
@@ -418,31 +555,31 @@ class E {
418
555
  continue;
419
556
  }
420
557
  if (u === ")")
421
- return f === "" && e.#t.length === 0 && (e.#u = !0), c.push(f), f = "", e.push(...p, c), h;
558
+ return f === "" && e.#t.length === 0 && (e.#u = !0), c.push(f), f = "", e.push(...p, c), l;
422
559
  f += u;
423
560
  }
424
- return e.type = null, e.#n = void 0, e.#t = [t.substring(n - 1)], h;
561
+ return e.type = null, e.#n = void 0, e.#t = [t.substring(n - 1)], l;
425
562
  }
426
563
  static fromGlob(t, e = {}) {
427
564
  const n = new E(null, void 0, e);
428
- return E.#h(t, n, 0, e), n;
565
+ return E.#l(t, n, 0, e), n;
429
566
  }
430
567
  // returns the regular expression if there's magic, or the unescaped
431
568
  // string if not.
432
569
  toMMPattern() {
433
570
  if (this !== this.#s)
434
571
  return this.#s.toMMPattern();
435
- const t = this.toString(), [e, n, r, i] = this.toRegExpSource();
436
- if (!(r || this.#n || this.#r.nocase && !this.#r.nocaseMagicOnly && t.toUpperCase() !== t.toLowerCase()))
572
+ const t = this.toString(), [e, n, i, r] = this.toRegExpSource();
573
+ if (!(i || this.#n || this.#i.nocase && !this.#i.nocaseMagicOnly && t.toUpperCase() !== t.toLowerCase()))
437
574
  return n;
438
- const l = (this.#r.nocase ? "i" : "") + (i ? "u" : "");
439
- return Object.assign(new RegExp(`^${e}$`, l), {
575
+ const a = (this.#i.nocase ? "i" : "") + (r ? "u" : "");
576
+ return Object.assign(new RegExp(`^${e}$`, a), {
440
577
  _src: e,
441
578
  _glob: t
442
579
  });
443
580
  }
444
581
  get options() {
445
- return this.#r;
582
+ return this.#i;
446
583
  }
447
584
  // returns the string match, the regexp source, whether there's magic
448
585
  // in the regexp (so a regular expression is required) and whether or
@@ -514,167 +651,167 @@ class E {
514
651
  // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
515
652
  // or start or whatever) and prepend ^ or / at the Regexp construction.
516
653
  toRegExpSource(t) {
517
- const e = t ?? !!this.#r.dot;
654
+ const e = t ?? !!this.#i.dot;
518
655
  if (this.#s === this && this.#p(), !this.type) {
519
- const a = this.isStart() && this.isEnd(), h = this.#t.map((u) => {
520
- const [m, d, S, b] = typeof u == "string" ? E.#d(u, this.#n, a) : u.toRegExpSource(t);
521
- return this.#n = this.#n || S, this.#i = this.#i || b, m;
656
+ const h = this.isStart() && this.isEnd(), l = this.#t.map((u) => {
657
+ const [m, d, S, b] = typeof u == "string" ? E.#d(u, this.#n, h) : u.toRegExpSource(t);
658
+ return this.#n = this.#n || S, this.#r = this.#r || b, m;
522
659
  }).join("");
523
660
  let c = "";
524
- if (this.isStart() && typeof this.#t[0] == "string" && !(this.#t.length === 1 && Ct.has(this.#t[0]))) {
525
- const m = Rt, d = (
661
+ if (this.isStart() && typeof this.#t[0] == "string" && !(this.#t.length === 1 && Ft.has(this.#t[0]))) {
662
+ const m = kt, d = (
526
663
  // dots are allowed, and the pattern starts with [ or .
527
- e && m.has(h.charAt(0)) || // the pattern starts with \., and then [ or .
528
- h.startsWith("\\.") && m.has(h.charAt(2)) || // the pattern starts with \.\., and then [ or .
529
- h.startsWith("\\.\\.") && m.has(h.charAt(4))
530
- ), S = !e && !t && m.has(h.charAt(0));
531
- c = d ? Pt : S ? R : "";
664
+ e && m.has(l.charAt(0)) || // the pattern starts with \., and then [ or .
665
+ l.startsWith("\\.") && m.has(l.charAt(2)) || // the pattern starts with \.\., and then [ or .
666
+ l.startsWith("\\.\\.") && m.has(l.charAt(4))
667
+ ), S = !e && !t && m.has(l.charAt(0));
668
+ c = d ? Lt : S ? R : "";
532
669
  }
533
670
  let p = "";
534
671
  return this.isEnd() && this.#s.#c && this.#e?.type === "!" && (p = "(?:$|\\/)"), [
535
- c + h + p,
536
- M(h),
672
+ c + l + p,
673
+ M(l),
537
674
  this.#n = !!this.#n,
538
- this.#i
675
+ this.#r
539
676
  ];
540
677
  }
541
- const n = this.type === "*" || this.type === "+", r = this.type === "!" ? "(?:(?!(?:" : "(?:";
542
- let i = this.#f(e);
543
- if (this.isStart() && this.isEnd() && !i && this.type !== "!") {
544
- const a = this.toString();
545
- return this.#t = [a], this.type = null, this.#n = void 0, [a, M(this.toString()), !1, !1];
678
+ const n = this.type === "*" || this.type === "+", i = this.type === "!" ? "(?:(?!(?:" : "(?:";
679
+ let r = this.#f(e);
680
+ if (this.isStart() && this.isEnd() && !r && this.type !== "!") {
681
+ const h = this.toString();
682
+ return this.#t = [h], this.type = null, this.#n = void 0, [h, M(this.toString()), !1, !1];
546
683
  }
547
684
  let o = !n || t || e || !R ? "" : this.#f(!0);
548
- o === i && (o = ""), o && (i = `(?:${i})(?:${o})*?`);
549
- let l = "";
685
+ o === r && (o = ""), o && (r = `(?:${r})(?:${o})*?`);
686
+ let a = "";
550
687
  if (this.type === "!" && this.#u)
551
- l = (this.isStart() && !e ? R : "") + B;
688
+ a = (this.isStart() && !e ? R : "") + _;
552
689
  else {
553
- const a = this.type === "!" ? (
690
+ const h = this.type === "!" ? (
554
691
  // !() must match something,but !(x) can match ''
555
- "))" + (this.isStart() && !e && !t ? R : "") + _ + ")"
692
+ "))" + (this.isStart() && !e && !t ? R : "") + z + ")"
556
693
  ) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && o ? ")" : this.type === "*" && o ? ")?" : `)${this.type}`;
557
- l = r + i + a;
694
+ a = i + r + h;
558
695
  }
559
696
  return [
560
- l,
561
- M(i),
697
+ a,
698
+ M(r),
562
699
  this.#n = !!this.#n,
563
- this.#i
700
+ this.#r
564
701
  ];
565
702
  }
566
703
  #f(t) {
567
704
  return this.#t.map((e) => {
568
705
  if (typeof e == "string")
569
706
  throw new Error("string type in extglob ast??");
570
- const [n, r, i, o] = e.toRegExpSource(t);
571
- return this.#i = this.#i || o, n;
707
+ const [n, i, r, o] = e.toRegExpSource(t);
708
+ return this.#r = this.#r || o, n;
572
709
  }).filter((e) => !(this.isStart() && this.isEnd()) || !!e).join("|");
573
710
  }
574
711
  static #d(t, e, n = !1) {
575
- let r = !1, i = "", o = !1;
576
- for (let l = 0; l < t.length; l++) {
577
- const a = t.charAt(l);
578
- if (r) {
579
- r = !1, i += (It.has(a) ? "\\" : "") + a;
712
+ let i = !1, r = "", o = !1;
713
+ for (let a = 0; a < t.length; a++) {
714
+ const h = t.charAt(a);
715
+ if (i) {
716
+ i = !1, r += (Wt.has(h) ? "\\" : "") + h;
580
717
  continue;
581
718
  }
582
- if (a === "\\") {
583
- l === t.length - 1 ? i += "\\\\" : r = !0;
719
+ if (h === "\\") {
720
+ a === t.length - 1 ? r += "\\\\" : i = !0;
584
721
  continue;
585
722
  }
586
- if (a === "[") {
587
- const [h, c, p, f] = Tt(t, l);
723
+ if (h === "[") {
724
+ const [l, c, p, f] = It(t, a);
588
725
  if (p) {
589
- i += h, o = o || c, l += p - 1, e = e || f;
726
+ r += l, o = o || c, a += p - 1, e = e || f;
590
727
  continue;
591
728
  }
592
729
  }
593
- if (a === "*") {
594
- n && t === "*" ? i += B : i += _, e = !0;
730
+ if (h === "*") {
731
+ n && t === "*" ? r += _ : r += z, e = !0;
595
732
  continue;
596
733
  }
597
- if (a === "?") {
598
- i += F, e = !0;
734
+ if (h === "?") {
735
+ r += k, e = !0;
599
736
  continue;
600
737
  }
601
- i += Dt(a);
738
+ r += jt(h);
602
739
  }
603
- return [i, M(t), !!e, o];
740
+ return [r, M(t), !!e, o];
604
741
  }
605
742
  }
606
- const Lt = (s, { windowsPathsNoEscape: t = !1 } = {}) => t ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&"), y = (s, t, e = {}) => (C(t), !e.nocomment && t.charAt(0) === "#" ? !1 : new I(t, e).match(s)), Ft = /^\*+([^+@!?\*\[\(]*)$/, kt = (s) => (t) => !t.startsWith(".") && t.endsWith(s), Ut = (s) => (t) => t.endsWith(s), Wt = (s) => (s = s.toLowerCase(), (t) => !t.startsWith(".") && t.toLowerCase().endsWith(s)), jt = (s) => (s = s.toLowerCase(), (t) => t.toLowerCase().endsWith(s)), zt = /^\*+\.\*+$/, _t = (s) => !s.startsWith(".") && s.includes("."), Bt = (s) => s !== "." && s !== ".." && s.includes("."), qt = /^\.\*+$/, Gt = (s) => s !== "." && s !== ".." && s.startsWith("."), Ht = /^\*+$/, Vt = (s) => s.length !== 0 && !s.startsWith("."), Zt = (s) => s.length !== 0 && s !== "." && s !== "..", Yt = /^\?+([^+@!?\*\[\(]*)?$/, Jt = ([s, t = ""]) => {
607
- const e = Q([s]);
743
+ const Ut = (s, { windowsPathsNoEscape: t = !1 } = {}) => t ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&"), y = (s, t, e = {}) => (C(t), !e.nocomment && t.charAt(0) === "#" ? !1 : new I(t, e).match(s)), zt = /^\*+([^+@!?\*\[\(]*)$/, _t = (s) => (t) => !t.startsWith(".") && t.endsWith(s), Bt = (s) => (t) => t.endsWith(s), qt = (s) => (s = s.toLowerCase(), (t) => !t.startsWith(".") && t.toLowerCase().endsWith(s)), Gt = (s) => (s = s.toLowerCase(), (t) => t.toLowerCase().endsWith(s)), Ht = /^\*+\.\*+$/, Vt = (s) => !s.startsWith(".") && s.includes("."), Zt = (s) => s !== "." && s !== ".." && s.includes("."), Yt = /^\.\*+$/, Jt = (s) => s !== "." && s !== ".." && s.startsWith("."), Xt = /^\*+$/, Qt = (s) => s.length !== 0 && !s.startsWith("."), Kt = (s) => s.length !== 0 && s !== "." && s !== "..", te = /^\?+([^+@!?\*\[\(]*)?$/, ee = ([s, t = ""]) => {
744
+ const e = X([s]);
608
745
  return t ? (t = t.toLowerCase(), (n) => e(n) && n.toLowerCase().endsWith(t)) : e;
609
- }, Xt = ([s, t = ""]) => {
610
- const e = K([s]);
746
+ }, se = ([s, t = ""]) => {
747
+ const e = Q([s]);
611
748
  return t ? (t = t.toLowerCase(), (n) => e(n) && n.toLowerCase().endsWith(t)) : e;
612
- }, Qt = ([s, t = ""]) => {
613
- const e = K([s]);
614
- return t ? (n) => e(n) && n.endsWith(t) : e;
615
- }, Kt = ([s, t = ""]) => {
749
+ }, ne = ([s, t = ""]) => {
616
750
  const e = Q([s]);
617
751
  return t ? (n) => e(n) && n.endsWith(t) : e;
618
- }, Q = ([s]) => {
752
+ }, ie = ([s, t = ""]) => {
753
+ const e = X([s]);
754
+ return t ? (n) => e(n) && n.endsWith(t) : e;
755
+ }, X = ([s]) => {
619
756
  const t = s.length;
620
757
  return (e) => e.length === t && !e.startsWith(".");
621
- }, K = ([s]) => {
758
+ }, Q = ([s]) => {
622
759
  const t = s.length;
623
760
  return (e) => e.length === t && e !== "." && e !== "..";
624
- }, tt = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix", q = {
761
+ }, K = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix", B = {
625
762
  win32: { sep: "\\" },
626
763
  posix: { sep: "/" }
627
- }, te = tt === "win32" ? q.win32.sep : q.posix.sep;
628
- y.sep = te;
629
- const N = Symbol("globstar **");
630
- y.GLOBSTAR = N;
631
- const ee = "[^/]", se = ee + "*?", ne = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", re = "(?:(?!(?:\\/|^)\\.).)*?", ie = (s, t = {}) => (e) => y(e, s, t);
632
- y.filter = ie;
633
- const O = (s, t = {}) => Object.assign({}, s, t), oe = (s) => {
764
+ }, re = K === "win32" ? B.win32.sep : B.posix.sep;
765
+ y.sep = re;
766
+ const O = Symbol("globstar **");
767
+ y.GLOBSTAR = O;
768
+ const oe = "[^/]", ce = oe + "*?", ae = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", he = "(?:(?!(?:\\/|^)\\.).)*?", le = (s, t = {}) => (e) => y(e, s, t);
769
+ y.filter = le;
770
+ const N = (s, t = {}) => Object.assign({}, s, t), ue = (s) => {
634
771
  if (!s || typeof s != "object" || !Object.keys(s).length)
635
772
  return y;
636
773
  const t = y;
637
- return Object.assign((n, r, i = {}) => t(n, r, O(s, i)), {
774
+ return Object.assign((n, i, r = {}) => t(n, i, N(s, r)), {
638
775
  Minimatch: class extends t.Minimatch {
639
- constructor(r, i = {}) {
640
- super(r, O(s, i));
776
+ constructor(i, r = {}) {
777
+ super(i, N(s, r));
641
778
  }
642
- static defaults(r) {
643
- return t.defaults(O(s, r)).Minimatch;
779
+ static defaults(i) {
780
+ return t.defaults(N(s, i)).Minimatch;
644
781
  }
645
782
  },
646
783
  AST: class extends t.AST {
647
784
  /* c8 ignore start */
648
- constructor(r, i, o = {}) {
649
- super(r, i, O(s, o));
785
+ constructor(i, r, o = {}) {
786
+ super(i, r, N(s, o));
650
787
  }
651
788
  /* c8 ignore stop */
652
- static fromGlob(r, i = {}) {
653
- return t.AST.fromGlob(r, O(s, i));
789
+ static fromGlob(i, r = {}) {
790
+ return t.AST.fromGlob(i, N(s, r));
654
791
  }
655
792
  },
656
- unescape: (n, r = {}) => t.unescape(n, O(s, r)),
657
- escape: (n, r = {}) => t.escape(n, O(s, r)),
658
- filter: (n, r = {}) => t.filter(n, O(s, r)),
659
- defaults: (n) => t.defaults(O(s, n)),
660
- makeRe: (n, r = {}) => t.makeRe(n, O(s, r)),
661
- braceExpand: (n, r = {}) => t.braceExpand(n, O(s, r)),
662
- match: (n, r, i = {}) => t.match(n, r, O(s, i)),
793
+ unescape: (n, i = {}) => t.unescape(n, N(s, i)),
794
+ escape: (n, i = {}) => t.escape(n, N(s, i)),
795
+ filter: (n, i = {}) => t.filter(n, N(s, i)),
796
+ defaults: (n) => t.defaults(N(s, n)),
797
+ makeRe: (n, i = {}) => t.makeRe(n, N(s, i)),
798
+ braceExpand: (n, i = {}) => t.braceExpand(n, N(s, i)),
799
+ match: (n, i, r = {}) => t.match(n, i, N(s, r)),
663
800
  sep: t.sep,
664
- GLOBSTAR: N
801
+ GLOBSTAR: O
665
802
  });
666
803
  };
667
- y.defaults = oe;
668
- const et = (s, t = {}) => (C(s), t.nobrace || !/\{(?:(?!\{).)*\}/.test(s) ? [s] : St(s));
669
- y.braceExpand = et;
670
- const ce = (s, t = {}) => new I(s, t).makeRe();
671
- y.makeRe = ce;
672
- const ae = (s, t, e = {}) => {
804
+ y.defaults = ue;
805
+ const tt = (s, t = {}) => (C(s), t.nobrace || !/\{(?:(?!\{).)*\}/.test(s) ? [s] : At(s));
806
+ y.braceExpand = tt;
807
+ const fe = (s, t = {}) => new I(s, t).makeRe();
808
+ y.makeRe = fe;
809
+ const pe = (s, t, e = {}) => {
673
810
  const n = new I(t, e);
674
- return s = s.filter((r) => n.match(r)), n.options.nonull && !s.length && s.push(t), s;
811
+ return s = s.filter((i) => n.match(i)), n.options.nonull && !s.length && s.push(t), s;
675
812
  };
676
- y.match = ae;
677
- const G = /[?*]|[+@!]\(.*?\)|\[|\]/, le = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
813
+ y.match = pe;
814
+ const q = /[?*]|[+@!]\(.*?\)|\[|\]/, de = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
678
815
  class I {
679
816
  options;
680
817
  set;
@@ -694,7 +831,7 @@ class I {
694
831
  windowsNoMagicRoot;
695
832
  regexp;
696
833
  constructor(t, e = {}) {
697
- C(t), e = e || {}, this.options = e, this.pattern = t, this.platform = e.platform || tt, this.isWindows = this.platform === "win32", this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e.allowWindowsEscape === !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();
834
+ C(t), e = e || {}, this.options = e, this.pattern = t, this.platform = e.platform || K, this.isWindows = this.platform === "win32", this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e.allowWindowsEscape === !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();
698
835
  }
699
836
  hasMagic() {
700
837
  if (this.options.magicalBraces && this.set.length > 1)
@@ -717,23 +854,23 @@ class I {
717
854
  this.empty = !0;
718
855
  return;
719
856
  }
720
- this.parseNegate(), this.globSet = [...new Set(this.braceExpand())], e.debug && (this.debug = (...i) => console.error(...i)), this.debug(this.pattern, this.globSet);
721
- const n = this.globSet.map((i) => this.slashSplit(i));
857
+ this.parseNegate(), this.globSet = [...new Set(this.braceExpand())], e.debug && (this.debug = (...r) => console.error(...r)), this.debug(this.pattern, this.globSet);
858
+ const n = this.globSet.map((r) => this.slashSplit(r));
722
859
  this.globParts = this.preprocess(n), this.debug(this.pattern, this.globParts);
723
- let r = this.globParts.map((i, o, l) => {
860
+ let i = this.globParts.map((r, o, a) => {
724
861
  if (this.isWindows && this.windowsNoMagicRoot) {
725
- const a = i[0] === "" && i[1] === "" && (i[2] === "?" || !G.test(i[2])) && !G.test(i[3]), h = /^[a-z]:/i.test(i[0]);
726
- if (a)
727
- return [...i.slice(0, 4), ...i.slice(4).map((c) => this.parse(c))];
862
+ const h = r[0] === "" && r[1] === "" && (r[2] === "?" || !q.test(r[2])) && !q.test(r[3]), l = /^[a-z]:/i.test(r[0]);
728
863
  if (h)
729
- return [i[0], ...i.slice(1).map((c) => this.parse(c))];
864
+ return [...r.slice(0, 4), ...r.slice(4).map((c) => this.parse(c))];
865
+ if (l)
866
+ return [r[0], ...r.slice(1).map((c) => this.parse(c))];
730
867
  }
731
- return i.map((a) => this.parse(a));
868
+ return r.map((h) => this.parse(h));
732
869
  });
733
- if (this.debug(this.pattern, r), this.set = r.filter((i) => i.indexOf(!1) === -1), this.isWindows)
734
- for (let i = 0; i < this.set.length; i++) {
735
- const o = this.set[i];
736
- o[0] === "" && o[1] === "" && this.globParts[i][2] === "?" && typeof o[3] == "string" && /^[a-z]:$/i.test(o[3]) && (o[2] = "?");
870
+ if (this.debug(this.pattern, i), this.set = i.filter((r) => r.indexOf(!1) === -1), this.isWindows)
871
+ for (let r = 0; r < this.set.length; r++) {
872
+ const o = this.set[r];
873
+ o[0] === "" && o[1] === "" && this.globParts[r][2] === "?" && typeof o[3] == "string" && /^[a-z]:$/i.test(o[3]) && (o[2] = "?");
737
874
  }
738
875
  this.debug(this.pattern, this.set);
739
876
  }
@@ -745,8 +882,8 @@ class I {
745
882
  preprocess(t) {
746
883
  if (this.options.noglobstar)
747
884
  for (let n = 0; n < t.length; n++)
748
- for (let r = 0; r < t[n].length; r++)
749
- t[n][r] === "**" && (t[n][r] = "*");
885
+ for (let i = 0; i < t[n].length; i++)
886
+ t[n][i] === "**" && (t[n][i] = "*");
750
887
  const { optimizationLevel: e = 1 } = this.options;
751
888
  return e >= 2 ? (t = this.firstPhasePreProcess(t), t = this.secondPhasePreProcess(t)) : e >= 1 ? t = this.levelOneOptimize(t) : t = this.adjascentGlobstarOptimize(t), t;
752
889
  }
@@ -755,19 +892,19 @@ class I {
755
892
  return t.map((e) => {
756
893
  let n = -1;
757
894
  for (; (n = e.indexOf("**", n + 1)) !== -1; ) {
758
- let r = n;
759
- for (; e[r + 1] === "**"; )
760
- r++;
761
- r !== n && e.splice(n, r - n);
895
+ let i = n;
896
+ for (; e[i + 1] === "**"; )
897
+ i++;
898
+ i !== n && e.splice(n, i - n);
762
899
  }
763
900
  return e;
764
901
  });
765
902
  }
766
903
  // get rid of adjascent ** and resolve .. portions
767
904
  levelOneOptimize(t) {
768
- return t.map((e) => (e = e.reduce((n, r) => {
769
- const i = n[n.length - 1];
770
- return r === "**" && i === "**" ? n : r === ".." && i && i !== ".." && i !== "." && i !== "**" ? (n.pop(), n) : (n.push(r), n);
905
+ return t.map((e) => (e = e.reduce((n, i) => {
906
+ const r = n[n.length - 1];
907
+ return i === "**" && r === "**" ? n : i === ".." && r && r !== ".." && r !== "." && r !== "**" ? (n.pop(), n) : (n.push(i), n);
771
908
  }, []), e.length === 0 ? [""] : e));
772
909
  }
773
910
  levelTwoFileOptimize(t) {
@@ -775,16 +912,16 @@ class I {
775
912
  let e = !1;
776
913
  do {
777
914
  if (e = !1, !this.preserveMultipleSlashes) {
778
- for (let r = 1; r < t.length - 1; r++) {
779
- const i = t[r];
780
- r === 1 && i === "" && t[0] === "" || (i === "." || i === "") && (e = !0, t.splice(r, 1), r--);
915
+ for (let i = 1; i < t.length - 1; i++) {
916
+ const r = t[i];
917
+ i === 1 && r === "" && t[0] === "" || (r === "." || r === "") && (e = !0, t.splice(i, 1), i--);
781
918
  }
782
919
  t[0] === "." && t.length === 2 && (t[1] === "." || t[1] === "") && (e = !0, t.pop());
783
920
  }
784
921
  let n = 0;
785
922
  for (; (n = t.indexOf("..", n + 1)) !== -1; ) {
786
- const r = t[n - 1];
787
- r && r !== "." && r !== ".." && r !== "**" && (e = !0, t.splice(n - 1, 2), n -= 2);
923
+ const i = t[n - 1];
924
+ i && i !== "." && i !== ".." && i !== "**" && (e = !0, t.splice(n - 1, 2), n -= 2);
788
925
  }
789
926
  } while (e);
790
927
  return t.length === 0 ? [""] : t;
@@ -812,34 +949,34 @@ class I {
812
949
  do {
813
950
  e = !1;
814
951
  for (let n of t) {
815
- let r = -1;
816
- for (; (r = n.indexOf("**", r + 1)) !== -1; ) {
817
- let o = r;
952
+ let i = -1;
953
+ for (; (i = n.indexOf("**", i + 1)) !== -1; ) {
954
+ let o = i;
818
955
  for (; n[o + 1] === "**"; )
819
956
  o++;
820
- o > r && n.splice(r + 1, o - r);
821
- let l = n[r + 1];
822
- const a = n[r + 2], h = n[r + 3];
823
- if (l !== ".." || !a || a === "." || a === ".." || !h || h === "." || h === "..")
957
+ o > i && n.splice(i + 1, o - i);
958
+ let a = n[i + 1];
959
+ const h = n[i + 2], l = n[i + 3];
960
+ if (a !== ".." || !h || h === "." || h === ".." || !l || l === "." || l === "..")
824
961
  continue;
825
- e = !0, n.splice(r, 1);
962
+ e = !0, n.splice(i, 1);
826
963
  const c = n.slice(0);
827
- c[r] = "**", t.push(c), r--;
964
+ c[i] = "**", t.push(c), i--;
828
965
  }
829
966
  if (!this.preserveMultipleSlashes) {
830
967
  for (let o = 1; o < n.length - 1; o++) {
831
- const l = n[o];
832
- o === 1 && l === "" && n[0] === "" || (l === "." || l === "") && (e = !0, n.splice(o, 1), o--);
968
+ const a = n[o];
969
+ o === 1 && a === "" && n[0] === "" || (a === "." || a === "") && (e = !0, n.splice(o, 1), o--);
833
970
  }
834
971
  n[0] === "." && n.length === 2 && (n[1] === "." || n[1] === "") && (e = !0, n.pop());
835
972
  }
836
- let i = 0;
837
- for (; (i = n.indexOf("..", i + 1)) !== -1; ) {
838
- const o = n[i - 1];
973
+ let r = 0;
974
+ for (; (r = n.indexOf("..", r + 1)) !== -1; ) {
975
+ const o = n[r - 1];
839
976
  if (o && o !== "." && o !== ".." && o !== "**") {
840
977
  e = !0;
841
- const a = i === 1 && n[i + 1] === "**" ? ["."] : [];
842
- n.splice(i - 1, 2, ...a), n.length === 0 && n.push(""), i -= 2;
978
+ const h = r === 1 && n[r + 1] === "**" ? ["."] : [];
979
+ n.splice(r - 1, 2, ...h), n.length === 0 && n.push(""), r -= 2;
843
980
  }
844
981
  }
845
982
  }
@@ -856,31 +993,31 @@ class I {
856
993
  secondPhasePreProcess(t) {
857
994
  for (let e = 0; e < t.length - 1; e++)
858
995
  for (let n = e + 1; n < t.length; n++) {
859
- const r = this.partsMatch(t[e], t[n], !this.preserveMultipleSlashes);
860
- if (r) {
861
- t[e] = [], t[n] = r;
996
+ const i = this.partsMatch(t[e], t[n], !this.preserveMultipleSlashes);
997
+ if (i) {
998
+ t[e] = [], t[n] = i;
862
999
  break;
863
1000
  }
864
1001
  }
865
1002
  return t.filter((e) => e.length);
866
1003
  }
867
1004
  partsMatch(t, e, n = !1) {
868
- let r = 0, i = 0, o = [], l = "";
869
- for (; r < t.length && i < e.length; )
870
- if (t[r] === e[i])
871
- o.push(l === "b" ? e[i] : t[r]), r++, i++;
872
- else if (n && t[r] === "**" && e[i] === t[r + 1])
873
- o.push(t[r]), r++;
874
- else if (n && e[i] === "**" && t[r] === e[i + 1])
875
- o.push(e[i]), i++;
876
- else if (t[r] === "*" && e[i] && (this.options.dot || !e[i].startsWith(".")) && e[i] !== "**") {
877
- if (l === "b")
1005
+ let i = 0, r = 0, o = [], a = "";
1006
+ for (; i < t.length && r < e.length; )
1007
+ if (t[i] === e[r])
1008
+ o.push(a === "b" ? e[r] : t[i]), i++, r++;
1009
+ else if (n && t[i] === "**" && e[r] === t[i + 1])
1010
+ o.push(t[i]), i++;
1011
+ else if (n && e[r] === "**" && t[i] === e[r + 1])
1012
+ o.push(e[r]), r++;
1013
+ else if (t[i] === "*" && e[r] && (this.options.dot || !e[r].startsWith(".")) && e[r] !== "**") {
1014
+ if (a === "b")
878
1015
  return !1;
879
- l = "a", o.push(t[r]), r++, i++;
880
- } else if (e[i] === "*" && t[r] && (this.options.dot || !t[r].startsWith(".")) && t[r] !== "**") {
881
- if (l === "a")
1016
+ a = "a", o.push(t[i]), i++, r++;
1017
+ } else if (e[r] === "*" && t[i] && (this.options.dot || !t[i].startsWith(".")) && t[i] !== "**") {
1018
+ if (a === "a")
882
1019
  return !1;
883
- l = "b", o.push(e[i]), r++, i++;
1020
+ a = "b", o.push(e[r]), i++, r++;
884
1021
  } else
885
1022
  return !1;
886
1023
  return t.length === e.length && o;
@@ -890,7 +1027,7 @@ class I {
890
1027
  return;
891
1028
  const t = this.pattern;
892
1029
  let e = !1, n = 0;
893
- for (let r = 0; r < t.length && t.charAt(r) === "!"; r++)
1030
+ for (let i = 0; i < t.length && t.charAt(i) === "!"; i++)
894
1031
  e = !e, n++;
895
1032
  n && (this.pattern = t.slice(n)), this.negate = e;
896
1033
  }
@@ -900,7 +1037,7 @@ class I {
900
1037
  // out of pattern, then that's fine, as long as all
901
1038
  // the parts match.
902
1039
  matchOne(t, e, n = !1) {
903
- const r = this.options;
1040
+ const i = this.options;
904
1041
  if (this.isWindows) {
905
1042
  const d = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), S = !d && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]), b = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]), A = !b && e[0] === "" && e[1] === "" && e[2] === "?" && typeof e[3] == "string" && /^[a-z]:$/i.test(e[3]), x = S ? 3 : d ? 0 : void 0, w = A ? 3 : b ? 0 : void 0;
906
1043
  if (typeof x == "number" && typeof w == "number") {
@@ -908,62 +1045,62 @@ class I {
908
1045
  v.toLowerCase() === P.toLowerCase() && (e[w] = v, w > x ? e = e.slice(w) : x > w && (t = t.slice(x)));
909
1046
  }
910
1047
  }
911
- const { optimizationLevel: i = 1 } = this.options;
912
- i >= 2 && (t = this.levelTwoFileOptimize(t)), this.debug("matchOne", this, { file: t, pattern: e }), this.debug("matchOne", t.length, e.length);
913
- for (var o = 0, l = 0, a = t.length, h = e.length; o < a && l < h; o++, l++) {
1048
+ const { optimizationLevel: r = 1 } = this.options;
1049
+ r >= 2 && (t = this.levelTwoFileOptimize(t)), this.debug("matchOne", this, { file: t, pattern: e }), this.debug("matchOne", t.length, e.length);
1050
+ for (var o = 0, a = 0, h = t.length, l = e.length; o < h && a < l; o++, a++) {
914
1051
  this.debug("matchOne loop");
915
- var c = e[l], p = t[o];
1052
+ var c = e[a], p = t[o];
916
1053
  if (this.debug(e, c, p), c === !1)
917
1054
  return !1;
918
- if (c === N) {
1055
+ if (c === O) {
919
1056
  this.debug("GLOBSTAR", [e, c, p]);
920
- var f = o, u = l + 1;
921
- if (u === h) {
922
- for (this.debug("** at the end"); o < a; o++)
923
- if (t[o] === "." || t[o] === ".." || !r.dot && t[o].charAt(0) === ".")
1057
+ var f = o, u = a + 1;
1058
+ if (u === l) {
1059
+ for (this.debug("** at the end"); o < h; o++)
1060
+ if (t[o] === "." || t[o] === ".." || !i.dot && t[o].charAt(0) === ".")
924
1061
  return !1;
925
1062
  return !0;
926
1063
  }
927
- for (; f < a; ) {
1064
+ for (; f < h; ) {
928
1065
  var m = t[f];
929
1066
  if (this.debug(`
930
1067
  globstar while`, t, f, e, u, m), this.matchOne(t.slice(f), e.slice(u), n))
931
- return this.debug("globstar found match!", f, a, m), !0;
932
- if (m === "." || m === ".." || !r.dot && m.charAt(0) === ".") {
1068
+ return this.debug("globstar found match!", f, h, m), !0;
1069
+ if (m === "." || m === ".." || !i.dot && m.charAt(0) === ".") {
933
1070
  this.debug("dot detected!", t, f, e, u);
934
1071
  break;
935
1072
  }
936
1073
  this.debug("globstar swallow a segment, and continue"), f++;
937
1074
  }
938
1075
  return !!(n && (this.debug(`
939
- >>> no match, partial?`, t, f, e, u), f === a));
1076
+ >>> no match, partial?`, t, f, e, u), f === h));
940
1077
  }
941
1078
  let d;
942
1079
  if (typeof c == "string" ? (d = p === c, this.debug("string match", c, p, d)) : (d = c.test(p), this.debug("pattern match", c, p, d)), !d)
943
1080
  return !1;
944
1081
  }
945
- if (o === a && l === h)
1082
+ if (o === h && a === l)
946
1083
  return !0;
947
- if (o === a)
1084
+ if (o === h)
948
1085
  return n;
949
- if (l === h)
950
- return o === a - 1 && t[o] === "";
1086
+ if (a === l)
1087
+ return o === h - 1 && t[o] === "";
951
1088
  throw new Error("wtf?");
952
1089
  }
953
1090
  braceExpand() {
954
- return et(this.pattern, this.options);
1091
+ return tt(this.pattern, this.options);
955
1092
  }
956
1093
  parse(t) {
957
1094
  C(t);
958
1095
  const e = this.options;
959
1096
  if (t === "**")
960
- return N;
1097
+ return O;
961
1098
  if (t === "")
962
1099
  return "";
963
- let n, r = null;
964
- (n = t.match(Ht)) ? r = e.dot ? Zt : Vt : (n = t.match(Ft)) ? r = (e.nocase ? e.dot ? jt : Wt : e.dot ? Ut : kt)(n[1]) : (n = t.match(Yt)) ? r = (e.nocase ? e.dot ? Xt : Jt : e.dot ? Qt : Kt)(n) : (n = t.match(zt)) ? r = e.dot ? Bt : _t : (n = t.match(qt)) && (r = Gt);
965
- const i = E.fromGlob(t, this.options).toMMPattern();
966
- return r && typeof i == "object" && Reflect.defineProperty(i, "test", { value: r }), i;
1100
+ let n, i = null;
1101
+ (n = t.match(Xt)) ? i = e.dot ? Kt : Qt : (n = t.match(zt)) ? i = (e.nocase ? e.dot ? Gt : qt : e.dot ? Bt : _t)(n[1]) : (n = t.match(te)) ? i = (e.nocase ? e.dot ? se : ee : e.dot ? ne : ie)(n) : (n = t.match(Ht)) ? i = e.dot ? Zt : Vt : (n = t.match(Yt)) && (i = Jt);
1102
+ const r = E.fromGlob(t, this.options).toMMPattern();
1103
+ return i && typeof r == "object" && Reflect.defineProperty(r, "test", { value: i }), r;
967
1104
  }
968
1105
  makeRe() {
969
1106
  if (this.regexp || this.regexp === !1)
@@ -971,23 +1108,23 @@ globstar while`, t, f, e, u, m), this.matchOne(t.slice(f), e.slice(u), n))
971
1108
  const t = this.set;
972
1109
  if (!t.length)
973
1110
  return this.regexp = !1, this.regexp;
974
- const e = this.options, n = e.noglobstar ? se : e.dot ? ne : re, r = new Set(e.nocase ? ["i"] : []);
975
- let i = t.map((a) => {
976
- const h = a.map((c) => {
1111
+ const e = this.options, n = e.noglobstar ? ce : e.dot ? ae : he, i = new Set(e.nocase ? ["i"] : []);
1112
+ let r = t.map((h) => {
1113
+ const l = h.map((c) => {
977
1114
  if (c instanceof RegExp)
978
1115
  for (const p of c.flags.split(""))
979
- r.add(p);
980
- return typeof c == "string" ? le(c) : c === N ? N : c._src;
1116
+ i.add(p);
1117
+ return typeof c == "string" ? de(c) : c === O ? O : c._src;
981
1118
  });
982
- return h.forEach((c, p) => {
983
- const f = h[p + 1], u = h[p - 1];
984
- c !== N || u === N || (u === void 0 ? f !== void 0 && f !== N ? h[p + 1] = "(?:\\/|" + n + "\\/)?" + f : h[p] = n : f === void 0 ? h[p - 1] = u + "(?:\\/|" + n + ")?" : f !== N && (h[p - 1] = u + "(?:\\/|\\/" + n + "\\/)" + f, h[p + 1] = N));
985
- }), h.filter((c) => c !== N).join("/");
1119
+ return l.forEach((c, p) => {
1120
+ const f = l[p + 1], u = l[p - 1];
1121
+ c !== O || u === O || (u === void 0 ? f !== void 0 && f !== O ? l[p + 1] = "(?:\\/|" + n + "\\/)?" + f : l[p] = n : f === void 0 ? l[p - 1] = u + "(?:\\/|" + n + ")?" : f !== O && (l[p - 1] = u + "(?:\\/|\\/" + n + "\\/)" + f, l[p + 1] = O));
1122
+ }), l.filter((c) => c !== O).join("/");
986
1123
  }).join("|");
987
- const [o, l] = t.length > 1 ? ["(?:", ")"] : ["", ""];
988
- i = "^" + o + i + l + "$", this.negate && (i = "^(?!" + i + ").+$");
1124
+ const [o, a] = t.length > 1 ? ["(?:", ")"] : ["", ""];
1125
+ r = "^" + o + r + a + "$", this.negate && (r = "^(?!" + r + ").+$");
989
1126
  try {
990
- this.regexp = new RegExp(i, [...r].join(""));
1127
+ this.regexp = new RegExp(r, [...i].join(""));
991
1128
  } catch {
992
1129
  this.regexp = !1;
993
1130
  }
@@ -1005,18 +1142,18 @@ globstar while`, t, f, e, u, m), this.matchOne(t.slice(f), e.slice(u), n))
1005
1142
  return !0;
1006
1143
  const n = this.options;
1007
1144
  this.isWindows && (t = t.split("\\").join("/"));
1008
- const r = this.slashSplit(t);
1009
- this.debug(this.pattern, "split", r);
1010
- const i = this.set;
1011
- this.debug(this.pattern, "set", i);
1012
- let o = r[r.length - 1];
1145
+ const i = this.slashSplit(t);
1146
+ this.debug(this.pattern, "split", i);
1147
+ const r = this.set;
1148
+ this.debug(this.pattern, "set", r);
1149
+ let o = i[i.length - 1];
1013
1150
  if (!o)
1014
- for (let l = r.length - 2; !o && l >= 0; l--)
1015
- o = r[l];
1016
- for (let l = 0; l < i.length; l++) {
1017
- const a = i[l];
1018
- let h = r;
1019
- if (n.matchBase && a.length === 1 && (h = [o]), this.matchOne(h, a, e))
1151
+ for (let a = i.length - 2; !o && a >= 0; a--)
1152
+ o = i[a];
1153
+ for (let a = 0; a < r.length; a++) {
1154
+ const h = r[a];
1155
+ let l = i;
1156
+ if (n.matchBase && h.length === 1 && (l = [o]), this.matchOne(l, h, e))
1020
1157
  return n.flipNegate ? !0 : !this.negate;
1021
1158
  }
1022
1159
  return n.flipNegate ? !1 : this.negate;
@@ -1027,234 +1164,73 @@ globstar while`, t, f, e, u, m), this.matchOne(t.slice(f), e.slice(u), n))
1027
1164
  }
1028
1165
  y.AST = E;
1029
1166
  y.Minimatch = I;
1030
- y.escape = Lt;
1167
+ y.escape = Ut;
1031
1168
  y.unescape = M;
1032
- const he = [
1033
- // Images
1034
- ".jpg",
1035
- ".jpeg",
1036
- ".png",
1037
- ".gif",
1038
- ".bmp",
1039
- ".webp",
1040
- ".ico",
1041
- ".tiff",
1042
- ".tga",
1043
- // Audio
1044
- ".mp3",
1045
- ".wav",
1046
- ".ogg",
1047
- ".flac",
1048
- ".aac",
1049
- ".wma",
1050
- ".m4a",
1051
- // Video
1052
- ".mp4",
1053
- ".avi",
1054
- ".mov",
1055
- ".wmv",
1056
- ".flv",
1057
- ".webm",
1058
- ".mkv",
1059
- ".m4v",
1060
- // Documents
1061
- ".pdf",
1062
- ".doc",
1063
- ".docx",
1064
- ".xls",
1065
- ".xlsx",
1066
- ".ppt",
1067
- ".pptx",
1068
- // Archives
1069
- ".zip",
1070
- ".rar",
1071
- ".7z",
1072
- ".tar",
1073
- ".gz",
1074
- ".bz2",
1075
- // Executables
1076
- ".exe",
1077
- ".dll",
1078
- ".so",
1079
- ".dylib",
1080
- // Other binary formats
1081
- ".dat",
1082
- ".db",
1083
- ".sqlite",
1084
- ".bin",
1085
- ".obj",
1086
- ".fbx",
1087
- ".3ds"
1088
- ];
1089
- function Te(s) {
1090
- const t = s.lastIndexOf(".");
1091
- if (t <= 0)
1092
- return !0;
1093
- const e = s.slice(t).toLowerCase();
1094
- return he.includes(e);
1095
- }
1096
- function ue(s, t = "utf-8") {
1097
- switch (t) {
1098
- case "utf8":
1099
- case "utf-8":
1100
- return new TextEncoder().encode(s);
1101
- case "utf16le":
1102
- case "ucs2":
1103
- case "ucs-2":
1104
- return fe(s);
1105
- case "ascii":
1106
- return ge(s);
1107
- case "latin1":
1108
- return de(s);
1109
- case "binary":
1110
- return Uint8Array.from(s, (e) => e.charCodeAt(0));
1111
- case "base64":
1112
- return Uint8Array.from(atob(s), (e) => e.charCodeAt(0));
1113
- case "hex":
1114
- if (!/^[\da-f]+$/i.test(s) || s.length % 2 !== 0)
1115
- throw new g("Invalid hex string", "INVALID_HEX_FORMAT");
1116
- return Uint8Array.from(s.match(/.{1,2}/g).map((e) => parseInt(e, 16)));
1117
- default:
1118
- return console.warn("Encoding not supported, falling back to UTF-8"), new TextEncoder().encode(s);
1119
- }
1120
- }
1121
- function Me(s, t = "utf-8") {
1122
- switch (t) {
1123
- case "utf8":
1124
- case "utf-8":
1125
- return new TextDecoder().decode(s);
1126
- case "utf16le":
1127
- case "utf-16le":
1128
- case "ucs2":
1129
- case "ucs-2":
1130
- return pe(s);
1131
- case "latin1":
1132
- return String.fromCharCode(...s);
1133
- case "ascii":
1134
- return String.fromCharCode(...s.map((e) => e & 127));
1135
- case "base64":
1136
- return btoa(String.fromCharCode(...s));
1137
- case "hex":
1138
- return Array.from(s).map((e) => e.toString(16).padStart(2, "0")).join("");
1139
- default:
1140
- return console.warn("Unsupported encoding, falling back to UTF-8"), new TextDecoder().decode(s);
1141
- }
1142
- }
1143
- function fe(s) {
1144
- const t = new Uint8Array(s.length * 2);
1145
- for (let e = 0; e < s.length; e++) {
1146
- const n = s.charCodeAt(e);
1147
- t[e * 2] = n & 255, t[e * 2 + 1] = n >> 8;
1148
- }
1149
- return t;
1150
- }
1151
- function pe(s) {
1152
- s.length % 2 !== 0 && (console.warn("Invalid UTF-16LE buffer length, truncating last byte"), s = s.slice(0, s.length - 1));
1153
- const t = new Uint16Array(s.buffer, s.byteOffset, s.byteLength / 2);
1154
- return String.fromCharCode(...t);
1155
- }
1156
- function de(s) {
1157
- const t = new Uint8Array(s.length);
1158
- for (let e = 0; e < s.length; e++)
1159
- t[e] = s.charCodeAt(e) & 255;
1160
- return t;
1161
- }
1162
- function ge(s) {
1163
- const t = new Uint8Array(s.length);
1164
- for (let e = 0; e < s.length; e++)
1165
- t[e] = s.charCodeAt(e) & 127;
1166
- return t;
1167
- }
1168
- function Pe() {
1169
+ function Te() {
1169
1170
  if (!("storage" in navigator) || !("getDirectory" in navigator.storage))
1170
1171
  throw new it();
1171
1172
  }
1172
- async function k(s, t, e) {
1173
+ async function ge(s, t, e) {
1173
1174
  return typeof navigator < "u" && navigator.locks?.request ? navigator.locks.request(`opfs:${s.replace(/\/+/g, "/")}`, { mode: t }, e) : e();
1174
1175
  }
1175
- function U(s) {
1176
+ function F(s) {
1176
1177
  return Array.isArray(s) ? s : (s.startsWith("~/") ? s.slice(2) : s).split("/").filter(Boolean);
1177
1178
  }
1178
- function st(s) {
1179
+ function et(s) {
1179
1180
  return typeof s == "string" ? s ?? "/" : `/${s.join("/")}`;
1180
1181
  }
1181
- function nt(s) {
1182
- const t = U(s);
1182
+ function st(s) {
1183
+ const t = F(s);
1183
1184
  return t[t.length - 1] || "";
1184
1185
  }
1185
- function Re(s) {
1186
- const t = U(s);
1187
- return t.pop(), st(t);
1186
+ function Me(s) {
1187
+ const t = F(s);
1188
+ return t.pop(), et(t);
1188
1189
  }
1189
- function rt(s) {
1190
+ function nt(s) {
1190
1191
  return !s || s === "/" ? "/" : s.startsWith("~/") ? `/${s.slice(2)}` : s.startsWith("/") ? s : `/${s}`;
1191
1192
  }
1192
- function Ce(s, t = !1) {
1193
+ function Pe(s, t = !1) {
1193
1194
  return s = s.replace(/\/$/, ""), t && !s.includes("*") ? `${s}/**` : s;
1194
1195
  }
1195
- function Ie(s, t) {
1196
+ function Re(s, t) {
1196
1197
  return y(s, t, {
1197
1198
  dot: !0,
1198
1199
  matchBase: !0
1199
1200
  });
1200
1201
  }
1201
- function De(s, t) {
1202
+ function Ce(s, t) {
1202
1203
  if (!t || Array.isArray(t) && t.length === 0)
1203
1204
  return !1;
1204
- const e = rt(s);
1205
- return (Array.isArray(t) ? t : [t]).some((r) => y(e, r, { dot: !0 }));
1205
+ const e = nt(s);
1206
+ return (Array.isArray(t) ? t : [t]).some((i) => y(e, i, { dot: !0 }));
1206
1207
  }
1207
- function Le(s) {
1208
- const t = rt(s), e = U(t), n = [];
1209
- for (const r of e)
1210
- if (!(r === "." || r === ""))
1211
- if (r === "..") {
1208
+ function Ie(s) {
1209
+ const t = nt(s), e = F(t), n = [];
1210
+ for (const i of e)
1211
+ if (!(i === "." || i === ""))
1212
+ if (i === "..") {
1212
1213
  if (n.length === 0)
1213
1214
  continue;
1214
1215
  n.pop();
1215
1216
  } else
1216
- n.push(r);
1217
- return st(n);
1217
+ n.push(i);
1218
+ return et(n);
1218
1219
  }
1219
- function Fe(s) {
1220
- const t = nt(s), e = t.lastIndexOf(".");
1220
+ function De(s) {
1221
+ const t = st(s), e = t.lastIndexOf(".");
1221
1222
  return e <= 0 || e === t.length - 1 ? "" : t.slice(e);
1222
1223
  }
1223
- function me(s, t = "utf-8") {
1224
- return typeof s == "string" ? ue(s, t) : s instanceof Uint8Array ? s : new Uint8Array(s);
1225
- }
1226
- async function ke(s, t) {
1227
- return k(t, "shared", async () => {
1228
- const n = await (await s.getFile()).arrayBuffer();
1229
- return new Uint8Array(n);
1230
- });
1231
- }
1232
- async function Ue(s, t, e, n, r = {}) {
1233
- const i = async () => {
1234
- const o = r.append || !1, l = !o && (r.truncate ?? !0), a = await we(s, n || "unknown");
1235
- try {
1236
- const h = me(t, e), c = o ? a.getSize() : 0;
1237
- a.write(h, { at: c }), l && a.truncate(h.byteLength), a.flush();
1238
- } catch (h) {
1239
- console.error(h);
1240
- const c = o ? "append" : "write";
1241
- throw new g(`Failed to ${c} file`, `${c.toUpperCase()}_FAILED`, void 0, h);
1242
- } finally {
1243
- try {
1244
- a?.close();
1245
- } catch {
1246
- }
1247
- }
1248
- };
1249
- return n ? k(n, "exclusive", i) : i();
1224
+ function Le(s, t = "utf-8") {
1225
+ return typeof s == "string" ? ct(s, t) : s instanceof Uint8Array ? s : new Uint8Array(s);
1250
1226
  }
1251
- async function We(s, t = "SHA-1", e = 50 * 1024 * 1024) {
1227
+ async function ke(s, t = "SHA-1", e = 50 * 1024 * 1024) {
1252
1228
  if (s instanceof File && (s = await s.arrayBuffer()), s.byteLength > e)
1253
1229
  throw new Error(`File size ${s.byteLength} bytes exceeds maximum allowed size ${e} bytes`);
1254
- const n = new Uint8Array(s), r = await crypto.subtle.digest(t, n);
1255
- return Array.from(new Uint8Array(r)).map((o) => o.toString(16).padStart(2, "0")).join("");
1230
+ const n = new Uint8Array(s), i = await crypto.subtle.digest(t, n);
1231
+ return Array.from(new Uint8Array(i)).map((o) => o.toString(16).padStart(2, "0")).join("");
1256
1232
  }
1257
- function je(s, t) {
1233
+ function Fe(s, t) {
1258
1234
  if (s.length !== t.length)
1259
1235
  return !1;
1260
1236
  for (let e = 0; e < s.length; e++)
@@ -1262,26 +1238,26 @@ function je(s, t) {
1262
1238
  return !1;
1263
1239
  return !0;
1264
1240
  }
1265
- async function ze(s) {
1241
+ async function We(s) {
1266
1242
  const t = await s.arrayBuffer();
1267
1243
  return new Uint8Array(t);
1268
1244
  }
1269
- async function _e(s, t, e = {}) {
1270
- const n = nt(t);
1271
- return k(t, "exclusive", async () => {
1272
- const r = e.recursive ?? !1, i = e.force ?? !1;
1245
+ async function je(s, t, e = {}) {
1246
+ const n = st(t);
1247
+ return ge(t, "exclusive", async () => {
1248
+ const i = e.recursive ?? !1, r = e.force ?? !1;
1273
1249
  e.useTrash;
1274
1250
  try {
1275
- await s.removeEntry(n, { recursive: r });
1251
+ await s.removeEntry(n, { recursive: i });
1276
1252
  } catch (o) {
1277
1253
  if (o.name === "NotFoundError") {
1278
- if (!i)
1254
+ if (!r)
1279
1255
  throw new g(`No such file or directory: ${t}`, "ENOENT", void 0, o);
1280
- } else throw o.name === "InvalidModificationError" ? new g(`Directory not empty: ${t}. Use recursive option to force removal.`, "ENOTEMPTY", void 0, o) : o.name === "TypeMismatchError" && !r ? new g(`Cannot remove directory without recursive option: ${t}`, "EISDIR", void 0, o) : new g(`Failed to remove entry: ${t}`, "RM_FAILED", void 0, o);
1256
+ } else throw o.name === "InvalidModificationError" ? new g(`Directory not empty: ${t}. Use recursive option to force removal.`, "ENOTEMPTY", void 0, o) : o.name === "TypeMismatchError" && !i ? new g(`Cannot remove directory without recursive option: ${t}`, "EISDIR", void 0, o) : new g(`Failed to remove entry: ${t}`, "RM_FAILED", void 0, o);
1281
1257
  }
1282
1258
  });
1283
1259
  }
1284
- function Be(s, t, e, n) {
1260
+ function Ue(s, t, e, n) {
1285
1261
  if (!Number.isInteger(t) || !Number.isInteger(e))
1286
1262
  throw new g("Invalid offset or length", "EINVAL");
1287
1263
  if (t < 0 || e < 0)
@@ -1291,64 +1267,62 @@ function Be(s, t, e, n) {
1291
1267
  if (n != null && (!Number.isInteger(n) || n < 0))
1292
1268
  throw new g("Invalid position", "EINVAL");
1293
1269
  }
1294
- function qe(s, t, e) {
1270
+ function ze(s, t, e) {
1295
1271
  try {
1296
1272
  t.flush(), t.close();
1297
1273
  } catch (n) {
1298
1274
  console.warn(`Warning: Failed to properly close file descriptor ${s} (${e}):`, n);
1299
1275
  }
1300
1276
  }
1301
- function Ge(s, t, e) {
1277
+ function _e(s, t, e) {
1302
1278
  if (s >= e)
1303
1279
  return { isEOF: !0, actualLength: 0 };
1304
1280
  const n = Math.min(t, e - s);
1305
1281
  return n <= 0 ? { isEOF: !0, actualLength: 0 } : { isEOF: !1, actualLength: n };
1306
1282
  }
1307
- async function we(s, t) {
1283
+ async function Be(s, t) {
1308
1284
  try {
1309
1285
  return await s.createSyncAccessHandle();
1310
1286
  } catch (e) {
1311
- throw ot(e, { path: t, isDirectory: !1 });
1287
+ throw rt(e, { path: t, isDirectory: !1 });
1312
1288
  }
1313
1289
  }
1314
1290
  export {
1315
- Ge as A,
1316
- we as B,
1317
- he as C,
1318
- xe as D,
1319
- Te as E,
1320
- Se as F,
1321
- ue as G,
1322
- Me as H,
1291
+ ze as A,
1292
+ _e as B,
1293
+ Be as C,
1294
+ Ee as D,
1295
+ ot as E,
1296
+ ye as F,
1323
1297
  g as O,
1324
- Ee as P,
1325
- Ne as S,
1326
- be as T,
1298
+ we as P,
1299
+ xe as S,
1300
+ Ne as T,
1327
1301
  it as a,
1328
- ye as b,
1329
- Oe as c,
1302
+ me as b,
1303
+ Se as c,
1330
1304
  Ae as d,
1331
- Pe as e,
1332
- nt as f,
1333
- Re as g,
1334
- Ce as h,
1335
- Ie as i,
1336
- st as j,
1337
- De as k,
1338
- Fe as l,
1339
- ot as m,
1340
- rt as n,
1341
- me as o,
1342
- ke as p,
1343
- Ue as q,
1344
- Le as r,
1345
- U as s,
1346
- We as t,
1347
- je as u,
1348
- ze as v,
1349
- k as w,
1350
- _e as x,
1351
- Be as y,
1352
- qe as z
1305
+ ct as e,
1306
+ Oe as f,
1307
+ Te as g,
1308
+ st as h,
1309
+ be as i,
1310
+ et as j,
1311
+ Me as k,
1312
+ Pe as l,
1313
+ rt as m,
1314
+ nt as n,
1315
+ Re as o,
1316
+ Ce as p,
1317
+ De as q,
1318
+ Ie as r,
1319
+ F as s,
1320
+ Le as t,
1321
+ ke as u,
1322
+ Fe as v,
1323
+ ge as w,
1324
+ We as x,
1325
+ je as y,
1326
+ Ue as z
1353
1327
  };
1354
- //# sourceMappingURL=helpers-DS5dyURe.js.map
1328
+ //# sourceMappingURL=helpers-CkNHswLp.js.map