@record-evolution/widget-value 1.1.22 → 1.1.24

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,52 +1,15 @@
1
- /* @license Copyright (c) 2023 Record Evolution GmbH. All rights reserved.*/
2
- /******************************************************************************
3
- Copyright (c) Microsoft Corporation.
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
- PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */
16
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
17
-
18
- function __decorate(decorators, target, key, desc) {
19
- var c = arguments.length,
20
- r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
21
- d;
22
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
23
- return c > 3 && r && Object.defineProperty(target, key, r), r;
24
- }
25
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
26
- var e = new Error(message);
27
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
28
- };
29
-
30
- /**
31
- * @license
32
- * Copyright 2019 Google LLC
33
- * SPDX-License-Identifier: BSD-3-Clause
34
- */
35
- const t$4 = globalThis,
36
- e$5 = t$4.ShadowRoot && (void 0 === t$4.ShadyCSS || t$4.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype,
37
- s$3 = Symbol(),
38
- o$4 = new WeakMap();
39
- let n$3 = class n {
40
- constructor(t, e, o) {
41
- if (this._$cssResult$ = true, o !== s$3) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
1
+ const D = globalThis, q = D.ShadowRoot && (D.ShadyCSS === void 0 || D.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.");
42
5
  this.cssText = t, this.t = e;
43
6
  }
44
7
  get styleSheet() {
45
8
  let t = this.o;
46
- const s = this.t;
47
- if (e$5 && void 0 === t) {
48
- const e = void 0 !== s && 1 === s.length;
49
- e && (t = o$4.get(s)), void 0 === t && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), e && o$4.set(s, t));
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));
50
13
  }
51
14
  return t;
52
15
  }
@@ -54,239 +17,182 @@ let n$3 = class n {
54
17
  return this.cssText;
55
18
  }
56
19
  };
57
- const r$5 = t => new n$3("string" == typeof t ? t : t + "", void 0, s$3),
58
- i$4 = (t, ...e) => {
59
- const o = 1 === t.length ? t[0] : e.reduce((e, s, o) => e + (t => {
60
- if (true === t._$cssResult$) return t.cssText;
61
- if ("number" == typeof t) return t;
62
- throw Error("Value passed to 'css' function must be a 'css' function result: " + t + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
63
- })(s) + t[o + 1], t[0]);
64
- return new n$3(o, t, s$3);
65
- },
66
- S$1 = (s, o) => {
67
- if (e$5) s.adoptedStyleSheets = o.map(t => t instanceof CSSStyleSheet ? t : t.styleSheet);else for (const e of o) {
68
- const o = document.createElement("style"),
69
- n = t$4.litNonce;
70
- void 0 !== n && o.setAttribute("nonce", n), o.textContent = e.cssText, s.appendChild(o);
71
- }
72
- },
73
- c$3 = e$5 ? t => t : t => t instanceof CSSStyleSheet ? (t => {
74
- let e = "";
75
- for (const s of t.cssRules) e += s.cssText;
76
- return r$5(e);
77
- })(t) : t;
78
-
79
- /**
80
- * @license
81
- * Copyright 2017 Google LLC
82
- * SPDX-License-Identifier: BSD-3-Clause
83
- */
84
- const {
85
- is: i$3,
86
- defineProperty: e$4,
87
- getOwnPropertyDescriptor: h$1,
88
- getOwnPropertyNames: r$4,
89
- getOwnPropertySymbols: o$3,
90
- getPrototypeOf: n$2
91
- } = Object,
92
- a$1 = globalThis,
93
- c$2 = a$1.trustedTypes,
94
- l$1 = c$2 ? c$2.emptyScript : "",
95
- p$2 = a$1.reactiveElementPolyfillSupport,
96
- d$1 = (t, s) => t,
97
- u$3 = {
98
- toAttribute(t, s) {
99
- switch (s) {
100
- case Boolean:
101
- t = t ? l$1 : null;
102
- break;
103
- case Object:
104
- case Array:
105
- t = null == t ? t : JSON.stringify(t);
20
+ const _t = (i) => new dt(typeof i == "string" ? i : i + "", void 0, F), mt = (i, ...t) => {
21
+ const e = i.length === 1 ? i[0] : t.reduce(((s, r, n) => s + ((o) => {
22
+ if (o._$cssResult$ === !0) return o.cssText;
23
+ if (typeof o == "number") return o;
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));
29
+ else for (const e of t) {
30
+ const s = document.createElement("style"), r = D.litNonce;
31
+ r !== void 0 && s.setAttribute("nonce", r), s.textContent = e.cssText, i.appendChild(s);
32
+ }
33
+ }, tt = q ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
34
+ let e = "";
35
+ for (const s of t.cssRules) e += s.cssText;
36
+ return _t(e);
37
+ })(i) : i;
38
+ const { is: At, defineProperty: bt, getOwnPropertyDescriptor: xt, getOwnPropertyNames: St, getOwnPropertySymbols: wt, getPrototypeOf: Ct } = Object, B = globalThis, et = B.trustedTypes, Et = et ? et.emptyScript : "", Pt = B.reactiveElementPolyfillSupport, O = (i, t) => i, R = { toAttribute(i, t) {
39
+ switch (t) {
40
+ case Boolean:
41
+ i = i ? Et : null;
42
+ break;
43
+ case Object:
44
+ case Array:
45
+ i = i == null ? i : JSON.stringify(i);
46
+ }
47
+ return i;
48
+ }, fromAttribute(i, t) {
49
+ let e = i;
50
+ switch (t) {
51
+ case Boolean:
52
+ e = i !== null;
53
+ break;
54
+ case Number:
55
+ e = i === null ? null : Number(i);
56
+ break;
57
+ case Object:
58
+ case Array:
59
+ try {
60
+ e = JSON.parse(i);
61
+ } catch {
62
+ e = null;
106
63
  }
107
- return t;
108
- },
109
- fromAttribute(t, s) {
110
- let i = t;
111
- switch (s) {
112
- case Boolean:
113
- i = null !== t;
114
- break;
115
- case Number:
116
- i = null === t ? null : Number(t);
117
- break;
118
- case Object:
119
- case Array:
120
- try {
121
- i = JSON.parse(t);
122
- } catch (t) {
123
- i = null;
124
- }
125
- }
126
- return i;
127
- }
128
- },
129
- f$1 = (t, s) => !i$3(t, s),
130
- b = {
131
- attribute: true,
132
- type: String,
133
- converter: u$3,
134
- reflect: false,
135
- useDefault: false,
136
- hasChanged: f$1
137
- };
138
- Symbol.metadata ??= Symbol("metadata"), a$1.litPropertyMetadata ??= new WeakMap();
139
- let y$1 = class y extends HTMLElement {
64
+ }
65
+ return e;
66
+ } }, Z = (i, t) => !At(i, t), it = { attribute: !0, type: String, converter: R, reflect: !1, useDefault: !1, hasChanged: Z };
67
+ Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), B.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
68
+ let w = class extends HTMLElement {
140
69
  static addInitializer(t) {
141
70
  this._$Ei(), (this.l ??= []).push(t);
142
71
  }
143
72
  static get observedAttributes() {
144
73
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
145
74
  }
146
- static createProperty(t, s = b) {
147
- if (s.state && (s.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(t) && ((s = Object.create(s)).wrapped = true), this.elementProperties.set(t, s), !s.noAccessor) {
148
- const i = Symbol(),
149
- h = this.getPropertyDescriptor(t, i, s);
150
- void 0 !== h && e$4(this.prototype, t, h);
75
+ static createProperty(t, e = it) {
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);
151
79
  }
152
80
  }
153
- static getPropertyDescriptor(t, s, i) {
154
- const {
155
- get: e,
156
- set: r
157
- } = h$1(this.prototype, t) ?? {
158
- get() {
159
- return this[s];
160
- },
161
- set(t) {
162
- this[s] = t;
163
- }
164
- };
165
- return {
166
- get: e,
167
- set(s) {
168
- const h = e?.call(this);
169
- r?.call(this, s), this.requestUpdate(t, h, i);
170
- },
171
- configurable: true,
172
- enumerable: true
173
- };
81
+ static getPropertyDescriptor(t, e, s) {
82
+ const { get: r, set: n } = xt(this.prototype, t) ?? { get() {
83
+ return this[e];
84
+ }, set(o) {
85
+ this[e] = o;
86
+ } };
87
+ return { get: r, set(o) {
88
+ const c = r?.call(this);
89
+ n?.call(this, o), this.requestUpdate(t, c, s);
90
+ }, configurable: !0, enumerable: !0 };
174
91
  }
175
92
  static getPropertyOptions(t) {
176
- return this.elementProperties.get(t) ?? b;
93
+ return this.elementProperties.get(t) ?? it;
177
94
  }
178
95
  static _$Ei() {
179
- if (this.hasOwnProperty(d$1("elementProperties"))) return;
180
- const t = n$2(this);
181
- t.finalize(), void 0 !== t.l && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
96
+ if (this.hasOwnProperty(O("elementProperties"))) return;
97
+ const t = Ct(this);
98
+ t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
182
99
  }
183
100
  static finalize() {
184
- if (this.hasOwnProperty(d$1("finalized"))) return;
185
- if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d$1("properties"))) {
186
- const t = this.properties,
187
- s = [...r$4(t), ...o$3(t)];
188
- for (const i of s) this.createProperty(i, t[i]);
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]);
189
105
  }
190
106
  const t = this[Symbol.metadata];
191
- if (null !== t) {
192
- const s = litPropertyMetadata.get(t);
193
- if (void 0 !== s) for (const [t, i] of s) this.elementProperties.set(t, i);
107
+ if (t !== null) {
108
+ const e = litPropertyMetadata.get(t);
109
+ if (e !== void 0) for (const [s, r] of e) this.elementProperties.set(s, r);
194
110
  }
195
- this._$Eh = new Map();
196
- for (const [t, s] of this.elementProperties) {
197
- const i = this._$Eu(t, s);
198
- void 0 !== i && this._$Eh.set(i, t);
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);
199
115
  }
200
116
  this.elementStyles = this.finalizeStyles(this.styles);
201
117
  }
202
- static finalizeStyles(s) {
203
- const i = [];
204
- if (Array.isArray(s)) {
205
- const e = new Set(s.flat(1 / 0).reverse());
206
- for (const s of e) i.unshift(c$3(s));
207
- } else void 0 !== s && i.push(c$3(s));
208
- return i;
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 r of s) e.unshift(tt(r));
123
+ } else t !== void 0 && e.push(tt(t));
124
+ return e;
209
125
  }
