vrembem 4.0.0-next.2 → 4.0.0-next.4

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,31 +1,31 @@
1
- var Ke = (e, t, i) => {
1
+ var ze = (e, t, n) => {
2
2
  if (!t.has(e))
3
- throw TypeError("Cannot " + i);
4
- }, S = (e, t, i) => (Ke(e, t, "read from private field"), i ? i.call(e) : t.get(e)), Rt = (e, t, i) => {
3
+ throw TypeError("Cannot " + n);
4
+ }, j = (e, t, n) => (ze(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Rt = (e, t, n) => {
5
5
  if (t.has(e))
6
6
  throw TypeError("Cannot add the same private member more than once");
7
- t instanceof WeakSet ? t.add(e) : t.set(e, i);
8
- }, it = (e, t, i, n) => (Ke(e, t, "write to private field"), n ? n.call(e, i) : t.set(e, i), i), P;
9
- let Ai = class {
10
- constructor(t, i) {
11
- Rt(this, P, void 0), this.value = t, it(this, P, i), this.mql = null;
7
+ t instanceof WeakSet ? t.add(e) : t.set(e, n);
8
+ }, nt = (e, t, n, i) => (ze(e, t, "write to private field"), i ? i.call(e, n) : t.set(e, n), n), V;
9
+ let In = class {
10
+ constructor(t, n) {
11
+ Rt(this, V, void 0), this.value = t, nt(this, V, n), this.mql = null;
12
12
  }
13
13
  get handler() {
14
- return S(this, P);
14
+ return j(this, V);
15
15
  }
16
16
  // Unmount existing handler before setting a new one.
17
17
  set handler(t) {
18
- this.mql && (typeof this.mql.removeEventListener == "function" ? this.mql.removeEventListener("change", S(this, P)) : this.mql.removeListener(S(this, P))), it(this, P, t);
18
+ this.mql && this.mql.removeEventListener("change", j(this, V)), nt(this, V, t);
19
19
  }
20
- mount(t, i) {
21
- return t && (this.value = t), i && it(this, P, i), this.value ? (this.mql = window.matchMedia(`(min-width: ${this.value})`), typeof this.mql.addEventListener == "function" ? this.mql.addEventListener("change", S(this, P)) : this.mql.addListener(S(this, P)), S(this, P).call(this, this.mql), this) : this;
20
+ mount(t, n) {
21
+ return t && (this.value = t), n && nt(this, V, n), this.value ? (this.mql = window.matchMedia(`(min-width: ${this.value})`), this.mql.addEventListener("change", j(this, V)), j(this, V).call(this, this.mql), this) : this;
22
22
  }
23
23
  unmount() {
24
- return this.mql ? (typeof this.mql.removeEventListener == "function" ? this.mql.removeEventListener("change", S(this, P)) : this.mql.removeListener(S(this, P)), this.value = null, it(this, P, null), this.mql = null, this) : this;
24
+ return this.mql ? (this.mql.removeEventListener("change", j(this, V)), this.value = null, nt(this, V, null), this.mql = null, this) : this;
25
25
  }
26
26
  };
27
- P = /* @__PURE__ */ new WeakMap();
28
- let Ci = class {
27
+ V = /* @__PURE__ */ new WeakMap();
28
+ let An = class {
29
29
  constructor() {
30
30
  this.collection = [];
31
31
  }
@@ -33,18 +33,18 @@ let Ci = class {
33
33
  return await this.deregister(t), this.collection.push(t), this.collection;
34
34
  }
35
35
  async deregister(t) {
36
- const i = this.collection.findIndex((n) => n === t);
37
- if (i >= 0) {
38
- const n = this.collection[i];
39
- Object.getOwnPropertyNames(n).forEach((s) => {
40
- delete n[s];
41
- }), this.collection.splice(i, 1);
36
+ const n = this.collection.findIndex((i) => i === t);
37
+ if (n >= 0) {
38
+ const i = this.collection[n];
39
+ Object.getOwnPropertyNames(i).forEach((r) => {
40
+ delete i[r];
41
+ }), this.collection.splice(n, 1);
42
42
  }
43
43
  return this.collection;
44
44
  }
45
45
  async registerCollection(t) {
46
- return await Promise.all(Array.from(t, (i) => {
47
- this.register(i);
46
+ return await Promise.all(Array.from(t, (n) => {
47
+ this.register(n);
48
48
  })), this.collection;
49
49
  }
50
50
  async deregisterCollection() {
@@ -52,15 +52,15 @@ let Ci = class {
52
52
  await this.deregister(this.collection[0]);
53
53
  return this.collection;
54
54
  }
55
- get(t, i = "id") {
56
- return this.collection.find((n) => n[i] === t);
55
+ get(t, n = "id") {
56
+ return this.collection.find((i) => i[n] === t);
57
57
  }
58
58
  };
59
59
  const p = {
60
60
  inert: ":not([inert]):not([inert] *)",
61
61
  negTabIndex: ':not([tabindex^="-"])',
62
62
  disabled: ":not(:disabled)"
63
- }, Ii = [
63
+ }, Pn = [
64
64
  `a[href]${p.inert}${p.negTabIndex}`,
65
65
  `area[href]${p.inert}${p.negTabIndex}`,
66
66
  `input:not([type="hidden"]):not([type="radio"])${p.inert}${p.negTabIndex}${p.disabled}`,
@@ -79,15 +79,15 @@ const p = {
79
79
  `[tabindex]${p.inert}${p.negTabIndex}`
80
80
  ];
81
81
  var wt, at, lt;
82
- let Si = class {
83
- constructor(t = null, i = "[data-focus]") {
84
- Rt(this, wt, void 0), Rt(this, at, void 0), Rt(this, lt, void 0), this.el = t, this.selectorFocus = i, it(this, at, qi.bind(this)), it(this, lt, Di.bind(this));
82
+ let Dn = class {
83
+ constructor(t = null, n = "[data-focus]") {
84
+ Rt(this, wt, void 0), Rt(this, at, void 0), Rt(this, lt, void 0), this.el = t, this.selectorFocus = n, nt(this, at, Mn.bind(this)), nt(this, lt, jn.bind(this));
85
85
  }
86
86
  get focusable() {
87
- return S(this, wt);
87
+ return j(this, wt);
88
88
  }
89
89
  set focusable(t) {
90
- it(this, wt, t), S(this, wt).length ? (document.removeEventListener("keydown", S(this, lt)), document.addEventListener("keydown", S(this, at))) : (document.removeEventListener("keydown", S(this, at)), document.addEventListener("keydown", S(this, lt)));
90
+ nt(this, wt, t), j(this, wt).length ? (document.removeEventListener("keydown", j(this, lt)), document.addEventListener("keydown", j(this, at))) : (document.removeEventListener("keydown", j(this, at)), document.addEventListener("keydown", j(this, lt)));
91
91
  }
92
92
  get focusableFirst() {
93
93
  return this.focusable[0];
@@ -95,162 +95,138 @@ let Si = class {
95
95
  get focusableLast() {
96
96
  return this.focusable[this.focusable.length - 1];
97
97
  }
98
- mount(t, i) {
99
- t && (this.el = t), i && (this.selectorFocus = i), this.focusable = this.getFocusable(), this.focus();
98
+ mount(t, n) {
99
+ t && (this.el = t), n && (this.selectorFocus = n), this.focusable = this.getFocusable(), this.focus();
100
100
  }
101
101
  unmount() {
102
- this.el = null, this.focusable = [], document.removeEventListener("keydown", S(this, at)), document.removeEventListener("keydown", S(this, lt));
102
+ this.el = null, this.focusable = [], document.removeEventListener("keydown", j(this, at)), document.removeEventListener("keydown", j(this, lt));
103
103
  }
104
- focus(t = this.el, i = this.selectorFocus) {
105
- (t.querySelector(i) || t).focus();
104
+ focus(t = this.el, n = this.selectorFocus) {
105
+ (t.querySelector(n) || t).focus();
106
106
  }
107
107
  getFocusable(t = this.el) {
108
- const i = [], n = document.activeElement, s = t.scrollTop;
109
- return t.querySelectorAll(Ii.join(",")).forEach((r) => {
110
- r.focus(), document.activeElement === r && i.push(r);
111
- }), t.scrollTop = s, n.focus(), i;
108
+ const n = [], i = document.activeElement, r = t.scrollTop;
109
+ return t.querySelectorAll(Pn.join(",")).forEach((s) => {
110
+ s.focus(), document.activeElement === s && n.push(s);
111
+ }), t.scrollTop = r, i.focus(), n;
112
112
  }
113
113
  };
114
114
  wt = /* @__PURE__ */ new WeakMap(), at = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap();
115
- function qi(e) {
115
+ function Mn(e) {
116
116
  (e.key === "Tab" || e.keyCode === 9) && (e.shiftKey ? (document.activeElement === this.focusableFirst || document.activeElement === this.el) && (e.preventDefault(), this.focusableLast.focus()) : (document.activeElement === this.focusableLast || document.activeElement === this.el) && (e.preventDefault(), this.focusableFirst.focus()));
117
117
  }
118
- function Di(e) {
118
+ function jn(e) {
119
119
  (e.key === "Tab" || e.keyCode === 9) && e.preventDefault();
120
120
  }
121
- function Pi(e, t) {
122
- const i = (e.getAttribute(`data-${t}`) || "").replace(/'/g, '"');
123
- return i ? JSON.parse(i) : {};
121
+ function Ke() {
122
+ return getComputedStyle(document.body).getPropertyValue("--vrembem-prefix").trim();
124
123
  }
125
- function Mi() {
126
- return getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix").trim();
124
+ function Ge(e, t = document.body, n = !0) {
125
+ if (n) {
126
+ const r = Ke();
127
+ r && !e.includes(`--${r}`) && (e = e.replace("--", `--${r}`));
128
+ }
129
+ const i = getComputedStyle(t).getPropertyValue(e).trim();
130
+ if (i)
131
+ return i;
132
+ throw new Error(`CSS variable "${e}" was not found!`);
133
+ }
134
+ function qn(e, t) {
135
+ const n = (e.getAttribute(`data-${t}`) || "").replace(/'/g, '"');
136
+ return n ? JSON.parse(n) : {};
127
137
  }
128
- function Wi(e, t = !0) {
129
- const i = localStorage.getItem(e), n = i ? JSON.parse(i) : {};
138
+ function Fn(e, t = !0) {
139
+ const n = localStorage.getItem(e), i = n ? JSON.parse(n) : {};
130
140
  return {
131
- get(s) {
132
- return s ? n[s] : n;
141
+ get(r) {
142
+ return r ? i[r] : i;
133
143
  },
134
- set(s, r) {
135
- return r ? n[s] = r : delete n[s], t && localStorage.setItem(e, JSON.stringify(n)), n;
144
+ set(r, s) {
145
+ return s ? i[r] = s : delete i[r], t && localStorage.setItem(e, JSON.stringify(i)), i;
136
146
  }
137
147
  };
138
148
  }
139
- function ji(e, t, i) {
140
- const n = t.nodeType === Node.COMMENT_NODE, s = t.nodeType === Node.ELEMENT_NODE;
141
- if (t = n || s ? t : document.querySelector(t), n && (i = "after"), !t)
149
+ function Nn(e, t, n) {
150
+ const i = t.nodeType === Node.COMMENT_NODE, r = t.nodeType === Node.ELEMENT_NODE;
151
+ if (t = i || r ? t : document.querySelector(t), i && (n = "after"), !t)
142
152
  throw new Error(`Not a valid teleport reference: '${t}'`);
143
- if (typeof t[i] != "function")
144
- throw new Error(`Not a valid teleport method: '${i}'`);
145
- let r = null;
146
- return n || (r = document.createComment("teleported #" + e.id), e.before(r)), t[i](e), n && t.remove(), r;
147
- }
148
- const Ni = (e, t) => new Promise((i) => {
149
- t.transition ? (e.classList.remove(t.stateClosed), e.classList.add(t.stateOpening), e.addEventListener("transitionend", function n(s) {
150
- s.target == e && (e.classList.add(t.stateOpened), e.classList.remove(t.stateOpening), i(e), this.removeEventListener("transitionend", n));
151
- })) : (e.classList.add(t.stateOpened), e.classList.remove(t.stateClosed), i(e));
152
- }), _i = (e, t) => new Promise((i) => {
153
- t.transition ? (e.classList.add(t.stateClosing), e.classList.remove(t.stateOpened), e.addEventListener("transitionend", function n(s) {
154
- s.target == e && (e.classList.remove(t.stateClosing), e.classList.add(t.stateClosed), i(e), this.removeEventListener("transitionend", n));
155
- })) : (e.classList.add(t.stateClosed), e.classList.remove(t.stateOpened), i(e));
156
- });
157
- function Fi(e, t) {
158
- t && document.querySelectorAll(t).forEach((i) => {
159
- e ? i.style.overflow = "hidden" : i.style.removeProperty("overflow");
153
+ if (typeof t[n] != "function")
154
+ throw new Error(`Not a valid teleport method: '${n}'`);
155
+ let s = null;
156
+ return i || (s = document.createComment("teleported #" + e.id), e.before(s)), t[n](e), i && t.remove(), s;
157
+ }
158
+ function Wn(e, t, n, i = "--transition-duration") {
159
+ return new Promise((r) => {
160
+ if (typeof i == "string") {
161
+ const s = Ge(i, e), a = !!s.includes("ms");
162
+ i = parseFloat(s) * (a ? 1 : 1e3);
163
+ }
164
+ e.classList.remove(t.finish), e.classList.add(n.start), setTimeout(() => {
165
+ e.classList.add(n.finish), e.classList.remove(n.start), r(e);
166
+ }, i);
167
+ });
168
+ }
169
+ function _n(e, t) {
170
+ t && document.querySelectorAll(t).forEach((n) => {
171
+ e ? n.style.overflow = "hidden" : n.style.removeProperty("overflow");
160
172
  });
161
173
  }
162
- function Bi(e, t) {
163
- t && document.querySelectorAll(t).forEach((i) => {
164
- e ? (i.inert = !0, i.setAttribute("aria-hidden", !0)) : (i.inert = null, i.removeAttribute("aria-hidden"));
174
+ function Bn(e, t) {
175
+ t && document.querySelectorAll(t).forEach((n) => {
176
+ e ? (n.inert = !0, n.setAttribute("aria-hidden", !0)) : (n.inert = null, n.removeAttribute("aria-hidden"));
165
177
  });
166
178
  }
167
- function Ri(e, t) {
168
- Bi(!!e, t.selectorInert), Fi(!!e, t.selectorOverflow);
179
+ function Rn(e, t) {
180
+ Bn(!!e, t.selectorInert), _n(!!e, t.selectorOverflow);
169
181
  }
170
- const Qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
182
+ const zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
171
183
  __proto__: null,
172
- Breakpoint: Ai,
173
- Collection: Ci,
174
- FocusTrap: Si,
175
- closeTransition: _i,
176
- getConfig: Pi,
177
- getPrefix: Mi,
178
- localStore: Wi,
179
- openTransition: Ni,
180
- teleport: ji,
181
- updateGlobalState: Ri
182
- }, Symbol.toStringTag, { value: "Module" })), Hi = {
183
- autoInit: !1,
184
- stateAttr: "aria-checked",
185
- stateValue: "mixed"
186
- };
187
- let Zs = class {
188
- constructor(t) {
189
- this.defaults = Hi, this.settings = { ...this.defaults, ...t }, this.__handlerClick = this.handlerClick.bind(this), this.settings.autoInit && this.init();
190
- }
191
- init(t = null) {
192
- t && (this.settings = { ...this.settings, ...t });
193
- const i = `[${this.settings.stateAttr}="${this.settings.stateValue}"]`, n = document.querySelectorAll(i);
194
- this.setIndeterminate(n), document.addEventListener("click", this.__handlerClick, !1);
195
- }
196
- destroy() {
197
- document.removeEventListener("click", this.__handlerClick, !1);
198
- }
199
- handlerClick(t) {
200
- const i = `[${this.settings.stateAttr}="${this.settings.stateValue}"]`, n = t.target.closest(i);
201
- n && (this.removeAriaState(n), this.setIndeterminate(n));
202
- }
203
- setAriaState(t, i = this.settings.stateValue) {
204
- t = t.forEach ? t : [t], t.forEach((n) => {
205
- n.setAttribute(this.settings.stateAttr, i);
206
- });
207
- }
208
- removeAriaState(t) {
209
- t = t.forEach ? t : [t], t.forEach((i) => {
210
- i.removeAttribute(this.settings.stateAttr);
211
- });
212
- }
213
- setIndeterminate(t) {
214
- t = t.forEach ? t : [t], t.forEach((i) => {
215
- i.hasAttribute(this.settings.stateAttr) ? i.indeterminate = !0 : i.indeterminate = !1;
216
- });
217
- }
218
- };
219
- var Ge = (e, t, i) => {
184
+ Breakpoint: In,
185
+ Collection: An,
186
+ FocusTrap: Dn,
187
+ cssVar: Ge,
188
+ getConfig: qn,
189
+ getPrefix: Ke,
190
+ localStore: Fn,
191
+ teleport: Nn,
192
+ transition: Wn,
193
+ updateGlobalState: Rn
194
+ }, Symbol.toStringTag, { value: "Module" }));
195
+ var Qe = (e, t, n) => {
220
196
  if (!t.has(e))
221
- throw TypeError("Cannot " + i);
222
- }, _t = (e, t, i) => (Ge(e, t, "read from private field"), i ? i.call(e) : t.get(e)), qe = (e, t, i) => {
197
+ throw TypeError("Cannot " + n);
198
+ }, Wt = (e, t, n) => (Qe(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Ae = (e, t, n) => {
223
199
  if (t.has(e))
224
200
  throw TypeError("Cannot add the same private member more than once");
225
- t instanceof WeakSet ? t.add(e) : t.set(e, i);
226
- }, De = (e, t, i, n) => (Ge(e, t, "write to private field"), n ? n.call(e, i) : t.set(e, i), i), Qe = (e, t, i) => {
201
+ t instanceof WeakSet ? t.add(e) : t.set(e, n);
202
+ }, Pe = (e, t, n, i) => (Qe(e, t, "write to private field"), i ? i.call(e, n) : t.set(e, n), n), Ze = (e, t, n) => {
227
203
  if (!t.has(e))
228
- throw TypeError("Cannot " + i);
229
- }, q = (e, t, i) => (Qe(e, t, "read from private field"), i ? i.call(e) : t.get(e)), Ht = (e, t, i) => {
204
+ throw TypeError("Cannot " + n);
205
+ }, q = (e, t, n) => (Ze(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Vt = (e, t, n) => {
230
206
  if (t.has(e))
231
207
  throw TypeError("Cannot add the same private member more than once");
232
- t instanceof WeakSet ? t.add(e) : t.set(e, i);
233
- }, nt = (e, t, i, n) => (Qe(e, t, "write to private field"), n ? n.call(e, i) : t.set(e, i), i), M;
234
- let Vi = class {
235
- constructor(t, i) {
236
- Ht(this, M, void 0), this.value = t, nt(this, M, i), this.mql = null;
208
+ t instanceof WeakSet ? t.add(e) : t.set(e, n);
209
+ }, it = (e, t, n, i) => (Ze(e, t, "write to private field"), i ? i.call(e, n) : t.set(e, n), n), H;
210
+ let Vn = class {
211
+ constructor(t, n) {
212
+ Vt(this, H, void 0), this.value = t, it(this, H, n), this.mql = null;
237
213
  }
238
214
  get handler() {
239
- return q(this, M);
215
+ return q(this, H);
240
216
  }
241
217
  // Unmount existing handler before setting a new one.
242
218
  set handler(t) {
243
- this.mql && (typeof this.mql.removeEventListener == "function" ? this.mql.removeEventListener("change", q(this, M)) : this.mql.removeListener(q(this, M))), nt(this, M, t);
219
+ this.mql && this.mql.removeEventListener("change", q(this, H)), it(this, H, t);
244
220
  }
245
- mount(t, i) {
246
- return t && (this.value = t), i && nt(this, M, i), this.value ? (this.mql = window.matchMedia(`(min-width: ${this.value})`), typeof this.mql.addEventListener == "function" ? this.mql.addEventListener("change", q(this, M)) : this.mql.addListener(q(this, M)), q(this, M).call(this, this.mql), this) : this;
221
+ mount(t, n) {
222
+ return t && (this.value = t), n && it(this, H, n), this.value ? (this.mql = window.matchMedia(`(min-width: ${this.value})`), this.mql.addEventListener("change", q(this, H)), q(this, H).call(this, this.mql), this) : this;
247
223
  }
248
224
  unmount() {
249
- return this.mql ? (typeof this.mql.removeEventListener == "function" ? this.mql.removeEventListener("change", q(this, M)) : this.mql.removeListener(q(this, M)), this.value = null, nt(this, M, null), this.mql = null, this) : this;
225
+ return this.mql ? (this.mql.removeEventListener("change", q(this, H)), this.value = null, it(this, H, null), this.mql = null, this) : this;
250
226
  }
251
227
  };
252
- M = /* @__PURE__ */ new WeakMap();
253
- let Ji = class {
228
+ H = /* @__PURE__ */ new WeakMap();
229
+ let Hn = class {
254
230
  constructor() {
255
231
  this.collection = [];
256
232
  }
@@ -258,18 +234,18 @@ let Ji = class {
258
234
  return await this.deregister(t), this.collection.push(t), this.collection;
259
235
  }
260
236
  async deregister(t) {
261
- const i = this.collection.findIndex((n) => n === t);
262
- if (i >= 0) {
263
- const n = this.collection[i];
264
- Object.getOwnPropertyNames(n).forEach((s) => {
265
- delete n[s];
266
- }), this.collection.splice(i, 1);
237
+ const n = this.collection.findIndex((i) => i === t);
238
+ if (n >= 0) {
239
+ const i = this.collection[n];
240
+ Object.getOwnPropertyNames(i).forEach((r) => {
241
+ delete i[r];
242
+ }), this.collection.splice(n, 1);
267
243
  }
268
244
  return this.collection;
269
245
  }
270
246
  async registerCollection(t) {
271
- return await Promise.all(Array.from(t, (i) => {
272
- this.register(i);
247
+ return await Promise.all(Array.from(t, (n) => {
248
+ this.register(n);
273
249
  })), this.collection;
274
250
  }
275
251
  async deregisterCollection() {
@@ -277,15 +253,15 @@ let Ji = class {
277
253
  await this.deregister(this.collection[0]);
278
254
  return this.collection;
279
255
  }
280
- get(t, i = "id") {
281
- return this.collection.find((n) => n[i] === t);
256
+ get(t, n = "id") {
257
+ return this.collection.find((i) => i[n] === t);
282
258
  }
283
259
  };
284
260
  const g = {
285
261
  inert: ":not([inert]):not([inert] *)",
286
262
  negTabIndex: ':not([tabindex^="-"])',
287
263
  disabled: ":not(:disabled)"
288
- }, zi = [
264
+ }, Jn = [
289
265
  `a[href]${g.inert}${g.negTabIndex}`,
290
266
  `area[href]${g.inert}${g.negTabIndex}`,
291
267
  `input:not([type="hidden"]):not([type="radio"])${g.inert}${g.negTabIndex}${g.disabled}`,
@@ -304,15 +280,15 @@ const g = {
304
280
  `[tabindex]${g.inert}${g.negTabIndex}`
305
281
  ];
306
282
  var $t, ct, dt;
307
- let Ki = class {
308
- constructor(t = null, i = "[data-focus]") {
309
- Ht(this, $t, void 0), Ht(this, ct, void 0), Ht(this, dt, void 0), this.el = t, this.selectorFocus = i, nt(this, ct, Gi.bind(this)), nt(this, dt, Qi.bind(this));
283
+ let zn = class {
284
+ constructor(t = null, n = "[data-focus]") {
285
+ Vt(this, $t, void 0), Vt(this, ct, void 0), Vt(this, dt, void 0), this.el = t, this.selectorFocus = n, it(this, ct, Kn.bind(this)), it(this, dt, Gn.bind(this));
310
286
  }
311
287
  get focusable() {
312
288
  return q(this, $t);
313
289
  }
314
290
  set focusable(t) {
315
- nt(this, $t, t), q(this, $t).length ? (document.removeEventListener("keydown", q(this, dt)), document.addEventListener("keydown", q(this, ct))) : (document.removeEventListener("keydown", q(this, ct)), document.addEventListener("keydown", q(this, dt)));
291
+ it(this, $t, t), q(this, $t).length ? (document.removeEventListener("keydown", q(this, dt)), document.addEventListener("keydown", q(this, ct))) : (document.removeEventListener("keydown", q(this, ct)), document.addEventListener("keydown", q(this, dt)));
316
292
  }
317
293
  get focusableFirst() {
318
294
  return this.focusable[0];
@@ -320,70 +296,82 @@ let Ki = class {
320
296
  get focusableLast() {
321
297
  return this.focusable[this.focusable.length - 1];
322
298
  }
323
- mount(t, i) {
324
- t && (this.el = t), i && (this.selectorFocus = i), this.focusable = this.getFocusable(), this.focus();
299
+ mount(t, n) {
300
+ t && (this.el = t), n && (this.selectorFocus = n), this.focusable = this.getFocusable(), this.focus();
325
301
  }
326
302
  unmount() {
327
303
  this.el = null, this.focusable = [], document.removeEventListener("keydown", q(this, ct)), document.removeEventListener("keydown", q(this, dt));
328
304
  }
329
- focus(t = this.el, i = this.selectorFocus) {
330
- (t.querySelector(i) || t).focus();
305
+ focus(t = this.el, n = this.selectorFocus) {
306
+ (t.querySelector(n) || t).focus();
331
307
  }
332
308
  getFocusable(t = this.el) {
333
- const i = [], n = document.activeElement, s = t.scrollTop;
334
- return t.querySelectorAll(zi.join(",")).forEach((r) => {
335
- r.focus(), document.activeElement === r && i.push(r);
336
- }), t.scrollTop = s, n.focus(), i;
309
+ const n = [], i = document.activeElement, r = t.scrollTop;
310
+ return t.querySelectorAll(Jn.join(",")).forEach((s) => {
311
+ s.focus(), document.activeElement === s && n.push(s);
312
+ }), t.scrollTop = r, i.focus(), n;
337
313
  }
338
314
  };
339
315
  $t = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap();
340
- function Gi(e) {
316
+ function Kn(e) {
341
317
  (e.key === "Tab" || e.keyCode === 9) && (e.shiftKey ? (document.activeElement === this.focusableFirst || document.activeElement === this.el) && (e.preventDefault(), this.focusableLast.focus()) : (document.activeElement === this.focusableLast || document.activeElement === this.el) && (e.preventDefault(), this.focusableFirst.focus()));
342
318
  }
343
- function Qi(e) {
319
+ function Gn(e) {
344
320
  (e.key === "Tab" || e.keyCode === 9) && e.preventDefault();
345
321
  }
346
- function Zi(e, t) {
347
- const i = (e.getAttribute(`data-${t}`) || "").replace(/'/g, '"');
348
- return i ? JSON.parse(i) : {};
322
+ function Xe() {
323
+ return getComputedStyle(document.body).getPropertyValue("--vrembem-prefix").trim();
324
+ }
325
+ function Qn(e, t = document.body, n = !0) {
326
+ if (n) {
327
+ const r = Xe();
328
+ r && !e.includes(`--${r}`) && (e = e.replace("--", `--${r}`));
329
+ }
330
+ const i = getComputedStyle(t).getPropertyValue(e).trim();
331
+ if (i)
332
+ return i;
333
+ throw new Error(`CSS variable "${e}" was not found!`);
349
334
  }
350
- function Ui() {
351
- return getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix").trim();
335
+ function Zn(e, t) {
336
+ const n = (e.getAttribute(`data-${t}`) || "").replace(/'/g, '"');
337
+ return n ? JSON.parse(n) : {};
352
338
  }
353
- function Xi(e, t = !0) {
354
- const i = localStorage.getItem(e), n = i ? JSON.parse(i) : {};
339
+ function Xn(e, t = !0) {
340
+ const n = localStorage.getItem(e), i = n ? JSON.parse(n) : {};
355
341
  return {
356
- get(s) {
357
- return s ? n[s] : n;
342
+ get(r) {
343
+ return r ? i[r] : i;
358
344
  },
359
- set(s, r) {
360
- return r ? n[s] = r : delete n[s], t && localStorage.setItem(e, JSON.stringify(n)), n;
345
+ set(r, s) {
346
+ return s ? i[r] = s : delete i[r], t && localStorage.setItem(e, JSON.stringify(i)), i;
361
347
  }
362
348
  };
363
349
  }
364
- const Yi = (e, t) => new Promise((i) => {
365
- t.transition ? (e.classList.remove(t.stateClosed), e.classList.add(t.stateOpening), e.addEventListener("transitionend", function n(s) {
366
- s.target == e && (e.classList.add(t.stateOpened), e.classList.remove(t.stateOpening), i(e), this.removeEventListener("transitionend", n));
367
- })) : (e.classList.add(t.stateOpened), e.classList.remove(t.stateClosed), i(e));
368
- }), tn = (e, t) => new Promise((i) => {
369
- t.transition ? (e.classList.add(t.stateClosing), e.classList.remove(t.stateOpened), e.addEventListener("transitionend", function n(s) {
370
- s.target == e && (e.classList.remove(t.stateClosing), e.classList.add(t.stateClosed), i(e), this.removeEventListener("transitionend", n));
371
- })) : (e.classList.add(t.stateClosed), e.classList.remove(t.stateOpened), i(e));
372
- });
373
- function en(e, t) {
374
- t && document.querySelectorAll(t).forEach((i) => {
375
- e ? i.style.overflow = "hidden" : i.style.removeProperty("overflow");
350
+ function Ye(e, t, n, i = "--transition-duration") {
351
+ return new Promise((r) => {
352
+ if (typeof i == "string") {
353
+ const s = Qn(i, e), a = !!s.includes("ms");
354
+ i = parseFloat(s) * (a ? 1 : 1e3);
355
+ }
356
+ e.classList.remove(t.finish), e.classList.add(n.start), setTimeout(() => {
357
+ e.classList.add(n.finish), e.classList.remove(n.start), r(e);
358
+ }, i);
376
359
  });
377
360
  }
378
- function nn(e, t) {
379
- t && document.querySelectorAll(t).forEach((i) => {
380
- e ? (i.inert = !0, i.setAttribute("aria-hidden", !0)) : (i.inert = null, i.removeAttribute("aria-hidden"));
361
+ function Yn(e, t) {
362
+ t && document.querySelectorAll(t).forEach((n) => {
363
+ e ? n.style.overflow = "hidden" : n.style.removeProperty("overflow");
381
364
  });
382
365
  }
383
- function le(e, t) {
384
- nn(!!e, t.selectorInert), en(!!e, t.selectorOverflow);
366
+ function Un(e, t) {
367
+ t && document.querySelectorAll(t).forEach((n) => {
368
+ e ? (n.inert = !0, n.setAttribute("aria-hidden", !0)) : (n.inert = null, n.removeAttribute("aria-hidden"));
369
+ });
385
370
  }
386
- const sn = {
371
+ function ae(e, t) {
372
+ Un(!!e, t.selectorInert), Yn(!!e, t.selectorOverflow);
373
+ }
374
+ const ti = {
387
375
  autoInit: !1,
388
376
  // Data attributes
389
377
  dataOpen: "drawer-open",
@@ -394,6 +382,7 @@ const sn = {
394
382
  // Selectors
395
383
  selectorDrawer: ".drawer",
396
384
  selectorDialog: ".drawer__dialog",
385
+ selectorScreen: ".drawer",
397
386
  selectorFocus: "[data-focus]",
398
387
  selectorInert: null,
399
388
  selectorOverflow: "body",
@@ -411,230 +400,239 @@ const sn = {
411
400
  store: !0,
412
401
  storeKey: "VB:DrawerState",
413
402
  setTabindex: !0,
414
- transition: !0
403
+ transition: !0,
404
+ transitionDuration: "--vb-drawer-transition-duration"
415
405
  };
416
- function rn(e) {
406
+ async function ei(e) {
417
407
  const t = e.target.closest(`
418
408
  [data-${this.settings.dataOpen}],
419
409
  [data-${this.settings.dataToggle}],
420
410
  [data-${this.settings.dataClose}]
421
411
  `);
422
412
  if (t) {
423
- e.preventDefault(), t.matches(`[data-${this.settings.dataToggle}]`) && t.getAttribute(`data-${this.settings.dataToggle}`).trim().split(" ").forEach((i) => {
424
- const n = this.get(i);
425
- n.trigger = t, n.toggle();
426
- }), t.matches(`[data-${this.settings.dataOpen}]`) && t.getAttribute(`data-${this.settings.dataOpen}`).trim().split(" ").forEach((i) => {
427
- const n = this.get(i);
428
- n.trigger = t, n.open();
429
- }), t.matches(`[data-${this.settings.dataClose}]`) && t.getAttribute(`data-${this.settings.dataClose}`).trim().split(" ").forEach((i) => {
430
- if (i) {
431
- const n = this.get(i);
432
- n.trigger = t, n.close();
413
+ e.preventDefault(), t.matches(`[data-${this.settings.dataToggle}]`) && t.getAttribute(`data-${this.settings.dataToggle}`).trim().split(" ").forEach((n) => {
414
+ const i = this.get(n);
415
+ return i.trigger = t, i.toggle();
416
+ }), t.matches(`[data-${this.settings.dataOpen}]`) && t.getAttribute(`data-${this.settings.dataOpen}`).trim().split(" ").forEach((n) => {
417
+ const i = this.get(n);
418
+ return i.trigger = t, i.open();
419
+ }), t.matches(`[data-${this.settings.dataClose}]`) && t.getAttribute(`data-${this.settings.dataClose}`).trim().split(" ").forEach((n) => {
420
+ if (n) {
421
+ const i = this.get(n);
422
+ return i.trigger = t, i.close();
433
423
  } else {
434
- const n = e.target.closest(this.settings.selectorDrawer);
435
- n && this.close(n);
424
+ const i = e.target.closest(this.settings.selectorDrawer);
425
+ if (i)
426
+ return this.close(i);
436
427
  }
437
428
  });
438
429
  return;
439
430
  }
440
- e.target.matches(this.settings.selectorDrawer) && this.close(e.target.id);
431
+ if (this.activeModal && e.target.matches(this.settings.selectorScreen))
432
+ return this.close(this.activeModal.id);
441
433
  }
442
- function on(e) {
443
- if (e.key === "Escape") {
444
- const t = this.activeModal;
445
- t && this.close(t);
446
- }
434
+ function ni(e) {
435
+ if (e.key === "Escape" && this.activeModal)
436
+ return this.close(this.activeModal);
447
437
  }
448
- async function ie(e, t = !0) {
449
- if (!e)
450
- return this.collection;
451
- const i = this.collection.findIndex((n) => n.id === e.id);
452
- if (i >= 0) {
453
- const n = this.collection[i];
454
- t && n.state === "opened" && await n.close(!1), this.store.set(n.id), n.unmountBreakpoint(), Object.getOwnPropertyNames(n).forEach((s) => {
455
- delete n[s];
456
- }), this.collection.splice(i, 1);
438
+ async function ee(e, t = !0) {
439
+ const n = this.collection.findIndex((i) => i.id === e.id);
440
+ if (n >= 0) {
441
+ const i = this.collection[n];
442
+ t && i.state === "opened" && await i.close(!1), this.store.set(i.id), i.unmountBreakpoint(), Object.getOwnPropertyNames(i).forEach((r) => {
443
+ delete i[r];
444
+ }), this.collection.splice(n, 1);
457
445
  }
458
446
  return this.collection;
459
447
  }
460
- function an(e) {
461
- const t = Ui(), i = e.getAttribute(`data-${this.settings.dataBreakpoint}`);
462
- return this.settings.breakpoints && this.settings.breakpoints[i] ? this.settings.breakpoints[i] : getComputedStyle(document.body).getPropertyValue(`--${t}breakpoint-${i}`).trim() ? getComputedStyle(document.body).getPropertyValue(`--${t}breakpoint-${i}`).trim() : i;
448
+ function ii(e) {
449
+ e.store === "opened" ? e.open(!1, !1) : e.store === "closed" ? e.close(!1, !1) : e.store === "indeterminate" ? e.state = "indeterminate" : e.el.classList.contains(e.getSetting("stateOpened")) ? e.open(!1, !1) : e.el.classList.contains(e.getSetting("stateClosed")) ? e.close(!1, !1) : e.state = "indeterminate";
450
+ }
451
+ async function ri(e) {
452
+ e.store === "opened" ? await e.open(!1, !1) : e.store === "closed" ? await e.close(!1, !1) : e.store === "indeterminate" ? e.state != "indeterminate" && (e.state = "indeterminate") : (e.state != e.inlineState && (e.state = e.inlineState), e.inlineState === "opened" ? await e.open(!1, !1) : e.inlineState === "closed" && await e.close(!1, !1));
453
+ }
454
+ function si(e) {
455
+ const t = Xe(), n = e.getAttribute(`data-${this.settings.dataBreakpoint}`);
456
+ return this.settings.breakpoints && this.settings.breakpoints[n] ? this.settings.breakpoints[n] : getComputedStyle(document.body).getPropertyValue(`--${t}breakpoint-${n}`).trim() ? getComputedStyle(document.body).getPropertyValue(`--${t}breakpoint-${n}`).trim() : n;
463
457
  }
464
- function ce(e) {
458
+ function le(e) {
465
459
  const t = typeof e == "string" ? this.get(e) : this.get(e.id);
466
460
  if (t)
467
461
  return t;
468
462
  throw new Error(`Drawer not found in collection with id of "${e.id || e}".`);
469
463
  }
470
- function Ze(e) {
471
- return typeof e == "string" ? e : typeof e.hasAttribute == "function" ? e.hasAttribute(`data-${this.settings.dataOpen}`) ? e.getAttribute(`data-${this.settings.dataOpen}`) : e.hasAttribute(`data-${this.settings.dataClose}`) ? e.getAttribute(`data-${this.settings.dataClose}`) || !1 : e.hasAttribute(`data-${this.settings.dataToggle}`) ? e.getAttribute(`data-${this.settings.dataToggle}`) : e.closest(this.settings.selectorDrawer) ? (e = e.closest(this.settings.selectorDrawer), e.id || !1) : !1 : e.id ? e.id : !1;
472
- }
473
- function ln(e) {
474
- const t = Ze.call(this, e);
475
- if (t) {
476
- const i = document.querySelector(`#${t}`), n = i ? i.querySelector(this.settings.selectorDialog) : null;
477
- return !i && !n ? { error: new Error(`No drawer elements found using the ID: "${t}".`) } : n ? { drawer: i, dialog: n } : { error: new Error("Drawer is missing dialog element.") };
478
- } else
479
- return { error: new Error("Could not resolve the drawer ID.") };
480
- }
481
- async function Ue(e) {
482
- this.store.get(e.id) ? this.store.get(e.id) === "opened" ? await e.open(!1, !1) : await e.close(!1, !1) : e.el.classList.contains(this.settings.stateOpened) ? e.state = "opened" : (e.el.classList.remove(this.settings.stateOpening), e.el.classList.remove(this.settings.stateClosing), e.el.classList.add(this.settings.stateClosed));
483
- }
484
- function Xe(e) {
464
+ function Ue(e) {
485
465
  e.state === "opened" ? e.mode === "modal" ? this.focusTrap.mount(e.dialog, this.settings.selectorFocus) : this.focusTrap.focus(e.dialog, this.settings.selectorFocus) : (e.trigger && (e.trigger.focus(), e.trigger = null), this.focusTrap.unmount());
486
466
  }
487
- async function de(e, t, i = !0) {
488
- const n = ce.call(this, e), s = { ...this.settings, ...n.settings };
489
- return t !== void 0 && (s.transition = t), n.state === "closed" && (n.state = "opening", await Yi(n.el, s), n.mode === "modal" && le(!0, s), n.state = "opened"), i && Xe.call(this, n), n.el.dispatchEvent(new CustomEvent(s.customEventPrefix + "opened", {
467
+ async function ce(e, t, n = !0) {
468
+ const i = le.call(this, e), r = { ...this.settings, ...i.settings };
469
+ return t !== void 0 && (r.transition = t), (i.state === "closed" || i.state === "indeterminate") && (i.state = "opening", r.transition ? await Ye(i.el, {
470
+ start: r.stateClosing,
471
+ finish: r.stateClosed
472
+ }, {
473
+ start: r.stateOpening,
474
+ finish: r.stateOpened
475
+ }, r.transitionDuration) : (i.el.classList.add(r.stateOpened), i.el.classList.remove(r.stateClosed)), i.state = "opened", i.mode === "modal" && ae(!0, r), n && Ue.call(this, i), i.el.dispatchEvent(new CustomEvent(r.customEventPrefix + "opened", {
490
476
  detail: this,
491
477
  bubbles: !0
492
- })), n;
478
+ }))), i;
493
479
  }
494
- async function Kt(e, t, i = !0) {
495
- const n = ce.call(this, e), s = { ...this.settings, ...n.settings };
496
- return t !== void 0 && (s.transition = t), n.state === "opened" && (n.state = "closing", document.activeElement.blur(), await tn(n.el, s), n.mode === "modal" && le(!1, s), i && Xe.call(this, n), n.state = "closed", n.el.dispatchEvent(new CustomEvent(s.customEventPrefix + "closed", {
480
+ async function zt(e, t, n = !0) {
481
+ const i = le.call(this, e), r = { ...this.settings, ...i.settings };
482
+ return t !== void 0 && (r.transition = t), (i.state === "opened" || i.state === "indeterminate") && (i.state = "closing", document.activeElement.blur(), r.transition ? await Ye(i.el, {
483
+ start: r.stateOpening,
484
+ finish: r.stateOpened
485
+ }, {
486
+ start: r.stateClosing,
487
+ finish: r.stateClosed
488
+ }, r.transitionDuration) : (i.el.classList.add(r.stateClosed), i.el.classList.remove(r.stateOpened)), i.state = "closed", i.mode === "modal" && ae(!1, r), n && Ue.call(this, i), i.el.dispatchEvent(new CustomEvent(r.customEventPrefix + "closed", {
497
489
  detail: this,
498
490
  bubbles: !0
499
- }))), n;
491
+ }))), i;
500
492
  }
501
- async function Ye(e, t, i) {
502
- const n = ce.call(this, e);
503
- return n.state === "closed" ? de.call(this, n, t, i) : Kt.call(this, n, t, i);
493
+ async function tn(e, t, n) {
494
+ const i = le.call(this, e);
495
+ return i.state === "closed" ? ce.call(this, i, t, n) : zt.call(this, i, t, n);
504
496
  }
505
- function cn(e) {
497
+ function oi(e) {
506
498
  switch (e.mode) {
507
499
  case "inline":
508
- return dn.call(this, e);
500
+ return ai.call(this, e);
509
501
  case "modal":
510
- return un.call(this, e);
502
+ return li.call(this, e);
511
503
  default:
512
504
  throw new Error(`"${e.mode}" is not a valid drawer mode.`);
513
505
  }
514
506
  }
515
- async function dn(e) {
516
- return e.el.classList.remove(e.getSetting("classModal")), e.dialog.removeAttribute("aria-modal"), le(!1, { ...this.settings, ...e.settings }), this.focusTrap.unmount(), await Ue.call(this, e), e.el.dispatchEvent(new CustomEvent(e.getSetting("customEventPrefix") + "switchMode", {
507
+ async function ai(e) {
508
+ return e.el.classList.remove(e.getSetting("classModal")), e.dialog.removeAttribute("aria-modal"), ae(!1, { ...this.settings, ...e.settings }), this.focusTrap.unmount(), await ri(e), e.el.dispatchEvent(new CustomEvent(e.getSetting("customEventPrefix") + "switchMode", {
517
509
  detail: this,
518
510
  bubbles: !0
519
511
  })), e;
520
512
  }
521
- async function un(e) {
522
- return e.el.classList.add(e.getSetting("classModal")), e.dialog.setAttribute("aria-modal", "true"), !this.store.get(e.id) && e.el.classList.contains(e.getSetting("stateOpened")) && this.store.set(e.id, "opened"), await Kt.call(this, e, !1, !1), e.el.dispatchEvent(new CustomEvent(e.getSetting("customEventPrefix") + "switchMode", {
513
+ async function li(e) {
514
+ return e.el.classList.add(e.getSetting("classModal")), e.dialog.setAttribute("aria-modal", "true"), await zt.call(this, e, !1, !1), e.el.dispatchEvent(new CustomEvent(e.getSetting("customEventPrefix") + "switchMode", {
523
515
  detail: this,
524
516
  bubbles: !0
525
517
  })), e;
526
518
  }
527
- async function hn(e, t) {
528
- await ie.call(this, e, !1);
529
- const i = this, n = new Vi(), s = {
530
- open(o, c) {
531
- return de.call(i, this, o, c);
519
+ async function ci(e, t = {}) {
520
+ await ee.call(this, e, !1);
521
+ const n = this, i = new Vn();
522
+ let r, s = "indeterminate";
523
+ const a = {
524
+ id: e.id,
525
+ el: e,
526
+ dialog: null,
527
+ trigger: null,
528
+ settings: { ...Zn(e, this.settings.dataConfig), ...t },
529
+ inlineState: "indeterminate",
530
+ get breakpoint() {
531
+ return si.call(n, e);
532
+ },
533
+ get store() {
534
+ return n.store.get(this.id);
535
+ },
536
+ get mode() {
537
+ return r;
538
+ },
539
+ set mode(o) {
540
+ r = o, oi.call(n, this);
532
541
  },
533
- close(o, c) {
534
- return Kt.call(i, this, o, c);
542
+ get state() {
543
+ return s;
544
+ },
545
+ set state(o) {
546
+ s = o, this.mode === "inline" && o != "opening" && o != "closing" && (this.inlineState = o, this.getSetting("store") && n.store.set(this.id, o)), o === "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")));
547
+ },
548
+ open(o, l) {
549
+ return ce.call(n, this, o, l);
550
+ },
551
+ close(o, l) {
552
+ return zt.call(n, this, o, l);
535
553
  },
536
- toggle(o, c) {
537
- return Ye.call(i, this, o, c);
554
+ toggle(o, l) {
555
+ return tn.call(n, this, o, l);
538
556
  },
539
557
  deregister() {
540
- return ie.call(i, this);
558
+ return ee.call(n, this);
541
559
  },
542
560
  mountBreakpoint() {
543
- const o = this.breakpoint, c = this.handleBreakpoint.bind(this);
544
- return n.mount(o, c), this;
561
+ const o = this.breakpoint, l = this.handleBreakpoint.bind(this);
562
+ return i.mount(o, l), this;
545
563
  },
546
564
  unmountBreakpoint() {
547
- return n.unmount(), this;
565
+ return i.unmount(), this;
548
566
  },
549
567
  handleBreakpoint(o) {
550
- return this.mode = o.matches ? "inline" : "modal", this;
568
+ const l = o.matches ? "inline" : "modal";
569
+ return this.mode != l && (this.mode = l), this;
551
570
  },
552
571
  getSetting(o) {
553
- return o in this.settings ? this.settings[o] : i.settings[o];
572
+ return o in this.settings ? this.settings[o] : n.settings[o];
554
573
  }
555
- }, r = {
556
- id: e.id,
557
- el: e,
558
- dialog: t,
559
- trigger: null,
560
- settings: Zi(e, this.settings.dataConfig),
561
- get breakpoint() {
562
- return an.call(i, e);
563
- },
564
- get state() {
565
- return a;
566
- },
567
- set state(o) {
568
- a = o, (o === "opened" || o === "closed") && this.mode === "inline" && i.store.set(this.id, this.state);
569
- },
570
- get mode() {
571
- return l;
572
- },
573
- set mode(o) {
574
- l = o, cn.call(i, this);
575
- },
576
- ...s
577
574
  };
578
- let a = e.classList.contains(r.getSetting("stateOpened")) ? "opened" : "closed", l = e.classList.contains(r.getSetting("classModal")) ? "modal" : "inline";
579
- return r.mode === "modal" ? r.dialog.setAttribute("aria-modal", "true") : r.dialog.removeAttribute("aria-modal"), r.getSetting("setTabindex") && r.dialog.setAttribute("tabindex", "-1"), this.collection.push(r), r.breakpoint ? r.mountBreakpoint() : await Ue.call(this, r), r;
575
+ this.collection.push(a);
576
+ const c = e.querySelector(a.getSetting("selectorDialog"));
577
+ return a.dialog = c || e, a.getSetting("setTabindex") && a.dialog.setAttribute("tabindex", "-1"), await ii(a), a.inlineState = a.state, a.mode = e.classList.contains(a.getSetting("classModal")) ? "modal" : "inline", a.breakpoint && a.mountBreakpoint(), a;
580
578
  }
581
579
  var Et, xt;
582
- let er = class extends Ji {
580
+ let Zr = class extends Hn {
583
581
  constructor(t) {
584
- super(), qe(this, Et, void 0), qe(this, xt, void 0), this.defaults = sn, this.settings = { ...this.defaults, ...t }, this.focusTrap = new Ki(), this.store = Xi(this.settings.storeKey, this.settings.store), De(this, Et, rn.bind(this)), De(this, xt, on.bind(this)), this.settings.autoInit && this.init();
582
+ super(), Ae(this, Et, void 0), Ae(this, xt, void 0), this.defaults = ti, this.settings = { ...this.defaults, ...t }, this.focusTrap = new zn(), this.store = Xn(this.settings.storeKey, this.settings.store), Pe(this, Et, ei.bind(this)), Pe(this, xt, ni.bind(this)), this.settings.autoInit && this.init();
585
583
  }
586
584
  get activeModal() {
587
585
  return this.collection.find((t) => t.state === "opened" && t.mode === "modal");
588
586
  }
589
587
  async init(t = null) {
590
588
  t && (this.settings = { ...this.settings, ...t });
591
- const i = document.querySelectorAll(this.settings.selectorDrawer);
592
- return await this.registerCollection(i), this.settings.eventListeners && this.initEventListeners(), this;
589
+ const n = document.querySelectorAll(this.settings.selectorDrawer);
590
+ return await this.registerCollection(n), this.settings.eventListeners && this.initEventListeners(), this;
593
591
  }
594
592
  async destroy() {
595
593
  return await this.deregisterCollection(), this.settings.eventListeners && this.destroyEventListeners(), this;
596
594
  }
597
595
  initEventListeners() {
598
- document.addEventListener("click", _t(this, Et), !1), document.addEventListener("keydown", _t(this, xt), !1);
596
+ document.addEventListener("click", Wt(this, Et), !1), document.addEventListener("keydown", Wt(this, xt), !1);
599
597
  }
600
598
  destroyEventListeners() {
601
- document.removeEventListener("click", _t(this, Et), !1), document.removeEventListener("keydown", _t(this, xt), !1);
599
+ document.removeEventListener("click", Wt(this, Et), !1), document.removeEventListener("keydown", Wt(this, xt), !1);
602
600
  }
603
- register(t) {
604
- const i = ln.call(this, t);
605
- return i.error ? Promise.reject(i.error) : hn.call(this, i.drawer, i.dialog);
601
+ register(t, n = {}) {
602
+ let i = typeof t == "string" ? document.getElementById(t) : t;
603
+ return i ? ci.call(this, i, n) : Promise.reject(new Error(`Failed to register; drawer not found with ID of: "${t.id || t}".`));
606
604
  }
607
605
  deregister(t) {
608
- const i = this.get(Ze.call(this, t));
609
- return ie.call(this, i);
606
+ let n = this.get(t.id || t);
607
+ return n ? ee.call(this, n) : Promise.reject(new Error(`Failed to deregister; drawer does not exist in collection with ID of: "${t.id || t}".`));
610
608
  }
611
- open(t, i, n) {
612
- return de.call(this, t, i, n);
609
+ open(t, n, i) {
610
+ return ce.call(this, t, n, i);
613
611
  }
614
- close(t, i, n) {
615
- return Kt.call(this, t, i, n);
612
+ close(t, n, i) {
613
+ return zt.call(this, t, n, i);
616
614
  }
617
- toggle(t, i, n) {
618
- return Ye.call(this, t, i, n);
615
+ toggle(t, n, i) {
616
+ return tn.call(this, t, n, i);
619
617
  }
620
618
  };
621
619
  Et = /* @__PURE__ */ new WeakMap(), xt = /* @__PURE__ */ new WeakMap();
622
- var ti = (e, t, i) => {
620
+ var en = (e, t, n) => {
623
621
  if (!t.has(e))
624
- throw TypeError("Cannot " + i);
625
- }, Ft = (e, t, i) => (ti(e, t, "read from private field"), i ? i.call(e) : t.get(e)), Pe = (e, t, i) => {
622
+ throw TypeError("Cannot " + n);
623
+ }, _t = (e, t, n) => (en(e, t, "read from private field"), n ? n.call(e) : t.get(e)), De = (e, t, n) => {
626
624
  if (t.has(e))
627
625
  throw TypeError("Cannot add the same private member more than once");
628
- t instanceof WeakSet ? t.add(e) : t.set(e, i);
629
- }, Me = (e, t, i, n) => (ti(e, t, "write to private field"), n ? n.call(e, i) : t.set(e, i), i), ei = (e, t, i) => {
626
+ t instanceof WeakSet ? t.add(e) : t.set(e, n);
627
+ }, Me = (e, t, n, i) => (en(e, t, "write to private field"), i ? i.call(e, n) : t.set(e, n), n), nn = (e, t, n) => {
630
628
  if (!t.has(e))
631
- throw TypeError("Cannot " + i);
632
- }, Q = (e, t, i) => (ei(e, t, "read from private field"), i ? i.call(e) : t.get(e)), Yt = (e, t, i) => {
629
+ throw TypeError("Cannot " + n);
630
+ }, Q = (e, t, n) => (nn(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Yt = (e, t, n) => {
633
631
  if (t.has(e))
634
632
  throw TypeError("Cannot add the same private member more than once");
635
- t instanceof WeakSet ? t.add(e) : t.set(e, i);
636
- }, te = (e, t, i, n) => (ei(e, t, "write to private field"), n ? n.call(e, i) : t.set(e, i), i);
637
- class fn {
633
+ t instanceof WeakSet ? t.add(e) : t.set(e, n);
634
+ }, Ut = (e, t, n, i) => (nn(e, t, "write to private field"), i ? i.call(e, n) : t.set(e, n), n);
635
+ class di {
638
636
  constructor() {
639
637
  this.collection = [];
640
638
  }
@@ -642,18 +640,18 @@ class fn {
642
640
  return await this.deregister(t), this.collection.push(t), this.collection;
643
641
  }
644
642
  async deregister(t) {
645
- const i = this.collection.findIndex((n) => n === t);
646
- if (i >= 0) {
647
- const n = this.collection[i];
648
- Object.getOwnPropertyNames(n).forEach((s) => {
649
- delete n[s];
650
- }), this.collection.splice(i, 1);
643
+ const n = this.collection.findIndex((i) => i === t);
644
+ if (n >= 0) {
645
+ const i = this.collection[n];
646
+ Object.getOwnPropertyNames(i).forEach((r) => {
647
+ delete i[r];
648
+ }), this.collection.splice(n, 1);
651
649
  }
652
650
  return this.collection;
653
651
  }
654
652
  async registerCollection(t) {
655
- return await Promise.all(Array.from(t, (i) => {
656
- this.register(i);
653
+ return await Promise.all(Array.from(t, (n) => {
654
+ this.register(n);
657
655
  })), this.collection;
658
656
  }
659
657
  async deregisterCollection() {
@@ -661,15 +659,15 @@ class fn {
661
659
  await this.deregister(this.collection[0]);
662
660
  return this.collection;
663
661
  }
664
- get(t, i = "id") {
665
- return this.collection.find((n) => n[i] === t);
662
+ get(t, n = "id") {
663
+ return this.collection.find((i) => i[n] === t);
666
664
  }
667
665
  }
668
666
  const m = {
669
667
  inert: ":not([inert]):not([inert] *)",
670
668
  negTabIndex: ':not([tabindex^="-"])',
671
669
  disabled: ":not(:disabled)"
672
- }, pn = [
670
+ }, ui = [
673
671
  `a[href]${m.inert}${m.negTabIndex}`,
674
672
  `area[href]${m.inert}${m.negTabIndex}`,
675
673
  `input:not([type="hidden"]):not([type="radio"])${m.inert}${m.negTabIndex}${m.disabled}`,
@@ -687,16 +685,16 @@ const m = {
687
685
  `[contenteditable]${m.inert}${m.negTabIndex}`,
688
686
  `[tabindex]${m.inert}${m.negTabIndex}`
689
687
  ];
690
- var Lt, ut, ht;
691
- let gn = class {
692
- constructor(t = null, i = "[data-focus]") {
693
- Yt(this, Lt, void 0), Yt(this, ut, void 0), Yt(this, ht, void 0), this.el = t, this.selectorFocus = i, te(this, ut, mn.bind(this)), te(this, ht, vn.bind(this));
688
+ var Ot, ut, ht;
689
+ class hi {
690
+ constructor(t = null, n = "[data-focus]") {
691
+ Yt(this, Ot, void 0), Yt(this, ut, void 0), Yt(this, ht, void 0), this.el = t, this.selectorFocus = n, Ut(this, ut, fi.bind(this)), Ut(this, ht, pi.bind(this));
694
692
  }
695
693
  get focusable() {
696
- return Q(this, Lt);
694
+ return Q(this, Ot);
697
695
  }
698
696
  set focusable(t) {
699
- te(this, Lt, t), Q(this, Lt).length ? (document.removeEventListener("keydown", Q(this, ht)), document.addEventListener("keydown", Q(this, ut))) : (document.removeEventListener("keydown", Q(this, ut)), document.addEventListener("keydown", Q(this, ht)));
697
+ Ut(this, Ot, t), Q(this, Ot).length ? (document.removeEventListener("keydown", Q(this, ht)), document.addEventListener("keydown", Q(this, ut))) : (document.removeEventListener("keydown", Q(this, ut)), document.addEventListener("keydown", Q(this, ht)));
700
698
  }
701
699
  get focusableFirst() {
702
700
  return this.focusable[0];
@@ -704,65 +702,80 @@ let gn = class {
704
702
  get focusableLast() {
705
703
  return this.focusable[this.focusable.length - 1];
706
704
  }
707
- mount(t, i) {
708
- t && (this.el = t), i && (this.selectorFocus = i), this.focusable = this.getFocusable(), this.focus();
705
+ mount(t, n) {
706
+ t && (this.el = t), n && (this.selectorFocus = n), this.focusable = this.getFocusable(), this.focus();
709
707
  }
710
708
  unmount() {
711
709
  this.el = null, this.focusable = [], document.removeEventListener("keydown", Q(this, ut)), document.removeEventListener("keydown", Q(this, ht));
712
710
  }
713
- focus(t = this.el, i = this.selectorFocus) {
714
- (t.querySelector(i) || t).focus();
711
+ focus(t = this.el, n = this.selectorFocus) {
712
+ (t.querySelector(n) || t).focus();
715
713
  }
716
714
  getFocusable(t = this.el) {
717
- const i = [], n = document.activeElement, s = t.scrollTop;
718
- return t.querySelectorAll(pn.join(",")).forEach((r) => {
719
- r.focus(), document.activeElement === r && i.push(r);
720
- }), t.scrollTop = s, n.focus(), i;
715
+ const n = [], i = document.activeElement, r = t.scrollTop;
716
+ return t.querySelectorAll(ui.join(",")).forEach((s) => {
717
+ s.focus(), document.activeElement === s && n.push(s);
718
+ }), t.scrollTop = r, i.focus(), n;
721
719
  }
722
- };
723
- Lt = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap();
724
- function mn(e) {
720
+ }
721
+ Ot = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap();
722
+ function fi(e) {
725
723
  (e.key === "Tab" || e.keyCode === 9) && (e.shiftKey ? (document.activeElement === this.focusableFirst || document.activeElement === this.el) && (e.preventDefault(), this.focusableLast.focus()) : (document.activeElement === this.focusableLast || document.activeElement === this.el) && (e.preventDefault(), this.focusableFirst.focus()));
726
724
  }
727
- function vn(e) {
725
+ function pi(e) {
728
726
  (e.key === "Tab" || e.keyCode === 9) && e.preventDefault();
729
727
  }
730
- function bn(e, t) {
731
- const i = (e.getAttribute(`data-${t}`) || "").replace(/'/g, '"');
732
- return i ? JSON.parse(i) : {};
728
+ function gi() {
729
+ return getComputedStyle(document.body).getPropertyValue("--vrembem-prefix").trim();
730
+ }
731
+ function mi(e, t = document.body, n = !0) {
732
+ if (n) {
733
+ const r = gi();
734
+ r && !e.includes(`--${r}`) && (e = e.replace("--", `--${r}`));
735
+ }
736
+ const i = getComputedStyle(t).getPropertyValue(e).trim();
737
+ if (i)
738
+ return i;
739
+ throw new Error(`CSS variable "${e}" was not found!`);
740
+ }
741
+ function vi(e, t) {
742
+ const n = (e.getAttribute(`data-${t}`) || "").replace(/'/g, '"');
743
+ return n ? JSON.parse(n) : {};
733
744
  }
734
- function We(e, t, i) {
735
- const n = t.nodeType === Node.COMMENT_NODE, s = t.nodeType === Node.ELEMENT_NODE;
736
- if (t = n || s ? t : document.querySelector(t), n && (i = "after"), !t)
745
+ function je(e, t, n) {
746
+ const i = t.nodeType === Node.COMMENT_NODE, r = t.nodeType === Node.ELEMENT_NODE;
747
+ if (t = i || r ? t : document.querySelector(t), i && (n = "after"), !t)
737
748
  throw new Error(`Not a valid teleport reference: '${t}'`);
738
- if (typeof t[i] != "function")
739
- throw new Error(`Not a valid teleport method: '${i}'`);
740
- let r = null;
741
- return n || (r = document.createComment("teleported #" + e.id), e.before(r)), t[i](e), n && t.remove(), r;
742
- }
743
- const yn = (e, t) => new Promise((i) => {
744
- t.transition ? (e.classList.remove(t.stateClosed), e.classList.add(t.stateOpening), e.addEventListener("transitionend", function n(s) {
745
- s.target == e && (e.classList.add(t.stateOpened), e.classList.remove(t.stateOpening), i(e), this.removeEventListener("transitionend", n));
746
- })) : (e.classList.add(t.stateOpened), e.classList.remove(t.stateClosed), i(e));
747
- }), wn = (e, t) => new Promise((i) => {
748
- t.transition ? (e.classList.add(t.stateClosing), e.classList.remove(t.stateOpened), e.addEventListener("transitionend", function n(s) {
749
- s.target == e && (e.classList.remove(t.stateClosing), e.classList.add(t.stateClosed), i(e), this.removeEventListener("transitionend", n));
750
- })) : (e.classList.add(t.stateClosed), e.classList.remove(t.stateOpened), i(e));
751
- });
752
- function $n(e, t) {
753
- t && document.querySelectorAll(t).forEach((i) => {
754
- e ? i.style.overflow = "hidden" : i.style.removeProperty("overflow");
749
+ if (typeof t[n] != "function")
750
+ throw new Error(`Not a valid teleport method: '${n}'`);
751
+ let s = null;
752
+ return i || (s = document.createComment("teleported #" + e.id), e.before(s)), t[n](e), i && t.remove(), s;
753
+ }
754
+ function rn(e, t, n, i = "--transition-duration") {
755
+ return new Promise((r) => {
756
+ if (typeof i == "string") {
757
+ const s = mi(i, e), a = !!s.includes("ms");
758
+ i = parseFloat(s) * (a ? 1 : 1e3);
759
+ }
760
+ e.classList.remove(t.finish), e.classList.add(n.start), setTimeout(() => {
761
+ e.classList.add(n.finish), e.classList.remove(n.start), r(e);
762
+ }, i);
755
763
  });
756
764
  }
757
- function En(e, t) {
758
- t && document.querySelectorAll(t).forEach((i) => {
759
- e ? (i.inert = !0, i.setAttribute("aria-hidden", !0)) : (i.inert = null, i.removeAttribute("aria-hidden"));
765
+ function bi(e, t) {
766
+ t && document.querySelectorAll(t).forEach((n) => {
767
+ e ? n.style.overflow = "hidden" : n.style.removeProperty("overflow");
760
768
  });
761
769
  }
762
- function xn(e, t) {
763
- En(!!e, t.selectorInert), $n(!!e, t.selectorOverflow);
770
+ function yi(e, t) {
771
+ t && document.querySelectorAll(t).forEach((n) => {
772
+ e ? (n.inert = !0, n.setAttribute("aria-hidden", !0)) : (n.inert = null, n.removeAttribute("aria-hidden"));
773
+ });
764
774
  }
765
- const Ln = {
775
+ function wi(e, t) {
776
+ yi(!!e, t.selectorInert), bi(!!e, t.selectorOverflow);
777
+ }
778
+ const $i = {
766
779
  autoInit: !1,
767
780
  // Data attributes
768
781
  dataOpen: "modal-open",
@@ -772,6 +785,7 @@ const Ln = {
772
785
  // Selectors
773
786
  selectorModal: ".modal",
774
787
  selectorDialog: ".modal__dialog",
788
+ selectorScreen: ".modal",
775
789
  selectorRequired: '[role="alertdialog"]',
776
790
  selectorFocus: "[data-focus]",
777
791
  selectorInert: null,
@@ -787,127 +801,134 @@ const Ln = {
787
801
  teleport: null,
788
802
  teleportMethod: "append",
789
803
  setTabindex: !0,
790
- transition: !0
804
+ transition: !0,
805
+ transitionDuration: "--vb-modal-transition-duration"
791
806
  };
792
- function ue(e) {
793
- const t = typeof e == "string" ? this.get(e) : this.get(e.id);
794
- if (t)
795
- return t;
796
- throw new Error(`Modal not found in collection with id of "${e.id || e}".`);
797
- }
798
- function Jt(e) {
799
- return typeof e == "string" ? e : typeof e.hasAttribute == "function" ? e.hasAttribute(`data-${this.settings.dataOpen}`) ? e.getAttribute(`data-${this.settings.dataOpen}`) : e.hasAttribute(`data-${this.settings.dataClose}`) ? e.getAttribute(`data-${this.settings.dataClose}`) || !1 : e.hasAttribute(`data-${this.settings.dataReplace}`) ? e.getAttribute(`data-${this.settings.dataReplace}`) : e.closest(this.settings.selectorModal) ? (e = e.closest(this.settings.selectorModal), e.id || !1) : !1 : e.id ? e.id : !1;
800
- }
801
- function On(e) {
802
- const t = Jt.call(this, e);
803
- if (t) {
804
- const i = document.querySelector(`#${t}`), n = i ? i.querySelector(this.settings.selectorDialog) : null;
805
- return !i && !n ? { error: new Error(`No modal elements found using the ID: "${t}".`) } : n ? { modal: i, dialog: n } : { error: new Error("Modal is missing dialog element.") };
806
- } else
807
- return { error: new Error("Could not resolve the modal ID.") };
808
- }
809
- function Gt() {
810
- this.active ? this.focusTrap.mount(this.active.dialog, this.settings.selectorFocus) : (this.trigger && (this.trigger.focus(), this.trigger = null), this.focusTrap.unmount());
811
- }
812
- async function kn(e) {
813
- let t = e.target.closest(
814
- `[data-${this.settings.dataOpen}], [data-${this.settings.dataReplace}]`
815
- );
807
+ async function Ei(e) {
808
+ const t = e.target.closest(`
809
+ [data-${this.settings.dataOpen}],
810
+ [data-${this.settings.dataReplace}],
811
+ [data-${this.settings.dataClose}]
812
+ `);
816
813
  if (t) {
817
- e.preventDefault(), e.target.closest(this.settings.selectorModal) || (this.trigger = t);
818
- const i = this.get(Jt.call(this, t));
819
- return t.matches(`[data-${this.settings.dataOpen}]`) ? i.open() : i.replace();
820
- }
821
- if (t = e.target.closest(`[data-${this.settings.dataClose}]`), t) {
822
- e.preventDefault();
823
- const i = t.getAttribute(`data-${this.settings.dataClose}`);
824
- return i === "*" ? this.closeAll() : this.close(i);
814
+ if (e.preventDefault(), t.matches(`[data-${this.settings.dataOpen}]`)) {
815
+ const n = t.getAttribute(`data-${this.settings.dataOpen}`).trim(), i = this.get(n);
816
+ return e.target.closest(this.settings.selectorModal) || (this.trigger = t), i.open();
817
+ }
818
+ if (t.matches(`[data-${this.settings.dataReplace}]`)) {
819
+ const n = t.getAttribute(`data-${this.settings.dataReplace}`).trim(), i = this.get(n);
820
+ return e.target.closest(this.settings.selectorModal) || (this.trigger = t), i.replace();
821
+ }
822
+ if (t.matches(`[data-${this.settings.dataClose}]`)) {
823
+ const n = t.getAttribute(`data-${this.settings.dataClose}`).trim();
824
+ return n === "*" ? this.closeAll() : this.close(n);
825
+ }
825
826
  }
826
- if (e.target.matches(this.settings.selectorModal) && !e.target.querySelector(this.settings.selectorRequired))
827
- return this.close(Jt.call(this, e.target));
827
+ if (this.active && e.target.matches(this.settings.selectorScreen) && !this.active.required)
828
+ return this.close(this.active.id);
828
829
  }
829
- function Tn(e) {
830
+ function xi(e) {
830
831
  if (e.key === "Escape" && this.active && !this.active.dialog.matches(this.settings.selectorRequired))
831
832
  return this.close();
832
833
  }
833
834
  async function ne(e, t = !0) {
834
- if (!e)
835
- return this.collection;
836
- const i = this.collection.findIndex((n) => n.id === e.id);
837
- if (i >= 0) {
838
- const n = this.collection[i];
839
- t && n.state === "opened" ? await n.close(!1) : this.stack.remove(n), n.getSetting("teleport") && n.teleportReturn(), Object.getOwnPropertyNames(n).forEach((s) => {
840
- delete n[s];
841
- }), this.collection.splice(i, 1);
835
+ const n = this.collection.findIndex((i) => i.id === e.id);
836
+ if (n >= 0) {
837
+ const i = this.collection[n];
838
+ t && i.state === "opened" ? await i.close(!1) : this.stack.remove(i), i.getSetting("teleport") && i.teleportReturn(), Object.getOwnPropertyNames(i).forEach((r) => {
839
+ delete i[r];
840
+ }), this.collection.splice(n, 1);
842
841
  }
843
842
  return this.collection;
844
843
  }
845
- async function he(e, t, i = !0) {
846
- const n = ue.call(this, e), s = { ...this.settings, ...n.settings };
847
- return t !== void 0 && (s.transition = t), this.stack.moveToTop(n), n.state === "closed" && (n.state = "opening", this.stack.add(n), await yn(n.el, s), n.state = "opened"), i && Gt.call(this), n.el.dispatchEvent(new CustomEvent(s.customEventPrefix + "opened", {
844
+ function de(e) {
845
+ const t = typeof e == "string" ? this.get(e) : this.get(e.id);
846
+ if (t)
847
+ return t;
848
+ throw new Error(`Modal not found in collection with id of "${e.id || e}".`);
849
+ }
850
+ function Kt() {
851
+ this.active ? this.focusTrap.mount(this.active.dialog, this.settings.selectorFocus) : (this.trigger && (this.trigger.focus(), this.trigger = null), this.focusTrap.unmount());
852
+ }
853
+ async function ue(e, t, n = !0) {
854
+ const i = de.call(this, e), r = { ...this.settings, ...i.settings };
855
+ return t !== void 0 && (r.transition = t), this.stack.moveToTop(i), i.state === "closed" && (i.state = "opening", this.stack.add(i), r.transition ? await rn(i.el, {
856
+ start: r.stateClosing,
857
+ finish: r.stateClosed
858
+ }, {
859
+ start: r.stateOpening,
860
+ finish: r.stateOpened
861
+ }, r.transitionDuration) : (i.el.classList.add(r.stateOpened), i.el.classList.remove(r.stateClosed)), i.state = "opened"), n && Kt.call(this), i.el.dispatchEvent(new CustomEvent(r.customEventPrefix + "opened", {
848
862
  detail: this,
849
863
  bubbles: !0
850
- })), n;
864
+ })), i;
851
865
  }
852
- async function fe(e, t, i = !0) {
853
- const n = e ? ue.call(this, e) : this.active;
854
- if (n && n.state === "opened") {
855
- n.state = "closing";
856
- const s = { ...this.settings, ...n.settings };
857
- t !== void 0 && (s.transition = t), document.activeElement.blur(), await wn(n.el, s), this.stack.remove(n), i && Gt.call(this), n.state = "closed", n.el.dispatchEvent(new CustomEvent(s.customEventPrefix + "closed", {
866
+ async function he(e, t, n = !0) {
867
+ const i = e ? de.call(this, e) : this.active;
868
+ if (i && i.state === "opened") {
869
+ i.state = "closing";
870
+ const r = { ...this.settings, ...i.settings };
871
+ t !== void 0 && (r.transition = t), document.activeElement.blur(), r.transition ? await rn(i.el, {
872
+ start: r.stateOpening,
873
+ finish: r.stateOpened
874
+ }, {
875
+ start: r.stateClosing,
876
+ finish: r.stateClosed
877
+ }, r.transitionDuration) : (i.el.classList.add(r.stateClosed), i.el.classList.remove(r.stateOpened)), this.stack.remove(i), i.state = "closed", n && Kt.call(this), i.el.dispatchEvent(new CustomEvent(r.customEventPrefix + "closed", {
858
878
  detail: this,
859
879
  bubbles: !0
860
880
  }));
861
881
  }
862
- return n;
882
+ return i;
863
883
  }
864
- async function se(e, t) {
865
- const i = [];
866
- return await Promise.all(this.stack.value.map(async (n) => {
867
- e && e === n.id ? Promise.resolve() : i.push(await fe.call(this, n, t, !1)), n.trigger = null;
868
- })), i;
884
+ async function ie(e, t) {
885
+ const n = [];
886
+ return await Promise.all(this.stack.value.map(async (i) => {
887
+ e && e === i.id ? Promise.resolve() : n.push(await he.call(this, i, t, !1)), i.trigger = null;
888
+ })), n;
869
889
  }
870
- async function ii(e, t, i = !0) {
871
- const n = ue.call(this, e);
872
- let s, r;
873
- return n.state === "opened" ? (s = n, r = await se.call(this, n.id, t)) : (s = he.call(this, n, t, !1), r = se.call(this, !1, t), await Promise.all([s, r])), i && Gt.call(this), { opened: s, closed: r };
890
+ async function sn(e, t, n = !0) {
891
+ const i = de.call(this, e);
892
+ let r, s;
893
+ return i.state === "opened" ? (r = i, s = await ie.call(this, i.id, t)) : (s = ie.call(this, !1, t), r = ue.call(this, i, t, !1), await Promise.all([r, s])), n && Kt.call(this), { opened: r, closed: s };
874
894
  }
875
- async function An(e, t) {
895
+ async function Oi(e, t = {}) {
876
896
  await ne.call(this, e, !1);
877
- const i = this, n = {
878
- open(r, a) {
879
- return he.call(i, this, r, a);
897
+ const n = this, i = {
898
+ id: e.id,
899
+ state: "closed",
900
+ el: e,
901
+ dialog: null,
902
+ get required() {
903
+ return this.dialog.matches(this.getSetting("selectorRequired"));
904
+ },
905
+ returnRef: null,
906
+ settings: { ...vi(e, this.settings.dataConfig), ...t },
907
+ open(s, a) {
908
+ return ue.call(n, this, s, a);
880
909
  },
881
- close(r, a) {
882
- return fe.call(i, this, r, a);
910
+ close(s, a) {
911
+ return he.call(n, this, s, a);
883
912
  },
884
- replace(r, a) {
885
- return ii.call(i, this, r, a);
913
+ replace(s, a) {
914
+ return sn.call(n, this, s, a);
886
915
  },
887
916
  deregister() {
888
- return ne.call(i, this);
917
+ return ne.call(n, this);
889
918
  },
890
- teleport(r = this.getSetting("teleport"), a = this.getSetting("teleportMethod")) {
891
- return this.returnRef ? (console.error("Element has already been teleported:", this.el), !1) : (this.returnRef = We(this.el, r, a), this.el);
919
+ teleport(s = this.getSetting("teleport"), a = this.getSetting("teleportMethod")) {
920
+ return this.returnRef ? (console.error("Element has already been teleported:", this.el), !1) : (this.returnRef = je(this.el, s, a), this.el);
892
921
  },
893
922
  teleportReturn() {
894
- return this.returnRef ? (this.returnRef = We(this.el, this.returnRef), this.el) : (console.error("No return reference found:", this.el), !1);
923
+ return this.returnRef ? (this.returnRef = je(this.el, this.returnRef), this.el) : (console.error("No return reference found:", this.el), !1);
895
924
  },
896
- getSetting(r) {
897
- return r in this.settings ? this.settings[r] : i.settings[r];
925
+ getSetting(s) {
926
+ return s in this.settings ? this.settings[s] : n.settings[s];
898
927
  }
899
- }, s = {
900
- id: e.id,
901
- state: "closed",
902
- el: e,
903
- dialog: t,
904
- returnRef: null,
905
- settings: bn(e, this.settings.dataConfig),
906
- ...n
907
- };
908
- return s.dialog.setAttribute("aria-modal", "true"), s.dialog.hasAttribute("role") || s.dialog.setAttribute("role", "dialog"), s.getSetting("setTabindex") && s.dialog.setAttribute("tabindex", "-1"), s.getSetting("teleport") && s.teleport(), this.collection.push(s), s.el.classList.contains(this.settings.stateOpened) ? await s.open(!1) : (s.el.classList.remove(this.settings.stateOpening), s.el.classList.remove(this.settings.stateClosing), s.el.classList.add(this.settings.stateClosed)), s;
928
+ }, r = e.querySelector(i.getSetting("selectorDialog"));
929
+ return i.dialog = r || e, i.dialog.setAttribute("aria-modal", "true"), i.dialog.hasAttribute("role") || i.dialog.setAttribute("role", "dialog"), i.getSetting("setTabindex") && i.dialog.setAttribute("tabindex", "-1"), i.getSetting("teleport") && i.teleport(), this.collection.push(i), i.el.classList.contains(this.settings.stateOpened) ? await i.open(!1) : (i.el.classList.remove(this.settings.stateOpening), i.el.classList.remove(this.settings.stateClosing), i.el.classList.add(this.settings.stateClosed)), i;
909
930
  }
910
- function Cn(e) {
931
+ function Li(e) {
911
932
  const t = [];
912
933
  return {
913
934
  get value() {
@@ -917,84 +938,84 @@ function Cn(e) {
917
938
  return t[t.length - 1];
918
939
  },
919
940
  updateIndex() {
920
- t.forEach((i, n) => {
921
- i.el.style.zIndex = null;
922
- const s = getComputedStyle(i.el)["z-index"];
923
- i.el.style.zIndex = parseInt(s) + n + 1;
941
+ t.forEach((n, i) => {
942
+ n.el.style.zIndex = null;
943
+ const r = getComputedStyle(n.el)["z-index"];
944
+ n.el.style.zIndex = parseInt(r) + i + 1;
924
945
  });
925
946
  },
926
947
  updateGlobalState() {
927
- xn(this.top, e), this.updateIndex();
948
+ wi(this.top, e), this.updateIndex();
928
949
  },
929
- add(i) {
930
- i.el.style.zIndex = null;
931
- const n = getComputedStyle(i.el)["z-index"];
932
- i.el.style.zIndex = parseInt(n) + t.length + 1, t.push(i), this.updateGlobalState();
950
+ add(n) {
951
+ n.el.style.zIndex = null;
952
+ const i = getComputedStyle(n.el)["z-index"];
953
+ n.el.style.zIndex = parseInt(i) + t.length + 1, t.push(n), this.updateGlobalState();
933
954
  },
934
- remove(i) {
935
- const n = t.findIndex((s) => s.id === i.id);
936
- n >= 0 && (i.el.style.zIndex = null, t.splice(n, 1), this.updateGlobalState());
955
+ remove(n) {
956
+ const i = t.findIndex((r) => r.id === n.id);
957
+ i >= 0 && (n.el.style.zIndex = null, t.splice(i, 1), this.updateGlobalState());
937
958
  },
938
- moveToTop(i) {
939
- const n = t.findIndex((s) => s.id === i.id);
940
- n >= 0 && (t.splice(n, 1), this.add(i));
959
+ moveToTop(n) {
960
+ const i = t.findIndex((r) => r.id === n.id);
961
+ i >= 0 && (t.splice(i, 1), this.add(n));
941
962
  }
942
963
  };
943
964
  }
944
- var Ot, kt;
945
- class sr extends fn {
965
+ var Lt, kt;
966
+ let Yr = class extends di {
946
967
  constructor(t) {
947
- super(), Pe(this, Ot, void 0), Pe(this, kt, void 0), this.defaults = Ln, this.settings = { ...this.defaults, ...t }, this.trigger = null, this.focusTrap = new gn(), this.stack = Cn(this.settings), Me(this, Ot, kn.bind(this)), Me(this, kt, Tn.bind(this)), this.settings.autoInit && this.init();
968
+ super(), De(this, Lt, void 0), De(this, kt, void 0), this.defaults = $i, this.settings = { ...this.defaults, ...t }, this.trigger = null, this.focusTrap = new hi(), this.stack = Li(this.settings), Me(this, Lt, Ei.bind(this)), Me(this, kt, xi.bind(this)), this.settings.autoInit && this.init();
948
969
  }
949
970
  get active() {
950
971
  return this.stack.top;
951
972
  }
952
973
  async init(t) {
953
974
  t && (this.settings = { ...this.settings, ...t });
954
- const i = document.querySelectorAll(this.settings.selectorModal);
955
- return await this.registerCollection(i), this.settings.eventListeners && this.initEventListeners(), this;
975
+ const n = document.querySelectorAll(this.settings.selectorModal);
976
+ return await this.registerCollection(n), this.settings.eventListeners && this.initEventListeners(), this;
956
977
  }
957
978
  async destroy() {
958
979
  return this.trigger = null, await this.deregisterCollection(), this.settings.eventListeners && this.destroyEventListeners(), this;
959
980
  }
960
981
  initEventListeners() {
961
- document.addEventListener("click", Ft(this, Ot), !1), document.addEventListener("keydown", Ft(this, kt), !1);
982
+ document.addEventListener("click", _t(this, Lt), !1), document.addEventListener("keydown", _t(this, kt), !1);
962
983
  }
963
984
  destroyEventListeners() {
964
- document.removeEventListener("click", Ft(this, Ot), !1), document.removeEventListener("keydown", Ft(this, kt), !1);
985
+ document.removeEventListener("click", _t(this, Lt), !1), document.removeEventListener("keydown", _t(this, kt), !1);
965
986
  }
966
- register(t) {
967
- const i = On.call(this, t);
968
- return i.error ? Promise.reject(i.error) : An.call(this, i.modal, i.dialog);
987
+ register(t, n = {}) {
988
+ let i = typeof t == "string" ? document.getElementById(t) : t;
989
+ return i ? Oi.call(this, i, n) : Promise.reject(new Error(`Failed to register; modal not found with ID of: "${t.id || t}".`));
969
990
  }
970
991
  deregister(t) {
971
- const i = this.get(Jt.call(this, t));
972
- return ne.call(this, i);
992
+ let n = this.get(t.id || t);
993
+ return n ? ne.call(this, n) : Promise.reject(new Error(`Failed to deregister; modal does not exist in collection with ID of: "${t.id || t}".`));
973
994
  }
974
- open(t, i, n) {
975
- return he.call(this, t, i, n);
995
+ open(t, n, i) {
996
+ return ue.call(this, t, n, i);
976
997
  }
977
- close(t, i, n) {
978
- return fe.call(this, t, i, n);
998
+ close(t, n, i) {
999
+ return he.call(this, t, n, i);
979
1000
  }
980
- replace(t, i, n) {
981
- return ii.call(this, t, i, n);
1001
+ replace(t, n, i) {
1002
+ return sn.call(this, t, n, i);
982
1003
  }
983
- async closeAll(t = !1, i, n = !0) {
984
- const s = await se.call(this, t, i);
985
- return n && Gt.call(this), s;
1004
+ async closeAll(t = !1, n, i = !0) {
1005
+ const r = await ie.call(this, t, n);
1006
+ return i && Kt.call(this), r;
986
1007
  }
987
- }
988
- Ot = /* @__PURE__ */ new WeakMap(), kt = /* @__PURE__ */ new WeakMap();
989
- var ni = (e, t, i) => {
1008
+ };
1009
+ Lt = /* @__PURE__ */ new WeakMap(), kt = /* @__PURE__ */ new WeakMap();
1010
+ var on = (e, t, n) => {
990
1011
  if (!t.has(e))
991
- throw TypeError("Cannot " + i);
992
- }, je = (e, t, i) => (ni(e, t, "read from private field"), i ? i.call(e) : t.get(e)), In = (e, t, i) => {
1012
+ throw TypeError("Cannot " + n);
1013
+ }, qe = (e, t, n) => (on(e, t, "read from private field"), n ? n.call(e) : t.get(e)), ki = (e, t, n) => {
993
1014
  if (t.has(e))
994
1015
  throw TypeError("Cannot add the same private member more than once");
995
- t instanceof WeakSet ? t.add(e) : t.set(e, i);
996
- }, Sn = (e, t, i, n) => (ni(e, t, "write to private field"), n ? n.call(e, i) : t.set(e, i), i);
997
- class qn {
1016
+ t instanceof WeakSet ? t.add(e) : t.set(e, n);
1017
+ }, Ti = (e, t, n, i) => (on(e, t, "write to private field"), i ? i.call(e, n) : t.set(e, n), n);
1018
+ class Si {
998
1019
  constructor() {
999
1020
  this.collection = [];
1000
1021
  }
@@ -1002,18 +1023,18 @@ class qn {
1002
1023
  return await this.deregister(t), this.collection.push(t), this.collection;
1003
1024
  }
1004
1025
  async deregister(t) {
1005
- const i = this.collection.findIndex((n) => n === t);
1006
- if (i >= 0) {
1007
- const n = this.collection[i];
1008
- Object.getOwnPropertyNames(n).forEach((s) => {
1009
- delete n[s];
1010
- }), this.collection.splice(i, 1);
1026
+ const n = this.collection.findIndex((i) => i === t);
1027
+ if (n >= 0) {
1028
+ const i = this.collection[n];
1029
+ Object.getOwnPropertyNames(i).forEach((r) => {
1030
+ delete i[r];
1031
+ }), this.collection.splice(n, 1);
1011
1032
  }
1012
1033
  return this.collection;
1013
1034
  }
1014
1035
  async registerCollection(t) {
1015
- return await Promise.all(Array.from(t, (i) => {
1016
- this.register(i);
1036
+ return await Promise.all(Array.from(t, (n) => {
1037
+ this.register(n);
1017
1038
  })), this.collection;
1018
1039
  }
1019
1040
  async deregisterCollection() {
@@ -1021,14 +1042,14 @@ class qn {
1021
1042
  await this.deregister(this.collection[0]);
1022
1043
  return this.collection;
1023
1044
  }
1024
- get(t, i = "id") {
1025
- return this.collection.find((n) => n[i] === t);
1045
+ get(t, n = "id") {
1046
+ return this.collection.find((i) => i[n] === t);
1026
1047
  }
1027
1048
  }
1028
- function Dn() {
1029
- return getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix").trim();
1049
+ function Ci() {
1050
+ return getComputedStyle(document.body).getPropertyValue("--vrembem-prefix").trim();
1030
1051
  }
1031
- const Pn = {
1052
+ const Ii = {
1032
1053
  autoInit: !1,
1033
1054
  // Selectors
1034
1055
  selectorPopover: ".popover",
@@ -1040,8 +1061,8 @@ const Pn = {
1040
1061
  eventType: "click",
1041
1062
  placement: "bottom"
1042
1063
  };
1043
- function si(e, t) {
1044
- const i = getComputedStyle(e), n = {
1064
+ function an(e, t) {
1065
+ const n = getComputedStyle(e), i = {
1045
1066
  placement: t.placement,
1046
1067
  event: t.eventType,
1047
1068
  offset: 0,
@@ -1050,43 +1071,43 @@ function si(e, t) {
1050
1071
  "arrow-element": t.selectorArrow,
1051
1072
  "arrow-padding": 0
1052
1073
  };
1053
- for (const s in n) {
1054
- const r = Dn(), a = i.getPropertyValue(`--${r}popover-${s}`).trim();
1055
- a && (n[s] = a);
1074
+ for (const r in i) {
1075
+ const s = Ci(), a = n.getPropertyValue(`--${s}popover-${r}`).trim();
1076
+ a && (i[r] = a);
1056
1077
  }
1057
- return n;
1078
+ return i;
1058
1079
  }
1059
- function ee(e) {
1080
+ function te(e) {
1060
1081
  let t;
1061
- const i = typeof e == "string" ? e.trim().split(" ") : [e];
1062
- switch (i.forEach(function(n, s) {
1063
- i[s] = parseInt(n, 10);
1064
- }), i.length) {
1082
+ const n = typeof e == "string" ? e.trim().split(" ") : [e];
1083
+ switch (n.forEach(function(i, r) {
1084
+ n[r] = parseInt(i, 10);
1085
+ }), n.length) {
1065
1086
  case 1:
1066
- t = i[0];
1087
+ t = n[0];
1067
1088
  break;
1068
1089
  case 2:
1069
1090
  t = {
1070
- top: i[0],
1071
- right: i[1],
1072
- bottom: i[0],
1073
- left: i[1]
1091
+ top: n[0],
1092
+ right: n[1],
1093
+ bottom: n[0],
1094
+ left: n[1]
1074
1095
  };
1075
1096
  break;
1076
1097
  case 3:
1077
1098
  t = {
1078
- top: i[0],
1079
- right: i[1],
1080
- bottom: i[2],
1081
- left: i[1]
1099
+ top: n[0],
1100
+ right: n[1],
1101
+ bottom: n[2],
1102
+ left: n[1]
1082
1103
  };
1083
1104
  break;
1084
1105
  case 4:
1085
1106
  t = {
1086
- top: i[0],
1087
- right: i[1],
1088
- bottom: i[2],
1089
- left: i[3]
1107
+ top: n[0],
1108
+ right: n[1],
1109
+ bottom: n[2],
1110
+ left: n[3]
1090
1111
  };
1091
1112
  break;
1092
1113
  default:
@@ -1095,7 +1116,7 @@ function ee(e) {
1095
1116
  }
1096
1117
  return t;
1097
1118
  }
1098
- function Mn(e) {
1119
+ function Ai(e) {
1099
1120
  return [{
1100
1121
  name: "offset",
1101
1122
  options: {
@@ -1104,92 +1125,92 @@ function Mn(e) {
1104
1125
  }, {
1105
1126
  name: "preventOverflow",
1106
1127
  options: {
1107
- padding: ee(e["overflow-padding"])
1128
+ padding: te(e["overflow-padding"])
1108
1129
  }
1109
1130
  }, {
1110
1131
  name: "flip",
1111
1132
  options: {
1112
- padding: ee(e["flip-padding"])
1133
+ padding: te(e["flip-padding"])
1113
1134
  }
1114
1135
  }, {
1115
1136
  name: "arrow",
1116
1137
  options: {
1117
1138
  element: e["arrow-element"],
1118
- padding: ee(e["arrow-padding"])
1139
+ padding: te(e["arrow-padding"])
1119
1140
  }
1120
1141
  }];
1121
1142
  }
1122
- function ri(e) {
1143
+ function ln(e) {
1123
1144
  const t = typeof e == "string" ? this.get(e) : this.get(e.id);
1124
1145
  if (t)
1125
1146
  return t;
1126
1147
  throw new Error(`Popover not found in collection with id of "${e}".`);
1127
1148
  }
1128
- function oi(e) {
1129
- return typeof e == "string" ? e : typeof e.hasAttribute == "function" ? e.closest(this.settings.selectorPopover) ? (e = e.closest(this.settings.selectorPopover), e.id) : e.hasAttribute("aria-controls") ? e.getAttribute("aria-controls") : e.hasAttribute("aria-describedby") ? e.getAttribute("aria-describedby") : !1 : e.id ? e.id : !1;
1149
+ function Pi(e) {
1150
+ return typeof e == "string" ? e : typeof e.hasAttribute == "function" ? e.closest(this.settings.selectorPopover) ? (e = e.closest(this.settings.selectorPopover), e.id) : e.hasAttribute("aria-controls") ? e.getAttribute("aria-controls") : e.hasAttribute("aria-describedby") ? e.getAttribute("aria-describedby") : !1 : !1;
1130
1151
  }
1131
- function Wn(e) {
1132
- const t = oi.call(this, e);
1152
+ function Di(e) {
1153
+ const t = Pi.call(this, e);
1133
1154
  if (t) {
1134
- const i = document.querySelector(`#${t}`), n = document.querySelector(`[aria-controls="${t}"]`) || document.querySelector(`[aria-describedby="${t}"]`);
1135
- return !n && !i ? { error: new Error(`No popover elements found using the ID: "${t}".`) } : n ? i ? { popover: i, trigger: n } : { error: new Error("No popover associated with the provided popover trigger.") } : { error: new Error("No popover trigger associated with the provided popover.") };
1155
+ const n = document.querySelector(`#${t}`), i = document.querySelector(`[aria-controls="${t}"]`) || document.querySelector(`[aria-describedby="${t}"]`);
1156
+ return !i && !n ? { error: new Error(`No popover elements found using the ID: "${t}".`) } : i ? n ? { popover: n, trigger: i } : { error: new Error("No popover associated with the provided popover trigger.") } : { error: new Error("No popover trigger associated with the provided popover.") };
1136
1157
  } else
1137
1158
  return { error: new Error("Could not resolve the popover ID.") };
1138
1159
  }
1139
- async function pe(e) {
1140
- const t = e ? ri.call(this, e) : await ai.call(this);
1160
+ async function fe(e) {
1161
+ const t = e ? ln.call(this, e) : await cn.call(this);
1141
1162
  return t && t.state === "opened" && (t.el.classList.remove(this.settings.stateActive), t.trigger.hasAttribute("aria-controls") && t.trigger.setAttribute("aria-expanded", "false"), t.popper.setOptions({
1142
1163
  modifiers: [{ name: "eventListeners", enabled: !1 }]
1143
1164
  }), t.state = "closed", t.trigger === this.trigger && (this.trigger = null)), t;
1144
1165
  }
1145
- async function ai() {
1166
+ async function cn() {
1146
1167
  const e = [];
1147
1168
  return await Promise.all(this.collection.map(async (t) => {
1148
- t.state === "opened" && e.push(await pe.call(this, t));
1169
+ t.state === "opened" && e.push(await fe.call(this, t));
1149
1170
  })), e;
1150
1171
  }
1151
- function li(e) {
1172
+ function dn(e) {
1152
1173
  e.state == "opened" && setTimeout(() => {
1153
- const t = e.el.closest(":hover") === e.el || e.trigger.closest(":hover") === e.trigger, i = document.activeElement.closest(
1174
+ const t = e.el.closest(":hover") === e.el || e.trigger.closest(":hover") === e.trigger, n = document.activeElement.closest(
1154
1175
  `#${e.id}, [aria-controls="${e.id}"], [aria-describedby="${e.id}"]`
1155
1176
  );
1156
- return !t && !i && e.close(), e;
1177
+ return !t && !n && e.close(), e;
1157
1178
  }, 1);
1158
1179
  }
1159
- function jn(e) {
1160
- e.state === "opened" ? e.close() : (this.trigger = e.trigger, e.open(), ci.call(this, e));
1180
+ function Mi(e) {
1181
+ e.state === "opened" ? e.close() : (this.trigger = e.trigger, e.open(), un.call(this, e));
1161
1182
  }
1162
- function Nn(e) {
1183
+ function ji(e) {
1163
1184
  switch (e.key) {
1164
1185
  case "Escape":
1165
- this.trigger && this.trigger.focus(), ai.call(this);
1186
+ this.trigger && this.trigger.focus(), cn.call(this);
1166
1187
  return;
1167
1188
  case "Tab":
1168
1189
  this.collection.forEach((t) => {
1169
- li.call(this, t);
1190
+ dn.call(this, t);
1170
1191
  });
1171
1192
  return;
1172
1193
  default:
1173
1194
  return;
1174
1195
  }
1175
1196
  }
1176
- function ci(e) {
1197
+ function un(e) {
1177
1198
  const t = this;
1178
- document.addEventListener("click", function i(n) {
1179
- n.target.closest(
1199
+ document.addEventListener("click", function n(i) {
1200
+ i.target.closest(
1180
1201
  `#${e.id}, [aria-controls="${e.id}"], [aria-describedby="${e.id}"]`
1181
- ) ? e.el && !e.el.classList.contains(t.settings.stateActive) && this.removeEventListener("click", i) : (e.el && e.el.classList.contains(t.settings.stateActive) && e.close(), this.removeEventListener("click", i));
1202
+ ) ? e.el && !e.el.classList.contains(t.settings.stateActive) && this.removeEventListener("click", n) : (e.el && e.el.classList.contains(t.settings.stateActive) && e.close(), this.removeEventListener("click", n));
1182
1203
  });
1183
1204
  }
1184
- var W = "top", B = "bottom", R = "right", j = "left", ge = "auto", qt = [W, B, R, j], ft = "start", It = "end", _n = "clippingParents", di = "viewport", yt = "popper", Fn = "reference", Ne = /* @__PURE__ */ qt.reduce(function(e, t) {
1205
+ var P = "top", W = "bottom", _ = "right", D = "left", pe = "auto", Pt = [P, W, _, D], ft = "start", It = "end", qi = "clippingParents", hn = "viewport", yt = "popper", Fi = "reference", Fe = /* @__PURE__ */ Pt.reduce(function(e, t) {
1185
1206
  return e.concat([t + "-" + ft, t + "-" + It]);
1186
- }, []), ui = /* @__PURE__ */ [].concat(qt, [ge]).reduce(function(e, t) {
1207
+ }, []), fn = /* @__PURE__ */ [].concat(Pt, [pe]).reduce(function(e, t) {
1187
1208
  return e.concat([t, t + "-" + ft, t + "-" + It]);
1188
- }, []), Bn = "beforeRead", Rn = "read", Hn = "afterRead", Vn = "beforeMain", Jn = "main", zn = "afterMain", Kn = "beforeWrite", Gn = "write", Qn = "afterWrite", Zn = [Bn, Rn, Hn, Vn, Jn, zn, Kn, Gn, Qn];
1209
+ }, []), Ni = "beforeRead", Wi = "read", _i = "afterRead", Bi = "beforeMain", Ri = "main", Vi = "afterMain", Hi = "beforeWrite", Ji = "write", zi = "afterWrite", Ki = [Ni, Wi, _i, Bi, Ri, Vi, Hi, Ji, zi];
1189
1210
  function z(e) {
1190
1211
  return e ? (e.nodeName || "").toLowerCase() : null;
1191
1212
  }
1192
- function _(e) {
1213
+ function F(e) {
1193
1214
  if (e == null)
1194
1215
  return window;
1195
1216
  if (e.toString() !== "[object Window]") {
@@ -1198,32 +1219,32 @@ function _(e) {
1198
1219
  }
1199
1220
  return e;
1200
1221
  }
1201
- function rt(e) {
1202
- var t = _(e).Element;
1222
+ function st(e) {
1223
+ var t = F(e).Element;
1203
1224
  return e instanceof t || e instanceof Element;
1204
1225
  }
1205
- function F(e) {
1206
- var t = _(e).HTMLElement;
1226
+ function N(e) {
1227
+ var t = F(e).HTMLElement;
1207
1228
  return e instanceof t || e instanceof HTMLElement;
1208
1229
  }
1209
- function me(e) {
1230
+ function ge(e) {
1210
1231
  if (typeof ShadowRoot > "u")
1211
1232
  return !1;
1212
- var t = _(e).ShadowRoot;
1233
+ var t = F(e).ShadowRoot;
1213
1234
  return e instanceof t || e instanceof ShadowRoot;
1214
1235
  }
1215
- function Un(e) {
1236
+ function Gi(e) {
1216
1237
  var t = e.state;
1217
- Object.keys(t.elements).forEach(function(i) {
1218
- var n = t.styles[i] || {}, s = t.attributes[i] || {}, r = t.elements[i];
1219
- !F(r) || !z(r) || (Object.assign(r.style, n), Object.keys(s).forEach(function(a) {
1220
- var l = s[a];
1221
- l === !1 ? r.removeAttribute(a) : r.setAttribute(a, l === !0 ? "" : l);
1238
+ Object.keys(t.elements).forEach(function(n) {
1239
+ var i = t.styles[n] || {}, r = t.attributes[n] || {}, s = t.elements[n];
1240
+ !N(s) || !z(s) || (Object.assign(s.style, i), Object.keys(r).forEach(function(a) {
1241
+ var c = r[a];
1242
+ c === !1 ? s.removeAttribute(a) : s.setAttribute(a, c === !0 ? "" : c);
1222
1243
  }));
1223
1244
  });
1224
1245
  }
1225
- function Xn(e) {
1226
- var t = e.state, i = {
1246
+ function Qi(e) {
1247
+ var t = e.state, n = {
1227
1248
  popper: {
1228
1249
  position: t.options.strategy,
1229
1250
  left: "0",
@@ -1235,137 +1256,137 @@ function Xn(e) {
1235
1256
  },
1236
1257
  reference: {}
1237
1258
  };
1238
- return Object.assign(t.elements.popper.style, i.popper), t.styles = i, t.elements.arrow && Object.assign(t.elements.arrow.style, i.arrow), function() {
1239
- Object.keys(t.elements).forEach(function(n) {
1240
- var s = t.elements[n], r = t.attributes[n] || {}, a = Object.keys(t.styles.hasOwnProperty(n) ? t.styles[n] : i[n]), l = a.reduce(function(o, c) {
1241
- return o[c] = "", o;
1259
+ return Object.assign(t.elements.popper.style, n.popper), t.styles = n, t.elements.arrow && Object.assign(t.elements.arrow.style, n.arrow), function() {
1260
+ Object.keys(t.elements).forEach(function(i) {
1261
+ var r = t.elements[i], s = t.attributes[i] || {}, a = Object.keys(t.styles.hasOwnProperty(i) ? t.styles[i] : n[i]), c = a.reduce(function(o, l) {
1262
+ return o[l] = "", o;
1242
1263
  }, {});
1243
- !F(s) || !z(s) || (Object.assign(s.style, l), Object.keys(r).forEach(function(o) {
1244
- s.removeAttribute(o);
1264
+ !N(r) || !z(r) || (Object.assign(r.style, c), Object.keys(s).forEach(function(o) {
1265
+ r.removeAttribute(o);
1245
1266
  }));
1246
1267
  });
1247
1268
  };
1248
1269
  }
1249
- const Yn = {
1270
+ const Zi = {
1250
1271
  name: "applyStyles",
1251
1272
  enabled: !0,
1252
1273
  phase: "write",
1253
- fn: Un,
1254
- effect: Xn,
1274
+ fn: Gi,
1275
+ effect: Qi,
1255
1276
  requires: ["computeStyles"]
1256
1277
  };
1257
1278
  function J(e) {
1258
1279
  return e.split("-")[0];
1259
1280
  }
1260
- var st = Math.max, zt = Math.min, pt = Math.round;
1281
+ var rt = Math.max, Jt = Math.min, pt = Math.round;
1261
1282
  function re() {
1262
1283
  var e = navigator.userAgentData;
1263
1284
  return e != null && e.brands && Array.isArray(e.brands) ? e.brands.map(function(t) {
1264
1285
  return t.brand + "/" + t.version;
1265
1286
  }).join(" ") : navigator.userAgent;
1266
1287
  }
1267
- function hi() {
1288
+ function pn() {
1268
1289
  return !/^((?!chrome|android).)*safari/i.test(re());
1269
1290
  }
1270
- function gt(e, t, i) {
1271
- t === void 0 && (t = !1), i === void 0 && (i = !1);
1272
- var n = e.getBoundingClientRect(), s = 1, r = 1;
1273
- t && F(e) && (s = e.offsetWidth > 0 && pt(n.width) / e.offsetWidth || 1, r = e.offsetHeight > 0 && pt(n.height) / e.offsetHeight || 1);
1274
- var a = rt(e) ? _(e) : window, l = a.visualViewport, o = !hi() && i, c = (n.left + (o && l ? l.offsetLeft : 0)) / s, d = (n.top + (o && l ? l.offsetTop : 0)) / r, b = n.width / s, v = n.height / r;
1291
+ function gt(e, t, n) {
1292
+ t === void 0 && (t = !1), n === void 0 && (n = !1);
1293
+ var i = e.getBoundingClientRect(), r = 1, s = 1;
1294
+ t && N(e) && (r = e.offsetWidth > 0 && pt(i.width) / e.offsetWidth || 1, s = e.offsetHeight > 0 && pt(i.height) / e.offsetHeight || 1);
1295
+ var a = st(e) ? F(e) : window, c = a.visualViewport, o = !pn() && n, l = (i.left + (o && c ? c.offsetLeft : 0)) / r, d = (i.top + (o && c ? c.offsetTop : 0)) / s, b = i.width / r, v = i.height / s;
1275
1296
  return {
1276
1297
  width: b,
1277
1298
  height: v,
1278
1299
  top: d,
1279
- right: c + b,
1300
+ right: l + b,
1280
1301
  bottom: d + v,
1281
- left: c,
1282
- x: c,
1302
+ left: l,
1303
+ x: l,
1283
1304
  y: d
1284
1305
  };
1285
1306
  }
1286
- function ve(e) {
1287
- var t = gt(e), i = e.offsetWidth, n = e.offsetHeight;
1288
- return Math.abs(t.width - i) <= 1 && (i = t.width), Math.abs(t.height - n) <= 1 && (n = t.height), {
1307
+ function me(e) {
1308
+ var t = gt(e), n = e.offsetWidth, i = e.offsetHeight;
1309
+ return Math.abs(t.width - n) <= 1 && (n = t.width), Math.abs(t.height - i) <= 1 && (i = t.height), {
1289
1310
  x: e.offsetLeft,
1290
1311
  y: e.offsetTop,
1291
- width: i,
1292
- height: n
1312
+ width: n,
1313
+ height: i
1293
1314
  };
1294
1315
  }
1295
- function fi(e, t) {
1296
- var i = t.getRootNode && t.getRootNode();
1316
+ function gn(e, t) {
1317
+ var n = t.getRootNode && t.getRootNode();
1297
1318
  if (e.contains(t))
1298
1319
  return !0;
1299
- if (i && me(i)) {
1300
- var n = t;
1320
+ if (n && ge(n)) {
1321
+ var i = t;
1301
1322
  do {
1302
- if (n && e.isSameNode(n))
1323
+ if (i && e.isSameNode(i))
1303
1324
  return !0;
1304
- n = n.parentNode || n.host;
1305
- } while (n);
1325
+ i = i.parentNode || i.host;
1326
+ } while (i);
1306
1327
  }
1307
1328
  return !1;
1308
1329
  }
1309
1330
  function G(e) {
1310
- return _(e).getComputedStyle(e);
1331
+ return F(e).getComputedStyle(e);
1311
1332
  }
1312
- function ts(e) {
1333
+ function Xi(e) {
1313
1334
  return ["table", "td", "th"].indexOf(z(e)) >= 0;
1314
1335
  }
1315
1336
  function Z(e) {
1316
- return ((rt(e) ? e.ownerDocument : (
1337
+ return ((st(e) ? e.ownerDocument : (
1317
1338
  // $FlowFixMe[prop-missing]
1318
1339
  e.document
1319
1340
  )) || window.document).documentElement;
1320
1341
  }
1321
- function Qt(e) {
1342
+ function Gt(e) {
1322
1343
  return z(e) === "html" ? e : (
1323
1344
  // this is a quicker (but less type safe) way to save quite some bytes from the bundle
1324
1345
  // $FlowFixMe[incompatible-return]
1325
1346
  // $FlowFixMe[prop-missing]
1326
1347
  e.assignedSlot || // step into the shadow DOM of the parent of a slotted node
1327
1348
  e.parentNode || // DOM Element detected
1328
- (me(e) ? e.host : null) || // ShadowRoot detected
1349
+ (ge(e) ? e.host : null) || // ShadowRoot detected
1329
1350
  // $FlowFixMe[incompatible-call]: HTMLElement is a Node
1330
1351
  Z(e)
1331
1352
  );
1332
1353
  }
1333
- function _e(e) {
1334
- return !F(e) || // https://github.com/popperjs/popper-core/issues/837
1354
+ function Ne(e) {
1355
+ return !N(e) || // https://github.com/popperjs/popper-core/issues/837
1335
1356
  G(e).position === "fixed" ? null : e.offsetParent;
1336
1357
  }
1337
- function es(e) {
1338
- var t = /firefox/i.test(re()), i = /Trident/i.test(re());
1339
- if (i && F(e)) {
1340
- var n = G(e);
1341
- if (n.position === "fixed")
1358
+ function Yi(e) {
1359
+ var t = /firefox/i.test(re()), n = /Trident/i.test(re());
1360
+ if (n && N(e)) {
1361
+ var i = G(e);
1362
+ if (i.position === "fixed")
1342
1363
  return null;
1343
1364
  }
1344
- var s = Qt(e);
1345
- for (me(s) && (s = s.host); F(s) && ["html", "body"].indexOf(z(s)) < 0; ) {
1346
- var r = G(s);
1347
- if (r.transform !== "none" || r.perspective !== "none" || r.contain === "paint" || ["transform", "perspective"].indexOf(r.willChange) !== -1 || t && r.willChange === "filter" || t && r.filter && r.filter !== "none")
1348
- return s;
1349
- s = s.parentNode;
1365
+ var r = Gt(e);
1366
+ for (ge(r) && (r = r.host); N(r) && ["html", "body"].indexOf(z(r)) < 0; ) {
1367
+ var s = G(r);
1368
+ if (s.transform !== "none" || s.perspective !== "none" || s.contain === "paint" || ["transform", "perspective"].indexOf(s.willChange) !== -1 || t && s.willChange === "filter" || t && s.filter && s.filter !== "none")
1369
+ return r;
1370
+ r = r.parentNode;
1350
1371
  }
1351
1372
  return null;
1352
1373
  }
1353
1374
  function Dt(e) {
1354
- for (var t = _(e), i = _e(e); i && ts(i) && G(i).position === "static"; )
1355
- i = _e(i);
1356
- return i && (z(i) === "html" || z(i) === "body" && G(i).position === "static") ? t : i || es(e) || t;
1375
+ for (var t = F(e), n = Ne(e); n && Xi(n) && G(n).position === "static"; )
1376
+ n = Ne(n);
1377
+ return n && (z(n) === "html" || z(n) === "body" && G(n).position === "static") ? t : n || Yi(e) || t;
1357
1378
  }
1358
- function be(e) {
1379
+ function ve(e) {
1359
1380
  return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y";
1360
1381
  }
1361
- function At(e, t, i) {
1362
- return st(e, zt(t, i));
1382
+ function St(e, t, n) {
1383
+ return rt(e, Jt(t, n));
1363
1384
  }
1364
- function is(e, t, i) {
1365
- var n = At(e, t, i);
1366
- return n > i ? i : n;
1385
+ function Ui(e, t, n) {
1386
+ var i = St(e, t, n);
1387
+ return i > n ? n : i;
1367
1388
  }
1368
- function pi() {
1389
+ function mn() {
1369
1390
  return {
1370
1391
  top: 0,
1371
1392
  right: 0,
@@ -1373,57 +1394,57 @@ function pi() {
1373
1394
  left: 0
1374
1395
  };
1375
1396
  }
1376
- function gi(e) {
1377
- return Object.assign({}, pi(), e);
1397
+ function vn(e) {
1398
+ return Object.assign({}, mn(), e);
1378
1399
  }
1379
- function mi(e, t) {
1380
- return t.reduce(function(i, n) {
1381
- return i[n] = e, i;
1400
+ function bn(e, t) {
1401
+ return t.reduce(function(n, i) {
1402
+ return n[i] = e, n;
1382
1403
  }, {});
1383
1404
  }
1384
- var ns = function(e, t) {
1405
+ var tr = function(e, t) {
1385
1406
  return e = typeof e == "function" ? e(Object.assign({}, t.rects, {
1386
1407
  placement: t.placement
1387
- })) : e, gi(typeof e != "number" ? e : mi(e, qt));
1408
+ })) : e, vn(typeof e != "number" ? e : bn(e, Pt));
1388
1409
  };
1389
- function ss(e) {
1390
- var t, i = e.state, n = e.name, s = e.options, r = i.elements.arrow, a = i.modifiersData.popperOffsets, l = J(i.placement), o = be(l), c = [j, R].indexOf(l) >= 0, d = c ? "height" : "width";
1391
- if (!(!r || !a)) {
1392
- var b = ns(s.padding, i), v = ve(r), h = o === "y" ? W : j, $ = o === "y" ? B : R, u = i.rects.reference[d] + i.rects.reference[o] - a[o] - i.rects.popper[d], w = a[o] - i.rects.reference[o], E = Dt(r), L = E ? o === "y" ? E.clientHeight || 0 : E.clientWidth || 0 : 0, O = u / 2 - w / 2, f = b[h], y = L - v[d] - b[$], x = L / 2 - v[d] / 2 + O, k = At(f, x, y), T = o;
1393
- i.modifiersData[n] = (t = {}, t[T] = k, t.centerOffset = k - x, t);
1410
+ function er(e) {
1411
+ var t, n = e.state, i = e.name, r = e.options, s = n.elements.arrow, a = n.modifiersData.popperOffsets, c = J(n.placement), o = ve(c), l = [D, _].indexOf(c) >= 0, d = l ? "height" : "width";
1412
+ if (!(!s || !a)) {
1413
+ var b = tr(r.padding, n), v = me(s), h = o === "y" ? P : D, $ = o === "y" ? W : _, u = n.rects.reference[d] + n.rects.reference[o] - a[o] - n.rects.popper[d], w = a[o] - n.rects.reference[o], E = Dt(s), O = E ? o === "y" ? E.clientHeight || 0 : E.clientWidth || 0 : 0, L = u / 2 - w / 2, f = b[h], y = O - v[d] - b[$], x = O / 2 - v[d] / 2 + L, k = St(f, x, y), T = o;
1414
+ n.modifiersData[i] = (t = {}, t[T] = k, t.centerOffset = k - x, t);
1394
1415
  }
1395
1416
  }
1396
- function rs(e) {
1397
- var t = e.state, i = e.options, n = i.element, s = n === void 0 ? "[data-popper-arrow]" : n;
1398
- s != null && (typeof s == "string" && (s = t.elements.popper.querySelector(s), !s) || fi(t.elements.popper, s) && (t.elements.arrow = s));
1417
+ function nr(e) {
1418
+ var t = e.state, n = e.options, i = n.element, r = i === void 0 ? "[data-popper-arrow]" : i;
1419
+ r != null && (typeof r == "string" && (r = t.elements.popper.querySelector(r), !r) || gn(t.elements.popper, r) && (t.elements.arrow = r));
1399
1420
  }
1400
- const os = {
1421
+ const ir = {
1401
1422
  name: "arrow",
1402
1423
  enabled: !0,
1403
1424
  phase: "main",
1404
- fn: ss,
1405
- effect: rs,
1425
+ fn: er,
1426
+ effect: nr,
1406
1427
  requires: ["popperOffsets"],
1407
1428
  requiresIfExists: ["preventOverflow"]
1408
1429
  };
1409
1430
  function mt(e) {
1410
1431
  return e.split("-")[1];
1411
1432
  }
1412
- var as = {
1433
+ var rr = {
1413
1434
  top: "auto",
1414
1435
  right: "auto",
1415
1436
  bottom: "auto",
1416
1437
  left: "auto"
1417
1438
  };
1418
- function ls(e, t) {
1419
- var i = e.x, n = e.y, s = t.devicePixelRatio || 1;
1439
+ function sr(e, t) {
1440
+ var n = e.x, i = e.y, r = t.devicePixelRatio || 1;
1420
1441
  return {
1421
- x: pt(i * s) / s || 0,
1422
- y: pt(n * s) / s || 0
1442
+ x: pt(n * r) / r || 0,
1443
+ y: pt(i * r) / r || 0
1423
1444
  };
1424
1445
  }
1425
- function Fe(e) {
1426
- var t, i = e.popper, n = e.popperRect, s = e.placement, r = e.variation, a = e.offsets, l = e.position, o = e.gpuAcceleration, c = e.adaptive, d = e.roundOffsets, b = e.isFixed, v = a.x, h = v === void 0 ? 0 : v, $ = a.y, u = $ === void 0 ? 0 : $, w = typeof d == "function" ? d({
1446
+ function We(e) {
1447
+ var t, n = e.popper, i = e.popperRect, r = e.placement, s = e.variation, a = e.offsets, c = e.position, o = e.gpuAcceleration, l = e.adaptive, d = e.roundOffsets, b = e.isFixed, v = a.x, h = v === void 0 ? 0 : v, $ = a.y, u = $ === void 0 ? 0 : $, w = typeof d == "function" ? d({
1427
1448
  x: h,
1428
1449
  y: u
1429
1450
  }) : {
@@ -1431,56 +1452,56 @@ function Fe(e) {
1431
1452
  y: u
1432
1453
  };
1433
1454
  h = w.x, u = w.y;
1434
- var E = a.hasOwnProperty("x"), L = a.hasOwnProperty("y"), O = j, f = W, y = window;
1435
- if (c) {
1436
- var x = Dt(i), k = "clientHeight", T = "clientWidth";
1437
- if (x === _(i) && (x = Z(i), G(x).position !== "static" && l === "absolute" && (k = "scrollHeight", T = "scrollWidth")), x = x, s === W || (s === j || s === R) && r === It) {
1438
- f = B;
1439
- var A = b && x === y && y.visualViewport ? y.visualViewport.height : (
1455
+ var E = a.hasOwnProperty("x"), O = a.hasOwnProperty("y"), L = D, f = P, y = window;
1456
+ if (l) {
1457
+ var x = Dt(n), k = "clientHeight", T = "clientWidth";
1458
+ if (x === F(n) && (x = Z(n), G(x).position !== "static" && c === "absolute" && (k = "scrollHeight", T = "scrollWidth")), x = x, r === P || (r === D || r === _) && s === It) {
1459
+ f = W;
1460
+ var S = b && x === y && y.visualViewport ? y.visualViewport.height : (
1440
1461
  // $FlowFixMe[prop-missing]
1441
1462
  x[k]
1442
1463
  );
1443
- u -= A - n.height, u *= o ? 1 : -1;
1464
+ u -= S - i.height, u *= o ? 1 : -1;
1444
1465
  }
1445
- if (s === j || (s === W || s === B) && r === It) {
1446
- O = R;
1466
+ if (r === D || (r === P || r === W) && s === It) {
1467
+ L = _;
1447
1468
  var C = b && x === y && y.visualViewport ? y.visualViewport.width : (
1448
1469
  // $FlowFixMe[prop-missing]
1449
1470
  x[T]
1450
1471
  );
1451
- h -= C - n.width, h *= o ? 1 : -1;
1472
+ h -= C - i.width, h *= o ? 1 : -1;
1452
1473
  }
1453
1474
  }
1454
1475
  var I = Object.assign({
1455
- position: l
1456
- }, c && as), H = d === !0 ? ls({
1476
+ position: c
1477
+ }, l && rr), B = d === !0 ? sr({
1457
1478
  x: h,
1458
1479
  y: u
1459
- }, _(i)) : {
1480
+ }, F(n)) : {
1460
1481
  x: h,
1461
1482
  y: u
1462
1483
  };
1463
- if (h = H.x, u = H.y, o) {
1464
- var D;
1465
- return Object.assign({}, I, (D = {}, D[f] = L ? "0" : "", D[O] = E ? "0" : "", D.transform = (y.devicePixelRatio || 1) <= 1 ? "translate(" + h + "px, " + u + "px)" : "translate3d(" + h + "px, " + u + "px, 0)", D));
1484
+ if (h = B.x, u = B.y, o) {
1485
+ var A;
1486
+ return Object.assign({}, I, (A = {}, A[f] = O ? "0" : "", A[L] = E ? "0" : "", A.transform = (y.devicePixelRatio || 1) <= 1 ? "translate(" + h + "px, " + u + "px)" : "translate3d(" + h + "px, " + u + "px, 0)", A));
1466
1487
  }
1467
- return Object.assign({}, I, (t = {}, t[f] = L ? u + "px" : "", t[O] = E ? h + "px" : "", t.transform = "", t));
1488
+ return Object.assign({}, I, (t = {}, t[f] = O ? u + "px" : "", t[L] = E ? h + "px" : "", t.transform = "", t));
1468
1489
  }
1469
- function cs(e) {
1470
- var t = e.state, i = e.options, n = i.gpuAcceleration, s = n === void 0 ? !0 : n, r = i.adaptive, a = r === void 0 ? !0 : r, l = i.roundOffsets, o = l === void 0 ? !0 : l, c = {
1490
+ function or(e) {
1491
+ var t = e.state, n = e.options, i = n.gpuAcceleration, r = i === void 0 ? !0 : i, s = n.adaptive, a = s === void 0 ? !0 : s, c = n.roundOffsets, o = c === void 0 ? !0 : c, l = {
1471
1492
  placement: J(t.placement),
1472
1493
  variation: mt(t.placement),
1473
1494
  popper: t.elements.popper,
1474
1495
  popperRect: t.rects.popper,
1475
- gpuAcceleration: s,
1496
+ gpuAcceleration: r,
1476
1497
  isFixed: t.options.strategy === "fixed"
1477
1498
  };
1478
- t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, Fe(Object.assign({}, c, {
1499
+ t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, We(Object.assign({}, l, {
1479
1500
  offsets: t.modifiersData.popperOffsets,
1480
1501
  position: t.options.strategy,
1481
1502
  adaptive: a,
1482
1503
  roundOffsets: o
1483
- })))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, Fe(Object.assign({}, c, {
1504
+ })))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, We(Object.assign({}, l, {
1484
1505
  offsets: t.modifiersData.arrow,
1485
1506
  position: "absolute",
1486
1507
  adaptive: !1,
@@ -1489,105 +1510,105 @@ function cs(e) {
1489
1510
  "data-popper-placement": t.placement
1490
1511
  });
1491
1512
  }
1492
- const ds = {
1513
+ const ar = {
1493
1514
  name: "computeStyles",
1494
1515
  enabled: !0,
1495
1516
  phase: "beforeWrite",
1496
- fn: cs,
1517
+ fn: or,
1497
1518
  data: {}
1498
1519
  };
1499
1520
  var Bt = {
1500
1521
  passive: !0
1501
1522
  };
1502
- function us(e) {
1503
- var t = e.state, i = e.instance, n = e.options, s = n.scroll, r = s === void 0 ? !0 : s, a = n.resize, l = a === void 0 ? !0 : a, o = _(t.elements.popper), c = [].concat(t.scrollParents.reference, t.scrollParents.popper);
1504
- return r && c.forEach(function(d) {
1505
- d.addEventListener("scroll", i.update, Bt);
1506
- }), l && o.addEventListener("resize", i.update, Bt), function() {
1507
- r && c.forEach(function(d) {
1508
- d.removeEventListener("scroll", i.update, Bt);
1509
- }), l && o.removeEventListener("resize", i.update, Bt);
1523
+ function lr(e) {
1524
+ var t = e.state, n = e.instance, i = e.options, r = i.scroll, s = r === void 0 ? !0 : r, a = i.resize, c = a === void 0 ? !0 : a, o = F(t.elements.popper), l = [].concat(t.scrollParents.reference, t.scrollParents.popper);
1525
+ return s && l.forEach(function(d) {
1526
+ d.addEventListener("scroll", n.update, Bt);
1527
+ }), c && o.addEventListener("resize", n.update, Bt), function() {
1528
+ s && l.forEach(function(d) {
1529
+ d.removeEventListener("scroll", n.update, Bt);
1530
+ }), c && o.removeEventListener("resize", n.update, Bt);
1510
1531
  };
1511
1532
  }
1512
- const hs = {
1533
+ const cr = {
1513
1534
  name: "eventListeners",
1514
1535
  enabled: !0,
1515
1536
  phase: "write",
1516
1537
  fn: function() {
1517
1538
  },
1518
- effect: us,
1539
+ effect: lr,
1519
1540
  data: {}
1520
1541
  };
1521
- var fs = {
1542
+ var dr = {
1522
1543
  left: "right",
1523
1544
  right: "left",
1524
1545
  bottom: "top",
1525
1546
  top: "bottom"
1526
1547
  };
1527
- function Vt(e) {
1548
+ function Ht(e) {
1528
1549
  return e.replace(/left|right|bottom|top/g, function(t) {
1529
- return fs[t];
1550
+ return dr[t];
1530
1551
  });
1531
1552
  }
1532
- var ps = {
1553
+ var ur = {
1533
1554
  start: "end",
1534
1555
  end: "start"
1535
1556
  };
1536
- function Be(e) {
1557
+ function _e(e) {
1537
1558
  return e.replace(/start|end/g, function(t) {
1538
- return ps[t];
1559
+ return ur[t];
1539
1560
  });
1540
1561
  }
1541
- function ye(e) {
1542
- var t = _(e), i = t.pageXOffset, n = t.pageYOffset;
1562
+ function be(e) {
1563
+ var t = F(e), n = t.pageXOffset, i = t.pageYOffset;
1543
1564
  return {
1544
- scrollLeft: i,
1545
- scrollTop: n
1565
+ scrollLeft: n,
1566
+ scrollTop: i
1546
1567
  };
1547
1568
  }
1548
- function we(e) {
1549
- return gt(Z(e)).left + ye(e).scrollLeft;
1569
+ function ye(e) {
1570
+ return gt(Z(e)).left + be(e).scrollLeft;
1550
1571
  }
1551
- function gs(e, t) {
1552
- var i = _(e), n = Z(e), s = i.visualViewport, r = n.clientWidth, a = n.clientHeight, l = 0, o = 0;
1553
- if (s) {
1554
- r = s.width, a = s.height;
1555
- var c = hi();
1556
- (c || !c && t === "fixed") && (l = s.offsetLeft, o = s.offsetTop);
1572
+ function hr(e, t) {
1573
+ var n = F(e), i = Z(e), r = n.visualViewport, s = i.clientWidth, a = i.clientHeight, c = 0, o = 0;
1574
+ if (r) {
1575
+ s = r.width, a = r.height;
1576
+ var l = pn();
1577
+ (l || !l && t === "fixed") && (c = r.offsetLeft, o = r.offsetTop);
1557
1578
  }
1558
1579
  return {
1559
- width: r,
1580
+ width: s,
1560
1581
  height: a,
1561
- x: l + we(e),
1582
+ x: c + ye(e),
1562
1583
  y: o
1563
1584
  };
1564
1585
  }
1565
- function ms(e) {
1566
- var t, i = Z(e), n = ye(e), s = (t = e.ownerDocument) == null ? void 0 : t.body, r = st(i.scrollWidth, i.clientWidth, s ? s.scrollWidth : 0, s ? s.clientWidth : 0), a = st(i.scrollHeight, i.clientHeight, s ? s.scrollHeight : 0, s ? s.clientHeight : 0), l = -n.scrollLeft + we(e), o = -n.scrollTop;
1567
- return G(s || i).direction === "rtl" && (l += st(i.clientWidth, s ? s.clientWidth : 0) - r), {
1568
- width: r,
1586
+ function fr(e) {
1587
+ var t, n = Z(e), i = be(e), r = (t = e.ownerDocument) == null ? void 0 : t.body, s = rt(n.scrollWidth, n.clientWidth, r ? r.scrollWidth : 0, r ? r.clientWidth : 0), a = rt(n.scrollHeight, n.clientHeight, r ? r.scrollHeight : 0, r ? r.clientHeight : 0), c = -i.scrollLeft + ye(e), o = -i.scrollTop;
1588
+ return G(r || n).direction === "rtl" && (c += rt(n.clientWidth, r ? r.clientWidth : 0) - s), {
1589
+ width: s,
1569
1590
  height: a,
1570
- x: l,
1591
+ x: c,
1571
1592
  y: o
1572
1593
  };
1573
1594
  }
1574
- function $e(e) {
1575
- var t = G(e), i = t.overflow, n = t.overflowX, s = t.overflowY;
1576
- return /auto|scroll|overlay|hidden/.test(i + s + n);
1595
+ function we(e) {
1596
+ var t = G(e), n = t.overflow, i = t.overflowX, r = t.overflowY;
1597
+ return /auto|scroll|overlay|hidden/.test(n + r + i);
1577
1598
  }
1578
- function vi(e) {
1579
- return ["html", "body", "#document"].indexOf(z(e)) >= 0 ? e.ownerDocument.body : F(e) && $e(e) ? e : vi(Qt(e));
1599
+ function yn(e) {
1600
+ return ["html", "body", "#document"].indexOf(z(e)) >= 0 ? e.ownerDocument.body : N(e) && we(e) ? e : yn(Gt(e));
1580
1601
  }
1581
1602
  function Ct(e, t) {
1582
- var i;
1603
+ var n;
1583
1604
  t === void 0 && (t = []);
1584
- var n = vi(e), s = n === ((i = e.ownerDocument) == null ? void 0 : i.body), r = _(n), a = s ? [r].concat(r.visualViewport || [], $e(n) ? n : []) : n, l = t.concat(a);
1585
- return s ? l : (
1605
+ var i = yn(e), r = i === ((n = e.ownerDocument) == null ? void 0 : n.body), s = F(i), a = r ? [s].concat(s.visualViewport || [], we(i) ? i : []) : i, c = t.concat(a);
1606
+ return r ? c : (
1586
1607
  // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
1587
- l.concat(Ct(Qt(a)))
1608
+ c.concat(Ct(Gt(a)))
1588
1609
  );
1589
1610
  }
1590
- function oe(e) {
1611
+ function se(e) {
1591
1612
  return Object.assign({}, e, {
1592
1613
  left: e.x,
1593
1614
  top: e.y,
@@ -1595,51 +1616,51 @@ function oe(e) {
1595
1616
  bottom: e.y + e.height
1596
1617
  });
1597
1618
  }
1598
- function vs(e, t) {
1599
- var i = gt(e, !1, t === "fixed");
1600
- return i.top = i.top + e.clientTop, i.left = i.left + e.clientLeft, i.bottom = i.top + e.clientHeight, i.right = i.left + e.clientWidth, i.width = e.clientWidth, i.height = e.clientHeight, i.x = i.left, i.y = i.top, i;
1619
+ function pr(e, t) {
1620
+ var n = gt(e, !1, t === "fixed");
1621
+ return n.top = n.top + e.clientTop, n.left = n.left + e.clientLeft, n.bottom = n.top + e.clientHeight, n.right = n.left + e.clientWidth, n.width = e.clientWidth, n.height = e.clientHeight, n.x = n.left, n.y = n.top, n;
1601
1622
  }
1602
- function Re(e, t, i) {
1603
- return t === di ? oe(gs(e, i)) : rt(t) ? vs(t, i) : oe(ms(Z(e)));
1623
+ function Be(e, t, n) {
1624
+ return t === hn ? se(hr(e, n)) : st(t) ? pr(t, n) : se(fr(Z(e)));
1604
1625
  }
1605
- function bs(e) {
1606
- var t = Ct(Qt(e)), i = ["absolute", "fixed"].indexOf(G(e).position) >= 0, n = i && F(e) ? Dt(e) : e;
1607
- return rt(n) ? t.filter(function(s) {
1608
- return rt(s) && fi(s, n) && z(s) !== "body";
1626
+ function gr(e) {
1627
+ var t = Ct(Gt(e)), n = ["absolute", "fixed"].indexOf(G(e).position) >= 0, i = n && N(e) ? Dt(e) : e;
1628
+ return st(i) ? t.filter(function(r) {
1629
+ return st(r) && gn(r, i) && z(r) !== "body";
1609
1630
  }) : [];
1610
1631
  }
1611
- function ys(e, t, i, n) {
1612
- var s = t === "clippingParents" ? bs(e) : [].concat(t), r = [].concat(s, [i]), a = r[0], l = r.reduce(function(o, c) {
1613
- var d = Re(e, c, n);
1614
- return o.top = st(d.top, o.top), o.right = zt(d.right, o.right), o.bottom = zt(d.bottom, o.bottom), o.left = st(d.left, o.left), o;
1615
- }, Re(e, a, n));
1616
- return l.width = l.right - l.left, l.height = l.bottom - l.top, l.x = l.left, l.y = l.top, l;
1617
- }
1618
- function bi(e) {
1619
- var t = e.reference, i = e.element, n = e.placement, s = n ? J(n) : null, r = n ? mt(n) : null, a = t.x + t.width / 2 - i.width / 2, l = t.y + t.height / 2 - i.height / 2, o;
1620
- switch (s) {
1621
- case W:
1632
+ function mr(e, t, n, i) {
1633
+ var r = t === "clippingParents" ? gr(e) : [].concat(t), s = [].concat(r, [n]), a = s[0], c = s.reduce(function(o, l) {
1634
+ var d = Be(e, l, i);
1635
+ return o.top = rt(d.top, o.top), o.right = Jt(d.right, o.right), o.bottom = Jt(d.bottom, o.bottom), o.left = rt(d.left, o.left), o;
1636
+ }, Be(e, a, i));
1637
+ return c.width = c.right - c.left, c.height = c.bottom - c.top, c.x = c.left, c.y = c.top, c;
1638
+ }
1639
+ function wn(e) {
1640
+ var t = e.reference, n = e.element, i = e.placement, r = i ? J(i) : null, s = i ? mt(i) : null, a = t.x + t.width / 2 - n.width / 2, c = t.y + t.height / 2 - n.height / 2, o;
1641
+ switch (r) {
1642
+ case P:
1622
1643
  o = {
1623
1644
  x: a,
1624
- y: t.y - i.height
1645
+ y: t.y - n.height
1625
1646
  };
1626
1647
  break;
1627
- case B:
1648
+ case W:
1628
1649
  o = {
1629
1650
  x: a,
1630
1651
  y: t.y + t.height
1631
1652
  };
1632
1653
  break;
1633
- case R:
1654
+ case _:
1634
1655
  o = {
1635
1656
  x: t.x + t.width,
1636
- y: l
1657
+ y: c
1637
1658
  };
1638
1659
  break;
1639
- case j:
1660
+ case D:
1640
1661
  o = {
1641
- x: t.x - i.width,
1642
- y: l
1662
+ x: t.x - n.width,
1663
+ y: c
1643
1664
  };
1644
1665
  break;
1645
1666
  default:
@@ -1648,55 +1669,55 @@ function bi(e) {
1648
1669
  y: t.y
1649
1670
  };
1650
1671
  }
1651
- var c = s ? be(s) : null;
1652
- if (c != null) {
1653
- var d = c === "y" ? "height" : "width";
1654
- switch (r) {
1672
+ var l = r ? ve(r) : null;
1673
+ if (l != null) {
1674
+ var d = l === "y" ? "height" : "width";
1675
+ switch (s) {
1655
1676
  case ft:
1656
- o[c] = o[c] - (t[d] / 2 - i[d] / 2);
1677
+ o[l] = o[l] - (t[d] / 2 - n[d] / 2);
1657
1678
  break;
1658
1679
  case It:
1659
- o[c] = o[c] + (t[d] / 2 - i[d] / 2);
1680
+ o[l] = o[l] + (t[d] / 2 - n[d] / 2);
1660
1681
  break;
1661
1682
  }
1662
1683
  }
1663
1684
  return o;
1664
1685
  }
1665
- function St(e, t) {
1686
+ function At(e, t) {
1666
1687
  t === void 0 && (t = {});
1667
- var i = t, n = i.placement, s = n === void 0 ? e.placement : n, r = i.strategy, a = r === void 0 ? e.strategy : r, l = i.boundary, o = l === void 0 ? _n : l, c = i.rootBoundary, d = c === void 0 ? di : c, b = i.elementContext, v = b === void 0 ? yt : b, h = i.altBoundary, $ = h === void 0 ? !1 : h, u = i.padding, w = u === void 0 ? 0 : u, E = gi(typeof w != "number" ? w : mi(w, qt)), L = v === yt ? Fn : yt, O = e.rects.popper, f = e.elements[$ ? L : v], y = ys(rt(f) ? f : f.contextElement || Z(e.elements.popper), o, d, a), x = gt(e.elements.reference), k = bi({
1688
+ var n = t, i = n.placement, r = i === void 0 ? e.placement : i, s = n.strategy, a = s === void 0 ? e.strategy : s, c = n.boundary, o = c === void 0 ? qi : c, l = n.rootBoundary, d = l === void 0 ? hn : l, b = n.elementContext, v = b === void 0 ? yt : b, h = n.altBoundary, $ = h === void 0 ? !1 : h, u = n.padding, w = u === void 0 ? 0 : u, E = vn(typeof w != "number" ? w : bn(w, Pt)), O = v === yt ? Fi : yt, L = e.rects.popper, f = e.elements[$ ? O : v], y = mr(st(f) ? f : f.contextElement || Z(e.elements.popper), o, d, a), x = gt(e.elements.reference), k = wn({
1668
1689
  reference: x,
1669
- element: O,
1690
+ element: L,
1670
1691
  strategy: "absolute",
1671
- placement: s
1672
- }), T = oe(Object.assign({}, O, k)), A = v === yt ? T : x, C = {
1673
- top: y.top - A.top + E.top,
1674
- bottom: A.bottom - y.bottom + E.bottom,
1675
- left: y.left - A.left + E.left,
1676
- right: A.right - y.right + E.right
1692
+ placement: r
1693
+ }), T = se(Object.assign({}, L, k)), S = v === yt ? T : x, C = {
1694
+ top: y.top - S.top + E.top,
1695
+ bottom: S.bottom - y.bottom + E.bottom,
1696
+ left: y.left - S.left + E.left,
1697
+ right: S.right - y.right + E.right
1677
1698
  }, I = e.modifiersData.offset;
1678
1699
  if (v === yt && I) {
1679
- var H = I[s];
1680
- Object.keys(C).forEach(function(D) {
1681
- var U = [R, B].indexOf(D) >= 0 ? 1 : -1, X = [W, B].indexOf(D) >= 0 ? "y" : "x";
1682
- C[D] += H[X] * U;
1700
+ var B = I[r];
1701
+ Object.keys(C).forEach(function(A) {
1702
+ var X = [_, W].indexOf(A) >= 0 ? 1 : -1, Y = [P, W].indexOf(A) >= 0 ? "y" : "x";
1703
+ C[A] += B[Y] * X;
1683
1704
  });
1684
1705
  }
1685
1706
  return C;
1686
1707
  }
1687
- function ws(e, t) {
1708
+ function vr(e, t) {
1688
1709
  t === void 0 && (t = {});
1689
- var i = t, n = i.placement, s = i.boundary, r = i.rootBoundary, a = i.padding, l = i.flipVariations, o = i.allowedAutoPlacements, c = o === void 0 ? ui : o, d = mt(n), b = d ? l ? Ne : Ne.filter(function($) {
1710
+ var n = t, i = n.placement, r = n.boundary, s = n.rootBoundary, a = n.padding, c = n.flipVariations, o = n.allowedAutoPlacements, l = o === void 0 ? fn : o, d = mt(i), b = d ? c ? Fe : Fe.filter(function($) {
1690
1711
  return mt($) === d;
1691
- }) : qt, v = b.filter(function($) {
1692
- return c.indexOf($) >= 0;
1712
+ }) : Pt, v = b.filter(function($) {
1713
+ return l.indexOf($) >= 0;
1693
1714
  });
1694
1715
  v.length === 0 && (v = b);
1695
1716
  var h = v.reduce(function($, u) {
1696
- return $[u] = St(e, {
1717
+ return $[u] = At(e, {
1697
1718
  placement: u,
1698
- boundary: s,
1699
- rootBoundary: r,
1719
+ boundary: r,
1720
+ rootBoundary: s,
1700
1721
  padding: a
1701
1722
  })[J(u)], $;
1702
1723
  }, {});
@@ -1704,96 +1725,96 @@ function ws(e, t) {
1704
1725
  return h[$] - h[u];
1705
1726
  });
1706
1727
  }
1707
- function $s(e) {
1708
- if (J(e) === ge)
1728
+ function br(e) {
1729
+ if (J(e) === pe)
1709
1730
  return [];
1710
- var t = Vt(e);
1711
- return [Be(e), t, Be(t)];
1712
- }
1713
- function Es(e) {
1714
- var t = e.state, i = e.options, n = e.name;
1715
- if (!t.modifiersData[n]._skip) {
1716
- for (var s = i.mainAxis, r = s === void 0 ? !0 : s, a = i.altAxis, l = a === void 0 ? !0 : a, o = i.fallbackPlacements, c = i.padding, d = i.boundary, b = i.rootBoundary, v = i.altBoundary, h = i.flipVariations, $ = h === void 0 ? !0 : h, u = i.allowedAutoPlacements, w = t.options.placement, E = J(w), L = E === w, O = o || (L || !$ ? [Vt(w)] : $s(w)), f = [w].concat(O).reduce(function(tt, K) {
1717
- return tt.concat(J(K) === ge ? ws(t, {
1731
+ var t = Ht(e);
1732
+ return [_e(e), t, _e(t)];
1733
+ }
1734
+ function yr(e) {
1735
+ var t = e.state, n = e.options, i = e.name;
1736
+ if (!t.modifiersData[i]._skip) {
1737
+ for (var r = n.mainAxis, s = r === void 0 ? !0 : r, a = n.altAxis, c = a === void 0 ? !0 : a, o = n.fallbackPlacements, l = n.padding, d = n.boundary, b = n.rootBoundary, v = n.altBoundary, h = n.flipVariations, $ = h === void 0 ? !0 : h, u = n.allowedAutoPlacements, w = t.options.placement, E = J(w), O = E === w, L = o || (O || !$ ? [Ht(w)] : br(w)), f = [w].concat(L).reduce(function(tt, K) {
1738
+ return tt.concat(J(K) === pe ? vr(t, {
1718
1739
  placement: K,
1719
1740
  boundary: d,
1720
1741
  rootBoundary: b,
1721
- padding: c,
1742
+ padding: l,
1722
1743
  flipVariations: $,
1723
1744
  allowedAutoPlacements: u
1724
1745
  }) : K);
1725
- }, []), y = t.rects.reference, x = t.rects.popper, k = /* @__PURE__ */ new Map(), T = !0, A = f[0], C = 0; C < f.length; C++) {
1726
- var I = f[C], H = J(I), D = mt(I) === ft, U = [W, B].indexOf(H) >= 0, X = U ? "width" : "height", N = St(t, {
1746
+ }, []), y = t.rects.reference, x = t.rects.popper, k = /* @__PURE__ */ new Map(), T = !0, S = f[0], C = 0; C < f.length; C++) {
1747
+ var I = f[C], B = J(I), A = mt(I) === ft, X = [P, W].indexOf(B) >= 0, Y = X ? "width" : "height", M = At(t, {
1727
1748
  placement: I,
1728
1749
  boundary: d,
1729
1750
  rootBoundary: b,
1730
1751
  altBoundary: v,
1731
- padding: c
1732
- }), V = U ? D ? R : j : D ? B : W;
1733
- y[X] > x[X] && (V = Vt(V));
1734
- var Pt = Vt(V), Y = [];
1735
- if (r && Y.push(N[H] <= 0), l && Y.push(N[V] <= 0, N[Pt] <= 0), Y.every(function(tt) {
1752
+ padding: l
1753
+ }), R = X ? A ? _ : D : A ? W : P;
1754
+ y[Y] > x[Y] && (R = Ht(R));
1755
+ var Mt = Ht(R), U = [];
1756
+ if (s && U.push(M[B] <= 0), c && U.push(M[R] <= 0, M[Mt] <= 0), U.every(function(tt) {
1736
1757
  return tt;
1737
1758
  })) {
1738
- A = I, T = !1;
1759
+ S = I, T = !1;
1739
1760
  break;
1740
1761
  }
1741
- k.set(I, Y);
1762
+ k.set(I, U);
1742
1763
  }
1743
1764
  if (T)
1744
- for (var Mt = $ ? 3 : 1, Zt = function(tt) {
1745
- var K = f.find(function(jt) {
1746
- var bt = k.get(jt);
1765
+ for (var jt = $ ? 3 : 1, Qt = function(tt) {
1766
+ var K = f.find(function(Ft) {
1767
+ var bt = k.get(Ft);
1747
1768
  if (bt)
1748
1769
  return bt.slice(0, tt).every(function(ot) {
1749
1770
  return ot;
1750
1771
  });
1751
1772
  });
1752
1773
  if (K)
1753
- return A = K, "break";
1754
- }, vt = Mt; vt > 0; vt--) {
1755
- var Wt = Zt(vt);
1756
- if (Wt === "break")
1774
+ return S = K, "break";
1775
+ }, vt = jt; vt > 0; vt--) {
1776
+ var qt = Qt(vt);
1777
+ if (qt === "break")
1757
1778
  break;
1758
1779
  }
1759
- t.placement !== A && (t.modifiersData[n]._skip = !0, t.placement = A, t.reset = !0);
1780
+ t.placement !== S && (t.modifiersData[i]._skip = !0, t.placement = S, t.reset = !0);
1760
1781
  }
1761
1782
  }
1762
- const xs = {
1783
+ const wr = {
1763
1784
  name: "flip",
1764
1785
  enabled: !0,
1765
1786
  phase: "main",
1766
- fn: Es,
1787
+ fn: yr,
1767
1788
  requiresIfExists: ["offset"],
1768
1789
  data: {
1769
1790
  _skip: !1
1770
1791
  }
1771
1792
  };
1772
- function He(e, t, i) {
1773
- return i === void 0 && (i = {
1793
+ function Re(e, t, n) {
1794
+ return n === void 0 && (n = {
1774
1795
  x: 0,
1775
1796
  y: 0
1776
1797
  }), {
1777
- top: e.top - t.height - i.y,
1778
- right: e.right - t.width + i.x,
1779
- bottom: e.bottom - t.height + i.y,
1780
- left: e.left - t.width - i.x
1798
+ top: e.top - t.height - n.y,
1799
+ right: e.right - t.width + n.x,
1800
+ bottom: e.bottom - t.height + n.y,
1801
+ left: e.left - t.width - n.x
1781
1802
  };
1782
1803
  }
1783
1804
  function Ve(e) {
1784
- return [W, R, B, j].some(function(t) {
1805
+ return [P, _, W, D].some(function(t) {
1785
1806
  return e[t] >= 0;
1786
1807
  });
1787
1808
  }
1788
- function Ls(e) {
1789
- var t = e.state, i = e.name, n = t.rects.reference, s = t.rects.popper, r = t.modifiersData.preventOverflow, a = St(t, {
1809
+ function $r(e) {
1810
+ var t = e.state, n = e.name, i = t.rects.reference, r = t.rects.popper, s = t.modifiersData.preventOverflow, a = At(t, {
1790
1811
  elementContext: "reference"
1791
- }), l = St(t, {
1812
+ }), c = At(t, {
1792
1813
  altBoundary: !0
1793
- }), o = He(a, n), c = He(l, s, r), d = Ve(o), b = Ve(c);
1794
- t.modifiersData[i] = {
1814
+ }), o = Re(a, i), l = Re(c, r, s), d = Ve(o), b = Ve(l);
1815
+ t.modifiersData[n] = {
1795
1816
  referenceClippingOffsets: o,
1796
- popperEscapeOffsets: c,
1817
+ popperEscapeOffsets: l,
1797
1818
  isReferenceHidden: d,
1798
1819
  hasPopperEscaped: b
1799
1820
  }, t.attributes.popper = Object.assign({}, t.attributes.popper, {
@@ -1801,215 +1822,215 @@ function Ls(e) {
1801
1822
  "data-popper-escaped": b
1802
1823
  });
1803
1824
  }
1804
- const Os = {
1825
+ const Er = {
1805
1826
  name: "hide",
1806
1827
  enabled: !0,
1807
1828
  phase: "main",
1808
1829
  requiresIfExists: ["preventOverflow"],
1809
- fn: Ls
1830
+ fn: $r
1810
1831
  };
1811
- function ks(e, t, i) {
1812
- var n = J(e), s = [j, W].indexOf(n) >= 0 ? -1 : 1, r = typeof i == "function" ? i(Object.assign({}, t, {
1832
+ function xr(e, t, n) {
1833
+ var i = J(e), r = [D, P].indexOf(i) >= 0 ? -1 : 1, s = typeof n == "function" ? n(Object.assign({}, t, {
1813
1834
  placement: e
1814
- })) : i, a = r[0], l = r[1];
1815
- return a = a || 0, l = (l || 0) * s, [j, R].indexOf(n) >= 0 ? {
1816
- x: l,
1835
+ })) : n, a = s[0], c = s[1];
1836
+ return a = a || 0, c = (c || 0) * r, [D, _].indexOf(i) >= 0 ? {
1837
+ x: c,
1817
1838
  y: a
1818
1839
  } : {
1819
1840
  x: a,
1820
- y: l
1841
+ y: c
1821
1842
  };
1822
1843
  }
1823
- function Ts(e) {
1824
- var t = e.state, i = e.options, n = e.name, s = i.offset, r = s === void 0 ? [0, 0] : s, a = ui.reduce(function(d, b) {
1825
- return d[b] = ks(b, t.rects, r), d;
1826
- }, {}), l = a[t.placement], o = l.x, c = l.y;
1827
- t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += o, t.modifiersData.popperOffsets.y += c), t.modifiersData[n] = a;
1844
+ function Or(e) {
1845
+ var t = e.state, n = e.options, i = e.name, r = n.offset, s = r === void 0 ? [0, 0] : r, a = fn.reduce(function(d, b) {
1846
+ return d[b] = xr(b, t.rects, s), d;
1847
+ }, {}), c = a[t.placement], o = c.x, l = c.y;
1848
+ t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += o, t.modifiersData.popperOffsets.y += l), t.modifiersData[i] = a;
1828
1849
  }
1829
- const As = {
1850
+ const Lr = {
1830
1851
  name: "offset",
1831
1852
  enabled: !0,
1832
1853
  phase: "main",
1833
1854
  requires: ["popperOffsets"],
1834
- fn: Ts
1855
+ fn: Or
1835
1856
  };
1836
- function Cs(e) {
1837
- var t = e.state, i = e.name;
1838
- t.modifiersData[i] = bi({
1857
+ function kr(e) {
1858
+ var t = e.state, n = e.name;
1859
+ t.modifiersData[n] = wn({
1839
1860
  reference: t.rects.reference,
1840
1861
  element: t.rects.popper,
1841
1862
  strategy: "absolute",
1842
1863
  placement: t.placement
1843
1864
  });
1844
1865
  }
1845
- const Is = {
1866
+ const Tr = {
1846
1867
  name: "popperOffsets",
1847
1868
  enabled: !0,
1848
1869
  phase: "read",
1849
- fn: Cs,
1870
+ fn: kr,
1850
1871
  data: {}
1851
1872
  };
1852
- function Ss(e) {
1873
+ function Sr(e) {
1853
1874
  return e === "x" ? "y" : "x";
1854
1875
  }
1855
- function qs(e) {
1856
- var t = e.state, i = e.options, n = e.name, s = i.mainAxis, r = s === void 0 ? !0 : s, a = i.altAxis, l = a === void 0 ? !1 : a, o = i.boundary, c = i.rootBoundary, d = i.altBoundary, b = i.padding, v = i.tether, h = v === void 0 ? !0 : v, $ = i.tetherOffset, u = $ === void 0 ? 0 : $, w = St(t, {
1876
+ function Cr(e) {
1877
+ var t = e.state, n = e.options, i = e.name, r = n.mainAxis, s = r === void 0 ? !0 : r, a = n.altAxis, c = a === void 0 ? !1 : a, o = n.boundary, l = n.rootBoundary, d = n.altBoundary, b = n.padding, v = n.tether, h = v === void 0 ? !0 : v, $ = n.tetherOffset, u = $ === void 0 ? 0 : $, w = At(t, {
1857
1878
  boundary: o,
1858
- rootBoundary: c,
1879
+ rootBoundary: l,
1859
1880
  padding: b,
1860
1881
  altBoundary: d
1861
- }), E = J(t.placement), L = mt(t.placement), O = !L, f = be(E), y = Ss(f), x = t.modifiersData.popperOffsets, k = t.rects.reference, T = t.rects.popper, A = typeof u == "function" ? u(Object.assign({}, t.rects, {
1882
+ }), E = J(t.placement), O = mt(t.placement), L = !O, f = ve(E), y = Sr(f), x = t.modifiersData.popperOffsets, k = t.rects.reference, T = t.rects.popper, S = typeof u == "function" ? u(Object.assign({}, t.rects, {
1862
1883
  placement: t.placement
1863
- })) : u, C = typeof A == "number" ? {
1864
- mainAxis: A,
1865
- altAxis: A
1884
+ })) : u, C = typeof S == "number" ? {
1885
+ mainAxis: S,
1886
+ altAxis: S
1866
1887
  } : Object.assign({
1867
1888
  mainAxis: 0,
1868
1889
  altAxis: 0
1869
- }, A), I = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, H = {
1890
+ }, S), I = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, B = {
1870
1891
  x: 0,
1871
1892
  y: 0
1872
1893
  };
1873
1894
  if (x) {
1874
- if (r) {
1875
- var D, U = f === "y" ? W : j, X = f === "y" ? B : R, N = f === "y" ? "height" : "width", V = x[f], Pt = V + w[U], Y = V - w[X], Mt = h ? -T[N] / 2 : 0, Zt = L === ft ? k[N] : T[N], vt = L === ft ? -T[N] : -k[N], Wt = t.elements.arrow, tt = h && Wt ? ve(Wt) : {
1895
+ if (s) {
1896
+ var A, X = f === "y" ? P : D, Y = f === "y" ? W : _, M = f === "y" ? "height" : "width", R = x[f], Mt = R + w[X], U = R - w[Y], jt = h ? -T[M] / 2 : 0, Qt = O === ft ? k[M] : T[M], vt = O === ft ? -T[M] : -k[M], qt = t.elements.arrow, tt = h && qt ? me(qt) : {
1876
1897
  width: 0,
1877
1898
  height: 0
1878
- }, K = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : pi(), jt = K[U], bt = K[X], ot = At(0, k[N], tt[N]), $i = O ? k[N] / 2 - Mt - ot - jt - C.mainAxis : Zt - ot - jt - C.mainAxis, Ei = O ? -k[N] / 2 + Mt + ot + bt + C.mainAxis : vt + ot + bt + C.mainAxis, Ut = t.elements.arrow && Dt(t.elements.arrow), xi = Ut ? f === "y" ? Ut.clientTop || 0 : Ut.clientLeft || 0 : 0, xe = (D = I == null ? void 0 : I[f]) != null ? D : 0, Li = V + $i - xe - xi, Oi = V + Ei - xe, Le = At(h ? zt(Pt, Li) : Pt, V, h ? st(Y, Oi) : Y);
1879
- x[f] = Le, H[f] = Le - V;
1899
+ }, K = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : mn(), Ft = K[X], bt = K[Y], ot = St(0, k[M], tt[M]), xn = L ? k[M] / 2 - jt - ot - Ft - C.mainAxis : Qt - ot - Ft - C.mainAxis, On = L ? -k[M] / 2 + jt + ot + bt + C.mainAxis : vt + ot + bt + C.mainAxis, Zt = t.elements.arrow && Dt(t.elements.arrow), Ln = Zt ? f === "y" ? Zt.clientTop || 0 : Zt.clientLeft || 0 : 0, Ee = (A = I == null ? void 0 : I[f]) != null ? A : 0, kn = R + xn - Ee - Ln, Tn = R + On - Ee, xe = St(h ? Jt(Mt, kn) : Mt, R, h ? rt(U, Tn) : U);
1900
+ x[f] = xe, B[f] = xe - R;
1880
1901
  }
1881
- if (l) {
1882
- var Oe, ki = f === "x" ? W : j, Ti = f === "x" ? B : R, et = x[y], Nt = y === "y" ? "height" : "width", ke = et + w[ki], Te = et - w[Ti], Xt = [W, j].indexOf(E) !== -1, Ae = (Oe = I == null ? void 0 : I[y]) != null ? Oe : 0, Ce = Xt ? ke : et - k[Nt] - T[Nt] - Ae + C.altAxis, Ie = Xt ? et + k[Nt] + T[Nt] - Ae - C.altAxis : Te, Se = h && Xt ? is(Ce, et, Ie) : At(h ? Ce : ke, et, h ? Ie : Te);
1883
- x[y] = Se, H[y] = Se - et;
1902
+ if (c) {
1903
+ var Oe, Sn = f === "x" ? P : D, Cn = f === "x" ? W : _, et = x[y], Nt = y === "y" ? "height" : "width", Le = et + w[Sn], ke = et - w[Cn], Xt = [P, D].indexOf(E) !== -1, Te = (Oe = I == null ? void 0 : I[y]) != null ? Oe : 0, Se = Xt ? Le : et - k[Nt] - T[Nt] - Te + C.altAxis, Ce = Xt ? et + k[Nt] + T[Nt] - Te - C.altAxis : ke, Ie = h && Xt ? Ui(Se, et, Ce) : St(h ? Se : Le, et, h ? Ce : ke);
1904
+ x[y] = Ie, B[y] = Ie - et;
1884
1905
  }
1885
- t.modifiersData[n] = H;
1906
+ t.modifiersData[i] = B;
1886
1907
  }
1887
1908
  }
1888
- const Ds = {
1909
+ const Ir = {
1889
1910
  name: "preventOverflow",
1890
1911
  enabled: !0,
1891
1912
  phase: "main",
1892
- fn: qs,
1913
+ fn: Cr,
1893
1914
  requiresIfExists: ["offset"]
1894
1915
  };
1895
- function Ps(e) {
1916
+ function Ar(e) {
1896
1917
  return {
1897
1918
  scrollLeft: e.scrollLeft,
1898
1919
  scrollTop: e.scrollTop
1899
1920
  };
1900
1921
  }
1901
- function Ms(e) {
1902
- return e === _(e) || !F(e) ? ye(e) : Ps(e);
1922
+ function Pr(e) {
1923
+ return e === F(e) || !N(e) ? be(e) : Ar(e);
1903
1924
  }
1904
- function Ws(e) {
1905
- var t = e.getBoundingClientRect(), i = pt(t.width) / e.offsetWidth || 1, n = pt(t.height) / e.offsetHeight || 1;
1906
- return i !== 1 || n !== 1;
1925
+ function Dr(e) {
1926
+ var t = e.getBoundingClientRect(), n = pt(t.width) / e.offsetWidth || 1, i = pt(t.height) / e.offsetHeight || 1;
1927
+ return n !== 1 || i !== 1;
1907
1928
  }
1908
- function js(e, t, i) {
1909
- i === void 0 && (i = !1);
1910
- var n = F(t), s = F(t) && Ws(t), r = Z(t), a = gt(e, s, i), l = {
1929
+ function Mr(e, t, n) {
1930
+ n === void 0 && (n = !1);
1931
+ var i = N(t), r = N(t) && Dr(t), s = Z(t), a = gt(e, r, n), c = {
1911
1932
  scrollLeft: 0,
1912
1933
  scrollTop: 0
1913
1934
  }, o = {
1914
1935
  x: 0,
1915
1936
  y: 0
1916
1937
  };
1917
- return (n || !n && !i) && ((z(t) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
1918
- $e(r)) && (l = Ms(t)), F(t) ? (o = gt(t, !0), o.x += t.clientLeft, o.y += t.clientTop) : r && (o.x = we(r))), {
1919
- x: a.left + l.scrollLeft - o.x,
1920
- y: a.top + l.scrollTop - o.y,
1938
+ return (i || !i && !n) && ((z(t) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
1939
+ we(s)) && (c = Pr(t)), N(t) ? (o = gt(t, !0), o.x += t.clientLeft, o.y += t.clientTop) : s && (o.x = ye(s))), {
1940
+ x: a.left + c.scrollLeft - o.x,
1941
+ y: a.top + c.scrollTop - o.y,
1921
1942
  width: a.width,
1922
1943
  height: a.height
1923
1944
  };
1924
1945
  }
1925
- function Ns(e) {
1926
- var t = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), n = [];
1927
- e.forEach(function(r) {
1928
- t.set(r.name, r);
1946
+ function jr(e) {
1947
+ var t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), i = [];
1948
+ e.forEach(function(s) {
1949
+ t.set(s.name, s);
1929
1950
  });
1930
- function s(r) {
1931
- i.add(r.name);
1932
- var a = [].concat(r.requires || [], r.requiresIfExists || []);
1933
- a.forEach(function(l) {
1934
- if (!i.has(l)) {
1935
- var o = t.get(l);
1936
- o && s(o);
1951
+ function r(s) {
1952
+ n.add(s.name);
1953
+ var a = [].concat(s.requires || [], s.requiresIfExists || []);
1954
+ a.forEach(function(c) {
1955
+ if (!n.has(c)) {
1956
+ var o = t.get(c);
1957
+ o && r(o);
1937
1958
  }
1938
- }), n.push(r);
1959
+ }), i.push(s);
1939
1960
  }
1940
- return e.forEach(function(r) {
1941
- i.has(r.name) || s(r);
1942
- }), n;
1961
+ return e.forEach(function(s) {
1962
+ n.has(s.name) || r(s);
1963
+ }), i;
1943
1964
  }
1944
- function _s(e) {
1945
- var t = Ns(e);
1946
- return Zn.reduce(function(i, n) {
1947
- return i.concat(t.filter(function(s) {
1948
- return s.phase === n;
1965
+ function qr(e) {
1966
+ var t = jr(e);
1967
+ return Ki.reduce(function(n, i) {
1968
+ return n.concat(t.filter(function(r) {
1969
+ return r.phase === i;
1949
1970
  }));
1950
1971
  }, []);
1951
1972
  }
1952
- function Fs(e) {
1973
+ function Fr(e) {
1953
1974
  var t;
1954
1975
  return function() {
1955
- return t || (t = new Promise(function(i) {
1976
+ return t || (t = new Promise(function(n) {
1956
1977
  Promise.resolve().then(function() {
1957
- t = void 0, i(e());
1978
+ t = void 0, n(e());
1958
1979
  });
1959
1980
  })), t;
1960
1981
  };
1961
1982
  }
1962
- function Bs(e) {
1963
- var t = e.reduce(function(i, n) {
1964
- var s = i[n.name];
1965
- return i[n.name] = s ? Object.assign({}, s, n, {
1966
- options: Object.assign({}, s.options, n.options),
1967
- data: Object.assign({}, s.data, n.data)
1968
- }) : n, i;
1983
+ function Nr(e) {
1984
+ var t = e.reduce(function(n, i) {
1985
+ var r = n[i.name];
1986
+ return n[i.name] = r ? Object.assign({}, r, i, {
1987
+ options: Object.assign({}, r.options, i.options),
1988
+ data: Object.assign({}, r.data, i.data)
1989
+ }) : i, n;
1969
1990
  }, {});
1970
- return Object.keys(t).map(function(i) {
1971
- return t[i];
1991
+ return Object.keys(t).map(function(n) {
1992
+ return t[n];
1972
1993
  });
1973
1994
  }
1974
- var Je = {
1995
+ var He = {
1975
1996
  placement: "bottom",
1976
1997
  modifiers: [],
1977
1998
  strategy: "absolute"
1978
1999
  };
1979
- function ze() {
1980
- for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)
1981
- t[i] = arguments[i];
1982
- return !t.some(function(n) {
1983
- return !(n && typeof n.getBoundingClientRect == "function");
2000
+ function Je() {
2001
+ for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
2002
+ t[n] = arguments[n];
2003
+ return !t.some(function(i) {
2004
+ return !(i && typeof i.getBoundingClientRect == "function");
1984
2005
  });
1985
2006
  }
1986
- function Rs(e) {
2007
+ function Wr(e) {
1987
2008
  e === void 0 && (e = {});
1988
- var t = e, i = t.defaultModifiers, n = i === void 0 ? [] : i, s = t.defaultOptions, r = s === void 0 ? Je : s;
1989
- return function(a, l, o) {
1990
- o === void 0 && (o = r);
1991
- var c = {
2009
+ var t = e, n = t.defaultModifiers, i = n === void 0 ? [] : n, r = t.defaultOptions, s = r === void 0 ? He : r;
2010
+ return function(a, c, o) {
2011
+ o === void 0 && (o = s);
2012
+ var l = {
1992
2013
  placement: "bottom",
1993
2014
  orderedModifiers: [],
1994
- options: Object.assign({}, Je, r),
2015
+ options: Object.assign({}, He, s),
1995
2016
  modifiersData: {},
1996
2017
  elements: {
1997
2018
  reference: a,
1998
- popper: l
2019
+ popper: c
1999
2020
  },
2000
2021
  attributes: {},
2001
2022
  styles: {}
2002
2023
  }, d = [], b = !1, v = {
2003
- state: c,
2024
+ state: l,
2004
2025
  setOptions: function(u) {
2005
- var w = typeof u == "function" ? u(c.options) : u;
2006
- $(), c.options = Object.assign({}, r, c.options, w), c.scrollParents = {
2007
- reference: rt(a) ? Ct(a) : a.contextElement ? Ct(a.contextElement) : [],
2008
- popper: Ct(l)
2026
+ var w = typeof u == "function" ? u(l.options) : u;
2027
+ $(), l.options = Object.assign({}, s, l.options, w), l.scrollParents = {
2028
+ reference: st(a) ? Ct(a) : a.contextElement ? Ct(a.contextElement) : [],
2029
+ popper: Ct(c)
2009
2030
  };
2010
- var E = _s(Bs([].concat(n, c.options.modifiers)));
2011
- return c.orderedModifiers = E.filter(function(L) {
2012
- return L.enabled;
2031
+ var E = qr(Nr([].concat(i, l.options.modifiers)));
2032
+ return l.orderedModifiers = E.filter(function(O) {
2033
+ return O.enabled;
2013
2034
  }), h(), v.update();
2014
2035
  },
2015
2036
  // Sync update – it will always be executed, even if not necessary. This
@@ -2019,55 +2040,55 @@ function Rs(e) {
2019
2040
  // prefer the async Popper#update method
2020
2041
  forceUpdate: function() {
2021
2042
  if (!b) {
2022
- var u = c.elements, w = u.reference, E = u.popper;
2023
- if (ze(w, E)) {
2024
- c.rects = {
2025
- reference: js(w, Dt(E), c.options.strategy === "fixed"),
2026
- popper: ve(E)
2027
- }, c.reset = !1, c.placement = c.options.placement, c.orderedModifiers.forEach(function(T) {
2028
- return c.modifiersData[T.name] = Object.assign({}, T.data);
2043
+ var u = l.elements, w = u.reference, E = u.popper;
2044
+ if (Je(w, E)) {
2045
+ l.rects = {
2046
+ reference: Mr(w, Dt(E), l.options.strategy === "fixed"),
2047
+ popper: me(E)
2048
+ }, l.reset = !1, l.placement = l.options.placement, l.orderedModifiers.forEach(function(T) {
2049
+ return l.modifiersData[T.name] = Object.assign({}, T.data);
2029
2050
  });
2030
- for (var L = 0; L < c.orderedModifiers.length; L++) {
2031
- if (c.reset === !0) {
2032
- c.reset = !1, L = -1;
2051
+ for (var O = 0; O < l.orderedModifiers.length; O++) {
2052
+ if (l.reset === !0) {
2053
+ l.reset = !1, O = -1;
2033
2054
  continue;
2034
2055
  }
2035
- var O = c.orderedModifiers[L], f = O.fn, y = O.options, x = y === void 0 ? {} : y, k = O.name;
2036
- typeof f == "function" && (c = f({
2037
- state: c,
2056
+ var L = l.orderedModifiers[O], f = L.fn, y = L.options, x = y === void 0 ? {} : y, k = L.name;
2057
+ typeof f == "function" && (l = f({
2058
+ state: l,
2038
2059
  options: x,
2039
2060
  name: k,
2040
2061
  instance: v
2041
- }) || c);
2062
+ }) || l);
2042
2063
  }
2043
2064
  }
2044
2065
  }
2045
2066
  },
2046
2067
  // Async and optimistically optimized update – it will not be executed if
2047
2068
  // not necessary (debounced to run at most once-per-tick)
2048
- update: Fs(function() {
2069
+ update: Fr(function() {
2049
2070
  return new Promise(function(u) {
2050
- v.forceUpdate(), u(c);
2071
+ v.forceUpdate(), u(l);
2051
2072
  });
2052
2073
  }),
2053
2074
  destroy: function() {
2054
2075
  $(), b = !0;
2055
2076
  }
2056
2077
  };
2057
- if (!ze(a, l))
2078
+ if (!Je(a, c))
2058
2079
  return v;
2059
2080
  v.setOptions(o).then(function(u) {
2060
2081
  !b && o.onFirstUpdate && o.onFirstUpdate(u);
2061
2082
  });
2062
2083
  function h() {
2063
- c.orderedModifiers.forEach(function(u) {
2064
- var w = u.name, E = u.options, L = E === void 0 ? {} : E, O = u.effect;
2065
- if (typeof O == "function") {
2066
- var f = O({
2067
- state: c,
2084
+ l.orderedModifiers.forEach(function(u) {
2085
+ var w = u.name, E = u.options, O = E === void 0 ? {} : E, L = u.effect;
2086
+ if (typeof L == "function") {
2087
+ var f = L({
2088
+ state: l,
2068
2089
  name: w,
2069
2090
  instance: v,
2070
- options: L
2091
+ options: O
2071
2092
  }), y = function() {
2072
2093
  };
2073
2094
  d.push(f || y);
@@ -2082,134 +2103,129 @@ function Rs(e) {
2082
2103
  return v;
2083
2104
  };
2084
2105
  }
2085
- var Hs = [hs, Is, ds, Yn, As, xs, Ds, os, Os], Vs = /* @__PURE__ */ Rs({
2086
- defaultModifiers: Hs
2106
+ var _r = [cr, Tr, ar, Zi, Lr, wr, Ir, ir, Er], Br = /* @__PURE__ */ Wr({
2107
+ defaultModifiers: _r
2087
2108
  });
2088
- async function ae(e) {
2089
- if (!e)
2090
- return this.collection;
2091
- const t = this.collection.findIndex((i) => i.id === e.id);
2109
+ async function oe(e) {
2110
+ const t = this.collection.findIndex((n) => n.id === e.id);
2092
2111
  if (t >= 0) {
2093
- const i = this.collection[t];
2094
- i.state === "opened" && i.close(), i.popper.destroy(), yi(i), Object.getOwnPropertyNames(i).forEach((n) => {
2095
- delete i[n];
2112
+ const n = this.collection[t];
2113
+ n.state === "opened" && n.close(), n.popper.destroy(), $n(n), Object.getOwnPropertyNames(n).forEach((i) => {
2114
+ delete n[i];
2096
2115
  }), this.collection.splice(t, 1);
2097
2116
  }
2098
2117
  return this.collection;
2099
2118
  }
2100
- function yi(e) {
2119
+ function $n(e) {
2101
2120
  return e.__eventListeners && (e.__eventListeners.forEach((t) => {
2102
- t.el.forEach((i) => {
2103
- t.type.forEach((n) => {
2104
- e[i].removeEventListener(n, t.listener, !1);
2121
+ t.el.forEach((n) => {
2122
+ t.type.forEach((i) => {
2123
+ e[n].removeEventListener(i, t.listener, !1);
2105
2124
  });
2106
2125
  });
2107
2126
  }), delete e.__eventListeners), e;
2108
2127
  }
2109
- async function Ee(e) {
2110
- const t = ri.call(this, e);
2111
- return t.el.classList.add(this.settings.stateActive), t.trigger.hasAttribute("aria-controls") && t.trigger.setAttribute("aria-expanded", "true"), t.config = si(t.el, this.settings), t.popper.setOptions({
2128
+ async function $e(e) {
2129
+ const t = ln.call(this, e);
2130
+ return t.el.classList.add(this.settings.stateActive), t.trigger.hasAttribute("aria-controls") && t.trigger.setAttribute("aria-expanded", "true"), t.config = an(t.el, this.settings), t.popper.setOptions({
2112
2131
  placement: t.config.placement,
2113
2132
  modifiers: [
2114
2133
  { name: "eventListeners", enabled: !0 },
2115
- ...Mn(t.config)
2134
+ ...Ai(t.config)
2116
2135
  ]
2117
2136
  }), t.popper.update(), t.state = "opened", t;
2118
2137
  }
2119
- async function Js(e, t) {
2120
- ae.call(this, e);
2121
- const i = this, n = {
2138
+ async function Rr(e, t) {
2139
+ oe.call(this, e);
2140
+ const n = this, i = {
2141
+ id: e.id,
2142
+ state: "closed",
2143
+ el: e,
2144
+ trigger: t,
2145
+ popper: Br(t, e),
2146
+ config: an(e, this.settings),
2122
2147
  open() {
2123
- return Ee.call(i, this);
2148
+ return $e.call(n, this);
2124
2149
  },
2125
2150
  close() {
2126
- return pe.call(i, this);
2151
+ return fe.call(n, this);
2127
2152
  },
2128
2153
  deregister() {
2129
- return ae.call(i, this);
2154
+ return oe.call(n, this);
2130
2155
  }
2131
- }, s = {
2132
- id: e.id,
2133
- state: "closed",
2134
- el: e,
2135
- trigger: t,
2136
- popper: Vs(t, e),
2137
- config: si(e, this.settings),
2138
- ...n
2139
2156
  };
2140
- return s.trigger.hasAttribute("aria-controls") && s.trigger.setAttribute("aria-expanded", "false"), wi.call(this, s), this.collection.push(s), s.el.classList.contains(this.settings.stateActive) && (await s.open(), ci.call(this, s)), s;
2157
+ return i.trigger.hasAttribute("aria-controls") && i.trigger.setAttribute("aria-expanded", "false"), En.call(this, i), this.collection.push(i), i.el.classList.contains(this.settings.stateActive) && (await i.open(), un.call(this, i)), i;
2141
2158
  }
2142
- function wi(e) {
2159
+ function En(e) {
2143
2160
  return e.__eventListeners || (e.config.event === "hover" ? (e.__eventListeners = [{
2144
2161
  el: ["trigger"],
2145
2162
  type: ["mouseenter", "focus"],
2146
- listener: Ee.bind(this, e)
2163
+ listener: $e.bind(this, e)
2147
2164
  }, {
2148
2165
  el: ["el", "trigger"],
2149
2166
  type: ["mouseleave", "focusout"],
2150
- listener: li.bind(this, e)
2167
+ listener: dn.bind(this, e)
2151
2168
  }], e.__eventListeners.forEach((t) => {
2152
- t.el.forEach((i) => {
2153
- t.type.forEach((n) => {
2154
- e[i].addEventListener(n, t.listener, !1);
2169
+ t.el.forEach((n) => {
2170
+ t.type.forEach((i) => {
2171
+ e[n].addEventListener(i, t.listener, !1);
2155
2172
  });
2156
2173
  });
2157
2174
  })) : (e.__eventListeners = [{
2158
2175
  el: ["trigger"],
2159
2176
  type: ["click"],
2160
- listener: jn.bind(this, e)
2177
+ listener: Mi.bind(this, e)
2161
2178
  }], e.__eventListeners.forEach((t) => {
2162
- t.el.forEach((i) => {
2163
- t.type.forEach((n) => {
2164
- e[i].addEventListener(n, t.listener, !1);
2179
+ t.el.forEach((n) => {
2180
+ t.type.forEach((i) => {
2181
+ e[n].addEventListener(i, t.listener, !1);
2165
2182
  });
2166
2183
  });
2167
2184
  }))), e;
2168
2185
  }
2169
2186
  var Tt;
2170
- class rr extends qn {
2187
+ class ts extends Si {
2171
2188
  constructor(t) {
2172
- super(), In(this, Tt, void 0), this.defaults = Pn, this.settings = { ...this.defaults, ...t }, this.trigger = null, Sn(this, Tt, Nn.bind(this)), this.settings.autoInit && this.init();
2189
+ super(), ki(this, Tt, void 0), this.defaults = Ii, this.settings = { ...this.defaults, ...t }, this.trigger = null, Ti(this, Tt, ji.bind(this)), this.settings.autoInit && this.init();
2173
2190
  }
2174
2191
  async init(t) {
2175
2192
  t && (this.settings = { ...this.settings, ...t });
2176
- const i = document.querySelectorAll(this.settings.selectorPopover);
2177
- return await this.registerCollection(i), this.settings.eventListeners && this.initEventListeners(!1), this;
2193
+ const n = document.querySelectorAll(this.settings.selectorPopover);
2194
+ return await this.registerCollection(n), this.settings.eventListeners && this.initEventListeners(!1), this;
2178
2195
  }
2179
2196
  async destroy() {
2180
2197
  return this.trigger = null, await this.deregisterCollection(), this.settings.eventListeners && this.destroyEventListeners(!1), this;
2181
2198
  }
2182
2199
  initEventListeners(t = !0) {
2183
- t && this.collection.forEach((i) => {
2184
- wi.call(this, i);
2185
- }), document.addEventListener("keydown", je(this, Tt), !1);
2200
+ t && this.collection.forEach((n) => {
2201
+ En.call(this, n);
2202
+ }), document.addEventListener("keydown", qe(this, Tt), !1);
2186
2203
  }
2187
2204
  destroyEventListeners(t = !0) {
2188
- t && this.collection.forEach((i) => {
2189
- yi(i);
2190
- }), document.removeEventListener("keydown", je(this, Tt), !1);
2205
+ t && this.collection.forEach((n) => {
2206
+ $n(n);
2207
+ }), document.removeEventListener("keydown", qe(this, Tt), !1);
2191
2208
  }
2192
2209
  register(t) {
2193
- const i = Wn.call(this, t);
2194
- return i.error ? Promise.reject(i.error) : Js.call(this, i.popover, i.trigger);
2210
+ const n = Di.call(this, t);
2211
+ return n.error ? Promise.reject(n.error) : Rr.call(this, n.popover, n.trigger);
2195
2212
  }
2196
2213
  deregister(t) {
2197
- const i = this.get(oi.call(this, t));
2198
- return ae.call(this, i);
2214
+ let n = this.get(t.id || t);
2215
+ return n ? oe.call(this, n) : Promise.reject(new Error(`Failed to deregister; popover does not exist in collection with ID of: "${t.id || t}".`));
2199
2216
  }
2200
2217
  open(t) {
2201
- return Ee.call(this, t);
2218
+ return $e.call(this, t);
2202
2219
  }
2203
2220
  close(t) {
2204
- return pe.call(this, t);
2221
+ return fe.call(this, t);
2205
2222
  }
2206
2223
  }
2207
2224
  Tt = /* @__PURE__ */ new WeakMap();
2208
2225
  export {
2209
- Zs as Checkbox,
2210
- er as Drawer,
2211
- sr as Modal,
2212
- rr as Popover,
2213
- Qs as core
2226
+ Zr as Drawer,
2227
+ Yr as Modal,
2228
+ ts as Popover,
2229
+ zr as core
2214
2230
  };
2215
2231
  //# sourceMappingURL=index.js.map