@mgdis/core-ui-helpers 1.0.6 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/.turbo/turbo-build.log +17 -17
  2. package/CHANGELOG.md +13 -0
  3. package/dist/locale/index.cjs +24 -0
  4. package/dist/locale/index.cjs.map +1 -1
  5. package/dist/locale/index.d.ts +8 -1
  6. package/dist/locale/index.js +24 -1
  7. package/dist/locale/index.js.map +1 -1
  8. package/dist/locale/index.umd.js +24 -0
  9. package/dist/locale/index.umd.js.map +1 -1
  10. package/dist/playwright/index.cjs +2 -2
  11. package/dist/playwright/index.cjs.map +1 -1
  12. package/dist/playwright/index.js +2 -2
  13. package/dist/playwright/index.js.map +1 -1
  14. package/dist/playwright/index.umd.js +2 -2
  15. package/dist/playwright/index.umd.js.map +1 -1
  16. package/dist/stencil/index.cjs +1595 -1
  17. package/dist/stencil/index.cjs.map +1 -1
  18. package/dist/stencil/index.js +1595 -1
  19. package/dist/stencil/index.js.map +1 -1
  20. package/dist/stencil/index.umd.js +1595 -1
  21. package/dist/stencil/index.umd.js.map +1 -1
  22. package/dist/storybook/index.cjs +1633 -18
  23. package/dist/storybook/index.cjs.map +1 -1
  24. package/dist/storybook/index.js +1633 -18
  25. package/dist/storybook/index.js.map +1 -1
  26. package/dist/storybook/index.umd.js +1633 -18
  27. package/dist/storybook/index.umd.js.map +1 -1
  28. package/dist/vue/index.cjs.map +1 -1
  29. package/dist/vue/index.js.map +1 -1
  30. package/dist/vue/index.umd.js.map +1 -1
  31. package/package.json +15 -16
  32. package/rollup.config.mjs +1 -1
  33. package/src/locale/index.spec.ts +2 -1
  34. package/src/locale/locale.spec.ts +94 -1
  35. package/src/locale/locale.ts +27 -0
  36. package/src/playwright/utils/__snapshots__/utils.spec.ts.snap +4 -4
  37. package/src/playwright/utils/utils.spec.ts +1 -1
  38. package/src/playwright/utils/utils.ts +2 -2
  39. package/src/stencil/ide/ide.spec.ts +5 -1
  40. package/src/stencil/index.spec.ts +5 -1
  41. package/src/storybook/index.spec.ts +5 -1
  42. package/src/storybook/stencil/stencil.spec.ts +4 -0
  43. package/src/tests/unit/__snapshots__/unit.spec.ts.snap +4 -4
  44. package/src/utils/components/__snapshots__/components.spec.ts.snap +1 -1
@@ -9,13 +9,254 @@ var BUILD = {
9
9
  };
10
10
 
11
11
  /*
12
- Stencil Client Platform v4.38.0 | MIT Licensed | https://stenciljs.com
12
+ Stencil Client Platform v4.40.1 | MIT Licensed | https://stenciljs.com
13
13
  */
14
+ var __create = Object.create;
14
15
  var __defProp = Object.defineProperty;
16
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
17
+ var __getOwnPropNames = Object.getOwnPropertyNames;
18
+ var __getProtoOf = Object.getPrototypeOf;
19
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
20
+ var __typeError = (msg) => {
21
+ throw TypeError(msg);
22
+ };
23
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
24
+ var __commonJS = (cb, mod) => function __require() {
25
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
26
+ };
15
27
  var __export = (target, all) => {
16
28
  for (var name in all)
17
29
  __defProp(target, name, { get: all[name], enumerable: true });
18
30
  };
31
+ var __copyProps = (to, from, except, desc) => {
32
+ if (from && typeof from === "object" || typeof from === "function") {
33
+ for (let key of __getOwnPropNames(from))
34
+ if (!__hasOwnProp.call(to, key) && key !== except)
35
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
36
+ }
37
+ return to;
38
+ };
39
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
40
+ // If the importer is in node compatibility mode or this is not an ESM
41
+ // file that has been converted to a CommonJS file using a Babel-
42
+ // compatible transform (i.e. "__esModule" has not been set), then set
43
+ // "default" to the CommonJS "module.exports" for node compatibility.
44
+ __defProp(target, "default", { value: mod, enumerable: true }) ,
45
+ mod
46
+ ));
47
+ var __publicField = (obj, key, value) => __defNormalProp(obj, key + "" , value);
48
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
49
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
50
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
51
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
52
+ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
53
+
54
+ // node_modules/balanced-match/index.js
55
+ var require_balanced_match = __commonJS({
56
+ "node_modules/balanced-match/index.js"(exports$1, module) {
57
+ module.exports = balanced;
58
+ function balanced(a, b, str) {
59
+ if (a instanceof RegExp) a = maybeMatch(a, str);
60
+ if (b instanceof RegExp) b = maybeMatch(b, str);
61
+ var r = range(a, b, str);
62
+ return r && {
63
+ start: r[0],
64
+ end: r[1],
65
+ pre: str.slice(0, r[0]),
66
+ body: str.slice(r[0] + a.length, r[1]),
67
+ post: str.slice(r[1] + b.length)
68
+ };
69
+ }
70
+ function maybeMatch(reg, str) {
71
+ var m = str.match(reg);
72
+ return m ? m[0] : null;
73
+ }
74
+ balanced.range = range;
75
+ function range(a, b, str) {
76
+ var begs, beg, left, right, result;
77
+ var ai = str.indexOf(a);
78
+ var bi = str.indexOf(b, ai + 1);
79
+ var i2 = ai;
80
+ if (ai >= 0 && bi > 0) {
81
+ if (a === b) {
82
+ return [ai, bi];
83
+ }
84
+ begs = [];
85
+ left = str.length;
86
+ while (i2 >= 0 && !result) {
87
+ if (i2 == ai) {
88
+ begs.push(i2);
89
+ ai = str.indexOf(a, i2 + 1);
90
+ } else if (begs.length == 1) {
91
+ result = [begs.pop(), bi];
92
+ } else {
93
+ beg = begs.pop();
94
+ if (beg < left) {
95
+ left = beg;
96
+ right = bi;
97
+ }
98
+ bi = str.indexOf(b, i2 + 1);
99
+ }
100
+ i2 = ai < bi && ai >= 0 ? ai : bi;
101
+ }
102
+ if (begs.length) {
103
+ result = [left, right];
104
+ }
105
+ }
106
+ return result;
107
+ }
108
+ }
109
+ });
110
+
111
+ // node_modules/brace-expansion/index.js
112
+ var require_brace_expansion = __commonJS({
113
+ "node_modules/brace-expansion/index.js"(exports$1, module) {
114
+ var balanced = require_balanced_match();
115
+ module.exports = expandTop;
116
+ var escSlash = "\0SLASH" + Math.random() + "\0";
117
+ var escOpen = "\0OPEN" + Math.random() + "\0";
118
+ var escClose = "\0CLOSE" + Math.random() + "\0";
119
+ var escComma = "\0COMMA" + Math.random() + "\0";
120
+ var escPeriod = "\0PERIOD" + Math.random() + "\0";
121
+ function numeric(str) {
122
+ return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
123
+ }
124
+ function escapeBraces(str) {
125
+ return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
126
+ }
127
+ function unescapeBraces(str) {
128
+ return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
129
+ }
130
+ function parseCommaParts(str) {
131
+ if (!str)
132
+ return [""];
133
+ var parts = [];
134
+ var m = balanced("{", "}", str);
135
+ if (!m)
136
+ return str.split(",");
137
+ var pre = m.pre;
138
+ var body = m.body;
139
+ var post = m.post;
140
+ var p = pre.split(",");
141
+ p[p.length - 1] += "{" + body + "}";
142
+ var postParts = parseCommaParts(post);
143
+ if (post.length) {
144
+ p[p.length - 1] += postParts.shift();
145
+ p.push.apply(p, postParts);
146
+ }
147
+ parts.push.apply(parts, p);
148
+ return parts;
149
+ }
150
+ function expandTop(str) {
151
+ if (!str)
152
+ return [];
153
+ if (str.substr(0, 2) === "{}") {
154
+ str = "\\{\\}" + str.substr(2);
155
+ }
156
+ return expand2(escapeBraces(str), true).map(unescapeBraces);
157
+ }
158
+ function embrace(str) {
159
+ return "{" + str + "}";
160
+ }
161
+ function isPadded(el) {
162
+ return /^-?0\d/.test(el);
163
+ }
164
+ function lte(i2, y) {
165
+ return i2 <= y;
166
+ }
167
+ function gte(i2, y) {
168
+ return i2 >= y;
169
+ }
170
+ function expand2(str, isTop) {
171
+ var expansions = [];
172
+ var m = balanced("{", "}", str);
173
+ if (!m) return [str];
174
+ var pre = m.pre;
175
+ var post = m.post.length ? expand2(m.post, false) : [""];
176
+ if (/\$$/.test(m.pre)) {
177
+ for (var k = 0; k < post.length; k++) {
178
+ var expansion = pre + "{" + m.body + "}" + post[k];
179
+ expansions.push(expansion);
180
+ }
181
+ } else {
182
+ var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
183
+ var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
184
+ var isSequence = isNumericSequence || isAlphaSequence;
185
+ var isOptions = m.body.indexOf(",") >= 0;
186
+ if (!isSequence && !isOptions) {
187
+ if (m.post.match(/,(?!,).*\}/)) {
188
+ str = m.pre + "{" + m.body + escClose + m.post;
189
+ return expand2(str);
190
+ }
191
+ return [str];
192
+ }
193
+ var n;
194
+ if (isSequence) {
195
+ n = m.body.split(/\.\./);
196
+ } else {
197
+ n = parseCommaParts(m.body);
198
+ if (n.length === 1) {
199
+ n = expand2(n[0], false).map(embrace);
200
+ if (n.length === 1) {
201
+ return post.map(function(p) {
202
+ return m.pre + n[0] + p;
203
+ });
204
+ }
205
+ }
206
+ }
207
+ var N;
208
+ if (isSequence) {
209
+ var x = numeric(n[0]);
210
+ var y = numeric(n[1]);
211
+ var width = Math.max(n[0].length, n[1].length);
212
+ var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
213
+ var test = lte;
214
+ var reverse = y < x;
215
+ if (reverse) {
216
+ incr *= -1;
217
+ test = gte;
218
+ }
219
+ var pad = n.some(isPadded);
220
+ N = [];
221
+ for (var i2 = x; test(i2, y); i2 += incr) {
222
+ var c;
223
+ if (isAlphaSequence) {
224
+ c = String.fromCharCode(i2);
225
+ if (c === "\\")
226
+ c = "";
227
+ } else {
228
+ c = String(i2);
229
+ if (pad) {
230
+ var need = width - c.length;
231
+ if (need > 0) {
232
+ var z = new Array(need + 1).join("0");
233
+ if (i2 < 0)
234
+ c = "-" + z + c.slice(1);
235
+ else
236
+ c = z + c;
237
+ }
238
+ }
239
+ }
240
+ N.push(c);
241
+ }
242
+ } else {
243
+ N = [];
244
+ for (var j = 0; j < n.length; j++) {
245
+ N.push.apply(N, expand2(n[j], false));
246
+ }
247
+ }
248
+ for (var j = 0; j < N.length; j++) {
249
+ for (var k = 0; k < post.length; k++) {
250
+ var expansion = pre + N[j] + post[k];
251
+ if (!isTop || isSequence || expansion)
252
+ expansions.push(expansion);
253
+ }
254
+ }
255
+ }
256
+ return expansions;
257
+ }
258
+ }
259
+ });
19
260
 