210
- static _$Eu(t, s) {
211
- const i = s.attribute;
212
- return false === i ? void 0 : "string" == typeof i ? i : "string" == typeof t ? t.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;
213
129
  }
214
130
  constructor() {
215
- super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
131
+ super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
216
132
  }
217
133
  _$Ev() {
218
- this._$ES = new Promise(t => this.enableUpdating = t), this._$AL = new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(t => t(this));
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)));
219
135
  }
220
136
  addController(t) {
221
- (this._$EO ??= new Set()).add(t), void 0 !== this.renderRoot && this.isConnected && t.hostConnected?.();
137
+ (this._$EO ??= /* @__PURE__ */ new Set()).add(t), this.renderRoot !== void 0 && this.isConnected && t.hostConnected?.();
222
138
  }
223
139
  removeController(t) {
224
140
  this._$EO?.delete(t);
225
141
  }
226
142
  _$E_() {
227
- const t = new Map(),
228
- s = this.constructor.elementProperties;
229
- for (const i of s.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
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]);
230
145
  t.size > 0 && (this._$Ep = t);
231
146
  }
232
147
  createRenderRoot() {
233
148
  const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
234
- return S$1(t, this.constructor.elementStyles), t;
149
+ return yt(t, this.constructor.elementStyles), t;
235
150
  }
236
151
  connectedCallback() {
237
- this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach(t => t.hostConnected?.());
152
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((t) => t.hostConnected?.()));
153
+ }
154
+ enableUpdating(t) {
238
155
  }
239
- enableUpdating(t) {}
240
156
  disconnectedCallback() {
241
- this._$EO?.forEach(t => t.hostDisconnected?.());
157
+ this._$EO?.forEach(((t) => t.hostDisconnected?.()));
242
158
  }
243
- attributeChangedCallback(t, s, i) {
244
- this._$AK(t, i);
159
+ attributeChangedCallback(t, e, s) {
160
+ this._$AK(t, s);
245
161
  }
246
- _$ET(t, s) {
247
- const i = this.constructor.elementProperties.get(t),
248
- e = this.constructor._$Eu(t, i);
249
- if (void 0 !== e && true === i.reflect) {
250
- const h = (void 0 !== i.converter?.toAttribute ? i.converter : u$3).toAttribute(s, i.type);
251
- this._$Em = t, null == h ? this.removeAttribute(e) : this.setAttribute(e, h), this._$Em = null;
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 : R).toAttribute(e, s.type);
166
+ this._$Em = t, n == null ? this.removeAttribute(r) : this.setAttribute(r, n), this._$Em = null;
252
167
  }
253
168
  }
254
- _$AK(t, s) {
255
- const i = this.constructor,
256
- e = i._$Eh.get(t);
257
- if (void 0 !== e && this._$Em !== e) {
258
- const t = i.getPropertyOptions(e),
259
- h = "function" == typeof t.converter ? {
260
- fromAttribute: t.converter
261
- } : void 0 !== t.converter?.fromAttribute ? t.converter : u$3;
262
- this._$Em = e, this[e] = h.fromAttribute(s, t.type) ?? this._$Ej?.get(e) ?? null, this._$Em = null;
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 : R;
173
+ this._$Em = r, this[r] = o.fromAttribute(e, n.type) ?? this._$Ej?.get(r) ?? null, this._$Em = null;
263
174
  }
264
175
  }
265
- requestUpdate(t, s, i) {
266
- if (void 0 !== t) {
267
- const e = this.constructor,
268
- h = this[t];
269
- if (i ??= e.getPropertyOptions(t), !((i.hasChanged ?? f$1)(h, s) || i.useDefault && i.reflect && h === this._$Ej?.get(t) && !this.hasAttribute(e._$Eu(t, i)))) return;
270
- this.C(t, s, i);
176
+ requestUpdate(t, e, s) {
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);
271
181
  }
272
- false === this.isUpdatePending && (this._$ES = this._$EP());
182
+ this.isUpdatePending === !1 && (this._$ES = this._$EP());
273
183
  }
274
- C(t, s, {
275
- useDefault: i,
276
- reflect: e,
277
- wrapped: h
278
- }, r) {
279
- i && !(this._$Ej ??= new Map()).has(t) && (this._$Ej.set(t, r ?? s ?? this[t]), true !== h || void 0 !== r) || (this._$AL.has(t) || (this.hasUpdated || i || (s = void 0), this._$AL.set(t, s)), true === e && this._$Em !== t && (this._$Eq ??= new Set()).add(t));
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));
280
186
  }
281
187
  async _$EP() {
282
- this.isUpdatePending = true;
188
+ this.isUpdatePending = !0;
283
189
  try {
284
190
  await this._$ES;
285
- } catch (t) {
286
- Promise.reject(t);
191
+ } catch (e) {
192
+ Promise.reject(e);
287
193
  }
288
194
  const t = this.scheduleUpdate();
289
- return null != t && (await t), !this.isUpdatePending;
195
+ return t != null && await t, !this.isUpdatePending;
290
196
  }
291
197
  scheduleUpdate() {
292
198
  return this.performUpdate();
@@ -295,33 +201,31 @@ let y$1 = class y extends HTMLElement {
295
201
  if (!this.isUpdatePending) return;
296
202
  if (!this.hasUpdated) {
297
203
  if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
298
- for (const [t, s] of this._$Ep) this[t] = s;
204
+ for (const [r, n] of this._$Ep) this[r] = n;
299
205
  this._$Ep = void 0;
300
206
  }
301
- const t = this.constructor.elementProperties;
302
- if (t.size > 0) for (const [s, i] of t) {
303
- const {
304
- wrapped: t
305
- } = i,
306
- e = this[s];
307
- true !== t || this._$AL.has(s) || void 0 === e || this.C(s, void 0, i, e);
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);
308
211
  }
309
212
  }
310
- let t = false;
311
- const s = this._$AL;
213
+ let t = !1;
214
+ const e = this._$AL;
312
215
  try {
313
- t = this.shouldUpdate(s), t ? (this.willUpdate(s), this._$EO?.forEach(t => t.hostUpdate?.()), this.update(s)) : this._$EM();
216
+ t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach(((s) => s.hostUpdate?.())), this.update(e)) : this._$EM();
314
217
  } catch (s) {
315
- throw t = false, this._$EM(), s;
218
+ throw t = !1, this._$EM(), s;
316
219
  }
317
- t && this._$AE(s);
220
+ t && this._$AE(e);
221
+ }
222
+ willUpdate(t) {
318
223
  }
