funnel-gfx-wc 0.1.142 → 0.1.143
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.
- package/dist/cjs/funnel-app.cjs.entry.js +6 -192
- package/dist/cjs/funnel-gfx-wc.cjs.js +3 -3
- package/dist/cjs/{index-BFBRUSYG.js → index-P8R-UExh.js} +1735 -106
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/esm/funnel-app.entry.js +6 -192
- package/dist/esm/funnel-gfx-wc.js +4 -4
- package/dist/esm/{index-CQ7_4qF8.js → index-BOZ1Hxha.js} +1735 -106
- package/dist/esm/loader.js +3 -3
- package/dist/funnel-gfx-wc/funnel-gfx-wc.esm.js +1 -1
- package/dist/funnel-gfx-wc/p-BOZ1Hxha.js +2 -0
- package/dist/funnel-gfx-wc/{p-2957b336.entry.js → p-e9717012.entry.js} +32 -32
- package/dist/types/stencil-public-runtime.d.ts +14 -3
- package/package.json +2 -2
- package/dist/funnel-gfx-wc/p-CQ7_4qF8.js +0 -2
|
@@ -1,15 +1,256 @@
|
|
|
1
1
|
const NAMESPACE = 'funnel-gfx-wc';
|
|
2
|
-
const BUILD = /* funnel-gfx-wc */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, constructableCSS: true, cssAnnotations: true, deserializer: false, devTools: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propChangeCallback: false, propMutable: false, propNumber: false, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, serializer: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: false, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false };
|
|
2
|
+
const BUILD = /* funnel-gfx-wc */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, constructableCSS: true, cssAnnotations: true, deserializer: false, devTools: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propChangeCallback: false, propMutable: false, propNumber: false, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, serializer: false, shadowDelegatesFocus: false, shadowDom: true, shadowSlotAssignmentManual: false, slot: false, slotChildNodesFix: false, slotRelocation: false, state: false, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false };
|
|
3
3
|
const Env = /* funnel-gfx-wc */ {};
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
Stencil Client Platform v4.
|
|
6
|
+
Stencil Client Platform v4.40.0 | MIT Licensed | https://stenciljs.com
|
|
7
7
|
*/
|
|
8
|
+
var __create = Object.create;
|
|
8
9
|
var __defProp = Object.defineProperty;
|
|
10
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
11
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
12
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __typeError = (msg) => {
|
|
15
|
+
throw TypeError(msg);
|
|
16
|
+
};
|
|
17
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
19
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
20
|
+
};
|
|
9
21
|
var __export = (target, all) => {
|
|
10
22
|
for (var name in all)
|
|
11
23
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
24
|
};
|
|
25
|
+
var __copyProps = (to, from, except, desc) => {
|
|
26
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
27
|
+
for (let key of __getOwnPropNames(from))
|
|
28
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
29
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
30
|
+
}
|
|
31
|
+
return to;
|
|
32
|
+
};
|
|
33
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
34
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
35
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
36
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
37
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
38
|
+
__defProp(target, "default", { value: mod, enumerable: true }) ,
|
|
39
|
+
mod
|
|
40
|
+
));
|
|
41
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "" , value);
|
|
42
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
43
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
44
|
+
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);
|
|
45
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
46
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
47
|
+
|
|
48
|
+
// node_modules/balanced-match/index.js
|
|
49
|
+
var require_balanced_match = __commonJS({
|
|
50
|
+
"node_modules/balanced-match/index.js"(exports, module) {
|
|
51
|
+
module.exports = balanced;
|
|
52
|
+
function balanced(a, b, str) {
|
|
53
|
+
if (a instanceof RegExp) a = maybeMatch(a, str);
|
|
54
|
+
if (b instanceof RegExp) b = maybeMatch(b, str);
|
|
55
|
+
var r = range(a, b, str);
|
|
56
|
+
return r && {
|
|
57
|
+
start: r[0],
|
|
58
|
+
end: r[1],
|
|
59
|
+
pre: str.slice(0, r[0]),
|
|
60
|
+
body: str.slice(r[0] + a.length, r[1]),
|
|
61
|
+
post: str.slice(r[1] + b.length)
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function maybeMatch(reg, str) {
|
|
65
|
+
var m = str.match(reg);
|
|
66
|
+
return m ? m[0] : null;
|
|
67
|
+
}
|
|
68
|
+
balanced.range = range;
|
|
69
|
+
function range(a, b, str) {
|
|
70
|
+
var begs, beg, left, right, result;
|
|
71
|
+
var ai = str.indexOf(a);
|
|
72
|
+
var bi = str.indexOf(b, ai + 1);
|
|
73
|
+
var i2 = ai;
|
|
74
|
+
if (ai >= 0 && bi > 0) {
|
|
75
|
+
if (a === b) {
|
|
76
|
+
return [ai, bi];
|
|
77
|
+
}
|
|
78
|
+
begs = [];
|
|
79
|
+
left = str.length;
|
|
80
|
+
while (i2 >= 0 && !result) {
|
|
81
|
+
if (i2 == ai) {
|
|
82
|
+
begs.push(i2);
|
|
83
|
+
ai = str.indexOf(a, i2 + 1);
|
|
84
|
+
} else if (begs.length == 1) {
|
|
85
|
+
result = [begs.pop(), bi];
|
|
86
|
+
} else {
|
|
87
|
+
beg = begs.pop();
|
|
88
|
+
if (beg < left) {
|
|
89
|
+
left = beg;
|
|
90
|
+
right = bi;
|
|
91
|
+
}
|
|
92
|
+
bi = str.indexOf(b, i2 + 1);
|
|
93
|
+
}
|
|
94
|
+
i2 = ai < bi && ai >= 0 ? ai : bi;
|
|
95
|
+
}
|
|
96
|
+
if (begs.length) {
|
|
97
|
+
result = [left, right];
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return result;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
// node_modules/brace-expansion/index.js
|
|
106
|
+
var require_brace_expansion = __commonJS({
|
|
107
|
+
"node_modules/brace-expansion/index.js"(exports, module) {
|
|
108
|
+
var balanced = require_balanced_match();
|
|
109
|
+
module.exports = expandTop;
|
|
110
|
+
var escSlash = "\0SLASH" + Math.random() + "\0";
|
|
111
|
+
var escOpen = "\0OPEN" + Math.random() + "\0";
|
|
112
|
+
var escClose = "\0CLOSE" + Math.random() + "\0";
|
|
113
|
+
var escComma = "\0COMMA" + Math.random() + "\0";
|
|
114
|
+
var escPeriod = "\0PERIOD" + Math.random() + "\0";
|
|
115
|
+
function numeric(str) {
|
|
116
|
+
return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
|
|
117
|
+
}
|
|
118
|
+
function escapeBraces(str) {
|
|
119
|
+
return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
|
|
120
|
+
}
|
|
121
|
+
function unescapeBraces(str) {
|
|
122
|
+
return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
|
|
123
|
+
}
|
|
124
|
+
function parseCommaParts(str) {
|
|
125
|
+
if (!str)
|
|
126
|
+
return [""];
|
|
127
|
+
var parts = [];
|
|
128
|
+
var m = balanced("{", "}", str);
|
|
129
|
+
if (!m)
|
|
130
|
+
return str.split(",");
|
|
131
|
+
var pre = m.pre;
|
|
132
|
+
var body = m.body;
|
|
133
|
+
var post = m.post;
|
|
134
|
+
var p = pre.split(",");
|
|
135
|
+
p[p.length - 1] += "{" + body + "}";
|
|
136
|
+
var postParts = parseCommaParts(post);
|
|
137
|
+
if (post.length) {
|
|
138
|
+
p[p.length - 1] += postParts.shift();
|
|
139
|
+
p.push.apply(p, postParts);
|
|
140
|
+
}
|
|
141
|
+
parts.push.apply(parts, p);
|
|
142
|
+
return parts;
|
|
143
|
+
}
|
|
144
|
+
function expandTop(str) {
|
|
145
|
+
if (!str)
|
|
146
|
+
return [];
|
|
147
|
+
if (str.substr(0, 2) === "{}") {
|
|
148
|
+
str = "\\{\\}" + str.substr(2);
|
|
149
|
+
}
|
|
150
|
+
return expand2(escapeBraces(str), true).map(unescapeBraces);
|
|
151
|
+
}
|
|
152
|
+
function embrace(str) {
|
|
153
|
+
return "{" + str + "}";
|
|
154
|
+
}
|
|
155
|
+
function isPadded(el) {
|
|
156
|
+
return /^-?0\d/.test(el);
|
|
157
|
+
}
|
|
158
|
+
function lte(i2, y) {
|
|
159
|
+
return i2 <= y;
|
|
160
|
+
}
|
|
161
|
+
function gte(i2, y) {
|
|
162
|
+
return i2 >= y;
|
|
163
|
+
}
|
|
164
|
+
function expand2(str, isTop) {
|
|
165
|
+
var expansions = [];
|
|
166
|
+
var m = balanced("{", "}", str);
|
|
167
|
+
if (!m) return [str];
|
|
168
|
+
var pre = m.pre;
|
|
169
|
+
var post = m.post.length ? expand2(m.post, false) : [""];
|
|
170
|
+
if (/\$$/.test(m.pre)) {
|
|
171
|
+
for (var k = 0; k < post.length; k++) {
|
|
172
|
+
var expansion = pre + "{" + m.body + "}" + post[k];
|
|
173
|
+
expansions.push(expansion);
|
|
174
|
+
}
|
|
175
|
+
} else {
|
|
176
|
+
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
|
177
|
+
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
|
178
|
+
var isSequence = isNumericSequence || isAlphaSequence;
|
|
179
|
+
var isOptions = m.body.indexOf(",") >= 0;
|
|
180
|
+
if (!isSequence && !isOptions) {
|
|
181
|
+
if (m.post.match(/,(?!,).*\}/)) {
|
|
182
|
+
str = m.pre + "{" + m.body + escClose + m.post;
|
|
183
|
+
return expand2(str);
|
|
184
|
+
}
|
|
185
|
+
return [str];
|
|
186
|
+
}
|
|
187
|
+
var n;
|
|
188
|
+
if (isSequence) {
|
|
189
|
+
n = m.body.split(/\.\./);
|
|
190
|
+
} else {
|
|
191
|
+
n = parseCommaParts(m.body);
|
|
192
|
+
if (n.length === 1) {
|
|
193
|
+
n = expand2(n[0], false).map(embrace);
|
|
194
|
+
if (n.length === 1) {
|
|
195
|
+
return post.map(function(p) {
|
|
196
|
+
return m.pre + n[0] + p;
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
var N;
|
|
202
|
+
if (isSequence) {
|
|
203
|
+
var x = numeric(n[0]);
|
|
204
|
+
var y = numeric(n[1]);
|
|
205
|
+
var width = Math.max(n[0].length, n[1].length);
|
|
206
|
+
var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
|
|
207
|
+
var test = lte;
|
|
208
|
+
var reverse = y < x;
|
|
209
|
+
if (reverse) {
|
|
210
|
+
incr *= -1;
|
|
211
|
+
test = gte;
|
|
212
|
+
}
|
|
213
|
+
var pad = n.some(isPadded);
|
|
214
|
+
N = [];
|
|
215
|
+
for (var i2 = x; test(i2, y); i2 += incr) {
|
|
216
|
+
var c;
|
|
217
|
+
if (isAlphaSequence) {
|
|
218
|
+
c = String.fromCharCode(i2);
|
|
219
|
+
if (c === "\\")
|
|
220
|
+
c = "";
|
|
221
|
+
} else {
|
|
222
|
+
c = String(i2);
|
|
223
|
+
if (pad) {
|
|
224
|
+
var need = width - c.length;
|
|
225
|
+
if (need > 0) {
|
|
226
|
+
var z = new Array(need + 1).join("0");
|
|
227
|
+
if (i2 < 0)
|
|
228
|
+
c = "-" + z + c.slice(1);
|
|
229
|
+
else
|
|
230
|
+
c = z + c;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
N.push(c);
|
|
235
|
+
}
|
|
236
|
+
} else {
|
|
237
|
+
N = [];
|
|
238
|
+
for (var j = 0; j < n.length; j++) {
|
|
239
|
+
N.push.apply(N, expand2(n[j], false));
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
for (var j = 0; j < N.length; j++) {
|
|
243
|
+
for (var k = 0; k < post.length; k++) {
|
|
244
|
+
var expansion = pre + N[j] + post[k];
|
|
245
|
+
if (!isTop || isSequence || expansion)
|
|
246
|
+
expansions.push(expansion);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return expansions;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
});
|
|
13
254
|
var Build = {
|
|
14
255
|
isDev: BUILD.isDev ? true : false,
|
|
15
256
|
isBrowser: true,
|
|
@@ -318,11 +559,11 @@ var readTask = /* @__PURE__ */ queueTask(queueDomReads, false);
|
|
|
318
559
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
319
560
|
|
|
320
561
|
// src/runtime/asset-path.ts
|
|
321
|
-
var getAssetPath = (
|
|
322
|
-
const assetUrl = new URL(
|
|
562
|
+
var getAssetPath = (path2) => {
|
|
563
|
+
const assetUrl = new URL(path2, plt.$resourcesUrl$);
|
|
323
564
|
return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
|
|
324
565
|
};
|
|
325
|
-
var setAssetPath = (
|
|
566
|
+
var setAssetPath = (path2) => plt.$resourcesUrl$ = path2;
|
|
326
567
|
|
|
327
568
|
// src/utils/helpers.ts
|
|
328
569
|
var isDef = (v) => v != null && v !== void 0;
|
|
@@ -331,6 +572,1359 @@ var isComplexType = (o) => {
|
|
|
331
572
|
return o === "object" || o === "function";
|
|
332
573
|
};
|
|
333
574
|
|
|
575
|
+
// node_modules/minimatch/dist/esm/index.js
|
|
576
|
+
var import_brace_expansion = __toESM(require_brace_expansion());
|
|
577
|
+
|
|
578
|
+
// node_modules/minimatch/dist/esm/assert-valid-pattern.js
|
|
579
|
+
var MAX_PATTERN_LENGTH = 1024 * 64;
|
|
580
|
+
var assertValidPattern = (pattern) => {
|
|
581
|
+
if (typeof pattern !== "string") {
|
|
582
|
+
throw new TypeError("invalid pattern");
|
|
583
|
+
}
|
|
584
|
+
if (pattern.length > MAX_PATTERN_LENGTH) {
|
|
585
|
+
throw new TypeError("pattern is too long");
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
// node_modules/minimatch/dist/esm/brace-expressions.js
|
|
590
|
+
var posixClasses = {
|
|
591
|
+
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
|
|
592
|
+
"[:alpha:]": ["\\p{L}\\p{Nl}", true],
|
|
593
|
+
"[:ascii:]": ["\\x00-\\x7f", false],
|
|
594
|
+
"[:blank:]": ["\\p{Zs}\\t", true],
|
|
595
|
+
"[:cntrl:]": ["\\p{Cc}", true],
|
|
596
|
+
"[:digit:]": ["\\p{Nd}", true],
|
|
597
|
+
"[:graph:]": ["\\p{Z}\\p{C}", true, true],
|
|
598
|
+
"[:lower:]": ["\\p{Ll}", true],
|
|
599
|
+
"[:print:]": ["\\p{C}", true],
|
|
600
|
+
"[:punct:]": ["\\p{P}", true],
|
|
601
|
+
"[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true],
|
|
602
|
+
"[:upper:]": ["\\p{Lu}", true],
|
|
603
|
+
"[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true],
|
|
604
|
+
"[:xdigit:]": ["A-Fa-f0-9", false]
|
|
605
|
+
};
|
|
606
|
+
var braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&");
|
|
607
|
+
var regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
608
|
+
var rangesToString = (ranges) => ranges.join("");
|
|
609
|
+
var parseClass = (glob, position) => {
|
|
610
|
+
const pos = position;
|
|
611
|
+
if (glob.charAt(pos) !== "[") {
|
|
612
|
+
throw new Error("not in a brace expression");
|
|
613
|
+
}
|
|
614
|
+
const ranges = [];
|
|
615
|
+
const negs = [];
|
|
616
|
+
let i2 = pos + 1;
|
|
617
|
+
let sawStart = false;
|
|
618
|
+
let uflag = false;
|
|
619
|
+
let escaping = false;
|
|
620
|
+
let negate = false;
|
|
621
|
+
let endPos = pos;
|
|
622
|
+
let rangeStart = "";
|
|
623
|
+
WHILE: while (i2 < glob.length) {
|
|
624
|
+
const c = glob.charAt(i2);
|
|
625
|
+
if ((c === "!" || c === "^") && i2 === pos + 1) {
|
|
626
|
+
negate = true;
|
|
627
|
+
i2++;
|
|
628
|
+
continue;
|
|
629
|
+
}
|
|
630
|
+
if (c === "]" && sawStart && !escaping) {
|
|
631
|
+
endPos = i2 + 1;
|
|
632
|
+
break;
|
|
633
|
+
}
|
|
634
|
+
sawStart = true;
|
|
635
|
+
if (c === "\\") {
|
|
636
|
+
if (!escaping) {
|
|
637
|
+
escaping = true;
|
|
638
|
+
i2++;
|
|
639
|
+
continue;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
if (c === "[" && !escaping) {
|
|
643
|
+
for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
|
|
644
|
+
if (glob.startsWith(cls, i2)) {
|
|
645
|
+
if (rangeStart) {
|
|
646
|
+
return ["$.", false, glob.length - pos, true];
|
|
647
|
+
}
|
|
648
|
+
i2 += cls.length;
|
|
649
|
+
if (neg)
|
|
650
|
+
negs.push(unip);
|
|
651
|
+
else
|
|
652
|
+
ranges.push(unip);
|
|
653
|
+
uflag = uflag || u;
|
|
654
|
+
continue WHILE;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
escaping = false;
|
|
659
|
+
if (rangeStart) {
|
|
660
|
+
if (c > rangeStart) {
|
|
661
|
+
ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));
|
|
662
|
+
} else if (c === rangeStart) {
|
|
663
|
+
ranges.push(braceEscape(c));
|
|
664
|
+
}
|
|
665
|
+
rangeStart = "";
|
|
666
|
+
i2++;
|
|
667
|
+
continue;
|
|
668
|
+
}
|
|
669
|
+
if (glob.startsWith("-]", i2 + 1)) {
|
|
670
|
+
ranges.push(braceEscape(c + "-"));
|
|
671
|
+
i2 += 2;
|
|
672
|
+
continue;
|
|
673
|
+
}
|
|
674
|
+
if (glob.startsWith("-", i2 + 1)) {
|
|
675
|
+
rangeStart = c;
|
|
676
|
+
i2 += 2;
|
|
677
|
+
continue;
|
|
678
|
+
}
|
|
679
|
+
ranges.push(braceEscape(c));
|
|
680
|
+
i2++;
|
|
681
|
+
}
|
|
682
|
+
if (endPos < i2) {
|
|
683
|
+
return ["", false, 0, false];
|
|
684
|
+
}
|
|
685
|
+
if (!ranges.length && !negs.length) {
|
|
686
|
+
return ["$.", false, glob.length - pos, true];
|
|
687
|
+
}
|
|
688
|
+
if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
|
|
689
|
+
const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
|
|
690
|
+
return [regexpEscape(r), false, endPos - pos, false];
|
|
691
|
+
}
|
|
692
|
+
const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
|
|
693
|
+
const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
|
|
694
|
+
const comb = ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs;
|
|
695
|
+
return [comb, uflag, endPos - pos, true];
|
|
696
|
+
};
|
|
697
|
+
|
|
698
|
+
// node_modules/minimatch/dist/esm/unescape.js
|
|
699
|
+
var unescape = (s, { windowsPathsNoEscape = false } = {}) => {
|
|
700
|
+
return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
|
|
701
|
+
};
|
|
702
|
+
|
|
703
|
+
// node_modules/minimatch/dist/esm/ast.js
|
|
704
|
+
var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
|
|
705
|
+
var isExtglobType = (c) => types.has(c);
|
|
706
|
+
var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
|
707
|
+
var startNoDot = "(?!\\.)";
|
|
708
|
+
var addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
|
|
709
|
+
var justDots = /* @__PURE__ */ new Set(["..", "."]);
|
|
710
|
+
var reSpecials = new Set("().*{}+?[]^$\\!");
|
|
711
|
+
var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
712
|
+
var qmark = "[^/]";
|
|
713
|
+
var star = qmark + "*?";
|
|
714
|
+
var starNoEmpty = qmark + "+?";
|
|
715
|
+
var _root, _hasMagic, _uflag, _parts, _parent, _parentIndex, _negs, _filledNegs, _options, _toString, _emptyExt, _AST_instances, fillNegs_fn, _AST_static, parseAST_fn, partsToRegExp_fn, parseGlob_fn;
|
|
716
|
+
var _AST = class _AST {
|
|
717
|
+
constructor(type, parent, options = {}) {
|
|
718
|
+
__privateAdd(this, _AST_instances);
|
|
719
|
+
__publicField(this, "type");
|
|
720
|
+
__privateAdd(this, _root);
|
|
721
|
+
__privateAdd(this, _hasMagic);
|
|
722
|
+
__privateAdd(this, _uflag, false);
|
|
723
|
+
__privateAdd(this, _parts, []);
|
|
724
|
+
__privateAdd(this, _parent);
|
|
725
|
+
__privateAdd(this, _parentIndex);
|
|
726
|
+
__privateAdd(this, _negs);
|
|
727
|
+
__privateAdd(this, _filledNegs, false);
|
|
728
|
+
__privateAdd(this, _options);
|
|
729
|
+
__privateAdd(this, _toString);
|
|
730
|
+
// set to true if it's an extglob with no children
|
|
731
|
+
// (which really means one child of '')
|
|
732
|
+
__privateAdd(this, _emptyExt, false);
|
|
733
|
+
this.type = type;
|
|
734
|
+
if (type)
|
|
735
|
+
__privateSet(this, _hasMagic, true);
|
|
736
|
+
__privateSet(this, _parent, parent);
|
|
737
|
+
__privateSet(this, _root, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _root) : this);
|
|
738
|
+
__privateSet(this, _options, __privateGet(this, _root) === this ? options : __privateGet(__privateGet(this, _root), _options));
|
|
739
|
+
__privateSet(this, _negs, __privateGet(this, _root) === this ? [] : __privateGet(__privateGet(this, _root), _negs));
|
|
740
|
+
if (type === "!" && !__privateGet(__privateGet(this, _root), _filledNegs))
|
|
741
|
+
__privateGet(this, _negs).push(this);
|
|
742
|
+
__privateSet(this, _parentIndex, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0);
|
|
743
|
+
}
|
|
744
|
+
get hasMagic() {
|
|
745
|
+
if (__privateGet(this, _hasMagic) !== void 0)
|
|
746
|
+
return __privateGet(this, _hasMagic);
|
|
747
|
+
for (const p of __privateGet(this, _parts)) {
|
|
748
|
+
if (typeof p === "string")
|
|
749
|
+
continue;
|
|
750
|
+
if (p.type || p.hasMagic)
|
|
751
|
+
return __privateSet(this, _hasMagic, true);
|
|
752
|
+
}
|
|
753
|
+
return __privateGet(this, _hasMagic);
|
|
754
|
+
}
|
|
755
|
+
// reconstructs the pattern
|
|
756
|
+
toString() {
|
|
757
|
+
if (__privateGet(this, _toString) !== void 0)
|
|
758
|
+
return __privateGet(this, _toString);
|
|
759
|
+
if (!this.type) {
|
|
760
|
+
return __privateSet(this, _toString, __privateGet(this, _parts).map((p) => String(p)).join(""));
|
|
761
|
+
} else {
|
|
762
|
+
return __privateSet(this, _toString, this.type + "(" + __privateGet(this, _parts).map((p) => String(p)).join("|") + ")");
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
push(...parts) {
|
|
766
|
+
for (const p of parts) {
|
|
767
|
+
if (p === "")
|
|
768
|
+
continue;
|
|
769
|
+
if (typeof p !== "string" && !(p instanceof _AST && __privateGet(p, _parent) === this)) {
|
|
770
|
+
throw new Error("invalid part: " + p);
|
|
771
|
+
}
|
|
772
|
+
__privateGet(this, _parts).push(p);
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
toJSON() {
|
|
776
|
+
var _a;
|
|
777
|
+
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())];
|
|
778
|
+
if (this.isStart() && !this.type)
|
|
779
|
+
ret.unshift([]);
|
|
780
|
+
if (this.isEnd() && (this === __privateGet(this, _root) || __privateGet(__privateGet(this, _root), _filledNegs) && ((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!")) {
|
|
781
|
+
ret.push({});
|
|
782
|
+
}
|
|
783
|
+
return ret;
|
|
784
|
+
}
|
|
785
|
+
isStart() {
|
|
786
|
+
var _a;
|
|
787
|
+
if (__privateGet(this, _root) === this)
|
|
788
|
+
return true;
|
|
789
|
+
if (!((_a = __privateGet(this, _parent)) == null ? void 0 : _a.isStart()))
|
|
790
|
+
return false;
|
|
791
|
+
if (__privateGet(this, _parentIndex) === 0)
|
|
792
|
+
return true;
|
|
793
|
+
const p = __privateGet(this, _parent);
|
|
794
|
+
for (let i2 = 0; i2 < __privateGet(this, _parentIndex); i2++) {
|
|
795
|
+
const pp = __privateGet(p, _parts)[i2];
|
|
796
|
+
if (!(pp instanceof _AST && pp.type === "!")) {
|
|
797
|
+
return false;
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
return true;
|
|
801
|
+
}
|
|
802
|
+
isEnd() {
|
|
803
|
+
var _a, _b, _c;
|
|
804
|
+
if (__privateGet(this, _root) === this)
|
|
805
|
+
return true;
|
|
806
|
+
if (((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!")
|
|
807
|
+
return true;
|
|
808
|
+
if (!((_b = __privateGet(this, _parent)) == null ? void 0 : _b.isEnd()))
|
|
809
|
+
return false;
|
|
810
|
+
if (!this.type)
|
|
811
|
+
return (_c = __privateGet(this, _parent)) == null ? void 0 : _c.isEnd();
|
|
812
|
+
const pl = __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0;
|
|
813
|
+
return __privateGet(this, _parentIndex) === pl - 1;
|
|
814
|
+
}
|
|
815
|
+
copyIn(part) {
|
|
816
|
+
if (typeof part === "string")
|
|
817
|
+
this.push(part);
|
|
818
|
+
else
|
|
819
|
+
this.push(part.clone(this));
|
|
820
|
+
}
|
|
821
|
+
clone(parent) {
|
|
822
|
+
const c = new _AST(this.type, parent);
|
|
823
|
+
for (const p of __privateGet(this, _parts)) {
|
|
824
|
+
c.copyIn(p);
|
|
825
|
+
}
|
|
826
|
+
return c;
|
|
827
|
+
}
|
|
828
|
+
static fromGlob(pattern, options = {}) {
|
|
829
|
+
var _a;
|
|
830
|
+
const ast = new _AST(null, void 0, options);
|
|
831
|
+
__privateMethod(_a = _AST, _AST_static, parseAST_fn).call(_a, pattern, ast, 0, options);
|
|
832
|
+
return ast;
|
|
833
|
+
}
|
|
834
|
+
// returns the regular expression if there's magic, or the unescaped
|
|
835
|
+
// string if not.
|
|
836
|
+
toMMPattern() {
|
|
837
|
+
if (this !== __privateGet(this, _root))
|
|
838
|
+
return __privateGet(this, _root).toMMPattern();
|
|
839
|
+
const glob = this.toString();
|
|
840
|
+
const [re, body, hasMagic, uflag] = this.toRegExpSource();
|
|
841
|
+
const anyMagic = hasMagic || __privateGet(this, _hasMagic) || __privateGet(this, _options).nocase && !__privateGet(this, _options).nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase();
|
|
842
|
+
if (!anyMagic) {
|
|
843
|
+
return body;
|
|
844
|
+
}
|
|
845
|
+
const flags = (__privateGet(this, _options).nocase ? "i" : "") + (uflag ? "u" : "");
|
|
846
|
+
return Object.assign(new RegExp(`^${re}$`, flags), {
|
|
847
|
+
_src: re,
|
|
848
|
+
_glob: glob
|
|
849
|
+
});
|
|
850
|
+
}
|
|
851
|
+
get options() {
|
|
852
|
+
return __privateGet(this, _options);
|
|
853
|
+
}
|
|
854
|
+
// returns the string match, the regexp source, whether there's magic
|
|
855
|
+
// in the regexp (so a regular expression is required) and whether or
|
|
856
|
+
// not the uflag is needed for the regular expression (for posix classes)
|
|
857
|
+
// TODO: instead of injecting the start/end at this point, just return
|
|
858
|
+
// the BODY of the regexp, along with the start/end portions suitable
|
|
859
|
+
// for binding the start/end in either a joined full-path makeRe context
|
|
860
|
+
// (where we bind to (^|/), or a standalone matchPart context (where
|
|
861
|
+
// we bind to ^, and not /). Otherwise slashes get duped!
|
|
862
|
+
//
|
|
863
|
+
// In part-matching mode, the start is:
|
|
864
|
+
// - if not isStart: nothing
|
|
865
|
+
// - if traversal possible, but not allowed: ^(?!\.\.?$)
|
|
866
|
+
// - if dots allowed or not possible: ^
|
|
867
|
+
// - if dots possible and not allowed: ^(?!\.)
|
|
868
|
+
// end is:
|
|
869
|
+
// - if not isEnd(): nothing
|
|
870
|
+
// - else: $
|
|
871
|
+
//
|
|
872
|
+
// In full-path matching mode, we put the slash at the START of the
|
|
873
|
+
// pattern, so start is:
|
|
874
|
+
// - if first pattern: same as part-matching mode
|
|
875
|
+
// - if not isStart(): nothing
|
|
876
|
+
// - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
|
|
877
|
+
// - if dots allowed or not possible: /
|
|
878
|
+
// - if dots possible and not allowed: /(?!\.)
|
|
879
|
+
// end is:
|
|
880
|
+
// - if last pattern, same as part-matching mode
|
|
881
|
+
// - else nothing
|
|
882
|
+
//
|
|
883
|
+
// Always put the (?:$|/) on negated tails, though, because that has to be
|
|
884
|
+
// there to bind the end of the negated pattern portion, and it's easier to
|
|
885
|
+
// just stick it in now rather than try to inject it later in the middle of
|
|
886
|
+
// the pattern.
|
|
887
|
+
//
|
|
888
|
+
// We can just always return the same end, and leave it up to the caller
|
|
889
|
+
// to know whether it's going to be used joined or in parts.
|
|
890
|
+
// And, if the start is adjusted slightly, can do the same there:
|
|
891
|
+
// - if not isStart: nothing
|
|
892
|
+
// - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
|
|
893
|
+
// - if dots allowed or not possible: (?:/|^)
|
|
894
|
+
// - if dots possible and not allowed: (?:/|^)(?!\.)
|
|
895
|
+
//
|
|
896
|
+
// But it's better to have a simpler binding without a conditional, for
|
|
897
|
+
// performance, so probably better to return both start options.
|
|
898
|
+
//
|
|
899
|
+
// Then the caller just ignores the end if it's not the first pattern,
|
|
900
|
+
// and the start always gets applied.
|
|
901
|
+
//
|
|
902
|
+
// But that's always going to be $ if it's the ending pattern, or nothing,
|
|
903
|
+
// so the caller can just attach $ at the end of the pattern when building.
|
|
904
|
+
//
|
|
905
|
+
// So the todo is:
|
|
906
|
+
// - better detect what kind of start is needed
|
|
907
|
+
// - return both flavors of starting pattern
|
|
908
|
+
// - attach $ at the end of the pattern when creating the actual RegExp
|
|
909
|
+
//
|
|
910
|
+
// Ah, but wait, no, that all only applies to the root when the first pattern
|
|
911
|
+
// is not an extglob. If the first pattern IS an extglob, then we need all
|
|
912
|
+
// that dot prevention biz to live in the extglob portions, because eg
|
|
913
|
+
// +(*|.x*) can match .xy but not .yx.
|
|
914
|
+
//
|
|
915
|
+
// So, return the two flavors if it's #root and the first child is not an
|
|
916
|
+
// AST, otherwise leave it to the child AST to handle it, and there,
|
|
917
|
+
// use the (?:^|/) style of start binding.
|
|
918
|
+
//
|
|
919
|
+
// Even simplified further:
|
|
920
|
+
// - Since the start for a join is eg /(?!\.) and the start for a part
|
|
921
|
+
// is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
|
|
922
|
+
// or start or whatever) and prepend ^ or / at the Regexp construction.
|
|
923
|
+
toRegExpSource(allowDot) {
|
|
924
|
+
var _a;
|
|
925
|
+
const dot = allowDot != null ? allowDot : !!__privateGet(this, _options).dot;
|
|
926
|
+
if (__privateGet(this, _root) === this)
|
|
927
|
+
__privateMethod(this, _AST_instances, fillNegs_fn).call(this);
|
|
928
|
+
if (!this.type) {
|
|
929
|
+
const noEmpty = this.isStart() && this.isEnd();
|
|
930
|
+
const src = __privateGet(this, _parts).map((p) => {
|
|
931
|
+
var _a2;
|
|
932
|
+
const [re, _, hasMagic, uflag] = typeof p === "string" ? __privateMethod(_a2 = _AST, _AST_static, parseGlob_fn).call(_a2, p, __privateGet(this, _hasMagic), noEmpty) : p.toRegExpSource(allowDot);
|
|
933
|
+
__privateSet(this, _hasMagic, __privateGet(this, _hasMagic) || hasMagic);
|
|
934
|
+
__privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
|
|
935
|
+
return re;
|
|
936
|
+
}).join("");
|
|
937
|
+
let start2 = "";
|
|
938
|
+
if (this.isStart()) {
|
|
939
|
+
if (typeof __privateGet(this, _parts)[0] === "string") {
|
|
940
|
+
const dotTravAllowed = __privateGet(this, _parts).length === 1 && justDots.has(__privateGet(this, _parts)[0]);
|
|
941
|
+
if (!dotTravAllowed) {
|
|
942
|
+
const aps = addPatternStart;
|
|
943
|
+
const needNoTrav = (
|
|
944
|
+
// dots are allowed, and the pattern starts with [ or .
|
|
945
|
+
dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
|
|
946
|
+
src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
|
|
947
|
+
src.startsWith("\\.\\.") && aps.has(src.charAt(4))
|
|
948
|
+
);
|
|
949
|
+
const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
|
|
950
|
+
start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
let end = "";
|
|
955
|
+
if (this.isEnd() && __privateGet(__privateGet(this, _root), _filledNegs) && ((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!") {
|
|
956
|
+
end = "(?:$|\\/)";
|
|
957
|
+
}
|
|
958
|
+
const final2 = start2 + src + end;
|
|
959
|
+
return [
|
|
960
|
+
final2,
|
|
961
|
+
unescape(src),
|
|
962
|
+
__privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
|
|
963
|
+
__privateGet(this, _uflag)
|
|
964
|
+
];
|
|
965
|
+
}
|
|
966
|
+
const repeated = this.type === "*" || this.type === "+";
|
|
967
|
+
const start = this.type === "!" ? "(?:(?!(?:" : "(?:";
|
|
968
|
+
let body = __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, dot);
|
|
969
|
+
if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
|
|
970
|
+
const s = this.toString();
|
|
971
|
+
__privateSet(this, _parts, [s]);
|
|
972
|
+
this.type = null;
|
|
973
|
+
__privateSet(this, _hasMagic, void 0);
|
|
974
|
+
return [s, unescape(this.toString()), false, false];
|
|
975
|
+
}
|
|
976
|
+
let bodyDotAllowed = !repeated || allowDot || dot || false ? "" : __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, true);
|
|
977
|
+
if (bodyDotAllowed === body) {
|
|
978
|
+
bodyDotAllowed = "";
|
|
979
|
+
}
|
|
980
|
+
if (bodyDotAllowed) {
|
|
981
|
+
body = `(?:${body})(?:${bodyDotAllowed})*?`;
|
|
982
|
+
}
|
|
983
|
+
let final = "";
|
|
984
|
+
if (this.type === "!" && __privateGet(this, _emptyExt)) {
|
|
985
|
+
final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
|
|
986
|
+
} else {
|
|
987
|
+
const close = this.type === "!" ? (
|
|
988
|
+
// !() must match something,but !(x) can match ''
|
|
989
|
+
"))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")"
|
|
990
|
+
) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
|
|
991
|
+
final = start + body + close;
|
|
992
|
+
}
|
|
993
|
+
return [
|
|
994
|
+
final,
|
|
995
|
+
unescape(body),
|
|
996
|
+
__privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
|
|
997
|
+
__privateGet(this, _uflag)
|
|
998
|
+
];
|
|
999
|
+
}
|
|
1000
|
+
};
|
|
1001
|
+
_root = new WeakMap();
|
|
1002
|
+
_hasMagic = new WeakMap();
|
|
1003
|
+
_uflag = new WeakMap();
|
|
1004
|
+
_parts = new WeakMap();
|
|
1005
|
+
_parent = new WeakMap();
|
|
1006
|
+
_parentIndex = new WeakMap();
|
|
1007
|
+
_negs = new WeakMap();
|
|
1008
|
+
_filledNegs = new WeakMap();
|
|
1009
|
+
_options = new WeakMap();
|
|
1010
|
+
_toString = new WeakMap();
|
|
1011
|
+
_emptyExt = new WeakMap();
|
|
1012
|
+
_AST_instances = new WeakSet();
|
|
1013
|
+
fillNegs_fn = function() {
|
|
1014
|
+
if (this !== __privateGet(this, _root))
|
|
1015
|
+
throw new Error("should only call on root");
|
|
1016
|
+
if (__privateGet(this, _filledNegs))
|
|
1017
|
+
return this;
|
|
1018
|
+
this.toString();
|
|
1019
|
+
__privateSet(this, _filledNegs, true);
|
|
1020
|
+
let n;
|
|
1021
|
+
while (n = __privateGet(this, _negs).pop()) {
|
|
1022
|
+
if (n.type !== "!")
|
|
1023
|
+
continue;
|
|
1024
|
+
let p = n;
|
|
1025
|
+
let pp = __privateGet(p, _parent);
|
|
1026
|
+
while (pp) {
|
|
1027
|
+
for (let i2 = __privateGet(p, _parentIndex) + 1; !pp.type && i2 < __privateGet(pp, _parts).length; i2++) {
|
|
1028
|
+
for (const part of __privateGet(n, _parts)) {
|
|
1029
|
+
if (typeof part === "string") {
|
|
1030
|
+
throw new Error("string part in extglob AST??");
|
|
1031
|
+
}
|
|
1032
|
+
part.copyIn(__privateGet(pp, _parts)[i2]);
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
p = pp;
|
|
1036
|
+
pp = __privateGet(p, _parent);
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
return this;
|
|
1040
|
+
};
|
|
1041
|
+
_AST_static = new WeakSet();
|
|
1042
|
+
parseAST_fn = function(str, ast, pos, opt) {
|
|
1043
|
+
var _a, _b;
|
|
1044
|
+
let escaping = false;
|
|
1045
|
+
let inBrace = false;
|
|
1046
|
+
let braceStart = -1;
|
|
1047
|
+
let braceNeg = false;
|
|
1048
|
+
if (ast.type === null) {
|
|
1049
|
+
let i3 = pos;
|
|
1050
|
+
let acc2 = "";
|
|
1051
|
+
while (i3 < str.length) {
|
|
1052
|
+
const c = str.charAt(i3++);
|
|
1053
|
+
if (escaping || c === "\\") {
|
|
1054
|
+
escaping = !escaping;
|
|
1055
|
+
acc2 += c;
|
|
1056
|
+
continue;
|
|
1057
|
+
}
|
|
1058
|
+
if (inBrace) {
|
|
1059
|
+
if (i3 === braceStart + 1) {
|
|
1060
|
+
if (c === "^" || c === "!") {
|
|
1061
|
+
braceNeg = true;
|
|
1062
|
+
}
|
|
1063
|
+
} else if (c === "]" && !(i3 === braceStart + 2 && braceNeg)) {
|
|
1064
|
+
inBrace = false;
|
|
1065
|
+
}
|
|
1066
|
+
acc2 += c;
|
|
1067
|
+
continue;
|
|
1068
|
+
} else if (c === "[") {
|
|
1069
|
+
inBrace = true;
|
|
1070
|
+
braceStart = i3;
|
|
1071
|
+
braceNeg = false;
|
|
1072
|
+
acc2 += c;
|
|
1073
|
+
continue;
|
|
1074
|
+
}
|
|
1075
|
+
if (!opt.noext && isExtglobType(c) && str.charAt(i3) === "(") {
|
|
1076
|
+
ast.push(acc2);
|
|
1077
|
+
acc2 = "";
|
|
1078
|
+
const ext2 = new _AST(c, ast);
|
|
1079
|
+
i3 = __privateMethod(_a = _AST, _AST_static, parseAST_fn).call(_a, str, ext2, i3, opt);
|
|
1080
|
+
ast.push(ext2);
|
|
1081
|
+
continue;
|
|
1082
|
+
}
|
|
1083
|
+
acc2 += c;
|
|
1084
|
+
}
|
|
1085
|
+
ast.push(acc2);
|
|
1086
|
+
return i3;
|
|
1087
|
+
}
|
|
1088
|
+
let i2 = pos + 1;
|
|
1089
|
+
let part = new _AST(null, ast);
|
|
1090
|
+
const parts = [];
|
|
1091
|
+
let acc = "";
|
|
1092
|
+
while (i2 < str.length) {
|
|
1093
|
+
const c = str.charAt(i2++);
|
|
1094
|
+
if (escaping || c === "\\") {
|
|
1095
|
+
escaping = !escaping;
|
|
1096
|
+
acc += c;
|
|
1097
|
+
continue;
|
|
1098
|
+
}
|
|
1099
|
+
if (inBrace) {
|
|
1100
|
+
if (i2 === braceStart + 1) {
|
|
1101
|
+
if (c === "^" || c === "!") {
|
|
1102
|
+
braceNeg = true;
|
|
1103
|
+
}
|
|
1104
|
+
} else if (c === "]" && !(i2 === braceStart + 2 && braceNeg)) {
|
|
1105
|
+
inBrace = false;
|
|
1106
|
+
}
|
|
1107
|
+
acc += c;
|
|
1108
|
+
continue;
|
|
1109
|
+
} else if (c === "[") {
|
|
1110
|
+
inBrace = true;
|
|
1111
|
+
braceStart = i2;
|
|
1112
|
+
braceNeg = false;
|
|
1113
|
+
acc += c;
|
|
1114
|
+
continue;
|
|
1115
|
+
}
|
|
1116
|
+
if (isExtglobType(c) && str.charAt(i2) === "(") {
|
|
1117
|
+
part.push(acc);
|
|
1118
|
+
acc = "";
|
|
1119
|
+
const ext2 = new _AST(c, part);
|
|
1120
|
+
part.push(ext2);
|
|
1121
|
+
i2 = __privateMethod(_b = _AST, _AST_static, parseAST_fn).call(_b, str, ext2, i2, opt);
|
|
1122
|
+
continue;
|
|
1123
|
+
}
|
|
1124
|
+
if (c === "|") {
|
|
1125
|
+
part.push(acc);
|
|
1126
|
+
acc = "";
|
|
1127
|
+
parts.push(part);
|
|
1128
|
+
part = new _AST(null, ast);
|
|
1129
|
+
continue;
|
|
1130
|
+
}
|
|
1131
|
+
if (c === ")") {
|
|
1132
|
+
if (acc === "" && __privateGet(ast, _parts).length === 0) {
|
|
1133
|
+
__privateSet(ast, _emptyExt, true);
|
|
1134
|
+
}
|
|
1135
|
+
part.push(acc);
|
|
1136
|
+
acc = "";
|
|
1137
|
+
ast.push(...parts, part);
|
|
1138
|
+
return i2;
|
|
1139
|
+
}
|
|
1140
|
+
acc += c;
|
|
1141
|
+
}
|
|
1142
|
+
ast.type = null;
|
|
1143
|
+
__privateSet(ast, _hasMagic, void 0);
|
|
1144
|
+
__privateSet(ast, _parts, [str.substring(pos - 1)]);
|
|
1145
|
+
return i2;
|
|
1146
|
+
};
|
|
1147
|
+
partsToRegExp_fn = function(dot) {
|
|
1148
|
+
return __privateGet(this, _parts).map((p) => {
|
|
1149
|
+
if (typeof p === "string") {
|
|
1150
|
+
throw new Error("string type in extglob ast??");
|
|
1151
|
+
}
|
|
1152
|
+
const [re, _, _hasMagic2, uflag] = p.toRegExpSource(dot);
|
|
1153
|
+
__privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
|
|
1154
|
+
return re;
|
|
1155
|
+
}).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
|
|
1156
|
+
};
|
|
1157
|
+
parseGlob_fn = function(glob, hasMagic, noEmpty = false) {
|
|
1158
|
+
let escaping = false;
|
|
1159
|
+
let re = "";
|
|
1160
|
+
let uflag = false;
|
|
1161
|
+
for (let i2 = 0; i2 < glob.length; i2++) {
|
|
1162
|
+
const c = glob.charAt(i2);
|
|
1163
|
+
if (escaping) {
|
|
1164
|
+
escaping = false;
|
|
1165
|
+
re += (reSpecials.has(c) ? "\\" : "") + c;
|
|
1166
|
+
continue;
|
|
1167
|
+
}
|
|
1168
|
+
if (c === "\\") {
|
|
1169
|
+
if (i2 === glob.length - 1) {
|
|
1170
|
+
re += "\\\\";
|
|
1171
|
+
} else {
|
|
1172
|
+
escaping = true;
|
|
1173
|
+
}
|
|
1174
|
+
continue;
|
|
1175
|
+
}
|
|
1176
|
+
if (c === "[") {
|
|
1177
|
+
const [src, needUflag, consumed, magic] = parseClass(glob, i2);
|
|
1178
|
+
if (consumed) {
|
|
1179
|
+
re += src;
|
|
1180
|
+
uflag = uflag || needUflag;
|
|
1181
|
+
i2 += consumed - 1;
|
|
1182
|
+
hasMagic = hasMagic || magic;
|
|
1183
|
+
continue;
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
if (c === "*") {
|
|
1187
|
+
if (noEmpty && glob === "*")
|
|
1188
|
+
re += starNoEmpty;
|
|
1189
|
+
else
|
|
1190
|
+
re += star;
|
|
1191
|
+
hasMagic = true;
|
|
1192
|
+
continue;
|
|
1193
|
+
}
|
|
1194
|
+
if (c === "?") {
|
|
1195
|
+
re += qmark;
|
|
1196
|
+
hasMagic = true;
|
|
1197
|
+
continue;
|
|
1198
|
+
}
|
|
1199
|
+
re += regExpEscape(c);
|
|
1200
|
+
}
|
|
1201
|
+
return [re, unescape(glob), !!hasMagic, uflag];
|
|
1202
|
+
};
|
|
1203
|
+
__privateAdd(_AST, _AST_static);
|
|
1204
|
+
var AST = _AST;
|
|
1205
|
+
|
|
1206
|
+
// node_modules/minimatch/dist/esm/escape.js
|
|
1207
|
+
var escape = (s, { windowsPathsNoEscape = false } = {}) => {
|
|
1208
|
+
return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
|
|
1209
|
+
};
|
|
1210
|
+
|
|
1211
|
+
// node_modules/minimatch/dist/esm/index.js
|
|
1212
|
+
var minimatch = (p, pattern, options = {}) => {
|
|
1213
|
+
assertValidPattern(pattern);
|
|
1214
|
+
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
1215
|
+
return false;
|
|
1216
|
+
}
|
|
1217
|
+
return new Minimatch(pattern, options).match(p);
|
|
1218
|
+
};
|
|
1219
|
+
var starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
|
|
1220
|
+
var starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2);
|
|
1221
|
+
var starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2);
|
|
1222
|
+
var starDotExtTestNocase = (ext2) => {
|
|
1223
|
+
ext2 = ext2.toLowerCase();
|
|
1224
|
+
return (f) => !f.startsWith(".") && f.toLowerCase().endsWith(ext2);
|
|
1225
|
+
};
|
|
1226
|
+
var starDotExtTestNocaseDot = (ext2) => {
|
|
1227
|
+
ext2 = ext2.toLowerCase();
|
|
1228
|
+
return (f) => f.toLowerCase().endsWith(ext2);
|
|
1229
|
+
};
|
|
1230
|
+
var starDotStarRE = /^\*+\.\*+$/;
|
|
1231
|
+
var starDotStarTest = (f) => !f.startsWith(".") && f.includes(".");
|
|
1232
|
+
var starDotStarTestDot = (f) => f !== "." && f !== ".." && f.includes(".");
|
|
1233
|
+
var dotStarRE = /^\.\*+$/;
|
|
1234
|
+
var dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith(".");
|
|
1235
|
+
var starRE = /^\*+$/;
|
|
1236
|
+
var starTest = (f) => f.length !== 0 && !f.startsWith(".");
|
|
1237
|
+
var starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..";
|
|
1238
|
+
var qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
|
|
1239
|
+
var qmarksTestNocase = ([$0, ext2 = ""]) => {
|
|
1240
|
+
const noext = qmarksTestNoExt([$0]);
|
|
1241
|
+
if (!ext2)
|
|
1242
|
+
return noext;
|
|
1243
|
+
ext2 = ext2.toLowerCase();
|
|
1244
|
+
return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
|
|
1245
|
+
};
|
|
1246
|
+
var qmarksTestNocaseDot = ([$0, ext2 = ""]) => {
|
|
1247
|
+
const noext = qmarksTestNoExtDot([$0]);
|
|
1248
|
+
if (!ext2)
|
|
1249
|
+
return noext;
|
|
1250
|
+
ext2 = ext2.toLowerCase();
|
|
1251
|
+
return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
|
|
1252
|
+
};
|
|
1253
|
+
var qmarksTestDot = ([$0, ext2 = ""]) => {
|
|
1254
|
+
const noext = qmarksTestNoExtDot([$0]);
|
|
1255
|
+
return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
|
|
1256
|
+
};
|
|
1257
|
+
var qmarksTest = ([$0, ext2 = ""]) => {
|
|
1258
|
+
const noext = qmarksTestNoExt([$0]);
|
|
1259
|
+
return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
|
|
1260
|
+
};
|
|
1261
|
+
var qmarksTestNoExt = ([$0]) => {
|
|
1262
|
+
const len = $0.length;
|
|
1263
|
+
return (f) => f.length === len && !f.startsWith(".");
|
|
1264
|
+
};
|
|
1265
|
+
var qmarksTestNoExtDot = ([$0]) => {
|
|
1266
|
+
const len = $0.length;
|
|
1267
|
+
return (f) => f.length === len && f !== "." && f !== "..";
|
|
1268
|
+
};
|
|
1269
|
+
var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
1270
|
+
var path = {
|
|
1271
|
+
win32: { sep: "\\" },
|
|
1272
|
+
posix: { sep: "/" }
|
|
1273
|
+
};
|
|
1274
|
+
var sep = defaultPlatform === "win32" ? path.win32.sep : path.posix.sep;
|
|
1275
|
+
minimatch.sep = sep;
|
|
1276
|
+
var GLOBSTAR = Symbol("globstar **");
|
|
1277
|
+
minimatch.GLOBSTAR = GLOBSTAR;
|
|
1278
|
+
var qmark2 = "[^/]";
|
|
1279
|
+
var star2 = qmark2 + "*?";
|
|
1280
|
+
var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
|
|
1281
|
+
var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
|
|
1282
|
+
var filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
|
|
1283
|
+
minimatch.filter = filter;
|
|
1284
|
+
var ext = (a, b = {}) => Object.assign({}, a, b);
|
|
1285
|
+
var defaults = (def) => {
|
|
1286
|
+
if (!def || typeof def !== "object" || !Object.keys(def).length) {
|
|
1287
|
+
return minimatch;
|
|
1288
|
+
}
|
|
1289
|
+
const orig = minimatch;
|
|
1290
|
+
const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
|
|
1291
|
+
return Object.assign(m, {
|
|
1292
|
+
Minimatch: class Minimatch extends orig.Minimatch {
|
|
1293
|
+
constructor(pattern, options = {}) {
|
|
1294
|
+
super(pattern, ext(def, options));
|
|
1295
|
+
}
|
|
1296
|
+
static defaults(options) {
|
|
1297
|
+
return orig.defaults(ext(def, options)).Minimatch;
|
|
1298
|
+
}
|
|
1299
|
+
},
|
|
1300
|
+
AST: class AST extends orig.AST {
|
|
1301
|
+
/* c8 ignore start */
|
|
1302
|
+
constructor(type, parent, options = {}) {
|
|
1303
|
+
super(type, parent, ext(def, options));
|
|
1304
|
+
}
|
|
1305
|
+
/* c8 ignore stop */
|
|
1306
|
+
static fromGlob(pattern, options = {}) {
|
|
1307
|
+
return orig.AST.fromGlob(pattern, ext(def, options));
|
|
1308
|
+
}
|
|
1309
|
+
},
|
|
1310
|
+
unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
|
|
1311
|
+
escape: (s, options = {}) => orig.escape(s, ext(def, options)),
|
|
1312
|
+
filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
|
|
1313
|
+
defaults: (options) => orig.defaults(ext(def, options)),
|
|
1314
|
+
makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
|
|
1315
|
+
braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
|
|
1316
|
+
match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
|
|
1317
|
+
sep: orig.sep,
|
|
1318
|
+
GLOBSTAR
|
|
1319
|
+
});
|
|
1320
|
+
};
|
|
1321
|
+
minimatch.defaults = defaults;
|
|
1322
|
+
var braceExpand = (pattern, options = {}) => {
|
|
1323
|
+
assertValidPattern(pattern);
|
|
1324
|
+
if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
|
|
1325
|
+
return [pattern];
|
|
1326
|
+
}
|
|
1327
|
+
return (0, import_brace_expansion.default)(pattern);
|
|
1328
|
+
};
|
|
1329
|
+
minimatch.braceExpand = braceExpand;
|
|
1330
|
+
var makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
|
|
1331
|
+
minimatch.makeRe = makeRe;
|
|
1332
|
+
var match = (list, pattern, options = {}) => {
|
|
1333
|
+
const mm = new Minimatch(pattern, options);
|
|
1334
|
+
list = list.filter((f) => mm.match(f));
|
|
1335
|
+
if (mm.options.nonull && !list.length) {
|
|
1336
|
+
list.push(pattern);
|
|
1337
|
+
}
|
|
1338
|
+
return list;
|
|
1339
|
+
};
|
|
1340
|
+
minimatch.match = match;
|
|
1341
|
+
var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
|
|
1342
|
+
var regExpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
1343
|
+
var Minimatch = class {
|
|
1344
|
+
options;
|
|
1345
|
+
set;
|
|
1346
|
+
pattern;
|
|
1347
|
+
windowsPathsNoEscape;
|
|
1348
|
+
nonegate;
|
|
1349
|
+
negate;
|
|
1350
|
+
comment;
|
|
1351
|
+
empty;
|
|
1352
|
+
preserveMultipleSlashes;
|
|
1353
|
+
partial;
|
|
1354
|
+
globSet;
|
|
1355
|
+
globParts;
|
|
1356
|
+
nocase;
|
|
1357
|
+
isWindows;
|
|
1358
|
+
platform;
|
|
1359
|
+
windowsNoMagicRoot;
|
|
1360
|
+
regexp;
|
|
1361
|
+
constructor(pattern, options = {}) {
|
|
1362
|
+
assertValidPattern(pattern);
|
|
1363
|
+
options = options || {};
|
|
1364
|
+
this.options = options;
|
|
1365
|
+
this.pattern = pattern;
|
|
1366
|
+
this.platform = options.platform || defaultPlatform;
|
|
1367
|
+
this.isWindows = this.platform === "win32";
|
|
1368
|
+
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
|
|
1369
|
+
if (this.windowsPathsNoEscape) {
|
|
1370
|
+
this.pattern = this.pattern.replace(/\\/g, "/");
|
|
1371
|
+
}
|
|
1372
|
+
this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
|
|
1373
|
+
this.regexp = null;
|
|
1374
|
+
this.negate = false;
|
|
1375
|
+
this.nonegate = !!options.nonegate;
|
|
1376
|
+
this.comment = false;
|
|
1377
|
+
this.empty = false;
|
|
1378
|
+
this.partial = !!options.partial;
|
|
1379
|
+
this.nocase = !!this.options.nocase;
|
|
1380
|
+
this.windowsNoMagicRoot = options.windowsNoMagicRoot !== void 0 ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase);
|
|
1381
|
+
this.globSet = [];
|
|
1382
|
+
this.globParts = [];
|
|
1383
|
+
this.set = [];
|
|
1384
|
+
this.make();
|
|
1385
|
+
}
|
|
1386
|
+
hasMagic() {
|
|
1387
|
+
if (this.options.magicalBraces && this.set.length > 1) {
|
|
1388
|
+
return true;
|
|
1389
|
+
}
|
|
1390
|
+
for (const pattern of this.set) {
|
|
1391
|
+
for (const part of pattern) {
|
|
1392
|
+
if (typeof part !== "string")
|
|
1393
|
+
return true;
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
return false;
|
|
1397
|
+
}
|
|
1398
|
+
debug(..._) {
|
|
1399
|
+
}
|
|
1400
|
+
make() {
|
|
1401
|
+
const pattern = this.pattern;
|
|
1402
|
+
const options = this.options;
|
|
1403
|
+
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
1404
|
+
this.comment = true;
|
|
1405
|
+
return;
|
|
1406
|
+
}
|
|
1407
|
+
if (!pattern) {
|
|
1408
|
+
this.empty = true;
|
|
1409
|
+
return;
|
|
1410
|
+
}
|
|
1411
|
+
this.parseNegate();
|
|
1412
|
+
this.globSet = [...new Set(this.braceExpand())];
|
|
1413
|
+
if (options.debug) {
|
|
1414
|
+
this.debug = (...args) => console.error(...args);
|
|
1415
|
+
}
|
|
1416
|
+
this.debug(this.pattern, this.globSet);
|
|
1417
|
+
const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
|
|
1418
|
+
this.globParts = this.preprocess(rawGlobParts);
|
|
1419
|
+
this.debug(this.pattern, this.globParts);
|
|
1420
|
+
let set = this.globParts.map((s, _, __) => {
|
|
1421
|
+
if (this.isWindows && this.windowsNoMagicRoot) {
|
|
1422
|
+
const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
|
|
1423
|
+
const isDrive = /^[a-z]:/i.test(s[0]);
|
|
1424
|
+
if (isUNC) {
|
|
1425
|
+
return [...s.slice(0, 4), ...s.slice(4).map((ss) => this.parse(ss))];
|
|
1426
|
+
} else if (isDrive) {
|
|
1427
|
+
return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
return s.map((ss) => this.parse(ss));
|
|
1431
|
+
});
|
|
1432
|
+
this.debug(this.pattern, set);
|
|
1433
|
+
this.set = set.filter((s) => s.indexOf(false) === -1);
|
|
1434
|
+
if (this.isWindows) {
|
|
1435
|
+
for (let i2 = 0; i2 < this.set.length; i2++) {
|
|
1436
|
+
const p = this.set[i2];
|
|
1437
|
+
if (p[0] === "" && p[1] === "" && this.globParts[i2][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) {
|
|
1438
|
+
p[2] = "?";
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
this.debug(this.pattern, this.set);
|
|
1443
|
+
}
|
|
1444
|
+
// various transforms to equivalent pattern sets that are
|
|
1445
|
+
// faster to process in a filesystem walk. The goal is to
|
|
1446
|
+
// eliminate what we can, and push all ** patterns as far
|
|
1447
|
+
// to the right as possible, even if it increases the number
|
|
1448
|
+
// of patterns that we have to process.
|
|
1449
|
+
preprocess(globParts) {
|
|
1450
|
+
if (this.options.noglobstar) {
|
|
1451
|
+
for (let i2 = 0; i2 < globParts.length; i2++) {
|
|
1452
|
+
for (let j = 0; j < globParts[i2].length; j++) {
|
|
1453
|
+
if (globParts[i2][j] === "**") {
|
|
1454
|
+
globParts[i2][j] = "*";
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
const { optimizationLevel = 1 } = this.options;
|
|
1460
|
+
if (optimizationLevel >= 2) {
|
|
1461
|
+
globParts = this.firstPhasePreProcess(globParts);
|
|
1462
|
+
globParts = this.secondPhasePreProcess(globParts);
|
|
1463
|
+
} else if (optimizationLevel >= 1) {
|
|
1464
|
+
globParts = this.levelOneOptimize(globParts);
|
|
1465
|
+
} else {
|
|
1466
|
+
globParts = this.adjascentGlobstarOptimize(globParts);
|
|
1467
|
+
}
|
|
1468
|
+
return globParts;
|
|
1469
|
+
}
|
|
1470
|
+
// just get rid of adjascent ** portions
|
|
1471
|
+
adjascentGlobstarOptimize(globParts) {
|
|
1472
|
+
return globParts.map((parts) => {
|
|
1473
|
+
let gs = -1;
|
|
1474
|
+
while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
|
|
1475
|
+
let i2 = gs;
|
|
1476
|
+
while (parts[i2 + 1] === "**") {
|
|
1477
|
+
i2++;
|
|
1478
|
+
}
|
|
1479
|
+
if (i2 !== gs) {
|
|
1480
|
+
parts.splice(gs, i2 - gs);
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
return parts;
|
|
1484
|
+
});
|
|
1485
|
+
}
|
|
1486
|
+
// get rid of adjascent ** and resolve .. portions
|
|
1487
|
+
levelOneOptimize(globParts) {
|
|
1488
|
+
return globParts.map((parts) => {
|
|
1489
|
+
parts = parts.reduce((set, part) => {
|
|
1490
|
+
const prev = set[set.length - 1];
|
|
1491
|
+
if (part === "**" && prev === "**") {
|
|
1492
|
+
return set;
|
|
1493
|
+
}
|
|
1494
|
+
if (part === "..") {
|
|
1495
|
+
if (prev && prev !== ".." && prev !== "." && prev !== "**") {
|
|
1496
|
+
set.pop();
|
|
1497
|
+
return set;
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
set.push(part);
|
|
1501
|
+
return set;
|
|
1502
|
+
}, []);
|
|
1503
|
+
return parts.length === 0 ? [""] : parts;
|
|
1504
|
+
});
|
|
1505
|
+
}
|
|
1506
|
+
levelTwoFileOptimize(parts) {
|
|
1507
|
+
if (!Array.isArray(parts)) {
|
|
1508
|
+
parts = this.slashSplit(parts);
|
|
1509
|
+
}
|
|
1510
|
+
let didSomething = false;
|
|
1511
|
+
do {
|
|
1512
|
+
didSomething = false;
|
|
1513
|
+
if (!this.preserveMultipleSlashes) {
|
|
1514
|
+
for (let i2 = 1; i2 < parts.length - 1; i2++) {
|
|
1515
|
+
const p = parts[i2];
|
|
1516
|
+
if (i2 === 1 && p === "" && parts[0] === "")
|
|
1517
|
+
continue;
|
|
1518
|
+
if (p === "." || p === "") {
|
|
1519
|
+
didSomething = true;
|
|
1520
|
+
parts.splice(i2, 1);
|
|
1521
|
+
i2--;
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
|
|
1525
|
+
didSomething = true;
|
|
1526
|
+
parts.pop();
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
let dd = 0;
|
|
1530
|
+
while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
|
|
1531
|
+
const p = parts[dd - 1];
|
|
1532
|
+
if (p && p !== "." && p !== ".." && p !== "**") {
|
|
1533
|
+
didSomething = true;
|
|
1534
|
+
parts.splice(dd - 1, 2);
|
|
1535
|
+
dd -= 2;
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
} while (didSomething);
|
|
1539
|
+
return parts.length === 0 ? [""] : parts;
|
|
1540
|
+
}
|
|
1541
|
+
// First phase: single-pattern processing
|
|
1542
|
+
// <pre> is 1 or more portions
|
|
1543
|
+
// <rest> is 1 or more portions
|
|
1544
|
+
// <p> is any portion other than ., .., '', or **
|
|
1545
|
+
// <e> is . or ''
|
|
1546
|
+
//
|
|
1547
|
+
// **/.. is *brutal* for filesystem walking performance, because
|
|
1548
|
+
// it effectively resets the recursive walk each time it occurs,
|
|
1549
|
+
// and ** cannot be reduced out by a .. pattern part like a regexp
|
|
1550
|
+
// or most strings (other than .., ., and '') can be.
|
|
1551
|
+
//
|
|
1552
|
+
// <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
|
|
1553
|
+
// <pre>/<e>/<rest> -> <pre>/<rest>
|
|
1554
|
+
// <pre>/<p>/../<rest> -> <pre>/<rest>
|
|
1555
|
+
// **/**/<rest> -> **/<rest>
|
|
1556
|
+
//
|
|
1557
|
+
// **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
|
|
1558
|
+
// this WOULD be allowed if ** did follow symlinks, or * didn't
|
|
1559
|
+
firstPhasePreProcess(globParts) {
|
|
1560
|
+
let didSomething = false;
|
|
1561
|
+
do {
|
|
1562
|
+
didSomething = false;
|
|
1563
|
+
for (let parts of globParts) {
|
|
1564
|
+
let gs = -1;
|
|
1565
|
+
while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
|
|
1566
|
+
let gss = gs;
|
|
1567
|
+
while (parts[gss + 1] === "**") {
|
|
1568
|
+
gss++;
|
|
1569
|
+
}
|
|
1570
|
+
if (gss > gs) {
|
|
1571
|
+
parts.splice(gs + 1, gss - gs);
|
|
1572
|
+
}
|
|
1573
|
+
let next = parts[gs + 1];
|
|
1574
|
+
const p = parts[gs + 2];
|
|
1575
|
+
const p2 = parts[gs + 3];
|
|
1576
|
+
if (next !== "..")
|
|
1577
|
+
continue;
|
|
1578
|
+
if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") {
|
|
1579
|
+
continue;
|
|
1580
|
+
}
|
|
1581
|
+
didSomething = true;
|
|
1582
|
+
parts.splice(gs, 1);
|
|
1583
|
+
const other = parts.slice(0);
|
|
1584
|
+
other[gs] = "**";
|
|
1585
|
+
globParts.push(other);
|
|
1586
|
+
gs--;
|
|
1587
|
+
}
|
|
1588
|
+
if (!this.preserveMultipleSlashes) {
|
|
1589
|
+
for (let i2 = 1; i2 < parts.length - 1; i2++) {
|
|
1590
|
+
const p = parts[i2];
|
|
1591
|
+
if (i2 === 1 && p === "" && parts[0] === "")
|
|
1592
|
+
continue;
|
|
1593
|
+
if (p === "." || p === "") {
|
|
1594
|
+
didSomething = true;
|
|
1595
|
+
parts.splice(i2, 1);
|
|
1596
|
+
i2--;
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
|
|
1600
|
+
didSomething = true;
|
|
1601
|
+
parts.pop();
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
let dd = 0;
|
|
1605
|
+
while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
|
|
1606
|
+
const p = parts[dd - 1];
|
|
1607
|
+
if (p && p !== "." && p !== ".." && p !== "**") {
|
|
1608
|
+
didSomething = true;
|
|
1609
|
+
const needDot = dd === 1 && parts[dd + 1] === "**";
|
|
1610
|
+
const splin = needDot ? ["."] : [];
|
|
1611
|
+
parts.splice(dd - 1, 2, ...splin);
|
|
1612
|
+
if (parts.length === 0)
|
|
1613
|
+
parts.push("");
|
|
1614
|
+
dd -= 2;
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
} while (didSomething);
|
|
1619
|
+
return globParts;
|
|
1620
|
+
}
|
|
1621
|
+
// second phase: multi-pattern dedupes
|
|
1622
|
+
// {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
|
|
1623
|
+
// {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
|
|
1624
|
+
// {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
|
|
1625
|
+
//
|
|
1626
|
+
// {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
|
|
1627
|
+
// ^-- not valid because ** doens't follow symlinks
|
|
1628
|
+
secondPhasePreProcess(globParts) {
|
|
1629
|
+
for (let i2 = 0; i2 < globParts.length - 1; i2++) {
|
|
1630
|
+
for (let j = i2 + 1; j < globParts.length; j++) {
|
|
1631
|
+
const matched = this.partsMatch(globParts[i2], globParts[j], !this.preserveMultipleSlashes);
|
|
1632
|
+
if (!matched)
|
|
1633
|
+
continue;
|
|
1634
|
+
globParts[i2] = matched;
|
|
1635
|
+
globParts[j] = [];
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
return globParts.filter((gs) => gs.length);
|
|
1639
|
+
}
|
|
1640
|
+
partsMatch(a, b, emptyGSMatch = false) {
|
|
1641
|
+
let ai = 0;
|
|
1642
|
+
let bi = 0;
|
|
1643
|
+
let result = [];
|
|
1644
|
+
let which = "";
|
|
1645
|
+
while (ai < a.length && bi < b.length) {
|
|
1646
|
+
if (a[ai] === b[bi]) {
|
|
1647
|
+
result.push(which === "b" ? b[bi] : a[ai]);
|
|
1648
|
+
ai++;
|
|
1649
|
+
bi++;
|
|
1650
|
+
} else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1]) {
|
|
1651
|
+
result.push(a[ai]);
|
|
1652
|
+
ai++;
|
|
1653
|
+
} else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1]) {
|
|
1654
|
+
result.push(b[bi]);
|
|
1655
|
+
bi++;
|
|
1656
|
+
} else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
|
|
1657
|
+
if (which === "b")
|
|
1658
|
+
return false;
|
|
1659
|
+
which = "a";
|
|
1660
|
+
result.push(a[ai]);
|
|
1661
|
+
ai++;
|
|
1662
|
+
bi++;
|
|
1663
|
+
} else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
|
|
1664
|
+
if (which === "a")
|
|
1665
|
+
return false;
|
|
1666
|
+
which = "b";
|
|
1667
|
+
result.push(b[bi]);
|
|
1668
|
+
ai++;
|
|
1669
|
+
bi++;
|
|
1670
|
+
} else {
|
|
1671
|
+
return false;
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
return a.length === b.length && result;
|
|
1675
|
+
}
|
|
1676
|
+
parseNegate() {
|
|
1677
|
+
if (this.nonegate)
|
|
1678
|
+
return;
|
|
1679
|
+
const pattern = this.pattern;
|
|
1680
|
+
let negate = false;
|
|
1681
|
+
let negateOffset = 0;
|
|
1682
|
+
for (let i2 = 0; i2 < pattern.length && pattern.charAt(i2) === "!"; i2++) {
|
|
1683
|
+
negate = !negate;
|
|
1684
|
+
negateOffset++;
|
|
1685
|
+
}
|
|
1686
|
+
if (negateOffset)
|
|
1687
|
+
this.pattern = pattern.slice(negateOffset);
|
|
1688
|
+
this.negate = negate;
|
|
1689
|
+
}
|
|
1690
|
+
// set partial to true to test if, for example,
|
|
1691
|
+
// "/a/b" matches the start of "/*/b/*/d"
|
|
1692
|
+
// Partial means, if you run out of file before you run
|
|
1693
|
+
// out of pattern, then that's fine, as long as all
|
|
1694
|
+
// the parts match.
|
|
1695
|
+
matchOne(file, pattern, partial = false) {
|
|
1696
|
+
const options = this.options;
|
|
1697
|
+
if (this.isWindows) {
|
|
1698
|
+
const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
|
|
1699
|
+
const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
|
|
1700
|
+
const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
|
|
1701
|
+
const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
|
|
1702
|
+
const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
|
|
1703
|
+
const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
|
|
1704
|
+
if (typeof fdi === "number" && typeof pdi === "number") {
|
|
1705
|
+
const [fd, pd] = [file[fdi], pattern[pdi]];
|
|
1706
|
+
if (fd.toLowerCase() === pd.toLowerCase()) {
|
|
1707
|
+
pattern[pdi] = fd;
|
|
1708
|
+
if (pdi > fdi) {
|
|
1709
|
+
pattern = pattern.slice(pdi);
|
|
1710
|
+
} else if (fdi > pdi) {
|
|
1711
|
+
file = file.slice(fdi);
|
|
1712
|
+
}
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
const { optimizationLevel = 1 } = this.options;
|
|
1717
|
+
if (optimizationLevel >= 2) {
|
|
1718
|
+
file = this.levelTwoFileOptimize(file);
|
|
1719
|
+
}
|
|
1720
|
+
this.debug("matchOne", this, { file, pattern });
|
|
1721
|
+
this.debug("matchOne", file.length, pattern.length);
|
|
1722
|
+
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
|
1723
|
+
this.debug("matchOne loop");
|
|
1724
|
+
var p = pattern[pi];
|
|
1725
|
+
var f = file[fi];
|
|
1726
|
+
this.debug(pattern, p, f);
|
|
1727
|
+
if (p === false) {
|
|
1728
|
+
return false;
|
|
1729
|
+
}
|
|
1730
|
+
if (p === GLOBSTAR) {
|
|
1731
|
+
this.debug("GLOBSTAR", [pattern, p, f]);
|
|
1732
|
+
var fr = fi;
|
|
1733
|
+
var pr = pi + 1;
|
|
1734
|
+
if (pr === pl) {
|
|
1735
|
+
this.debug("** at the end");
|
|
1736
|
+
for (; fi < fl; fi++) {
|
|
1737
|
+
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
|
|
1738
|
+
return false;
|
|
1739
|
+
}
|
|
1740
|
+
return true;
|
|
1741
|
+
}
|
|
1742
|
+
while (fr < fl) {
|
|
1743
|
+
var swallowee = file[fr];
|
|
1744
|
+
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
|
1745
|
+
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
|
1746
|
+
this.debug("globstar found match!", fr, fl, swallowee);
|
|
1747
|
+
return true;
|
|
1748
|
+
} else {
|
|
1749
|
+
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
|
1750
|
+
this.debug("dot detected!", file, fr, pattern, pr);
|
|
1751
|
+
break;
|
|
1752
|
+
}
|
|
1753
|
+
this.debug("globstar swallow a segment, and continue");
|
|
1754
|
+
fr++;
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
if (partial) {
|
|
1758
|
+
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
|
1759
|
+
if (fr === fl) {
|
|
1760
|
+
return true;
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
return false;
|
|
1764
|
+
}
|
|
1765
|
+
let hit;
|
|
1766
|
+
if (typeof p === "string") {
|
|
1767
|
+
hit = f === p;
|
|
1768
|
+
this.debug("string match", p, f, hit);
|
|
1769
|
+
} else {
|
|
1770
|
+
hit = p.test(f);
|
|
1771
|
+
this.debug("pattern match", p, f, hit);
|
|
1772
|
+
}
|
|
1773
|
+
if (!hit)
|
|
1774
|
+
return false;
|
|
1775
|
+
}
|
|
1776
|
+
if (fi === fl && pi === pl) {
|
|
1777
|
+
return true;
|
|
1778
|
+
} else if (fi === fl) {
|
|
1779
|
+
return partial;
|
|
1780
|
+
} else if (pi === pl) {
|
|
1781
|
+
return fi === fl - 1 && file[fi] === "";
|
|
1782
|
+
} else {
|
|
1783
|
+
throw new Error("wtf?");
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
braceExpand() {
|
|
1787
|
+
return braceExpand(this.pattern, this.options);
|
|
1788
|
+
}
|
|
1789
|
+
parse(pattern) {
|
|
1790
|
+
assertValidPattern(pattern);
|
|
1791
|
+
const options = this.options;
|
|
1792
|
+
if (pattern === "**")
|
|
1793
|
+
return GLOBSTAR;
|
|
1794
|
+
if (pattern === "")
|
|
1795
|
+
return "";
|
|
1796
|
+
let m;
|
|
1797
|
+
let fastTest = null;
|
|
1798
|
+
if (m = pattern.match(starRE)) {
|
|
1799
|
+
fastTest = options.dot ? starTestDot : starTest;
|
|
1800
|
+
} else if (m = pattern.match(starDotExtRE)) {
|
|
1801
|
+
fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m[1]);
|
|
1802
|
+
} else if (m = pattern.match(qmarksRE)) {
|
|
1803
|
+
fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m);
|
|
1804
|
+
} else if (m = pattern.match(starDotStarRE)) {
|
|
1805
|
+
fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
|
|
1806
|
+
} else if (m = pattern.match(dotStarRE)) {
|
|
1807
|
+
fastTest = dotStarTest;
|
|
1808
|
+
}
|
|
1809
|
+
const re = AST.fromGlob(pattern, this.options).toMMPattern();
|
|
1810
|
+
if (fastTest && typeof re === "object") {
|
|
1811
|
+
Reflect.defineProperty(re, "test", { value: fastTest });
|
|
1812
|
+
}
|
|
1813
|
+
return re;
|
|
1814
|
+
}
|
|
1815
|
+
makeRe() {
|
|
1816
|
+
if (this.regexp || this.regexp === false)
|
|
1817
|
+
return this.regexp;
|
|
1818
|
+
const set = this.set;
|
|
1819
|
+
if (!set.length) {
|
|
1820
|
+
this.regexp = false;
|
|
1821
|
+
return this.regexp;
|
|
1822
|
+
}
|
|
1823
|
+
const options = this.options;
|
|
1824
|
+
const twoStar = options.noglobstar ? star2 : options.dot ? twoStarDot : twoStarNoDot;
|
|
1825
|
+
const flags = new Set(options.nocase ? ["i"] : []);
|
|
1826
|
+
let re = set.map((pattern) => {
|
|
1827
|
+
const pp = pattern.map((p) => {
|
|
1828
|
+
if (p instanceof RegExp) {
|
|
1829
|
+
for (const f of p.flags.split(""))
|
|
1830
|
+
flags.add(f);
|
|
1831
|
+
}
|
|
1832
|
+
return typeof p === "string" ? regExpEscape2(p) : p === GLOBSTAR ? GLOBSTAR : p._src;
|
|
1833
|
+
});
|
|
1834
|
+
pp.forEach((p, i2) => {
|
|
1835
|
+
const next = pp[i2 + 1];
|
|
1836
|
+
const prev = pp[i2 - 1];
|
|
1837
|
+
if (p !== GLOBSTAR || prev === GLOBSTAR) {
|
|
1838
|
+
return;
|
|
1839
|
+
}
|
|
1840
|
+
if (prev === void 0) {
|
|
1841
|
+
if (next !== void 0 && next !== GLOBSTAR) {
|
|
1842
|
+
pp[i2 + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
|
|
1843
|
+
} else {
|
|
1844
|
+
pp[i2] = twoStar;
|
|
1845
|
+
}
|
|
1846
|
+
} else if (next === void 0) {
|
|
1847
|
+
pp[i2 - 1] = prev + "(?:\\/|" + twoStar + ")?";
|
|
1848
|
+
} else if (next !== GLOBSTAR) {
|
|
1849
|
+
pp[i2 - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
|
|
1850
|
+
pp[i2 + 1] = GLOBSTAR;
|
|
1851
|
+
}
|
|
1852
|
+
});
|
|
1853
|
+
return pp.filter((p) => p !== GLOBSTAR).join("/");
|
|
1854
|
+
}).join("|");
|
|
1855
|
+
const [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
|
|
1856
|
+
re = "^" + open + re + close + "$";
|
|
1857
|
+
if (this.negate)
|
|
1858
|
+
re = "^(?!" + re + ").+$";
|
|
1859
|
+
try {
|
|
1860
|
+
this.regexp = new RegExp(re, [...flags].join(""));
|
|
1861
|
+
} catch (ex) {
|
|
1862
|
+
this.regexp = false;
|
|
1863
|
+
}
|
|
1864
|
+
return this.regexp;
|
|
1865
|
+
}
|
|
1866
|
+
slashSplit(p) {
|
|
1867
|
+
if (this.preserveMultipleSlashes) {
|
|
1868
|
+
return p.split("/");
|
|
1869
|
+
} else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
|
|
1870
|
+
return ["", ...p.split(/\/+/)];
|
|
1871
|
+
} else {
|
|
1872
|
+
return p.split(/\/+/);
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
match(f, partial = this.partial) {
|
|
1876
|
+
this.debug("match", f, this.pattern);
|
|
1877
|
+
if (this.comment) {
|
|
1878
|
+
return false;
|
|
1879
|
+
}
|
|
1880
|
+
if (this.empty) {
|
|
1881
|
+
return f === "";
|
|
1882
|
+
}
|
|
1883
|
+
if (f === "/" && partial) {
|
|
1884
|
+
return true;
|
|
1885
|
+
}
|
|
1886
|
+
const options = this.options;
|
|
1887
|
+
if (this.isWindows) {
|
|
1888
|
+
f = f.split("\\").join("/");
|
|
1889
|
+
}
|
|
1890
|
+
const ff = this.slashSplit(f);
|
|
1891
|
+
this.debug(this.pattern, "split", ff);
|
|
1892
|
+
const set = this.set;
|
|
1893
|
+
this.debug(this.pattern, "set", set);
|
|
1894
|
+
let filename = ff[ff.length - 1];
|
|
1895
|
+
if (!filename) {
|
|
1896
|
+
for (let i2 = ff.length - 2; !filename && i2 >= 0; i2--) {
|
|
1897
|
+
filename = ff[i2];
|
|
1898
|
+
}
|
|
1899
|
+
}
|
|
1900
|
+
for (let i2 = 0; i2 < set.length; i2++) {
|
|
1901
|
+
const pattern = set[i2];
|
|
1902
|
+
let file = ff;
|
|
1903
|
+
if (options.matchBase && pattern.length === 1) {
|
|
1904
|
+
file = [filename];
|
|
1905
|
+
}
|
|
1906
|
+
const hit = this.matchOne(file, pattern, partial);
|
|
1907
|
+
if (hit) {
|
|
1908
|
+
if (options.flipNegate) {
|
|
1909
|
+
return true;
|
|
1910
|
+
}
|
|
1911
|
+
return !this.negate;
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
if (options.flipNegate) {
|
|
1915
|
+
return false;
|
|
1916
|
+
}
|
|
1917
|
+
return this.negate;
|
|
1918
|
+
}
|
|
1919
|
+
static defaults(def) {
|
|
1920
|
+
return minimatch.defaults(def).Minimatch;
|
|
1921
|
+
}
|
|
1922
|
+
};
|
|
1923
|
+
minimatch.AST = AST;
|
|
1924
|
+
minimatch.Minimatch = Minimatch;
|
|
1925
|
+
minimatch.escape = escape;
|
|
1926
|
+
minimatch.unescape = unescape;
|
|
1927
|
+
|
|
334
1928
|
// src/utils/query-nonce-meta-tag-content.ts
|
|
335
1929
|
function queryNonceMetaTagContent(doc) {
|
|
336
1930
|
var _a, _b, _c;
|
|
@@ -503,10 +2097,17 @@ function createStyleSheetIfNeededAndSupported(styles2) {
|
|
|
503
2097
|
var globalStyleSheet;
|
|
504
2098
|
function createShadowRoot(cmpMeta) {
|
|
505
2099
|
var _a;
|
|
506
|
-
const
|
|
507
|
-
|
|
508
|
-
delegatesFocus
|
|
509
|
-
}
|
|
2100
|
+
const opts = { mode: "open" };
|
|
2101
|
+
if (BUILD.shadowDelegatesFocus) {
|
|
2102
|
+
opts.delegatesFocus = !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */);
|
|
2103
|
+
}
|
|
2104
|
+
if (BUILD.shadowSlotAssignmentManual) {
|
|
2105
|
+
const isManual = !!(cmpMeta.$flags$ & 1024 /* shadowSlotAssignmentManual */);
|
|
2106
|
+
if (isManual) {
|
|
2107
|
+
opts.slotAssignment = "manual";
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
const shadowRoot = this.attachShadow(opts);
|
|
510
2111
|
if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported()) != null ? _a : null;
|
|
511
2112
|
if (globalStyleSheet) {
|
|
512
2113
|
if (supportsMutableAdoptedStyleSheets) {
|
|
@@ -1133,7 +2734,7 @@ var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
|
1133
2734
|
styles.set(scopeId2, style);
|
|
1134
2735
|
};
|
|
1135
2736
|
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
1136
|
-
var _a;
|
|
2737
|
+
var _a, _b, _c;
|
|
1137
2738
|
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
1138
2739
|
const style = styles.get(scopeId2);
|
|
1139
2740
|
if (!BUILD.attachStyles || !win.document) {
|
|
@@ -1148,51 +2749,51 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1148
2749
|
if (!appliedStyles) {
|
|
1149
2750
|
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
1150
2751
|
}
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
1180
|
-
}
|
|
2752
|
+
const existingStyleElm = (BUILD.hydrateClientSide || BUILD.hotModuleReplacement) && styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`);
|
|
2753
|
+
if (existingStyleElm) {
|
|
2754
|
+
existingStyleElm.innerHTML = style;
|
|
2755
|
+
} else if (!appliedStyles.has(scopeId2)) {
|
|
2756
|
+
styleElm = win.document.createElement("style");
|
|
2757
|
+
styleElm.innerHTML = style;
|
|
2758
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
2759
|
+
if (nonce != null) {
|
|
2760
|
+
styleElm.setAttribute("nonce", nonce);
|
|
2761
|
+
}
|
|
2762
|
+
if ((BUILD.hydrateServerSide || BUILD.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */ || cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
2763
|
+
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
2764
|
+
}
|
|
2765
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
2766
|
+
if (styleContainerNode.nodeName === "HEAD") {
|
|
2767
|
+
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
2768
|
+
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
2769
|
+
styleContainerNode.insertBefore(
|
|
2770
|
+
styleElm,
|
|
2771
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
2772
|
+
);
|
|
2773
|
+
} else if ("host" in styleContainerNode) {
|
|
2774
|
+
if (supportsConstructableStylesheets) {
|
|
2775
|
+
const currentWindow = (_b = styleContainerNode.defaultView) != null ? _b : styleContainerNode.ownerDocument.defaultView;
|
|
2776
|
+
const stylesheet = new currentWindow.CSSStyleSheet();
|
|
2777
|
+
stylesheet.replaceSync(style);
|
|
2778
|
+
if (supportsMutableAdoptedStyleSheets) {
|
|
2779
|
+
styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
|
|
1181
2780
|
} else {
|
|
1182
|
-
|
|
1183
|
-
if (existingStyleContainer) {
|
|
1184
|
-
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
1185
|
-
} else {
|
|
1186
|
-
styleContainerNode.prepend(styleElm);
|
|
1187
|
-
}
|
|
2781
|
+
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
1188
2782
|
}
|
|
1189
2783
|
} else {
|
|
1190
|
-
styleContainerNode.
|
|
2784
|
+
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
2785
|
+
if (existingStyleContainer) {
|
|
2786
|
+
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
2787
|
+
} else {
|
|
2788
|
+
styleContainerNode.prepend(styleElm);
|
|
2789
|
+
}
|
|
1191
2790
|
}
|
|
2791
|
+
} else {
|
|
2792
|
+
styleContainerNode.append(styleElm);
|
|
1192
2793
|
}
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
2794
|
+
}
|
|
2795
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2796
|
+
styleContainerNode.insertBefore(styleElm, null);
|
|
1196
2797
|
}
|
|
1197
2798
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
1198
2799
|
styleElm.innerHTML += SLOT_FB_CSS;
|
|
@@ -1201,11 +2802,28 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1201
2802
|
appliedStyles.add(scopeId2);
|
|
1202
2803
|
}
|
|
1203
2804
|
}
|
|
1204
|
-
} else if (BUILD.constructableCSS
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
2805
|
+
} else if (BUILD.constructableCSS) {
|
|
2806
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
2807
|
+
if (!appliedStyles) {
|
|
2808
|
+
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
2809
|
+
}
|
|
2810
|
+
if (!appliedStyles.has(scopeId2)) {
|
|
2811
|
+
const currentWindow = (_c = styleContainerNode.defaultView) != null ? _c : styleContainerNode.ownerDocument.defaultView;
|
|
2812
|
+
let stylesheet;
|
|
2813
|
+
if (style.constructor === currentWindow.CSSStyleSheet) {
|
|
2814
|
+
stylesheet = style;
|
|
2815
|
+
} else {
|
|
2816
|
+
stylesheet = new currentWindow.CSSStyleSheet();
|
|
2817
|
+
for (let i2 = 0; i2 < style.cssRules.length; i2++) {
|
|
2818
|
+
stylesheet.insertRule(style.cssRules[i2].cssText, i2);
|
|
2819
|
+
}
|
|
2820
|
+
}
|
|
2821
|
+
if (supportsMutableAdoptedStyleSheets) {
|
|
2822
|
+
styleContainerNode.adoptedStyleSheets.push(stylesheet);
|
|
2823
|
+
} else {
|
|
2824
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, stylesheet];
|
|
2825
|
+
}
|
|
2826
|
+
appliedStyles.add(scopeId2);
|
|
1209
2827
|
}
|
|
1210
2828
|
}
|
|
1211
2829
|
}
|
|
@@ -1382,7 +3000,7 @@ var validateInputProperties = (inputElm) => {
|
|
|
1382
3000
|
|
|
1383
3001
|
// src/runtime/client-hydrate.ts
|
|
1384
3002
|
var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
1385
|
-
var _a, _b;
|
|
3003
|
+
var _a, _b, _c, _d;
|
|
1386
3004
|
const endHydrate = createTime("hydrateClient", tagName);
|
|
1387
3005
|
const shadowRoot = hostElm.shadowRoot;
|
|
1388
3006
|
const childRenderNodes = [];
|
|
@@ -1475,6 +3093,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1475
3093
|
let snGroupIdx;
|
|
1476
3094
|
let snGroupLen;
|
|
1477
3095
|
let slottedItem;
|
|
3096
|
+
let currentPos = 0;
|
|
1478
3097
|
for (snIndex; snIndex < snLen; snIndex++) {
|
|
1479
3098
|
slotGroup = slottedNodes[snIndex];
|
|
1480
3099
|
if (!slotGroup || !slotGroup.length) continue;
|
|
@@ -1488,7 +3107,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1488
3107
|
if (!hosts[slottedItem.hostId]) continue;
|
|
1489
3108
|
const hostEle = hosts[slottedItem.hostId];
|
|
1490
3109
|
if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
|
|
1491
|
-
hostEle.
|
|
3110
|
+
hostEle.insertBefore(slottedItem.node, (_c = (_b = slotGroup[snGroupIdx - 1]) == null ? void 0 : _b.node) == null ? void 0 : _c.nextSibling);
|
|
1492
3111
|
}
|
|
1493
3112
|
if (!hostEle.shadowRoot || !shadowRoot) {
|
|
1494
3113
|
if (!slottedItem.slot["s-cr"]) {
|
|
@@ -1499,14 +3118,15 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1499
3118
|
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
1500
3119
|
}
|
|
1501
3120
|
}
|
|
1502
|
-
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
1503
|
-
if (((
|
|
3121
|
+
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"] || currentPos);
|
|
3122
|
+
if (((_d = slottedItem.node.parentElement) == null ? void 0 : _d.shadowRoot) && slottedItem.node["getAttribute"] && slottedItem.node.getAttribute("slot")) {
|
|
1504
3123
|
slottedItem.node.removeAttribute("slot");
|
|
1505
3124
|
}
|
|
1506
3125
|
if (BUILD.experimentalSlotFixes) {
|
|
1507
3126
|
patchSlottedNode(slottedItem.node);
|
|
1508
3127
|
}
|
|
1509
3128
|
}
|
|
3129
|
+
currentPos = (slottedItem.node["s-oo"] || currentPos) + 1;
|
|
1510
3130
|
}
|
|
1511
3131
|
}
|
|
1512
3132
|
if (BUILD.scoped && scopeId2 && slotNodes.length) {
|
|
@@ -1528,7 +3148,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1528
3148
|
if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
|
|
1529
3149
|
if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
|
|
1530
3150
|
node.removeAttribute("hidden");
|
|
1531
|
-
} else if (node.nodeType === 8 /* CommentNode */ && !node.nodeValue
|
|
3151
|
+
} else if (node.nodeType === 8 /* CommentNode */ && !node.nodeValue) {
|
|
1532
3152
|
node.parentNode.removeChild(node);
|
|
1533
3153
|
}
|
|
1534
3154
|
}
|
|
@@ -1695,10 +3315,6 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1695
3315
|
vnode.$elm$ = node;
|
|
1696
3316
|
vnode.$index$ = "0";
|
|
1697
3317
|
parentVNode.$children$ = [vnode];
|
|
1698
|
-
} else {
|
|
1699
|
-
if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim() && !node["s-nr"]) {
|
|
1700
|
-
node.remove();
|
|
1701
|
-
}
|
|
1702
3318
|
}
|
|
1703
3319
|
return parentVNode;
|
|
1704
3320
|
};
|
|
@@ -2069,16 +3685,16 @@ var applyStrictSelectorScope = (selector, scopeSelector2, hostSelector) => {
|
|
|
2069
3685
|
let scopedSelector = "";
|
|
2070
3686
|
let startIndex = 0;
|
|
2071
3687
|
let res;
|
|
2072
|
-
const
|
|
3688
|
+
const sep2 = /( |>|\+|~(?!=))(?=(?:[^()]*\([^()]*\))*[^()]*$)\s*/g;
|
|
2073
3689
|
const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;
|
|
2074
3690
|
let shouldScope = !hasHost;
|
|
2075
|
-
while ((res =
|
|
3691
|
+
while ((res = sep2.exec(selector)) !== null) {
|
|
2076
3692
|
const separator = res[1];
|
|
2077
3693
|
const part2 = selector.slice(startIndex, res.index).trim();
|
|
2078
3694
|
shouldScope = shouldScope || part2.indexOf(_polyfillHostNoCombinator) > -1;
|
|
2079
3695
|
const scopedPart = shouldScope ? _scopeSelectorPart(part2) : part2;
|
|
2080
3696
|
scopedSelector += `${scopedPart} ${separator} `;
|
|
2081
|
-
startIndex =
|
|
3697
|
+
startIndex = sep2.lastIndex;
|
|
2082
3698
|
}
|
|
2083
3699
|
const part = selector.substring(startIndex);
|
|
2084
3700
|
shouldScope = !part.match(_safePartRe) && (shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1);
|
|
@@ -2497,10 +4113,11 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
2497
4113
|
elm.classList.add(elm["s-si"] = scopeId);
|
|
2498
4114
|
}
|
|
2499
4115
|
if (newVNode2.$children$) {
|
|
4116
|
+
const appendTarget = newVNode2.$tag$ === "template" ? elm.content : elm;
|
|
2500
4117
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
2501
4118
|
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
2502
4119
|
if (childNode) {
|
|
2503
|
-
|
|
4120
|
+
appendTarget.appendChild(childNode);
|
|
2504
4121
|
}
|
|
2505
4122
|
}
|
|
2506
4123
|
}
|
|
@@ -2587,6 +4204,9 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
|
2587
4204
|
if (BUILD.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
2588
4205
|
containerElm = containerElm.shadowRoot;
|
|
2589
4206
|
}
|
|
4207
|
+
if (parentVNode.$tag$ === "template") {
|
|
4208
|
+
containerElm = containerElm.content;
|
|
4209
|
+
}
|
|
2590
4210
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
2591
4211
|
if (vnodes[startIdx]) {
|
|
2592
4212
|
childNode = createElm(null, parentVNode, startIdx);
|
|
@@ -2630,6 +4250,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
2630
4250
|
let newEndVnode = newCh[newEndIdx];
|
|
2631
4251
|
let node;
|
|
2632
4252
|
let elmToMove;
|
|
4253
|
+
const containerElm = newVNode2.$tag$ === "template" ? parentElm.content : parentElm;
|
|
2633
4254
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
2634
4255
|
if (oldStartVnode == null) {
|
|
2635
4256
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
@@ -2652,7 +4273,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
2652
4273
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
2653
4274
|
}
|
|
2654
4275
|
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
2655
|
-
insertBefore(
|
|
4276
|
+
insertBefore(containerElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
2656
4277
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
2657
4278
|
newEndVnode = newCh[--newEndIdx];
|
|
2658
4279
|
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
@@ -2660,7 +4281,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
2660
4281
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
2661
4282
|
}
|
|
2662
4283
|
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
2663
|
-
insertBefore(
|
|
4284
|
+
insertBefore(containerElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
2664
4285
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
2665
4286
|
newStartVnode = newCh[++newStartIdx];
|
|
2666
4287
|
} else {
|
|
@@ -2935,13 +4556,16 @@ render() {
|
|
|
2935
4556
|
for (const relocateData of relocateNodes) {
|
|
2936
4557
|
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
2937
4558
|
const slotRefNode = relocateData.$slotRefNode$;
|
|
4559
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && isInitialLoad) {
|
|
4560
|
+
nodeToRelocate["s-ih"] = (_a = nodeToRelocate.hidden) != null ? _a : false;
|
|
4561
|
+
}
|
|
2938
4562
|
if (slotRefNode) {
|
|
2939
4563
|
const parentNodeRef = slotRefNode.parentNode;
|
|
2940
4564
|
let insertBeforeNode = slotRefNode.nextSibling;
|
|
2941
4565
|
if (!BUILD.hydrateServerSide && (!BUILD.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
|
|
2942
|
-
let orgLocationNode = (
|
|
4566
|
+
let orgLocationNode = (_b = nodeToRelocate["s-ol"]) == null ? void 0 : _b.previousSibling;
|
|
2943
4567
|
while (orgLocationNode) {
|
|
2944
|
-
let refNode = (
|
|
4568
|
+
let refNode = (_c = orgLocationNode["s-nr"]) != null ? _c : null;
|
|
2945
4569
|
if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
|
|
2946
4570
|
refNode = refNode.nextSibling;
|
|
2947
4571
|
while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
|
|
@@ -2964,18 +4588,13 @@ render() {
|
|
|
2964
4588
|
}
|
|
2965
4589
|
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
2966
4590
|
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
|
|
2967
|
-
nodeToRelocate.hidden = (
|
|
4591
|
+
nodeToRelocate.hidden = (_d = nodeToRelocate["s-ih"]) != null ? _d : false;
|
|
2968
4592
|
}
|
|
2969
4593
|
}
|
|
2970
4594
|
}
|
|
2971
4595
|
nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
|
|
2972
|
-
} else {
|
|
2973
|
-
|
|
2974
|
-
if (isInitialLoad) {
|
|
2975
|
-
nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
|
|
2976
|
-
}
|
|
2977
|
-
nodeToRelocate.hidden = true;
|
|
2978
|
-
}
|
|
4596
|
+
} else if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
4597
|
+
nodeToRelocate.hidden = true;
|
|
2979
4598
|
}
|
|
2980
4599
|
}
|
|
2981
4600
|
}
|
|
@@ -3329,7 +4948,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
3329
4948
|
if (BUILD.serializer && BUILD.reflect && cmpMeta.$attrsToReflect$) {
|
|
3330
4949
|
if (instance && cmpMeta.$serializers$ && cmpMeta.$serializers$[propName]) {
|
|
3331
4950
|
let attrVal = newVal;
|
|
3332
|
-
for (const
|
|
4951
|
+
for (const serializer of cmpMeta.$serializers$[propName]) {
|
|
4952
|
+
const [[methodName]] = Object.entries(serializer);
|
|
3333
4953
|
attrVal = instance[methodName](attrVal, propName);
|
|
3334
4954
|
}
|
|
3335
4955
|
hostRef.$serializerValues$.set(propName, attrVal);
|
|
@@ -3358,27 +4978,34 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
3358
4978
|
);
|
|
3359
4979
|
}
|
|
3360
4980
|
}
|
|
3361
|
-
if (
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
4981
|
+
if (BUILD.propChangeCallback && cmpMeta.$watchers$) {
|
|
4982
|
+
const watchMethods = cmpMeta.$watchers$[propName];
|
|
4983
|
+
if (watchMethods) {
|
|
4984
|
+
watchMethods.map((watcher) => {
|
|
4985
|
+
try {
|
|
4986
|
+
const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
|
|
4987
|
+
if (flags & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */) {
|
|
4988
|
+
if (!instance) {
|
|
4989
|
+
hostRef.$fetchedCbList$.push(() => {
|
|
4990
|
+
hostRef.$lazyInstance$[watchMethodName](newVal, oldVal, propName);
|
|
4991
|
+
});
|
|
4992
|
+
} else {
|
|
4993
|
+
instance[watchMethodName](newVal, oldVal, propName);
|
|
4994
|
+
}
|
|
3370
4995
|
}
|
|
3371
|
-
})
|
|
3372
|
-
|
|
3373
|
-
}
|
|
3374
|
-
if (BUILD.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
3375
|
-
if (instance.componentShouldUpdate) {
|
|
3376
|
-
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
3377
|
-
return;
|
|
4996
|
+
} catch (e) {
|
|
4997
|
+
consoleError(e, elm);
|
|
3378
4998
|
}
|
|
4999
|
+
});
|
|
5000
|
+
}
|
|
5001
|
+
}
|
|
5002
|
+
if (BUILD.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
5003
|
+
if (instance.componentShouldUpdate) {
|
|
5004
|
+
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
5005
|
+
return;
|
|
3379
5006
|
}
|
|
3380
|
-
scheduleUpdate(hostRef, false);
|
|
3381
5007
|
}
|
|
5008
|
+
scheduleUpdate(hostRef, false);
|
|
3382
5009
|
}
|
|
3383
5010
|
}
|
|
3384
5011
|
};
|
|
@@ -3561,7 +5188,8 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
3561
5188
|
this[propName] = deserializeVal;
|
|
3562
5189
|
}
|
|
3563
5190
|
};
|
|
3564
|
-
for (const
|
|
5191
|
+
for (const deserializer of cmpMeta.$deserializers$[propName]) {
|
|
5192
|
+
const [[methodName]] = Object.entries(deserializer);
|
|
3565
5193
|
if (BUILD.lazyLoad) {
|
|
3566
5194
|
if (hostRef.$lazyInstance$) {
|
|
3567
5195
|
setVal(methodName, hostRef.$lazyInstance$);
|
|
@@ -3580,13 +5208,14 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
3580
5208
|
return;
|
|
3581
5209
|
} else if (propName == null) {
|
|
3582
5210
|
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
3583
|
-
if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) &&
|
|
5211
|
+
if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) && newValue !== oldValue) {
|
|
3584
5212
|
const elm = BUILD.lazyLoad ? hostRef.$hostElement$ : this;
|
|
3585
5213
|
const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
3586
5214
|
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
|
|
3587
|
-
entry == null ? void 0 : entry.forEach((
|
|
3588
|
-
|
|
3589
|
-
|
|
5215
|
+
entry == null ? void 0 : entry.forEach((watcher) => {
|
|
5216
|
+
const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
|
|
5217
|
+
if (instance[watchMethodName] != null && (flags2 & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */)) {
|
|
5218
|
+
instance[watchMethodName].call(instance, newValue, oldValue, attrName);
|
|
3590
5219
|
}
|
|
3591
5220
|
});
|
|
3592
5221
|
}
|
|
@@ -3687,7 +5316,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
3687
5316
|
}
|
|
3688
5317
|
}
|
|
3689
5318
|
const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
3690
|
-
if (!styles.has(scopeId2)) {
|
|
5319
|
+
if (!styles.has(scopeId2) || BUILD.hotModuleReplacement && hmrVersionId) {
|
|
3691
5320
|
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
3692
5321
|
if (BUILD.hydrateServerSide && BUILD.shadowDom) {
|
|
3693
5322
|
if (cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */) {
|
|
@@ -3850,7 +5479,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
3850
5479
|
if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
3851
5480
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
3852
5481
|
}
|
|
3853
|
-
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /*
|
|
5482
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /* hasSlot */) {
|
|
3854
5483
|
if (BUILD.experimentalSlotFixes) {
|
|
3855
5484
|
patchPseudoShadowDom(Cstr.prototype);
|
|
3856
5485
|
} else {
|
|
@@ -4079,7 +5708,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
4079
5708
|
return (_a3 = getHostRef(this)) == null ? void 0 : _a3.$onReadyPromise$;
|
|
4080
5709
|
}
|
|
4081
5710
|
};
|
|
4082
|
-
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /*
|
|
5711
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /* hasSlot */) {
|
|
4083
5712
|
if (BUILD.experimentalSlotFixes) {
|
|
4084
5713
|
patchPseudoShadowDom(HostElement.prototype);
|
|
4085
5714
|
} else {
|