20
261
  // src/utils/constants.ts
21
262
  var SVG_NS = "http://www.w3.org/2000/svg";
@@ -40,6 +281,1359 @@ var isComplexType = (o) => {
40
281
  return o === "object" || o === "function";
41
282
  };
42
283
 
284
+ // node_modules/minimatch/dist/esm/index.js
285
+ var import_brace_expansion = __toESM(require_brace_expansion());
286
+
287
+ // node_modules/minimatch/dist/esm/assert-valid-pattern.js
288
+ var MAX_PATTERN_LENGTH = 1024 * 64;
289
+ var assertValidPattern = (pattern) => {
290
+ if (typeof pattern !== "string") {
291
+ throw new TypeError("invalid pattern");
292
+ }
293
+ if (pattern.length > MAX_PATTERN_LENGTH) {
294
+ throw new TypeError("pattern is too long");
295
+ }
296
+ };
297
+
298
+ // node_modules/minimatch/dist/esm/brace-expressions.js
299
+ var posixClasses = {
300
+ "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
301
+ "[:alpha:]": ["\\p{L}\\p{Nl}", true],
302
+ "[:ascii:]": ["\\x00-\\x7f", false],
303
+ "[:blank:]": ["\\p{Zs}\\t", true],
304
+ "[:cntrl:]": ["\\p{Cc}", true],
305
+ "[:digit:]": ["\\p{Nd}", true],
306
+ "[:graph:]": ["\\p{Z}\\p{C}", true, true],
307
+ "[:lower:]": ["\\p{Ll}", true],
308
+ "[:print:]": ["\\p{C}", true],
309
+ "[:punct:]": ["\\p{P}", true],
310
+ "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true],
311
+ "[:upper:]": ["\\p{Lu}", true],
312
+ "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true],
313
+ "[:xdigit:]": ["A-Fa-f0-9", false]
314
+ };
315
+ var braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&");
316
+ var regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
317
+ var rangesToString = (ranges) => ranges.join("");
318
+ var parseClass = (glob, position) => {
319
+ const pos = position;
320
+ if (glob.charAt(pos) !== "[") {
321
+ throw new Error("not in a brace expression");
322
+ }
323
+ const ranges = [];
324
+ const negs = [];
325
+ let i2 = pos + 1;
326
+ let sawStart = false;
327
+ let uflag = false;
328
+ let escaping = false;
329
+ let negate = false;
330
+ let endPos = pos;
331
+ let rangeStart = "";
332
+ WHILE: while (i2 < glob.length) {
333
+ const c = glob.charAt(i2);
334
+ if ((c === "!" || c === "^") && i2 === pos + 1) {
335
+ negate = true;
336
+ i2++;
337
+ continue;
338
+ }
339
+ if (c === "]" && sawStart && !escaping) {
340
+ endPos = i2 + 1;
341
+ break;
342
+ }
343
+ sawStart = true;
344
+ if (c === "\\") {
345
+ if (!escaping) {
346
+ escaping = true;
347
+ i2++;
348
+ continue;
349
+ }
350
+ }
351
+ if (c === "[" && !escaping) {
352
+ for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
353
+ if (glob.startsWith(cls, i2)) {
354
+ if (rangeStart) {
355
+ return ["$.", false, glob.length - pos, true];
356
+ }
357
+ i2 += cls.length;
358
+ if (neg)
359
+ negs.push(unip);
360
+ else
361
+ ranges.push(unip);
362
+ uflag = uflag || u;
363
+ continue WHILE;
364
+ }
365
+ }
366
+ }
367
+ escaping = false;
368
+ if (rangeStart) {
369
+ if (c > rangeStart) {
370
+ ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));
371
+ } else if (c === rangeStart) {
372
+ ranges.push(braceEscape(c));
373
+ }
374
+ rangeStart = "";
375
+ i2++;
376
+ continue;
377
+ }
378
+ if (glob.startsWith("-]", i2 + 1)) {
379
+ ranges.push(braceEscape(c + "-"));
380
+ i2 += 2;
381
+ continue;
382
+ }
383
+ if (glob.startsWith("-", i2 + 1)) {
384
+ rangeStart = c;
385
+ i2 += 2;
386
+ continue;
387
+ }
388
+ ranges.push(braceEscape(c));
389
+ i2++;
390
+ }
391
+ if (endPos < i2) {
392
+ return ["", false, 0, false];
393
+ }
394
+ if (!ranges.length && !negs.length) {
395
+ return ["$.", false, glob.length - pos, true];
396
+ }
397
+ if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
398
+ const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
399
+ return [regexpEscape(r), false, endPos - pos, false];
400
+ }
401
+ const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
402
+ const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
403
+ const comb = ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs;
404
+ return [comb, uflag, endPos - pos, true];
405
+ };
406
+
407
+ // node_modules/minimatch/dist/esm/unescape.js
408
+ var unescape = (s, { windowsPathsNoEscape = false } = {}) => {
409
+ return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
410
+ };
411
+
412
+ // node_modules/minimatch/dist/esm/ast.js
413
+ var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
414
+ var isExtglobType = (c) => types.has(c);
415
+ var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
416
+ var startNoDot = "(?!\\.)";
417
+ var addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
418
+ var justDots = /* @__PURE__ */ new Set(["..", "."]);
419
+ var reSpecials = new Set("().*{}+?[]^$\\!");
420
+ var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
421
+ var qmark = "[^/]";
422
+ var star = qmark + "*?";
423
+ var starNoEmpty = qmark + "+?";
424
+ var _root, _hasMagic, _uflag, _parts, _parent, _parentIndex, _negs, _filledNegs, _options, _toString, _emptyExt, _AST_instances, fillNegs_fn, _AST_static, parseAST_fn, partsToRegExp_fn, parseGlob_fn;
425
+ var _AST = class _AST {
426
+ constructor(type, parent, options = {}) {
427
+ __privateAdd(this, _AST_instances);
428
+ __publicField(this, "type");
429
+ __privateAdd(this, _root);
430
+ __privateAdd(this, _hasMagic);
431
+ __privateAdd(this, _uflag, false);
432
+ __privateAdd(this, _parts, []);
433
+ __privateAdd(this, _parent);
434
+ __privateAdd(this, _parentIndex);
435
+ __privateAdd(this, _negs);
436
+ __privateAdd(this, _filledNegs, false);
437
+ __privateAdd(this, _options);
438
+ __privateAdd(this, _toString);
439
+ // set to true if it's an extglob with no children
440
+ // (which really means one child of '')
441
+ __privateAdd(this, _emptyExt, false);
442
+ this.type = type;
443
+ if (type)
444
+ __privateSet(this, _hasMagic, true);
445
+ __privateSet(this, _parent, parent);
446
+ __privateSet(this, _root, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _root) : this);
447
+ __privateSet(this, _options, __privateGet(this, _root) === this ? options : __privateGet(__privateGet(this, _root), _options));
448
+ __privateSet(this, _negs, __privateGet(this, _root) === this ? [] : __privateGet(__privateGet(this, _root), _negs));
449
+ if (type === "!" && !__privateGet(__privateGet(this, _root), _filledNegs))
450
+ __privateGet(this, _negs).push(this);
451
+ __privateSet(this, _parentIndex, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0);
452
+ }
453
+ get hasMagic() {
454
+ if (__privateGet(this, _hasMagic) !== void 0)
455
+ return __privateGet(this, _hasMagic);
456
+ for (const p of __privateGet(this, _parts)) {
457
+ if (typeof p === "string")
458
+ continue;
459
+ if (p.type || p.hasMagic)
460
+ return __privateSet(this, _hasMagic, true);
461
+ }
462
+ return __privateGet(this, _hasMagic);
463
+ }
464
+ // reconstructs the pattern
465
+ toString() {
466
+ if (__privateGet(this, _toString) !== void 0)
467
+ return __privateGet(this, _toString);
468
+ if (!this.type) {
469
+ return __privateSet(this, _toString, __privateGet(this, _parts).map((p) => String(p)).join(""));
470
+ } else {
471
+ return __privateSet(this, _toString, this.type + "(" + __privateGet(this, _parts).map((p) => String(p)).join("|") + ")");
472
+ }
473
+ }
474
+ push(...parts) {
475
+ for (const p of parts) {
476
+ if (p === "")
477
+ continue;
478
+ if (typeof p !== "string" && !(p instanceof _AST && __privateGet(p, _parent) === this)) {
479
+ throw new Error("invalid part: " + p);
480
+ }
481
+ __privateGet(this, _parts).push(p);
482
+ }
483
+ }
484
+ toJSON() {
485
+ var _a;
486
+ const ret = this.type === null ? __privateGet(this, _parts).slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...__privateGet(this, _parts).map((p) => p.toJSON())];
487
+ if (this.isStart() && !this.type)
488
+ ret.unshift([]);
489
+ if (this.isEnd() && (this === __privateGet(this, _root) || __privateGet(__privateGet(this, _root), _filledNegs) && ((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!")) {
490
+ ret.push({});
491
+ }
492
+ return ret;
493
+ }
494
+ isStart() {
495
+ var _a;
496
+ if (__privateGet(this, _root) === this)
497
+ return true;
498
+ if (!((_a = __privateGet(this, _parent)) == null ? void 0 : _a.isStart()))
499
+ return false;
500
+ if (__privateGet(this, _parentIndex) === 0)
501
+ return true;
502
+ const p = __privateGet(this, _parent);
503
+ for (let i2 = 0; i2 < __privateGet(this, _parentIndex); i2++) {
504
+ const pp = __privateGet(p, _parts)[i2];
505
+ if (!(pp instanceof _AST && pp.type === "!")) {
506
+ return false;
507
+ }
508
+ }
509
+ return true;
510
+ }
511
+ isEnd() {
512
+ var _a, _b, _c;
513
+ if (__privateGet(this, _root) === this)
514
+ return true;
515
+ if (((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!")
516
+ return true;
517
+ if (!((_b = __privateGet(this, _parent)) == null ? void 0 : _b.isEnd()))
518
+ return false;
519
+ if (!this.type)
520
+ return (_c = __privateGet(this, _parent)) == null ? void 0 : _c.isEnd();
521
+ const pl = __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0;
522
+ return __privateGet(this, _parentIndex) === pl - 1;
523
+ }
524
+ copyIn(part) {
525
+ if (typeof part === "string")
526
+ this.push(part);
527
+ else
528
+ this.push(part.clone(this));
529
+ }
530
+ clone(parent) {
531
+ const c = new _AST(this.type, parent);
532
+ for (const p of __privateGet(this, _parts)) {
533
+ c.copyIn(p);
534
+ }
535
+ return c;
536
+ }
537
+ static fromGlob(pattern, options = {}) {
538
+ var _a;
539
+ const ast = new _AST(null, void 0, options);
540
+ __privateMethod(_a = _AST, _AST_static, parseAST_fn).call(_a, pattern, ast, 0, options);
541
+ return ast;
542
+ }
543
+ // returns the regular expression if there's magic, or the unescaped
544
+ // string if not.
545
+ toMMPattern() {
546
+ if (this !== __privateGet(this, _root))
547
+ return __privateGet(this, _root).toMMPattern();
548
+ const glob = this.toString();
549
+ const [re, body, hasMagic, uflag] = this.toRegExpSource();
550
+ const anyMagic = hasMagic || __privateGet(this, _hasMagic) || __privateGet(this, _options).nocase && !__privateGet(this, _options).nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase();
551
+ if (!anyMagic) {
552
+ return body;
553
+ }
554
+ const flags = (__privateGet(this, _options).nocase ? "i" : "") + (uflag ? "u" : "");
555
+ return Object.assign(new RegExp(`^${re}$`, flags), {
556
+ _src: re,
557
+ _glob: glob
558
+ });
559
+ }
560
+ get options() {
561
+ return __privateGet(this, _options);
562
+ }
563
+ // returns the string match, the regexp source, whether there's magic
564
+ // in the regexp (so a regular expression is required) and whether or
565
+ // not the uflag is needed for the regular expression (for posix classes)
566
+ // TODO: instead of injecting the start/end at this point, just return
567
+ // the BODY of the regexp, along with the start/end portions suitable
568
+ // for binding the start/end in either a joined full-path makeRe context
569
+ // (where we bind to (^|/), or a standalone matchPart context (where
570
+ // we bind to ^, and not /). Otherwise slashes get duped!
571
+ //
572
+ // In part-matching mode, the start is:
573
+ // - if not isStart: nothing
574
+ // - if traversal possible, but not allowed: ^(?!\.\.?$)
575
+ // - if dots allowed or not possible: ^
576
+ // - if dots possible and not allowed: ^(?!\.)
577
+ // end is:
578
+ // - if not isEnd(): nothing
579
+ // - else: $
580
+ //
581
+ // In full-path matching mode, we put the slash at the START of the
582
+ // pattern, so start is:
583
+ // - if first pattern: same as part-matching mode
584
+ // - if not isStart(): nothing
585
+ // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
586
+ // - if dots allowed or not possible: /
587
+ // - if dots possible and not allowed: /(?!\.)
588
+ // end is:
589
+ // - if last pattern, same as part-matching mode
590
+ // - else nothing
591
+ //
592
+ // Always put the (?:$|/) on negated tails, though, because that has to be
593
+ // there to bind the end of the negated pattern portion, and it's easier to
594
+ // just stick it in now rather than try to inject it later in the middle of
595
+ // the pattern.
596
+ //
597
+ // We can just always return the same end, and leave it up to the caller
598
+ // to know whether it's going to be used joined or in parts.
599
+ // And, if the start is adjusted slightly, can do the same there:
600
+ // - if not isStart: nothing
601
+ // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
602
+ // - if dots allowed or not possible: (?:/|^)
603
+ // - if dots possible and not allowed: (?:/|^)(?!\.)
604
+ //
605
+ // But it's better to have a simpler binding without a conditional, for
606
+ // performance, so probably better to return both start options.
607
+ //
608
+ // Then the caller just ignores the end if it's not the first pattern,
609
+ // and the start always gets applied.
610
+ //
611
+ // But that's always going to be $ if it's the ending pattern, or nothing,
612
+ // so the caller can just attach $ at the end of the pattern when building.
613
+ //
614
+ // So the todo is:
615
+ // - better detect what kind of start is needed
616
+ // - return both flavors of starting pattern
617
+ // - attach $ at the end of the pattern when creating the actual RegExp
618
+ //
619
+ // Ah, but wait, no, that all only applies to the root when the first pattern
620
+ // is not an extglob. If the first pattern IS an extglob, then we need all
621
+ // that dot prevention biz to live in the extglob portions, because eg
622
+ // +(*|.x*) can match .xy but not .yx.
623
+ //
624
+ // So, return the two flavors if it's #root and the first child is not an
625
+ // AST, otherwise leave it to the child AST to handle it, and there,
626
+ // use the (?:^|/) style of start binding.
627
+ //
628
+ // Even simplified further:
629
+ // - Since the start for a join is eg /(?!\.) and the start for a part
630
+ // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
631
+ // or start or whatever) and prepend ^ or / at the Regexp construction.
632
+ toRegExpSource(allowDot) {
633
+ var _a;
634
+ const dot = allowDot != null ? allowDot : !!__privateGet(this, _options).dot;
635
+ if (__privateGet(this, _root) === this)
636
+ __privateMethod(this, _AST_instances, fillNegs_fn).call(this);
637
+ if (!this.type) {
638
+ const noEmpty = this.isStart() && this.isEnd();
639
+ const src = __privateGet(this, _parts).map((p) => {
640
+ var _a2;
641
+ const [re, _, hasMagic, uflag] = typeof p === "string" ? __privateMethod(_a2 = _AST, _AST_static, parseGlob_fn).call(_a2, p, __privateGet(this, _hasMagic), noEmpty) : p.toRegExpSource(allowDot);
642
+ __privateSet(this, _hasMagic, __privateGet(this, _hasMagic) || hasMagic);
643
+ __privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
644
+ return re;
645
+ }).join("");
646
+ let start2 = "";
647
+ if (this.isStart()) {
648
+ if (typeof __privateGet(this, _parts)[0] === "string") {
649
+ const dotTravAllowed = __privateGet(this, _parts).length === 1 && justDots.has(__privateGet(this, _parts)[0]);
650
+ if (!dotTravAllowed) {
651
+ const aps = addPatternStart;
652
+ const needNoTrav = (
653
+ // dots are allowed, and the pattern starts with [ or .
654
+ dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
655
+ src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
656
+ src.startsWith("\\.\\.") && aps.has(src.charAt(4))
657
+ );
658
+ const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
659
+ start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
660
+ }
661
+ }
662
+ }
663
+ let end = "";
664
+ if (this.isEnd() && __privateGet(__privateGet(this, _root), _filledNegs) && ((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!") {
665
+ end = "(?:$|\\/)";
666
+ }
667
+ const final2 = start2 + src + end;
668
+ return [
669
+ final2,
670
+ unescape(src),
671
+ __privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
672
+ __privateGet(this, _uflag)
673
+ ];
674
+ }
675
+ const repeated = this.type === "*" || this.type === "+";
676
+ const start = this.type === "!" ? "(?:(?!(?:" : "(?:";
677
+ let body = __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, dot);
678
+ if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
679
+ const s = this.toString();
680
+ __privateSet(this, _parts, [s]);
681
+ this.type = null;
682
+ __privateSet(this, _hasMagic, void 0);
683
+ return [s, unescape(this.toString()), false, false];
684
+ }
685
+ let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, true);
686
+ if (bodyDotAllowed === body) {
687
+ bodyDotAllowed = "";
688
+ }
689
+ if (bodyDotAllowed) {
690
+ body = `(?:${body})(?:${bodyDotAllowed})*?`;
691
+ }
692
+ let final = "";
693
+ if (this.type === "!" && __privateGet(this, _emptyExt)) {
694
+ final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
695
+ } else {
696
+ const close = this.type === "!" ? (
697
+ // !() must match something,but !(x) can match ''
698
+ "))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")"
699
+ ) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
700
+ final = start + body + close;
701
+ }
702
+ return [
703
+ final,
704
+ unescape(body),
705
+ __privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
706
+ __privateGet(this, _uflag)
707
+ ];
708
+ }
709
+ };
710
+ _root = new WeakMap();
711
+ _hasMagic = new WeakMap();
712
+ _uflag = new WeakMap();
713
+ _parts = new WeakMap();
714
+ _parent = new WeakMap();
715
+ _parentIndex = new WeakMap();
716
+ _negs = new WeakMap();
717
+ _filledNegs = new WeakMap();
718
+ _options = new WeakMap();
719
+ _toString = new WeakMap();
720
+ _emptyExt = new WeakMap();
721
+ _AST_instances = new WeakSet();
722
+ fillNegs_fn = function() {
723
+ if (this !== __privateGet(this, _root))
724
+ throw new Error("should only call on root");
725
+ if (__privateGet(this, _filledNegs))
726
+ return this;
727
+ this.toString();
728
+ __privateSet(this, _filledNegs, true);
729
+ let n;
730
+ while (n = __privateGet(this, _negs).pop()) {
731
+ if (n.type !== "!")
732
+ continue;
733
+ let p = n;
734
+ let pp = __privateGet(p, _parent);
735
+ while (pp) {
736
+ for (let i2 = __privateGet(p, _parentIndex) + 1; !pp.type && i2 < __privateGet(pp, _parts).length; i2++) {
737
+ for (const part of __privateGet(n, _parts)) {
738
+ if (typeof part === "string") {
739
+ throw new Error("string part in extglob AST??");
740
+ }
741
+ part.copyIn(__privateGet(pp, _parts)[i2]);
742
+ }
743
+ }
744
+ p = pp;
745
+ pp = __privateGet(p, _parent);
746
+ }
747
+ }
748
+ return this;
749
+ };
750
+ _AST_static = new WeakSet();
751
+ parseAST_fn = function(str, ast, pos, opt) {
752
+ var _a, _b;
753
+ let escaping = false;
754
+ let inBrace = false;
755
+ let braceStart = -1;
756
+ let braceNeg = false;
757
+ if (ast.type === null) {
758
+ let i3 = pos;
759
+ let acc2 = "";
760
+ while (i3 < str.length) {
761
+ const c = str.charAt(i3++);
762
+ if (escaping || c === "\\") {
763
+ escaping = !escaping;
764
+ acc2 += c;
765
+ continue;
766
+ }
767
+ if (inBrace) {
768
+ if (i3 === braceStart + 1) {
769
+ if (c === "^" || c === "!") {
770
+ braceNeg = true;
771
+ }
772
+ } else if (c === "]" && !(i3 === braceStart + 2 && braceNeg)) {
773
+ inBrace = false;
774
+ }
775
+ acc2 += c;
776
+ continue;
777
+ } else if (c === "[") {
778
+ inBrace = true;
779
+ braceStart = i3;
780
+ braceNeg = false;
781
+ acc2 += c;
782
+ continue;
783
+ }
784
+ if (!opt.noext && isExtglobType(c) && str.charAt(i3) === "(") {
785
+ ast.push(acc2);
786
+ acc2 = "";
787
+ const ext2 = new _AST(c, ast);
788
+ i3 = __privateMethod(_a = _AST, _AST_static, parseAST_fn).call(_a, str, ext2, i3, opt);
789
+ ast.push(ext2);
790
+ continue;
791
+ }
792
+ acc2 += c;
793
+ }
794
+ ast.push(acc2);
795
+ return i3;
796
+ }
797
+ let i2 = pos + 1;
798
+ let part = new _AST(null, ast);
799
+ const parts = [];
800
+ let acc = "";
801
+ while (i2 < str.length) {
802
+ const c = str.charAt(i2++);
803
+ if (escaping || c === "\\") {
804
+ escaping = !escaping;
805
+ acc += c;
806
+ continue;
807
+ }
808
+ if (inBrace) {
809
+ if (i2 === braceStart + 1) {
810
+ if (c === "^" || c === "!") {
811
+ braceNeg = true;
812
+ }
813
+ } else if (c === "]" && !(i2 === braceStart + 2 && braceNeg)) {
814
+ inBrace = false;
815
+ }
816
+ acc += c;
817
+ continue;
818
+ } else if (c === "[") {
819
+ inBrace = true;
820
+ braceStart = i2;
821
+ braceNeg = false;
822
+ acc += c;
823
+ continue;
824
+ }
825
+ if (isExtglobType(c) && str.charAt(i2) === "(") {
826
+ part.push(acc);
827
+ acc = "";
828
+ const ext2 = new _AST(c, part);
829
+ part.push(ext2);
830
+ i2 = __privateMethod(_b = _AST, _AST_static, parseAST_fn).call(_b, str, ext2, i2, opt);
831
+ continue;
832
+ }
833
+ if (c === "|") {
834
+ part.push(acc);
835
+ acc = "";
836
+ parts.push(part);
837
+ part = new _AST(null, ast);
838
+ continue;
839
+ }
840
+ if (c === ")") {
841
+ if (acc === "" && __privateGet(ast, _parts).length === 0) {
842
+ __privateSet(ast, _emptyExt, true);
843
+ }
844
+ part.push(acc);
845
+ acc = "";
846
+ ast.push(...parts, part);
847
+ return i2;
848
+ }
849
+ acc += c;
850
+ }
851
+ ast.type = null;
852
+ __privateSet(ast, _hasMagic, void 0);
853
+ __privateSet(ast, _parts, [str.substring(pos - 1)]);
854
+ return i2;
855
+ };
856
+ partsToRegExp_fn = function(dot) {
857
+ return __privateGet(this, _parts).map((p) => {
858
+ if (typeof p === "string") {
859
+ throw new Error("string type in extglob ast??");
860
+ }
861
+ const [re, _, _hasMagic2, uflag] = p.toRegExpSource(dot);
862
+ __privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
863
+ return re;
864
+ }).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
865
+ };
866
+ parseGlob_fn = function(glob, hasMagic, noEmpty = false) {
867
+ let escaping = false;
868
+ let re = "";
869
+ let uflag = false;
870
+ for (let i2 = 0; i2 < glob.length; i2++) {
871
+ const c = glob.charAt(i2);
872
+ if (escaping) {
873
+ escaping = false;
874
+ re += (reSpecials.has(c) ? "\\" : "") + c;
875
+ continue;
876
+ }
877
+ if (c === "\\") {
878
+ if (i2 === glob.length - 1) {
879
+ re += "\\\\";
880
+ } else {
881
+ escaping = true;
882
+ }
883
+ continue;
884
+ }
885
+ if (c === "[") {
886
+ const [src, needUflag, consumed, magic] = parseClass(glob, i2);
887
+ if (consumed) {
888
+ re += src;
889
+ uflag = uflag || needUflag;
890
+ i2 += consumed - 1;
891
+ hasMagic = hasMagic || magic;
892
+ continue;
893
+ }
894
+ }
895
+ if (c === "*") {
896
+ if (noEmpty && glob === "*")
897
+ re += starNoEmpty;
898
+ else
899
+ re += star;
900
+ hasMagic = true;
901
+ continue;
902
+ }
903
+ if (c === "?") {
904
+ re += qmark;
905
+ hasMagic = true;
906
+ continue;
907
+ }
908
+ re += regExpEscape(c);
909
+ }
910
+ return [re, unescape(glob), !!hasMagic, uflag];
911
+ };
912
+ __privateAdd(_AST, _AST_static);
913
+ var AST = _AST;
914
+
915
+ // node_modules/minimatch/dist/esm/escape.js
916
+ var escape = (s, { windowsPathsNoEscape = false } = {}) => {
917
+ return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
918
+ };
919
+
920
+ // node_modules/minimatch/dist/esm/index.js
921
+ var minimatch = (p, pattern, options = {}) => {
922
+ assertValidPattern(pattern);
923
+ if (!options.nocomment && pattern.charAt(0) === "#") {
924
+ return false;
925
+ }
926
+ return new Minimatch(pattern, options).match(p);
927
+ };
928
+ var starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
929
+ var starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2);
930
+ var starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2);
931
+ var starDotExtTestNocase = (ext2) => {
932
+ ext2 = ext2.toLowerCase();
933
+ return (f) => !f.startsWith(".") && f.toLowerCase().endsWith(ext2);
934
+ };
935
+ var starDotExtTestNocaseDot = (ext2) => {
936
+ ext2 = ext2.toLowerCase();
937
+ return (f) => f.toLowerCase().endsWith(ext2);
938
+ };
939
+ var starDotStarRE = /^\*+\.\*+$/;
940
+ var starDotStarTest = (f) => !f.startsWith(".") && f.includes(".");
941
+ var starDotStarTestDot = (f) => f !== "." && f !== ".." && f.includes(".");
942
+ var dotStarRE = /^\.\*+$/;
943
+ var dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith(".");
944
+ var starRE = /^\*+$/;
945
+ var starTest = (f) => f.length !== 0 && !f.startsWith(".");
946
+ var starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..";
947
+ var qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
948
+ var qmarksTestNocase = ([$0, ext2 = ""]) => {
949
+ const noext = qmarksTestNoExt([$0]);
950
+ if (!ext2)
951
+ return noext;
952
+ ext2 = ext2.toLowerCase();
953
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
954
+ };
955
+ var qmarksTestNocaseDot = ([$0, ext2 = ""]) => {
956
+ const noext = qmarksTestNoExtDot([$0]);
957
+ if (!ext2)
958
+ return noext;
959
+ ext2 = ext2.toLowerCase();
960
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
961
+ };
962
+ var qmarksTestDot = ([$0, ext2 = ""]) => {
963
+ const noext = qmarksTestNoExtDot([$0]);
964
+ return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
965
+ };
966
+ var qmarksTest = ([$0, ext2 = ""]) => {
967
+ const noext = qmarksTestNoExt([$0]);
968
+ return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
969
+ };
970
+ var qmarksTestNoExt = ([$0]) => {
971
+ const len = $0.length;
972
+ return (f) => f.length === len && !f.startsWith(".");
973
+ };
974
+ var qmarksTestNoExtDot = ([$0]) => {
975
+ const len = $0.length;
976
+ return (f) => f.length === len && f !== "." && f !== "..";
977
+ };
978
+ var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
979
+ var path = {
980
+ win32: { sep: "\\" },
981
+ posix: { sep: "/" }
982
+ };
983
+ var sep = defaultPlatform === "win32" ? path.win32.sep : path.posix.sep;
984
+ minimatch.sep = sep;
985
+ var GLOBSTAR = Symbol("globstar **");
986
+ minimatch.GLOBSTAR = GLOBSTAR;
987
+ var qmark2 = "[^/]";
988
+ var star2 = qmark2 + "*?";
989
+ var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
990
+ var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
991
+ var filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
992
+ minimatch.filter = filter;
993
+ var ext = (a, b = {}) => Object.assign({}, a, b);
994
+ var defaults = (def) => {
995
+ if (!def || typeof def !== "object" || !Object.keys(def).length) {
996
+ return minimatch;
997
+ }
998
+ const orig = minimatch;
999
+ const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
1000
+ return Object.assign(m, {
1001
+ Minimatch: class Minimatch extends orig.Minimatch {
1002
+ constructor(pattern, options = {}) {
1003
+ super(pattern, ext(def, options));
1004
+ }
1005
+ static defaults(options) {
1006
+ return orig.defaults(ext(def, options)).Minimatch;
1007
+ }
1008
+ },
1009
+ AST: class AST extends orig.AST {
1010
+ /* c8 ignore start */
1011
+ constructor(type, parent, options = {}) {
1012
+ super(type, parent, ext(def, options));
1013
+ }
1014
+ /* c8 ignore stop */
1015
+ static fromGlob(pattern, options = {}) {
1016
+ return orig.AST.fromGlob(pattern, ext(def, options));
1017
+ }
1018
+ },
1019
+ unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
1020
+ escape: (s, options = {}) => orig.escape(s, ext(def, options)),
1021
+ filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
1022
+ defaults: (options) => orig.defaults(ext(def, options)),
1023
+ makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
1024
+ braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
1025
+ match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
1026
+ sep: orig.sep,
1027
+ GLOBSTAR
1028
+ });
1029
+ };
1030
+ minimatch.defaults = defaults;
1031
+ var braceExpand = (pattern, options = {}) => {
1032
+ assertValidPattern(pattern);
1033
+ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
1034
+ return [pattern];
1035
+ }
1036
+ return (0, import_brace_expansion.default)(pattern);
1037
+ };
1038
+ minimatch.braceExpand = braceExpand;
1039
+ var makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
1040
+ minimatch.makeRe = makeRe;
1041
+ var match = (list, pattern, options = {}) => {
1042
+ const mm = new Minimatch(pattern, options);
1043
+ list = list.filter((f) => mm.match(f));
1044
+ if (mm.options.nonull && !list.length) {
1045
+ list.push(pattern);
1046
+ }
1047
+ return list;
1048
+ };
1049
+ minimatch.match = match;
1050
+ var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
1051
+ var regExpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
1052
+ var Minimatch = class {
1053
+ options;
1054
+ set;
1055
+ pattern;
1056
+ windowsPathsNoEscape;
1057
+ nonegate;
1058
+ negate;
1059
+ comment;
1060
+ empty;
1061
+ preserveMultipleSlashes;
1062
+ partial;
1063
+ globSet;
1064
+ globParts;
1065
+ nocase;
1066
+ isWindows;
1067
+ platform;
1068
+ windowsNoMagicRoot;
1069
+ regexp;
1070
+ constructor(pattern, options = {}) {
1071
+ assertValidPattern(pattern);
1072
+ options = options || {};
1073
+ this.options = options;
1074
+ this.pattern = pattern;
1075
+ this.platform = options.platform || defaultPlatform;
1076
+ this.isWindows = this.platform === "win32";
1077
+ this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
1078
+ if (this.windowsPathsNoEscape) {
1079
+ this.pattern = this.pattern.replace(/\\/g, "/");
1080
+ }
1081
+ this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
1082
+ this.regexp = null;
1083
+ this.negate = false;
1084
+ this.nonegate = !!options.nonegate;
1085
+ this.comment = false;
1086
+ this.empty = false;
1087
+ this.partial = !!options.partial;
1088
+ this.nocase = !!this.options.nocase;
1089
+ this.windowsNoMagicRoot = options.windowsNoMagicRoot !== void 0 ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase);
1090
+ this.globSet = [];
1091
+ this.globParts = [];
1092
+ this.set = [];
1093
+ this.make();
1094
+ }
1095
+ hasMagic() {
1096
+ if (this.options.magicalBraces && this.set.length > 1) {
1097
+ return true;
1098
+ }
1099
+ for (const pattern of this.set) {
1100
+ for (const part of pattern) {
1101
+ if (typeof part !== "string")
1102
+ return true;
1103
+ }
1104
+ }
1105
+ return false;
1106
+ }
1107
+ debug(..._) {
1108
+ }
1109
+ make() {
1110
+ const pattern = this.pattern;
1111
+ const options = this.options;
1112
+ if (!options.nocomment && pattern.charAt(0) === "#") {
1113
+ this.comment = true;
1114
+ return;
1115
+ }
1116
+ if (!pattern) {
1117
+ this.empty = true;
1118
+ return;
1119
+ }
1120
+ this.parseNegate();
1121
+ this.globSet = [...new Set(this.braceExpand())];
1122
+ if (options.debug) {
1123
+ this.debug = (...args) => console.error(...args);
1124
+ }
1125
+ this.debug(this.pattern, this.globSet);
1126
+ const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
1127
+ this.globParts = this.preprocess(rawGlobParts);
1128
+ this.debug(this.pattern, this.globParts);
1129
+ let set = this.globParts.map((s, _, __) => {
1130
+ if (this.isWindows && this.windowsNoMagicRoot) {
1131
+ const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
1132
+ const isDrive = /^[a-z]:/i.test(s[0]);
1133
+ if (isUNC) {
1134
+ return [...s.slice(0, 4), ...s.slice(4).map((ss) => this.parse(ss))];
1135
+ } else if (isDrive) {
1136
+ return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
1137
+ }
1138
+ }
1139
+ return s.map((ss) => this.parse(ss));
1140
+ });
1141
+ this.debug(this.pattern, set);
1142
+ this.set = set.filter((s) => s.indexOf(false) === -1);
1143
+ if (this.isWindows) {
1144
+ for (let i2 = 0; i2 < this.set.length; i2++) {
1145
+ const p = this.set[i2];
1146
+ if (p[0] === "" && p[1] === "" && this.globParts[i2][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) {
1147
+ p[2] = "?";
1148
+ }
1149
+ }
1150
+ }
1151
+ this.debug(this.pattern, this.set);
1152
+ }
1153
+ // various transforms to equivalent pattern sets that are
1154
+ // faster to process in a filesystem walk. The goal is to
1155
+ // eliminate what we can, and push all ** patterns as far
1156
+ // to the right as possible, even if it increases the number
1157
+ // of patterns that we have to process.
1158
+ preprocess(globParts) {
1159
+ if (this.options.noglobstar) {
1160
+ for (let i2 = 0; i2 < globParts.length; i2++) {
1161
+ for (let j = 0; j < globParts[i2].length; j++) {
1162
+ if (globParts[i2][j] === "**") {
1163
+ globParts[i2][j] = "*";
1164
+ }
1165
+ }
1166
+ }
1167
+ }
1168
+ const { optimizationLevel = 1 } = this.options;
1169
+ if (optimizationLevel >= 2) {
1170
+ globParts = this.firstPhasePreProcess(globParts);
1171
+ globParts = this.secondPhasePreProcess(globParts);
1172
+ } else if (optimizationLevel >= 1) {
1173
+ globParts = this.levelOneOptimize(globParts);
1174
+ } else {
1175
+ globParts = this.adjascentGlobstarOptimize(globParts);
1176
+ }
1177
+ return globParts;
1178
+ }
1179
+ // just get rid of adjascent ** portions
1180
+ adjascentGlobstarOptimize(globParts) {
1181
+ return globParts.map((parts) => {
1182
+ let gs = -1;
1183
+ while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
1184
+ let i2 = gs;
1185
+ while (parts[i2 + 1] === "**") {
1186
+ i2++;
1187
+ }
1188
+ if (i2 !== gs) {
1189
+ parts.splice(gs, i2 - gs);
1190
+ }
1191
+ }
1192
+ return parts;
1193
+ });
1194
+ }
1195
+ // get rid of adjascent ** and resolve .. portions
1196
+ levelOneOptimize(globParts) {
1197
+ return globParts.map((parts) => {
1198
+ parts = parts.reduce((set, part) => {
1199
+ const prev = set[set.length - 1];
1200
+ if (part === "**" && prev === "**") {
1201
+ return set;
1202
+ }
1203
+ if (part === "..") {
1204
+ if (prev && prev !== ".." && prev !== "." && prev !== "**") {
1205
+ set.pop();
1206
+ return set;
1207
+ }
1208
+ }
1209
+ set.push(part);
1210
+ return set;
1211
+ }, []);
1212
+ return parts.length === 0 ? [""] : parts;
1213
+ });
1214
+ }
1215
+ levelTwoFileOptimize(parts) {
1216
+ if (!Array.isArray(parts)) {
1217
+ parts = this.slashSplit(parts);
1218
+ }
1219
+ let didSomething = false;
1220
+ do {
1221
+ didSomething = false;
1222
+ if (!this.preserveMultipleSlashes) {
1223
+ for (let i2 = 1; i2 < parts.length - 1; i2++) {
1224
+ const p = parts[i2];
1225
+ if (i2 === 1 && p === "" && parts[0] === "")
1226
+ continue;
1227
+ if (p === "." || p === "") {
1228
+ didSomething = true;
1229
+ parts.splice(i2, 1);
1230
+ i2--;
1231
+ }
1232
+ }
1233
+ if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
1234
+ didSomething = true;
1235
+ parts.pop();
1236
+ }
1237
+ }
1238
+ let dd = 0;
1239
+ while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
1240
+ const p = parts[dd - 1];
1241
+ if (p && p !== "." && p !== ".." && p !== "**") {
1242
+ didSomething = true;
1243
+ parts.splice(dd - 1, 2);
1244
+ dd -= 2;
1245
+ }
1246
+ }
1247
+ } while (didSomething);
1248
+ return parts.length === 0 ? [""] : parts;
1249
+ }
1250
+ // First phase: single-pattern processing
1251
+ // <pre> is 1 or more portions
1252
+ // <rest> is 1 or more portions
1253
+ // <p> is any portion other than ., .., '', or **
1254
+ // <e> is . or ''
1255
+ //
1256
+ // **/.. is *brutal* for filesystem walking performance, because
1257
+ // it effectively resets the recursive walk each time it occurs,
1258
+ // and ** cannot be reduced out by a .. pattern part like a regexp
1259
+ // or most strings (other than .., ., and '') can be.
1260
+ //
1261
+ // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
1262
+ // <pre>/<e>/<rest> -> <pre>/<rest>
1263
+ // <pre>/<p>/../<rest> -> <pre>/<rest>
1264
+ // **/**/<rest> -> **/<rest>
1265
+ //
1266
+ // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
1267
+ // this WOULD be allowed if ** did follow symlinks, or * didn't
1268
+ firstPhasePreProcess(globParts) {
1269
+ let didSomething = false;
1270
+ do {
1271
+ didSomething = false;
1272
+ for (let parts of globParts) {
1273
+ let gs = -1;
1274
+ while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
1275
+ let gss = gs;
1276
+ while (parts[gss + 1] === "**") {
1277
+ gss++;
1278
+ }
1279
+ if (gss > gs) {
1280
+ parts.splice(gs + 1, gss - gs);
1281
+ }
1282
+ let next = parts[gs + 1];
1283
+ const p = parts[gs + 2];
1284
+ const p2 = parts[gs + 3];
1285
+ if (next !== "..")
1286
+ continue;
1287
+ if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") {
1288
+ continue;
1289
+ }
1290
+ didSomething = true;
1291
+ parts.splice(gs, 1);
1292
+ const other = parts.slice(0);
1293
+ other[gs] = "**";
1294
+ globParts.push(other);
1295
+ gs--;
1296
+ }
1297
+ if (!this.preserveMultipleSlashes) {
1298
+ for (let i2 = 1; i2 < parts.length - 1; i2++) {
1299
+ const p = parts[i2];
1300
+ if (i2 === 1 && p === "" && parts[0] === "")
1301
+ continue;
1302
+ if (p === "." || p === "") {
1303
+ didSomething = true;
1304
+ parts.splice(i2, 1);
1305
+ i2--;
1306
+ }
1307
+ }
1308
+ if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
1309
+ didSomething = true;
1310
+ parts.pop();
1311
+ }
1312
+ }
1313
+ let dd = 0;
1314
+ while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
1315
+ const p = parts[dd - 1];
1316
+ if (p && p !== "." && p !== ".." && p !== "**") {
1317
+ didSomething = true;
1318
+ const needDot = dd === 1 && parts[dd + 1] === "**";
1319
+ const splin = needDot ? ["."] : [];
1320
+ parts.splice(dd - 1, 2, ...splin);
1321
+ if (parts.length === 0)
1322
+ parts.push("");
1323
+ dd -= 2;
1324
+ }
1325
+ }
1326
+ }
1327
+ } while (didSomething);
1328
+ return globParts;
1329
+ }
1330
+ // second phase: multi-pattern dedupes
1331
+ // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
1332
+ // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
1333
+ // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
1334
+ //
1335
+ // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
1336
+ // ^-- not valid because ** doens't follow symlinks
1337
+ secondPhasePreProcess(globParts) {
1338
+ for (let i2 = 0; i2 < globParts.length - 1; i2++) {
1339
+ for (let j = i2 + 1; j < globParts.length; j++) {
1340
+ const matched = this.partsMatch(globParts[i2], globParts[j], !this.preserveMultipleSlashes);
1341
+ if (!matched)
1342
+ continue;
1343
+ globParts[i2] = matched;
1344
+ globParts[j] = [];
1345
+ }
1346
+ }
1347
+ return globParts.filter((gs) => gs.length);
1348
+ }
1349
+ partsMatch(a, b, emptyGSMatch = false) {
1350
+ let ai = 0;
1351
+ let bi = 0;
1352
+ let result = [];
1353
+ let which = "";
1354
+ while (ai < a.length && bi < b.length) {
1355
+ if (a[ai] === b[bi]) {
1356
+ result.push(which === "b" ? b[bi] : a[ai]);
1357
+ ai++;
1358
+ bi++;
1359
+ } else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1]) {
1360
+ result.push(a[ai]);
1361
+ ai++;
1362
+ } else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1]) {
1363
+ result.push(b[bi]);
1364
+ bi++;
1365
+ } else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
1366
+ if (which === "b")
1367
+ return false;
1368
+ which = "a";
1369
+ result.push(a[ai]);
1370
+ ai++;
1371
+ bi++;
1372
+ } else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
1373
+ if (which === "a")
1374
+ return false;
1375
+ which = "b";
1376
+ result.push(b[bi]);
1377
+ ai++;
1378
+ bi++;
1379
+ } else {
1380
+ return false;
1381
+ }
1382
+ }
1383
+ return a.length === b.length && result;
1384
+ }
1385
+ parseNegate() {
1386
+ if (this.nonegate)
1387
+ return;
1388
+ const pattern = this.pattern;
1389
+ let negate = false;
1390
+ let negateOffset = 0;
1391
+ for (let i2 = 0; i2 < pattern.length && pattern.charAt(i2) === "!"; i2++) {
1392
+ negate = !negate;
1393
+ negateOffset++;
1394
+ }
1395
+ if (negateOffset)
1396
+ this.pattern = pattern.slice(negateOffset);
1397
+ this.negate = negate;
1398
+ }
1399
+ // set partial to true to test if, for example,
1400
+ // "/a/b" matches the start of "/*/b/*/d"
1401
+ // Partial means, if you run out of file before you run
1402
+ // out of pattern, then that's fine, as long as all
1403
+ // the parts match.
1404
+ matchOne(file, pattern, partial = false) {
1405
+ const options = this.options;
1406
+ if (this.isWindows) {
1407
+ const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
1408
+ const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
1409
+ const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
1410
+ const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
1411
+ const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
1412
+ const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
1413
+ if (typeof fdi === "number" && typeof pdi === "number") {
1414
+ const [fd, pd] = [file[fdi], pattern[pdi]];
1415
+ if (fd.toLowerCase() === pd.toLowerCase()) {
1416
+ pattern[pdi] = fd;
1417
+ if (pdi > fdi) {
1418
+ pattern = pattern.slice(pdi);
1419
+ } else if (fdi > pdi) {
1420
+ file = file.slice(fdi);
1421
+ }
1422
+ }
1423
+ }
1424
+ }
1425
+ const { optimizationLevel = 1 } = this.options;
1426
+ if (optimizationLevel >= 2) {
1427
+ file = this.levelTwoFileOptimize(file);
1428
+ }
1429
+ this.debug("matchOne", this, { file, pattern });
1430
+ this.debug("matchOne", file.length, pattern.length);
1431
+ for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
1432
+ this.debug("matchOne loop");
1433
+ var p = pattern[pi];
1434
+ var f = file[fi];
1435
+ this.debug(pattern, p, f);
1436
+ if (p === false) {
1437
+ return false;
1438
+ }
1439
+ if (p === GLOBSTAR) {
1440
+ this.debug("GLOBSTAR", [pattern, p, f]);
1441
+ var fr = fi;
1442
+ var pr = pi + 1;
1443
+ if (pr === pl) {
1444
+ this.debug("** at the end");
1445
+ for (; fi < fl; fi++) {
1446
+ if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
1447
+ return false;
1448
+ }
1449
+ return true;
1450
+ }
1451
+ while (fr < fl) {
1452
+ var swallowee = file[fr];
1453
+ this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
1454
+ if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
1455
+ this.debug("globstar found match!", fr, fl, swallowee);
1456
+ return true;
1457
+ } else {
1458
+ if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
1459
+ this.debug("dot detected!", file, fr, pattern, pr);
1460
+ break;
1461
+ }
1462
+ this.debug("globstar swallow a segment, and continue");
1463
+ fr++;
1464
+ }
1465
+ }
1466
+ if (partial) {
1467
+ this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
1468
+ if (fr === fl) {
1469
+ return true;
1470
+ }
1471
+ }
1472
+ return false;
1473
+ }
1474
+ let hit;
1475
+ if (typeof p === "string") {
1476
+ hit = f === p;
1477
+ this.debug("string match", p, f, hit);
1478
+ } else {
1479
+ hit = p.test(f);
1480
+ this.debug("pattern match", p, f, hit);
1481
+ }
1482
+ if (!hit)
1483
+ return false;
1484
+ }
1485
+ if (fi === fl && pi === pl) {
1486
+ return true;
1487
+ } else if (fi === fl) {
1488
+ return partial;
1489
+ } else if (pi === pl) {
1490
+ return fi === fl - 1 && file[fi] === "";
1491
+ } else {
1492
+ throw new Error("wtf?");
1493
+ }
1494
+ }
1495
+ braceExpand() {
1496
+ return braceExpand(this.pattern, this.options);
1497
+ }
1498
+ parse(pattern) {
1499
+ assertValidPattern(pattern);
1500
+ const options = this.options;
1501
+ if (pattern === "**")
1502
+ return GLOBSTAR;
1503
+ if (pattern === "")
1504
+ return "";
1505
+ let m;
1506
+ let fastTest = null;
1507
+ if (m = pattern.match(starRE)) {
1508
+ fastTest = options.dot ? starTestDot : starTest;
1509
+ } else if (m = pattern.match(starDotExtRE)) {
1510
+ fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m[1]);
1511
+ } else if (m = pattern.match(qmarksRE)) {
1512
+ fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m);
1513
+ } else if (m = pattern.match(starDotStarRE)) {
1514
+ fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
1515
+ } else if (m = pattern.match(dotStarRE)) {
1516
+ fastTest = dotStarTest;
1517
+ }
1518
+ const re = AST.fromGlob(pattern, this.options).toMMPattern();
1519
+ if (fastTest && typeof re === "object") {
1520
+ Reflect.defineProperty(re, "test", { value: fastTest });
1521
+ }
1522
+ return re;
1523
+ }
1524
+ makeRe() {
1525
+ if (this.regexp || this.regexp === false)
1526
+ return this.regexp;
1527
+ const set = this.set;
1528
+ if (!set.length) {
1529
+ this.regexp = false;
1530
+ return this.regexp;
1531
+ }
1532
+ const options = this.options;
1533
+ const twoStar = options.noglobstar ? star2 : options.dot ? twoStarDot : twoStarNoDot;
1534
+ const flags = new Set(options.nocase ? ["i"] : []);
1535
+ let re = set.map((pattern) => {
1536
+ const pp = pattern.map((p) => {
1537
+ if (p instanceof RegExp) {
1538
+ for (const f of p.flags.split(""))
1539
+ flags.add(f);
1540
+ }
1541
+ return typeof p === "string" ? regExpEscape2(p) : p === GLOBSTAR ? GLOBSTAR : p._src;
1542
+ });
1543
+ pp.forEach((p, i2) => {
1544
+ const next = pp[i2 + 1];
1545
+ const prev = pp[i2 - 1];
1546
+ if (p !== GLOBSTAR || prev === GLOBSTAR) {
1547
+ return;
1548
+ }
1549
+ if (prev === void 0) {
1550
+ if (next !== void 0 && next !== GLOBSTAR) {
1551
+ pp[i2 + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
1552
+ } else {
1553
+ pp[i2] = twoStar;
1554
+ }
1555
+ } else if (next === void 0) {
1556
+ pp[i2 - 1] = prev + "(?:\\/|" + twoStar + ")?";
1557
+ } else if (next !== GLOBSTAR) {
1558
+ pp[i2 - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
1559
+ pp[i2 + 1] = GLOBSTAR;
1560
+ }
1561
+ });
1562
+ return pp.filter((p) => p !== GLOBSTAR).join("/");
1563
+ }).join("|");
1564
+ const [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
1565
+ re = "^" + open + re + close + "$";
1566
+ if (this.negate)
1567
+ re = "^(?!" + re + ").+$";
1568
+ try {
1569
+ this.regexp = new RegExp(re, [...flags].join(""));
1570
+ } catch (ex) {
1571
+ this.regexp = false;
1572
+ }
1573
+ return this.regexp;
1574
+ }
1575
+ slashSplit(p) {
1576
+ if (this.preserveMultipleSlashes) {
1577
+ return p.split("/");
1578
+ } else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
1579
+ return ["", ...p.split(/\/+/)];
1580
+ } else {
1581
+ return p.split(/\/+/);
1582
+ }
1583
+ }
1584
+ match(f, partial = this.partial) {
1585
+ this.debug("match", f, this.pattern);
1586
+ if (this.comment) {
1587
+ return false;
1588
+ }
1589
+ if (this.empty) {
1590
+ return f === "";
1591
+ }
1592
+ if (f === "/" && partial) {
1593
+ return true;
1594
+ }
1595
+ const options = this.options;
1596
+ if (this.isWindows) {
1597
+ f = f.split("\\").join("/");
1598
+ }
1599
+ const ff = this.slashSplit(f);
1600
+ this.debug(this.pattern, "split", ff);
1601
+ const set = this.set;
1602
+ this.debug(this.pattern, "set", set);
1603
+ let filename = ff[ff.length - 1];
1604
+ if (!filename) {
1605
+ for (let i2 = ff.length - 2; !filename && i2 >= 0; i2--) {
1606
+ filename = ff[i2];
1607
+ }
1608
+ }
1609
+ for (let i2 = 0; i2 < set.length; i2++) {
1610
+ const pattern = set[i2];
1611
+ let file = ff;
1612
+ if (options.matchBase && pattern.length === 1) {
1613
+ file = [filename];
1614
+ }
1615
+ const hit = this.matchOne(file, pattern, partial);
1616
+ if (hit) {
1617
+ if (options.flipNegate) {
1618
+ return true;
1619
+ }
1620
+ return !this.negate;
1621
+ }
1622
+ }
1623
+ if (options.flipNegate) {
1624
+ return false;
1625
+ }
1626
+ return this.negate;
1627
+ }
1628
+ static defaults(def) {
1629
+ return minimatch.defaults(def).Minimatch;
1630
+ }
1631
+ };
1632
+ minimatch.AST = AST;
1633
+ minimatch.Minimatch = Minimatch;
1634
+ minimatch.escape = escape;
1635
+ minimatch.unescape = unescape;
1636
+
43
1637
  // src/utils/regular-expression.ts
44
1638
  var escapeRegExpSpecialCharacters = (text) => {
45
1639
  return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -485,10 +2079,11 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
485
2079
  elm.classList.add(elm["s-si"] = scopeId);
486
2080
  }
487
2081
  if (newVNode2.$children$) {
2082
+ const appendTarget = newVNode2.$tag$ === "template" ? elm.content : elm;
488
2083
  for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
489
2084
  childNode = createElm(oldParentVNode, newVNode2, i2);
490
2085
  if (childNode) {
491
- elm.appendChild(childNode);
2086
+ appendTarget.appendChild(childNode);
492
2087
  }
493
2088
  }
494
2089
  }