319
- willUpdate(t) {}
320
224
  _$AE(t) {
321
- this._$EO?.forEach(t => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t)), this.updated(t);
225
+ this._$EO?.forEach(((e) => e.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
322
226
  }
323
227
  _$EM() {
324
- this._$AL = new Map(), this.isUpdatePending = false;
228
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
325
229
  }
326
230
  get updateComplete() {
327
231
  return this.getUpdateComplete();
@@ -330,151 +234,82 @@ let y$1 = class y extends HTMLElement {
330
234
  return this._$ES;
331
235
  }
332
236
  shouldUpdate(t) {
333
- return true;
237
+ return !0;
334
238
  }
335
239
  update(t) {
336
- this._$Eq &&= this._$Eq.forEach(t => this._$ET(t, this[t])), this._$EM();
240
+ this._$Eq &&= this._$Eq.forEach(((e) => this._$ET(e, this[e]))), this._$EM();
241
+ }
242
+ updated(t) {
243
+ }
244
+ firstUpdated(t) {
337
245
  }
338
- updated(t) {}
339
- firstUpdated(t) {}
340
246
  };
341
- y$1.elementStyles = [], y$1.shadowRootOptions = {
342
- mode: "open"
343
- }, y$1[d$1("elementProperties")] = new Map(), y$1[d$1("finalized")] = new Map(), p$2?.({
344
- ReactiveElement: y$1
345
- }), (a$1.reactiveElementVersions ??= []).push("2.1.0");
346
-
347
- /**
348
- * @license
349
- * Copyright 2017 Google LLC
350
- * SPDX-License-Identifier: BSD-3-Clause
351
- */
352
- const t$3 = globalThis,
353
- i$2 = t$3.trustedTypes,
354
- s$2 = i$2 ? i$2.createPolicy("lit-html", {
355
- createHTML: t => t
356
- }) : void 0,
357
- e$3 = "$lit$",
358
- h = `lit$${Math.random().toFixed(9).slice(2)}$`,
359
- o$2 = "?" + h,
360
- n$1 = `<${o$2}>`,
361
- r$3 = document,
362
- l = () => r$3.createComment(""),
363
- c$1 = t => null === t || "object" != typeof t && "function" != typeof t,
364
- a = Array.isArray,
365
- u$2 = t => a(t) || "function" == typeof t?.[Symbol.iterator],
366
- d = "[ \t\n\f\r]",
367
- f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
368
- v$1 = /-->/g,
369
- _ = />/g,
370
- m$1 = RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`, "g"),
371
- p$1 = /'/g,
372
- g = /"/g,
373
- $ = /^(?:script|style|textarea|title)$/i,
374
- y = t => (i, ...s) => ({
375
- _$litType$: t,
376
- strings: i,
377
- values: s
378
- }),
379
- x = y(1),
380
- T = Symbol.for("lit-noChange"),
381
- E = Symbol.for("lit-nothing"),
382
- A = new WeakMap(),
383
- C = r$3.createTreeWalker(r$3, 129);
384
- function P(t, i) {
385
- if (!a(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
386
- return void 0 !== s$2 ? s$2.createHTML(i) : i;
247
+ w.elementStyles = [], w.shadowRootOptions = { mode: "open" }, w[O("elementProperties")] = /* @__PURE__ */ new Map(), w[O("finalized")] = /* @__PURE__ */ new Map(), Pt?.({ ReactiveElement: w }), (B.reactiveElementVersions ??= []).push("2.1.0");
248
+ const J = globalThis, j = J.trustedTypes, st = j ? j.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, pt = "$lit$", m = `lit$${Math.random().toFixed(9).slice(2)}$`, $t = "?" + m, Tt = `<${$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", V = `[
249
+ \f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, rt = /-->/g, nt = />/g, y = RegExp(`>|${V}(?:([^\\s"'>=/]+)(${V}*=${V}*(?:[^
250
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), ot = /'/g, at = /"/g, ft = /^(?:script|style|textarea|title)$/i, Mt = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), I = 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;
387
254
  }
388
- const V = (t, i) => {
389
- const s = t.length - 1,
390
- o = [];
391
- let r,
392
- l = 2 === i ? "<svg>" : 3 === i ? "<math>" : "",
393
- c = f;
394
- for (let i = 0; i < s; i++) {
395
- const s = t[i];
396
- let a,
397
- u,
398
- d = -1,
399
- y = 0;
400
- for (; y < s.length && (c.lastIndex = y, u = c.exec(s), null !== u);) y = c.lastIndex, c === f ? "!--" === u[1] ? c = v$1 : void 0 !== u[1] ? c = _ : void 0 !== u[2] ? ($.test(u[2]) && (r = RegExp("</" + u[2], "g")), c = m$1) : void 0 !== u[3] && (c = m$1) : c === m$1 ? ">" === u[0] ? (c = r ?? f, d = -1) : void 0 === u[1] ? d = -2 : (d = c.lastIndex - u[2].length, a = u[1], c = void 0 === u[3] ? m$1 : '"' === u[3] ? g : p$1) : c === g || c === p$1 ? c = m$1 : c === v$1 || c === _ ? c = f : (c = m$1, r = void 0);
401
- const x = c === m$1 && t[i + 1].startsWith("/>") ? " " : "";
402
- l += c === f ? s + n$1 : d >= 0 ? (o.push(a), s.slice(0, d) + e$3 + s.slice(d) + h + x) : s + h + (-2 === d ? i : x);
403
- }
404
- return [P(t, l + (t[s] || "<?>") + (2 === i ? "</svg>" : 3 === i ? "</math>" : "")), o];
255
+ const Ut = (i, t) => {
256
+ const e = i.length - 1, s = [];
257
+ let r, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = P;
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 === P ? 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 ?? P, 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 = P : (o = y, r = void 0);
262
+ const d = o === y && i[c + 1].startsWith("/>") ? " " : "";
263
+ n += o === P ? a + Tt : l >= 0 ? (s.push($), a.slice(0, l) + pt + a.slice(l) + m + d) : a + m + (l === -2 ? c : d);
264
+ }
265
+ return [gt(i, n + (i[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
405
266
  };
406
- class N {
407
- constructor({
408
- strings: t,
409
- _$litType$: s
410
- }, n) {
267
+ class H {
268
+ constructor({ strings: t, _$litType$: e }, s) {
411
269
  let r;
412
270
  this.parts = [];
413
- let c = 0,
414
- a = 0;
415
- const u = t.length - 1,
416
- d = this.parts,
417
- [f, v] = V(t, s);
418
- if (this.el = N.createElement(f, n), C.currentNode = this.el.content, 2 === s || 3 === s) {
419
- const t = this.el.content.firstChild;
420
- t.replaceWith(...t.childNodes);
421
- }
422
- for (; null !== (r = C.nextNode()) && d.length < u;) {
423
- if (1 === r.nodeType) {
424
- if (r.hasAttributes()) for (const t of r.getAttributeNames()) if (t.endsWith(e$3)) {
425
- const i = v[a++],
426
- s = r.getAttribute(t).split(h),
427
- e = /([.?@])?(.*)/.exec(i);
428
- d.push({
429
- type: 1,
430
- index: c,
431
- name: e[2],
432
- strings: s,
433
- ctor: "." === e[1] ? H : "?" === e[1] ? I : "@" === e[1] ? L : k
434
- }), r.removeAttribute(t);
435
- } else t.startsWith(h) && (d.push({
436
- type: 6,
437
- index: c
438
- }), r.removeAttribute(t));
439
- if ($.test(r.tagName)) {
440
- const t = r.textContent.split(h),
441
- s = t.length - 1;
442
- if (s > 0) {
443
- r.textContent = i$2 ? i$2.emptyScript : "";
444
- for (let i = 0; i < s; i++) r.append(t[i], l()), C.nextNode(), d.push({
445
- type: 2,
446
- index: ++c
447
- });
448
- r.append(t[s], l());
271
+ let n = 0, o = 0;
272
+ const c = t.length - 1, a = this.parts, [$, h] = Ut(t, e);
273
+ if (this.el = H.createElement($, s), b.currentNode = this.el.content, e === 2 || e === 3) {
274
+ const l = this.el.content.firstChild;
275
+ l.replaceWith(...l.childNodes);
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(m), p = /([.?@])?(.*)/.exec(u);
281
+ a.push({ type: 1, index: n, name: p[2], strings: d, ctor: p[1] === "." ? Ht : p[1] === "?" ? Nt : p[1] === "@" ? Dt : L }), r.removeAttribute(l);
282
+ } else l.startsWith(m) && (a.push({ type: 6, index: n }), r.removeAttribute(l));
283
+ if (ft.test(r.tagName)) {
284
+ const l = r.textContent.split(m), u = l.length - 1;
285
+ if (u > 0) {
286
+ r.textContent = j ? j.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());
449
289
  }
450
290
  }
451
- } else if (8 === r.nodeType) if (r.data === o$2) d.push({
452
- type: 2,
453
- index: c
454
- });else {
455
- let t = -1;
456
- for (; -1 !== (t = r.data.indexOf(h, t + 1));) d.push({
457
- type: 7,
458
- index: c
459
- }), t += h.length - 1;
291
+ } else if (r.nodeType === 8) if (r.data === $t) a.push({ type: 2, index: n });
292
+ else {
293
+ let l = -1;
294
+ for (; (l = r.data.indexOf(m, l + 1)) !== -1; ) a.push({ type: 7, index: n }), l += m.length - 1;
460
295
  }
461
- c++;
296
+ n++;
462
297
  }
463
298
  }
464
- static createElement(t, i) {
465
- const s = r$3.createElement("template");
299
+ static createElement(t, e) {
300
+ const s = x.createElement("template");
466
301
  return s.innerHTML = t, s;
467
302
  }
468
303
  }
469
- function S(t, i, s = t, e) {
470
- if (i === T) return i;
471
- let h = void 0 !== e ? s._$Co?.[e] : s._$Cl;
472
- const o = c$1(i) ? void 0 : i._$litDirective$;
473
- return h?.constructor !== o && (h?._$AO?.(false), void 0 === o ? h = void 0 : (h = new o(t), h._$AT(t, s, e)), void 0 !== e ? (s._$Co ??= [])[e] = h : s._$Cl = h), void 0 !== h && (i = S(t, h._$AS(t, i.values), h, e)), i;
304
+ function C(i, t, e = i, s) {
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;
474
309
  }
475
- let M$1 = class M {
476
- constructor(t, i) {
477
- this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = i;
310
+ let zt = class {
311
+ constructor(t, e) {
312
+ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
478
313
  }
479
314
  get parentNode() {
480
315
  return this._$AM.parentNode;
@@ -483,43 +318,34 @@ let M$1 = class M {
483
318
  return this._$AM._$AU;
484
319
  }
485
320
  u(t) {
486
- const {
487
- el: {
488
- content: i
489
- },
490
- parts: s
491
- } = this._$AD,
492
- e = (t?.creationScope ?? r$3).importNode(i, true);
493
- C.currentNode = e;
494
- let h = C.nextNode(),
495
- o = 0,
496
- n = 0,
497
- l = s[0];
498
- for (; void 0 !== l;) {
499
- if (o === l.index) {
500
- let i;
501
- 2 === l.type ? i = new R(h, h.nextSibling, this, t) : 1 === l.type ? i = new l.ctor(h, l.name, l.strings, this, t) : 6 === l.type && (i = new z(h, this, t)), this._$AV.push(i), l = s[++n];
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];
324
+ for (; a !== void 0; ) {
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];
502
328
  }
503
- o !== l?.index && (h = C.nextNode(), o++);
329
+ o !== a?.index && (n = b.nextNode(), o++);
504
330
  }
505
- return C.currentNode = r$3, e;
331
+ return b.currentNode = x, r;
506
332
  }
507
333
  p(t) {
508
- let i = 0;
509
- for (const s of this._$AV) void 0 !== s && (void 0 !== s.strings ? (s._$AI(t, s, i), i += s.strings.length - 2) : s._$AI(t[i])), i++;
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++;
510
336
  }
511
337
  };
512
- class R {
338
+ class E {
513
339
  get _$AU() {
514
340
  return this._$AM?._$AU ?? this._$Cv;
515
341
  }
516
- constructor(t, i, s, e) {
517
- this.type = 2, this._$AH = E, this._$AN = void 0, this._$AA = t, this._$AB = i, this._$AM = s, this.options = e, this._$Cv = e?.isConnected ?? true;
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;
518
344
  }
519
345
  get parentNode() {
520
346
  let t = this._$AA.parentNode;
521
- const i = this._$AM;
522
- return void 0 !== i && 11 === t?.nodeType && (t = i.parentNode), t;
347
+ const e = this._$AM;
348
+ return e !== void 0 && t?.nodeType === 11 && (t = e.parentNode), t;
523
349
  }
524
350
  get startNode() {
525
351
  return this._$AA;
@@ -527,8 +353,8 @@ class R {
527
353
  get endNode() {
528
354
  return this._$AB;
529
355
  }
530
- _$AI(t, i = this) {
531
- t = S(this, t, i), c$1(t) ? t === E || null == t || "" === t ? (this._$AH !== E && this._$AR(), this._$AH = E) : t !== this._$AH && t !== T && this._(t) : void 0 !== t._$litType$ ? this.$(t) : void 0 !== t.nodeType ? this.T(t) : u$2(t) ? this.k(t) : this._(t);
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);
532
358
  }
533
359
  O(t) {
534
360
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -537,179 +363,149 @@ class R {
537
363
  this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
538
364
  }
539
365
  _(t) {
540
- this._$AH !== E && c$1(this._$AH) ? this._$AA.nextSibling.data = t : this.T(r$3.createTextNode(t)), this._$AH = t;
366
+ this._$AH !== f && z(this._$AH) ? this._$AA.nextSibling.data = t : this.T(x.createTextNode(t)), this._$AH = t;
541
367
  }
542
368
  $(t) {
543
- const {
544
- values: i,
545
- _$litType$: s
546
- } = t,
547
- e = "number" == typeof s ? this._$AC(t) : (void 0 === s.el && (s.el = N.createElement(P(s.h, s.h[0]), this.options)), s);
548
- if (this._$AH?._$AD === e) this._$AH.p(i);else {
549
- const t = new M$1(e, this),
550
- s = t.u(this.options);
551
- t.p(i), this.T(s), this._$AH = t;
369
+ const { values: e, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = H.createElement(gt(s.h, s.h[0]), this.options)), s);
370
+ if (this._$AH?._$AD === r) this._$AH.p(e);
371
+ else {
372
+ const n = new zt(r, this), o = n.u(this.options);
373
+ n.p(e), this.T(o), this._$AH = n;
552
374
  }
553
375
  }
554
376
  _$AC(t) {
555
- let i = A.get(t.strings);
556
- return void 0 === i && A.set(t.strings, i = new N(t)), i;
377
+ let e = lt.get(t.strings);
378
+ return e === void 0 && lt.set(t.strings, e = new H(t)), e;
557
379
  }
558
380
  k(t) {
559
- a(this._$AH) || (this._$AH = [], this._$AR());
560
- const i = this._$AH;
561
- let s,
562
- e = 0;
563
- for (const h of t) e === i.length ? i.push(s = new R(this.O(l()), this.O(l()), this, this.options)) : s = i[e], s._$AI(h), e++;
564
- e < i.length && (this._$AR(s && s._$AB.nextSibling, e), i.length = e);
565
- }
566
- _$AR(t = this._$AA.nextSibling, i) {
567
- for (this._$AP?.(false, true, i); t && t !== this._$AB;) {
568
- const i = t.nextSibling;
569
- t.remove(), t = i;
381
+ K(this._$AH) || (this._$AH = [], this._$AR());
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);
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;
570
391
  }
571
392
  }
572
393
  setConnected(t) {
573
- void 0 === this._$AM && (this._$Cv = t, this._$AP?.(t));
394
+ this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
574
395
  }
575
396
  }
576
- class k {
397
+ class L {
577
398
  get tagName() {
578
399
  return this.element.tagName;
579
400
  }
580
401
  get _$AU() {
581
402
  return this._$AM._$AU;
582
403
  }
583
- constructor(t, i, s, e, h) {
584
- this.type = 1, this._$AH = E, this._$AN = void 0, this.element = t, this.name = i, this._$AM = e, this.options = h, s.length > 2 || "" !== s[0] || "" !== s[1] ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = E;
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;
585
406
  }
586
- _$AI(t, i = this, s, e) {
587
- const h = this.strings;
588
- let o = false;
589
- if (void 0 === h) t = S(this, t, i, 0), o = !c$1(t) || t !== this._$AH && t !== T, o && (this._$AH = t);else {
590
- const e = t;
591
- let n, r;
592
- for (t = h[0], n = 0; n < h.length - 1; n++) r = S(this, e[s + n], i, n), r === T && (r = this._$AH[n]), o ||= !c$1(r) || r !== this._$AH[n], r === E ? t = E : t !== E && (t += (r ?? "") + h[n + 1]), this._$AH[n] = r;
407
+ _$AI(t, e = this, s, r) {
408
+ const n = this.strings;
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);
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] = $;
593
415
  }
594
- o && !e && this.j(t);
416
+ o && !r && this.j(t);
595
417
  }
596
418
  j(t) {
597
- t === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
419
+ t === f ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
598
420
  }
599
421
  }
600
- class H extends k {
422
+ class Ht extends L {
601
423
  constructor() {
602
424
  super(...arguments), this.type = 3;
603
425
  }
604
426
  j(t) {
605
- this.element[this.name] = t === E ? void 0 : t;
427
+ this.element[this.name] = t === f ? void 0 : t;
606
428
  }
607
429
  }
608
- class I extends k {
430
+ class Nt extends L {
609
431
  constructor() {
610
432
  super(...arguments), this.type = 4;
611
433
  }
612
434
  j(t) {
613
- this.element.toggleAttribute(this.name, !!t && t !== E);
435
+ this.element.toggleAttribute(this.name, !!t && t !== f);
614
436
  }
615
437
  }
616
- class L extends k {
617
- constructor(t, i, s, e, h) {
618
- super(t, i, s, e, h), this.type = 5;
438
+ class Dt extends L {
439
+ constructor(t, e, s, r, n) {
440
+ super(t, e, s, r, n), this.type = 5;
619
441
  }
620
- _$AI(t, i = this) {
621
- if ((t = S(this, t, i, 0) ?? E) === T) return;
622
- const s = this._$AH,
623
- e = t === E && s !== E || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive,
624
- h = t !== E && (s === E || e);
625
- e && this.element.removeEventListener(this.name, this, s), h && this.element.addEventListener(this.name, this, t), this._$AH = t;
442
+ _$AI(t, e = this) {
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;
626
446
  }
627
447
  handleEvent(t) {
628
- "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
448
+ typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
629
449
  }
630
450
  }
631
- class z {
632
- constructor(t, i, s) {
633
- this.element = t, this.type = 6, this._$AN = void 0, this._$AM = i, this.options = s;
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;
634
454
  }
635
455
  get _$AU() {
636
456
  return this._$AM._$AU;
637
457
  }
638
458
  _$AI(t) {
639
- S(this, t);
459
+ C(this, t);
640
460
  }
641
461
  }
642
- const Z = {
643
- I: R},
644
- j = t$3.litHtmlPolyfillSupport;
645
- j?.(N, R), (t$3.litHtmlVersions ??= []).push("3.3.0");
646
- const B = (t, i, s) => {
647
- const e = s?.renderBefore ?? i;
648
- let h = e._$litPart$;
649
- if (void 0 === h) {
650
- const t = s?.renderBefore ?? null;
651
- e._$litPart$ = h = new R(i.insertBefore(l(), t), t, void 0, s ?? {});
652
- }
653
- return h._$AI(t), h;
462
+ const jt = { I: E }, Bt = J.litHtmlPolyfillSupport;
463
+ Bt?.(H, E), (J.litHtmlVersions ??= []).push("3.3.0");
464
+ const Lt = (i, t, e) => {
465
+ const s = e?.renderBefore ?? t;
466
+ let r = s._$litPart$;
467
+ if (r === void 0) {
468
+ const n = e?.renderBefore ?? null;
469
+ s._$litPart$ = r = new E(t.insertBefore(U(), n), n, void 0, e ?? {});
470
+ }
471
+ return r._$AI(i), r;
654
472
  };
655
-
656
- /**
657
- * @license
658
- * Copyright 2017 Google LLC
659
- * SPDX-License-Identifier: BSD-3-Clause
660
- */
661
- const s$1 = globalThis;
662
- let i$1 = class i extends y$1 {
473
+ const Q = globalThis;
474
+ let M = class extends w {
663
475
  constructor() {
664
- super(...arguments), this.renderOptions = {
665
- host: this
666
- }, this._$Do = void 0;
476
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
667
477
  }
668
478
  createRenderRoot() {
669
479
  const t = super.createRenderRoot();
670
480
  return this.renderOptions.renderBefore ??= t.firstChild, t;
671
481
  }
672
482
  update(t) {
673
- const r = this.render();
674
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = B(r, this.renderRoot, this.renderOptions);
483
+ const e = this.render();
484
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Lt(e, this.renderRoot, this.renderOptions);
675
485
  }
676
486
  connectedCallback() {
677
- super.connectedCallback(), this._$Do?.setConnected(true);
487
+ super.connectedCallback(), this._$Do?.setConnected(!0);
678
488
  }
679
489
  disconnectedCallback() {
680
- super.disconnectedCallback(), this._$Do?.setConnected(false);
490
+ super.disconnectedCallback(), this._$Do?.setConnected(!1);
681
491
  }
682
492
  render() {
683
- return T;
493
+ return S;
684
494
  }
685
495
  };
686
- i$1._$litElement$ = true, i$1["finalized"] = true, s$1.litElementHydrateSupport?.({
687
- LitElement: i$1
688
- });
689
- const o$1 = s$1.litElementPolyfillSupport;
690
- o$1?.({
691
- LitElement: i$1
692
- });
693
- (s$1.litElementVersions ??= []).push("4.2.0");
694
-
695
- /**
696
- * @license
697
- * Copyright 2017 Google LLC
698
- * SPDX-License-Identifier: BSD-3-Clause
699
- */
700
- const t$2 = {
701
- CHILD: 2},
702
- e$2 = t => (...e) => ({
703
- _$litDirective$: t,
704
- values: e
705
- });
706
- class i {
707
- constructor(t) {}
496
+ M._$litElement$ = !0, M.finalized = !0, Q.litElementHydrateSupport?.({ LitElement: M });
497
+ const kt = Q.litElementPolyfillSupport;
498
+ kt?.({ LitElement: M });
499
+ (Q.litElementVersions ??= []).push("4.2.0");
500
+ const Vt = { CHILD: 2 }, It = (i) => (...t) => ({ _$litDirective$: i, values: t });
501
+ class Wt {
502
+ constructor(t) {
503
+ }
708
504
  get _$AU() {
709
505
  return this._$AM._$AU;
710
506
  }
711
- _$AT(t, e, i) {
712
- this._$Ct = t, this._$AM = e, this._$Ci = i;
507
+ _$AT(t, e, s) {
508
+ this._$Ct = t, this._$AM = e, this._$Ci = s;
713
509
  }
714
510
  _$AS(t, e) {
715
511
  return this.update(t, e);
@@ -718,469 +514,307 @@ class i {
718
514
  return this.render(...e);
719
515
  }
720
516
  }
721
-
722
- /**
723
- * @license
724
- * Copyright 2020 Google LLC
725
- * SPDX-License-Identifier: BSD-3-Clause
726
- */
727
- const {
728
- I: t$1
729
- } = Z,
730
- s = () => document.createComment(""),
731
- r$2 = (o, i, n) => {
732
- const e = o._$AA.parentNode,
733
- l = void 0 === i ? o._$AB : i._$AA;
734
- if (void 0 === n) {
735
- const i = e.insertBefore(s(), l),
736
- c = e.insertBefore(s(), l);
737
- n = new t$1(i, c, o, o.options);
738
- } else {
739
- const t = n._$AB.nextSibling,
740
- i = n._$AM,
741
- c = i !== o;
742
- if (c) {
743
- let t;
744
- n._$AQ?.(o), n._$AM = o, void 0 !== n._$AP && (t = o._$AU) !== i._$AU && n._$AP(t);
745
- }
746
- if (t !== l || c) {
747
- let o = n._$AA;
748
- for (; o !== t;) {
749
- const t = o.nextSibling;
750
- e.insertBefore(o, l), o = t;
751
- }
752
- }
753
- }
754
- return n;
755
- },
756
- v = (o, t, i = o) => (o._$AI(t, i), o),
757
- u$1 = {},
758
- m = (o, t = u$1) => o._$AH = t,
759
- p = o => o._$AH,
760
- M = o => {
761
- o._$AP?.(false, true);
762
- let t = o._$AA;
763
- const i = o._$AB.nextSibling;
764
- for (; t !== i;) {
765
- const o = t.nextSibling;
766
- t.remove(), t = o;
767
- }
768
- };
769
-
770
- /**
771
- * @license
772
- * Copyright 2017 Google LLC
773
- * SPDX-License-Identifier: BSD-3-Clause
774
- */
775
- const u = (e, s, t) => {
776
- const r = new Map();
777
- for (let l = s; l <= t; l++) r.set(e[l], l);
778
- return r;
779
- },
780
- c = e$2(class extends i {
781
- constructor(e) {
782
- if (super(e), e.type !== t$2.CHILD) throw Error("repeat() can only be used in text expressions");
783
- }
784
- dt(e, s, t) {
785
- let r;
786
- void 0 === t ? t = s : void 0 !== s && (r = s);
787
- const l = [],
788
- o = [];
789
- let i = 0;
790
- for (const s of e) l[i] = r ? r(s, i) : i, o[i] = t(s, i), i++;
791
- return {
792
- values: o,
793
- keys: l
794
- };
795
- }
796
- render(e, s, t) {
797
- return this.dt(e, s, t).values;
798
- }
799
- update(s, [t, r, c]) {
800
- const d = p(s),
801
- {
802
- values: p$1,
803
- keys: a
804
- } = this.dt(t, r, c);
805
- if (!Array.isArray(d)) return this.ut = a, p$1;
806
- const h = this.ut ??= [],
807
- v$1 = [];
808
- let m$1,
809
- y,
810
- x = 0,
811
- j = d.length - 1,
812
- k = 0,
813
- w = p$1.length - 1;
814
- for (; x <= j && k <= w;) if (null === d[x]) x++;else if (null === d[j]) j--;else if (h[x] === a[k]) v$1[k] = v(d[x], p$1[k]), x++, k++;else if (h[j] === a[w]) v$1[w] = v(d[j], p$1[w]), j--, w--;else if (h[x] === a[w]) v$1[w] = v(d[x], p$1[w]), r$2(s, v$1[w + 1], d[x]), x++, w--;else if (h[j] === a[k]) v$1[k] = v(d[j], p$1[k]), r$2(s, d[x], d[j]), j--, k++;else if (void 0 === m$1 && (m$1 = u(a, k, w), y = u(h, x, j)), m$1.has(h[x])) {
815
- if (m$1.has(h[j])) {
816
- const e = y.get(a[k]),
817
- t = void 0 !== e ? d[e] : null;
818
- if (null === t) {
819
- const e = r$2(s, d[x]);
820
- v(e, p$1[k]), v$1[k] = e;
821
- } else v$1[k] = v(t, p$1[k]), r$2(s, d[x], t), d[e] = null;
822
- k++;
823
- } else M(d[j]), j--;
824
- } else M(d[x]), x++;
825
- for (; k <= w;) {
826
- const e = r$2(s, v$1[w + 1]);
827
- v(e, p$1[k]), v$1[k++] = e;
517
+ const { I: qt } = jt, ht = () => document.createComment(""), T = (i, t, e) => {
518
+ const s = i._$AA.parentNode, r = t === void 0 ? i._$AB : t._$AA;
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);
522
+ } else {
523
+ const n = e._$AB.nextSibling, o = e._$AM, c = o !== i;
524
+ if (c) {
525
+ let a;
526
+ e._$AQ?.(i), e._$AM = i, e._$AP !== void 0 && (a = i._$AU) !== o._$AU && e._$AP(a);
527
+ }
528
+ if (n !== r || c) {
529
+ let a = e._$AA;
530
+ for (; a !== n; ) {
531
+ const $ = a.nextSibling;
532
+ s.insertBefore(a, r), a = $;
828
533
  }
829
- for (; x <= j;) {
830
- const e = d[x++];
831
- null !== e && M(e);
832
- }
833
- return this.ut = a, m(s, v$1), T;
834
534
  }
835
- });
836
-
837
- /**
838
- * @license
839
- * Copyright 2017 Google LLC
840
- * SPDX-License-Identifier: BSD-3-Clause
841
- */
842
- const t = t => (e, o) => {
843
- void 0 !== o ? o.addInitializer(() => {
844
- customElements.define(t, e);
845
- }) : customElements.define(t, e);
535
+ }
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) => {
538
+ i._$AP?.(!1, !0);
539
+ let t = i._$AA;
540
+ const e = i._$AB.nextSibling;
541
+ for (; t !== e; ) {
542
+ const s = t.nextSibling;
543
+ t.remove(), t = s;
544
+ }
846
545
  };
847
-
848
- /**
849
- * @license
850
- * Copyright 2017 Google LLC
851
- * SPDX-License-Identifier: BSD-3-Clause
852
- */
853
- const o = {
854
- attribute: true,
855
- type: String,
856
- converter: u$3,
857
- reflect: false,
858
- hasChanged: f$1
859
- },
860
- r$1 = (t = o, e, r) => {
861
- const {
862
- kind: n,
863
- metadata: i
864
- } = r;
865
- let s = globalThis.litPropertyMetadata.get(i);
866
- if (void 0 === s && globalThis.litPropertyMetadata.set(i, s = new Map()), "setter" === n && ((t = Object.create(t)).wrapped = true), s.set(r.name, t), "accessor" === n) {
867
- const {
868
- name: o
869
- } = r;
870
- return {
871
- set(r) {
872
- const n = e.get.call(this);
873
- e.set.call(this, r), this.requestUpdate(o, n, t);
874
- },
875
- init(e) {
876
- return void 0 !== e && this.C(o, void 0, t, e), e;
877
- }
878
- };
879
- }
880
- if ("setter" === n) {
881
- const {
882
- name: o
883
- } = r;
884
- return function (r) {
885
- const n = this[o];
886
- e.call(this, r), this.requestUpdate(o, n, t);
887
- };
888
- }
889
- throw Error("Unsupported decorator location: " + n);
890
- };
891
- function n(t) {
892
- return (e, o) => "object" == typeof o ? r$1(t, e, o) : ((t, e, o) => {
893
- const r = e.hasOwnProperty(o);
894
- return e.constructor.createProperty(o, t), r ? Object.getOwnPropertyDescriptor(e, o) : void 0;
895
- })(t, e, o);
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 = It(class extends Wt {
551
+ constructor(i) {
552
+ if (super(i), i.type !== Vt.CHILD) throw Error("repeat() can only be used in text expressions");
553
+ }
554
+ dt(i, t, e) {
555
+ let s;
556
+ e === void 0 ? e = t : t !== void 0 && (s = t);
557
+ const r = [], n = [];
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 };
561
+ }
562
+ render(i, t, e) {
563
+ return this.dt(i, t, e).values;
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]), T(i, a[p + 1], r[l]), l++, p--;
575
+ else if (c[u] === o[d]) a[d] = A(r[u], n[d]), T(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]), k = g !== void 0 ? r[g] : null;
578
+ if (k === null) {
579
+ const X = T(i, r[l]);
580
+ A(X, n[d]), a[d] = X;
581
+ } else a[d] = A(k, n[d]), T(i, r[l], k), r[g] = null;
582
+ d++;
583
+ } else W(r[u]), u--;
584
+ else W(r[l]), l++;
585
+ for (; d <= p; ) {
586
+ const g = T(i, a[p + 1]);
587
+ A(g, n[d]), a[d++] = g;
588
+ }
589
+ for (; l <= u; ) {
590
+ const g = r[l++];
591
+ g !== null && W(g);
592
+ }
593
+ return this.ut = o, Zt(i, a), S;
594
+ }
595
+ });
596
+ const Kt = (i) => (t, e) => {
597
+ e !== void 0 ? e.addInitializer((() => {
598
+ customElements.define(i, t);
599
+ })) : customElements.define(i, t);
600
+ };
601
+ const Qt = { attribute: !0, type: String, converter: R, 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") {
605
+ const { name: o } = e;
606
+ return { set(c) {
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;
611
+ } };
612
+ }
613
+ if (s === "setter") {
614
+ const { name: o } = e;
615
+ return function(c) {
616
+ const a = this[o];
617
+ t.call(this, c), this.requestUpdate(o, a, i);
618
+ };
619
+ }
620
+ throw Error("Unsupported decorator location: " + s);
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;
626
+ })(i, t, e);
896
627
  }
897
-
898
- /**
899
- * @license
900
- * Copyright 2017 Google LLC
901
- * SPDX-License-Identifier: BSD-3-Clause
902
- */
903
- function r(r) {
904
- return n({
905
- ...r,
906
- state: true,
907
- attribute: false
908
- });
628
+ function N(i) {
629
+ return G({ ...i, state: !0, attribute: !1 });
909
630
  }
910
-
911
- /**
912
- * @license
913
- * Copyright 2017 Google LLC
914
- * SPDX-License-Identifier: BSD-3-Clause
915
- */
916
- const e$1 = (e, t, c) => (c.configurable = true, c.enumerable = true, Reflect.decorate && "object" != typeof t && Object.defineProperty(e, t, c), c);
917
-
918
- /**
919
- * @license
920
- * Copyright 2017 Google LLC
921
- * SPDX-License-Identifier: BSD-3-Clause
922
- */
923
- function e(e, r) {
924
- return (n, s, i) => {
925
- const o = t => t.renderRoot?.querySelector(e) ?? null;
926
- return e$1(n, s, {
927
- get() {
928
- return o(this);
929
- }
930
- });
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) => {
634
+ const n = (o) => o.renderRoot?.querySelector(i) ?? null;
635
+ return Xt(e, s, { get() {
636
+ return n(this);
637
+ } });
931
638
  };
932
639
  }
933
-
934
- let WidgetValue = class WidgetValue extends i$1 {
935
- constructor() {
936
- super();
937
- this.dataSets = new Map();
938
- this.textActive = true;
939
- this.version = '1.1.22';
940
- this.origWidth = 0;
941
- this.origHeight = 0;
942
- this.resizeObserver = new ResizeObserver(this.applyData.bind(this));
943
- this.resizeObserver.observe(this);
944
- }
945
- disconnectedCallback() {
946
- super.disconnectedCallback();
947
- if (this.resizeObserver) {
948
- this.resizeObserver.disconnect();
949
- }
950
- }
951
- firstUpdated(_changedProperties) {
952
- this.registerTheme(this.theme);
953
- }
954
- update(changedProperties) {
955
- if (changedProperties.has('inputData')) {
956
- this.transformData();
957
- }
958
- super.update(changedProperties);
959
- }
960
- updated(changedProperties) {
961
- if (changedProperties.has('inputData')) {
962
- this.sizingSetup();
963
- this.applyData();
964
- }
965
- if (changedProperties.has('theme')) {
966
- this.registerTheme(this.theme);
967
- }
968
- super.updated(changedProperties);
969
- }
970
- registerTheme(theme) {
971
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
972
- const cssTextColor = getComputedStyle(this).getPropertyValue('--re-text-color').trim();
973
- const cssBgColor = getComputedStyle(this).getPropertyValue('--re-tile-background-color').trim();
974
- this.themeBgColor = cssBgColor || ((_b = (_a = this.theme) === null || _a === void 0 ? void 0 : _a.theme_object) === null || _b === void 0 ? void 0 : _b.backgroundColor);
975
- this.themeTitleColor = cssTextColor || ((_f = (_e = (_d = (_c = this.theme) === null || _c === void 0 ? void 0 : _c.theme_object) === null || _d === void 0 ? void 0 : _d.title) === null || _e === void 0 ? void 0 : _e.textStyle) === null || _f === void 0 ? void 0 : _f.color);
976
- this.themeSubtitleColor =
977
- cssTextColor || ((_k = (_j = (_h = (_g = this.theme) === null || _g === void 0 ? void 0 : _g.theme_object) === null || _h === void 0 ? void 0 : _h.title) === null || _j === void 0 ? void 0 : _j.subtextStyle) === null || _k === void 0 ? void 0 : _k.color) || this.themeTitleColor;
978
- }
979
- sizingSetup() {
980
- var _a;
981
- const boxes = Array.from((_a = this.sizingContainer) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.single-value'));
982
- let width = 0;
983
- let height = 0;
984
- for (const box of boxes) {
985
- const dims = box.getBoundingClientRect();
986
- width = Math.max(dims.width, width);
987
- height = Math.max(dims.height, height);
988
- }
989
- if (width < this.origWidth) {
990
- if (!this.lastLargerWidthTime || Date.now() - this.lastLargerWidthTime > 5000) {
991
- this.origWidth = width;
992
- }
993
- }
994
- else {
995
- this.origWidth = width;
996
- this.lastLargerWidthTime = Date.now();
997
- }
998
- this.origHeight = height;
999
- }
1000
- applyData() {
1001
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
1002
- if (!this.valueContainer)
1003
- return;
1004
- const userWidth = this.valueContainer.getBoundingClientRect().width;
1005
- const userHeight = this.valueContainer.getBoundingClientRect().height;
1006
- const count = this.dataSets.size;
1007
- const width = this.origWidth;
1008
- const height = this.origHeight;
1009
- if (!userWidth || !userHeight || !width || !height)
1010
- return;
1011
- const fits = [];
1012
- for (let c = 1; c <= count; c++) {
1013
- const r = Math.ceil(count / c);
1014
- const uwgap = userWidth - 12 * (c - 1);
1015
- const uhgap = userHeight - 12 * (r - 1);
1016
- const m = uwgap / width / c;
1017
- const size = m * m * width * height * count;
1018
- if (r * m * height <= uhgap)
1019
- fits.push({ r, c, m, size, width, height, userWidth, userHeight });
1020
- }
1021
- for (let r = 1; r <= count; r++) {
1022
- const c = Math.ceil(count / r);
1023
- const uwgap = userWidth - 12 * (c - 1);
1024
- const uhgap = userHeight - 12 * (r - 1);
1025
- const m = uhgap / height / r;
1026
- const size = m * m * width * height * count;
1027
- if (c * m * width <= uwgap)
1028
- fits.push({ r, c, m, size, width, height, userWidth, userHeight });
1029
- }
1030
- const maxSize = fits.reduce((p, c) => (c.size < p ? p : c.size), 0);
1031
- const fit = fits.find((f) => f.size === maxSize);
1032
- if (!fit)
1033
- return;
1034
- const modifier = (_a = fit.m) !== null && _a !== void 0 ? _a : 1;
1035
- // console.log('FITS', fits, 'modifier', modifier, 'cols',fit?.c, 'rows', fit?.r, 'new size', fit?.size.toFixed(0), 'total space', (userWidth* userHeight).toFixed(0))
1036
- const boxes = Array.from((_b = this.valueContainer) === null || _b === void 0 ? void 0 : _b.querySelectorAll('.single-value'));
1037
- this.valueContainer.style.gridTemplateColumns = `repeat(${fit.c}, 1fr)`;
1038
- for (const box of boxes) {
1039
- box.setAttribute('style', `width:${modifier * width}px; height:${modifier * height}px; padding:${modifier * 6}px`);
1040
- const label = box.getAttribute('label');
1041
- const ds = this.dataSets.get(label !== null && label !== void 0 ? label : '');
1042
- const numberText = box.querySelector('.current-value');
1043
- numberText.setAttribute('style', `font-size: ${32 * modifier}px;
1044
- color: ${((_c = ds === null || ds === void 0 ? void 0 : ds.styling) === null || _c === void 0 ? void 0 : _c.valueColor) || ((_f = (_e = (_d = this.theme) === null || _d === void 0 ? void 0 : _d.theme_object) === null || _e === void 0 ? void 0 : _e.color) === null || _f === void 0 ? void 0 : _f[0]) || this.themeTitleColor};`);
1045
- const labelText = box.querySelector('.label');
1046
- labelText.setAttribute('style', `font-size: ${26 * modifier}px;
1047
- color: ${((_g = ds === null || ds === void 0 ? void 0 : ds.styling) === null || _g === void 0 ? void 0 : _g.labelColor) || ((_k = (_j = (_h = this.theme) === null || _h === void 0 ? void 0 : _h.theme_object) === null || _j === void 0 ? void 0 : _j.color) === null || _k === void 0 ? void 0 : _k[1]) || this.themeSubtitleColor};`);
1048
- const unitText = box.querySelector('.unit');
1049
- unitText.setAttribute('style', `font-size: ${26 * modifier}px;
1050
- color: ${((_l = ds === null || ds === void 0 ? void 0 : ds.styling) === null || _l === void 0 ? void 0 : _l.valueColor) || ((_p = (_o = (_m = this.theme) === null || _m === void 0 ? void 0 : _m.theme_object) === null || _o === void 0 ? void 0 : _o.color) === null || _p === void 0 ? void 0 : _p[0]) || this.themeTitleColor};`);
1051
- }
1052
- this.textActive = true;
1053
- }
1054
- async transformData() {
1055
- var _a, _b;
1056
- if (!this.inputData)
1057
- return;
1058
- this.dataSets.forEach((d) => {
1059
- var _a;
1060
- (_a = d.label) !== null && _a !== void 0 ? _a : (d.label = '');
1061
- });
1062
- this.dataSets = new Map();
1063
- (_b = (_a = this.inputData) === null || _a === void 0 ? void 0 : _a.dataseries) === null || _b === void 0 ? void 0 : _b.forEach((ds) => {
1064
- var _a;
1065
- // pivot data
1066
- const distincts = ds.multiChart
1067
- ? [...new Set((_a = ds.data) === null || _a === void 0 ? void 0 : _a.map((d) => d.pivot))].sort()
1068
- : [''];
1069
- distincts.forEach((piv) => {
1070
- var _a, _b, _c;
1071
- const prefix = piv !== null && piv !== void 0 ? piv : '';
1072
- const label = (_a = ds.label) !== null && _a !== void 0 ? _a : '';
1073
- const pds = {
1074
- label: prefix + (!!prefix && !!label ? ' - ' : '') + label,
1075
- order: ds.order,
1076
- unit: ds.unit,
1077
- precision: ds.precision,
1078
- advanced: ds.advanced,
1079
- styling: ds.styling,
1080
- multiChart: ds.multiChart,
1081
- value: ds.value,
1082
- data: distincts.length === 1 ? ds.data : (_b = ds.data) === null || _b === void 0 ? void 0 : _b.filter((d) => d.pivot === piv),
1083
- needleValue: undefined
1084
- };
1085
- this.dataSets.set((_c = pds.label) !== null && _c !== void 0 ? _c : '', pds);
1086
- });
1087
- });
1088
- // filter latest values and calculate average
1089
- this.dataSets.forEach((ds, label) => {
1090
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
1091
- (_a = ds.advanced) !== null && _a !== void 0 ? _a : (ds.advanced = {});
1092
- if (typeof ((_b = ds.advanced) === null || _b === void 0 ? void 0 : _b.averageLatest) !== 'number' || !isNaN((_c = ds.advanced) === null || _c === void 0 ? void 0 : _c.averageLatest))
1093
- ds.advanced.averageLatest = 1;
1094
- if (!ds.multiChart) {
1095
- ds.needleValue = ds.value;
1096
- }
1097
- else {
1098
- const data = (_f = (_d = ds === null || ds === void 0 ? void 0 : ds.data) === null || _d === void 0 ? void 0 : _d.slice(-((_e = ds === null || ds === void 0 ? void 0 : ds.advanced) === null || _e === void 0 ? void 0 : _e.averageLatest) || -1)) !== null && _f !== void 0 ? _f : [];
1099
- const values = ((_h = (_g = data === null || data === void 0 ? void 0 : data.map((d) => d.value)) === null || _g === void 0 ? void 0 : _g.filter((p) => p !== undefined)) !== null && _h !== void 0 ? _h : []);
1100
- ds.needleValue = values.reduce((p, c) => p + c, 0) / values.length;
1101
- // Check age of data Latency
1102
- const tsp = Date.parse((_k = (_j = data === null || data === void 0 ? void 0 : data[0]) === null || _j === void 0 ? void 0 : _j.tsp) !== null && _k !== void 0 ? _k : '');
1103
- if (isNaN(tsp)) {
1104
- const now = new Date().getTime();
1105
- if (now - tsp > ((_m = (_l = ds.advanced) === null || _l === void 0 ? void 0 : _l.maxLatency) !== null && _m !== void 0 ? _m : Infinity) * 1000)
1106
- ds.needleValue = undefined;
1107
- }
1108
- }
1109
- });
1110
- }
1111
- render() {
1112
- var _a, _b, _c, _d;
1113
- return x `
640
+ var Yt = Object.defineProperty, te = Object.getOwnPropertyDescriptor, _ = (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;
644
+ };
645
+ let v = class extends M {
646
+ constructor() {
647
+ super(), this.dataSets = /* @__PURE__ */ new Map(), this.textActive = !0, this.version = "1.1.24", this.origWidth = 0, this.origHeight = 0, this.resizeObserver = new ResizeObserver(this.applyData.bind(this)), this.resizeObserver.observe(this);
648
+ }
649
+ disconnectedCallback() {
650
+ super.disconnectedCallback(), this.resizeObserver && this.resizeObserver.disconnect();
651
+ }
652
+ firstUpdated(i) {
653
+ this.registerTheme(this.theme);
654
+ }
655
+ update(i) {
656
+ i.has("inputData") && this.transformData(), super.update(i);
657
+ }
658
+ updated(i) {
659
+ i.has("inputData") && (this.sizingSetup(), this.applyData()), i.has("theme") && this.registerTheme(this.theme), super.updated(i);
660
+ }
661
+ registerTheme(i) {
662
+ const t = getComputedStyle(this).getPropertyValue("--re-text-color").trim(), e = getComputedStyle(this).getPropertyValue("--re-tile-background-color").trim();
663
+ this.themeBgColor = e || 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;
664
+ }
665
+ sizingSetup() {
666
+ const i = Array.from(
667
+ this.sizingContainer?.querySelectorAll(".single-value")
668
+ );
669
+ let t = 0, e = 0;
670
+ for (const s of i) {
671
+ const r = s.getBoundingClientRect();
672
+ t = Math.max(r.width, t), e = Math.max(r.height, e);
673
+ }
674
+ t < this.origWidth ? (!this.lastLargerWidthTime || Date.now() - this.lastLargerWidthTime > 5e3) && (this.origWidth = t) : (this.origWidth = t, this.lastLargerWidthTime = Date.now()), this.origHeight = e;
675
+ }
676
+ applyData() {
677
+ if (!this.valueContainer) return;
678
+ const i = this.valueContainer.getBoundingClientRect().width, t = this.valueContainer.getBoundingClientRect().height, e = this.dataSets.size, s = this.origWidth, r = this.origHeight;
679
+ if (!i || !t || !s || !r) return;
680
+ const n = [];
681
+ for (let h = 1; h <= e; h++) {
682
+ 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;
683
+ l * p * r <= d && n.push({ r: l, c: h, m: p, size: g, width: s, height: r, userWidth: i, userHeight: t });
684
+ }
685
+ for (let h = 1; h <= e; h++) {
686
+ const l = Math.ceil(e / h), u = i - 12 * (l - 1), p = (t - 12 * (h - 1)) / r / h, g = p * p * s * r * e;
687
+ l * p * s <= u && n.push({ r: h, c: l, m: p, size: g, width: s, height: r, userWidth: i, userHeight: t });
688
+ }
689
+ const o = n.reduce((h, l) => l.size < h ? h : l.size, 0), c = n.find((h) => h.size === o);
690
+ if (!c) return;
691
+ const a = c.m ?? 1, $ = Array.from(
692
+ this.valueContainer?.querySelectorAll(".single-value")
693
+ );
694
+ this.valueContainer.style.gridTemplateColumns = `repeat(${c.c}, 1fr)`;
695
+ for (const h of $) {
696
+ h.setAttribute(
697
+ "style",
698
+ `width:${a * s}px; height:${a * r}px; padding:${a * 6}px`
699
+ );
700
+ const l = h.getAttribute("label"), u = this.dataSets.get(l ?? "");
701
+ h.querySelector(".label").setAttribute(
702
+ "style",
703
+ `font-size: ${26 * a}px;
704
+ color: ${u?.styling?.labelColor || this.themeTitleColor};`
705
+ ), h.querySelector(".current-value").setAttribute(
706
+ "style",
707
+ `font-size: ${32 * a}px;
708
+ color: ${u?.styling?.valueColor || this.theme?.theme_object?.color?.[0] || this.themeTitleColor};`
709
+ ), h.querySelector(".unit").setAttribute("style", `font-size: ${26 * a}px;`);
710
+ }
711
+ this.textActive = !0;
712
+ }
713
+ async transformData() {
714
+ this.inputData && (this.dataSets.forEach((i) => {
715
+ i.label ??= "";
716
+ }), this.dataSets = /* @__PURE__ */ new Map(), this.inputData?.dataseries?.forEach((i) => {
717
+ const t = i.multiChart ? [...new Set(i.data?.map((e) => e.pivot))].sort() : [""];
718
+ t.forEach((e) => {
719
+ const s = e ?? "", r = i.label ?? "", n = {
720
+ label: s + (s && r ? " - " : "") + r,
721
+ order: i.order,
722
+ unit: i.unit,
723
+ precision: i.precision,
724
+ advanced: i.advanced,
725
+ styling: i.styling,
726
+ multiChart: i.multiChart,
727
+ value: i.value,
728
+ data: t.length === 1 ? i.data : i.data?.filter((o) => o.pivot === e),
729
+ needleValue: void 0
730
+ };
731
+ this.dataSets.set(n.label ?? "", n);
732
+ });
733
+ }), this.dataSets.forEach((i, t) => {
734
+ if (i.advanced ??= {}, (typeof i.advanced?.averageLatest != "number" || !isNaN(i.advanced?.averageLatest)) && (i.advanced.averageLatest = 1), !i.multiChart)
735
+ i.needleValue = i.value;
736
+ else {
737
+ const e = i?.data?.slice(-i?.advanced?.averageLatest || -1) ?? [], s = e?.map((n) => n.value)?.filter((n) => n !== void 0) ?? [];
738
+ i.needleValue = s.reduce((n, o) => n + o, 0) / s.length;
739
+ const r = Date.parse(e?.[0]?.tsp ?? "");
740
+ isNaN(r) && (/* @__PURE__ */ new Date()).getTime() - r > (i.advanced?.maxLatency ?? 1 / 0) * 1e3 && (i.needleValue = void 0);
741
+ }
742
+ }));
743
+ }
744
+ render() {
745
+ return I`
1114
746
  <div
1115
747
  class="wrapper"
1116
748
  style="background-color: ${this.themeBgColor}; color: ${this.themeTitleColor}"
1117
749
  >
1118
750
  <header>
1119
- <h3 class="paging" ?active=${(_a = this.inputData) === null || _a === void 0 ? void 0 : _a.title}>${(_b = this.inputData) === null || _b === void 0 ? void 0 : _b.title}</h3>
751
+ <h3 class="paging" ?active=${this.inputData?.title}>${this.inputData?.title}</h3>
1120
752
  <p
1121
753
  class="paging"
1122
- ?active=${(_c = this.inputData) === null || _c === void 0 ? void 0 : _c.subTitle}
754
+ ?active=${this.inputData?.subTitle}
1123
755
  style="color: ${this.themeSubtitleColor}"
1124
756
  >
1125
- ${(_d = this.inputData) === null || _d === void 0 ? void 0 : _d.subTitle}
757
+ ${this.inputData?.subTitle}
1126
758
  </p>
1127
759
  </header>
1128
760
  <div class="sizing-container">
1129
- ${c(this.dataSets, ([label]) => label, ([label, ds]) => {
1130
- var _a;
1131
- return x `
1132
- <div class="single-value" label="${label}">
1133
- <div class="label paging" ?active=${this.textActive}>${label}</div>
761
+ ${ut(
762
+ this.dataSets,
763
+ ([i]) => i,
764
+ ([i, t]) => I`
765
+ <div class="single-value" label="${i}">
766
+ <div class="label paging" ?active=${this.textActive}>${i}</div>
1134
767
  <span
1135
768
  class="current-value paging"
1136
769
  ?active=${this.textActive}
1137
- style="color: ${this.themeTitleColor}"
770
+ style="color: ${t?.styling?.valueColor || this.theme?.theme_object?.color?.[0] || this.themeTitleColor}"
1138
771
  >
1139
- ${ds.needleValue === undefined ||
1140
- ds.needleValue === null ||
1141
- isNaN(ds.needleValue)
1142
- ? ''
1143
- : ds.needleValue.toFixed(Math.max(0, (_a = ds.precision) !== null && _a !== void 0 ? _a : 0))}
1144
- <span class="unit paging" ?active=${this.textActive}>${ds.unit}</span>
772
+ ${t.needleValue === void 0 || t.needleValue === null || isNaN(t.needleValue) ? "" : t.needleValue.toFixed(Math.max(0, t.precision ?? 0))}
773
+ <span class="unit paging" ?active=${this.textActive}>${t.unit}</span>
1145
774
  </span>
1146
775
  </div>
1147
- `;
1148
- })}
776
+ `
777
+ )}
1149
778
  </div>
1150
779
  <div class="paging no-data" ?active=${!this.dataSets.size}>No Data</div>
1151
780
  <div class="value-container">
1152
- ${c([...this.dataSets.entries()].sort(), ([label]) => label, ([label, ds]) => {
1153
- var _a;
1154
- return x `
1155
- <div class="single-value" label="${label}">
1156
- <div class="label paging" ?active=${this.textActive}>${label}</div>
781
+ ${ut(
782
+ [...this.dataSets.entries()].sort(),
783
+ ([i]) => i,
784
+ ([i, t]) => I`
785
+ <div class="single-value" label="${i}">
786
+ <div
787
+ class="label paging"
788
+ style="color: ${t?.styling?.labelColor || this.themeTitleColor}"
789
+ ?active=${this.textActive}
790
+ >
791
+ ${i}
792
+ </div>
1157
793
  <span
1158
794
  class="current-value paging"
1159
795
  ?active=${this.textActive}
1160
- style="color: ${this.themeTitleColor}"
796
+ style="color: ${t?.styling?.valueColor || this.theme?.theme_object?.color?.[0] || this.themeTitleColor}"
1161
797
  >
1162
- ${ds.needleValue === undefined ||
1163
- ds.needleValue === null ||
1164
- isNaN(ds.needleValue)
1165
- ? ''
1166
- : ds.needleValue.toFixed(Math.max(0, (_a = ds.precision) !== null && _a !== void 0 ? _a : 0))}
1167
- <span class="unit paging" ?active=${this.textActive}>${ds.unit}</span>
798
+ ${t.needleValue === void 0 || t.needleValue === null || isNaN(t.needleValue) ? "" : t.needleValue.toFixed(Math.max(0, t.precision ?? 0))}
799
+ <span class="unit paging" ?active=${this.textActive}>${t.unit}</span>
1168
800
  </span>
1169
801
  </div>
1170
- `;
1171
- })}
802
+ `
803
+ )}
1172
804
  </div>
1173
805
  </div>
1174
806
  `;
1175
- }
807
+ }
1176
808
  };
