@ticketlayer/elements 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -15
- package/dist/cjs/{index-DfzcrE9-.js → index-I9CoYv3k.js} +277 -1798
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/money-BtmM2gt-.js +118 -0
- package/dist/cjs/{order-summary-ZMkJ5bez.js → order-summary-X3TlZxc2.js} +34 -0
- package/dist/cjs/ticketlayer-elements.cjs.js +3 -3
- package/dist/cjs/tl-buy-modal.cjs.entry.js +3 -3
- package/dist/cjs/tl-buy-tickets-button.cjs.entry.js +10 -7
- package/dist/cjs/tl-buy-tickets-wrapper.cjs.entry.js +2 -2
- package/dist/cjs/tl-cart-badge.cjs.entry.js +2 -2
- package/dist/cjs/tl-cart-drawer.cjs.entry.js +2 -2
- package/dist/cjs/tl-cart.cjs.entry.js +10 -4
- package/dist/cjs/tl-checkout-wrapper.cjs.entry.js +2 -2
- package/dist/cjs/tl-event-card.cjs.entry.js +4 -3
- package/dist/cjs/tl-event-list.cjs.entry.js +2 -2
- package/dist/cjs/tl-login.cjs.entry.js +4 -3
- package/dist/cjs/tl-my-orders.cjs.entry.js +4 -3
- package/dist/cjs/tl-occurrence-selector_2.cjs.entry.js +454 -122
- package/dist/cjs/tl-order-confirmation.cjs.entry.js +11 -8
- package/dist/cjs/tl-order-tickets_2.cjs.entry.js +3 -3
- package/dist/cjs/tl-promo-code.cjs.entry.js +4 -3
- package/dist/cjs/tl-seat-map.cjs.entry.js +2 -2
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/tl-buy-modal/tl-buy-modal.css +12 -13
- package/dist/collection/components/tl-buy-modal/tl-buy-modal.js +1 -1
- package/dist/collection/components/tl-buy-tickets-button/tl-buy-tickets-button.css +4 -4
- package/dist/collection/components/tl-buy-tickets-button/tl-buy-tickets-button.js +11 -8
- package/dist/collection/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.css +2 -2
- package/dist/collection/components/tl-cart/tl-cart.css +52 -51
- package/dist/collection/components/tl-cart/tl-cart.js +10 -4
- package/dist/collection/components/tl-cart-badge/tl-cart-badge.css +11 -11
- package/dist/collection/components/tl-cart-drawer/tl-cart-drawer.css +6 -6
- package/dist/collection/components/tl-checkout-wrapper/tl-checkout-wrapper.css +2 -2
- package/dist/collection/components/tl-event-card/tl-event-card.css +22 -22
- package/dist/collection/components/tl-event-card/tl-event-card.js +1 -1
- package/dist/collection/components/tl-event-list/tl-event-list.css +17 -17
- package/dist/collection/components/tl-login/tl-login.css +26 -26
- package/dist/collection/components/tl-login/tl-login.js +1 -1
- package/dist/collection/components/tl-my-orders/tl-my-orders.css +40 -40
- package/dist/collection/components/tl-occurrence-selector/tl-occurrence-selector.css +54 -65
- package/dist/collection/components/tl-occurrence-selector/tl-occurrence-selector.js +2 -2
- package/dist/collection/components/tl-order-confirmation/tl-order-confirmation.css +38 -38
- package/dist/collection/components/tl-order-confirmation/tl-order-confirmation.js +8 -6
- package/dist/collection/components/tl-order-tickets/tl-order-tickets.css +9 -9
- package/dist/collection/components/tl-promo-code/tl-promo-code.css +25 -25
- package/dist/collection/components/tl-promo-code/tl-promo-code.js +1 -1
- package/dist/collection/components/tl-seat-map/tl-seat-map.css +10 -10
- package/dist/collection/components/tl-ticket/tl-ticket.css +13 -13
- package/dist/collection/components/tl-ticket/tl-ticket.js +1 -1
- package/dist/collection/components/tl-ticket-selector/tl-ticket-selector.css +74 -49
- package/dist/collection/components/tl-ticket-selector/tl-ticket-selector.js +73 -127
- package/dist/collection/utils/cart-totals.js +9 -0
- package/dist/collection/utils/order-summary.js +36 -0
- package/dist/components/money.js +1 -0
- package/dist/components/order-summary.js +1 -1
- package/dist/components/tl-buy-modal.js +1 -1
- package/dist/components/tl-buy-tickets-button.js +1 -1
- package/dist/components/tl-buy-tickets-wrapper2.js +1 -1
- package/dist/components/tl-cart-badge.js +1 -1
- package/dist/components/tl-cart-drawer.js +1 -1
- package/dist/components/tl-cart2.js +1 -1
- package/dist/components/tl-checkout-wrapper2.js +1 -1
- package/dist/components/tl-event-card2.js +1 -1
- package/dist/components/tl-event-list.js +1 -1
- package/dist/components/tl-login2.js +1 -1
- package/dist/components/tl-my-orders.js +1 -1
- package/dist/components/tl-occurrence-selector2.js +1 -1
- package/dist/components/tl-order-confirmation.js +1 -1
- package/dist/components/tl-order-tickets2.js +1 -1
- package/dist/components/tl-promo-code.js +1 -1
- package/dist/components/tl-seat-map.js +1 -1
- package/dist/components/tl-ticket-selector2.js +1 -1
- package/dist/components/tl-ticket2.js +1 -1
- package/dist/elements.docs.d.ts +26 -0
- package/dist/elements.docs.json +35 -17
- package/dist/esm/{index-Ba-RZTFI.js → index-OoYV1faY.js} +277 -1798
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/money-4ig0-WB6.js +112 -0
- package/dist/esm/{order-summary-BGekdjN9.js → order-summary-DiDtvfZM.js} +34 -1
- package/dist/esm/ticketlayer-elements.js +4 -4
- package/dist/esm/tl-buy-modal.entry.js +3 -3
- package/dist/esm/tl-buy-tickets-button.entry.js +10 -7
- package/dist/esm/tl-buy-tickets-wrapper.entry.js +2 -2
- package/dist/esm/tl-cart-badge.entry.js +2 -2
- package/dist/esm/tl-cart-drawer.entry.js +2 -2
- package/dist/esm/tl-cart.entry.js +10 -4
- package/dist/esm/tl-checkout-wrapper.entry.js +2 -2
- package/dist/esm/tl-event-card.entry.js +4 -3
- package/dist/esm/tl-event-list.entry.js +2 -2
- package/dist/esm/tl-login.entry.js +4 -3
- package/dist/esm/tl-my-orders.entry.js +4 -3
- package/dist/esm/tl-occurrence-selector_2.entry.js +455 -123
- package/dist/esm/tl-order-confirmation.entry.js +11 -8
- package/dist/esm/tl-order-tickets_2.entry.js +3 -3
- package/dist/esm/tl-promo-code.entry.js +4 -3
- package/dist/esm/tl-seat-map.entry.js +2 -2
- package/dist/ticketlayer-elements/index.esm.js +1 -1
- package/dist/ticketlayer-elements/p-0814420f.entry.js +1 -0
- package/dist/ticketlayer-elements/p-0acabc26.entry.js +1 -0
- package/dist/ticketlayer-elements/{p-9372ff1f.entry.js → p-109a3feb.entry.js} +1 -1
- package/dist/ticketlayer-elements/{p-41d22d7c.entry.js → p-1a4ba71c.entry.js} +1 -1
- package/dist/ticketlayer-elements/p-318965c1.entry.js +1 -0
- package/dist/ticketlayer-elements/p-347c7fd1.entry.js +1 -0
- package/dist/ticketlayer-elements/p-3649c26d.entry.js +1 -0
- package/dist/ticketlayer-elements/p-40260cc9.entry.js +1 -0
- package/dist/ticketlayer-elements/p-4ig0-WB6.js +1 -0
- package/dist/ticketlayer-elements/p-55fd2f9f.entry.js +1 -0
- package/dist/ticketlayer-elements/p-62ee659b.entry.js +1 -0
- package/dist/ticketlayer-elements/{p-f446310d.entry.js → p-7d4ecc2b.entry.js} +1 -1
- package/dist/ticketlayer-elements/p-7f0abf95.entry.js +1 -0
- package/dist/ticketlayer-elements/p-BXpVGW51.js +1 -0
- package/dist/ticketlayer-elements/p-OoYV1faY.js +3 -0
- package/dist/ticketlayer-elements/p-a3c1b26c.entry.js +1 -0
- package/dist/ticketlayer-elements/p-ac264adc.entry.js +1 -0
- package/dist/ticketlayer-elements/{p-82752e3b.entry.js → p-aeb4c6fb.entry.js} +1 -1
- package/dist/ticketlayer-elements/{p-9c9072c8.entry.js → p-ba62541f.entry.js} +1 -1
- package/dist/ticketlayer-elements/ticketlayer-elements.css +1 -1
- package/dist/ticketlayer-elements/ticketlayer-elements.esm.js +1 -1
- package/dist/types/components/tl-cart/tl-cart.d.ts +10 -0
- package/dist/types/components/tl-ticket-selector/tl-ticket-selector.d.ts +40 -29
- package/dist/types/components.d.ts +165 -36
- package/dist/types/stencil-public-runtime.d.ts +97 -57
- package/dist/types/utils/cart-totals.d.ts +10 -0
- package/dist/types/utils/order-summary.d.ts +34 -0
- package/elements.catalogue.json +91 -22
- package/loader/index.d.ts +1 -1
- package/package.json +31 -32
- package/dist/ticketlayer-elements/p-0291df4c.entry.js +0 -1
- package/dist/ticketlayer-elements/p-11273f8f.entry.js +0 -1
- package/dist/ticketlayer-elements/p-340ab4f5.entry.js +0 -1
- package/dist/ticketlayer-elements/p-7ff43848.entry.js +0 -1
- package/dist/ticketlayer-elements/p-976770f3.entry.js +0 -1
- package/dist/ticketlayer-elements/p-9a903ff6.entry.js +0 -1
- package/dist/ticketlayer-elements/p-BGekdjN9.js +0 -1
- package/dist/ticketlayer-elements/p-Ba-RZTFI.js +0 -2
- package/dist/ticketlayer-elements/p-a5c90b68.entry.js +0 -1
- package/dist/ticketlayer-elements/p-b6d479ad.entry.js +0 -1
- package/dist/ticketlayer-elements/p-eb640760.entry.js +0 -1
- package/dist/ticketlayer-elements/p-f5846f61.entry.js +0 -1
- package/dist/ticketlayer-elements/p-fb9444c4.entry.js +0 -1
|
@@ -4,261 +4,29 @@ const NAMESPACE = 'ticketlayer-elements';
|
|
|
4
4
|
const BUILD = /* ticketlayer-elements */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: true, slotRelocation: true, state: true, updatable: true};
|
|
5
5
|
|
|
6
6
|
const globalScripts = () => {};
|
|
7
|
-
const globalStyles = ":root{--tl-
|
|
7
|
+
const globalStyles = ":root{--tl-primary:#6366f1;--tl-color-primary:var(--tl-primary);--tl-primary-foreground:#ffffff;--tl-color-primary-foreground:var(--tl-primary-foreground);--tl-secondary:#f3f4f6;--tl-color-secondary:var(--tl-secondary);--tl-secondary-foreground:#111827;--tl-color-secondary-foreground:var(--tl-secondary-foreground);--tl-accent:#ec4899;--tl-color-accent:var(--tl-accent);--tl-accent-foreground:#ffffff;--tl-color-accent-foreground:var(--tl-accent-foreground);--tl-background:#ffffff;--tl-color-background:var(--tl-background);--tl-foreground:#111827;--tl-color-foreground:var(--tl-foreground);--tl-card:#ffffff;--tl-color-card:var(--tl-card);--tl-muted:#f9fafb;--tl-color-muted:var(--tl-muted);--tl-muted-foreground:#6b7280;--tl-color-muted-foreground:var(--tl-muted-foreground);--tl-border:#e5e7eb;--tl-color-border:var(--tl-border);--tl-border-hover:#9ca3af;--tl-color-border-hover:var(--tl-border-hover);--tl-input:#e5e7eb;--tl-color-input:var(--tl-input);--tl-ring:#6366f1;--tl-color-ring:var(--tl-ring);--tl-success:#10b981;--tl-color-success:var(--tl-success);--tl-success-foreground:#ffffff;--tl-color-success-foreground:var(--tl-success-foreground);--tl-warning:#f59e0b;--tl-color-warning:var(--tl-warning);--tl-warning-foreground:#ffffff;--tl-color-warning-foreground:var(--tl-warning-foreground);--tl-warning-bg:#fef3c7;--tl-color-warning-bg:var(--tl-warning-bg);--tl-error:#ef4444;--tl-color-error:var(--tl-error);--tl-destructive:var(--tl-error);--tl-color-destructive:var(--tl-error);--tl-error-foreground:#ffffff;--tl-color-error-foreground:var(--tl-error-foreground);--tl-destructive-foreground:var(--tl-error-foreground);--tl-color-destructive-foreground:var(--tl-error-foreground);--tl-error-bg:#fee2e2;--tl-color-error-bg:var(--tl-error-bg);--tl-destructive-bg:var(--tl-error-bg);--tl-color-destructive-bg:var(--tl-error-bg);--tl-font-family:system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;--tl-font-family-mono:ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;--tl-font-size-base:16px;--tl-base-size:var(--tl-font-size-base);--tl-font-scale:1.25;--tl-radius-none:0px;--tl-radius-sm:0.25rem;--tl-radius-md:0.5rem;--tl-radius:var(--tl-radius-md);--tl-radius-lg:0.75rem;--tl-radius-full:9999px;--tl-spacing-1:0.25rem;--tl-spacing-2:0.5rem;--tl-spacing-3:0.75rem;--tl-spacing-4:1rem;--tl-spacing-5:1.25rem;--tl-spacing-6:1.5rem;--tl-spacing-8:2rem;--tl-duration-fast:120ms;--tl-duration-normal:200ms;--tl-duration-slow:320ms;--tl-easing-standard:cubic-bezier(0.2, 0, 0, 1);--tl-easing-emphasised:cubic-bezier(0.3, 0, 0, 1)}";
|
|
8
8
|
|
|
9
9
|
/*
|
|
10
|
-
Stencil Client Platform v4.
|
|
10
|
+
Stencil Client Platform v4.45.0 | MIT Licensed | https://stenciljs.com
|
|
11
11
|
*/
|
|
12
|
-
var __create = Object.create;
|
|
13
|
-
var __defProp = Object.defineProperty;
|
|
14
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
15
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
16
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
17
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
18
|
-
var __typeError = (msg) => {
|
|
19
|
-
throw TypeError(msg);
|
|
20
|
-
};
|
|
21
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
22
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
23
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
24
|
-
};
|
|
25
|
-
var __export = (target, all) => {
|
|
26
|
-
for (var name in all)
|
|
27
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
28
|
-
};
|
|
29
|
-
var __copyProps = (to, from, except, desc) => {
|
|
30
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
31
|
-
for (let key of __getOwnPropNames(from))
|
|
32
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
33
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
34
|
-
}
|
|
35
|
-
return to;
|
|
36
|
-
};
|
|
37
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
38
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
39
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
40
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
41
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
42
|
-
__defProp(target, "default", { value: mod, enumerable: true }) ,
|
|
43
|
-
mod
|
|
44
|
-
));
|
|
45
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "" , value);
|
|
46
|
-
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
47
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
48
|
-
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);
|
|
49
|
-
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
50
|
-
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
51
12
|
|
|
52
|
-
// node_modules/balanced-match/index.js
|
|
53
|
-
var require_balanced_match = __commonJS({
|
|
54
|
-
"node_modules/balanced-match/index.js"(exports, module) {
|
|
55
|
-
module.exports = balanced;
|
|
56
|
-
function balanced(a, b, str) {
|
|
57
|
-
if (a instanceof RegExp) a = maybeMatch(a, str);
|
|
58
|
-
if (b instanceof RegExp) b = maybeMatch(b, str);
|
|
59
|
-
var r = range(a, b, str);
|
|
60
|
-
return r && {
|
|
61
|
-
start: r[0],
|
|
62
|
-
end: r[1],
|
|
63
|
-
pre: str.slice(0, r[0]),
|
|
64
|
-
body: str.slice(r[0] + a.length, r[1]),
|
|
65
|
-
post: str.slice(r[1] + b.length)
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
function maybeMatch(reg, str) {
|
|
69
|
-
var m = str.match(reg);
|
|
70
|
-
return m ? m[0] : null;
|
|
71
|
-
}
|
|
72
|
-
balanced.range = range;
|
|
73
|
-
function range(a, b, str) {
|
|
74
|
-
var begs, beg, left, right, result;
|
|
75
|
-
var ai = str.indexOf(a);
|
|
76
|
-
var bi = str.indexOf(b, ai + 1);
|
|
77
|
-
var i2 = ai;
|
|
78
|
-
if (ai >= 0 && bi > 0) {
|
|
79
|
-
if (a === b) {
|
|
80
|
-
return [ai, bi];
|
|
81
|
-
}
|
|
82
|
-
begs = [];
|
|
83
|
-
left = str.length;
|
|
84
|
-
while (i2 >= 0 && !result) {
|
|
85
|
-
if (i2 == ai) {
|
|
86
|
-
begs.push(i2);
|
|
87
|
-
ai = str.indexOf(a, i2 + 1);
|
|
88
|
-
} else if (begs.length == 1) {
|
|
89
|
-
result = [begs.pop(), bi];
|
|
90
|
-
} else {
|
|
91
|
-
beg = begs.pop();
|
|
92
|
-
if (beg < left) {
|
|
93
|
-
left = beg;
|
|
94
|
-
right = bi;
|
|
95
|
-
}
|
|
96
|
-
bi = str.indexOf(b, i2 + 1);
|
|
97
|
-
}
|
|
98
|
-
i2 = ai < bi && ai >= 0 ? ai : bi;
|
|
99
|
-
}
|
|
100
|
-
if (begs.length) {
|
|
101
|
-
result = [left, right];
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return result;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
// node_modules/brace-expansion/index.js
|
|
110
|
-
var require_brace_expansion = __commonJS({
|
|
111
|
-
"node_modules/brace-expansion/index.js"(exports, module) {
|
|
112
|
-
var balanced = require_balanced_match();
|
|
113
|
-
module.exports = expandTop;
|
|
114
|
-
var escSlash = "\0SLASH" + Math.random() + "\0";
|
|
115
|
-
var escOpen = "\0OPEN" + Math.random() + "\0";
|
|
116
|
-
var escClose = "\0CLOSE" + Math.random() + "\0";
|
|
117
|
-
var escComma = "\0COMMA" + Math.random() + "\0";
|
|
118
|
-
var escPeriod = "\0PERIOD" + Math.random() + "\0";
|
|
119
|
-
function numeric(str) {
|
|
120
|
-
return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
|
|
121
|
-
}
|
|
122
|
-
function escapeBraces(str) {
|
|
123
|
-
return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
|
|
124
|
-
}
|
|
125
|
-
function unescapeBraces(str) {
|
|
126
|
-
return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
|
|
127
|
-
}
|
|
128
|
-
function parseCommaParts(str) {
|
|
129
|
-
if (!str)
|
|
130
|
-
return [""];
|
|
131
|
-
var parts = [];
|
|
132
|
-
var m = balanced("{", "}", str);
|
|
133
|
-
if (!m)
|
|
134
|
-
return str.split(",");
|
|
135
|
-
var pre = m.pre;
|
|
136
|
-
var body = m.body;
|
|
137
|
-
var post = m.post;
|
|
138
|
-
var p = pre.split(",");
|
|
139
|
-
p[p.length - 1] += "{" + body + "}";
|
|
140
|
-
var postParts = parseCommaParts(post);
|
|
141
|
-
if (post.length) {
|
|
142
|
-
p[p.length - 1] += postParts.shift();
|
|
143
|
-
p.push.apply(p, postParts);
|
|
144
|
-
}
|
|
145
|
-
parts.push.apply(parts, p);
|
|
146
|
-
return parts;
|
|
147
|
-
}
|
|
148
|
-
function expandTop(str) {
|
|
149
|
-
if (!str)
|
|
150
|
-
return [];
|
|
151
|
-
if (str.substr(0, 2) === "{}") {
|
|
152
|
-
str = "\\{\\}" + str.substr(2);
|
|
153
|
-
}
|
|
154
|
-
return expand2(escapeBraces(str), true).map(unescapeBraces);
|
|
155
|
-
}
|
|
156
|
-
function embrace(str) {
|
|
157
|
-
return "{" + str + "}";
|
|
158
|
-
}
|
|
159
|
-
function isPadded(el) {
|
|
160
|
-
return /^-?0\d/.test(el);
|
|
161
|
-
}
|
|
162
|
-
function lte(i2, y) {
|
|
163
|
-
return i2 <= y;
|
|
164
|
-
}
|
|
165
|
-
function gte(i2, y) {
|
|
166
|
-
return i2 >= y;
|
|
167
|
-
}
|
|
168
|
-
function expand2(str, isTop) {
|
|
169
|
-
var expansions = [];
|
|
170
|
-
var m = balanced("{", "}", str);
|
|
171
|
-
if (!m) return [str];
|
|
172
|
-
var pre = m.pre;
|
|
173
|
-
var post = m.post.length ? expand2(m.post, false) : [""];
|
|
174
|
-
if (/\$$/.test(m.pre)) {
|
|
175
|
-
for (var k = 0; k < post.length; k++) {
|
|
176
|
-
var expansion = pre + "{" + m.body + "}" + post[k];
|
|
177
|
-
expansions.push(expansion);
|
|
178
|
-
}
|
|
179
|
-
} else {
|
|
180
|
-
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
|
181
|
-
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
|
182
|
-
var isSequence = isNumericSequence || isAlphaSequence;
|
|
183
|
-
var isOptions = m.body.indexOf(",") >= 0;
|
|
184
|
-
if (!isSequence && !isOptions) {
|
|
185
|
-
if (m.post.match(/,(?!,).*\}/)) {
|
|
186
|
-
str = m.pre + "{" + m.body + escClose + m.post;
|
|
187
|
-
return expand2(str);
|
|
188
|
-
}
|
|
189
|
-
return [str];
|
|
190
|
-
}
|
|
191
|
-
var n;
|
|
192
|
-
if (isSequence) {
|
|
193
|
-
n = m.body.split(/\.\./);
|
|
194
|
-
} else {
|
|
195
|
-
n = parseCommaParts(m.body);
|
|
196
|
-
if (n.length === 1) {
|
|
197
|
-
n = expand2(n[0], false).map(embrace);
|
|
198
|
-
if (n.length === 1) {
|
|
199
|
-
return post.map(function(p) {
|
|
200
|
-
return m.pre + n[0] + p;
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
var N;
|
|
206
|
-
if (isSequence) {
|
|
207
|
-
var x = numeric(n[0]);
|
|
208
|
-
var y = numeric(n[1]);
|
|
209
|
-
var width = Math.max(n[0].length, n[1].length);
|
|
210
|
-
var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
|
|
211
|
-
var test = lte;
|
|
212
|
-
var reverse = y < x;
|
|
213
|
-
if (reverse) {
|
|
214
|
-
incr *= -1;
|
|
215
|
-
test = gte;
|
|
216
|
-
}
|
|
217
|
-
var pad = n.some(isPadded);
|
|
218
|
-
N = [];
|
|
219
|
-
for (var i2 = x; test(i2, y); i2 += incr) {
|
|
220
|
-
var c;
|
|
221
|
-
if (isAlphaSequence) {
|
|
222
|
-
c = String.fromCharCode(i2);
|
|
223
|
-
if (c === "\\")
|
|
224
|
-
c = "";
|
|
225
|
-
} else {
|
|
226
|
-
c = String(i2);
|
|
227
|
-
if (pad) {
|
|
228
|
-
var need = width - c.length;
|
|
229
|
-
if (need > 0) {
|
|
230
|
-
var z = new Array(need + 1).join("0");
|
|
231
|
-
if (i2 < 0)
|
|
232
|
-
c = "-" + z + c.slice(1);
|
|
233
|
-
else
|
|
234
|
-
c = z + c;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
N.push(c);
|
|
239
|
-
}
|
|
240
|
-
} else {
|
|
241
|
-
N = [];
|
|
242
|
-
for (var j = 0; j < n.length; j++) {
|
|
243
|
-
N.push.apply(N, expand2(n[j], false));
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
for (var j = 0; j < N.length; j++) {
|
|
247
|
-
for (var k = 0; k < post.length; k++) {
|
|
248
|
-
var expansion = pre + N[j] + post[k];
|
|
249
|
-
if (!isTop || isSequence || expansion)
|
|
250
|
-
expansions.push(expansion);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
return expansions;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
13
|
|
|
259
14
|
// src/utils/constants.ts
|
|
260
15
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
261
16
|
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
17
|
+
|
|
18
|
+
// src/utils/get-prop-descriptor.ts
|
|
19
|
+
function getPropertyDescriptor(obj, memberName, getOnly) {
|
|
20
|
+
const stopAt = typeof HTMLElement !== "undefined" ? HTMLElement.prototype : null;
|
|
21
|
+
while (obj && obj !== stopAt) {
|
|
22
|
+
const desc = Object.getOwnPropertyDescriptor(obj, memberName);
|
|
23
|
+
if (desc && (!getOnly || desc.get)) return desc;
|
|
24
|
+
obj = Object.getPrototypeOf(obj);
|
|
25
|
+
}
|
|
26
|
+
return void 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// src/utils/es2022-rewire-class-members.ts
|
|
262
30
|
var reWireGetterSetter = (instance, hostRef) => {
|
|
263
31
|
var _a;
|
|
264
32
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
@@ -266,7 +34,7 @@ var reWireGetterSetter = (instance, hostRef) => {
|
|
|
266
34
|
members.map(([memberName, [memberFlags]]) => {
|
|
267
35
|
if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
|
|
268
36
|
const ogValue = instance[memberName];
|
|
269
|
-
const ogDescriptor = getPropertyDescriptor(Object.getPrototypeOf(instance), memberName) || Object.getOwnPropertyDescriptor(instance, memberName);
|
|
37
|
+
const ogDescriptor = getPropertyDescriptor(Object.getPrototypeOf(instance), memberName, true) || Object.getOwnPropertyDescriptor(instance, memberName);
|
|
270
38
|
if (ogDescriptor) {
|
|
271
39
|
Object.defineProperty(instance, memberName, {
|
|
272
40
|
get() {
|
|
@@ -279,18 +47,14 @@ var reWireGetterSetter = (instance, hostRef) => {
|
|
|
279
47
|
enumerable: true
|
|
280
48
|
});
|
|
281
49
|
}
|
|
282
|
-
|
|
50
|
+
if (hostRef.$instanceValues$.has(memberName)) {
|
|
51
|
+
instance[memberName] = hostRef.$instanceValues$.get(memberName);
|
|
52
|
+
} else if (ogValue !== void 0) {
|
|
53
|
+
instance[memberName] = ogValue;
|
|
54
|
+
}
|
|
283
55
|
}
|
|
284
56
|
});
|
|
285
57
|
};
|
|
286
|
-
function getPropertyDescriptor(obj, memberName) {
|
|
287
|
-
while (obj) {
|
|
288
|
-
const desc = Object.getOwnPropertyDescriptor(obj, memberName);
|
|
289
|
-
if (desc == null ? void 0 : desc.get) return desc;
|
|
290
|
-
obj = Object.getPrototypeOf(obj);
|
|
291
|
-
}
|
|
292
|
-
return void 0;
|
|
293
|
-
}
|
|
294
58
|
|
|
295
59
|
// src/client/client-host-ref.ts
|
|
296
60
|
var getHostRef = (ref) => {
|
|
@@ -332,7 +96,9 @@ var consoleError = (e, el) => (0, console.error)(e, el);
|
|
|
332
96
|
|
|
333
97
|
// src/client/client-load-module.ts
|
|
334
98
|
var cmpModules = /* @__PURE__ */ new Map();
|
|
99
|
+
var failedLoadAttempts = /* @__PURE__ */ new Map();
|
|
335
100
|
var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
101
|
+
var _a;
|
|
336
102
|
const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
|
|
337
103
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
338
104
|
if (!bundleId) {
|
|
@@ -342,21 +108,28 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
342
108
|
if (module) {
|
|
343
109
|
return module[exportName];
|
|
344
110
|
}
|
|
111
|
+
const retryCount = (_a = failedLoadAttempts.get(bundleId)) != null ? _a : 0;
|
|
112
|
+
const cacheBustParams = [
|
|
113
|
+
retryCount > 0 ? `s-retry=${retryCount}` : "",
|
|
114
|
+
""
|
|
115
|
+
].filter(Boolean).join("&");
|
|
345
116
|
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
346
117
|
return import(
|
|
347
118
|
/* @vite-ignore */
|
|
348
119
|
/* webpackInclude: /\.entry\.js$/ */
|
|
349
120
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
350
121
|
/* webpackMode: "lazy" */
|
|
351
|
-
`./${bundleId}.entry.js${""}`
|
|
122
|
+
`./${bundleId}.entry.js${cacheBustParams ? "?" + cacheBustParams : ""}`
|
|
352
123
|
).then(
|
|
353
124
|
(importedModule) => {
|
|
354
125
|
{
|
|
126
|
+
failedLoadAttempts.delete(bundleId);
|
|
355
127
|
cmpModules.set(bundleId, importedModule);
|
|
356
128
|
}
|
|
357
129
|
return importedModule[exportName];
|
|
358
130
|
},
|
|
359
131
|
(e) => {
|
|
132
|
+
failedLoadAttempts.set(bundleId, retryCount + 1);
|
|
360
133
|
consoleError(e, hostRef.$hostElement$);
|
|
361
134
|
}
|
|
362
135
|
);
|
|
@@ -366,6 +139,8 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
366
139
|
var styles = /* @__PURE__ */ new Map();
|
|
367
140
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
368
141
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
142
|
+
var MAX_LAZY_LOAD_RETRIES = 3;
|
|
143
|
+
var LAZY_LOAD_RETRY_INTERVAL_MS = 1e3;
|
|
369
144
|
var win = typeof window !== "undefined" ? window : {};
|
|
370
145
|
var plt = {
|
|
371
146
|
$flags$: 0,
|
|
@@ -392,6 +167,10 @@ var supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets ? /* @_
|
|
|
392
167
|
var queuePending = false;
|
|
393
168
|
var queueDomReads = [];
|
|
394
169
|
var queueDomWrites = [];
|
|
170
|
+
var scheduleFlush = () => {
|
|
171
|
+
var _a;
|
|
172
|
+
return ((_a = win.document) == null ? void 0 : _a.hidden) ? nextTick(flush) : plt.raf(flush);
|
|
173
|
+
};
|
|
395
174
|
var queueTask = (queue, write) => (cb) => {
|
|
396
175
|
queue.push(cb);
|
|
397
176
|
if (!queuePending) {
|
|
@@ -399,7 +178,7 @@ var queueTask = (queue, write) => (cb) => {
|
|
|
399
178
|
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
400
179
|
nextTick(flush);
|
|
401
180
|
} else {
|
|
402
|
-
|
|
181
|
+
scheduleFlush();
|
|
403
182
|
}
|
|
404
183
|
}
|
|
405
184
|
};
|
|
@@ -418,1429 +197,12 @@ var flush = () => {
|
|
|
418
197
|
{
|
|
419
198
|
consume(queueDomWrites);
|
|
420
199
|
if (queuePending = queueDomReads.length > 0) {
|
|
421
|
-
|
|
200
|
+
scheduleFlush();
|
|
422
201
|
}
|
|
423
202
|
}
|
|
424
203
|
};
|
|
425
204
|
var nextTick = (cb) => promiseResolve().then(cb);
|
|
426
205
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
427
|
-
var isComplexType = (o) => {
|
|
428
|
-
o = typeof o;
|
|
429
|
-
return o === "object" || o === "function";
|
|
430
|
-
};
|
|
431
|
-
|
|
432
|
-
// node_modules/minimatch/dist/esm/index.js
|
|
433
|
-
var import_brace_expansion = __toESM(require_brace_expansion());
|
|
434
|
-
|
|
435
|
-
// node_modules/minimatch/dist/esm/assert-valid-pattern.js
|
|
436
|
-
var MAX_PATTERN_LENGTH = 1024 * 64;
|
|
437
|
-
var assertValidPattern = (pattern) => {
|
|
438
|
-
if (typeof pattern !== "string") {
|
|
439
|
-
throw new TypeError("invalid pattern");
|
|
440
|
-
}
|
|
441
|
-
if (pattern.length > MAX_PATTERN_LENGTH) {
|
|
442
|
-
throw new TypeError("pattern is too long");
|
|
443
|
-
}
|
|
444
|
-
};
|
|
445
|
-
|
|
446
|
-
// node_modules/minimatch/dist/esm/brace-expressions.js
|
|
447
|
-
var posixClasses = {
|
|
448
|
-
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
|
|
449
|
-
"[:alpha:]": ["\\p{L}\\p{Nl}", true],
|
|
450
|
-
"[:ascii:]": ["\\x00-\\x7f", false],
|
|
451
|
-
"[:blank:]": ["\\p{Zs}\\t", true],
|
|
452
|
-
"[:cntrl:]": ["\\p{Cc}", true],
|
|
453
|
-
"[:digit:]": ["\\p{Nd}", true],
|
|
454
|
-
"[:graph:]": ["\\p{Z}\\p{C}", true, true],
|
|
455
|
-
"[:lower:]": ["\\p{Ll}", true],
|
|
456
|
-
"[:print:]": ["\\p{C}", true],
|
|
457
|
-
"[:punct:]": ["\\p{P}", true],
|
|
458
|
-
"[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true],
|
|
459
|
-
"[:upper:]": ["\\p{Lu}", true],
|
|
460
|
-
"[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true],
|
|
461
|
-
"[:xdigit:]": ["A-Fa-f0-9", false]
|
|
462
|
-
};
|
|
463
|
-
var braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&");
|
|
464
|
-
var regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
465
|
-
var rangesToString = (ranges) => ranges.join("");
|
|
466
|
-
var parseClass = (glob, position) => {
|
|
467
|
-
const pos = position;
|
|
468
|
-
if (glob.charAt(pos) !== "[") {
|
|
469
|
-
throw new Error("not in a brace expression");
|
|
470
|
-
}
|
|
471
|
-
const ranges = [];
|
|
472
|
-
const negs = [];
|
|
473
|
-
let i2 = pos + 1;
|
|
474
|
-
let sawStart = false;
|
|
475
|
-
let uflag = false;
|
|
476
|
-
let escaping = false;
|
|
477
|
-
let negate = false;
|
|
478
|
-
let endPos = pos;
|
|
479
|
-
let rangeStart = "";
|
|
480
|
-
WHILE: while (i2 < glob.length) {
|
|
481
|
-
const c = glob.charAt(i2);
|
|
482
|
-
if ((c === "!" || c === "^") && i2 === pos + 1) {
|
|
483
|
-
negate = true;
|
|
484
|
-
i2++;
|
|
485
|
-
continue;
|
|
486
|
-
}
|
|
487
|
-
if (c === "]" && sawStart && !escaping) {
|
|
488
|
-
endPos = i2 + 1;
|
|
489
|
-
break;
|
|
490
|
-
}
|
|
491
|
-
sawStart = true;
|
|
492
|
-
if (c === "\\") {
|
|
493
|
-
if (!escaping) {
|
|
494
|
-
escaping = true;
|
|
495
|
-
i2++;
|
|
496
|
-
continue;
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
if (c === "[" && !escaping) {
|
|
500
|
-
for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
|
|
501
|
-
if (glob.startsWith(cls, i2)) {
|
|
502
|
-
if (rangeStart) {
|
|
503
|
-
return ["$.", false, glob.length - pos, true];
|
|
504
|
-
}
|
|
505
|
-
i2 += cls.length;
|
|
506
|
-
if (neg)
|
|
507
|
-
negs.push(unip);
|
|
508
|
-
else
|
|
509
|
-
ranges.push(unip);
|
|
510
|
-
uflag = uflag || u;
|
|
511
|
-
continue WHILE;
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
escaping = false;
|
|
516
|
-
if (rangeStart) {
|
|
517
|
-
if (c > rangeStart) {
|
|
518
|
-
ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));
|
|
519
|
-
} else if (c === rangeStart) {
|
|
520
|
-
ranges.push(braceEscape(c));
|
|
521
|
-
}
|
|
522
|
-
rangeStart = "";
|
|
523
|
-
i2++;
|
|
524
|
-
continue;
|
|
525
|
-
}
|
|
526
|
-
if (glob.startsWith("-]", i2 + 1)) {
|
|
527
|
-
ranges.push(braceEscape(c + "-"));
|
|
528
|
-
i2 += 2;
|
|
529
|
-
continue;
|
|
530
|
-
}
|
|
531
|
-
if (glob.startsWith("-", i2 + 1)) {
|
|
532
|
-
rangeStart = c;
|
|
533
|
-
i2 += 2;
|
|
534
|
-
continue;
|
|
535
|
-
}
|
|
536
|
-
ranges.push(braceEscape(c));
|
|
537
|
-
i2++;
|
|
538
|
-
}
|
|
539
|
-
if (endPos < i2) {
|
|
540
|
-
return ["", false, 0, false];
|
|
541
|
-
}
|
|
542
|
-
if (!ranges.length && !negs.length) {
|
|
543
|
-
return ["$.", false, glob.length - pos, true];
|
|
544
|
-
}
|
|
545
|
-
if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
|
|
546
|
-
const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
|
|
547
|
-
return [regexpEscape(r), false, endPos - pos, false];
|
|
548
|
-
}
|
|
549
|
-
const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
|
|
550
|
-
const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
|
|
551
|
-
const comb = ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs;
|
|
552
|
-
return [comb, uflag, endPos - pos, true];
|
|
553
|
-
};
|
|
554
|
-
|
|
555
|
-
// node_modules/minimatch/dist/esm/unescape.js
|
|
556
|
-
var unescape = (s, { windowsPathsNoEscape = false } = {}) => {
|
|
557
|
-
return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
|
|
558
|
-
};
|
|
559
|
-
|
|
560
|
-
// node_modules/minimatch/dist/esm/ast.js
|
|
561
|
-
var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
|
|
562
|
-
var isExtglobType = (c) => types.has(c);
|
|
563
|
-
var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
|
564
|
-
var startNoDot = "(?!\\.)";
|
|
565
|
-
var addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
|
|
566
|
-
var justDots = /* @__PURE__ */ new Set(["..", "."]);
|
|
567
|
-
var reSpecials = new Set("().*{}+?[]^$\\!");
|
|
568
|
-
var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
569
|
-
var qmark = "[^/]";
|
|
570
|
-
var star = qmark + "*?";
|
|
571
|
-
var starNoEmpty = qmark + "+?";
|
|
572
|
-
var _root, _hasMagic, _uflag, _parts, _parent, _parentIndex, _negs, _filledNegs, _options, _toString, _emptyExt, _AST_instances, fillNegs_fn, _AST_static, parseAST_fn, partsToRegExp_fn, parseGlob_fn;
|
|
573
|
-
var _AST = class _AST {
|
|
574
|
-
constructor(type, parent, options = {}) {
|
|
575
|
-
__privateAdd(this, _AST_instances);
|
|
576
|
-
__publicField(this, "type");
|
|
577
|
-
__privateAdd(this, _root);
|
|
578
|
-
__privateAdd(this, _hasMagic);
|
|
579
|
-
__privateAdd(this, _uflag, false);
|
|
580
|
-
__privateAdd(this, _parts, []);
|
|
581
|
-
__privateAdd(this, _parent);
|
|
582
|
-
__privateAdd(this, _parentIndex);
|
|
583
|
-
__privateAdd(this, _negs);
|
|
584
|
-
__privateAdd(this, _filledNegs, false);
|
|
585
|
-
__privateAdd(this, _options);
|
|
586
|
-
__privateAdd(this, _toString);
|
|
587
|
-
// set to true if it's an extglob with no children
|
|
588
|
-
// (which really means one child of '')
|
|
589
|
-
__privateAdd(this, _emptyExt, false);
|
|
590
|
-
this.type = type;
|
|
591
|
-
if (type)
|
|
592
|
-
__privateSet(this, _hasMagic, true);
|
|
593
|
-
__privateSet(this, _parent, parent);
|
|
594
|
-
__privateSet(this, _root, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _root) : this);
|
|
595
|
-
__privateSet(this, _options, __privateGet(this, _root) === this ? options : __privateGet(__privateGet(this, _root), _options));
|
|
596
|
-
__privateSet(this, _negs, __privateGet(this, _root) === this ? [] : __privateGet(__privateGet(this, _root), _negs));
|
|
597
|
-
if (type === "!" && !__privateGet(__privateGet(this, _root), _filledNegs))
|
|
598
|
-
__privateGet(this, _negs).push(this);
|
|
599
|
-
__privateSet(this, _parentIndex, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0);
|
|
600
|
-
}
|
|
601
|
-
get hasMagic() {
|
|
602
|
-
if (__privateGet(this, _hasMagic) !== void 0)
|
|
603
|
-
return __privateGet(this, _hasMagic);
|
|
604
|
-
for (const p of __privateGet(this, _parts)) {
|
|
605
|
-
if (typeof p === "string")
|
|
606
|
-
continue;
|
|
607
|
-
if (p.type || p.hasMagic)
|
|
608
|
-
return __privateSet(this, _hasMagic, true);
|
|
609
|
-
}
|
|
610
|
-
return __privateGet(this, _hasMagic);
|
|
611
|
-
}
|
|
612
|
-
// reconstructs the pattern
|
|
613
|
-
toString() {
|
|
614
|
-
if (__privateGet(this, _toString) !== void 0)
|
|
615
|
-
return __privateGet(this, _toString);
|
|
616
|
-
if (!this.type) {
|
|
617
|
-
return __privateSet(this, _toString, __privateGet(this, _parts).map((p) => String(p)).join(""));
|
|
618
|
-
} else {
|
|
619
|
-
return __privateSet(this, _toString, this.type + "(" + __privateGet(this, _parts).map((p) => String(p)).join("|") + ")");
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
push(...parts) {
|
|
623
|
-
for (const p of parts) {
|
|
624
|
-
if (p === "")
|
|
625
|
-
continue;
|
|
626
|
-
if (typeof p !== "string" && !(p instanceof _AST && __privateGet(p, _parent) === this)) {
|
|
627
|
-
throw new Error("invalid part: " + p);
|
|
628
|
-
}
|
|
629
|
-
__privateGet(this, _parts).push(p);
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
toJSON() {
|
|
633
|
-
var _a;
|
|
634
|
-
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())];
|
|
635
|
-
if (this.isStart() && !this.type)
|
|
636
|
-
ret.unshift([]);
|
|
637
|
-
if (this.isEnd() && (this === __privateGet(this, _root) || __privateGet(__privateGet(this, _root), _filledNegs) && ((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!")) {
|
|
638
|
-
ret.push({});
|
|
639
|
-
}
|
|
640
|
-
return ret;
|
|
641
|
-
}
|
|
642
|
-
isStart() {
|
|
643
|
-
var _a;
|
|
644
|
-
if (__privateGet(this, _root) === this)
|
|
645
|
-
return true;
|
|
646
|
-
if (!((_a = __privateGet(this, _parent)) == null ? void 0 : _a.isStart()))
|
|
647
|
-
return false;
|
|
648
|
-
if (__privateGet(this, _parentIndex) === 0)
|
|
649
|
-
return true;
|
|
650
|
-
const p = __privateGet(this, _parent);
|
|
651
|
-
for (let i2 = 0; i2 < __privateGet(this, _parentIndex); i2++) {
|
|
652
|
-
const pp = __privateGet(p, _parts)[i2];
|
|
653
|
-
if (!(pp instanceof _AST && pp.type === "!")) {
|
|
654
|
-
return false;
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
return true;
|
|
658
|
-
}
|
|
659
|
-
isEnd() {
|
|
660
|
-
var _a, _b, _c;
|
|
661
|
-
if (__privateGet(this, _root) === this)
|
|
662
|
-
return true;
|
|
663
|
-
if (((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!")
|
|
664
|
-
return true;
|
|
665
|
-
if (!((_b = __privateGet(this, _parent)) == null ? void 0 : _b.isEnd()))
|
|
666
|
-
return false;
|
|
667
|
-
if (!this.type)
|
|
668
|
-
return (_c = __privateGet(this, _parent)) == null ? void 0 : _c.isEnd();
|
|
669
|
-
const pl = __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0;
|
|
670
|
-
return __privateGet(this, _parentIndex) === pl - 1;
|
|
671
|
-
}
|
|
672
|
-
copyIn(part) {
|
|
673
|
-
if (typeof part === "string")
|
|
674
|
-
this.push(part);
|
|
675
|
-
else
|
|
676
|
-
this.push(part.clone(this));
|
|
677
|
-
}
|
|
678
|
-
clone(parent) {
|
|
679
|
-
const c = new _AST(this.type, parent);
|
|
680
|
-
for (const p of __privateGet(this, _parts)) {
|
|
681
|
-
c.copyIn(p);
|
|
682
|
-
}
|
|
683
|
-
return c;
|
|
684
|
-
}
|
|
685
|
-
static fromGlob(pattern, options = {}) {
|
|
686
|
-
var _a;
|
|
687
|
-
const ast = new _AST(null, void 0, options);
|
|
688
|
-
__privateMethod(_a = _AST, _AST_static, parseAST_fn).call(_a, pattern, ast, 0, options);
|
|
689
|
-
return ast;
|
|
690
|
-
}
|
|
691
|
-
// returns the regular expression if there's magic, or the unescaped
|
|
692
|
-
// string if not.
|
|
693
|
-
toMMPattern() {
|
|
694
|
-
if (this !== __privateGet(this, _root))
|
|
695
|
-
return __privateGet(this, _root).toMMPattern();
|
|
696
|
-
const glob = this.toString();
|
|
697
|
-
const [re, body, hasMagic, uflag] = this.toRegExpSource();
|
|
698
|
-
const anyMagic = hasMagic || __privateGet(this, _hasMagic) || __privateGet(this, _options).nocase && !__privateGet(this, _options).nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase();
|
|
699
|
-
if (!anyMagic) {
|
|
700
|
-
return body;
|
|
701
|
-
}
|
|
702
|
-
const flags = (__privateGet(this, _options).nocase ? "i" : "") + (uflag ? "u" : "");
|
|
703
|
-
return Object.assign(new RegExp(`^${re}$`, flags), {
|
|
704
|
-
_src: re,
|
|
705
|
-
_glob: glob
|
|
706
|
-
});
|
|
707
|
-
}
|
|
708
|
-
get options() {
|
|
709
|
-
return __privateGet(this, _options);
|
|
710
|
-
}
|
|
711
|
-
// returns the string match, the regexp source, whether there's magic
|
|
712
|
-
// in the regexp (so a regular expression is required) and whether or
|
|
713
|
-
// not the uflag is needed for the regular expression (for posix classes)
|
|
714
|
-
// TODO: instead of injecting the start/end at this point, just return
|
|
715
|
-
// the BODY of the regexp, along with the start/end portions suitable
|
|
716
|
-
// for binding the start/end in either a joined full-path makeRe context
|
|
717
|
-
// (where we bind to (^|/), or a standalone matchPart context (where
|
|
718
|
-
// we bind to ^, and not /). Otherwise slashes get duped!
|
|
719
|
-
//
|
|
720
|
-
// In part-matching mode, the start is:
|
|
721
|
-
// - if not isStart: nothing
|
|
722
|
-
// - if traversal possible, but not allowed: ^(?!\.\.?$)
|
|
723
|
-
// - if dots allowed or not possible: ^
|
|
724
|
-
// - if dots possible and not allowed: ^(?!\.)
|
|
725
|
-
// end is:
|
|
726
|
-
// - if not isEnd(): nothing
|
|
727
|
-
// - else: $
|
|
728
|
-
//
|
|
729
|
-
// In full-path matching mode, we put the slash at the START of the
|
|
730
|
-
// pattern, so start is:
|
|
731
|
-
// - if first pattern: same as part-matching mode
|
|
732
|
-
// - if not isStart(): nothing
|
|
733
|
-
// - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
|
|
734
|
-
// - if dots allowed or not possible: /
|
|
735
|
-
// - if dots possible and not allowed: /(?!\.)
|
|
736
|
-
// end is:
|
|
737
|
-
// - if last pattern, same as part-matching mode
|
|
738
|
-
// - else nothing
|
|
739
|
-
//
|
|
740
|
-
// Always put the (?:$|/) on negated tails, though, because that has to be
|
|
741
|
-
// there to bind the end of the negated pattern portion, and it's easier to
|
|
742
|
-
// just stick it in now rather than try to inject it later in the middle of
|
|
743
|
-
// the pattern.
|
|
744
|
-
//
|
|
745
|
-
// We can just always return the same end, and leave it up to the caller
|
|
746
|
-
// to know whether it's going to be used joined or in parts.
|
|
747
|
-
// And, if the start is adjusted slightly, can do the same there:
|
|
748
|
-
// - if not isStart: nothing
|
|
749
|
-
// - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
|
|
750
|
-
// - if dots allowed or not possible: (?:/|^)
|
|
751
|
-
// - if dots possible and not allowed: (?:/|^)(?!\.)
|
|
752
|
-
//
|
|
753
|
-
// But it's better to have a simpler binding without a conditional, for
|
|
754
|
-
// performance, so probably better to return both start options.
|
|
755
|
-
//
|
|
756
|
-
// Then the caller just ignores the end if it's not the first pattern,
|
|
757
|
-
// and the start always gets applied.
|
|
758
|
-
//
|
|
759
|
-
// But that's always going to be $ if it's the ending pattern, or nothing,
|
|
760
|
-
// so the caller can just attach $ at the end of the pattern when building.
|
|
761
|
-
//
|
|
762
|
-
// So the todo is:
|
|
763
|
-
// - better detect what kind of start is needed
|
|
764
|
-
// - return both flavors of starting pattern
|
|
765
|
-
// - attach $ at the end of the pattern when creating the actual RegExp
|
|
766
|
-
//
|
|
767
|
-
// Ah, but wait, no, that all only applies to the root when the first pattern
|
|
768
|
-
// is not an extglob. If the first pattern IS an extglob, then we need all
|
|
769
|
-
// that dot prevention biz to live in the extglob portions, because eg
|
|
770
|
-
// +(*|.x*) can match .xy but not .yx.
|
|
771
|
-
//
|
|
772
|
-
// So, return the two flavors if it's #root and the first child is not an
|
|
773
|
-
// AST, otherwise leave it to the child AST to handle it, and there,
|
|
774
|
-
// use the (?:^|/) style of start binding.
|
|
775
|
-
//
|
|
776
|
-
// Even simplified further:
|
|
777
|
-
// - Since the start for a join is eg /(?!\.) and the start for a part
|
|
778
|
-
// is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
|
|
779
|
-
// or start or whatever) and prepend ^ or / at the Regexp construction.
|
|
780
|
-
toRegExpSource(allowDot) {
|
|
781
|
-
var _a;
|
|
782
|
-
const dot = allowDot != null ? allowDot : !!__privateGet(this, _options).dot;
|
|
783
|
-
if (__privateGet(this, _root) === this)
|
|
784
|
-
__privateMethod(this, _AST_instances, fillNegs_fn).call(this);
|
|
785
|
-
if (!this.type) {
|
|
786
|
-
const noEmpty = this.isStart() && this.isEnd();
|
|
787
|
-
const src = __privateGet(this, _parts).map((p) => {
|
|
788
|
-
var _a2;
|
|
789
|
-
const [re, _, hasMagic, uflag] = typeof p === "string" ? __privateMethod(_a2 = _AST, _AST_static, parseGlob_fn).call(_a2, p, __privateGet(this, _hasMagic), noEmpty) : p.toRegExpSource(allowDot);
|
|
790
|
-
__privateSet(this, _hasMagic, __privateGet(this, _hasMagic) || hasMagic);
|
|
791
|
-
__privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
|
|
792
|
-
return re;
|
|
793
|
-
}).join("");
|
|
794
|
-
let start2 = "";
|
|
795
|
-
if (this.isStart()) {
|
|
796
|
-
if (typeof __privateGet(this, _parts)[0] === "string") {
|
|
797
|
-
const dotTravAllowed = __privateGet(this, _parts).length === 1 && justDots.has(__privateGet(this, _parts)[0]);
|
|
798
|
-
if (!dotTravAllowed) {
|
|
799
|
-
const aps = addPatternStart;
|
|
800
|
-
const needNoTrav = (
|
|
801
|
-
// dots are allowed, and the pattern starts with [ or .
|
|
802
|
-
dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
|
|
803
|
-
src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
|
|
804
|
-
src.startsWith("\\.\\.") && aps.has(src.charAt(4))
|
|
805
|
-
);
|
|
806
|
-
const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
|
|
807
|
-
start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
let end = "";
|
|
812
|
-
if (this.isEnd() && __privateGet(__privateGet(this, _root), _filledNegs) && ((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!") {
|
|
813
|
-
end = "(?:$|\\/)";
|
|
814
|
-
}
|
|
815
|
-
const final2 = start2 + src + end;
|
|
816
|
-
return [
|
|
817
|
-
final2,
|
|
818
|
-
unescape(src),
|
|
819
|
-
__privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
|
|
820
|
-
__privateGet(this, _uflag)
|
|
821
|
-
];
|
|
822
|
-
}
|
|
823
|
-
const repeated = this.type === "*" || this.type === "+";
|
|
824
|
-
const start = this.type === "!" ? "(?:(?!(?:" : "(?:";
|
|
825
|
-
let body = __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, dot);
|
|
826
|
-
if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
|
|
827
|
-
const s = this.toString();
|
|
828
|
-
__privateSet(this, _parts, [s]);
|
|
829
|
-
this.type = null;
|
|
830
|
-
__privateSet(this, _hasMagic, void 0);
|
|
831
|
-
return [s, unescape(this.toString()), false, false];
|
|
832
|
-
}
|
|
833
|
-
let bodyDotAllowed = !repeated || allowDot || dot || false ? "" : __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, true);
|
|
834
|
-
if (bodyDotAllowed === body) {
|
|
835
|
-
bodyDotAllowed = "";
|
|
836
|
-
}
|
|
837
|
-
if (bodyDotAllowed) {
|
|
838
|
-
body = `(?:${body})(?:${bodyDotAllowed})*?`;
|
|
839
|
-
}
|
|
840
|
-
let final = "";
|
|
841
|
-
if (this.type === "!" && __privateGet(this, _emptyExt)) {
|
|
842
|
-
final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
|
|
843
|
-
} else {
|
|
844
|
-
const close = this.type === "!" ? (
|
|
845
|
-
// !() must match something,but !(x) can match ''
|
|
846
|
-
"))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")"
|
|
847
|
-
) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
|
|
848
|
-
final = start + body + close;
|
|
849
|
-
}
|
|
850
|
-
return [
|
|
851
|
-
final,
|
|
852
|
-
unescape(body),
|
|
853
|
-
__privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
|
|
854
|
-
__privateGet(this, _uflag)
|
|
855
|
-
];
|
|
856
|
-
}
|
|
857
|
-
};
|
|
858
|
-
_root = new WeakMap();
|
|
859
|
-
_hasMagic = new WeakMap();
|
|
860
|
-
_uflag = new WeakMap();
|
|
861
|
-
_parts = new WeakMap();
|
|
862
|
-
_parent = new WeakMap();
|
|
863
|
-
_parentIndex = new WeakMap();
|
|
864
|
-
_negs = new WeakMap();
|
|
865
|
-
_filledNegs = new WeakMap();
|
|
866
|
-
_options = new WeakMap();
|
|
867
|
-
_toString = new WeakMap();
|
|
868
|
-
_emptyExt = new WeakMap();
|
|
869
|
-
_AST_instances = new WeakSet();
|
|
870
|
-
fillNegs_fn = function() {
|
|
871
|
-
if (this !== __privateGet(this, _root))
|
|
872
|
-
throw new Error("should only call on root");
|
|
873
|
-
if (__privateGet(this, _filledNegs))
|
|
874
|
-
return this;
|
|
875
|
-
this.toString();
|
|
876
|
-
__privateSet(this, _filledNegs, true);
|
|
877
|
-
let n;
|
|
878
|
-
while (n = __privateGet(this, _negs).pop()) {
|
|
879
|
-
if (n.type !== "!")
|
|
880
|
-
continue;
|
|
881
|
-
let p = n;
|
|
882
|
-
let pp = __privateGet(p, _parent);
|
|
883
|
-
while (pp) {
|
|
884
|
-
for (let i2 = __privateGet(p, _parentIndex) + 1; !pp.type && i2 < __privateGet(pp, _parts).length; i2++) {
|
|
885
|
-
for (const part of __privateGet(n, _parts)) {
|
|
886
|
-
if (typeof part === "string") {
|
|
887
|
-
throw new Error("string part in extglob AST??");
|
|
888
|
-
}
|
|
889
|
-
part.copyIn(__privateGet(pp, _parts)[i2]);
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
p = pp;
|
|
893
|
-
pp = __privateGet(p, _parent);
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
return this;
|
|
897
|
-
};
|
|
898
|
-
_AST_static = new WeakSet();
|
|
899
|
-
parseAST_fn = function(str, ast, pos, opt) {
|
|
900
|
-
var _a, _b;
|
|
901
|
-
let escaping = false;
|
|
902
|
-
let inBrace = false;
|
|
903
|
-
let braceStart = -1;
|
|
904
|
-
let braceNeg = false;
|
|
905
|
-
if (ast.type === null) {
|
|
906
|
-
let i3 = pos;
|
|
907
|
-
let acc2 = "";
|
|
908
|
-
while (i3 < str.length) {
|
|
909
|
-
const c = str.charAt(i3++);
|
|
910
|
-
if (escaping || c === "\\") {
|
|
911
|
-
escaping = !escaping;
|
|
912
|
-
acc2 += c;
|
|
913
|
-
continue;
|
|
914
|
-
}
|
|
915
|
-
if (inBrace) {
|
|
916
|
-
if (i3 === braceStart + 1) {
|
|
917
|
-
if (c === "^" || c === "!") {
|
|
918
|
-
braceNeg = true;
|
|
919
|
-
}
|
|
920
|
-
} else if (c === "]" && !(i3 === braceStart + 2 && braceNeg)) {
|
|
921
|
-
inBrace = false;
|
|
922
|
-
}
|
|
923
|
-
acc2 += c;
|
|
924
|
-
continue;
|
|
925
|
-
} else if (c === "[") {
|
|
926
|
-
inBrace = true;
|
|
927
|
-
braceStart = i3;
|
|
928
|
-
braceNeg = false;
|
|
929
|
-
acc2 += c;
|
|
930
|
-
continue;
|
|
931
|
-
}
|
|
932
|
-
if (!opt.noext && isExtglobType(c) && str.charAt(i3) === "(") {
|
|
933
|
-
ast.push(acc2);
|
|
934
|
-
acc2 = "";
|
|
935
|
-
const ext2 = new _AST(c, ast);
|
|
936
|
-
i3 = __privateMethod(_a = _AST, _AST_static, parseAST_fn).call(_a, str, ext2, i3, opt);
|
|
937
|
-
ast.push(ext2);
|
|
938
|
-
continue;
|
|
939
|
-
}
|
|
940
|
-
acc2 += c;
|
|
941
|
-
}
|
|
942
|
-
ast.push(acc2);
|
|
943
|
-
return i3;
|
|
944
|
-
}
|
|
945
|
-
let i2 = pos + 1;
|
|
946
|
-
let part = new _AST(null, ast);
|
|
947
|
-
const parts = [];
|
|
948
|
-
let acc = "";
|
|
949
|
-
while (i2 < str.length) {
|
|
950
|
-
const c = str.charAt(i2++);
|
|
951
|
-
if (escaping || c === "\\") {
|
|
952
|
-
escaping = !escaping;
|
|
953
|
-
acc += c;
|
|
954
|
-
continue;
|
|
955
|
-
}
|
|
956
|
-
if (inBrace) {
|
|
957
|
-
if (i2 === braceStart + 1) {
|
|
958
|
-
if (c === "^" || c === "!") {
|
|
959
|
-
braceNeg = true;
|
|
960
|
-
}
|
|
961
|
-
} else if (c === "]" && !(i2 === braceStart + 2 && braceNeg)) {
|
|
962
|
-
inBrace = false;
|
|
963
|
-
}
|
|
964
|
-
acc += c;
|
|
965
|
-
continue;
|
|
966
|
-
} else if (c === "[") {
|
|
967
|
-
inBrace = true;
|
|
968
|
-
braceStart = i2;
|
|
969
|
-
braceNeg = false;
|
|
970
|
-
acc += c;
|
|
971
|
-
continue;
|
|
972
|
-
}
|
|
973
|
-
if (isExtglobType(c) && str.charAt(i2) === "(") {
|
|
974
|
-
part.push(acc);
|
|
975
|
-
acc = "";
|
|
976
|
-
const ext2 = new _AST(c, part);
|
|
977
|
-
part.push(ext2);
|
|
978
|
-
i2 = __privateMethod(_b = _AST, _AST_static, parseAST_fn).call(_b, str, ext2, i2, opt);
|
|
979
|
-
continue;
|
|
980
|
-
}
|
|
981
|
-
if (c === "|") {
|
|
982
|
-
part.push(acc);
|
|
983
|
-
acc = "";
|
|
984
|
-
parts.push(part);
|
|
985
|
-
part = new _AST(null, ast);
|
|
986
|
-
continue;
|
|
987
|
-
}
|
|
988
|
-
if (c === ")") {
|
|
989
|
-
if (acc === "" && __privateGet(ast, _parts).length === 0) {
|
|
990
|
-
__privateSet(ast, _emptyExt, true);
|
|
991
|
-
}
|
|
992
|
-
part.push(acc);
|
|
993
|
-
acc = "";
|
|
994
|
-
ast.push(...parts, part);
|
|
995
|
-
return i2;
|
|
996
|
-
}
|
|
997
|
-
acc += c;
|
|
998
|
-
}
|
|
999
|
-
ast.type = null;
|
|
1000
|
-
__privateSet(ast, _hasMagic, void 0);
|
|
1001
|
-
__privateSet(ast, _parts, [str.substring(pos - 1)]);
|
|
1002
|
-
return i2;
|
|
1003
|
-
};
|
|
1004
|
-
partsToRegExp_fn = function(dot) {
|
|
1005
|
-
return __privateGet(this, _parts).map((p) => {
|
|
1006
|
-
if (typeof p === "string") {
|
|
1007
|
-
throw new Error("string type in extglob ast??");
|
|
1008
|
-
}
|
|
1009
|
-
const [re, _, _hasMagic2, uflag] = p.toRegExpSource(dot);
|
|
1010
|
-
__privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
|
|
1011
|
-
return re;
|
|
1012
|
-
}).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
|
|
1013
|
-
};
|
|
1014
|
-
parseGlob_fn = function(glob, hasMagic, noEmpty = false) {
|
|
1015
|
-
let escaping = false;
|
|
1016
|
-
let re = "";
|
|
1017
|
-
let uflag = false;
|
|
1018
|
-
for (let i2 = 0; i2 < glob.length; i2++) {
|
|
1019
|
-
const c = glob.charAt(i2);
|
|
1020
|
-
if (escaping) {
|
|
1021
|
-
escaping = false;
|
|
1022
|
-
re += (reSpecials.has(c) ? "\\" : "") + c;
|
|
1023
|
-
continue;
|
|
1024
|
-
}
|
|
1025
|
-
if (c === "\\") {
|
|
1026
|
-
if (i2 === glob.length - 1) {
|
|
1027
|
-
re += "\\\\";
|
|
1028
|
-
} else {
|
|
1029
|
-
escaping = true;
|
|
1030
|
-
}
|
|
1031
|
-
continue;
|
|
1032
|
-
}
|
|
1033
|
-
if (c === "[") {
|
|
1034
|
-
const [src, needUflag, consumed, magic] = parseClass(glob, i2);
|
|
1035
|
-
if (consumed) {
|
|
1036
|
-
re += src;
|
|
1037
|
-
uflag = uflag || needUflag;
|
|
1038
|
-
i2 += consumed - 1;
|
|
1039
|
-
hasMagic = hasMagic || magic;
|
|
1040
|
-
continue;
|
|
1041
|
-
}
|
|
1042
|
-
}
|
|
1043
|
-
if (c === "*") {
|
|
1044
|
-
if (noEmpty && glob === "*")
|
|
1045
|
-
re += starNoEmpty;
|
|
1046
|
-
else
|
|
1047
|
-
re += star;
|
|
1048
|
-
hasMagic = true;
|
|
1049
|
-
continue;
|
|
1050
|
-
}
|
|
1051
|
-
if (c === "?") {
|
|
1052
|
-
re += qmark;
|
|
1053
|
-
hasMagic = true;
|
|
1054
|
-
continue;
|
|
1055
|
-
}
|
|
1056
|
-
re += regExpEscape(c);
|
|
1057
|
-
}
|
|
1058
|
-
return [re, unescape(glob), !!hasMagic, uflag];
|
|
1059
|
-
};
|
|
1060
|
-
__privateAdd(_AST, _AST_static);
|
|
1061
|
-
var AST = _AST;
|
|
1062
|
-
|
|
1063
|
-
// node_modules/minimatch/dist/esm/escape.js
|
|
1064
|
-
var escape = (s, { windowsPathsNoEscape = false } = {}) => {
|
|
1065
|
-
return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
|
|
1066
|
-
};
|
|
1067
|
-
|
|
1068
|
-
// node_modules/minimatch/dist/esm/index.js
|
|
1069
|
-
var minimatch = (p, pattern, options = {}) => {
|
|
1070
|
-
assertValidPattern(pattern);
|
|
1071
|
-
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
1072
|
-
return false;
|
|
1073
|
-
}
|
|
1074
|
-
return new Minimatch(pattern, options).match(p);
|
|
1075
|
-
};
|
|
1076
|
-
var starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
|
|
1077
|
-
var starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2);
|
|
1078
|
-
var starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2);
|
|
1079
|
-
var starDotExtTestNocase = (ext2) => {
|
|
1080
|
-
ext2 = ext2.toLowerCase();
|
|
1081
|
-
return (f) => !f.startsWith(".") && f.toLowerCase().endsWith(ext2);
|
|
1082
|
-
};
|
|
1083
|
-
var starDotExtTestNocaseDot = (ext2) => {
|
|
1084
|
-
ext2 = ext2.toLowerCase();
|
|
1085
|
-
return (f) => f.toLowerCase().endsWith(ext2);
|
|
1086
|
-
};
|
|
1087
|
-
var starDotStarRE = /^\*+\.\*+$/;
|
|
1088
|
-
var starDotStarTest = (f) => !f.startsWith(".") && f.includes(".");
|
|
1089
|
-
var starDotStarTestDot = (f) => f !== "." && f !== ".." && f.includes(".");
|
|
1090
|
-
var dotStarRE = /^\.\*+$/;
|
|
1091
|
-
var dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith(".");
|
|
1092
|
-
var starRE = /^\*+$/;
|
|
1093
|
-
var starTest = (f) => f.length !== 0 && !f.startsWith(".");
|
|
1094
|
-
var starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..";
|
|
1095
|
-
var qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
|
|
1096
|
-
var qmarksTestNocase = ([$0, ext2 = ""]) => {
|
|
1097
|
-
const noext = qmarksTestNoExt([$0]);
|
|
1098
|
-
if (!ext2)
|
|
1099
|
-
return noext;
|
|
1100
|
-
ext2 = ext2.toLowerCase();
|
|
1101
|
-
return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
|
|
1102
|
-
};
|
|
1103
|
-
var qmarksTestNocaseDot = ([$0, ext2 = ""]) => {
|
|
1104
|
-
const noext = qmarksTestNoExtDot([$0]);
|
|
1105
|
-
if (!ext2)
|
|
1106
|
-
return noext;
|
|
1107
|
-
ext2 = ext2.toLowerCase();
|
|
1108
|
-
return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
|
|
1109
|
-
};
|
|
1110
|
-
var qmarksTestDot = ([$0, ext2 = ""]) => {
|
|
1111
|
-
const noext = qmarksTestNoExtDot([$0]);
|
|
1112
|
-
return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
|
|
1113
|
-
};
|
|
1114
|
-
var qmarksTest = ([$0, ext2 = ""]) => {
|
|
1115
|
-
const noext = qmarksTestNoExt([$0]);
|
|
1116
|
-
return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
|
|
1117
|
-
};
|
|
1118
|
-
var qmarksTestNoExt = ([$0]) => {
|
|
1119
|
-
const len = $0.length;
|
|
1120
|
-
return (f) => f.length === len && !f.startsWith(".");
|
|
1121
|
-
};
|
|
1122
|
-
var qmarksTestNoExtDot = ([$0]) => {
|
|
1123
|
-
const len = $0.length;
|
|
1124
|
-
return (f) => f.length === len && f !== "." && f !== "..";
|
|
1125
|
-
};
|
|
1126
|
-
var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
1127
|
-
var path = {
|
|
1128
|
-
win32: { sep: "\\" },
|
|
1129
|
-
posix: { sep: "/" }
|
|
1130
|
-
};
|
|
1131
|
-
var sep = defaultPlatform === "win32" ? path.win32.sep : path.posix.sep;
|
|
1132
|
-
minimatch.sep = sep;
|
|
1133
|
-
var GLOBSTAR = Symbol("globstar **");
|
|
1134
|
-
minimatch.GLOBSTAR = GLOBSTAR;
|
|
1135
|
-
var qmark2 = "[^/]";
|
|
1136
|
-
var star2 = qmark2 + "*?";
|
|
1137
|
-
var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
|
|
1138
|
-
var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
|
|
1139
|
-
var filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
|
|
1140
|
-
minimatch.filter = filter;
|
|
1141
|
-
var ext = (a, b = {}) => Object.assign({}, a, b);
|
|
1142
|
-
var defaults = (def) => {
|
|
1143
|
-
if (!def || typeof def !== "object" || !Object.keys(def).length) {
|
|
1144
|
-
return minimatch;
|
|
1145
|
-
}
|
|
1146
|
-
const orig = minimatch;
|
|
1147
|
-
const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
|
|
1148
|
-
return Object.assign(m, {
|
|
1149
|
-
Minimatch: class Minimatch extends orig.Minimatch {
|
|
1150
|
-
constructor(pattern, options = {}) {
|
|
1151
|
-
super(pattern, ext(def, options));
|
|
1152
|
-
}
|
|
1153
|
-
static defaults(options) {
|
|
1154
|
-
return orig.defaults(ext(def, options)).Minimatch;
|
|
1155
|
-
}
|
|
1156
|
-
},
|
|
1157
|
-
AST: class AST extends orig.AST {
|
|
1158
|
-
/* c8 ignore start */
|
|
1159
|
-
constructor(type, parent, options = {}) {
|
|
1160
|
-
super(type, parent, ext(def, options));
|
|
1161
|
-
}
|
|
1162
|
-
/* c8 ignore stop */
|
|
1163
|
-
static fromGlob(pattern, options = {}) {
|
|
1164
|
-
return orig.AST.fromGlob(pattern, ext(def, options));
|
|
1165
|
-
}
|
|
1166
|
-
},
|
|
1167
|
-
unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
|
|
1168
|
-
escape: (s, options = {}) => orig.escape(s, ext(def, options)),
|
|
1169
|
-
filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
|
|
1170
|
-
defaults: (options) => orig.defaults(ext(def, options)),
|
|
1171
|
-
makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
|
|
1172
|
-
braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
|
|
1173
|
-
match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
|
|
1174
|
-
sep: orig.sep,
|
|
1175
|
-
GLOBSTAR
|
|
1176
|
-
});
|
|
1177
|
-
};
|
|
1178
|
-
minimatch.defaults = defaults;
|
|
1179
|
-
var braceExpand = (pattern, options = {}) => {
|
|
1180
|
-
assertValidPattern(pattern);
|
|
1181
|
-
if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
|
|
1182
|
-
return [pattern];
|
|
1183
|
-
}
|
|
1184
|
-
return (0, import_brace_expansion.default)(pattern);
|
|
1185
|
-
};
|
|
1186
|
-
minimatch.braceExpand = braceExpand;
|
|
1187
|
-
var makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
|
|
1188
|
-
minimatch.makeRe = makeRe;
|
|
1189
|
-
var match = (list, pattern, options = {}) => {
|
|
1190
|
-
const mm = new Minimatch(pattern, options);
|
|
1191
|
-
list = list.filter((f) => mm.match(f));
|
|
1192
|
-
if (mm.options.nonull && !list.length) {
|
|
1193
|
-
list.push(pattern);
|
|
1194
|
-
}
|
|
1195
|
-
return list;
|
|
1196
|
-
};
|
|
1197
|
-
minimatch.match = match;
|
|
1198
|
-
var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
|
|
1199
|
-
var regExpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
1200
|
-
var Minimatch = class {
|
|
1201
|
-
options;
|
|
1202
|
-
set;
|
|
1203
|
-
pattern;
|
|
1204
|
-
windowsPathsNoEscape;
|
|
1205
|
-
nonegate;
|
|
1206
|
-
negate;
|
|
1207
|
-
comment;
|
|
1208
|
-
empty;
|
|
1209
|
-
preserveMultipleSlashes;
|
|
1210
|
-
partial;
|
|
1211
|
-
globSet;
|
|
1212
|
-
globParts;
|
|
1213
|
-
nocase;
|
|
1214
|
-
isWindows;
|
|
1215
|
-
platform;
|
|
1216
|
-
windowsNoMagicRoot;
|
|
1217
|
-
regexp;
|
|
1218
|
-
constructor(pattern, options = {}) {
|
|
1219
|
-
assertValidPattern(pattern);
|
|
1220
|
-
options = options || {};
|
|
1221
|
-
this.options = options;
|
|
1222
|
-
this.pattern = pattern;
|
|
1223
|
-
this.platform = options.platform || defaultPlatform;
|
|
1224
|
-
this.isWindows = this.platform === "win32";
|
|
1225
|
-
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
|
|
1226
|
-
if (this.windowsPathsNoEscape) {
|
|
1227
|
-
this.pattern = this.pattern.replace(/\\/g, "/");
|
|
1228
|
-
}
|
|
1229
|
-
this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
|
|
1230
|
-
this.regexp = null;
|
|
1231
|
-
this.negate = false;
|
|
1232
|
-
this.nonegate = !!options.nonegate;
|
|
1233
|
-
this.comment = false;
|
|
1234
|
-
this.empty = false;
|
|
1235
|
-
this.partial = !!options.partial;
|
|
1236
|
-
this.nocase = !!this.options.nocase;
|
|
1237
|
-
this.windowsNoMagicRoot = options.windowsNoMagicRoot !== void 0 ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase);
|
|
1238
|
-
this.globSet = [];
|
|
1239
|
-
this.globParts = [];
|
|
1240
|
-
this.set = [];
|
|
1241
|
-
this.make();
|
|
1242
|
-
}
|
|
1243
|
-
hasMagic() {
|
|
1244
|
-
if (this.options.magicalBraces && this.set.length > 1) {
|
|
1245
|
-
return true;
|
|
1246
|
-
}
|
|
1247
|
-
for (const pattern of this.set) {
|
|
1248
|
-
for (const part of pattern) {
|
|
1249
|
-
if (typeof part !== "string")
|
|
1250
|
-
return true;
|
|
1251
|
-
}
|
|
1252
|
-
}
|
|
1253
|
-
return false;
|
|
1254
|
-
}
|
|
1255
|
-
debug(..._) {
|
|
1256
|
-
}
|
|
1257
|
-
make() {
|
|
1258
|
-
const pattern = this.pattern;
|
|
1259
|
-
const options = this.options;
|
|
1260
|
-
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
1261
|
-
this.comment = true;
|
|
1262
|
-
return;
|
|
1263
|
-
}
|
|
1264
|
-
if (!pattern) {
|
|
1265
|
-
this.empty = true;
|
|
1266
|
-
return;
|
|
1267
|
-
}
|
|
1268
|
-
this.parseNegate();
|
|
1269
|
-
this.globSet = [...new Set(this.braceExpand())];
|
|
1270
|
-
if (options.debug) {
|
|
1271
|
-
this.debug = (...args) => console.error(...args);
|
|
1272
|
-
}
|
|
1273
|
-
this.debug(this.pattern, this.globSet);
|
|
1274
|
-
const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
|
|
1275
|
-
this.globParts = this.preprocess(rawGlobParts);
|
|
1276
|
-
this.debug(this.pattern, this.globParts);
|
|
1277
|
-
let set = this.globParts.map((s, _, __) => {
|
|
1278
|
-
if (this.isWindows && this.windowsNoMagicRoot) {
|
|
1279
|
-
const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
|
|
1280
|
-
const isDrive = /^[a-z]:/i.test(s[0]);
|
|
1281
|
-
if (isUNC) {
|
|
1282
|
-
return [...s.slice(0, 4), ...s.slice(4).map((ss) => this.parse(ss))];
|
|
1283
|
-
} else if (isDrive) {
|
|
1284
|
-
return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
|
|
1285
|
-
}
|
|
1286
|
-
}
|
|
1287
|
-
return s.map((ss) => this.parse(ss));
|
|
1288
|
-
});
|
|
1289
|
-
this.debug(this.pattern, set);
|
|
1290
|
-
this.set = set.filter((s) => s.indexOf(false) === -1);
|
|
1291
|
-
if (this.isWindows) {
|
|
1292
|
-
for (let i2 = 0; i2 < this.set.length; i2++) {
|
|
1293
|
-
const p = this.set[i2];
|
|
1294
|
-
if (p[0] === "" && p[1] === "" && this.globParts[i2][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) {
|
|
1295
|
-
p[2] = "?";
|
|
1296
|
-
}
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
|
-
this.debug(this.pattern, this.set);
|
|
1300
|
-
}
|
|
1301
|
-
// various transforms to equivalent pattern sets that are
|
|
1302
|
-
// faster to process in a filesystem walk. The goal is to
|
|
1303
|
-
// eliminate what we can, and push all ** patterns as far
|
|
1304
|
-
// to the right as possible, even if it increases the number
|
|
1305
|
-
// of patterns that we have to process.
|
|
1306
|
-
preprocess(globParts) {
|
|
1307
|
-
if (this.options.noglobstar) {
|
|
1308
|
-
for (let i2 = 0; i2 < globParts.length; i2++) {
|
|
1309
|
-
for (let j = 0; j < globParts[i2].length; j++) {
|
|
1310
|
-
if (globParts[i2][j] === "**") {
|
|
1311
|
-
globParts[i2][j] = "*";
|
|
1312
|
-
}
|
|
1313
|
-
}
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
const { optimizationLevel = 1 } = this.options;
|
|
1317
|
-
if (optimizationLevel >= 2) {
|
|
1318
|
-
globParts = this.firstPhasePreProcess(globParts);
|
|
1319
|
-
globParts = this.secondPhasePreProcess(globParts);
|
|
1320
|
-
} else if (optimizationLevel >= 1) {
|
|
1321
|
-
globParts = this.levelOneOptimize(globParts);
|
|
1322
|
-
} else {
|
|
1323
|
-
globParts = this.adjascentGlobstarOptimize(globParts);
|
|
1324
|
-
}
|
|
1325
|
-
return globParts;
|
|
1326
|
-
}
|
|
1327
|
-
// just get rid of adjascent ** portions
|
|
1328
|
-
adjascentGlobstarOptimize(globParts) {
|
|
1329
|
-
return globParts.map((parts) => {
|
|
1330
|
-
let gs = -1;
|
|
1331
|
-
while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
|
|
1332
|
-
let i2 = gs;
|
|
1333
|
-
while (parts[i2 + 1] === "**") {
|
|
1334
|
-
i2++;
|
|
1335
|
-
}
|
|
1336
|
-
if (i2 !== gs) {
|
|
1337
|
-
parts.splice(gs, i2 - gs);
|
|
1338
|
-
}
|
|
1339
|
-
}
|
|
1340
|
-
return parts;
|
|
1341
|
-
});
|
|
1342
|
-
}
|
|
1343
|
-
// get rid of adjascent ** and resolve .. portions
|
|
1344
|
-
levelOneOptimize(globParts) {
|
|
1345
|
-
return globParts.map((parts) => {
|
|
1346
|
-
parts = parts.reduce((set, part) => {
|
|
1347
|
-
const prev = set[set.length - 1];
|
|
1348
|
-
if (part === "**" && prev === "**") {
|
|
1349
|
-
return set;
|
|
1350
|
-
}
|
|
1351
|
-
if (part === "..") {
|
|
1352
|
-
if (prev && prev !== ".." && prev !== "." && prev !== "**") {
|
|
1353
|
-
set.pop();
|
|
1354
|
-
return set;
|
|
1355
|
-
}
|
|
1356
|
-
}
|
|
1357
|
-
set.push(part);
|
|
1358
|
-
return set;
|
|
1359
|
-
}, []);
|
|
1360
|
-
return parts.length === 0 ? [""] : parts;
|
|
1361
|
-
});
|
|
1362
|
-
}
|
|
1363
|
-
levelTwoFileOptimize(parts) {
|
|
1364
|
-
if (!Array.isArray(parts)) {
|
|
1365
|
-
parts = this.slashSplit(parts);
|
|
1366
|
-
}
|
|
1367
|
-
let didSomething = false;
|
|
1368
|
-
do {
|
|
1369
|
-
didSomething = false;
|
|
1370
|
-
if (!this.preserveMultipleSlashes) {
|
|
1371
|
-
for (let i2 = 1; i2 < parts.length - 1; i2++) {
|
|
1372
|
-
const p = parts[i2];
|
|
1373
|
-
if (i2 === 1 && p === "" && parts[0] === "")
|
|
1374
|
-
continue;
|
|
1375
|
-
if (p === "." || p === "") {
|
|
1376
|
-
didSomething = true;
|
|
1377
|
-
parts.splice(i2, 1);
|
|
1378
|
-
i2--;
|
|
1379
|
-
}
|
|
1380
|
-
}
|
|
1381
|
-
if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
|
|
1382
|
-
didSomething = true;
|
|
1383
|
-
parts.pop();
|
|
1384
|
-
}
|
|
1385
|
-
}
|
|
1386
|
-
let dd = 0;
|
|
1387
|
-
while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
|
|
1388
|
-
const p = parts[dd - 1];
|
|
1389
|
-
if (p && p !== "." && p !== ".." && p !== "**") {
|
|
1390
|
-
didSomething = true;
|
|
1391
|
-
parts.splice(dd - 1, 2);
|
|
1392
|
-
dd -= 2;
|
|
1393
|
-
}
|
|
1394
|
-
}
|
|
1395
|
-
} while (didSomething);
|
|
1396
|
-
return parts.length === 0 ? [""] : parts;
|
|
1397
|
-
}
|
|
1398
|
-
// First phase: single-pattern processing
|
|
1399
|
-
// <pre> is 1 or more portions
|
|
1400
|
-
// <rest> is 1 or more portions
|
|
1401
|
-
// <p> is any portion other than ., .., '', or **
|
|
1402
|
-
// <e> is . or ''
|
|
1403
|
-
//
|
|
1404
|
-
// **/.. is *brutal* for filesystem walking performance, because
|
|
1405
|
-
// it effectively resets the recursive walk each time it occurs,
|
|
1406
|
-
// and ** cannot be reduced out by a .. pattern part like a regexp
|
|
1407
|
-
// or most strings (other than .., ., and '') can be.
|
|
1408
|
-
//
|
|
1409
|
-
// <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
|
|
1410
|
-
// <pre>/<e>/<rest> -> <pre>/<rest>
|
|
1411
|
-
// <pre>/<p>/../<rest> -> <pre>/<rest>
|
|
1412
|
-
// **/**/<rest> -> **/<rest>
|
|
1413
|
-
//
|
|
1414
|
-
// **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
|
|
1415
|
-
// this WOULD be allowed if ** did follow symlinks, or * didn't
|
|
1416
|
-
firstPhasePreProcess(globParts) {
|
|
1417
|
-
let didSomething = false;
|
|
1418
|
-
do {
|
|
1419
|
-
didSomething = false;
|
|
1420
|
-
for (let parts of globParts) {
|
|
1421
|
-
let gs = -1;
|
|
1422
|
-
while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
|
|
1423
|
-
let gss = gs;
|
|
1424
|
-
while (parts[gss + 1] === "**") {
|
|
1425
|
-
gss++;
|
|
1426
|
-
}
|
|
1427
|
-
if (gss > gs) {
|
|
1428
|
-
parts.splice(gs + 1, gss - gs);
|
|
1429
|
-
}
|
|
1430
|
-
let next = parts[gs + 1];
|
|
1431
|
-
const p = parts[gs + 2];
|
|
1432
|
-
const p2 = parts[gs + 3];
|
|
1433
|
-
if (next !== "..")
|
|
1434
|
-
continue;
|
|
1435
|
-
if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") {
|
|
1436
|
-
continue;
|
|
1437
|
-
}
|
|
1438
|
-
didSomething = true;
|
|
1439
|
-
parts.splice(gs, 1);
|
|
1440
|
-
const other = parts.slice(0);
|
|
1441
|
-
other[gs] = "**";
|
|
1442
|
-
globParts.push(other);
|
|
1443
|
-
gs--;
|
|
1444
|
-
}
|
|
1445
|
-
if (!this.preserveMultipleSlashes) {
|
|
1446
|
-
for (let i2 = 1; i2 < parts.length - 1; i2++) {
|
|
1447
|
-
const p = parts[i2];
|
|
1448
|
-
if (i2 === 1 && p === "" && parts[0] === "")
|
|
1449
|
-
continue;
|
|
1450
|
-
if (p === "." || p === "") {
|
|
1451
|
-
didSomething = true;
|
|
1452
|
-
parts.splice(i2, 1);
|
|
1453
|
-
i2--;
|
|
1454
|
-
}
|
|
1455
|
-
}
|
|
1456
|
-
if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
|
|
1457
|
-
didSomething = true;
|
|
1458
|
-
parts.pop();
|
|
1459
|
-
}
|
|
1460
|
-
}
|
|
1461
|
-
let dd = 0;
|
|
1462
|
-
while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
|
|
1463
|
-
const p = parts[dd - 1];
|
|
1464
|
-
if (p && p !== "." && p !== ".." && p !== "**") {
|
|
1465
|
-
didSomething = true;
|
|
1466
|
-
const needDot = dd === 1 && parts[dd + 1] === "**";
|
|
1467
|
-
const splin = needDot ? ["."] : [];
|
|
1468
|
-
parts.splice(dd - 1, 2, ...splin);
|
|
1469
|
-
if (parts.length === 0)
|
|
1470
|
-
parts.push("");
|
|
1471
|
-
dd -= 2;
|
|
1472
|
-
}
|
|
1473
|
-
}
|
|
1474
|
-
}
|
|
1475
|
-
} while (didSomething);
|
|
1476
|
-
return globParts;
|
|
1477
|
-
}
|
|
1478
|
-
// second phase: multi-pattern dedupes
|
|
1479
|
-
// {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
|
|
1480
|
-
// {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
|
|
1481
|
-
// {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
|
|
1482
|
-
//
|
|
1483
|
-
// {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
|
|
1484
|
-
// ^-- not valid because ** doens't follow symlinks
|
|
1485
|
-
secondPhasePreProcess(globParts) {
|
|
1486
|
-
for (let i2 = 0; i2 < globParts.length - 1; i2++) {
|
|
1487
|
-
for (let j = i2 + 1; j < globParts.length; j++) {
|
|
1488
|
-
const matched = this.partsMatch(globParts[i2], globParts[j], !this.preserveMultipleSlashes);
|
|
1489
|
-
if (!matched)
|
|
1490
|
-
continue;
|
|
1491
|
-
globParts[i2] = matched;
|
|
1492
|
-
globParts[j] = [];
|
|
1493
|
-
}
|
|
1494
|
-
}
|
|
1495
|
-
return globParts.filter((gs) => gs.length);
|
|
1496
|
-
}
|
|
1497
|
-
partsMatch(a, b, emptyGSMatch = false) {
|
|
1498
|
-
let ai = 0;
|
|
1499
|
-
let bi = 0;
|
|
1500
|
-
let result = [];
|
|
1501
|
-
let which = "";
|
|
1502
|
-
while (ai < a.length && bi < b.length) {
|
|
1503
|
-
if (a[ai] === b[bi]) {
|
|
1504
|
-
result.push(which === "b" ? b[bi] : a[ai]);
|
|
1505
|
-
ai++;
|
|
1506
|
-
bi++;
|
|
1507
|
-
} else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1]) {
|
|
1508
|
-
result.push(a[ai]);
|
|
1509
|
-
ai++;
|
|
1510
|
-
} else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1]) {
|
|
1511
|
-
result.push(b[bi]);
|
|
1512
|
-
bi++;
|
|
1513
|
-
} else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
|
|
1514
|
-
if (which === "b")
|
|
1515
|
-
return false;
|
|
1516
|
-
which = "a";
|
|
1517
|
-
result.push(a[ai]);
|
|
1518
|
-
ai++;
|
|
1519
|
-
bi++;
|
|
1520
|
-
} else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
|
|
1521
|
-
if (which === "a")
|
|
1522
|
-
return false;
|
|
1523
|
-
which = "b";
|
|
1524
|
-
result.push(b[bi]);
|
|
1525
|
-
ai++;
|
|
1526
|
-
bi++;
|
|
1527
|
-
} else {
|
|
1528
|
-
return false;
|
|
1529
|
-
}
|
|
1530
|
-
}
|
|
1531
|
-
return a.length === b.length && result;
|
|
1532
|
-
}
|
|
1533
|
-
parseNegate() {
|
|
1534
|
-
if (this.nonegate)
|
|
1535
|
-
return;
|
|
1536
|
-
const pattern = this.pattern;
|
|
1537
|
-
let negate = false;
|
|
1538
|
-
let negateOffset = 0;
|
|
1539
|
-
for (let i2 = 0; i2 < pattern.length && pattern.charAt(i2) === "!"; i2++) {
|
|
1540
|
-
negate = !negate;
|
|
1541
|
-
negateOffset++;
|
|
1542
|
-
}
|
|
1543
|
-
if (negateOffset)
|
|
1544
|
-
this.pattern = pattern.slice(negateOffset);
|
|
1545
|
-
this.negate = negate;
|
|
1546
|
-
}
|
|
1547
|
-
// set partial to true to test if, for example,
|
|
1548
|
-
// "/a/b" matches the start of "/*/b/*/d"
|
|
1549
|
-
// Partial means, if you run out of file before you run
|
|
1550
|
-
// out of pattern, then that's fine, as long as all
|
|
1551
|
-
// the parts match.
|
|
1552
|
-
matchOne(file, pattern, partial = false) {
|
|
1553
|
-
const options = this.options;
|
|
1554
|
-
if (this.isWindows) {
|
|
1555
|
-
const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
|
|
1556
|
-
const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
|
|
1557
|
-
const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
|
|
1558
|
-
const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
|
|
1559
|
-
const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
|
|
1560
|
-
const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
|
|
1561
|
-
if (typeof fdi === "number" && typeof pdi === "number") {
|
|
1562
|
-
const [fd, pd] = [file[fdi], pattern[pdi]];
|
|
1563
|
-
if (fd.toLowerCase() === pd.toLowerCase()) {
|
|
1564
|
-
pattern[pdi] = fd;
|
|
1565
|
-
if (pdi > fdi) {
|
|
1566
|
-
pattern = pattern.slice(pdi);
|
|
1567
|
-
} else if (fdi > pdi) {
|
|
1568
|
-
file = file.slice(fdi);
|
|
1569
|
-
}
|
|
1570
|
-
}
|
|
1571
|
-
}
|
|
1572
|
-
}
|
|
1573
|
-
const { optimizationLevel = 1 } = this.options;
|
|
1574
|
-
if (optimizationLevel >= 2) {
|
|
1575
|
-
file = this.levelTwoFileOptimize(file);
|
|
1576
|
-
}
|
|
1577
|
-
this.debug("matchOne", this, { file, pattern });
|
|
1578
|
-
this.debug("matchOne", file.length, pattern.length);
|
|
1579
|
-
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
|
1580
|
-
this.debug("matchOne loop");
|
|
1581
|
-
var p = pattern[pi];
|
|
1582
|
-
var f = file[fi];
|
|
1583
|
-
this.debug(pattern, p, f);
|
|
1584
|
-
if (p === false) {
|
|
1585
|
-
return false;
|
|
1586
|
-
}
|
|
1587
|
-
if (p === GLOBSTAR) {
|
|
1588
|
-
this.debug("GLOBSTAR", [pattern, p, f]);
|
|
1589
|
-
var fr = fi;
|
|
1590
|
-
var pr = pi + 1;
|
|
1591
|
-
if (pr === pl) {
|
|
1592
|
-
this.debug("** at the end");
|
|
1593
|
-
for (; fi < fl; fi++) {
|
|
1594
|
-
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
|
|
1595
|
-
return false;
|
|
1596
|
-
}
|
|
1597
|
-
return true;
|
|
1598
|
-
}
|
|
1599
|
-
while (fr < fl) {
|
|
1600
|
-
var swallowee = file[fr];
|
|
1601
|
-
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
|
1602
|
-
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
|
1603
|
-
this.debug("globstar found match!", fr, fl, swallowee);
|
|
1604
|
-
return true;
|
|
1605
|
-
} else {
|
|
1606
|
-
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
|
1607
|
-
this.debug("dot detected!", file, fr, pattern, pr);
|
|
1608
|
-
break;
|
|
1609
|
-
}
|
|
1610
|
-
this.debug("globstar swallow a segment, and continue");
|
|
1611
|
-
fr++;
|
|
1612
|
-
}
|
|
1613
|
-
}
|
|
1614
|
-
if (partial) {
|
|
1615
|
-
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
|
1616
|
-
if (fr === fl) {
|
|
1617
|
-
return true;
|
|
1618
|
-
}
|
|
1619
|
-
}
|
|
1620
|
-
return false;
|
|
1621
|
-
}
|
|
1622
|
-
let hit;
|
|
1623
|
-
if (typeof p === "string") {
|
|
1624
|
-
hit = f === p;
|
|
1625
|
-
this.debug("string match", p, f, hit);
|
|
1626
|
-
} else {
|
|
1627
|
-
hit = p.test(f);
|
|
1628
|
-
this.debug("pattern match", p, f, hit);
|
|
1629
|
-
}
|
|
1630
|
-
if (!hit)
|
|
1631
|
-
return false;
|
|
1632
|
-
}
|
|
1633
|
-
if (fi === fl && pi === pl) {
|
|
1634
|
-
return true;
|
|
1635
|
-
} else if (fi === fl) {
|
|
1636
|
-
return partial;
|
|
1637
|
-
} else if (pi === pl) {
|
|
1638
|
-
return fi === fl - 1 && file[fi] === "";
|
|
1639
|
-
} else {
|
|
1640
|
-
throw new Error("wtf?");
|
|
1641
|
-
}
|
|
1642
|
-
}
|
|
1643
|
-
braceExpand() {
|
|
1644
|
-
return braceExpand(this.pattern, this.options);
|
|
1645
|
-
}
|
|
1646
|
-
parse(pattern) {
|
|
1647
|
-
assertValidPattern(pattern);
|
|
1648
|
-
const options = this.options;
|
|
1649
|
-
if (pattern === "**")
|
|
1650
|
-
return GLOBSTAR;
|
|
1651
|
-
if (pattern === "")
|
|
1652
|
-
return "";
|
|
1653
|
-
let m;
|
|
1654
|
-
let fastTest = null;
|
|
1655
|
-
if (m = pattern.match(starRE)) {
|
|
1656
|
-
fastTest = options.dot ? starTestDot : starTest;
|
|
1657
|
-
} else if (m = pattern.match(starDotExtRE)) {
|
|
1658
|
-
fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m[1]);
|
|
1659
|
-
} else if (m = pattern.match(qmarksRE)) {
|
|
1660
|
-
fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m);
|
|
1661
|
-
} else if (m = pattern.match(starDotStarRE)) {
|
|
1662
|
-
fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
|
|
1663
|
-
} else if (m = pattern.match(dotStarRE)) {
|
|
1664
|
-
fastTest = dotStarTest;
|
|
1665
|
-
}
|
|
1666
|
-
const re = AST.fromGlob(pattern, this.options).toMMPattern();
|
|
1667
|
-
if (fastTest && typeof re === "object") {
|
|
1668
|
-
Reflect.defineProperty(re, "test", { value: fastTest });
|
|
1669
|
-
}
|
|
1670
|
-
return re;
|
|
1671
|
-
}
|
|
1672
|
-
makeRe() {
|
|
1673
|
-
if (this.regexp || this.regexp === false)
|
|
1674
|
-
return this.regexp;
|
|
1675
|
-
const set = this.set;
|
|
1676
|
-
if (!set.length) {
|
|
1677
|
-
this.regexp = false;
|
|
1678
|
-
return this.regexp;
|
|
1679
|
-
}
|
|
1680
|
-
const options = this.options;
|
|
1681
|
-
const twoStar = options.noglobstar ? star2 : options.dot ? twoStarDot : twoStarNoDot;
|
|
1682
|
-
const flags = new Set(options.nocase ? ["i"] : []);
|
|
1683
|
-
let re = set.map((pattern) => {
|
|
1684
|
-
const pp = pattern.map((p) => {
|
|
1685
|
-
if (p instanceof RegExp) {
|
|
1686
|
-
for (const f of p.flags.split(""))
|
|
1687
|
-
flags.add(f);
|
|
1688
|
-
}
|
|
1689
|
-
return typeof p === "string" ? regExpEscape2(p) : p === GLOBSTAR ? GLOBSTAR : p._src;
|
|
1690
|
-
});
|
|
1691
|
-
pp.forEach((p, i2) => {
|
|
1692
|
-
const next = pp[i2 + 1];
|
|
1693
|
-
const prev = pp[i2 - 1];
|
|
1694
|
-
if (p !== GLOBSTAR || prev === GLOBSTAR) {
|
|
1695
|
-
return;
|
|
1696
|
-
}
|
|
1697
|
-
if (prev === void 0) {
|
|
1698
|
-
if (next !== void 0 && next !== GLOBSTAR) {
|
|
1699
|
-
pp[i2 + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
|
|
1700
|
-
} else {
|
|
1701
|
-
pp[i2] = twoStar;
|
|
1702
|
-
}
|
|
1703
|
-
} else if (next === void 0) {
|
|
1704
|
-
pp[i2 - 1] = prev + "(?:\\/|" + twoStar + ")?";
|
|
1705
|
-
} else if (next !== GLOBSTAR) {
|
|
1706
|
-
pp[i2 - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
|
|
1707
|
-
pp[i2 + 1] = GLOBSTAR;
|
|
1708
|
-
}
|
|
1709
|
-
});
|
|
1710
|
-
return pp.filter((p) => p !== GLOBSTAR).join("/");
|
|
1711
|
-
}).join("|");
|
|
1712
|
-
const [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
|
|
1713
|
-
re = "^" + open + re + close + "$";
|
|
1714
|
-
if (this.negate)
|
|
1715
|
-
re = "^(?!" + re + ").+$";
|
|
1716
|
-
try {
|
|
1717
|
-
this.regexp = new RegExp(re, [...flags].join(""));
|
|
1718
|
-
} catch (ex) {
|
|
1719
|
-
this.regexp = false;
|
|
1720
|
-
}
|
|
1721
|
-
return this.regexp;
|
|
1722
|
-
}
|
|
1723
|
-
slashSplit(p) {
|
|
1724
|
-
if (this.preserveMultipleSlashes) {
|
|
1725
|
-
return p.split("/");
|
|
1726
|
-
} else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
|
|
1727
|
-
return ["", ...p.split(/\/+/)];
|
|
1728
|
-
} else {
|
|
1729
|
-
return p.split(/\/+/);
|
|
1730
|
-
}
|
|
1731
|
-
}
|
|
1732
|
-
match(f, partial = this.partial) {
|
|
1733
|
-
this.debug("match", f, this.pattern);
|
|
1734
|
-
if (this.comment) {
|
|
1735
|
-
return false;
|
|
1736
|
-
}
|
|
1737
|
-
if (this.empty) {
|
|
1738
|
-
return f === "";
|
|
1739
|
-
}
|
|
1740
|
-
if (f === "/" && partial) {
|
|
1741
|
-
return true;
|
|
1742
|
-
}
|
|
1743
|
-
const options = this.options;
|
|
1744
|
-
if (this.isWindows) {
|
|
1745
|
-
f = f.split("\\").join("/");
|
|
1746
|
-
}
|
|
1747
|
-
const ff = this.slashSplit(f);
|
|
1748
|
-
this.debug(this.pattern, "split", ff);
|
|
1749
|
-
const set = this.set;
|
|
1750
|
-
this.debug(this.pattern, "set", set);
|
|
1751
|
-
let filename = ff[ff.length - 1];
|
|
1752
|
-
if (!filename) {
|
|
1753
|
-
for (let i2 = ff.length - 2; !filename && i2 >= 0; i2--) {
|
|
1754
|
-
filename = ff[i2];
|
|
1755
|
-
}
|
|
1756
|
-
}
|
|
1757
|
-
for (let i2 = 0; i2 < set.length; i2++) {
|
|
1758
|
-
const pattern = set[i2];
|
|
1759
|
-
let file = ff;
|
|
1760
|
-
if (options.matchBase && pattern.length === 1) {
|
|
1761
|
-
file = [filename];
|
|
1762
|
-
}
|
|
1763
|
-
const hit = this.matchOne(file, pattern, partial);
|
|
1764
|
-
if (hit) {
|
|
1765
|
-
if (options.flipNegate) {
|
|
1766
|
-
return true;
|
|
1767
|
-
}
|
|
1768
|
-
return !this.negate;
|
|
1769
|
-
}
|
|
1770
|
-
}
|
|
1771
|
-
if (options.flipNegate) {
|
|
1772
|
-
return false;
|
|
1773
|
-
}
|
|
1774
|
-
return this.negate;
|
|
1775
|
-
}
|
|
1776
|
-
static defaults(def) {
|
|
1777
|
-
return minimatch.defaults(def).Minimatch;
|
|
1778
|
-
}
|
|
1779
|
-
};
|
|
1780
|
-
minimatch.AST = AST;
|
|
1781
|
-
minimatch.Minimatch = Minimatch;
|
|
1782
|
-
minimatch.escape = escape;
|
|
1783
|
-
minimatch.unescape = unescape;
|
|
1784
|
-
|
|
1785
|
-
// src/utils/query-nonce-meta-tag-content.ts
|
|
1786
|
-
function queryNonceMetaTagContent(doc) {
|
|
1787
|
-
var _a, _b, _c;
|
|
1788
|
-
return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
|
|
1789
|
-
}
|
|
1790
|
-
|
|
1791
|
-
// src/utils/regular-expression.ts
|
|
1792
|
-
var escapeRegExpSpecialCharacters = (text) => {
|
|
1793
|
-
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1794
|
-
};
|
|
1795
|
-
|
|
1796
|
-
// src/utils/result.ts
|
|
1797
|
-
var result_exports = {};
|
|
1798
|
-
__export(result_exports, {
|
|
1799
|
-
err: () => err,
|
|
1800
|
-
map: () => map,
|
|
1801
|
-
ok: () => ok,
|
|
1802
|
-
unwrap: () => unwrap,
|
|
1803
|
-
unwrapErr: () => unwrapErr
|
|
1804
|
-
});
|
|
1805
|
-
var ok = (value) => ({
|
|
1806
|
-
isOk: true,
|
|
1807
|
-
isErr: false,
|
|
1808
|
-
value
|
|
1809
|
-
});
|
|
1810
|
-
var err = (value) => ({
|
|
1811
|
-
isOk: false,
|
|
1812
|
-
isErr: true,
|
|
1813
|
-
value
|
|
1814
|
-
});
|
|
1815
|
-
function map(result, fn) {
|
|
1816
|
-
if (result.isOk) {
|
|
1817
|
-
const val = fn(result.value);
|
|
1818
|
-
if (val instanceof Promise) {
|
|
1819
|
-
return val.then((newVal) => ok(newVal));
|
|
1820
|
-
} else {
|
|
1821
|
-
return ok(val);
|
|
1822
|
-
}
|
|
1823
|
-
}
|
|
1824
|
-
if (result.isErr) {
|
|
1825
|
-
const value = result.value;
|
|
1826
|
-
return err(value);
|
|
1827
|
-
}
|
|
1828
|
-
throw "should never get here";
|
|
1829
|
-
}
|
|
1830
|
-
var unwrap = (result) => {
|
|
1831
|
-
if (result.isOk) {
|
|
1832
|
-
return result.value;
|
|
1833
|
-
} else {
|
|
1834
|
-
throw result.value;
|
|
1835
|
-
}
|
|
1836
|
-
};
|
|
1837
|
-
var unwrapErr = (result) => {
|
|
1838
|
-
if (result.isErr) {
|
|
1839
|
-
return result.value;
|
|
1840
|
-
} else {
|
|
1841
|
-
throw result.value;
|
|
1842
|
-
}
|
|
1843
|
-
};
|
|
1844
206
|
|
|
1845
207
|
// src/utils/style.ts
|
|
1846
208
|
function createStyleSheetIfNeededAndSupported(styles2) {
|
|
@@ -1910,7 +272,7 @@ function getHostSlotNodes(childNodes, hostName, slotName) {
|
|
|
1910
272
|
slottedNodes.push(childNode);
|
|
1911
273
|
if (typeof slotName !== "undefined") return slottedNodes;
|
|
1912
274
|
}
|
|
1913
|
-
slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode
|
|
275
|
+
slottedNodes = [...slottedNodes, ...getHostSlotNodes(internalCall(childNode, "childNodes"), hostName, slotName)];
|
|
1914
276
|
}
|
|
1915
277
|
return slottedNodes;
|
|
1916
278
|
}
|
|
@@ -2002,6 +364,14 @@ var uniqueTime = (key, measureText) => {
|
|
|
2002
364
|
};
|
|
2003
365
|
}
|
|
2004
366
|
};
|
|
367
|
+
|
|
368
|
+
// src/utils/query-nonce-meta-tag-content.ts
|
|
369
|
+
function queryNonceMetaTagContent(doc) {
|
|
370
|
+
var _a, _b, _c;
|
|
371
|
+
return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// src/runtime/styles.ts
|
|
2005
375
|
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
2006
376
|
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
2007
377
|
let style = styles.get(scopeId2);
|
|
@@ -2035,7 +405,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
2035
405
|
}
|
|
2036
406
|
if (!appliedStyles.has(scopeId2)) {
|
|
2037
407
|
styleElm = win.document.createElement("style");
|
|
2038
|
-
styleElm.
|
|
408
|
+
styleElm.textContent = style;
|
|
2039
409
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
2040
410
|
if (nonce != null) {
|
|
2041
411
|
styleElm.setAttribute("nonce", nonce);
|
|
@@ -2060,8 +430,8 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
2060
430
|
}
|
|
2061
431
|
} else {
|
|
2062
432
|
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
2063
|
-
if (existingStyleContainer) {
|
|
2064
|
-
existingStyleContainer.
|
|
433
|
+
if (existingStyleContainer && true) {
|
|
434
|
+
existingStyleContainer.textContent = style + existingStyleContainer.textContent;
|
|
2065
435
|
} else {
|
|
2066
436
|
styleContainerNode.prepend(styleElm);
|
|
2067
437
|
}
|
|
@@ -2074,7 +444,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
2074
444
|
styleContainerNode.insertBefore(styleElm, null);
|
|
2075
445
|
}
|
|
2076
446
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
2077
|
-
styleElm.
|
|
447
|
+
styleElm.textContent += SLOT_FB_CSS;
|
|
2078
448
|
}
|
|
2079
449
|
if (appliedStyles) {
|
|
2080
450
|
appliedStyles.add(scopeId2);
|
|
@@ -2122,6 +492,12 @@ var attachStyles = (hostRef) => {
|
|
|
2122
492
|
endAttachStyles();
|
|
2123
493
|
};
|
|
2124
494
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
495
|
+
var isComplexType = (o) => {
|
|
496
|
+
o = typeof o;
|
|
497
|
+
return o === "object" || o === "function";
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
// src/runtime/vdom/h.ts
|
|
2125
501
|
var h = (nodeName, vnodeData, ...children) => {
|
|
2126
502
|
if (typeof nodeName === "string") {
|
|
2127
503
|
nodeName = transformTag(nodeName);
|
|
@@ -2140,6 +516,11 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
2140
516
|
} else if (child != null && typeof child !== "boolean") {
|
|
2141
517
|
if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
|
|
2142
518
|
child = String(child);
|
|
519
|
+
} else if (typeof nodeName !== "function" && child.$flags$ === void 0) {
|
|
520
|
+
{
|
|
521
|
+
consoleError("Invalid vNode child");
|
|
522
|
+
}
|
|
523
|
+
continue;
|
|
2143
524
|
}
|
|
2144
525
|
if (simple && lastSimple) {
|
|
2145
526
|
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
|
|
@@ -2182,7 +563,8 @@ var newVNode = (tag, text) => {
|
|
|
2182
563
|
const vnode = {
|
|
2183
564
|
$flags$: 0,
|
|
2184
565
|
$tag$: tag,
|
|
2185
|
-
|
|
566
|
+
// Normalize undefined to null to prevent rendering "undefined" as text
|
|
567
|
+
$text$: text != null ? text : null,
|
|
2186
568
|
$elm$: null,
|
|
2187
569
|
$children$: null
|
|
2188
570
|
};
|
|
@@ -2199,18 +581,33 @@ var newVNode = (tag, text) => {
|
|
|
2199
581
|
};
|
|
2200
582
|
var Host = {};
|
|
2201
583
|
var isHost = (node) => node && node.$tag$ === Host;
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
)
|
|
584
|
+
|
|
585
|
+
// src/runtime/normalize-watchers.ts
|
|
586
|
+
var normalizeWatchers = (raw) => {
|
|
587
|
+
if (!raw) return void 0;
|
|
588
|
+
const keys = Object.keys(raw);
|
|
589
|
+
if (keys.length === 0) return void 0;
|
|
590
|
+
let hasLegacy = false;
|
|
591
|
+
for (const propName of keys) {
|
|
592
|
+
if (hasLegacy) break;
|
|
593
|
+
for (const h2 of raw[propName]) {
|
|
594
|
+
if (typeof h2 === "string") {
|
|
595
|
+
hasLegacy = true;
|
|
596
|
+
break;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
if (!hasLegacy) return raw;
|
|
601
|
+
const out = {};
|
|
602
|
+
for (const propName of keys) {
|
|
603
|
+
out[propName] = raw[propName].map(
|
|
604
|
+
(h2) => typeof h2 === "string" ? { [h2]: 0 } : h2
|
|
605
|
+
);
|
|
606
|
+
}
|
|
607
|
+
return out;
|
|
2210
608
|
};
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
createSupportsRuleRe(":host-context");
|
|
609
|
+
|
|
610
|
+
// src/runtime/parse-property-value.ts
|
|
2214
611
|
var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
2215
612
|
if (propValue != null && !isComplexType(propValue)) {
|
|
2216
613
|
if (propType & 4 /* Boolean */) {
|
|
@@ -2289,7 +686,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
2289
686
|
}
|
|
2290
687
|
} else if (memberName === "key") ; else if (memberName === "ref") {
|
|
2291
688
|
if (newValue) {
|
|
2292
|
-
newValue
|
|
689
|
+
queueRefAttachment(newValue, elm);
|
|
2293
690
|
}
|
|
2294
691
|
} else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
|
|
2295
692
|
if (memberName[2] === "-") {
|
|
@@ -2309,6 +706,36 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
2309
706
|
plt.ael(elm, memberName, newValue, capture);
|
|
2310
707
|
}
|
|
2311
708
|
}
|
|
709
|
+
} else if (memberName[0] === "a" && memberName.startsWith("attr:")) {
|
|
710
|
+
const propName = memberName.slice(5);
|
|
711
|
+
let attrName;
|
|
712
|
+
{
|
|
713
|
+
const hostRef = getHostRef(elm);
|
|
714
|
+
if (hostRef && hostRef.$cmpMeta$ && hostRef.$cmpMeta$.$members$) {
|
|
715
|
+
const memberMeta = hostRef.$cmpMeta$.$members$[propName];
|
|
716
|
+
if (memberMeta && memberMeta[1]) {
|
|
717
|
+
attrName = memberMeta[1];
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
if (!attrName) {
|
|
722
|
+
attrName = propName.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
723
|
+
}
|
|
724
|
+
if (newValue == null || newValue === false) {
|
|
725
|
+
if (newValue !== false || elm.getAttribute(attrName) === "") {
|
|
726
|
+
elm.removeAttribute(attrName);
|
|
727
|
+
}
|
|
728
|
+
} else {
|
|
729
|
+
elm.setAttribute(attrName, newValue === true ? "" : newValue);
|
|
730
|
+
}
|
|
731
|
+
return;
|
|
732
|
+
} else if (memberName[0] === "p" && memberName.startsWith("prop:")) {
|
|
733
|
+
const propName = memberName.slice(5);
|
|
734
|
+
try {
|
|
735
|
+
elm[propName] = newValue;
|
|
736
|
+
} catch (e) {
|
|
737
|
+
}
|
|
738
|
+
return;
|
|
2312
739
|
} else {
|
|
2313
740
|
const isComplex = isComplexType(newValue);
|
|
2314
741
|
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
@@ -2317,7 +744,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
2317
744
|
const n = newValue == null ? "" : newValue;
|
|
2318
745
|
if (memberName === "list") {
|
|
2319
746
|
isProp = false;
|
|
2320
|
-
} else if (oldValue == null || elm[memberName]
|
|
747
|
+
} else if (oldValue == null || elm[memberName] !== n) {
|
|
2321
748
|
if (typeof elm.__lookupSetter__(memberName) === "function") {
|
|
2322
749
|
elm[memberName] = n;
|
|
2323
750
|
} else {
|
|
@@ -2331,7 +758,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
2331
758
|
}
|
|
2332
759
|
}
|
|
2333
760
|
if (newValue == null || newValue === false) {
|
|
2334
|
-
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
761
|
+
if (newValue !== false || elm.getAttribute(memberName) === "" || flags & 4 /* isHost */ && !isEnumeratedAttribute(memberName)) {
|
|
2335
762
|
{
|
|
2336
763
|
elm.removeAttribute(memberName);
|
|
2337
764
|
}
|
|
@@ -2344,6 +771,8 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
2344
771
|
}
|
|
2345
772
|
}
|
|
2346
773
|
};
|
|
774
|
+
var ENUMERATED_ATTRIBUTES = /* @__PURE__ */ new Set(["draggable", "contenteditable", "spellcheck"]);
|
|
775
|
+
var isEnumeratedAttribute = (attrName) => ENUMERATED_ATTRIBUTES.has(attrName) || attrName.startsWith("aria-");
|
|
2347
776
|
var parseClassListRegex = /\s/;
|
|
2348
777
|
var parseClassList = (value) => {
|
|
2349
778
|
if (typeof value === "object" && value && "baseVal" in value) {
|
|
@@ -2400,6 +829,8 @@ var useNativeShadowDom = false;
|
|
|
2400
829
|
var checkSlotFallbackVisibility = false;
|
|
2401
830
|
var checkSlotRelocate = false;
|
|
2402
831
|
var isSvgMode = false;
|
|
832
|
+
var refCallbacksToRemove = [];
|
|
833
|
+
var refCallbacksToAttach = [];
|
|
2403
834
|
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
2404
835
|
var _a;
|
|
2405
836
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
@@ -2422,7 +853,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
2422
853
|
);
|
|
2423
854
|
}
|
|
2424
855
|
}
|
|
2425
|
-
if (newVNode2.$text$
|
|
856
|
+
if (newVNode2.$text$ != null) {
|
|
2426
857
|
elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
|
|
2427
858
|
} else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
2428
859
|
elm = newVNode2.$elm$ = win.document.createTextNode("");
|
|
@@ -2434,9 +865,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
2434
865
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
2435
866
|
}
|
|
2436
867
|
if (!win.document) {
|
|
2437
|
-
throw new Error(
|
|
2438
|
-
"You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
|
|
2439
|
-
);
|
|
868
|
+
throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");
|
|
2440
869
|
}
|
|
2441
870
|
elm = newVNode2.$elm$ = win.document.createElementNS(
|
|
2442
871
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
@@ -2626,7 +1055,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
2626
1055
|
if (idxInOld >= 0) {
|
|
2627
1056
|
elmToMove = oldCh[idxInOld];
|
|
2628
1057
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
2629
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2,
|
|
1058
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
|
|
2630
1059
|
} else {
|
|
2631
1060
|
patch(elmToMove, newStartVnode, isInitialRender);
|
|
2632
1061
|
oldCh[idxInOld] = void 0;
|
|
@@ -2684,7 +1113,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
2684
1113
|
const tag = newVNode2.$tag$;
|
|
2685
1114
|
const text = newVNode2.$text$;
|
|
2686
1115
|
let defaultHolder;
|
|
2687
|
-
if (text
|
|
1116
|
+
if (text == null) {
|
|
2688
1117
|
{
|
|
2689
1118
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
2690
1119
|
}
|
|
@@ -2731,7 +1160,10 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
2731
1160
|
const slotName = childNode["s-sn"];
|
|
2732
1161
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
2733
1162
|
node = hostContentNodes[j];
|
|
2734
|
-
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] &&
|
|
1163
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && // let an exact named-slot match override a stale default-slot claim. Skip this for
|
|
1164
|
+
// `slotName === ''` itself - a matched default node's cached `s-sn` is `''` too, which
|
|
1165
|
+
// would trivially "match" on every re-render and force pointless re-insertion.
|
|
1166
|
+
(!node["s-sh"] || node["s-sh"] !== childNode["s-hn"] || slotName !== "" && getSlotName(node) === slotName)) {
|
|
2735
1167
|
if (isNodeLocatedInSlot(node, slotName)) {
|
|
2736
1168
|
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
2737
1169
|
checkSlotFallbackVisibility = true;
|
|
@@ -2771,18 +1203,35 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
2771
1203
|
};
|
|
2772
1204
|
var nullifyVNodeRefs = (vNode) => {
|
|
2773
1205
|
{
|
|
2774
|
-
vNode.$attrs$ && vNode.$attrs$.ref
|
|
1206
|
+
if (vNode.$attrs$ && vNode.$attrs$.ref) {
|
|
1207
|
+
refCallbacksToRemove.push(() => vNode.$attrs$.ref(null));
|
|
1208
|
+
}
|
|
2775
1209
|
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
2776
1210
|
}
|
|
2777
1211
|
};
|
|
1212
|
+
var queueRefAttachment = (refCallback, elm) => {
|
|
1213
|
+
{
|
|
1214
|
+
refCallbacksToAttach.push(() => refCallback(elm));
|
|
1215
|
+
}
|
|
1216
|
+
};
|
|
1217
|
+
var flushQueuedRefCallbacks = () => {
|
|
1218
|
+
{
|
|
1219
|
+
refCallbacksToRemove.forEach((cb) => cb());
|
|
1220
|
+
refCallbacksToRemove.length = 0;
|
|
1221
|
+
refCallbacksToAttach.forEach((cb) => cb());
|
|
1222
|
+
refCallbacksToAttach.length = 0;
|
|
1223
|
+
}
|
|
1224
|
+
};
|
|
2778
1225
|
var insertBefore = (parent, newNode, reference, isInitialLoad) => {
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
1226
|
+
{
|
|
1227
|
+
if (typeof newNode["s-sn"] === "string") {
|
|
1228
|
+
parent.insertBefore(newNode, reference);
|
|
1229
|
+
const { slotNode } = findSlotFromSlottedNode(newNode);
|
|
1230
|
+
if (slotNode && !isInitialLoad) dispatchSlotChangeEvent(slotNode);
|
|
1231
|
+
return newNode;
|
|
1232
|
+
}
|
|
2784
1233
|
}
|
|
2785
|
-
if (parent.__insertBefore) {
|
|
1234
|
+
if ((parent == null ? void 0 : parent.__insertBefore)) {
|
|
2786
1235
|
return parent.__insertBefore(newNode, reference);
|
|
2787
1236
|
} else {
|
|
2788
1237
|
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
@@ -2908,6 +1357,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
2908
1357
|
}
|
|
2909
1358
|
}
|
|
2910
1359
|
contentRef = void 0;
|
|
1360
|
+
flushQueuedRefCallbacks();
|
|
2911
1361
|
};
|
|
2912
1362
|
|
|
2913
1363
|
// src/runtime/update-component.ts
|
|
@@ -2969,8 +1419,8 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
2969
1419
|
endSchedule();
|
|
2970
1420
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
2971
1421
|
};
|
|
2972
|
-
var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((
|
|
2973
|
-
console.error(
|
|
1422
|
+
var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err) => {
|
|
1423
|
+
console.error(err);
|
|
2974
1424
|
fn();
|
|
2975
1425
|
}) : fn();
|
|
2976
1426
|
var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
|
|
@@ -2998,7 +1448,7 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2998
1448
|
if (childrenPromises.length === 0) {
|
|
2999
1449
|
postUpdate();
|
|
3000
1450
|
} else {
|
|
3001
|
-
Promise.all(childrenPromises).then(postUpdate);
|
|
1451
|
+
Promise.all(childrenPromises).then(postUpdate).catch(postUpdate);
|
|
3002
1452
|
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
3003
1453
|
childrenPromises.length = 0;
|
|
3004
1454
|
}
|
|
@@ -3122,25 +1572,26 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
3122
1572
|
});
|
|
3123
1573
|
}
|
|
3124
1574
|
}
|
|
3125
|
-
if (
|
|
1575
|
+
if (flags & 2 /* hasRendered */) {
|
|
3126
1576
|
if (instance.componentShouldUpdate) {
|
|
3127
|
-
|
|
1577
|
+
const shouldUpdate = instance.componentShouldUpdate(newVal, oldVal, propName);
|
|
1578
|
+
if (shouldUpdate === false && !(flags & 16 /* isQueuedForUpdate */)) {
|
|
3128
1579
|
return;
|
|
3129
1580
|
}
|
|
3130
1581
|
}
|
|
3131
|
-
|
|
1582
|
+
if (!(flags & 16 /* isQueuedForUpdate */)) {
|
|
1583
|
+
scheduleUpdate(hostRef, false);
|
|
1584
|
+
}
|
|
3132
1585
|
}
|
|
3133
1586
|
}
|
|
3134
1587
|
};
|
|
3135
|
-
|
|
3136
|
-
// src/runtime/proxy-component.ts
|
|
3137
1588
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
3138
1589
|
var _a, _b;
|
|
3139
1590
|
const prototype = Cstr.prototype;
|
|
3140
1591
|
if (cmpMeta.$members$ || BUILD.propChangeCallback) {
|
|
3141
1592
|
{
|
|
3142
1593
|
if (Cstr.watchers && !cmpMeta.$watchers$) {
|
|
3143
|
-
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1594
|
+
cmpMeta.$watchers$ = normalizeWatchers(Cstr.watchers);
|
|
3144
1595
|
}
|
|
3145
1596
|
if (Cstr.deserializers && !cmpMeta.$deserializers$) {
|
|
3146
1597
|
cmpMeta.$deserializers$ = Cstr.deserializers;
|
|
@@ -3152,7 +1603,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
3152
1603
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
3153
1604
|
members.map(([memberName, [memberFlags]]) => {
|
|
3154
1605
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
3155
|
-
const { get: origGetter, set: origSetter } =
|
|
1606
|
+
const { get: origGetter, set: origSetter } = getPropertyDescriptor(prototype, memberName) || {};
|
|
3156
1607
|
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
3157
1608
|
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
3158
1609
|
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
@@ -3204,21 +1655,26 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
3204
1655
|
}
|
|
3205
1656
|
return;
|
|
3206
1657
|
}
|
|
3207
|
-
const
|
|
1658
|
+
const parsedValue = parsePropertyValue(
|
|
1659
|
+
newValue,
|
|
1660
|
+
memberFlags);
|
|
1661
|
+
const setterSetVal = (val) => {
|
|
3208
1662
|
const currentValue = ref.$lazyInstance$[memberName];
|
|
3209
1663
|
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
3210
1664
|
ref.$instanceValues$.set(memberName, currentValue);
|
|
3211
1665
|
}
|
|
3212
|
-
ref.$lazyInstance$[memberName] =
|
|
3213
|
-
newValue,
|
|
3214
|
-
memberFlags);
|
|
1666
|
+
ref.$lazyInstance$[memberName] = val;
|
|
3215
1667
|
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
3216
1668
|
};
|
|
3217
1669
|
if (ref.$lazyInstance$) {
|
|
3218
|
-
setterSetVal();
|
|
1670
|
+
setterSetVal(parsedValue);
|
|
3219
1671
|
} else {
|
|
1672
|
+
ref.$instanceValues$.set(memberName, parsedValue);
|
|
3220
1673
|
ref.$fetchedCbList$.push(() => {
|
|
3221
|
-
|
|
1674
|
+
const pendingValue = ref.$instanceValues$.get(memberName);
|
|
1675
|
+
if (ref.$lazyInstance$[memberName] !== pendingValue) {
|
|
1676
|
+
setterSetVal(pendingValue);
|
|
1677
|
+
}
|
|
3222
1678
|
});
|
|
3223
1679
|
}
|
|
3224
1680
|
}
|
|
@@ -3255,11 +1711,14 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
3255
1711
|
return;
|
|
3256
1712
|
}
|
|
3257
1713
|
const propFlags = members.find(([m]) => m === propName);
|
|
3258
|
-
|
|
1714
|
+
const propMemberFlags = propFlags ? propFlags[1][0] : 0;
|
|
1715
|
+
const isBooleanTarget = propMemberFlags & 4 /* Boolean */;
|
|
1716
|
+
const isSpuriousBooleanRemoval = isBooleanTarget && newValue === null && this[propName] === void 0;
|
|
1717
|
+
if (isBooleanTarget) {
|
|
3259
1718
|
newValue = newValue === null || newValue === "false" ? false : true;
|
|
3260
1719
|
}
|
|
3261
1720
|
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
3262
|
-
if (newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1721
|
+
if (!isSpuriousBooleanRemoval && newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
3263
1722
|
this[propName] = newValue;
|
|
3264
1723
|
}
|
|
3265
1724
|
});
|
|
@@ -3281,77 +1740,95 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
3281
1740
|
|
|
3282
1741
|
// src/runtime/initialize-component.ts
|
|
3283
1742
|
var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
1743
|
+
var _a;
|
|
3284
1744
|
let Cstr;
|
|
3285
|
-
|
|
3286
|
-
hostRef.$flags$
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
const
|
|
3290
|
-
if (
|
|
3291
|
-
const
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
1745
|
+
try {
|
|
1746
|
+
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1747
|
+
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1748
|
+
hostRef.$flags$ &= -1025 /* hasFailedLoad */;
|
|
1749
|
+
const bundleId = cmpMeta.$lazyBundleId$;
|
|
1750
|
+
if (bundleId) {
|
|
1751
|
+
const CstrImport = loadModule(cmpMeta, hostRef);
|
|
1752
|
+
if (CstrImport && "then" in CstrImport) {
|
|
1753
|
+
const endLoad = uniqueTime();
|
|
1754
|
+
Cstr = await CstrImport;
|
|
1755
|
+
endLoad();
|
|
1756
|
+
} else {
|
|
1757
|
+
Cstr = CstrImport;
|
|
1758
|
+
}
|
|
1759
|
+
if (!Cstr) {
|
|
1760
|
+
hostRef.$flags$ &= -33 /* hasInitializedComponent */;
|
|
1761
|
+
hostRef.$loadRetryCount$ = ((_a = hostRef.$loadRetryCount$) != null ? _a : 0) + 1;
|
|
1762
|
+
if (hostRef.$loadRetryCount$ < MAX_LAZY_LOAD_RETRIES) {
|
|
1763
|
+
hostRef.$flags$ |= 1024 /* hasFailedLoad */;
|
|
1764
|
+
}
|
|
1765
|
+
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
1766
|
+
}
|
|
1767
|
+
if (!Cstr.isProxied) {
|
|
1768
|
+
{
|
|
1769
|
+
cmpMeta.$watchers$ = normalizeWatchers(Cstr.watchers);
|
|
1770
|
+
cmpMeta.$serializers$ = Cstr.serializers;
|
|
1771
|
+
cmpMeta.$deserializers$ = Cstr.deserializers;
|
|
1772
|
+
}
|
|
1773
|
+
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
1774
|
+
Cstr.isProxied = true;
|
|
1775
|
+
}
|
|
1776
|
+
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
|
|
3301
1777
|
{
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
1778
|
+
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
1779
|
+
}
|
|
1780
|
+
try {
|
|
1781
|
+
new Cstr(hostRef);
|
|
1782
|
+
} catch (e) {
|
|
1783
|
+
consoleError(e, elm);
|
|
1784
|
+
}
|
|
1785
|
+
{
|
|
1786
|
+
hostRef.$flags$ &= -9 /* isConstructingInstance */;
|
|
1787
|
+
}
|
|
1788
|
+
{
|
|
1789
|
+
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1790
|
+
}
|
|
1791
|
+
endNewInstance();
|
|
1792
|
+
const needsDeferredCallback = cmpMeta.$flags$ & 4 /* hasSlotRelocation */;
|
|
1793
|
+
if (!needsDeferredCallback) {
|
|
1794
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1795
|
+
} else {
|
|
1796
|
+
hostRef.$deferredConnectedCallback$ = true;
|
|
3305
1797
|
}
|
|
3306
|
-
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
3307
|
-
Cstr.isProxied = true;
|
|
3308
|
-
}
|
|
3309
|
-
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
|
|
3310
|
-
{
|
|
3311
|
-
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
3312
|
-
}
|
|
3313
|
-
try {
|
|
3314
|
-
new Cstr(hostRef);
|
|
3315
|
-
} catch (e) {
|
|
3316
|
-
consoleError(e, elm);
|
|
3317
|
-
}
|
|
3318
|
-
{
|
|
3319
|
-
hostRef.$flags$ &= -9 /* isConstructingInstance */;
|
|
3320
|
-
}
|
|
3321
|
-
{
|
|
3322
|
-
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
3323
|
-
}
|
|
3324
|
-
endNewInstance();
|
|
3325
|
-
const needsDeferredCallback = cmpMeta.$flags$ & 4 /* hasSlotRelocation */;
|
|
3326
|
-
if (!needsDeferredCallback) {
|
|
3327
|
-
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
3328
1798
|
} else {
|
|
3329
|
-
|
|
1799
|
+
Cstr = elm.constructor;
|
|
1800
|
+
const cmpTag = elm.localName;
|
|
1801
|
+
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
1802
|
+
}
|
|
1803
|
+
if (Cstr && Cstr.style) {
|
|
1804
|
+
let style;
|
|
1805
|
+
if (typeof Cstr.style === "string") {
|
|
1806
|
+
style = Cstr.style;
|
|
1807
|
+
}
|
|
1808
|
+
const scopeId2 = getScopeId(cmpMeta);
|
|
1809
|
+
if (!styles.has(scopeId2) || BUILD.hotModuleReplacement) {
|
|
1810
|
+
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
1811
|
+
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
1812
|
+
endRegisterStyles();
|
|
1813
|
+
}
|
|
3330
1814
|
}
|
|
1815
|
+
}
|
|
1816
|
+
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1817
|
+
const schedule = () => scheduleUpdate(hostRef, true);
|
|
1818
|
+
if (ancestorComponent && ancestorComponent["s-rc"]) {
|
|
1819
|
+
ancestorComponent["s-rc"].push(schedule);
|
|
3331
1820
|
} else {
|
|
3332
|
-
|
|
3333
|
-
const cmpTag = elm.localName;
|
|
3334
|
-
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
1821
|
+
schedule();
|
|
3335
1822
|
}
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
3345
|
-
endRegisterStyles();
|
|
3346
|
-
}
|
|
1823
|
+
} catch (e) {
|
|
1824
|
+
consoleError(e, elm);
|
|
1825
|
+
if (hostRef.$onRenderResolve$) {
|
|
1826
|
+
hostRef.$onRenderResolve$();
|
|
1827
|
+
hostRef.$onRenderResolve$ = void 0;
|
|
1828
|
+
}
|
|
1829
|
+
if (hostRef.$onReadyResolve$ && !(hostRef.$flags$ & 1024 /* hasFailedLoad */)) {
|
|
1830
|
+
hostRef.$onReadyResolve$(elm);
|
|
3347
1831
|
}
|
|
3348
|
-
}
|
|
3349
|
-
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
3350
|
-
const schedule = () => scheduleUpdate(hostRef, true);
|
|
3351
|
-
if (ancestorComponent && ancestorComponent["s-rc"]) {
|
|
3352
|
-
ancestorComponent["s-rc"].push(schedule);
|
|
3353
|
-
} else {
|
|
3354
|
-
schedule();
|
|
3355
1832
|
}
|
|
3356
1833
|
};
|
|
3357
1834
|
var fireConnectedCallback = (instance, elm) => {
|
|
@@ -3388,7 +1865,7 @@ var connectedCallback = (elm) => {
|
|
|
3388
1865
|
}
|
|
3389
1866
|
if (cmpMeta.$members$) {
|
|
3390
1867
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
3391
|
-
if (memberFlags & 31 /* Prop */ &&
|
|
1868
|
+
if (memberFlags & 31 /* Prop */ && Object.prototype.hasOwnProperty.call(elm, memberName)) {
|
|
3392
1869
|
const value = elm[memberName];
|
|
3393
1870
|
delete elm[memberName];
|
|
3394
1871
|
elm[memberName] = value;
|
|
@@ -3401,6 +1878,8 @@ var connectedCallback = (elm) => {
|
|
|
3401
1878
|
} else {
|
|
3402
1879
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
3403
1880
|
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1881
|
+
} else if (hostRef.$flags$ & 1024 /* hasFailedLoad */) {
|
|
1882
|
+
setTimeout(() => initializeComponent(elm, hostRef, cmpMeta), LAZY_LOAD_RETRY_INTERVAL_MS);
|
|
3404
1883
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
3405
1884
|
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
|
|
3406
1885
|
}
|
|
@@ -3462,7 +1941,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3462
1941
|
let hasSlotRelocation = false;
|
|
3463
1942
|
lazyBundles.map((lazyBundle) => {
|
|
3464
1943
|
lazyBundle[1].map((compactMeta) => {
|
|
3465
|
-
var _a2, _b
|
|
1944
|
+
var _a2, _b;
|
|
3466
1945
|
const cmpMeta = {
|
|
3467
1946
|
$flags$: compactMeta[0],
|
|
3468
1947
|
$tagName$: compactMeta[1],
|
|
@@ -3476,9 +1955,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3476
1955
|
cmpMeta.$members$ = compactMeta[2];
|
|
3477
1956
|
}
|
|
3478
1957
|
{
|
|
3479
|
-
cmpMeta.$watchers$ = (
|
|
3480
|
-
cmpMeta.$serializers$ = (
|
|
3481
|
-
cmpMeta.$deserializers$ = (
|
|
1958
|
+
cmpMeta.$watchers$ = normalizeWatchers(compactMeta[4]);
|
|
1959
|
+
cmpMeta.$serializers$ = (_a2 = compactMeta[5]) != null ? _a2 : {};
|
|
1960
|
+
cmpMeta.$deserializers$ = (_b = compactMeta[6]) != null ? _b : {};
|
|
3482
1961
|
}
|
|
3483
1962
|
const tagName = transformTag(cmpMeta.$tagName$);
|
|
3484
1963
|
const HostElement = class extends HTMLElement {
|
|
@@ -3524,7 +2003,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3524
2003
|
}
|
|
3525
2004
|
disconnectedCallback() {
|
|
3526
2005
|
plt.jmp(() => disconnectedCallback(this));
|
|
3527
|
-
|
|
2006
|
+
nextTick(() => {
|
|
3528
2007
|
var _a3;
|
|
3529
2008
|
const hostRef = getHostRef(this);
|
|
3530
2009
|
if (!hostRef) {
|