@@ -546,6 +2141,9 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
546
2141
  if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
547
2142
  containerElm = containerElm.shadowRoot;
548
2143
  }
2144
+ if (parentVNode.$tag$ === "template") {
2145
+ containerElm = containerElm.content;
2146
+ }
549
2147
  for (; startIdx <= endIdx; ++startIdx) {
550
2148
  if (vnodes[startIdx]) {
551
2149
  childNode = createElm(null, parentVNode, startIdx);
@@ -589,6 +2187,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
589
2187
  let newEndVnode = newCh[newEndIdx];
590
2188
  let node;
591
2189
  let elmToMove;
2190
+ const containerElm = newVNode2.$tag$ === "template" ? parentElm.content : parentElm;
592
2191
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
593
2192
  if (oldStartVnode == null) {
594
2193
  oldStartVnode = oldCh[++oldStartIdx];
@@ -611,7 +2210,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
611
2210
  putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
612
2211
  }
613
2212
  patch(oldStartVnode, newEndVnode, isInitialRender);
614
- insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
2213
+ insertBefore(containerElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
615
2214
  oldStartVnode = oldCh[++oldStartIdx];
616
2215
  newEndVnode = newCh[--newEndIdx];
617
2216
  } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
@@ -619,7 +2218,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
619
2218
  putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
620
2219
  }
621
2220
  patch(oldEndVnode, newStartVnode, isInitialRender);
622
- insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
2221
+ insertBefore(containerElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
623
2222
  oldEndVnode = oldCh[--oldEndIdx];
624
2223
  newStartVnode = newCh[++newStartIdx];
625
2224
  } else {
@@ -860,13 +2459,16 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
860
2459
  for (const relocateData of relocateNodes) {
861
2460
  const nodeToRelocate = relocateData.$nodeToRelocate$;
862
2461
  const slotRefNode = relocateData.$slotRefNode$;
2462
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */ && isInitialLoad) {
2463
+ nodeToRelocate["s-ih"] = (_a = nodeToRelocate.hidden) != null ? _a : false;
2464
+ }
863
2465
  if (slotRefNode) {
864
2466
  const parentNodeRef = slotRefNode.parentNode;
865
2467
  let insertBeforeNode = slotRefNode.nextSibling;
866
2468
  {
867
- let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
2469
+ let orgLocationNode = (_b = nodeToRelocate["s-ol"]) == null ? void 0 : _b.previousSibling;
868
2470
  while (orgLocationNode) {
869
- let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
2471
+ let refNode = (_c = orgLocationNode["s-nr"]) != null ? _c : null;
870
2472
  if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
871
2473
  refNode = refNode.nextSibling;
872
2474
  while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
@@ -889,18 +2491,13 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
889
2491
  }
890
2492
  insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
891
2493
  if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
892
- nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
2494
+ nodeToRelocate.hidden = (_d = nodeToRelocate["s-ih"]) != null ? _d : false;
893
2495
  }
894
2496
  }
895
2497
  }
896
2498
  nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
897
- } else {
898
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
899
- if (isInitialLoad) {
900
- nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
901
- }
902
- nodeToRelocate.hidden = true;
903
- }
2499
+ } else if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
2500
+ nodeToRelocate.hidden = true;
904
2501
  }
