@ironflock/widget-value 1.1.36 → 1.1.37

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,15 +1,15 @@
1
- const N = globalThis, q = N.ShadowRoot && (N.ShadyCSS === void 0 || N.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, F = /* @__PURE__ */ Symbol(), Y = /* @__PURE__ */ new WeakMap();
2
- let dt = class {
3
- constructor(t, e, s) {
4
- if (this._$cssResult$ = !0, s !== F) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
1
+ const N = globalThis, F = N.ShadowRoot && (N.ShadyCSS === void 0 || N.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Z = /* @__PURE__ */ Symbol(), tt = /* @__PURE__ */ new WeakMap();
2
+ let $t = class {
3
+ constructor(t, e, r) {
4
+ if (this._$cssResult$ = !0, r !== Z) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
5
5
  this.cssText = t, this.t = e;
6
6
  }
7
7
  get styleSheet() {
8
8
  let t = this.o;
9
9
  const e = this.t;
10
- if (q && t === void 0) {
11
- const s = e !== void 0 && e.length === 1;
12
- s && (t = Y.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && Y.set(e, t));
10
+ if (F && t === void 0) {
11
+ const r = e !== void 0 && e.length === 1;
12
+ r && (t = tt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && tt.set(e, t));
13
13
  }
14
14
  return t;
15
15
  }
@@ -17,28 +17,28 @@ let dt = class {
17
17
  return this.cssText;
18
18
  }
19
19
  };
20
- const mt = (i) => new dt(typeof i == "string" ? i : i + "", void 0, F), _t = (i, ...t) => {
21
- const e = i.length === 1 ? i[0] : t.reduce(((s, r, n) => s + ((o) => {
20
+ const At = (i) => new $t(typeof i == "string" ? i : i + "", void 0, Z), bt = (i, ...t) => {
21
+ const e = i.length === 1 ? i[0] : t.reduce(((r, s, n) => r + ((o) => {
22
22
  if (o._$cssResult$ === !0) return o.cssText;
23
23
  if (typeof o == "number") return o;
24
24
  throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
25
- })(r) + i[n + 1]), i[0]);
26
- return new dt(e, i, F);
27
- }, yt = (i, t) => {
28
- if (q) i.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet));
25
+ })(s) + i[n + 1]), i[0]);
26
+ return new $t(e, i, Z);
27
+ }, xt = (i, t) => {
28
+ if (F) i.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet));
29
29
  else for (const e of t) {
30
- const s = document.createElement("style"), r = N.litNonce;
31
- r !== void 0 && s.setAttribute("nonce", r), s.textContent = e.cssText, i.appendChild(s);
30
+ const r = document.createElement("style"), s = N.litNonce;
31
+ s !== void 0 && r.setAttribute("nonce", s), r.textContent = e.cssText, i.appendChild(r);
32
32
  }
33
- }, tt = q ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
33
+ }, et = F ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
34
34
  let e = "";
35
- for (const s of t.cssRules) e += s.cssText;
36
- return mt(e);
35
+ for (const r of t.cssRules) e += r.cssText;
36
+ return At(e);
37
37
  })(i) : i;
