@justeattakeaway/pie-modal 0.21.0 → 0.22.0

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,192 +1,115 @@
1
- import { css as B, LitElement as L, html as F, nothing as u, unsafeCSS as pe } from "lit";
2
- import { html as g, unsafeStatic as ge } from "lit/static-html.js";
3
- import { property as s, query as I } from "lit/decorators.js";
4
- import { property as me } from "lit/decorators/property.js";
5
- var fe = Object.defineProperty, ve = Object.getOwnPropertyDescriptor, be = (e, t, o, i) => {
6
- for (var n = i > 1 ? void 0 : i ? ve(t, o) : t, a = e.length - 1, r; a >= 0; a--)
7
- (r = e[a]) && (n = (i ? r(t, o, n) : r(n)) || n);
8
- return i && n && fe(t, o, n), n;
9
- };
10
- const ye = (e) => {
11
- class t extends e {
12
- constructor() {
13
- var i;
14
- super(...arguments), this.dir = ((i = document == null ? void 0 : document.documentElement) == null ? void 0 : i.dir) ?? "ltr";
15
- }
1
+ import { isServer as te, css as I, LitElement as O, html as M, unsafeCSS as ie, nothing as c } from "lit";
2
+ import { html as p, unsafeStatic as oe } from "lit/static-html.js";
3
+ import { property as r, query as $ } from "lit/decorators.js";
4
+ const ne = (n) => {
5
+ class e extends n {
16
6
  /**
17
- * Returns true if the element is in Right to Left mode.
18
- * If a dir attribute is not explicitly set on the web component
19
- * then it falls back to the nearest parent with a dir attribute set.
7
+ * A getter to determine whether the text direction is right-to-left (RTL).
8
+ * If the `dir` property is present on the component, it will be used to determine the text direction.
9
+ * If running on the client-side (not SSR) and the `dir` property is not present, the text direction will be inferred
10
+ * from the document's root element. This inference is not available during SSR.
11
+ * In all other cases, it will return `false`, indicating a left-to-right (LTR) text direction.
20
12
  *
21
- * A dir attribute being set will result in a reactive property.
22
- * If the component falls back to a parent dir attribute then the value
23
- * will not be reactive and is only computed once
13
+ * @returns {boolean} - Returns `true` if the text direction is RTL, otherwise `false`.
24
14
  */
25
15
  get isRTL() {
26
- return this.dir === "rtl";
16
+ return this.dir ? this.dir === "rtl" : !te && !this.dir ? document.documentElement.getAttribute("dir") === "rtl" : !1;
27
17
  }
28
18
  }
29
- return be([
30
- me({ type: String, reflect: !0 })
31
- ], t.prototype, "dir", 2), t;
32
- }, N = (e, t, o) => function(n, a) {
33
- const r = `#${a}`;
34
- Object.defineProperty(n, a, {
19
+ return e;
20
+ }, E = (n, e, t) => function(o, a) {
21
+ const l = `#${a}`;
22
+ Object.defineProperty(o, a, {
35
23
  get() {
36
- return this[r];
24
+ return this[l];
37
25
  },
38
26
  set(h) {
39
- const p = this[r];
40
- t.includes(h) ? this[r] = h : (console.error(
41
- `<${e}> Invalid value "${h}" provided for property "${a}".`,
42
- `Must be one of: ${t.join(" | ")}.`,
43
- `Falling back to default value: "${o}"`
44
- ), this[r] = o), this.requestUpdate(a, p);
27
+ const u = this[l];
28
+ e.includes(h) ? this[l] = h : (console.error(
29
+ `<${n}> Invalid value "${h}" provided for property "${a}".`,
30
+ `Must be one of: ${e.join(" | ")}.`,
31
+ `Falling back to default value: "${t}"`
32
+ ), this[l] = t), this.requestUpdate(a, u);
45
33
  }
46
34
  });
47
- }, we = (e) => function(o, i) {
48
- const n = `#${i}`;
49
- Object.defineProperty(o, i, {
35
+ }, ae = (n) => function(t, i) {
36
+ const o = `#${i}`;
37
+ Object.defineProperty(t, i, {
50
38
  get() {
51
- return this[n];
39
+ return this[o];
52
40
  },
53
41
  set(a) {
54
- const r = this[n];
55
- (a == null || typeof a == "string" && a.trim() === "") && console.error(`<${e}> Missing required attribute "${i}"`), this[n] = a, this.requestUpdate(i, r);
42
+ const l = this[o];
43
+ (a == null || typeof a == "string" && a.trim() === "") && console.error(`<${n}> Missing required attribute "${i}"`), this[o] = a, this.requestUpdate(i, l);
56
44
  }
57
45
  });
58
- };
59
- function _e(e) {
60
- if (Array.isArray(e)) {
61
- for (var t = 0, o = Array(e.length); t < e.length; t++)
62
- o[t] = e[t];
63
- return o;
64
- } else
65
- return Array.from(e);
66
- }
67
- var R = !1;
68
- if (typeof window < "u") {
69
- var W = {
70
- get passive() {
71
- R = !0;
72
- }
73
- };
74
- window.addEventListener("testPassive", null, W), window.removeEventListener("testPassive", null, W);
75
- }
76
- var G = typeof window < "u" && window.navigator && window.navigator.platform && (/iP(ad|hone|od)/.test(window.navigator.platform) || window.navigator.platform === "MacIntel" && window.navigator.maxTouchPoints > 1), m = [], S = !1, J = -1, w = void 0, _ = void 0, Q = function(t) {
77
- return m.some(function(o) {
78
- return !!(o.options.allowTouchMove && o.options.allowTouchMove(t));
79
- });
80
- }, O = function(t) {
81
- var o = t || window.event;
82
- return Q(o.target) || o.touches.length > 1 ? !0 : (o.preventDefault && o.preventDefault(), !1);
83
- }, ke = function(t) {
84
- if (_ === void 0) {
85
- var o = !!t && t.reserveScrollBarGap === !0, i = window.innerWidth - document.documentElement.clientWidth;
86
- o && i > 0 && (_ = document.body.style.paddingRight, document.body.style.paddingRight = i + "px");
87
- }
88
- w === void 0 && (w = document.body.style.overflow, document.body.style.overflow = "hidden");
89
- }, xe = function() {
90
- _ !== void 0 && (document.body.style.paddingRight = _, _ = void 0), w !== void 0 && (document.body.style.overflow = w, w = void 0);
91
- }, Ee = function(t) {
92
- return t ? t.scrollHeight - t.scrollTop <= t.clientHeight : !1;
93
- }, Me = function(t, o) {
94
- var i = t.targetTouches[0].clientY - J;
95
- return Q(t.target) ? !1 : o && o.scrollTop === 0 && i > 0 || Ee(o) && i < 0 ? O(t) : (t.stopPropagation(), !0);
96
- }, Ce = function(t, o) {
97
- if (!t) {
98
- console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");
99
- return;
100
- }
101
- if (!m.some(function(n) {
102
- return n.targetElement === t;
103
- })) {
104
- var i = {
105
- targetElement: t,
106
- options: o || {}
107
- };
108
- m = [].concat(_e(m), [i]), G ? (t.ontouchstart = function(n) {
109
- n.targetTouches.length === 1 && (J = n.targetTouches[0].clientY);
110
- }, t.ontouchmove = function(n) {
111
- n.targetTouches.length === 1 && Me(n, t);
112
- }, S || (document.addEventListener("touchmove", O, R ? { passive: !1 } : void 0), S = !0)) : ke(o);
113
- }
114
- }, ze = function(t) {
115
- if (!t) {
116
- console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");
117
- return;
118
- }
119
- m = m.filter(function(o) {
120
- return o.targetElement !== t;
121
- }), G ? (t.ontouchstart = null, t.ontouchmove = null, S && m.length === 0 && (document.removeEventListener("touchmove", O, R ? { passive: !1 } : void 0), S = !1)) : m.length || xe();
122
- };
123
- const A = {
46
+ }, _ = {
124
47
  xs: 16,
125
48
  s: 20,
126
49
  m: 24,
127
50
  l: 28,
128
51
  xl: 32,
129
52
  xxl: 40
130
- }, ee = Object.keys(A), te = "xs", oe = 8, D = 32;
131
- function Se(e, t, o) {
132
- const i = parseInt(e, 10), n = i % o === 0;
133
- return i >= t && n;
53
+ }, W = Object.keys(_), Y = "xs", U = 8, z = 32;
54
+ function le(n, e, t) {
55
+ const i = parseInt(n, 10), o = i % t === 0;
56
+ return i >= e && o;
134
57
  }
135
- const ie = {
136
- large: (e) => Se(e, D, oe),
137
- regular: (e) => ee.includes(e)
58
+ const H = {
59
+ large: (n) => le(n, z, U),
60
+ regular: (n) => W.includes(n)
138
61
  };
139
- function Oe(e) {
140
- const t = ie.large(e);
141
- return { isValid: t, size: t ? e : D };
62
+ function re(n) {
63
+ const e = H.large(n);
64
+ return { isValid: e, size: e ? n : z };
142
65
  }
143
- function Ae(e) {
144
- const t = ie.regular(e), o = t ? A[e] : A[te];
145
- return { isValid: t, size: o };
66
+ function se(n) {
67
+ const e = H.regular(n), t = e ? _[n] : _[Y];
68
+ return { isValid: e, size: t };
146
69
  }
147
- const b = (e, t, o, i) => {
148
- const n = e.endsWith("Large") || e.endsWith("-large");
149
- let a, r;
150
- if (o) {
151
- if ({ isValid: a, size: r } = n ? Oe(o) : Ae(o), !a) {
152
- const h = n ? `Invalid prop "size" value supplied to "${i}". The prop value should be a number equal or greater than ${D} and multiple of ${oe}.` : `Invalid prop "size" value supplied to "${i}". The prop value should be one of the following values: ${ee.join(", ")}.`;
70
+ const m = (n, e, t, i) => {
71
+ const o = n.endsWith("Large") || n.endsWith("-large");
72
+ let a, l;
73
+ if (t) {
74
+ if ({ isValid: a, size: l } = o ? re(t) : se(t), !a) {
75
+ const h = o ? `Invalid prop "size" value supplied to "${i}". The prop value should be a number equal or greater than ${z} and multiple of ${U}.` : `Invalid prop "size" value supplied to "${i}". The prop value should be one of the following values: ${W.join(", ")}.`;
153
76
  console.error(h);
154
77
  }
155
78
  } else
156
- r = n ? D : A[te];
79
+ l = o ? z : _[Y];
157
80
  return {
158
- class: [e, t].filter(Boolean).join(" "),
159
- width: r,
160
- height: r
81
+ class: [n, e].filter(Boolean).join(" "),
82
+ width: l,
83
+ height: l
161
84
  };
162
85
  };
163
- var De = Object.defineProperty, Le = Object.getOwnPropertyDescriptor, j = (e, t, o, i) => {
164
- for (var n = i > 1 ? void 0 : i ? Le(t, o) : t, a = e.length - 1, r; a >= 0; a--)
165
- (r = e[a]) && (n = (i ? r(t, o, n) : r(n)) || n);
166
- return i && n && De(t, o, n), n;
86
+ var de = Object.defineProperty, ce = Object.getOwnPropertyDescriptor, P = (n, e, t, i) => {
87
+ for (var o = i > 1 ? void 0 : i ? ce(e, t) : e, a = n.length - 1, l; a >= 0; a--)
88
+ (l = n[a]) && (o = (i ? l(e, t, o) : l(o)) || o);
89
+ return i && o && de(e, t, o), o;
167
90
  };
168
- const U = "icon-close";
169
- let x = class extends L {
91
+ const R = "icon-close";
92
+ let b = class extends O {
170
93
  constructor() {
171
94
  super(...arguments), this.size = "xs", this.class = "c-pieIcon c-pieIcon--close";
172
95
  }
173
96
  connectedCallback() {
174
- var t, o, i;
175
- if (super.connectedCallback(), ((t = this._svg) == null ? void 0 : t.getAttribute("width")) === null) {
176
- const n = b("c-pieIcon c-pieIcon--close", "", null, "IconClose");
177
- (o = this._svg) == null || o.setAttribute("width", n.width), (i = this._svg) == null || i.setAttribute("height", n.height);
97
+ var e, t, i;
98
+ if (super.connectedCallback(), ((e = this._svg) == null ? void 0 : e.getAttribute("width")) === null) {
99
+ const o = m("c-pieIcon c-pieIcon--close", "", null, "IconClose");
100
+ (t = this._svg) == null || t.setAttribute("width", o.width), (i = this._svg) == null || i.setAttribute("height", o.height);
178
101
  }
179
102
  }
180
- updated(t) {
181
- var o, i;
182
- let n;
183
- t.has("size") && (n = b("c-pieIcon c-pieIcon--close", "", this.size, "IconClose"), (o = this._svg) == null || o.setAttribute("width", n.width), (i = this._svg) == null || i.setAttribute("height", n.height));
103
+ updated(e) {
104
+ var t, i;
105
+ let o;
106
+ e.has("size") && (o = m("c-pieIcon c-pieIcon--close", "", this.size, "IconClose"), (t = this._svg) == null || t.setAttribute("width", o.width), (i = this._svg) == null || i.setAttribute("height", o.height));
184
107
  }
185
108
  render() {
186
- return F`<svg xmlns="http://www.w3.org/2000/svg" role="presentation" focusable="false" fill="currentColor" viewBox="0 0 16 16" class="c-pieIcon c-pieIcon--close"><path d="M11.868 3.205 8 7.072 4.133 3.205l-.928.927L7.073 8l-3.868 3.867.928.928L8 8.927l3.868 3.868.927-.928L8.928 8l3.867-3.868-.927-.927Z"></path></svg>`;
109
+ return M`<svg xmlns="http://www.w3.org/2000/svg" role="presentation" focusable="false" fill="currentColor" viewBox="0 0 16 16" class="c-pieIcon c-pieIcon--close"><path d="M11.868 3.205 8 7.072 4.133 3.205l-.928.927L7.073 8l-3.868 3.867.928.928L8 8.927l3.868 3.868.927-.928L8.928 8l3.867-3.868-.927-.927Z"></path></svg>`;
187
110
  }
188
111
  };
189
- x.styles = B`
112
+ b.styles = I`
190
113
  :host-context(pie-icon-button) svg,
191
114
  :host-context(pie-button) svg {
192
115
  display: block;
@@ -194,43 +117,43 @@ x.styles = B`
194
117
  height: var(--btn-icon-size);
195
118
  }
196
119
  `;
197
- j([
198
- s({ type: String, reflect: !0 })
199
- ], x.prototype, "size", 2);
200
- j([
201
- s({ type: String, reflect: !0 })
202
- ], x.prototype, "class", 2);
203
- j([
204
- I("svg")
205
- ], x.prototype, "_svg", 2);
206
- customElements.get(U) === void 0 && customElements.define(U, x);
207
- var Ie = Object.defineProperty, $e = Object.getOwnPropertyDescriptor, H = (e, t, o, i) => {
208
- for (var n = i > 1 ? void 0 : i ? $e(t, o) : t, a = e.length - 1, r; a >= 0; a--)
209
- (r = e[a]) && (n = (i ? r(t, o, n) : r(n)) || n);
210
- return i && n && Ie(t, o, n), n;
120
+ P([
121
+ r({ type: String, reflect: !0 })
122
+ ], b.prototype, "size", 2);
123
+ P([
124
+ r({ type: String, reflect: !0 })
125
+ ], b.prototype, "class", 2);
126
+ P([
127
+ $("svg")
128
+ ], b.prototype, "_svg", 2);
129
+ customElements.get(R) === void 0 && customElements.define(R, b);
130
+ var he = Object.defineProperty, pe = Object.getOwnPropertyDescriptor, D = (n, e, t, i) => {
131
+ for (var o = i > 1 ? void 0 : i ? pe(e, t) : e, a = n.length - 1, l; a >= 0; a--)
132
+ (l = n[a]) && (o = (i ? l(e, t, o) : l(o)) || o);
133
+ return i && o && he(e, t, o), o;
211
134
  };
212
- const Y = "icon-chevron-left";
213
- class E extends L {
135
+ const N = "icon-chevron-left";
136
+ class w extends O {
214
137
  constructor() {
215
138
  super(...arguments), this.size = "xs", this.class = "c-pieIcon c-pieIcon--chevronLeft";
216
139
  }
217
140
  connectedCallback() {
218
- var t, o, i;
219
- if (super.connectedCallback(), ((t = this._svg) == null ? void 0 : t.getAttribute("width")) === null) {
220
- const n = b("c-pieIcon c-pieIcon--chevronLeft", "", null, "IconChevronLeft");
221
- (o = this._svg) == null || o.setAttribute("width", n.width), (i = this._svg) == null || i.setAttribute("height", n.height);
141
+ var e, t, i;
142
+ if (super.connectedCallback(), ((e = this._svg) == null ? void 0 : e.getAttribute("width")) === null) {
143
+ const o = m("c-pieIcon c-pieIcon--chevronLeft", "", null, "IconChevronLeft");
144
+ (t = this._svg) == null || t.setAttribute("width", o.width), (i = this._svg) == null || i.setAttribute("height", o.height);
222
145
  }
223
146
  }
224
- updated(t) {
225
- var o, i;
226
- let n;
227
- t.has("size") && (n = b("c-pieIcon c-pieIcon--chevronLeft", "", this.size, "IconChevronLeft"), (o = this._svg) == null || o.setAttribute("width", n.width), (i = this._svg) == null || i.setAttribute("height", n.height));
147
+ updated(e) {
148
+ var t, i;
149
+ let o;
150
+ e.has("size") && (o = m("c-pieIcon c-pieIcon--chevronLeft", "", this.size, "IconChevronLeft"), (t = this._svg) == null || t.setAttribute("width", o.width), (i = this._svg) == null || i.setAttribute("height", o.height));
228
151
  }
229
152
  render() {
230
- return F`<svg xmlns="http://www.w3.org/2000/svg" role="presentation" focusable="false" fill="currentColor" viewBox="0 0 16 16" class="c-pieIcon c-pieIcon--chevronLeft"><path d="M10.96 2.82 5.605 8l5.399 5.197-.875.963-5.565-5.364a1.164 1.164 0 0 1 0-1.671l5.495-5.25.901.945Z"></path></svg>`;
153
+ return M`<svg xmlns="http://www.w3.org/2000/svg" role="presentation" focusable="false" fill="currentColor" viewBox="0 0 16 16" class="c-pieIcon c-pieIcon--chevronLeft"><path d="M10.96 2.82 5.605 8l5.399 5.197-.875.963-5.565-5.364a1.164 1.164 0 0 1 0-1.671l5.495-5.25.901.945Z"></path></svg>`;
231
154
  }
232
155
  }
233
- E.styles = B`
156
+ w.styles = I`
234
157
  :host-context(pie-icon-button) svg,
235
158
  :host-context(pie-button) svg {
236
159
  display: block;
@@ -238,43 +161,43 @@ E.styles = B`
238
161
  height: var(--btn-icon-size);
239
162
  }
240
163
  `;
241
- H([
242
- s({ type: String, reflect: !0 })
243
- ], E.prototype, "size", 2);
244
- H([
245
- s({ type: String, reflect: !0 })
246
- ], E.prototype, "class", 2);
247
- H([
248
- I("svg")
249
- ], E.prototype, "_svg", 2);
250
- customElements.get(Y) === void 0 && customElements.define(Y, E);
251
- var Pe = Object.defineProperty, Te = Object.getOwnPropertyDescriptor, V = (e, t, o, i) => {
252
- for (var n = i > 1 ? void 0 : i ? Te(t, o) : t, a = e.length - 1, r; a >= 0; a--)
253
- (r = e[a]) && (n = (i ? r(t, o, n) : r(n)) || n);
254
- return i && n && Pe(t, o, n), n;
164
+ D([
165
+ r({ type: String, reflect: !0 })
166
+ ], w.prototype, "size", 2);
167
+ D([
168
+ r({ type: String, reflect: !0 })
169
+ ], w.prototype, "class", 2);
170
+ D([
171
+ $("svg")
172
+ ], w.prototype, "_svg", 2);
173
+ customElements.get(N) === void 0 && customElements.define(N, w);
174
+ var ge = Object.defineProperty, ue = Object.getOwnPropertyDescriptor, T = (n, e, t, i) => {
175
+ for (var o = i > 1 ? void 0 : i ? ue(e, t) : e, a = n.length - 1, l; a >= 0; a--)
176
+ (l = n[a]) && (o = (i ? l(e, t, o) : l(o)) || o);
177
+ return i && o && ge(e, t, o), o;
255
178
  };
256
- const K = "icon-chevron-right";
257
- class M extends L {
179
+ const q = "icon-chevron-right";
180
+ class y extends O {
258
181
  constructor() {
259
182
  super(...arguments), this.size = "xs", this.class = "c-pieIcon c-pieIcon--chevronRight";
260
183
  }
261
184
  connectedCallback() {
262
- var t, o, i;
263
- if (super.connectedCallback(), ((t = this._svg) == null ? void 0 : t.getAttribute("width")) === null) {
264
- const n = b("c-pieIcon c-pieIcon--chevronRight", "", null, "IconChevronRight");
265
- (o = this._svg) == null || o.setAttribute("width", n.width), (i = this._svg) == null || i.setAttribute("height", n.height);
185
+ var e, t, i;
186
+ if (super.connectedCallback(), ((e = this._svg) == null ? void 0 : e.getAttribute("width")) === null) {
187
+ const o = m("c-pieIcon c-pieIcon--chevronRight", "", null, "IconChevronRight");
188
+ (t = this._svg) == null || t.setAttribute("width", o.width), (i = this._svg) == null || i.setAttribute("height", o.height);
266
189
  }
267
190
  }
268
- updated(t) {
269
- var o, i;
270
- let n;
271
- t.has("size") && (n = b("c-pieIcon c-pieIcon--chevronRight", "", this.size, "IconChevronRight"), (o = this._svg) == null || o.setAttribute("width", n.width), (i = this._svg) == null || i.setAttribute("height", n.height));
191
+ updated(e) {
192
+ var t, i;
193
+ let o;
194
+ e.has("size") && (o = m("c-pieIcon c-pieIcon--chevronRight", "", this.size, "IconChevronRight"), (t = this._svg) == null || t.setAttribute("width", o.width), (i = this._svg) == null || i.setAttribute("height", o.height));
272
195
  }
273
196
  render() {
274
- return F`<svg xmlns="http://www.w3.org/2000/svg" role="presentation" focusable="false" fill="currentColor" viewBox="0 0 16 16" class="c-pieIcon c-pieIcon--chevronRight"><path d="M5.044 13.18 10.399 8 5 2.82l.875-.962 5.539 5.346a1.164 1.164 0 0 1 0 1.636l-5.469 5.285-.901-.945Z"></path></svg>`;
197
+ return M`<svg xmlns="http://www.w3.org/2000/svg" role="presentation" focusable="false" fill="currentColor" viewBox="0 0 16 16" class="c-pieIcon c-pieIcon--chevronRight"><path d="M5.044 13.18 10.399 8 5 2.82l.875-.962 5.539 5.346a1.164 1.164 0 0 1 0 1.636l-5.469 5.285-.901-.945Z"></path></svg>`;
275
198
  }
276
199
  }
277
- M.styles = B`
200
+ y.styles = I`
278
201
  :host-context(pie-icon-button) svg,
279
202
  :host-context(pie-button) svg {
280
203
  display: block;
@@ -282,495 +205,164 @@ M.styles = B`
282
205
  height: var(--btn-icon-size);
283
206
  }
284
207
  `;
285
- V([
286
- s({ type: String, reflect: !0 })
287
- ], M.prototype, "size", 2);
288
- V([
289
- s({ type: String, reflect: !0 })
290
- ], M.prototype, "class", 2);
291
- V([
292
- I("svg")
293
- ], M.prototype, "_svg", 2);
294
- customElements.get(K) === void 0 && customElements.define(K, M);
295
- var v = window.CustomEvent;
296
- (!v || typeof v == "object") && (v = function(t, o) {
297
- o = o || {};
298
- var i = document.createEvent("CustomEvent");
299
- return i.initCustomEvent(t, !!o.bubbles, !!o.cancelable, o.detail || null), i;
300
- }, v.prototype = window.Event.prototype);
301
- function ne(e, t) {
302
- var o = "on" + t.type.toLowerCase();
303
- return typeof e[o] == "function" && e[o](t), e.dispatchEvent(t);
304
- }
305
- function Be(e) {
306
- for (; e && e !== document.body; ) {
307
- var t = window.getComputedStyle(e), o = function(i, n) {
308
- return !(t[i] === void 0 || t[i] === n);
309
- };
310
- if (t.opacity < 1 || o("zIndex", "auto") || o("transform", "none") || o("mixBlendMode", "normal") || o("filter", "none") || o("perspective", "none") || t.isolation === "isolate" || t.position === "fixed" || t.webkitOverflowScrolling === "touch")
311
- return !0;
312
- e = e.parentElement;
313
- }
314
- return !1;
315
- }
316
- function k(e) {
317
- for (; e; ) {
318
- if (e.localName === "dialog")
319
- return (
320
- /** @type {HTMLDialogElement} */
321
- e
322
- );
323
- e.parentElement ? e = e.parentElement : e.parentNode ? e = e.parentNode.host : e = null;
324
- }
325
- return null;
326
- }
327
- function ae(e) {
328
- for (; e && e.shadowRoot && e.shadowRoot.activeElement; )
329
- e = e.shadowRoot.activeElement;
330
- e && e.blur && e !== document.body && e.blur();
331
- }
332
- function Fe(e, t) {
333
- for (var o = 0; o < e.length; ++o)
334
- if (e[o] === t)
335
- return !0;
336
- return !1;
208
+ T([
209
+ r({ type: String, reflect: !0 })
210
+ ], y.prototype, "size", 2);
211
+ T([
212
+ r({ type: String, reflect: !0 })
213
+ ], y.prototype, "class", 2);
214
+ T([
215
+ $("svg")
216
+ ], y.prototype, "_svg", 2);
217
+ customElements.get(q) === void 0 && customElements.define(q, y);
218
+ function me(n) {
219
+ if (Array.isArray(n)) {
220
+ for (var e = 0, t = Array(n.length); e < n.length; e++)
221
+ t[e] = n[e];
222
+ return t;
223
+ } else
224
+ return Array.from(n);
337
225
  }
338
- function $(e) {
339
- return !e || !e.hasAttribute("method") ? !1 : e.getAttribute("method").toLowerCase() === "dialog";
226
+ var j = !1;
227
+ if (typeof window < "u") {
228
+ var V = {
229
+ get passive() {
230
+ j = !0;
231
+ }
232
+ };
233
+ window.addEventListener("testPassive", null, V), window.removeEventListener("testPassive", null, V);
340
234
  }
341
- function re(e) {
342
- var t = ["button", "input", "keygen", "select", "textarea"], o = t.map(function(r) {
343
- return r + ":not([disabled])";
235
+ var Z = typeof window < "u" && window.navigator && window.navigator.platform && (/iP(ad|hone|od)/.test(window.navigator.platform) || window.navigator.platform === "MacIntel" && window.navigator.maxTouchPoints > 1), g = [], C = !1, G = -1, v = void 0, f = void 0, X = function(e) {
236
+ return g.some(function(t) {
237
+ return !!(t.options.allowTouchMove && t.options.allowTouchMove(e));
344
238
  });
345
- o.push('[tabindex]:not([disabled]):not([tabindex=""])');
346
- var i = e.querySelector(o.join(", "));
347
- if (!i && "attachShadow" in Element.prototype)
348
- for (var n = e.querySelectorAll("*"), a = 0; a < n.length && !(n[a].tagName && n[a].shadowRoot && (i = re(n[a].shadowRoot), i)); a++)
349
- ;
350
- return i;
351
- }
352
- function X(e) {
353
- return e.isConnected || document.body.contains(e);
354
- }
355
- function le(e) {
356
- if (e.submitter)
357
- return e.submitter;
358
- var t = e.target;
359
- if (!(t instanceof HTMLFormElement))
360
- return null;
361
- var o = l.formSubmitter;
362
- if (!o) {
363
- var i = e.target, n = "getRootNode" in i && i.getRootNode() || document;
364
- o = n.activeElement;
365
- }
366
- return !o || o.form !== t ? null : o;
367
- }
368
- function Ne(e) {
369
- if (!e.defaultPrevented) {
370
- var t = (
371
- /** @type {!HTMLFormElement} */
372
- e.target
373
- ), o = l.imagemapUseValue, i = le(e);
374
- o === null && i && (o = i.value);
375
- var n = k(t);
376
- if (n) {
377
- var a = i && i.getAttribute("formmethod") || t.getAttribute("method");
378
- a === "dialog" && (e.preventDefault(), o != null ? n.close(o) : n.close());
379
- }
239
+ }, A = function(e) {
240
+ var t = e || window.event;
241
+ return X(t.target) || t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
242
+ }, ve = function(e) {
243
+ if (f === void 0) {
244
+ var t = !!e && e.reserveScrollBarGap === !0, i = window.innerWidth - document.documentElement.clientWidth;
245
+ t && i > 0 && (f = document.body.style.paddingRight, document.body.style.paddingRight = i + "px");
246
+ }
247
+ v === void 0 && (v = document.body.style.overflow, document.body.style.overflow = "hidden");
248
+ }, fe = function() {
249
+ f !== void 0 && (document.body.style.paddingRight = f, f = void 0), v !== void 0 && (document.body.style.overflow = v, v = void 0);
250
+ }, be = function(e) {
251
+ return e ? e.scrollHeight - e.scrollTop <= e.clientHeight : !1;
252
+ }, we = function(e, t) {
253
+ var i = e.targetTouches[0].clientY - G;
254
+ return X(e.target) ? !1 : t && t.scrollTop === 0 && i > 0 || be(t) && i < 0 ? A(e) : (e.stopPropagation(), !0);
255
+ }, ye = function(e, t) {
256
+ if (!e) {
257
+ console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");
258
+ return;
380
259
  }
381
- }
382
- function se(e) {
383
- if (this.dialog_ = e, this.replacedStyleTop_ = !1, this.openAsModal_ = !1, e.hasAttribute("role") || e.setAttribute("role", "dialog"), e.show = this.show.bind(this), e.showModal = this.showModal.bind(this), e.close = this.close.bind(this), e.addEventListener("submit", Ne, !1), "returnValue" in e || (e.returnValue = ""), "MutationObserver" in window) {
384
- var t = new MutationObserver(this.maybeHideModal.bind(this));
385
- t.observe(e, { attributes: !0, attributeFilter: ["open"] });
386
- } else {
387
- var o = !1, i = function() {
388
- o ? this.downgradeModal() : this.maybeHideModal(), o = !1;
389
- }.bind(this), n, a = function(r) {
390
- if (r.target === e) {
391
- var h = "DOMNodeRemoved";
392
- o |= r.type.substr(0, h.length) === h, window.clearTimeout(n), n = window.setTimeout(i, 0);
393
- }
260
+ if (!g.some(function(o) {
261
+ return o.targetElement === e;
262
+ })) {
263
+ var i = {
264
+ targetElement: e,
265
+ options: t || {}
394
266
  };
395
- ["DOMAttrModified", "DOMNodeRemoved", "DOMNodeRemovedFromDocument"].forEach(function(r) {
396
- e.addEventListener(r, a);
397
- });
398
- }
399
- Object.defineProperty(e, "open", {
400
- set: this.setOpen.bind(this),
401
- get: e.hasAttribute.bind(e, "open")
402
- }), this.backdrop_ = document.createElement("div"), this.backdrop_.className = "backdrop", this.backdrop_.addEventListener("mouseup", this.backdropMouseEvent_.bind(this)), this.backdrop_.addEventListener("mousedown", this.backdropMouseEvent_.bind(this)), this.backdrop_.addEventListener("click", this.backdropMouseEvent_.bind(this));
403
- }
404
- se.prototype = /** @type {HTMLDialogElement.prototype} */
405
- {
406
- get dialog() {
407
- return this.dialog_;
408
- },
409
- /**
410
- * Maybe remove this dialog from the modal top layer. This is called when
411
- * a modal dialog may no longer be tenable, e.g., when the dialog is no
412
- * longer open or is no longer part of the DOM.
413
- */
414
- maybeHideModal: function() {
415
- this.dialog_.hasAttribute("open") && X(this.dialog_) || this.downgradeModal();
416
- },
417
- /**
418
- * Remove this dialog from the modal top layer, leaving it as a non-modal.
419
- */
420
- downgradeModal: function() {
421
- this.openAsModal_ && (this.openAsModal_ = !1, this.dialog_.style.zIndex = "", this.replacedStyleTop_ && (this.dialog_.style.top = "", this.replacedStyleTop_ = !1), this.backdrop_.parentNode && this.backdrop_.parentNode.removeChild(this.backdrop_), l.dm.removeDialog(this));
422
- },
423
- /**
424
- * @param {boolean} value whether to open or close this dialog
425
- */
426
- setOpen: function(e) {
427
- e ? this.dialog_.hasAttribute("open") || this.dialog_.setAttribute("open", "") : (this.dialog_.removeAttribute("open"), this.maybeHideModal());
428
- },
429
- /**
430
- * Handles mouse events ('mouseup', 'mousedown', 'click') on the fake .backdrop element, redirecting them as if
431
- * they were on the dialog itself.
432
- *
433
- * @param {!Event} e to redirect
434
- */
435
- backdropMouseEvent_: function(e) {
436
- if (this.dialog_.hasAttribute("tabindex"))
437
- this.dialog_.focus();
438
- else {
439
- var t = document.createElement("div");
440
- this.dialog_.insertBefore(t, this.dialog_.firstChild), t.tabIndex = -1, t.focus(), this.dialog_.removeChild(t);
441
- }
442
- var o = document.createEvent("MouseEvents");
443
- o.initMouseEvent(
444
- e.type,
445
- e.bubbles,
446
- e.cancelable,
447
- window,
448
- e.detail,
449
- e.screenX,
450
- e.screenY,
451
- e.clientX,
452
- e.clientY,
453
- e.ctrlKey,
454
- e.altKey,
455
- e.shiftKey,
456
- e.metaKey,
457
- e.button,
458
- e.relatedTarget
459
- ), this.dialog_.dispatchEvent(o), e.stopPropagation();
460
- },
461
- /**
462
- * Focuses on the first focusable element within the dialog. This will always blur the current
463
- * focus, even if nothing within the dialog is found.
464
- */
465
- focus_: function() {
466
- var e = this.dialog_.querySelector("[autofocus]:not([disabled])");
467
- !e && this.dialog_.tabIndex >= 0 && (e = this.dialog_), e || (e = re(this.dialog_)), ae(document.activeElement), e && e.focus();
468
- },
469
- /**
470
- * Sets the zIndex for the backdrop and dialog.
471
- *
472
- * @param {number} dialogZ
473
- * @param {number} backdropZ
474
- */
475
- updateZIndex: function(e, t) {
476
- if (e < t)
477
- throw new Error("dialogZ should never be < backdropZ");
478
- this.dialog_.style.zIndex = e, this.backdrop_.style.zIndex = t;
479
- },
480
- /**
481
- * Shows the dialog. If the dialog is already open, this does nothing.
482
- */
483
- show: function() {
484
- this.dialog_.open || (this.setOpen(!0), this.focus_());
485
- },
486
- /**
487
- * Show this dialog modally.
488
- */
489
- showModal: function() {
490
- if (this.dialog_.hasAttribute("open"))
491
- throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");
492
- if (!X(this.dialog_))
493
- throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");
494
- if (!l.dm.pushDialog(this))
495
- throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");
496
- Be(this.dialog_.parentElement) && console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"), this.setOpen(!0), this.openAsModal_ = !0, l.needsCentering(this.dialog_) ? (l.reposition(this.dialog_), this.replacedStyleTop_ = !0) : this.replacedStyleTop_ = !1, this.dialog_.parentNode.insertBefore(this.backdrop_, this.dialog_.nextSibling), this.focus_();
497
- },
498
- /**
499
- * Closes this HTMLDialogElement. This is optional vs clearing the open
500
- * attribute, however this fires a 'close' event.
501
- *
502
- * @param {string=} opt_returnValue to use as the returnValue
503
- */
504
- close: function(e) {
505
- if (!this.dialog_.hasAttribute("open"))
506
- throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");
507
- this.setOpen(!1), e !== void 0 && (this.dialog_.returnValue = e);
508
- var t = new v("close", {
509
- bubbles: !1,
510
- cancelable: !1
511
- });
512
- ne(this.dialog_, t);
513
- }
514
- };
515
- var l = {};
516
- l.reposition = function(e) {
517
- var t = document.body.scrollTop || document.documentElement.scrollTop, o = t + (window.innerHeight - e.offsetHeight) / 2;
518
- e.style.top = Math.max(t, o) + "px";
519
- };
520
- l.isInlinePositionSetByStylesheet = function(e) {
521
- for (var t = 0; t < document.styleSheets.length; ++t) {
522
- var o = document.styleSheets[t], i = null;
523
- try {
524
- i = o.cssRules;
525
- } catch {
526
- }
527
- if (i)
528
- for (var n = 0; n < i.length; ++n) {
529
- var a = i[n], r = null;
530
- try {
531
- r = document.querySelectorAll(a.selectorText);
532
- } catch {
533
- }
534
- if (!(!r || !Fe(r, e))) {
535
- var h = a.style.getPropertyValue("top"), p = a.style.getPropertyValue("bottom");
536
- if (h && h !== "auto" || p && p !== "auto")
537
- return !0;
538
- }
539
- }
540
- }
541
- return !1;
542
- };
543
- l.needsCentering = function(e) {
544
- var t = window.getComputedStyle(e);
545
- return t.position !== "absolute" || e.style.top !== "auto" && e.style.top !== "" || e.style.bottom !== "auto" && e.style.bottom !== "" ? !1 : !l.isInlinePositionSetByStylesheet(e);
546
- };
547
- l.forceRegisterDialog = function(e) {
548
- if ((window.HTMLDialogElement || e.showModal) && console.warn("This browser already supports <dialog>, the polyfill may not work correctly", e), e.localName !== "dialog")
549
- throw new Error("Failed to register dialog: The element is not a dialog.");
550
- new se(
551
- /** @type {!HTMLDialogElement} */
552
- e
553
- );
554
- };
555
- l.registerDialog = function(e) {
556
- e.showModal || l.forceRegisterDialog(e);
557
- };
558
- l.DialogManager = function() {
559
- this.pendingDialogStack = [];
560
- var e = this.checkDOM_.bind(this);
561
- this.overlay = document.createElement("div"), this.overlay.className = "_dialog_overlay", this.overlay.addEventListener("click", function(t) {
562
- this.forwardTab_ = void 0, t.stopPropagation(), e([]);
563
- }.bind(this)), this.handleKey_ = this.handleKey_.bind(this), this.handleFocus_ = this.handleFocus_.bind(this), this.zIndexLow_ = 1e5, this.zIndexHigh_ = 1e5 + 150, this.forwardTab_ = void 0, "MutationObserver" in window && (this.mo_ = new MutationObserver(function(t) {
564
- var o = [];
565
- t.forEach(function(i) {
566
- for (var n = 0, a; a = i.removedNodes[n]; ++n) {
567
- if (a instanceof Element)
568
- a.localName === "dialog" && o.push(a);
569
- else
570
- continue;
571
- o = o.concat(a.querySelectorAll("dialog"));
572
- }
573
- }), o.length && e(o);
574
- }));
575
- };
576
- l.DialogManager.prototype.blockDocument = function() {
577
- document.documentElement.addEventListener("focus", this.handleFocus_, !0), document.addEventListener("keydown", this.handleKey_), this.mo_ && this.mo_.observe(document, { childList: !0, subtree: !0 });
578
- };
579
- l.DialogManager.prototype.unblockDocument = function() {
580
- document.documentElement.removeEventListener("focus", this.handleFocus_, !0), document.removeEventListener("keydown", this.handleKey_), this.mo_ && this.mo_.disconnect();
581
- };
582
- l.DialogManager.prototype.updateStacking = function() {
583
- for (var e = this.zIndexHigh_, t = 0, o; o = this.pendingDialogStack[t]; ++t)
584
- o.updateZIndex(--e, --e), t === 0 && (this.overlay.style.zIndex = --e);
585
- var i = this.pendingDialogStack[0];
586
- if (i) {
587
- var n = i.dialog.parentNode || document.body;
588
- n.appendChild(this.overlay);
589
- } else
590
- this.overlay.parentNode && this.overlay.parentNode.removeChild(this.overlay);
591
- };
592
- l.DialogManager.prototype.containedByTopDialog_ = function(e) {
593
- for (; e = k(e); ) {
594
- for (var t = 0, o; o = this.pendingDialogStack[t]; ++t)
595
- if (o.dialog === e)
596
- return t === 0;
597
- e = e.parentElement;
598
- }
599
- return !1;
600
- };
601
- l.DialogManager.prototype.handleFocus_ = function(e) {
602
- var t = e.composedPath ? e.composedPath()[0] : e.target;
603
- if (!this.containedByTopDialog_(t) && document.activeElement !== document.documentElement && (e.preventDefault(), e.stopPropagation(), ae(
604
- /** @type {Element} */
605
- t
606
- ), this.forwardTab_ !== void 0)) {
607
- var o = this.pendingDialogStack[0], i = o.dialog, n = i.compareDocumentPosition(t);
608
- return n & Node.DOCUMENT_POSITION_PRECEDING && (this.forwardTab_ ? o.focus_() : t !== document.documentElement && document.documentElement.focus()), !1;
267
+ g = [].concat(me(g), [i]), Z ? (e.ontouchstart = function(o) {
268
+ o.targetTouches.length === 1 && (G = o.targetTouches[0].clientY);
269
+ }, e.ontouchmove = function(o) {
270
+ o.targetTouches.length === 1 && we(o, e);
271
+ }, C || (document.addEventListener("touchmove", A, j ? { passive: !1 } : void 0), C = !0)) : ve(t);
272
+ }
273
+ }, ke = function(e) {
274
+ if (!e) {
275
+ console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");
276
+ return;
609
277
  }
278
+ g = g.filter(function(t) {
279
+ return t.targetElement !== e;
280
+ }), Z ? (e.ontouchstart = null, e.ontouchmove = null, C && g.length === 0 && (document.removeEventListener("touchmove", A, j ? { passive: !1 } : void 0), C = !1)) : g.length || fe();
610
281
  };
611
- l.DialogManager.prototype.handleKey_ = function(e) {
612
- if (this.forwardTab_ = void 0, e.keyCode === 27) {
613
- e.preventDefault(), e.stopPropagation();
614
- var t = new v("cancel", {
615
- bubbles: !1,
616
- cancelable: !0
617
- }), o = this.pendingDialogStack[0];
618
- o && ne(o.dialog, t) && o.dialog.close();
619
- } else
620
- e.keyCode === 9 && (this.forwardTab_ = !e.shiftKey);
621
- };
622
- l.DialogManager.prototype.checkDOM_ = function(e) {
623
- var t = this.pendingDialogStack.slice();
624
- t.forEach(function(o) {
625
- e.indexOf(o.dialog) !== -1 ? o.downgradeModal() : o.maybeHideModal();
626
- });
627
- };
628
- l.DialogManager.prototype.pushDialog = function(e) {
629
- var t = (this.zIndexHigh_ - this.zIndexLow_) / 2 - 1;
630
- return this.pendingDialogStack.length >= t ? !1 : (this.pendingDialogStack.unshift(e) === 1 && this.blockDocument(), this.updateStacking(), !0);
631
- };
632
- l.DialogManager.prototype.removeDialog = function(e) {
633
- var t = this.pendingDialogStack.indexOf(e);
634
- t !== -1 && (this.pendingDialogStack.splice(t, 1), this.pendingDialogStack.length === 0 && this.unblockDocument(), this.updateStacking());
635
- };
636
- l.dm = new l.DialogManager();
637
- l.formSubmitter = null;
638
- l.imagemapUseValue = null;
639
- if (window.HTMLDialogElement === void 0) {
640
- var Z = document.createElement("form");
641
- if (Z.setAttribute("method", "dialog"), Z.method !== "dialog") {
642
- var f = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "method");
643
- if (f) {
644
- var Re = f.get;
645
- f.get = function() {
646
- return $(this) ? "dialog" : Re.call(this);
647
- };
648
- var je = f.set;
649
- f.set = function(e) {
650
- return typeof e == "string" && e.toLowerCase() === "dialog" ? this.setAttribute("method", e) : je.call(this, e);
651
- }, Object.defineProperty(HTMLFormElement.prototype, "method", f);
652
- }
653
- }
654
- document.addEventListener("click", function(e) {
655
- if (l.formSubmitter = null, l.imagemapUseValue = null, !e.defaultPrevented) {
656
- var t = (
657
- /** @type {Element} */
658
- e.target
659
- );
660
- if ("composedPath" in e) {
661
- var o = e.composedPath();
662
- t = o.shift() || t;
663
- }
664
- if (!(!t || !$(t.form))) {
665
- var i = t.type === "submit" && ["button", "input"].indexOf(t.localName) > -1;
666
- if (!i) {
667
- if (!(t.localName === "input" && t.type === "image"))
668
- return;
669
- l.imagemapUseValue = e.offsetX + "," + e.offsetY;
670
- }
671
- var n = k(t);
672
- n && (l.formSubmitter = t);
673
- }
674
- }
675
- }, !1), document.addEventListener("submit", function(e) {
676
- var t = e.target, o = k(t);
677
- if (!o) {
678
- var i = le(e), n = i && i.getAttribute("formmethod") || t.getAttribute("method");
679
- n === "dialog" && e.preventDefault();
680
- }
681
- });
682
- var He = HTMLFormElement.prototype.submit, Ve = function() {
683
- if (!$(this))
684
- return He.call(this);
685
- var e = k(this);
686
- e && e.close();
687
- };
688
- HTMLFormElement.prototype.submit = Ve;
689
- }
690
- const qe = `dialog{position:absolute;left:0;right:0;width:-moz-fit-content;width:-webkit-fit-content;width:fit-content;height:-moz-fit-content;height:-webkit-fit-content;height:fit-content;margin:auto;border:solid;padding:1em;background:white;color:#000;display:block}dialog:not([open]){display:none}dialog+.backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.1)}._dialog_overlay{position:fixed;top:0;right:0;bottom:0;left:0}dialog.fixed{position:fixed;top:50%;transform:translateY(-50%)}*,*:before,*:after{box-sizing:border-box}@keyframes rotate360{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.c-modal{--modal-size-s: 450px;--modal-size-m: 600px;--modal-size-l: 1080px;--modal-border-radius: var(--dt-radius-rounded-d);--modal-font: var(--dt-font-interactive-m-family);--modal-bg-color: var(--dt-color-container-default);--modal-elevation: var(--dt-elevation-04);text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-font-smoothing:antialiased;border-radius:var(--modal-border-radius);border:none;box-shadow:var(--modal-elevation);font-family:var(--modal-font);background-color:var(--modal-bg-color);padding:0;--modal-margin-none: var(--dt-spacing-none);--modal-margin-small: var(--dt-spacing-g);--modal-margin-large: var(--dt-spacing-j);--modal-margin-block: var(--modal-margin-small);--modal-block-size: fit-content;--modal-inline-size: 75%;--modal-max-block-size: calc(100vh - calc(var(--modal-margin-block) * 2));--modal-max-inline-size: var(--modal-size-m);block-size:var(--modal-block-size);inline-size:var(--modal-inline-size);max-block-size:var(--modal-max-block-size);max-inline-size:var(--modal-max-inline-size)}.c-modal:focus-visible{outline:none}@media (max-width: 768px){.c-modal pie-icon-button{--btn-dimension: 40px}}.c-modal[open]{display:flex;flex-direction:column}@media (min-width: 768px){.c-modal{--modal-margin-block: var(--modal-margin-large)}}.c-modal[size=small]{--modal-max-inline-size: var(--modal-size-s)}@media (min-width: 768px){.c-modal[size=small]{--modal-margin-block: var(--modal-margin-large)}}@media (max-width: 767px){.c-modal[size=medium][isfullwidthbelowmid]{--modal-margin-block: var(--modal-margin-none);--modal-border-radius: var(--dt-radius-rounded-none);--modal-block-size: 100%;--modal-inline-size: 100%;--modal-max-inline-size: 100%}}.c-modal[size=large]{--modal-inline-size: 75%;--modal-max-inline-size: var(--modal-size-l);--modal-margin-block: var(--modal-margin-large)}@media (max-width: 767px){.c-modal[size=large]{--modal-margin-block: var(--modal-margin-none);--modal-border-radius: var(--dt-radius-rounded-none);--modal-block-size: 100%;--modal-inline-size: 100%}}.c-modal[position=top]{margin-block-start:var(--dt-spacing-j)}@media (max-width: 767px){.c-modal[position=top][isfullwidthbelowmid]{margin-block-start:var(--dt-spacing-none)}}.c-modal::backdrop{background:rgba(0,0,0,.5)}.c-modal .c-modal-footer{--modal-button-spacing: var(--dt-spacing-d);--modal-footer-padding: var(--dt-spacing-d);display:flex;flex-flow:row-reverse;flex-wrap:wrap;gap:var(--modal-button-spacing);padding:var(--modal-footer-padding)}@media (min-width: 768px){.c-modal .c-modal-footer{--modal-footer-padding: var(--dt-spacing-e)}}@media (max-width: 767px){.c-modal[hasstackedactions] .c-modal-footer{flex-direction:column}}.c-modal .c-modal-header{padding-inline:var(--dt-spacing-d);padding-block:14px;display:grid;grid-template-areas:"back heading close" ". heading .";grid-template-columns:minmax(0,max-content) minmax(0,1fr) minmax(0,max-content);align-items:center}@media (min-width: 768px){.c-modal .c-modal-header{padding-inline:var(--dt-spacing-e);padding-block:20px}}.c-modal[hasbackbutton] .c-modal-header{padding-block:var(--dt-spacing-b);padding-inline-start:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal[hasbackbutton] .c-modal-header{padding-block:var(--dt-spacing-c);padding-inline-start:var(--dt-spacing-c)}}.c-modal[isdismissible] .c-modal-header{padding-block:var(--dt-spacing-b);padding-inline-end:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal[isdismissible] .c-modal-header{padding-block:var(--dt-spacing-c);padding-inline-end:var(--dt-spacing-c)}}.c-modal .c-modal-heading{--modal-header-font-size: calc(var(--dt-font-heading-m-size--wide) * 1px);--modal-header-font-line-height: calc(var(--dt-font-heading-m-line-height--wide) * 1px);--modal-header-font-weight: var(--dt-font-heading-m-weight);font-size:var(--modal-header-font-size);line-height:var(--modal-header-font-line-height);font-weight:var(--modal-header-font-weight);margin:0;grid-area:heading}.c-modal[hasbackbutton] .c-modal-heading{padding-inline-start:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal[hasbackbutton] .c-modal-heading{padding-inline-start:var(--dt-spacing-c)}}.c-modal[isdismissible] .c-modal-heading{padding-inline-end:var(--dt-spacing-d)}@media (min-width: 768px){.c-modal[isdismissible] .c-modal-heading{padding-inline-end:var(--dt-spacing-e)}}.c-modal .c-modal-backBtn{grid-area:back}.c-modal .c-modal-closeBtn{grid-area:close}.c-modal[isfooterpinned] .c-modal-content,.c-modal .c-modal-scrollContainer{overflow-y:auto}.c-modal .c-modal-scrollContainer{--bg-scroll-start: linear-gradient(var(--dt-color-container-default) 30%, rgba(255, 255, 255, 0));--bg-scroll-end: linear-gradient(rgba(255, 255, 255, 0), var(--dt-color-container-default) 70%) 0 100%;--bg-scroll-top: radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0));--bg-scroll-bottom: radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0)) 0 100%;--bg-size-scroll-start: 100% 40px;--bg-size-scroll-end: 100% 40px;--bg-size-scroll-top: 100% 16px;--bg-size-scroll-bottom: 100% 16px;background:var(--bg-scroll-start),var(--bg-scroll-end),var(--bg-scroll-top),var(--bg-scroll-bottom);background-repeat:no-repeat;background-color:var(--dt-color-container-default);background-size:var(--bg-size-scroll-start),var(--bg-size-scroll-end),var(--bg-size-scroll-top),var(--bg-size-scroll-bottom);background-attachment:local,local,scroll,scroll}.c-modal .c-modal-content{--modal-content-font-size: calc(var(--dt-font-size-16) * 1px);--modal-content-font-weight: var(--dt-font-weight-regular);--modal-content-line-height: calc(var(--dt-font-size-16-line-height) * 1px);--modal-content-padding: var(--dt-spacing-e);--modal-content-padding-block: var(--dt-spacing-a);--spinner-size: 48px;--spinner-border-width: 6px;--spinner-base-color-h: var(--dt-color-content-interactive-secondary-h);--spinner-base-color-s: var(--dt-color-content-interactive-secondary-s);--spinner-base-color-l: var(--dt-color-content-interactive-secondary-l);--spinner-left-color-opacity: .35;--spinner-left-color: hsl(var(--spinner-base-color-h), var(--spinner-base-color-s), var(--spinner-base-color-l), var(--spinner-left-color-opacity));--spinner-right-color: hsl(var(--spinner-base-color-h), var(--spinner-base-color-s), var(--spinner-base-color-l), 1);--spinner-animation-duration: 1.15s;--spinner-animation-timing-function: linear;--spinner-animation-iteration-count: infinite;position:relative;min-block-size:var(--dt-spacing-j);font-size:var(--modal-content-font-size);line-height:var(--modal-content-line-height);font-weight:var(--modal-content-font-weight);padding-inline:var(--modal-content-padding);padding-block:var(--modal-content-padding-block)}.c-modal .c-modal-content--scrollable{background:linear-gradient(to bottom,transparent,var(--dt-color-container-default) 75%) center bottom,linear-gradient(transparent,var(--dt-color-border-strong)) center bottom;background-repeat:no-repeat;background-size:100% 48px,100% 12px;background-attachment:local,scroll}.c-modal .c-modal-content:before{content:"";position:absolute;left:50%;top:50%;translate:-50% -50%;height:var(--spinner-size);width:var(--spinner-size);display:block;background-color:transparent;border-radius:50%;border-color:var(--spinner-left-color) var(--spinner-right-color) var(--spinner-right-color) var(--spinner-left-color);border-width:var(--spinner-border-width);border-style:solid;will-change:transform;opacity:0}.c-modal[isLoading] .c-modal-content:before{animation:rotate360 var(--spinner-animation-duration) var(--spinner-animation-timing-function) var(--spinner-animation-iteration-count);opacity:1}.c-modal[isLoading] .c-modal-content .c-modal-contentInner{opacity:0}
691
- `, We = ["h1", "h2", "h3", "h4", "h5", "h6"], Ue = ["small", "medium", "large"], Ye = ["top", "center"], P = "pie-modal-close", z = "pie-modal-open", T = "pie-modal-back", Ke = "pie-modal-leading-action-click", Xe = "pie-modal-supporting-action-click";
692
- var Ze = Object.defineProperty, Ge = Object.getOwnPropertyDescriptor, c = (e, t, o, i) => {
693
- for (var n = i > 1 ? void 0 : i ? Ge(t, o) : t, a = e.length - 1, r; a >= 0; a--)
694
- (r = e[a]) && (n = (i ? r(t, o, n) : r(n)) || n);
695
- return i && n && Ze(t, o, n), n;
282
+ const xe = `dialog{position:absolute;left:0;right:0;width:-moz-fit-content;width:-webkit-fit-content;width:fit-content;height:-moz-fit-content;height:-webkit-fit-content;height:fit-content;margin:auto;border:solid;padding:1em;background:white;color:#000;display:block}dialog:not([open]){display:none}dialog+.backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.1)}._dialog_overlay{position:fixed;top:0;right:0;bottom:0;left:0}dialog.fixed{position:fixed;top:50%;transform:translateY(-50%)}*,*:before,*:after{box-sizing:border-box}@keyframes rotate360{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.c-modal{--modal-size-s: 450px;--modal-size-m: 600px;--modal-size-l: 1080px;--modal-border-radius: var(--dt-radius-rounded-d);--modal-font: var(--dt-font-interactive-m-family);--modal-bg-color: var(--dt-color-container-default);--modal-elevation: var(--dt-elevation-04);text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-font-smoothing:antialiased;border-radius:var(--modal-border-radius);border:none;box-shadow:var(--modal-elevation);font-family:var(--modal-font);background-color:var(--modal-bg-color);padding:0;--modal-margin-none: var(--dt-spacing-none);--modal-margin-small: var(--dt-spacing-g);--modal-margin-large: var(--dt-spacing-j);--modal-margin-block: var(--modal-margin-small);--modal-block-size: fit-content;--modal-inline-size: 75%;--modal-max-block-size: calc(100vh - calc(var(--modal-margin-block) * 2));--modal-max-inline-size: var(--modal-size-m);block-size:var(--modal-block-size);inline-size:var(--modal-inline-size);max-block-size:var(--modal-max-block-size);max-inline-size:var(--modal-max-inline-size)}.c-modal:focus-visible{outline:none}@media (max-width: 768px){.c-modal pie-icon-button{--btn-dimension: 40px}}.c-modal[open]{display:flex;flex-direction:column}@media (min-width: 768px){.c-modal{--modal-margin-block: var(--modal-margin-large)}}.c-modal[size=small]{--modal-max-inline-size: var(--modal-size-s)}@media (min-width: 768px){.c-modal[size=small]{--modal-margin-block: var(--modal-margin-large)}}@media (max-width: 767px){.c-modal[size=medium][isfullwidthbelowmid]{--modal-margin-block: var(--modal-margin-none);--modal-border-radius: var(--dt-radius-rounded-none);--modal-block-size: 100%;--modal-inline-size: 100%;--modal-max-inline-size: 100%}}.c-modal[size=large]{--modal-inline-size: 75%;--modal-max-inline-size: var(--modal-size-l);--modal-margin-block: var(--modal-margin-large)}@media (max-width: 767px){.c-modal[size=large]{--modal-margin-block: var(--modal-margin-none);--modal-border-radius: var(--dt-radius-rounded-none);--modal-block-size: 100%;--modal-inline-size: 100%}}.c-modal[position=top]{margin-block-start:var(--dt-spacing-j)}@media (max-width: 767px){.c-modal[position=top][isfullwidthbelowmid]{margin-block-start:var(--dt-spacing-none)}}.c-modal::backdrop{background:rgba(0,0,0,.5)}.c-modal .c-modal-footer{--modal-button-spacing: var(--dt-spacing-d);--modal-footer-padding: var(--dt-spacing-d);display:flex;flex-flow:row-reverse;flex-wrap:wrap;gap:var(--modal-button-spacing);padding:var(--modal-footer-padding)}@media (min-width: 768px){.c-modal .c-modal-footer{--modal-footer-padding: var(--dt-spacing-e)}}@media (max-width: 767px){.c-modal[hasstackedactions] .c-modal-footer{flex-direction:column}}.c-modal .c-modal-header{padding-inline:var(--dt-spacing-d);padding-block:14px;display:grid;grid-template-areas:"back heading close" ". heading .";grid-template-columns:minmax(0,max-content) minmax(0,1fr) minmax(0,max-content);align-items:center}@media (min-width: 768px){.c-modal .c-modal-header{padding-inline:var(--dt-spacing-e);padding-block:20px}}.c-modal[hasbackbutton] .c-modal-header{padding-block:var(--dt-spacing-b);padding-inline-start:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal[hasbackbutton] .c-modal-header{padding-block:var(--dt-spacing-c);padding-inline-start:var(--dt-spacing-c)}}.c-modal[isdismissible] .c-modal-header{padding-block:var(--dt-spacing-b);padding-inline-end:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal[isdismissible] .c-modal-header{padding-block:var(--dt-spacing-c);padding-inline-end:var(--dt-spacing-c)}}.c-modal .c-modal-heading{--modal-header-font-size: calc(var(--dt-font-heading-m-size--wide) * 1px);--modal-header-font-line-height: calc(var(--dt-font-heading-m-line-height--wide) * 1px);--modal-header-font-weight: var(--dt-font-heading-m-weight);font-size:var(--modal-header-font-size);line-height:var(--modal-header-font-line-height);font-weight:var(--modal-header-font-weight);margin:0;grid-area:heading}.c-modal[hasbackbutton] .c-modal-heading{padding-inline-start:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal[hasbackbutton] .c-modal-heading{padding-inline-start:var(--dt-spacing-c)}}.c-modal[isdismissible] .c-modal-heading{padding-inline-end:var(--dt-spacing-d)}@media (min-width: 768px){.c-modal[isdismissible] .c-modal-heading{padding-inline-end:var(--dt-spacing-e)}}.c-modal .c-modal-backBtn{grid-area:back}.c-modal .c-modal-closeBtn{grid-area:close}.c-modal[isfooterpinned] .c-modal-content,.c-modal .c-modal-scrollContainer{overflow-y:auto}.c-modal .c-modal-scrollContainer{--bg-scroll-start: linear-gradient(var(--dt-color-container-default) 30%, rgba(255, 255, 255, 0));--bg-scroll-end: linear-gradient(rgba(255, 255, 255, 0), var(--dt-color-container-default) 70%) 0 100%;--bg-scroll-top: radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0));--bg-scroll-bottom: radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0)) 0 100%;--bg-size-scroll-start: 100% 40px;--bg-size-scroll-end: 100% 40px;--bg-size-scroll-top: 100% 16px;--bg-size-scroll-bottom: 100% 16px;background:var(--bg-scroll-start),var(--bg-scroll-end),var(--bg-scroll-top),var(--bg-scroll-bottom);background-repeat:no-repeat;background-color:var(--dt-color-container-default);background-size:var(--bg-size-scroll-start),var(--bg-size-scroll-end),var(--bg-size-scroll-top),var(--bg-size-scroll-bottom);background-attachment:local,local,scroll,scroll}.c-modal .c-modal-content{--modal-content-font-size: calc(var(--dt-font-size-16) * 1px);--modal-content-font-weight: var(--dt-font-weight-regular);--modal-content-line-height: calc(var(--dt-font-size-16-line-height) * 1px);--modal-content-padding: var(--dt-spacing-e);--modal-content-padding-block: var(--dt-spacing-a);--spinner-size: 48px;--spinner-border-width: 6px;--spinner-base-color-h: var(--dt-color-content-interactive-secondary-h);--spinner-base-color-s: var(--dt-color-content-interactive-secondary-s);--spinner-base-color-l: var(--dt-color-content-interactive-secondary-l);--spinner-left-color-opacity: .35;--spinner-left-color: hsl(var(--spinner-base-color-h), var(--spinner-base-color-s), var(--spinner-base-color-l), var(--spinner-left-color-opacity));--spinner-right-color: hsl(var(--spinner-base-color-h), var(--spinner-base-color-s), var(--spinner-base-color-l), 1);--spinner-animation-duration: 1.15s;--spinner-animation-timing-function: linear;--spinner-animation-iteration-count: infinite;position:relative;min-block-size:var(--dt-spacing-j);font-size:var(--modal-content-font-size);line-height:var(--modal-content-line-height);font-weight:var(--modal-content-font-weight);padding-inline:var(--modal-content-padding);padding-block:var(--modal-content-padding-block)}.c-modal .c-modal-content--scrollable{background:linear-gradient(to bottom,transparent,var(--dt-color-container-default) 75%) center bottom,linear-gradient(transparent,var(--dt-color-border-strong)) center bottom;background-repeat:no-repeat;background-size:100% 48px,100% 12px;background-attachment:local,scroll}.c-modal .c-modal-content:before{content:"";position:absolute;left:50%;top:50%;translate:-50% -50%;height:var(--spinner-size);width:var(--spinner-size);display:block;background-color:transparent;border-radius:50%;border-color:var(--spinner-left-color) var(--spinner-right-color) var(--spinner-right-color) var(--spinner-left-color);border-width:var(--spinner-border-width);border-style:solid;will-change:transform;opacity:0}.c-modal[isLoading] .c-modal-content:before{animation:rotate360 var(--spinner-animation-duration) var(--spinner-animation-timing-function) var(--spinner-animation-iteration-count);opacity:1}.c-modal[isLoading] .c-modal-content .c-modal-contentInner{opacity:0}
283
+ `, _e = ["h1", "h2", "h3", "h4", "h5", "h6"], ze = ["small", "medium", "large"], Ce = ["top", "center"], S = "pie-modal-close", x = "pie-modal-open", B = "pie-modal-back", Ae = "pie-modal-leading-action-click", Oe = "pie-modal-supporting-action-click";
284
+ var $e = Object.defineProperty, Le = Object.getOwnPropertyDescriptor, d = (n, e, t, i) => {
285
+ for (var o = i > 1 ? void 0 : i ? Le(e, t) : e, a = n.length - 1, l; a >= 0; a--)
286
+ (l = n[a]) && (o = (i ? l(e, t, o) : l(o)) || o);
287
+ return i && o && $e(e, t, o), o;
696
288
  };
697
- const C = "pie-modal";
698
- class d extends ye(L) {
289
+ const k = "pie-modal";
290
+ class s extends ne(O) {
699
291
  constructor() {
700
- super(), this.headingLevel = "h2", this.hasBackButton = !1, this.hasStackedActions = !1, this.isDismissible = !1, this.isFooterPinned = !0, this.isFullWidthBelowMid = !1, this.isLoading = !1, this.isOpen = !1, this.position = "center", this.size = "medium", this._backButtonClicked = !1, this._handleDialogCancelEvent = (t) => {
701
- this.isDismissible || t.preventDefault();
702
- }, this._handleDialogLightDismiss = (t) => {
703
- var p;
292
+ super(...arguments), this.headingLevel = "h2", this.hasBackButton = !1, this.hasStackedActions = !1, this.isDismissible = !1, this.isFooterPinned = !0, this.isFullWidthBelowMid = !1, this.isLoading = !1, this.isOpen = !1, this.position = "center", this.size = "medium", this._backButtonClicked = !1, this._handleDialogCancelEvent = (e) => {
293
+ this.isDismissible || e.preventDefault();
294
+ }, this._handleDialogLightDismiss = (e) => {
295
+ var u;
704
296
  if (!this.isDismissible)
705
297
  return;
706
- const o = (p = this._dialog) == null ? void 0 : p.getBoundingClientRect(), {
298
+ const t = (u = this._dialog) == null ? void 0 : u.getBoundingClientRect(), {
707
299
  top: i = 0,
708
- bottom: n = 0,
300
+ bottom: o = 0,
709
301
  left: a = 0,
710
- right: r = 0
711
- } = o || {};
712
- if (i === 0 && n === 0 && a === 0 && r === 0)
302
+ right: l = 0
303
+ } = t || {};
304
+ if (i === 0 && o === 0 && a === 0 && l === 0)
713
305
  return;
714
- (t.clientY < i || t.clientY > n || t.clientX < a || t.clientX > r) && (this.isOpen = !1);
715
- }, this._dispatchModalCustomEvent = (t) => {
716
- const o = new CustomEvent(t, {
306
+ (e.clientY < i || e.clientY > o || e.clientX < a || e.clientX > l) && (this.isOpen = !1);
307
+ }, this._dispatchModalCustomEvent = (e) => {
308
+ const t = new CustomEvent(e, {
717
309
  bubbles: !0,
718
310
  composed: !0
719
311
  });
720
- this.dispatchEvent(o);
721
- }, this.addEventListener("click", (t) => this._handleDialogLightDismiss(t));
312
+ this.dispatchEvent(t);
313
+ };
722
314
  }
723
315
  connectedCallback() {
724
- super.connectedCallback(), document.addEventListener(z, this._handleModalOpened.bind(this)), document.addEventListener(P, this._handleModalClosed.bind(this)), document.addEventListener(T, this._handleModalClosed.bind(this));
316
+ super.connectedCallback(), this.addEventListener("click", (e) => this._handleDialogLightDismiss(e)), document.addEventListener(x, this._handleModalOpened.bind(this)), document.addEventListener(S, this._handleModalClosed.bind(this)), document.addEventListener(B, this._handleModalClosed.bind(this));
725
317
  }
726
318
  disconnectedCallback() {
727
- document.removeEventListener(z, this._handleModalOpened.bind(this)), document.removeEventListener(P, this._handleModalClosed.bind(this)), document.removeEventListener(T, this._handleModalClosed.bind(this)), super.disconnectedCallback();
319
+ document.removeEventListener(x, this._handleModalOpened.bind(this)), document.removeEventListener(S, this._handleModalClosed.bind(this)), document.removeEventListener(B, this._handleModalClosed.bind(this)), super.disconnectedCallback();
728
320
  }
729
- firstUpdated(t) {
730
- this._dialog && (l.registerDialog(this._dialog), this._dialog.addEventListener("cancel", (o) => this._handleDialogCancelEvent(o)), this._dialog.addEventListener("close", () => {
321
+ async firstUpdated(e) {
322
+ super.firstUpdated(e), this._dialog && ((await import("./dialog-polyfill.esm-29edb142.js").then((i) => i.default)).registerDialog(this._dialog), this._dialog.addEventListener("cancel", (i) => this._handleDialogCancelEvent(i)), this._dialog.addEventListener("close", () => {
731
323
  this.isOpen = !1;
732
- })), this._handleModalOpenStateOnFirstRender(t);
324
+ })), this._handleModalOpenStateOnFirstRender(e);
733
325
  }
734
- updated(t) {
735
- this._handleModalOpenStateChanged(t);
326
+ updated(e) {
327
+ super.updated(e), this._handleModalOpenStateChanged(e);
736
328
  }
737
329
  /**
738
330
  * Opens the dialog element and disables page scrolling
739
331
  */
740
332
  _handleModalOpened() {
741
- var o, i, n, a;
742
- const t = (o = this._dialog) == null ? void 0 : o.querySelector(".c-modal-scrollContainer");
743
- t && Ce(t), !((i = this._dialog) != null && i.hasAttribute("open") || !((n = this._dialog) != null && n.isConnected)) && ((a = this._dialog) == null || a.showModal());
333
+ var t, i, o, a;
334
+ const e = (t = this._dialog) == null ? void 0 : t.querySelector(".c-modal-scrollContainer");
335
+ e && ye(e), !((i = this._dialog) != null && i.hasAttribute("open") || !((o = this._dialog) != null && o.isConnected)) && ((a = this._dialog) == null || a.showModal());
744
336
  }
745
337
  /**
746
338
  * Closes the dialog element and re-enables page scrolling
747
339
  */
748
340
  _handleModalClosed() {
749
- var o, i;
750
- const t = (o = this._dialog) == null ? void 0 : o.querySelector(".c-modal-scrollContainer");
751
- t && ze(t), (i = this._dialog) == null || i.close(), this._returnFocus();
341
+ var t, i;
342
+ const e = (t = this._dialog) == null ? void 0 : t.querySelector(".c-modal-scrollContainer");
343
+ e && ke(e), (i = this._dialog) == null || i.close(), this._returnFocus();
752
344
  }
753
345
  // Handles the value of the isOpen property on first render of the component
754
- _handleModalOpenStateOnFirstRender(t) {
755
- t.get("isOpen") === void 0 && this.isOpen && this._dispatchModalCustomEvent(z);
346
+ _handleModalOpenStateOnFirstRender(e) {
347
+ e.get("isOpen") === void 0 && this.isOpen && this._dispatchModalCustomEvent(x);
756
348
  }
757
349
  // Handles changes to the modal isOpen property by dispatching any appropriate events
758
- _handleModalOpenStateChanged(t) {
759
- const o = t.get("isOpen");
760
- o !== void 0 && (o ? this._backButtonClicked ? (this._backButtonClicked = !1, this._dispatchModalCustomEvent(T)) : this._dispatchModalCustomEvent(P) : this._dispatchModalCustomEvent(z));
350
+ _handleModalOpenStateChanged(e) {
351
+ const t = e.get("isOpen");
352
+ t !== void 0 && (t ? this._backButtonClicked ? (this._backButtonClicked = !1, this._dispatchModalCustomEvent(B)) : this._dispatchModalCustomEvent(S) : this._dispatchModalCustomEvent(x));
761
353
  }
762
- _handleActionClick(t) {
763
- var o, i;
764
- t === "leading" ? ((o = this._dialog) == null || o.close("leading"), this._dispatchModalCustomEvent(Ke)) : t === "supporting" && ((i = this._dialog) == null || i.close("supporting"), this._dispatchModalCustomEvent(Xe));
354
+ _handleActionClick(e) {
355
+ var t, i;
356
+ e === "leading" ? ((t = this._dialog) == null || t.close("leading"), this._dispatchModalCustomEvent(Ae)) : e === "supporting" && ((i = this._dialog) == null || i.close("supporting"), this._dispatchModalCustomEvent(Oe));
765
357
  }
766
358
  /**
767
359
  * Return focus to the specified element, providing the selector is valid
768
360
  * and the chosen element can be found.
769
361
  */
770
362
  _returnFocus() {
771
- var o, i;
772
- const t = (o = this.returnFocusAfterCloseSelector) == null ? void 0 : o.trim();
773
- t && ((i = document.querySelector(t)) == null || i.focus());
363
+ var t, i;
364
+ const e = (t = this.returnFocusAfterCloseSelector) == null ? void 0 : t.trim();
365
+ e && ((i = document.querySelector(e)) == null || i.focus());
774
366
  }
775
367
  /**
776
368
  * Template for the close button element. Called within the
@@ -779,15 +371,15 @@ class d extends ye(L) {
779
371
  * @private
780
372
  */
781
373
  renderCloseButton() {
782
- var t;
783
- return g`
374
+ var e;
375
+ return p`
784
376
  <pie-icon-button
785
377
  @click="${() => {
786
378
  this.isOpen = !1;
787
379
  }}"
788
380
  variant="ghost-secondary"
789
381
  class="c-modal-closeBtn"
790
- aria-label="${((t = this.aria) == null ? void 0 : t.close) || u}"
382
+ aria-label="${((e = this.aria) == null ? void 0 : e.close) || c}"
791
383
  data-test-id="modal-close-button">
792
384
  <icon-close></icon-close>
793
385
  </pie-icon-button>`;
@@ -799,17 +391,17 @@ class d extends ye(L) {
799
391
  * @private
800
392
  */
801
393
  renderBackButton() {
802
- var t;
803
- return g`
394
+ var e;
395
+ return p`
804
396
  <pie-icon-button
805
397
  @click="${() => {
806
398
  this._backButtonClicked = !0, this.isOpen = !1;
807
399
  }}"
808
400
  variant="ghost-secondary"
809
401
  class="c-modal-backBtn"
810
- aria-label="${((t = this.aria) == null ? void 0 : t.back) || u}"
402
+ aria-label="${((e = this.aria) == null ? void 0 : e.back) || c}"
811
403
  data-test-id="modal-back-button">
812
- ${this.isRTL ? g`<icon-chevron-right></icon-chevron-right>` : g`<icon-chevron-left></icon-chevron-left>`}
404
+ ${this.isRTL ? p`<icon-chevron-right></icon-chevron-right>` : p`<icon-chevron-left></icon-chevron-left>`}
813
405
  </pie-icon-button>
814
406
  `;
815
407
  }
@@ -823,18 +415,18 @@ class d extends ye(L) {
823
415
  * @private
824
416
  */
825
417
  renderLeadingAction() {
826
- const { text: t, variant: o = "primary", ariaLabel: i } = this.leadingAction;
827
- return t ? g`
418
+ const { text: e, variant: t = "primary", ariaLabel: i } = this.leadingAction;
419
+ return e ? p`
828
420
  <pie-button
829
- variant="${o}"
830
- aria-label="${i || u}"
421
+ variant="${t}"
422
+ aria-label="${i || c}"
831
423
  type="submit"
832
424
  ?isFullWidth="${this.hasStackedActions}"
833
425
  @click="${() => this._handleActionClick("leading")}"
834
426
  data-test-id="modal-leading-action">
835
- ${t}
427
+ ${e}
836
428
  </pie-button>
837
- ` : u;
429
+ ` : c;
838
430
  }
839
431
  /**
840
432
  * Render supportingAction button depending on prop availability.
@@ -848,76 +440,76 @@ class d extends ye(L) {
848
440
  * @private
849
441
  */
850
442
  renderSupportingAction() {
851
- const { text: t, variant: o = "ghost", ariaLabel: i } = this.supportingAction;
852
- return t ? this.leadingAction ? g`
443
+ const { text: e, variant: t = "ghost", ariaLabel: i } = this.supportingAction;
444
+ return e ? this.leadingAction ? p`
853
445
  <pie-button
854
- variant="${o}"
855
- aria-label="${i || u}"
446
+ variant="${t}"
447
+ aria-label="${i || c}"
856
448
  type="reset"
857
449
  ?isFullWidth="${this.hasStackedActions}"
858
450
  @click="${() => this._handleActionClick("supporting")}"
859
451
  data-test-id="modal-supporting-action">
860
- ${t}
452
+ ${e}
861
453
  </pie-button>
862
- ` : (console.warn("Use `leadingAction` instead of `supportingAction`. `supportingAction` is being ignored."), u) : u;
454
+ ` : (console.warn("Use `leadingAction` instead of `supportingAction`. `supportingAction` is being ignored."), c) : c;
863
455
  }
864
456
  /**
865
457
  * Renders the modal inner content and footer of the modal.
866
458
  * @private
867
459
  */
868
460
  renderModalContentAndFooter() {
869
- return g`
461
+ return p`
870
462
  <article class="c-modal-scrollContainer c-modal-content c-modal-content--scrollable">
871
463
  <div class="c-modal-contentInner">
872
464
  <slot></slot>
873
465
  </div>
874
466
  </article>
875
467
  <footer class="c-modal-footer">
876
- ${this.leadingAction ? this.renderLeadingAction() : u}
877
- ${this.supportingAction ? this.renderSupportingAction() : u}
468
+ ${this.leadingAction ? this.renderLeadingAction() : c}
469
+ ${this.supportingAction ? this.renderSupportingAction() : c}
878
470
  </footer>`;
879
471
  }
880
472
  render() {
881
473
  const {
882
- aria: t,
883
- hasBackButton: o,
474
+ aria: e,
475
+ hasBackButton: t,
884
476
  hasStackedActions: i,
885
- heading: n,
477
+ heading: o,
886
478
  headingLevel: a = "h2",
887
- isDismissible: r,
479
+ isDismissible: l,
888
480
  isFooterPinned: h,
889
- isFullWidthBelowMid: p,
890
- isLoading: y,
891
- leadingAction: de,
892
- position: ce,
893
- size: he,
894
- supportingAction: ue
895
- } = this, q = ge(a);
896
- return g`
481
+ isFullWidthBelowMid: u,
482
+ isLoading: L,
483
+ leadingAction: J,
484
+ position: Q,
485
+ size: K,
486
+ supportingAction: ee
487
+ } = this, F = oe(a);
488
+ return p`
897
489
  <dialog
898
490
  id="dialog"
899
491
  class="c-modal"
900
- size="${he}"
901
- position="${ce}"
902
- ?hasActions=${de || ue}
903
- ?hasBackButton=${o}
492
+ size="${K}"
493
+ position="${Q}"
494
+ ?hasActions=${J || ee}
495
+ ?hasBackButton=${t}
904
496
  ?hasStackedActions=${i}
905
- ?isDismissible=${r}
497
+ ?isDismissible=${l}
906
498
  ?isFooterPinned=${h}
907
- ?isFullWidthBelowMid=${p}
908
- ?isLoading=${y}
909
- aria-busy="${y ? "true" : "false"}"
910
- aria-label="${y && (t == null ? void 0 : t.loading) || u}"
499
+ ?isFullWidthBelowMid=${u}
500
+ ?isLoading=${L}
501
+ aria-busy="${L ? "true" : "false"}"
502
+ aria-label="${L && (e == null ? void 0 : e.loading) || c}"
911
503
  data-test-id="pie-modal">
912
504
  <header class="c-modal-header">
913
- ${o ? this.renderBackButton() : u}
914
- <${q} class="c-modal-heading">
915
- ${n}
916
- </${q}>
917
- ${r ? this.renderCloseButton() : u}
505
+ ${t ? this.renderBackButton() : c}
506
+ <${F} class="c-modal-heading">
507
+ ${o}
508
+ </${F}>
509
+ ${l ? this.renderCloseButton() : c}
918
510
  </header>
919
511
  ${// We need to wrap the remaining content in a shared scrollable container if the footer is not pinned
920
- h ? this.renderModalContentAndFooter() : g`
512
+ h ? this.renderModalContentAndFooter() : p`
921
513
  <div class="c-modal-scrollContainer">
922
514
  ${this.renderModalContentAndFooter()}
923
515
  </div>
@@ -925,68 +517,68 @@ class d extends ye(L) {
925
517
  </dialog>`;
926
518
  }
927
519
  }
928
- d.styles = pe(qe);
929
- c([
930
- s({ type: Object })
931
- ], d.prototype, "aria", 2);
932
- c([
933
- s({ type: String }),
934
- we(C)
935
- ], d.prototype, "heading", 2);
936
- c([
937
- s(),
938
- N(C, We, "h2")
939
- ], d.prototype, "headingLevel", 2);
940
- c([
941
- s({ type: Boolean })
942
- ], d.prototype, "hasBackButton", 2);
943
- c([
944
- s({ type: Boolean })
945
- ], d.prototype, "hasStackedActions", 2);
946
- c([
947
- s({ type: Boolean, reflect: !0 })
948
- ], d.prototype, "isDismissible", 2);
949
- c([
950
- s({ type: Boolean })
951
- ], d.prototype, "isFooterPinned", 2);
952
- c([
953
- s({ type: Boolean })
954
- ], d.prototype, "isFullWidthBelowMid", 2);
955
- c([
956
- s({ type: Boolean, reflect: !0 })
957
- ], d.prototype, "isLoading", 2);
958
- c([
959
- s({ type: Boolean })
960
- ], d.prototype, "isOpen", 2);
961
- c([
962
- s({ type: Object })
963
- ], d.prototype, "leadingAction", 2);
964
- c([
965
- s(),
966
- N(C, Ye, "center")
967
- ], d.prototype, "position", 2);
968
- c([
969
- s()
970
- ], d.prototype, "returnFocusAfterCloseSelector", 2);
971
- c([
972
- s(),
973
- N(C, Ue, "medium")
974
- ], d.prototype, "size", 2);
975
- c([
976
- s({ type: Object })
977
- ], d.prototype, "supportingAction", 2);
978
- c([
979
- I("dialog")
980
- ], d.prototype, "_dialog", 2);
981
- customElements.define(C, d);
520
+ s.styles = ie(xe);
521
+ d([
522
+ r({ type: Object })
523
+ ], s.prototype, "aria", 2);
524
+ d([
525
+ r({ type: String }),
526
+ ae(k)
527
+ ], s.prototype, "heading", 2);
528
+ d([
529
+ r(),
530
+ E(k, _e, "h2")
531
+ ], s.prototype, "headingLevel", 2);
532
+ d([
533
+ r({ type: Boolean })
534
+ ], s.prototype, "hasBackButton", 2);
535
+ d([
536
+ r({ type: Boolean })
537
+ ], s.prototype, "hasStackedActions", 2);
538
+ d([
539
+ r({ type: Boolean, reflect: !0 })
540
+ ], s.prototype, "isDismissible", 2);
541
+ d([
542
+ r({ type: Boolean })
543
+ ], s.prototype, "isFooterPinned", 2);
544
+ d([
545
+ r({ type: Boolean })
546
+ ], s.prototype, "isFullWidthBelowMid", 2);
547
+ d([
548
+ r({ type: Boolean, reflect: !0 })
549
+ ], s.prototype, "isLoading", 2);
550
+ d([
551
+ r({ type: Boolean })
552
+ ], s.prototype, "isOpen", 2);
553
+ d([
554
+ r({ type: Object })
555
+ ], s.prototype, "leadingAction", 2);
556
+ d([
557
+ r(),
558
+ E(k, Ce, "center")
559
+ ], s.prototype, "position", 2);
560
+ d([
561
+ r()
562
+ ], s.prototype, "returnFocusAfterCloseSelector", 2);
563
+ d([
564
+ r(),
565
+ E(k, ze, "medium")
566
+ ], s.prototype, "size", 2);
567
+ d([
568
+ r({ type: Object })
569
+ ], s.prototype, "supportingAction", 2);
570
+ d([
571
+ $("dialog")
572
+ ], s.prototype, "_dialog", 2);
573
+ customElements.define(k, s);
982
574
  export {
983
- T as ON_MODAL_BACK_EVENT,
984
- P as ON_MODAL_CLOSE_EVENT,
985
- Ke as ON_MODAL_LEADING_ACTION_CLICK,
986
- z as ON_MODAL_OPEN_EVENT,
987
- Xe as ON_MODAL_SUPPORTING_ACTION_CLICK,
988
- d as PieModal,
989
- We as headingLevels,
990
- Ye as positions,
991
- Ue as sizes
575
+ B as ON_MODAL_BACK_EVENT,
576
+ S as ON_MODAL_CLOSE_EVENT,
577
+ Ae as ON_MODAL_LEADING_ACTION_CLICK,
578
+ x as ON_MODAL_OPEN_EVENT,
579
+ Oe as ON_MODAL_SUPPORTING_ACTION_CLICK,
580
+ s as PieModal,
581
+ _e as headingLevels,
582
+ Ce as positions,
583
+ ze as sizes
992
584
  };