905
2502
  }
906
2503
  }
@@ -913,7 +2510,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
913
2510
  if (BUILD.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
914
2511
  const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
915
2512
  for (const childNode of children) {
916
- if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
2513
+ if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"] && childNode.nodeType === 1 /* ElementNode */) {
917
2514
  if (isInitialLoad && childNode["s-ih"] == null) {
918
2515
  childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
919
2516
  }
@@ -1578,7 +3175,7 @@ let ignore_map$1;
1578
3175
  */
1579
3176
  const minify = (html, config) => {
1580
3177
  let reinsert_ignored = false;
1581
- const { checked_html, ignored } = getState();
3178
+ const { checked_html, ignored, constants } = getState();
1582
3179
 
1583
3180
  if (!checked_html && !isHtml(html)) return html
1584
3181
 
@@ -1609,6 +3206,18 @@ const minify = (html, config) => {
1609
3206
  // Collapse any remaining multiple spaces to single spaces.
1610
3207
  html = html.replace(/ {2,}/g, ' ');
1611
3208
 
3209
+ // Protect space between text content and an opening tag (e.g., "text <a>")
3210
+ html = html.replace(
3211
+ /(\S) (<[a-zA-Z][a-zA-Z0-9_:-]*)/g,
3212
+ `$1___MINIFY-PROTECTED-SPACE___$2`
3213
+ );
3214
+
3215
+ // Protect space between a closing tag and text content (e.g., "</a> text")
3216
+ html = html.replace(
3217
+ /(<\/[a-zA-Z][a-zA-Z0-9_:-]*>) (\S)/g,
3218
+ `$1___MINIFY-PROTECTED-SPACE___$2`
3219
+ );
3220
+
1612
3221
  // Remove specific single spaces between tags and whitespace within tags.
1613
3222
  html = html.replace(/ >/g, ">"); // <tag > -> <tag>
1614
3223
  html = html.replace(/ </g, "<"); // leading space before tag
@@ -1617,6 +3226,9 @@ const minify = (html, config) => {
1617
3226
  html = html.replace(/<\s+\//g, '</'); // < /tag> -> </tag>
1618
3227
  html = html.replace(/<\/\s+/g, '</'); // </ tag> -> </tag>
1619
3228
 
3229
+ // Unprotect space around inner tags
3230
+ html = html.replace(new RegExp('___MINIFY-PROTECTED-SPACE___', 'g'), ' ');
3231
+
1620
3232
  // Trim spaces around equals signs in attributes (run before value trim)
1621
3233
  // This handles `attr = "value"` -> `attr="value"`
1622
3234
  html = html.replace(/ = /g, "=");
@@ -1692,7 +3304,7 @@ const enqueue = (html) => {
1692
3304
  *
1693
3305
  * @returns {string}
1694
3306
  */
1695
- const process = () => {
3307
+ const process$1 = () => {
1696
3308
  const { config, constants } = getState();
1697
3309
  const step = " ".repeat(config.tab_size);
1698
3310
  const tag_wrap = config.tag_wrap;
@@ -1761,6 +3373,9 @@ const process = () => {
1761
3373
  output_lines[output_lines.length - 1] =
1762
3374
  output_lines.at(-1) + current_line_value.charAt(0);
1763
3375
  current_line_value = current_line_value.slice(1).trim();
3376
+
3377
+ /* If nothing left after extracting punctuation, skip this line. */
3378
+ if (current_line_value.length === 0) return
1764
3379
  }
1765
3380
  }
1766
3381
 
@@ -1906,7 +3521,7 @@ const prettify = (html, config) => {
1906
3521
 
1907
3522
  html = minify(html);
1908
3523
  enqueue(html);
1909
- html = process();
3524
+ html = process$1();
1910
3525
 
1911
3526
  /* Revert html text within attribute values. */
1912
3527
  html = unsetIgnoreAttribute(html);