@justeattakeaway/pie-switch 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,25 +1,25 @@
1
- import { LitElement as Ie, unsafeCSS as Ve, nothing as L, html as N } from "lit";
2
- import { property as y, query as ce } from "lit/decorators.js";
3
- import { classMap as Se } from "lit/directives/class-map.js";
4
- import { ifDefined as Te } from "lit/directives/if-defined.js";
5
- import { FormControlMixin as Le, RtlMixin as Ne, wrapNativeEvent as Pe, validPropertyValues as Oe, defineCustomElement as _e } from "@justeattakeaway/pie-webc-core";
1
+ import { LitElement as It, unsafeCSS as Vt, nothing as L, html as N } from "lit";
2
+ import { property as y, query as ct } from "lit/decorators.js";
3
+ import { classMap as St } from "lit/directives/class-map.js";
4
+ import { ifDefined as Tt } from "lit/directives/if-defined.js";
5
+ import { FormControlMixin as Lt, RtlMixin as Nt, wrapNativeEvent as Ot, validPropertyValues as Pt, defineCustomElement as _t } from "@justeattakeaway/pie-webc-core";
6
6
  import "@justeattakeaway/pie-icons-webc/dist/IconCheck.js";
7
- var $e = Object.defineProperty, Re = (m, s, c, h) => {
8
- for (var l = void 0, f = m.length - 1, E; f >= 0; f--)
9
- (E = m[f]) && (l = E(s, c, l) || l);
10
- return l && $e(s, c, l), l;
7
+ var $t = Object.defineProperty, Rt = (f, s, c, h) => {
8
+ for (var l = void 0, m = f.length - 1, E; m >= 0; m--)
9
+ (E = f[m]) && (l = E(s, c, l) || l);
10
+ return l && $t(s, c, l), l;
11
11
  };
12
- class de extends Ie {
12
+ class dt extends It {
13
13
  constructor() {
14
- super(...arguments), this.v = "1.3.0";
14
+ super(...arguments), this.v = "1.3.1";
15
15
  }
16
16
  }
17
- Re([
17
+ Rt([
18
18
  y({ type: String, reflect: !0 })
19
- ], de.prototype, "v");
19
+ ], dt.prototype, "v");
20
20
  (function() {
21
- (function(m) {
22
- const s = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), F = {
21
+ (function(f) {
22
+ const s = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), F = {
23
23
  ariaAtomic: "aria-atomic",
24
24
  ariaAutoComplete: "aria-autocomplete",
25
25
  ariaBusy: "aria-busy",
@@ -62,47 +62,47 @@ Re([
62
62
  ariaValueNow: "aria-valuenow",
63
63
  ariaValueText: "aria-valuetext",
64
64
  role: "role"
65
- }, ue = (t, e) => {
65
+ }, ut = (e, t) => {
66
66
  for (let i in F) {
67
- e[i] = null;
67
+ t[i] = null;
68
68
  let a = null;
69
69
  const r = F[i];
70
- Object.defineProperty(e, i, {
70
+ Object.defineProperty(t, i, {
71
71
  get() {
72
72
  return a;
73
73
  },
74
74
  set(o) {
75
- a = o, t.isConnected ? t.setAttribute(r, o) : C.set(t, e);
75
+ a = o, e.isConnected ? e.setAttribute(r, o) : C.set(e, t);
76
76
  }
77
77
  });
78
78
  }
79
79
  };
80
- function G(t) {
81
- const e = l.get(t), { form: i } = e;
82
- ee(t, i, e), Z(t, e.labels);
80
+ function G(e) {
81
+ const t = l.get(e), { form: i } = t;
82
+ tt(e, i, t), Z(e, t.labels);
83
83
  }
84
- const Y = (t, e = !1) => {
85
- const i = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, {
84
+ const Y = (e, t = !1) => {
85
+ const i = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
86
86
  acceptNode(o) {
87
87
  return l.has(o) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
88
88
  }
89
89
  });
90
90
  let a = i.nextNode();
91
- const r = !e || t.disabled;
91
+ const r = !t || e.disabled;
92
92
  for (; a; )
93
- a.formDisabledCallback && r && $(a, t.disabled), a = i.nextNode();
94
- }, J = { attributes: !0, attributeFilter: ["disabled", "name"] }, I = T() ? new MutationObserver((t) => {
95
- for (const e of t) {
96
- const i = e.target;
97
- if (e.attributeName === "disabled" && (i.constructor.formAssociated ? $(i, i.hasAttribute("disabled")) : i.localName === "fieldset" && Y(i)), e.attributeName === "name" && i.constructor.formAssociated) {
93
+ a.formDisabledCallback && r && $(a, e.disabled), a = i.nextNode();
94
+ }, J = { attributes: !0, attributeFilter: ["disabled", "name"] }, I = T() ? new MutationObserver((e) => {
95
+ for (const t of e) {
96
+ const i = t.target;
97
+ if (t.attributeName === "disabled" && (i.constructor.formAssociated ? $(i, i.hasAttribute("disabled")) : i.localName === "fieldset" && Y(i)), t.attributeName === "name" && i.constructor.formAssociated) {
98
98
  const a = l.get(i), r = q.get(i);
99
99
  a.setFormValue(r);
100
100
  }
101
101
  }
102
102
  }) : {};
103
- function O(t) {
104
- t.forEach((e) => {
105
- const { addedNodes: i, removedNodes: a } = e, r = Array.from(i), o = Array.from(a);
103
+ function P(e) {
104
+ e.forEach((t) => {
105
+ const { addedNodes: i, removedNodes: a } = t, r = Array.from(i), o = Array.from(a);
106
106
  r.forEach((n) => {
107
107
  var u;
108
108
  if (l.has(n) && n.constructor.formAssociated && G(n), C.has(n)) {
@@ -128,188 +128,187 @@ Re([
128
128
  n.localName === "fieldset" && ((u = I.observe) === null || u === void 0 || u.call(I, n, J), Y(n, !0));
129
129
  }), o.forEach((n) => {
130
130
  const u = l.get(n);
131
- u && h.get(u) && Q(u), P.has(n) && P.get(n).disconnect();
131
+ u && h.get(u) && Q(u), O.has(n) && O.get(n).disconnect();
132
132
  });
133
133
  });
134
134
  }
135
- function pe(t) {
136
- t.forEach((e) => {
137
- const { removedNodes: i } = e;
135
+ function pt(e) {
136
+ e.forEach((t) => {
137
+ const { removedNodes: i } = t;
138
138
  i.forEach((a) => {
139
- const r = j.get(e.target);
140
- l.has(a) && ie(a), r.disconnect();
139
+ const r = j.get(t.target);
140
+ l.has(a) && it(a), r.disconnect();
141
141
  });
142
142
  });
143
143
  }
144
- const fe = (t) => {
145
- var e, i;
146
- const a = new MutationObserver(pe);
147
- !((e = window == null ? void 0 : window.ShadyDOM) === null || e === void 0) && e.inUse && t.mode && t.host && (t = t.host), (i = a.observe) === null || i === void 0 || i.call(a, t, { childList: !0 }), j.set(t, a);
144
+ const mt = (e) => {
145
+ var t, i;
146
+ const a = new MutationObserver(pt);
147
+ !((t = window == null ? void 0 : window.ShadyDOM) === null || t === void 0) && t.inUse && e.mode && e.host && (e = e.host), (i = a.observe) === null || i === void 0 || i.call(a, e, { childList: !0 }), j.set(e, a);
148
148
  };
149
- T() && new MutationObserver(O);
149
+ T() && new MutationObserver(P);
150
150
  const _ = {
151
151
  childList: !0,
152
152
  subtree: !0
153
- }, $ = (t, e) => {
154
- t.toggleAttribute("internals-disabled", e), e ? t.setAttribute("aria-disabled", "true") : t.removeAttribute("aria-disabled"), t.formDisabledCallback && t.formDisabledCallback.apply(t, [e]);
155
- }, Q = (t) => {
156
- h.get(t).forEach((i) => {
153
+ }, $ = (e, t) => {
154
+ e.toggleAttribute("internals-disabled", t), t ? e.setAttribute("aria-disabled", "true") : e.removeAttribute("aria-disabled"), e.formDisabledCallback && e.formDisabledCallback.apply(e, [t]);
155
+ }, Q = (e) => {
156
+ h.get(e).forEach((i) => {
157
157
  i.remove();
158
- }), h.set(t, []);
159
- }, X = (t, e) => {
158
+ }), h.set(e, []);
159
+ }, X = (e, t) => {
160
160
  const i = document.createElement("input");
161
- return i.type = "hidden", i.name = t.getAttribute("name"), t.after(i), h.get(e).push(i), i;
162
- }, me = (t, e) => {
161
+ return i.type = "hidden", i.name = e.getAttribute("name"), e.after(i), h.get(t).push(i), i;
162
+ }, ft = (e, t) => {
163
163
  var i;
164
- h.set(e, []), (i = I.observe) === null || i === void 0 || i.call(I, t, J);
165
- }, Z = (t, e) => {
166
- if (e.length) {
167
- Array.from(e).forEach((a) => a.addEventListener("click", t.click.bind(t)));
168
- let i = e[0].id;
169
- e[0].id || (i = `${e[0].htmlFor}_Label`, e[0].id = i), t.setAttribute("aria-labelledby", i);
170
- }
171
- }, V = (t) => {
172
- const e = Array.from(t.elements).filter((o) => !o.tagName.includes("-") && o.validity).map((o) => o.validity.valid), i = k.get(t) || [], a = Array.from(i).filter((o) => o.isConnected).map((o) => l.get(o).validity.valid), r = [...e, ...a].includes(!1);
173
- t.toggleAttribute("internals-invalid", r), t.toggleAttribute("internals-valid", !r);
174
- }, be = (t) => {
175
- V(S(t.target));
176
- }, ve = (t) => {
177
- V(S(t.target));
178
- }, we = (t) => {
179
- const e = ["button[type=submit]", "input[type=submit]", "button:not([type])"].map((i) => `${i}:not([disabled])`).map((i) => `${i}:not([form])${t.id ? `,${i}[form='${t.id}']` : ""}`).join(",");
180
- t.addEventListener("click", (i) => {
181
- if (i.target.closest(e)) {
182
- const r = k.get(t);
183
- if (t.noValidate)
164
+ h.set(t, []), (i = I.observe) === null || i === void 0 || i.call(I, e, J);
165
+ }, Z = (e, t) => {
166
+ if (t.length) {
167
+ Array.from(t).forEach((a) => a.addEventListener("click", e.click.bind(e)));
168
+ let i = t[0].id;
169
+ t[0].id || (i = `${t[0].htmlFor}_Label`, t[0].id = i), e.setAttribute("aria-labelledby", i);
170
+ }
171
+ }, V = (e) => {
172
+ const t = Array.from(e.elements).filter((o) => !o.tagName.includes("-") && o.validity).map((o) => o.validity.valid), i = k.get(e) || [], a = Array.from(i).filter((o) => o.isConnected).map((o) => l.get(o).validity.valid), r = [...t, ...a].includes(!1);
173
+ e.toggleAttribute("internals-invalid", r), e.toggleAttribute("internals-valid", !r);
174
+ }, bt = (e) => {
175
+ V(S(e.target));
176
+ }, vt = (e) => {
177
+ V(S(e.target));
178
+ }, wt = (e) => {
179
+ const t = ["button[type=submit]", "input[type=submit]", "button:not([type])"].map((i) => `${i}:not([disabled])`).map((i) => `${i}:not([form])${e.id ? `,${i}[form='${e.id}']` : ""}`).join(",");
180
+ e.addEventListener("click", (i) => {
181
+ if (i.target.closest(t)) {
182
+ const r = k.get(e);
183
+ if (e.noValidate)
184
184
  return;
185
185
  r.size && Array.from(r).reverse().map((u) => l.get(u).reportValidity()).includes(!1) && i.preventDefault();
186
186
  }
187
187
  });
188
- }, ge = (t) => {
189
- const e = k.get(t.target);
190
- e && e.size && e.forEach((i) => {
188
+ }, gt = (e) => {
189
+ const t = k.get(e.target);
190
+ t && t.size && t.forEach((i) => {
191
191
  i.constructor.formAssociated && i.formResetCallback && i.formResetCallback.apply(i);
192
192
  });
193
- }, ee = (t, e, i) => {
194
- if (e) {
195
- const a = k.get(e);
193
+ }, tt = (e, t, i) => {
194
+ if (t) {
195
+ const a = k.get(t);
196
196
  if (a)
197
- a.add(t);
197
+ a.add(e);
198
198
  else {
199
199
  const r = /* @__PURE__ */ new Set();
200
- r.add(t), k.set(e, r), we(e), e.addEventListener("reset", ge), e.addEventListener("input", be), e.addEventListener("change", ve);
200
+ r.add(e), k.set(t, r), wt(t), t.addEventListener("reset", gt), t.addEventListener("input", bt), t.addEventListener("change", vt);
201
201
  }
202
- E.set(e, { ref: t, internals: i }), t.constructor.formAssociated && t.formAssociatedCallback && setTimeout(() => {
203
- t.formAssociatedCallback.apply(t, [e]);
204
- }, 0), V(e);
205
- }
206
- }, S = (t) => {
207
- let e = t.parentNode;
208
- return e && e.tagName !== "FORM" && (e = S(e)), e;
209
- }, w = (t, e, i = DOMException) => {
210
- if (!t.constructor.formAssociated)
211
- throw new i(e);
212
- }, te = (t, e, i) => {
213
- const a = k.get(t);
202
+ E.set(t, { ref: e, internals: i }), e.constructor.formAssociated && e.formAssociatedCallback && setTimeout(() => {
203
+ e.formAssociatedCallback.apply(e, [t]);
204
+ }, 0), V(t);
205
+ }
206
+ }, S = (e) => {
207
+ let t = e.parentNode;
208
+ return t && t.tagName !== "FORM" && (t = S(t)), t;
209
+ }, w = (e, t, i = DOMException) => {
210
+ if (!e.constructor.formAssociated)
211
+ throw new i(t);
212
+ }, et = (e, t, i) => {
213
+ const a = k.get(e);
214
214
  return a && a.size && a.forEach((r) => {
215
- l.get(r)[i]() || (e = !1);
216
- }), e;
217
- }, ie = (t) => {
218
- if (t.constructor.formAssociated) {
219
- const e = l.get(t), { labels: i, form: a } = e;
220
- Z(t, i), ee(t, a, e);
215
+ l.get(r)[i]() || (t = !1);
216
+ }), t;
217
+ }, it = (e) => {
218
+ if (e.constructor.formAssociated) {
219
+ const t = l.get(e), { labels: i, form: a } = t;
220
+ Z(e, i), tt(e, a, t);
221
221
  }
222
222
  };
223
223
  function T() {
224
224
  return typeof MutationObserver < "u";
225
225
  }
226
- class ye {
226
+ class yt {
227
227
  constructor() {
228
228
  this.badInput = !1, this.customError = !1, this.patternMismatch = !1, this.rangeOverflow = !1, this.rangeUnderflow = !1, this.stepMismatch = !1, this.tooLong = !1, this.tooShort = !1, this.typeMismatch = !1, this.valid = !0, this.valueMissing = !1, Object.seal(this);
229
229
  }
230
230
  }
231
- const Ee = (t) => (t.badInput = !1, t.customError = !1, t.patternMismatch = !1, t.rangeOverflow = !1, t.rangeUnderflow = !1, t.stepMismatch = !1, t.tooLong = !1, t.tooShort = !1, t.typeMismatch = !1, t.valid = !0, t.valueMissing = !1, t), ke = (t, e, i) => (t.valid = Me(e), Object.keys(e).forEach((a) => t[a] = e[a]), i && V(i), t), Me = (t) => {
232
- let e = !0;
233
- for (let i in t)
234
- i !== "valid" && t[i] !== !1 && (e = !1);
235
- return e;
231
+ const Et = (e) => (e.badInput = !1, e.customError = !1, e.patternMismatch = !1, e.rangeOverflow = !1, e.rangeUnderflow = !1, e.stepMismatch = !1, e.tooLong = !1, e.tooShort = !1, e.typeMismatch = !1, e.valid = !0, e.valueMissing = !1, e), kt = (e, t, i) => (e.valid = Mt(t), Object.keys(t).forEach((a) => e[a] = t[a]), i && V(i), e), Mt = (e) => {
232
+ let t = !0;
233
+ for (let i in e)
234
+ i !== "valid" && e[i] !== !1 && (t = !1);
235
+ return t;
236
236
  }, R = /* @__PURE__ */ new WeakMap();
237
- function ae(t, e) {
238
- t.toggleAttribute(e, !0), t.part && t.part.add(e);
237
+ function at(e, t) {
238
+ e.toggleAttribute(t, !0), e.part && e.part.add(t);
239
239
  }
240
240
  class D extends Set {
241
241
  static get isPolyfilled() {
242
242
  return !0;
243
243
  }
244
- constructor(e) {
245
- if (super(), !e || !e.tagName || e.tagName.indexOf("-") === -1)
244
+ constructor(t) {
245
+ if (super(), !t || !t.tagName || t.tagName.indexOf("-") === -1)
246
246
  throw new TypeError("Illegal constructor");
247
- R.set(this, e);
248
- }
249
- add(e) {
250
- if (!/^--/.test(e) || typeof e != "string")
251
- throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${e} must start with '--'.`);
252
- const i = super.add(e), a = R.get(this), r = `state${e}`;
253
- return a.isConnected ? ae(a, r) : setTimeout(() => {
254
- ae(a, r);
247
+ R.set(this, t);
248
+ }
249
+ add(t) {
250
+ if (!/^--/.test(t) || typeof t != "string")
251
+ throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);
252
+ const i = super.add(t), a = R.get(this), r = `state${t}`;
253
+ return a.isConnected ? at(a, r) : setTimeout(() => {
254
+ at(a, r);
255
255
  }), i;
256
256
  }
257
257
  clear() {
258
- for (let [e] of this.entries())
259
- this.delete(e);
258
+ for (let [t] of this.entries())
259
+ this.delete(t);
260
260
  super.clear();
261
261
  }
262
- delete(e) {
263
- const i = super.delete(e), a = R.get(this);
264
- return a.isConnected ? (a.toggleAttribute(`state${e}`, !1), a.part && a.part.remove(`state${e}`)) : setTimeout(() => {
265
- a.toggleAttribute(`state${e}`, !1), a.part && a.part.remove(`state${e}`);
262
+ delete(t) {
263
+ const i = super.delete(t), a = R.get(this);
264
+ return a.isConnected ? (a.toggleAttribute(`state${t}`, !1), a.part && a.part.remove(`state${t}`)) : setTimeout(() => {
265
+ a.toggleAttribute(`state${t}`, !1), a.part && a.part.remove(`state${t}`);
266
266
  }), i;
267
267
  }
268
268
  }
269
- function re(t, e, i, a) {
270
- if (i === "a" && !a) throw new TypeError("Private accessor was defined without a getter");
271
- if (typeof e == "function" ? t !== e || !a : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
272
- return i === "m" ? a : i === "a" ? a.call(t) : a ? a.value : e.get(t);
269
+ function rt(e, t, i, a) {
270
+ if (typeof t == "function" ? e !== t || !0 : !t.has(e)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
271
+ return i === "m" ? a : i === "a" ? a.call(e) : a ? a.value : t.get(e);
273
272
  }
274
- function xe(t, e, i, a, r) {
275
- if (typeof e == "function" ? t !== e || !0 : !e.has(t)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
276
- return e.set(t, i), i;
273
+ function xt(e, t, i, a, r) {
274
+ if (typeof t == "function" ? e !== t || !0 : !t.has(e)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
275
+ return t.set(e, i), i;
277
276
  }
278
277
  var x;
279
- class Ce {
280
- constructor(e) {
281
- x.set(this, void 0), xe(this, x, e);
282
- for (let i = 0; i < e.length; i++) {
283
- let a = e[i];
278
+ class Ct {
279
+ constructor(t) {
280
+ x.set(this, void 0), xt(this, x, t);
281
+ for (let i = 0; i < t.length; i++) {
282
+ let a = t[i];
284
283
  this[i] = a, a.hasAttribute("name") && (this[a.getAttribute("name")] = a);
285
284
  }
286
285
  Object.freeze(this);
287
286
  }
288
287
  get length() {
289
- return re(this, x, "f").length;
288
+ return rt(this, x, "f").length;
290
289
  }
291
290
  [(x = /* @__PURE__ */ new WeakMap(), Symbol.iterator)]() {
292
- return re(this, x, "f")[Symbol.iterator]();
291
+ return rt(this, x, "f")[Symbol.iterator]();
293
292
  }
294
- item(e) {
295
- return this[e] == null ? null : this[e];
293
+ item(t) {
294
+ return this[t] == null ? null : this[t];
296
295
  }
297
- namedItem(e) {
298
- return this[e] == null ? null : this[e];
296
+ namedItem(t) {
297
+ return this[t] == null ? null : this[t];
299
298
  }
300
299
  }
301
- function Ae() {
302
- const t = HTMLFormElement.prototype.checkValidity;
300
+ function At() {
301
+ const e = HTMLFormElement.prototype.checkValidity;
303
302
  HTMLFormElement.prototype.checkValidity = i;
304
- const e = HTMLFormElement.prototype.reportValidity;
303
+ const t = HTMLFormElement.prototype.reportValidity;
305
304
  HTMLFormElement.prototype.reportValidity = a;
306
305
  function i(...o) {
307
- let n = t.apply(this, o);
308
- return te(this, n, "checkValidity");
306
+ let n = e.apply(this, o);
307
+ return et(this, n, "checkValidity");
309
308
  }
310
309
  function a(...o) {
311
- let n = e.apply(this, o);
312
- return te(this, n, "reportValidity");
310
+ let n = t.apply(this, o);
311
+ return et(this, n, "reportValidity");
313
312
  }
314
313
  const { get: r } = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "elements");
315
314
  Object.defineProperty(HTMLFormElement.prototype, "elements", {
@@ -318,23 +317,23 @@ Re([
318
317
  if (u.length === 0)
319
318
  return n;
320
319
  const d = Array.from(n).concat(u).sort((g, b) => g.compareDocumentPosition ? g.compareDocumentPosition(b) & 2 ? 1 : -1 : 0);
321
- return new Ce(d);
320
+ return new Ct(d);
322
321
  }
323
322
  });
324
323
  }
325
- class se {
324
+ class st {
326
325
  static get isPolyfilled() {
327
326
  return !0;
328
327
  }
329
- constructor(e) {
330
- if (!e || !e.tagName || e.tagName.indexOf("-") === -1)
328
+ constructor(t) {
329
+ if (!t || !t.tagName || t.tagName.indexOf("-") === -1)
331
330
  throw new TypeError("Illegal constructor");
332
- const i = e.getRootNode(), a = new ye();
333
- this.states = new D(e), s.set(this, e), c.set(this, a), l.set(e, this), ue(e, this), me(e, this), Object.seal(this), i instanceof DocumentFragment && fe(i);
331
+ const i = t.getRootNode(), a = new yt();
332
+ this.states = new D(t), s.set(this, t), c.set(this, a), l.set(t, this), ut(t, this), ft(t, this), Object.seal(this), i instanceof DocumentFragment && mt(i);
334
333
  }
335
334
  checkValidity() {
336
- const e = s.get(this);
337
- if (w(e, "Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
335
+ const t = s.get(this);
336
+ if (w(t, "Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
338
337
  return !0;
339
338
  const i = c.get(this);
340
339
  if (!i.valid) {
@@ -343,90 +342,90 @@ Re([
343
342
  cancelable: !0,
344
343
  composed: !1
345
344
  });
346
- e.dispatchEvent(a);
345
+ t.dispatchEvent(a);
347
346
  }
348
347
  return i.valid;
349
348
  }
350
349
  get form() {
351
- const e = s.get(this);
352
- w(e, "Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");
350
+ const t = s.get(this);
351
+ w(t, "Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");
353
352
  let i;
354
- return e.constructor.formAssociated === !0 && (i = S(e)), i;
353
+ return t.constructor.formAssociated === !0 && (i = S(t)), i;
355
354
  }
356
355
  get labels() {
357
- const e = s.get(this);
358
- w(e, "Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");
359
- const i = e.getAttribute("id"), a = e.getRootNode();
356
+ const t = s.get(this);
357
+ w(t, "Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");
358
+ const i = t.getAttribute("id"), a = t.getRootNode();
360
359
  return a && i ? a.querySelectorAll(`[for="${i}"]`) : [];
361
360
  }
362
361
  reportValidity() {
363
- const e = s.get(this);
364
- if (w(e, "Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
362
+ const t = s.get(this);
363
+ if (w(t, "Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
365
364
  return !0;
366
365
  const i = this.checkValidity(), a = U.get(this);
367
- if (a && !e.constructor.formAssociated)
366
+ if (a && !t.constructor.formAssociated)
368
367
  throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");
369
- return !i && a && (e.focus(), a.focus()), i;
368
+ return !i && a && (t.focus(), a.focus()), i;
370
369
  }
371
- setFormValue(e) {
370
+ setFormValue(t) {
372
371
  const i = s.get(this);
373
- if (w(i, "Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."), Q(this), e != null && !(e instanceof FormData)) {
372
+ if (w(i, "Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."), Q(this), t != null && !(t instanceof FormData)) {
374
373
  if (i.getAttribute("name")) {
375
374
  const a = X(i, this);
376
- a.value = e;
375
+ a.value = t;
377
376
  }
378
- } else e != null && e instanceof FormData && Array.from(e).reverse().forEach(([a, r]) => {
377
+ } else t != null && t instanceof FormData && Array.from(t).reverse().forEach(([a, r]) => {
379
378
  if (typeof r == "string") {
380
379
  const o = X(i, this);
381
380
  o.name = a, o.value = r;
382
381
  }
383
382
  });
384
- q.set(i, e);
383
+ q.set(i, t);
385
384
  }
386
- setValidity(e, i, a) {
385
+ setValidity(t, i, a) {
387
386
  const r = s.get(this);
388
- if (w(r, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !e)
387
+ if (w(r, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !t)
389
388
  throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");
390
389
  U.set(this, a);
391
390
  const o = c.get(this), n = {};
392
- for (const g in e)
393
- n[g] = e[g];
394
- Object.keys(n).length === 0 && Ee(o);
391
+ for (const g in t)
392
+ n[g] = t[g];
393
+ Object.keys(n).length === 0 && Et(o);
395
394
  const u = Object.assign(Object.assign({}, o), n);
396
395
  delete u.valid;
397
- const { valid: d } = ke(o, u, this.form);
396
+ const { valid: d } = kt(o, u, this.form);
398
397
  if (!d && !i)
399
398
  throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");
400
- f.set(this, d ? "" : i), r.isConnected ? (r.toggleAttribute("internals-invalid", !d), r.toggleAttribute("internals-valid", d), r.setAttribute("aria-invalid", `${!d}`)) : A.set(r, this);
399
+ m.set(this, d ? "" : i), r.isConnected ? (r.toggleAttribute("internals-invalid", !d), r.toggleAttribute("internals-valid", d), r.setAttribute("aria-invalid", `${!d}`)) : A.set(r, this);
401
400
  }
402
401
  get shadowRoot() {
403
- const e = s.get(this), i = B.get(e);
402
+ const t = s.get(this), i = B.get(t);
404
403
  return i || null;
405
404
  }
406
405
  get validationMessage() {
407
- const e = s.get(this);
408
- return w(e, "Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."), f.get(this);
406
+ const t = s.get(this);
407
+ return w(t, "Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."), m.get(this);
409
408
  }
410
409
  get validity() {
411
- const e = s.get(this);
412
- return w(e, "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."), c.get(this);
410
+ const t = s.get(this);
411
+ return w(t, "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."), c.get(this);
413
412
  }
414
413
  get willValidate() {
415
- const e = s.get(this);
416
- return w(e, "Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."), !(e.disabled || e.hasAttribute("disabled") || e.hasAttribute("readonly"));
414
+ const t = s.get(this);
415
+ return w(t, "Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."), !(t.disabled || t.hasAttribute("disabled") || t.hasAttribute("readonly"));
417
416
  }
418
417
  }
419
- function Fe() {
418
+ function Ft() {
420
419
  if (typeof window > "u" || !window.ElementInternals || !HTMLElement.prototype.attachInternals)
421
420
  return !1;
422
- class t extends HTMLElement {
421
+ class e extends HTMLElement {
423
422
  constructor() {
424
423
  super(), this.internals = this.attachInternals();
425
424
  }
426
425
  }
427
- const e = `element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g, "")}`;
428
- customElements.define(e, t);
429
- const i = new t();
426
+ const t = `element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g, "")}`;
427
+ customElements.define(t, e);
428
+ const i = new e();
430
429
  return [
431
430
  "shadowRoot",
432
431
  "form",
@@ -440,25 +439,25 @@ Re([
440
439
  "reportValidity"
441
440
  ].every((a) => a in i.internals);
442
441
  }
443
- let oe = !1, ne = !1;
444
- function H(t) {
445
- ne || (ne = !0, window.CustomStateSet = D, t && (HTMLElement.prototype.attachInternals = function(...e) {
446
- const i = t.call(this, e);
442
+ let ot = !1, nt = !1;
443
+ function H(e) {
444
+ nt || (nt = !0, window.CustomStateSet = D, e && (HTMLElement.prototype.attachInternals = function(...t) {
445
+ const i = e.call(this, t);
447
446
  return i.states = new D(this), i;
448
447
  }));
449
448
  }
450
- function le(t = !0) {
451
- if (!oe) {
452
- if (oe = !0, typeof window < "u" && (window.ElementInternals = se), typeof CustomElementRegistry < "u") {
453
- const e = CustomElementRegistry.prototype.define;
449
+ function lt(e = !0) {
450
+ if (!ot) {
451
+ if (ot = !0, typeof window < "u" && (window.ElementInternals = st), typeof CustomElementRegistry < "u") {
452
+ const t = CustomElementRegistry.prototype.define;
454
453
  CustomElementRegistry.prototype.define = function(i, a, r) {
455
454
  if (a.formAssociated) {
456
455
  const o = a.prototype.connectedCallback;
457
456
  a.prototype.connectedCallback = function() {
458
- K.has(this) || (K.set(this, !0), this.hasAttribute("disabled") && $(this, !0)), o != null && o.apply(this), ie(this);
457
+ K.has(this) || (K.set(this, !0), this.hasAttribute("disabled") && $(this, !0)), o != null && o.apply(this), it(this);
459
458
  };
460
459
  }
461
- e.call(this, i, a, r);
460
+ t.call(this, i, a, r);
462
461
  };
463
462
  }
464
463
  if (typeof HTMLElement < "u" && (HTMLElement.prototype.attachInternals = function() {
@@ -468,38 +467,38 @@ Re([
468
467
  } else return {};
469
468
  if (l.has(this))
470
469
  throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");
471
- return new se(this);
470
+ return new st(this);
472
471
  }), typeof Element < "u") {
473
- let e = function(...a) {
472
+ let t = function(...a) {
474
473
  const r = i.apply(this, a);
475
474
  if (B.set(this, r), T()) {
476
- const o = new MutationObserver(O);
477
- window.ShadyDOM ? o.observe(this, _) : o.observe(r, _), P.set(this, o);
475
+ const o = new MutationObserver(P);
476
+ window.ShadyDOM ? o.observe(this, _) : o.observe(r, _), O.set(this, o);
478
477
  }
479
478
  return r;
480
479
  };
481
480
  const i = Element.prototype.attachShadow;
482
- Element.prototype.attachShadow = e;
481
+ Element.prototype.attachShadow = t;
483
482
  }
484
- T() && typeof document < "u" && new MutationObserver(O).observe(document.documentElement, _), typeof HTMLFormElement < "u" && Ae(), (t || typeof window < "u" && !window.CustomStateSet) && H();
483
+ T() && typeof document < "u" && new MutationObserver(P).observe(document.documentElement, _), typeof HTMLFormElement < "u" && At(), (e || typeof window < "u" && !window.CustomStateSet) && H();
485
484
  }
486
485
  }
487
- return !!customElements.polyfillWrapFlushCallback || (Fe() ? typeof window < "u" && !window.CustomStateSet && H(HTMLElement.prototype.attachInternals) : le(!1)), m.forceCustomStateSetPolyfill = H, m.forceElementInternalsPolyfill = le, Object.defineProperty(m, "__esModule", { value: !0 }), m;
486
+ return !!customElements.polyfillWrapFlushCallback || (Ft() ? typeof window < "u" && !window.CustomStateSet && H(HTMLElement.prototype.attachInternals) : lt(!1)), f.forceCustomStateSetPolyfill = H, f.forceElementInternalsPolyfill = lt, Object.defineProperty(f, "__esModule", { value: !0 }), f;
488
487
  })({});
489
488
  })();
490
- const De = "*,*:after,*:before{box-sizing:inherit}*,*:before,*:after{cursor:inherit}.c-switch-wrapper{display:inline-flex;align-items:center;gap:var(--dt-spacing-b);font-family:var(--dt-font-body-l-family);cursor:pointer}.c-switch-wrapper[disabled]{cursor:not-allowed}.c-switch{--int-states-mixin-bg-color: var(--dt-color-interactive-form);--switch-bg-color--checked: var(--dt-color-interactive-brand);--switch-bg-color--disabled: var(--dt-color-disabled-01);--switch-width: 48px;--switch-height: 24px;--switch-control-size: 20px;--switch-padding: 2px;--switch-radius: var(--dt-radius-rounded-e);--switch-translation: calc(var(--switch-width) - var(--switch-control-size) - 2 * var(--switch-padding));position:relative;display:flex;width:var(--switch-width);height:var(--switch-height);flex-shrink:0;padding:var(--switch-padding);border-radius:var(--switch-radius);background-color:var(--int-states-mixin-bg-color)}@media (prefers-reduced-motion: no-preference){.c-switch{transition:background-color .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-form-h), var(--dt-color-interactive-form-s), calc(var(--dt-color-interactive-form-l) + var(--hover-modifier)))}.c-switch:active:not(:disabled,.is-disabled,.is-dismissible),.c-switch.is-loading:not(:disabled,.is-disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-form-h), var(--dt-color-interactive-form-s), calc(var(--dt-color-interactive-form-l) + var(--active-modifier)))}@supports (background-color: color-mix(in srgb,black,white)){.c-switch:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-01-bg) var(--dt-color-hover-01), var(--dt-color-interactive-form))}.c-switch:active:not(:disabled,.is-disabled,.is-dismissible),.c-switch.is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-01-bg) var(--dt-color-active-01), var(--dt-color-interactive-form))}}.c-switch:focus,.c-switch:focus-within{box-shadow:0 0 0 2px var(--dt-color-focus-inner),0 0 0 4px var(--dt-color-focus-outer);outline:none}.c-switch[checked]{--int-states-mixin-bg-color: var(--dt-color-interactive-brand)}@media (prefers-reduced-motion: no-preference){.c-switch[checked]{transition:background-color .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch[checked]:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-brand-h), var(--dt-color-interactive-brand-s), calc(var(--dt-color-interactive-brand-l) + var(--hover-modifier)))}.c-switch[checked]:active:not(:disabled,.is-disabled,.is-dismissible),.c-switch[checked].is-loading:not(:disabled,.is-disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-brand-h), var(--dt-color-interactive-brand-s), calc(var(--dt-color-interactive-brand-l) + var(--active-modifier)))}@supports (background-color: color-mix(in srgb,black,white)){.c-switch[checked]:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-01-bg) var(--dt-color-hover-01), var(--dt-color-interactive-brand))}.c-switch[checked]:active:not(:disabled,.is-disabled,.is-dismissible),.c-switch[checked].is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-01-bg) var(--dt-color-active-01), var(--dt-color-interactive-brand))}}[disabled] .c-switch{--int-states-mixin-bg-color: var(--switch-bg-color--disabled);pointer-events:none}.c-switch-input{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;left:50%;transform:translate(-50%) translateY(-50%);bottom:0}.c-switch-input:disabled{background-color:transparent}.c-switch-control{position:absolute;left:2px;width:var(--switch-control-size);height:var(--switch-control-size);border-radius:var(--switch-radius);background-color:var(--dt-color-interactive-light);padding:var(--switch-padding)}@media (prefers-reduced-motion: no-preference){.c-switch-control{transition:transform .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch-wrapper--rtl .c-switch-control{position:absolute;left:initial;right:2px}.c-switch-input:checked+.c-switch-control{transform:translate(var(--switch-translation))}@media (prefers-reduced-motion: no-preference){.c-switch-input:checked+.c-switch-control{transition:transform .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch-input:checked+.c-switch-control .c-pieIcon--check{color:var(--dt-color-interactive-brand)}@media (prefers-reduced-motion: no-preference){.c-switch-input:checked+.c-switch-control .c-pieIcon--check{transition:color .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch-input:disabled~.c-switch-control{color:var(--switch-bg-color--disabled)}.c-switch-input:disabled~.c-switch-control .c-pieIcon--check{color:var(--switch-bg-color--disabled)}@media (prefers-reduced-motion: no-preference){.c-switch-input:disabled~.c-switch-control .c-pieIcon--check{transition:color .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch-label{color:var(--dt-color-content-default)}.c-switch-description{position:absolute;display:block;height:1px;width:1px;overflow:hidden;padding:1px;white-space:nowrap}.c-switch-wrapper--rtl .c-switch-input:checked+.c-switch-control{transform:translate(calc(-1 * var(--switch-translation)))}@media (prefers-reduced-motion: no-preference){.c-switch-wrapper--rtl .c-switch-input:checked+.c-switch-control{transition:transform .15s cubic-bezier(.4,0,.9,1) 0s}}", He = ["leading", "trailing"], Ye = "change", M = {
489
+ const Dt = "*,*:after,*:before{box-sizing:inherit}*,*:before,*:after{cursor:inherit}.c-switch-wrapper{display:inline-flex;align-items:center;gap:var(--dt-spacing-b);font-family:var(--dt-font-body-l-family);cursor:pointer}.c-switch-wrapper[disabled]{cursor:not-allowed}.c-switch{--int-states-mixin-bg-color: var(--dt-color-interactive-form);--switch-bg-color--checked: var(--dt-color-interactive-brand);--switch-bg-color--disabled: var(--dt-color-disabled-01);--switch-width: 48px;--switch-height: 24px;--switch-control-size: 20px;--switch-padding: 2px;--switch-radius: var(--dt-radius-rounded-e);--switch-translation: calc(var(--switch-width) - var(--switch-control-size) - 2 * var(--switch-padding));position:relative;display:flex;width:var(--switch-width);height:var(--switch-height);flex-shrink:0;padding:var(--switch-padding);border-radius:var(--switch-radius);background-color:var(--int-states-mixin-bg-color)}@media (prefers-reduced-motion: no-preference){.c-switch{transition:background-color .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-form-h), var(--dt-color-interactive-form-s), calc(var(--dt-color-interactive-form-l) + var(--hover-modifier)))}.c-switch:active:not(:disabled,.is-disabled,.is-dismissible),.c-switch.is-loading:not(:disabled,.is-disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-form-h), var(--dt-color-interactive-form-s), calc(var(--dt-color-interactive-form-l) + var(--active-modifier)))}@supports (background-color: color-mix(in srgb,black,white)){.c-switch:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-01-bg) var(--dt-color-hover-01), var(--dt-color-interactive-form))}.c-switch:active:not(:disabled,.is-disabled,.is-dismissible),.c-switch.is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-01-bg) var(--dt-color-active-01), var(--dt-color-interactive-form))}}.c-switch:focus,.c-switch:focus-within{box-shadow:0 0 0 2px var(--dt-color-focus-inner),0 0 0 4px var(--dt-color-focus-outer);outline:none}.c-switch[checked]{--int-states-mixin-bg-color: var(--dt-color-interactive-brand)}@media (prefers-reduced-motion: no-preference){.c-switch[checked]{transition:background-color .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch[checked]:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-brand-h), var(--dt-color-interactive-brand-s), calc(var(--dt-color-interactive-brand-l) + var(--hover-modifier)))}.c-switch[checked]:active:not(:disabled,.is-disabled,.is-dismissible),.c-switch[checked].is-loading:not(:disabled,.is-disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-brand-h), var(--dt-color-interactive-brand-s), calc(var(--dt-color-interactive-brand-l) + var(--active-modifier)))}@supports (background-color: color-mix(in srgb,black,white)){.c-switch[checked]:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-01-bg) var(--dt-color-hover-01), var(--dt-color-interactive-brand))}.c-switch[checked]:active:not(:disabled,.is-disabled,.is-dismissible),.c-switch[checked].is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-01-bg) var(--dt-color-active-01), var(--dt-color-interactive-brand))}}[disabled] .c-switch{--int-states-mixin-bg-color: var(--switch-bg-color--disabled);pointer-events:none}.c-switch-input{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;left:50%;transform:translate(-50%) translateY(-50%);bottom:0}.c-switch-input:disabled{background-color:transparent}.c-switch-control{position:absolute;left:2px;width:var(--switch-control-size);height:var(--switch-control-size);border-radius:var(--switch-radius);background-color:var(--dt-color-interactive-light);padding:var(--switch-padding)}@media (prefers-reduced-motion: no-preference){.c-switch-control{transition:transform .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch-wrapper--rtl .c-switch-control{position:absolute;left:initial;right:2px}.c-switch-input:checked+.c-switch-control{transform:translate(var(--switch-translation))}@media (prefers-reduced-motion: no-preference){.c-switch-input:checked+.c-switch-control{transition:transform .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch-input:checked+.c-switch-control .c-pieIcon--check{color:var(--dt-color-interactive-brand)}@media (prefers-reduced-motion: no-preference){.c-switch-input:checked+.c-switch-control .c-pieIcon--check{transition:color .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch-input:disabled~.c-switch-control{color:var(--switch-bg-color--disabled)}.c-switch-input:disabled~.c-switch-control .c-pieIcon--check{color:var(--switch-bg-color--disabled)}@media (prefers-reduced-motion: no-preference){.c-switch-input:disabled~.c-switch-control .c-pieIcon--check{transition:color .15s cubic-bezier(.4,0,.9,1) 0s}}.c-switch-label{color:var(--dt-color-content-default)}.c-switch-description{position:absolute;display:block;height:1px;width:1px;overflow:hidden;padding:1px;white-space:nowrap}.c-switch-wrapper--rtl .c-switch-input:checked+.c-switch-control{transform:translate(calc(-1 * var(--switch-translation)))}@media (prefers-reduced-motion: no-preference){.c-switch-wrapper--rtl .c-switch-input:checked+.c-switch-control{transition:transform .15s cubic-bezier(.4,0,.9,1) 0s}}", Ht = ["leading", "trailing"], Yt = "change", M = {
491
490
  checked: !1,
492
491
  disabled: !1,
493
492
  labelPlacement: "leading",
494
493
  required: !1,
495
494
  value: "on"
496
495
  };
497
- var We = Object.defineProperty, v = (m, s, c, h) => {
498
- for (var l = void 0, f = m.length - 1, E; f >= 0; f--)
499
- (E = m[f]) && (l = E(s, c, l) || l);
500
- return l && We(s, c, l), l;
496
+ var Wt = Object.defineProperty, v = (f, s, c, h) => {
497
+ for (var l = void 0, m = f.length - 1, E; m >= 0; m--)
498
+ (E = f[m]) && (l = E(s, c, l) || l);
499
+ return l && Wt(s, c, l), l;
501
500
  };
502
- const he = "pie-switch", z = class z extends Le(Ne(de)) {
501
+ const ht = "pie-switch", z = class z extends Lt(Nt(dt)) {
503
502
  constructor() {
504
503
  super(...arguments), this.labelPlacement = M.labelPlacement, this.checked = M.checked, this.required = M.required, this.value = M.value, this.disabled = M.disabled;
505
504
  }
@@ -524,7 +523,7 @@ const he = "pie-switch", z = class z extends Le(Ne(de)) {
524
523
  handleChange(s) {
525
524
  const { checked: c } = s == null ? void 0 : s.currentTarget;
526
525
  this.checked = c;
527
- const h = Pe(s);
526
+ const h = Ot(s);
528
527
  this.dispatchEvent(h), this.handleFormAssociation();
529
528
  }
530
529
  /**
@@ -596,11 +595,11 @@ const he = "pie-switch", z = class z extends Le(Ne(de)) {
596
595
  checked: c,
597
596
  disabled: h,
598
597
  isRTL: l,
599
- required: f
598
+ required: m
600
599
  } = this;
601
600
  return N`
602
601
  <label
603
- class="${Se({
602
+ class="${St({
604
603
  "c-switch-wrapper": !0,
605
604
  "c-switch-wrapper--rtl": l
606
605
  })}"
@@ -615,11 +614,11 @@ const he = "pie-switch", z = class z extends Le(Ne(de)) {
615
614
  role="switch"
616
615
  type="checkbox"
617
616
  class="c-switch-input"
618
- .required=${f}
617
+ .required=${m}
619
618
  .checked="${c}"
620
619
  .disabled="${h}"
621
620
  @change="${this.handleChange}"
622
- aria-label="${Te(s == null ? void 0 : s.label)}"
621
+ aria-label="${Tt(s == null ? void 0 : s.label)}"
623
622
  aria-describedby="${s != null && s.describedBy ? "switch-description" : L}">
624
623
  <div class="c-switch-control">
625
624
  ${c ? N`<icon-check></icon-check>` : L}
@@ -630,14 +629,14 @@ const he = "pie-switch", z = class z extends Le(Ne(de)) {
630
629
  </label>`;
631
630
  }
632
631
  };
633
- z.styles = Ve(De);
632
+ z.styles = Vt(Dt);
634
633
  let p = z;
635
634
  v([
636
635
  y({ type: String })
637
636
  ], p.prototype, "label");
638
637
  v([
639
638
  y({ type: String }),
640
- Oe(he, He, M.labelPlacement)
639
+ Pt(ht, Ht, M.labelPlacement)
641
640
  ], p.prototype, "labelPlacement");
642
641
  v([
643
642
  y({ type: Object })
@@ -658,15 +657,15 @@ v([
658
657
  y({ type: Boolean, reflect: !0 })
659
658
  ], p.prototype, "disabled");
660
659
  v([
661
- ce('input[type="checkbox"]')
660
+ ct('input[type="checkbox"]')
662
661
  ], p.prototype, "input");
663
662
  v([
664
- ce("label")
663
+ ct("label")
665
664
  ], p.prototype, "focusTarget");
666
- _e(he, p);
665
+ _t(ht, p);
667
666
  export {
668
- Ye as ON_SWITCH_CHANGED_EVENT,
667
+ Yt as ON_SWITCH_CHANGED_EVENT,
669
668
  p as PieSwitch,
670
669
  M as defaultProps,
671
- He as labelPlacements
670
+ Ht as labelPlacements
672
671
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-switch",
3
3
  "description": "PIE Design System Switch built using Web Components",
4
- "version": "1.3.0",
4
+ "version": "1.3.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/justeattakeaway/pie",
@@ -39,14 +39,14 @@
39
39
  "license": "Apache-2.0",
40
40
  "devDependencies": {
41
41
  "@custom-elements-manifest/analyzer": "0.9.0",
42
- "@justeattakeaway/pie-components-config": "0.19.0",
42
+ "@justeattakeaway/pie-components-config": "0.19.1",
43
43
  "@justeattakeaway/pie-css": "0.16.0",
44
44
  "@justeattakeaway/pie-monorepo-utils": "0.5.0",
45
45
  "cem-plugin-module-file-extensions": "0.0.5"
46
46
  },
47
47
  "dependencies": {
48
- "@justeattakeaway/pie-icons-webc": "1.6.1",
49
- "@justeattakeaway/pie-webc-core": "0.25.0",
48
+ "@justeattakeaway/pie-icons-webc": "1.6.2",
49
+ "@justeattakeaway/pie-webc-core": "0.25.1",
50
50
  "@justeattakeaway/pie-wrapper-react": "0.14.3",
51
51
  "element-internals-polyfill": "1.3.11"
52
52
  },
package/declaration.d.ts DELETED
@@ -1,9 +0,0 @@
1
- declare module '*.scss' {
2
- const content: Record<string, string>;
3
- export default content;
4
- }
5
-
6
- declare module '*.scss?inline' {
7
- const content: Record<string, string>;
8
- export default content;
9
- }