1177
- WidgetValue.styles = i$4 `
809
+ v.styles = mt`
1178
810
  :host {
1179
811
  display: block;
1180
812
  font-family: sans-serif;
1181
813
  box-sizing: border-box;
1182
814
  position: relative;
1183
815
  margin: auto;
816
+ overflow: hidden;
817
+ container-type: size;
1184
818
  }
1185
819
 
1186
820
  .paging:not([active]) {
@@ -1192,7 +826,7 @@ WidgetValue.styles = i$4 `
1192
826
  flex-direction: column;
1193
827
  height: 100%;
1194
828
  width: 100%;
1195
- padding: 16px;
829
+ padding: 2cqh 2cqw;
1196
830
  box-sizing: border-box;
1197
831
  }
1198
832
 
@@ -1261,36 +895,37 @@ WidgetValue.styles = i$4 `
1261
895
  justify-content: center;
1262
896
  }
1263
897
  `;
1264
- __decorate([
1265
- n({ type: Object })
1266
- ], WidgetValue.prototype, "inputData", void 0);
1267
- __decorate([
1268
- n({ type: Object })
1269
- ], WidgetValue.prototype, "theme", void 0);
1270
- __decorate([
1271
- r()
1272
- ], WidgetValue.prototype, "dataSets", void 0);
1273
- __decorate([
1274
- r()
1275
- ], WidgetValue.prototype, "textActive", void 0);
1276
- __decorate([
1277
- r()
1278
- ], WidgetValue.prototype, "themeBgColor", void 0);
1279
- __decorate([
1280
- r()
1281
- ], WidgetValue.prototype, "themeTitleColor", void 0);
1282
- __decorate([
1283
- r()
1284
- ], WidgetValue.prototype, "themeSubtitleColor", void 0);
1285
- __decorate([
1286
- e('.value-container')
1287
- ], WidgetValue.prototype, "valueContainer", void 0);
1288
- __decorate([
1289
- e('.sizing-container')
1290
- ], WidgetValue.prototype, "sizingContainer", void 0);
1291
- WidgetValue = __decorate([
1292
- t('widget-value-1.1.22')
1293
- ], WidgetValue);
1294
-
1295
- export { WidgetValue };
898
+ _([
899
+ G({ type: Object })
900
+ ], v.prototype, "inputData", 2);
901
+ _([
902
+ G({ type: Object })
903
+ ], v.prototype, "theme", 2);
904
+ _([
905
+ N()
906
+ ], v.prototype, "dataSets", 2);
907
+ _([
908
+ N()
909
+ ], v.prototype, "textActive", 2);
910
+ _([
911
+ N()
912
+ ], v.prototype, "themeBgColor", 2);
913
+ _([
914
+ N()
915
+ ], v.prototype, "themeTitleColor", 2);
916
+ _([
917
+ N()
918
+ ], v.prototype, "themeSubtitleColor", 2);
919
+ _([
920
+ vt(".value-container")
921
+ ], v.prototype, "valueContainer", 2);
922
+ _([
923
+ vt(".sizing-container")
924
+ ], v.prototype, "sizingContainer", 2);
925
+ v = _([
926
+ Kt("widget-value-1.1.24")
927
+ ], v);
928
+ export {
929
+ v as WidgetValue
930
+ };
1296
931
  //# sourceMappingURL=widget-value.js.map