@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.
@@ -1,1626 +1,699 @@
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.
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 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));
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 e;
14
+ return t;
18
15
  }
19
16
  toString() {
20
17
  return this.cssText;
21
18
  }
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) => {
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 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) => {
55
- $.emitLitDebugLogEvents && $.dispatchEvent(new CustomEvent("lit-debug", {
56
- detail: n
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;
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.__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
- }
73
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
180
74
  }
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.`);
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
- * 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
- */
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(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]);
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 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);
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.__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);
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), 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;
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
- * 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;
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.__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
- */
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 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
- */
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.__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
- */
152
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((t) => t.hostConnected?.()));
153
+ }
154
+ enableUpdating(t) {
155
+ }
409
156
  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;
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
- /** @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;
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
- * 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;
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.__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() {
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.__updatePromise;
487
- } catch (t) {
488
- Promise.reject(t);
190
+ await this._$ES;
191
+ } catch (e) {
192
+ Promise.reject(e);
489
193
  }
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
- */
194
+ const t = this.scheduleUpdate();
195
+ return t != null && await t, !this.isUpdatePending;
196
+ }
510
197
  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
- */
198
+ return this.performUpdate();
199
+ }
524
200
  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.`);
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
- if (this.__instanceProperties) {
535
- for (const [s, r] of this.__instanceProperties)
536
- this[s] = r;
537
- this.__instanceProperties = void 0;
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 e = !1;
547
- const t = this._$changedProperties;
213
+ let t = !1;
214
+ const e = this._$AL;
548
215
  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;
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
- 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
- */
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.__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) {
234
+ return this._$ES;
235
+ }
236
+ shouldUpdate(t) {
640
237
  return !0;
641
238
  }
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) {
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
- 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));
718
- }, queueMicrotask(() => {
719
- H("dev-mode", "Lit is in dev mode. Not recommended for production!");
720
- });
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,
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 Ct = (n, e) => {
764
- const t = n.length - 1, i = [];
765
- let s = e === he ? "<svg>" : e === pe ? "<math>" : "", r, o = I;
766
- for (let a = 0; a < t; a++) {
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)
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 F {
788
- constructor({ strings: e, ["_$litType$"]: t }, i) {
267
+ class R {
268
+ constructor({ strings: t, _$litType$: e }, s) {
269
+ let i;
789
270
  this.parts = [];
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);
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 (; (s = R.nextNode()) !== null && a.length < l; ) {
797
- if (s.nodeType === 1) {
798
- {
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);
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
- if (s.hasAttributes())
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);
811
- a.push({
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());
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
- if (g.length !== o)
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("${...}") + "`");
843
- u && u({
844
- kind: "template prep",
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 L(n, e, t = n, i) {
859
- if (e === E)
860
- return e;
861
- let s = i !== void 0 ? t.__directives?.[i] : t.__directive;
862
- const r = B(e) ? void 0 : (
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 Et {
869
- constructor(e, t) {
870
- this._$parts = [], this._$disconnectableChildren = void 0, this._$template = e, this._$parent = t;
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._$parent.parentNode;
875
- }
876
- // See comment in Disconnectable interface for why this is a getter
877
- get _$isConnected() {
878
- return this._$parent._$isConnected;
879
- }
880
- // This method is separate from the constructor because we need to return a
881
- // DocumentFragment and we don't want to hold onto it with an instance field.
882
- _clone(e) {
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 (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];
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
- o !== a?.index && (r = R.nextNode(), o++);
329
+ n !== a?.index && (o = x.nextNode(), n++);
892
330
  }
893
- return R.currentNode = k, s;
894
- }
895
- _update(e) {
896
- let t = 0;
897
- for (const i of this._$parts)
898
- i !== void 0 && (u && u({
899
- kind: "set part",
900
- part: i,
901
- value: e[t],
902
- valueIndex: t,
903
- values: e,
904
- templateInstance: this
905
- }), i.strings !== void 0 ? (i._$setValue(e, i, t), t += i.strings.length - 2) : i._$setValue(e[t])), t++;
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 e = S(this._$startNode).parentNode;
936
- const t = this._$parent;
937
- return t !== void 0 && e?.nodeType === 11 && (e = t.parentNode), e;
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._$startNode;
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._$endNode;
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
- _commitText(e) {
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({
999
- kind: "commit text",
1000
- node: t,
1001
- value: e,
1002
- options: this.options
1003
- }), t.data = e;
1004
- } else {
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({
1007
- kind: "commit text",
1008
- node: t,
1009
- value: e,
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 r = new Et(s, this), o = r._clone(this.options);
1028
- u && u({
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
- // Overridden via `litHtmlPolyfillSupport` to provide platform support.
1048
- /** @internal */
1049
- _$getTemplate(e) {
1050
- let t = De.get(e.strings);
1051
- return t === void 0 && De.set(e.strings, t = new F(e)), t;
1052
- }
1053
- _commitIterable(e) {
1054
- ge(this._$committedValue) || (this._$committedValue = [], this._$clear());
1055
- const t = this._$committedValue;
1056
- let i = 0, 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);
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
- * Implementation of RootPart's `isConnected`. Note that this method
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 ee {
396
+ }
397
+ class B {
1093
398
  get tagName() {
1094
399
  return this.element.tagName;
1095
400
  }
1096
- // See comment in Disconnectable interface for why this is a getter
1097
- get _$isConnected() {
1098
- return this._$parent._$isConnected;
1099
- }
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;
1102
- }
1103
- /**
1104
- * Sets the value of this part by resolving the value from possibly multiple
1105
- * values and static strings and committing it to the DOM.
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 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;
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
- o && !s && this._commitValue(e);
1138
- }
1139
- /** @internal */
1140
- _commitValue(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({
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 Nt extends ee {
422
+ class Vt extends B {
1151
423
  constructor() {
1152
- super(...arguments), this.type = St;
1153
- }
1154
- /** @internal */
1155
- _commitValue(e) {
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 Mt extends ee {
430
+ class Wt extends B {
1166
431
  constructor() {
1167
- super(...arguments), this.type = vt;
1168
- }
1169
- /** @internal */
1170
- _commitValue(e) {
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 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)
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.`);
1184
- }
1185
- // EventPart does not use the base _$setValue/_resolveValue implementation
1186
- // since the dirty checking is more complex
1187
- /** @internal */
1188
- _$setValue(e, t = this) {
1189
- if (e = L(this, e, t, 0) ?? m, e === E)
1190
- return;
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 At {
1208
- constructor(e, t, i) {
1209
- this.element = e, this.type = ye, this._$disconnectableChildren = void 0, this._$parent = t, this.options = i;
1210
- }
1211
- // See comment in Disconnectable interface for why this is a getter
1212
- get _$isConnected() {
1213
- return this._$parent._$isConnected;
1214
- }
1215
- _$setValue(e) {
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 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.");
1231
- });
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;
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
- 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 {
473
+ const st = globalThis;
474
+ let C = class extends E {
1264
475
  constructor() {
1265
- super(...arguments), this.renderOptions = { host: this }, this.__childPart = void 0;
476
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
1266
477
  }
1267
- /**
1268
- * @category rendering
1269
- */
1270
478
  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
- */
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.__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
- */
487
+ super.connectedCallback(), this._$Do?.setConnected(!0);
488
+ }
1327
489
  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
- */
490
+ super.disconnectedCallback(), this._$Do?.setConnected(!1);
491
+ }
1337
492
  render() {
1338
- return E;
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
- 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));
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 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);
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 new Error(`Unsupported decorator location: ${i}`);
524
+ throw Error("Unsupported decorator location: " + s);
1391
525
  };
1392
- function te(n) {
1393
- return (e, t) => typeof t == "object" ? It(n, e, t) : Dt(n, e, t);
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 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
- });
532
+ function T(r) {
533
+ return V({ ...r, state: !0, attribute: !1 });
1404
534
  }
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
- });
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 be = {
1420
- ATTRIBUTE: 1,
1421
- CHILD: 2
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
- // See comment in Disconnectable interface for why this is a getter
1431
- get _$isConnected() {
1432
- return this._$parent._$isConnected;
548
+ get _$AU() {
549
+ return this._$AM._$AU;
1433
550
  }
1434
- /** @internal */
1435
- _$initialize(e, t, i) {
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
- /** @internal */
1439
- _$resolve(e, t) {
1440
- return this.update(e, t);
554
+ _$AS(t, e) {
555
+ return this.update(t, e);
1441
556
  }
1442
- update(e, t) {
1443
- return this.render(...t);
557
+ update(t, e) {
558
+ return this.render(...e);
1444
559
  }
1445
- }
1446
- const Qe = "important", Ze = " !" + Qe, jt = 0 - Ze.length;
1447
- class Bt extends we {
1448
- constructor(e) {
1449
- if (super(e), e.type !== be.ATTRIBUTE || e.name !== "style" || e.strings?.length > 2)
1450
- throw new Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
1451
- }
1452
- render(e) {
1453
- return Object.keys(e).reduce((t, i) => {
1454
- const s = e[i];
1455
- return s == null ? t : (i = i.includes("-") ? i : i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase(), t + `${i}:${s};`);
1456
- }, "");
1457
- }
1458
- update(e, [t]) {
1459
- const { style: i } = e.element;
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 r = t[s];
1466
- if (r != null) {
1467
- this._previousStyleProperties.add(s);
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;
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 E;
583
+ return y;
1473
584
  }
1474
- }
1475
- const ae = $e(Bt);
1476
- const Ft = 1;
1477
- class Se extends we {
1478
- constructor(e) {
1479
- if (super(e), this._value = m, e.type !== be.CHILD)
1480
- throw new Error(`${this.constructor.directiveName}() can only be used in child bindings`);
1481
- }
1482
- render(e) {
1483
- if (e === m || e == null)
1484
- return this._templateResult = void 0, this._value = e;
1485
- if (e === E)
1486
- return e;
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
- Se.directiveName = "unsafeHTML";
1504
- Se.resultType = Ft;
1505
- const qt = 2;
1506
- class ve extends Se {
1507
- }
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;
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 r = T(t._$endNode).nextSibling, o = t._$parent, l = o !== n;
1518
- if (l) {
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
- t._$notifyConnectionChanged !== void 0 && (a = n._$isConnected) !== o._$isConnected && t._$notifyConnectionChanged(a);
614
+ e._$AQ?.(r), e._$AM = r, e._$AP !== void 0 && (a = r._$AU) !== n._$AU && e._$AP(a);
1522
615
  }
1523
- if (r !== s || l) {
1524
- let a = t._$startNode;
1525
- for (; a !== r; ) {
1526
- const h = T(a).nextSibling;
1527
- T(i).insertBefore(a, s), a = h;
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 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;
1536
- for (; e !== t; ) {
1537
- const i = T(e).nextSibling;
1538
- T(e).remove(), e = i;
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 Ie = (n, e, t) => {
1542
- const i = /* @__PURE__ */ new Map();
1543
- for (let s = e; s <= t; s++)
1544
- i.set(n[s], s);
1545
- return i;
1546
- };
1547
- class Zt extends we {
1548
- constructor(e) {
1549
- if (super(e), e.type !== be.CHILD)
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
- i === void 0 ? i = t : t !== void 0 && (s = t);
1555
- const r = [], o = [];
1556
- let l = 0;
1557
- for (const a of e)
1558
- r[l] = s ? s(a, l) : l, o[l] = i(a, l), l++;
1559
- return {
1560
- values: o,
1561
- keys: r
1562
- };
1563
- }
1564
- render(e, t, i) {
1565
- return this._getValuesAndKeys(e, t, i).values;
1566
- }
1567
- update(e, [t, i, s]) {
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--;
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 (; c <= d; ) {
1604
- const P = r[c++];
1605
- P !== null && le(P);
677
+ for (; l <= p; ) {
678
+ const m = i[l++];
679
+ m !== null && Z(m);
1606
680
  }
1607
- return this._itemKeys = l, Jt(e, h), E;
681
+ return this.ut = n, ne(r, a), y;
1608
682
  }
1609
- }
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;
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 Q = class extends D {
689
+ let I = class extends C {
1617
690
  render() {
1618
- return y`
1619
- ${this.value !== void 0 ? y`<div class="bar" style="width: ${this.value * 100}%;"></div>` : y`<div class="indeterminate"></div>`}
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
- Q.styles = He`
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
- Xe([
1666
- te({ type: Number })
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;
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 Pe = class Pe extends D {
749
+ const nt = class nt extends C {
1677
750
  constructor() {
1678
- super(), this.version = "1.0.9", this.getModifier = this.getModifier.bind(this);
751
+ super(), this.version = "1.0.11", this.getModifier = this.getModifier.bind(this);
1679
752
  }
1680
- update(e) {
1681
- e.has("inputData") && (this.transform(), this.modifier || this.getModifier()), e.has("theme") && this.registerTheme(this.theme), super.update(e);
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(e) {
756
+ firstUpdated(t) {
1684
757
  this.registerTheme(this.theme), new ResizeObserver(this.getModifier).observe(this);
1685
758
  }
1686
- registerTheme(e) {
1687
- const t = getComputedStyle(this).getPropertyValue("--re-text-color").trim(), i = getComputedStyle(this).getPropertyValue("--re-tile-background-color").trim();
1688
- this.themeBgColor = i || this.theme?.theme_object?.backgroundColor, this.themeTitleColor = t || this.theme?.theme_object?.title?.textStyle?.color, this.themeSubtitleColor = t || this.theme?.theme_object?.title?.subtextStyle?.color || this.themeTitleColor;
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(e) {
1691
- const i = e.target.files?.[0];
1692
- i && (this.previewUrl && URL.revokeObjectURL(this.previewUrl), this.previewUrl = URL.createObjectURL(i), this.dispatchEvent(
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: i, name: i.name, size: i.size, type: i.type, url: this.previewUrl },
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 e = this.inputData.image.trim(), i = e.replace(/^\uFEFF/, "").trimStart().match(/<svg[\s\S]*?<\/svg>/i);
1706
- if (i) {
1707
- this.inlineSvg = i[0].trim(), this.previewUrl = void 0;
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(e)) {
1711
- this.previewUrl = e;
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(e)) {
1715
- this.previewUrl = e;
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(e) && e.length > 100) {
1719
- this.previewUrl = `data:image/*;base64,${e}`;
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(e), this.previewUrl = e;
796
+ new URL(t), this.previewUrl = t;
1724
797
  return;
1725
798
  } catch {
1726
- if (/^([./]|\/)/.test(e)) {
1727
- this.previewUrl = e;
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 e = this.baseLayer.getBoundingClientRect();
1736
- if (!e) return;
1737
- const t = this.baseLayer.parentElement?.getBoundingClientRect();
808
+ const t = this.baseLayer.getBoundingClientRect();
1738
809
  if (!t) return;
1739
- let i, s;
810
+ const e = this.baseLayer.parentElement?.getBoundingClientRect();
811
+ if (!e) return;
812
+ let s, i;
1740
813
  if (this.baseLayer instanceof HTMLImageElement)
1741
- i = this.baseLayer.naturalWidth, s = this.baseLayer.naturalHeight;
814
+ s = this.baseLayer.naturalWidth, i = this.baseLayer.naturalHeight;
1742
815
  else {
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;
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 f = this.baseLayer.getAttribute("width"), _ = this.baseLayer.getAttribute("height");
1750
- f && _ && (i = parseFloat(f), s = parseFloat(_));
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 (!i || !s) return;
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 };
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(e, t, i) {
831
+ getOverlayItemPosition(t, e, s) {
1759
832
  return {
1760
- left: e * i.visibleWidth,
1761
- top: t * i.visibleHeight
833
+ left: t * s.visibleWidth,
834
+ top: e * s.visibleHeight
1762
835
  };
1763
836
  }
1764
- renderText(e, t, i) {
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";
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 g = {
1777
- "font-size": (s.textStyle.fontSize ?? 14) * i.scaler + "px",
1778
- color: h,
1779
- "background-color": s.textStyle.backgroundColor,
1780
- "font-weight": s.textStyle.fontWeight,
1781
- left: `${r.left}px`,
1782
- top: `${r.top}px`,
1783
- "border-radius": 10 * i.scaler + "px",
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 * i.scaler}px ${12 * i.scaler}px`
859
+ padding: `${6 * s.scaler}px ${12 * s.scaler}px`
1787
860
  };
1788
- return y`
1789
- <div class="overlay-item" style=${ae(g)}>${t.prefix}${l}${t.suffix}</div>
861
+ return g`
862
+ <div class="overlay-item" style=${F(u)}>${e.prefix}${h}${e.suffix}</div>
1790
863
  `;
1791
864
  }
1792
- renderProgress(e, t, i) {
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",
1797
- "--progress-width": (s.progressStyle?.width ?? 10) * i.scaler + "px",
1798
- "--progress-height": (s.progressStyle?.height ?? 100) * i.scaler + "px",
1799
- "--progress-background": s.progressStyle?.backgroundColor ?? "#fff",
1800
- "border-radius": 10 * i.scaler + "px",
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(${s.progressStyle?.rotate ?? 0}deg)`,
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> `;
1808
- }
1809
- renderLayer(e) {
1810
- const t = this.modifier;
1811
- if (!t) return m;
1812
- const i = {
1813
- left: t.xOffset + "px",
1814
- top: t.yOffset + "px",
1815
- width: t.visibleWidth + "px",
1816
- height: t.visibleHeight + "px"
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 y`<div
891
+ return g`<div
1819
892
  class="overlay"
1820
- style=${ae(i)}
1821
- type="${e.layerType}"
1822
- name="${e.layerName}"
893
+ style=${F(s)}
894
+ type="${t.layerType}"
895
+ name="${t.layerName}"
1823
896
  >
1824
- ${e.layerType === "text" ? this.renderTextLayer(e) : this.renderProgressLayer(e)}
897
+ ${t.layerType === "text" ? this.renderTextLayer(t) : this.renderProgressLayer(t)}
1825
898
  </div>`;
1826
899
  }
1827
- renderTextLayer(e) {
1828
- const t = this.modifier;
1829
- return t ? y`${de(
1830
- e.textPins ?? [],
1831
- (i, s) => s,
1832
- (i) => y`${this.renderText(e, i, t)}`
1833
- )}` : m;
1834
- }
1835
- renderProgressLayer(e) {
1836
- const t = this.modifier;
1837
- return t ? y`${de(
1838
- e.progressPins ?? [],
1839
- (i, s) => s,
1840
- (i) => y`${this.renderProgress(e, i, t)}`
1841
- )}` : m;
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 e = !!this.inlineSvg || !!this.previewUrl;
1845
- return y`
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=${!e}>No Image</div>
1859
- <div class="img-container paging" ?active="${e}">
1860
- ${this.inlineSvg ? y`<div id="base-layer" class="svg-wrapper">${Kt(this.inlineSvg)}</div>` : this.previewUrl ? y`<img
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
- ${de(
940
+ ${X(
1868
941
  this.inputData?.overlays ?? [],
1869
- (t) => t.layerName,
1870
- (t) => y` ${this.renderLayer(t)} `
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
- Pe.styles = He`
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 w = Pe;
1962
- N([
1963
- te({ type: Object })
1964
- ], w.prototype, "inputData");
1965
- N([
1966
- te({ type: Object })
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);
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
- w as WidgetImage
1064
+ v as WidgetImage
1992
1065
  };
1993
1066
  //# sourceMappingURL=widget-overlay.js.map