@record-evolution/widget-switch 1.1.1 → 1.1.2

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,3029 +1,150 @@
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$6 = 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.");
42
- this.cssText = t, this.t = e;
43
- }
44
- get styleSheet() {
45
- let t = this.o;
46
- const s = this.t;
47
- if (e$6 && 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));
50
- }
51
- return t;
52
- }
53
- toString() {
54
- return this.cssText;
55
- }
1
+ import { css as d, LitElement as u, html as h } from "lit";
2
+ import { repeat as v } from "lit/directives/repeat.js";
3
+ import { property as m, state as n, customElement as b } from "lit/decorators.js";
4
+ import "@material/web/switch/switch.js";
5
+ var f = Object.defineProperty, g = Object.getOwnPropertyDescriptor, c = (t, e, r, s) => {
6
+ for (var l = s > 1 ? void 0 : s ? g(e, r) : e, p = t.length - 1, i; p >= 0; p--)
7
+ (i = t[p]) && (l = (s ? i(e, r, l) : i(l)) || l);
8
+ return s && l && f(e, r, l), l;
56
9
  };
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$6) 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$6 ? 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$5,
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);
106
- }
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 {
140
- static addInitializer(t) {
141
- this._$Ei(), (this.l ??= []).push(t);
142
- }
143
- static get observedAttributes() {
144
- return this.finalize(), this._$Eh && [...this._$Eh.keys()];
145
- }
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$5(this.prototype, t, h);
151
- }
152
- }
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
- };
174
- }
175
- static getPropertyOptions(t) {
176
- return this.elementProperties.get(t) ?? b;
177
- }
178
- 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);
182
- }
183
- 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]);
189
- }
190
- 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);
194
- }
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);
199
- }
200
- this.elementStyles = this.finalizeStyles(this.styles);
201
- }
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;
209
- }
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;
213
- }
10
+ let a = class extends u {
214
11
  constructor() {
215
- super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
216
- }
217
- _$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));
219
- }
220
- addController(t) {
221
- (this._$EO ??= new Set()).add(t), void 0 !== this.renderRoot && this.isConnected && t.hostConnected?.();
222
- }
223
- removeController(t) {
224
- this._$EO?.delete(t);
225
- }
226
- _$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]);
230
- t.size > 0 && (this._$Ep = t);
12
+ super(), this.dataSets = /* @__PURE__ */ new Map(), this.textActive = !0, this.version = "1.1.2", this.origWidth = 0, this.origHeight = 0, this.resizeObserver = new ResizeObserver(this.applyData.bind(this)), this.resizeObserver.observe(this);
231
13
  }
232
- createRenderRoot() {
233
- const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
234
- return S$1(t, this.constructor.elementStyles), t;
235
- }
236
- connectedCallback() {
237
- this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach(t => t.hostConnected?.());
238
- }
239
- enableUpdating(t) {}
240
14
  disconnectedCallback() {
241
- this._$EO?.forEach(t => t.hostDisconnected?.());
242
- }
243
- attributeChangedCallback(t, s, i) {
244
- this._$AK(t, i);
245
- }
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;
252
- }
253
- }
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;
263
- }
264
- }
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);
271
- }
272
- false === this.isUpdatePending && (this._$ES = this._$EP());
273
- }
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));
280
- }
281
- async _$EP() {
282
- this.isUpdatePending = true;
283
- try {
284
- await this._$ES;
285
- } catch (t) {
286
- Promise.reject(t);
287
- }
288
- const t = this.scheduleUpdate();
289
- return null != t && (await t), !this.isUpdatePending;
290
- }
291
- scheduleUpdate() {
292
- return this.performUpdate();
293
- }
294
- performUpdate() {
295
- if (!this.isUpdatePending) return;
296
- if (!this.hasUpdated) {
297
- if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
298
- for (const [t, s] of this._$Ep) this[t] = s;
299
- this._$Ep = void 0;
300
- }
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);
308
- }
309
- }
310
- let t = false;
311
- const s = this._$AL;
312
- try {
313
- t = this.shouldUpdate(s), t ? (this.willUpdate(s), this._$EO?.forEach(t => t.hostUpdate?.()), this.update(s)) : this._$EM();
314
- } catch (s) {
315
- throw t = false, this._$EM(), s;
316
- }
317
- t && this._$AE(s);
318
- }
319
- willUpdate(t) {}
320
- _$AE(t) {
321
- this._$EO?.forEach(t => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t)), this.updated(t);
15
+ super.disconnectedCallback(), this.resizeObserver && this.resizeObserver.disconnect();
322
16
  }