38
- const { is: At, defineProperty: bt, getOwnPropertyDescriptor: xt, getOwnPropertyNames: St, getOwnPropertySymbols: wt, getPrototypeOf: Ct } = Object, j = globalThis, et = j.trustedTypes, Et = et ? et.emptyScript : "", Tt = j.reactiveElementPolyfillSupport, O = (i, t) => i, H = { toAttribute(i, t) {
38
+ const { is: St, defineProperty: wt, getOwnPropertyDescriptor: Ct, getOwnPropertyNames: Et, getOwnPropertySymbols: Tt, getPrototypeOf: Pt } = Object, k = globalThis, it = k.trustedTypes, Mt = it ? it.emptyScript : "", Ot = k.reactiveElementPolyfillSupport, M = (i, t) => i, R = { toAttribute(i, t) {
39
39
  switch (t) {
40
40
  case Boolean:
41
- i = i ? Et : null;
41
+ i = i ? Mt : null;
42
42
  break;
43
43
  case Object:
44
44
  case Array:
@@ -63,8 +63,8 @@ const { is: At, defineProperty: bt, getOwnPropertyDescriptor: xt, getOwnProperty
63
63
  }
64
64
  }
65
65
  return e;
66
- } }, Z = (i, t) => !At(i, t), it = { attribute: !0, type: String, converter: H, reflect: !1, useDefault: !1, hasChanged: Z };
67
- Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), j.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
66
+ } }, J = (i, t) => !St(i, t), st = { attribute: !0, type: String, converter: R, reflect: !1, useDefault: !1, hasChanged: J };
67
+ Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), k.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
68
68
  let w = class extends HTMLElement {
69
69
  static addInitializer(t) {
70
70
  this._$Ei(), (this.l ??= []).push(t);
@@ -72,60 +72,60 @@ let w = class extends HTMLElement {
72
72
  static get observedAttributes() {
73
73
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
74
74
  }
75
- static createProperty(t, e = it) {
75
+ static createProperty(t, e = st) {
76
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(), r = this.getPropertyDescriptor(t, s, e);
78
- r !== void 0 && bt(this.prototype, t, r);
77
+ const r = /* @__PURE__ */ Symbol(), s = this.getPropertyDescriptor(t, r, e);
78
+ s !== void 0 && wt(this.prototype, t, s);
79
79
  }
80
80
  }
81
- static getPropertyDescriptor(t, e, s) {
82
- const { get: r, set: n } = xt(this.prototype, t) ?? { get() {
81
+ static getPropertyDescriptor(t, e, r) {
82
+ const { get: s, set: n } = Ct(this.prototype, t) ?? { get() {
83
83
  return this[e];
84
84
  }, set(o) {
85
85
  this[e] = o;
86
86
  } };
87
- return { get: r, set(o) {
88
- const c = r?.call(this);
89
- n?.call(this, o), this.requestUpdate(t, c, s);
87
+ return { get: s, set(o) {
88
+ const h = s?.call(this);
89
+ n?.call(this, o), this.requestUpdate(t, h, r);
90
90
  }, configurable: !0, enumerable: !0 };
91
91
  }
92
92
  static getPropertyOptions(t) {
93
- return this.elementProperties.get(t) ?? it;
93
+ return this.elementProperties.get(t) ?? st;
94
94
  }
95
95
  static _$Ei() {
96
- if (this.hasOwnProperty(O("elementProperties"))) return;
97
- const t = Ct(this);
96
+ if (this.hasOwnProperty(M("elementProperties"))) return;
97
+ const t = Pt(this);
98
98
  t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
99
99
  }
100
100
  static finalize() {
101
- if (this.hasOwnProperty(O("finalized"))) return;
102
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(O("properties"))) {
103
- const e = this.properties, s = [...St(e), ...wt(e)];
104
- for (const r of s) this.createProperty(r, e[r]);
101
+ if (this.hasOwnProperty(M("finalized"))) return;
102
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(M("properties"))) {
103
+ const e = this.properties, r = [...Et(e), ...Tt(e)];
104
+ for (const s of r) this.createProperty(s, e[s]);
105
105
  }
106
106
  const t = this[Symbol.metadata];
107
107
  if (t !== null) {
108
108
  const e = litPropertyMetadata.get(t);
109
- if (e !== void 0) for (const [s, r] of e) this.elementProperties.set(s, r);
109
+ if (e !== void 0) for (const [r, s] of e) this.elementProperties.set(r, s);
110
110
  }
111
111
  this._$Eh = /* @__PURE__ */ new Map();
112
- for (const [e, s] of this.elementProperties) {
113
- const r = this._$Eu(e, s);
114
- r !== void 0 && this._$Eh.set(r, e);
112
+ for (const [e, r] of this.elementProperties) {
113
+ const s = this._$Eu(e, r);
114
+ s !== void 0 && this._$Eh.set(s, e);
115
115
  }
116
116
  this.elementStyles = this.finalizeStyles(this.styles);
117
117
  }
118
118
  static finalizeStyles(t) {
119
119
  const e = [];
120
120
  if (Array.isArray(t)) {
121
- const s = new Set(t.flat(1 / 0).reverse());
122
- for (const r of s) e.unshift(tt(r));
123
- } else t !== void 0 && e.push(tt(t));
121
+ const r = new Set(t.flat(1 / 0).reverse());
122
+ for (const s of r) e.unshift(et(s));
123
+ } else t !== void 0 && e.push(et(t));
124
124
  return e;
125
125
  }
126
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;
127
+ const r = e.attribute;
128
+ return r === !1 ? void 0 : typeof r == "string" ? r : typeof t == "string" ? t.toLowerCase() : void 0;
129
129
  }
130
130
  constructor() {
131
131
  super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
@@ -141,12 +141,12 @@ let w = class extends HTMLElement {
141
141
  }
142
142
  _$E_() {
143
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]);
144
+ for (const r of e.keys()) this.hasOwnProperty(r) && (t.set(r, this[r]), delete this[r]);
145
145
  t.size > 0 && (this._$Ep = t);
146
146
  }
147
147
  createRenderRoot() {
148
148
  const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
149
- return yt(t, this.constructor.elementStyles), t;
149
+ return xt(t, this.constructor.elementStyles), t;
150
150
  }
151
151
  connectedCallback() {
152
152
  this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((t) => t.hostConnected?.()));
@@ -156,33 +156,33 @@ let w = class extends HTMLElement {
156
156
  disconnectedCallback() {
157
157
  this._$EO?.forEach(((t) => t.hostDisconnected?.()));
158
158
  }
159
- attributeChangedCallback(t, e, s) {
160
- this._$AK(t, s);
159
+ attributeChangedCallback(t, e, r) {
160
+ this._$AK(t, r);
161
161
  }
162
162
  _$ET(t, e) {
163
- const s = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, s);
164
- if (r !== void 0 && s.reflect === !0) {
165
- const n = (s.converter?.toAttribute !== void 0 ? s.converter : H).toAttribute(e, s.type);
166
- this._$Em = t, n == null ? this.removeAttribute(r) : this.setAttribute(r, n), this._$Em = null;
163
+ const r = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, r);
164
+ if (s !== void 0 && r.reflect === !0) {
165
+ const n = (r.converter?.toAttribute !== void 0 ? r.converter : R).toAttribute(e, r.type);
166
+ this._$Em = t, n == null ? this.removeAttribute(s) : this.setAttribute(s, n), this._$Em = null;
167
167
  }
168
168
  }
169
169
  _$AK(t, e) {
170
- const s = this.constructor, r = s._$Eh.get(t);
171
- if (r !== void 0 && this._$Em !== r) {
172
- const n = s.getPropertyOptions(r), o = typeof n.converter == "function" ? { fromAttribute: n.converter } : n.converter?.fromAttribute !== void 0 ? n.converter : H;
173
- this._$Em = r, this[r] = o.fromAttribute(e, n.type) ?? this._$Ej?.get(r) ?? null, this._$Em = null;
170
+ const r = this.constructor, s = r._$Eh.get(t);
171
+ if (s !== void 0 && this._$Em !== s) {
172
+ const n = r.getPropertyOptions(s), o = typeof n.converter == "function" ? { fromAttribute: n.converter } : n.converter?.fromAttribute !== void 0 ? n.converter : R;
173
+ this._$Em = s, this[s] = o.fromAttribute(e, n.type) ?? this._$Ej?.get(s) ?? null, this._$Em = null;
174
174
  }
175
175
  }
176
- requestUpdate(t, e, s) {
176
+ requestUpdate(t, e, r) {
177
177
  if (t !== void 0) {
178
- const r = this.constructor, n = this[t];
179
- if (s ??= r.getPropertyOptions(t), !((s.hasChanged ?? Z)(n, e) || s.useDefault && s.reflect && n === this._$Ej?.get(t) && !this.hasAttribute(r._$Eu(t, s)))) return;
180
- this.C(t, e, s);
178
+ const s = this.constructor, n = this[t];
179
+ if (r ??= s.getPropertyOptions(t), !((r.hasChanged ?? J)(n, e) || r.useDefault && r.reflect && n === this._$Ej?.get(t) && !this.hasAttribute(s._$Eu(t, r)))) return;
180
+ this.C(t, e, r);
181
181
  }
182
182
  this.isUpdatePending === !1 && (this._$ES = this._$EP());
183
183
  }
184
- C(t, e, { useDefault: s, reflect: r, wrapped: n }, o) {
185
- s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, o ?? e ?? this[t]), n !== !0 || o !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), r === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
184
+ C(t, e, { useDefault: r, reflect: s, wrapped: n }, o) {
185
+ r && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, o ?? e ?? this[t]), n !== !0 || o !== void 0) || (this._$AL.has(t) || (this.hasUpdated || r || (e = void 0), this._$AL.set(t, e)), s === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
186
186
  }
187
187
  async _$EP() {
188
188
  this.isUpdatePending = !0;
@@ -201,21 +201,21 @@ let w = class extends HTMLElement {
201
201
  if (!this.isUpdatePending) return;
202
202
  if (!this.hasUpdated) {
203
203
  if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
204
- for (const [r, n] of this._$Ep) this[r] = n;
204
+ for (const [s, n] of this._$Ep) this[s] = n;
205
205
  this._$Ep = void 0;
206
206
  }
207
- const s = this.constructor.elementProperties;
208
- if (s.size > 0) for (const [r, n] of s) {
209
- const { wrapped: o } = n, c = this[r];
210
- o !== !0 || this._$AL.has(r) || c === void 0 || this.C(r, void 0, n, c);
207
+ const r = this.constructor.elementProperties;
208
+ if (r.size > 0) for (const [s, n] of r) {
209
+ const { wrapped: o } = n, h = this[s];
210
+ o !== !0 || this._$AL.has(s) || h === void 0 || this.C(s, void 0, n, h);
211
211
  }
212
212
  }
213
213
  let t = !1;
214
214
  const e = this._$AL;
215
215
  try {
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;
216
+ t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach(((r) => r.hostUpdate?.())), this.update(e)) : this._$EM();
217
+ } catch (r) {
218
+ throw t = !1, this._$EM(), r;
219
219
  }
220
220
  t && this._$AE(e);
221
221
  }
@@ -244,70 +244,70 @@ let w = class extends HTMLElement {
244
244
  firstUpdated(t) {
245
245
  }
246
246
  };
247
- w.elementStyles = [], w.shadowRootOptions = { mode: "open" }, w[O("elementProperties")] = /* @__PURE__ */ new Map(), w[O("finalized")] = /* @__PURE__ */ new Map(), Tt?.({ ReactiveElement: w }), (j.reactiveElementVersions ??= []).push("2.1.0");
248
- const J = globalThis, R = J.trustedTypes, st = R ? R.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, pt = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, $t = "?" + _, Pt = `<${$t}>`, x = document, U = () => x.createComment(""), z = (i) => i === null || typeof i != "object" && typeof i != "function", K = Array.isArray, Ot = (i) => K(i) || typeof i?.[Symbol.iterator] == "function", I = `[
249
- \f\r]`, T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, rt = /-->/g, nt = />/g, y = RegExp(`>|${I}(?:([^\\s"'>=/]+)(${I}*=${I}*(?:[^
250
- \f\r"'\`<>=]|("|')|))|$)`, "g"), ot = /'/g, at = /"/g, ft = /^(?:script|style|textarea|title)$/i, Mt = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), V = Mt(1), S = /* @__PURE__ */ Symbol.for("lit-noChange"), f = /* @__PURE__ */ Symbol.for("lit-nothing"), lt = /* @__PURE__ */ new WeakMap(), b = x.createTreeWalker(x, 129);
251
- function gt(i, t) {
252
- if (!K(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
253
- return st !== void 0 ? st.createHTML(t) : t;
247
+ w.elementStyles = [], w.shadowRootOptions = { mode: "open" }, w[M("elementProperties")] = /* @__PURE__ */ new Map(), w[M("finalized")] = /* @__PURE__ */ new Map(), Ot?.({ ReactiveElement: w }), (k.reactiveElementVersions ??= []).push("2.1.0");
248
+ const K = globalThis, j = K.trustedTypes, rt = j ? j.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, ft = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, gt = "?" + _, Ut = `<${gt}>`, x = document, U = () => x.createComment(""), D = (i) => i === null || typeof i != "object" && typeof i != "function", Q = Array.isArray, Dt = (i) => Q(i) || typeof i?.[Symbol.iterator] == "function", V = `[
249
+ \f\r]`, T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, nt = /-->/g, ot = />/g, y = RegExp(`>|${V}(?:([^\\s"'>=/]+)(${V}*=${V}*(?:[^
250
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), at = /'/g, lt = /"/g, mt = /^(?:script|style|textarea|title)$/i, zt = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), W = zt(1), S = /* @__PURE__ */ Symbol.for("lit-noChange"), f = /* @__PURE__ */ Symbol.for("lit-nothing"), ht = /* @__PURE__ */ new WeakMap(), b = x.createTreeWalker(x, 129);
251
+ function vt(i, t) {
252
+ if (!Q(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
253
+ return rt !== void 0 ? rt.createHTML(t) : t;
254
254
  }
255
- const Ut = (i, t) => {
256
- const e = i.length - 1, s = [];
257
- let r, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = T;
258
- for (let c = 0; c < e; c++) {
259
- const a = i[c];
260
- let $, h, l = -1, u = 0;
261
- for (; u < a.length && (o.lastIndex = u, h = o.exec(a), h !== null); ) u = o.lastIndex, o === T ? h[1] === "!--" ? o = rt : h[1] !== void 0 ? o = nt : h[2] !== void 0 ? (ft.test(h[2]) && (r = RegExp("</" + h[2], "g")), o = y) : h[3] !== void 0 && (o = y) : o === y ? h[0] === ">" ? (o = r ?? T, l = -1) : h[1] === void 0 ? l = -2 : (l = o.lastIndex - h[2].length, $ = h[1], o = h[3] === void 0 ? y : h[3] === '"' ? at : ot) : o === at || o === ot ? o = y : o === rt || o === nt ? o = T : (o = y, r = void 0);
262
- const d = o === y && i[c + 1].startsWith("/>") ? " " : "";
263
- n += o === T ? a + Pt : l >= 0 ? (s.push($), a.slice(0, l) + pt + a.slice(l) + _ + d) : a + _ + (l === -2 ? c : d);
264
- }
265
- return [gt(i, n + (i[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
255
+ const Nt = (i, t) => {
256
+ const e = i.length - 1, r = [];
257
+ let s, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = T;
258
+ for (let h = 0; h < e; h++) {
259
+ const a = i[h];
260
+ let u, c, l = -1, d = 0;
261
+ for (; d < a.length && (o.lastIndex = d, c = o.exec(a), c !== null); ) d = o.lastIndex, o === T ? c[1] === "!--" ? o = nt : c[1] !== void 0 ? o = ot : c[2] !== void 0 ? (mt.test(c[2]) && (s = RegExp("</" + c[2], "g")), o = y) : c[3] !== void 0 && (o = y) : o === y ? c[0] === ">" ? (o = s ?? T, l = -1) : c[1] === void 0 ? l = -2 : (l = o.lastIndex - c[2].length, u = c[1], o = c[3] === void 0 ? y : c[3] === '"' ? lt : at) : o === lt || o === at ? o = y : o === nt || o === ot ? o = T : (o = y, s = void 0);
262
+ const p = o === y && i[h + 1].startsWith("/>") ? " " : "";
263
+ n += o === T ? a + Ut : l >= 0 ? (r.push(u), a.slice(0, l) + ft + a.slice(l) + _ + p) : a + _ + (l === -2 ? h : p);
264
+ }
265
+ return [vt(i, n + (i[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
266
266
  };
267
- class D {
268
- constructor({ strings: t, _$litType$: e }, s) {
269
- let r;
267
+ class z {
268
+ constructor({ strings: t, _$litType$: e }, r) {
269
+ let s;
270
270
  this.parts = [];
271
271
  let n = 0, o = 0;
272
- const c = t.length - 1, a = this.parts, [$, h] = Ut(t, e);
273
- if (this.el = D.createElement($, s), b.currentNode = this.el.content, e === 2 || e === 3) {
272
+ const h = t.length - 1, a = this.parts, [u, c] = Nt(t, e);
273
+ if (this.el = z.createElement(u, r), b.currentNode = this.el.content, e === 2 || e === 3) {
274
274
  const l = this.el.content.firstChild;
275
275
  l.replaceWith(...l.childNodes);
276
276
  }
277
- for (; (r = b.nextNode()) !== null && a.length < c; ) {
278
- if (r.nodeType === 1) {
279
- if (r.hasAttributes()) for (const l of r.getAttributeNames()) if (l.endsWith(pt)) {
280
- const u = h[o++], d = r.getAttribute(l).split(_), p = /([.?@])?(.*)/.exec(u);
281
- a.push({ type: 1, index: n, name: p[2], strings: d, ctor: p[1] === "." ? Dt : p[1] === "?" ? Nt : p[1] === "@" ? Ht : L }), r.removeAttribute(l);
282
- } else l.startsWith(_) && (a.push({ type: 6, index: n }), r.removeAttribute(l));
283
- if (ft.test(r.tagName)) {
284
- const l = r.textContent.split(_), u = l.length - 1;
285
- if (u > 0) {
286
- r.textContent = R ? R.emptyScript : "";
287
- for (let d = 0; d < u; d++) r.append(l[d], U()), b.nextNode(), a.push({ type: 2, index: ++n });
288
- r.append(l[u], U());
277
+ for (; (s = b.nextNode()) !== null && a.length < h; ) {
278
+ if (s.nodeType === 1) {
279
+ if (s.hasAttributes()) for (const l of s.getAttributeNames()) if (l.endsWith(ft)) {
280
+ const d = c[o++], p = s.getAttribute(l).split(_), $ = /([.?@])?(.*)/.exec(d);
281
+ a.push({ type: 1, index: n, name: $[2], strings: p, ctor: $[1] === "." ? Rt : $[1] === "?" ? jt : $[1] === "@" ? kt : L }), s.removeAttribute(l);
282
+ } else l.startsWith(_) && (a.push({ type: 6, index: n }), s.removeAttribute(l));
283
+ if (mt.test(s.tagName)) {
284
+ const l = s.textContent.split(_), d = l.length - 1;
285
+ if (d > 0) {
286
+ s.textContent = j ? j.emptyScript : "";
287
+ for (let p = 0; p < d; p++) s.append(l[p], U()), b.nextNode(), a.push({ type: 2, index: ++n });
288
+ s.append(l[d], U());
289
289
  }
290
290
  }
291
- } else if (r.nodeType === 8) if (r.data === $t) a.push({ type: 2, index: n });
291
+ } else if (s.nodeType === 8) if (s.data === gt) a.push({ type: 2, index: n });
292
292
  else {
293
293
  let l = -1;
294
- for (; (l = r.data.indexOf(_, l + 1)) !== -1; ) a.push({ type: 7, index: n }), l += _.length - 1;
294
+ for (; (l = s.data.indexOf(_, l + 1)) !== -1; ) a.push({ type: 7, index: n }), l += _.length - 1;
295
295
  }
296
296
  n++;
297
297
  }
298
298
  }
299
299
  static createElement(t, e) {
300
- const s = x.createElement("template");
301
- return s.innerHTML = t, s;
300
+ const r = x.createElement("template");
301
+ return r.innerHTML = t, r;
302
302
  }
303
303
  }
304
- function C(i, t, e = i, s) {
304
+ function C(i, t, e = i, r) {
305
305
  if (t === S) return t;
306
- let r = s !== void 0 ? e._$Co?.[s] : e._$Cl;
307
- const n = z(t) ? void 0 : t._$litDirective$;
308
- return r?.constructor !== n && (r?._$AO?.(!1), n === void 0 ? r = void 0 : (r = new n(i), r._$AT(i, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = r : e._$Cl = r), r !== void 0 && (t = C(i, r._$AS(i, t.values), r, s)), t;
306
+ let s = r !== void 0 ? e._$Co?.[r] : e._$Cl;
307
+ const n = D(t) ? void 0 : t._$litDirective$;
308
+ return s?.constructor !== n && (s?._$AO?.(!1), n === void 0 ? s = void 0 : (s = new n(i), s._$AT(i, e, r)), r !== void 0 ? (e._$Co ??= [])[r] = s : e._$Cl = s), s !== void 0 && (t = C(i, s._$AS(i, t.values), s, r)), t;
309
309
  }
310
- let zt = class {
310
+ let Ht = class {
311
311
  constructor(t, e) {
312
312
  this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
313
313
  }
@@ -318,29 +318,29 @@ let zt = class {
318
318
  return this._$AM._$AU;
319
319
  }
320
320
  u(t) {
321
- const { el: { content: e }, parts: s } = this._$AD, r = (t?.creationScope ?? x).importNode(e, !0);
322
- b.currentNode = r;
323
- let n = b.nextNode(), o = 0, c = 0, a = s[0];
321
+ const { el: { content: e }, parts: r } = this._$AD, s = (t?.creationScope ?? x).importNode(e, !0);
322
+ b.currentNode = s;
323
+ let n = b.nextNode(), o = 0, h = 0, a = r[0];
324
324
  for (; a !== void 0; ) {
325
325
  if (o === a.index) {
326
- let $;
327
- a.type === 2 ? $ = new E(n, n.nextSibling, this, t) : a.type === 1 ? $ = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && ($ = new Rt(n, this, t)), this._$AV.push($), a = s[++c];
326
+ let u;
327
+ a.type === 2 ? u = new E(n, n.nextSibling, this, t) : a.type === 1 ? u = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (u = new Lt(n, this, t)), this._$AV.push(u), a = r[++h];
328
328
  }
329
329
  o !== a?.index && (n = b.nextNode(), o++);
330
330
  }
331
- return b.currentNode = x, r;
331
+ return b.currentNode = x, s;
332
332
  }
333
333
  p(t) {
334
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++;
335
+ for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(t, r, e), e += r.strings.length - 2) : r._$AI(t[e])), e++;
336
336
  }
337
337
  };
338
338
  class E {
339
339
  get _$AU() {
340
340
  return this._$AM?._$AU ?? this._$Cv;
341
341
  }
342
- constructor(t, e, s, r) {
343
- this.type = 2, this._$AH = f, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = r, this._$Cv = r?.isConnected ?? !0;
342
+ constructor(t, e, r, s) {
343
+ this.type = 2, this._$AH = f, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = r, this.options = s, this._$Cv = s?.isConnected ?? !0;
344
344
  }
345
345
  get parentNode() {
346
346
  let t = this._$AA.parentNode;
@@ -354,7 +354,7 @@ class E {
354
354
  return this._$AB;
355
355
  }
356
356
  _$AI(t, e = this) {
357
- t = C(this, t, e), z(t) ? t === f || t == null || t === "" ? (this._$AH !== f && this._$AR(), this._$AH = f) : t !== this._$AH && t !== S && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Ot(t) ? this.k(t) : this._(t);
357
+ t = C(this, t, e), D(t) ? t === f || t == null || t === "" ? (this._$AH !== f && this._$AR(), this._$AH = f) : t !== this._$AH && t !== S && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Dt(t) ? this.k(t) : this._(t);
358
358
  }
359
359
  O(t) {
360
360
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -363,31 +363,31 @@ class E {
363
363
  this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
364
364
  }
365
365
  _(t) {
366
- this._$AH !== f && z(this._$AH) ? this._$AA.nextSibling.data = t : this.T(x.createTextNode(t)), this._$AH = t;
366
+ this._$AH !== f && D(this._$AH) ? this._$AA.nextSibling.data = t : this.T(x.createTextNode(t)), this._$AH = t;
367
367
  }
368
368
  $(t) {
369
- const { values: e, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = D.createElement(gt(s.h, s.h[0]), this.options)), s);
370
- if (this._$AH?._$AD === r) this._$AH.p(e);
369
+ const { values: e, _$litType$: r } = t, s = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = z.createElement(vt(r.h, r.h[0]), this.options)), r);
370
+ if (this._$AH?._$AD === s) this._$AH.p(e);
371
371
  else {
372
- const n = new zt(r, this), o = n.u(this.options);
372
+ const n = new Ht(s, this), o = n.u(this.options);
373
373
  n.p(e), this.T(o), this._$AH = n;
374
374
  }
375
375
  }
376
376
  _$AC(t) {
377
- let e = lt.get(t.strings);
378
- return e === void 0 && lt.set(t.strings, e = new D(t)), e;
377
+ let e = ht.get(t.strings);
378
+ return e === void 0 && ht.set(t.strings, e = new z(t)), e;
379
379
  }
380
380
  k(t) {
381
- K(this._$AH) || (this._$AH = [], this._$AR());
381
+ Q(this._$AH) || (this._$AH = [], this._$AR());
382
382
  const e = this._$AH;
383
- let s, r = 0;
384
- for (const n of t) r === e.length ? e.push(s = new E(this.O(U()), this.O(U()), this, this.options)) : s = e[r], s._$AI(n), r++;
385
- r < e.length && (this._$AR(s && s._$AB.nextSibling, r), e.length = r);
383
+ let r, s = 0;
384
+ for (const n of t) s === e.length ? e.push(r = new E(this.O(U()), this.O(U()), this, this.options)) : r = e[s], r._$AI(n), s++;
385
+ s < e.length && (this._$AR(r && r._$AB.nextSibling, s), e.length = s);
386
386
  }
387
387
  _$AR(t = this._$AA.nextSibling, e) {
388
388
  for (this._$AP?.(!1, !0, e); t && t !== this._$AB; ) {
389
- const s = t.nextSibling;
390
- t.remove(), t = s;
389
+ const r = t.nextSibling;
390
+ t.remove(), t = r;
391
391
  }
392
392
  }
393
393
  setConnected(t) {
@@ -401,25 +401,25 @@ class L {
401
401
  get _$AU() {
402
402
  return this._$AM._$AU;
403
403
  }
404
- constructor(t, e, s, r, n) {
405
- this.type = 1, this._$AH = f, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = f;
404
+ constructor(t, e, r, s, n) {
405
+ this.type = 1, this._$AH = f, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = n, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = f;
406
406
  }
407
- _$AI(t, e = this, s, r) {
407
+ _$AI(t, e = this, r, s) {
408
408
  const n = this.strings;
409
409
  let o = !1;
410
- if (n === void 0) t = C(this, t, e, 0), o = !z(t) || t !== this._$AH && t !== S, o && (this._$AH = t);
410
+ if (n === void 0) t = C(this, t, e, 0), o = !D(t) || t !== this._$AH && t !== S, o && (this._$AH = t);
411
411
  else {
412
- const c = t;
413
- let a, $;
414
- for (t = n[0], a = 0; a < n.length - 1; a++) $ = C(this, c[s + a], e, a), $ === S && ($ = this._$AH[a]), o ||= !z($) || $ !== this._$AH[a], $ === f ? t = f : t !== f && (t += ($ ?? "") + n[a + 1]), this._$AH[a] = $;
412
+ const h = t;
413
+ let a, u;
414
+ for (t = n[0], a = 0; a < n.length - 1; a++) u = C(this, h[r + a], e, a), u === S && (u = this._$AH[a]), o ||= !D(u) || u !== this._$AH[a], u === f ? t = f : t !== f && (t += (u ?? "") + n[a + 1]), this._$AH[a] = u;
415
415
  }
416
- o && !r && this.j(t);
416
+ o && !s && this.j(t);
417
417
  }
418
418
  j(t) {
419
419
  t === f ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
420
420
  }
421
421
  }
422
- class Dt extends L {
422
+ class Rt extends L {
423
423
  constructor() {
424
424
  super(...arguments), this.type = 3;
425
425
  }
@@ -427,7 +427,7 @@ class Dt extends L {
427
427
  this.element[this.name] = t === f ? void 0 : t;
428
428
  }
429
429
  }
430
- class Nt extends L {
430
+ class jt extends L {
431
431
  constructor() {
432
432
  super(...arguments), this.type = 4;
433
433
  }
@@ -435,22 +435,22 @@ class Nt extends L {
435
435
  this.element.toggleAttribute(this.name, !!t && t !== f);
436
436
  }
437
437
  }
438
- class Ht extends L {
439
- constructor(t, e, s, r, n) {
440
- super(t, e, s, r, n), this.type = 5;
438
+ class kt extends L {
439
+ constructor(t, e, r, s, n) {
440
+ super(t, e, r, s, n), this.type = 5;
441
441
  }
442
442
  _$AI(t, e = this) {
443
443
  if ((t = C(this, t, e, 0) ?? f) === S) return;
444
- const s = this._$AH, r = t === f && s !== f || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== f && (s === f || r);
445
- r && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
444
+ const r = this._$AH, s = t === f && r !== f || t.capture !== r.capture || t.once !== r.once || t.passive !== r.passive, n = t !== f && (r === f || s);
445
+ s && this.element.removeEventListener(this.name, this, r), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
446
446
  }
447
447
  handleEvent(t) {
448
448
  typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
449
449
  }
450
450
  }
451
- class Rt {
452
- constructor(t, e, s) {
453
- this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
451
+ class Lt {
452
+ constructor(t, e, r) {
453
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = r;
454
454
  }
455
455
  get _$AU() {
456
456
  return this._$AM._$AU;
@@ -459,19 +459,19 @@ class Rt {
459
459
  C(this, t);
460
460
  }
461
461
  }
462
- const jt = { I: E }, Lt = J.litHtmlPolyfillSupport;
463
- Lt?.(D, E), (J.litHtmlVersions ??= []).push("3.3.0");
464
- const kt = (i, t, e) => {
465
- const s = e?.renderBefore ?? t;
466
- let r = s._$litPart$;
467
- if (r === void 0) {
462
+ const Bt = { I: E }, It = K.litHtmlPolyfillSupport;
463
+ It?.(z, E), (K.litHtmlVersions ??= []).push("3.3.0");
464
+ const Vt = (i, t, e) => {
465
+ const r = e?.renderBefore ?? t;
466
+ let s = r._$litPart$;
467
+ if (s === void 0) {
468
468
  const n = e?.renderBefore ?? null;
469
- s._$litPart$ = r = new E(t.insertBefore(U(), n), n, void 0, e ?? {});
469
+ r._$litPart$ = s = new E(t.insertBefore(U(), n), n, void 0, e ?? {});
470
470
  }
471
- return r._$AI(i), r;
471
+ return s._$AI(i), s;
472
472
  };
473
- const Q = globalThis;
474
- let M = class extends w {
473
+ const G = globalThis;
474
+ let O = class extends w {
475
475
  constructor() {
476
476
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
477
477
  }
@@ -481,7 +481,7 @@ let M = class extends w {
481
481
  }
482
482
  update(t) {
483
483
  const e = this.render();
484
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = kt(e, this.renderRoot, this.renderOptions);
484
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Vt(e, this.renderRoot, this.renderOptions);
485
485
  }
486
486
  connectedCallback() {
487
487
  super.connectedCallback(), this._$Do?.setConnected(!0);
@@ -493,19 +493,19 @@ let M = class extends w {
493
493
  return S;
494
494
  }
495
495
  };
496
- M._$litElement$ = !0, M.finalized = !0, Q.litElementHydrateSupport?.({ LitElement: M });
497
- const Bt = Q.litElementPolyfillSupport;
498
- Bt?.({ LitElement: M });
499
- (Q.litElementVersions ??= []).push("4.2.0");
500
- const It = { CHILD: 2 }, Vt = (i) => (...t) => ({ _$litDirective$: i, values: t });
501
- class Wt {
496
+ O._$litElement$ = !0, O.finalized = !0, G.litElementHydrateSupport?.({ LitElement: O });
497
+ const Wt = G.litElementPolyfillSupport;
498
+ Wt?.({ LitElement: O });
499
+ (G.litElementVersions ??= []).push("4.2.0");
500
+ const qt = { CHILD: 2 }, Ft = (i) => (...t) => ({ _$litDirective$: i, values: t });
501
+ class Zt {
502
502
  constructor(t) {
503
503
  }
504
504
  get _$AU() {
505
505
  return this._$AM._$AU;
506
506
  }
507
- _$AT(t, e, s) {
508
- this._$Ct = t, this._$AM = e, this._$Ci = s;
507
+ _$AT(t, e, r) {
508
+ this._$Ct = t, this._$AM = e, this._$Ci = r;
509
509
  }
510
510
  _$AS(t, e) {
511
511
  return this.update(t, e);
@@ -514,160 +514,170 @@ class Wt {
514
514
  return this.render(...e);
515
515
  }
516
516
  }
517
- const { I: qt } = jt, ht = () => document.createComment(""), P = (i, t, e) => {
518
- const s = i._$AA.parentNode, r = t === void 0 ? i._$AB : t._$AA;
517
+ const { I: Jt } = Bt, ct = () => document.createComment(""), P = (i, t, e) => {
518
+ const r = i._$AA.parentNode, s = t === void 0 ? i._$AB : t._$AA;
519
519
  if (e === void 0) {
520
- const n = s.insertBefore(ht(), r), o = s.insertBefore(ht(), r);
521
- e = new qt(n, o, i, i.options);
520
+ const n = r.insertBefore(ct(), s), o = r.insertBefore(ct(), s);
521
+ e = new Jt(n, o, i, i.options);
522
522
  } else {
523
- const n = e._$AB.nextSibling, o = e._$AM, c = o !== i;
524
- if (c) {
523
+ const n = e._$AB.nextSibling, o = e._$AM, h = o !== i;
524
+ if (h) {
525
525
  let a;
526
526
  e._$AQ?.(i), e._$AM = i, e._$AP !== void 0 && (a = i._$AU) !== o._$AU && e._$AP(a);
527
527
  }
528
- if (n !== r || c) {
528
+ if (n !== s || h) {
529
529
  let a = e._$AA;
530
530
  for (; a !== n; ) {
531
- const $ = a.nextSibling;
532
- s.insertBefore(a, r), a = $;
531
+ const u = a.nextSibling;
532
+ r.insertBefore(a, s), a = u;
533
533
  }
534
534
  }
535
535
  }
536
536
  return e;
537
- }, A = (i, t, e = i) => (i._$AI(t, e), i), Ft = {}, Zt = (i, t = Ft) => i._$AH = t, Jt = (i) => i._$AH, W = (i) => {
537
+ }, A = (i, t, e = i) => (i._$AI(t, e), i), Kt = {}, Qt = (i, t = Kt) => i._$AH = t, Gt = (i) => i._$AH, q = (i) => {
538
538
  i._$AP?.(!1, !0);
539
539
  let t = i._$AA;
540
540
  const e = i._$AB.nextSibling;
541
541
  for (; t !== e; ) {
542
- const s = t.nextSibling;
543
- t.remove(), t = s;
542
+ const r = t.nextSibling;
543
+ t.remove(), t = r;
544
544
  }
545
545
  };
546
- const ct = (i, t, e) => {
547
- const s = /* @__PURE__ */ new Map();
548
- for (let r = t; r <= e; r++) s.set(i[r], r);
549
- return s;
550
- }, ut = Vt(class extends Wt {
546
+ const ut = (i, t, e) => {
547
+ const r = /* @__PURE__ */ new Map();
548
+ for (let s = t; s <= e; s++) r.set(i[s], s);
549
+ return r;
550
+ }, dt = Ft(class extends Zt {
551
551
  constructor(i) {
552
- if (super(i), i.type !== It.CHILD) throw Error("repeat() can only be used in text expressions");
552
+ if (super(i), i.type !== qt.CHILD) throw Error("repeat() can only be used in text expressions");
553
553
  }
554
554
  dt(i, t, e) {
555
- let s;
556
- e === void 0 ? e = t : t !== void 0 && (s = t);
557
- const r = [], n = [];
555
+ let r;
556
+ e === void 0 ? e = t : t !== void 0 && (r = t);
557
+ const s = [], n = [];
558
558
  let o = 0;
559
- for (const c of i) r[o] = s ? s(c, o) : o, n[o] = e(c, o), o++;
560
- return { values: n, keys: r };
559
+ for (const h of i) s[o] = r ? r(h, o) : o, n[o] = e(h, o), o++;
560
+ return { values: n, keys: s };
561
561
  }
562
562
  render(i, t, e) {
563
563
  return this.dt(i, t, e).values;
564
564
  }
565
- update(i, [t, e, s]) {
566
- const r = Jt(i), { values: n, keys: o } = this.dt(t, e, s);
567
- if (!Array.isArray(r)) return this.ut = o, n;
568
- const c = this.ut ??= [], a = [];
569
- let $, h, l = 0, u = r.length - 1, d = 0, p = n.length - 1;
570
- for (; l <= u && d <= p; ) if (r[l] === null) l++;
571
- else if (r[u] === null) u--;
572
- else if (c[l] === o[d]) a[d] = A(r[l], n[d]), l++, d++;
573
- else if (c[u] === o[p]) a[p] = A(r[u], n[p]), u--, p--;
574
- else if (c[l] === o[p]) a[p] = A(r[l], n[p]), P(i, a[p + 1], r[l]), l++, p--;
575
- else if (c[u] === o[d]) a[d] = A(r[u], n[d]), P(i, r[l], r[u]), u--, d++;
576
- else if ($ === void 0 && ($ = ct(o, d, p), h = ct(c, l, u)), $.has(c[l])) if ($.has(c[u])) {
577
- const g = h.get(o[d]), B = g !== void 0 ? r[g] : null;
578
- if (B === null) {
579
- const X = P(i, r[l]);
580
- A(X, n[d]), a[d] = X;
581
- } else a[d] = A(B, n[d]), P(i, r[l], B), r[g] = null;
582
- d++;
583
- } else W(r[u]), u--;
584
- else W(r[l]), l++;
585
- for (; d <= p; ) {
586
- const g = P(i, a[p + 1]);
587
- A(g, n[d]), a[d++] = g;
565
+ update(i, [t, e, r]) {
566
+ const s = Gt(i), { values: n, keys: o } = this.dt(t, e, r);
567
+ if (!Array.isArray(s)) return this.ut = o, n;
568
+ const h = this.ut ??= [], a = [];
569
+ let u, c, l = 0, d = s.length - 1, p = 0, $ = n.length - 1;
570
+ for (; l <= d && p <= $; ) if (s[l] === null) l++;
571
+ else if (s[d] === null) d--;
572
+ else if (h[l] === o[p]) a[p] = A(s[l], n[p]), l++, p++;
573
+ else if (h[d] === o[$]) a[$] = A(s[d], n[$]), d--, $--;
574
+ else if (h[l] === o[$]) a[$] = A(s[l], n[$]), P(i, a[$ + 1], s[l]), l++, $--;
575
+ else if (h[d] === o[p]) a[p] = A(s[d], n[p]), P(i, s[l], s[d]), d--, p++;
576
+ else if (u === void 0 && (u = ut(o, p, $), c = ut(h, l, d)), u.has(h[l])) if (u.has(h[d])) {
577
+ const g = c.get(o[p]), I = g !== void 0 ? s[g] : null;
578
+ if (I === null) {
579
+ const Y = P(i, s[l]);
580
+ A(Y, n[p]), a[p] = Y;
581
+ } else a[p] = A(I, n[p]), P(i, s[l], I), s[g] = null;
582
+ p++;
583
+ } else q(s[d]), d--;
584
+ else q(s[l]), l++;
585
+ for (; p <= $; ) {
586
+ const g = P(i, a[$ + 1]);
587
+ A(g, n[p]), a[p++] = g;
588
588
  }
589
- for (; l <= u; ) {
590
- const g = r[l++];
591
- g !== null && W(g);
589
+ for (; l <= d; ) {
590
+ const g = s[l++];
591
+ g !== null && q(g);
592
592
  }
593
- return this.ut = o, Zt(i, a), S;
593
+ return this.ut = o, Qt(i, a), S;
594
594
  }
595
595
  });
596
- const Kt = (i) => (t, e) => {
596
+ const Xt = (i) => (t, e) => {
597
597
  e !== void 0 ? e.addInitializer((() => {
598
598
  customElements.define(i, t);
599
599
  })) : customElements.define(i, t);
600
600
  };
601
- const Qt = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged: Z }, Gt = (i = Qt, t, e) => {
602
- const { kind: s, metadata: r } = e;
603
- let n = globalThis.litPropertyMetadata.get(r);
604
- if (n === void 0 && globalThis.litPropertyMetadata.set(r, n = /* @__PURE__ */ new Map()), s === "setter" && ((i = Object.create(i)).wrapped = !0), n.set(e.name, i), s === "accessor") {
601
+ const Yt = { attribute: !0, type: String, converter: R, reflect: !1, hasChanged: J }, te = (i = Yt, t, e) => {
602
+ const { kind: r, metadata: s } = e;
603
+ let n = globalThis.litPropertyMetadata.get(s);
604
+ if (n === void 0 && globalThis.litPropertyMetadata.set(s, n = /* @__PURE__ */ new Map()), r === "setter" && ((i = Object.create(i)).wrapped = !0), n.set(e.name, i), r === "accessor") {
605
605
  const { name: o } = e;
606
- return { set(c) {
606
+ return { set(h) {
607
607
  const a = t.get.call(this);
608
- t.set.call(this, c), this.requestUpdate(o, a, i);
609
- }, init(c) {
610
- return c !== void 0 && this.C(o, void 0, i, c), c;
608
+ t.set.call(this, h), this.requestUpdate(o, a, i);
609
+ }, init(h) {
610
+ return h !== void 0 && this.C(o, void 0, i, h), h;
611
611
  } };
612
612
  }
613
- if (s === "setter") {
613
+ if (r === "setter") {
614
614
  const { name: o } = e;
615
- return function(c) {
615
+ return function(h) {
616
616
  const a = this[o];
617
- t.call(this, c), this.requestUpdate(o, a, i);
617
+ t.call(this, h), this.requestUpdate(o, a, i);
618
618
  };
619
619
  }
620
- throw Error("Unsupported decorator location: " + s);
620
+ throw Error("Unsupported decorator location: " + r);
621
621
  };
622
- function G(i) {
623
- return (t, e) => typeof e == "object" ? Gt(i, t, e) : ((s, r, n) => {
624
- const o = r.hasOwnProperty(n);
625
- return r.constructor.createProperty(n, s), o ? Object.getOwnPropertyDescriptor(r, n) : void 0;
622
+ function X(i) {
623
+ return (t, e) => typeof e == "object" ? te(i, t, e) : ((r, s, n) => {
624
+ const o = s.hasOwnProperty(n);
625
+ return s.constructor.createProperty(n, r), o ? Object.getOwnPropertyDescriptor(s, n) : void 0;
626
626
  })(i, t, e);
627
627
  }
628
- function k(i) {
629
- return G({ ...i, state: !0, attribute: !1 });
628
+ function B(i) {
629
+ return X({ ...i, state: !0, attribute: !1 });
630
630
  }
631
- const Xt = (i, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(i, t, e), e);
632
- function vt(i, t) {
633
- return (e, s, r) => {
631
+ const ee = (i, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(i, t, e), e);
632
+ function _t(i, t) {
633
+ return (e, r, s) => {
634
634
  const n = (o) => o.renderRoot?.querySelector(i) ?? null;
635
- return Xt(e, s, { get() {
635
+ return ee(e, r, { get() {
636
636
  return n(this);
637
637
  } });
638
638
  };
639
639
  }
640
- var Yt = Object.defineProperty, te = Object.getOwnPropertyDescriptor, m = (i, t, e, s) => {
641
- for (var r = s > 1 ? void 0 : s ? te(t, e) : t, n = i.length - 1, o; n >= 0; n--)
642
- (o = i[n]) && (r = (s ? o(t, e, r) : o(r)) || r);
643
- return s && r && Yt(t, e, r), r;
640
+ var ie = Object.defineProperty, se = Object.getOwnPropertyDescriptor, v = (i, t, e, r) => {
641
+ for (var s = r > 1 ? void 0 : r ? se(t, e) : t, n = i.length - 1, o; n >= 0; n--)
642
+ (o = i[n]) && (s = (r ? o(t, e, s) : o(s)) || s);
643
+ return r && s && ie(t, e, s), s;
644
644
  };
645
- const ee = new Intl.DateTimeFormat(void 0, {
645
+ const re = new Intl.DateTimeFormat(void 0, {
646
646
  year: "numeric",
647
647
  month: "short",
648
648
  day: "numeric",
649
649
  hour: "2-digit",
650
650
  minute: "2-digit"
651
- }), ie = (i) => {
651
+ }), yt = (i) => {
652
652
  if (i == null || i === "") return;
653
653
  const t = /^\s*-?\d+(\.\d+)?\s*$/.test(String(i)) ? Number(i) : Date.parse(String(i));
654
654
  return Number.isFinite(t) ? new Date(t) : void 0;
655
+ }, H = (i) => {
656
+ if (i == null || i === "") return;
657
+ const t = typeof i == "number" ? i : Number(i);
658
+ return Number.isFinite(t) ? t : void 0;
659
+ }, pt = (i) => {
660
+ const t = Math.floor(Number(i));
661
+ return Number.isFinite(t) ? Math.min(100, Math.max(0, t)) : 0;
662
+ }, ne = (i, t) => {
663
+ const e = H(t), r = yt(i[i.length - 1]?.tsp);
664
+ return e === void 0 || !r ? void 0 : r.getTime() + e * 1e3;
655
665
  };
656
- let v = class extends M {
666
+ let m = class extends O {
657
667
  constructor() {
658
- super(), this.dataSets = /* @__PURE__ */ new Map(), this.textActive = !0, this.version = "1.1.36", this.origWidth = 0, this.origHeight = 0, this.resizeObserver = new ResizeObserver(this.applyData.bind(this)), this.resizeObserver.observe(this);
668
+ super(), this.dataSets = /* @__PURE__ */ new Map(), this.textActive = !0, this.version = "1.1.37", this.origWidth = 0, this.origHeight = 0, this.resizeObserver = new ResizeObserver(this.applyData.bind(this));
659
669
  }
660
- disconnectedCallback() {
661
- super.disconnectedCallback(), this.resizeObserver && this.resizeObserver.disconnect();
670
+ connectedCallback() {
671
+ super.connectedCallback(), this.resizeObserver.observe(this), this.hasUpdated && this.transformData();
662
672
  }
663
- firstUpdated(i) {
664
- this.registerTheme(this.theme);
673
+ disconnectedCallback() {
674
+ super.disconnectedCallback(), this.resizeObserver.disconnect(), clearTimeout(this.staleTimer), this.staleTimer = void 0;
665
675
  }
666
676
  update(i) {
667
- i.has("inputData") && this.transformData(), super.update(i);
677
+ (i.has("theme") || !this.hasUpdated) && this.registerTheme(this.theme), i.has("inputData") && this.transformData(), super.update(i);
668
678
  }
669
679
  updated(i) {
670
- i.has("inputData") && (this.sizingSetup(), this.applyData()), i.has("theme") && this.registerTheme(this.theme), super.updated(i);
680
+ i.has("inputData") && this.sizingSetup(), this.applyData(), super.updated(i);
671
681
  }
672
682
  registerTheme(i) {
673
683
  this.theme?.theme_object?.backgroundColor;
@@ -677,90 +687,102 @@ let v = class extends M {
677
687
  subTitleText() {
678
688
  const i = this.inputData?.subTitle;
679
689
  if (this.inputData?.subTitleType !== "timestamp") return i;
680
- const t = ie(i);
681
- return t ? ee.format(t) : i;
690
+ const t = yt(i);
691
+ return t ? re.format(t) : i;
682
692
  }
683
693
  sizingSetup() {
684
694
  const i = Array.from(
685
695
  this.sizingContainer?.querySelectorAll(".single-value")
686
696
  );
687
697
  let t = 0, e = 0;
688
- for (const s of i) {
689
- const r = s.getBoundingClientRect();
690
- t = Math.max(r.width, t), e = Math.max(r.height, e);
698
+ for (const r of i) {
699
+ const s = r.getBoundingClientRect();
700
+ t = Math.max(s.width, t), e = Math.max(s.height, e);
691
701
  }
692
702
  t < this.origWidth ? (!this.lastLargerWidthTime || Date.now() - this.lastLargerWidthTime > 5e3) && (this.origWidth = t) : (this.origWidth = t, this.lastLargerWidthTime = Date.now()), this.origHeight = e;
693
703
  }
694
704
  applyData() {
695
705
  if (!this.valueContainer) return;
696
- const i = this.valueContainer.getBoundingClientRect().width, t = this.valueContainer.getBoundingClientRect().height, e = this.dataSets.size, s = this.origWidth, r = this.origHeight;
697
- if (!i || !t || !s || !r) return;
706
+ const i = this.valueContainer.getBoundingClientRect().width, t = this.valueContainer.getBoundingClientRect().height, e = this.dataSets.size, r = this.origWidth, s = this.origHeight;
707
+ if (!i || !t || !r || !s) return;
698
708
  const n = [];
699
- for (let h = 1; h <= e; h++) {
700
- const l = Math.ceil(e / h), u = i - 12 * (h - 1), d = t - 12 * (l - 1), p = u / s / h, g = p * p * s * r * e;
701
- l * p * r <= d && n.push({ r: l, c: h, m: p, size: g, width: s, height: r, userWidth: i, userHeight: t });
709
+ for (let c = 1; c <= e; c++) {
710
+ const l = Math.ceil(e / c), d = i - 12 * (c - 1), p = t - 12 * (l - 1), $ = d / r / c, g = $ * $ * r * s * e;
711
+ l * $ * s <= p && n.push({ r: l, c, m: $, size: g, width: r, height: s, userWidth: i, userHeight: t });
702
712
  }
703
- for (let h = 1; h <= e; h++) {
704
- const l = Math.ceil(e / h), u = i - 12 * (l - 1), p = (t - 12 * (h - 1)) / r / h, g = p * p * s * r * e;
705
- l * p * s <= u && n.push({ r: h, c: l, m: p, size: g, width: s, height: r, userWidth: i, userHeight: t });
713
+ for (let c = 1; c <= e; c++) {
714
+ const l = Math.ceil(e / c), d = i - 12 * (l - 1), $ = (t - 12 * (c - 1)) / s / c, g = $ * $ * r * s * e;
715
+ l * $ * r <= d && n.push({ r: c, c: l, m: $, size: g, width: r, height: s, userWidth: i, userHeight: t });
706
716
  }
707
- const o = n.reduce((h, l) => l.size < h ? h : l.size, 0), c = n.find((h) => h.size === o);
708
- if (!c) return;
709
- const a = c.m ?? 1, $ = Array.from(
717
+ const o = n.reduce((c, l) => l.size < c ? c : l.size, 0), h = n.find((c) => c.size === o);
718
+ if (!h) return;
719
+ const a = h.m ?? 1, u = Array.from(
710
720
  this.valueContainer?.querySelectorAll(".single-value")
711
721
  );
712
- this.valueContainer.style.gridTemplateColumns = `repeat(${c.c}, 1fr)`;
713
- for (const h of $) {
714
- h.setAttribute(
722
+ this.valueContainer.style.gridTemplateColumns = `repeat(${h.c}, 1fr)`;
723
+ for (const c of u) {
724
+ c.setAttribute(
715
725
  "style",
716
- `width:${a * s}px; height:${a * r}px; padding:${a * 6}px`
726
+ `width:${a * r}px; height:${a * s}px; padding:${a * 6}px`
717
727
  );
718
- const l = h.getAttribute("label"), u = this.dataSets.get(l ?? "");
719
- h.querySelector(".label").setAttribute(
728
+ const l = c.getAttribute("label"), d = this.dataSets.get(l ?? "");
729
+ c.querySelector(".label").setAttribute(
720
730
  "style",
721
731
  `font-size: ${26 * a}px;
722
- color: ${u?.styling?.labelColor || this.themeTitleColor};`
723
- ), h.querySelector(".current-value").setAttribute(
732
+ color: ${d?.styling?.labelColor || this.themeTitleColor};`
733
+ ), c.querySelector(".current-value").setAttribute(
724
734
  "style",
725
735
  `font-size: ${32 * a}px;
726
- color: ${u?.styling?.valueColor || this.theme?.theme_object?.color?.[0] || this.themeTitleColor};`
727
- ), h.querySelector(".unit").setAttribute("style", `font-size: ${26 * a}px;`);
736
+ color: ${d?.styling?.valueColor || this.theme?.theme_object?.color?.[0] || this.themeTitleColor};`
737
+ ), c.querySelector(".unit").setAttribute("style", `font-size: ${26 * a}px;`);
728
738
  }
729
739
  this.textActive = !0;
730
740
  }
731
- async transformData() {
732
- this.inputData && (this.dataSets.forEach((i) => {
733
- i.label ??= "";
734
- }), this.dataSets = /* @__PURE__ */ new Map(), this.inputData?.dataseries?.forEach((i) => {
735
- const t = i.multiChart ? [...new Set(i.data?.map((e) => e.pivot))].sort() : [""];
736
- t.forEach((e) => {
737
- const s = e ?? "", r = i.label ?? "", n = {
738
- label: s + (s && r ? " - " : "") + r,
739
- order: i.order,
740
- unit: i.unit,
741
- precision: i.precision,
742
- advanced: i.advanced,
743
- styling: i.styling,
744
- multiChart: i.multiChart,
745
- value: i.value,
746
- data: t.length === 1 ? i.data : i.data?.filter((o) => o.pivot === e),
741
+ transformData() {
742
+ this.dataSets = /* @__PURE__ */ new Map();
743
+ const i = this.inputData?.dataseries;
744
+ (Array.isArray(i) ? i.filter((s) => !!s && typeof s == "object") : []).forEach((s) => {
745
+ const n = Array.isArray(s.data) ? s.data.filter((h) => !!h && typeof h == "object") : [], o = s.multiChart ? [...new Set(n.map((h) => h.pivot))].sort() : [""];
746
+ o.forEach((h) => {
747
+ const a = h ?? "", u = s.label ?? "", c = {
748
+ label: a + (a && u ? " - " : "") + u,
749
+ order: s.order,
750
+ unit: s.unit,
751
+ precision: s.precision,
752
+ advanced: s.advanced,
753
+ styling: s.styling,
754
+ multiChart: s.multiChart,
755
+ value: s.value,
756
+ data: o.length === 1 ? n : n.filter((l) => l.pivot === h),
747
757
  needleValue: void 0
748
758
  };
749
- this.dataSets.set(n.label ?? "", n);
759
+ this.dataSets.set(c.label ?? "", c);
750
760
  });
751
- }), this.dataSets.forEach((i, t) => {
752
- if (i.advanced ??= {}, (typeof i.advanced?.averageLatest != "number" || isNaN(i.advanced?.averageLatest)) && (i.advanced.averageLatest = 1), !i.multiChart)
753
- i.needleValue = i.value === void 0 || i.value === null ? void 0 : Number(i.value);
761
+ });
762
+ const e = Date.now();
763
+ let r = 1 / 0;
764
+ this.dataSets.forEach((s) => {
765
+ const n = H(s.advanced?.averageLatest), o = n !== void 0 && n >= 1 ? Math.floor(n) : 1;
766
+ if (!s.multiChart)
767
+ s.needleValue = H(s.value);
754
768
  else {
755
- const e = i?.data?.slice(-i?.advanced?.averageLatest || -1) ?? [], s = e?.map((n) => n.value)?.filter((n) => n !== void 0)?.map(Number) ?? [];
756
- i.needleValue = s.reduce((n, o) => n + o, 0) / s.length;
757
- const r = Date.parse(e?.[e.length - 1]?.tsp ?? "");
758
- isNaN(r) || (/* @__PURE__ */ new Date()).getTime() - r > (i.advanced?.maxLatency ?? 1 / 0) * 1e3 && (i.needleValue = void 0);
769
+ const h = s.data?.slice(-o) ?? [], a = h.map((c) => H(c.value)).filter((c) => c !== void 0);
770
+ s.needleValue = a.length ? a.reduce((c, l) => c + l, 0) / a.length : void 0;
771
+ const u = ne(h, s.advanced?.maxLatency);
772
+ u !== void 0 && e > u ? s.needleValue = void 0 : u !== void 0 && (r = Math.min(r, u));
759
773
  }
760
- }));
774
+ }), this.scheduleStaleCheck(r);
775
+ }
776
+ /** Runs transformData again just after `at` (epoch ms), when the next readout goes stale. */
777
+ scheduleStaleCheck(i) {
778
+ if (clearTimeout(this.staleTimer), this.staleTimer = void 0, !Number.isFinite(i) || !this.isConnected) return;
779
+ const t = Math.min(Math.max(i - Date.now(), 0) + 1, 2 ** 31 - 1);
780
+ this.staleTimer = setTimeout(() => {
781
+ this.staleTimer = void 0, this.transformData();
782
+ }, t);
761
783
  }
762
784
  render() {
763
- return V`
785
+ return W`
764
786
  <div class="wrapper" style="color: ${this.themeTitleColor}">
765
787
  <header>
766
788
  <h3 class="paging" ?active=${this.inputData?.title}>${this.inputData?.title}</h3>
@@ -773,10 +795,10 @@ let v = class extends M {
773
795
  </p>
774
796
  </header>
775
797
  <div class="sizing-container">
776
- ${ut(
798
+ ${dt(
777
799
  this.dataSets,
778
800
  ([i]) => i,
779
- ([i, t]) => V`
801
+ ([i, t]) => W`
780
802
  <div class="single-value" label="${i}">
781
803
  <div class="label paging" ?active=${this.textActive}>${i}</div>
782
804
  <span
@@ -784,7 +806,7 @@ let v = class extends M {
784
806
  ?active=${this.textActive}
785
807
  style="color: ${t?.styling?.valueColor || this.theme?.theme_object?.color?.[0] || this.themeTitleColor}"
786
808
  >
787
- ${t.needleValue === void 0 || t.needleValue === null || isNaN(t.needleValue) ? "" : t.needleValue.toFixed(Math.max(0, t.precision ?? 0))}
809
+ ${t.needleValue === void 0 || t.needleValue === null || isNaN(t.needleValue) ? "" : t.needleValue.toFixed(pt(t.precision))}
788
810
  <span class="unit paging" ?active=${this.textActive}>${t.unit}</span>
789
811
  </span>
790
812
  </div>
@@ -793,10 +815,10 @@ let v = class extends M {
793
815
  </div>
794
816
  <div class="paging no-data" ?active=${!this.dataSets.size}>No Data</div>
795
817
  <div class="value-container">
796
- ${ut(
818
+ ${dt(
797
819
  [...this.dataSets.entries()].sort(),
798
820
  ([i]) => i,
799
- ([i, t]) => V`
821
+ ([i, t]) => W`
800
822
  <div class="single-value" label="${i}">
801
823
  <div
802
824
  class="label paging"
@@ -810,7 +832,7 @@ let v = class extends M {
810
832
  ?active=${this.textActive}
811
833
  style="color: ${t?.styling?.valueColor || this.theme?.theme_object?.color?.[0] || this.themeTitleColor}"
812
834
  >
813
- ${t.needleValue === void 0 || t.needleValue === null || isNaN(t.needleValue) ? "" : t.needleValue.toFixed(Math.max(0, t.precision ?? 0))}
835
+ ${t.needleValue === void 0 || t.needleValue === null || isNaN(t.needleValue) ? "" : t.needleValue.toFixed(pt(t.precision))}
814
836
  <span class="unit paging" ?active=${this.textActive}>${t.unit}</span>
815
837
  </span>
816
838
  </div>
@@ -821,7 +843,7 @@ let v = class extends M {
821
843
  `;
822
844
  }
823
845
  };
824
- v.styles = _t`
846
+ m.styles = bt`
825
847
  :host {
826
848
  display: block;
827
849
  font-family: sans-serif;
@@ -910,34 +932,34 @@ v.styles = _t`
910
932
  justify-content: center;
911
933
  }
912
934
  `;
913
- m([
914
- G({ type: Object })
915
- ], v.prototype, "inputData", 2);
916
- m([
917
- G({ type: Object })
918
- ], v.prototype, "theme", 2);
919
- m([
920
- k()
921
- ], v.prototype, "dataSets", 2);
922
- m([
923
- k()
924
- ], v.prototype, "textActive", 2);
925
- m([
926
- k()
927
- ], v.prototype, "themeTitleColor", 2);
928
- m([
929
- k()
930
- ], v.prototype, "themeSubtitleColor", 2);
931
- m([
932
- vt(".value-container")
933
- ], v.prototype, "valueContainer", 2);
934
- m([
935
- vt(".sizing-container")
936
- ], v.prototype, "sizingContainer", 2);
937
- v = m([
938
- Kt("widget-value-1.1.36")
939
- ], v);
935
+ v([
936
+ X({ type: Object })
937
+ ], m.prototype, "inputData", 2);
938
+ v([
939
+ X({ type: Object })
940
+ ], m.prototype, "theme", 2);
941
+ v([
942
+ B()
943
+ ], m.prototype, "dataSets", 2);
944
+ v([
945
+ B()
946
+ ], m.prototype, "textActive", 2);
947
+ v([
948
+ B()
949
+ ], m.prototype, "themeTitleColor", 2);
950
+ v([
951
+ B()
952
+ ], m.prototype, "themeSubtitleColor", 2);
953
+ v([
954
+ _t(".value-container")
955
+ ], m.prototype, "valueContainer", 2);
956
+ v([
957
+ _t(".sizing-container")
958
+ ], m.prototype, "sizingContainer", 2);
959
+ m = v([
960
+ Xt("widget-value-1.1.37")
961
+ ], m);
940
962
  export {
941
- v as WidgetValue
963
+ m as WidgetValue
942
964
  };
943
965
  //# sourceMappingURL=widget-value.js.map