@record-evolution/widget-overlay 1.0.9 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/widget-overlay.js +720 -1647
- package/dist/widget-overlay.js.map +1 -1
- package/package.json +8 -3
- package/src/definition-schema.d.ts +0 -65
- package/src/definition-schema.json +32 -22
- package/thumbnail.webp +0 -0
package/dist/widget-overlay.js
CHANGED
|
@@ -1,1626 +1,699 @@
|
|
|
1
|
-
const
|
|
2
|
-
class
|
|
3
|
-
constructor(
|
|
4
|
-
if (this._$cssResult$ = !0,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
// This is a getter so that it's lazy. In practice, this means stylesheets
|
|
9
|
-
// are not created until the first element instance is made.
|
|
1
|
+
const k = globalThis, J = k.ShadowRoot && (k.ShadyCSS === void 0 || k.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, K = /* @__PURE__ */ Symbol(), lt = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
let _t = class {
|
|
3
|
+
constructor(t, e, s) {
|
|
4
|
+
if (this._$cssResult$ = !0, s !== K) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
|
+
this.cssText = t, this.t = e;
|
|
6
|
+
}
|
|
10
7
|
get styleSheet() {
|
|
11
|
-
let
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
14
|
-
const
|
|
15
|
-
|
|
8
|
+
let t = this.o;
|
|
9
|
+
const e = this.t;
|
|
10
|
+
if (J && t === void 0) {
|
|
11
|
+
const s = e !== void 0 && e.length === 1;
|
|
12
|
+
s && (t = lt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && lt.set(e, t));
|
|
16
13
|
}
|
|
17
|
-
return
|
|
14
|
+
return t;
|
|
18
15
|
}
|
|
19
16
|
toString() {
|
|
20
17
|
return this.cssText;
|
|
21
18
|
}
|
|
22
|
-
}
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
return n.cssText;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const i = document.createElement("style"), s = q.litNonce;
|
|
38
|
-
s !== void 0 && i.setAttribute("nonce", s), i.textContent = t.cssText, n.appendChild(i);
|
|
39
|
-
}
|
|
40
|
-
}, st = (n) => {
|
|
19
|
+
};
|
|
20
|
+
const Pt = (r) => new _t(typeof r == "string" ? r : r + "", void 0, K), bt = (r, ...t) => {
|
|
21
|
+
const e = r.length === 1 ? r[0] : t.reduce(((s, i, o) => s + ((n) => {
|
|
22
|
+
if (n._$cssResult$ === !0) return n.cssText;
|
|
23
|
+
if (typeof n == "number") return n;
|
|
24
|
+
throw Error("Value passed to 'css' function must be a 'css' function result: " + n + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
25
|
+
})(i) + r[o + 1]), r[0]);
|
|
26
|
+
return new _t(e, r, K);
|
|
27
|
+
}, Ut = (r, t) => {
|
|
28
|
+
if (J) r.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet));
|
|
29
|
+
else for (const e of t) {
|
|
30
|
+
const s = document.createElement("style"), i = k.litNonce;
|
|
31
|
+
i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
|
|
32
|
+
}
|
|
33
|
+
}, ht = J ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
|
41
34
|
let e = "";
|
|
42
|
-
for (const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
t = n === null ? null : Number(n);
|
|
79
|
-
break;
|
|
80
|
-
case Object:
|
|
81
|
-
case Array:
|
|
82
|
-
try {
|
|
83
|
-
t = JSON.parse(n);
|
|
84
|
-
} catch {
|
|
85
|
-
t = null;
|
|
86
|
-
}
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
return t;
|
|
35
|
+
for (const s of t.cssRules) e += s.cssText;
|
|
36
|
+
return Pt(e);
|
|
37
|
+
})(r) : r;
|
|
38
|
+
const { is: Tt, defineProperty: Ot, getOwnPropertyDescriptor: Mt, getOwnPropertyNames: Nt, getOwnPropertySymbols: Ht, getPrototypeOf: Lt } = Object, z = globalThis, ct = z.trustedTypes, Rt = ct ? ct.emptyScript : "", kt = z.reactiveElementPolyfillSupport, N = (r, t) => r, j = { toAttribute(r, t) {
|
|
39
|
+
switch (t) {
|
|
40
|
+
case Boolean:
|
|
41
|
+
r = r ? Rt : null;
|
|
42
|
+
break;
|
|
43
|
+
case Object:
|
|
44
|
+
case Array:
|
|
45
|
+
r = r == null ? r : JSON.stringify(r);
|
|
46
|
+
}
|
|
47
|
+
return r;
|
|
48
|
+
}, fromAttribute(r, t) {
|
|
49
|
+
let e = r;
|
|
50
|
+
switch (t) {
|
|
51
|
+
case Boolean:
|
|
52
|
+
e = r !== null;
|
|
53
|
+
break;
|
|
54
|
+
case Number:
|
|
55
|
+
e = r === null ? null : Number(r);
|
|
56
|
+
break;
|
|
57
|
+
case Object:
|
|
58
|
+
case Array:
|
|
59
|
+
try {
|
|
60
|
+
e = JSON.parse(r);
|
|
61
|
+
} catch {
|
|
62
|
+
e = null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return e;
|
|
66
|
+
} }, Q = (r, t) => !Tt(r, t), dt = { attribute: !0, type: String, converter: j, reflect: !1, useDefault: !1, hasChanged: Q };
|
|
67
|
+
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), z.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
|
+
let E = class extends HTMLElement {
|
|
69
|
+
static addInitializer(t) {
|
|
70
|
+
this._$Ei(), (this.l ??= []).push(t);
|
|
90
71
|
}
|
|
91
|
-
}, me = (n, e) => !nt(n, e), Ue = {
|
|
92
|
-
attribute: !0,
|
|
93
|
-
type: String,
|
|
94
|
-
converter: G,
|
|
95
|
-
reflect: !1,
|
|
96
|
-
useDefault: !1,
|
|
97
|
-
hasChanged: me
|
|
98
|
-
};
|
|
99
|
-
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata");
|
|
100
|
-
$.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
101
|
-
class C extends HTMLElement {
|
|
102
|
-
/**
|
|
103
|
-
* Adds an initializer function to the class that is called during instance
|
|
104
|
-
* construction.
|
|
105
|
-
*
|
|
106
|
-
* This is useful for code that runs against a `ReactiveElement`
|
|
107
|
-
* subclass, such as a decorator, that needs to do work for each
|
|
108
|
-
* instance, such as setting up a `ReactiveController`.
|
|
109
|
-
*
|
|
110
|
-
* ```ts
|
|
111
|
-
* const myDecorator = (target: typeof ReactiveElement, key: string) => {
|
|
112
|
-
* target.addInitializer((instance: ReactiveElement) => {
|
|
113
|
-
* // This is run during construction of the element
|
|
114
|
-
* new MyController(instance);
|
|
115
|
-
* });
|
|
116
|
-
* }
|
|
117
|
-
* ```
|
|
118
|
-
*
|
|
119
|
-
* Decorating a field will then cause each instance to run an initializer
|
|
120
|
-
* that adds a controller:
|
|
121
|
-
*
|
|
122
|
-
* ```ts
|
|
123
|
-
* class MyElement extends LitElement {
|
|
124
|
-
* @myDecorator foo;
|
|
125
|
-
* }
|
|
126
|
-
* ```
|
|
127
|
-
*
|
|
128
|
-
* Initializers are stored per-constructor. Adding an initializer to a
|
|
129
|
-
* subclass does not add it to a superclass. Since initializers are run in
|
|
130
|
-
* constructors, initializers will run in order of the class hierarchy,
|
|
131
|
-
* starting with superclasses and progressing to the instance's class.
|
|
132
|
-
*
|
|
133
|
-
* @nocollapse
|
|
134
|
-
*/
|
|
135
|
-
static addInitializer(e) {
|
|
136
|
-
this.__prepare(), (this._initializers ??= []).push(e);
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Returns a list of attributes corresponding to the registered properties.
|
|
140
|
-
* @nocollapse
|
|
141
|
-
* @category attributes
|
|
142
|
-
*/
|
|
143
72
|
static get observedAttributes() {
|
|
144
|
-
return this.finalize(), this.
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Creates a property accessor on the element prototype if one does not exist
|
|
148
|
-
* and stores a {@linkcode PropertyDeclaration} for the property with the
|
|
149
|
-
* given options. The property setter calls the property's `hasChanged`
|
|
150
|
-
* property option or uses a strict identity check to determine whether or not
|
|
151
|
-
* to request an update.
|
|
152
|
-
*
|
|
153
|
-
* This method may be overridden to customize properties; however,
|
|
154
|
-
* when doing so, it's important to call `super.createProperty` to ensure
|
|
155
|
-
* the property is setup correctly. This method calls
|
|
156
|
-
* `getPropertyDescriptor` internally to get a descriptor to install.
|
|
157
|
-
* To customize what properties do when they are get or set, override
|
|
158
|
-
* `getPropertyDescriptor`. To customize the options for a property,
|
|
159
|
-
* implement `createProperty` like this:
|
|
160
|
-
*
|
|
161
|
-
* ```ts
|
|
162
|
-
* static createProperty(name, options) {
|
|
163
|
-
* options = Object.assign(options, {myOption: true});
|
|
164
|
-
* super.createProperty(name, options);
|
|
165
|
-
* }
|
|
166
|
-
* ```
|
|
167
|
-
*
|
|
168
|
-
* @nocollapse
|
|
169
|
-
* @category properties
|
|
170
|
-
*/
|
|
171
|
-
static createProperty(e, t = Ue) {
|
|
172
|
-
if (t.state && (t.attribute = !1), this.__prepare(), this.prototype.hasOwnProperty(e) && (t = Object.create(t), t.wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
|
|
173
|
-
const i = (
|
|
174
|
-
// Use Symbol.for in dev mode to make it easier to maintain state
|
|
175
|
-
// when doing HMR.
|
|
176
|
-
/* @__PURE__ */ Symbol.for(`${String(e)} (@property() cache)`)
|
|
177
|
-
), s = this.getPropertyDescriptor(e, i, t);
|
|
178
|
-
s !== void 0 && rt(this.prototype, e, s);
|
|
179
|
-
}
|
|
73
|
+
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
180
74
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
*
|
|
186
|
-
* ```ts
|
|
187
|
-
* class MyElement extends LitElement {
|
|
188
|
-
* static getPropertyDescriptor(name, key, options) {
|
|
189
|
-
* const defaultDescriptor =
|
|
190
|
-
* super.getPropertyDescriptor(name, key, options);
|
|
191
|
-
* const setter = defaultDescriptor.set;
|
|
192
|
-
* return {
|
|
193
|
-
* get: defaultDescriptor.get,
|
|
194
|
-
* set(value) {
|
|
195
|
-
* setter.call(this, value);
|
|
196
|
-
* // custom action.
|
|
197
|
-
* },
|
|
198
|
-
* configurable: true,
|
|
199
|
-
* enumerable: true
|
|
200
|
-
* }
|
|
201
|
-
* }
|
|
202
|
-
* }
|
|
203
|
-
* ```
|
|
204
|
-
*
|
|
205
|
-
* @nocollapse
|
|
206
|
-
* @category properties
|
|
207
|
-
*/
|
|
208
|
-
static getPropertyDescriptor(e, t, i) {
|
|
209
|
-
const { get: s, set: r } = Ee(this.prototype, e) ?? {
|
|
210
|
-
get() {
|
|
211
|
-
return this[t];
|
|
212
|
-
},
|
|
213
|
-
set(o) {
|
|
214
|
-
this[t] = o;
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
if (s == null) {
|
|
218
|
-
if ("value" in (Ee(this.prototype, e) ?? {}))
|
|
219
|
-
throw new Error(`Field ${JSON.stringify(String(e))} on ${this.name} was declared as a reactive property but it's actually declared as a value on the prototype. Usually this is due to using @property or @state on a method.`);
|
|
220
|
-
v("reactive-property-without-getter", `Field ${JSON.stringify(String(e))} on ${this.name} was declared as a reactive property but it does not have a getter. This will be an error in a future version of Lit.`);
|
|
75
|
+
static createProperty(t, e = dt) {
|
|
76
|
+
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
77
|
+
const s = /* @__PURE__ */ Symbol(), i = this.getPropertyDescriptor(t, s, e);
|
|
78
|
+
i !== void 0 && Ot(this.prototype, t, i);
|
|
221
79
|
}
|
|
222
|
-
return {
|
|
223
|
-
get: s,
|
|
224
|
-
set(o) {
|
|
225
|
-
const l = s?.call(this);
|
|
226
|
-
r?.call(this, o), this.requestUpdate(e, l, i);
|
|
227
|
-
},
|
|
228
|
-
configurable: !0,
|
|
229
|
-
enumerable: !0
|
|
230
|
-
};
|
|
231
80
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
static
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
* for element properties, initializers, etc.
|
|
252
|
-
*
|
|
253
|
-
* Can be called multiple times by code that needs to ensure these
|
|
254
|
-
* properties exist before using them.
|
|
255
|
-
*
|
|
256
|
-
* This method ensures the superclass is finalized so that inherited
|
|
257
|
-
* property metadata can be copied down.
|
|
258
|
-
* @nocollapse
|
|
259
|
-
*/
|
|
260
|
-
static __prepare() {
|
|
261
|
-
if (this.hasOwnProperty(V("elementProperties")))
|
|
262
|
-
return;
|
|
263
|
-
const e = Ne(this);
|
|
264
|
-
e.finalize(), e._initializers !== void 0 && (this._initializers = [...e._initializers]), this.elementProperties = new Map(e.elementProperties);
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Finishes setting up the class so that it's ready to be registered
|
|
268
|
-
* as a custom element and instantiated.
|
|
269
|
-
*
|
|
270
|
-
* This method is called by the ReactiveElement.observedAttributes getter.
|
|
271
|
-
* If you override the observedAttributes getter, you must either call
|
|
272
|
-
* super.observedAttributes to trigger finalization, or call finalize()
|
|
273
|
-
* yourself.
|
|
274
|
-
*
|
|
275
|
-
* @nocollapse
|
|
276
|
-
*/
|
|
81
|
+
static getPropertyDescriptor(t, e, s) {
|
|
82
|
+
const { get: i, set: o } = Mt(this.prototype, t) ?? { get() {
|
|
83
|
+
return this[e];
|
|
84
|
+
}, set(n) {
|
|
85
|
+
this[e] = n;
|
|
86
|
+
} };
|
|
87
|
+
return { get: i, set(n) {
|
|
88
|
+
const h = i?.call(this);
|
|
89
|
+
o?.call(this, n), this.requestUpdate(t, h, s);
|
|
90
|
+
}, configurable: !0, enumerable: !0 };
|
|
91
|
+
}
|
|
92
|
+
static getPropertyOptions(t) {
|
|
93
|
+
return this.elementProperties.get(t) ?? dt;
|
|
94
|
+
}
|
|
95
|
+
static _$Ei() {
|
|
96
|
+
if (this.hasOwnProperty(N("elementProperties"))) return;
|
|
97
|
+
const t = Lt(this);
|
|
98
|
+
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
99
|
+
}
|
|
277
100
|
static finalize() {
|
|
278
|
-
if (this.hasOwnProperty(
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
const
|
|
282
|
-
...ot(t),
|
|
283
|
-
...at(t)
|
|
284
|
-
];
|
|
285
|
-
for (const s of i)
|
|
286
|
-
this.createProperty(s, t[s]);
|
|
101
|
+
if (this.hasOwnProperty(N("finalized"))) return;
|
|
102
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(N("properties"))) {
|
|
103
|
+
const e = this.properties, s = [...Nt(e), ...Ht(e)];
|
|
104
|
+
for (const i of s) this.createProperty(i, e[i]);
|
|
287
105
|
}
|
|
288
|
-
const
|
|
289
|
-
if (
|
|
290
|
-
const
|
|
291
|
-
if (
|
|
292
|
-
for (const [i, s] of t)
|
|
293
|
-
this.elementProperties.set(i, s);
|
|
106
|
+
const t = this[Symbol.metadata];
|
|
107
|
+
if (t !== null) {
|
|
108
|
+
const e = litPropertyMetadata.get(t);
|
|
109
|
+
if (e !== void 0) for (const [s, i] of e) this.elementProperties.set(s, i);
|
|
294
110
|
}
|
|
295
|
-
this.
|
|
296
|
-
for (const [
|
|
297
|
-
const
|
|
298
|
-
|
|
111
|
+
this._$Eh = /* @__PURE__ */ new Map();
|
|
112
|
+
for (const [e, s] of this.elementProperties) {
|
|
113
|
+
const i = this._$Eu(e, s);
|
|
114
|
+
i !== void 0 && this._$Eh.set(i, e);
|
|
299
115
|
}
|
|
300
|
-
this.elementStyles = this.finalizeStyles(this.styles)
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
* especially when composing via subclassing. The last item is kept to try
|
|
310
|
-
* to preserve the cascade order with the assumption that it's most important
|
|
311
|
-
* that last added styles override previous styles.
|
|
312
|
-
*
|
|
313
|
-
* @nocollapse
|
|
314
|
-
* @category styles
|
|
315
|
-
*/
|
|
316
|
-
static finalizeStyles(e) {
|
|
317
|
-
const t = [];
|
|
318
|
-
if (Array.isArray(e)) {
|
|
319
|
-
const i = new Set(e.flat(1 / 0).reverse());
|
|
320
|
-
for (const s of i)
|
|
321
|
-
t.unshift(Ce(s));
|
|
322
|
-
} else e !== void 0 && t.push(Ce(e));
|
|
323
|
-
return t;
|
|
116
|
+
this.elementStyles = this.finalizeStyles(this.styles);
|
|
117
|
+
}
|
|
118
|
+
static finalizeStyles(t) {
|
|
119
|
+
const e = [];
|
|
120
|
+
if (Array.isArray(t)) {
|
|
121
|
+
const s = new Set(t.flat(1 / 0).reverse());
|
|
122
|
+
for (const i of s) e.unshift(ht(i));
|
|
123
|
+
} else t !== void 0 && e.push(ht(t));
|
|
124
|
+
return e;
|
|
324
125
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
*/
|
|
329
|
-
static __attributeNameForProperty(e, t) {
|
|
330
|
-
const i = t.attribute;
|
|
331
|
-
return i === !1 ? void 0 : typeof i == "string" ? i : typeof e == "string" ? e.toLowerCase() : void 0;
|
|
126
|
+
static _$Eu(t, e) {
|
|
127
|
+
const s = e.attribute;
|
|
128
|
+
return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
|
|
332
129
|
}
|
|
333
130
|
constructor() {
|
|
334
|
-
super(), this.
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
* @category controllers
|
|
351
|
-
*/
|
|
352
|
-
addController(e) {
|
|
353
|
-
(this.__controllers ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
|
|
354
|
-
}
|
|
355
|
-
/**
|
|
356
|
-
* Removes a `ReactiveController` from the element.
|
|
357
|
-
* @category controllers
|
|
358
|
-
*/
|
|
359
|
-
removeController(e) {
|
|
360
|
-
this.__controllers?.delete(e);
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* Fixes any properties set on the instance before upgrade time.
|
|
364
|
-
* Otherwise these would shadow the accessor and break these properties.
|
|
365
|
-
* The properties are stored in a Map which is played back after the
|
|
366
|
-
* constructor runs.
|
|
367
|
-
*/
|
|
368
|
-
__saveInstanceProperties() {
|
|
369
|
-
const e = /* @__PURE__ */ new Map(), t = this.constructor.elementProperties;
|
|
370
|
-
for (const i of t.keys())
|
|
371
|
-
this.hasOwnProperty(i) && (e.set(i, this[i]), delete this[i]);
|
|
372
|
-
e.size > 0 && (this.__instanceProperties = e);
|
|
373
|
-
}
|
|
374
|
-
/**
|
|
375
|
-
* Returns the node into which the element should render and by default
|
|
376
|
-
* creates and returns an open shadowRoot. Implement to customize where the
|
|
377
|
-
* element's DOM is rendered. For example, to render into the element's
|
|
378
|
-
* childNodes, return `this`.
|
|
379
|
-
*
|
|
380
|
-
* @return Returns a node into which to render.
|
|
381
|
-
* @category rendering
|
|
382
|
-
*/
|
|
131
|
+
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
132
|
+
}
|
|
133
|
+
_$Ev() {
|
|
134
|
+
this._$ES = new Promise(((t) => this.enableUpdating = t)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((t) => t(this)));
|
|
135
|
+
}
|
|
136
|
+
addController(t) {
|
|
137
|
+
(this._$EO ??= /* @__PURE__ */ new Set()).add(t), this.renderRoot !== void 0 && this.isConnected && t.hostConnected?.();
|
|
138
|
+
}
|
|
139
|
+
removeController(t) {
|
|
140
|
+
this._$EO?.delete(t);
|
|
141
|
+
}
|
|
142
|
+
_$E_() {
|
|
143
|
+
const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
|
|
144
|
+
for (const s of e.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
|
|
145
|
+
t.size > 0 && (this._$Ep = t);
|
|
146
|
+
}
|
|
383
147
|
createRenderRoot() {
|
|
384
|
-
const
|
|
385
|
-
return
|
|
386
|
-
}
|
|
387
|
-
/**
|
|
388
|
-
* On first connection, creates the element's renderRoot, sets up
|
|
389
|
-
* element styling, and enables updating.
|
|
390
|
-
* @category lifecycle
|
|
391
|
-
*/
|
|
148
|
+
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
149
|
+
return Ut(t, this.constructor.elementStyles), t;
|
|
150
|
+
}
|
|
392
151
|
connectedCallback() {
|
|
393
|
-
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this.
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
* overridden on the element instance with a function that triggers the first
|
|
398
|
-
* update.
|
|
399
|
-
* @category updates
|
|
400
|
-
*/
|
|
401
|
-
enableUpdating(e) {
|
|
402
|
-
}
|
|
403
|
-
/**
|
|
404
|
-
* Allows for `super.disconnectedCallback()` in extensions while
|
|
405
|
-
* reserving the possibility of making non-breaking feature additions
|
|
406
|
-
* when disconnecting at some point in the future.
|
|
407
|
-
* @category lifecycle
|
|
408
|
-
*/
|
|
152
|
+
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((t) => t.hostConnected?.()));
|
|
153
|
+
}
|
|
154
|
+
enableUpdating(t) {
|
|
155
|
+
}
|
|
409
156
|
disconnectedCallback() {
|
|
410
|
-
this.
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
* See [responding to attribute changes](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#responding_to_attribute_changes)
|
|
421
|
-
* on MDN for more information about the `attributeChangedCallback`.
|
|
422
|
-
* @category attributes
|
|
423
|
-
*/
|
|
424
|
-
attributeChangedCallback(e, t, i) {
|
|
425
|
-
this._$attributeToProperty(e, i);
|
|
426
|
-
}
|
|
427
|
-
__propertyToAttribute(e, t) {
|
|
428
|
-
const s = this.constructor.elementProperties.get(e), r = this.constructor.__attributeNameForProperty(e, s);
|
|
429
|
-
if (r !== void 0 && s.reflect === !0) {
|
|
430
|
-
const l = (s.converter?.toAttribute !== void 0 ? s.converter : G).toAttribute(t, s.type);
|
|
431
|
-
this.constructor.enabledWarnings.includes("migration") && l === void 0 && v("undefined-attribute-value", `The attribute value for the ${e} property is undefined on element ${this.localName}. The attribute will be removed, but in the previous version of \`ReactiveElement\`, the attribute would not have changed.`), this.__reflectingProperty = e, l == null ? this.removeAttribute(r) : this.setAttribute(r, l), this.__reflectingProperty = null;
|
|
157
|
+
this._$EO?.forEach(((t) => t.hostDisconnected?.()));
|
|
158
|
+
}
|
|
159
|
+
attributeChangedCallback(t, e, s) {
|
|
160
|
+
this._$AK(t, s);
|
|
161
|
+
}
|
|
162
|
+
_$ET(t, e) {
|
|
163
|
+
const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
|
|
164
|
+
if (i !== void 0 && s.reflect === !0) {
|
|
165
|
+
const o = (s.converter?.toAttribute !== void 0 ? s.converter : j).toAttribute(e, s.type);
|
|
166
|
+
this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
|
|
432
167
|
}
|
|
433
168
|
}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
this.__reflectingProperty = s, this[s] = o.fromAttribute(t, r.type) ?? this.__defaultValues?.get(s) ?? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
440
|
-
null, this.__reflectingProperty = null;
|
|
169
|
+
_$AK(t, e) {
|
|
170
|
+
const s = this.constructor, i = s._$Eh.get(t);
|
|
171
|
+
if (i !== void 0 && this._$Em !== i) {
|
|
172
|
+
const o = s.getPropertyOptions(i), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : j;
|
|
173
|
+
this._$Em = i, this[i] = n.fromAttribute(e, o.type) ?? this._$Ej?.get(i) ?? null, this._$Em = null;
|
|
441
174
|
}
|
|
442
175
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
* property `name` and `oldValue` to ensure that any configured property
|
|
449
|
-
* options are honored.
|
|
450
|
-
*
|
|
451
|
-
* @param name name of requesting property
|
|
452
|
-
* @param oldValue old value of requesting property
|
|
453
|
-
* @param options property options to use instead of the previously
|
|
454
|
-
* configured options
|
|
455
|
-
* @category updates
|
|
456
|
-
*/
|
|
457
|
-
requestUpdate(e, t, i) {
|
|
458
|
-
if (e !== void 0) {
|
|
459
|
-
e instanceof Event && v("", "The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()");
|
|
460
|
-
const s = this.constructor, r = this[e];
|
|
461
|
-
if (i ??= s.getPropertyOptions(e), (i.hasChanged ?? me)(r, t) || // When there is no change, check a corner case that can occur when
|
|
462
|
-
// 1. there's a initial value which was not reflected
|
|
463
|
-
// 2. the property is subsequently set to this value.
|
|
464
|
-
// For example, `prop: {useDefault: true, reflect: true}`
|
|
465
|
-
// and el.prop = 'foo'. This should be considered a change if the
|
|
466
|
-
// attribute is not set because we will now reflect the property to the attribute.
|
|
467
|
-
i.useDefault && i.reflect && r === this.__defaultValues?.get(e) && !this.hasAttribute(s.__attributeNameForProperty(e, i)))
|
|
468
|
-
this._$changeProperty(e, t, i);
|
|
469
|
-
else
|
|
470
|
-
return;
|
|
176
|
+
requestUpdate(t, e, s) {
|
|
177
|
+
if (t !== void 0) {
|
|
178
|
+
const i = this.constructor, o = this[t];
|
|
179
|
+
if (s ??= i.getPropertyOptions(t), !((s.hasChanged ?? Q)(o, e) || s.useDefault && s.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(i._$Eu(t, s)))) return;
|
|
180
|
+
this.C(t, e, s);
|
|
471
181
|
}
|
|
472
|
-
this.isUpdatePending === !1 && (this.
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
_$
|
|
478
|
-
i && !(this.__defaultValues ??= /* @__PURE__ */ new Map()).has(e) && (this.__defaultValues.set(e, o ?? t ?? this[e]), r !== !0 || o !== void 0) || (this._$changedProperties.has(e) || (!this.hasUpdated && !i && (t = void 0), this._$changedProperties.set(e, t)), s === !0 && this.__reflectingProperty !== e && (this.__reflectingProperties ??= /* @__PURE__ */ new Set()).add(e));
|
|
479
|
-
}
|
|
480
|
-
/**
|
|
481
|
-
* Sets up the element to asynchronously update.
|
|
482
|
-
*/
|
|
483
|
-
async __enqueueUpdate() {
|
|
182
|
+
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
183
|
+
}
|
|
184
|
+
C(t, e, { useDefault: s, reflect: i, wrapped: o }, n) {
|
|
185
|
+
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, n ?? e ?? this[t]), o !== !0 || n !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), i === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
|
|
186
|
+
}
|
|
187
|
+
async _$EP() {
|
|
484
188
|
this.isUpdatePending = !0;
|
|
485
189
|
try {
|
|
486
|
-
await this.
|
|
487
|
-
} catch (
|
|
488
|
-
Promise.reject(
|
|
190
|
+
await this._$ES;
|
|
191
|
+
} catch (e) {
|
|
192
|
+
Promise.reject(e);
|
|
489
193
|
}
|
|
490
|
-
const
|
|
491
|
-
return
|
|
492
|
-
}
|
|
493
|
-
/**
|
|
494
|
-
* Schedules an element update. You can override this method to change the
|
|
495
|
-
* timing of updates by returning a Promise. The update will await the
|
|
496
|
-
* returned Promise, and you should resolve the Promise to allow the update
|
|
497
|
-
* to proceed. If this method is overridden, `super.scheduleUpdate()`
|
|
498
|
-
* must be called.
|
|
499
|
-
*
|
|
500
|
-
* For instance, to schedule updates to occur just before the next frame:
|
|
501
|
-
*
|
|
502
|
-
* ```ts
|
|
503
|
-
* override protected async scheduleUpdate(): Promise<unknown> {
|
|
504
|
-
* await new Promise((resolve) => requestAnimationFrame(() => resolve()));
|
|
505
|
-
* super.scheduleUpdate();
|
|
506
|
-
* }
|
|
507
|
-
* ```
|
|
508
|
-
* @category updates
|
|
509
|
-
*/
|
|
194
|
+
const t = this.scheduleUpdate();
|
|
195
|
+
return t != null && await t, !this.isUpdatePending;
|
|
196
|
+
}
|
|
510
197
|
scheduleUpdate() {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
}
|
|
514
|
-
/**
|
|
515
|
-
* Performs an element update. Note, if an exception is thrown during the
|
|
516
|
-
* update, `firstUpdated` and `updated` will not be called.
|
|
517
|
-
*
|
|
518
|
-
* Call `performUpdate()` to immediately process a pending update. This should
|
|
519
|
-
* generally not be needed, but it can be done in rare cases when you need to
|
|
520
|
-
* update synchronously.
|
|
521
|
-
*
|
|
522
|
-
* @category updates
|
|
523
|
-
*/
|
|
198
|
+
return this.performUpdate();
|
|
199
|
+
}
|
|
524
200
|
performUpdate() {
|
|
525
|
-
if (!this.isUpdatePending)
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
const r = [...this.constructor.elementProperties.keys()].filter((o) => this.hasOwnProperty(o) && o in Ne(this));
|
|
531
|
-
if (r.length)
|
|
532
|
-
throw new Error(`The following properties on element ${this.localName} will not trigger updates as expected because they are set using class fields: ${r.join(", ")}. Native class fields and some compiled output will overwrite accessors used for detecting changes. See https://lit.dev/msg/class-field-shadowing for more information.`);
|
|
201
|
+
if (!this.isUpdatePending) return;
|
|
202
|
+
if (!this.hasUpdated) {
|
|
203
|
+
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
204
|
+
for (const [i, o] of this._$Ep) this[i] = o;
|
|
205
|
+
this._$Ep = void 0;
|
|
533
206
|
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
this.
|
|
207
|
+
const s = this.constructor.elementProperties;
|
|
208
|
+
if (s.size > 0) for (const [i, o] of s) {
|
|
209
|
+
const { wrapped: n } = o, h = this[i];
|
|
210
|
+
n !== !0 || this._$AL.has(i) || h === void 0 || this.C(i, void 0, o, h);
|
|
538
211
|
}
|
|
539
|
-
const i = this.constructor.elementProperties;
|
|
540
|
-
if (i.size > 0)
|
|
541
|
-
for (const [s, r] of i) {
|
|
542
|
-
const { wrapped: o } = r, l = this[s];
|
|
543
|
-
o === !0 && !this._$changedProperties.has(s) && l !== void 0 && this._$changeProperty(s, void 0, r, l);
|
|
544
|
-
}
|
|
545
212
|
}
|
|
546
|
-
let
|
|
547
|
-
const
|
|
213
|
+
let t = !1;
|
|
214
|
+
const e = this._$AL;
|
|
548
215
|
try {
|
|
549
|
-
|
|
550
|
-
} catch (
|
|
551
|
-
throw
|
|
216
|
+
t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach(((s) => s.hostUpdate?.())), this.update(e)) : this._$EM();
|
|
217
|
+
} catch (s) {
|
|
218
|
+
throw t = !1, this._$EM(), s;
|
|
552
219
|
}
|
|
553
|
-
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
* // only need to check changed properties for an expensive computation.
|
|
564
|
-
* if (changedProperties.has('firstName') || changedProperties.has('lastName')) {
|
|
565
|
-
* this.sha = computeSHA(`${this.firstName} ${this.lastName}`);
|
|
566
|
-
* }
|
|
567
|
-
* }
|
|
568
|
-
*
|
|
569
|
-
* render() {
|
|
570
|
-
* return html`SHA: ${this.sha}`;
|
|
571
|
-
* }
|
|
572
|
-
* ```
|
|
573
|
-
*
|
|
574
|
-
* @category updates
|
|
575
|
-
*/
|
|
576
|
-
willUpdate(e) {
|
|
577
|
-
}
|
|
578
|
-
// Note, this is an override point for polyfill-support.
|
|
579
|
-
// @internal
|
|
580
|
-
_$didUpdate(e) {
|
|
581
|
-
this.__controllers?.forEach((t) => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e), this.isUpdatePending && this.constructor.enabledWarnings.includes("change-in-update") && v("change-in-update", `Element ${this.localName} scheduled an update (generally because a property was set) after an update completed, causing a new update to be scheduled. This is inefficient and should be avoided unless the next update can only be scheduled as a side effect of the previous update.`);
|
|
582
|
-
}
|
|
583
|
-
__markUpdated() {
|
|
584
|
-
this._$changedProperties = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
585
|
-
}
|
|
586
|
-
/**
|
|
587
|
-
* Returns a Promise that resolves when the element has completed updating.
|
|
588
|
-
* The Promise value is a boolean that is `true` if the element completed the
|
|
589
|
-
* update without triggering another update. The Promise result is `false` if
|
|
590
|
-
* a property was set inside `updated()`. If the Promise is rejected, an
|
|
591
|
-
* exception was thrown during the update.
|
|
592
|
-
*
|
|
593
|
-
* To await additional asynchronous work, override the `getUpdateComplete`
|
|
594
|
-
* method. For example, it is sometimes useful to await a rendered element
|
|
595
|
-
* before fulfilling this Promise. To do this, first await
|
|
596
|
-
* `super.getUpdateComplete()`, then any subsequent state.
|
|
597
|
-
*
|
|
598
|
-
* @return A promise of a boolean that resolves to true if the update completed
|
|
599
|
-
* without triggering another update.
|
|
600
|
-
* @category updates
|
|
601
|
-
*/
|
|
220
|
+
t && this._$AE(e);
|
|
221
|
+
}
|
|
222
|
+
willUpdate(t) {
|
|
223
|
+
}
|
|
224
|
+
_$AE(t) {
|
|
225
|
+
this._$EO?.forEach(((e) => e.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
226
|
+
}
|
|
227
|
+
_$EM() {
|
|
228
|
+
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
229
|
+
}
|
|
602
230
|
get updateComplete() {
|
|
603
231
|
return this.getUpdateComplete();
|
|
604
232
|
}
|
|
605
|
-
/**
|
|
606
|
-
* Override point for the `updateComplete` promise.
|
|
607
|
-
*
|
|
608
|
-
* It is not safe to override the `updateComplete` getter directly due to a
|
|
609
|
-
* limitation in TypeScript which means it is not possible to call a
|
|
610
|
-
* superclass getter (e.g. `super.updateComplete.then(...)`) when the target
|
|
611
|
-
* language is ES5 (https://github.com/microsoft/TypeScript/issues/338).
|
|
612
|
-
* This method should be overridden instead. For example:
|
|
613
|
-
*
|
|
614
|
-
* ```ts
|
|
615
|
-
* class MyElement extends LitElement {
|
|
616
|
-
* override async getUpdateComplete() {
|
|
617
|
-
* const result = await super.getUpdateComplete();
|
|
618
|
-
* await this._myChild.updateComplete;
|
|
619
|
-
* return result;
|
|
620
|
-
* }
|
|
621
|
-
* }
|
|
622
|
-
* ```
|
|
623
|
-
*
|
|
624
|
-
* @return A promise of a boolean that resolves to true if the update completed
|
|
625
|
-
* without triggering another update.
|
|
626
|
-
* @category updates
|
|
627
|
-
*/
|
|
628
233
|
getUpdateComplete() {
|
|
629
|
-
return this.
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
* Controls whether or not `update()` should be called when the element requests
|
|
633
|
-
* an update. By default, this method always returns `true`, but this can be
|
|
634
|
-
* customized to control when to update.
|
|
635
|
-
*
|
|
636
|
-
* @param _changedProperties Map of changed properties with old values
|
|
637
|
-
* @category updates
|
|
638
|
-
*/
|
|
639
|
-
shouldUpdate(e) {
|
|
234
|
+
return this._$ES;
|
|
235
|
+
}
|
|
236
|
+
shouldUpdate(t) {
|
|
640
237
|
return !0;
|
|
641
238
|
}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
* @param _changedProperties Map of changed properties with old values
|
|
649
|
-
* @category updates
|
|
650
|
-
*/
|
|
651
|
-
update(e) {
|
|
652
|
-
this.__reflectingProperties &&= this.__reflectingProperties.forEach((t) => this.__propertyToAttribute(t, this[t])), this.__markUpdated();
|
|
653
|
-
}
|
|
654
|
-
/**
|
|
655
|
-
* Invoked whenever the element is updated. Implement to perform
|
|
656
|
-
* post-updating tasks via DOM APIs, for example, focusing an element.
|
|
657
|
-
*
|
|
658
|
-
* Setting properties inside this method will trigger the element to update
|
|
659
|
-
* again after this update cycle completes.
|
|
660
|
-
*
|
|
661
|
-
* @param _changedProperties Map of changed properties with old values
|
|
662
|
-
* @category updates
|
|
663
|
-
*/
|
|
664
|
-
updated(e) {
|
|
665
|
-
}
|
|
666
|
-
/**
|
|
667
|
-
* Invoked when the element is first updated. Implement to perform one time
|
|
668
|
-
* work on the element after update.
|
|
669
|
-
*
|
|
670
|
-
* ```ts
|
|
671
|
-
* firstUpdated() {
|
|
672
|
-
* this.renderRoot.getElementById('my-text-area').focus();
|
|
673
|
-
* }
|
|
674
|
-
* ```
|
|
675
|
-
*
|
|
676
|
-
* Setting properties inside this method will trigger the element to update
|
|
677
|
-
* again after this update cycle completes.
|
|
678
|
-
*
|
|
679
|
-
* @param _changedProperties Map of changed properties with old values
|
|
680
|
-
* @category updates
|
|
681
|
-
*/
|
|
682
|
-
firstUpdated(e) {
|
|
239
|
+
update(t) {
|
|
240
|
+
this._$Eq &&= this._$Eq.forEach(((e) => this._$ET(e, this[e]))), this._$EM();
|
|
241
|
+
}
|
|
242
|
+
updated(t) {
|
|
243
|
+
}
|
|
244
|
+
firstUpdated(t) {
|
|
683
245
|
}
|
|
684
|
-
}
|
|
685
|
-
C.elementStyles = [];
|
|
686
|
-
C.shadowRootOptions = { mode: "open" };
|
|
687
|
-
C[V("elementProperties")] = /* @__PURE__ */ new Map();
|
|
688
|
-
C[V("finalized")] = /* @__PURE__ */ new Map();
|
|
689
|
-
je?.({ ReactiveElement: C });
|
|
690
|
-
{
|
|
691
|
-
C.enabledWarnings = [
|
|
692
|
-
"change-in-update",
|
|
693
|
-
"async-perform-update"
|
|
694
|
-
];
|
|
695
|
-
const n = function(e) {
|
|
696
|
-
e.hasOwnProperty(V("enabledWarnings")) || (e.enabledWarnings = e.enabledWarnings.slice());
|
|
697
|
-
};
|
|
698
|
-
C.enableWarning = function(e) {
|
|
699
|
-
n(this), this.enabledWarnings.includes(e) || this.enabledWarnings.push(e);
|
|
700
|
-
}, C.disableWarning = function(e) {
|
|
701
|
-
n(this);
|
|
702
|
-
const t = this.enabledWarnings.indexOf(e);
|
|
703
|
-
t >= 0 && this.enabledWarnings.splice(t, 1);
|
|
704
|
-
};
|
|
705
|
-
}
|
|
706
|
-
($.reactiveElementVersions ??= []).push("2.1.0");
|
|
707
|
-
$.reactiveElementVersions.length > 1 && queueMicrotask(() => {
|
|
708
|
-
v("multiple-versions", "Multiple versions of Lit loaded. Loading multiple versions is not recommended.");
|
|
709
|
-
});
|
|
710
|
-
const b = globalThis, u = (n) => {
|
|
711
|
-
b.emitLitDebugLogEvents && b.dispatchEvent(new CustomEvent("lit-debug", {
|
|
712
|
-
detail: n
|
|
713
|
-
}));
|
|
714
246
|
};
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
createHTML: (n) => n
|
|
723
|
-
}) : void 0, ht = (n) => n, Z = (n, e, t) => ht, pt = (n) => {
|
|
724
|
-
if (O !== Z)
|
|
725
|
-
throw new Error("Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.");
|
|
726
|
-
O = n;
|
|
727
|
-
}, ut = () => {
|
|
728
|
-
O = Z;
|
|
729
|
-
}, ce = (n, e, t) => O(n, e, t), Be = "$lit$", x = `lit$${Math.random().toFixed(9).slice(2)}$`, Fe = "?" + x, ft = `<${Fe}>`, k = document, j = () => k.createComment(""), B = (n) => n === null || typeof n != "object" && typeof n != "function", ge = Array.isArray, mt = (n) => ge(n) || // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
730
|
-
typeof n?.[Symbol.iterator] == "function", se = `[
|
|
731
|
-
\f\r]`, gt = `[^
|
|
732
|
-
\f\r"'\`<>=]`, _t = `[^\\s"'>=/]`, I = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Re = 1, ne = 2, yt = 3, ke = /-->/g, Oe = />/g, U = new RegExp(`>|${se}(?:(${_t}+)(${se}*=${se}*(?:${gt}|("|')|))|$)`, "g"), bt = 0, Ve = 1, $t = 2, Le = 3, re = /'/g, oe = /"/g, qe = /^(?:script|style|textarea|title)$/i, wt = 1, he = 2, pe = 3, _e = 1, J = 2, St = 3, vt = 4, Pt = 5, ye = 6, xt = 7, Tt = (n) => (e, ...t) => (e.some((i) => i === void 0) && console.warn(`Some template strings are undefined.
|
|
733
|
-
This is probably caused by illegal octal escape sequences.`), t.some((i) => i?._$litStatic$) && H("", `Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.
|
|
734
|
-
Please use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions`), {
|
|
735
|
-
// This property needs to remain unminified.
|
|
736
|
-
_$litType$: n,
|
|
737
|
-
strings: e,
|
|
738
|
-
values: t
|
|
739
|
-
}), y = Tt(wt), E = /* @__PURE__ */ Symbol.for("lit-noChange"), m = /* @__PURE__ */ Symbol.for("lit-nothing"), De = /* @__PURE__ */ new WeakMap(), R = k.createTreeWalker(
|
|
740
|
-
k,
|
|
741
|
-
129
|
|
742
|
-
/* NodeFilter.SHOW_{ELEMENT|COMMENT} */
|
|
743
|
-
);
|
|
744
|
-
let O = Z;
|
|
745
|
-
function Ke(n, e) {
|
|
746
|
-
if (!ge(n) || !n.hasOwnProperty("raw")) {
|
|
747
|
-
let t = "invalid template strings array";
|
|
748
|
-
throw t = `
|
|
749
|
-
Internal Error: expected template strings to be an array
|
|
750
|
-
with a 'raw' field. Faking a template strings array by
|
|
751
|
-
calling html or svg like an ordinary function is effectively
|
|
752
|
-
the same as calling unsafeHtml and can lead to major security
|
|
753
|
-
issues, e.g. opening your code up to XSS attacks.
|
|
754
|
-
If you're using the html or svg tagged template functions normally
|
|
755
|
-
and still seeing this error, please file a bug at
|
|
756
|
-
https://github.com/lit/lit/issues/new?template=bug_report.md
|
|
757
|
-
and include information about your build tooling, if any.
|
|
758
|
-
`.trim().replace(/\n */g, `
|
|
759
|
-
`), new Error(t);
|
|
760
|
-
}
|
|
761
|
-
return Ae !== void 0 ? Ae.createHTML(e) : e;
|
|
247
|
+
E.elementStyles = [], E.shadowRootOptions = { mode: "open" }, E[N("elementProperties")] = /* @__PURE__ */ new Map(), E[N("finalized")] = /* @__PURE__ */ new Map(), kt?.({ ReactiveElement: E }), (z.reactiveElementVersions ??= []).push("2.1.0");
|
|
248
|
+
const tt = globalThis, D = tt.trustedTypes, pt = D ? D.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, At = "$lit$", b = `lit$${Math.random().toFixed(9).slice(2)}$`, wt = "?" + b, jt = `<${wt}>`, S = document, H = () => S.createComment(""), L = (r) => r === null || typeof r != "object" && typeof r != "function", et = Array.isArray, Dt = (r) => et(r) || typeof r?.[Symbol.iterator] == "function", q = `[
|
|
249
|
+
\f\r]`, O = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ut = /-->/g, ft = />/g, A = RegExp(`>|${q}(?:([^\\s"'>=/]+)(${q}*=${q}*(?:[^
|
|
250
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), $t = /'/g, gt = /"/g, xt = /^(?:script|style|textarea|title)$/i, It = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), g = It(1), y = /* @__PURE__ */ Symbol.for("lit-noChange"), f = /* @__PURE__ */ Symbol.for("lit-nothing"), mt = /* @__PURE__ */ new WeakMap(), x = S.createTreeWalker(S, 129);
|
|
251
|
+
function St(r, t) {
|
|
252
|
+
if (!et(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
253
|
+
return pt !== void 0 ? pt.createHTML(t) : t;
|
|
762
254
|
}
|
|
763
|
-
const
|
|
764
|
-
const
|
|
765
|
-
let
|
|
766
|
-
for (let
|
|
767
|
-
const
|
|
768
|
-
let
|
|
769
|
-
for (;
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
o = Oe;
|
|
775
|
-
else if (d[ne] !== void 0)
|
|
776
|
-
qe.test(d[ne]) && (r = new RegExp(`</${d[ne]}`, "g")), o = U;
|
|
777
|
-
else if (d[yt] !== void 0)
|
|
778
|
-
throw new Error("Bindings in tag names are not supported. Please use static templates instead. See https://lit.dev/docs/templates/expressions/#static-expressions");
|
|
779
|
-
} else o === U ? d[bt] === ">" ? (o = r ?? I, g = -1) : d[Ve] === void 0 ? g = -2 : (g = o.lastIndex - d[$t].length, p = d[Ve], o = d[Le] === void 0 ? U : d[Le] === '"' ? oe : re) : o === oe || o === re ? o = U : o === ke || o === Oe ? o = I : (o = U, r = void 0);
|
|
780
|
-
console.assert(g === -1 || o === U || o === re || o === oe, "unexpected parse state B");
|
|
781
|
-
const f = o === U && n[a + 1].startsWith("/>") ? " " : "";
|
|
782
|
-
s += o === I ? h + ft : g >= 0 ? (i.push(p), h.slice(0, g) + Be + h.slice(g) + x + f) : h + x + (g === -2 ? a : f);
|
|
783
|
-
}
|
|
784
|
-
const l = s + (n[t] || "<?>") + (e === he ? "</svg>" : e === pe ? "</math>" : "");
|
|
785
|
-
return [Ke(n, l), i];
|
|
255
|
+
const zt = (r, t) => {
|
|
256
|
+
const e = r.length - 1, s = [];
|
|
257
|
+
let i, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = O;
|
|
258
|
+
for (let h = 0; h < e; h++) {
|
|
259
|
+
const a = r[h];
|
|
260
|
+
let d, u, l = -1, p = 0;
|
|
261
|
+
for (; p < a.length && (n.lastIndex = p, u = n.exec(a), u !== null); ) p = n.lastIndex, n === O ? u[1] === "!--" ? n = ut : u[1] !== void 0 ? n = ft : u[2] !== void 0 ? (xt.test(u[2]) && (i = RegExp("</" + u[2], "g")), n = A) : u[3] !== void 0 && (n = A) : n === A ? u[0] === ">" ? (n = i ?? O, l = -1) : u[1] === void 0 ? l = -2 : (l = n.lastIndex - u[2].length, d = u[1], n = u[3] === void 0 ? A : u[3] === '"' ? gt : $t) : n === gt || n === $t ? n = A : n === ut || n === ft ? n = O : (n = A, i = void 0);
|
|
262
|
+
const c = n === A && r[h + 1].startsWith("/>") ? " " : "";
|
|
263
|
+
o += n === O ? a + jt : l >= 0 ? (s.push(d), a.slice(0, l) + At + a.slice(l) + b + c) : a + b + (l === -2 ? h : c);
|
|
264
|
+
}
|
|
265
|
+
return [St(r, o + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
786
266
|
};
|
|
787
|
-
class
|
|
788
|
-
constructor({ strings:
|
|
267
|
+
class R {
|
|
268
|
+
constructor({ strings: t, _$litType$: e }, s) {
|
|
269
|
+
let i;
|
|
789
270
|
this.parts = [];
|
|
790
|
-
let
|
|
791
|
-
const
|
|
792
|
-
if (this.el =
|
|
793
|
-
const
|
|
794
|
-
|
|
271
|
+
let o = 0, n = 0;
|
|
272
|
+
const h = t.length - 1, a = this.parts, [d, u] = zt(t, e);
|
|
273
|
+
if (this.el = R.createElement(d, s), x.currentNode = this.el.content, e === 2 || e === 3) {
|
|
274
|
+
const l = this.el.content.firstChild;
|
|
275
|
+
l.replaceWith(...l.childNodes);
|
|
795
276
|
}
|
|
796
|
-
for (; (
|
|
797
|
-
if (
|
|
798
|
-
{
|
|
799
|
-
const p =
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
277
|
+
for (; (i = x.nextNode()) !== null && a.length < h; ) {
|
|
278
|
+
if (i.nodeType === 1) {
|
|
279
|
+
if (i.hasAttributes()) for (const l of i.getAttributeNames()) if (l.endsWith(At)) {
|
|
280
|
+
const p = u[n++], c = i.getAttribute(l).split(b), $ = /([.?@])?(.*)/.exec(p);
|
|
281
|
+
a.push({ type: 1, index: o, name: $[2], strings: c, ctor: $[1] === "." ? Vt : $[1] === "?" ? Wt : $[1] === "@" ? qt : B }), i.removeAttribute(l);
|
|
282
|
+
} else l.startsWith(b) && (a.push({ type: 6, index: o }), i.removeAttribute(l));
|
|
283
|
+
if (xt.test(i.tagName)) {
|
|
284
|
+
const l = i.textContent.split(b), p = l.length - 1;
|
|
285
|
+
if (p > 0) {
|
|
286
|
+
i.textContent = D ? D.emptyScript : "";
|
|
287
|
+
for (let c = 0; c < p; c++) i.append(l[c], H()), x.nextNode(), a.push({ type: 2, index: ++o });
|
|
288
|
+
i.append(l[p], H());
|
|
805
289
|
}
|
|
806
290
|
}
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
index: r,
|
|
814
|
-
name: _[2],
|
|
815
|
-
strings: f,
|
|
816
|
-
ctor: _[1] === "." ? Nt : _[1] === "?" ? Mt : _[1] === "@" ? Ut : ee
|
|
817
|
-
}), s.removeAttribute(p);
|
|
818
|
-
} else p.startsWith(x) && (a.push({
|
|
819
|
-
type: ye,
|
|
820
|
-
index: r
|
|
821
|
-
}), s.removeAttribute(p));
|
|
822
|
-
if (qe.test(s.tagName)) {
|
|
823
|
-
const p = s.textContent.split(x), c = p.length - 1;
|
|
824
|
-
if (c > 0) {
|
|
825
|
-
s.textContent = Y ? Y.emptyScript : "";
|
|
826
|
-
for (let d = 0; d < c; d++)
|
|
827
|
-
s.append(p[d], j()), R.nextNode(), a.push({ type: J, index: ++r });
|
|
828
|
-
s.append(p[c], j());
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
} else if (s.nodeType === 8)
|
|
832
|
-
if (s.data === Fe)
|
|
833
|
-
a.push({ type: J, index: r });
|
|
834
|
-
else {
|
|
835
|
-
let c = -1;
|
|
836
|
-
for (; (c = s.data.indexOf(x, c + 1)) !== -1; )
|
|
837
|
-
a.push({ type: xt, index: r }), c += x.length - 1;
|
|
838
|
-
}
|
|
839
|
-
r++;
|
|
291
|
+
} else if (i.nodeType === 8) if (i.data === wt) a.push({ type: 2, index: o });
|
|
292
|
+
else {
|
|
293
|
+
let l = -1;
|
|
294
|
+
for (; (l = i.data.indexOf(b, l + 1)) !== -1; ) a.push({ type: 7, index: o }), l += b.length - 1;
|
|
295
|
+
}
|
|
296
|
+
o++;
|
|
840
297
|
}
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
template: this,
|
|
846
|
-
clonableTemplate: this.el,
|
|
847
|
-
parts: this.parts,
|
|
848
|
-
strings: e
|
|
849
|
-
});
|
|
850
|
-
}
|
|
851
|
-
// Overridden via `litHtmlPolyfillSupport` to provide platform support.
|
|
852
|
-
/** @nocollapse */
|
|
853
|
-
static createElement(e, t) {
|
|
854
|
-
const i = k.createElement("template");
|
|
855
|
-
return i.innerHTML = e, i;
|
|
298
|
+
}
|
|
299
|
+
static createElement(t, e) {
|
|
300
|
+
const s = S.createElement("template");
|
|
301
|
+
return s.innerHTML = t, s;
|
|
856
302
|
}
|
|
857
303
|
}
|
|
858
|
-
function
|
|
859
|
-
if (
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
// This property needs to remain unminified.
|
|
864
|
-
e._$litDirective$
|
|
865
|
-
);
|
|
866
|
-
return s?.constructor !== r && (s?._$notifyDirectiveConnectionChanged?.(!1), r === void 0 ? s = void 0 : (s = new r(n), s._$initialize(n, t, i)), i !== void 0 ? (t.__directives ??= [])[i] = s : t.__directive = s), s !== void 0 && (e = L(n, s._$resolve(n, e.values), s, i)), e;
|
|
304
|
+
function P(r, t, e = r, s) {
|
|
305
|
+
if (t === y) return t;
|
|
306
|
+
let i = s !== void 0 ? e._$Co?.[s] : e._$Cl;
|
|
307
|
+
const o = L(t) ? void 0 : t._$litDirective$;
|
|
308
|
+
return i?.constructor !== o && (i?._$AO?.(!1), o === void 0 ? i = void 0 : (i = new o(r), i._$AT(r, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = i : e._$Cl = i), i !== void 0 && (t = P(r, i._$AS(r, t.values), i, s)), t;
|
|
867
309
|
}
|
|
868
|
-
class
|
|
869
|
-
constructor(
|
|
870
|
-
this._$
|
|
310
|
+
let Bt = class {
|
|
311
|
+
constructor(t, e) {
|
|
312
|
+
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
871
313
|
}
|
|
872
|
-
// Called by ChildPart parentNode getter
|
|
873
314
|
get parentNode() {
|
|
874
|
-
return this._$
|
|
875
|
-
}
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
const { el: { content: t }, parts: i } = this._$template, s = (e?.creationScope ?? k).importNode(t, !0);
|
|
884
|
-
R.currentNode = s;
|
|
885
|
-
let r = R.nextNode(), o = 0, l = 0, a = i[0];
|
|
315
|
+
return this._$AM.parentNode;
|
|
316
|
+
}
|
|
317
|
+
get _$AU() {
|
|
318
|
+
return this._$AM._$AU;
|
|
319
|
+
}
|
|
320
|
+
u(t) {
|
|
321
|
+
const { el: { content: e }, parts: s } = this._$AD, i = (t?.creationScope ?? S).importNode(e, !0);
|
|
322
|
+
x.currentNode = i;
|
|
323
|
+
let o = x.nextNode(), n = 0, h = 0, a = s[0];
|
|
886
324
|
for (; a !== void 0; ) {
|
|
887
|
-
if (
|
|
888
|
-
let
|
|
889
|
-
a.type ===
|
|
325
|
+
if (n === a.index) {
|
|
326
|
+
let d;
|
|
327
|
+
a.type === 2 ? d = new U(o, o.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(o, a.name, a.strings, this, t) : a.type === 6 && (d = new Ft(o, this, t)), this._$AV.push(d), a = s[++h];
|
|
890
328
|
}
|
|
891
|
-
|
|
329
|
+
n !== a?.index && (o = x.nextNode(), n++);
|
|
892
330
|
}
|
|
893
|
-
return
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
let
|
|
897
|
-
for (const
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
331
|
+
return x.currentNode = S, i;
|
|
332
|
+
}
|
|
333
|
+
p(t) {
|
|
334
|
+
let e = 0;
|
|
335
|
+
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
class U {
|
|
339
|
+
get _$AU() {
|
|
340
|
+
return this._$AM?._$AU ?? this._$Cv;
|
|
341
|
+
}
|
|
342
|
+
constructor(t, e, s, i) {
|
|
343
|
+
this.type = 2, this._$AH = f, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = i?.isConnected ?? !0;
|
|
906
344
|
}
|
|
907
|
-
}
|
|
908
|
-
let X = class Ge {
|
|
909
|
-
// See comment in Disconnectable interface for why this is a getter
|
|
910
|
-
get _$isConnected() {
|
|
911
|
-
return this._$parent?._$isConnected ?? this.__isConnected;
|
|
912
|
-
}
|
|
913
|
-
constructor(e, t, i, s) {
|
|
914
|
-
this.type = J, this._$committedValue = m, this._$disconnectableChildren = void 0, this._$startNode = e, this._$endNode = t, this._$parent = i, this.options = s, this.__isConnected = s?.isConnected ?? !0, this._textSanitizer = void 0;
|
|
915
|
-
}
|
|
916
|
-
/**
|
|
917
|
-
* The parent node into which the part renders its content.
|
|
918
|
-
*
|
|
919
|
-
* A ChildPart's content consists of a range of adjacent child nodes of
|
|
920
|
-
* `.parentNode`, possibly bordered by 'marker nodes' (`.startNode` and
|
|
921
|
-
* `.endNode`).
|
|
922
|
-
*
|
|
923
|
-
* - If both `.startNode` and `.endNode` are non-null, then the part's content
|
|
924
|
-
* consists of all siblings between `.startNode` and `.endNode`, exclusively.
|
|
925
|
-
*
|
|
926
|
-
* - If `.startNode` is non-null but `.endNode` is null, then the part's
|
|
927
|
-
* content consists of all siblings following `.startNode`, up to and
|
|
928
|
-
* including the last child of `.parentNode`. If `.endNode` is non-null, then
|
|
929
|
-
* `.startNode` will always be non-null.
|
|
930
|
-
*
|
|
931
|
-
* - If both `.endNode` and `.startNode` are null, then the part's content
|
|
932
|
-
* consists of all child nodes of `.parentNode`.
|
|
933
|
-
*/
|
|
934
345
|
get parentNode() {
|
|
935
|
-
let
|
|
936
|
-
const
|
|
937
|
-
return
|
|
938
|
-
}
|
|
939
|
-
/**
|
|
940
|
-
* The part's leading marker node, if any. See `.parentNode` for more
|
|
941
|
-
* information.
|
|
942
|
-
*/
|
|
346
|
+
let t = this._$AA.parentNode;
|
|
347
|
+
const e = this._$AM;
|
|
348
|
+
return e !== void 0 && t?.nodeType === 11 && (t = e.parentNode), t;
|
|
349
|
+
}
|
|
943
350
|
get startNode() {
|
|
944
|
-
return this._$
|
|
351
|
+
return this._$AA;
|
|
945
352
|
}
|
|
946
|
-
/**
|
|
947
|
-
* The part's trailing marker node, if any. See `.parentNode` for more
|
|
948
|
-
* information.
|
|
949
|
-
*/
|
|
950
353
|
get endNode() {
|
|
951
|
-
return this._$
|
|
952
|
-
}
|
|
953
|
-
_$setValue(e, t = this) {
|
|
954
|
-
if (this.parentNode === null)
|
|
955
|
-
throw new Error("This `ChildPart` has no `parentNode` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's `innerHTML` or `textContent` can do this.");
|
|
956
|
-
if (e = L(this, e, t), B(e))
|
|
957
|
-
e === m || e == null || e === "" ? (this._$committedValue !== m && (u && u({
|
|
958
|
-
kind: "commit nothing to child",
|
|
959
|
-
start: this._$startNode,
|
|
960
|
-
end: this._$endNode,
|
|
961
|
-
parent: this._$parent,
|
|
962
|
-
options: this.options
|
|
963
|
-
}), this._$clear()), this._$committedValue = m) : e !== this._$committedValue && e !== E && this._commitText(e);
|
|
964
|
-
else if (e._$litType$ !== void 0)
|
|
965
|
-
this._commitTemplateResult(e);
|
|
966
|
-
else if (e.nodeType !== void 0) {
|
|
967
|
-
if (this.options?.host === e) {
|
|
968
|
-
this._commitText("[probable mistake: rendered a template's host in itself (commonly caused by writing ${this} in a template]"), console.warn("Attempted to render the template host", e, "inside itself. This is almost always a mistake, and in dev mode ", "we render some warning text. In production however, we'll ", "render it, which will usually result in an error, and sometimes ", "in the element disappearing from the DOM.");
|
|
969
|
-
return;
|
|
970
|
-
}
|
|
971
|
-
this._commitNode(e);
|
|
972
|
-
} else mt(e) ? this._commitIterable(e) : this._commitText(e);
|
|
973
|
-
}
|
|
974
|
-
_insert(e) {
|
|
975
|
-
return S(S(this._$startNode).parentNode).insertBefore(e, this._$endNode);
|
|
976
|
-
}
|
|
977
|
-
_commitNode(e) {
|
|
978
|
-
if (this._$committedValue !== e) {
|
|
979
|
-
if (this._$clear(), O !== Z) {
|
|
980
|
-
const t = this._$startNode.parentNode?.nodeName;
|
|
981
|
-
if (t === "STYLE" || t === "SCRIPT") {
|
|
982
|
-
let i = "Forbidden";
|
|
983
|
-
throw t === "STYLE" ? i = "Lit does not support binding inside style nodes. This is a security risk, as style injection attacks can exfiltrate data and spoof UIs. Consider instead using css`...` literals to compose styles, and do dynamic styling with css custom properties, ::parts, <slot>s, and by mutating the DOM rather than stylesheets." : i = "Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.", new Error(i);
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
u && u({
|
|
987
|
-
kind: "commit node",
|
|
988
|
-
start: this._$startNode,
|
|
989
|
-
parent: this._$parent,
|
|
990
|
-
value: e,
|
|
991
|
-
options: this.options
|
|
992
|
-
}), this._$committedValue = this._insert(e);
|
|
993
|
-
}
|
|
354
|
+
return this._$AB;
|
|
994
355
|
}
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
options: this.options
|
|
1011
|
-
}), t.data = e;
|
|
1012
|
-
}
|
|
1013
|
-
this._$committedValue = e;
|
|
1014
|
-
}
|
|
1015
|
-
_commitTemplateResult(e) {
|
|
1016
|
-
const { values: t, ["_$litType$"]: i } = e, s = typeof i == "number" ? this._$getTemplate(e) : (i.el === void 0 && (i.el = F.createElement(Ke(i.h, i.h[0]), this.options)), i);
|
|
1017
|
-
if (this._$committedValue?._$template === s)
|
|
1018
|
-
u && u({
|
|
1019
|
-
kind: "template updating",
|
|
1020
|
-
template: s,
|
|
1021
|
-
instance: this._$committedValue,
|
|
1022
|
-
parts: this._$committedValue._$parts,
|
|
1023
|
-
options: this.options,
|
|
1024
|
-
values: t
|
|
1025
|
-
}), this._$committedValue._update(t);
|
|
356
|
+
_$AI(t, e = this) {
|
|
357
|
+
t = P(this, t, e), L(t) ? t === f || t == null || t === "" ? (this._$AH !== f && this._$AR(), this._$AH = f) : t !== this._$AH && t !== y && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Dt(t) ? this.k(t) : this._(t);
|
|
358
|
+
}
|
|
359
|
+
O(t) {
|
|
360
|
+
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
361
|
+
}
|
|
362
|
+
T(t) {
|
|
363
|
+
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
364
|
+
}
|
|
365
|
+
_(t) {
|
|
366
|
+
this._$AH !== f && L(this._$AH) ? this._$AA.nextSibling.data = t : this.T(S.createTextNode(t)), this._$AH = t;
|
|
367
|
+
}
|
|
368
|
+
$(t) {
|
|
369
|
+
const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = R.createElement(St(s.h, s.h[0]), this.options)), s);
|
|
370
|
+
if (this._$AH?._$AD === i) this._$AH.p(e);
|
|
1026
371
|
else {
|
|
1027
|
-
const
|
|
1028
|
-
|
|
1029
|
-
kind: "template instantiated",
|
|
1030
|
-
template: s,
|
|
1031
|
-
instance: r,
|
|
1032
|
-
parts: r._$parts,
|
|
1033
|
-
options: this.options,
|
|
1034
|
-
fragment: o,
|
|
1035
|
-
values: t
|
|
1036
|
-
}), r._update(t), u && u({
|
|
1037
|
-
kind: "template instantiated and updated",
|
|
1038
|
-
template: s,
|
|
1039
|
-
instance: r,
|
|
1040
|
-
parts: r._$parts,
|
|
1041
|
-
options: this.options,
|
|
1042
|
-
fragment: o,
|
|
1043
|
-
values: t
|
|
1044
|
-
}), this._commitNode(o), this._$committedValue = r;
|
|
372
|
+
const o = new Bt(i, this), n = o.u(this.options);
|
|
373
|
+
o.p(e), this.T(n), this._$AH = o;
|
|
1045
374
|
}
|
|
1046
375
|
}
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
const t = this._$
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
* Removes the nodes contained within this Part from the DOM.
|
|
1063
|
-
*
|
|
1064
|
-
* @param start Start node to clear from, for clearing a subset of the part's
|
|
1065
|
-
* DOM (used when truncating iterables)
|
|
1066
|
-
* @param from When `start` is specified, the index within the iterable from
|
|
1067
|
-
* which ChildParts are being removed, used for disconnecting directives in
|
|
1068
|
-
* those Parts.
|
|
1069
|
-
*
|
|
1070
|
-
* @internal
|
|
1071
|
-
*/
|
|
1072
|
-
_$clear(e = S(this._$startNode).nextSibling, t) {
|
|
1073
|
-
for (this._$notifyConnectionChanged?.(!1, !0, t); e && e !== this._$endNode; ) {
|
|
1074
|
-
const i = S(e).nextSibling;
|
|
1075
|
-
S(e).remove(), e = i;
|
|
376
|
+
_$AC(t) {
|
|
377
|
+
let e = mt.get(t.strings);
|
|
378
|
+
return e === void 0 && mt.set(t.strings, e = new R(t)), e;
|
|
379
|
+
}
|
|
380
|
+
k(t) {
|
|
381
|
+
et(this._$AH) || (this._$AH = [], this._$AR());
|
|
382
|
+
const e = this._$AH;
|
|
383
|
+
let s, i = 0;
|
|
384
|
+
for (const o of t) i === e.length ? e.push(s = new U(this.O(H()), this.O(H()), this, this.options)) : s = e[i], s._$AI(o), i++;
|
|
385
|
+
i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
|
|
386
|
+
}
|
|
387
|
+
_$AR(t = this._$AA.nextSibling, e) {
|
|
388
|
+
for (this._$AP?.(!1, !0, e); t && t !== this._$AB; ) {
|
|
389
|
+
const s = t.nextSibling;
|
|
390
|
+
t.remove(), t = s;
|
|
1076
391
|
}
|
|
1077
392
|
}
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
* should only be called on `RootPart`s (the `ChildPart` returned from a
|
|
1081
|
-
* top-level `render()` call). It has no effect on non-root ChildParts.
|
|
1082
|
-
* @param isConnected Whether to set
|
|
1083
|
-
* @internal
|
|
1084
|
-
*/
|
|
1085
|
-
setConnected(e) {
|
|
1086
|
-
if (this._$parent === void 0)
|
|
1087
|
-
this.__isConnected = e, this._$notifyConnectionChanged?.(e);
|
|
1088
|
-
else
|
|
1089
|
-
throw new Error("part.setConnected() may only be called on a RootPart returned from render().");
|
|
393
|
+
setConnected(t) {
|
|
394
|
+
this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
|
|
1090
395
|
}
|
|
1091
|
-
}
|
|
1092
|
-
class
|
|
396
|
+
}
|
|
397
|
+
class B {
|
|
1093
398
|
get tagName() {
|
|
1094
399
|
return this.element.tagName;
|
|
1095
400
|
}
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
* If this part is single-valued, `this._strings` will be undefined, and the
|
|
1107
|
-
* method will be called with a single value argument. If this part is
|
|
1108
|
-
* multi-value, `this._strings` will be defined, and the method is called
|
|
1109
|
-
* with the value array of the part's owning TemplateInstance, and an offset
|
|
1110
|
-
* into the value array from which the values should be read.
|
|
1111
|
-
* This method is overloaded this way to eliminate short-lived array slices
|
|
1112
|
-
* of the template instance values, and allow a fast-path for single-valued
|
|
1113
|
-
* parts.
|
|
1114
|
-
*
|
|
1115
|
-
* @param value The part value, or an array of values for multi-valued parts
|
|
1116
|
-
* @param valueIndex the index to start reading values from. `undefined` for
|
|
1117
|
-
* single-valued parts
|
|
1118
|
-
* @param noCommit causes the part to not commit its value to the DOM. Used
|
|
1119
|
-
* in hydration to prime attribute parts with their first-rendered value,
|
|
1120
|
-
* but not set the attribute, and in SSR to no-op the DOM operation and
|
|
1121
|
-
* capture the value for serialization.
|
|
1122
|
-
*
|
|
1123
|
-
* @internal
|
|
1124
|
-
*/
|
|
1125
|
-
_$setValue(e, t = this, i, s) {
|
|
1126
|
-
const r = this.strings;
|
|
1127
|
-
let o = !1;
|
|
1128
|
-
if (r === void 0)
|
|
1129
|
-
e = L(this, e, t, 0), o = !B(e) || e !== this._$committedValue && e !== E, o && (this._$committedValue = e);
|
|
401
|
+
get _$AU() {
|
|
402
|
+
return this._$AM._$AU;
|
|
403
|
+
}
|
|
404
|
+
constructor(t, e, s, i, o) {
|
|
405
|
+
this.type = 1, this._$AH = f, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = f;
|
|
406
|
+
}
|
|
407
|
+
_$AI(t, e = this, s, i) {
|
|
408
|
+
const o = this.strings;
|
|
409
|
+
let n = !1;
|
|
410
|
+
if (o === void 0) t = P(this, t, e, 0), n = !L(t) || t !== this._$AH && t !== y, n && (this._$AH = t);
|
|
1130
411
|
else {
|
|
1131
|
-
const
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
for (a = 0; a < r.length - 1; a++)
|
|
1135
|
-
h = L(this, l[i + a], t, a), h === E && (h = this._$committedValue[a]), o ||= !B(h) || h !== this._$committedValue[a], h === m ? e = m : e !== m && (e += (h ?? "") + r[a + 1]), this._$committedValue[a] = h;
|
|
412
|
+
const h = t;
|
|
413
|
+
let a, d;
|
|
414
|
+
for (t = o[0], a = 0; a < o.length - 1; a++) d = P(this, h[s + a], e, a), d === y && (d = this._$AH[a]), n ||= !L(d) || d !== this._$AH[a], d === f ? t = f : t !== f && (t += (d ?? "") + o[a + 1]), this._$AH[a] = d;
|
|
1136
415
|
}
|
|
1137
|
-
|
|
1138
|
-
}
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
e === m ? S(this.element).removeAttribute(this.name) : (this._sanitizer === void 0 && (this._sanitizer = O(this.element, this.name, "attribute")), e = this._sanitizer(e ?? ""), u && u({
|
|
1142
|
-
kind: "commit attribute",
|
|
1143
|
-
element: this.element,
|
|
1144
|
-
name: this.name,
|
|
1145
|
-
value: e,
|
|
1146
|
-
options: this.options
|
|
1147
|
-
}), S(this.element).setAttribute(this.name, e ?? ""));
|
|
416
|
+
n && !i && this.j(t);
|
|
417
|
+
}
|
|
418
|
+
j(t) {
|
|
419
|
+
t === f ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
1148
420
|
}
|
|
1149
421
|
}
|
|
1150
|
-
class
|
|
422
|
+
class Vt extends B {
|
|
1151
423
|
constructor() {
|
|
1152
|
-
super(...arguments), this.type =
|
|
1153
|
-
}
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
this._sanitizer === void 0 && (this._sanitizer = O(this.element, this.name, "property")), e = this._sanitizer(e), u && u({
|
|
1157
|
-
kind: "commit property",
|
|
1158
|
-
element: this.element,
|
|
1159
|
-
name: this.name,
|
|
1160
|
-
value: e,
|
|
1161
|
-
options: this.options
|
|
1162
|
-
}), this.element[this.name] = e === m ? void 0 : e;
|
|
424
|
+
super(...arguments), this.type = 3;
|
|
425
|
+
}
|
|
426
|
+
j(t) {
|
|
427
|
+
this.element[this.name] = t === f ? void 0 : t;
|
|
1163
428
|
}
|
|
1164
429
|
}
|
|
1165
|
-
class
|
|
430
|
+
class Wt extends B {
|
|
1166
431
|
constructor() {
|
|
1167
|
-
super(...arguments), this.type =
|
|
1168
|
-
}
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
u && u({
|
|
1172
|
-
kind: "commit boolean attribute",
|
|
1173
|
-
element: this.element,
|
|
1174
|
-
name: this.name,
|
|
1175
|
-
value: !!(e && e !== m),
|
|
1176
|
-
options: this.options
|
|
1177
|
-
}), S(this.element).toggleAttribute(this.name, !!e && e !== m);
|
|
432
|
+
super(...arguments), this.type = 4;
|
|
433
|
+
}
|
|
434
|
+
j(t) {
|
|
435
|
+
this.element.toggleAttribute(this.name, !!t && t !== f);
|
|
1178
436
|
}
|
|
1179
437
|
}
|
|
1180
|
-
class
|
|
1181
|
-
constructor(e,
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
const i = this._$committedValue, s = e === m && i !== m || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, r = e !== m && (i === m || s);
|
|
1192
|
-
u && u({
|
|
1193
|
-
kind: "commit event listener",
|
|
1194
|
-
element: this.element,
|
|
1195
|
-
name: this.name,
|
|
1196
|
-
value: e,
|
|
1197
|
-
options: this.options,
|
|
1198
|
-
removeListener: s,
|
|
1199
|
-
addListener: r,
|
|
1200
|
-
oldListener: i
|
|
1201
|
-
}), s && this.element.removeEventListener(this.name, this, i), r && this.element.addEventListener(this.name, this, e), this._$committedValue = e;
|
|
1202
|
-
}
|
|
1203
|
-
handleEvent(e) {
|
|
1204
|
-
typeof this._$committedValue == "function" ? this._$committedValue.call(this.options?.host ?? this.element, e) : this._$committedValue.handleEvent(e);
|
|
438
|
+
class qt extends B {
|
|
439
|
+
constructor(t, e, s, i, o) {
|
|
440
|
+
super(t, e, s, i, o), this.type = 5;
|
|
441
|
+
}
|
|
442
|
+
_$AI(t, e = this) {
|
|
443
|
+
if ((t = P(this, t, e, 0) ?? f) === y) return;
|
|
444
|
+
const s = this._$AH, i = t === f && s !== f || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== f && (s === f || i);
|
|
445
|
+
i && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
446
|
+
}
|
|
447
|
+
handleEvent(t) {
|
|
448
|
+
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
1205
449
|
}
|
|
1206
450
|
}
|
|
1207
|
-
class
|
|
1208
|
-
constructor(
|
|
1209
|
-
this.element =
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
u && u({
|
|
1217
|
-
kind: "commit to element binding",
|
|
1218
|
-
element: this.element,
|
|
1219
|
-
value: e,
|
|
1220
|
-
options: this.options
|
|
1221
|
-
}), L(this, e);
|
|
451
|
+
class Ft {
|
|
452
|
+
constructor(t, e, s) {
|
|
453
|
+
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
|
454
|
+
}
|
|
455
|
+
get _$AU() {
|
|
456
|
+
return this._$AM._$AU;
|
|
457
|
+
}
|
|
458
|
+
_$AI(t) {
|
|
459
|
+
P(this, t);
|
|
1222
460
|
}
|
|
1223
461
|
}
|
|
1224
|
-
const
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
});
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
throw new TypeError(`The container to render into may not be ${e}`);
|
|
1235
|
-
const i = ct++, s = t?.renderBefore ?? e;
|
|
1236
|
-
let r = s._$litPart$;
|
|
1237
|
-
if (u && u({
|
|
1238
|
-
kind: "begin render",
|
|
1239
|
-
id: i,
|
|
1240
|
-
value: n,
|
|
1241
|
-
container: e,
|
|
1242
|
-
options: t,
|
|
1243
|
-
part: r
|
|
1244
|
-
}), r === void 0) {
|
|
1245
|
-
const o = t?.renderBefore ?? null;
|
|
1246
|
-
s._$litPart$ = r = new X(e.insertBefore(j(), o), o, void 0, t ?? {});
|
|
1247
|
-
}
|
|
1248
|
-
return r._$setValue(n), u && u({
|
|
1249
|
-
kind: "end render",
|
|
1250
|
-
id: i,
|
|
1251
|
-
value: n,
|
|
1252
|
-
container: e,
|
|
1253
|
-
options: t,
|
|
1254
|
-
part: r
|
|
1255
|
-
}), r;
|
|
462
|
+
const Zt = { I: U }, Xt = tt.litHtmlPolyfillSupport;
|
|
463
|
+
Xt?.(R, U), (tt.litHtmlVersions ??= []).push("3.3.0");
|
|
464
|
+
const Yt = (r, t, e) => {
|
|
465
|
+
const s = e?.renderBefore ?? t;
|
|
466
|
+
let i = s._$litPart$;
|
|
467
|
+
if (i === void 0) {
|
|
468
|
+
const o = e?.renderBefore ?? null;
|
|
469
|
+
s._$litPart$ = i = new U(t.insertBefore(H(), o), o, void 0, e ?? {});
|
|
470
|
+
}
|
|
471
|
+
return i._$AI(r), i;
|
|
1256
472
|
};
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
let Ye;
|
|
1260
|
-
M.litIssuedWarnings ??= /* @__PURE__ */ new Set(), Ye = (n, e) => {
|
|
1261
|
-
e += ` See https://lit.dev/msg/${n} for more information.`, !M.litIssuedWarnings.has(e) && !M.litIssuedWarnings.has(n) && (console.warn(e), M.litIssuedWarnings.add(e));
|
|
1262
|
-
};
|
|
1263
|
-
class D extends C {
|
|
473
|
+
const st = globalThis;
|
|
474
|
+
let C = class extends E {
|
|
1264
475
|
constructor() {
|
|
1265
|
-
super(...arguments), this.renderOptions = { host: this }, this.
|
|
476
|
+
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
1266
477
|
}
|
|
1267
|
-
/**
|
|
1268
|
-
* @category rendering
|
|
1269
|
-
*/
|
|
1270
478
|
createRenderRoot() {
|
|
1271
|
-
const
|
|
1272
|
-
return this.renderOptions.renderBefore ??=
|
|
1273
|
-
}
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
* @param changedProperties Map of changed properties with old values
|
|
1279
|
-
* @category updates
|
|
1280
|
-
*/
|
|
1281
|
-
update(e) {
|
|
1282
|
-
const t = this.render();
|
|
1283
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this.__childPart = K(t, this.renderRoot, this.renderOptions);
|
|
1284
|
-
}
|
|
1285
|
-
/**
|
|
1286
|
-
* Invoked when the component is added to the document's DOM.
|
|
1287
|
-
*
|
|
1288
|
-
* In `connectedCallback()` you should setup tasks that should only occur when
|
|
1289
|
-
* the element is connected to the document. The most common of these is
|
|
1290
|
-
* adding event listeners to nodes external to the element, like a keydown
|
|
1291
|
-
* event handler added to the window.
|
|
1292
|
-
*
|
|
1293
|
-
* ```ts
|
|
1294
|
-
* connectedCallback() {
|
|
1295
|
-
* super.connectedCallback();
|
|
1296
|
-
* addEventListener('keydown', this._handleKeydown);
|
|
1297
|
-
* }
|
|
1298
|
-
* ```
|
|
1299
|
-
*
|
|
1300
|
-
* Typically, anything done in `connectedCallback()` should be undone when the
|
|
1301
|
-
* element is disconnected, in `disconnectedCallback()`.
|
|
1302
|
-
*
|
|
1303
|
-
* @category lifecycle
|
|
1304
|
-
*/
|
|
479
|
+
const t = super.createRenderRoot();
|
|
480
|
+
return this.renderOptions.renderBefore ??= t.firstChild, t;
|
|
481
|
+
}
|
|
482
|
+
update(t) {
|
|
483
|
+
const e = this.render();
|
|
484
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Yt(e, this.renderRoot, this.renderOptions);
|
|
485
|
+
}
|
|
1305
486
|
connectedCallback() {
|
|
1306
|
-
super.connectedCallback(), this.
|
|
1307
|
-
}
|
|
1308
|
-
/**
|
|
1309
|
-
* Invoked when the component is removed from the document's DOM.
|
|
1310
|
-
*
|
|
1311
|
-
* This callback is the main signal to the element that it may no longer be
|
|
1312
|
-
* used. `disconnectedCallback()` should ensure that nothing is holding a
|
|
1313
|
-
* reference to the element (such as event listeners added to nodes external
|
|
1314
|
-
* to the element), so that it is free to be garbage collected.
|
|
1315
|
-
*
|
|
1316
|
-
* ```ts
|
|
1317
|
-
* disconnectedCallback() {
|
|
1318
|
-
* super.disconnectedCallback();
|
|
1319
|
-
* window.removeEventListener('keydown', this._handleKeydown);
|
|
1320
|
-
* }
|
|
1321
|
-
* ```
|
|
1322
|
-
*
|
|
1323
|
-
* An element may be re-connected after being disconnected.
|
|
1324
|
-
*
|
|
1325
|
-
* @category lifecycle
|
|
1326
|
-
*/
|
|
487
|
+
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
488
|
+
}
|
|
1327
489
|
disconnectedCallback() {
|
|
1328
|
-
super.disconnectedCallback(), this.
|
|
1329
|
-
}
|
|
1330
|
-
/**
|
|
1331
|
-
* Invoked on each update to perform rendering tasks. This method may return
|
|
1332
|
-
* any value renderable by lit-html's `ChildPart` - typically a
|
|
1333
|
-
* `TemplateResult`. Setting properties inside this method will *not* trigger
|
|
1334
|
-
* the element to update.
|
|
1335
|
-
* @category rendering
|
|
1336
|
-
*/
|
|
490
|
+
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
491
|
+
}
|
|
1337
492
|
render() {
|
|
1338
|
-
return
|
|
493
|
+
return y;
|
|
1339
494
|
}
|
|
1340
|
-
}
|
|
1341
|
-
D._$litElement$ = !0;
|
|
1342
|
-
D[Ot("finalized")] = !0;
|
|
1343
|
-
M.litElementHydrateSupport?.({ LitElement: D });
|
|
1344
|
-
const Vt = M.litElementPolyfillSupportDevMode;
|
|
1345
|
-
Vt?.({ LitElement: D });
|
|
1346
|
-
(M.litElementVersions ??= []).push("4.2.0");
|
|
1347
|
-
M.litElementVersions.length > 1 && queueMicrotask(() => {
|
|
1348
|
-
Ye("multiple-versions", "Multiple versions of Lit loaded. Loading multiple versions is not recommended.");
|
|
1349
|
-
});
|
|
1350
|
-
const Lt = (n) => (e, t) => {
|
|
1351
|
-
t !== void 0 ? t.addInitializer(() => {
|
|
1352
|
-
customElements.define(n, e);
|
|
1353
|
-
}) : customElements.define(n, e);
|
|
1354
495
|
};
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
496
|
+
C._$litElement$ = !0, C.finalized = !0, st.litElementHydrateSupport?.({ LitElement: C });
|
|
497
|
+
const Gt = st.litElementPolyfillSupport;
|
|
498
|
+
Gt?.({ LitElement: C });
|
|
499
|
+
(st.litElementVersions ??= []).push("4.2.0");
|
|
500
|
+
const Jt = (r) => (t, e) => {
|
|
501
|
+
e !== void 0 ? e.addInitializer((() => {
|
|
502
|
+
customElements.define(r, t);
|
|
503
|
+
})) : customElements.define(r, t);
|
|
1358
504
|
};
|
|
1359
|
-
const
|
|
1360
|
-
const i = e
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
const a = e.get.call(this);
|
|
1377
|
-
e.set.call(this, l), this.requestUpdate(o, a, n);
|
|
1378
|
-
},
|
|
1379
|
-
init(l) {
|
|
1380
|
-
return l !== void 0 && this._$changeProperty(o, void 0, n, l), l;
|
|
1381
|
-
}
|
|
1382
|
-
};
|
|
1383
|
-
} else if (i === "setter") {
|
|
1384
|
-
const { name: o } = t;
|
|
1385
|
-
return function(l) {
|
|
1386
|
-
const a = this[o];
|
|
1387
|
-
e.call(this, l), this.requestUpdate(o, a, n);
|
|
505
|
+
const Kt = { attribute: !0, type: String, converter: j, reflect: !1, hasChanged: Q }, Qt = (r = Kt, t, e) => {
|
|
506
|
+
const { kind: s, metadata: i } = e;
|
|
507
|
+
let o = globalThis.litPropertyMetadata.get(i);
|
|
508
|
+
if (o === void 0 && globalThis.litPropertyMetadata.set(i, o = /* @__PURE__ */ new Map()), s === "setter" && ((r = Object.create(r)).wrapped = !0), o.set(e.name, r), s === "accessor") {
|
|
509
|
+
const { name: n } = e;
|
|
510
|
+
return { set(h) {
|
|
511
|
+
const a = t.get.call(this);
|
|
512
|
+
t.set.call(this, h), this.requestUpdate(n, a, r);
|
|
513
|
+
}, init(h) {
|
|
514
|
+
return h !== void 0 && this.C(n, void 0, r, h), h;
|
|
515
|
+
} };
|
|
516
|
+
}
|
|
517
|
+
if (s === "setter") {
|
|
518
|
+
const { name: n } = e;
|
|
519
|
+
return function(h) {
|
|
520
|
+
const a = this[n];
|
|
521
|
+
t.call(this, h), this.requestUpdate(n, a, r);
|
|
1388
522
|
};
|
|
1389
523
|
}
|
|
1390
|
-
throw
|
|
524
|
+
throw Error("Unsupported decorator location: " + s);
|
|
1391
525
|
};
|
|
1392
|
-
function
|
|
1393
|
-
return (
|
|
526
|
+
function V(r) {
|
|
527
|
+
return (t, e) => typeof e == "object" ? Qt(r, t, e) : ((s, i, o) => {
|
|
528
|
+
const n = i.hasOwnProperty(o);
|
|
529
|
+
return i.constructor.createProperty(o, s), n ? Object.getOwnPropertyDescriptor(i, o) : void 0;
|
|
530
|
+
})(r, t, e);
|
|
1394
531
|
}
|
|
1395
|
-
function
|
|
1396
|
-
return
|
|
1397
|
-
...n,
|
|
1398
|
-
// Add both `state` and `attribute` because we found a third party
|
|
1399
|
-
// controller that is keying off of PropertyOptions.state to determine
|
|
1400
|
-
// whether a field is a private internal property or not.
|
|
1401
|
-
state: !0,
|
|
1402
|
-
attribute: !1
|
|
1403
|
-
});
|
|
532
|
+
function T(r) {
|
|
533
|
+
return V({ ...r, state: !0, attribute: !1 });
|
|
1404
534
|
}
|
|
1405
|
-
const
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
get() {
|
|
1414
|
-
return r(this);
|
|
1415
|
-
}
|
|
1416
|
-
});
|
|
1417
|
-
});
|
|
535
|
+
const te = (r, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(r, t, e), e);
|
|
536
|
+
function ee(r, t) {
|
|
537
|
+
return (e, s, i) => {
|
|
538
|
+
const o = (n) => n.renderRoot?.querySelector(r) ?? null;
|
|
539
|
+
return te(e, s, { get() {
|
|
540
|
+
return o(this);
|
|
541
|
+
} });
|
|
542
|
+
};
|
|
1418
543
|
}
|
|
1419
|
-
const
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
}, $e = (n) => (...e) => ({
|
|
1423
|
-
// This property needs to remain unminified.
|
|
1424
|
-
_$litDirective$: n,
|
|
1425
|
-
values: e
|
|
1426
|
-
});
|
|
1427
|
-
class we {
|
|
1428
|
-
constructor(e) {
|
|
544
|
+
const it = { ATTRIBUTE: 1, CHILD: 2 }, rt = (r) => (...t) => ({ _$litDirective$: r, values: t });
|
|
545
|
+
let ot = class {
|
|
546
|
+
constructor(t) {
|
|
1429
547
|
}
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
return this._$parent._$isConnected;
|
|
548
|
+
get _$AU() {
|
|
549
|
+
return this._$AM._$AU;
|
|
1433
550
|
}
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
this.__part = e, this._$parent = t, this.__attributeIndex = i;
|
|
551
|
+
_$AT(t, e, s) {
|
|
552
|
+
this._$Ct = t, this._$AM = e, this._$Ci = s;
|
|
1437
553
|
}
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
return this.update(e, t);
|
|
554
|
+
_$AS(t, e) {
|
|
555
|
+
return this.update(t, e);
|
|
1441
556
|
}
|
|
1442
|
-
update(
|
|
1443
|
-
return this.render(...
|
|
557
|
+
update(t, e) {
|
|
558
|
+
return this.render(...e);
|
|
1444
559
|
}
|
|
1445
|
-
}
|
|
1446
|
-
const
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
const
|
|
1460
|
-
if (this._previousStyleProperties === void 0)
|
|
1461
|
-
return this._previousStyleProperties = new Set(Object.keys(t)), this.render(t);
|
|
1462
|
-
for (const s of this._previousStyleProperties)
|
|
1463
|
-
t[s] == null && (this._previousStyleProperties.delete(s), s.includes("-") ? i.removeProperty(s) : i[s] = null);
|
|
560
|
+
};
|
|
561
|
+
const Et = "important", se = " !" + Et, F = rt(class extends ot {
|
|
562
|
+
constructor(r) {
|
|
563
|
+
if (super(r), r.type !== it.ATTRIBUTE || r.name !== "style" || r.strings?.length > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
|
|
564
|
+
}
|
|
565
|
+
render(r) {
|
|
566
|
+
return Object.keys(r).reduce(((t, e) => {
|
|
567
|
+
const s = r[e];
|
|
568
|
+
return s == null ? t : t + `${e = e.includes("-") ? e : e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${s};`;
|
|
569
|
+
}), "");
|
|
570
|
+
}
|
|
571
|
+
update(r, [t]) {
|
|
572
|
+
const { style: e } = r.element;
|
|
573
|
+
if (this.ft === void 0) return this.ft = new Set(Object.keys(t)), this.render(t);
|
|
574
|
+
for (const s of this.ft) t[s] == null && (this.ft.delete(s), s.includes("-") ? e.removeProperty(s) : e[s] = null);
|
|
1464
575
|
for (const s in t) {
|
|
1465
|
-
const
|
|
1466
|
-
if (
|
|
1467
|
-
this.
|
|
1468
|
-
const o = typeof
|
|
1469
|
-
s.includes("-") || o ?
|
|
576
|
+
const i = t[s];
|
|
577
|
+
if (i != null) {
|
|
578
|
+
this.ft.add(s);
|
|
579
|
+
const o = typeof i == "string" && i.endsWith(se);
|
|
580
|
+
s.includes("-") || o ? e.setProperty(s, o ? i.slice(0, -11) : i, o ? Et : "") : e[s] = i;
|
|
1470
581
|
}
|
|
1471
582
|
}
|
|
1472
|
-
return
|
|
583
|
+
return y;
|
|
1473
584
|
}
|
|
1474
|
-
}
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
if (
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
if (typeof e != "string")
|
|
1488
|
-
throw new Error(`${this.constructor.directiveName}() called with a non-string value`);
|
|
1489
|
-
if (e === this._value)
|
|
1490
|
-
return this._templateResult;
|
|
1491
|
-
this._value = e;
|
|
1492
|
-
const t = [e];
|
|
1493
|
-
return t.raw = t, this._templateResult = {
|
|
1494
|
-
// Cast to a known set of integers that satisfy ResultType so that we
|
|
1495
|
-
// don't have to export ResultType and possibly encourage this pattern.
|
|
1496
|
-
// This property needs to remain unminified.
|
|
1497
|
-
_$litType$: this.constructor.resultType,
|
|
1498
|
-
strings: t,
|
|
1499
|
-
values: []
|
|
1500
|
-
};
|
|
585
|
+
});
|
|
586
|
+
class Y extends ot {
|
|
587
|
+
constructor(t) {
|
|
588
|
+
if (super(t), this.it = f, t.type !== it.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
589
|
+
}
|
|
590
|
+
render(t) {
|
|
591
|
+
if (t === f || t == null) return this._t = void 0, this.it = t;
|
|
592
|
+
if (t === y) return t;
|
|
593
|
+
if (typeof t != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
594
|
+
if (t === this.it) return this._t;
|
|
595
|
+
this.it = t;
|
|
596
|
+
const e = [t];
|
|
597
|
+
return e.raw = e, this._t = { _$litType$: this.constructor.resultType, strings: e, values: [] };
|
|
1501
598
|
}
|
|
1502
599
|
}
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
const
|
|
1512
|
-
|
|
1513
|
-
if (t === void 0) {
|
|
1514
|
-
const r = T(i).insertBefore(ze(), s), o = T(i).insertBefore(ze(), s);
|
|
1515
|
-
t = new Gt(r, o, n, n.options);
|
|
600
|
+
Y.directiveName = "unsafeHTML", Y.resultType = 1;
|
|
601
|
+
let G = class extends Y {
|
|
602
|
+
};
|
|
603
|
+
G.directiveName = "unsafeSVG", G.resultType = 2;
|
|
604
|
+
const ie = rt(G);
|
|
605
|
+
const { I: re } = Zt, vt = () => document.createComment(""), M = (r, t, e) => {
|
|
606
|
+
const s = r._$AA.parentNode, i = t === void 0 ? r._$AB : t._$AA;
|
|
607
|
+
if (e === void 0) {
|
|
608
|
+
const o = s.insertBefore(vt(), i), n = s.insertBefore(vt(), i);
|
|
609
|
+
e = new re(o, n, r, r.options);
|
|
1516
610
|
} else {
|
|
1517
|
-
const
|
|
1518
|
-
if (
|
|
1519
|
-
t._$reparentDisconnectables?.(n), t._$parent = n;
|
|
611
|
+
const o = e._$AB.nextSibling, n = e._$AM, h = n !== r;
|
|
612
|
+
if (h) {
|
|
1520
613
|
let a;
|
|
1521
|
-
|
|
614
|
+
e._$AQ?.(r), e._$AM = r, e._$AP !== void 0 && (a = r._$AU) !== n._$AU && e._$AP(a);
|
|
1522
615
|
}
|
|
1523
|
-
if (
|
|
1524
|
-
let a =
|
|
1525
|
-
for (; a !==
|
|
1526
|
-
const
|
|
1527
|
-
|
|
616
|
+
if (o !== i || h) {
|
|
617
|
+
let a = e._$AA;
|
|
618
|
+
for (; a !== o; ) {
|
|
619
|
+
const d = a.nextSibling;
|
|
620
|
+
s.insertBefore(a, i), a = d;
|
|
1528
621
|
}
|
|
1529
622
|
}
|
|
1530
623
|
}
|
|
1531
|
-
return
|
|
1532
|
-
},
|
|
1533
|
-
|
|
1534
|
-
let
|
|
1535
|
-
const
|
|
1536
|
-
for (;
|
|
1537
|
-
const
|
|
1538
|
-
|
|
624
|
+
return e;
|
|
625
|
+
}, w = (r, t, e = r) => (r._$AI(t, e), r), oe = {}, ne = (r, t = oe) => r._$AH = t, ae = (r) => r._$AH, Z = (r) => {
|
|
626
|
+
r._$AP?.(!1, !0);
|
|
627
|
+
let t = r._$AA;
|
|
628
|
+
const e = r._$AB.nextSibling;
|
|
629
|
+
for (; t !== e; ) {
|
|
630
|
+
const s = t.nextSibling;
|
|
631
|
+
t.remove(), t = s;
|
|
1539
632
|
}
|
|
1540
633
|
};
|
|
1541
|
-
const
|
|
1542
|
-
const
|
|
1543
|
-
for (let
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
throw new Error("repeat() can only be used in text expressions");
|
|
1551
|
-
}
|
|
1552
|
-
_getValuesAndKeys(e, t, i) {
|
|
634
|
+
const yt = (r, t, e) => {
|
|
635
|
+
const s = /* @__PURE__ */ new Map();
|
|
636
|
+
for (let i = t; i <= e; i++) s.set(r[i], i);
|
|
637
|
+
return s;
|
|
638
|
+
}, X = rt(class extends ot {
|
|
639
|
+
constructor(r) {
|
|
640
|
+
if (super(r), r.type !== it.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
641
|
+
}
|
|
642
|
+
dt(r, t, e) {
|
|
1553
643
|
let s;
|
|
1554
|
-
|
|
1555
|
-
const
|
|
1556
|
-
let
|
|
1557
|
-
for (const
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
return this.
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
if (
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
else if (g === void 0 && (g = Ie(l, f, _), p = Ie(a, c, d)), !g.has(a[c]))
|
|
1587
|
-
le(r[c]), c++;
|
|
1588
|
-
else if (!g.has(a[d]))
|
|
1589
|
-
le(r[d]), d--;
|
|
1590
|
-
else {
|
|
1591
|
-
const P = p.get(l[f]), ie = P !== void 0 ? r[P] : null;
|
|
1592
|
-
if (ie === null) {
|
|
1593
|
-
const xe = W(e, r[c]);
|
|
1594
|
-
A(xe, o[f]), h[f] = xe;
|
|
1595
|
-
} else
|
|
1596
|
-
h[f] = A(ie, o[f]), W(e, r[c], ie), r[P] = null;
|
|
1597
|
-
f++;
|
|
1598
|
-
}
|
|
1599
|
-
for (; f <= _; ) {
|
|
1600
|
-
const P = W(e, h[_ + 1]);
|
|
1601
|
-
A(P, o[f]), h[f++] = P;
|
|
644
|
+
e === void 0 ? e = t : t !== void 0 && (s = t);
|
|
645
|
+
const i = [], o = [];
|
|
646
|
+
let n = 0;
|
|
647
|
+
for (const h of r) i[n] = s ? s(h, n) : n, o[n] = e(h, n), n++;
|
|
648
|
+
return { values: o, keys: i };
|
|
649
|
+
}
|
|
650
|
+
render(r, t, e) {
|
|
651
|
+
return this.dt(r, t, e).values;
|
|
652
|
+
}
|
|
653
|
+
update(r, [t, e, s]) {
|
|
654
|
+
const i = ae(r), { values: o, keys: n } = this.dt(t, e, s);
|
|
655
|
+
if (!Array.isArray(i)) return this.ut = n, o;
|
|
656
|
+
const h = this.ut ??= [], a = [];
|
|
657
|
+
let d, u, l = 0, p = i.length - 1, c = 0, $ = o.length - 1;
|
|
658
|
+
for (; l <= p && c <= $; ) if (i[l] === null) l++;
|
|
659
|
+
else if (i[p] === null) p--;
|
|
660
|
+
else if (h[l] === n[c]) a[c] = w(i[l], o[c]), l++, c++;
|
|
661
|
+
else if (h[p] === n[$]) a[$] = w(i[p], o[$]), p--, $--;
|
|
662
|
+
else if (h[l] === n[$]) a[$] = w(i[l], o[$]), M(r, a[$ + 1], i[l]), l++, $--;
|
|
663
|
+
else if (h[p] === n[c]) a[c] = w(i[p], o[c]), M(r, i[l], i[p]), p--, c++;
|
|
664
|
+
else if (d === void 0 && (d = yt(n, c, $), u = yt(h, l, p)), d.has(h[l])) if (d.has(h[p])) {
|
|
665
|
+
const m = u.get(n[c]), W = m !== void 0 ? i[m] : null;
|
|
666
|
+
if (W === null) {
|
|
667
|
+
const at = M(r, i[l]);
|
|
668
|
+
w(at, o[c]), a[c] = at;
|
|
669
|
+
} else a[c] = w(W, o[c]), M(r, i[l], W), i[m] = null;
|
|
670
|
+
c++;
|
|
671
|
+
} else Z(i[p]), p--;
|
|
672
|
+
else Z(i[l]), l++;
|
|
673
|
+
for (; c <= $; ) {
|
|
674
|
+
const m = M(r, a[$ + 1]);
|
|
675
|
+
w(m, o[c]), a[c++] = m;
|
|
1602
676
|
}
|
|
1603
|
-
for (;
|
|
1604
|
-
const
|
|
1605
|
-
|
|
677
|
+
for (; l <= p; ) {
|
|
678
|
+
const m = i[l++];
|
|
679
|
+
m !== null && Z(m);
|
|
1606
680
|
}
|
|
1607
|
-
return this.
|
|
681
|
+
return this.ut = n, ne(r, a), y;
|
|
1608
682
|
}
|
|
1609
|
-
}
|
|
1610
|
-
|
|
1611
|
-
var
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
return i && s && Xt(e, t, s), s;
|
|
683
|
+
});
|
|
684
|
+
var le = Object.defineProperty, he = Object.getOwnPropertyDescriptor, Ct = (r, t, e, s) => {
|
|
685
|
+
for (var i = s > 1 ? void 0 : s ? he(t, e) : t, o = r.length - 1, n; o >= 0; o--)
|
|
686
|
+
(n = r[o]) && (i = (s ? n(t, e, i) : n(i)) || i);
|
|
687
|
+
return s && i && le(t, e, i), i;
|
|
1615
688
|
};
|
|
1616
|
-
let
|
|
689
|
+
let I = class extends C {
|
|
1617
690
|
render() {
|
|
1618
|
-
return
|
|
1619
|
-
${this.value !== void 0 ?
|
|
691
|
+
return g`
|
|
692
|
+
${this.value !== void 0 ? g`<div class="bar" style="width: ${this.value * 100}%;"></div>` : g`<div class="indeterminate"></div>`}
|
|
1620
693
|
`;
|
|
1621
694
|
}
|
|
1622
695
|
};
|
|
1623
|
-
|
|
696
|
+
I.styles = bt`
|
|
1624
697
|
:host {
|
|
1625
698
|
display: inline-block;
|
|
1626
699
|
width: var(--progress-width, 200px);
|
|
@@ -1662,36 +735,36 @@ Q.styles = He`
|
|
|
1662
735
|
}
|
|
1663
736
|
}
|
|
1664
737
|
`;
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
],
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
],
|
|
1671
|
-
var
|
|
1672
|
-
for (var
|
|
1673
|
-
(
|
|
1674
|
-
return
|
|
738
|
+
Ct([
|
|
739
|
+
V({ type: Number })
|
|
740
|
+
], I.prototype, "value", 2);
|
|
741
|
+
I = Ct([
|
|
742
|
+
Jt("linear-progress")
|
|
743
|
+
], I);
|
|
744
|
+
var ce = Object.defineProperty, _ = (r, t, e, s) => {
|
|
745
|
+
for (var i = void 0, o = r.length - 1, n; o >= 0; o--)
|
|
746
|
+
(n = r[o]) && (i = n(t, e, i) || i);
|
|
747
|
+
return i && ce(t, e, i), i;
|
|
1675
748
|
};
|
|
1676
|
-
const
|
|
749
|
+
const nt = class nt extends C {
|
|
1677
750
|
constructor() {
|
|
1678
|
-
super(), this.version = "1.0.
|
|
751
|
+
super(), this.version = "1.0.11", this.getModifier = this.getModifier.bind(this);
|
|
1679
752
|
}
|
|
1680
|
-
update(
|
|
1681
|
-
|
|
753
|
+
update(t) {
|
|
754
|
+
t.has("inputData") && (this.transform(), this.modifier || this.getModifier()), t.has("theme") && this.registerTheme(this.theme), super.update(t);
|
|
1682
755
|
}
|
|
1683
|
-
firstUpdated(
|
|
756
|
+
firstUpdated(t) {
|
|
1684
757
|
this.registerTheme(this.theme), new ResizeObserver(this.getModifier).observe(this);
|
|
1685
758
|
}
|
|
1686
|
-
registerTheme(
|
|
1687
|
-
const
|
|
1688
|
-
this.themeBgColor =
|
|
759
|
+
registerTheme(t) {
|
|
760
|
+
const e = getComputedStyle(this).getPropertyValue("--re-text-color").trim(), s = getComputedStyle(this).getPropertyValue("--re-tile-background-color").trim();
|
|
761
|
+
this.themeBgColor = s || this.theme?.theme_object?.backgroundColor, this.themeTitleColor = e || this.theme?.theme_object?.title?.textStyle?.color, this.themeSubtitleColor = e || this.theme?.theme_object?.title?.subtextStyle?.color || this.themeTitleColor;
|
|
1689
762
|
}
|
|
1690
|
-
handleFileChange(
|
|
1691
|
-
const
|
|
1692
|
-
|
|
763
|
+
handleFileChange(t) {
|
|
764
|
+
const s = t.target.files?.[0];
|
|
765
|
+
s && (this.previewUrl && URL.revokeObjectURL(this.previewUrl), this.previewUrl = URL.createObjectURL(s), this.dispatchEvent(
|
|
1693
766
|
new CustomEvent("overlay-file-selected", {
|
|
1694
|
-
detail: { file:
|
|
767
|
+
detail: { file: s, name: s.name, size: s.size, type: s.type, url: this.previewUrl },
|
|
1695
768
|
bubbles: !0,
|
|
1696
769
|
composed: !0
|
|
1697
770
|
})
|
|
@@ -1702,29 +775,29 @@ const Pe = class Pe extends D {
|
|
|
1702
775
|
this.previewUrl = void 0;
|
|
1703
776
|
return;
|
|
1704
777
|
}
|
|
1705
|
-
const
|
|
1706
|
-
if (
|
|
1707
|
-
this.inlineSvg =
|
|
778
|
+
const t = this.inputData.image.trim(), s = t.replace(/^\uFEFF/, "").trimStart().match(/<svg[\s\S]*?<\/svg>/i);
|
|
779
|
+
if (s) {
|
|
780
|
+
this.inlineSvg = s[0].trim(), this.previewUrl = void 0;
|
|
1708
781
|
return;
|
|
1709
782
|
}
|
|
1710
|
-
if (/^data:image\/svg\+xml[,;]/.test(
|
|
1711
|
-
this.previewUrl =
|
|
783
|
+
if (/^data:image\/svg\+xml[,;]/.test(t)) {
|
|
784
|
+
this.previewUrl = t;
|
|
1712
785
|
return;
|
|
1713
786
|
}
|
|
1714
|
-
if (/^data:image\/[a-zA-Z.+-]+;base64,/.test(
|
|
1715
|
-
this.previewUrl =
|
|
787
|
+
if (/^data:image\/[a-zA-Z.+-]+;base64,/.test(t)) {
|
|
788
|
+
this.previewUrl = t;
|
|
1716
789
|
return;
|
|
1717
790
|
}
|
|
1718
|
-
if (/^[A-Za-z0-9+/]+=*$/.test(
|
|
1719
|
-
this.previewUrl = `data:image/*;base64,${
|
|
791
|
+
if (/^[A-Za-z0-9+/]+=*$/.test(t) && t.length > 100) {
|
|
792
|
+
this.previewUrl = `data:image/*;base64,${t}`;
|
|
1720
793
|
return;
|
|
1721
794
|
}
|
|
1722
795
|
try {
|
|
1723
|
-
new URL(
|
|
796
|
+
new URL(t), this.previewUrl = t;
|
|
1724
797
|
return;
|
|
1725
798
|
} catch {
|
|
1726
|
-
if (/^([./]|\/)/.test(
|
|
1727
|
-
this.previewUrl =
|
|
799
|
+
if (/^([./]|\/)/.test(t)) {
|
|
800
|
+
this.previewUrl = t;
|
|
1728
801
|
return;
|
|
1729
802
|
}
|
|
1730
803
|
}
|
|
@@ -1732,117 +805,117 @@ const Pe = class Pe extends D {
|
|
|
1732
805
|
}
|
|
1733
806
|
async getModifier() {
|
|
1734
807
|
if (!this.baseLayer) return;
|
|
1735
|
-
const
|
|
1736
|
-
if (!e) return;
|
|
1737
|
-
const t = this.baseLayer.parentElement?.getBoundingClientRect();
|
|
808
|
+
const t = this.baseLayer.getBoundingClientRect();
|
|
1738
809
|
if (!t) return;
|
|
1739
|
-
|
|
810
|
+
const e = this.baseLayer.parentElement?.getBoundingClientRect();
|
|
811
|
+
if (!e) return;
|
|
812
|
+
let s, i;
|
|
1740
813
|
if (this.baseLayer instanceof HTMLImageElement)
|
|
1741
|
-
|
|
814
|
+
s = this.baseLayer.naturalWidth, i = this.baseLayer.naturalHeight;
|
|
1742
815
|
else {
|
|
1743
|
-
const
|
|
1744
|
-
if (
|
|
1745
|
-
const
|
|
1746
|
-
if (console.log(
|
|
1747
|
-
|
|
816
|
+
const p = this.baseLayer.querySelector("svg");
|
|
817
|
+
if (p) {
|
|
818
|
+
const c = p.viewBox.baseVal;
|
|
819
|
+
if (console.log(c), c && c.width > 0 && c.height > 0)
|
|
820
|
+
s = c.width, i = c.height;
|
|
1748
821
|
else {
|
|
1749
|
-
const
|
|
1750
|
-
|
|
822
|
+
const $ = this.baseLayer.getAttribute("width"), m = this.baseLayer.getAttribute("height");
|
|
823
|
+
$ && m && (s = parseFloat($), i = parseFloat(m));
|
|
1751
824
|
}
|
|
1752
825
|
}
|
|
1753
826
|
}
|
|
1754
|
-
if (!
|
|
1755
|
-
const
|
|
1756
|
-
this.modifier = { scaler:
|
|
827
|
+
if (!s || !i) return;
|
|
828
|
+
const o = t.width / s, n = t.height / i, h = Math.min(o, n), a = s * h, d = i * h, u = (e.width - a) / 2, l = (e.height - d) / 2;
|
|
829
|
+
this.modifier = { scaler: h, xOffset: u, yOffset: l, visibleWidth: a, visibleHeight: d };
|
|
1757
830
|
}
|
|
1758
|
-
getOverlayItemPosition(
|
|
831
|
+
getOverlayItemPosition(t, e, s) {
|
|
1759
832
|
return {
|
|
1760
|
-
left:
|
|
1761
|
-
top:
|
|
833
|
+
left: t * s.visibleWidth,
|
|
834
|
+
top: e * s.visibleHeight
|
|
1762
835
|
};
|
|
1763
836
|
}
|
|
1764
|
-
renderText(
|
|
1765
|
-
const
|
|
1766
|
-
if (!
|
|
1767
|
-
const
|
|
1768
|
-
let
|
|
1769
|
-
const a = Number(
|
|
1770
|
-
let
|
|
1771
|
-
if (!Number.isNaN(a) && typeof
|
|
1772
|
-
|
|
1773
|
-
const
|
|
1774
|
-
|
|
837
|
+
renderText(t, e, s) {
|
|
838
|
+
const i = t, o = this.getOverlayItemPosition(e.relXPos, e.relYPos, s);
|
|
839
|
+
if (!o) return f;
|
|
840
|
+
const n = i.textStyle?.precision ?? 1;
|
|
841
|
+
let h = e.data;
|
|
842
|
+
const a = Number(h);
|
|
843
|
+
let d = "#333";
|
|
844
|
+
if (!Number.isNaN(a) && typeof n == "number" && n >= 0) {
|
|
845
|
+
h = a.toFixed(n);
|
|
846
|
+
const l = i.sections?.sectionLimits.findIndex((p) => a <= p) ?? -2;
|
|
847
|
+
d = (l >= 1 ? i.sections?.colors[l - 1] : "#333") ?? "#333";
|
|
1775
848
|
}
|
|
1776
|
-
const
|
|
1777
|
-
"font-size": (
|
|
1778
|
-
color:
|
|
1779
|
-
"background-color":
|
|
1780
|
-
"font-weight":
|
|
1781
|
-
left: `${
|
|
1782
|
-
top: `${
|
|
1783
|
-
"border-radius": 10 *
|
|
849
|
+
const u = {
|
|
850
|
+
"font-size": (i.textStyle.fontSize ?? 14) * s.scaler + "px",
|
|
851
|
+
color: d,
|
|
852
|
+
"background-color": i.textStyle.backgroundColor,
|
|
853
|
+
"font-weight": i.textStyle.fontWeight,
|
|
854
|
+
left: `${o.left}px`,
|
|
855
|
+
top: `${o.top}px`,
|
|
856
|
+
"border-radius": 10 * s.scaler + "px",
|
|
1784
857
|
"transform-origin": "50% 50%",
|
|
1785
858
|
transform: "translate(-50%, -50%)",
|
|
1786
|
-
padding: `${6 *
|
|
859
|
+
padding: `${6 * s.scaler}px ${12 * s.scaler}px`
|
|
1787
860
|
};
|
|
1788
|
-
return
|
|
1789
|
-
<div class="overlay-item" style=${
|
|
861
|
+
return g`
|
|
862
|
+
<div class="overlay-item" style=${F(u)}>${e.prefix}${h}${e.suffix}</div>
|
|
1790
863
|
`;
|
|
1791
864
|
}
|
|
1792
|
-
renderProgress(
|
|
1793
|
-
const
|
|
1794
|
-
if (!
|
|
1795
|
-
const
|
|
1796
|
-
"--progress-color": (
|
|
1797
|
-
"--progress-width": (
|
|
1798
|
-
"--progress-height": (
|
|
1799
|
-
"--progress-background":
|
|
1800
|
-
"border-radius": 10 *
|
|
865
|
+
renderProgress(t, e, s) {
|
|
866
|
+
const i = t, o = this.getOverlayItemPosition(e.relXPos, e.relYPos, s);
|
|
867
|
+
if (!o) return f;
|
|
868
|
+
const n = i.sections?.sectionLimits.findIndex(($) => Number(e.data) <= $) ?? -2, a = {
|
|
869
|
+
"--progress-color": (n >= 1 ? i.sections?.colors[n - 1] : void 0) ?? "#333",
|
|
870
|
+
"--progress-width": (i.progressStyle?.width ?? 10) * s.scaler + "px",
|
|
871
|
+
"--progress-height": (i.progressStyle?.height ?? 100) * s.scaler + "px",
|
|
872
|
+
"--progress-background": i.progressStyle?.backgroundColor ?? "#fff",
|
|
873
|
+
"border-radius": 10 * s.scaler + "px",
|
|
1801
874
|
"transform-origin": "50% 50%",
|
|
1802
|
-
transform: `translate(-50%, -50%) rotate(${
|
|
1803
|
-
left: `${
|
|
1804
|
-
top: `${
|
|
1805
|
-
},
|
|
1806
|
-
let
|
|
1807
|
-
return
|
|
1808
|
-
}
|
|
1809
|
-
renderLayer(
|
|
1810
|
-
const
|
|
1811
|
-
if (!
|
|
1812
|
-
const
|
|
1813
|
-
left:
|
|
1814
|
-
top:
|
|
1815
|
-
width:
|
|
1816
|
-
height:
|
|
875
|
+
transform: `translate(-50%, -50%) rotate(${i.progressStyle?.rotate ?? 0}deg)`,
|
|
876
|
+
left: `${o.left}px`,
|
|
877
|
+
top: `${o.top}px`
|
|
878
|
+
}, d = Number(e.data), u = i.sections ?? {}, l = Math.min(...u.sectionLimits.map(Number)), p = Math.max(...u.sectionLimits.map(Number));
|
|
879
|
+
let c = p === l ? 0 : (d - l) / (p - l);
|
|
880
|
+
return c = Math.min(1, Math.max(0, c)), g` <linear-progress .value=${c} style=${F(a)}></linear-progress> `;
|
|
881
|
+
}
|
|
882
|
+
renderLayer(t) {
|
|
883
|
+
const e = this.modifier;
|
|
884
|
+
if (!e) return f;
|
|
885
|
+
const s = {
|
|
886
|
+
left: e.xOffset + "px",
|
|
887
|
+
top: e.yOffset + "px",
|
|
888
|
+
width: e.visibleWidth + "px",
|
|
889
|
+
height: e.visibleHeight + "px"
|
|
1817
890
|
};
|
|
1818
|
-
return
|
|
891
|
+
return g`<div
|
|
1819
892
|
class="overlay"
|
|
1820
|
-
style=${
|
|
1821
|
-
type="${
|
|
1822
|
-
name="${
|
|
893
|
+
style=${F(s)}
|
|
894
|
+
type="${t.layerType}"
|
|
895
|
+
name="${t.layerName}"
|
|
1823
896
|
>
|
|
1824
|
-
${
|
|
897
|
+
${t.layerType === "text" ? this.renderTextLayer(t) : this.renderProgressLayer(t)}
|
|
1825
898
|
</div>`;
|
|
1826
899
|
}
|
|
1827
|
-
renderTextLayer(
|
|
1828
|
-
const
|
|
1829
|
-
return
|
|
1830
|
-
|
|
1831
|
-
(
|
|
1832
|
-
(
|
|
1833
|
-
)}` :
|
|
1834
|
-
}
|
|
1835
|
-
renderProgressLayer(
|
|
1836
|
-
const
|
|
1837
|
-
return
|
|
1838
|
-
|
|
1839
|
-
(
|
|
1840
|
-
(
|
|
1841
|
-
)}` :
|
|
900
|
+
renderTextLayer(t) {
|
|
901
|
+
const e = this.modifier;
|
|
902
|
+
return e ? g`${X(
|
|
903
|
+
t.textPins ?? [],
|
|
904
|
+
(s, i) => i,
|
|
905
|
+
(s) => g`${this.renderText(t, s, e)}`
|
|
906
|
+
)}` : f;
|
|
907
|
+
}
|
|
908
|
+
renderProgressLayer(t) {
|
|
909
|
+
const e = this.modifier;
|
|
910
|
+
return e ? g`${X(
|
|
911
|
+
t.progressPins ?? [],
|
|
912
|
+
(s, i) => i,
|
|
913
|
+
(s) => g`${this.renderProgress(t, s, e)}`
|
|
914
|
+
)}` : f;
|
|
1842
915
|
}
|
|
1843
916
|
render() {
|
|
1844
|
-
const
|
|
1845
|
-
return
|
|
917
|
+
const t = !!this.inlineSvg || !!this.previewUrl;
|
|
918
|
+
return g`
|
|
1846
919
|
<div class="wrapper" style="background-color: ${this.themeBgColor}">
|
|
1847
920
|
<h3 class="paging" ?active=${this.inputData?.title} style="color: ${this.themeTitleColor}">
|
|
1848
921
|
${this.inputData?.title}
|
|
@@ -1855,26 +928,26 @@ const Pe = class Pe extends D {
|
|
|
1855
928
|
${this.inputData?.subTitle}
|
|
1856
929
|
</p>
|
|
1857
930
|
|
|
1858
|
-
<div class="paging no-data" ?active=${!
|
|
1859
|
-
<div class="img-container paging" ?active="${
|
|
1860
|
-
${this.inlineSvg ?
|
|
931
|
+
<div class="paging no-data" ?active=${!t}>No Image</div>
|
|
932
|
+
<div class="img-container paging" ?active="${t}">
|
|
933
|
+
${this.inlineSvg ? g`<div id="base-layer" class="svg-wrapper">${ie(this.inlineSvg)}</div>` : this.previewUrl ? g`<img
|
|
1861
934
|
id="base-layer"
|
|
1862
935
|
@load="${this.getModifier}"
|
|
1863
936
|
src="${this.previewUrl}"
|
|
1864
937
|
alt="Image Widget"
|
|
1865
938
|
style="object-fit: ${this.inputData?.stretchToFit ? "fill" : "contain"}"
|
|
1866
939
|
/>` : ""}
|
|
1867
|
-
${
|
|
940
|
+
${X(
|
|
1868
941
|
this.inputData?.overlays ?? [],
|
|
1869
|
-
(
|
|
1870
|
-
(
|
|
942
|
+
(e) => e.layerName,
|
|
943
|
+
(e) => g` ${this.renderLayer(e)} `
|
|
1871
944
|
)}
|
|
1872
945
|
</div>
|
|
1873
946
|
</div>
|
|
1874
947
|
`;
|
|
1875
948
|
}
|
|
1876
949
|
};
|
|
1877
|
-
|
|
950
|
+
nt.styles = bt`
|
|
1878
951
|
:host {
|
|
1879
952
|
display: block;
|
|
1880
953
|
font-family: sans-serif;
|
|
@@ -1958,36 +1031,36 @@ Pe.styles = He`
|
|
|
1958
1031
|
pointer-events: auto;
|
|
1959
1032
|
}
|
|
1960
1033
|
`;
|
|
1961
|
-
let
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
],
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
],
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
],
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
],
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
],
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
],
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
],
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
],
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
],
|
|
1989
|
-
window.customElements.define("widget-overlay-1.0.
|
|
1034
|
+
let v = nt;
|
|
1035
|
+
_([
|
|
1036
|
+
V({ type: Object })
|
|
1037
|
+
], v.prototype, "inputData");
|
|
1038
|
+
_([
|
|
1039
|
+
V({ type: Object })
|
|
1040
|
+
], v.prototype, "theme");
|
|
1041
|
+
_([
|
|
1042
|
+
T()
|
|
1043
|
+
], v.prototype, "themeBgColor");
|
|
1044
|
+
_([
|
|
1045
|
+
T()
|
|
1046
|
+
], v.prototype, "themeTitleColor");
|
|
1047
|
+
_([
|
|
1048
|
+
T()
|
|
1049
|
+
], v.prototype, "themeSubtitleColor");
|
|
1050
|
+
_([
|
|
1051
|
+
T()
|
|
1052
|
+
], v.prototype, "previewUrl");
|
|
1053
|
+
_([
|
|
1054
|
+
T()
|
|
1055
|
+
], v.prototype, "inlineSvg");
|
|
1056
|
+
_([
|
|
1057
|
+
T()
|
|
1058
|
+
], v.prototype, "modifier");
|
|
1059
|
+
_([
|
|
1060
|
+
ee("#base-layer")
|
|
1061
|
+
], v.prototype, "baseLayer");
|
|
1062
|
+
window.customElements.define("widget-overlay-1.0.11", v);
|
|
1990
1063
|
export {
|
|
1991
|
-
|
|
1064
|
+
v as WidgetImage
|
|
1992
1065
|
};
|
|
1993
1066
|
//# sourceMappingURL=widget-overlay.js.map
|