@record-evolution/widget-overlay 1.0.8 → 1.0.9
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 +1245 -338
- package/dist/widget-overlay.js.map +1 -1
- package/package.json +1 -1
package/dist/widget-overlay.js
CHANGED
|
@@ -1,29 +1,749 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const q = globalThis, ue = q.ShadowRoot && (q.ShadyCSS === void 0 || q.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, fe = /* @__PURE__ */ Symbol(), Te = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
class We {
|
|
3
|
+
constructor(e, t, i) {
|
|
4
|
+
if (this._$cssResult$ = !0, i !== fe)
|
|
5
|
+
throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
6
|
+
this.cssText = e, this._strings = t;
|
|
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.
|
|
10
|
+
get styleSheet() {
|
|
11
|
+
let e = this._styleSheet;
|
|
12
|
+
const t = this._strings;
|
|
13
|
+
if (ue && e === void 0) {
|
|
14
|
+
const i = t !== void 0 && t.length === 1;
|
|
15
|
+
i && (e = Te.get(t)), e === void 0 && ((this._styleSheet = e = new CSSStyleSheet()).replaceSync(this.cssText), i && Te.set(t, e));
|
|
16
|
+
}
|
|
17
|
+
return e;
|
|
18
|
+
}
|
|
19
|
+
toString() {
|
|
20
|
+
return this.cssText;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const et = (n) => {
|
|
24
|
+
if (n._$cssResult$ === !0)
|
|
25
|
+
return n.cssText;
|
|
26
|
+
if (typeof n == "number")
|
|
27
|
+
return n;
|
|
28
|
+
throw new 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.`);
|
|
29
|
+
}, tt = (n) => new We(typeof n == "string" ? n : String(n), void 0, fe), He = (n, ...e) => {
|
|
30
|
+
const t = n.length === 1 ? n[0] : e.reduce((i, s, r) => i + et(s) + n[r + 1], n[0]);
|
|
31
|
+
return new We(t, n, fe);
|
|
32
|
+
}, it = (n, e) => {
|
|
33
|
+
if (ue)
|
|
34
|
+
n.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
35
|
+
else
|
|
36
|
+
for (const t of e) {
|
|
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) => {
|
|
41
|
+
let e = "";
|
|
42
|
+
for (const t of n.cssRules)
|
|
43
|
+
e += t.cssText;
|
|
44
|
+
return tt(e);
|
|
45
|
+
}, Ce = ue ? (n) => n : (n) => n instanceof CSSStyleSheet ? st(n) : n;
|
|
46
|
+
const { is: nt, defineProperty: rt, getOwnPropertyDescriptor: Ee, getOwnPropertyNames: ot, getOwnPropertySymbols: at, getPrototypeOf: Ne } = Object, $ = globalThis;
|
|
47
|
+
let v;
|
|
48
|
+
const Me = $.trustedTypes, lt = Me ? Me.emptyScript : "", je = $.reactiveElementPolyfillSupportDevMode;
|
|
49
|
+
$.litIssuedWarnings ??= /* @__PURE__ */ new Set(), v = (n, e) => {
|
|
50
|
+
e += ` See https://lit.dev/msg/${n} for more information.`, !$.litIssuedWarnings.has(e) && !$.litIssuedWarnings.has(n) && (console.warn(e), $.litIssuedWarnings.add(e));
|
|
51
|
+
}, queueMicrotask(() => {
|
|
52
|
+
v("dev-mode", "Lit is in dev mode. Not recommended for production!"), $.ShadyDOM?.inUse && je === void 0 && v("polyfill-support-missing", "Shadow DOM is being polyfilled via `ShadyDOM` but the `polyfill-support` module has not been loaded.");
|
|
53
|
+
});
|
|
54
|
+
const dt = (n) => {
|
|
4
55
|
$.emitLitDebugLogEvents && $.dispatchEvent(new CustomEvent("lit-debug", {
|
|
5
|
-
detail:
|
|
56
|
+
detail: n
|
|
6
57
|
}));
|
|
58
|
+
}, V = (n, e) => n, G = {
|
|
59
|
+
toAttribute(n, e) {
|
|
60
|
+
switch (e) {
|
|
61
|
+
case Boolean:
|
|
62
|
+
n = n ? lt : null;
|
|
63
|
+
break;
|
|
64
|
+
case Object:
|
|
65
|
+
case Array:
|
|
66
|
+
n = n == null ? n : JSON.stringify(n);
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
return n;
|
|
70
|
+
},
|
|
71
|
+
fromAttribute(n, e) {
|
|
72
|
+
let t = n;
|
|
73
|
+
switch (e) {
|
|
74
|
+
case Boolean:
|
|
75
|
+
t = n !== null;
|
|
76
|
+
break;
|
|
77
|
+
case Number:
|
|
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;
|
|
90
|
+
}
|
|
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
|
|
7
98
|
};
|
|
8
|
-
|
|
9
|
-
$.
|
|
10
|
-
|
|
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
|
+
static get observedAttributes() {
|
|
144
|
+
return this.finalize(), this.__attributeToPropertyMap && [...this.__attributeToPropertyMap.keys()];
|
|
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
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Returns a property descriptor to be defined on the given named property.
|
|
183
|
+
* If no descriptor is returned, the property will not become an accessor.
|
|
184
|
+
* For example,
|
|
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.`);
|
|
221
|
+
}
|
|
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
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Returns the property options associated with the given property.
|
|
234
|
+
* These options are defined with a `PropertyDeclaration` via the `properties`
|
|
235
|
+
* object or the `@property` decorator and are registered in
|
|
236
|
+
* `createProperty(...)`.
|
|
237
|
+
*
|
|
238
|
+
* Note, this method should be considered "final" and not overridden. To
|
|
239
|
+
* customize the options for a given property, override
|
|
240
|
+
* {@linkcode createProperty}.
|
|
241
|
+
*
|
|
242
|
+
* @nocollapse
|
|
243
|
+
* @final
|
|
244
|
+
* @category properties
|
|
245
|
+
*/
|
|
246
|
+
static getPropertyOptions(e) {
|
|
247
|
+
return this.elementProperties.get(e) ?? Ue;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Initializes static own properties of the class used in bookkeeping
|
|
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
|
+
*/
|
|
277
|
+
static finalize() {
|
|
278
|
+
if (this.hasOwnProperty(V("finalized")))
|
|
279
|
+
return;
|
|
280
|
+
if (this.finalized = !0, this.__prepare(), this.hasOwnProperty(V("properties"))) {
|
|
281
|
+
const t = this.properties, i = [
|
|
282
|
+
...ot(t),
|
|
283
|
+
...at(t)
|
|
284
|
+
];
|
|
285
|
+
for (const s of i)
|
|
286
|
+
this.createProperty(s, t[s]);
|
|
287
|
+
}
|
|
288
|
+
const e = this[Symbol.metadata];
|
|
289
|
+
if (e !== null) {
|
|
290
|
+
const t = litPropertyMetadata.get(e);
|
|
291
|
+
if (t !== void 0)
|
|
292
|
+
for (const [i, s] of t)
|
|
293
|
+
this.elementProperties.set(i, s);
|
|
294
|
+
}
|
|
295
|
+
this.__attributeToPropertyMap = /* @__PURE__ */ new Map();
|
|
296
|
+
for (const [t, i] of this.elementProperties) {
|
|
297
|
+
const s = this.__attributeNameForProperty(t, i);
|
|
298
|
+
s !== void 0 && this.__attributeToPropertyMap.set(s, t);
|
|
299
|
+
}
|
|
300
|
+
this.elementStyles = this.finalizeStyles(this.styles), this.hasOwnProperty("createProperty") && v("no-override-create-property", "Overriding ReactiveElement.createProperty() is deprecated. The override will not be called with standard decorators"), this.hasOwnProperty("getPropertyDescriptor") && v("no-override-get-property-descriptor", "Overriding ReactiveElement.getPropertyDescriptor() is deprecated. The override will not be called with standard decorators");
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Takes the styles the user supplied via the `static styles` property and
|
|
304
|
+
* returns the array of styles to apply to the element.
|
|
305
|
+
* Override this method to integrate into a style management system.
|
|
306
|
+
*
|
|
307
|
+
* Styles are deduplicated preserving the _last_ instance in the list. This
|
|
308
|
+
* is a performance optimization to avoid duplicated styles that can occur
|
|
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;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Returns the property name for the given attribute `name`.
|
|
327
|
+
* @nocollapse
|
|
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;
|
|
332
|
+
}
|
|
333
|
+
constructor() {
|
|
334
|
+
super(), this.__instanceProperties = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this.__reflectingProperty = null, this.__initialize();
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Internal only override point for customizing work done when elements
|
|
338
|
+
* are constructed.
|
|
339
|
+
*/
|
|
340
|
+
__initialize() {
|
|
341
|
+
this.__updatePromise = new Promise((e) => this.enableUpdating = e), this._$changedProperties = /* @__PURE__ */ new Map(), this.__saveInstanceProperties(), this.requestUpdate(), this.constructor._initializers?.forEach((e) => e(this));
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Registers a `ReactiveController` to participate in the element's reactive
|
|
345
|
+
* update cycle. The element automatically calls into any registered
|
|
346
|
+
* controllers during its lifecycle callbacks.
|
|
347
|
+
*
|
|
348
|
+
* If the element is connected when `addController()` is called, the
|
|
349
|
+
* controller's `hostConnected()` callback will be immediately called.
|
|
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
|
+
*/
|
|
383
|
+
createRenderRoot() {
|
|
384
|
+
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
385
|
+
return it(e, this.constructor.elementStyles), e;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* On first connection, creates the element's renderRoot, sets up
|
|
389
|
+
* element styling, and enables updating.
|
|
390
|
+
* @category lifecycle
|
|
391
|
+
*/
|
|
392
|
+
connectedCallback() {
|
|
393
|
+
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this.__controllers?.forEach((e) => e.hostConnected?.());
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Note, this method should be considered final and not overridden. It is
|
|
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
|
+
*/
|
|
409
|
+
disconnectedCallback() {
|
|
410
|
+
this.__controllers?.forEach((e) => e.hostDisconnected?.());
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Synchronizes property values when attributes change.
|
|
414
|
+
*
|
|
415
|
+
* Specifically, when an attribute is set, the corresponding property is set.
|
|
416
|
+
* You should rarely need to implement this callback. If this method is
|
|
417
|
+
* overridden, `super.attributeChangedCallback(name, _old, value)` must be
|
|
418
|
+
* called.
|
|
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;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
/** @internal */
|
|
435
|
+
_$attributeToProperty(e, t) {
|
|
436
|
+
const i = this.constructor, s = i.__attributeToPropertyMap.get(e);
|
|
437
|
+
if (s !== void 0 && this.__reflectingProperty !== s) {
|
|
438
|
+
const r = i.getPropertyOptions(s), o = typeof r.converter == "function" ? { fromAttribute: r.converter } : r.converter?.fromAttribute !== void 0 ? r.converter : G;
|
|
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;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Requests an update which is processed asynchronously. This should be called
|
|
445
|
+
* when an element should update based on some state not triggered by setting
|
|
446
|
+
* a reactive property. In this case, pass no arguments. It should also be
|
|
447
|
+
* called when manually implementing a property setter. In this case, pass the
|
|
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;
|
|
471
|
+
}
|
|
472
|
+
this.isUpdatePending === !1 && (this.__updatePromise = this.__enqueueUpdate());
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* @internal
|
|
476
|
+
*/
|
|
477
|
+
_$changeProperty(e, t, { useDefault: i, reflect: s, wrapped: r }, o) {
|
|
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() {
|
|
484
|
+
this.isUpdatePending = !0;
|
|
485
|
+
try {
|
|
486
|
+
await this.__updatePromise;
|
|
487
|
+
} catch (t) {
|
|
488
|
+
Promise.reject(t);
|
|
489
|
+
}
|
|
490
|
+
const e = this.scheduleUpdate();
|
|
491
|
+
return e != null && await e, !this.isUpdatePending;
|
|
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
|
+
*/
|
|
510
|
+
scheduleUpdate() {
|
|
511
|
+
const e = this.performUpdate();
|
|
512
|
+
return this.constructor.enabledWarnings.includes("async-perform-update") && typeof e?.then == "function" && v("async-perform-update", `Element ${this.localName} returned a Promise from performUpdate(). This behavior is deprecated and will be removed in a future version of ReactiveElement.`), e;
|
|
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
|
+
*/
|
|
524
|
+
performUpdate() {
|
|
525
|
+
if (!this.isUpdatePending)
|
|
526
|
+
return;
|
|
527
|
+
if (dt?.({ kind: "update" }), !this.hasUpdated) {
|
|
528
|
+
this.renderRoot ??= this.createRenderRoot();
|
|
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.`);
|
|
533
|
+
}
|
|
534
|
+
if (this.__instanceProperties) {
|
|
535
|
+
for (const [s, r] of this.__instanceProperties)
|
|
536
|
+
this[s] = r;
|
|
537
|
+
this.__instanceProperties = void 0;
|
|
538
|
+
}
|
|
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
|
+
}
|
|
546
|
+
let e = !1;
|
|
547
|
+
const t = this._$changedProperties;
|
|
548
|
+
try {
|
|
549
|
+
e = this.shouldUpdate(t), e ? (this.willUpdate(t), this.__controllers?.forEach((i) => i.hostUpdate?.()), this.update(t)) : this.__markUpdated();
|
|
550
|
+
} catch (i) {
|
|
551
|
+
throw e = !1, this.__markUpdated(), i;
|
|
552
|
+
}
|
|
553
|
+
e && this._$didUpdate(t);
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* Invoked before `update()` to compute values needed during the update.
|
|
557
|
+
*
|
|
558
|
+
* Implement `willUpdate` to compute property values that depend on other
|
|
559
|
+
* properties and are used in the rest of the update process.
|
|
560
|
+
*
|
|
561
|
+
* ```ts
|
|
562
|
+
* willUpdate(changedProperties) {
|
|
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
|
+
*/
|
|
602
|
+
get updateComplete() {
|
|
603
|
+
return this.getUpdateComplete();
|
|
604
|
+
}
|
|
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
|
+
getUpdateComplete() {
|
|
629
|
+
return this.__updatePromise;
|
|
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) {
|
|
640
|
+
return !0;
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Updates the element. This method reflects property values to attributes.
|
|
644
|
+
* It can be overridden to render and keep updated element DOM.
|
|
645
|
+
* Setting properties inside this method will *not* trigger
|
|
646
|
+
* another update.
|
|
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) {
|
|
683
|
+
}
|
|
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
|
+
};
|
|
715
|
+
let ct = 0, H;
|
|
716
|
+
b.litIssuedWarnings ??= /* @__PURE__ */ new Set(), H = (n, e) => {
|
|
717
|
+
e += n ? ` See https://lit.dev/msg/${n} for more information.` : "", !b.litIssuedWarnings.has(e) && !b.litIssuedWarnings.has(n) && (console.warn(e), b.litIssuedWarnings.add(e));
|
|
11
718
|
}, queueMicrotask(() => {
|
|
12
|
-
|
|
719
|
+
H("dev-mode", "Lit is in dev mode. Not recommended for production!");
|
|
13
720
|
});
|
|
14
|
-
const
|
|
15
|
-
createHTML: (
|
|
16
|
-
}) : void 0,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
721
|
+
const S = b.ShadyDOM?.inUse && b.ShadyDOM?.noPatch === !0 ? b.ShadyDOM.wrap : (n) => n, Y = b.trustedTypes, Ae = Y ? Y.createPolicy("lit-html", {
|
|
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,
|
|
21
741
|
129
|
|
22
742
|
/* NodeFilter.SHOW_{ELEMENT|COMMENT} */
|
|
23
743
|
);
|
|
24
|
-
let
|
|
25
|
-
function
|
|
26
|
-
if (!
|
|
744
|
+
let O = Z;
|
|
745
|
+
function Ke(n, e) {
|
|
746
|
+
if (!ge(n) || !n.hasOwnProperty("raw")) {
|
|
27
747
|
let t = "invalid template strings array";
|
|
28
748
|
throw t = `
|
|
29
749
|
Internal Error: expected template strings to be an array
|
|
@@ -38,87 +758,87 @@ function Ae(o, e) {
|
|
|
38
758
|
`.trim().replace(/\n */g, `
|
|
39
759
|
`), new Error(t);
|
|
40
760
|
}
|
|
41
|
-
return
|
|
761
|
+
return Ae !== void 0 ? Ae.createHTML(e) : e;
|
|
42
762
|
}
|
|
43
|
-
const
|
|
44
|
-
const t =
|
|
45
|
-
let s = e ===
|
|
763
|
+
const Ct = (n, e) => {
|
|
764
|
+
const t = n.length - 1, i = [];
|
|
765
|
+
let s = e === he ? "<svg>" : e === pe ? "<math>" : "", r, o = I;
|
|
46
766
|
for (let a = 0; a < t; a++) {
|
|
47
|
-
const
|
|
48
|
-
let
|
|
49
|
-
for (;
|
|
50
|
-
if (
|
|
51
|
-
if (
|
|
52
|
-
|
|
53
|
-
else if (
|
|
54
|
-
|
|
55
|
-
else if (
|
|
56
|
-
|
|
57
|
-
else if (
|
|
767
|
+
const h = n[a];
|
|
768
|
+
let g = -1, p, c = 0, d;
|
|
769
|
+
for (; c < h.length && (o.lastIndex = c, d = o.exec(h), d !== null); )
|
|
770
|
+
if (c = o.lastIndex, o === I) {
|
|
771
|
+
if (d[Re] === "!--")
|
|
772
|
+
o = ke;
|
|
773
|
+
else if (d[Re] !== void 0)
|
|
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)
|
|
58
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");
|
|
59
|
-
} else
|
|
60
|
-
console.assert(
|
|
61
|
-
const
|
|
62
|
-
s +=
|
|
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);
|
|
63
783
|
}
|
|
64
|
-
const
|
|
65
|
-
return [
|
|
784
|
+
const l = s + (n[t] || "<?>") + (e === he ? "</svg>" : e === pe ? "</math>" : "");
|
|
785
|
+
return [Ke(n, l), i];
|
|
66
786
|
};
|
|
67
|
-
class
|
|
787
|
+
class F {
|
|
68
788
|
constructor({ strings: e, ["_$litType$"]: t }, i) {
|
|
69
789
|
this.parts = [];
|
|
70
|
-
let s,
|
|
71
|
-
const
|
|
72
|
-
if (this.el =
|
|
73
|
-
const
|
|
74
|
-
|
|
790
|
+
let s, r = 0, o = 0;
|
|
791
|
+
const l = e.length - 1, a = this.parts, [h, g] = Ct(e, t);
|
|
792
|
+
if (this.el = F.createElement(h, i), R.currentNode = this.el.content, t === he || t === pe) {
|
|
793
|
+
const p = this.el.content.firstChild;
|
|
794
|
+
p.replaceWith(...p.childNodes);
|
|
75
795
|
}
|
|
76
|
-
for (; (s =
|
|
796
|
+
for (; (s = R.nextNode()) !== null && a.length < l; ) {
|
|
77
797
|
if (s.nodeType === 1) {
|
|
78
798
|
{
|
|
79
|
-
const
|
|
80
|
-
if (/^(?:textarea|template)$/i.test(
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
83
|
-
throw new Error(
|
|
84
|
-
|
|
799
|
+
const p = s.localName;
|
|
800
|
+
if (/^(?:textarea|template)$/i.test(p) && s.innerHTML.includes(x)) {
|
|
801
|
+
const c = `Expressions are not supported inside \`${p}\` elements. See https://lit.dev/msg/expression-in-${p} for more information.`;
|
|
802
|
+
if (p === "template")
|
|
803
|
+
throw new Error(c);
|
|
804
|
+
H("", c);
|
|
85
805
|
}
|
|
86
806
|
}
|
|
87
807
|
if (s.hasAttributes())
|
|
88
|
-
for (const
|
|
89
|
-
if (
|
|
90
|
-
const
|
|
808
|
+
for (const p of s.getAttributeNames())
|
|
809
|
+
if (p.endsWith(Be)) {
|
|
810
|
+
const c = g[o++], f = s.getAttribute(p).split(x), _ = /([.?@])?(.*)/.exec(c);
|
|
91
811
|
a.push({
|
|
92
|
-
type:
|
|
93
|
-
index:
|
|
94
|
-
name:
|
|
95
|
-
strings:
|
|
96
|
-
ctor:
|
|
97
|
-
}), s.removeAttribute(
|
|
98
|
-
} else
|
|
99
|
-
type:
|
|
100
|
-
index:
|
|
101
|
-
}), s.removeAttribute(
|
|
102
|
-
if (
|
|
103
|
-
const
|
|
104
|
-
if (
|
|
105
|
-
s.textContent =
|
|
106
|
-
for (let
|
|
107
|
-
s.append(
|
|
108
|
-
s.append(
|
|
812
|
+
type: _e,
|
|
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());
|
|
109
829
|
}
|
|
110
830
|
}
|
|
111
831
|
} else if (s.nodeType === 8)
|
|
112
|
-
if (s.data ===
|
|
113
|
-
a.push({ type:
|
|
832
|
+
if (s.data === Fe)
|
|
833
|
+
a.push({ type: J, index: r });
|
|
114
834
|
else {
|
|
115
|
-
let
|
|
116
|
-
for (; (
|
|
117
|
-
a.push({ type:
|
|
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;
|
|
118
838
|
}
|
|
119
|
-
|
|
839
|
+
r++;
|
|
120
840
|
}
|
|
121
|
-
if (
|
|
841
|
+
if (g.length !== o)
|
|
122
842
|
throw new Error('Detected duplicate attribute bindings. This occurs if your template has duplicate attributes on an element tag. For example "<input ?disabled=${true} ?disabled=${false}>" contains a duplicate "disabled" attribute. The error was detected in the following template: \n`' + e.join("${...}") + "`");
|
|
123
843
|
u && u({
|
|
124
844
|
kind: "template prep",
|
|
@@ -131,21 +851,21 @@ class U {
|
|
|
131
851
|
// Overridden via `litHtmlPolyfillSupport` to provide platform support.
|
|
132
852
|
/** @nocollapse */
|
|
133
853
|
static createElement(e, t) {
|
|
134
|
-
const i =
|
|
854
|
+
const i = k.createElement("template");
|
|
135
855
|
return i.innerHTML = e, i;
|
|
136
856
|
}
|
|
137
857
|
}
|
|
138
|
-
function L(
|
|
139
|
-
if (e ===
|
|
858
|
+
function L(n, e, t = n, i) {
|
|
859
|
+
if (e === E)
|
|
140
860
|
return e;
|
|
141
861
|
let s = i !== void 0 ? t.__directives?.[i] : t.__directive;
|
|
142
|
-
const
|
|
862
|
+
const r = B(e) ? void 0 : (
|
|
143
863
|
// This property needs to remain unminified.
|
|
144
864
|
e._$litDirective$
|
|
145
865
|
);
|
|
146
|
-
return s?.constructor !==
|
|
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;
|
|
147
867
|
}
|
|
148
|
-
class
|
|
868
|
+
class Et {
|
|
149
869
|
constructor(e, t) {
|
|
150
870
|
this._$parts = [], this._$disconnectableChildren = void 0, this._$template = e, this._$parent = t;
|
|
151
871
|
}
|
|
@@ -160,17 +880,17 @@ class qe {
|
|
|
160
880
|
// This method is separate from the constructor because we need to return a
|
|
161
881
|
// DocumentFragment and we don't want to hold onto it with an instance field.
|
|
162
882
|
_clone(e) {
|
|
163
|
-
const { el: { content: t }, parts: i } = this._$template, s = (e?.creationScope ??
|
|
164
|
-
|
|
165
|
-
let
|
|
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];
|
|
166
886
|
for (; a !== void 0; ) {
|
|
167
|
-
if (
|
|
168
|
-
let
|
|
169
|
-
a.type ===
|
|
887
|
+
if (o === a.index) {
|
|
888
|
+
let h;
|
|
889
|
+
a.type === J ? h = new X(r, r.nextSibling, this, e) : a.type === _e ? h = new a.ctor(r, a.name, a.strings, this, e) : a.type === ye && (h = new At(r, this, e)), this._$parts.push(h), a = i[++l];
|
|
170
890
|
}
|
|
171
|
-
|
|
891
|
+
o !== a?.index && (r = R.nextNode(), o++);
|
|
172
892
|
}
|
|
173
|
-
return
|
|
893
|
+
return R.currentNode = k, s;
|
|
174
894
|
}
|
|
175
895
|
_update(e) {
|
|
176
896
|
let t = 0;
|
|
@@ -185,13 +905,13 @@ class qe {
|
|
|
185
905
|
}), i.strings !== void 0 ? (i._$setValue(e, i, t), t += i.strings.length - 2) : i._$setValue(e[t])), t++;
|
|
186
906
|
}
|
|
187
907
|
}
|
|
188
|
-
let
|
|
908
|
+
let X = class Ge {
|
|
189
909
|
// See comment in Disconnectable interface for why this is a getter
|
|
190
910
|
get _$isConnected() {
|
|
191
911
|
return this._$parent?._$isConnected ?? this.__isConnected;
|
|
192
912
|
}
|
|
193
913
|
constructor(e, t, i, s) {
|
|
194
|
-
this.type =
|
|
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;
|
|
195
915
|
}
|
|
196
916
|
/**
|
|
197
917
|
* The parent node into which the part renders its content.
|
|
@@ -212,7 +932,7 @@ let oe = class Ve {
|
|
|
212
932
|
* consists of all child nodes of `.parentNode`.
|
|
213
933
|
*/
|
|
214
934
|
get parentNode() {
|
|
215
|
-
let e =
|
|
935
|
+
let e = S(this._$startNode).parentNode;
|
|
216
936
|
const t = this._$parent;
|
|
217
937
|
return t !== void 0 && e?.nodeType === 11 && (e = t.parentNode), e;
|
|
218
938
|
}
|
|
@@ -233,14 +953,14 @@ let oe = class Ve {
|
|
|
233
953
|
_$setValue(e, t = this) {
|
|
234
954
|
if (this.parentNode === null)
|
|
235
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.");
|
|
236
|
-
if (e = L(this, e, t),
|
|
237
|
-
e ===
|
|
956
|
+
if (e = L(this, e, t), B(e))
|
|
957
|
+
e === m || e == null || e === "" ? (this._$committedValue !== m && (u && u({
|
|
238
958
|
kind: "commit nothing to child",
|
|
239
959
|
start: this._$startNode,
|
|
240
960
|
end: this._$endNode,
|
|
241
961
|
parent: this._$parent,
|
|
242
962
|
options: this.options
|
|
243
|
-
}), this._$clear()), this._$committedValue =
|
|
963
|
+
}), this._$clear()), this._$committedValue = m) : e !== this._$committedValue && e !== E && this._commitText(e);
|
|
244
964
|
else if (e._$litType$ !== void 0)
|
|
245
965
|
this._commitTemplateResult(e);
|
|
246
966
|
else if (e.nodeType !== void 0) {
|
|
@@ -249,14 +969,14 @@ let oe = class Ve {
|
|
|
249
969
|
return;
|
|
250
970
|
}
|
|
251
971
|
this._commitNode(e);
|
|
252
|
-
} else
|
|
972
|
+
} else mt(e) ? this._commitIterable(e) : this._commitText(e);
|
|
253
973
|
}
|
|
254
974
|
_insert(e) {
|
|
255
|
-
return
|
|
975
|
+
return S(S(this._$startNode).parentNode).insertBefore(e, this._$endNode);
|
|
256
976
|
}
|
|
257
977
|
_commitNode(e) {
|
|
258
978
|
if (this._$committedValue !== e) {
|
|
259
|
-
if (this._$clear(),
|
|
979
|
+
if (this._$clear(), O !== Z) {
|
|
260
980
|
const t = this._$startNode.parentNode?.nodeName;
|
|
261
981
|
if (t === "STYLE" || t === "SCRIPT") {
|
|
262
982
|
let i = "Forbidden";
|
|
@@ -273,17 +993,17 @@ let oe = class Ve {
|
|
|
273
993
|
}
|
|
274
994
|
}
|
|
275
995
|
_commitText(e) {
|
|
276
|
-
if (this._$committedValue !==
|
|
277
|
-
const t =
|
|
278
|
-
this._textSanitizer === void 0 && (this._textSanitizer =
|
|
996
|
+
if (this._$committedValue !== m && B(this._$committedValue)) {
|
|
997
|
+
const t = S(this._$startNode).nextSibling;
|
|
998
|
+
this._textSanitizer === void 0 && (this._textSanitizer = ce(t, "data", "property")), e = this._textSanitizer(e), u && u({
|
|
279
999
|
kind: "commit text",
|
|
280
1000
|
node: t,
|
|
281
1001
|
value: e,
|
|
282
1002
|
options: this.options
|
|
283
1003
|
}), t.data = e;
|
|
284
1004
|
} else {
|
|
285
|
-
const t =
|
|
286
|
-
this._commitNode(t), this._textSanitizer === void 0 && (this._textSanitizer =
|
|
1005
|
+
const t = k.createTextNode("");
|
|
1006
|
+
this._commitNode(t), this._textSanitizer === void 0 && (this._textSanitizer = ce(t, "data", "property")), e = this._textSanitizer(e), u && u({
|
|
287
1007
|
kind: "commit text",
|
|
288
1008
|
node: t,
|
|
289
1009
|
value: e,
|
|
@@ -293,7 +1013,7 @@ let oe = class Ve {
|
|
|
293
1013
|
this._$committedValue = e;
|
|
294
1014
|
}
|
|
295
1015
|
_commitTemplateResult(e) {
|
|
296
|
-
const { values: t, ["_$litType$"]: i } = e, s = typeof i == "number" ? this._$getTemplate(e) : (i.el === void 0 && (i.el =
|
|
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);
|
|
297
1017
|
if (this._$committedValue?._$template === s)
|
|
298
1018
|
u && u({
|
|
299
1019
|
kind: "template updating",
|
|
@@ -304,39 +1024,39 @@ let oe = class Ve {
|
|
|
304
1024
|
values: t
|
|
305
1025
|
}), this._$committedValue._update(t);
|
|
306
1026
|
else {
|
|
307
|
-
const
|
|
1027
|
+
const r = new Et(s, this), o = r._clone(this.options);
|
|
308
1028
|
u && u({
|
|
309
1029
|
kind: "template instantiated",
|
|
310
1030
|
template: s,
|
|
311
|
-
instance:
|
|
312
|
-
parts:
|
|
1031
|
+
instance: r,
|
|
1032
|
+
parts: r._$parts,
|
|
313
1033
|
options: this.options,
|
|
314
|
-
fragment:
|
|
1034
|
+
fragment: o,
|
|
315
1035
|
values: t
|
|
316
|
-
}),
|
|
1036
|
+
}), r._update(t), u && u({
|
|
317
1037
|
kind: "template instantiated and updated",
|
|
318
1038
|
template: s,
|
|
319
|
-
instance:
|
|
320
|
-
parts:
|
|
1039
|
+
instance: r,
|
|
1040
|
+
parts: r._$parts,
|
|
321
1041
|
options: this.options,
|
|
322
|
-
fragment:
|
|
1042
|
+
fragment: o,
|
|
323
1043
|
values: t
|
|
324
|
-
}), this._commitNode(
|
|
1044
|
+
}), this._commitNode(o), this._$committedValue = r;
|
|
325
1045
|
}
|
|
326
1046
|
}
|
|
327
1047
|
// Overridden via `litHtmlPolyfillSupport` to provide platform support.
|
|
328
1048
|
/** @internal */
|
|
329
1049
|
_$getTemplate(e) {
|
|
330
|
-
let t =
|
|
331
|
-
return t === void 0 &&
|
|
1050
|
+
let t = De.get(e.strings);
|
|
1051
|
+
return t === void 0 && De.set(e.strings, t = new F(e)), t;
|
|
332
1052
|
}
|
|
333
1053
|
_commitIterable(e) {
|
|
334
|
-
|
|
1054
|
+
ge(this._$committedValue) || (this._$committedValue = [], this._$clear());
|
|
335
1055
|
const t = this._$committedValue;
|
|
336
1056
|
let i = 0, s;
|
|
337
|
-
for (const
|
|
338
|
-
i === t.length ? t.push(s = new
|
|
339
|
-
i < t.length && (this._$clear(s &&
|
|
1057
|
+
for (const r of e)
|
|
1058
|
+
i === t.length ? t.push(s = new Ge(this._insert(j()), this._insert(j()), this, this.options)) : s = t[i], s._$setValue(r), i++;
|
|
1059
|
+
i < t.length && (this._$clear(s && S(s._$endNode).nextSibling, i), t.length = i);
|
|
340
1060
|
}
|
|
341
1061
|
/**
|
|
342
1062
|
* Removes the nodes contained within this Part from the DOM.
|
|
@@ -349,10 +1069,10 @@ let oe = class Ve {
|
|
|
349
1069
|
*
|
|
350
1070
|
* @internal
|
|
351
1071
|
*/
|
|
352
|
-
_$clear(e =
|
|
1072
|
+
_$clear(e = S(this._$startNode).nextSibling, t) {
|
|
353
1073
|
for (this._$notifyConnectionChanged?.(!1, !0, t); e && e !== this._$endNode; ) {
|
|
354
|
-
const i =
|
|
355
|
-
|
|
1074
|
+
const i = S(e).nextSibling;
|
|
1075
|
+
S(e).remove(), e = i;
|
|
356
1076
|
}
|
|
357
1077
|
}
|
|
358
1078
|
/**
|
|
@@ -369,7 +1089,7 @@ let oe = class Ve {
|
|
|
369
1089
|
throw new Error("part.setConnected() may only be called on a RootPart returned from render().");
|
|
370
1090
|
}
|
|
371
1091
|
};
|
|
372
|
-
class
|
|
1092
|
+
class ee {
|
|
373
1093
|
get tagName() {
|
|
374
1094
|
return this.element.tagName;
|
|
375
1095
|
}
|
|
@@ -377,8 +1097,8 @@ class W {
|
|
|
377
1097
|
get _$isConnected() {
|
|
378
1098
|
return this._$parent._$isConnected;
|
|
379
1099
|
}
|
|
380
|
-
constructor(e, t, i, s,
|
|
381
|
-
this.type =
|
|
1100
|
+
constructor(e, t, i, s, r) {
|
|
1101
|
+
this.type = _e, this._$committedValue = m, this._$disconnectableChildren = void 0, this.element = e, this.name = t, this._$parent = s, this.options = r, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$committedValue = new Array(i.length - 1).fill(new String()), this.strings = i) : this._$committedValue = m, this._sanitizer = void 0;
|
|
382
1102
|
}
|
|
383
1103
|
/**
|
|
384
1104
|
* Sets the value of this part by resolving the value from possibly multiple
|
|
@@ -403,48 +1123,48 @@ class W {
|
|
|
403
1123
|
* @internal
|
|
404
1124
|
*/
|
|
405
1125
|
_$setValue(e, t = this, i, s) {
|
|
406
|
-
const
|
|
407
|
-
let
|
|
408
|
-
if (
|
|
409
|
-
e = L(this, e, t, 0),
|
|
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);
|
|
410
1130
|
else {
|
|
411
|
-
const
|
|
412
|
-
e =
|
|
413
|
-
let a,
|
|
414
|
-
for (a = 0; a <
|
|
415
|
-
|
|
1131
|
+
const l = e;
|
|
1132
|
+
e = r[0];
|
|
1133
|
+
let a, h;
|
|
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;
|
|
416
1136
|
}
|
|
417
|
-
|
|
1137
|
+
o && !s && this._commitValue(e);
|
|
418
1138
|
}
|
|
419
1139
|
/** @internal */
|
|
420
1140
|
_commitValue(e) {
|
|
421
|
-
e ===
|
|
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({
|
|
422
1142
|
kind: "commit attribute",
|
|
423
1143
|
element: this.element,
|
|
424
1144
|
name: this.name,
|
|
425
1145
|
value: e,
|
|
426
1146
|
options: this.options
|
|
427
|
-
}),
|
|
1147
|
+
}), S(this.element).setAttribute(this.name, e ?? ""));
|
|
428
1148
|
}
|
|
429
1149
|
}
|
|
430
|
-
class
|
|
1150
|
+
class Nt extends ee {
|
|
431
1151
|
constructor() {
|
|
432
|
-
super(...arguments), this.type =
|
|
1152
|
+
super(...arguments), this.type = St;
|
|
433
1153
|
}
|
|
434
1154
|
/** @internal */
|
|
435
1155
|
_commitValue(e) {
|
|
436
|
-
this._sanitizer === void 0 && (this._sanitizer =
|
|
1156
|
+
this._sanitizer === void 0 && (this._sanitizer = O(this.element, this.name, "property")), e = this._sanitizer(e), u && u({
|
|
437
1157
|
kind: "commit property",
|
|
438
1158
|
element: this.element,
|
|
439
1159
|
name: this.name,
|
|
440
1160
|
value: e,
|
|
441
1161
|
options: this.options
|
|
442
|
-
}), this.element[this.name] = e ===
|
|
1162
|
+
}), this.element[this.name] = e === m ? void 0 : e;
|
|
443
1163
|
}
|
|
444
1164
|
}
|
|
445
|
-
class
|
|
1165
|
+
class Mt extends ee {
|
|
446
1166
|
constructor() {
|
|
447
|
-
super(...arguments), this.type =
|
|
1167
|
+
super(...arguments), this.type = vt;
|
|
448
1168
|
}
|
|
449
1169
|
/** @internal */
|
|
450
1170
|
_commitValue(e) {
|
|
@@ -452,23 +1172,23 @@ class Qe extends W {
|
|
|
452
1172
|
kind: "commit boolean attribute",
|
|
453
1173
|
element: this.element,
|
|
454
1174
|
name: this.name,
|
|
455
|
-
value: !!(e && e !==
|
|
1175
|
+
value: !!(e && e !== m),
|
|
456
1176
|
options: this.options
|
|
457
|
-
}),
|
|
1177
|
+
}), S(this.element).toggleAttribute(this.name, !!e && e !== m);
|
|
458
1178
|
}
|
|
459
1179
|
}
|
|
460
|
-
class
|
|
461
|
-
constructor(e, t, i, s,
|
|
462
|
-
if (super(e, t, i, s,
|
|
1180
|
+
class Ut extends ee {
|
|
1181
|
+
constructor(e, t, i, s, r) {
|
|
1182
|
+
if (super(e, t, i, s, r), this.type = Pt, this.strings !== void 0)
|
|
463
1183
|
throw new Error(`A \`<${e.localName}>\` has a \`@${t}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`);
|
|
464
1184
|
}
|
|
465
1185
|
// EventPart does not use the base _$setValue/_resolveValue implementation
|
|
466
1186
|
// since the dirty checking is more complex
|
|
467
1187
|
/** @internal */
|
|
468
1188
|
_$setValue(e, t = this) {
|
|
469
|
-
if (e = L(this, e, t, 0) ??
|
|
1189
|
+
if (e = L(this, e, t, 0) ?? m, e === E)
|
|
470
1190
|
return;
|
|
471
|
-
const i = this._$committedValue, s = e ===
|
|
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);
|
|
472
1192
|
u && u({
|
|
473
1193
|
kind: "commit event listener",
|
|
474
1194
|
element: this.element,
|
|
@@ -476,17 +1196,17 @@ class Xe extends W {
|
|
|
476
1196
|
value: e,
|
|
477
1197
|
options: this.options,
|
|
478
1198
|
removeListener: s,
|
|
479
|
-
addListener:
|
|
1199
|
+
addListener: r,
|
|
480
1200
|
oldListener: i
|
|
481
|
-
}), s && this.element.removeEventListener(this.name, this, i),
|
|
1201
|
+
}), s && this.element.removeEventListener(this.name, this, i), r && this.element.addEventListener(this.name, this, e), this._$committedValue = e;
|
|
482
1202
|
}
|
|
483
1203
|
handleEvent(e) {
|
|
484
1204
|
typeof this._$committedValue == "function" ? this._$committedValue.call(this.options?.host ?? this.element, e) : this._$committedValue.handleEvent(e);
|
|
485
1205
|
}
|
|
486
1206
|
}
|
|
487
|
-
class
|
|
1207
|
+
class At {
|
|
488
1208
|
constructor(e, t, i) {
|
|
489
|
-
this.element = e, this.type =
|
|
1209
|
+
this.element = e, this.type = ye, this._$disconnectableChildren = void 0, this._$parent = t, this.options = i;
|
|
490
1210
|
}
|
|
491
1211
|
// See comment in Disconnectable interface for why this is a getter
|
|
492
1212
|
get _$isConnected() {
|
|
@@ -501,23 +1221,210 @@ class Je {
|
|
|
501
1221
|
}), L(this, e);
|
|
502
1222
|
}
|
|
503
1223
|
}
|
|
504
|
-
const
|
|
505
|
-
_ChildPart:
|
|
506
|
-
},
|
|
507
|
-
|
|
508
|
-
(
|
|
509
|
-
|
|
510
|
-
|
|
1224
|
+
const Rt = {
|
|
1225
|
+
_ChildPart: X
|
|
1226
|
+
}, kt = b.litHtmlPolyfillSupportDevMode;
|
|
1227
|
+
kt?.(F, X);
|
|
1228
|
+
(b.litHtmlVersions ??= []).push("3.3.0");
|
|
1229
|
+
b.litHtmlVersions.length > 1 && queueMicrotask(() => {
|
|
1230
|
+
H("multiple-versions", "Multiple versions of Lit loaded. Loading multiple versions is not recommended.");
|
|
511
1231
|
});
|
|
512
|
-
const
|
|
1232
|
+
const K = (n, e, t) => {
|
|
1233
|
+
if (e == null)
|
|
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;
|
|
1256
|
+
};
|
|
1257
|
+
K.setSanitizer = pt, K.createSanitizer = ce, K._testOnlyClearSanitizerFactoryDoNotCallOrElse = ut;
|
|
1258
|
+
const Ot = (n, e) => n, M = globalThis;
|
|
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 {
|
|
1264
|
+
constructor() {
|
|
1265
|
+
super(...arguments), this.renderOptions = { host: this }, this.__childPart = void 0;
|
|
1266
|
+
}
|
|
1267
|
+
/**
|
|
1268
|
+
* @category rendering
|
|
1269
|
+
*/
|
|
1270
|
+
createRenderRoot() {
|
|
1271
|
+
const e = super.createRenderRoot();
|
|
1272
|
+
return this.renderOptions.renderBefore ??= e.firstChild, e;
|
|
1273
|
+
}
|
|
1274
|
+
/**
|
|
1275
|
+
* Updates the element. This method reflects property values to attributes
|
|
1276
|
+
* and calls `render` to render DOM via lit-html. Setting properties inside
|
|
1277
|
+
* this method will *not* trigger another update.
|
|
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
|
+
*/
|
|
1305
|
+
connectedCallback() {
|
|
1306
|
+
super.connectedCallback(), this.__childPart?.setConnected(!0);
|
|
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
|
+
*/
|
|
1327
|
+
disconnectedCallback() {
|
|
1328
|
+
super.disconnectedCallback(), this.__childPart?.setConnected(!1);
|
|
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
|
+
*/
|
|
1337
|
+
render() {
|
|
1338
|
+
return E;
|
|
1339
|
+
}
|
|
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
|
+
};
|
|
1355
|
+
let Je;
|
|
1356
|
+
globalThis.litIssuedWarnings ??= /* @__PURE__ */ new Set(), Je = (n, e) => {
|
|
1357
|
+
e += ` See https://lit.dev/msg/${n} for more information.`, !globalThis.litIssuedWarnings.has(e) && !globalThis.litIssuedWarnings.has(n) && (console.warn(e), globalThis.litIssuedWarnings.add(e));
|
|
1358
|
+
};
|
|
1359
|
+
const Dt = (n, e, t) => {
|
|
1360
|
+
const i = e.hasOwnProperty(t);
|
|
1361
|
+
return e.constructor.createProperty(t, n), i ? Object.getOwnPropertyDescriptor(e, t) : void 0;
|
|
1362
|
+
}, zt = {
|
|
1363
|
+
attribute: !0,
|
|
1364
|
+
type: String,
|
|
1365
|
+
converter: G,
|
|
1366
|
+
reflect: !1,
|
|
1367
|
+
hasChanged: me
|
|
1368
|
+
}, It = (n = zt, e, t) => {
|
|
1369
|
+
const { kind: i, metadata: s } = t;
|
|
1370
|
+
s == null && Je("missing-class-metadata", `The class ${e} is missing decorator metadata. This could mean that you're using a compiler that supports decorators but doesn't support decorator metadata, such as TypeScript 5.1. Please update your compiler.`);
|
|
1371
|
+
let r = globalThis.litPropertyMetadata.get(s);
|
|
1372
|
+
if (r === void 0 && globalThis.litPropertyMetadata.set(s, r = /* @__PURE__ */ new Map()), i === "setter" && (n = Object.create(n), n.wrapped = !0), r.set(t.name, n), i === "accessor") {
|
|
1373
|
+
const { name: o } = t;
|
|
1374
|
+
return {
|
|
1375
|
+
set(l) {
|
|
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);
|
|
1388
|
+
};
|
|
1389
|
+
}
|
|
1390
|
+
throw new Error(`Unsupported decorator location: ${i}`);
|
|
1391
|
+
};
|
|
1392
|
+
function te(n) {
|
|
1393
|
+
return (e, t) => typeof t == "object" ? It(n, e, t) : Dt(n, e, t);
|
|
1394
|
+
}
|
|
1395
|
+
function z(n) {
|
|
1396
|
+
return te({
|
|
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
|
+
});
|
|
1404
|
+
}
|
|
1405
|
+
const Wt = (n, e, t) => (t.configurable = !0, t.enumerable = !0, // We check for Reflect.decorate each time, in case the zombiefill
|
|
1406
|
+
// is applied via lazy loading some Angular code.
|
|
1407
|
+
Reflect.decorate && typeof e != "object" && Object.defineProperty(n, e, t), t);
|
|
1408
|
+
globalThis.litIssuedWarnings ??= /* @__PURE__ */ new Set();
|
|
1409
|
+
function Ht(n, e) {
|
|
1410
|
+
return ((t, i, s) => {
|
|
1411
|
+
const r = (o) => o.renderRoot?.querySelector(n) ?? null;
|
|
1412
|
+
return Wt(t, i, {
|
|
1413
|
+
get() {
|
|
1414
|
+
return r(this);
|
|
1415
|
+
}
|
|
1416
|
+
});
|
|
1417
|
+
});
|
|
1418
|
+
}
|
|
1419
|
+
const be = {
|
|
513
1420
|
ATTRIBUTE: 1,
|
|
514
1421
|
CHILD: 2
|
|
515
|
-
},
|
|
1422
|
+
}, $e = (n) => (...e) => ({
|
|
516
1423
|
// This property needs to remain unminified.
|
|
517
|
-
_$litDirective$:
|
|
1424
|
+
_$litDirective$: n,
|
|
518
1425
|
values: e
|
|
519
1426
|
});
|
|
520
|
-
class
|
|
1427
|
+
class we {
|
|
521
1428
|
constructor(e) {
|
|
522
1429
|
}
|
|
523
1430
|
// See comment in Disconnectable interface for why this is a getter
|
|
@@ -536,10 +1443,10 @@ class le {
|
|
|
536
1443
|
return this.render(...t);
|
|
537
1444
|
}
|
|
538
1445
|
}
|
|
539
|
-
const
|
|
540
|
-
class
|
|
1446
|
+
const Qe = "important", Ze = " !" + Qe, jt = 0 - Ze.length;
|
|
1447
|
+
class Bt extends we {
|
|
541
1448
|
constructor(e) {
|
|
542
|
-
if (super(e), e.type !==
|
|
1449
|
+
if (super(e), e.type !== be.ATTRIBUTE || e.name !== "style" || e.strings?.length > 2)
|
|
543
1450
|
throw new Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
|
|
544
1451
|
}
|
|
545
1452
|
render(e) {
|
|
@@ -555,27 +1462,27 @@ class st extends le {
|
|
|
555
1462
|
for (const s of this._previousStyleProperties)
|
|
556
1463
|
t[s] == null && (this._previousStyleProperties.delete(s), s.includes("-") ? i.removeProperty(s) : i[s] = null);
|
|
557
1464
|
for (const s in t) {
|
|
558
|
-
const
|
|
559
|
-
if (
|
|
1465
|
+
const r = t[s];
|
|
1466
|
+
if (r != null) {
|
|
560
1467
|
this._previousStyleProperties.add(s);
|
|
561
|
-
const
|
|
562
|
-
s.includes("-") ||
|
|
1468
|
+
const o = typeof r == "string" && r.endsWith(Ze);
|
|
1469
|
+
s.includes("-") || o ? i.setProperty(s, o ? r.slice(0, jt) : r, o ? Qe : "") : i[s] = r;
|
|
563
1470
|
}
|
|
564
1471
|
}
|
|
565
|
-
return
|
|
1472
|
+
return E;
|
|
566
1473
|
}
|
|
567
1474
|
}
|
|
568
|
-
const
|
|
569
|
-
const
|
|
570
|
-
class
|
|
1475
|
+
const ae = $e(Bt);
|
|
1476
|
+
const Ft = 1;
|
|
1477
|
+
class Se extends we {
|
|
571
1478
|
constructor(e) {
|
|
572
|
-
if (super(e), this._value =
|
|
1479
|
+
if (super(e), this._value = m, e.type !== be.CHILD)
|
|
573
1480
|
throw new Error(`${this.constructor.directiveName}() can only be used in child bindings`);
|
|
574
1481
|
}
|
|
575
1482
|
render(e) {
|
|
576
|
-
if (e ===
|
|
1483
|
+
if (e === m || e == null)
|
|
577
1484
|
return this._templateResult = void 0, this._value = e;
|
|
578
|
-
if (e ===
|
|
1485
|
+
if (e === E)
|
|
579
1486
|
return e;
|
|
580
1487
|
if (typeof e != "string")
|
|
581
1488
|
throw new Error(`${this.constructor.directiveName}() called with a non-string value`);
|
|
@@ -593,127 +1500,127 @@ class de extends le {
|
|
|
593
1500
|
};
|
|
594
1501
|
}
|
|
595
1502
|
}
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
const
|
|
599
|
-
class
|
|
1503
|
+
Se.directiveName = "unsafeHTML";
|
|
1504
|
+
Se.resultType = Ft;
|
|
1505
|
+
const qt = 2;
|
|
1506
|
+
class ve extends Se {
|
|
600
1507
|
}
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
const
|
|
604
|
-
const { _ChildPart:
|
|
605
|
-
const i = T(
|
|
1508
|
+
ve.directiveName = "unsafeSVG";
|
|
1509
|
+
ve.resultType = qt;
|
|
1510
|
+
const Kt = $e(ve);
|
|
1511
|
+
const { _ChildPart: Gt } = Rt, T = window.ShadyDOM?.inUse && window.ShadyDOM?.noPatch === !0 ? window.ShadyDOM.wrap : (n) => n, ze = () => document.createComment(""), W = (n, e, t) => {
|
|
1512
|
+
const i = T(n._$startNode).parentNode, s = e === void 0 ? n._$endNode : e._$startNode;
|
|
606
1513
|
if (t === void 0) {
|
|
607
|
-
const
|
|
608
|
-
t = new
|
|
1514
|
+
const r = T(i).insertBefore(ze(), s), o = T(i).insertBefore(ze(), s);
|
|
1515
|
+
t = new Gt(r, o, n, n.options);
|
|
609
1516
|
} else {
|
|
610
|
-
const
|
|
611
|
-
if (
|
|
612
|
-
t._$reparentDisconnectables?.(
|
|
1517
|
+
const r = T(t._$endNode).nextSibling, o = t._$parent, l = o !== n;
|
|
1518
|
+
if (l) {
|
|
1519
|
+
t._$reparentDisconnectables?.(n), t._$parent = n;
|
|
613
1520
|
let a;
|
|
614
|
-
t._$notifyConnectionChanged !== void 0 && (a =
|
|
1521
|
+
t._$notifyConnectionChanged !== void 0 && (a = n._$isConnected) !== o._$isConnected && t._$notifyConnectionChanged(a);
|
|
615
1522
|
}
|
|
616
|
-
if (
|
|
1523
|
+
if (r !== s || l) {
|
|
617
1524
|
let a = t._$startNode;
|
|
618
|
-
for (; a !==
|
|
619
|
-
const
|
|
620
|
-
T(i).insertBefore(a, s), a =
|
|
1525
|
+
for (; a !== r; ) {
|
|
1526
|
+
const h = T(a).nextSibling;
|
|
1527
|
+
T(i).insertBefore(a, s), a = h;
|
|
621
1528
|
}
|
|
622
1529
|
}
|
|
623
1530
|
}
|
|
624
1531
|
return t;
|
|
625
|
-
},
|
|
626
|
-
|
|
627
|
-
let e =
|
|
628
|
-
const t = T(
|
|
1532
|
+
}, A = (n, e, t = n) => (n._$setValue(e, t), n), Yt = {}, Jt = (n, e = Yt) => n._$committedValue = e, Qt = (n) => n._$committedValue, le = (n) => {
|
|
1533
|
+
n._$notifyConnectionChanged?.(!1, !0);
|
|
1534
|
+
let e = n._$startNode;
|
|
1535
|
+
const t = T(n._$endNode).nextSibling;
|
|
629
1536
|
for (; e !== t; ) {
|
|
630
1537
|
const i = T(e).nextSibling;
|
|
631
1538
|
T(e).remove(), e = i;
|
|
632
1539
|
}
|
|
633
1540
|
};
|
|
634
|
-
const
|
|
1541
|
+
const Ie = (n, e, t) => {
|
|
635
1542
|
const i = /* @__PURE__ */ new Map();
|
|
636
1543
|
for (let s = e; s <= t; s++)
|
|
637
|
-
i.set(
|
|
1544
|
+
i.set(n[s], s);
|
|
638
1545
|
return i;
|
|
639
1546
|
};
|
|
640
|
-
class
|
|
1547
|
+
class Zt extends we {
|
|
641
1548
|
constructor(e) {
|
|
642
|
-
if (super(e), e.type !==
|
|
1549
|
+
if (super(e), e.type !== be.CHILD)
|
|
643
1550
|
throw new Error("repeat() can only be used in text expressions");
|
|
644
1551
|
}
|
|
645
1552
|
_getValuesAndKeys(e, t, i) {
|
|
646
1553
|
let s;
|
|
647
1554
|
i === void 0 ? i = t : t !== void 0 && (s = t);
|
|
648
|
-
const
|
|
649
|
-
let
|
|
1555
|
+
const r = [], o = [];
|
|
1556
|
+
let l = 0;
|
|
650
1557
|
for (const a of e)
|
|
651
|
-
|
|
1558
|
+
r[l] = s ? s(a, l) : l, o[l] = i(a, l), l++;
|
|
652
1559
|
return {
|
|
653
|
-
values:
|
|
654
|
-
keys:
|
|
1560
|
+
values: o,
|
|
1561
|
+
keys: r
|
|
655
1562
|
};
|
|
656
1563
|
}
|
|
657
1564
|
render(e, t, i) {
|
|
658
1565
|
return this._getValuesAndKeys(e, t, i).values;
|
|
659
1566
|
}
|
|
660
1567
|
update(e, [t, i, s]) {
|
|
661
|
-
const
|
|
662
|
-
if (!Array.isArray(
|
|
663
|
-
return this._itemKeys =
|
|
664
|
-
const a = this._itemKeys ??= [],
|
|
665
|
-
let
|
|
666
|
-
for (;
|
|
667
|
-
if (
|
|
668
|
-
|
|
669
|
-
else if (
|
|
670
|
-
|
|
671
|
-
else if (a[
|
|
672
|
-
|
|
673
|
-
else if (a[
|
|
674
|
-
|
|
675
|
-
else if (a[
|
|
676
|
-
|
|
677
|
-
else if (a[
|
|
678
|
-
|
|
679
|
-
else if (
|
|
680
|
-
|
|
681
|
-
else if (!
|
|
682
|
-
|
|
1568
|
+
const r = Qt(e), { values: o, keys: l } = this._getValuesAndKeys(t, i, s);
|
|
1569
|
+
if (!Array.isArray(r))
|
|
1570
|
+
return this._itemKeys = l, o;
|
|
1571
|
+
const a = this._itemKeys ??= [], h = [];
|
|
1572
|
+
let g, p, c = 0, d = r.length - 1, f = 0, _ = o.length - 1;
|
|
1573
|
+
for (; c <= d && f <= _; )
|
|
1574
|
+
if (r[c] === null)
|
|
1575
|
+
c++;
|
|
1576
|
+
else if (r[d] === null)
|
|
1577
|
+
d--;
|
|
1578
|
+
else if (a[c] === l[f])
|
|
1579
|
+
h[f] = A(r[c], o[f]), c++, f++;
|
|
1580
|
+
else if (a[d] === l[_])
|
|
1581
|
+
h[_] = A(r[d], o[_]), d--, _--;
|
|
1582
|
+
else if (a[c] === l[_])
|
|
1583
|
+
h[_] = A(r[c], o[_]), W(e, h[_ + 1], r[c]), c++, _--;
|
|
1584
|
+
else if (a[d] === l[f])
|
|
1585
|
+
h[f] = A(r[d], o[f]), W(e, r[c], r[d]), d--, f++;
|
|
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--;
|
|
683
1590
|
else {
|
|
684
|
-
const
|
|
685
|
-
if (
|
|
686
|
-
const
|
|
687
|
-
|
|
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;
|
|
688
1595
|
} else
|
|
689
|
-
|
|
690
|
-
|
|
1596
|
+
h[f] = A(ie, o[f]), W(e, r[c], ie), r[P] = null;
|
|
1597
|
+
f++;
|
|
691
1598
|
}
|
|
692
|
-
for (;
|
|
693
|
-
const
|
|
694
|
-
|
|
1599
|
+
for (; f <= _; ) {
|
|
1600
|
+
const P = W(e, h[_ + 1]);
|
|
1601
|
+
A(P, o[f]), h[f++] = P;
|
|
695
1602
|
}
|
|
696
|
-
for (;
|
|
697
|
-
const
|
|
698
|
-
|
|
1603
|
+
for (; c <= d; ) {
|
|
1604
|
+
const P = r[c++];
|
|
1605
|
+
P !== null && le(P);
|
|
699
1606
|
}
|
|
700
|
-
return this._itemKeys =
|
|
1607
|
+
return this._itemKeys = l, Jt(e, h), E;
|
|
701
1608
|
}
|
|
702
1609
|
}
|
|
703
|
-
const
|
|
704
|
-
var
|
|
705
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
706
|
-
(
|
|
707
|
-
return i && s &&
|
|
1610
|
+
const de = $e(Zt);
|
|
1611
|
+
var Xt = Object.defineProperty, ei = Object.getOwnPropertyDescriptor, Xe = (n, e, t, i) => {
|
|
1612
|
+
for (var s = i > 1 ? void 0 : i ? ei(e, t) : e, r = n.length - 1, o; r >= 0; r--)
|
|
1613
|
+
(o = n[r]) && (s = (i ? o(e, t, s) : o(s)) || s);
|
|
1614
|
+
return i && s && Xt(e, t, s), s;
|
|
708
1615
|
};
|
|
709
|
-
let
|
|
1616
|
+
let Q = class extends D {
|
|
710
1617
|
render() {
|
|
711
1618
|
return y`
|
|
712
1619
|
${this.value !== void 0 ? y`<div class="bar" style="width: ${this.value * 100}%;"></div>` : y`<div class="indeterminate"></div>`}
|
|
713
1620
|
`;
|
|
714
1621
|
}
|
|
715
1622
|
};
|
|
716
|
-
|
|
1623
|
+
Q.styles = He`
|
|
717
1624
|
:host {
|
|
718
1625
|
display: inline-block;
|
|
719
1626
|
width: var(--progress-width, 200px);
|
|
@@ -755,20 +1662,20 @@ B.styles = ve`
|
|
|
755
1662
|
}
|
|
756
1663
|
}
|
|
757
1664
|
`;
|
|
758
|
-
|
|
1665
|
+
Xe([
|
|
759
1666
|
te({ type: Number })
|
|
760
|
-
],
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
],
|
|
764
|
-
var
|
|
765
|
-
for (var s = void 0,
|
|
766
|
-
(
|
|
767
|
-
return s &&
|
|
1667
|
+
], Q.prototype, "value", 2);
|
|
1668
|
+
Q = Xe([
|
|
1669
|
+
Lt("linear-progress")
|
|
1670
|
+
], Q);
|
|
1671
|
+
var ti = Object.defineProperty, N = (n, e, t, i) => {
|
|
1672
|
+
for (var s = void 0, r = n.length - 1, o; r >= 0; r--)
|
|
1673
|
+
(o = n[r]) && (s = o(e, t, s) || s);
|
|
1674
|
+
return s && ti(e, t, s), s;
|
|
768
1675
|
};
|
|
769
|
-
const
|
|
1676
|
+
const Pe = class Pe extends D {
|
|
770
1677
|
constructor() {
|
|
771
|
-
super(), this.version = "1.0.
|
|
1678
|
+
super(), this.version = "1.0.9", this.getModifier = this.getModifier.bind(this);
|
|
772
1679
|
}
|
|
773
1680
|
update(e) {
|
|
774
1681
|
e.has("inputData") && (this.transform(), this.modifier || this.getModifier()), e.has("theme") && this.registerTheme(this.theme), super.update(e);
|
|
@@ -833,20 +1740,20 @@ const he = class he extends Te {
|
|
|
833
1740
|
if (this.baseLayer instanceof HTMLImageElement)
|
|
834
1741
|
i = this.baseLayer.naturalWidth, s = this.baseLayer.naturalHeight;
|
|
835
1742
|
else {
|
|
836
|
-
const
|
|
837
|
-
if (
|
|
838
|
-
const
|
|
839
|
-
if (console.log(
|
|
840
|
-
i =
|
|
1743
|
+
const c = this.baseLayer.querySelector("svg");
|
|
1744
|
+
if (c) {
|
|
1745
|
+
const d = c.viewBox.baseVal;
|
|
1746
|
+
if (console.log(d), d && d.width > 0 && d.height > 0)
|
|
1747
|
+
i = d.width, s = d.height;
|
|
841
1748
|
else {
|
|
842
|
-
const
|
|
843
|
-
|
|
1749
|
+
const f = this.baseLayer.getAttribute("width"), _ = this.baseLayer.getAttribute("height");
|
|
1750
|
+
f && _ && (i = parseFloat(f), s = parseFloat(_));
|
|
844
1751
|
}
|
|
845
1752
|
}
|
|
846
1753
|
}
|
|
847
1754
|
if (!i || !s) return;
|
|
848
|
-
const
|
|
849
|
-
this.modifier = { scaler:
|
|
1755
|
+
const r = e.width / i, o = e.height / s, l = Math.min(r, o), a = i * l, h = s * l, g = (t.width - a) / 2, p = (t.height - h) / 2;
|
|
1756
|
+
this.modifier = { scaler: l, xOffset: g, yOffset: p, visibleWidth: a, visibleHeight: h };
|
|
850
1757
|
}
|
|
851
1758
|
getOverlayItemPosition(e, t, i) {
|
|
852
1759
|
return {
|
|
@@ -855,53 +1762,53 @@ const he = class he extends Te {
|
|
|
855
1762
|
};
|
|
856
1763
|
}
|
|
857
1764
|
renderText(e, t, i) {
|
|
858
|
-
const s = e,
|
|
859
|
-
if (!
|
|
860
|
-
const
|
|
861
|
-
let
|
|
862
|
-
const a = Number(
|
|
863
|
-
let
|
|
864
|
-
if (!Number.isNaN(a) && typeof
|
|
865
|
-
|
|
866
|
-
const
|
|
867
|
-
|
|
1765
|
+
const s = e, r = this.getOverlayItemPosition(t.relXPos, t.relYPos, i);
|
|
1766
|
+
if (!r) return m;
|
|
1767
|
+
const o = s.textStyle?.precision ?? 1;
|
|
1768
|
+
let l = t.data;
|
|
1769
|
+
const a = Number(l);
|
|
1770
|
+
let h = "#333";
|
|
1771
|
+
if (!Number.isNaN(a) && typeof o == "number" && o >= 0) {
|
|
1772
|
+
l = a.toFixed(o);
|
|
1773
|
+
const p = s.sections?.sectionLimits.findIndex((c) => a <= c) ?? -2;
|
|
1774
|
+
h = (p >= 1 ? s.sections?.colors[p - 1] : "#333") ?? "#333";
|
|
868
1775
|
}
|
|
869
|
-
const
|
|
1776
|
+
const g = {
|
|
870
1777
|
"font-size": (s.textStyle.fontSize ?? 14) * i.scaler + "px",
|
|
871
|
-
color:
|
|
1778
|
+
color: h,
|
|
872
1779
|
"background-color": s.textStyle.backgroundColor,
|
|
873
1780
|
"font-weight": s.textStyle.fontWeight,
|
|
874
|
-
left: `${
|
|
875
|
-
top: `${
|
|
1781
|
+
left: `${r.left}px`,
|
|
1782
|
+
top: `${r.top}px`,
|
|
876
1783
|
"border-radius": 10 * i.scaler + "px",
|
|
877
1784
|
"transform-origin": "50% 50%",
|
|
878
1785
|
transform: "translate(-50%, -50%)",
|
|
879
1786
|
padding: `${6 * i.scaler}px ${12 * i.scaler}px`
|
|
880
1787
|
};
|
|
881
1788
|
return y`
|
|
882
|
-
<div class="overlay-item" style=${
|
|
1789
|
+
<div class="overlay-item" style=${ae(g)}>${t.prefix}${l}${t.suffix}</div>
|
|
883
1790
|
`;
|
|
884
1791
|
}
|
|
885
1792
|
renderProgress(e, t, i) {
|
|
886
|
-
const s = e,
|
|
887
|
-
if (!
|
|
888
|
-
const
|
|
889
|
-
"--progress-color": (
|
|
1793
|
+
const s = e, r = this.getOverlayItemPosition(t.relXPos, t.relYPos, i);
|
|
1794
|
+
if (!r) return m;
|
|
1795
|
+
const o = s.sections?.sectionLimits.findIndex((f) => Number(t.data) <= f) ?? -2, a = {
|
|
1796
|
+
"--progress-color": (o >= 1 ? s.sections?.colors[o - 1] : void 0) ?? "#333",
|
|
890
1797
|
"--progress-width": (s.progressStyle?.width ?? 10) * i.scaler + "px",
|
|
891
1798
|
"--progress-height": (s.progressStyle?.height ?? 100) * i.scaler + "px",
|
|
892
1799
|
"--progress-background": s.progressStyle?.backgroundColor ?? "#fff",
|
|
893
1800
|
"border-radius": 10 * i.scaler + "px",
|
|
894
1801
|
"transform-origin": "50% 50%",
|
|
895
1802
|
transform: `translate(-50%, -50%) rotate(${s.progressStyle?.rotate ?? 0}deg)`,
|
|
896
|
-
left: `${
|
|
897
|
-
top: `${
|
|
898
|
-
},
|
|
899
|
-
let
|
|
900
|
-
return
|
|
1803
|
+
left: `${r.left}px`,
|
|
1804
|
+
top: `${r.top}px`
|
|
1805
|
+
}, h = Number(t.data), g = s.sections ?? {}, p = Math.min(...g.sectionLimits.map(Number)), c = Math.max(...g.sectionLimits.map(Number));
|
|
1806
|
+
let d = c === p ? 0 : (h - p) / (c - p);
|
|
1807
|
+
return d = Math.min(1, Math.max(0, d)), y` <linear-progress .value=${d} style=${ae(a)}></linear-progress> `;
|
|
901
1808
|
}
|
|
902
1809
|
renderLayer(e) {
|
|
903
1810
|
const t = this.modifier;
|
|
904
|
-
if (!t) return
|
|
1811
|
+
if (!t) return m;
|
|
905
1812
|
const i = {
|
|
906
1813
|
left: t.xOffset + "px",
|
|
907
1814
|
top: t.yOffset + "px",
|
|
@@ -910,7 +1817,7 @@ const he = class he extends Te {
|
|
|
910
1817
|
};
|
|
911
1818
|
return y`<div
|
|
912
1819
|
class="overlay"
|
|
913
|
-
style=${
|
|
1820
|
+
style=${ae(i)}
|
|
914
1821
|
type="${e.layerType}"
|
|
915
1822
|
name="${e.layerName}"
|
|
916
1823
|
>
|
|
@@ -919,19 +1826,19 @@ const he = class he extends Te {
|
|
|
919
1826
|
}
|
|
920
1827
|
renderTextLayer(e) {
|
|
921
1828
|
const t = this.modifier;
|
|
922
|
-
return t ? y`${
|
|
1829
|
+
return t ? y`${de(
|
|
923
1830
|
e.textPins ?? [],
|
|
924
1831
|
(i, s) => s,
|
|
925
1832
|
(i) => y`${this.renderText(e, i, t)}`
|
|
926
|
-
)}` :
|
|
1833
|
+
)}` : m;
|
|
927
1834
|
}
|
|
928
1835
|
renderProgressLayer(e) {
|
|
929
1836
|
const t = this.modifier;
|
|
930
|
-
return t ? y`${
|
|
1837
|
+
return t ? y`${de(
|
|
931
1838
|
e.progressPins ?? [],
|
|
932
1839
|
(i, s) => s,
|
|
933
1840
|
(i) => y`${this.renderProgress(e, i, t)}`
|
|
934
|
-
)}` :
|
|
1841
|
+
)}` : m;
|
|
935
1842
|
}
|
|
936
1843
|
render() {
|
|
937
1844
|
const e = !!this.inlineSvg || !!this.previewUrl;
|
|
@@ -950,14 +1857,14 @@ const he = class he extends Te {
|
|
|
950
1857
|
|
|
951
1858
|
<div class="paging no-data" ?active=${!e}>No Image</div>
|
|
952
1859
|
<div class="img-container paging" ?active="${e}">
|
|
953
|
-
${this.inlineSvg ? y`<div id="base-layer" class="svg-wrapper">${
|
|
1860
|
+
${this.inlineSvg ? y`<div id="base-layer" class="svg-wrapper">${Kt(this.inlineSvg)}</div>` : this.previewUrl ? y`<img
|
|
954
1861
|
id="base-layer"
|
|
955
1862
|
@load="${this.getModifier}"
|
|
956
1863
|
src="${this.previewUrl}"
|
|
957
1864
|
alt="Image Widget"
|
|
958
1865
|
style="object-fit: ${this.inputData?.stretchToFit ? "fill" : "contain"}"
|
|
959
1866
|
/>` : ""}
|
|
960
|
-
${
|
|
1867
|
+
${de(
|
|
961
1868
|
this.inputData?.overlays ?? [],
|
|
962
1869
|
(t) => t.layerName,
|
|
963
1870
|
(t) => y` ${this.renderLayer(t)} `
|
|
@@ -967,7 +1874,7 @@ const he = class he extends Te {
|
|
|
967
1874
|
`;
|
|
968
1875
|
}
|
|
969
1876
|
};
|
|
970
|
-
|
|
1877
|
+
Pe.styles = He`
|
|
971
1878
|
:host {
|
|
972
1879
|
display: block;
|
|
973
1880
|
font-family: sans-serif;
|
|
@@ -1051,36 +1958,36 @@ he.styles = ve`
|
|
|
1051
1958
|
pointer-events: auto;
|
|
1052
1959
|
}
|
|
1053
1960
|
`;
|
|
1054
|
-
let
|
|
1055
|
-
|
|
1961
|
+
let w = Pe;
|
|
1962
|
+
N([
|
|
1056
1963
|
te({ type: Object })
|
|
1057
|
-
],
|
|
1058
|
-
|
|
1964
|
+
], w.prototype, "inputData");
|
|
1965
|
+
N([
|
|
1059
1966
|
te({ type: Object })
|
|
1060
|
-
],
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
],
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
],
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
],
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
],
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
],
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
],
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
],
|
|
1082
|
-
window.customElements.define("widget-overlay-1.0.
|
|
1967
|
+
], w.prototype, "theme");
|
|
1968
|
+
N([
|
|
1969
|
+
z()
|
|
1970
|
+
], w.prototype, "themeBgColor");
|
|
1971
|
+
N([
|
|
1972
|
+
z()
|
|
1973
|
+
], w.prototype, "themeTitleColor");
|
|
1974
|
+
N([
|
|
1975
|
+
z()
|
|
1976
|
+
], w.prototype, "themeSubtitleColor");
|
|
1977
|
+
N([
|
|
1978
|
+
z()
|
|
1979
|
+
], w.prototype, "previewUrl");
|
|
1980
|
+
N([
|
|
1981
|
+
z()
|
|
1982
|
+
], w.prototype, "inlineSvg");
|
|
1983
|
+
N([
|
|
1984
|
+
z()
|
|
1985
|
+
], w.prototype, "modifier");
|
|
1986
|
+
N([
|
|
1987
|
+
Ht("#base-layer")
|
|
1988
|
+
], w.prototype, "baseLayer");
|
|
1989
|
+
window.customElements.define("widget-overlay-1.0.9", w);
|
|
1083
1990
|
export {
|
|
1084
|
-
|
|
1991
|
+
w as WidgetImage
|
|
1085
1992
|
};
|
|
1086
1993
|
//# sourceMappingURL=widget-overlay.js.map
|