323
- _$EM() {
324
- this._$AL = new Map(), this.isUpdatePending = false;
325
- }
326
- get updateComplete() {
327
- return this.getUpdateComplete();
328
- }
329
- getUpdateComplete() {
330
- return this._$ES;
331
- }
332
- shouldUpdate(t) {
333
- return true;
17
+ firstUpdated(t) {
18
+ this.valueContainer = this?.shadowRoot?.querySelector(".value-container"), this.registerTheme(this.theme), this.transformData(), this.applyData();
334
19
  }
335
20
  update(t) {
336
- this._$Eq &&= this._$Eq.forEach(t => this._$ET(t, this[t])), this._$EM();
337
- }
338
- updated(t) {}
339
- firstUpdated(t) {}
340
- };
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$4 = "$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;
387
- }
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$4 + 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];
405
- };
406
- class N {
407
- constructor({
408
- strings: t,
409
- _$litType$: s
410
- }, n) {
411
- let r;
412
- 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$4)) {
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());
449
- }
450
- }
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;
460
- }
461
- c++;
462
- }
463
- }
464
- static createElement(t, i) {
465
- const s = r$3.createElement("template");
466
- return s.innerHTML = t, s;
467
- }
468
- }
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;
474
- }
475
- let M$1 = class M {
476
- constructor(t, i) {
477
- this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = i;
478
- }
479
- get parentNode() {
480
- return this._$AM.parentNode;
481
- }
482
- get _$AU() {
483
- return this._$AM._$AU;
484
- }
485
- 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];
502
- }
503
- o !== l?.index && (h = C.nextNode(), o++);
504
- }
505
- return C.currentNode = r$3, e;
506
- }
507
- 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++;
510
- }
511
- };
512
- class R {
513
- get _$AU() {
514
- return this._$AM?._$AU ?? this._$Cv;
515
- }
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;
518
- }
519
- get parentNode() {
520
- let t = this._$AA.parentNode;
521
- const i = this._$AM;
522
- return void 0 !== i && 11 === t?.nodeType && (t = i.parentNode), t;
523
- }
524
- get startNode() {
525
- return this._$AA;
526
- }
527
- get endNode() {
528
- return this._$AB;
529
- }
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);
532
- }
533
- O(t) {
534
- return this._$AA.parentNode.insertBefore(t, this._$AB);
535
- }
536
- T(t) {
537
- this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
538
- }
539
- _(t) {
540
- this._$AH !== E && c$1(this._$AH) ? this._$AA.nextSibling.data = t : this.T(r$3.createTextNode(t)), this._$AH = t;
541
- }
542
- $(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;
552
- }
553
- }
554
- _$AC(t) {
555
- let i = A.get(t.strings);
556
- return void 0 === i && A.set(t.strings, i = new N(t)), i;
557
- }
558
- 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;
570
- }
571
- }
572
- setConnected(t) {
573
- void 0 === this._$AM && (this._$Cv = t, this._$AP?.(t));
574
- }
575
- }
576
- class k {
577
- get tagName() {
578
- return this.element.tagName;
579
- }
580
- get _$AU() {
581
- return this._$AM._$AU;
582
- }
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;
585
- }
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;
593
- }
594
- o && !e && this.j(t);
595
- }
596
- j(t) {
597
- t === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
598
- }
599
- }
600
- class H extends k {
601
- constructor() {
602
- super(...arguments), this.type = 3;
603
- }
604
- j(t) {
605
- this.element[this.name] = t === E ? void 0 : t;
606
- }
607
- }
608
- class I extends k {
609
- constructor() {
610
- super(...arguments), this.type = 4;
611
- }
612
- j(t) {
613
- this.element.toggleAttribute(this.name, !!t && t !== E);
614
- }
615
- }
616
- class L extends k {
617
- constructor(t, i, s, e, h) {
618
- super(t, i, s, e, h), this.type = 5;
619
- }
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;
626
- }
627
- handleEvent(t) {
628
- "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
629
- }
630
- }
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;
634
- }
635
- get _$AU() {
636
- return this._$AM._$AU;
637
- }
638
- _$AI(t) {
639
- S(this, t);
640
- }
641
- }
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;
654
- };
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 {
663
- constructor() {
664
- super(...arguments), this.renderOptions = {
665
- host: this
666
- }, this._$Do = void 0;
667
- }
668
- createRenderRoot() {
669
- const t = super.createRenderRoot();
670
- return this.renderOptions.renderBefore ??= t.firstChild, t;
671
- }
672
- 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);
675
- }
676
- connectedCallback() {
677
- super.connectedCallback(), this._$Do?.setConnected(true);
678
- }
679
- disconnectedCallback() {
680
- super.disconnectedCallback(), this._$Do?.setConnected(false);
681
- }
682
- render() {
683
- return T;
684
- }
685
- };
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
- ATTRIBUTE: 1,
702
- CHILD: 2},
703
- e$3 = t => (...e) => ({
704
- _$litDirective$: t,
705
- values: e
706
- });
707
- class i {
708
- constructor(t) {}
709
- get _$AU() {
710
- return this._$AM._$AU;
711
- }
712
- _$AT(t, e, i) {
713
- this._$Ct = t, this._$AM = e, this._$Ci = i;
714
- }
715
- _$AS(t, e) {
716
- return this.update(t, e);
717
- }
718
- update(t, e) {
719
- return this.render(...e);
720
- }
721
- }
722
-
723
- /**
724
- * @license
725
- * Copyright 2020 Google LLC
726
- * SPDX-License-Identifier: BSD-3-Clause
727
- */
728
- const {
729
- I: t$1
730
- } = Z,
731
- s = () => document.createComment(""),
732
- r$2 = (o, i, n) => {
733
- const e = o._$AA.parentNode,
734
- l = void 0 === i ? o._$AB : i._$AA;
735
- if (void 0 === n) {
736
- const i = e.insertBefore(s(), l),
737
- c = e.insertBefore(s(), l);
738
- n = new t$1(i, c, o, o.options);
739
- } else {
740
- const t = n._$AB.nextSibling,
741
- i = n._$AM,
742
- c = i !== o;
743
- if (c) {
744
- let t;
745
- n._$AQ?.(o), n._$AM = o, void 0 !== n._$AP && (t = o._$AU) !== i._$AU && n._$AP(t);
746
- }
747
- if (t !== l || c) {
748
- let o = n._$AA;
749
- for (; o !== t;) {
750
- const t = o.nextSibling;
751
- e.insertBefore(o, l), o = t;
752
- }
753
- }
754
- }
755
- return n;
756
- },
757
- v = (o, t, i = o) => (o._$AI(t, i), o),
758
- u$1 = {},
759
- m = (o, t = u$1) => o._$AH = t,
760
- p = o => o._$AH,
761
- M = o => {
762
- o._$AP?.(false, true);
763
- let t = o._$AA;
764
- const i = o._$AB.nextSibling;
765
- for (; t !== i;) {
766
- const o = t.nextSibling;
767
- t.remove(), t = o;
768
- }
769
- };
770
-
771
- /**
772
- * @license
773
- * Copyright 2017 Google LLC
774
- * SPDX-License-Identifier: BSD-3-Clause
775
- */
776
- const u = (e, s, t) => {
777
- const r = new Map();
778
- for (let l = s; l <= t; l++) r.set(e[l], l);
779
- return r;
780
- },
781
- c = e$3(class extends i {
782
- constructor(e) {
783
- if (super(e), e.type !== t$2.CHILD) throw Error("repeat() can only be used in text expressions");
784
- }
785
- dt(e, s, t) {
786
- let r;
787
- void 0 === t ? t = s : void 0 !== s && (r = s);
788
- const l = [],
789
- o = [];
790
- let i = 0;
791
- for (const s of e) l[i] = r ? r(s, i) : i, o[i] = t(s, i), i++;
792
- return {
793
- values: o,
794
- keys: l
795
- };
796
- }
797
- render(e, s, t) {
798
- return this.dt(e, s, t).values;
799
- }
800
- update(s, [t, r, c]) {
801
- const d = p(s),
802
- {
803
- values: p$1,
804
- keys: a
805
- } = this.dt(t, r, c);
806
- if (!Array.isArray(d)) return this.ut = a, p$1;
807
- const h = this.ut ??= [],
808
- v$1 = [];
809
- let m$1,
810
- y,
811
- x = 0,
812
- j = d.length - 1,
813
- k = 0,
814
- w = p$1.length - 1;
815
- 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])) {
816
- if (m$1.has(h[j])) {
817
- const e = y.get(a[k]),
818
- t = void 0 !== e ? d[e] : null;
819
- if (null === t) {
820
- const e = r$2(s, d[x]);
821
- v(e, p$1[k]), v$1[k] = e;
822
- } else v$1[k] = v(t, p$1[k]), r$2(s, d[x], t), d[e] = null;
823
- k++;
824
- } else M(d[j]), j--;
825
- } else M(d[x]), x++;
826
- for (; k <= w;) {
827
- const e = r$2(s, v$1[w + 1]);
828
- v(e, p$1[k]), v$1[k++] = e;
829
- }
830
- for (; x <= j;) {
831
- const e = d[x++];
832
- null !== e && M(e);
833
- }
834
- return this.ut = a, m(s, v$1), T;
835
- }
836
- });
837
-
838
- /**
839
- * @license
840
- * Copyright 2017 Google LLC
841
- * SPDX-License-Identifier: BSD-3-Clause
842
- */
843
- const t = t => (e, o) => {
844
- void 0 !== o ? o.addInitializer(() => {
845
- customElements.define(t, e);
846
- }) : customElements.define(t, e);
847
- };
848
-
849
- /**
850
- * @license
851
- * Copyright 2017 Google LLC
852
- * SPDX-License-Identifier: BSD-3-Clause
853
- */
854
- const o = {
855
- attribute: true,
856
- type: String,
857
- converter: u$3,
858
- reflect: false,
859
- hasChanged: f$1
860
- },
861
- r$1 = (t = o, e, r) => {
862
- const {
863
- kind: n,
864
- metadata: i
865
- } = r;
866
- let s = globalThis.litPropertyMetadata.get(i);
867
- 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) {
868
- const {
869
- name: o
870
- } = r;
871
- return {
872
- set(r) {
873
- const n = e.get.call(this);
874
- e.set.call(this, r), this.requestUpdate(o, n, t);
875
- },
876
- init(e) {
877
- return void 0 !== e && this.C(o, void 0, t, e), e;
878
- }
879
- };
880
- }
881
- if ("setter" === n) {
882
- const {
883
- name: o
884
- } = r;
885
- return function (r) {
886
- const n = this[o];
887
- e.call(this, r), this.requestUpdate(o, n, t);
888
- };
889
- }
890
- throw Error("Unsupported decorator location: " + n);
891
- };
892
- function n(t) {
893
- return (e, o) => "object" == typeof o ? r$1(t, e, o) : ((t, e, o) => {
894
- const r = e.hasOwnProperty(o);
895
- return e.constructor.createProperty(o, t), r ? Object.getOwnPropertyDescriptor(e, o) : void 0;
896
- })(t, e, o);
897
- }
898
-
899
- /**
900
- * @license
901
- * Copyright 2017 Google LLC
902
- * SPDX-License-Identifier: BSD-3-Clause
903
- */
904
- function r(r) {
905
- return n({
906
- ...r,
907
- state: true,
908
- attribute: false
909
- });
910
- }
911
-
912
- /**
913
- * @license
914
- * Copyright 2017 Google LLC
915
- * SPDX-License-Identifier: BSD-3-Clause
916
- */
917
- const e$2 = (e, t, c) => (c.configurable = true, c.enumerable = true, Reflect.decorate && "object" != typeof t && Object.defineProperty(e, t, c), c);
918
-
919
- /**
920
- * @license
921
- * Copyright 2017 Google LLC
922
- * SPDX-License-Identifier: BSD-3-Clause
923
- */
924
- function e$1(e, r) {
925
- return (n, s, i) => {
926
- const o = t => t.renderRoot?.querySelector(e) ?? null;
927
- return e$2(n, s, {
928
- get() {
929
- return o(this);
930
- }
931
- });
932
- };
933
- }
934
-
935
- /**
936
- * @license
937
- * Copyright 2023 Google LLC
938
- * SPDX-License-Identifier: Apache-2.0
939
- */
940
- /**
941
- * A key to retrieve an `Attachable` element's `AttachableController` from a
942
- * global `MutationObserver`.
943
- */
944
- const ATTACHABLE_CONTROLLER = Symbol('attachableController');
945
- let FOR_ATTRIBUTE_OBSERVER;
946
- {
947
- /**
948
- * A global `MutationObserver` that reacts to `for` attribute changes on
949
- * `Attachable` elements. If the `for` attribute changes, the controller will
950
- * re-attach to the new referenced element.
951
- */
952
- FOR_ATTRIBUTE_OBSERVER = new MutationObserver(records => {
953
- for (const record of records) {
954
- // When a control's `for` attribute changes, inform its
955
- // `AttachableController` to update to a new control.
956
- record.target[ATTACHABLE_CONTROLLER]?.hostConnected();
957
- }
958
- });
959
- }
960
- /**
961
- * A controller that provides an implementation for `Attachable` elements.
962
- *
963
- * @example
964
- * ```ts
965
- * class MyElement extends LitElement implements Attachable {
966
- * get control() { return this.attachableController.control; }
967
- *
968
- * private readonly attachableController = new AttachableController(
969
- * this,
970
- * (previousControl, newControl) => {
971
- * previousControl?.removeEventListener('click', this.handleClick);
972
- * newControl?.addEventListener('click', this.handleClick);
973
- * }
974
- * );
975
- *
976
- * // Implement remaining `Attachable` properties/methods that call the
977
- * // controller's properties/methods.
978
- * }
979
- * ```
980
- */
981
- class AttachableController {
982
- get htmlFor() {
983
- return this.host.getAttribute('for');
984
- }
985
- set htmlFor(htmlFor) {
986
- if (htmlFor === null) {
987
- this.host.removeAttribute('for');
988
- } else {
989
- this.host.setAttribute('for', htmlFor);
990
- }
991
- }
992
- get control() {
993
- if (this.host.hasAttribute('for')) {
994
- if (!this.htmlFor || !this.host.isConnected) {
995
- return null;
996
- }
997
- return this.host.getRootNode().querySelector(`#${this.htmlFor}`);
998
- }
999
- return this.currentControl || this.host.parentElement;
1000
- }
1001
- set control(control) {
1002
- if (control) {
1003
- this.attach(control);
1004
- } else {
1005
- this.detach();
1006
- }
1007
- }
1008
- /**
1009
- * Creates a new controller for an `Attachable` element.
1010
- *
1011
- * @param host The `Attachable` element.
1012
- * @param onControlChange A callback with two parameters for the previous and
1013
- * next control. An `Attachable` element may perform setup or teardown
1014
- * logic whenever the control changes.
1015
- */
1016
- constructor(host, onControlChange) {
1017
- this.host = host;
1018
- this.onControlChange = onControlChange;
1019
- this.currentControl = null;
1020
- host.addController(this);
1021
- host[ATTACHABLE_CONTROLLER] = this;
1022
- FOR_ATTRIBUTE_OBSERVER?.observe(host, {
1023
- attributeFilter: ['for']
1024
- });
1025
- }
1026
- attach(control) {
1027
- if (control === this.currentControl) {
1028
- return;
1029
- }
1030
- this.setCurrentControl(control);
1031
- // When imperatively attaching, remove the `for` attribute so
1032
- // that the attached control is used instead of a referenced one.
1033
- this.host.removeAttribute('for');
1034
- }
1035
- detach() {
1036
- this.setCurrentControl(null);
1037
- // When imperatively detaching, add an empty `for=""` attribute. This will
1038
- // ensure the control is `null` rather than the `parentElement`.
1039
- this.host.setAttribute('for', '');
1040
- }
1041
- /** @private */
1042
- hostConnected() {
1043
- this.setCurrentControl(this.control);
1044
- }
1045
- /** @private */
1046
- hostDisconnected() {
1047
- this.setCurrentControl(null);
1048
- }
1049
- setCurrentControl(control) {
1050
- this.onControlChange(this.currentControl, control);
1051
- this.currentControl = control;
1052
- }
1053
- }
1054
-
1055
- /**
1056
- * @license
1057
- * Copyright 2021 Google LLC
1058
- * SPDX-License-Identifier: Apache-2.0
1059
- */
1060
- /**
1061
- * Events that the focus ring listens to.
1062
- */
1063
- const EVENTS$1 = ['focusin', 'focusout', 'pointerdown'];
1064
- /**
1065
- * A focus ring component.
1066
- *
1067
- * @fires visibility-changed {Event} Fired whenever `visible` changes.
1068
- */
1069
- class FocusRing extends i$1 {
1070
- constructor() {
1071
- super(...arguments);
1072
- /**
1073
- * Makes the focus ring visible.
1074
- */
1075
- this.visible = false;
1076
- /**
1077
- * Makes the focus ring animate inwards instead of outwards.
1078
- */
1079
- this.inward = false;
1080
- this.attachableController = new AttachableController(this, this.onControlChange.bind(this));
1081
- }
1082
- get htmlFor() {
1083
- return this.attachableController.htmlFor;
1084
- }
1085
- set htmlFor(htmlFor) {
1086
- this.attachableController.htmlFor = htmlFor;
1087
- }
1088
- get control() {
1089
- return this.attachableController.control;
1090
- }
1091
- set control(control) {
1092
- this.attachableController.control = control;
1093
- }
1094
- attach(control) {
1095
- this.attachableController.attach(control);
1096
- }
1097
- detach() {
1098
- this.attachableController.detach();
1099
- }
1100
- connectedCallback() {
1101
- super.connectedCallback();
1102
- // Needed for VoiceOver, which will create a "group" if the element is a
1103
- // sibling to other content.
1104
- this.setAttribute('aria-hidden', 'true');
1105
- }
1106
- /** @private */
1107
- handleEvent(event) {
1108
- if (event[HANDLED_BY_FOCUS_RING]) {
1109
- // This ensures the focus ring does not activate when multiple focus rings
1110
- // are used within a single component.
1111
- return;
1112
- }
1113
- switch (event.type) {
1114
- default:
1115
- return;
1116
- case 'focusin':
1117
- this.visible = this.control?.matches(':focus-visible') ?? false;
1118
- break;
1119
- case 'focusout':
1120
- case 'pointerdown':
1121
- this.visible = false;
1122
- break;
1123
- }
1124
- event[HANDLED_BY_FOCUS_RING] = true;
1125
- }
1126
- onControlChange(prev, next) {
1127
- for (const event of EVENTS$1) {
1128
- prev?.removeEventListener(event, this);
1129
- next?.addEventListener(event, this);
1130
- }
1131
- }
1132
- update(changed) {
1133
- if (changed.has('visible')) {
1134
- // This logic can be removed once the `:has` selector has been introduced
1135
- // to Firefox. This is necessary to allow correct submenu styles.
1136
- this.dispatchEvent(new Event('visibility-changed'));
1137
- }
1138
- super.update(changed);
1139
- }
1140
- }
1141
- __decorate([n({
1142
- type: Boolean,
1143
- reflect: true
1144
- })], FocusRing.prototype, "visible", void 0);
1145
- __decorate([n({
1146
- type: Boolean,
1147
- reflect: true
1148
- })], FocusRing.prototype, "inward", void 0);
1149
- const HANDLED_BY_FOCUS_RING = Symbol('handledByFocusRing');
1150
-
1151
- /**
1152
- * @license
1153
- * Copyright 2024 Google LLC
1154
- * SPDX-License-Identifier: Apache-2.0
1155
- */
1156
- // Generated stylesheet for ./focus/internal/focus-ring-styles.css.
1157
- const styles$2 = i$4`:host{animation-delay:0s,calc(var(--mdif3-focus-ring-duration, 600ms)*.25);animation-duration:calc(var(--mdif3-focus-ring-duration, 600ms)*.25),calc(var(--mdif3-focus-ring-duration, 600ms)*.75);animation-timing-function:cubic-bezier(0.2, 0, 0, 1);box-sizing:border-box;color:var(--mdif3-focus-ring-color, var(--mdif3-sys-color-secondary, #625b71));display:none;pointer-events:none;position:absolute}:host([visible]){display:flex}:host(:not([inward])){animation-name:outward-grow,outward-shrink;border-end-end-radius:calc(var(--mdif3-focus-ring-shape-end-end, var(--mdif3-focus-ring-shape, var(--mdif3-sys-shape-corner-full, 9999px))) + var(--mdif3-focus-ring-outward-offset, 2px));border-end-start-radius:calc(var(--mdif3-focus-ring-shape-end-start, var(--mdif3-focus-ring-shape, var(--mdif3-sys-shape-corner-full, 9999px))) + var(--mdif3-focus-ring-outward-offset, 2px));border-start-end-radius:calc(var(--mdif3-focus-ring-shape-start-end, var(--mdif3-focus-ring-shape, var(--mdif3-sys-shape-corner-full, 9999px))) + var(--mdif3-focus-ring-outward-offset, 2px));border-start-start-radius:calc(var(--mdif3-focus-ring-shape-start-start, var(--mdif3-focus-ring-shape, var(--mdif3-sys-shape-corner-full, 9999px))) + var(--mdif3-focus-ring-outward-offset, 2px));inset:calc(-1*var(--mdif3-focus-ring-outward-offset, 2px));outline:var(--mdif3-focus-ring-width, 3px) solid currentColor}:host([inward]){animation-name:inward-grow,inward-shrink;border-end-end-radius:calc(var(--mdif3-focus-ring-shape-end-end, var(--mdif3-focus-ring-shape, var(--mdif3-sys-shape-corner-full, 9999px))) - var(--mdif3-focus-ring-inward-offset, 0px));border-end-start-radius:calc(var(--mdif3-focus-ring-shape-end-start, var(--mdif3-focus-ring-shape, var(--mdif3-sys-shape-corner-full, 9999px))) - var(--mdif3-focus-ring-inward-offset, 0px));border-start-end-radius:calc(var(--mdif3-focus-ring-shape-start-end, var(--mdif3-focus-ring-shape, var(--mdif3-sys-shape-corner-full, 9999px))) - var(--mdif3-focus-ring-inward-offset, 0px));border-start-start-radius:calc(var(--mdif3-focus-ring-shape-start-start, var(--mdif3-focus-ring-shape, var(--mdif3-sys-shape-corner-full, 9999px))) - var(--mdif3-focus-ring-inward-offset, 0px));border:var(--mdif3-focus-ring-width, 3px) solid currentColor;inset:var(--mdif3-focus-ring-inward-offset, 0px)}@keyframes outward-grow{from{outline-width:0}to{outline-width:var(--mdif3-focus-ring-active-width, 8px)}}@keyframes outward-shrink{from{outline-width:var(--mdif3-focus-ring-active-width, 8px)}}@keyframes inward-grow{from{border-width:0}to{border-width:var(--mdif3-focus-ring-active-width, 8px)}}@keyframes inward-shrink{from{border-width:var(--mdif3-focus-ring-active-width, 8px)}}@media(prefers-reduced-motion){:host{animation:none}}
1158
- `;
1159
-
1160
- /**
1161
- * @license
1162
- * Copyright 2021 Google LLC
1163
- * SPDX-License-Identifier: Apache-2.0
1164
- */
1165
- /**
1166
- * TODO(b/267336424): add docs
1167
- *
1168
- * @final
1169
- * @suppress {visibility}
1170
- */
1171
- let MdFocusRing = class MdFocusRing extends FocusRing {};
1172
- MdFocusRing.styles = [styles$2];
1173
- MdFocusRing = __decorate([t('mdif3-focus-ring')], MdFocusRing);
1174
-
1175
- /**
1176
- * @license
1177
- * Copyright 2018 Google LLC
1178
- * SPDX-License-Identifier: BSD-3-Clause
1179
- */
1180
- const e = e$3(class extends i {
1181
- constructor(t) {
1182
- if (super(t), t.type !== t$2.ATTRIBUTE || "class" !== t.name || t.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
1183
- }
1184
- render(t) {
1185
- return " " + Object.keys(t).filter(s => t[s]).join(" ") + " ";
1186
- }
1187
- update(s, [i]) {
1188
- if (void 0 === this.st) {
1189
- this.st = new Set(), void 0 !== s.strings && (this.nt = new Set(s.strings.join(" ").split(/\s/).filter(t => "" !== t)));
1190
- for (const t in i) i[t] && !this.nt?.has(t) && this.st.add(t);
1191
- return this.render(i);
1192
- }
1193
- const r = s.element.classList;
1194
- for (const t of this.st) t in i || (r.remove(t), this.st.delete(t));
1195
- for (const t in i) {
1196
- const s = !!i[t];
1197
- s === this.st.has(t) || this.nt?.has(t) || (s ? (r.add(t), this.st.add(t)) : (r.remove(t), this.st.delete(t)));
1198
- }
1199
- return T;
1200
- }
1201
- });
1202
-
1203
- /**
1204
- * @license
1205
- * Copyright 2021 Google LLC
1206
- * SPDX-License-Identifier: Apache-2.0
1207
- */
1208
- /**
1209
- * Easing functions to use for web animations.
1210
- *
1211
- * **NOTE:** `EASING.EMPHASIZED` is approximated with unknown accuracy.
1212
- *
1213
- * TODO(b/241113345): replace with tokens
1214
- */
1215
- const EASING = {
1216
- STANDARD: 'cubic-bezier(0.2, 0, 0, 1)'};
1217
-
1218
- /**
1219
- * @license
1220
- * Copyright 2022 Google LLC
1221
- * SPDX-License-Identifier: Apache-2.0
1222
- */
1223
- const PRESS_GROW_MS = 450;
1224
- const MINIMUM_PRESS_MS = 225;
1225
- const INITIAL_ORIGIN_SCALE = 0.2;
1226
- const PADDING = 10;
1227
- const SOFT_EDGE_MINIMUM_SIZE = 75;
1228
- const SOFT_EDGE_CONTAINER_RATIO = 0.35;
1229
- const PRESS_PSEUDO = '::after';
1230
- const ANIMATION_FILL = 'forwards';
1231
- /**
1232
- * Interaction states for the ripple.
1233
- *
1234
- * On Touch:
1235
- * - `INACTIVE -> TOUCH_DELAY -> WAITING_FOR_CLICK -> INACTIVE`
1236
- * - `INACTIVE -> TOUCH_DELAY -> HOLDING -> WAITING_FOR_CLICK -> INACTIVE`
1237
- *
1238
- * On Mouse or Pen:
1239
- * - `INACTIVE -> WAITING_FOR_CLICK -> INACTIVE`
1240
- */
1241
- var State;
1242
- (function (State) {
1243
- /**
1244
- * Initial state of the control, no touch in progress.
1245
- *
1246
- * Transitions:
1247
- * - on touch down: transition to `TOUCH_DELAY`.
1248
- * - on mouse down: transition to `WAITING_FOR_CLICK`.
1249
- */
1250
- State[State["INACTIVE"] = 0] = "INACTIVE";
1251
- /**
1252
- * Touch down has been received, waiting to determine if it's a swipe or
1253
- * scroll.
1254
- *
1255
- * Transitions:
1256
- * - on touch up: begin press; transition to `WAITING_FOR_CLICK`.
1257
- * - on cancel: transition to `INACTIVE`.
1258
- * - after `TOUCH_DELAY_MS`: begin press; transition to `HOLDING`.
1259
- */
1260
- State[State["TOUCH_DELAY"] = 1] = "TOUCH_DELAY";
1261
- /**
1262
- * A touch has been deemed to be a press
1263
- *
1264
- * Transitions:
1265
- * - on up: transition to `WAITING_FOR_CLICK`.
1266
- */
1267
- State[State["HOLDING"] = 2] = "HOLDING";
1268
- /**
1269
- * The user touch has finished, transition into rest state.
1270
- *
1271
- * Transitions:
1272
- * - on click end press; transition to `INACTIVE`.
1273
- */
1274
- State[State["WAITING_FOR_CLICK"] = 3] = "WAITING_FOR_CLICK";
1275
- })(State || (State = {}));
1276
- /**
1277
- * Events that the ripple listens to.
1278
- */
1279
- const EVENTS = ['click', 'contextmenu', 'pointercancel', 'pointerdown', 'pointerenter', 'pointerleave', 'pointerup'];
1280
- /**
1281
- * Delay reacting to touch so that we do not show the ripple for a swipe or
1282
- * scroll interaction.
1283
- */
1284
- const TOUCH_DELAY_MS = 150;
1285
- /**
1286
- * Used to detect if HCM is active. Events do not process during HCM when the
1287
- * ripple is not displayed.
1288
- */
1289
- const FORCED_COLORS = window.matchMedia('(forced-colors: active)');
1290
- /**
1291
- * A ripple component.
1292
- */
1293
- class Ripple extends i$1 {
1294
- constructor() {
1295
- super(...arguments);
1296
- /**
1297
- * Disables the ripple.
1298
- */
1299
- this.disabled = false;
1300
- this.hovered = false;
1301
- this.pressed = false;
1302
- this.rippleSize = '';
1303
- this.rippleScale = '';
1304
- this.initialSize = 0;
1305
- this.state = State.INACTIVE;
1306
- this.attachableController = new AttachableController(this, this.onControlChange.bind(this));
1307
- }
1308
- get htmlFor() {
1309
- return this.attachableController.htmlFor;
1310
- }
1311
- set htmlFor(htmlFor) {
1312
- this.attachableController.htmlFor = htmlFor;
1313
- }
1314
- get control() {
1315
- return this.attachableController.control;
1316
- }
1317
- set control(control) {
1318
- this.attachableController.control = control;
1319
- }
1320
- attach(control) {
1321
- this.attachableController.attach(control);
1322
- }
1323
- detach() {
1324
- this.attachableController.detach();
1325
- }
1326
- connectedCallback() {
1327
- super.connectedCallback();
1328
- // Needed for VoiceOver, which will create a "group" if the element is a
1329
- // sibling to other content.
1330
- this.setAttribute('aria-hidden', 'true');
1331
- }
1332
- render() {
1333
- const classes = {
1334
- 'hovered': this.hovered,
1335
- 'pressed': this.pressed
1336
- };
1337
- return x`<div class="surface ${e(classes)}"></div>`;
1338
- }
1339
- update(changedProps) {
1340
- if (changedProps.has('disabled') && this.disabled) {
1341
- this.hovered = false;
1342
- this.pressed = false;
1343
- }
1344
- super.update(changedProps);
1345
- }
1346
- /**
1347
- * TODO(b/269799771): make private
1348
- * @private only public for slider
1349
- */
1350
- handlePointerenter(event) {
1351
- if (!this.shouldReactToEvent(event)) {
1352
- return;
1353
- }
1354
- this.hovered = true;
1355
- }
1356
- /**
1357
- * TODO(b/269799771): make private
1358
- * @private only public for slider
1359
- */
1360
- handlePointerleave(event) {
1361
- if (!this.shouldReactToEvent(event)) {
1362
- return;
1363
- }
1364
- this.hovered = false;
1365
- // release a held mouse or pen press that moves outside the element
1366
- if (this.state !== State.INACTIVE) {
1367
- this.endPressAnimation();
1368
- }
1369
- }
1370
- handlePointerup(event) {
1371
- if (!this.shouldReactToEvent(event)) {
1372
- return;
1373
- }
1374
- if (this.state === State.HOLDING) {
1375
- this.state = State.WAITING_FOR_CLICK;
1376
- return;
1377
- }
1378
- if (this.state === State.TOUCH_DELAY) {
1379
- this.state = State.WAITING_FOR_CLICK;
1380
- this.startPressAnimation(this.rippleStartEvent);
1381
- return;
1382
- }
1383
- }
1384
- async handlePointerdown(event) {
1385
- if (!this.shouldReactToEvent(event)) {
1386
- return;
1387
- }
1388
- this.rippleStartEvent = event;
1389
- if (!this.isTouch(event)) {
1390
- this.state = State.WAITING_FOR_CLICK;
1391
- this.startPressAnimation(event);
1392
- return;
1393
- }
1394
- // Wait for a hold after touch delay
1395
- this.state = State.TOUCH_DELAY;
1396
- await new Promise(resolve => {
1397
- setTimeout(resolve, TOUCH_DELAY_MS);
1398
- });
1399
- if (this.state !== State.TOUCH_DELAY) {
1400
- return;
1401
- }
1402
- this.state = State.HOLDING;
1403
- this.startPressAnimation(event);
1404
- }
1405
- handleClick() {
1406
- // Click is a MouseEvent in Firefox and Safari, so we cannot use
1407
- // `shouldReactToEvent`
1408
- if (this.disabled) {
1409
- return;
1410
- }
1411
- if (this.state === State.WAITING_FOR_CLICK) {
1412
- this.endPressAnimation();
1413
- return;
1414
- }
1415
- if (this.state === State.INACTIVE) {
1416
- // keyboard synthesized click event
1417
- this.startPressAnimation();
1418
- this.endPressAnimation();
1419
- }
1420
- }
1421
- handlePointercancel(event) {
1422
- if (!this.shouldReactToEvent(event)) {
1423
- return;
1424
- }
1425
- this.endPressAnimation();
1426
- }
1427
- handleContextmenu() {
1428
- if (this.disabled) {
1429
- return;
1430
- }
1431
- this.endPressAnimation();
1432
- }
1433
- determineRippleSize() {
1434
- const {
1435
- height,
1436
- width
1437
- } = this.getBoundingClientRect();
1438
- const maxDim = Math.max(height, width);
1439
- const softEdgeSize = Math.max(SOFT_EDGE_CONTAINER_RATIO * maxDim, SOFT_EDGE_MINIMUM_SIZE);
1440
- // `?? 1` may be removed once `currentCSSZoom` is widely available.
1441
- const zoom = this.currentCSSZoom ?? 1;
1442
- const initialSize = Math.floor(maxDim * INITIAL_ORIGIN_SCALE / zoom);
1443
- const hypotenuse = Math.sqrt(width ** 2 + height ** 2);
1444
- const maxRadius = hypotenuse + PADDING;
1445
- this.initialSize = initialSize;
1446
- // The dimensions may be altered by CSS `zoom`, which needs to be
1447
- // compensated for in the final scale() value.
1448
- const maybeZoomedScale = (maxRadius + softEdgeSize) / initialSize;
1449
- this.rippleScale = `${maybeZoomedScale / zoom}`;
1450
- this.rippleSize = `${initialSize}px`;
1451
- }
1452
- getNormalizedPointerEventCoords(pointerEvent) {
1453
- const {
1454
- scrollX,
1455
- scrollY
1456
- } = window;
1457
- const {
1458
- left,
1459
- top
1460
- } = this.getBoundingClientRect();
1461
- const documentX = scrollX + left;
1462
- const documentY = scrollY + top;
1463
- const {
1464
- pageX,
1465
- pageY
1466
- } = pointerEvent;
1467
- // `?? 1` may be removed once `currentCSSZoom` is widely available.
1468
- const zoom = this.currentCSSZoom ?? 1;
1469
- return {
1470
- x: (pageX - documentX) / zoom,
1471
- y: (pageY - documentY) / zoom
1472
- };
1473
- }
1474
- getTranslationCoordinates(positionEvent) {
1475
- const {
1476
- height,
1477
- width
1478
- } = this.getBoundingClientRect();
1479
- // `?? 1` may be removed once `currentCSSZoom` is widely available.
1480
- const zoom = this.currentCSSZoom ?? 1;
1481
- // end in the center
1482
- const endPoint = {
1483
- x: (width / zoom - this.initialSize) / 2,
1484
- y: (height / zoom - this.initialSize) / 2
1485
- };
1486
- let startPoint;
1487
- if (positionEvent instanceof PointerEvent) {
1488
- startPoint = this.getNormalizedPointerEventCoords(positionEvent);
1489
- } else {
1490
- startPoint = {
1491
- x: width / zoom / 2,
1492
- y: height / zoom / 2
21
+ t.has("inputData") && (this.transformData(), this.applyData()), t.has("theme") && this.registerTheme(this.theme), super.update(t);
22
+ }
23
+ registerTheme(t) {
24
+ const e = getComputedStyle(this).getPropertyValue("--re-text-color").trim(), r = getComputedStyle(this).getPropertyValue("--re-tile-background-color").trim(), s = getComputedStyle(this).getPropertyValue("--re-primary-color").trim();
25
+ this.themeBgColor = r || this.theme?.theme_object?.backgroundColor, this.themeTitleColor = e || this.theme?.theme_object?.title?.textStyle?.color, this.themeSubtitleColor = e || this.theme?.theme_object?.title?.subtextStyle?.color || this.themeTitleColor, this.themePrimaryColor = s || this.theme?.theme_object?.color?.[0] || "#5470c6";
26
+ }
27
+ applyData() {
28
+ }
29
+ async transformData() {
30
+ this.inputData && (this.dataSets.forEach((t) => {
31
+ t.label ??= "";
32
+ }), this.dataSets = /* @__PURE__ */ new Map(), this.inputData?.dataseries?.forEach((t, e) => {
33
+ t.selected = void 0;
34
+ let r = t.label;
35
+ this.dataSets.has(r ?? "") && (r += "-" + e);
36
+ const s = {
37
+ label: r,
38
+ actionApp: t?.actionApp,
39
+ actionDevice: t?.actionDevice,
40
+ actionTopic: t?.actionTopic,
41
+ multiChart: t.multiChart,
42
+ styling: t.styling,
43
+ selected: this.isSelected(t)
1493
44
  };
1494
- }
1495
- // center around start point
1496
- startPoint = {
1497
- x: startPoint.x - this.initialSize / 2,
1498
- y: startPoint.y - this.initialSize / 2
1499
- };
1500
- return {
1501
- startPoint,
1502
- endPoint
1503
- };
1504
- }
1505
- startPressAnimation(positionEvent) {
1506
- if (!this.mdRoot) {
1507
- return;
1508
- }
1509
- this.pressed = true;
1510
- this.growAnimation?.cancel();
1511
- this.determineRippleSize();
1512
- const {
1513
- startPoint,
1514
- endPoint
1515
- } = this.getTranslationCoordinates(positionEvent);
1516
- const translateStart = `${startPoint.x}px, ${startPoint.y}px`;
1517
- const translateEnd = `${endPoint.x}px, ${endPoint.y}px`;
1518
- this.growAnimation = this.mdRoot.animate({
1519
- top: [0, 0],
1520
- left: [0, 0],
1521
- height: [this.rippleSize, this.rippleSize],
1522
- width: [this.rippleSize, this.rippleSize],
1523
- transform: [`translate(${translateStart}) scale(1)`, `translate(${translateEnd}) scale(${this.rippleScale})`]
1524
- }, {
1525
- pseudoElement: PRESS_PSEUDO,
1526
- duration: PRESS_GROW_MS,
1527
- easing: EASING.STANDARD,
1528
- fill: ANIMATION_FILL
1529
- });
1530
- }
1531
- async endPressAnimation() {
1532
- this.rippleStartEvent = undefined;
1533
- this.state = State.INACTIVE;
1534
- const animation = this.growAnimation;
1535
- let pressAnimationPlayState = Infinity;
1536
- if (typeof animation?.currentTime === 'number') {
1537
- pressAnimationPlayState = animation.currentTime;
1538
- } else if (animation?.currentTime) {
1539
- pressAnimationPlayState = animation.currentTime.to('ms').value;
1540
- }
1541
- if (pressAnimationPlayState >= MINIMUM_PRESS_MS) {
1542
- this.pressed = false;
1543
- return;
1544
- }
1545
- await new Promise(resolve => {
1546
- setTimeout(resolve, MINIMUM_PRESS_MS - pressAnimationPlayState);
1547
- });
1548
- if (this.growAnimation !== animation) {
1549
- // A new press animation was started. The old animation was canceled and
1550
- // should not finish the pressed state.
1551
- return;
1552
- }
1553
- this.pressed = false;
1554
- }
1555
- /**
1556
- * Returns `true` if
1557
- * - the ripple element is enabled
1558
- * - the pointer is primary for the input type
1559
- * - the pointer is the pointer that started the interaction, or will start
1560
- * the interaction
1561
- * - the pointer is a touch, or the pointer state has the primary button
1562
- * held, or the pointer is hovering
1563
- */
1564
- shouldReactToEvent(event) {
1565
- if (this.disabled || !event.isPrimary) {
1566
- return false;
1567
- }
1568
- if (this.rippleStartEvent && this.rippleStartEvent.pointerId !== event.pointerId) {
1569
- return false;
1570
- }
1571
- if (event.type === 'pointerenter' || event.type === 'pointerleave') {
1572
- return !this.isTouch(event);
1573
- }
1574
- const isPrimaryButton = event.buttons === 1;
1575
- return this.isTouch(event) || isPrimaryButton;
1576
- }
1577
- isTouch({
1578
- pointerType
1579
- }) {
1580
- return pointerType === 'touch';
1581
- }
1582
- /** @private */
1583
- async handleEvent(event) {
1584
- if (FORCED_COLORS?.matches) {
1585
- // Skip event logic since the ripple is `display: none`.
1586
- return;
1587
- }
1588
- switch (event.type) {
1589
- case 'click':
1590
- this.handleClick();
1591
- break;
1592
- case 'contextmenu':
1593
- this.handleContextmenu();
1594
- break;
1595
- case 'pointercancel':
1596
- this.handlePointercancel(event);
1597
- break;
1598
- case 'pointerdown':
1599
- await this.handlePointerdown(event);
1600
- break;
1601
- case 'pointerenter':
1602
- this.handlePointerenter(event);
1603
- break;
1604
- case 'pointerleave':
1605
- this.handlePointerleave(event);
1606
- break;
1607
- case 'pointerup':
1608
- this.handlePointerup(event);
1609
- break;
1610
- }
1611
- }
1612
- onControlChange(prev, next) {
1613
- for (const event of EVENTS) {
1614
- prev?.removeEventListener(event, this);
1615
- next?.addEventListener(event, this);
1616
- }
1617
- }
1618
- }
1619
- __decorate([n({
1620
- type: Boolean,
1621
- reflect: true
1622
- })], Ripple.prototype, "disabled", void 0);
1623
- __decorate([r()], Ripple.prototype, "hovered", void 0);
1624
- __decorate([r()], Ripple.prototype, "pressed", void 0);
1625
- __decorate([e$1('.surface')], Ripple.prototype, "mdRoot", void 0);
1626
-
1627
- /**
1628
- * @license
1629
- * Copyright 2024 Google LLC
1630
- * SPDX-License-Identifier: Apache-2.0
1631
- */
1632
- // Generated stylesheet for ./ripple/internal/ripple-styles.css.
1633
- const styles$1 = i$4`:host{display:flex;margin:auto;pointer-events:none}:host([disabled]){display:none}@media(forced-colors: active){:host{display:none}}:host,.surface{border-radius:inherit;position:absolute;inset:0;overflow:hidden}.surface{-webkit-tap-highlight-color:rgba(0,0,0,0)}.surface::before,.surface::after{content:"";opacity:0;position:absolute}.surface::before{background-color:var(--mdif3-ripple-hover-color, var(--mdif3-sys-color-on-surface, #1d1b20));inset:0;transition:opacity 15ms linear,background-color 15ms linear}.surface::after{background:radial-gradient(closest-side, var(--mdif3-ripple-pressed-color, var(--mdif3-sys-color-on-surface, #1d1b20)) max(100% - 70px, 65%), transparent 100%);transform-origin:center center;transition:opacity 375ms linear}.hovered::before{background-color:var(--mdif3-ripple-hover-color, var(--mdif3-sys-color-on-surface, #1d1b20));opacity:var(--mdif3-ripple-hover-opacity, 0.08)}.pressed::after{opacity:var(--mdif3-ripple-pressed-opacity, 0.12);transition-duration:105ms}
1634
- `;
1635
-
1636
- /**
1637
- * @license
1638
- * Copyright 2022 Google LLC
1639
- * SPDX-License-Identifier: Apache-2.0
1640
- */
1641
- /**
1642
- * @summary Ripples, also known as state layers, are visual indicators used to
1643
- * communicate the status of a component or interactive element.
1644
- *
1645
- * @description A state layer is a semi-transparent covering on an element that
1646
- * indicates its state. State layers provide a systematic approach to
1647
- * visualizing states by using opacity. A layer can be applied to an entire
1648
- * element or in a circular shape and only one state layer can be applied at a
1649
- * given time.
1650
- *
1651
- * @final
1652
- * @suppress {visibility}
1653
- */
1654
- let MdRipple = class MdRipple extends Ripple {};
1655
- MdRipple.styles = [styles$1];
1656
- MdRipple = __decorate([t('mdif3-ripple')], MdRipple);
1657
-
1658
- /**
1659
- * @license
1660
- * Copyright 2023 Google LLC
1661
- * SPDX-License-Identifier: Apache-2.0
1662
- */
1663
- /**
1664
- * Accessibility Object Model reflective aria properties.
1665
- */
1666
- const ARIA_PROPERTIES = ['role', 'ariaAtomic', 'ariaAutoComplete', 'ariaBusy', 'ariaChecked', 'ariaColCount', 'ariaColIndex', 'ariaColSpan', 'ariaCurrent', 'ariaDisabled', 'ariaExpanded', 'ariaHasPopup', 'ariaHidden', 'ariaInvalid', 'ariaKeyShortcuts', 'ariaLabel', 'ariaLevel', 'ariaLive', 'ariaModal', 'ariaMultiLine', 'ariaMultiSelectable', 'ariaOrientation', 'ariaPlaceholder', 'ariaPosInSet', 'ariaPressed', 'ariaReadOnly', 'ariaRequired', 'ariaRoleDescription', 'ariaRowCount', 'ariaRowIndex', 'ariaRowSpan', 'ariaSelected', 'ariaSetSize', 'ariaSort', 'ariaValueMax', 'ariaValueMin', 'ariaValueNow', 'ariaValueText'];
1667
- /**
1668
- * Accessibility Object Model aria attributes.
1669
- */
1670
- const ARIA_ATTRIBUTES = ARIA_PROPERTIES.map(ariaPropertyToAttribute);
1671
- /**
1672
- * Checks if an attribute is one of the AOM aria attributes.
1673
- *
1674
- * @example
1675
- * isAriaAttribute('aria-label'); // true
1676
- *
1677
- * @param attribute The attribute to check.
1678
- * @return True if the attribute is an aria attribute, or false if not.
1679
- */
1680
- function isAriaAttribute(attribute) {
1681
- return ARIA_ATTRIBUTES.includes(attribute);
1682
- }
1683
- /**
1684
- * Converts an AOM aria property into its corresponding attribute.
1685
- *
1686
- * @example
1687
- * ariaPropertyToAttribute('ariaLabel'); // 'aria-label'
1688
- *
1689
- * @param property The aria property.
1690
- * @return The aria attribute.
1691
- */
1692
- function ariaPropertyToAttribute(property) {
1693
- return property.replace('aria', 'aria-')
1694
- // IDREF attributes also include an "Element" or "Elements" suffix
1695
- .replace(/Elements?/g, '').toLowerCase();
1696
- }
1697
-
1698
- /**
1699
- * @license
1700
- * Copyright 2023 Google LLC
1701
- * SPDX-License-Identifier: Apache-2.0
1702
- */
1703
- // Private symbols
1704
- const privateIgnoreAttributeChangesFor = Symbol('privateIgnoreAttributeChangesFor');
1705
- /**
1706
- * Mixes in aria delegation for elements that delegate focus and aria to inner
1707
- * shadow root elements.
1708
- *
1709
- * This mixin fixes invalid aria announcements with shadow roots, caused by
1710
- * duplicate aria attributes on both the host and the inner shadow root element.
1711
- *
1712
- * Note: this mixin **does not yet support** ID reference attributes, such as
1713
- * `aria-labelledby` or `aria-controls`.
1714
- *
1715
- * @example
1716
- * ```ts
1717
- * class MyButton extends mixinDelegatesAria(LitElement) {
1718
- * static shadowRootOptions = {mode: 'open', delegatesFocus: true};
1719
- *
1720
- * render() {
1721
- * return html`
1722
- * <button aria-label=${this.ariaLabel || nothing}>
1723
- * <slot></slot>
1724
- * </button>
1725
- * `;
1726
- * }
1727
- * }
1728
- * ```
1729
- * ```html
1730
- * <my-button aria-label="Plus one">+1</my-button>
1731
- * ```
1732
- *
1733
- * Use `ARIAMixinStrict` for lit analyzer strict types, such as the "role"
1734
- * attribute.
1735
- *
1736
- * @example
1737
- * ```ts
1738
- * return html`
1739
- * <button role=${(this as ARIAMixinStrict).role || nothing}>
1740
- * <slot></slot>
1741
- * </button>
1742
- * `;
1743
- * ```
1744
- *
1745
- * In the future, updates to the Accessibility Object Model (AOM) will provide
1746
- * built-in aria delegation features that will replace this mixin.
1747
- *
1748
- * @param base The class to mix functionality into.
1749
- * @return The provided class with aria delegation mixed in.
1750
- */
1751
- function mixinDelegatesAria(base) {
1752
- var _a;
1753
- class WithDelegatesAriaElement extends base {
1754
- constructor() {
1755
- super(...arguments);
1756
- this[_a] = new Set();
1757
- }
1758
- attributeChangedCallback(name, oldValue, newValue) {
1759
- if (!isAriaAttribute(name)) {
1760
- super.attributeChangedCallback(name, oldValue, newValue);
1761
- return;
1762
- }
1763
- if (this[privateIgnoreAttributeChangesFor].has(name)) {
1764
- return;
1765
- }
1766
- // Don't trigger another `attributeChangedCallback` once we remove the
1767
- // aria attribute from the host. We check the explicit name of the
1768
- // attribute to ignore since `attributeChangedCallback` can be called
1769
- // multiple times out of an expected order when hydrating an element with
1770
- // multiple attributes.
1771
- this[privateIgnoreAttributeChangesFor].add(name);
1772
- this.removeAttribute(name);
1773
- this[privateIgnoreAttributeChangesFor].delete(name);
1774
- const dataProperty = ariaAttributeToDataProperty(name);
1775
- if (newValue === null) {
1776
- delete this.dataset[dataProperty];
1777
- } else {
1778
- this.dataset[dataProperty] = newValue;
1779
- }
1780
- this.requestUpdate(ariaAttributeToDataProperty(name), oldValue);
1781
- }
1782
- getAttribute(name) {
1783
- if (isAriaAttribute(name)) {
1784
- return super.getAttribute(ariaAttributeToDataAttribute(name));
1785
- }
1786
- return super.getAttribute(name);
1787
- }
1788
- removeAttribute(name) {
1789
- super.removeAttribute(name);
1790
- if (isAriaAttribute(name)) {
1791
- super.removeAttribute(ariaAttributeToDataAttribute(name));
1792
- // Since `aria-*` attributes are already removed`, we need to request
1793
- // an update because `attributeChangedCallback` will not be called.
1794
- this.requestUpdate();
1795
- }
1796
- }
1797
- }
1798
- _a = privateIgnoreAttributeChangesFor;
1799
- setupDelegatesAriaProperties(WithDelegatesAriaElement);
1800
- return WithDelegatesAriaElement;
1801
- }
1802
- /**
1803
- * Overrides the constructor's native `ARIAMixin` properties to ensure that
1804
- * aria properties reflect the values that were shifted to a data attribute.
1805
- *
1806
- * @param ctor The `ReactiveElement` constructor to patch.
1807
- */
1808
- function setupDelegatesAriaProperties(ctor) {
1809
- for (const ariaProperty of ARIA_PROPERTIES) {
1810
- // The casing between ariaProperty and the dataProperty may be different.
1811
- // ex: aria-haspopup -> ariaHasPopup
1812
- const ariaAttribute = ariaPropertyToAttribute(ariaProperty);
1813
- // ex: aria-haspopup -> data-aria-haspopup
1814
- const dataAttribute = ariaAttributeToDataAttribute(ariaAttribute);
1815
- // ex: aria-haspopup -> dataset.ariaHaspopup
1816
- const dataProperty = ariaAttributeToDataProperty(ariaAttribute);
1817
- // Call `ReactiveElement.createProperty()` so that the `aria-*` and `data-*`
1818
- // attributes are added to the `static observedAttributes` array. This
1819
- // triggers `attributeChangedCallback` for the delegates aria mixin to
1820
- // handle.
1821
- ctor.createProperty(ariaProperty, {
1822
- attribute: ariaAttribute,
1823
- noAccessor: true
1824
- });
1825
- ctor.createProperty(Symbol(dataAttribute), {
1826
- attribute: dataAttribute,
1827
- noAccessor: true
1828
- });
1829
- // Re-define the `ARIAMixin` properties to handle data attribute shifting.
1830
- // It is safe to use `Object.defineProperty` here because the properties
1831
- // are native and not renamed.
1832
- // tslint:disable-next-line:ban-unsafe-reflection
1833
- Object.defineProperty(ctor.prototype, ariaProperty, {
1834
- configurable: true,
1835
- enumerable: true,
1836
- get() {
1837
- return this.dataset[dataProperty] ?? null;
1838
- },
1839
- set(value) {
1840
- const prevValue = this.dataset[dataProperty] ?? null;
1841
- if (value === prevValue) {
1842
- return;
1843
- }
1844
- if (value === null) {
1845
- delete this.dataset[dataProperty];
1846
- } else {
1847
- this.dataset[dataProperty] = value;
1848
- }
1849
- this.requestUpdate(ariaProperty, prevValue);
1850
- }
1851
- });
1852
- }
1853
- }
1854
- function ariaAttributeToDataAttribute(ariaAttribute) {
1855
- // aria-haspopup -> data-aria-haspopup
1856
- return `data-${ariaAttribute}`;
1857
- }
1858
- function ariaAttributeToDataProperty(ariaAttribute) {
1859
- // aria-haspopup -> dataset.ariaHaspopup
1860
- return ariaAttribute.replace(/-\w/, dashLetter => dashLetter[1].toUpperCase());
1861
- }
1862
-
1863
- /**
1864
- * @license
1865
- * Copyright 2023 Google LLC
1866
- * SPDX-License-Identifier: Apache-2.0
1867
- */
1868
- /**
1869
- * A symbol used to access dispatch hooks on an event.
1870
- */
1871
- const dispatchHooks = Symbol('dispatchHooks');
1872
- /**
1873
- * Add a hook for an event that is called after the event is dispatched and
1874
- * propagates to other event listeners.
1875
- *
1876
- * This is useful for behaviors that need to check if an event is canceled.
1877
- *
1878
- * The callback is invoked synchronously, which allows for better integration
1879
- * with synchronous platform APIs (like `<form>` or `<label>` clicking).
1880
- *
1881
- * Note: `setupDispatchHooks()` must be called on the element before adding any
1882
- * other event listeners. Call it in the constructor of an element or
1883
- * controller.
1884
- *
1885
- * @example
1886
- * ```ts
1887
- * class MyControl extends LitElement {
1888
- * constructor() {
1889
- * super();
1890
- * setupDispatchHooks(this, 'click');
1891
- * this.addEventListener('click', event => {
1892
- * afterDispatch(event, () => {
1893
- * if (event.defaultPrevented) {
1894
- * return
1895
- * }
1896
- *
1897
- * // ... perform logic
1898
- * });
1899
- * });
1900
- * }
1901
- * }
1902
- * ```
1903
- *
1904
- * @example
1905
- * ```ts
1906
- * class MyController implements ReactiveController {
1907
- * constructor(host: ReactiveElement) {
1908
- * // setupDispatchHooks() may be called multiple times for the same
1909
- * // element and events, making it safe for multiple controllers to use it.
1910
- * setupDispatchHooks(host, 'click');
1911
- * host.addEventListener('click', event => {
1912
- * afterDispatch(event, () => {
1913
- * if (event.defaultPrevented) {
1914
- * return;
1915
- * }
1916
- *
1917
- * // ... perform logic
1918
- * });
1919
- * });
1920
- * }
1921
- * }
1922
- * ```
1923
- *
1924
- * @param event The event to add a hook to.
1925
- * @param callback A hook that is called after the event finishes dispatching.
1926
- */
1927
- function afterDispatch(event, callback) {
1928
- const hooks = event[dispatchHooks];
1929
- if (!hooks) {
1930
- throw new Error(`'${event.type}' event needs setupDispatchHooks().`);
1931
- }
1932
- hooks.addEventListener('after', callback);
1933
- }
1934
- /**
1935
- * A lookup map of elements and event types that have a dispatch hook listener
1936
- * set up. Used to ensure we don't set up multiple hook listeners on the same
1937
- * element for the same event.
1938
- */
1939
- const ELEMENT_DISPATCH_HOOK_TYPES = new WeakMap();
1940
- /**
1941
- * Sets up an element to add dispatch hooks to given event types. This must be
1942
- * called before adding any event listeners that need to use dispatch hooks
1943
- * like `afterDispatch()`.
1944
- *
1945
- * This function is safe to call multiple times with the same element or event
1946
- * types. Call it in the constructor of elements, mixins, and controllers to
1947
- * ensure it is set up before external listeners.
1948
- *
1949
- * @example
1950
- * ```ts
1951
- * class MyControl extends LitElement {
1952
- * constructor() {
1953
- * super();
1954
- * setupDispatchHooks(this, 'click');
1955
- * this.addEventListener('click', this.listenerUsingAfterDispatch);
1956
- * }
1957
- * }
1958
- * ```
1959
- *
1960
- * @param element The element to set up event dispatch hooks for.
1961
- * @param eventTypes The event types to add dispatch hooks to.
1962
- */
1963
- function setupDispatchHooks(element, ...eventTypes) {
1964
- let typesAlreadySetUp = ELEMENT_DISPATCH_HOOK_TYPES.get(element);
1965
- if (!typesAlreadySetUp) {
1966
- typesAlreadySetUp = new Set();
1967
- ELEMENT_DISPATCH_HOOK_TYPES.set(element, typesAlreadySetUp);
1968
- }
1969
- for (const eventType of eventTypes) {
1970
- // Don't register multiple dispatch hook listeners. A second registration
1971
- // would lead to the second listener re-dispatching a re-dispatched event,
1972
- // which can cause an infinite loop inside the other one.
1973
- if (typesAlreadySetUp.has(eventType)) {
1974
- continue;
1975
- }
1976
- // When we re-dispatch the event, it's going to immediately trigger this
1977
- // listener again. Use a flag to ignore it.
1978
- let isRedispatching = false;
1979
- element.addEventListener(eventType, event => {
1980
- if (isRedispatching) {
1981
- return;
1982
- }
1983
- // Do not let the event propagate to any other listener (not just
1984
- // bubbling listeners with `stopPropagation()`).
1985
- event.stopImmediatePropagation();
1986
- // Make a copy.
1987
- const eventCopy = Reflect.construct(event.constructor, [event.type, event]);
1988
- // Add hooks onto the event.
1989
- const hooks = new EventTarget();
1990
- eventCopy[dispatchHooks] = hooks;
1991
- // Re-dispatch the event. We can't reuse `redispatchEvent()` since we
1992
- // need to add the hooks to the copy before it's dispatched.
1993
- isRedispatching = true;
1994
- const dispatched = element.dispatchEvent(eventCopy);
1995
- isRedispatching = false;
1996
- if (!dispatched) {
1997
- event.preventDefault();
1998
- }
1999
- // Synchronously call afterDispatch() hooks.
2000
- hooks.dispatchEvent(new Event('after'));
2001
- }, {
2002
- // Ensure this listener runs before other listeners.
2003
- // `setupDispatchHooks()` should be called in constructors to also
2004
- // ensure they run before any other externally-added capture listeners.
2005
- capture: true
2006
- });
2007
- typesAlreadySetUp.add(eventType);
2008
- }
2009
- }
2010
-
2011
- /**
2012
- * @license
2013
- * Copyright 2021 Google LLC
2014
- * SPDX-License-Identifier: Apache-2.0
2015
- */
2016
- /**
2017
- * Dispatches a click event to the given element that triggers a native action,
2018
- * but is not composed and therefore is not seen outside the element.
2019
- *
2020
- * This is useful for responding to an external click event on the host element
2021
- * that should trigger an internal action like a button click.
2022
- *
2023
- * Note, a helper is provided because setting this up correctly is a bit tricky.
2024
- * In particular, calling `click` on an element creates a composed event, which
2025
- * is not desirable, and a manually dispatched event must specifically be a
2026
- * `MouseEvent` to trigger a native action.
2027
- *
2028
- * @example
2029
- * hostClickListener = (event: MouseEvent) {
2030
- * if (isActivationClick(event)) {
2031
- * this.dispatchActivationClick(this.buttonElement);
2032
- * }
2033
- * }
2034
- *
2035
- */
2036
- function dispatchActivationClick(element) {
2037
- const event = new MouseEvent('click', {
2038
- bubbles: true
2039
- });
2040
- element.dispatchEvent(event);
2041
- return event;
2042
- }
2043
- /**
2044
- * Returns true if the click event should trigger an activation behavior. The
2045
- * behavior is defined by the element and is whatever it should do when
2046
- * clicked.
2047
- *
2048
- * Typically when an element needs to handle a click, the click is generated
2049
- * from within the element and an event listener within the element implements
2050
- * the needed behavior; however, it's possible to fire a click directly
2051
- * at the element that the element should handle. This method helps
2052
- * distinguish these "external" clicks.
2053
- *
2054
- * An "external" click can be triggered in a number of ways: via a click
2055
- * on an associated label for a form associated element, calling
2056
- * `element.click()`, or calling
2057
- * `element.dispatchEvent(new MouseEvent('click', ...))`.
2058
- *
2059
- * Also works around Firefox issue
2060
- * https://bugzilla.mozilla.org/show_bug.cgi?id=1804576 by squelching
2061
- * events for a microtask after called.
2062
- *
2063
- * @example
2064
- * hostClickListener = (event: MouseEvent) {
2065
- * if (isActivationClick(event)) {
2066
- * this.dispatchActivationClick(this.buttonElement);
2067
- * }
2068
- * }
2069
- *
2070
- */
2071
- function isActivationClick(event) {
2072
- // Event must start at the event target.
2073
- if (event.currentTarget !== event.target) {
2074
- return false;
2075
- }
2076
- // Event must not be retargeted from shadowRoot.
2077
- if (event.composedPath()[0] !== event.target) {
2078
- return false;
2079
- }
2080
- // Target must not be disabled; this should only occur for a synthetically
2081
- // dispatched click.
2082
- if (event.target.disabled) {
2083
- return false;
2084
- }
2085
- // This is an activation if the event should not be squelched.
2086
- return !squelchEvent(event);
2087
- }
2088
- // TODO(https://bugzilla.mozilla.org/show_bug.cgi?id=1804576)
2089
- // Remove when Firefox bug is addressed.
2090
- function squelchEvent(event) {
2091
- const squelched = isSquelchingEvents;
2092
- if (squelched) {
2093
- event.preventDefault();
2094
- event.stopImmediatePropagation();
2095
- }
2096
- squelchEventsForMicrotask();
2097
- return squelched;
2098
- }
2099
- // Ignore events for one microtask only.
2100
- let isSquelchingEvents = false;
2101
- async function squelchEventsForMicrotask() {
2102
- isSquelchingEvents = true;
2103
- // Need to pause for just one microtask.
2104
- // tslint:disable-next-line
2105
- await null;
2106
- isSquelchingEvents = false;
2107
- }
2108
-
2109
- /**
2110
- * @license
2111
- * Copyright 2021 Google LLC
2112
- * SPDX-License-Identifier: Apache-2.0
2113
- */
2114
- /**
2115
- * Re-dispatches an event from the provided element.
2116
- *
2117
- * This function is useful for forwarding non-composed events, such as `change`
2118
- * events.
2119
- *
2120
- * @example
2121
- * class MyInput extends LitElement {
2122
- * render() {
2123
- * return html`<input @change=${this.redispatchEvent}>`;
2124
- * }
2125
- *
2126
- * protected redispatchEvent(event: Event) {
2127
- * redispatchEvent(this, event);
2128
- * }
2129
- * }
2130
- *
2131
- * @param element The element to dispatch the event from.
2132
- * @param event The event to re-dispatch.
2133
- * @return Whether or not the event was dispatched (if cancelable).
2134
- */
2135
- function redispatchEvent(element, event) {
2136
- // For bubbling events in SSR light DOM (or composed), stop their propagation
2137
- // and dispatch the copy.
2138
- if (event.bubbles && (!element.shadowRoot || event.composed)) {
2139
- event.stopPropagation();
2140
- }
2141
- const copy = Reflect.construct(event.constructor, [event.type, event]);
2142
- const dispatched = element.dispatchEvent(copy);
2143
- if (!dispatched) {
2144
- event.preventDefault();
2145
- }
2146
- return dispatched;
2147
- }
2148
-
2149
- /**
2150
- * @license
2151
- * Copyright 2023 Google LLC
2152
- * SPDX-License-Identifier: Apache-2.0
2153
- */
2154
- /**
2155
- * A unique symbol used for protected access to an instance's
2156
- * `ElementInternals`.
2157
- *
2158
- * @example
2159
- * ```ts
2160
- * class MyElement extends mixinElementInternals(LitElement) {
2161
- * constructor() {
2162
- * super();
2163
- * this[internals].role = 'button';
2164
- * }
2165
- * }
2166
- * ```
2167
- */
2168
- const internals = Symbol('internals');
2169
- // Private symbols
2170
- const privateInternals = Symbol('privateInternals');
2171
- /**
2172
- * Mixes in an attached `ElementInternals` instance.
2173
- *
2174
- * This mixin is only needed when other shared code needs access to a
2175
- * component's `ElementInternals`, such as form-associated mixins.
2176
- *
2177
- * @param base The class to mix functionality into.
2178
- * @return The provided class with `WithElementInternals` mixed in.
2179
- */
2180
- function mixinElementInternals(base) {
2181
- class WithElementInternalsElement extends base {
2182
- get [internals]() {
2183
- // Create internals in getter so that it can be used in methods called on
2184
- // construction in `ReactiveElement`, such as `requestUpdate()`.
2185
- if (!this[privateInternals]) {
2186
- // Cast needed for closure
2187
- this[privateInternals] = this.attachInternals();
2188
- }
2189
- return this[privateInternals];
2190
- }
2191
- }
2192
- return WithElementInternalsElement;
2193
- }
2194
-
2195
- /**
2196
- * @license
2197
- * Copyright 2023 Google LLC
2198
- * SPDX-License-Identifier: Apache-2.0
2199
- */
2200
- /**
2201
- * A symbol property used to create a constraint validation `Validator`.
2202
- * Required for all `mixinConstraintValidation()` elements.
2203
- */
2204
- const createValidator = Symbol('createValidator');
2205
- /**
2206
- * A symbol property used to return an anchor for constraint validation popups.
2207
- * Required for all `mixinConstraintValidation()` elements.
2208
- */
2209
- const getValidityAnchor = Symbol('getValidityAnchor');
2210
- // Private symbol members, used to avoid name clashing.
2211
- const privateValidator = Symbol('privateValidator');
2212
- const privateSyncValidity = Symbol('privateSyncValidity');
2213
- const privateCustomValidationMessage = Symbol('privateCustomValidationMessage');
2214
- /**
2215
- * Mixes in constraint validation APIs for an element.
2216
- *
2217
- * See https://developer.mozilla.org/en-US/docs/Web/HTML/Constraint_validation
2218
- * for more details.
2219
- *
2220
- * Implementations must provide a validator to cache and compute its validity,
2221
- * along with a shadow root element to anchor validation popups to.
2222
- *
2223
- * @example
2224
- * ```ts
2225
- * const baseClass = mixinConstraintValidation(
2226
- * mixinFormAssociated(mixinElementInternals(LitElement))
2227
- * );
2228
- *
2229
- * class MyCheckbox extends baseClass {
2230
- * \@property({type: Boolean}) checked = false;
2231
- * \@property({type: Boolean}) required = false;
2232
- *
2233
- * [createValidator]() {
2234
- * return new CheckboxValidator(() => this);
2235
- * }
2236
- *
2237
- * [getValidityAnchor]() {
2238
- * return this.renderRoot.querySelector('.root');
2239
- * }
2240
- * }
2241
- * ```
2242
- *
2243
- * @param base The class to mix functionality into.
2244
- * @return The provided class with `ConstraintValidation` mixed in.
2245
- */
2246
- function mixinConstraintValidation(base) {
2247
- var _a;
2248
- class ConstraintValidationElement extends base {
2249
- constructor() {
2250
- super(...arguments);
2251
- /**
2252
- * Needed for Safari, see https://bugs.webkit.org/show_bug.cgi?id=261432
2253
- * Replace with this[internals].validity.customError when resolved.
2254
- */
2255
- this[_a] = '';
2256
- }
2257
- get validity() {
2258
- this[privateSyncValidity]();
2259
- return this[internals].validity;
2260
- }
2261
- get validationMessage() {
2262
- this[privateSyncValidity]();
2263
- return this[internals].validationMessage;
2264
- }
2265
- get willValidate() {
2266
- this[privateSyncValidity]();
2267
- return this[internals].willValidate;
2268
- }
2269
- checkValidity() {
2270
- this[privateSyncValidity]();
2271
- return this[internals].checkValidity();
2272
- }
2273
- reportValidity() {
2274
- this[privateSyncValidity]();
2275
- return this[internals].reportValidity();
2276
- }
2277
- setCustomValidity(error) {
2278
- this[privateCustomValidationMessage] = error;
2279
- this[privateSyncValidity]();
2280
- }
2281
- requestUpdate(name, oldValue, options) {
2282
- super.requestUpdate(name, oldValue, options);
2283
- this[privateSyncValidity]();
2284
- }
2285
- firstUpdated(changed) {
2286
- super.firstUpdated(changed);
2287
- // Sync the validity again when the element first renders, since the
2288
- // validity anchor is now available.
2289
- //
2290
- // Elements that `delegatesFocus: true` to an `<input>` will throw an
2291
- // error in Chrome and Safari when a form tries to submit or call
2292
- // `form.reportValidity()`:
2293
- // "An invalid form control with name='' is not focusable"
2294
- //
2295
- // The validity anchor MUST be provided in `internals.setValidity()` and
2296
- // MUST be the `<input>` element rendered.
2297
- //
2298
- // See https://lit.dev/playground/#gist=6c26e418e0010f7a5aac15005cde8bde
2299
- // for a reproduction.
2300
- this[privateSyncValidity]();
2301
- }
2302
- [(_a = privateCustomValidationMessage, privateSyncValidity)]() {
2303
- if (!this[privateValidator]) {
2304
- this[privateValidator] = this[createValidator]();
2305
- }
2306
- const {
2307
- validity,
2308
- validationMessage: nonCustomValidationMessage
2309
- } = this[privateValidator].getValidity();
2310
- const customError = !!this[privateCustomValidationMessage];
2311
- const validationMessage = this[privateCustomValidationMessage] || nonCustomValidationMessage;
2312
- this[internals].setValidity({
2313
- ...validity,
2314
- customError
2315
- }, validationMessage, this[getValidityAnchor]() ?? undefined);
2316
- }
2317
- [createValidator]() {
2318
- throw new Error('Implement [createValidator]');
2319
- }
2320
- [getValidityAnchor]() {
2321
- throw new Error('Implement [getValidityAnchor]');
2322
- }
2323
- }
2324
- return ConstraintValidationElement;
2325
- }
2326
-
2327
- /**
2328
- * @license
2329
- * Copyright 2023 Google LLC
2330
- * SPDX-License-Identifier: Apache-2.0
2331
- */
2332
- /**
2333
- * A symbol property to retrieve the form value for an element.
2334
- */
2335
- const getFormValue = Symbol('getFormValue');
2336
- /**
2337
- * A symbol property to retrieve the form state for an element.
2338
- */
2339
- const getFormState = Symbol('getFormState');
2340
- /**
2341
- * Mixes in form-associated behavior for a class. This allows an element to add
2342
- * values to `<form>` elements.
2343
- *
2344
- * Implementing classes should provide a `[formValue]` to return the current
2345
- * value of the element, as well as reset and restore callbacks.
2346
- *
2347
- * @example
2348
- * ```ts
2349
- * const base = mixinFormAssociated(mixinElementInternals(LitElement));
2350
- *
2351
- * class MyControl extends base {
2352
- * \@property()
2353
- * value = '';
2354
- *
2355
- * override [getFormValue]() {
2356
- * return this.value;
2357
- * }
2358
- *
2359
- * override formResetCallback() {
2360
- * const defaultValue = this.getAttribute('value');
2361
- * this.value = defaultValue;
2362
- * }
2363
- *
2364
- * override formStateRestoreCallback(state: string) {
2365
- * this.value = state;
2366
- * }
2367
- * }
2368
- * ```
2369
- *
2370
- * Elements may optionally provide a `[formState]` if their values do not
2371
- * represent the state of the component.
2372
- *
2373
- * @example
2374
- * ```ts
2375
- * const base = mixinFormAssociated(mixinElementInternals(LitElement));
2376
- *
2377
- * class MyCheckbox extends base {
2378
- * \@property()
2379
- * value = 'on';
2380
- *
2381
- * \@property({type: Boolean})
2382
- * checked = false;
2383
- *
2384
- * override [getFormValue]() {
2385
- * return this.checked ? this.value : null;
2386
- * }
2387
- *
2388
- * override [getFormState]() {
2389
- * return String(this.checked);
2390
- * }
2391
- *
2392
- * override formResetCallback() {
2393
- * const defaultValue = this.hasAttribute('checked');
2394
- * this.checked = defaultValue;
2395
- * }
2396
- *
2397
- * override formStateRestoreCallback(state: string) {
2398
- * this.checked = Boolean(state);
2399
- * }
2400
- * }
2401
- * ```
2402
- *
2403
- * IMPORTANT: Requires declares for lit-analyzer
2404
- * @example
2405
- * ```ts
2406
- * const base = mixinFormAssociated(mixinElementInternals(LitElement));
2407
- * class MyControl extends base {
2408
- * // Writable mixin properties for lit-html binding, needed for lit-analyzer
2409
- * declare disabled: boolean;
2410
- * declare name: string;
2411
- * }
2412
- * ```
2413
- *
2414
- * @param base The class to mix functionality into. The base class must use
2415
- * `mixinElementInternals()`.
2416
- * @return The provided class with `FormAssociated` mixed in.
2417
- */
2418
- function mixinFormAssociated(base) {
2419
- class FormAssociatedElement extends base {
2420
- get form() {
2421
- return this[internals].form;
2422
- }
2423
- get labels() {
2424
- return this[internals].labels;
2425
- }
2426
- // Use @property for the `name` and `disabled` properties to add them to the
2427
- // `observedAttributes` array and trigger `attributeChangedCallback()`.
2428
- //
2429
- // We don't use Lit's default getter/setter (`noAccessor: true`) because
2430
- // the attributes need to be updated synchronously to work with synchronous
2431
- // form APIs, and Lit updates attributes async by default.
2432
- get name() {
2433
- return this.getAttribute('name') ?? '';
2434
- }
2435
- set name(name) {
2436
- // Note: setting name to null or empty does not remove the attribute.
2437
- this.setAttribute('name', name);
2438
- // We don't need to call `requestUpdate()` since it's called synchronously
2439
- // in `attributeChangedCallback()`.
2440
- }
2441
- get disabled() {
2442
- return this.hasAttribute('disabled');
2443
- }
2444
- set disabled(disabled) {
2445
- this.toggleAttribute('disabled', disabled);
2446
- // We don't need to call `requestUpdate()` since it's called synchronously
2447
- // in `attributeChangedCallback()`.
2448
- }
2449
- attributeChangedCallback(name, old, value) {
2450
- // Manually `requestUpdate()` for `name` and `disabled` when their
2451
- // attribute or property changes.
2452
- // The properties update their attributes, so this callback is invoked
2453
- // immediately when the properties are set. We call `requestUpdate()` here
2454
- // instead of letting Lit set the properties from the attribute change.
2455
- // That would cause the properties to re-set the attribute and invoke this
2456
- // callback again in a loop. This leads to stale state when Lit tries to
2457
- // determine if a property changed or not.
2458
- if (name === 'name' || name === 'disabled') {
2459
- // Disabled's value is only false if the attribute is missing and null.
2460
- const oldValue = name === 'disabled' ? old !== null : old;
2461
- // Trigger a lit update when the attribute changes.
2462
- this.requestUpdate(name, oldValue);
2463
- return;
2464
- }
2465
- super.attributeChangedCallback(name, old, value);
2466
- }
2467
- requestUpdate(name, oldValue, options) {
2468
- super.requestUpdate(name, oldValue, options);
2469
- // If any properties change, update the form value, which may have changed
2470
- // as well.
2471
- // Update the form value synchronously in `requestUpdate()` rather than
2472
- // `update()` or `updated()`, which are async. This is necessary to ensure
2473
- // that form data is updated in time for synchronous event listeners.
2474
- this[internals].setFormValue(this[getFormValue](), this[getFormState]());
2475
- }
2476
- [getFormValue]() {
2477
- // Closure does not allow abstract symbol members, so a default
2478
- // implementation is needed.
2479
- throw new Error('Implement [getFormValue]');
2480
- }
2481
- [getFormState]() {
2482
- return this[getFormValue]();
2483
- }
2484
- formDisabledCallback(disabled) {
2485
- this.disabled = disabled;
2486
- }
2487
- }
2488
- /** @nocollapse */
2489
- FormAssociatedElement.formAssociated = true;
2490
- __decorate([n({
2491
- noAccessor: true
2492
- })], FormAssociatedElement.prototype, "name", null);
2493
- __decorate([n({
2494
- type: Boolean,
2495
- noAccessor: true
2496
- })], FormAssociatedElement.prototype, "disabled", null);
2497
- return FormAssociatedElement;
2498
- }
2499
-
2500
- /**
2501
- * @license
2502
- * Copyright 2023 Google LLC
2503
- * SPDX-License-Identifier: Apache-2.0
2504
- */
2505
- /**
2506
- * A class that computes and caches `ValidityStateFlags` for a component with
2507
- * a given `State` interface.
2508
- *
2509
- * Cached performance before computing validity is important since constraint
2510
- * validation must be checked frequently and synchronously when properties
2511
- * change.
2512
- *
2513
- * @template State The expected interface of properties relevant to constraint
2514
- * validation.
2515
- */
2516
- class Validator {
2517
- /**
2518
- * Creates a new validator.
2519
- *
2520
- * @param getCurrentState A callback that returns the current state of
2521
- * constraint validation-related properties.
2522
- */
2523
- constructor(getCurrentState) {
2524
- this.getCurrentState = getCurrentState;
2525
- /**
2526
- * The current validity state and message. This is cached and returns if
2527
- * constraint validation state does not change.
2528
- */
2529
- this.currentValidity = {
2530
- validity: {},
2531
- validationMessage: ''
2532
- };
2533
- }
2534
- /**
2535
- * Returns the current `ValidityStateFlags` and validation message for the
2536
- * validator.
2537
- *
2538
- * If the constraint validation state has not changed, this will return a
2539
- * cached result. This is important since `getValidity()` can be called
2540
- * frequently in response to synchronous property changes.
2541
- *
2542
- * @return The current validity and validation message.
2543
- */
2544
- getValidity() {
2545
- const state = this.getCurrentState();
2546
- const hasStateChanged = !this.prevState || !this.equals(this.prevState, state);
2547
- if (!hasStateChanged) {
2548
- return this.currentValidity;
2549
- }
2550
- const {
2551
- validity,
2552
- validationMessage
2553
- } = this.computeValidity(state);
2554
- this.prevState = this.copy(state);
2555
- this.currentValidity = {
2556
- validationMessage,
2557
- validity: {
2558
- // Change any `ValidityState` instances into `ValidityStateFlags` since
2559
- // `ValidityState` cannot be easily `{...spread}`.
2560
- badInput: validity.badInput,
2561
- customError: validity.customError,
2562
- patternMismatch: validity.patternMismatch,
2563
- rangeOverflow: validity.rangeOverflow,
2564
- rangeUnderflow: validity.rangeUnderflow,
2565
- stepMismatch: validity.stepMismatch,
2566
- tooLong: validity.tooLong,
2567
- tooShort: validity.tooShort,
2568
- typeMismatch: validity.typeMismatch,
2569
- valueMissing: validity.valueMissing
2570
- }
2571
- };
2572
- return this.currentValidity;
2573
- }
2574
- }
2575
-
2576
- /**
2577
- * @license
2578
- * Copyright 2023 Google LLC
2579
- * SPDX-License-Identifier: Apache-2.0
2580
- */
2581
- /**
2582
- * A validator that provides constraint validation that emulates
2583
- * `<input type="checkbox">` validation.
2584
- */
2585
- class CheckboxValidator extends Validator {
2586
- computeValidity(state) {
2587
- if (!this.checkboxControl) {
2588
- // Lazily create the platform input
2589
- this.checkboxControl = document.createElement('input');
2590
- this.checkboxControl.type = 'checkbox';
2591
- }
2592
- this.checkboxControl.checked = state.checked;
2593
- this.checkboxControl.required = state.required;
2594
- return {
2595
- validity: this.checkboxControl.validity,
2596
- validationMessage: this.checkboxControl.validationMessage
2597
- };
2598
- }
2599
- equals(prev, next) {
2600
- return prev.checked === next.checked && prev.required === next.required;
45
+ this.dataSets.set(s.label ?? "", s);
46
+ }));
2601
47
  }
2602
- copy({
2603
- checked,
2604
- required
2605
- }) {
2606
- return {
2607
- checked,
2608
- required
48
+ isSelected(t) {
49
+ const e = t.value;
50
+ if (e === void 0) return;
51
+ const r = t?.stateMap?.on;
52
+ if (r?.startsWith("<=")) {
53
+ const i = parseFloat(e ?? ""), o = parseFloat(r.substring(2));
54
+ return isNaN(i) || isNaN(o) ? void 0 : i <= o;
55
+ }
56
+ if (r?.startsWith("<")) {
57
+ const i = parseFloat(e ?? ""), o = parseFloat(r.substring(1));
58
+ return isNaN(i) || isNaN(o) ? void 0 : i < o;
59
+ }
60
+ if (r?.startsWith(">=")) {
61
+ const i = parseFloat(e ?? ""), o = parseFloat(r.substring(2));
62
+ return isNaN(i) || isNaN(o) ? void 0 : i >= o;
63
+ }
64
+ if (r?.startsWith(">")) {
65
+ const i = parseFloat(e ?? ""), o = parseFloat(r.substring(1));
66
+ return isNaN(i) || isNaN(o) ? void 0 : i > o;
67
+ }
68
+ const s = t?.stateMap?.off;
69
+ if (s?.startsWith("<=")) {
70
+ const i = parseFloat(e ?? ""), o = parseFloat(s.substring(2));
71
+ return isNaN(i) || isNaN(o) ? void 0 : i > o;
72
+ }
73
+ if (s?.startsWith("<")) {
74
+ const i = parseFloat(e ?? ""), o = parseFloat(s.substring(1));
75
+ return isNaN(i) || isNaN(o) ? void 0 : i <= o;
76
+ }
77
+ if (s?.startsWith(">=")) {
78
+ const i = parseFloat(e ?? ""), o = parseFloat(s.substring(2));
79
+ return isNaN(i) || isNaN(o) ? void 0 : i < o;
80
+ }
81
+ if (s?.startsWith(">")) {
82
+ const i = parseFloat(e ?? ""), o = parseFloat(s.substring(1));
83
+ return isNaN(i) || isNaN(o) ? void 0 : i <= o;
84
+ }
85
+ if ((r?.split(",").map((i) => i.trim().replace('"', "").replace("'", "")) ?? []).includes(String(e) ?? "")) return !0;
86
+ if ((s?.split(",").map((i) => i.trim().replace('"', "").replace("'", "")) ?? []).includes(String(e) ?? "")) return !1;
87
+ }
88
+ handleActionSubmit(t) {
89
+ const e = t.target, r = {
90
+ args: e?.selected,
91
+ actionApp: e?.actionApp,
92
+ actionDevice: e?.actionDevice,
93
+ actionTopic: e?.actionTopic,
94
+ label: e?.label
2609
95
  };
2610
- }
2611
- }
2612
-
2613
- /**
2614
- * @license
2615
- * Copyright 2021 Google LLC
2616
- * SPDX-License-Identifier: Apache-2.0
2617
- */
2618
- // Separate variable needed for closure.
2619
- const switchBaseClass = mixinDelegatesAria(mixinConstraintValidation(mixinFormAssociated(mixinElementInternals(i$1))));
2620
- /**
2621
- * @fires input {InputEvent} Fired whenever `selected` changes due to user
2622
- * interaction (bubbles and composed).
2623
- * @fires change {Event} Fired whenever `selected` changes due to user
2624
- * interaction (bubbles).
2625
- */
2626
- class Switch extends switchBaseClass {
2627
- constructor() {
2628
- super();
2629
- /**
2630
- * Puts the switch in the selected state and sets the form submission value to
2631
- * the `value` property.
2632
- */
2633
- this.selected = false;
2634
- /**
2635
- * Shows both the selected and deselected icons.
2636
- */
2637
- this.icons = false;
2638
- /**
2639
- * Shows only the selected icon, and not the deselected icon. If `true`,
2640
- * overrides the behavior of the `icons` property.
2641
- */
2642
- this.showOnlySelectedIcon = false;
2643
- /**
2644
- * When true, require the switch to be selected when participating in
2645
- * form submission.
2646
- *
2647
- * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#validation
2648
- */
2649
- this.required = false;
2650
- /**
2651
- * The value associated with this switch on form submission. `null` is
2652
- * submitted when `selected` is `false`.
2653
- */
2654
- this.value = 'on';
2655
- // This click listener does not currently need dispatch hooks since it does
2656
- // not check `event.defaultPrevented`.
2657
- this.addEventListener('click', event => {
2658
- if (!isActivationClick(event) || !this.input) {
2659
- return;
2660
- }
2661
- this.focus();
2662
- dispatchActivationClick(this.input);
2663
- });
2664
- // Add the aria keyboard interaction pattern for switch and the Enter key.
2665
- // See https://www.w3.org/WAI/ARIA/apg/patterns/switch/.
2666
- setupDispatchHooks(this, 'keydown');
2667
- this.addEventListener('keydown', event => {
2668
- afterDispatch(event, () => {
2669
- const ignoreEvent = event.defaultPrevented || event.key !== 'Enter';
2670
- if (ignoreEvent || this.disabled || !this.input) {
2671
- return;
2672
- }
2673
- this.input.click();
2674
- });
2675
- });
96
+ this.dispatchEvent(
97
+ new CustomEvent("action-submit", {
98
+ detail: r,
99
+ bubbles: !1,
100
+ composed: !1
101
+ })
102
+ );
2676
103
  }
2677
104
  render() {
2678
- return x`
2679
- <div class="switch ${e(this.getRenderClasses())}">
2680
- <input
2681
- id="switch"
2682
- class="touch"
2683
- type="checkbox"
2684
- role="switch"
2685
- aria-label=${this.ariaLabel || E}
2686
- ?checked=${this.selected}
2687
- ?disabled=${this.disabled}
2688
- ?required=${this.required}
2689
- @input=${this.handleInput}
2690
- @change=${this.handleChange} />
2691
-
2692
- <mdif3-focus-ring part="focus-ring" for="switch"></mdif3-focus-ring>
2693
- <span class="track"> ${this.renderHandle()} </span>
2694
- </div>
2695
- `;
2696
- }
2697
- getRenderClasses() {
2698
- return {
2699
- 'selected': this.selected,
2700
- 'unselected': !this.selected,
2701
- 'disabled': this.disabled
2702
- };
2703
- }
2704
- renderHandle() {
2705
- const classes = {
2706
- 'with-icon': this.showOnlySelectedIcon ? this.selected : this.icons
2707
- };
2708
- return x`
2709
- ${this.renderTouchTarget()}
2710
- <span class="handle-container">
2711
- <mdif3-ripple for="switch" ?disabled="${this.disabled}"></mdif3-ripple>
2712
- <span class="handle ${e(classes)}">
2713
- ${this.shouldShowIcons() ? this.renderIcons() : x``}
2714
- </span>
2715
- </span>
2716
- `;
2717
- }
2718
- renderIcons() {
2719
- return x`
2720
- <div class="icons">
2721
- ${this.renderOnIcon()}
2722
- ${this.showOnlySelectedIcon ? x`` : this.renderOffIcon()}
2723
- </div>
2724
- `;
2725
- }
2726
- /**
2727
- * https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck%3AFILL%400%3Bwght%40500%3BGRAD%400%3Bopsz%4024
2728
- */
2729
- renderOnIcon() {
2730
- return x`
2731
- <slot class="icon icon--on" name="on-icon">
2732
- <svg viewBox="0 0 24 24">
2733
- <path
2734
- d="M9.55 18.2 3.65 12.3 5.275 10.675 9.55 14.95 18.725 5.775 20.35 7.4Z" />
2735
- </svg>
2736
- </slot>
2737
- `;
2738
- }
2739
- /**
2740
- * https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Aclose%3AFILL%400%3Bwght%40500%3BGRAD%400%3Bopsz%4024
2741
- */
2742
- renderOffIcon() {
2743
- return x`
2744
- <slot class="icon icon--off" name="off-icon">
2745
- <svg viewBox="0 0 24 24">
2746
- <path
2747
- d="M6.4 19.2 4.8 17.6 10.4 12 4.8 6.4 6.4 4.8 12 10.4 17.6 4.8 19.2 6.4 13.6 12 19.2 17.6 17.6 19.2 12 13.6Z" />
2748
- </svg>
2749
- </slot>
2750
- `;
2751
- }
2752
- renderTouchTarget() {
2753
- return x`<span class="touch"></span>`;
2754
- }
2755
- shouldShowIcons() {
2756
- return this.icons || this.showOnlySelectedIcon;
2757
- }
2758
- handleInput(event) {
2759
- const target = event.target;
2760
- this.selected = target.checked;
2761
- // <input> 'input' event bubbles and is composed, don't re-dispatch it.
2762
- }
2763
- handleChange(event) {
2764
- // <input> 'change' event is not composed, re-dispatch it.
2765
- redispatchEvent(this, event);
2766
- }
2767
- [getFormValue]() {
2768
- return this.selected ? this.value : null;
2769
- }
2770
- [getFormState]() {
2771
- return String(this.selected);
2772
- }
2773
- formResetCallback() {
2774
- // The selected property does not reflect, so the original attribute set by
2775
- // the user is used to determine the default value.
2776
- this.selected = this.hasAttribute('selected');
2777
- }
2778
- formStateRestoreCallback(state) {
2779
- this.selected = state === 'true';
2780
- }
2781
- [createValidator]() {
2782
- return new CheckboxValidator(() => ({
2783
- checked: this.selected,
2784
- required: this.required
2785
- }));
2786
- }
2787
- [getValidityAnchor]() {
2788
- return this.input;
2789
- }
2790
- }
2791
- /** @nocollapse */
2792
- Switch.shadowRootOptions = {
2793
- mode: 'open',
2794
- delegatesFocus: true
2795
- };
2796
- __decorate([n({
2797
- type: Boolean
2798
- })], Switch.prototype, "selected", void 0);
2799
- __decorate([n({
2800
- type: Boolean
2801
- })], Switch.prototype, "icons", void 0);
2802
- __decorate([n({
2803
- type: Boolean,
2804
- attribute: 'show-only-selected-icon'
2805
- })], Switch.prototype, "showOnlySelectedIcon", void 0);
2806
- __decorate([n({
2807
- type: Boolean
2808
- })], Switch.prototype, "required", void 0);
2809
- __decorate([n()], Switch.prototype, "value", void 0);
2810
- __decorate([e$1('input')], Switch.prototype, "input", void 0);
2811
-
2812
- /**
2813
- * @license
2814
- * Copyright 2024 Google LLC
2815
- * SPDX-License-Identifier: Apache-2.0
2816
- */
2817
- // Generated stylesheet for ./switch/internal/switch-styles.css.
2818
- const styles = i$4`@layer styles, hcm;@layer styles{:host{display:inline-flex;outline:none;vertical-align:top;-webkit-tap-highlight-color:rgba(0,0,0,0);cursor:pointer}:host([disabled]){cursor:default}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--mdif3-switch-track-height, 32px))/2) 0px}mdif3-focus-ring{--mdif3-focus-ring-shape-start-start: var(--mdif3-switch-track-shape-start-start, var(--mdif3-switch-track-shape, var(--mdif3-sys-shape-corner-full, 9999px)));--mdif3-focus-ring-shape-start-end: var(--mdif3-switch-track-shape-start-end, var(--mdif3-switch-track-shape, var(--mdif3-sys-shape-corner-full, 9999px)));--mdif3-focus-ring-shape-end-end: var(--mdif3-switch-track-shape-end-end, var(--mdif3-switch-track-shape, var(--mdif3-sys-shape-corner-full, 9999px)));--mdif3-focus-ring-shape-end-start: var(--mdif3-switch-track-shape-end-start, var(--mdif3-switch-track-shape, var(--mdif3-sys-shape-corner-full, 9999px)))}.switch{align-items:center;display:inline-flex;flex-shrink:0;position:relative;width:var(--mdif3-switch-track-width, 52px);height:var(--mdif3-switch-track-height, 32px);border-start-start-radius:var(--mdif3-switch-track-shape-start-start, var(--mdif3-switch-track-shape, var(--mdif3-sys-shape-corner-full, 9999px)));border-start-end-radius:var(--mdif3-switch-track-shape-start-end, var(--mdif3-switch-track-shape, var(--mdif3-sys-shape-corner-full, 9999px)));border-end-end-radius:var(--mdif3-switch-track-shape-end-end, var(--mdif3-switch-track-shape, var(--mdif3-sys-shape-corner-full, 9999px)));border-end-start-radius:var(--mdif3-switch-track-shape-end-start, var(--mdif3-switch-track-shape, var(--mdif3-sys-shape-corner-full, 9999px)))}input{appearance:none;height:max(100%,var(--mdif3-switch-touch-target-size, 48px));outline:none;margin:0;position:absolute;width:max(100%,var(--mdif3-switch-touch-target-size, 48px));z-index:1;cursor:inherit;top:50%;left:50%;transform:translate(-50%, -50%)}:host([touch-target=none]) input{display:none}}@layer styles{.track{position:absolute;width:100%;height:100%;box-sizing:border-box;border-radius:inherit;display:flex;justify-content:center;align-items:center}.track::before{content:"";display:flex;position:absolute;height:100%;width:100%;border-radius:inherit;box-sizing:border-box;transition-property:opacity,background-color;transition-timing-function:linear;transition-duration:67ms}.disabled .track{background-color:rgba(0,0,0,0);border-color:rgba(0,0,0,0)}.disabled .track::before,.disabled .track::after{transition:none;opacity:var(--mdif3-switch-disabled-track-opacity, 0.12)}.disabled .track::before{background-clip:content-box}.selected .track::before{background-color:var(--mdif3-switch-selected-track-color, var(--mdif3-sys-color-primary, #6750a4))}.selected:hover .track::before{background-color:var(--mdif3-switch-selected-hover-track-color, var(--mdif3-sys-color-primary, #6750a4))}.selected:focus-within .track::before{background-color:var(--mdif3-switch-selected-focus-track-color, var(--mdif3-sys-color-primary, #6750a4))}.selected:active .track::before{background-color:var(--mdif3-switch-selected-pressed-track-color, var(--mdif3-sys-color-primary, #6750a4))}.selected.disabled .track{background-clip:border-box}.selected.disabled .track::before{background-color:var(--mdif3-switch-disabled-selected-track-color, var(--mdif3-sys-color-on-surface, #1d1b20))}.unselected .track::before{background-color:var(--mdif3-switch-track-color, var(--mdif3-sys-color-surface-container-highest, #e6e0e9));border-color:var(--mdif3-switch-track-outline-color, var(--mdif3-sys-color-outline, #79747e));border-style:solid;border-width:var(--mdif3-switch-track-outline-width, 2px)}.unselected:hover .track::before{background-color:var(--mdif3-switch-hover-track-color, var(--mdif3-sys-color-surface-container-highest, #e6e0e9));border-color:var(--mdif3-switch-hover-track-outline-color, var(--mdif3-sys-color-outline, #79747e))}.unselected:focus-visible .track::before{background-color:var(--mdif3-switch-focus-track-color, var(--mdif3-sys-color-surface-container-highest, #e6e0e9));border-color:var(--mdif3-switch-focus-track-outline-color, var(--mdif3-sys-color-outline, #79747e))}.unselected:active .track::before{background-color:var(--mdif3-switch-pressed-track-color, var(--mdif3-sys-color-surface-container-highest, #e6e0e9));border-color:var(--mdif3-switch-pressed-track-outline-color, var(--mdif3-sys-color-outline, #79747e))}.unselected.disabled .track::before{background-color:var(--mdif3-switch-disabled-track-color, var(--mdif3-sys-color-surface-container-highest, #e6e0e9));border-color:var(--mdif3-switch-disabled-track-outline-color, var(--mdif3-sys-color-on-surface, #1d1b20))}}@layer hcm{@media(forced-colors: active){.selected .track::before{background:ButtonText;border-color:ButtonText}.disabled .track::before{border-color:GrayText;opacity:1}.disabled.selected .track::before{background:GrayText}}}@layer styles{.handle-container{display:flex;place-content:center;place-items:center;position:relative;transition:margin 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275)}.selected .handle-container{margin-inline-start:calc(var(--mdif3-switch-track-width, 52px) - var(--mdif3-switch-track-height, 32px))}.unselected .handle-container{margin-inline-end:calc(var(--mdif3-switch-track-width, 52px) - var(--mdif3-switch-track-height, 32px))}.disabled .handle-container{transition:none}.handle{border-start-start-radius:var(--mdif3-switch-handle-shape-start-start, var(--mdif3-switch-handle-shape, var(--mdif3-sys-shape-corner-full, 9999px)));border-start-end-radius:var(--mdif3-switch-handle-shape-start-end, var(--mdif3-switch-handle-shape, var(--mdif3-sys-shape-corner-full, 9999px)));border-end-end-radius:var(--mdif3-switch-handle-shape-end-end, var(--mdif3-switch-handle-shape, var(--mdif3-sys-shape-corner-full, 9999px)));border-end-start-radius:var(--mdif3-switch-handle-shape-end-start, var(--mdif3-switch-handle-shape, var(--mdif3-sys-shape-corner-full, 9999px)));height:var(--mdif3-switch-handle-height, 16px);width:var(--mdif3-switch-handle-width, 16px);transform-origin:center;transition-property:height,width;transition-duration:250ms,250ms;transition-timing-function:cubic-bezier(0.2, 0, 0, 1),cubic-bezier(0.2, 0, 0, 1);z-index:0}.handle::before{content:"";display:flex;inset:0;position:absolute;border-radius:inherit;box-sizing:border-box;transition:background-color 67ms linear}.disabled .handle,.disabled .handle::before{transition:none}.selected .handle{height:var(--mdif3-switch-selected-handle-height, 24px);width:var(--mdif3-switch-selected-handle-width, 24px)}.handle.with-icon{height:var(--mdif3-switch-with-icon-handle-height, 24px);width:var(--mdif3-switch-with-icon-handle-width, 24px)}.selected:not(.disabled):active .handle,.unselected:not(.disabled):active .handle{height:var(--mdif3-switch-pressed-handle-height, 28px);width:var(--mdif3-switch-pressed-handle-width, 28px);transition-timing-function:linear;transition-duration:100ms}.selected .handle::before{background-color:var(--mdif3-switch-selected-handle-color, var(--mdif3-sys-color-on-primary, #fff))}.selected:hover .handle::before{background-color:var(--mdif3-switch-selected-hover-handle-color, var(--mdif3-sys-color-primary-container, #eaddff))}.selected:focus-within .handle::before{background-color:var(--mdif3-switch-selected-focus-handle-color, var(--mdif3-sys-color-primary-container, #eaddff))}.selected:active .handle::before{background-color:var(--mdif3-switch-selected-pressed-handle-color, var(--mdif3-sys-color-primary-container, #eaddff))}.selected.disabled .handle::before{background-color:var(--mdif3-switch-disabled-selected-handle-color, var(--mdif3-sys-color-surface, #fef7ff));opacity:var(--mdif3-switch-disabled-selected-handle-opacity, 1)}.unselected .handle::before{background-color:var(--mdif3-switch-handle-color, var(--mdif3-sys-color-outline, #79747e))}.unselected:hover .handle::before{background-color:var(--mdif3-switch-hover-handle-color, var(--mdif3-sys-color-on-surface-variant, #49454f))}.unselected:focus-within .handle::before{background-color:var(--mdif3-switch-focus-handle-color, var(--mdif3-sys-color-on-surface-variant, #49454f))}.unselected:active .handle::before{background-color:var(--mdif3-switch-pressed-handle-color, var(--mdif3-sys-color-on-surface-variant, #49454f))}.unselected.disabled .handle::before{background-color:var(--mdif3-switch-disabled-handle-color, var(--mdif3-sys-color-on-surface, #1d1b20));opacity:var(--mdif3-switch-disabled-handle-opacity, 0.38)}mdif3-ripple{border-radius:var(--mdif3-switch-state-layer-shape, var(--mdif3-sys-shape-corner-full, 9999px));height:var(--mdif3-switch-state-layer-size, 40px);inset:unset;width:var(--mdif3-switch-state-layer-size, 40px)}.selected mdif3-ripple{--mdif3-ripple-hover-color: var(--mdif3-switch-selected-hover-state-layer-color, var(--mdif3-sys-color-primary, #6750a4));--mdif3-ripple-pressed-color: var(--mdif3-switch-selected-pressed-state-layer-color, var(--mdif3-sys-color-primary, #6750a4));--mdif3-ripple-hover-opacity: var(--mdif3-switch-selected-hover-state-layer-opacity, 0.08);--mdif3-ripple-pressed-opacity: var(--mdif3-switch-selected-pressed-state-layer-opacity, 0.12)}.unselected mdif3-ripple{--mdif3-ripple-hover-color: var(--mdif3-switch-hover-state-layer-color, var(--mdif3-sys-color-on-surface, #1d1b20));--mdif3-ripple-pressed-color: var(--mdif3-switch-pressed-state-layer-color, var(--mdif3-sys-color-on-surface, #1d1b20));--mdif3-ripple-hover-opacity: var(--mdif3-switch-hover-state-layer-opacity, 0.08);--mdif3-ripple-pressed-opacity: var(--mdif3-switch-pressed-state-layer-opacity, 0.12)}}@layer hcm{@media(forced-colors: active){.unselected .handle::before{background:ButtonText}.disabled .handle::before{opacity:1}.disabled.unselected .handle::before{background:GrayText}}}@layer styles{.icons{position:relative;height:100%;width:100%}.icon{position:absolute;inset:0;margin:auto;display:flex;align-items:center;justify-content:center;fill:currentColor;transition:fill 67ms linear,opacity 33ms linear,transform 167ms cubic-bezier(0.2, 0, 0, 1);opacity:0}.disabled .icon{transition:none}.selected .icon--on,.unselected .icon--off{opacity:1}.unselected .handle:not(.with-icon) .icon--on{transform:rotate(-45deg)}.icon--off{width:var(--mdif3-switch-icon-size, 16px);height:var(--mdif3-switch-icon-size, 16px);color:var(--mdif3-switch-icon-color, var(--mdif3-sys-color-surface-container-highest, #e6e0e9))}.unselected:hover .icon--off{color:var(--mdif3-switch-hover-icon-color, var(--mdif3-sys-color-surface-container-highest, #e6e0e9))}.unselected:focus-within .icon--off{color:var(--mdif3-switch-focus-icon-color, var(--mdif3-sys-color-surface-container-highest, #e6e0e9))}.unselected:active .icon--off{color:var(--mdif3-switch-pressed-icon-color, var(--mdif3-sys-color-surface-container-highest, #e6e0e9))}.unselected.disabled .icon--off{color:var(--mdif3-switch-disabled-icon-color, var(--mdif3-sys-color-surface-container-highest, #e6e0e9));opacity:var(--mdif3-switch-disabled-icon-opacity, 0.38)}.icon--on{width:var(--mdif3-switch-selected-icon-size, 16px);height:var(--mdif3-switch-selected-icon-size, 16px);color:var(--mdif3-switch-selected-icon-color, var(--mdif3-sys-color-on-primary-container, #21005d))}.selected:hover .icon--on{color:var(--mdif3-switch-selected-hover-icon-color, var(--mdif3-sys-color-on-primary-container, #21005d))}.selected:focus-within .icon--on{color:var(--mdif3-switch-selected-focus-icon-color, var(--mdif3-sys-color-on-primary-container, #21005d))}.selected:active .icon--on{color:var(--mdif3-switch-selected-pressed-icon-color, var(--mdif3-sys-color-on-primary-container, #21005d))}.selected.disabled .icon--on{color:var(--mdif3-switch-disabled-selected-icon-color, var(--mdif3-sys-color-on-surface, #1d1b20));opacity:var(--mdif3-switch-disabled-selected-icon-opacity, 0.38)}}@layer hcm{@media(forced-colors: active){.icon--off{fill:Canvas}.icon--on{fill:ButtonText}.disabled.unselected .icon--off,.disabled.selected .icon--on{opacity:1}.disabled .icon--on{fill:GrayText}}}
2819
- `;
2820
-
2821
- /**
2822
- * @license
2823
- * Copyright 2021 Google LLC
2824
- * SPDX-License-Identifier: Apache-2.0
2825
- */
2826
- /**
2827
- * @summary Switches toggle the state of a single item on or off.
2828
- *
2829
- * @description
2830
- * There's one type of switch in Material. Use this selection control when the
2831
- * user needs to toggle a single item on or off.
2832
- *
2833
- * @final
2834
- * @suppress {visibility}
2835
- */
2836
- let MdSwitch = class MdSwitch extends Switch {};
2837
- MdSwitch.styles = [styles];
2838
- MdSwitch = __decorate([t('mdif3-switch')], MdSwitch);
2839
-
2840
- let WidgetSwitch = class WidgetSwitch extends i$1 {
2841
- constructor() {
2842
- super();
2843
- this.dataSets = new Map();
2844
- this.textActive = true;
2845
- this.version = '1.1.1';
2846
- this.origWidth = 0;
2847
- this.origHeight = 0;
2848
- this.resizeObserver = new ResizeObserver(this.applyData.bind(this));
2849
- this.resizeObserver.observe(this);
2850
- }
2851
- disconnectedCallback() {
2852
- super.disconnectedCallback();
2853
- if (this.resizeObserver) {
2854
- this.resizeObserver.disconnect();
2855
- }
2856
- }
2857
- firstUpdated(_changedProperties) {
2858
- var _a;
2859
- this.valueContainer = (_a = this === null || this === void 0 ? void 0 : this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.value-container');
2860
- this.registerTheme(this.theme);
2861
- this.transformData();
2862
- this.applyData();
2863
- }
2864
- update(changedProperties) {
2865
- if (changedProperties.has('inputData')) {
2866
- this.transformData();
2867
- this.applyData();
2868
- }
2869
- if (changedProperties.has('theme')) {
2870
- this.registerTheme(this.theme);
2871
- }
2872
- super.update(changedProperties);
2873
- }
2874
- registerTheme(theme) {
2875
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
2876
- const cssTextColor = getComputedStyle(this).getPropertyValue('--re-text-color').trim();
2877
- const cssBgColor = getComputedStyle(this).getPropertyValue('--re-tile-background-color').trim();
2878
- this.themeBgColor = cssBgColor || ((_b = (_a = this.theme) === null || _a === void 0 ? void 0 : _a.theme_object) === null || _b === void 0 ? void 0 : _b.backgroundColor);
2879
- 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);
2880
- this.themeSubtitleColor =
2881
- 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;
2882
- }
2883
- applyData() { }
2884
- async transformData() {
2885
- var _a, _b;
2886
- if (!this.inputData)
2887
- return;
2888
- this.dataSets.forEach((d) => {
2889
- var _a;
2890
- (_a = d.label) !== null && _a !== void 0 ? _a : (d.label = '');
2891
- });
2892
- this.dataSets = new Map();
2893
- (_b = (_a = this.inputData) === null || _a === void 0 ? void 0 : _a.dataseries) === null || _b === void 0 ? void 0 : _b.forEach((ds, idx) => {
2894
- var _a;
2895
- // pivot data
2896
- ds.selected = undefined;
2897
- let label = ds.label;
2898
- if (this.dataSets.has(label !== null && label !== void 0 ? label : '')) {
2899
- label += '-' + idx;
2900
- }
2901
- const pds = {
2902
- label: label,
2903
- actionApp: ds === null || ds === void 0 ? void 0 : ds.actionApp,
2904
- actionDevice: ds === null || ds === void 0 ? void 0 : ds.actionDevice,
2905
- actionTopic: ds === null || ds === void 0 ? void 0 : ds.actionTopic,
2906
- multiChart: ds.multiChart,
2907
- styling: ds.styling,
2908
- selected: this.isSelected(ds)
2909
- };
2910
- this.dataSets.set((_a = pds.label) !== null && _a !== void 0 ? _a : '', pds);
2911
- });
2912
- // console.log('Value Datasets', this.dataSets)
2913
- }
2914
- isSelected(ds) {
2915
- var _a, _b, _c, _d, _e, _f;
2916
- const value = ds.value;
2917
- if (value === undefined)
2918
- return undefined;
2919
- const on = (_a = ds === null || ds === void 0 ? void 0 : ds.stateMap) === null || _a === void 0 ? void 0 : _a.on;
2920
- if (on === null || on === void 0 ? void 0 : on.startsWith('<=')) {
2921
- const val = parseFloat(value !== null && value !== void 0 ? value : '');
2922
- const comp = parseFloat(on.substring(2));
2923
- return isNaN(val) || isNaN(comp) ? undefined : val <= comp;
2924
- }
2925
- if (on === null || on === void 0 ? void 0 : on.startsWith('<')) {
2926
- const val = parseFloat(value !== null && value !== void 0 ? value : '');
2927
- const comp = parseFloat(on.substring(1));
2928
- return isNaN(val) || isNaN(comp) ? undefined : val < comp;
2929
- }
2930
- if (on === null || on === void 0 ? void 0 : on.startsWith('>=')) {
2931
- const val = parseFloat(value !== null && value !== void 0 ? value : '');
2932
- const comp = parseFloat(on.substring(2));
2933
- return isNaN(val) || isNaN(comp) ? undefined : val >= comp;
2934
- }
2935
- if (on === null || on === void 0 ? void 0 : on.startsWith('>')) {
2936
- const val = parseFloat(value !== null && value !== void 0 ? value : '');
2937
- const comp = parseFloat(on.substring(1));
2938
- return isNaN(val) || isNaN(comp) ? undefined : val > comp;
2939
- }
2940
- const off = (_b = ds === null || ds === void 0 ? void 0 : ds.stateMap) === null || _b === void 0 ? void 0 : _b.off;
2941
- if (off === null || off === void 0 ? void 0 : off.startsWith('<=')) {
2942
- const val = parseFloat(value !== null && value !== void 0 ? value : '');
2943
- const comp = parseFloat(off.substring(2));
2944
- return isNaN(val) || isNaN(comp) ? undefined : val > comp;
2945
- }
2946
- if (off === null || off === void 0 ? void 0 : off.startsWith('<')) {
2947
- const val = parseFloat(value !== null && value !== void 0 ? value : '');
2948
- const comp = parseFloat(off.substring(1));
2949
- return isNaN(val) || isNaN(comp) ? undefined : val <= comp;
2950
- }
2951
- if (off === null || off === void 0 ? void 0 : off.startsWith('>=')) {
2952
- const val = parseFloat(value !== null && value !== void 0 ? value : '');
2953
- const comp = parseFloat(off.substring(2));
2954
- return isNaN(val) || isNaN(comp) ? undefined : val < comp;
2955
- }
2956
- if (off === null || off === void 0 ? void 0 : off.startsWith('>')) {
2957
- const val = parseFloat(value !== null && value !== void 0 ? value : '');
2958
- const comp = parseFloat(off.substring(1));
2959
- return isNaN(val) || isNaN(comp) ? undefined : val <= comp;
2960
- }
2961
- const onValues = (_c = on === null || on === void 0 ? void 0 : on.split(',').map((v) => v.trim().replace('"', '').replace("'", ''))) !== null && _c !== void 0 ? _c : [];
2962
- if (onValues.includes((_d = String(value)) !== null && _d !== void 0 ? _d : ''))
2963
- return true;
2964
- const offValues = (_e = off === null || off === void 0 ? void 0 : off.split(',').map((v) => v.trim().replace('"', '').replace("'", ''))) !== null && _e !== void 0 ? _e : [];
2965
- if (offValues.includes((_f = String(value)) !== null && _f !== void 0 ? _f : ''))
2966
- return false;
2967
- return undefined;
2968
- }
2969
- handleActionSubmit(e) {
2970
- const switchEl = e.target;
2971
- const payload = {
2972
- args: switchEl === null || switchEl === void 0 ? void 0 : switchEl.selected,
2973
- actionApp: switchEl === null || switchEl === void 0 ? void 0 : switchEl.actionApp,
2974
- actionDevice: switchEl === null || switchEl === void 0 ? void 0 : switchEl.actionDevice,
2975
- actionTopic: switchEl === null || switchEl === void 0 ? void 0 : switchEl.actionTopic,
2976
- label: switchEl === null || switchEl === void 0 ? void 0 : switchEl.label
2977
- };
2978
- this.dispatchEvent(new CustomEvent('action-submit', {
2979
- detail: payload,
2980
- bubbles: false,
2981
- composed: false
2982
- }));
2983
- }
2984
- render() {
2985
- var _a, _b, _c, _d;
2986
- return x `
105
+ return h`
2987
106
  <div
2988
107
  class="wrapper"
2989
- style="background-color: ${this.themeBgColor}; color: ${this.themeTitleColor}"
108
+ style="background-color: ${this.themeBgColor}; color: ${this.themeTitleColor}; --switch-primary-color: ${this.themePrimaryColor}; --switch-text-color: ${this.themeTitleColor}"
2990
109
  >
2991
110
  <header>
2992
- <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>
111
+ <h3 class="paging" ?active=${this.inputData?.title}>${this.inputData?.title}</h3>
2993
112
  <p
2994
113
  class="paging"
2995
- ?active=${(_c = this.inputData) === null || _c === void 0 ? void 0 : _c.subTitle}
114
+ ?active=${this.inputData?.subTitle}
2996
115
  style="color: ${this.themeSubtitleColor}"
2997
116
  >
2998
- ${(_d = this.inputData) === null || _d === void 0 ? void 0 : _d.subTitle}
117
+ ${this.inputData?.subTitle}
2999
118
  </p>
3000
119
  </header>
3001
120
 
3002
121
  <div class="value-container">
3003
- ${c([...this.dataSets.entries()].sort(), ([label]) => label, ([label, ds]) => {
3004
- return x `
3005
- <div class="switch" label="${label}">
3006
- ${label}
122
+ ${v(
123
+ [...this.dataSets.entries()].sort(),
124
+ ([t]) => t,
125
+ ([t, e]) => h`
126
+ <div class="switch" label="${t}">
127
+ ${t}
3007
128
  <label
3008
- ><mdif3-switch
3009
- aria-label="${label}"
3010
- ?selected="${!!ds.selected}"
3011
- .actionApp="${ds === null || ds === void 0 ? void 0 : ds.actionApp}"
3012
- .actionDevice="${ds === null || ds === void 0 ? void 0 : ds.actionDevice}"
3013
- .actionTopic="${ds === null || ds === void 0 ? void 0 : ds.actionTopic}"
3014
- .label="${label}"
129
+ ><md-switch
130
+ aria-label="${t}"
131
+ ?selected="${!!e.selected}"
132
+ .actionApp="${e?.actionApp}"
133
+ .actionDevice="${e?.actionDevice}"
134
+ .actionTopic="${e?.actionTopic}"
135
+ .label="${t}"
3015
136
  @change="${this.handleActionSubmit}"
3016
- ></mdif3-switch
137
+ ></md-switch
3017
138
  ></label>
3018
139
  </div>
3019
- `;
3020
- })}
140
+ `
141
+ )}
3021
142
  </div>
3022
143
  </div>
3023
144
  `;
3024
- }
145
+ }
3025
146
  };
3026
- WidgetSwitch.styles = i$4 `
147
+ a.styles = d`
3027
148
  :host {
3028
149
  display: block;
3029
150
  font-family: sans-serif;
@@ -3041,7 +162,7 @@ WidgetSwitch.styles = i$4 `
3041
162
  flex-direction: column;
3042
163
  height: 100%;
3043
164
  width: 100%;
3044
- padding: 16px;
165
+ padding: 2cqh 2cqw;
3045
166
  box-sizing: border-box;
3046
167
  }
3047
168
 
@@ -3080,7 +201,40 @@ WidgetSwitch.styles = i$4 `
3080
201
  align-items: center;
3081
202
  gap: 12px;
3082
203
  box-sizing: border-box;
3083
- /* border-left: 4px solid #ddd; */
204
+ }
205
+
206
+ md-switch {
207
+ --md-switch-selected-handle-color: var(--switch-primary-color, #5470c6);
208
+ --md-switch-selected-hover-handle-color: var(--switch-primary-color, #5470c6);
209
+ --md-switch-selected-focus-handle-color: var(--switch-primary-color, #5470c6);
210
+ --md-switch-selected-pressed-handle-color: var(--switch-primary-color, #5470c6);
211
+ --md-switch-selected-track-color: color-mix(
212
+ in srgb,
213
+ var(--switch-primary-color, #5470c6) 40%,
214
+ transparent
215
+ );
216
+ --md-switch-selected-hover-track-color: color-mix(
217
+ in srgb,
218
+ var(--switch-primary-color, #5470c6) 50%,
219
+ transparent
220
+ );
221
+ --md-switch-selected-focus-track-color: color-mix(
222
+ in srgb,
223
+ var(--switch-primary-color, #5470c6) 50%,
224
+ transparent
225
+ );
226
+ --md-switch-selected-pressed-track-color: color-mix(
227
+ in srgb,
228
+ var(--switch-primary-color, #5470c6) 50%,
229
+ transparent
230
+ );
231
+ --md-switch-unselected-handle-color: var(--switch-text-color, #464646);
232
+ --md-switch-unselected-track-color: color-mix(
233
+ in srgb,
234
+ var(--switch-text-color, #464646) 20%,
235
+ transparent
236
+ );
237
+ --md-switch-unselected-track-outline-color: var(--switch-text-color, #464646);
3084
238
  }
3085
239
 
3086
240
  .no-data {
@@ -3093,30 +247,34 @@ WidgetSwitch.styles = i$4 `
3093
247
  justify-content: center;
3094
248
  }
3095
249
  `;
3096
- __decorate([
3097
- n({ type: Object })
3098
- ], WidgetSwitch.prototype, "inputData", void 0);
3099
- __decorate([
3100
- n({ type: Object })
3101
- ], WidgetSwitch.prototype, "theme", void 0);
3102
- __decorate([
3103
- r()
3104
- ], WidgetSwitch.prototype, "dataSets", void 0);
3105
- __decorate([
3106
- r()
3107
- ], WidgetSwitch.prototype, "textActive", void 0);
3108
- __decorate([
3109
- r()
3110
- ], WidgetSwitch.prototype, "themeBgColor", void 0);
3111
- __decorate([
3112
- r()
3113
- ], WidgetSwitch.prototype, "themeTitleColor", void 0);
3114
- __decorate([
3115
- r()
3116
- ], WidgetSwitch.prototype, "themeSubtitleColor", void 0);
3117
- WidgetSwitch = __decorate([
3118
- t('widget-switch-1.1.1')
3119
- ], WidgetSwitch);
3120
-
3121
- export { WidgetSwitch };
250
+ c([
251
+ m({ type: Object })
252
+ ], a.prototype, "inputData", 2);
253
+ c([
254
+ m({ type: Object })
255
+ ], a.prototype, "theme", 2);
256
+ c([
257
+ n()
258
+ ], a.prototype, "dataSets", 2);
259
+ c([
260
+ n()
261
+ ], a.prototype, "textActive", 2);
262
+ c([
263
+ n()
264
+ ], a.prototype, "themeBgColor", 2);
265
+ c([
266
+ n()
267
+ ], a.prototype, "themeTitleColor", 2);
268
+ c([
269
+ n()
270
+ ], a.prototype, "themeSubtitleColor", 2);
271
+ c([
272
+ n()
273
+ ], a.prototype, "themePrimaryColor", 2);
274
+ a = c([
275
+ b("widget-switch-1.1.2")
276
+ ], a);
277
+ export {
278
+ a as WidgetSwitch
279
+ };
3122
280
  //# sourceMappingURL=widget-switch.js.map