vrembem 4.0.0-next.30 → 4.0.0-next.31

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,350 +1,798 @@
1
- var te = (t) => {
1
+ var Jt = (t) => {
2
2
  throw TypeError(t);
3
3
  };
4
- var ee = (t, e, i) => e.has(t) || te("Cannot " + i);
5
- var w = (t, e, i) => (ee(t, e, "read from private field"), i ? i.call(t) : e.get(t)), $ = (t, e, i) => e.has(t) ? te("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), E = (t, e, i, s) => (ee(t, e, "write to private field"), s ? s.call(t, i) : e.set(t, i), i);
6
- function le(t) {
7
- return t.split("-").map((e, i) => i === 0 ? e : e.charAt(0).toUpperCase() + e.slice(1)).join("");
4
+ var Xt = (t, e, s) => e.has(t) || Jt("Cannot " + s);
5
+ var E = (t, e, s) => (Xt(t, e, "read from private field"), s ? s.call(t) : e.get(t)), U = (t, e, s) => e.has(t) ? Jt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), S = (t, e, s, n) => (Xt(t, e, "write to private field"), n ? n.call(t, s) : e.set(t, s), s);
6
+ const C = ":not([inert])", $ = ':not([tabindex^="-"])', mt = ":not(:disabled)", se = [
7
+ `a[href]${C}${$}`,
8
+ `area[href]${C}${$}`,
9
+ `input:not([type="hidden"]):not([type="radio"])${C}${$}${mt}`,
10
+ `input[type="radio"]${C}${$}${mt}`,
11
+ `select${C}${$}${mt}`,
12
+ `textarea${C}${$}${mt}`,
13
+ `button${C}${$}${mt}`,
14
+ `details${C} > summary:first-of-type${$}`,
15
+ `iframe${C}${$}`,
16
+ `audio[controls]${C}${$}`,
17
+ `video[controls]${C}${$}`,
18
+ `[contenteditable]${C}${$}`,
19
+ `[tabindex]${C}${$}`
20
+ ];
21
+ function ie(t, e = "config") {
22
+ const n = (t.getAttribute(`data-${e}`) || "").replace(/'/g, '"');
23
+ return n ? JSON.parse(n) : {};
24
+ }
25
+ function Bt(t) {
26
+ return typeof t == "string" ? document.getElementById(t) : t instanceof HTMLElement ? t : null;
8
27
  }
9
- function Kt(t) {
28
+ async function Q(t, e, ...s) {
29
+ e in t && typeof t[e] == "function" && await t[e](...s);
30
+ }
31
+ function oe(t, e, s) {
32
+ if (typeof e == "string") {
33
+ const i = document.querySelector(e);
34
+ if (!i)
35
+ throw new Error(`No teleport reference found for selector: ${e}`);
36
+ e = i;
37
+ } else if (!(e instanceof HTMLElement))
38
+ throw new Error(`Not a valid teleport reference: '${e}'`);
39
+ if (typeof e[s] != "function")
40
+ throw new Error(`Not a valid teleport method: '${s}'`);
41
+ let n = document.createComment(
42
+ "teleported #" + t.id
43
+ );
44
+ return t.before(n), e[s](t), () => {
45
+ n && (n.after(t), n.remove(), n = null);
46
+ };
47
+ }
48
+ function re(t) {
49
+ return t.split("-").map(
50
+ (e, s) => s === 0 ? e : e.charAt(0).toUpperCase() + e.slice(1)
51
+ ).join("");
52
+ }
53
+ function Ut(t) {
10
54
  return t.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
11
55
  }
12
- function ae(t) {
56
+ function le(t) {
13
57
  if (typeof t == "number")
14
58
  return t;
15
59
  const e = parseFloat(t);
16
60
  if (!Number.isNaN(e)) {
17
- const i = t.includes("ms");
18
- return e * (i ? 1 : 1e3);
61
+ const s = t.includes("ms");
62
+ return e * (s ? 1 : 1e3);
19
63
  }
20
64
  throw new Error(`Could not convert value to milliseconds: ${t}`);
21
65
  }
22
- function Pt() {
23
- return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
66
+ function wt(t, e, s, n, i = 0) {
67
+ return new Promise((r) => {
68
+ t.classList.remove(e), t.classList.add(s), setTimeout(() => {
69
+ t.classList.add(n), t.classList.remove(s), r(t);
70
+ }, le(i));
71
+ });
24
72
  }
25
- function ce(t, e) {
26
- const i = {
73
+ function ae(t, e = {}) {
74
+ const s = {
27
75
  fallback: null,
28
76
  element: document.body,
29
77
  ...e
30
78
  };
31
- if (t.slice(0, 2) !== "--") {
32
- const n = Pt();
33
- n && (t = `${n}${t}`), t = `--${t}`;
34
- }
35
- const s = getComputedStyle(i.element).getPropertyValue(t).trim();
36
- if (s)
37
- return s;
38
- if (i.fallback)
39
- return i.fallback;
79
+ if (!t.startsWith("--")) {
80
+ const i = kt();
81
+ i && (t = `${i}${t}`), t = `--${t}`;
82
+ }
83
+ const n = getComputedStyle(s.element).getPropertyValue(t).trim();
84
+ if (n)
85
+ return n;
86
+ if (s.fallback)
87
+ return s.fallback;
40
88
  throw new Error(`CSS variable "${t}" was not found!`);
41
89
  }
42
- function fe(t, e = "config") {
43
- const s = (t.getAttribute(`data-${e}`) || "").replace(/'/g, '"');
44
- return s ? JSON.parse(s) : {};
90
+ async function V(t, e, s) {
91
+ await Q(e, t, s), s && await Q(s, t);
92
+ for (const n of e.plugins)
93
+ await Q(n, t, { plugin: n, parent: e, entry: s });
94
+ await e.emit(t, s);
45
95
  }
46
- function ue(t) {
47
- const e = getComputedStyle(t.el), i = {}, s = t.getSetting("customProps");
48
- for (let n = 0; n < s.length; n++) {
49
- const o = Pt(), r = t.context.module.toLowerCase(), l = Kt(s[n]), a = e.getPropertyValue(`--${o}${r}-${l}`).trim();
50
- a && (i[l] = a);
96
+ function ce(t) {
97
+ const e = getComputedStyle(t.el), s = {}, n = t.getSetting("customProps");
98
+ for (let i = 0; i < n.length; i++) {
99
+ const r = kt(), o = t.parent.module.toLowerCase(), l = Ut(n[i]), a = e.getPropertyValue(`--${r}${o}-${l}`).trim();
100
+ a && (s[l] = a);
51
101
  }
52
- return i;
102
+ return s;
53
103
  }
54
- function de(t) {
55
- return typeof t == "string" ? document.getElementById(t) : t instanceof HTMLElement ? t : null;
104
+ function kt() {
105
+ return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
56
106
  }
57
- function Me(t, e, i = "camel") {
58
- return e = i === "camel" ? le(e) : Kt(e), t.split(".").concat(e).reduce((s, n) => s == null ? void 0 : s[n], this);
107
+ function He(t, e, s = "camel") {
108
+ return e = s === "camel" ? re(e) : Ut(e), t.split(".").concat(e).reduce((n, i) => n == null ? void 0 : n[i], this);
59
109
  }
60
- function he(t, e = {}) {
110
+ function fe(t, e = {}) {
61
111
  const {
62
- fallback: i,
63
- props: s = ["dataConfig", "customProps", "settings", "context.settings"]
112
+ fallback: s,
113
+ props: n = ["dataConfig", "customProps", "settings", "parent.settings"]
64
114
  } = e;
65
- for (const n of s) {
66
- const o = n !== "customProps" ? "camel" : "kebab", r = Me.call(this, n, t, o);
67
- if (r !== void 0)
68
- return r;
69
- }
70
- if (i !== void 0)
71
- return i;
72
- throw new Error(`${this.context.module} setting does not exist: ${t}`);
73
- }
74
- async function C(t, ...e) {
75
- t in this && typeof this[t] == "function" && await this[t](...e);
76
- }
77
- function St(t, e, i, s, n = 0) {
78
- return new Promise((o) => {
79
- t.classList.remove(e), t.classList.add(i), setTimeout(() => {
80
- t.classList.add(s), t.classList.remove(i), o(t);
81
- }, ae(n));
82
- });
115
+ for (const i of n) {
116
+ const r = i !== "customProps" ? "camel" : "kebab", o = He.call(this, i, t, r);
117
+ if (o !== void 0)
118
+ return o;
119
+ }
120
+ if (s !== void 0)
121
+ return s;
122
+ throw new Error(`${this.parent.module} setting does not exist: ${t}`);
83
123
  }
84
- function Fe(t, e) {
85
- e && document.querySelectorAll(e).forEach((s) => {
86
- t ? s.style.overflow = "hidden" : s.style.removeProperty("overflow");
124
+ function Ne(t, e) {
125
+ e && document.querySelectorAll(e).forEach((n) => {
126
+ t ? n.style.overflow = "hidden" : n.style.removeProperty("overflow");
87
127
  });
88
128
  }
89
- function Ie(t, e) {
90
- e && document.querySelectorAll(e).forEach((s) => {
91
- t ? (s.inert = !0, s.setAttribute("aria-hidden", !0)) : (s.inert = null, s.removeAttribute("aria-hidden"));
129
+ function Be(t, e) {
130
+ e && document.querySelectorAll(e).forEach((n) => {
131
+ t ? (n.inert = !0, n.setAttribute("aria-hidden", "true")) : (n.inert = !1, n.removeAttribute("aria-hidden"));
92
132
  });
93
133
  }
94
- function Et(t, e, i) {
95
- Ie(!!t, e), Fe(!!t, i);
134
+ function bt(t, e, s) {
135
+ Be(!!t, e), Ne(!!t, s);
136
+ }
137
+ const ue = {
138
+ on(t, e, ...s) {
139
+ this.events[t] || (this.events[t] = []), this.events[t].some(
140
+ (i) => i.listener === e
141
+ ) || this.events[t].push({ listener: e, args: s });
142
+ },
143
+ off(t, e) {
144
+ this.events[t] && (this.events[t] = this.events[t].filter(
145
+ (s) => s.listener !== e
146
+ ));
147
+ },
148
+ async emit(t, e) {
149
+ if (t = t.startsWith("on") ? t.slice(2, 3).toLowerCase() + t.slice(3) : t, !!this.events[t])
150
+ for (const { listener: s, args: n } of this.events[t])
151
+ await s(e, ...n);
152
+ }
153
+ };
154
+ class de extends Array {
155
+ constructor(e = null) {
156
+ super(), this.el = e, this.el && this.set();
157
+ }
158
+ get first() {
159
+ return this[0];
160
+ }
161
+ get last() {
162
+ return this[this.length - 1];
163
+ }
164
+ set(e = this.el) {
165
+ this.length = 0, this.push(...e.querySelectorAll(se.join(",")));
166
+ }
167
+ clear() {
168
+ this.length = 0;
169
+ }
96
170
  }
97
- var P;
98
- class ge {
99
- constructor(e, i) {
100
- $(this, P);
101
- this.value = e, E(this, P, i), this.mql = null;
171
+ class he {
172
+ constructor(e = null) {
173
+ this.el = e, this.focusable = new de(), this.handleFocusTrap = Ue.bind(this);
102
174
  }
103
- get handler() {
104
- return w(this, P);
175
+ on(e = this.el) {
176
+ this.focusable.set(e), this.focusable.length ? document.addEventListener("keydown", this.handleFocusTrap) : document.addEventListener("keydown", Gt);
105
177
  }
106
- // Unmount existing handler before setting a new one.
107
- set handler(e) {
108
- this.mql && this.mql.removeEventListener("change", w(this, P)), E(this, P, e);
178
+ off() {
179
+ this.focusable.clear(), document.removeEventListener("keydown", this.handleFocusTrap), document.removeEventListener("keydown", Gt);
109
180
  }
110
- mount(e, i) {
111
- return e && (this.value = e), i && E(this, P, i), this.value ? (this.mql = window.matchMedia(`(min-width: ${this.value})`), this.mql.addEventListener("change", w(this, P)), w(this, P).call(this, this.mql), this) : this;
181
+ }
182
+ function Gt(t) {
183
+ (t.key === "Tab" || t.keyCode === 9) && t.preventDefault();
184
+ }
185
+ function Ue(t) {
186
+ if (t.key !== "Tab" && t.keyCode !== 9) return;
187
+ const { activeElement: e } = document, { el: s, focusable: n } = this, i = t.shiftKey, r = e === n.first || e === s, o = e === n.last || e === s;
188
+ (i && r || !i && o) && (t.preventDefault(), (i ? n.last : n.first).focus());
189
+ }
190
+ function Vt(t, e = !0) {
191
+ const s = localStorage.getItem(t), n = s ? JSON.parse(s) : {};
192
+ return {
193
+ get(i, r = void 0) {
194
+ return i ? i in n ? n[i] : r : n;
195
+ },
196
+ set(i, r) {
197
+ return r ? n[i] = r : delete n[i], e && localStorage.setItem(t, JSON.stringify(n)), n;
198
+ }
199
+ };
200
+ }
201
+ class ge extends Array {
202
+ constructor(e = {}) {
203
+ super(), this.presets = e;
204
+ }
205
+ applySettings(e) {
206
+ var r;
207
+ const s = (e == null ? void 0 : e.defaults) || {}, n = ((r = this.presets) == null ? void 0 : r[e.name]) || {}, i = (e == null ? void 0 : e.options) || {};
208
+ e.settings = { ...s, ...n, ...i };
209
+ }
210
+ validate(e) {
211
+ return !("name" in e) || typeof e.name != "string" ? (console.error("Plugin requires a name!"), !1) : !0;
212
+ }
213
+ get(e) {
214
+ return this.find((s) => s.name === e);
215
+ }
216
+ add(e) {
217
+ if (Array.isArray(e))
218
+ e.forEach((s) => this.add(s));
219
+ else if (this.applySettings(e), this.validate(e)) {
220
+ const s = this.findIndex((n) => n.name === e.name);
221
+ ~s ? this[s] = e : this.push(e);
222
+ }
112
223
  }
113
- unmount() {
114
- return this.mql ? (this.mql.removeEventListener("change", w(this, P)), this.value = null, E(this, P, null), this.mql = null, this) : this;
224
+ remove(e) {
225
+ const s = this.findIndex((n) => n.name === e);
226
+ ~s && this.splice(s, 1);
115
227
  }
116
228
  }
117
- P = new WeakMap();
118
- class Rt {
229
+ class me extends Array {
119
230
  constructor(e = {}) {
120
- this.module = this.constructor.name, this.collection = [], this.settings = Object.assign({
121
- dataConfig: "config",
122
- customProps: [],
123
- teleport: null,
124
- teleportMethod: "append"
125
- }, e);
231
+ super(), this.settings = e;
126
232
  }
127
- get(e, i = "id") {
128
- return this.collection.find((s) => s[i] === e);
233
+ get copy() {
234
+ return [...this];
129
235
  }
130
- applySettings(e) {
131
- return Object.assign(this.settings, e);
236
+ get top() {
237
+ const e = this[this.length - 1];
238
+ return e || null;
132
239
  }
133
- async createEntry(e, i) {
134
- return new Ct(this, e, i);
240
+ updateIndex() {
241
+ this.forEach((e, s) => {
242
+ e.el.style.zIndex = null;
243
+ const n = getComputedStyle(e.el)["z-index"];
244
+ e.el.style.zIndex = parseInt(n) + s + 1;
245
+ });
135
246
  }
136
- async register(e, i = {}) {
137
- await this.deregister((e == null ? void 0 : e.id) || e, !0);
138
- const s = await this.createEntry(e, i);
139
- return await s.mount(), await C.call(this, "beforeRegister", s), await C.call(s, "beforeRegister"), this.collection.push(s), await C.call(s, "afterRegister"), await C.call(this, "afterRegister", s), s;
247
+ onChange() {
248
+ this.updateIndex(), typeof this.settings.onChange == "function" && this.settings.onChange();
140
249
  }
141
- async deregister(e, i = !1) {
142
- const s = this.collection.findIndex((n) => n.id === e);
143
- if (~s) {
144
- const n = this.collection[s];
145
- await n.unmount(i), await C.call(this, "beforeDeregister", n), await C.call(n, "beforeDeregister", i), Object.getOwnPropertyNames(n).forEach((o) => {
146
- o != "beforeDeregister" && o != "afterDeregister" && delete n[o];
147
- }), this.collection.splice(s, 1), await C.call(n, "afterDeregister", i), await C.call(this, "afterDeregister", n);
250
+ add(e) {
251
+ this.push(e), this.onChange();
252
+ }
253
+ remove(e) {
254
+ const s = this.findIndex((n) => n.id === e.id);
255
+ ~s && (e.el.style.zIndex = null, this.splice(s, 1), this.onChange());
256
+ }
257
+ moveToTop(e) {
258
+ const s = this.findIndex((n) => n.id === e.id);
259
+ ~s && (this.splice(s, 1), this.add(e));
260
+ }
261
+ }
262
+ const Ve = {
263
+ condition: !0
264
+ }, _e = {
265
+ primary: "hsl(152deg 60% 50%)",
266
+ secondary: "hsl(214deg 50% 50%)",
267
+ neutral: "hsl(214deg 20% 50%)",
268
+ important: "hsl(0deg 80% 50%)"
269
+ };
270
+ function We(t = {}) {
271
+ const e = {
272
+ name: "debug",
273
+ defaults: Ve,
274
+ options: t
275
+ };
276
+ function s(o, l = [], a = ["primary", "secondary"]) {
277
+ const c = a.map((d) => `color: ${_e[d]}`);
278
+ console.log(`%c📡 DEBUG: %c${o}`, ...c, ...l);
279
+ }
280
+ function n(o, ...l) {
281
+ return typeof o == "function" ? o(...l) : o;
282
+ }
283
+ const i = {
284
+ beforeMountRef: s.bind(null, "Event > beforeMount()"),
285
+ afterMountRef: s.bind(null, "Event > afterMount()"),
286
+ beforeUnmountRef: s.bind(
287
+ null,
288
+ "Event > beforeUnmount()",
289
+ [],
290
+ ["important", "neutral"]
291
+ ),
292
+ afterUnmountRef: s.bind(
293
+ null,
294
+ "Event > afterUnmount()",
295
+ [],
296
+ ["important", "neutral"]
297
+ ),
298
+ createEntryRef: (o, { parent: l, plugin: a }) => {
299
+ if (n(a.settings.condition, o)) {
300
+ const c = l.collection.length;
301
+ s(`Event > createEntry() > [${c}] #${o.id}`);
302
+ }
303
+ },
304
+ registerEntryRef: (o, { parent: l, plugin: a }) => {
305
+ if (n(a.settings.condition, o)) {
306
+ const c = l.collection.length;
307
+ s(`Event > registerEntry() > [${c}] #${o.id}`);
308
+ }
309
+ },
310
+ destroyEntryRef: (o, { parent: l, plugin: a }) => {
311
+ if (n(a.settings.condition, o)) {
312
+ const c = l.collection.length;
313
+ s(
314
+ `Event > destroyEntry() > [${c}] #${o.id}`,
315
+ [],
316
+ ["important", "neutral"]
317
+ );
318
+ }
319
+ },
320
+ deregisterEntryRef: (o, { parent: l, plugin: a }) => {
321
+ if (n(a.settings.condition, o)) {
322
+ const c = l.collection.length;
323
+ s(
324
+ `Event > deregisterEntry() > [${c}] #${o.id}`,
325
+ [],
326
+ ["important", "neutral"]
327
+ );
328
+ }
148
329
  }
149
- return this.collection;
330
+ };
331
+ return { ...e, ...{
332
+ // Plugin setup/teardown methods
333
+ setup({ parent: o }) {
334
+ s("Plugin > setup()", arguments, ["secondary", "neutral"]), o.on("beforeMount", i.beforeMountRef), o.on("createEntry", i.createEntryRef, { parent: o, plugin: this }), o.on("registerEntry", i.registerEntryRef, {
335
+ parent: o,
336
+ plugin: this
337
+ }), o.on("afterMount", i.afterMountRef), o.on("beforeUnmount", i.beforeUnmountRef), o.on("destroyEntry", i.destroyEntryRef, { parent: o, plugin: this }), o.on("deregisterEntry", i.deregisterEntryRef, {
338
+ parent: o,
339
+ plugin: this
340
+ }), o.on("afterUnmount", i.afterUnmountRef);
341
+ },
342
+ teardown({ parent: o }) {
343
+ s("Plugin > teardown()", arguments, ["secondary", "neutral"]), o.off("beforeMount", i.beforeMountRef), o.off("createEntry", i.createEntryRef), o.off("registerEntry", i.registerEntryRef), o.off("afterMount", i.afterMountRef), o.off("beforeUnmount", i.beforeUnmountRef), o.off("destroyEntry", i.destroyEntryRef), o.off("deregisterEntry", i.deregisterEntryRef), o.off("afterUnmount", i.afterUnmountRef);
344
+ },
345
+ // Mount lifecycle hooks
346
+ beforeMount() {
347
+ s("Hook > beforeMount()", arguments);
348
+ },
349
+ onCreateEntry({ parent: o, entry: l }) {
350
+ if (n(this.settings.condition, l)) {
351
+ const a = o.collection.length;
352
+ s(`Hook > onCreateEntry() > [${a}] #${l.id}`, arguments);
353
+ }
354
+ },
355
+ onRegisterEntry({ parent: o, entry: l }) {
356
+ if (n(this.settings.condition, l)) {
357
+ const a = o.collection.length - 1;
358
+ s(`Hook > onRegisterEntry() > [${a}] #${l.id}`, arguments);
359
+ }
360
+ },
361
+ afterMount() {
362
+ s("Hook > afterMount()", arguments);
363
+ },
364
+ // Unmount lifecycle hooks
365
+ beforeUnmount() {
366
+ s("Hook > beforeUnmount()", arguments, ["important", "neutral"]);
367
+ },
368
+ onDestroyEntry({ parent: o, entry: l }) {
369
+ if (n(this.settings.condition, l)) {
370
+ const a = o.collection.length - 1;
371
+ s(`Hook > onDestroyEntry() > [${a}] #${l.id}`, arguments, [
372
+ "important",
373
+ "neutral"
374
+ ]);
375
+ }
376
+ },
377
+ onDeregisterEntry({ parent: o, entry: l }) {
378
+ if (n(this.settings.condition, l)) {
379
+ const a = o.collection.length;
380
+ s(`Hook > onDeregisterEntry() > [${a}] #${l.id}`, arguments, [
381
+ "important",
382
+ "neutral"
383
+ ]);
384
+ }
385
+ },
386
+ afterUnmount() {
387
+ s("Hook > afterUnmount()", arguments, ["important", "neutral"]);
388
+ }
389
+ } };
390
+ }
391
+ const ze = {
392
+ condition: !0
393
+ };
394
+ function Qe(t = {}) {
395
+ const e = {
396
+ name: "focusTrap",
397
+ defaults: ze,
398
+ options: t
399
+ }, s = {
400
+ setup({ parent: o }) {
401
+ o.on("opened", i, this), o.on("closed", r, this);
402
+ },
403
+ teardown({ parent: o }) {
404
+ o.off("opened", i), o.off("closed", r);
405
+ },
406
+ onCreateEntry({ entry: o }) {
407
+ o.focusTrap = new he();
408
+ }
409
+ };
410
+ function n(o, ...l) {
411
+ return typeof o == "function" ? o(...l) : o;
412
+ }
413
+ function i(o, l) {
414
+ var c;
415
+ const a = { plugin: l, parent: o.parent, entry: o };
416
+ n(l.settings.condition, a) && ((c = o.focusTrap) == null || c.on(o.dialog));
417
+ }
418
+ function r(o, l) {
419
+ var c;
420
+ const a = { plugin: l, parent: o.parent, entry: o };
421
+ n(l.settings.condition, a) && ((c = o.focusTrap) == null || c.off());
422
+ }
423
+ return { ...e, ...s };
424
+ }
425
+ const Ke = {
426
+ // The data attributes to get the breakpoint values from.
427
+ dataBreakpoint: "breakpoint",
428
+ // The data attributes to get the media query value from.
429
+ dataMediaQuery: "media-query",
430
+ // The string token to replace in the media query string.
431
+ token: "{{BP}}",
432
+ // Sets a global breakpoint. Can be overridden by setting a data attribute
433
+ // value. Notice: setting this option will enable a media query breakpoint on
434
+ // all entries.
435
+ breakpoint: null,
436
+ // The default media query string to use. Can be overridden by setting a data
437
+ // attribute value.
438
+ mediaQuery: "(min-width: {{BP}})",
439
+ // Maps entry ID or breakpoint key to breakpoint values. This is referenced
440
+ // when getting an entries breakpoint value.
441
+ breakpoints: {},
442
+ // Maps entry ID's to a media query strings. Media query may contain a token.
443
+ // This is referenced when getting an entries media query string.
444
+ mediaQueries: {},
445
+ // The function to run when the MediaQueryList triggers a "change" event.
446
+ // This is run once on initial mount.
447
+ onChange: () => {
150
448
  }
151
- async mount(e = {}) {
152
- this.applySettings(e), await C.call(this, "beforeMount");
153
- const i = document.querySelectorAll(this.settings.selector);
154
- for (const s of i)
155
- await this.register(s);
156
- return await C.call(this, "afterMount"), this;
449
+ };
450
+ function je(t = {}) {
451
+ const e = {
452
+ name: "mediaQuery",
453
+ defaults: Ke,
454
+ options: t
455
+ }, s = {
456
+ onCreateEntry({ entry: l }) {
457
+ r.call(this, l);
458
+ },
459
+ onDestroyEntry({ entry: l }) {
460
+ o(l);
461
+ }
462
+ };
463
+ function n(l) {
464
+ const a = l.el.getAttribute(`data-${this.settings.dataMediaQuery}`);
465
+ return !a && l.id in this.settings.mediaQueries ? this.settings.mediaQueries[l.id] : a;
466
+ }
467
+ function i(l) {
468
+ let a = l.el.getAttribute(`data-${this.settings.dataBreakpoint}`);
469
+ return !a && l.id in this.settings.breakpoints && (a = this.settings.breakpoints[l.id]), a && a in this.settings.breakpoints && (a = this.settings.breakpoints[a]), a && (a = getComputedStyle(document.body).getPropertyValue(`--${kt()}breakpoint-${a}`).trim() || a), a || this.settings.breakpoint;
470
+ }
471
+ function r(l) {
472
+ let a = n.call(this, l);
473
+ const c = i.call(this, l);
474
+ if (!c && !a) return;
475
+ c && !a && (a = this.settings.mediaQuery);
476
+ const d = a.replace(new RegExp(`${this.settings.token}`, "g"), c);
477
+ l.mql = window.matchMedia(d), l.mql.onchange = (f) => {
478
+ this.settings.onChange(f, l);
479
+ }, this.settings.onChange(l.mql, l);
480
+ }
481
+ function o(l) {
482
+ l.mql && (l.mql.onchange = null, l.mql = null);
483
+ }
484
+ return { ...e, ...s };
485
+ }
486
+ const Ye = {
487
+ // The property on entry objects to watch.
488
+ prop: "state",
489
+ // The default value or a function to compute the initial value.
490
+ value: null,
491
+ // The local storage key prefix.
492
+ keyPrefix: "VB:",
493
+ // The local storage key to use. If not provided, module name and prop value
494
+ // will be used e.g., "VB:ModalState".
495
+ key: null,
496
+ // Condition to determine whether or not to store the value in local storage.
497
+ condition: !1,
498
+ // The function to run whenever the value changes.
499
+ onChange() {
157
500
  }
158
- async unmount() {
159
- for (await C.call(this, "beforeUnmount"); this.collection.length > 0; )
160
- await this.deregister(this.collection[0].id);
161
- return await C.call(this, "afterUnmount"), this;
501
+ };
502
+ function Je(t = {}) {
503
+ const e = {
504
+ name: "propStore",
505
+ defaults: Ye,
506
+ options: t,
507
+ store: null
508
+ }, s = {
509
+ setup({ parent: l }) {
510
+ this.store = Vt(o.call(this, l.module));
511
+ },
512
+ async onCreateEntry({ entry: l }) {
513
+ await n.call(this, l);
514
+ },
515
+ onDestroyEntry({ entry: l }) {
516
+ r.call(this, l);
517
+ }
518
+ };
519
+ async function n(l) {
520
+ let a = l[this.settings.prop] || null;
521
+ const c = { plugin: this, parent: l.parent, entry: l };
522
+ Object.defineProperty(l, this.settings.prop, {
523
+ configurable: !0,
524
+ get() {
525
+ return a;
526
+ },
527
+ set: async (d) => {
528
+ if (a === d) return;
529
+ const f = a;
530
+ a = d, i(
531
+ this.settings.condition,
532
+ c,
533
+ d,
534
+ f
535
+ ) && this.store.set(l.id, d), await this.settings.onChange(c, d, f);
536
+ }
537
+ }), Object.defineProperty(l, "store", {
538
+ configurable: !0,
539
+ get: () => this.store.get(l.id),
540
+ set: (d) => {
541
+ l[this.settings.prop] = d;
542
+ }
543
+ }), l[this.settings.prop] = await i(this.settings.value, c) || l[this.settings.prop];
544
+ }
545
+ function i(l, ...a) {
546
+ return typeof l == "function" ? l(...a) : l;
162
547
  }
548
+ async function r(l) {
549
+ const a = l[this.settings.prop];
550
+ delete l[this.settings.prop], l[this.settings.prop] = a, this.store.set(l.id, null);
551
+ }
552
+ function o(l) {
553
+ const a = this.settings.prop.charAt(0).toUpperCase() + this.settings.prop.slice(1), c = this.settings.key || l + a;
554
+ return this.settings.keyPrefix + c;
555
+ }
556
+ return { ...e, ...s };
163
557
  }
164
- class Ct {
165
- constructor(e, i, s = {}) {
166
- this.context = e, this.id = (i == null ? void 0 : i.id) || i, this.el = de(i), this.settings = Object.assign({}, s), this.dataConfig = {}, this.customProps = {}, this.returnRef = null;
558
+ const Xe = {
559
+ where: null,
560
+ how: "append"
561
+ };
562
+ function Ge(t = {}) {
563
+ const e = {
564
+ name: "teleport",
565
+ defaults: Xe,
566
+ options: t
567
+ }, s = {
568
+ onCreateEntry({ plugin: r, entry: o }) {
569
+ n(r, o);
570
+ },
571
+ onDestroyEntry({ plugin: r, entry: o }) {
572
+ i(r, o);
573
+ }
574
+ };
575
+ function n(r, o) {
576
+ o.teleport = () => {
577
+ typeof o.teleportReturn == "function" && o.teleportReturn(), o.teleportReturn = oe(
578
+ o.el,
579
+ o.getSetting("teleport", { fallback: r.settings.where }),
580
+ o.getSetting("teleportMethod", { fallback: r.settings.how })
581
+ );
582
+ }, o.teleport(), o.parent.emit("teleport", { plugin: r, parent, entry: o });
583
+ }
584
+ function i(r, o) {
585
+ typeof o.teleportReturn == "function" && o.teleportReturn(), o.parent.emit("teleportReturn", { plugin: r, parent, entry: o });
586
+ }
587
+ return { ...e, ...s };
588
+ }
589
+ const qe = {
590
+ dataConfig: "config",
591
+ customProps: []
592
+ };
593
+ class xt {
594
+ constructor(e, s, n = {}) {
595
+ this.parent = e, this.id = (s == null ? void 0 : s.id) || s, this.el = Bt(s), this.settings = { ...n }, this.dataConfig = {}, this.customProps = {};
167
596
  }
168
597
  applySettings(e) {
169
598
  return Object.assign(this.settings, e);
170
599
  }
171
- getDataConfig() {
172
- return Object.assign(this.dataConfig, fe(this.el, this.getSetting("dataConfig")));
600
+ getSetting(e, s) {
601
+ return fe.call(this, e, s);
173
602
  }
174
- getCustomProps() {
175
- return Object.assign(this.customProps, ue(this));
603
+ buildDataConfig() {
604
+ return Object.assign(
605
+ this.dataConfig,
606
+ ie(this.el, this.getSetting("dataConfig"))
607
+ );
176
608
  }
177
- getSetting(e, i = {}) {
178
- return he.call(this, e, i);
609
+ buildCustomProps() {
610
+ return Object.assign(this.customProps, ce(this));
179
611
  }
180
- async mount(e = {}) {
612
+ async init(e = {}) {
181
613
  if (this.el === null)
182
- throw new Error(`${this.context.module} element was not found with ID: "${this.id}"`);
183
- this.applySettings(e), this.getDataConfig(), this.getCustomProps(), await C.call(this, "beforeMount"), this.getSetting("teleport") && this.teleport(), await C.call(this, "afterMount");
184
- }
185
- async unmount(e = !1) {
186
- await C.call(this, "beforeUnmount", e), this.getSetting("teleport") && this.teleportReturn(), await C.call(this, "afterUnmount", e);
187
- }
188
- teleport(e = this.getSetting("teleport"), i = this.getSetting("teleportMethod")) {
189
- return this.returnRef ? (console.error("Element has already been teleported:", this.el), !1) : (this.returnRef = Vt(this.el, e, i), this.el);
190
- }
191
- teleportReturn() {
192
- return this.returnRef ? (this.returnRef = Vt(this.el, this.returnRef), this.el) : (console.error("No return reference found:", this.el), !1);
193
- }
194
- }
195
- var nt, G, J;
196
- class jt {
197
- constructor(e = null, i = "[data-focus]") {
198
- $(this, nt);
199
- $(this, G);
200
- $(this, J);
201
- this.el = e, this.selectorFocus = i, E(this, G, Be.bind(this)), E(this, J, Ve.bind(this));
202
- }
203
- get focusable() {
204
- return w(this, nt);
205
- }
206
- set focusable(e) {
207
- E(this, nt, e), w(this, nt).length ? (document.removeEventListener("keydown", w(this, J)), document.addEventListener("keydown", w(this, G))) : (document.removeEventListener("keydown", w(this, G)), document.addEventListener("keydown", w(this, J)));
208
- }
209
- get focusableFirst() {
210
- return this.focusable[0];
211
- }
212
- get focusableLast() {
213
- return this.focusable[this.focusable.length - 1];
214
- }
215
- mount(e, i) {
216
- e && (this.el = e), i && (this.selectorFocus = i), this.focusable = this.getFocusable(), this.focus();
217
- }
218
- unmount() {
219
- this.el = null, this.focusable = [], document.removeEventListener("keydown", w(this, G)), document.removeEventListener("keydown", w(this, J));
220
- }
221
- focus(e = this.el, i = this.selectorFocus) {
222
- (e.querySelector(i) || e).focus();
223
- }
224
- getFocusable(e = this.el) {
225
- const i = [], s = document.activeElement, n = e.scrollTop, o = Ne.join(",");
226
- return e.querySelectorAll(o).forEach((l) => {
227
- l.focus(), document.activeElement === l && i.push(l);
228
- }), e.scrollTop = n, s.focus(), i;
229
- }
230
- }
231
- nt = new WeakMap(), G = new WeakMap(), J = new WeakMap();
232
- const L = ":not([inert])", O = ':not([tabindex^="-"])', yt = ":not(:disabled)", Ne = [
233
- `a[href]${L}${O}`,
234
- `area[href]${L}${O}`,
235
- `input:not([type="hidden"]):not([type="radio"])${L}${O}${yt}`,
236
- `input[type="radio"]${L}${O}${yt}`,
237
- `select${L}${O}${yt}`,
238
- `textarea${L}${O}${yt}`,
239
- `button${L}${O}${yt}`,
240
- `details${L} > summary:first-of-type${O}`,
241
- `iframe${L}${O}`,
242
- `audio[controls]${L}${O}`,
243
- `video[controls]${L}${O}`,
244
- `[contenteditable]${L}${O}`,
245
- `[tabindex]${L}${O}`
246
- ];
247
- function Be(t) {
248
- (t.key === "Tab" || t.keyCode === 9) && (t.shiftKey ? (document.activeElement === this.focusableFirst || document.activeElement === this.el) && (t.preventDefault(), this.focusableLast.focus()) : (document.activeElement === this.focusableLast || document.activeElement === this.el) && (t.preventDefault(), this.focusableFirst.focus()));
249
- }
250
- function Ve(t) {
251
- (t.key === "Tab" || t.keyCode === 9) && t.preventDefault();
614
+ throw new Error(
615
+ `${this.parent.module} element was not found with ID: "${this.id}"`
616
+ );
617
+ this.applySettings(e), this.buildDataConfig(), this.buildCustomProps();
618
+ }
619
+ async destroy() {
620
+ Object.getOwnPropertyNames(this).forEach((e) => {
621
+ e !== "id" && delete this[e];
622
+ });
623
+ }
252
624
  }
253
- function Xt(t, e = !0) {
254
- const i = localStorage.getItem(t), s = i ? JSON.parse(i) : {};
255
- return {
256
- get(n) {
257
- return n ? s[n] : s;
258
- },
259
- set(n, o) {
260
- return o ? s[n] = o : delete s[n], e && localStorage.setItem(t, JSON.stringify(s)), s;
625
+ class Ot {
626
+ constructor(e = {}) {
627
+ this.module = this.constructor.name, this.collection = [], this.entryClass = xt, this.settings = { ...qe, ...e }, this.plugins = new ge(this.settings.presets), this.events = {}, Object.assign(this, ue);
628
+ }
629
+ get(e, s = "id") {
630
+ return this.collection.find((n) => n[s] === e);
631
+ }
632
+ applySettings(e) {
633
+ return Object.assign(this.settings, e);
634
+ }
635
+ async createEntry(e, s) {
636
+ const n = new this.entryClass(this, e, s);
637
+ return await Q(n, "init"), await V("onCreateEntry", this, n), n;
638
+ }
639
+ async destroyEntry(e) {
640
+ return await V("onDestroyEntry", this, e), await Q(e, "destroy"), e;
641
+ }
642
+ async register(e, s = {}) {
643
+ const n = Bt(e);
644
+ if (n === null)
645
+ throw new Error(
646
+ `${this.module} element was not found with ID: "${(e == null ? void 0 : e.id) || e}"`
647
+ );
648
+ const i = this.collection.findIndex((r) => r.id === n.id);
649
+ if (~i) {
650
+ const r = this.collection[i];
651
+ return r.el = n, typeof r.init == "function" && await r.init(s), r;
652
+ } else {
653
+ const r = await this.createEntry(n, s);
654
+ return this.collection.push(r), await V("onRegisterEntry", this, r), r;
261
655
  }
262
- };
263
- }
264
- function Vt(t, e, i) {
265
- const s = e.nodeType === Node.COMMENT_NODE, n = e.nodeType === Node.ELEMENT_NODE;
266
- if (e = s || n ? e : document.querySelector(e), s && (i = "after"), !e) throw new Error(`Not a valid teleport reference: '${e}'`);
267
- if (typeof e[i] != "function") throw new Error(`Not a valid teleport method: '${i}'`);
268
- let o = null;
269
- return s || (o = document.createComment("teleported #" + t.id), t.before(o)), e[i](t), s && e.remove(), o;
656
+ }
657
+ async deregister(e) {
658
+ const s = this.collection.findIndex((n) => n.id === e);
659
+ if (~s) {
660
+ const n = await this.destroyEntry(this.collection[s]);
661
+ return await V(
662
+ "onDeregisterEntry",
663
+ this,
664
+ this.collection[s]
665
+ ), this.collection.splice(s, 1), n;
666
+ }
667
+ return null;
668
+ }
669
+ async mount(e = {}) {
670
+ var n;
671
+ this.applySettings(e);
672
+ for (const i of ((n = this.settings) == null ? void 0 : n.plugins) || [])
673
+ this.plugins.add(i);
674
+ for (const i of this.plugins)
675
+ await Q(i, "setup", { plugin: i, parent: this });
676
+ await V("beforeMount", this);
677
+ const s = document.querySelectorAll(this.settings.selector);
678
+ for (const i of s)
679
+ await this.register(i);
680
+ return await V("afterMount", this), this;
681
+ }
682
+ async unmount() {
683
+ for (await V("beforeUnmount", this); this.collection.length > 0; )
684
+ await this.deregister(this.collection[0].id);
685
+ await V("afterUnmount", this);
686
+ for (const e of this.plugins)
687
+ await Q(e, "teardown", { plugin: e, parent: this });
688
+ for (const e of [...this.plugins])
689
+ this.plugins.remove(e.name);
690
+ return this;
691
+ }
270
692
  }
271
- function He(t) {
693
+ function Ze(t) {
272
694
  const e = {
273
- prefix: ce("prefix-themes", { fallback: "vb-theme-" }),
695
+ prefix: ae("prefix-themes", { fallback: "vb-theme-" }),
274
696
  themes: ["root", "light", "dark"],
275
697
  storeKey: "VB:Profile"
276
698
  };
277
- for (const [o] of Object.entries(e))
278
- t && t[o] && (e[o] = t[o]);
279
- const i = {
699
+ for (const [r] of Object.entries(e))
700
+ t && t[r] && (e[r] = t[r]);
701
+ const s = {
280
702
  onInit() {
281
703
  },
282
704
  onChange() {
283
705
  }
284
706
  };
285
- for (const [o] of Object.entries(i))
286
- t && t[o] && (i[o] = t[o]);
287
- const s = Xt(e.storeKey), n = {
288
- // Store our settings in the API.
707
+ for (const [r] of Object.entries(s))
708
+ t && t[r] && (s[r] = t[r]);
709
+ const n = Vt(e.storeKey), i = {
710
+ // Store our settings in the API
289
711
  settings: e,
290
- // Actions.
291
- add(o) {
292
- e.themes.push(o);
712
+ // Actions
713
+ add(r) {
714
+ e.themes.push(r);
293
715
  },
294
- remove(o) {
295
- const r = e.themes.indexOf(o);
296
- ~r && e.themes.splice(r, 1);
716
+ remove(r) {
717
+ const o = e.themes.indexOf(r);
718
+ ~o && e.themes.splice(o, 1);
297
719
  },
298
- callback(o) {
299
- i[o].call(this);
720
+ callback(r) {
721
+ s[r].call(this);
300
722
  },
301
- // Getters.
723
+ // Getters
302
724
  get class() {
303
725
  return `${e.prefix}${this.theme}`;
304
726
  },
305
727
  get classes() {
306
- return e.themes.map((o) => `${e.prefix}${o}`);
728
+ return e.themes.map((r) => `${e.prefix}${r}`);
307
729
  },
308
730
  get themes() {
309
731
  return e.themes;
310
732
  },
311
- // Setup the theme get and set methods.
733
+ // Setup the theme get and set methods
312
734
  get theme() {
313
- return s.get("theme") || "root";
735
+ return n.get("theme") || "root";
314
736
  },
315
- set theme(o) {
316
- e.themes.includes(o) ? this.theme != o && (s.set("theme", o), document.documentElement.classList.remove(...this.classes), document.documentElement.classList.add(`${e.prefix}${o}`), this.callback("onChange")) : console.error(`Not a valid theme value: "${o}"`);
737
+ set theme(r) {
738
+ e.themes.includes(r) ? this.theme != r && (n.set("theme", r), document.documentElement.classList.remove(...this.classes), document.documentElement.classList.add(`${e.prefix}${r}`), this.callback("onChange")) : console.error(`Not a valid theme value: "${r}"`);
317
739
  }
318
740
  };
319
- return n.callback("onInit"), n;
741
+ return i.callback("onInit"), i;
320
742
  }
321
- const qi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
743
+ const fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
322
744
  __proto__: null,
323
- Breakpoint: ge,
324
- Collection: Rt,
325
- CollectionEntry: Ct,
326
- FocusTrap: jt,
327
- cssVar: ce,
328
- getConfig: fe,
329
- getCustomProps: ue,
330
- getElement: de,
331
- getPrefix: Pt,
332
- getSetting: he,
333
- lifecycleHook: C,
334
- localStore: Xt,
335
- setGlobalState: Et,
336
- teleport: Vt,
337
- themeStore: He,
338
- toCamel: le,
339
- toKebab: Kt,
340
- toMilliseconds: ae,
341
- transition: St
342
- }, Symbol.toStringTag, { value: "Module" })), _e = {
745
+ Collection: Ot,
746
+ CollectionEntry: xt,
747
+ FocusTrap: he,
748
+ FocusableArray: de,
749
+ PluginsArray: ge,
750
+ StackArray: me,
751
+ cssVar: ae,
752
+ debug: We,
753
+ dispatchLifecycleHook: V,
754
+ eventEmitter: ue,
755
+ focusTrap: Qe,
756
+ focusableSelectors: se,
757
+ getCustomProps: ce,
758
+ getDataConfig: ie,
759
+ getElement: Bt,
760
+ getPrefix: kt,
761
+ getSetting: fe,
762
+ localStore: Vt,
763
+ maybeRunMethod: Q,
764
+ mediaQuery: je,
765
+ propStore: Je,
766
+ setGlobalState: bt,
767
+ teleport: Ge,
768
+ teleportElement: oe,
769
+ themeStore: Ze,
770
+ toCamel: re,
771
+ toKebab: Ut,
772
+ toMilliseconds: le,
773
+ transition: wt
774
+ }, Symbol.toStringTag, { value: "Module" })), tn = {
775
+ focusTrap: {
776
+ condition: ({ entry: t }) => t.state === "closed" || t.state === "opened" && t.mode === "modal"
777
+ },
778
+ mediaQuery: {
779
+ onChange(t, e) {
780
+ e.mode = t.matches ? "inline" : "modal";
781
+ }
782
+ },
783
+ propStore: {
784
+ prop: "inlineState",
785
+ value: ({ entry: t }) => t.store,
786
+ condition: ({ entry: t }) => ["opened", "closed", "indeterminate"].includes(t.state),
787
+ onChange: ({ entry: t }) => t.applyState()
788
+ }
789
+ }, en = {
790
+ // Plugin presets
791
+ presets: tn,
343
792
  // Data attributes
344
793
  dataOpen: "drawer-open",
345
794
  dataClose: "drawer-close",
346
795
  dataToggle: "drawer-toggle",
347
- dataBreakpoint: "drawer-breakpoint",
348
796
  // Selectors
349
797
  selector: ".drawer",
350
798
  selectorDialog: ".drawer__dialog",
@@ -360,139 +808,125 @@ const qi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
360
808
  // Classes
361
809
  classModal: "drawer_modal",
362
810
  // Feature toggles
363
- customProps: [
364
- "transition-duration"
365
- ],
811
+ customProps: ["transition-duration"],
366
812
  breakpoints: null,
367
813
  customEventPrefix: "drawer:",
368
- store: !0,
369
- storeKey: "VB:DrawerState",
370
814
  setTabindex: !0,
371
- teleport: null,
372
- teleportMethod: "prepend",
373
815
  transition: !0,
374
816
  transitionDuration: 300
375
817
  };
376
- function ze(t) {
377
- t.store === "opened" ? t.open(!1, !1) : t.store === "closed" ? t.close(!1, !1) : t.store === "indeterminate" ? t.state = "indeterminate" : t.el.classList.contains(t.getSetting("stateOpened")) ? t.open(!1, !1) : t.el.classList.contains(t.getSetting("stateClosed")) ? t.close(!1, !1) : t.state = "indeterminate";
378
- }
379
- async function We(t) {
380
- t.store === "opened" ? await t.open(!1, !1) : t.store === "closed" ? await t.close(!1, !1) : t.store === "indeterminate" ? t.state != "indeterminate" && (t.state = "indeterminate") : (t.state != t.inlineState && (t.state = t.inlineState), t.inlineState === "opened" ? await t.open(!1, !1) : t.inlineState === "closed" && await t.close(!1, !1));
381
- }
382
- function Ue(t) {
383
- const e = Pt(), i = t.getAttribute(`data-${this.settings.dataBreakpoint}`);
384
- return this.settings.breakpoints && this.settings.breakpoints[i] ? this.settings.breakpoints[i] : getComputedStyle(document.body).getPropertyValue(`--${e}breakpoint-${i}`).trim() ? getComputedStyle(document.body).getPropertyValue(`--${e}breakpoint-${i}`).trim() : i;
385
- }
386
- function it(t) {
387
- const e = typeof t == "string" ? this.get(t) : t;
388
- if (e)
389
- return e;
390
- throw new Error(`Drawer not found in collection with id of "${t.id || t}".`);
391
- }
392
- function me(t) {
393
- t.state === "opened" ? t.mode === "modal" ? this.focusTrap.mount(t.dialog, this.settings.selectorFocus) : this.focusTrap.focus(t.dialog, this.settings.selectorFocus) : (t.trigger && (t.trigger.focus(), t.trigger = null), this.focusTrap.unmount());
394
- }
395
- function Ke(t) {
818
+ function nn(t) {
396
819
  switch (t.mode) {
397
820
  case "inline":
398
- return je.call(this, t);
821
+ return sn.call(this, t);
399
822
  case "modal":
400
- return Xe.call(this, t);
823
+ return on.call(this, t);
401
824
  default:
402
825
  throw new Error(`"${t.mode}" is not a valid drawer mode.`);
403
826
  }
404
827
  }
405
- async function je(t) {
406
- return t.el.classList.remove(t.getSetting("classModal")), t.dialog.removeAttribute("aria-modal"), Et(!1, t.getSetting("selectorInert"), t.getSetting("selectorOverflow")), this.focusTrap.unmount(), await We(t), t.el.dispatchEvent(new CustomEvent(t.getSetting("customEventPrefix") + "switchMode", {
407
- detail: this,
408
- bubbles: !0
409
- })), t;
410
- }
411
- async function Xe(t) {
412
- return t.el.classList.add(t.getSetting("classModal")), t.dialog.setAttribute("aria-modal", "true"), await t.close(!1, !1), t.el.dispatchEvent(new CustomEvent(t.getSetting("customEventPrefix") + "switchMode", {
413
- detail: this,
414
- bubbles: !0
415
- })), t;
416
- }
417
- var ot, rt, lt;
418
- class Ye extends Ct {
419
- constructor(i, s, n = {}) {
420
- super(i, s, n);
421
- $(this, ot);
422
- $(this, rt);
423
- $(this, lt);
424
- this.dialog = null, this.trigger = null, E(this, lt, new ge()), E(this, ot, "indeterminate"), E(this, rt, "indeterminate"), this.inlineState = "indeterminate";
425
- }
426
- get breakpoint() {
427
- return Ue.call(this.context, this.el);
428
- }
429
- get store() {
430
- return this.context.store.get(this.id);
828
+ async function sn(t) {
829
+ return t.el.classList.remove(t.getSetting("classModal")), t.dialog.removeAttribute("aria-modal"), bt(
830
+ !1,
831
+ t.getSetting("selectorInert"),
832
+ t.getSetting("selectorOverflow")
833
+ ), t.applyState(), t.el.dispatchEvent(
834
+ new CustomEvent(t.getSetting("customEventPrefix") + "switchMode", {
835
+ detail: this,
836
+ bubbles: !0
837
+ })
838
+ ), await t.parent.emit("switchMode", t), t;
839
+ }
840
+ async function on(t) {
841
+ return t.el.classList.add(t.getSetting("classModal")), t.dialog.setAttribute("aria-modal", "true"), await t.close(!1, !1), t.el.dispatchEvent(
842
+ new CustomEvent(t.getSetting("customEventPrefix") + "switchMode", {
843
+ detail: this,
844
+ bubbles: !0
845
+ })
846
+ ), await t.parent.emit("switchMode", t), t;
847
+ }
848
+ var q;
849
+ class rn extends xt {
850
+ constructor(s, n, i = {}) {
851
+ super(s, n, i);
852
+ U(this, q);
853
+ this.dialog = null, this.trigger = null, this.state = null, this.inlineState = null, S(this, q, "indeterminate");
431
854
  }
432
855
  get mode() {
433
- return w(this, ot);
434
- }
435
- set mode(i) {
436
- E(this, ot, i), Ke.call(this.context, this);
437
- }
438
- get state() {
439
- return w(this, rt);
440
- }
441
- set state(i) {
442
- E(this, rt, i), this.mode === "inline" && i != "opening" && i != "closing" && (this.inlineState = i, this.getSetting("store") && this.context.store.set(this.id, i)), i === "indeterminate" && (this.el.classList.remove(this.getSetting("stateOpened")), this.el.classList.remove(this.getSetting("stateOpening")), this.el.classList.remove(this.getSetting("stateClosed")), this.el.classList.remove(this.getSetting("stateClosing")));
856
+ return E(this, q);
857
+ }
858
+ set mode(s) {
859
+ E(this, q) !== s && (S(this, q, s), nn.call(this.parent, this));
860
+ }
861
+ setState(s) {
862
+ this.state = s;
863
+ const n = ["opening", "closing"];
864
+ this.mode === "inline" && !n.includes(s) && (this.inlineState = s), s === "indeterminate" && (this.el.classList.remove(this.getSetting("stateOpened")), this.el.classList.remove(this.getSetting("stateOpening")), this.el.classList.remove(this.getSetting("stateClosed")), this.el.classList.remove(this.getSetting("stateClosing")));
865
+ }
866
+ async applyState() {
867
+ if (this.mode !== "modal") {
868
+ if (this.inlineState === "opened")
869
+ return await this.open(!1, !1);
870
+ if (this.inlineState === "closed")
871
+ return await this.close(!1, !1);
872
+ if (this.state === null) {
873
+ if (this.el.classList.contains(this.getSetting("stateOpened")))
874
+ return await this.open(!1, !1);
875
+ if (this.el.classList.contains(this.getSetting("stateClosed")))
876
+ return await this.close(!1, !1);
877
+ }
878
+ return this.setState("indeterminate");
879
+ }
443
880
  }
444
- async open(i, s) {
445
- return this.context.open(this, i, s);
881
+ async open(s, n) {
882
+ return this.parent.open(this, s, n);
446
883
  }
447
- async close(i, s) {
448
- return this.context.close(this, i, s);
884
+ async close(s, n) {
885
+ return this.parent.close(this, s, n);
449
886
  }
450
- async toggle(i, s) {
451
- return this.context.toggle(this, i, s);
887
+ async toggle(s, n) {
888
+ return this.parent.toggle(this, s, n);
452
889
  }
453
890
  async deregister() {
454
- return this.context.deregister(this.id);
455
- }
456
- mountBreakpoint() {
457
- const i = this.breakpoint, s = this.handleBreakpoint.bind(this);
458
- w(this, lt).mount(i, s);
459
- }
460
- unmountBreakpoint() {
461
- w(this, lt).unmount();
891
+ return this.parent.deregister(this.id);
462
892
  }
463
- handleBreakpoint(i) {
464
- const s = i.matches ? "inline" : "modal";
465
- this.mode != s && (this.mode = s);
893
+ async onCreateEntry() {
894
+ const s = this.el.querySelector(this.getSetting("selectorDialog"));
895
+ this.dialog = s || this.el, this.getSetting("setTabindex") && this.dialog.setAttribute("tabindex", "-1"), await this.applyState(), this.inlineState = this.state, this.mode = this.el.classList.contains(this.getSetting("classModal")) ? "modal" : "inline";
466
896
  }
467
- async beforeMount() {
468
- const i = this.el.querySelector(this.getSetting("selectorDialog"));
469
- this.dialog = i || this.el, this.getSetting("setTabindex") && this.dialog.setAttribute("tabindex", "-1"), ze(this), this.inlineState = this.state, this.mode = this.el.classList.contains(this.getSetting("classModal")) ? "modal" : "inline", this.breakpoint && this.mountBreakpoint();
470
- }
471
- async beforeUnmount(i = !0) {
472
- i && this.state === "opened" && await this.close(!1), this.context.store.set(this.id), this.unmountBreakpoint();
897
+ async onDestroyEntry() {
898
+ this.mode === "modal" && this.state === "opened" && await this.close(!1);
473
899
  }
474
900
  }
475
- ot = new WeakMap(), rt = new WeakMap(), lt = new WeakMap();
476
- async function Ge(t) {
901
+ q = new WeakMap();
902
+ function nt(t) {
903
+ const e = typeof t == "string" ? this.get(t) : t;
904
+ if (e)
905
+ return e;
906
+ throw new Error(
907
+ `Drawer not found in collection with id of "${t.id || t}".`
908
+ );
909
+ }
910
+ async function ln(t) {
477
911
  const e = t.target.closest(`
478
912
  [data-${this.settings.dataOpen}],
479
913
  [data-${this.settings.dataToggle}],
480
914
  [data-${this.settings.dataClose}]
481
915
  `);
482
916
  if (e) {
483
- t.preventDefault(), e.matches(`[data-${this.settings.dataToggle}]`) && e.getAttribute(`data-${this.settings.dataToggle}`).trim().split(" ").forEach((s) => {
484
- const n = it.call(this, s);
485
- return n.trigger = e, n.toggle();
486
- }), e.matches(`[data-${this.settings.dataOpen}]`) && e.getAttribute(`data-${this.settings.dataOpen}`).trim().split(" ").forEach((s) => {
487
- const n = it.call(this, s);
488
- return n.trigger = e, n.open();
489
- }), e.matches(`[data-${this.settings.dataClose}]`) && e.getAttribute(`data-${this.settings.dataClose}`).trim().split(" ").forEach((s) => {
490
- if (s) {
491
- const n = it.call(this, s);
492
- return n.trigger = e, n.close();
917
+ t.preventDefault(), e.matches(`[data-${this.settings.dataToggle}]`) && e.getAttribute(`data-${this.settings.dataToggle}`).trim().split(" ").forEach((n) => {
918
+ const i = nt.call(this, n);
919
+ return i.trigger = e, i.toggle();
920
+ }), e.matches(`[data-${this.settings.dataOpen}]`) && e.getAttribute(`data-${this.settings.dataOpen}`).trim().split(" ").forEach((n) => {
921
+ const i = nt.call(this, n);
922
+ return i.trigger = e, i.open();
923
+ }), e.matches(`[data-${this.settings.dataClose}]`) && e.getAttribute(`data-${this.settings.dataClose}`).trim().split(" ").forEach((n) => {
924
+ if (n) {
925
+ const i = nt.call(this, n);
926
+ return i.trigger = e, i.close();
493
927
  } else {
494
- const n = t.target.closest(this.settings.selector);
495
- if (n) return this.close(n.id);
928
+ const i = t.target.closest(this.settings.selector);
929
+ if (i) return this.close(i.id);
496
930
  }
497
931
  });
498
932
  return;
@@ -500,75 +934,87 @@ async function Ge(t) {
500
934
  if (this.activeModal && t.target.matches(this.settings.selectorScreen))
501
935
  return this.close(this.activeModal.id);
502
936
  }
503
- function Je(t) {
937
+ function an(t) {
504
938
  if (t.key === "Escape" && this.activeModal)
505
939
  return this.close(this.activeModal.id);
506
940
  }
507
- async function pe(t, e, i = !0) {
508
- const s = it.call(this, t);
509
- return (s.state === "closed" || s.state === "indeterminate") && (s.state = "opening", e ?? s.getSetting("transition") ? await St(
510
- s.el,
511
- s.getSetting("stateClosed"),
512
- s.getSetting("stateOpening"),
513
- s.getSetting("stateOpened"),
514
- s.getSetting("transitionDuration")
515
- ) : (s.el.classList.add(s.getSetting("stateOpened")), s.el.classList.remove(s.getSetting("stateClosed"))), s.state = "opened", s.mode === "modal" && Et(!0, s.getSetting("selectorInert"), s.getSetting("selectorOverflow")), i && me.call(this, s), s.el.dispatchEvent(new CustomEvent(s.getSetting("customEventPrefix") + "opened", {
516
- detail: this,
517
- bubbles: !0
518
- }))), s;
519
- }
520
- async function we(t, e, i = !0) {
521
- const s = it.call(this, t);
522
- return (s.state === "opened" || s.state === "indeterminate") && (s.state = "closing", document.activeElement.blur(), e ?? s.getSetting("transition") ? await St(
523
- s.el,
524
- s.getSetting("stateOpened"),
525
- s.getSetting("stateClosing"),
526
- s.getSetting("stateClosed"),
527
- s.getSetting("transitionDuration")
528
- ) : (s.el.classList.add(s.getSetting("stateClosed")), s.el.classList.remove(s.getSetting("stateOpened"))), s.state = "closed", s.mode === "modal" && Et(!1, s.getSetting("selectorInert"), s.getSetting("selectorOverflow")), i && me.call(this, s), s.el.dispatchEvent(new CustomEvent(s.getSetting("customEventPrefix") + "closed", {
529
- detail: this,
530
- bubbles: !0
531
- }))), s;
532
- }
533
- async function Ze(t, e, i) {
534
- const s = it.call(this, t);
535
- return s.state === "closed" ? pe.call(this, s, e, i) : we.call(this, s, e, i);
536
- }
537
- var at, ct;
538
- class ts extends Rt {
539
- constructor(i) {
540
- super({ ..._e, ...i });
541
- $(this, at);
542
- $(this, ct);
543
- this.focusTrap = new jt(), E(this, at, Ge.bind(this)), E(this, ct, Je.bind(this)), this.store = Xt(this.settings.storeKey, this.settings.store);
941
+ function pe(t) {
942
+ t.state === "opened" ? (t.dialog.querySelector(this.settings.selectorFocus) || t.dialog).focus() : t.trigger && (t.trigger.focus(), t.trigger = null);
943
+ }
944
+ async function ye(t, e, s = !0) {
945
+ const n = nt.call(this, t);
946
+ return (n.state === "closed" || n.state === "indeterminate" || n.state === null) && (n.setState("opening"), e ?? n.getSetting("transition") ? await wt(
947
+ n.el,
948
+ n.getSetting("stateClosed"),
949
+ n.getSetting("stateOpening"),
950
+ n.getSetting("stateOpened"),
951
+ n.getSetting("transitionDuration")
952
+ ) : (n.el.classList.add(n.getSetting("stateOpened")), n.el.classList.remove(n.getSetting("stateClosed"))), n.setState("opened"), n.mode === "modal" && bt(
953
+ !0,
954
+ n.getSetting("selectorInert"),
955
+ n.getSetting("selectorOverflow")
956
+ ), s && pe.call(this, n), n.el.dispatchEvent(
957
+ new CustomEvent(n.getSetting("customEventPrefix") + "opened", {
958
+ detail: this,
959
+ bubbles: !0
960
+ })
961
+ ), await n.parent.emit("opened", n)), n;
962
+ }
963
+ async function we(t, e, s = !0) {
964
+ const n = nt.call(this, t);
965
+ return (n.state === "opened" || n.state === "indeterminate" || n.state === null) && (n.setState("closing"), document.activeElement.blur(), e ?? n.getSetting("transition") ? await wt(
966
+ n.el,
967
+ n.getSetting("stateOpened"),
968
+ n.getSetting("stateClosing"),
969
+ n.getSetting("stateClosed"),
970
+ n.getSetting("transitionDuration")
971
+ ) : (n.el.classList.add(n.getSetting("stateClosed")), n.el.classList.remove(n.getSetting("stateOpened"))), n.setState("closed"), n.mode === "modal" && bt(
972
+ !1,
973
+ n.getSetting("selectorInert"),
974
+ n.getSetting("selectorOverflow")
975
+ ), s && pe.call(this, n), n.el.dispatchEvent(
976
+ new CustomEvent(n.getSetting("customEventPrefix") + "closed", {
977
+ detail: this,
978
+ bubbles: !0
979
+ })
980
+ ), await n.parent.emit("closed", n)), n;
981
+ }
982
+ async function cn(t, e, s) {
983
+ const n = nt.call(this, t);
984
+ return n.state === "closed" ? ye.call(this, n, e, s) : we.call(this, n, e, s);
985
+ }
986
+ var it, ot;
987
+ class us extends Ot {
988
+ constructor(s) {
989
+ super({ ...en, ...s });
990
+ U(this, it);
991
+ U(this, ot);
992
+ this.module = "Drawer", this.entryClass = rn, S(this, it, ln.bind(this)), S(this, ot, an.bind(this));
544
993
  }
545
994
  get activeModal() {
546
- return this.collection.find((i) => i.state === "opened" && i.mode === "modal");
547
- }
548
- async createEntry(i, s) {
549
- return new Ye(this, i, s);
995
+ return this.collection.find((s) => s.state === "opened" && s.mode === "modal");
550
996
  }
551
- async open(i, s, n) {
552
- return pe.call(this, i, s, n);
997
+ async open(s, n, i) {
998
+ return ye.call(this, s, n, i);
553
999
  }
554
- async close(i, s, n) {
555
- return we.call(this, i, s, n);
1000
+ async close(s, n, i) {
1001
+ return we.call(this, s, n, i);
556
1002
  }
557
- async toggle(i, s, n) {
558
- return Ze.call(this, i, s, n);
1003
+ async toggle(s, n, i) {
1004
+ return cn.call(this, s, n, i);
559
1005
  }
560
1006
  async afterMount() {
561
- document.addEventListener("click", w(this, at), !1), document.addEventListener("keydown", w(this, ct), !1);
1007
+ document.addEventListener("click", E(this, it), !1), document.addEventListener("keydown", E(this, ot), !1);
562
1008
  }
563
1009
  async beforeUnmount() {
564
1010
  this.trigger = null;
565
1011
  }
566
1012
  async afterUnmount() {
567
- document.removeEventListener("click", w(this, at), !1), document.removeEventListener("keydown", w(this, ct), !1);
1013
+ document.removeEventListener("click", E(this, it), !1), document.removeEventListener("keydown", E(this, ot), !1);
568
1014
  }
569
1015
  }
570
- at = new WeakMap(), ct = new WeakMap();
571
- const Qe = {
1016
+ it = new WeakMap(), ot = new WeakMap();
1017
+ const fn = {
572
1018
  // Data attributes
573
1019
  dataOpen: "modal-open",
574
1020
  dataClose: "modal-close",
@@ -587,56 +1033,51 @@ const Qe = {
587
1033
  stateClosing: "is-closing",
588
1034
  stateClosed: "is-closed",
589
1035
  // Feature settings
590
- customProps: [
591
- "transition-duration"
592
- ],
1036
+ customProps: ["transition-duration"],
593
1037
  customEventPrefix: "modal:",
594
1038
  setTabindex: !0,
595
- teleport: null,
596
- teleportMethod: "append",
597
1039
  transition: !0,
598
1040
  transitionDuration: 300
599
1041
  };
600
- class qe extends Ct {
601
- constructor(e, i, s = {}) {
602
- super(e, i, s), this.state = "closed", this.dialog = null;
1042
+ class un extends xt {
1043
+ constructor(e, s, n = {}) {
1044
+ super(e, s, n), this.state = "closed", this.dialog = null;
603
1045
  }
604
1046
  get isRequired() {
605
1047
  return this.dialog.matches(this.getSetting("selectorRequired"));
606
1048
  }
607
- async open(e, i) {
608
- return this.context.open(this, e, i);
1049
+ async open(e, s) {
1050
+ return this.parent.open(this, e, s);
609
1051
  }
610
- async close(e, i) {
611
- return this.context.close(this, e, i);
1052
+ async close(e, s) {
1053
+ return this.parent.close(this, e, s);
612
1054
  }
613
- async replace(e, i) {
614
- return this.context.replace(this, e, i);
1055
+ async replace(e, s) {
1056
+ return this.parent.replace(this, e, s);
615
1057
  }
616
1058
  async deregister() {
617
- return this.context.deregister(this.id);
1059
+ return this.parent.deregister(this.id);
618
1060
  }
619
- async beforeMount() {
1061
+ async onCreateEntry() {
620
1062
  const e = this.el.querySelector(this.getSetting("selectorDialog"));
621
1063
  this.dialog = e || this.el, this.dialog.setAttribute("aria-modal", "true"), this.dialog.hasAttribute("role") || this.dialog.setAttribute("role", "dialog"), this.getSetting("setTabindex") && this.dialog.setAttribute("tabindex", "-1");
622
1064
  }
623
- async afterRegister() {
1065
+ async onRegisterEntry() {
624
1066
  this.el.classList.contains(this.getSetting("stateOpened")) ? await this.open(!1) : (this.el.classList.remove(this.getSetting("stateOpening")), this.el.classList.remove(this.getSetting("stateClosing")), this.el.classList.add(this.getSetting("stateClosed")));
625
1067
  }
626
- async beforeUnmount(e = !1) {
627
- !e && this.state === "opened" ? await this.close(!1) : this.context.stack.remove(this);
1068
+ async onDestroyEntry() {
1069
+ this.state === "opened" && await this.close(!1);
628
1070
  }
629
1071
  }
630
- function xt(t) {
1072
+ function pt(t) {
631
1073
  const e = typeof t == "string" ? this.get(t) : this.get(t.id);
632
1074
  if (e)
633
1075
  return e;
634
- throw new Error(`Modal not found in collection with id of "${t.id || t}".`);
635
- }
636
- function Dt() {
637
- this.active ? this.focusTrap.mount(this.active.dialog, this.settings.selectorFocus) : (this.trigger && (this.trigger.focus(), this.trigger = null), this.focusTrap.unmount());
1076
+ throw new Error(
1077
+ `Modal not found in collection with id of "${t.id || t}".`
1078
+ );
638
1079
  }
639
- async function ti(t) {
1080
+ async function dn(t) {
640
1081
  const e = t.target.closest(`
641
1082
  [data-${this.settings.dataOpen}],
642
1083
  [data-${this.settings.dataReplace}],
@@ -644,136 +1085,115 @@ async function ti(t) {
644
1085
  `);
645
1086
  if (e) {
646
1087
  if (t.preventDefault(), e.matches(`[data-${this.settings.dataOpen}]`)) {
647
- const i = e.getAttribute(`data-${this.settings.dataOpen}`).trim(), s = xt.call(this, i);
648
- return t.target.closest(this.settings.selector) || (this.trigger = e), s.open();
1088
+ const s = e.getAttribute(`data-${this.settings.dataOpen}`).trim(), n = pt.call(this, s);
1089
+ return t.target.closest(this.settings.selector) || (this.trigger = e), n.open();
649
1090
  }
650
1091
  if (e.matches(`[data-${this.settings.dataReplace}]`)) {
651
- const i = e.getAttribute(`data-${this.settings.dataReplace}`).trim(), s = xt.call(this, i);
652
- return t.target.closest(this.settings.selector) || (this.trigger = e), s.replace();
1092
+ const s = e.getAttribute(`data-${this.settings.dataReplace}`).trim(), n = pt.call(this, s);
1093
+ return t.target.closest(this.settings.selector) || (this.trigger = e), n.replace();
653
1094
  }
654
1095
  if (e.matches(`[data-${this.settings.dataClose}]`)) {
655
- const i = e.getAttribute(`data-${this.settings.dataClose}`).trim();
656
- return i === "*" ? this.closeAll() : this.close(i);
1096
+ const s = e.getAttribute(`data-${this.settings.dataClose}`).trim();
1097
+ return s === "*" ? this.closeAll() : this.close(s);
657
1098
  }
658
1099
  }
659
1100
  if (this.active && t.target.matches(this.settings.selectorScreen) && !this.active.isRequired)
660
1101
  return this.close(this.active.id);
661
1102
  }
662
- function ei(t) {
1103
+ function hn(t) {
663
1104
  if (t.key === "Escape" && this.active && !this.active.dialog.matches(this.settings.selectorRequired))
664
1105
  return this.close();
665
1106
  }
666
- async function be(t, e = void 0, i = !0) {
667
- const s = xt.call(this, t);
668
- return this.stack.moveToTop(s), s.state === "closed" && (s.state = "opening", this.stack.add(s), e ?? s.getSetting("transition") ? await St(
669
- s.el,
670
- s.getSetting("stateClosed"),
671
- s.getSetting("stateOpening"),
672
- s.getSetting("stateOpened"),
673
- s.getSetting("transitionDuration")
674
- ) : (s.el.classList.add(s.getSetting("stateOpened")), s.el.classList.remove(s.getSetting("stateClosed"))), s.state = "opened"), i && Dt.call(this), s.el.dispatchEvent(new CustomEvent(s.getSetting("customEventPrefix") + "opened", {
675
- detail: this,
676
- bubbles: !0
677
- })), s;
678
- }
679
- async function ye(t, e, i = !0) {
680
- const s = t ? xt.call(this, t) : this.active;
681
- return s && s.state === "opened" && (s.state = "closing", document.activeElement.blur(), e ?? s.getSetting("transition") ? await St(
682
- s.el,
683
- s.getSetting("stateOpened"),
684
- s.getSetting("stateClosing"),
685
- s.getSetting("stateClosed"),
686
- s.getSetting("transitionDuration")
687
- ) : (s.el.classList.add(s.getSetting("stateClosed")), s.el.classList.remove(s.getSetting("stateOpened"))), this.stack.remove(s), s.state = "closed", i && Dt.call(this), s.el.dispatchEvent(new CustomEvent(s.getSetting("customEventPrefix") + "closed", {
688
- detail: this,
689
- bubbles: !0
690
- }))), s;
691
- }
692
- async function Ht(t, e) {
693
- const i = [];
694
- return await Promise.all(this.stack.value.map(async (s) => {
695
- t && t === s.id ? Promise.resolve() : i.push(await ye.call(this, s, e, !1)), s.trigger = null;
696
- })), i;
697
- }
698
- async function ii(t, e, i = !0) {
699
- const s = xt.call(this, t);
700
- let n, o;
701
- return s.state === "opened" ? (n = s, o = await Ht.call(this, s.id, e)) : (o = Ht.call(this, !1, e), n = be.call(this, s, e, !1), await Promise.all([n, o])), i && Dt.call(this), { opened: n, closed: o };
702
- }
703
- function si(t) {
704
- const e = [];
705
- return {
706
- get value() {
707
- return [...e];
708
- },
709
- get top() {
710
- const i = e[e.length - 1];
711
- return i || null;
712
- },
713
- updateIndex() {
714
- e.forEach((i, s) => {
715
- i.el.style.zIndex = null;
716
- const n = getComputedStyle(i.el)["z-index"];
717
- i.el.style.zIndex = parseInt(n) + s + 1;
718
- });
719
- },
720
- setGlobalState() {
721
- Et(this.top, t.selectorInert, t.selectorOverflow), this.updateIndex();
722
- },
723
- add(i) {
724
- i.el.style.zIndex = null;
725
- const s = getComputedStyle(i.el)["z-index"];
726
- i.el.style.zIndex = parseInt(s) + e.length + 1, e.push(i), this.setGlobalState();
727
- },
728
- remove(i) {
729
- const s = e.findIndex((n) => n.id === i.id);
730
- s >= 0 && (i.el.style.zIndex = null, e.splice(s, 1), this.setGlobalState());
731
- },
732
- moveToTop(i) {
733
- const s = e.findIndex((n) => n.id === i.id);
734
- s >= 0 && (e.splice(s, 1), this.add(i));
735
- }
736
- };
737
- }
738
- var ft, ut;
739
- class es extends Rt {
740
- constructor(i) {
741
- super({ ...Qe, ...i });
742
- $(this, ft);
743
- $(this, ut);
744
- this.trigger = null, this.focusTrap = new jt(), E(this, ft, ti.bind(this)), E(this, ut, ei.bind(this)), this.stack = si(this.settings);
1107
+ function Lt() {
1108
+ this.active ? (this.active.dialog.querySelector(this.settings.selectorFocus) || this.active.dialog).focus() : this.trigger && (this.trigger.focus(), this.trigger = null);
1109
+ }
1110
+ async function be(t, e = void 0, s = !0) {
1111
+ const n = pt.call(this, t);
1112
+ return this.stack.moveToTop(n), n.state === "closed" && (n.state = "opening", this.stack.add(n), e ?? n.getSetting("transition") ? await wt(
1113
+ n.el,
1114
+ n.getSetting("stateClosed"),
1115
+ n.getSetting("stateOpening"),
1116
+ n.getSetting("stateOpened"),
1117
+ n.getSetting("transitionDuration")
1118
+ ) : (n.el.classList.add(n.getSetting("stateOpened")), n.el.classList.remove(n.getSetting("stateClosed"))), n.state = "opened"), s && Lt.call(this), n.el.dispatchEvent(
1119
+ new CustomEvent(n.getSetting("customEventPrefix") + "opened", {
1120
+ detail: n,
1121
+ bubbles: !0
1122
+ })
1123
+ ), await n.parent.emit("opened", n), n;
1124
+ }
1125
+ async function xe(t, e, s = !0) {
1126
+ const n = t ? pt.call(this, t) : this.active;
1127
+ return n && n.state === "opened" && (n.state = "closing", document.activeElement.blur(), e ?? n.getSetting("transition") ? await wt(
1128
+ n.el,
1129
+ n.getSetting("stateOpened"),
1130
+ n.getSetting("stateClosing"),
1131
+ n.getSetting("stateClosed"),
1132
+ n.getSetting("transitionDuration")
1133
+ ) : (n.el.classList.add(n.getSetting("stateClosed")), n.el.classList.remove(n.getSetting("stateOpened"))), this.stack.remove(n), n.state = "closed", s && Lt.call(this), n.el.dispatchEvent(
1134
+ new CustomEvent(n.getSetting("customEventPrefix") + "closed", {
1135
+ detail: n,
1136
+ bubbles: !0
1137
+ })
1138
+ ), await n.parent.emit("closed", n)), n;
1139
+ }
1140
+ async function It(t, e) {
1141
+ const s = [];
1142
+ return await Promise.all(
1143
+ this.stack.copy.map(async (n) => {
1144
+ t && t === n.id || (s.push(await xe.call(this, n, e, !1)), n.trigger = null);
1145
+ })
1146
+ ), s;
1147
+ }
1148
+ async function gn(t, e, s = !0) {
1149
+ const n = pt.call(this, t);
1150
+ let i, r;
1151
+ return n.state === "opened" ? (i = n, r = await It.call(this, n.id, e)) : (r = It.call(this, !1, e), i = be.call(this, n, e, !1), await Promise.all([i, r])), s && Lt.call(this), { opened: i, closed: r };
1152
+ }
1153
+ var rt, lt;
1154
+ class ds extends Ot {
1155
+ constructor(s) {
1156
+ super({ ...fn, ...s });
1157
+ U(this, rt);
1158
+ U(this, lt);
1159
+ this.module = "Modal", this.entryClass = un, this.trigger = null, S(this, rt, dn.bind(this)), S(this, lt, hn.bind(this)), this.stack = new me({
1160
+ onChange: () => {
1161
+ bt(
1162
+ this.stack.top,
1163
+ this.settings.selectorInert,
1164
+ this.settings.selectorOverflow
1165
+ );
1166
+ }
1167
+ });
745
1168
  }
746
1169
  get active() {
747
1170
  return this.stack.top;
748
1171
  }
749
- async createEntry(i, s) {
750
- return new qe(this, i, s);
751
- }
752
- async open(i, s, n) {
753
- return be.call(this, i, s, n);
1172
+ async open(s, n, i) {
1173
+ return be.call(this, s, n, i);
754
1174
  }
755
- async close(i, s, n) {
756
- return ye.call(this, i, s, n);
1175
+ async close(s, n, i) {
1176
+ return xe.call(this, s, n, i);
757
1177
  }
758
- async replace(i, s, n) {
759
- return ii.call(this, i, s, n);
1178
+ async replace(s, n, i) {
1179
+ return gn.call(this, s, n, i);
760
1180
  }
761
- async closeAll(i = !1, s, n = !0) {
762
- const o = await Ht.call(this, i, s);
763
- return n && Dt.call(this), o;
1181
+ async closeAll(s = !1, n, i = !0) {
1182
+ const r = await It.call(this, s, n);
1183
+ return i && Lt.call(this), r;
764
1184
  }
765
1185
  async afterMount() {
766
- document.addEventListener("click", w(this, ft), !1), document.addEventListener("keydown", w(this, ut), !1);
1186
+ document.addEventListener("click", E(this, rt), !1), document.addEventListener("keydown", E(this, lt), !1);
767
1187
  }
768
1188
  async beforeUnmount() {
769
1189
  this.trigger = null;
770
1190
  }
771
1191
  async afterUnmount() {
772
- document.removeEventListener("click", w(this, ft), !1), document.removeEventListener("keydown", w(this, ut), !1);
1192
+ document.removeEventListener("click", E(this, rt), !1), document.removeEventListener("keydown", E(this, lt), !1);
773
1193
  }
774
1194
  }
775
- ft = new WeakMap(), ut = new WeakMap();
776
- const ni = {
1195
+ rt = new WeakMap(), lt = new WeakMap();
1196
+ const mn = {
777
1197
  // Selectors
778
1198
  selector: ".popover",
779
1199
  selectorTooltip: ".popover_tooltip",
@@ -790,62 +1210,60 @@ const ni = {
790
1210
  "arrow-padding",
791
1211
  "toggle-delay"
792
1212
  ],
1213
+ customEventPrefix: "popover:",
793
1214
  placement: "bottom",
794
1215
  event: "click",
795
1216
  offset: 0,
796
1217
  flipPadding: 0,
797
1218
  shiftPadding: 0,
798
1219
  arrowPadding: 0,
799
- toggleDelay: 0,
800
- // Feature settings
801
- teleport: null,
802
- teleportMethod: "append"
1220
+ toggleDelay: 0
803
1221
  };
804
- function ie(t, e, i) {
1222
+ function qt(t, e, s) {
805
1223
  Object.assign(t.style, {
806
1224
  left: e != null ? `${e}px` : "",
807
- top: i != null ? `${i}px` : ""
1225
+ top: s != null ? `${s}px` : ""
808
1226
  });
809
1227
  }
810
- function xe(t, e) {
811
- let i = t.getSetting("toggle-delay");
812
- typeof i == "string" && (i.indexOf(",") > -1 && (i = i.split(",")), i.indexOf(" ") > -1 && (i = i.split(" "))), Array.isArray(i) && (i = i[e]);
813
- const s = Number(i);
814
- if (Number.isNaN(s))
815
- throw new Error(`Provided delay value is not a number: "${i}"`);
816
- return s;
1228
+ function ve(t, e) {
1229
+ let s = t.getSetting("toggle-delay");
1230
+ typeof s == "string" && (s.indexOf(",") > -1 && (s = s.split(",")), s.indexOf(" ") > -1 && (s = s.split(" "))), Array.isArray(s) && (s = s[e]);
1231
+ const n = Number(s);
1232
+ if (Number.isNaN(n))
1233
+ throw new Error(`Provided delay value is not a number: "${s}"`);
1234
+ return n;
817
1235
  }
818
- function Nt(t) {
1236
+ function Mt(t) {
819
1237
  let e;
820
- const i = typeof t == "string" ? t.trim().split(" ") : [t];
821
- for (let s = 0; s < i.length; s++)
822
- i[s] = Number(i[s]);
823
- switch (i.length) {
1238
+ const s = typeof t == "string" ? t.trim().split(" ") : [t];
1239
+ for (let n = 0; n < s.length; n++)
1240
+ s[n] = Number(s[n]);
1241
+ switch (s.length) {
824
1242
  case 1:
825
- e = i[0];
1243
+ e = s[0];
826
1244
  break;
827
1245
  case 2:
828
1246
  e = {
829
- top: i[0],
830
- right: i[1],
831
- bottom: i[0],
832
- left: i[1]
1247
+ top: s[0],
1248
+ right: s[1],
1249
+ bottom: s[0],
1250
+ left: s[1]
833
1251
  };
834
1252
  break;
835
1253
  case 3:
836
1254
  e = {
837
- top: i[0],
838
- right: i[1],
839
- bottom: i[2],
840
- left: i[1]
1255
+ top: s[0],
1256
+ right: s[1],
1257
+ bottom: s[2],
1258
+ left: s[1]
841
1259
  };
842
1260
  break;
843
1261
  case 4:
844
1262
  e = {
845
- top: i[0],
846
- right: i[1],
847
- bottom: i[2],
848
- left: i[3]
1263
+ top: s[0],
1264
+ right: s[1],
1265
+ bottom: s[2],
1266
+ left: s[3]
849
1267
  };
850
1268
  break;
851
1269
  default:
@@ -854,99 +1272,109 @@ function Nt(t) {
854
1272
  }
855
1273
  return e;
856
1274
  }
857
- function oi(t) {
1275
+ function pn(t) {
858
1276
  return {
859
1277
  offset: Number(t.getSetting("offset")),
860
1278
  flip: {
861
- padding: Nt(t.getSetting("flip-padding"))
1279
+ padding: Mt(t.getSetting("flip-padding"))
862
1280
  },
863
1281
  shift: {
864
- padding: Nt(t.getSetting("shift-padding"))
1282
+ padding: Mt(t.getSetting("shift-padding"))
865
1283
  },
866
1284
  arrow: {
867
1285
  element: t.getSetting("selectorArrow"),
868
- padding: Nt(t.getSetting("arrow-padding"))
1286
+ padding: Mt(t.getSetting("arrow-padding"))
869
1287
  }
870
1288
  };
871
1289
  }
872
- function ve(t) {
1290
+ function Ee(t) {
873
1291
  const e = typeof t == "string" ? this.get(t) : this.get(t.id);
874
1292
  if (e)
875
1293
  return e;
876
1294
  throw new Error(`Popover not found in collection with id of "${t}".`);
877
1295
  }
878
1296
  async function Se(t) {
879
- const e = t ? ve.call(this, t) : await Ee.call(this);
880
- return e && e.state === "opened" && (e.el.inert = !0, e.el.classList.remove(this.settings.stateActive), e.isTooltip || e.trigger.setAttribute("aria-expanded", "false"), e.floatingCleanup(), e.state = "closed", e.trigger === this.trigger && (this.trigger = null)), e;
881
- }
882
- async function Ee() {
1297
+ const e = t ? Ee.call(this, t) : await Ce.call(this);
1298
+ return e && e.state === "opened" && (e.el.inert = !0, e.el.classList.remove(this.settings.stateActive), e.isTooltip || e.trigger.setAttribute("aria-expanded", "false"), e.floatingCleanup(), e.state = "closed", e.trigger === this.trigger && (this.trigger = null), e.el.dispatchEvent(
1299
+ new CustomEvent(e.getSetting("customEventPrefix") + "closed", {
1300
+ detail: this,
1301
+ bubbles: !0
1302
+ })
1303
+ ), await e.parent.emit("closed", e)), e;
1304
+ }
1305
+ async function Ce() {
883
1306
  const t = [];
884
- return await Promise.all(this.collection.map(async (e) => {
885
- e.state === "opened" && t.push(await Se.call(this, e));
886
- })), t;
1307
+ return await Promise.all(
1308
+ this.collection.map(async (e) => {
1309
+ e.state === "opened" && t.push(await Se.call(this, e));
1310
+ })
1311
+ ), t;
887
1312
  }
888
- function Ce(t) {
1313
+ function $e(t) {
889
1314
  t.state == "opened" && setTimeout(() => {
890
1315
  const e = t.el.matches(":hover") === t.el || t.trigger.matches(":hover") === t.trigger;
891
- let i = document.activeElement.closest(
1316
+ let s = document.activeElement.closest(
892
1317
  `#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`
893
1318
  );
894
- return i = i ? i.matches(":focus-visible") : !1, !e && !i && t.close(), t;
1319
+ return !e && !s && t.close(), t;
895
1320
  }, 1);
896
1321
  }
897
- function ri(t) {
1322
+ function yn(t) {
898
1323
  t.state === "opened" ? t.close() : (this.trigger = t.trigger, t.open());
899
1324
  }
900
- function li(t) {
1325
+ function wn(t) {
901
1326
  t.isTooltip && (t.toggleDelayId && clearTimeout(t.toggleDelayId), t.close());
902
1327
  }
903
- function ai(t, e) {
1328
+ function bn(t, e) {
904
1329
  if (t.isHovered = e, e.type == "focus" && !t.trigger.matches(":focus-visible"))
905
1330
  return;
906
1331
  t.toggleDelayId && clearTimeout(t.toggleDelayId);
907
- const i = t.trigger.getAttribute("aria-expanded");
908
- if (i && i == "true") return;
909
- const s = this.activeHover ? 0 : xe(t, 0);
1332
+ const s = t.trigger.getAttribute("aria-expanded");
1333
+ if (s && s == "true") return;
1334
+ const n = this.activeHover ? 0 : ve(t, 0);
910
1335
  this.activeHover && this.activeHover.close(), t.toggleDelayId = setTimeout(() => {
911
1336
  t.id && t.open();
912
- }, s);
1337
+ }, n);
913
1338
  }
914
- function ci(t, e) {
1339
+ function xn(t, e) {
915
1340
  setTimeout(() => {
916
- t.isHovered = e, !t.isHovered && (t.toggleDelayId && clearTimeout(t.toggleDelayId), t.toggleDelayId = setTimeout(() => {
917
- Ce.call(this, t);
918
- }, xe(t, 1)));
1341
+ t.isHovered = e, !t.isHovered && (t.toggleDelayId && clearTimeout(t.toggleDelayId), t.toggleDelayId = setTimeout(
1342
+ () => {
1343
+ $e.call(this, t);
1344
+ },
1345
+ ve(t, 1)
1346
+ ));
919
1347
  }, 1);
920
1348
  }
921
- function fi(t) {
1349
+ function vn(t) {
922
1350
  switch (t.key) {
923
1351
  case "Escape":
924
- this.trigger && this.trigger.focus(), Ee.call(this);
1352
+ this.trigger && this.trigger.focus(), Ce.call(this);
925
1353
  return;
926
1354
  case "Tab":
927
1355
  this.collection.forEach((e) => {
928
- Ce.call(this, e);
1356
+ $e.call(this, e);
929
1357
  });
930
1358
  return;
931
1359
  default:
932
1360
  return;
933
1361
  }
934
1362
  }
935
- function ui(t) {
1363
+ function En(t) {
936
1364
  const e = this;
937
- document.addEventListener("click", function i(s) {
938
- s.target.closest(
1365
+ document.addEventListener("click", function s(n) {
1366
+ n.target.closest(
939
1367
  `#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`
940
- ) ? t.el && !t.el.classList.contains(e.settings.stateActive) && this.removeEventListener("click", i) : (t.el && t.el.classList.contains(e.settings.stateActive) && t.close(), this.removeEventListener("click", i));
1368
+ ) ? t.el && !t.el.classList.contains(e.settings.stateActive) && this.removeEventListener("click", s) : (t.el && t.el.classList.contains(e.settings.stateActive) && t.close(), this.removeEventListener("click", s));
941
1369
  });
942
1370
  }
943
- var R, z;
944
- class di extends Ct {
945
- constructor(i, s, n = {}) {
946
- super(i, s, n);
947
- $(this, R);
948
- $(this, z);
949
- this.state = "closed", this.toggleDelayId = null, this.trigger = null, E(this, R, null), E(this, z, {
1371
+ var L, z;
1372
+ class Sn extends xt {
1373
+ constructor(s, n, i = {}) {
1374
+ super(s, n, i);
1375
+ U(this, L);
1376
+ U(this, z);
1377
+ this.state = "closed", this.toggleDelayId = null, this.trigger = null, S(this, L, null), S(this, z, {
950
1378
  el: !1,
951
1379
  trigger: !1
952
1380
  }), this.floatingCleanup = () => {
@@ -956,153 +1384,159 @@ class di extends Ct {
956
1384
  return !!this.el.closest(this.getSetting("selectorTooltip")) || this.el.getAttribute("role") == "tooltip";
957
1385
  }
958
1386
  get isHovered() {
959
- return w(this, z).el || w(this, z).trigger;
1387
+ return E(this, z).el || E(this, z).trigger;
960
1388
  }
961
- set isHovered(i) {
962
- const s = i.type == "mouseenter" ? !0 : i.type == "mouseleave" ? !1 : void 0;
963
- if (s != null)
964
- switch (i.target) {
1389
+ set isHovered(s) {
1390
+ const n = s.type == "mouseenter" ? !0 : s.type == "mouseleave" ? !1 : void 0;
1391
+ if (n != null)
1392
+ switch (s.target) {
965
1393
  case this.el:
966
- w(this, z).el = s;
1394
+ E(this, z).el = n;
967
1395
  break;
968
1396
  case this.trigger:
969
- w(this, z).trigger = s;
1397
+ E(this, z).trigger = n;
970
1398
  break;
971
1399
  }
972
1400
  }
973
1401
  async open() {
974
- return this.context.open(this);
1402
+ return this.parent.open(this);
975
1403
  }
976
1404
  async close() {
977
- return this.context.close(this);
1405
+ return this.parent.close(this);
978
1406
  }
979
1407
  async deregister() {
980
- return this.context.deregister(this.id);
1408
+ return this.parent.deregister(this.id);
981
1409
  }
982
1410
  registerEventListeners() {
983
- w(this, R) || (this.getSetting("event") === "hover" ? (E(this, R, [{
984
- el: ["el", "trigger"],
985
- type: ["mouseenter", "focus"],
986
- listener: ai.bind(this.context, this)
987
- }, {
988
- el: ["el", "trigger"],
989
- type: ["mouseleave", "focusout"],
990
- listener: ci.bind(this.context, this)
991
- }, {
992
- el: ["trigger"],
993
- type: ["click"],
994
- listener: li.bind(this.context, this)
995
- }]), w(this, R).forEach((s) => {
996
- s.el.forEach((n) => {
997
- s.type.forEach((o) => {
998
- this[n].addEventListener(o, s.listener, !1);
1411
+ E(this, L) || (this.getSetting("event") === "hover" ? (S(this, L, [
1412
+ {
1413
+ el: ["el", "trigger"],
1414
+ type: ["mouseenter", "focus"],
1415
+ listener: bn.bind(this.parent, this)
1416
+ },
1417
+ {
1418
+ el: ["el", "trigger"],
1419
+ type: ["mouseleave", "focusout"],
1420
+ listener: xn.bind(this.parent, this)
1421
+ },
1422
+ {
1423
+ el: ["trigger"],
1424
+ type: ["click"],
1425
+ listener: wn.bind(this.parent, this)
1426
+ }
1427
+ ]), E(this, L).forEach((n) => {
1428
+ n.el.forEach((i) => {
1429
+ n.type.forEach((r) => {
1430
+ this[i].addEventListener(r, n.listener, !1);
999
1431
  });
1000
1432
  });
1001
- })) : (E(this, R, [{
1002
- el: ["trigger"],
1003
- type: ["click"],
1004
- listener: ri.bind(this.context, this)
1005
- }]), w(this, R).forEach((s) => {
1006
- s.el.forEach((n) => {
1007
- s.type.forEach((o) => {
1008
- this[n].addEventListener(o, s.listener, !1);
1433
+ })) : (S(this, L, [
1434
+ {
1435
+ el: ["trigger"],
1436
+ type: ["click"],
1437
+ listener: yn.bind(this.parent, this)
1438
+ }
1439
+ ]), E(this, L).forEach((n) => {
1440
+ n.el.forEach((i) => {
1441
+ n.type.forEach((r) => {
1442
+ this[i].addEventListener(r, n.listener, !1);
1009
1443
  });
1010
1444
  });
1011
1445
  })));
1012
1446
  }
1013
1447
  deregisterEventListeners() {
1014
- w(this, R) && (w(this, R).forEach((i) => {
1015
- i.el.forEach((s) => {
1016
- i.type.forEach((n) => {
1017
- this[s].removeEventListener(n, i.listener, !1);
1448
+ E(this, L) && (E(this, L).forEach((s) => {
1449
+ s.el.forEach((n) => {
1450
+ s.type.forEach((i) => {
1451
+ this[n].removeEventListener(i, s.listener, !1);
1018
1452
  });
1019
1453
  });
1020
- }), E(this, R, null));
1454
+ }), S(this, L, null));
1021
1455
  }
1022
- async beforeMount() {
1456
+ async onCreateEntry() {
1023
1457
  this.trigger = document.querySelector(
1024
1458
  `[aria-controls="${this.id}"], [aria-describedby="${this.id}"]`
1025
1459
  ), this.isTooltip ? (this.settings.event = "hover", this.el.setAttribute("role", "tooltip")) : this.trigger.setAttribute("aria-expanded", "false"), this.registerEventListeners();
1026
1460
  }
1027
- async afterRegister() {
1461
+ async onRegisterEntry() {
1028
1462
  this.el.classList.contains(this.getSetting("stateActive")) ? await this.open() : this.el.inert = !0;
1029
1463
  }
1030
- async beforeUnmount() {
1464
+ async onDestroyEntry() {
1031
1465
  this.state === "opened" && await this.close(), this.floatingCleanup(), this.deregisterEventListeners();
1032
1466
  }
1033
1467
  }
1034
- R = new WeakMap(), z = new WeakMap();
1035
- const ht = Math.min, Z = Math.max, Lt = Math.round, kt = Math.floor, W = (t) => ({
1468
+ L = new WeakMap(), z = new WeakMap();
1469
+ const ct = Math.min, Z = Math.max, Ct = Math.round, St = Math.floor, I = (t) => ({
1036
1470
  x: t,
1037
1471
  y: t
1038
- }), hi = {
1472
+ }), Cn = {
1039
1473
  left: "right",
1040
1474
  right: "left",
1041
1475
  bottom: "top",
1042
1476
  top: "bottom"
1043
- }, gi = {
1477
+ }, $n = {
1044
1478
  start: "end",
1045
1479
  end: "start"
1046
1480
  };
1047
- function _t(t, e, i) {
1048
- return Z(t, ht(e, i));
1481
+ function Ft(t, e, s) {
1482
+ return Z(t, ct(e, s));
1049
1483
  }
1050
- function Q(t, e) {
1484
+ function tt(t, e) {
1051
1485
  return typeof t == "function" ? t(e) : t;
1052
1486
  }
1053
- function U(t) {
1487
+ function j(t) {
1054
1488
  return t.split("-")[0];
1055
1489
  }
1056
- function At(t) {
1490
+ function vt(t) {
1057
1491
  return t.split("-")[1];
1058
1492
  }
1059
- function Yt(t) {
1493
+ function _t(t) {
1060
1494
  return t === "x" ? "y" : "x";
1061
1495
  }
1062
- function Gt(t) {
1496
+ function Wt(t) {
1063
1497
  return t === "y" ? "height" : "width";
1064
1498
  }
1065
- function q(t) {
1066
- return ["top", "bottom"].includes(U(t)) ? "y" : "x";
1499
+ function K(t) {
1500
+ return ["top", "bottom"].includes(j(t)) ? "y" : "x";
1067
1501
  }
1068
- function Jt(t) {
1069
- return Yt(q(t));
1502
+ function zt(t) {
1503
+ return _t(K(t));
1070
1504
  }
1071
- function mi(t, e, i) {
1072
- i === void 0 && (i = !1);
1073
- const s = At(t), n = Jt(t), o = Gt(n);
1074
- let r = n === "x" ? s === (i ? "end" : "start") ? "right" : "left" : s === "start" ? "bottom" : "top";
1075
- return e.reference[o] > e.floating[o] && (r = Ot(r)), [r, Ot(r)];
1505
+ function An(t, e, s) {
1506
+ s === void 0 && (s = !1);
1507
+ const n = vt(t), i = zt(t), r = Wt(i);
1508
+ let o = i === "x" ? n === (s ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
1509
+ return e.reference[r] > e.floating[r] && (o = $t(o)), [o, $t(o)];
1076
1510
  }
1077
- function pi(t) {
1078
- const e = Ot(t);
1079
- return [zt(t), e, zt(e)];
1511
+ function kn(t) {
1512
+ const e = $t(t);
1513
+ return [Ht(t), e, Ht(e)];
1080
1514
  }
1081
- function zt(t) {
1082
- return t.replace(/start|end/g, (e) => gi[e]);
1515
+ function Ht(t) {
1516
+ return t.replace(/start|end/g, (e) => $n[e]);
1083
1517
  }
1084
- function wi(t, e, i) {
1085
- const s = ["left", "right"], n = ["right", "left"], o = ["top", "bottom"], r = ["bottom", "top"];
1518
+ function On(t, e, s) {
1519
+ const n = ["left", "right"], i = ["right", "left"], r = ["top", "bottom"], o = ["bottom", "top"];
1086
1520
  switch (t) {
1087
1521
  case "top":
1088
1522
  case "bottom":
1089
- return i ? e ? n : s : e ? s : n;
1523
+ return s ? e ? i : n : e ? n : i;
1090
1524
  case "left":
1091
1525
  case "right":
1092
- return e ? o : r;
1526
+ return e ? r : o;
1093
1527
  default:
1094
1528
  return [];
1095
1529
  }
1096
1530
  }
1097
- function bi(t, e, i, s) {
1098
- const n = At(t);
1099
- let o = wi(U(t), i === "start", s);
1100
- return n && (o = o.map((r) => r + "-" + n), e && (o = o.concat(o.map(zt)))), o;
1531
+ function Ln(t, e, s, n) {
1532
+ const i = vt(t);
1533
+ let r = On(j(t), s === "start", n);
1534
+ return i && (r = r.map((o) => o + "-" + i), e && (r = r.concat(r.map(Ht)))), r;
1101
1535
  }
1102
- function Ot(t) {
1103
- return t.replace(/left|right|bottom|top/g, (e) => hi[e]);
1536
+ function $t(t) {
1537
+ return t.replace(/left|right|bottom|top/g, (e) => Cn[e]);
1104
1538
  }
1105
- function yi(t) {
1539
+ function Rn(t) {
1106
1540
  return {
1107
1541
  top: 0,
1108
1542
  right: 0,
@@ -1112,292 +1546,296 @@ function yi(t) {
1112
1546
  };
1113
1547
  }
1114
1548
  function Ae(t) {
1115
- return typeof t != "number" ? yi(t) : {
1549
+ return typeof t != "number" ? Rn(t) : {
1116
1550
  top: t,
1117
1551
  right: t,
1118
1552
  bottom: t,
1119
1553
  left: t
1120
1554
  };
1121
1555
  }
1122
- function Tt(t) {
1556
+ function At(t) {
1123
1557
  const {
1124
1558
  x: e,
1125
- y: i,
1126
- width: s,
1127
- height: n
1559
+ y: s,
1560
+ width: n,
1561
+ height: i
1128
1562
  } = t;
1129
1563
  return {
1130
- width: s,
1131
- height: n,
1132
- top: i,
1564
+ width: n,
1565
+ height: i,
1566
+ top: s,
1133
1567
  left: e,
1134
- right: e + s,
1135
- bottom: i + n,
1568
+ right: e + n,
1569
+ bottom: s + i,
1136
1570
  x: e,
1137
- y: i
1571
+ y: s
1138
1572
  };
1139
1573
  }
1140
- function se(t, e, i) {
1574
+ function Zt(t, e, s) {
1141
1575
  let {
1142
- reference: s,
1143
- floating: n
1576
+ reference: n,
1577
+ floating: i
1144
1578
  } = t;
1145
- const o = q(e), r = Jt(e), l = Gt(r), a = U(e), c = o === "y", d = s.x + s.width / 2 - n.width / 2, u = s.y + s.height / 2 - n.height / 2, h = s[l] / 2 - n[l] / 2;
1146
- let f;
1579
+ const r = K(e), o = zt(e), l = Wt(o), a = j(e), c = r === "y", d = n.x + n.width / 2 - i.width / 2, f = n.y + n.height / 2 - i.height / 2, h = n[l] / 2 - i[l] / 2;
1580
+ let u;
1147
1581
  switch (a) {
1148
1582
  case "top":
1149
- f = {
1583
+ u = {
1150
1584
  x: d,
1151
- y: s.y - n.height
1585
+ y: n.y - i.height
1152
1586
  };
1153
1587
  break;
1154
1588
  case "bottom":
1155
- f = {
1589
+ u = {
1156
1590
  x: d,
1157
- y: s.y + s.height
1591
+ y: n.y + n.height
1158
1592
  };
1159
1593
  break;
1160
1594
  case "right":
1161
- f = {
1162
- x: s.x + s.width,
1163
- y: u
1595
+ u = {
1596
+ x: n.x + n.width,
1597
+ y: f
1164
1598
  };
1165
1599
  break;
1166
1600
  case "left":
1167
- f = {
1168
- x: s.x - n.width,
1169
- y: u
1601
+ u = {
1602
+ x: n.x - i.width,
1603
+ y: f
1170
1604
  };
1171
1605
  break;
1172
1606
  default:
1173
- f = {
1174
- x: s.x,
1175
- y: s.y
1607
+ u = {
1608
+ x: n.x,
1609
+ y: n.y
1176
1610
  };
1177
1611
  }
1178
- switch (At(e)) {
1612
+ switch (vt(e)) {
1179
1613
  case "start":
1180
- f[r] -= h * (i && c ? -1 : 1);
1614
+ u[o] -= h * (s && c ? -1 : 1);
1181
1615
  break;
1182
1616
  case "end":
1183
- f[r] += h * (i && c ? -1 : 1);
1617
+ u[o] += h * (s && c ? -1 : 1);
1184
1618
  break;
1185
1619
  }
1186
- return f;
1620
+ return u;
1187
1621
  }
1188
- const xi = async (t, e, i) => {
1622
+ const Pn = async (t, e, s) => {
1189
1623
  const {
1190
- placement: s = "bottom",
1191
- strategy: n = "absolute",
1192
- middleware: o = [],
1193
- platform: r
1194
- } = i, l = o.filter(Boolean), a = await (r.isRTL == null ? void 0 : r.isRTL(e));
1195
- let c = await r.getElementRects({
1624
+ placement: n = "bottom",
1625
+ strategy: i = "absolute",
1626
+ middleware: r = [],
1627
+ platform: o
1628
+ } = s, l = r.filter(Boolean), a = await (o.isRTL == null ? void 0 : o.isRTL(e));
1629
+ let c = await o.getElementRects({
1196
1630
  reference: t,
1197
1631
  floating: e,
1198
- strategy: n
1632
+ strategy: i
1199
1633
  }), {
1200
1634
  x: d,
1201
- y: u
1202
- } = se(c, s, a), h = s, f = {}, g = 0;
1635
+ y: f
1636
+ } = Zt(c, n, a), h = n, u = {}, g = 0;
1203
1637
  for (let m = 0; m < l.length; m++) {
1204
1638
  const {
1205
- name: b,
1206
- fn: p
1639
+ name: p,
1640
+ fn: y
1207
1641
  } = l[m], {
1208
- x: y,
1209
- y: x,
1210
- data: S,
1211
- reset: v
1212
- } = await p({
1642
+ x: w,
1643
+ y: b,
1644
+ data: v,
1645
+ reset: x
1646
+ } = await y({
1213
1647
  x: d,
1214
- y: u,
1215
- initialPlacement: s,
1648
+ y: f,
1649
+ initialPlacement: n,
1216
1650
  placement: h,
1217
- strategy: n,
1218
- middlewareData: f,
1651
+ strategy: i,
1652
+ middlewareData: u,
1219
1653
  rects: c,
1220
- platform: r,
1654
+ platform: o,
1221
1655
  elements: {
1222
1656
  reference: t,
1223
1657
  floating: e
1224
1658
  }
1225
1659
  });
1226
- d = y ?? d, u = x ?? u, f = {
1227
- ...f,
1228
- [b]: {
1229
- ...f[b],
1230
- ...S
1660
+ d = w ?? d, f = b ?? f, u = {
1661
+ ...u,
1662
+ [p]: {
1663
+ ...u[p],
1664
+ ...v
1231
1665
  }
1232
- }, v && g <= 50 && (g++, typeof v == "object" && (v.placement && (h = v.placement), v.rects && (c = v.rects === !0 ? await r.getElementRects({
1666
+ }, x && g <= 50 && (g++, typeof x == "object" && (x.placement && (h = x.placement), x.rects && (c = x.rects === !0 ? await o.getElementRects({
1233
1667
  reference: t,
1234
1668
  floating: e,
1235
- strategy: n
1236
- }) : v.rects), {
1669
+ strategy: i
1670
+ }) : x.rects), {
1237
1671
  x: d,
1238
- y: u
1239
- } = se(c, h, a)), m = -1);
1672
+ y: f
1673
+ } = Zt(c, h, a)), m = -1);
1240
1674
  }
1241
1675
  return {
1242
1676
  x: d,
1243
- y: u,
1677
+ y: f,
1244
1678
  placement: h,
1245
- strategy: n,
1246
- middlewareData: f
1679
+ strategy: i,
1680
+ middlewareData: u
1247
1681
  };
1248
1682
  };
1249
- async function $e(t, e) {
1250
- var i;
1683
+ async function ke(t, e) {
1684
+ var s;
1251
1685
  e === void 0 && (e = {});
1252
1686
  const {
1253
- x: s,
1254
- y: n,
1255
- platform: o,
1256
- rects: r,
1687
+ x: n,
1688
+ y: i,
1689
+ platform: r,
1690
+ rects: o,
1257
1691
  elements: l,
1258
1692
  strategy: a
1259
1693
  } = t, {
1260
1694
  boundary: c = "clippingAncestors",
1261
1695
  rootBoundary: d = "viewport",
1262
- elementContext: u = "floating",
1696
+ elementContext: f = "floating",
1263
1697
  altBoundary: h = !1,
1264
- padding: f = 0
1265
- } = Q(e, t), g = Ae(f), b = l[h ? u === "floating" ? "reference" : "floating" : u], p = Tt(await o.getClippingRect({
1266
- element: (i = await (o.isElement == null ? void 0 : o.isElement(b))) == null || i ? b : b.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(l.floating)),
1698
+ padding: u = 0
1699
+ } = tt(e, t), g = Ae(u), p = l[h ? f === "floating" ? "reference" : "floating" : f], y = At(await r.getClippingRect({
1700
+ element: (s = await (r.isElement == null ? void 0 : r.isElement(p))) == null || s ? p : p.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(l.floating)),
1267
1701
  boundary: c,
1268
1702
  rootBoundary: d,
1269
1703
  strategy: a
1270
- })), y = u === "floating" ? {
1271
- x: s,
1272
- y: n,
1273
- width: r.floating.width,
1274
- height: r.floating.height
1275
- } : r.reference, x = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l.floating)), S = await (o.isElement == null ? void 0 : o.isElement(x)) ? await (o.getScale == null ? void 0 : o.getScale(x)) || {
1704
+ })), w = f === "floating" ? {
1705
+ x: n,
1706
+ y: i,
1707
+ width: o.floating.width,
1708
+ height: o.floating.height
1709
+ } : o.reference, b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l.floating)), v = await (r.isElement == null ? void 0 : r.isElement(b)) ? await (r.getScale == null ? void 0 : r.getScale(b)) || {
1276
1710
  x: 1,
1277
1711
  y: 1
1278
1712
  } : {
1279
1713
  x: 1,
1280
1714
  y: 1
1281
- }, v = Tt(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
1715
+ }, x = At(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
1282
1716
  elements: l,
1283
- rect: y,
1284
- offsetParent: x,
1717
+ rect: w,
1718
+ offsetParent: b,
1285
1719
  strategy: a
1286
- }) : y);
1720
+ }) : w);
1287
1721
  return {
1288
- top: (p.top - v.top + g.top) / S.y,
1289
- bottom: (v.bottom - p.bottom + g.bottom) / S.y,
1290
- left: (p.left - v.left + g.left) / S.x,
1291
- right: (v.right - p.right + g.right) / S.x
1722
+ top: (y.top - x.top + g.top) / v.y,
1723
+ bottom: (x.bottom - y.bottom + g.bottom) / v.y,
1724
+ left: (y.left - x.left + g.left) / v.x,
1725
+ right: (x.right - y.right + g.right) / v.x
1292
1726
  };
1293
1727
  }
1294
- const vi = (t) => ({
1728
+ const Tn = (t) => ({
1295
1729
  name: "arrow",
1296
1730
  options: t,
1297
1731
  async fn(e) {
1298
1732
  const {
1299
- x: i,
1300
- y: s,
1301
- placement: n,
1302
- rects: o,
1303
- platform: r,
1733
+ x: s,
1734
+ y: n,
1735
+ placement: i,
1736
+ rects: r,
1737
+ platform: o,
1304
1738
  elements: l,
1305
1739
  middlewareData: a
1306
1740
  } = e, {
1307
1741
  element: c,
1308
1742
  padding: d = 0
1309
- } = Q(t, e) || {};
1743
+ } = tt(t, e) || {};
1310
1744
  if (c == null)
1311
1745
  return {};
1312
- const u = Ae(d), h = {
1313
- x: i,
1314
- y: s
1315
- }, f = Jt(n), g = Gt(f), m = await r.getDimensions(c), b = f === "y", p = b ? "top" : "left", y = b ? "bottom" : "right", x = b ? "clientHeight" : "clientWidth", S = o.reference[g] + o.reference[f] - h[f] - o.floating[g], v = h[f] - o.reference[f], k = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c));
1316
- let j = k ? k[x] : 0;
1317
- (!j || !await (r.isElement == null ? void 0 : r.isElement(k))) && (j = l.floating[x] || o.floating[g]);
1318
- const pt = S / 2 - v / 2, X = j / 2 - m[g] / 2 - 1, V = ht(u[p], X), wt = ht(u[y], X), Y = V, bt = j - m[g] - wt, A = j / 2 - m[g] / 2 + pt, et = _t(Y, A, bt), B = !a.arrow && At(n) != null && A !== et && o.reference[g] / 2 - (A < Y ? V : wt) - m[g] / 2 < 0, F = B ? A < Y ? A - Y : A - bt : 0;
1746
+ const f = Ae(d), h = {
1747
+ x: s,
1748
+ y: n
1749
+ }, u = zt(i), g = Wt(u), m = await o.getDimensions(c), p = u === "y", y = p ? "top" : "left", w = p ? "bottom" : "right", b = p ? "clientHeight" : "clientWidth", v = r.reference[g] + r.reference[u] - h[u] - r.floating[g], x = h[u] - r.reference[u], k = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
1750
+ let O = k ? k[b] : 0;
1751
+ (!O || !await (o.isElement == null ? void 0 : o.isElement(k))) && (O = l.floating[b] || r.floating[g]);
1752
+ const dt = v / 2 - x / 2, J = O / 2 - m[g] / 2 - 1, N = ct(f[y], J), ht = ct(f[w], J), X = N, gt = O - m[g] - ht, M = O / 2 - m[g] / 2 + dt, R = Ft(X, M, gt), G = !a.arrow && vt(i) != null && M !== R && r.reference[g] / 2 - (M < X ? N : ht) - m[g] / 2 < 0, B = G ? M < X ? M - X : M - gt : 0;
1319
1753
  return {
1320
- [f]: h[f] + F,
1754
+ [u]: h[u] + B,
1321
1755
  data: {
1322
- [f]: et,
1323
- centerOffset: A - et - F,
1324
- ...B && {
1325
- alignmentOffset: F
1756
+ [u]: R,
1757
+ centerOffset: M - R - B,
1758
+ ...G && {
1759
+ alignmentOffset: B
1326
1760
  }
1327
1761
  },
1328
- reset: B
1762
+ reset: G
1329
1763
  };
1330
1764
  }
1331
- }), Si = function(t) {
1765
+ }), Mn = function(t) {
1332
1766
  return t === void 0 && (t = {}), {
1333
1767
  name: "flip",
1334
1768
  options: t,
1335
1769
  async fn(e) {
1336
- var i, s;
1770
+ var s, n;
1337
1771
  const {
1338
- placement: n,
1339
- middlewareData: o,
1340
- rects: r,
1772
+ placement: i,
1773
+ middlewareData: r,
1774
+ rects: o,
1341
1775
  initialPlacement: l,
1342
1776
  platform: a,
1343
1777
  elements: c
1344
1778
  } = e, {
1345
1779
  mainAxis: d = !0,
1346
- crossAxis: u = !0,
1780
+ crossAxis: f = !0,
1347
1781
  fallbackPlacements: h,
1348
- fallbackStrategy: f = "bestFit",
1782
+ fallbackStrategy: u = "bestFit",
1349
1783
  fallbackAxisSideDirection: g = "none",
1350
1784
  flipAlignment: m = !0,
1351
- ...b
1352
- } = Q(t, e);
1353
- if ((i = o.arrow) != null && i.alignmentOffset)
1785
+ ...p
1786
+ } = tt(t, e);
1787
+ if ((s = r.arrow) != null && s.alignmentOffset)
1354
1788
  return {};
1355
- const p = U(n), y = q(l), x = U(l) === l, S = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), v = h || (x || !m ? [Ot(l)] : pi(l)), k = g !== "none";
1356
- !h && k && v.push(...bi(l, m, g, S));
1357
- const j = [l, ...v], pt = await $e(e, b), X = [];
1358
- let V = ((s = o.flip) == null ? void 0 : s.overflows) || [];
1359
- if (d && X.push(pt[p]), u) {
1360
- const A = mi(n, r, S);
1361
- X.push(pt[A[0]], pt[A[1]]);
1789
+ const y = j(i), w = K(l), b = j(l) === l, v = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), x = h || (b || !m ? [$t(l)] : kn(l)), k = g !== "none";
1790
+ !h && k && x.push(...Ln(l, m, g, v));
1791
+ const O = [l, ...x], dt = await ke(e, p), J = [];
1792
+ let N = ((n = r.flip) == null ? void 0 : n.overflows) || [];
1793
+ if (d && J.push(dt[y]), f) {
1794
+ const R = An(i, o, v);
1795
+ J.push(dt[R[0]], dt[R[1]]);
1362
1796
  }
1363
- if (V = [...V, {
1364
- placement: n,
1365
- overflows: X
1366
- }], !X.every((A) => A <= 0)) {
1367
- var wt, Y;
1368
- const A = (((wt = o.flip) == null ? void 0 : wt.index) || 0) + 1, et = j[A];
1369
- if (et)
1370
- return {
1371
- data: {
1372
- index: A,
1373
- overflows: V
1374
- },
1375
- reset: {
1376
- placement: et
1377
- }
1378
- };
1379
- let B = (Y = V.filter((F) => F.overflows[0] <= 0).sort((F, H) => F.overflows[1] - H.overflows[1])[0]) == null ? void 0 : Y.placement;
1797
+ if (N = [...N, {
1798
+ placement: i,
1799
+ overflows: J
1800
+ }], !J.every((R) => R <= 0)) {
1801
+ var ht, X;
1802
+ const R = (((ht = r.flip) == null ? void 0 : ht.index) || 0) + 1, G = O[R];
1803
+ if (G) {
1804
+ var gt;
1805
+ const _ = f === "alignment" ? w !== K(G) : !1, D = ((gt = N[0]) == null ? void 0 : gt.overflows[0]) > 0;
1806
+ if (!_ || D)
1807
+ return {
1808
+ data: {
1809
+ index: R,
1810
+ overflows: N
1811
+ },
1812
+ reset: {
1813
+ placement: G
1814
+ }
1815
+ };
1816
+ }
1817
+ let B = (X = N.filter((_) => _.overflows[0] <= 0).sort((_, D) => _.overflows[1] - D.overflows[1])[0]) == null ? void 0 : X.placement;
1380
1818
  if (!B)
1381
- switch (f) {
1819
+ switch (u) {
1382
1820
  case "bestFit": {
1383
- var bt;
1384
- const F = (bt = V.filter((H) => {
1821
+ var M;
1822
+ const _ = (M = N.filter((D) => {
1385
1823
  if (k) {
1386
- const _ = q(H.placement);
1387
- return _ === y || // Create a bias to the `y` side axis due to horizontal
1824
+ const W = K(D.placement);
1825
+ return W === w || // Create a bias to the `y` side axis due to horizontal
1388
1826
  // reading directions favoring greater width.
1389
- _ === "y";
1827
+ W === "y";
1390
1828
  }
1391
1829
  return !0;
1392
- }).map((H) => [H.placement, H.overflows.filter((_) => _ > 0).reduce((_, De) => _ + De, 0)]).sort((H, _) => H[1] - _[1])[0]) == null ? void 0 : bt[0];
1393
- F && (B = F);
1830
+ }).map((D) => [D.placement, D.overflows.filter((W) => W > 0).reduce((W, Fe) => W + Fe, 0)]).sort((D, W) => D[1] - W[1])[0]) == null ? void 0 : M[0];
1831
+ _ && (B = _);
1394
1832
  break;
1395
1833
  }
1396
1834
  case "initialPlacement":
1397
1835
  B = l;
1398
1836
  break;
1399
1837
  }
1400
- if (n !== B)
1838
+ if (i !== B)
1401
1839
  return {
1402
1840
  reset: {
1403
1841
  placement: B
@@ -1408,131 +1846,131 @@ const vi = (t) => ({
1408
1846
  }
1409
1847
  };
1410
1848
  };
1411
- async function Ei(t, e) {
1849
+ async function Dn(t, e) {
1412
1850
  const {
1413
- placement: i,
1414
- platform: s,
1415
- elements: n
1416
- } = t, o = await (s.isRTL == null ? void 0 : s.isRTL(n.floating)), r = U(i), l = At(i), a = q(i) === "y", c = ["left", "top"].includes(r) ? -1 : 1, d = o && a ? -1 : 1, u = Q(e, t);
1851
+ placement: s,
1852
+ platform: n,
1853
+ elements: i
1854
+ } = t, r = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), o = j(s), l = vt(s), a = K(s) === "y", c = ["left", "top"].includes(o) ? -1 : 1, d = r && a ? -1 : 1, f = tt(e, t);
1417
1855
  let {
1418
1856
  mainAxis: h,
1419
- crossAxis: f,
1857
+ crossAxis: u,
1420
1858
  alignmentAxis: g
1421
- } = typeof u == "number" ? {
1422
- mainAxis: u,
1859
+ } = typeof f == "number" ? {
1860
+ mainAxis: f,
1423
1861
  crossAxis: 0,
1424
1862
  alignmentAxis: null
1425
1863
  } : {
1426
- mainAxis: u.mainAxis || 0,
1427
- crossAxis: u.crossAxis || 0,
1428
- alignmentAxis: u.alignmentAxis
1864
+ mainAxis: f.mainAxis || 0,
1865
+ crossAxis: f.crossAxis || 0,
1866
+ alignmentAxis: f.alignmentAxis
1429
1867
  };
1430
- return l && typeof g == "number" && (f = l === "end" ? g * -1 : g), a ? {
1431
- x: f * d,
1868
+ return l && typeof g == "number" && (u = l === "end" ? g * -1 : g), a ? {
1869
+ x: u * d,
1432
1870
  y: h * c
1433
1871
  } : {
1434
1872
  x: h * c,
1435
- y: f * d
1873
+ y: u * d
1436
1874
  };
1437
1875
  }
1438
- const Ci = function(t) {
1876
+ const In = function(t) {
1439
1877
  return t === void 0 && (t = 0), {
1440
1878
  name: "offset",
1441
1879
  options: t,
1442
1880
  async fn(e) {
1443
- var i, s;
1881
+ var s, n;
1444
1882
  const {
1445
- x: n,
1446
- y: o,
1447
- placement: r,
1883
+ x: i,
1884
+ y: r,
1885
+ placement: o,
1448
1886
  middlewareData: l
1449
- } = e, a = await Ei(e, t);
1450
- return r === ((i = l.offset) == null ? void 0 : i.placement) && (s = l.arrow) != null && s.alignmentOffset ? {} : {
1451
- x: n + a.x,
1452
- y: o + a.y,
1887
+ } = e, a = await Dn(e, t);
1888
+ return o === ((s = l.offset) == null ? void 0 : s.placement) && (n = l.arrow) != null && n.alignmentOffset ? {} : {
1889
+ x: i + a.x,
1890
+ y: r + a.y,
1453
1891
  data: {
1454
1892
  ...a,
1455
- placement: r
1893
+ placement: o
1456
1894
  }
1457
1895
  };
1458
1896
  }
1459
1897
  };
1460
- }, Ai = function(t) {
1898
+ }, Fn = function(t) {
1461
1899
  return t === void 0 && (t = {}), {
1462
1900
  name: "shift",
1463
1901
  options: t,
1464
1902
  async fn(e) {
1465
1903
  const {
1466
- x: i,
1467
- y: s,
1468
- placement: n
1904
+ x: s,
1905
+ y: n,
1906
+ placement: i
1469
1907
  } = e, {
1470
- mainAxis: o = !0,
1471
- crossAxis: r = !1,
1908
+ mainAxis: r = !0,
1909
+ crossAxis: o = !1,
1472
1910
  limiter: l = {
1473
- fn: (b) => {
1911
+ fn: (p) => {
1474
1912
  let {
1475
- x: p,
1476
- y
1477
- } = b;
1913
+ x: y,
1914
+ y: w
1915
+ } = p;
1478
1916
  return {
1479
- x: p,
1480
- y
1917
+ x: y,
1918
+ y: w
1481
1919
  };
1482
1920
  }
1483
1921
  },
1484
1922
  ...a
1485
- } = Q(t, e), c = {
1486
- x: i,
1487
- y: s
1488
- }, d = await $e(e, a), u = q(U(n)), h = Yt(u);
1489
- let f = c[h], g = c[u];
1490
- if (o) {
1491
- const b = h === "y" ? "top" : "left", p = h === "y" ? "bottom" : "right", y = f + d[b], x = f - d[p];
1492
- f = _t(y, f, x);
1493
- }
1923
+ } = tt(t, e), c = {
1924
+ x: s,
1925
+ y: n
1926
+ }, d = await ke(e, a), f = K(j(i)), h = _t(f);
1927
+ let u = c[h], g = c[f];
1494
1928
  if (r) {
1495
- const b = u === "y" ? "top" : "left", p = u === "y" ? "bottom" : "right", y = g + d[b], x = g - d[p];
1496
- g = _t(y, g, x);
1929
+ const p = h === "y" ? "top" : "left", y = h === "y" ? "bottom" : "right", w = u + d[p], b = u - d[y];
1930
+ u = Ft(w, u, b);
1931
+ }
1932
+ if (o) {
1933
+ const p = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", w = g + d[p], b = g - d[y];
1934
+ g = Ft(w, g, b);
1497
1935
  }
1498
1936
  const m = l.fn({
1499
1937
  ...e,
1500
- [h]: f,
1501
- [u]: g
1938
+ [h]: u,
1939
+ [f]: g
1502
1940
  });
1503
1941
  return {
1504
1942
  ...m,
1505
1943
  data: {
1506
- x: m.x - i,
1507
- y: m.y - s,
1944
+ x: m.x - s,
1945
+ y: m.y - n,
1508
1946
  enabled: {
1509
- [h]: o,
1510
- [u]: r
1947
+ [h]: r,
1948
+ [f]: o
1511
1949
  }
1512
1950
  }
1513
1951
  };
1514
1952
  }
1515
1953
  };
1516
- }, $i = function(t) {
1954
+ }, Hn = function(t) {
1517
1955
  return t === void 0 && (t = {}), {
1518
1956
  options: t,
1519
1957
  fn(e) {
1520
1958
  const {
1521
- x: i,
1522
- y: s,
1523
- placement: n,
1524
- rects: o,
1525
- middlewareData: r
1959
+ x: s,
1960
+ y: n,
1961
+ placement: i,
1962
+ rects: r,
1963
+ middlewareData: o
1526
1964
  } = e, {
1527
1965
  offset: l = 0,
1528
1966
  mainAxis: a = !0,
1529
1967
  crossAxis: c = !0
1530
- } = Q(t, e), d = {
1531
- x: i,
1532
- y: s
1533
- }, u = q(n), h = Yt(u);
1534
- let f = d[h], g = d[u];
1535
- const m = Q(l, e), b = typeof m == "number" ? {
1968
+ } = tt(t, e), d = {
1969
+ x: s,
1970
+ y: n
1971
+ }, f = K(i), h = _t(f);
1972
+ let u = d[h], g = d[f];
1973
+ const m = tt(l, e), p = typeof m == "number" ? {
1536
1974
  mainAxis: m,
1537
1975
  crossAxis: 0
1538
1976
  } : {
@@ -1541,60 +1979,60 @@ const Ci = function(t) {
1541
1979
  ...m
1542
1980
  };
1543
1981
  if (a) {
1544
- const x = h === "y" ? "height" : "width", S = o.reference[h] - o.floating[x] + b.mainAxis, v = o.reference[h] + o.reference[x] - b.mainAxis;
1545
- f < S ? f = S : f > v && (f = v);
1982
+ const b = h === "y" ? "height" : "width", v = r.reference[h] - r.floating[b] + p.mainAxis, x = r.reference[h] + r.reference[b] - p.mainAxis;
1983
+ u < v ? u = v : u > x && (u = x);
1546
1984
  }
1547
1985
  if (c) {
1548
- var p, y;
1549
- const x = h === "y" ? "width" : "height", S = ["top", "left"].includes(U(n)), v = o.reference[u] - o.floating[x] + (S && ((p = r.offset) == null ? void 0 : p[u]) || 0) + (S ? 0 : b.crossAxis), k = o.reference[u] + o.reference[x] + (S ? 0 : ((y = r.offset) == null ? void 0 : y[u]) || 0) - (S ? b.crossAxis : 0);
1550
- g < v ? g = v : g > k && (g = k);
1986
+ var y, w;
1987
+ const b = h === "y" ? "width" : "height", v = ["top", "left"].includes(j(i)), x = r.reference[f] - r.floating[b] + (v && ((y = o.offset) == null ? void 0 : y[f]) || 0) + (v ? 0 : p.crossAxis), k = r.reference[f] + r.reference[b] + (v ? 0 : ((w = o.offset) == null ? void 0 : w[f]) || 0) - (v ? p.crossAxis : 0);
1988
+ g < x ? g = x : g > k && (g = k);
1551
1989
  }
1552
1990
  return {
1553
- [h]: f,
1554
- [u]: g
1991
+ [h]: u,
1992
+ [f]: g
1555
1993
  };
1556
1994
  }
1557
1995
  };
1558
1996
  };
1559
- function Mt() {
1997
+ function Rt() {
1560
1998
  return typeof window < "u";
1561
1999
  }
1562
- function mt(t) {
1563
- return ke(t) ? (t.nodeName || "").toLowerCase() : "#document";
2000
+ function ut(t) {
2001
+ return Oe(t) ? (t.nodeName || "").toLowerCase() : "#document";
1564
2002
  }
1565
- function T(t) {
2003
+ function A(t) {
1566
2004
  var e;
1567
2005
  return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
1568
2006
  }
1569
- function N(t) {
2007
+ function H(t) {
1570
2008
  var e;
1571
- return (e = (ke(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
2009
+ return (e = (Oe(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
1572
2010
  }
1573
- function ke(t) {
1574
- return Mt() ? t instanceof Node || t instanceof T(t).Node : !1;
2011
+ function Oe(t) {
2012
+ return Rt() ? t instanceof Node || t instanceof A(t).Node : !1;
1575
2013
  }
1576
- function D(t) {
1577
- return Mt() ? t instanceof Element || t instanceof T(t).Element : !1;
2014
+ function P(t) {
2015
+ return Rt() ? t instanceof Element || t instanceof A(t).Element : !1;
1578
2016
  }
1579
- function I(t) {
1580
- return Mt() ? t instanceof HTMLElement || t instanceof T(t).HTMLElement : !1;
2017
+ function F(t) {
2018
+ return Rt() ? t instanceof HTMLElement || t instanceof A(t).HTMLElement : !1;
1581
2019
  }
1582
- function ne(t) {
1583
- return !Mt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof T(t).ShadowRoot;
2020
+ function te(t) {
2021
+ return !Rt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof A(t).ShadowRoot;
1584
2022
  }
1585
- function $t(t) {
2023
+ function Et(t) {
1586
2024
  const {
1587
2025
  overflow: e,
1588
- overflowX: i,
1589
- overflowY: s,
1590
- display: n
1591
- } = M(t);
1592
- return /auto|scroll|overlay|hidden|clip/.test(e + s + i) && !["inline", "contents"].includes(n);
2026
+ overflowX: s,
2027
+ overflowY: n,
2028
+ display: i
2029
+ } = T(t);
2030
+ return /auto|scroll|overlay|hidden|clip/.test(e + n + s) && !["inline", "contents"].includes(i);
1593
2031
  }
1594
- function ki(t) {
1595
- return ["table", "td", "th"].includes(mt(t));
2032
+ function Nn(t) {
2033
+ return ["table", "td", "th"].includes(ut(t));
1596
2034
  }
1597
- function Ft(t) {
2035
+ function Pt(t) {
1598
2036
  return [":popover-open", ":modal"].some((e) => {
1599
2037
  try {
1600
2038
  return t.matches(e);
@@ -1603,32 +2041,32 @@ function Ft(t) {
1603
2041
  }
1604
2042
  });
1605
2043
  }
1606
- function Zt(t) {
1607
- const e = Qt(), i = D(t) ? M(t) : t;
1608
- return i.transform !== "none" || i.perspective !== "none" || (i.containerType ? i.containerType !== "normal" : !1) || !e && (i.backdropFilter ? i.backdropFilter !== "none" : !1) || !e && (i.filter ? i.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((s) => (i.willChange || "").includes(s)) || ["paint", "layout", "strict", "content"].some((s) => (i.contain || "").includes(s));
2044
+ function Qt(t) {
2045
+ const e = Kt(), s = P(t) ? T(t) : t;
2046
+ return ["transform", "translate", "scale", "rotate", "perspective"].some((n) => s[n] ? s[n] !== "none" : !1) || (s.containerType ? s.containerType !== "normal" : !1) || !e && (s.backdropFilter ? s.backdropFilter !== "none" : !1) || !e && (s.filter ? s.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((n) => (s.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (s.contain || "").includes(n));
1609
2047
  }
1610
- function Li(t) {
1611
- let e = K(t);
1612
- for (; I(e) && !gt(e); ) {
1613
- if (Zt(e))
2048
+ function Bn(t) {
2049
+ let e = Y(t);
2050
+ for (; F(e) && !ft(e); ) {
2051
+ if (Qt(e))
1614
2052
  return e;
1615
- if (Ft(e))
2053
+ if (Pt(e))
1616
2054
  return null;
1617
- e = K(e);
2055
+ e = Y(e);
1618
2056
  }
1619
2057
  return null;
1620
2058
  }
1621
- function Qt() {
2059
+ function Kt() {
1622
2060
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
1623
2061
  }
1624
- function gt(t) {
1625
- return ["html", "body", "#document"].includes(mt(t));
2062
+ function ft(t) {
2063
+ return ["html", "body", "#document"].includes(ut(t));
1626
2064
  }
1627
- function M(t) {
1628
- return T(t).getComputedStyle(t);
2065
+ function T(t) {
2066
+ return A(t).getComputedStyle(t);
1629
2067
  }
1630
- function It(t) {
1631
- return D(t) ? {
2068
+ function Tt(t) {
2069
+ return P(t) ? {
1632
2070
  scrollLeft: t.scrollLeft,
1633
2071
  scrollTop: t.scrollTop
1634
2072
  } : {
@@ -1636,210 +2074,223 @@ function It(t) {
1636
2074
  scrollTop: t.scrollY
1637
2075
  };
1638
2076
  }
1639
- function K(t) {
1640
- if (mt(t) === "html")
2077
+ function Y(t) {
2078
+ if (ut(t) === "html")
1641
2079
  return t;
1642
2080
  const e = (
1643
2081
  // Step into the shadow DOM of the parent of a slotted node.
1644
2082
  t.assignedSlot || // DOM Element detected.
1645
2083
  t.parentNode || // ShadowRoot detected.
1646
- ne(t) && t.host || // Fallback.
1647
- N(t)
2084
+ te(t) && t.host || // Fallback.
2085
+ H(t)
1648
2086
  );
1649
- return ne(e) ? e.host : e;
2087
+ return te(e) ? e.host : e;
1650
2088
  }
1651
2089
  function Le(t) {
1652
- const e = K(t);
1653
- return gt(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : I(e) && $t(e) ? e : Le(e);
2090
+ const e = Y(t);
2091
+ return ft(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : F(e) && Et(e) ? e : Le(e);
1654
2092
  }
1655
- function vt(t, e, i) {
1656
- var s;
1657
- e === void 0 && (e = []), i === void 0 && (i = !0);
1658
- const n = Le(t), o = n === ((s = t.ownerDocument) == null ? void 0 : s.body), r = T(n);
1659
- if (o) {
1660
- const l = Wt(r);
1661
- return e.concat(r, r.visualViewport || [], $t(n) ? n : [], l && i ? vt(l) : []);
2093
+ function yt(t, e, s) {
2094
+ var n;
2095
+ e === void 0 && (e = []), s === void 0 && (s = !0);
2096
+ const i = Le(t), r = i === ((n = t.ownerDocument) == null ? void 0 : n.body), o = A(i);
2097
+ if (r) {
2098
+ const l = Nt(o);
2099
+ return e.concat(o, o.visualViewport || [], Et(i) ? i : [], l && s ? yt(l) : []);
1662
2100
  }
1663
- return e.concat(n, vt(n, [], i));
2101
+ return e.concat(i, yt(i, [], s));
1664
2102
  }
1665
- function Wt(t) {
2103
+ function Nt(t) {
1666
2104
  return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
1667
2105
  }
1668
- function Oe(t) {
1669
- const e = M(t);
1670
- let i = parseFloat(e.width) || 0, s = parseFloat(e.height) || 0;
1671
- const n = I(t), o = n ? t.offsetWidth : i, r = n ? t.offsetHeight : s, l = Lt(i) !== o || Lt(s) !== r;
1672
- return l && (i = o, s = r), {
1673
- width: i,
1674
- height: s,
2106
+ function Re(t) {
2107
+ const e = T(t);
2108
+ let s = parseFloat(e.width) || 0, n = parseFloat(e.height) || 0;
2109
+ const i = F(t), r = i ? t.offsetWidth : s, o = i ? t.offsetHeight : n, l = Ct(s) !== r || Ct(n) !== o;
2110
+ return l && (s = r, n = o), {
2111
+ width: s,
2112
+ height: n,
1675
2113
  $: l
1676
2114
  };
1677
2115
  }
1678
- function qt(t) {
1679
- return D(t) ? t : t.contextElement;
2116
+ function jt(t) {
2117
+ return P(t) ? t : t.contextElement;
1680
2118
  }
1681
2119
  function st(t) {
1682
- const e = qt(t);
1683
- if (!I(e))
1684
- return W(1);
1685
- const i = e.getBoundingClientRect(), {
1686
- width: s,
1687
- height: n,
1688
- $: o
1689
- } = Oe(e);
1690
- let r = (o ? Lt(i.width) : i.width) / s, l = (o ? Lt(i.height) : i.height) / n;
1691
- return (!r || !Number.isFinite(r)) && (r = 1), (!l || !Number.isFinite(l)) && (l = 1), {
1692
- x: r,
2120
+ const e = jt(t);
2121
+ if (!F(e))
2122
+ return I(1);
2123
+ const s = e.getBoundingClientRect(), {
2124
+ width: n,
2125
+ height: i,
2126
+ $: r
2127
+ } = Re(e);
2128
+ let o = (r ? Ct(s.width) : s.width) / n, l = (r ? Ct(s.height) : s.height) / i;
2129
+ return (!o || !Number.isFinite(o)) && (o = 1), (!l || !Number.isFinite(l)) && (l = 1), {
2130
+ x: o,
1693
2131
  y: l
1694
2132
  };
1695
2133
  }
1696
- const Oi = /* @__PURE__ */ W(0);
1697
- function Te(t) {
1698
- const e = T(t);
1699
- return !Qt() || !e.visualViewport ? Oi : {
2134
+ const Un = /* @__PURE__ */ I(0);
2135
+ function Pe(t) {
2136
+ const e = A(t);
2137
+ return !Kt() || !e.visualViewport ? Un : {
1700
2138
  x: e.visualViewport.offsetLeft,
1701
2139
  y: e.visualViewport.offsetTop
1702
2140
  };
1703
2141
  }
1704
- function Ti(t, e, i) {
1705
- return e === void 0 && (e = !1), !i || e && i !== T(t) ? !1 : e;
1706
- }
1707
- function tt(t, e, i, s) {
1708
- e === void 0 && (e = !1), i === void 0 && (i = !1);
1709
- const n = t.getBoundingClientRect(), o = qt(t);
1710
- let r = W(1);
1711
- e && (s ? D(s) && (r = st(s)) : r = st(t));
1712
- const l = Ti(o, i, s) ? Te(o) : W(0);
1713
- let a = (n.left + l.x) / r.x, c = (n.top + l.y) / r.y, d = n.width / r.x, u = n.height / r.y;
1714
- if (o) {
1715
- const h = T(o), f = s && D(s) ? T(s) : s;
1716
- let g = h, m = Wt(g);
1717
- for (; m && s && f !== g; ) {
1718
- const b = st(m), p = m.getBoundingClientRect(), y = M(m), x = p.left + (m.clientLeft + parseFloat(y.paddingLeft)) * b.x, S = p.top + (m.clientTop + parseFloat(y.paddingTop)) * b.y;
1719
- a *= b.x, c *= b.y, d *= b.x, u *= b.y, a += x, c += S, g = T(m), m = Wt(g);
2142
+ function Vn(t, e, s) {
2143
+ return e === void 0 && (e = !1), !s || e && s !== A(t) ? !1 : e;
2144
+ }
2145
+ function et(t, e, s, n) {
2146
+ e === void 0 && (e = !1), s === void 0 && (s = !1);
2147
+ const i = t.getBoundingClientRect(), r = jt(t);
2148
+ let o = I(1);
2149
+ e && (n ? P(n) && (o = st(n)) : o = st(t));
2150
+ const l = Vn(r, s, n) ? Pe(r) : I(0);
2151
+ let a = (i.left + l.x) / o.x, c = (i.top + l.y) / o.y, d = i.width / o.x, f = i.height / o.y;
2152
+ if (r) {
2153
+ const h = A(r), u = n && P(n) ? A(n) : n;
2154
+ let g = h, m = Nt(g);
2155
+ for (; m && n && u !== g; ) {
2156
+ const p = st(m), y = m.getBoundingClientRect(), w = T(m), b = y.left + (m.clientLeft + parseFloat(w.paddingLeft)) * p.x, v = y.top + (m.clientTop + parseFloat(w.paddingTop)) * p.y;
2157
+ a *= p.x, c *= p.y, d *= p.x, f *= p.y, a += b, c += v, g = A(m), m = Nt(g);
1720
2158
  }
1721
2159
  }
1722
- return Tt({
2160
+ return At({
1723
2161
  width: d,
1724
- height: u,
2162
+ height: f,
1725
2163
  x: a,
1726
2164
  y: c
1727
2165
  });
1728
2166
  }
1729
- function Pi(t) {
2167
+ function Yt(t, e) {
2168
+ const s = Tt(t).scrollLeft;
2169
+ return e ? e.left + s : et(H(t)).left + s;
2170
+ }
2171
+ function Te(t, e, s) {
2172
+ s === void 0 && (s = !1);
2173
+ const n = t.getBoundingClientRect(), i = n.left + e.scrollLeft - (s ? 0 : (
2174
+ // RTL <body> scrollbar.
2175
+ Yt(t, n)
2176
+ )), r = n.top + e.scrollTop;
2177
+ return {
2178
+ x: i,
2179
+ y: r
2180
+ };
2181
+ }
2182
+ function _n(t) {
1730
2183
  let {
1731
2184
  elements: e,
1732
- rect: i,
1733
- offsetParent: s,
1734
- strategy: n
2185
+ rect: s,
2186
+ offsetParent: n,
2187
+ strategy: i
1735
2188
  } = t;
1736
- const o = n === "fixed", r = N(s), l = e ? Ft(e.floating) : !1;
1737
- if (s === r || l && o)
1738
- return i;
2189
+ const r = i === "fixed", o = H(n), l = e ? Pt(e.floating) : !1;
2190
+ if (n === o || l && r)
2191
+ return s;
1739
2192
  let a = {
1740
2193
  scrollLeft: 0,
1741
2194
  scrollTop: 0
1742
- }, c = W(1);
1743
- const d = W(0), u = I(s);
1744
- if ((u || !u && !o) && ((mt(s) !== "body" || $t(r)) && (a = It(s)), I(s))) {
1745
- const h = tt(s);
1746
- c = st(s), d.x = h.x + s.clientLeft, d.y = h.y + s.clientTop;
2195
+ }, c = I(1);
2196
+ const d = I(0), f = F(n);
2197
+ if ((f || !f && !r) && ((ut(n) !== "body" || Et(o)) && (a = Tt(n)), F(n))) {
2198
+ const u = et(n);
2199
+ c = st(n), d.x = u.x + n.clientLeft, d.y = u.y + n.clientTop;
1747
2200
  }
2201
+ const h = o && !f && !r ? Te(o, a, !0) : I(0);
1748
2202
  return {
1749
- width: i.width * c.x,
1750
- height: i.height * c.y,
1751
- x: i.x * c.x - a.scrollLeft * c.x + d.x,
1752
- y: i.y * c.y - a.scrollTop * c.y + d.y
2203
+ width: s.width * c.x,
2204
+ height: s.height * c.y,
2205
+ x: s.x * c.x - a.scrollLeft * c.x + d.x + h.x,
2206
+ y: s.y * c.y - a.scrollTop * c.y + d.y + h.y
1753
2207
  };
1754
2208
  }
1755
- function Ri(t) {
2209
+ function Wn(t) {
1756
2210
  return Array.from(t.getClientRects());
1757
2211
  }
1758
- function Ut(t, e) {
1759
- const i = It(t).scrollLeft;
1760
- return e ? e.left + i : tt(N(t)).left + i;
1761
- }
1762
- function Di(t) {
1763
- const e = N(t), i = It(t), s = t.ownerDocument.body, n = Z(e.scrollWidth, e.clientWidth, s.scrollWidth, s.clientWidth), o = Z(e.scrollHeight, e.clientHeight, s.scrollHeight, s.clientHeight);
1764
- let r = -i.scrollLeft + Ut(t);
1765
- const l = -i.scrollTop;
1766
- return M(s).direction === "rtl" && (r += Z(e.clientWidth, s.clientWidth) - n), {
1767
- width: n,
1768
- height: o,
1769
- x: r,
2212
+ function zn(t) {
2213
+ const e = H(t), s = Tt(t), n = t.ownerDocument.body, i = Z(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), r = Z(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
2214
+ let o = -s.scrollLeft + Yt(t);
2215
+ const l = -s.scrollTop;
2216
+ return T(n).direction === "rtl" && (o += Z(e.clientWidth, n.clientWidth) - i), {
2217
+ width: i,
2218
+ height: r,
2219
+ x: o,
1770
2220
  y: l
1771
2221
  };
1772
2222
  }
1773
- function Mi(t, e) {
1774
- const i = T(t), s = N(t), n = i.visualViewport;
1775
- let o = s.clientWidth, r = s.clientHeight, l = 0, a = 0;
1776
- if (n) {
1777
- o = n.width, r = n.height;
1778
- const c = Qt();
1779
- (!c || c && e === "fixed") && (l = n.offsetLeft, a = n.offsetTop);
2223
+ function Qn(t, e) {
2224
+ const s = A(t), n = H(t), i = s.visualViewport;
2225
+ let r = n.clientWidth, o = n.clientHeight, l = 0, a = 0;
2226
+ if (i) {
2227
+ r = i.width, o = i.height;
2228
+ const c = Kt();
2229
+ (!c || c && e === "fixed") && (l = i.offsetLeft, a = i.offsetTop);
1780
2230
  }
1781
2231
  return {
1782
- width: o,
1783
- height: r,
2232
+ width: r,
2233
+ height: o,
1784
2234
  x: l,
1785
2235
  y: a
1786
2236
  };
1787
2237
  }
1788
- function Fi(t, e) {
1789
- const i = tt(t, !0, e === "fixed"), s = i.top + t.clientTop, n = i.left + t.clientLeft, o = I(t) ? st(t) : W(1), r = t.clientWidth * o.x, l = t.clientHeight * o.y, a = n * o.x, c = s * o.y;
2238
+ function Kn(t, e) {
2239
+ const s = et(t, !0, e === "fixed"), n = s.top + t.clientTop, i = s.left + t.clientLeft, r = F(t) ? st(t) : I(1), o = t.clientWidth * r.x, l = t.clientHeight * r.y, a = i * r.x, c = n * r.y;
1790
2240
  return {
1791
- width: r,
2241
+ width: o,
1792
2242
  height: l,
1793
2243
  x: a,
1794
2244
  y: c
1795
2245
  };
1796
2246
  }
1797
- function oe(t, e, i) {
1798
- let s;
2247
+ function ee(t, e, s) {
2248
+ let n;
1799
2249
  if (e === "viewport")
1800
- s = Mi(t, i);
2250
+ n = Qn(t, s);
1801
2251
  else if (e === "document")
1802
- s = Di(N(t));
1803
- else if (D(e))
1804
- s = Fi(e, i);
2252
+ n = zn(H(t));
2253
+ else if (P(e))
2254
+ n = Kn(e, s);
1805
2255
  else {
1806
- const n = Te(t);
1807
- s = {
1808
- ...e,
1809
- x: e.x - n.x,
1810
- y: e.y - n.y
2256
+ const i = Pe(t);
2257
+ n = {
2258
+ x: e.x - i.x,
2259
+ y: e.y - i.y,
2260
+ width: e.width,
2261
+ height: e.height
1811
2262
  };
1812
2263
  }
1813
- return Tt(s);
2264
+ return At(n);
1814
2265
  }
1815
- function Pe(t, e) {
1816
- const i = K(t);
1817
- return i === e || !D(i) || gt(i) ? !1 : M(i).position === "fixed" || Pe(i, e);
2266
+ function Me(t, e) {
2267
+ const s = Y(t);
2268
+ return s === e || !P(s) || ft(s) ? !1 : T(s).position === "fixed" || Me(s, e);
1818
2269
  }
1819
- function Ii(t, e) {
1820
- const i = e.get(t);
1821
- if (i)
1822
- return i;
1823
- let s = vt(t, [], !1).filter((l) => D(l) && mt(l) !== "body"), n = null;
1824
- const o = M(t).position === "fixed";
1825
- let r = o ? K(t) : t;
1826
- for (; D(r) && !gt(r); ) {
1827
- const l = M(r), a = Zt(r);
1828
- !a && l.position === "fixed" && (n = null), (o ? !a && !n : !a && l.position === "static" && !!n && ["absolute", "fixed"].includes(n.position) || $t(r) && !a && Pe(t, r)) ? s = s.filter((d) => d !== r) : n = l, r = K(r);
2270
+ function jn(t, e) {
2271
+ const s = e.get(t);
2272
+ if (s)
2273
+ return s;
2274
+ let n = yt(t, [], !1).filter((l) => P(l) && ut(l) !== "body"), i = null;
2275
+ const r = T(t).position === "fixed";
2276
+ let o = r ? Y(t) : t;
2277
+ for (; P(o) && !ft(o); ) {
2278
+ const l = T(o), a = Qt(o);
2279
+ !a && l.position === "fixed" && (i = null), (r ? !a && !i : !a && l.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || Et(o) && !a && Me(t, o)) ? n = n.filter((d) => d !== o) : i = l, o = Y(o);
1829
2280
  }
1830
- return e.set(t, s), s;
2281
+ return e.set(t, n), n;
1831
2282
  }
1832
- function Ni(t) {
2283
+ function Yn(t) {
1833
2284
  let {
1834
2285
  element: e,
1835
- boundary: i,
1836
- rootBoundary: s,
1837
- strategy: n
2286
+ boundary: s,
2287
+ rootBoundary: n,
2288
+ strategy: i
1838
2289
  } = t;
1839
- const r = [...i === "clippingAncestors" ? Ft(e) ? [] : Ii(e, this._c) : [].concat(i), s], l = r[0], a = r.reduce((c, d) => {
1840
- const u = oe(e, d, n);
1841
- return c.top = Z(u.top, c.top), c.right = ht(u.right, c.right), c.bottom = ht(u.bottom, c.bottom), c.left = Z(u.left, c.left), c;
1842
- }, oe(e, l, n));
2290
+ const o = [...s === "clippingAncestors" ? Pt(e) ? [] : jn(e, this._c) : [].concat(s), n], l = o[0], a = o.reduce((c, d) => {
2291
+ const f = ee(e, d, i);
2292
+ return c.top = Z(f.top, c.top), c.right = ct(f.right, c.right), c.bottom = ct(f.bottom, c.bottom), c.left = Z(f.left, c.left), c;
2293
+ }, ee(e, l, i));
1843
2294
  return {
1844
2295
  width: a.right - a.left,
1845
2296
  height: a.bottom - a.top,
@@ -1847,254 +2298,257 @@ function Ni(t) {
1847
2298
  y: a.top
1848
2299
  };
1849
2300
  }
1850
- function Bi(t) {
2301
+ function Jn(t) {
1851
2302
  const {
1852
2303
  width: e,
1853
- height: i
1854
- } = Oe(t);
2304
+ height: s
2305
+ } = Re(t);
1855
2306
  return {
1856
2307
  width: e,
1857
- height: i
2308
+ height: s
1858
2309
  };
1859
2310
  }
1860
- function Vi(t, e, i) {
1861
- const s = I(e), n = N(e), o = i === "fixed", r = tt(t, !0, o, e);
2311
+ function Xn(t, e, s) {
2312
+ const n = F(e), i = H(e), r = s === "fixed", o = et(t, !0, r, e);
1862
2313
  let l = {
1863
2314
  scrollLeft: 0,
1864
2315
  scrollTop: 0
1865
2316
  };
1866
- const a = W(0);
1867
- if (s || !s && !o)
1868
- if ((mt(e) !== "body" || $t(n)) && (l = It(e)), s) {
1869
- const f = tt(e, !0, o, e);
1870
- a.x = f.x + e.clientLeft, a.y = f.y + e.clientTop;
1871
- } else n && (a.x = Ut(n));
1872
- let c = 0, d = 0;
1873
- if (n && !s && !o) {
1874
- const f = n.getBoundingClientRect();
1875
- d = f.top + l.scrollTop, c = f.left + l.scrollLeft - // RTL <body> scrollbar.
1876
- Ut(n, f);
1877
- }
1878
- const u = r.left + l.scrollLeft - a.x - c, h = r.top + l.scrollTop - a.y - d;
2317
+ const a = I(0);
2318
+ function c() {
2319
+ a.x = Yt(i);
2320
+ }
2321
+ if (n || !n && !r)
2322
+ if ((ut(e) !== "body" || Et(i)) && (l = Tt(e)), n) {
2323
+ const u = et(e, !0, r, e);
2324
+ a.x = u.x + e.clientLeft, a.y = u.y + e.clientTop;
2325
+ } else i && c();
2326
+ r && !n && i && c();
2327
+ const d = i && !n && !r ? Te(i, l) : I(0), f = o.left + l.scrollLeft - a.x - d.x, h = o.top + l.scrollTop - a.y - d.y;
1879
2328
  return {
1880
- x: u,
2329
+ x: f,
1881
2330
  y: h,
1882
- width: r.width,
1883
- height: r.height
2331
+ width: o.width,
2332
+ height: o.height
1884
2333
  };
1885
2334
  }
1886
- function Bt(t) {
1887
- return M(t).position === "static";
2335
+ function Dt(t) {
2336
+ return T(t).position === "static";
1888
2337
  }
1889
- function re(t, e) {
1890
- if (!I(t) || M(t).position === "fixed")
2338
+ function ne(t, e) {
2339
+ if (!F(t) || T(t).position === "fixed")
1891
2340
  return null;
1892
2341
  if (e)
1893
2342
  return e(t);
1894
- let i = t.offsetParent;
1895
- return N(t) === i && (i = i.ownerDocument.body), i;
1896
- }
1897
- function Re(t, e) {
1898
- const i = T(t);
1899
- if (Ft(t))
1900
- return i;
1901
- if (!I(t)) {
1902
- let n = K(t);
1903
- for (; n && !gt(n); ) {
1904
- if (D(n) && !Bt(n))
1905
- return n;
1906
- n = K(n);
2343
+ let s = t.offsetParent;
2344
+ return H(t) === s && (s = s.ownerDocument.body), s;
2345
+ }
2346
+ function De(t, e) {
2347
+ const s = A(t);
2348
+ if (Pt(t))
2349
+ return s;
2350
+ if (!F(t)) {
2351
+ let i = Y(t);
2352
+ for (; i && !ft(i); ) {
2353
+ if (P(i) && !Dt(i))
2354
+ return i;
2355
+ i = Y(i);
1907
2356
  }
1908
- return i;
2357
+ return s;
1909
2358
  }
1910
- let s = re(t, e);
1911
- for (; s && ki(s) && Bt(s); )
1912
- s = re(s, e);
1913
- return s && gt(s) && Bt(s) && !Zt(s) ? i : s || Li(t) || i;
2359
+ let n = ne(t, e);
2360
+ for (; n && Nn(n) && Dt(n); )
2361
+ n = ne(n, e);
2362
+ return n && ft(n) && Dt(n) && !Qt(n) ? s : n || Bn(t) || s;
1914
2363
  }
1915
- const Hi = async function(t) {
1916
- const e = this.getOffsetParent || Re, i = this.getDimensions, s = await i(t.floating);
2364
+ const Gn = async function(t) {
2365
+ const e = this.getOffsetParent || De, s = this.getDimensions, n = await s(t.floating);
1917
2366
  return {
1918
- reference: Vi(t.reference, await e(t.floating), t.strategy),
2367
+ reference: Xn(t.reference, await e(t.floating), t.strategy),
1919
2368
  floating: {
1920
2369
  x: 0,
1921
2370
  y: 0,
1922
- width: s.width,
1923
- height: s.height
2371
+ width: n.width,
2372
+ height: n.height
1924
2373
  }
1925
2374
  };
1926
2375
  };
1927
- function _i(t) {
1928
- return M(t).direction === "rtl";
1929
- }
1930
- const zi = {
1931
- convertOffsetParentRelativeRectToViewportRelativeRect: Pi,
1932
- getDocumentElement: N,
1933
- getClippingRect: Ni,
1934
- getOffsetParent: Re,
1935
- getElementRects: Hi,
1936
- getClientRects: Ri,
1937
- getDimensions: Bi,
2376
+ function qn(t) {
2377
+ return T(t).direction === "rtl";
2378
+ }
2379
+ const Zn = {
2380
+ convertOffsetParentRelativeRectToViewportRelativeRect: _n,
2381
+ getDocumentElement: H,
2382
+ getClippingRect: Yn,
2383
+ getOffsetParent: De,
2384
+ getElementRects: Gn,
2385
+ getClientRects: Wn,
2386
+ getDimensions: Jn,
1938
2387
  getScale: st,
1939
- isElement: D,
1940
- isRTL: _i
2388
+ isElement: P,
2389
+ isRTL: qn
1941
2390
  };
1942
- function Wi(t, e) {
1943
- let i = null, s;
1944
- const n = N(t);
1945
- function o() {
2391
+ function Ie(t, e) {
2392
+ return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
2393
+ }
2394
+ function ts(t, e) {
2395
+ let s = null, n;
2396
+ const i = H(t);
2397
+ function r() {
1946
2398
  var l;
1947
- clearTimeout(s), (l = i) == null || l.disconnect(), i = null;
1948
- }
1949
- function r(l, a) {
1950
- l === void 0 && (l = !1), a === void 0 && (a = 1), o();
1951
- const {
1952
- left: c,
1953
- top: d,
1954
- width: u,
1955
- height: h
1956
- } = t.getBoundingClientRect();
1957
- if (l || e(), !u || !h)
2399
+ clearTimeout(n), (l = s) == null || l.disconnect(), s = null;
2400
+ }
2401
+ function o(l, a) {
2402
+ l === void 0 && (l = !1), a === void 0 && (a = 1), r();
2403
+ const c = t.getBoundingClientRect(), {
2404
+ left: d,
2405
+ top: f,
2406
+ width: h,
2407
+ height: u
2408
+ } = c;
2409
+ if (l || e(), !h || !u)
1958
2410
  return;
1959
- const f = kt(d), g = kt(n.clientWidth - (c + u)), m = kt(n.clientHeight - (d + h)), b = kt(c), y = {
1960
- rootMargin: -f + "px " + -g + "px " + -m + "px " + -b + "px",
1961
- threshold: Z(0, ht(1, a)) || 1
2411
+ const g = St(f), m = St(i.clientWidth - (d + h)), p = St(i.clientHeight - (f + u)), y = St(d), b = {
2412
+ rootMargin: -g + "px " + -m + "px " + -p + "px " + -y + "px",
2413
+ threshold: Z(0, ct(1, a)) || 1
1962
2414
  };
1963
- let x = !0;
1964
- function S(v) {
1965
- const k = v[0].intersectionRatio;
1966
- if (k !== a) {
1967
- if (!x)
1968
- return r();
1969
- k ? r(!1, k) : s = setTimeout(() => {
1970
- r(!1, 1e-7);
2415
+ let v = !0;
2416
+ function x(k) {
2417
+ const O = k[0].intersectionRatio;
2418
+ if (O !== a) {
2419
+ if (!v)
2420
+ return o();
2421
+ O ? o(!1, O) : n = setTimeout(() => {
2422
+ o(!1, 1e-7);
1971
2423
  }, 1e3);
1972
2424
  }
1973
- x = !1;
2425
+ O === 1 && !Ie(c, t.getBoundingClientRect()) && o(), v = !1;
1974
2426
  }
1975
2427
  try {
1976
- i = new IntersectionObserver(S, {
1977
- ...y,
2428
+ s = new IntersectionObserver(x, {
2429
+ ...b,
1978
2430
  // Handle <iframe>s
1979
- root: n.ownerDocument
2431
+ root: i.ownerDocument
1980
2432
  });
1981
2433
  } catch {
1982
- i = new IntersectionObserver(S, y);
2434
+ s = new IntersectionObserver(x, b);
1983
2435
  }
1984
- i.observe(t);
2436
+ s.observe(t);
1985
2437
  }
1986
- return r(!0), o;
2438
+ return o(!0), r;
1987
2439
  }
1988
- function Ui(t, e, i, s) {
1989
- s === void 0 && (s = {});
2440
+ function es(t, e, s, n) {
2441
+ n === void 0 && (n = {});
1990
2442
  const {
1991
- ancestorScroll: n = !0,
1992
- ancestorResize: o = !0,
1993
- elementResize: r = typeof ResizeObserver == "function",
2443
+ ancestorScroll: i = !0,
2444
+ ancestorResize: r = !0,
2445
+ elementResize: o = typeof ResizeObserver == "function",
1994
2446
  layoutShift: l = typeof IntersectionObserver == "function",
1995
2447
  animationFrame: a = !1
1996
- } = s, c = qt(t), d = n || o ? [...c ? vt(c) : [], ...vt(e)] : [];
1997
- d.forEach((p) => {
1998
- n && p.addEventListener("scroll", i, {
2448
+ } = n, c = jt(t), d = i || r ? [...c ? yt(c) : [], ...yt(e)] : [];
2449
+ d.forEach((y) => {
2450
+ i && y.addEventListener("scroll", s, {
1999
2451
  passive: !0
2000
- }), o && p.addEventListener("resize", i);
2452
+ }), r && y.addEventListener("resize", s);
2001
2453
  });
2002
- const u = c && l ? Wi(c, i) : null;
2003
- let h = -1, f = null;
2004
- r && (f = new ResizeObserver((p) => {
2005
- let [y] = p;
2006
- y && y.target === c && f && (f.unobserve(e), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
2007
- var x;
2008
- (x = f) == null || x.observe(e);
2009
- })), i();
2010
- }), c && !a && f.observe(c), f.observe(e));
2011
- let g, m = a ? tt(t) : null;
2012
- a && b();
2013
- function b() {
2014
- const p = tt(t);
2015
- m && (p.x !== m.x || p.y !== m.y || p.width !== m.width || p.height !== m.height) && i(), m = p, g = requestAnimationFrame(b);
2016
- }
2017
- return i(), () => {
2018
- var p;
2019
- d.forEach((y) => {
2020
- n && y.removeEventListener("scroll", i), o && y.removeEventListener("resize", i);
2021
- }), u == null || u(), (p = f) == null || p.disconnect(), f = null, a && cancelAnimationFrame(g);
2454
+ const f = c && l ? ts(c, s) : null;
2455
+ let h = -1, u = null;
2456
+ o && (u = new ResizeObserver((y) => {
2457
+ let [w] = y;
2458
+ w && w.target === c && u && (u.unobserve(e), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
2459
+ var b;
2460
+ (b = u) == null || b.observe(e);
2461
+ })), s();
2462
+ }), c && !a && u.observe(c), u.observe(e));
2463
+ let g, m = a ? et(t) : null;
2464
+ a && p();
2465
+ function p() {
2466
+ const y = et(t);
2467
+ m && !Ie(m, y) && s(), m = y, g = requestAnimationFrame(p);
2468
+ }
2469
+ return s(), () => {
2470
+ var y;
2471
+ d.forEach((w) => {
2472
+ i && w.removeEventListener("scroll", s), r && w.removeEventListener("resize", s);
2473
+ }), f == null || f(), (y = u) == null || y.disconnect(), u = null, a && cancelAnimationFrame(g);
2022
2474
  };
2023
2475
  }
2024
- const Ki = Ci, ji = Ai, Xi = Si, Yi = vi, Gi = $i, Ji = (t, e, i) => {
2025
- const s = /* @__PURE__ */ new Map(), n = {
2026
- platform: zi,
2027
- ...i
2028
- }, o = {
2029
- ...n.platform,
2030
- _c: s
2476
+ const ns = In, ss = Fn, is = Mn, os = Tn, rs = Hn, ls = (t, e, s) => {
2477
+ const n = /* @__PURE__ */ new Map(), i = {
2478
+ platform: Zn,
2479
+ ...s
2480
+ }, r = {
2481
+ ...i.platform,
2482
+ _c: n
2031
2483
  };
2032
- return xi(t, e, {
2033
- ...n,
2034
- platform: o
2484
+ return Pn(t, e, {
2485
+ ...i,
2486
+ platform: r
2035
2487
  });
2036
2488
  };
2037
- async function Zi(t) {
2038
- const e = ve.call(this, t);
2039
- e.el.inert = !1, e.el.classList.add(this.settings.stateActive), e.isTooltip || e.trigger.setAttribute("aria-expanded", "true"), e.getCustomProps();
2040
- const i = oi(e), s = e.el.querySelector(i.arrow.element);
2041
- return i.arrow.element = s || void 0, e.floatingCleanup = Ui(e.trigger, e.el, () => {
2042
- Ji(e.trigger, e.el, {
2489
+ async function as(t) {
2490
+ const e = Ee.call(this, t);
2491
+ e.el.inert = !1, e.el.classList.add(this.settings.stateActive), e.isTooltip || e.trigger.setAttribute("aria-expanded", "true"), e.buildCustomProps();
2492
+ const s = pn(e), n = e.el.querySelector(s.arrow.element);
2493
+ return s.arrow.element = n || void 0, e.floatingCleanup = es(e.trigger, e.el, () => {
2494
+ ls(e.trigger, e.el, {
2043
2495
  placement: e.getSetting("placement"),
2044
2496
  middleware: [
2045
- Xi(i.flip),
2046
- ji({ ...i.shift, limiter: Gi() }),
2047
- Ki(i.offset),
2048
- Yi(i.arrow)
2497
+ is(s.flip),
2498
+ ss({ ...s.shift, limiter: rs() }),
2499
+ ns(s.offset),
2500
+ os(s.arrow)
2049
2501
  ]
2050
- }).then(({ x: n, y: o, placement: r, middlewareData: l }) => {
2502
+ }).then(({ x: i, y: r, placement: o, middlewareData: l }) => {
2051
2503
  if (e.el) {
2052
- if (ie(e.el, n, o), i.arrow.element && l.arrow) {
2504
+ if (qt(e.el, i, r), s.arrow.element && l.arrow) {
2053
2505
  const { x: a, y: c } = l.arrow;
2054
- ie(i.arrow.element, a, c);
2506
+ qt(s.arrow.element, a, c);
2055
2507
  }
2056
- e.el.setAttribute("data-floating-placement", r);
2508
+ e.el.setAttribute("data-floating-placement", o);
2057
2509
  }
2058
2510
  });
2059
- }), e.state = "opened", e.getSetting("event") === "click" && ui.call(this, e), e;
2060
- }
2061
- var dt;
2062
- class is extends Rt {
2063
- constructor(i = {}) {
2064
- super({ ...ni, ...i });
2065
- $(this, dt);
2066
- this.trigger = null, E(this, dt, fi.bind(this));
2511
+ }), e.state = "opened", e.getSetting("event") === "click" && En.call(this, e), e.el.dispatchEvent(
2512
+ new CustomEvent(e.getSetting("customEventPrefix") + "opened", {
2513
+ detail: this,
2514
+ bubbles: !0
2515
+ })
2516
+ ), await e.parent.emit("opened", e), e;
2517
+ }
2518
+ var at;
2519
+ class hs extends Ot {
2520
+ constructor(s = {}) {
2521
+ super({ ...mn, ...s });
2522
+ U(this, at);
2523
+ this.module = "Popover", this.entryClass = Sn, this.trigger = null, S(this, at, vn.bind(this));
2067
2524
  }
2068
2525
  get active() {
2069
2526
  return this.get("opened", "state");
2070
2527
  }
2071
2528
  get activeHover() {
2072
- return this.collection.find((i) => i.state == "opened" && i.getSetting("event") == "hover");
2073
- }
2074
- async createEntry(i, s) {
2075
- return new di(this, i, s);
2529
+ return this.collection.find((s) => s.state == "opened" && s.getSetting("event") == "hover");
2076
2530
  }
2077
- async open(i) {
2078
- return Zi.call(this, i);
2531
+ async open(s) {
2532
+ return as.call(this, s);
2079
2533
  }
2080
- async close(i) {
2081
- return Se.call(this, i);
2534
+ async close(s) {
2535
+ return Se.call(this, s);
2082
2536
  }
2083
2537
  async afterMount() {
2084
- document.addEventListener("keydown", w(this, dt), !1);
2538
+ document.addEventListener("keydown", E(this, at), !1);
2085
2539
  }
2086
2540
  async beforeUnmount() {
2087
2541
  this.trigger = null;
2088
2542
  }
2089
2543
  async afterUnmount() {
2090
- document.removeEventListener("keydown", w(this, dt), !1);
2544
+ document.removeEventListener("keydown", E(this, at), !1);
2091
2545
  }
2092
2546
  }
2093
- dt = new WeakMap();
2547
+ at = new WeakMap();
2094
2548
  export {
2095
- ts as Drawer,
2096
- es as Modal,
2097
- is as Popover,
2098
- qi as core
2549
+ us as Drawer,
2550
+ ds as Modal,
2551
+ hs as Popover,
2552
+ fs as core
2099
2553
  };
2100
2554
  //# sourceMappingURL=index.js.map