vrembem 4.0.0-next.7 → 4.0.0-next.8
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/README.md +3 -7
- package/dev/index.css +1031 -862
- package/dev/index.css.map +1 -1
- package/dev/index.js +685 -685
- package/dev/index.js.map +1 -1
- package/dev/index.umd.cjs +685 -685
- package/dev/index.umd.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +304 -304
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +3 -3
- package/dist/index.umd.cjs.map +1 -1
- package/index.js +4 -4
- package/package.json +23 -23
package/dev/index.js
CHANGED
|
@@ -2,29 +2,29 @@ var b$2 = (t, e, n) => {
|
|
|
2
2
|
if (!e.has(t))
|
|
3
3
|
throw TypeError("Cannot " + n);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
5
|
+
var o$2 = (t, e, n) => (b$2(t, e, "read from private field"), n ? n.call(t) : e.get(t)), m$2 = (t, e, n) => {
|
|
6
6
|
if (e.has(t))
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
8
|
e instanceof WeakSet ? e.add(t) : e.set(t, n);
|
|
9
|
-
}, a$1 = (t, e, n,
|
|
9
|
+
}, a$1 = (t, e, n, i) => (b$2(t, e, "write to private field"), i ? i.call(t, n) : e.set(t, n), n);
|
|
10
10
|
var l$1;
|
|
11
|
-
let I$
|
|
11
|
+
let I$2 = class I {
|
|
12
12
|
constructor(e, n) {
|
|
13
13
|
m$2(this, l$1, void 0);
|
|
14
14
|
this.value = e, a$1(this, l$1, n), this.mql = null;
|
|
15
15
|
}
|
|
16
16
|
get handler() {
|
|
17
|
-
return
|
|
17
|
+
return o$2(this, l$1);
|
|
18
18
|
}
|
|
19
19
|
// Unmount existing handler before setting a new one.
|
|
20
20
|
set handler(e) {
|
|
21
|
-
this.mql && this.mql.removeEventListener("change",
|
|
21
|
+
this.mql && this.mql.removeEventListener("change", o$2(this, l$1)), a$1(this, l$1, e);
|
|
22
22
|
}
|
|
23
23
|
mount(e, n) {
|
|
24
|
-
return e && (this.value = e), n && a$1(this, l$1, n), this.value ? (this.mql = window.matchMedia(`(min-width: ${this.value})`), this.mql.addEventListener("change",
|
|
24
|
+
return e && (this.value = e), n && a$1(this, l$1, n), this.value ? (this.mql = window.matchMedia(`(min-width: ${this.value})`), this.mql.addEventListener("change", o$2(this, l$1)), o$2(this, l$1).call(this, this.mql), this) : this;
|
|
25
25
|
}
|
|
26
26
|
unmount() {
|
|
27
|
-
return this.mql ? (this.mql.removeEventListener("change",
|
|
27
|
+
return this.mql ? (this.mql.removeEventListener("change", o$2(this, l$1)), this.value = null, a$1(this, l$1, null), this.mql = null, this) : this;
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
l$1 = /* @__PURE__ */ new WeakMap();
|
|
@@ -36,11 +36,11 @@ let L$2 = class L {
|
|
|
36
36
|
return await this.deregister(e), this.collection.push(e), this.collection;
|
|
37
37
|
}
|
|
38
38
|
async deregister(e) {
|
|
39
|
-
const n = this.collection.findIndex((
|
|
39
|
+
const n = this.collection.findIndex((i) => i === e);
|
|
40
40
|
if (n >= 0) {
|
|
41
|
-
const
|
|
42
|
-
Object.getOwnPropertyNames(
|
|
43
|
-
delete
|
|
41
|
+
const i = this.collection[n];
|
|
42
|
+
Object.getOwnPropertyNames(i).forEach((r) => {
|
|
43
|
+
delete i[r];
|
|
44
44
|
}), this.collection.splice(n, 1);
|
|
45
45
|
}
|
|
46
46
|
return this.collection;
|
|
@@ -56,44 +56,44 @@ let L$2 = class L {
|
|
|
56
56
|
return this.collection;
|
|
57
57
|
}
|
|
58
58
|
get(e, n = "id") {
|
|
59
|
-
return this.collection.find((
|
|
59
|
+
return this.collection.find((i) => i[n] === e);
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
|
-
const
|
|
62
|
+
const s = {
|
|
63
63
|
inert: ":not([inert]):not([inert] *)",
|
|
64
64
|
negTabIndex: ':not([tabindex^="-"])',
|
|
65
65
|
disabled: ":not(:disabled)"
|
|
66
66
|
}, g$2 = [
|
|
67
|
-
`a[href]${
|
|
68
|
-
`area[href]${
|
|
69
|
-
`input:not([type="hidden"]):not([type="radio"])${
|
|
70
|
-
`input[type="radio"]${
|
|
71
|
-
`select${
|
|
72
|
-
`textarea${
|
|
73
|
-
`button${
|
|
74
|
-
`details${
|
|
67
|
+
`a[href]${s.inert}${s.negTabIndex}`,
|
|
68
|
+
`area[href]${s.inert}${s.negTabIndex}`,
|
|
69
|
+
`input:not([type="hidden"]):not([type="radio"])${s.inert}${s.negTabIndex}${s.disabled}`,
|
|
70
|
+
`input[type="radio"]${s.inert}${s.negTabIndex}${s.disabled}`,
|
|
71
|
+
`select${s.inert}${s.negTabIndex}${s.disabled}`,
|
|
72
|
+
`textarea${s.inert}${s.negTabIndex}${s.disabled}`,
|
|
73
|
+
`button${s.inert}${s.negTabIndex}${s.disabled}`,
|
|
74
|
+
`details${s.inert} > summary:first-of-type${s.negTabIndex}`,
|
|
75
75
|
// Discard until Firefox supports `:has()`
|
|
76
76
|
// See: https://github.com/KittyGiraudel/focusable-selectors/issues/12
|
|
77
77
|
// `details:not(:has(> summary))${not.inert}${not.negTabIndex}`,
|
|
78
|
-
`iframe${
|
|
79
|
-
`audio[controls]${
|
|
80
|
-
`video[controls]${
|
|
81
|
-
`[contenteditable]${
|
|
82
|
-
`[tabindex]${
|
|
78
|
+
`iframe${s.inert}${s.negTabIndex}`,
|
|
79
|
+
`audio[controls]${s.inert}${s.negTabIndex}`,
|
|
80
|
+
`video[controls]${s.inert}${s.negTabIndex}`,
|
|
81
|
+
`[contenteditable]${s.inert}${s.negTabIndex}`,
|
|
82
|
+
`[tabindex]${s.inert}${s.negTabIndex}`
|
|
83
83
|
];
|
|
84
|
-
var f$2, u$
|
|
84
|
+
var f$2, u$1, d$2;
|
|
85
85
|
let S$3 = class S {
|
|
86
86
|
constructor(e = null, n = "[data-focus]") {
|
|
87
87
|
m$2(this, f$2, void 0);
|
|
88
|
-
m$2(this, u$
|
|
88
|
+
m$2(this, u$1, void 0);
|
|
89
89
|
m$2(this, d$2, void 0);
|
|
90
|
-
this.el = e, this.selectorFocus = n, a$1(this, u$
|
|
90
|
+
this.el = e, this.selectorFocus = n, a$1(this, u$1, $$2.bind(this)), a$1(this, d$2, v$2.bind(this));
|
|
91
91
|
}
|
|
92
92
|
get focusable() {
|
|
93
|
-
return
|
|
93
|
+
return o$2(this, f$2);
|
|
94
94
|
}
|
|
95
95
|
set focusable(e) {
|
|
96
|
-
a$1(this, f$2, e),
|
|
96
|
+
a$1(this, f$2, e), o$2(this, f$2).length ? (document.removeEventListener("keydown", o$2(this, d$2)), document.addEventListener("keydown", o$2(this, u$1))) : (document.removeEventListener("keydown", o$2(this, u$1)), document.addEventListener("keydown", o$2(this, d$2)));
|
|
97
97
|
}
|
|
98
98
|
get focusableFirst() {
|
|
99
99
|
return this.focusable[0];
|
|
@@ -105,132 +105,132 @@ let S$3 = class S {
|
|
|
105
105
|
e && (this.el = e), n && (this.selectorFocus = n), this.focusable = this.getFocusable(), this.focus();
|
|
106
106
|
}
|
|
107
107
|
unmount() {
|
|
108
|
-
this.el = null, this.focusable = [], document.removeEventListener("keydown",
|
|
108
|
+
this.el = null, this.focusable = [], document.removeEventListener("keydown", o$2(this, u$1)), document.removeEventListener("keydown", o$2(this, d$2));
|
|
109
109
|
}
|
|
110
110
|
focus(e = this.el, n = this.selectorFocus) {
|
|
111
111
|
(e.querySelector(n) || e).focus();
|
|
112
112
|
}
|
|
113
113
|
getFocusable(e = this.el) {
|
|
114
|
-
const n = [],
|
|
114
|
+
const n = [], i = document.activeElement, r = e.scrollTop;
|
|
115
115
|
return e.querySelectorAll(g$2.join(",")).forEach((h2) => {
|
|
116
116
|
h2.focus(), document.activeElement === h2 && n.push(h2);
|
|
117
|
-
}), e.scrollTop =
|
|
117
|
+
}), e.scrollTop = r, i.focus(), n;
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
|
-
f$2 = /* @__PURE__ */ new WeakMap(), u$
|
|
120
|
+
f$2 = /* @__PURE__ */ new WeakMap(), u$1 = /* @__PURE__ */ new WeakMap(), d$2 = /* @__PURE__ */ new WeakMap();
|
|
121
121
|
function $$2(t) {
|
|
122
122
|
(t.key === "Tab" || t.keyCode === 9) && (t.shiftKey ? (document.activeElement === this.focusableFirst || document.activeElement === this.el) && (t.preventDefault(), this.focusableLast.focus()) : (document.activeElement === this.focusableLast || document.activeElement === this.el) && (t.preventDefault(), this.focusableFirst.focus()));
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function v$2(t) {
|
|
125
125
|
(t.key === "Tab" || t.keyCode === 9) && t.preventDefault();
|
|
126
126
|
}
|
|
127
|
-
function
|
|
128
|
-
return getComputedStyle(document.body).getPropertyValue("--
|
|
127
|
+
function y$2() {
|
|
128
|
+
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
129
129
|
}
|
|
130
|
-
function T$2(t, e = document.body
|
|
131
|
-
if (
|
|
132
|
-
const
|
|
133
|
-
|
|
130
|
+
function T$2(t, e = document.body) {
|
|
131
|
+
if (t.slice(0, 2) !== "--") {
|
|
132
|
+
const i = y$2();
|
|
133
|
+
i && (t = `${i}${t}`), t = `--${t}`;
|
|
134
134
|
}
|
|
135
|
-
const
|
|
136
|
-
if (
|
|
137
|
-
return
|
|
135
|
+
const n = getComputedStyle(e).getPropertyValue(t).trim();
|
|
136
|
+
if (n)
|
|
137
|
+
return n;
|
|
138
138
|
throw new Error(`CSS variable "${t}" was not found!`);
|
|
139
139
|
}
|
|
140
140
|
function q$2(t, e) {
|
|
141
|
-
const
|
|
142
|
-
return
|
|
141
|
+
const i = (t.getAttribute(`data-${e}`) || "").replace(/'/g, '"');
|
|
142
|
+
return i ? JSON.parse(i) : {};
|
|
143
143
|
}
|
|
144
144
|
function F$3(t, e = true) {
|
|
145
|
-
const n = localStorage.getItem(t),
|
|
145
|
+
const n = localStorage.getItem(t), i = n ? JSON.parse(n) : {};
|
|
146
146
|
return {
|
|
147
|
-
get(
|
|
148
|
-
return
|
|
147
|
+
get(r) {
|
|
148
|
+
return r ? i[r] : i;
|
|
149
149
|
},
|
|
150
|
-
set(
|
|
151
|
-
return c2 ?
|
|
150
|
+
set(r, c2) {
|
|
151
|
+
return c2 ? i[r] = c2 : delete i[r], e && localStorage.setItem(t, JSON.stringify(i)), i;
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
function k$3(t, e, n) {
|
|
156
|
-
const
|
|
157
|
-
if (e =
|
|
156
|
+
const i = e.nodeType === Node.COMMENT_NODE, r = e.nodeType === Node.ELEMENT_NODE;
|
|
157
|
+
if (e = i || r ? e : document.querySelector(e), i && (n = "after"), !e)
|
|
158
158
|
throw new Error(`Not a valid teleport reference: '${e}'`);
|
|
159
159
|
if (typeof e[n] != "function")
|
|
160
160
|
throw new Error(`Not a valid teleport method: '${n}'`);
|
|
161
161
|
let c2 = null;
|
|
162
|
-
return
|
|
162
|
+
return i || (c2 = document.createComment("teleported #" + t.id), t.before(c2)), e[n](t), i && e.remove(), c2;
|
|
163
163
|
}
|
|
164
|
-
function w$2(t, e, n,
|
|
165
|
-
return new Promise((
|
|
166
|
-
if (typeof
|
|
167
|
-
const c2 = T$2(
|
|
168
|
-
|
|
164
|
+
function w$2(t, e, n, i = "transition-duration") {
|
|
165
|
+
return new Promise((r) => {
|
|
166
|
+
if (typeof i == "string") {
|
|
167
|
+
const c2 = T$2(i, t), h2 = !!c2.includes("ms");
|
|
168
|
+
i = parseFloat(c2) * (h2 ? 1 : 1e3);
|
|
169
169
|
}
|
|
170
170
|
t.classList.remove(e.finish), t.classList.add(n.start), setTimeout(() => {
|
|
171
|
-
t.classList.add(n.finish), t.classList.remove(n.start),
|
|
172
|
-
},
|
|
171
|
+
t.classList.add(n.finish), t.classList.remove(n.start), r(t);
|
|
172
|
+
}, i);
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
|
-
function
|
|
176
|
-
e && document.querySelectorAll(e).forEach((
|
|
177
|
-
t ?
|
|
175
|
+
function E$2(t, e) {
|
|
176
|
+
e && document.querySelectorAll(e).forEach((i) => {
|
|
177
|
+
t ? i.style.overflow = "hidden" : i.style.removeProperty("overflow");
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
|
-
function
|
|
181
|
-
e && document.querySelectorAll(e).forEach((
|
|
182
|
-
t ? (
|
|
180
|
+
function p$2(t, e) {
|
|
181
|
+
e && document.querySelectorAll(e).forEach((i) => {
|
|
182
|
+
t ? (i.inert = true, i.setAttribute("aria-hidden", true)) : (i.inert = null, i.removeAttribute("aria-hidden"));
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
185
|
function C$2(t, e) {
|
|
186
|
-
|
|
186
|
+
p$2(!!t, e.selectorInert), E$2(!!t, e.selectorOverflow);
|
|
187
187
|
}
|
|
188
188
|
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
189
189
|
__proto__: null,
|
|
190
|
-
Breakpoint: I$
|
|
190
|
+
Breakpoint: I$2,
|
|
191
191
|
Collection: L$2,
|
|
192
192
|
FocusTrap: S$3,
|
|
193
193
|
cssVar: T$2,
|
|
194
194
|
getConfig: q$2,
|
|
195
|
-
getPrefix:
|
|
195
|
+
getPrefix: y$2,
|
|
196
196
|
localStore: F$3,
|
|
197
197
|
teleport: k$3,
|
|
198
198
|
transition: w$2,
|
|
199
199
|
updateGlobalState: C$2
|
|
200
200
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
201
|
-
var I$
|
|
202
|
-
if (!
|
|
201
|
+
var I$1 = (t, s2, e) => {
|
|
202
|
+
if (!s2.has(t))
|
|
203
203
|
throw TypeError("Cannot " + e);
|
|
204
204
|
};
|
|
205
|
-
var
|
|
206
|
-
if (
|
|
205
|
+
var w$1 = (t, s2, e) => (I$1(t, s2, "read from private field"), e ? e.call(t) : s2.get(t)), S$2 = (t, s2, e) => {
|
|
206
|
+
if (s2.has(t))
|
|
207
207
|
throw TypeError("Cannot add the same private member more than once");
|
|
208
|
-
|
|
209
|
-
},
|
|
210
|
-
var O$1 = (t,
|
|
211
|
-
if (!
|
|
208
|
+
s2 instanceof WeakSet ? s2.add(t) : s2.set(t, e);
|
|
209
|
+
}, L$1 = (t, s2, e, i) => (I$1(t, s2, "write to private field"), i ? i.call(t, e) : s2.set(t, e), e);
|
|
210
|
+
var O$1 = (t, s2, e) => {
|
|
211
|
+
if (!s2.has(t))
|
|
212
212
|
throw TypeError("Cannot " + e);
|
|
213
|
-
}, l = (t,
|
|
214
|
-
if (
|
|
213
|
+
}, l = (t, s2, e) => (O$1(t, s2, "read from private field"), e ? e.call(t) : s2.get(t)), $$1 = (t, s2, e) => {
|
|
214
|
+
if (s2.has(t))
|
|
215
215
|
throw TypeError("Cannot add the same private member more than once");
|
|
216
|
-
|
|
217
|
-
},
|
|
216
|
+
s2 instanceof WeakSet ? s2.add(t) : s2.set(t, e);
|
|
217
|
+
}, h$1 = (t, s2, e, i) => (O$1(t, s2, "write to private field"), i ? i.call(t, e) : s2.set(t, e), e), d$1;
|
|
218
218
|
let P$1 = class P {
|
|
219
|
-
constructor(
|
|
220
|
-
|
|
219
|
+
constructor(s2, e) {
|
|
220
|
+
$$1(this, d$1, void 0), this.value = s2, h$1(this, d$1, e), this.mql = null;
|
|
221
221
|
}
|
|
222
222
|
get handler() {
|
|
223
223
|
return l(this, d$1);
|
|
224
224
|
}
|
|
225
225
|
// Unmount existing handler before setting a new one.
|
|
226
|
-
set handler(
|
|
227
|
-
this.mql && this.mql.removeEventListener("change", l(this, d$1)),
|
|
226
|
+
set handler(s2) {
|
|
227
|
+
this.mql && this.mql.removeEventListener("change", l(this, d$1)), h$1(this, d$1, s2);
|
|
228
228
|
}
|
|
229
|
-
mount(
|
|
230
|
-
return
|
|
229
|
+
mount(s2, e) {
|
|
230
|
+
return s2 && (this.value = s2), e && h$1(this, d$1, e), this.value ? (this.mql = window.matchMedia(`(min-width: ${this.value})`), this.mql.addEventListener("change", l(this, d$1)), l(this, d$1).call(this, this.mql), this) : this;
|
|
231
231
|
}
|
|
232
232
|
unmount() {
|
|
233
|
-
return this.mql ? (this.mql.removeEventListener("change", l(this, d$1)), this.value = null,
|
|
233
|
+
return this.mql ? (this.mql.removeEventListener("change", l(this, d$1)), this.value = null, h$1(this, d$1, null), this.mql = null, this) : this;
|
|
234
234
|
}
|
|
235
235
|
};
|
|
236
236
|
d$1 = /* @__PURE__ */ new WeakMap();
|
|
@@ -238,21 +238,21 @@ let A$1 = class A {
|
|
|
238
238
|
constructor() {
|
|
239
239
|
this.collection = [];
|
|
240
240
|
}
|
|
241
|
-
async register(
|
|
242
|
-
return await this.deregister(
|
|
241
|
+
async register(s2) {
|
|
242
|
+
return await this.deregister(s2), this.collection.push(s2), this.collection;
|
|
243
243
|
}
|
|
244
|
-
async deregister(
|
|
245
|
-
const e = this.collection.findIndex((
|
|
244
|
+
async deregister(s2) {
|
|
245
|
+
const e = this.collection.findIndex((i) => i === s2);
|
|
246
246
|
if (e >= 0) {
|
|
247
|
-
const
|
|
248
|
-
Object.getOwnPropertyNames(
|
|
249
|
-
delete
|
|
247
|
+
const i = this.collection[e];
|
|
248
|
+
Object.getOwnPropertyNames(i).forEach((n) => {
|
|
249
|
+
delete i[n];
|
|
250
250
|
}), this.collection.splice(e, 1);
|
|
251
251
|
}
|
|
252
252
|
return this.collection;
|
|
253
253
|
}
|
|
254
|
-
async registerCollection(
|
|
255
|
-
return await Promise.all(Array.from(
|
|
254
|
+
async registerCollection(s2) {
|
|
255
|
+
return await Promise.all(Array.from(s2, (e) => {
|
|
256
256
|
this.register(e);
|
|
257
257
|
})), this.collection;
|
|
258
258
|
}
|
|
@@ -261,8 +261,8 @@ let A$1 = class A {
|
|
|
261
261
|
await this.deregister(this.collection[0]);
|
|
262
262
|
return this.collection;
|
|
263
263
|
}
|
|
264
|
-
get(
|
|
265
|
-
return this.collection.find((
|
|
264
|
+
get(s2, e = "id") {
|
|
265
|
+
return this.collection.find((i) => i[e] === s2);
|
|
266
266
|
}
|
|
267
267
|
};
|
|
268
268
|
const o$1 = {
|
|
@@ -288,15 +288,15 @@ const o$1 = {
|
|
|
288
288
|
`[tabindex]${o$1.inert}${o$1.negTabIndex}`
|
|
289
289
|
];
|
|
290
290
|
var v$1, g$1, f$1;
|
|
291
|
-
let j$
|
|
292
|
-
constructor(
|
|
293
|
-
|
|
291
|
+
let j$1 = class j {
|
|
292
|
+
constructor(s2 = null, e = "[data-focus]") {
|
|
293
|
+
$$1(this, v$1, void 0), $$1(this, g$1, void 0), $$1(this, f$1, void 0), this.el = s2, this.selectorFocus = e, h$1(this, g$1, q$1.bind(this)), h$1(this, f$1, K$2.bind(this));
|
|
294
294
|
}
|
|
295
295
|
get focusable() {
|
|
296
296
|
return l(this, v$1);
|
|
297
297
|
}
|
|
298
|
-
set focusable(
|
|
299
|
-
|
|
298
|
+
set focusable(s2) {
|
|
299
|
+
h$1(this, v$1, s2), l(this, v$1).length ? (document.removeEventListener("keydown", l(this, f$1)), document.addEventListener("keydown", l(this, g$1))) : (document.removeEventListener("keydown", l(this, g$1)), document.addEventListener("keydown", l(this, f$1)));
|
|
300
300
|
}
|
|
301
301
|
get focusableFirst() {
|
|
302
302
|
return this.focusable[0];
|
|
@@ -304,20 +304,20 @@ let j$2 = class j {
|
|
|
304
304
|
get focusableLast() {
|
|
305
305
|
return this.focusable[this.focusable.length - 1];
|
|
306
306
|
}
|
|
307
|
-
mount(
|
|
308
|
-
|
|
307
|
+
mount(s2, e) {
|
|
308
|
+
s2 && (this.el = s2), e && (this.selectorFocus = e), this.focusable = this.getFocusable(), this.focus();
|
|
309
309
|
}
|
|
310
310
|
unmount() {
|
|
311
311
|
this.el = null, this.focusable = [], document.removeEventListener("keydown", l(this, g$1)), document.removeEventListener("keydown", l(this, f$1));
|
|
312
312
|
}
|
|
313
|
-
focus(
|
|
314
|
-
(
|
|
313
|
+
focus(s2 = this.el, e = this.selectorFocus) {
|
|
314
|
+
(s2.querySelector(e) || s2).focus();
|
|
315
315
|
}
|
|
316
|
-
getFocusable(
|
|
317
|
-
const e = [],
|
|
318
|
-
return
|
|
316
|
+
getFocusable(s2 = this.el) {
|
|
317
|
+
const e = [], i = document.activeElement, n = s2.scrollTop;
|
|
318
|
+
return s2.querySelectorAll(B$1.join(",")).forEach((c2) => {
|
|
319
319
|
c2.focus(), document.activeElement === c2 && e.push(c2);
|
|
320
|
-
}),
|
|
320
|
+
}), s2.scrollTop = n, i.focus(), e;
|
|
321
321
|
}
|
|
322
322
|
};
|
|
323
323
|
v$1 = /* @__PURE__ */ new WeakMap(), g$1 = /* @__PURE__ */ new WeakMap(), f$1 = /* @__PURE__ */ new WeakMap();
|
|
@@ -327,60 +327,60 @@ function q$1(t) {
|
|
|
327
327
|
function K$2(t) {
|
|
328
328
|
(t.key === "Tab" || t.keyCode === 9) && t.preventDefault();
|
|
329
329
|
}
|
|
330
|
-
function
|
|
331
|
-
return getComputedStyle(document.body).getPropertyValue("--
|
|
330
|
+
function M$2() {
|
|
331
|
+
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
332
332
|
}
|
|
333
|
-
function N$2(t,
|
|
334
|
-
if (
|
|
335
|
-
const
|
|
336
|
-
|
|
333
|
+
function N$2(t, s2 = document.body) {
|
|
334
|
+
if (t.slice(0, 2) !== "--") {
|
|
335
|
+
const i = M$2();
|
|
336
|
+
i && (t = `${i}${t}`), t = `--${t}`;
|
|
337
337
|
}
|
|
338
|
-
const
|
|
339
|
-
if (
|
|
340
|
-
return
|
|
338
|
+
const e = getComputedStyle(s2).getPropertyValue(t).trim();
|
|
339
|
+
if (e)
|
|
340
|
+
return e;
|
|
341
341
|
throw new Error(`CSS variable "${t}" was not found!`);
|
|
342
342
|
}
|
|
343
|
-
function V$
|
|
344
|
-
const e = (t.getAttribute(`data-${
|
|
343
|
+
function V$2(t, s2) {
|
|
344
|
+
const e = (t.getAttribute(`data-${s2}`) || "").replace(/'/g, '"');
|
|
345
345
|
return e ? JSON.parse(e) : {};
|
|
346
346
|
}
|
|
347
|
-
function W$1(t,
|
|
348
|
-
const e = localStorage.getItem(t),
|
|
347
|
+
function W$1(t, s2 = true) {
|
|
348
|
+
const e = localStorage.getItem(t), i = e ? JSON.parse(e) : {};
|
|
349
349
|
return {
|
|
350
350
|
get(n) {
|
|
351
|
-
return n ?
|
|
351
|
+
return n ? i[n] : i;
|
|
352
352
|
},
|
|
353
353
|
set(n, c2) {
|
|
354
|
-
return c2 ?
|
|
354
|
+
return c2 ? i[n] = c2 : delete i[n], s2 && localStorage.setItem(t, JSON.stringify(i)), i;
|
|
355
355
|
}
|
|
356
356
|
};
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function y$1(t, s2, e, i = "transition-duration") {
|
|
359
359
|
return new Promise((n) => {
|
|
360
|
-
if (typeof
|
|
361
|
-
const c2 = N$2(
|
|
362
|
-
|
|
360
|
+
if (typeof i == "string") {
|
|
361
|
+
const c2 = N$2(i, t), r = !!c2.includes("ms");
|
|
362
|
+
i = parseFloat(c2) * (r ? 1 : 1e3);
|
|
363
363
|
}
|
|
364
|
-
t.classList.remove(
|
|
364
|
+
t.classList.remove(s2.finish), t.classList.add(e.start), setTimeout(() => {
|
|
365
365
|
t.classList.add(e.finish), t.classList.remove(e.start), n(t);
|
|
366
|
-
},
|
|
366
|
+
}, i);
|
|
367
367
|
});
|
|
368
368
|
}
|
|
369
|
-
function _$2(t,
|
|
370
|
-
|
|
369
|
+
function _$2(t, s2) {
|
|
370
|
+
s2 && document.querySelectorAll(s2).forEach((e) => {
|
|
371
371
|
t ? e.style.overflow = "hidden" : e.style.removeProperty("overflow");
|
|
372
372
|
});
|
|
373
373
|
}
|
|
374
|
-
function J$2(t,
|
|
375
|
-
|
|
374
|
+
function J$2(t, s2) {
|
|
375
|
+
s2 && document.querySelectorAll(s2).forEach((e) => {
|
|
376
376
|
t ? (e.inert = true, e.setAttribute("aria-hidden", true)) : (e.inert = null, e.removeAttribute("aria-hidden"));
|
|
377
377
|
});
|
|
378
378
|
}
|
|
379
|
-
function
|
|
380
|
-
J$2(!!t,
|
|
379
|
+
function C$1(t, s2) {
|
|
380
|
+
J$2(!!t, s2.selectorInert), _$2(!!t, s2.selectorOverflow);
|
|
381
381
|
}
|
|
382
382
|
const z$1 = {
|
|
383
|
-
|
|
383
|
+
autoMount: false,
|
|
384
384
|
// Data attributes
|
|
385
385
|
dataOpen: "drawer-open",
|
|
386
386
|
dataClose: "drawer-close",
|
|
@@ -409,25 +409,44 @@ const z$1 = {
|
|
|
409
409
|
storeKey: "VB:DrawerState",
|
|
410
410
|
setTabindex: true,
|
|
411
411
|
transition: true,
|
|
412
|
-
transitionDuration: "
|
|
412
|
+
transitionDuration: "drawer-transition-duration"
|
|
413
413
|
};
|
|
414
|
-
|
|
415
|
-
|
|
414
|
+
function G$1(t) {
|
|
415
|
+
t.store === "opened" ? t.open(false, false) : t.store === "closed" ? t.close(false, false) : t.store === "indeterminate" ? t.state = "indeterminate" : t.el.classList.contains(t.getSetting("stateOpened")) ? t.open(false, false) : t.el.classList.contains(t.getSetting("stateClosed")) ? t.close(false, false) : t.state = "indeterminate";
|
|
416
|
+
}
|
|
417
|
+
async function H$1(t) {
|
|
418
|
+
t.store === "opened" ? await t.open(false, false) : t.store === "closed" ? await t.close(false, false) : t.store === "indeterminate" ? t.state != "indeterminate" && (t.state = "indeterminate") : (t.state != t.inlineState && (t.state = t.inlineState), t.inlineState === "opened" ? await t.open(false, false) : t.inlineState === "closed" && await t.close(false, false));
|
|
419
|
+
}
|
|
420
|
+
function Q$1(t) {
|
|
421
|
+
const s2 = M$2(), e = t.getAttribute(`data-${this.settings.dataBreakpoint}`);
|
|
422
|
+
return this.settings.breakpoints && this.settings.breakpoints[e] ? this.settings.breakpoints[e] : getComputedStyle(document.body).getPropertyValue(`--${s2}breakpoint-${e}`).trim() ? getComputedStyle(document.body).getPropertyValue(`--${s2}breakpoint-${e}`).trim() : e;
|
|
423
|
+
}
|
|
424
|
+
function m$1(t) {
|
|
425
|
+
const s2 = typeof t == "string" ? this.get(t) : this.get(t.id);
|
|
426
|
+
if (s2)
|
|
427
|
+
return s2;
|
|
428
|
+
throw new Error(`Drawer not found in collection with id of "${t.id || t}".`);
|
|
429
|
+
}
|
|
430
|
+
function D$2(t) {
|
|
431
|
+
t.state === "opened" ? t.mode === "modal" ? this.focusTrap.mount(t.dialog, this.settings.selectorFocus) : this.focusTrap.focus(t.dialog, this.settings.selectorFocus) : (t.trigger && (t.trigger.focus(), t.trigger = null), this.focusTrap.unmount());
|
|
432
|
+
}
|
|
433
|
+
async function R$1(t) {
|
|
434
|
+
const s2 = t.target.closest(`
|
|
416
435
|
[data-${this.settings.dataOpen}],
|
|
417
436
|
[data-${this.settings.dataToggle}],
|
|
418
437
|
[data-${this.settings.dataClose}]
|
|
419
438
|
`);
|
|
420
|
-
if (
|
|
421
|
-
t.preventDefault(),
|
|
422
|
-
const n =
|
|
423
|
-
return n.trigger =
|
|
424
|
-
}),
|
|
425
|
-
const n =
|
|
426
|
-
return n.trigger =
|
|
427
|
-
}),
|
|
428
|
-
if (
|
|
429
|
-
const n =
|
|
430
|
-
return n.trigger =
|
|
439
|
+
if (s2) {
|
|
440
|
+
t.preventDefault(), s2.matches(`[data-${this.settings.dataToggle}]`) && s2.getAttribute(`data-${this.settings.dataToggle}`).trim().split(" ").forEach((i) => {
|
|
441
|
+
const n = m$1.call(this, i);
|
|
442
|
+
return n.trigger = s2, n.toggle();
|
|
443
|
+
}), s2.matches(`[data-${this.settings.dataOpen}]`) && s2.getAttribute(`data-${this.settings.dataOpen}`).trim().split(" ").forEach((i) => {
|
|
444
|
+
const n = m$1.call(this, i);
|
|
445
|
+
return n.trigger = s2, n.open();
|
|
446
|
+
}), s2.matches(`[data-${this.settings.dataClose}]`) && s2.getAttribute(`data-${this.settings.dataClose}`).trim().split(" ").forEach((i) => {
|
|
447
|
+
if (i) {
|
|
448
|
+
const n = m$1.call(this, i);
|
|
449
|
+
return n.trigger = s2, n.close();
|
|
431
450
|
} else {
|
|
432
451
|
const n = t.target.closest(this.settings.selectorDrawer);
|
|
433
452
|
if (n)
|
|
@@ -439,68 +458,49 @@ async function G$1(t) {
|
|
|
439
458
|
if (this.activeModal && t.target.matches(this.settings.selectorScreen))
|
|
440
459
|
return this.close(this.activeModal.id);
|
|
441
460
|
}
|
|
442
|
-
function
|
|
461
|
+
function U(t) {
|
|
443
462
|
if (t.key === "Escape" && this.activeModal)
|
|
444
463
|
return this.close(this.activeModal);
|
|
445
464
|
}
|
|
446
|
-
async function
|
|
447
|
-
const e = this.collection.findIndex((
|
|
465
|
+
async function k$2(t, s2 = true) {
|
|
466
|
+
const e = this.collection.findIndex((i) => i.id === t.id);
|
|
448
467
|
if (e >= 0) {
|
|
449
|
-
const
|
|
450
|
-
|
|
451
|
-
delete
|
|
468
|
+
const i = this.collection[e];
|
|
469
|
+
s2 && i.state === "opened" && await i.close(false), this.store.set(i.id), i.unmountBreakpoint(), Object.getOwnPropertyNames(i).forEach((n) => {
|
|
470
|
+
delete i[n];
|
|
452
471
|
}), this.collection.splice(e, 1);
|
|
453
472
|
}
|
|
454
473
|
return this.collection;
|
|
455
474
|
}
|
|
456
|
-
function
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
async function R$1(t) {
|
|
460
|
-
t.store === "opened" ? await t.open(false, false) : t.store === "closed" ? await t.close(false, false) : t.store === "indeterminate" ? t.state != "indeterminate" && (t.state = "indeterminate") : (t.state != t.inlineState && (t.state = t.inlineState), t.inlineState === "opened" ? await t.open(false, false) : t.inlineState === "closed" && await t.close(false, false));
|
|
461
|
-
}
|
|
462
|
-
function U(t) {
|
|
463
|
-
const s = y$1(), e = t.getAttribute(`data-${this.settings.dataBreakpoint}`);
|
|
464
|
-
return this.settings.breakpoints && this.settings.breakpoints[e] ? this.settings.breakpoints[e] : getComputedStyle(document.body).getPropertyValue(`--${s}breakpoint-${e}`).trim() ? getComputedStyle(document.body).getPropertyValue(`--${s}breakpoint-${e}`).trim() : e;
|
|
465
|
-
}
|
|
466
|
-
function C$1(t) {
|
|
467
|
-
const s = typeof t == "string" ? this.get(t) : this.get(t.id);
|
|
468
|
-
if (s)
|
|
469
|
-
return s;
|
|
470
|
-
throw new Error(`Drawer not found in collection with id of "${t.id || t}".`);
|
|
471
|
-
}
|
|
472
|
-
function D$2(t) {
|
|
473
|
-
t.state === "opened" ? t.mode === "modal" ? this.focusTrap.mount(t.dialog, this.settings.selectorFocus) : this.focusTrap.focus(t.dialog, this.settings.selectorFocus) : (t.trigger && (t.trigger.focus(), t.trigger = null), this.focusTrap.unmount());
|
|
474
|
-
}
|
|
475
|
-
async function x$1(t, s, e = true) {
|
|
476
|
-
const i2 = C$1.call(this, t), n = { ...this.settings, ...i2.settings };
|
|
477
|
-
return s !== void 0 && (n.transition = s), (i2.state === "closed" || i2.state === "indeterminate") && (i2.state = "opening", n.transition ? await M$1(i2.el, {
|
|
475
|
+
async function x$1(t, s2, e = true) {
|
|
476
|
+
const i = m$1.call(this, t), n = { ...this.settings, ...i.settings };
|
|
477
|
+
return s2 !== void 0 && (n.transition = s2), (i.state === "closed" || i.state === "indeterminate") && (i.state = "opening", n.transition ? await y$1(i.el, {
|
|
478
478
|
start: n.stateClosing,
|
|
479
479
|
finish: n.stateClosed
|
|
480
480
|
}, {
|
|
481
481
|
start: n.stateOpening,
|
|
482
482
|
finish: n.stateOpened
|
|
483
|
-
}, n.transitionDuration) : (
|
|
483
|
+
}, n.transitionDuration) : (i.el.classList.add(n.stateOpened), i.el.classList.remove(n.stateClosed)), i.state = "opened", i.mode === "modal" && C$1(true, n), e && D$2.call(this, i), i.el.dispatchEvent(new CustomEvent(n.customEventPrefix + "opened", {
|
|
484
484
|
detail: this,
|
|
485
485
|
bubbles: true
|
|
486
|
-
}))),
|
|
486
|
+
}))), i;
|
|
487
487
|
}
|
|
488
|
-
async function E$1(t,
|
|
489
|
-
const
|
|
490
|
-
return
|
|
488
|
+
async function E$1(t, s2, e = true) {
|
|
489
|
+
const i = m$1.call(this, t), n = { ...this.settings, ...i.settings };
|
|
490
|
+
return s2 !== void 0 && (n.transition = s2), (i.state === "opened" || i.state === "indeterminate") && (i.state = "closing", document.activeElement.blur(), n.transition ? await y$1(i.el, {
|
|
491
491
|
start: n.stateOpening,
|
|
492
492
|
finish: n.stateOpened
|
|
493
493
|
}, {
|
|
494
494
|
start: n.stateClosing,
|
|
495
495
|
finish: n.stateClosed
|
|
496
|
-
}, n.transitionDuration) : (
|
|
496
|
+
}, n.transitionDuration) : (i.el.classList.add(n.stateClosed), i.el.classList.remove(n.stateOpened)), i.state = "closed", i.mode === "modal" && C$1(false, n), e && D$2.call(this, i), i.el.dispatchEvent(new CustomEvent(n.customEventPrefix + "closed", {
|
|
497
497
|
detail: this,
|
|
498
498
|
bubbles: true
|
|
499
|
-
}))),
|
|
499
|
+
}))), i;
|
|
500
500
|
}
|
|
501
|
-
async function F$2(t,
|
|
502
|
-
const
|
|
503
|
-
return
|
|
501
|
+
async function F$2(t, s2, e) {
|
|
502
|
+
const i = m$1.call(this, t);
|
|
503
|
+
return i.state === "closed" ? x$1.call(this, i, s2, e) : E$1.call(this, i, s2, e);
|
|
504
504
|
}
|
|
505
505
|
function X(t) {
|
|
506
506
|
switch (t.mode) {
|
|
@@ -513,7 +513,7 @@ function X(t) {
|
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
515
|
async function Y(t) {
|
|
516
|
-
return t.el.classList.remove(t.getSetting("classModal")), t.dialog.removeAttribute("aria-modal"),
|
|
516
|
+
return t.el.classList.remove(t.getSetting("classModal")), t.dialog.removeAttribute("aria-modal"), C$1(false, { ...this.settings, ...t.settings }), this.focusTrap.unmount(), await H$1(t), t.el.dispatchEvent(new CustomEvent(t.getSetting("customEventPrefix") + "switchMode", {
|
|
517
517
|
detail: this,
|
|
518
518
|
bubbles: true
|
|
519
519
|
})), t;
|
|
@@ -524,19 +524,19 @@ async function Z$1(t) {
|
|
|
524
524
|
bubbles: true
|
|
525
525
|
})), t;
|
|
526
526
|
}
|
|
527
|
-
async function tt$1(t,
|
|
528
|
-
await
|
|
529
|
-
const e = this,
|
|
527
|
+
async function tt$1(t, s2 = {}) {
|
|
528
|
+
await k$2.call(this, t, false);
|
|
529
|
+
const e = this, i = new P$1();
|
|
530
530
|
let n, c2 = "indeterminate";
|
|
531
|
-
const
|
|
531
|
+
const r = {
|
|
532
532
|
id: t.id,
|
|
533
533
|
el: t,
|
|
534
534
|
dialog: null,
|
|
535
535
|
trigger: null,
|
|
536
|
-
settings: { ...V$
|
|
536
|
+
settings: { ...V$2(t, this.settings.dataConfig), ...s2 },
|
|
537
537
|
inlineState: "indeterminate",
|
|
538
538
|
get breakpoint() {
|
|
539
|
-
return
|
|
539
|
+
return Q$1.call(e, t);
|
|
540
540
|
},
|
|
541
541
|
get store() {
|
|
542
542
|
return e.store.get(this.id);
|
|
@@ -553,107 +553,107 @@ async function tt$1(t, s = {}) {
|
|
|
553
553
|
set state(a2) {
|
|
554
554
|
c2 = a2, this.mode === "inline" && a2 != "opening" && a2 != "closing" && (this.inlineState = a2, this.getSetting("store") && e.store.set(this.id, a2)), a2 === "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")));
|
|
555
555
|
},
|
|
556
|
-
open(a2,
|
|
557
|
-
return x$1.call(e, this, a2,
|
|
556
|
+
open(a2, u2) {
|
|
557
|
+
return x$1.call(e, this, a2, u2);
|
|
558
558
|
},
|
|
559
|
-
close(a2,
|
|
560
|
-
return E$1.call(e, this, a2,
|
|
559
|
+
close(a2, u2) {
|
|
560
|
+
return E$1.call(e, this, a2, u2);
|
|
561
561
|
},
|
|
562
|
-
toggle(a2,
|
|
563
|
-
return F$2.call(e, this, a2,
|
|
562
|
+
toggle(a2, u2) {
|
|
563
|
+
return F$2.call(e, this, a2, u2);
|
|
564
564
|
},
|
|
565
565
|
deregister() {
|
|
566
|
-
return
|
|
566
|
+
return k$2.call(e, this);
|
|
567
567
|
},
|
|
568
568
|
mountBreakpoint() {
|
|
569
|
-
const a2 = this.breakpoint,
|
|
570
|
-
return
|
|
569
|
+
const a2 = this.breakpoint, u2 = this.handleBreakpoint.bind(this);
|
|
570
|
+
return i.mount(a2, u2), this;
|
|
571
571
|
},
|
|
572
572
|
unmountBreakpoint() {
|
|
573
|
-
return
|
|
573
|
+
return i.unmount(), this;
|
|
574
574
|
},
|
|
575
575
|
handleBreakpoint(a2) {
|
|
576
|
-
const
|
|
577
|
-
return this.mode !=
|
|
576
|
+
const u2 = a2.matches ? "inline" : "modal";
|
|
577
|
+
return this.mode != u2 && (this.mode = u2), this;
|
|
578
578
|
},
|
|
579
579
|
getSetting(a2) {
|
|
580
580
|
return a2 in this.settings ? this.settings[a2] : e.settings[a2];
|
|
581
581
|
}
|
|
582
582
|
};
|
|
583
|
-
this.collection.push(
|
|
584
|
-
const T2 = t.querySelector(
|
|
585
|
-
return
|
|
583
|
+
this.collection.push(r);
|
|
584
|
+
const T2 = t.querySelector(r.getSetting("selectorDialog"));
|
|
585
|
+
return r.dialog = T2 || t, r.getSetting("setTabindex") && r.dialog.setAttribute("tabindex", "-1"), await G$1(r), r.inlineState = r.state, r.mode = t.classList.contains(r.getSetting("classModal")) ? "modal" : "inline", r.breakpoint && r.mountBreakpoint(), r;
|
|
586
586
|
}
|
|
587
|
-
var
|
|
587
|
+
var p$1, b$1;
|
|
588
588
|
let st$1 = class st extends A$1 {
|
|
589
589
|
constructor(e) {
|
|
590
590
|
super();
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
this.defaults = z$1, this.settings = { ...this.defaults, ...e }, this.focusTrap = new j$
|
|
591
|
+
S$2(this, p$1, void 0);
|
|
592
|
+
S$2(this, b$1, void 0);
|
|
593
|
+
this.defaults = z$1, this.settings = { ...this.defaults, ...e }, this.focusTrap = new j$1(), this.store = W$1(this.settings.storeKey, this.settings.store), L$1(this, p$1, R$1.bind(this)), L$1(this, b$1, U.bind(this)), this.settings.autoMount && this.mount();
|
|
594
594
|
}
|
|
595
595
|
get activeModal() {
|
|
596
596
|
return this.collection.find((e) => e.state === "opened" && e.mode === "modal");
|
|
597
597
|
}
|
|
598
|
-
async
|
|
598
|
+
async mount(e = null) {
|
|
599
599
|
e && (this.settings = { ...this.settings, ...e });
|
|
600
|
-
const
|
|
601
|
-
return await this.registerCollection(
|
|
600
|
+
const i = document.querySelectorAll(this.settings.selectorDrawer);
|
|
601
|
+
return await this.registerCollection(i), this.settings.eventListeners && this.mountEventListeners(), this;
|
|
602
602
|
}
|
|
603
|
-
async
|
|
604
|
-
return await this.deregisterCollection(), this.settings.eventListeners && this.
|
|
603
|
+
async unmount() {
|
|
604
|
+
return await this.deregisterCollection(), this.settings.eventListeners && this.unmountEventListeners(), this;
|
|
605
605
|
}
|
|
606
|
-
|
|
607
|
-
document.addEventListener("click",
|
|
606
|
+
mountEventListeners() {
|
|
607
|
+
document.addEventListener("click", w$1(this, p$1), false), document.addEventListener("keydown", w$1(this, b$1), false);
|
|
608
608
|
}
|
|
609
|
-
|
|
610
|
-
document.removeEventListener("click",
|
|
609
|
+
unmountEventListeners() {
|
|
610
|
+
document.removeEventListener("click", w$1(this, p$1), false), document.removeEventListener("keydown", w$1(this, b$1), false);
|
|
611
611
|
}
|
|
612
|
-
register(e,
|
|
612
|
+
register(e, i = {}) {
|
|
613
613
|
let n = typeof e == "string" ? document.getElementById(e) : e;
|
|
614
|
-
return n ? tt$1.call(this, n,
|
|
614
|
+
return n ? tt$1.call(this, n, i) : Promise.reject(new Error(`Failed to register; drawer not found with ID of: "${e.id || e}".`));
|
|
615
615
|
}
|
|
616
616
|
deregister(e) {
|
|
617
|
-
let
|
|
618
|
-
return
|
|
617
|
+
let i = this.get(e.id || e);
|
|
618
|
+
return i ? k$2.call(this, i) : Promise.reject(new Error(`Failed to deregister; drawer does not exist in collection with ID of: "${e.id || e}".`));
|
|
619
619
|
}
|
|
620
|
-
open(e,
|
|
621
|
-
return x$1.call(this, e,
|
|
620
|
+
open(e, i, n) {
|
|
621
|
+
return x$1.call(this, e, i, n);
|
|
622
622
|
}
|
|
623
|
-
close(e,
|
|
624
|
-
return E$1.call(this, e,
|
|
623
|
+
close(e, i, n) {
|
|
624
|
+
return E$1.call(this, e, i, n);
|
|
625
625
|
}
|
|
626
|
-
toggle(e,
|
|
627
|
-
return F$2.call(this, e,
|
|
626
|
+
toggle(e, i, n) {
|
|
627
|
+
return F$2.call(this, e, i, n);
|
|
628
628
|
}
|
|
629
629
|
};
|
|
630
|
-
|
|
631
|
-
var
|
|
632
|
-
if (!
|
|
630
|
+
p$1 = /* @__PURE__ */ new WeakMap(), b$1 = /* @__PURE__ */ new WeakMap();
|
|
631
|
+
var L2 = (i, s2, t) => {
|
|
632
|
+
if (!s2.has(i))
|
|
633
633
|
throw TypeError("Cannot " + t);
|
|
634
634
|
};
|
|
635
|
-
var f = (
|
|
636
|
-
if (
|
|
635
|
+
var f = (i, s2, t) => (L2(i, s2, "read from private field"), t ? t.call(i) : s2.get(i)), v = (i, s2, t) => {
|
|
636
|
+
if (s2.has(i))
|
|
637
637
|
throw TypeError("Cannot add the same private member more than once");
|
|
638
|
-
|
|
639
|
-
},
|
|
640
|
-
var
|
|
641
|
-
if (!
|
|
638
|
+
s2 instanceof WeakSet ? s2.add(i) : s2.set(i, t);
|
|
639
|
+
}, b = (i, s2, t, e) => (L2(i, s2, "write to private field"), e ? e.call(i, t) : s2.set(i, t), t);
|
|
640
|
+
var I2 = (i, s2, t) => {
|
|
641
|
+
if (!s2.has(i))
|
|
642
642
|
throw TypeError("Cannot " + t);
|
|
643
|
-
}, a = (
|
|
644
|
-
if (
|
|
643
|
+
}, a = (i, s2, t) => (I2(i, s2, "read from private field"), t ? t.call(i) : s2.get(i)), y = (i, s2, t) => {
|
|
644
|
+
if (s2.has(i))
|
|
645
645
|
throw TypeError("Cannot add the same private member more than once");
|
|
646
|
-
|
|
647
|
-
},
|
|
646
|
+
s2 instanceof WeakSet ? s2.add(i) : s2.set(i, t);
|
|
647
|
+
}, w = (i, s2, t, e) => (I2(i, s2, "write to private field"), e ? e.call(i, t) : s2.set(i, t), t);
|
|
648
648
|
class O {
|
|
649
649
|
constructor() {
|
|
650
650
|
this.collection = [];
|
|
651
651
|
}
|
|
652
|
-
async register(
|
|
653
|
-
return await this.deregister(
|
|
652
|
+
async register(s2) {
|
|
653
|
+
return await this.deregister(s2), this.collection.push(s2), this.collection;
|
|
654
654
|
}
|
|
655
|
-
async deregister(
|
|
656
|
-
const t = this.collection.findIndex((e) => e ===
|
|
655
|
+
async deregister(s2) {
|
|
656
|
+
const t = this.collection.findIndex((e) => e === s2);
|
|
657
657
|
if (t >= 0) {
|
|
658
658
|
const e = this.collection[t];
|
|
659
659
|
Object.getOwnPropertyNames(e).forEach((n) => {
|
|
@@ -662,8 +662,8 @@ class O {
|
|
|
662
662
|
}
|
|
663
663
|
return this.collection;
|
|
664
664
|
}
|
|
665
|
-
async registerCollection(
|
|
666
|
-
return await Promise.all(Array.from(
|
|
665
|
+
async registerCollection(s2) {
|
|
666
|
+
return await Promise.all(Array.from(s2, (t) => {
|
|
667
667
|
this.register(t);
|
|
668
668
|
})), this.collection;
|
|
669
669
|
}
|
|
@@ -672,15 +672,15 @@ class O {
|
|
|
672
672
|
await this.deregister(this.collection[0]);
|
|
673
673
|
return this.collection;
|
|
674
674
|
}
|
|
675
|
-
get(
|
|
676
|
-
return this.collection.find((e) => e[t] ===
|
|
675
|
+
get(s2, t = "id") {
|
|
676
|
+
return this.collection.find((e) => e[t] === s2);
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
679
|
const o = {
|
|
680
680
|
inert: ":not([inert]):not([inert] *)",
|
|
681
681
|
negTabIndex: ':not([tabindex^="-"])',
|
|
682
682
|
disabled: ":not(:disabled)"
|
|
683
|
-
},
|
|
683
|
+
}, M$1 = [
|
|
684
684
|
`a[href]${o.inert}${o.negTabIndex}`,
|
|
685
685
|
`area[href]${o.inert}${o.negTabIndex}`,
|
|
686
686
|
`input:not([type="hidden"]):not([type="radio"])${o.inert}${o.negTabIndex}${o.disabled}`,
|
|
@@ -699,15 +699,15 @@ const o = {
|
|
|
699
699
|
`[tabindex]${o.inert}${o.negTabIndex}`
|
|
700
700
|
];
|
|
701
701
|
var g, c, d;
|
|
702
|
-
class
|
|
703
|
-
constructor(
|
|
704
|
-
|
|
702
|
+
class A2 {
|
|
703
|
+
constructor(s2 = null, t = "[data-focus]") {
|
|
704
|
+
y(this, g, void 0), y(this, c, void 0), y(this, d, void 0), this.el = s2, this.selectorFocus = t, w(this, c, P2.bind(this)), w(this, d, R.bind(this));
|
|
705
705
|
}
|
|
706
706
|
get focusable() {
|
|
707
707
|
return a(this, g);
|
|
708
708
|
}
|
|
709
|
-
set focusable(
|
|
710
|
-
|
|
709
|
+
set focusable(s2) {
|
|
710
|
+
w(this, g, s2), a(this, g).length ? (document.removeEventListener("keydown", a(this, d)), document.addEventListener("keydown", a(this, c))) : (document.removeEventListener("keydown", a(this, c)), document.addEventListener("keydown", a(this, d)));
|
|
711
711
|
}
|
|
712
712
|
get focusableFirst() {
|
|
713
713
|
return this.focusable[0];
|
|
@@ -715,81 +715,81 @@ class M {
|
|
|
715
715
|
get focusableLast() {
|
|
716
716
|
return this.focusable[this.focusable.length - 1];
|
|
717
717
|
}
|
|
718
|
-
mount(
|
|
719
|
-
|
|
718
|
+
mount(s2, t) {
|
|
719
|
+
s2 && (this.el = s2), t && (this.selectorFocus = t), this.focusable = this.getFocusable(), this.focus();
|
|
720
720
|
}
|
|
721
721
|
unmount() {
|
|
722
722
|
this.el = null, this.focusable = [], document.removeEventListener("keydown", a(this, c)), document.removeEventListener("keydown", a(this, d));
|
|
723
723
|
}
|
|
724
|
-
focus(
|
|
725
|
-
(
|
|
724
|
+
focus(s2 = this.el, t = this.selectorFocus) {
|
|
725
|
+
(s2.querySelector(t) || s2).focus();
|
|
726
726
|
}
|
|
727
|
-
getFocusable(
|
|
728
|
-
const t = [], e = document.activeElement, n =
|
|
729
|
-
return
|
|
730
|
-
|
|
731
|
-
}),
|
|
727
|
+
getFocusable(s2 = this.el) {
|
|
728
|
+
const t = [], e = document.activeElement, n = s2.scrollTop;
|
|
729
|
+
return s2.querySelectorAll(M$1.join(",")).forEach((r) => {
|
|
730
|
+
r.focus(), document.activeElement === r && t.push(r);
|
|
731
|
+
}), s2.scrollTop = n, e.focus(), t;
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
734
|
g = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakMap();
|
|
735
|
-
function P2(
|
|
736
|
-
(
|
|
735
|
+
function P2(i) {
|
|
736
|
+
(i.key === "Tab" || i.keyCode === 9) && (i.shiftKey ? (document.activeElement === this.focusableFirst || document.activeElement === this.el) && (i.preventDefault(), this.focusableLast.focus()) : (document.activeElement === this.focusableLast || document.activeElement === this.el) && (i.preventDefault(), this.focusableFirst.focus()));
|
|
737
737
|
}
|
|
738
|
-
function R(
|
|
739
|
-
(
|
|
738
|
+
function R(i) {
|
|
739
|
+
(i.key === "Tab" || i.keyCode === 9) && i.preventDefault();
|
|
740
740
|
}
|
|
741
741
|
function F$1() {
|
|
742
|
-
return getComputedStyle(document.body).getPropertyValue("--
|
|
742
|
+
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
743
743
|
}
|
|
744
|
-
function D$1(
|
|
745
|
-
if (
|
|
746
|
-
const
|
|
747
|
-
|
|
744
|
+
function D$1(i, s2 = document.body) {
|
|
745
|
+
if (i.slice(0, 2) !== "--") {
|
|
746
|
+
const e = F$1();
|
|
747
|
+
e && (i = `${e}${i}`), i = `--${i}`;
|
|
748
748
|
}
|
|
749
|
-
const
|
|
750
|
-
if (
|
|
751
|
-
return
|
|
752
|
-
throw new Error(`CSS variable "${
|
|
749
|
+
const t = getComputedStyle(s2).getPropertyValue(i).trim();
|
|
750
|
+
if (t)
|
|
751
|
+
return t;
|
|
752
|
+
throw new Error(`CSS variable "${i}" was not found!`);
|
|
753
753
|
}
|
|
754
|
-
function N$1(
|
|
755
|
-
const t = (
|
|
754
|
+
function N$1(i, s2) {
|
|
755
|
+
const t = (i.getAttribute(`data-${s2}`) || "").replace(/'/g, '"');
|
|
756
756
|
return t ? JSON.parse(t) : {};
|
|
757
757
|
}
|
|
758
|
-
function
|
|
759
|
-
const e =
|
|
760
|
-
if (
|
|
761
|
-
throw new Error(`Not a valid teleport reference: '${
|
|
762
|
-
if (typeof
|
|
758
|
+
function T$1(i, s2, t) {
|
|
759
|
+
const e = s2.nodeType === Node.COMMENT_NODE, n = s2.nodeType === Node.ELEMENT_NODE;
|
|
760
|
+
if (s2 = e || n ? s2 : document.querySelector(s2), e && (t = "after"), !s2)
|
|
761
|
+
throw new Error(`Not a valid teleport reference: '${s2}'`);
|
|
762
|
+
if (typeof s2[t] != "function")
|
|
763
763
|
throw new Error(`Not a valid teleport method: '${t}'`);
|
|
764
|
-
let
|
|
765
|
-
return e || (
|
|
764
|
+
let r = null;
|
|
765
|
+
return e || (r = document.createComment("teleported #" + i.id), i.before(r)), s2[t](i), e && s2.remove(), r;
|
|
766
766
|
}
|
|
767
|
-
function S$1(
|
|
767
|
+
function S$1(i, s2, t, e = "transition-duration") {
|
|
768
768
|
return new Promise((n) => {
|
|
769
769
|
if (typeof e == "string") {
|
|
770
|
-
const
|
|
771
|
-
e = parseFloat(
|
|
770
|
+
const r = D$1(e, i), l2 = !!r.includes("ms");
|
|
771
|
+
e = parseFloat(r) * (l2 ? 1 : 1e3);
|
|
772
772
|
}
|
|
773
|
-
|
|
774
|
-
|
|
773
|
+
i.classList.remove(s2.finish), i.classList.add(t.start), setTimeout(() => {
|
|
774
|
+
i.classList.add(t.finish), i.classList.remove(t.start), n(i);
|
|
775
775
|
}, e);
|
|
776
776
|
});
|
|
777
777
|
}
|
|
778
|
-
function z(
|
|
779
|
-
|
|
780
|
-
|
|
778
|
+
function z(i, s2) {
|
|
779
|
+
s2 && document.querySelectorAll(s2).forEach((t) => {
|
|
780
|
+
i ? t.style.overflow = "hidden" : t.style.removeProperty("overflow");
|
|
781
781
|
});
|
|
782
782
|
}
|
|
783
|
-
function
|
|
784
|
-
|
|
785
|
-
|
|
783
|
+
function j2(i, s2) {
|
|
784
|
+
s2 && document.querySelectorAll(s2).forEach((t) => {
|
|
785
|
+
i ? (t.inert = true, t.setAttribute("aria-hidden", true)) : (t.inert = null, t.removeAttribute("aria-hidden"));
|
|
786
786
|
});
|
|
787
787
|
}
|
|
788
|
-
function W(
|
|
789
|
-
|
|
788
|
+
function W(i, s2) {
|
|
789
|
+
j2(!!i, s2.selectorInert), z(!!i, s2.selectorOverflow);
|
|
790
790
|
}
|
|
791
791
|
const _$1 = {
|
|
792
|
-
|
|
792
|
+
autoMount: false,
|
|
793
793
|
// Data attributes
|
|
794
794
|
dataOpen: "modal-open",
|
|
795
795
|
dataClose: "modal-close",
|
|
@@ -815,57 +815,57 @@ const _$1 = {
|
|
|
815
815
|
teleportMethod: "append",
|
|
816
816
|
setTabindex: true,
|
|
817
817
|
transition: true,
|
|
818
|
-
transitionDuration: "
|
|
818
|
+
transitionDuration: "modal-transition-duration"
|
|
819
819
|
};
|
|
820
|
-
|
|
821
|
-
const
|
|
820
|
+
function m(i) {
|
|
821
|
+
const s2 = typeof i == "string" ? this.get(i) : this.get(i.id);
|
|
822
|
+
if (s2)
|
|
823
|
+
return s2;
|
|
824
|
+
throw new Error(`Modal not found in collection with id of "${i.id || i}".`);
|
|
825
|
+
}
|
|
826
|
+
function p() {
|
|
827
|
+
this.active ? this.focusTrap.mount(this.active.dialog, this.settings.selectorFocus) : (this.trigger && (this.trigger.focus(), this.trigger = null), this.focusTrap.unmount());
|
|
828
|
+
}
|
|
829
|
+
async function G(i) {
|
|
830
|
+
const s2 = i.target.closest(`
|
|
822
831
|
[data-${this.settings.dataOpen}],
|
|
823
832
|
[data-${this.settings.dataReplace}],
|
|
824
833
|
[data-${this.settings.dataClose}]
|
|
825
834
|
`);
|
|
826
|
-
if (
|
|
827
|
-
if (
|
|
828
|
-
const t =
|
|
829
|
-
return
|
|
835
|
+
if (s2) {
|
|
836
|
+
if (i.preventDefault(), s2.matches(`[data-${this.settings.dataOpen}]`)) {
|
|
837
|
+
const t = s2.getAttribute(`data-${this.settings.dataOpen}`).trim(), e = m.call(this, t);
|
|
838
|
+
return i.target.closest(this.settings.selectorModal) || (this.trigger = s2), e.open();
|
|
830
839
|
}
|
|
831
|
-
if (
|
|
832
|
-
const t =
|
|
833
|
-
return
|
|
840
|
+
if (s2.matches(`[data-${this.settings.dataReplace}]`)) {
|
|
841
|
+
const t = s2.getAttribute(`data-${this.settings.dataReplace}`).trim(), e = m.call(this, t);
|
|
842
|
+
return i.target.closest(this.settings.selectorModal) || (this.trigger = s2), e.replace();
|
|
834
843
|
}
|
|
835
|
-
if (
|
|
836
|
-
const t =
|
|
844
|
+
if (s2.matches(`[data-${this.settings.dataClose}]`)) {
|
|
845
|
+
const t = s2.getAttribute(`data-${this.settings.dataClose}`).trim();
|
|
837
846
|
return t === "*" ? this.closeAll() : this.close(t);
|
|
838
847
|
}
|
|
839
848
|
}
|
|
840
|
-
if (this.active &&
|
|
849
|
+
if (this.active && i.target.matches(this.settings.selectorScreen) && !this.active.required)
|
|
841
850
|
return this.close(this.active.id);
|
|
842
851
|
}
|
|
843
|
-
function K$1(
|
|
844
|
-
if (
|
|
852
|
+
function K$1(i) {
|
|
853
|
+
if (i.key === "Escape" && this.active && !this.active.dialog.matches(this.settings.selectorRequired))
|
|
845
854
|
return this.close();
|
|
846
855
|
}
|
|
847
|
-
async function
|
|
848
|
-
const t = this.collection.findIndex((e) => e.id ===
|
|
856
|
+
async function E(i, s2 = true) {
|
|
857
|
+
const t = this.collection.findIndex((e) => e.id === i.id);
|
|
849
858
|
if (t >= 0) {
|
|
850
859
|
const e = this.collection[t];
|
|
851
|
-
|
|
860
|
+
s2 && e.state === "opened" ? await e.close(false) : this.stack.remove(e), e.getSetting("teleport") && e.teleportReturn(), Object.getOwnPropertyNames(e).forEach((n) => {
|
|
852
861
|
delete e[n];
|
|
853
862
|
}), this.collection.splice(t, 1);
|
|
854
863
|
}
|
|
855
864
|
return this.collection;
|
|
856
865
|
}
|
|
857
|
-
function
|
|
858
|
-
const
|
|
859
|
-
|
|
860
|
-
return s;
|
|
861
|
-
throw new Error(`Modal not found in collection with id of "${i2.id || i2}".`);
|
|
862
|
-
}
|
|
863
|
-
function p() {
|
|
864
|
-
this.active ? this.focusTrap.mount(this.active.dialog, this.settings.selectorFocus) : (this.trigger && (this.trigger.focus(), this.trigger = null), this.focusTrap.unmount());
|
|
865
|
-
}
|
|
866
|
-
async function x(i2, s, t = true) {
|
|
867
|
-
const e = $.call(this, i2), n = { ...this.settings, ...e.settings };
|
|
868
|
-
return s !== void 0 && (n.transition = s), this.stack.moveToTop(e), e.state === "closed" && (e.state = "opening", this.stack.add(e), n.transition ? await S$1(e.el, {
|
|
866
|
+
async function x(i, s2, t = true) {
|
|
867
|
+
const e = m.call(this, i), n = { ...this.settings, ...e.settings };
|
|
868
|
+
return s2 !== void 0 && (n.transition = s2), this.stack.moveToTop(e), e.state === "closed" && (e.state = "opening", this.stack.add(e), n.transition ? await S$1(e.el, {
|
|
869
869
|
start: n.stateClosing,
|
|
870
870
|
finish: n.stateClosed
|
|
871
871
|
}, {
|
|
@@ -876,12 +876,12 @@ async function x(i2, s, t = true) {
|
|
|
876
876
|
bubbles: true
|
|
877
877
|
})), e;
|
|
878
878
|
}
|
|
879
|
-
async function C(
|
|
880
|
-
const e =
|
|
879
|
+
async function C(i, s2, t = true) {
|
|
880
|
+
const e = i ? m.call(this, i) : this.active;
|
|
881
881
|
if (e && e.state === "opened") {
|
|
882
882
|
e.state = "closing";
|
|
883
883
|
const n = { ...this.settings, ...e.settings };
|
|
884
|
-
|
|
884
|
+
s2 !== void 0 && (n.transition = s2), document.activeElement.blur(), n.transition ? await S$1(e.el, {
|
|
885
885
|
start: n.stateOpening,
|
|
886
886
|
finish: n.stateOpened
|
|
887
887
|
}, {
|
|
@@ -894,84 +894,84 @@ async function C(i2, s, t = true) {
|
|
|
894
894
|
}
|
|
895
895
|
return e;
|
|
896
896
|
}
|
|
897
|
-
async function
|
|
897
|
+
async function $(i, s2) {
|
|
898
898
|
const t = [];
|
|
899
899
|
return await Promise.all(this.stack.value.map(async (e) => {
|
|
900
|
-
|
|
900
|
+
i && i === e.id ? Promise.resolve() : t.push(await C.call(this, e, s2, false)), e.trigger = null;
|
|
901
901
|
})), t;
|
|
902
902
|
}
|
|
903
|
-
async function k$1(
|
|
904
|
-
const e =
|
|
905
|
-
let n,
|
|
906
|
-
return e.state === "opened" ? (n = e,
|
|
903
|
+
async function k$1(i, s2, t = true) {
|
|
904
|
+
const e = m.call(this, i);
|
|
905
|
+
let n, r;
|
|
906
|
+
return e.state === "opened" ? (n = e, r = await $.call(this, e.id, s2)) : (r = $.call(this, false, s2), n = x.call(this, e, s2, false), await Promise.all([n, r])), t && p.call(this), { opened: n, closed: r };
|
|
907
907
|
}
|
|
908
|
-
async function V(
|
|
909
|
-
await
|
|
908
|
+
async function V$1(i, s2 = {}) {
|
|
909
|
+
await E.call(this, i, false);
|
|
910
910
|
const t = this, e = {
|
|
911
|
-
id:
|
|
911
|
+
id: i.id,
|
|
912
912
|
state: "closed",
|
|
913
|
-
el:
|
|
913
|
+
el: i,
|
|
914
914
|
dialog: null,
|
|
915
915
|
get required() {
|
|
916
916
|
return this.dialog.matches(this.getSetting("selectorRequired"));
|
|
917
917
|
},
|
|
918
918
|
returnRef: null,
|
|
919
|
-
settings: { ...N$1(
|
|
920
|
-
open(
|
|
921
|
-
return x.call(t, this,
|
|
919
|
+
settings: { ...N$1(i, this.settings.dataConfig), ...s2 },
|
|
920
|
+
open(r, l2) {
|
|
921
|
+
return x.call(t, this, r, l2);
|
|
922
922
|
},
|
|
923
|
-
close(
|
|
924
|
-
return C.call(t, this,
|
|
923
|
+
close(r, l2) {
|
|
924
|
+
return C.call(t, this, r, l2);
|
|
925
925
|
},
|
|
926
|
-
replace(
|
|
927
|
-
return k$1.call(t, this,
|
|
926
|
+
replace(r, l2) {
|
|
927
|
+
return k$1.call(t, this, r, l2);
|
|
928
928
|
},
|
|
929
929
|
deregister() {
|
|
930
|
-
return
|
|
930
|
+
return E.call(t, this);
|
|
931
931
|
},
|
|
932
|
-
teleport(
|
|
933
|
-
return this.returnRef ? (console.error("Element has already been teleported:", this.el), false) : (this.returnRef =
|
|
932
|
+
teleport(r = this.getSetting("teleport"), l2 = this.getSetting("teleportMethod")) {
|
|
933
|
+
return this.returnRef ? (console.error("Element has already been teleported:", this.el), false) : (this.returnRef = T$1(this.el, r, l2), this.el);
|
|
934
934
|
},
|
|
935
935
|
teleportReturn() {
|
|
936
|
-
return this.returnRef ? (this.returnRef =
|
|
936
|
+
return this.returnRef ? (this.returnRef = T$1(this.el, this.returnRef), this.el) : (console.error("No return reference found:", this.el), false);
|
|
937
937
|
},
|
|
938
|
-
getSetting(
|
|
939
|
-
return
|
|
938
|
+
getSetting(r) {
|
|
939
|
+
return r in this.settings ? this.settings[r] : t.settings[r];
|
|
940
940
|
}
|
|
941
|
-
}, n =
|
|
942
|
-
return e.dialog = n ||
|
|
941
|
+
}, n = i.querySelector(e.getSetting("selectorDialog"));
|
|
942
|
+
return e.dialog = n || i, e.dialog.setAttribute("aria-modal", "true"), e.dialog.hasAttribute("role") || e.dialog.setAttribute("role", "dialog"), e.getSetting("setTabindex") && e.dialog.setAttribute("tabindex", "-1"), e.getSetting("teleport") && e.teleport(), this.collection.push(e), e.el.classList.contains(this.settings.stateOpened) ? await e.open(false) : (e.el.classList.remove(this.settings.stateOpening), e.el.classList.remove(this.settings.stateClosing), e.el.classList.add(this.settings.stateClosed)), e;
|
|
943
943
|
}
|
|
944
|
-
function q(
|
|
945
|
-
const
|
|
944
|
+
function q(i) {
|
|
945
|
+
const s2 = [];
|
|
946
946
|
return {
|
|
947
947
|
get value() {
|
|
948
|
-
return [...
|
|
948
|
+
return [...s2];
|
|
949
949
|
},
|
|
950
950
|
get top() {
|
|
951
|
-
return
|
|
951
|
+
return s2[s2.length - 1];
|
|
952
952
|
},
|
|
953
953
|
updateIndex() {
|
|
954
|
-
|
|
954
|
+
s2.forEach((t, e) => {
|
|
955
955
|
t.el.style.zIndex = null;
|
|
956
956
|
const n = getComputedStyle(t.el)["z-index"];
|
|
957
957
|
t.el.style.zIndex = parseInt(n) + e + 1;
|
|
958
958
|
});
|
|
959
959
|
},
|
|
960
960
|
updateGlobalState() {
|
|
961
|
-
W(this.top,
|
|
961
|
+
W(this.top, i), this.updateIndex();
|
|
962
962
|
},
|
|
963
963
|
add(t) {
|
|
964
964
|
t.el.style.zIndex = null;
|
|
965
965
|
const e = getComputedStyle(t.el)["z-index"];
|
|
966
|
-
t.el.style.zIndex = parseInt(e) +
|
|
966
|
+
t.el.style.zIndex = parseInt(e) + s2.length + 1, s2.push(t), this.updateGlobalState();
|
|
967
967
|
},
|
|
968
968
|
remove(t) {
|
|
969
|
-
const e =
|
|
970
|
-
e >= 0 && (t.el.style.zIndex = null,
|
|
969
|
+
const e = s2.findIndex((n) => n.id === t.id);
|
|
970
|
+
e >= 0 && (t.el.style.zIndex = null, s2.splice(e, 1), this.updateGlobalState());
|
|
971
971
|
},
|
|
972
972
|
moveToTop(t) {
|
|
973
|
-
const e =
|
|
974
|
-
e >= 0 && (
|
|
973
|
+
const e = s2.findIndex((n) => n.id === t.id);
|
|
974
|
+
e >= 0 && (s2.splice(e, 1), this.add(t));
|
|
975
975
|
}
|
|
976
976
|
};
|
|
977
977
|
}
|
|
@@ -979,34 +979,34 @@ var u, h;
|
|
|
979
979
|
let J$1 = class J extends O {
|
|
980
980
|
constructor(t) {
|
|
981
981
|
super();
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
this.defaults = _$1, this.settings = { ...this.defaults, ...t }, this.trigger = null, this.focusTrap = new
|
|
982
|
+
v(this, u, void 0);
|
|
983
|
+
v(this, h, void 0);
|
|
984
|
+
this.defaults = _$1, this.settings = { ...this.defaults, ...t }, this.trigger = null, this.focusTrap = new A2(), this.stack = q(this.settings), b(this, u, G.bind(this)), b(this, h, K$1.bind(this)), this.settings.autoMount && this.mount();
|
|
985
985
|
}
|
|
986
986
|
get active() {
|
|
987
987
|
return this.stack.top;
|
|
988
988
|
}
|
|
989
|
-
async
|
|
989
|
+
async mount(t) {
|
|
990
990
|
t && (this.settings = { ...this.settings, ...t });
|
|
991
991
|
const e = document.querySelectorAll(this.settings.selectorModal);
|
|
992
|
-
return await this.registerCollection(e), this.settings.eventListeners && this.
|
|
992
|
+
return await this.registerCollection(e), this.settings.eventListeners && this.mountEventListeners(), this;
|
|
993
993
|
}
|
|
994
|
-
async
|
|
995
|
-
return this.trigger = null, await this.deregisterCollection(), this.settings.eventListeners && this.
|
|
994
|
+
async unmount() {
|
|
995
|
+
return this.trigger = null, await this.deregisterCollection(), this.settings.eventListeners && this.unmountEventListeners(), this;
|
|
996
996
|
}
|
|
997
|
-
|
|
997
|
+
mountEventListeners() {
|
|
998
998
|
document.addEventListener("click", f(this, u), false), document.addEventListener("keydown", f(this, h), false);
|
|
999
999
|
}
|
|
1000
|
-
|
|
1000
|
+
unmountEventListeners() {
|
|
1001
1001
|
document.removeEventListener("click", f(this, u), false), document.removeEventListener("keydown", f(this, h), false);
|
|
1002
1002
|
}
|
|
1003
1003
|
register(t, e = {}) {
|
|
1004
1004
|
let n = typeof t == "string" ? document.getElementById(t) : t;
|
|
1005
|
-
return n ? V.call(this, n, e) : Promise.reject(new Error(`Failed to register; modal not found with ID of: "${t.id || t}".`));
|
|
1005
|
+
return n ? V$1.call(this, n, e) : Promise.reject(new Error(`Failed to register; modal not found with ID of: "${t.id || t}".`));
|
|
1006
1006
|
}
|
|
1007
1007
|
deregister(t) {
|
|
1008
1008
|
let e = this.get(t.id || t);
|
|
1009
|
-
return e ?
|
|
1009
|
+
return e ? E.call(this, e) : Promise.reject(new Error(`Failed to deregister; modal does not exist in collection with ID of: "${t.id || t}".`));
|
|
1010
1010
|
}
|
|
1011
1011
|
open(t, e, n) {
|
|
1012
1012
|
return x.call(this, t, e, n);
|
|
@@ -1018,20 +1018,20 @@ let J$1 = class J extends O {
|
|
|
1018
1018
|
return k$1.call(this, t, e, n);
|
|
1019
1019
|
}
|
|
1020
1020
|
async closeAll(t = false, e, n = true) {
|
|
1021
|
-
const
|
|
1022
|
-
return n && p.call(this),
|
|
1021
|
+
const r = await $.call(this, t, e);
|
|
1022
|
+
return n && p.call(this), r;
|
|
1023
1023
|
}
|
|
1024
1024
|
};
|
|
1025
1025
|
u = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap();
|
|
1026
|
-
var Ue = (e, t,
|
|
1026
|
+
var Ue = (e, t, r) => {
|
|
1027
1027
|
if (!t.has(e))
|
|
1028
|
-
throw TypeError("Cannot " +
|
|
1028
|
+
throw TypeError("Cannot " + r);
|
|
1029
1029
|
};
|
|
1030
|
-
var Ae = (e, t,
|
|
1030
|
+
var Ae = (e, t, r) => (Ue(e, t, "read from private field"), r ? r.call(e) : t.get(e)), _e = (e, t, r) => {
|
|
1031
1031
|
if (t.has(e))
|
|
1032
1032
|
throw TypeError("Cannot add the same private member more than once");
|
|
1033
|
-
t instanceof WeakSet ? t.add(e) : t.set(e,
|
|
1034
|
-
}, Ke = (e, t,
|
|
1033
|
+
t instanceof WeakSet ? t.add(e) : t.set(e, r);
|
|
1034
|
+
}, Ke = (e, t, r, i) => (Ue(e, t, "write to private field"), i ? i.call(e, r) : t.set(e, r), r);
|
|
1035
1035
|
class $t {
|
|
1036
1036
|
constructor() {
|
|
1037
1037
|
this.collection = [];
|
|
@@ -1040,18 +1040,18 @@ class $t {
|
|
|
1040
1040
|
return await this.deregister(t), this.collection.push(t), this.collection;
|
|
1041
1041
|
}
|
|
1042
1042
|
async deregister(t) {
|
|
1043
|
-
const
|
|
1044
|
-
if (
|
|
1045
|
-
const
|
|
1046
|
-
Object.getOwnPropertyNames(
|
|
1047
|
-
delete
|
|
1048
|
-
}), this.collection.splice(
|
|
1043
|
+
const r = this.collection.findIndex((i) => i === t);
|
|
1044
|
+
if (r >= 0) {
|
|
1045
|
+
const i = this.collection[r];
|
|
1046
|
+
Object.getOwnPropertyNames(i).forEach((n) => {
|
|
1047
|
+
delete i[n];
|
|
1048
|
+
}), this.collection.splice(r, 1);
|
|
1049
1049
|
}
|
|
1050
1050
|
return this.collection;
|
|
1051
1051
|
}
|
|
1052
1052
|
async registerCollection(t) {
|
|
1053
|
-
return await Promise.all(Array.from(t, (
|
|
1054
|
-
this.register(
|
|
1053
|
+
return await Promise.all(Array.from(t, (r) => {
|
|
1054
|
+
this.register(r);
|
|
1055
1055
|
})), this.collection;
|
|
1056
1056
|
}
|
|
1057
1057
|
async deregisterCollection() {
|
|
@@ -1059,15 +1059,15 @@ class $t {
|
|
|
1059
1059
|
await this.deregister(this.collection[0]);
|
|
1060
1060
|
return this.collection;
|
|
1061
1061
|
}
|
|
1062
|
-
get(t,
|
|
1063
|
-
return this.collection.find((
|
|
1062
|
+
get(t, r = "id") {
|
|
1063
|
+
return this.collection.find((i) => i[r] === t);
|
|
1064
1064
|
}
|
|
1065
1065
|
}
|
|
1066
1066
|
function Ct() {
|
|
1067
|
-
return getComputedStyle(document.body).getPropertyValue("--
|
|
1067
|
+
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
1068
1068
|
}
|
|
1069
1069
|
const kt = {
|
|
1070
|
-
|
|
1070
|
+
autoMount: false,
|
|
1071
1071
|
// Selectors
|
|
1072
1072
|
selectorPopover: ".popover",
|
|
1073
1073
|
selectorArrow: ".popover__arrow",
|
|
@@ -1079,7 +1079,7 @@ const kt = {
|
|
|
1079
1079
|
placement: "bottom"
|
|
1080
1080
|
};
|
|
1081
1081
|
function ot(e, t) {
|
|
1082
|
-
const
|
|
1082
|
+
const r = getComputedStyle(e), i = {
|
|
1083
1083
|
placement: t.placement,
|
|
1084
1084
|
event: t.eventType,
|
|
1085
1085
|
offset: 0,
|
|
@@ -1088,43 +1088,43 @@ function ot(e, t) {
|
|
|
1088
1088
|
"arrow-element": t.selectorArrow,
|
|
1089
1089
|
"arrow-padding": 0
|
|
1090
1090
|
};
|
|
1091
|
-
for (const n in
|
|
1092
|
-
const o2 = Ct(), l2 =
|
|
1093
|
-
l2 && (
|
|
1091
|
+
for (const n in i) {
|
|
1092
|
+
const o2 = Ct(), l2 = r.getPropertyValue(`--${o2}popover-${n}`).trim();
|
|
1093
|
+
l2 && (i[n] = l2);
|
|
1094
1094
|
}
|
|
1095
|
-
return
|
|
1095
|
+
return i;
|
|
1096
1096
|
}
|
|
1097
1097
|
function Pe(e) {
|
|
1098
1098
|
let t;
|
|
1099
|
-
const
|
|
1100
|
-
switch (
|
|
1101
|
-
|
|
1102
|
-
}),
|
|
1099
|
+
const r = typeof e == "string" ? e.trim().split(" ") : [e];
|
|
1100
|
+
switch (r.forEach(function(i, n) {
|
|
1101
|
+
r[n] = parseInt(i, 10);
|
|
1102
|
+
}), r.length) {
|
|
1103
1103
|
case 1:
|
|
1104
|
-
t =
|
|
1104
|
+
t = r[0];
|
|
1105
1105
|
break;
|
|
1106
1106
|
case 2:
|
|
1107
1107
|
t = {
|
|
1108
|
-
top:
|
|
1109
|
-
right:
|
|
1110
|
-
bottom:
|
|
1111
|
-
left:
|
|
1108
|
+
top: r[0],
|
|
1109
|
+
right: r[1],
|
|
1110
|
+
bottom: r[0],
|
|
1111
|
+
left: r[1]
|
|
1112
1112
|
};
|
|
1113
1113
|
break;
|
|
1114
1114
|
case 3:
|
|
1115
1115
|
t = {
|
|
1116
|
-
top:
|
|
1117
|
-
right:
|
|
1118
|
-
bottom:
|
|
1119
|
-
left:
|
|
1116
|
+
top: r[0],
|
|
1117
|
+
right: r[1],
|
|
1118
|
+
bottom: r[2],
|
|
1119
|
+
left: r[1]
|
|
1120
1120
|
};
|
|
1121
1121
|
break;
|
|
1122
1122
|
case 4:
|
|
1123
1123
|
t = {
|
|
1124
|
-
top:
|
|
1125
|
-
right:
|
|
1126
|
-
bottom:
|
|
1127
|
-
left:
|
|
1124
|
+
top: r[0],
|
|
1125
|
+
right: r[1],
|
|
1126
|
+
bottom: r[2],
|
|
1127
|
+
left: r[3]
|
|
1128
1128
|
};
|
|
1129
1129
|
break;
|
|
1130
1130
|
default:
|
|
@@ -1169,8 +1169,8 @@ function Rt(e) {
|
|
|
1169
1169
|
function Bt(e) {
|
|
1170
1170
|
const t = Rt.call(this, e);
|
|
1171
1171
|
if (t) {
|
|
1172
|
-
const
|
|
1173
|
-
return !
|
|
1172
|
+
const r = document.querySelector(`#${t}`), i = document.querySelector(`[aria-controls="${t}"]`) || document.querySelector(`[aria-describedby="${t}"]`);
|
|
1173
|
+
return !i && !r ? { error: new Error(`No popover elements found using the ID: "${t}".`) } : i ? r ? { popover: r, trigger: i } : { error: new Error("No popover associated with the provided popover trigger.") } : { error: new Error("No popover trigger associated with the provided popover.") };
|
|
1174
1174
|
} else
|
|
1175
1175
|
return { error: new Error("Could not resolve the popover ID.") };
|
|
1176
1176
|
}
|
|
@@ -1188,10 +1188,10 @@ async function st2() {
|
|
|
1188
1188
|
}
|
|
1189
1189
|
function ct(e) {
|
|
1190
1190
|
e.state == "opened" && setTimeout(() => {
|
|
1191
|
-
const t = e.el.closest(":hover") === e.el || e.trigger.closest(":hover") === e.trigger,
|
|
1191
|
+
const t = e.el.closest(":hover") === e.el || e.trigger.closest(":hover") === e.trigger, r = document.activeElement.closest(
|
|
1192
1192
|
`#${e.id}, [aria-controls="${e.id}"], [aria-describedby="${e.id}"]`
|
|
1193
1193
|
);
|
|
1194
|
-
return !t && !
|
|
1194
|
+
return !t && !r && e.close(), e;
|
|
1195
1195
|
}, 1);
|
|
1196
1196
|
}
|
|
1197
1197
|
function Tt(e) {
|
|
@@ -1213,17 +1213,17 @@ function St(e) {
|
|
|
1213
1213
|
}
|
|
1214
1214
|
function lt(e) {
|
|
1215
1215
|
const t = this;
|
|
1216
|
-
document.addEventListener("click", function
|
|
1217
|
-
|
|
1216
|
+
document.addEventListener("click", function r(i) {
|
|
1217
|
+
i.target.closest(
|
|
1218
1218
|
`#${e.id}, [aria-controls="${e.id}"], [aria-describedby="${e.id}"]`
|
|
1219
|
-
) ? e.el && !e.el.classList.contains(t.settings.stateActive) && this.removeEventListener("click",
|
|
1219
|
+
) ? e.el && !e.el.classList.contains(t.settings.stateActive) && this.removeEventListener("click", r) : (e.el && e.el.classList.contains(t.settings.stateActive) && e.close(), this.removeEventListener("click", r));
|
|
1220
1220
|
});
|
|
1221
1221
|
}
|
|
1222
|
-
var k = "top", S2 = "bottom",
|
|
1222
|
+
var k = "top", S2 = "bottom", M = "right", D = "left", De = "auto", le = [k, S2, M, D], Q = "start", se = "end", Mt = "clippingParents", ft = "viewport", ne = "popper", jt = "reference", Ge = /* @__PURE__ */ le.reduce(function(e, t) {
|
|
1223
1223
|
return e.concat([t + "-" + Q, t + "-" + se]);
|
|
1224
1224
|
}, []), ut = /* @__PURE__ */ [].concat(le, [De]).reduce(function(e, t) {
|
|
1225
1225
|
return e.concat([t, t + "-" + Q, t + "-" + se]);
|
|
1226
|
-
}, []), Wt = "beforeRead", Ht = "read", Nt = "afterRead",
|
|
1226
|
+
}, []), Wt = "beforeRead", Ht = "read", Nt = "afterRead", Vt = "beforeMain", It = "main", Ft = "afterMain", Xt = "beforeWrite", Yt = "write", qt = "afterWrite", zt = [Wt, Ht, Nt, Vt, It, Ft, Xt, Yt, qt];
|
|
1227
1227
|
function N(e) {
|
|
1228
1228
|
return e ? (e.nodeName || "").toLowerCase() : null;
|
|
1229
1229
|
}
|
|
@@ -1252,16 +1252,16 @@ function Re(e) {
|
|
|
1252
1252
|
}
|
|
1253
1253
|
function Ut(e) {
|
|
1254
1254
|
var t = e.state;
|
|
1255
|
-
Object.keys(t.elements).forEach(function(
|
|
1256
|
-
var
|
|
1257
|
-
!T(o2) || !N(o2) || (Object.assign(o2.style,
|
|
1258
|
-
var
|
|
1259
|
-
|
|
1255
|
+
Object.keys(t.elements).forEach(function(r) {
|
|
1256
|
+
var i = t.styles[r] || {}, n = t.attributes[r] || {}, o2 = t.elements[r];
|
|
1257
|
+
!T(o2) || !N(o2) || (Object.assign(o2.style, i), Object.keys(n).forEach(function(l2) {
|
|
1258
|
+
var s2 = n[l2];
|
|
1259
|
+
s2 === false ? o2.removeAttribute(l2) : o2.setAttribute(l2, s2 === true ? "" : s2);
|
|
1260
1260
|
}));
|
|
1261
1261
|
});
|
|
1262
1262
|
}
|
|
1263
1263
|
function _t(e) {
|
|
1264
|
-
var t = e.state,
|
|
1264
|
+
var t = e.state, r = {
|
|
1265
1265
|
popper: {
|
|
1266
1266
|
position: t.options.strategy,
|
|
1267
1267
|
left: "0",
|
|
@@ -1273,12 +1273,12 @@ function _t(e) {
|
|
|
1273
1273
|
},
|
|
1274
1274
|
reference: {}
|
|
1275
1275
|
};
|
|
1276
|
-
return Object.assign(t.elements.popper.style,
|
|
1277
|
-
Object.keys(t.elements).forEach(function(
|
|
1278
|
-
var n = t.elements[
|
|
1276
|
+
return Object.assign(t.elements.popper.style, r.popper), t.styles = r, t.elements.arrow && Object.assign(t.elements.arrow.style, r.arrow), function() {
|
|
1277
|
+
Object.keys(t.elements).forEach(function(i) {
|
|
1278
|
+
var n = t.elements[i], o2 = t.attributes[i] || {}, l2 = Object.keys(t.styles.hasOwnProperty(i) ? t.styles[i] : r[i]), s2 = l2.reduce(function(a2, f2) {
|
|
1279
1279
|
return a2[f2] = "", a2;
|
|
1280
1280
|
}, {});
|
|
1281
|
-
!T(n) || !N(n) || (Object.assign(n.style,
|
|
1281
|
+
!T(n) || !N(n) || (Object.assign(n.style, s2), Object.keys(o2).forEach(function(a2) {
|
|
1282
1282
|
n.removeAttribute(a2);
|
|
1283
1283
|
}));
|
|
1284
1284
|
});
|
|
@@ -1305,11 +1305,11 @@ function Le() {
|
|
|
1305
1305
|
function pt() {
|
|
1306
1306
|
return !/^((?!chrome|android).)*safari/i.test(Le());
|
|
1307
1307
|
}
|
|
1308
|
-
function ee(e, t,
|
|
1309
|
-
t === void 0 && (t = false),
|
|
1310
|
-
var
|
|
1311
|
-
t && T(e) && (n = e.offsetWidth > 0 && Z(
|
|
1312
|
-
var l2 = K(e) ? B(e) : window,
|
|
1308
|
+
function ee(e, t, r) {
|
|
1309
|
+
t === void 0 && (t = false), r === void 0 && (r = false);
|
|
1310
|
+
var i = e.getBoundingClientRect(), n = 1, o2 = 1;
|
|
1311
|
+
t && T(e) && (n = e.offsetWidth > 0 && Z(i.width) / e.offsetWidth || 1, o2 = e.offsetHeight > 0 && Z(i.height) / e.offsetHeight || 1);
|
|
1312
|
+
var l2 = K(e) ? B(e) : window, s2 = l2.visualViewport, a2 = !pt() && r, f2 = (i.left + (a2 && s2 ? s2.offsetLeft : 0)) / n, c2 = (i.top + (a2 && s2 ? s2.offsetTop : 0)) / o2, h2 = i.width / n, y2 = i.height / o2;
|
|
1313
1313
|
return {
|
|
1314
1314
|
width: h2,
|
|
1315
1315
|
height: y2,
|
|
@@ -1322,29 +1322,29 @@ function ee(e, t, r2) {
|
|
|
1322
1322
|
};
|
|
1323
1323
|
}
|
|
1324
1324
|
function Be(e) {
|
|
1325
|
-
var t = ee(e),
|
|
1326
|
-
return Math.abs(t.width -
|
|
1325
|
+
var t = ee(e), r = e.offsetWidth, i = e.offsetHeight;
|
|
1326
|
+
return Math.abs(t.width - r) <= 1 && (r = t.width), Math.abs(t.height - i) <= 1 && (i = t.height), {
|
|
1327
1327
|
x: e.offsetLeft,
|
|
1328
1328
|
y: e.offsetTop,
|
|
1329
|
-
width:
|
|
1330
|
-
height:
|
|
1329
|
+
width: r,
|
|
1330
|
+
height: i
|
|
1331
1331
|
};
|
|
1332
1332
|
}
|
|
1333
1333
|
function dt(e, t) {
|
|
1334
|
-
var
|
|
1334
|
+
var r = t.getRootNode && t.getRootNode();
|
|
1335
1335
|
if (e.contains(t))
|
|
1336
1336
|
return true;
|
|
1337
|
-
if (
|
|
1338
|
-
var
|
|
1337
|
+
if (r && Re(r)) {
|
|
1338
|
+
var i = t;
|
|
1339
1339
|
do {
|
|
1340
|
-
if (
|
|
1340
|
+
if (i && e.isSameNode(i))
|
|
1341
1341
|
return true;
|
|
1342
|
-
|
|
1343
|
-
} while (
|
|
1342
|
+
i = i.parentNode || i.host;
|
|
1343
|
+
} while (i);
|
|
1344
1344
|
}
|
|
1345
1345
|
return false;
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1347
|
+
function V(e) {
|
|
1348
1348
|
return B(e).getComputedStyle(e);
|
|
1349
1349
|
}
|
|
1350
1350
|
function Gt(e) {
|
|
@@ -1370,18 +1370,18 @@ function we(e) {
|
|
|
1370
1370
|
}
|
|
1371
1371
|
function Je(e) {
|
|
1372
1372
|
return !T(e) || // https://github.com/popperjs/popper-core/issues/837
|
|
1373
|
-
|
|
1373
|
+
V(e).position === "fixed" ? null : e.offsetParent;
|
|
1374
1374
|
}
|
|
1375
1375
|
function Jt(e) {
|
|
1376
|
-
var t = /firefox/i.test(Le()),
|
|
1377
|
-
if (
|
|
1378
|
-
var
|
|
1379
|
-
if (
|
|
1376
|
+
var t = /firefox/i.test(Le()), r = /Trident/i.test(Le());
|
|
1377
|
+
if (r && T(e)) {
|
|
1378
|
+
var i = V(e);
|
|
1379
|
+
if (i.position === "fixed")
|
|
1380
1380
|
return null;
|
|
1381
1381
|
}
|
|
1382
1382
|
var n = we(e);
|
|
1383
1383
|
for (Re(n) && (n = n.host); T(n) && ["html", "body"].indexOf(N(n)) < 0; ) {
|
|
1384
|
-
var o2 =
|
|
1384
|
+
var o2 = V(n);
|
|
1385
1385
|
if (o2.transform !== "none" || o2.perspective !== "none" || o2.contain === "paint" || ["transform", "perspective"].indexOf(o2.willChange) !== -1 || t && o2.willChange === "filter" || t && o2.filter && o2.filter !== "none")
|
|
1386
1386
|
return n;
|
|
1387
1387
|
n = n.parentNode;
|
|
@@ -1389,19 +1389,19 @@ function Jt(e) {
|
|
|
1389
1389
|
return null;
|
|
1390
1390
|
}
|
|
1391
1391
|
function fe(e) {
|
|
1392
|
-
for (var t = B(e),
|
|
1393
|
-
|
|
1394
|
-
return
|
|
1392
|
+
for (var t = B(e), r = Je(e); r && Gt(r) && V(r).position === "static"; )
|
|
1393
|
+
r = Je(r);
|
|
1394
|
+
return r && (N(r) === "html" || N(r) === "body" && V(r).position === "static") ? t : r || Jt(e) || t;
|
|
1395
1395
|
}
|
|
1396
1396
|
function Te(e) {
|
|
1397
1397
|
return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y";
|
|
1398
1398
|
}
|
|
1399
|
-
function oe(e, t,
|
|
1400
|
-
return _(e, ye(t,
|
|
1399
|
+
function oe(e, t, r) {
|
|
1400
|
+
return _(e, ye(t, r));
|
|
1401
1401
|
}
|
|
1402
|
-
function Qt(e, t,
|
|
1403
|
-
var
|
|
1404
|
-
return
|
|
1402
|
+
function Qt(e, t, r) {
|
|
1403
|
+
var i = oe(e, t, r);
|
|
1404
|
+
return i > r ? r : i;
|
|
1405
1405
|
}
|
|
1406
1406
|
function vt() {
|
|
1407
1407
|
return {
|
|
@@ -1415,24 +1415,24 @@ function ht(e) {
|
|
|
1415
1415
|
return Object.assign({}, vt(), e);
|
|
1416
1416
|
}
|
|
1417
1417
|
function gt(e, t) {
|
|
1418
|
-
return t.reduce(function(
|
|
1419
|
-
return
|
|
1418
|
+
return t.reduce(function(r, i) {
|
|
1419
|
+
return r[i] = e, r;
|
|
1420
1420
|
}, {});
|
|
1421
1421
|
}
|
|
1422
|
-
var Zt = function(t,
|
|
1423
|
-
return t = typeof t == "function" ? t(Object.assign({},
|
|
1424
|
-
placement:
|
|
1422
|
+
var Zt = function(t, r) {
|
|
1423
|
+
return t = typeof t == "function" ? t(Object.assign({}, r.rects, {
|
|
1424
|
+
placement: r.placement
|
|
1425
1425
|
})) : t, ht(typeof t != "number" ? t : gt(t, le));
|
|
1426
1426
|
};
|
|
1427
1427
|
function er(e) {
|
|
1428
|
-
var t,
|
|
1428
|
+
var t, r = e.state, i = e.name, n = e.options, o2 = r.elements.arrow, l2 = r.modifiersData.popperOffsets, s2 = H(r.placement), a2 = Te(s2), f2 = [D, M].indexOf(s2) >= 0, c2 = f2 ? "height" : "width";
|
|
1429
1429
|
if (!(!o2 || !l2)) {
|
|
1430
|
-
var h2 = Zt(n.padding,
|
|
1431
|
-
|
|
1430
|
+
var h2 = Zt(n.padding, r), y2 = Be(o2), u2 = a2 === "y" ? k : D, b2 = a2 === "y" ? S2 : M, v2 = r.rects.reference[c2] + r.rects.reference[a2] - l2[a2] - r.rects.popper[c2], d2 = l2[a2] - r.rects.reference[a2], w2 = fe(o2), O2 = w2 ? a2 === "y" ? w2.clientHeight || 0 : w2.clientWidth || 0 : 0, E2 = v2 / 2 - d2 / 2, p2 = h2[u2], g2 = O2 - y2[c2] - h2[b2], m2 = O2 / 2 - y2[c2] / 2 + E2, x2 = oe(p2, m2, g2), L3 = a2;
|
|
1431
|
+
r.modifiersData[i] = (t = {}, t[L3] = x2, t.centerOffset = x2 - m2, t);
|
|
1432
1432
|
}
|
|
1433
1433
|
}
|
|
1434
1434
|
function tr(e) {
|
|
1435
|
-
var t = e.state,
|
|
1435
|
+
var t = e.state, r = e.options, i = r.element, n = i === void 0 ? "[data-popper-arrow]" : i;
|
|
1436
1436
|
n != null && (typeof n == "string" && (n = t.elements.popper.querySelector(n), !n) || dt(t.elements.popper, n) && (t.elements.arrow = n));
|
|
1437
1437
|
}
|
|
1438
1438
|
const rr = {
|
|
@@ -1454,14 +1454,14 @@ var ir = {
|
|
|
1454
1454
|
left: "auto"
|
|
1455
1455
|
};
|
|
1456
1456
|
function nr(e, t) {
|
|
1457
|
-
var
|
|
1457
|
+
var r = e.x, i = e.y, n = t.devicePixelRatio || 1;
|
|
1458
1458
|
return {
|
|
1459
|
-
x: Z(
|
|
1460
|
-
y: Z(
|
|
1459
|
+
x: Z(r * n) / n || 0,
|
|
1460
|
+
y: Z(i * n) / n || 0
|
|
1461
1461
|
};
|
|
1462
1462
|
}
|
|
1463
1463
|
function Qe(e) {
|
|
1464
|
-
var t,
|
|
1464
|
+
var t, r = e.popper, i = e.popperRect, n = e.placement, o2 = e.variation, l2 = e.offsets, s2 = e.position, a2 = e.gpuAcceleration, f2 = e.adaptive, c2 = e.roundOffsets, h2 = e.isFixed, y2 = l2.x, u2 = y2 === void 0 ? 0 : y2, b2 = l2.y, v2 = b2 === void 0 ? 0 : b2, d2 = typeof c2 == "function" ? c2({
|
|
1465
1465
|
x: u2,
|
|
1466
1466
|
y: v2
|
|
1467
1467
|
}) : {
|
|
@@ -1471,41 +1471,41 @@ function Qe(e) {
|
|
|
1471
1471
|
u2 = d2.x, v2 = d2.y;
|
|
1472
1472
|
var w2 = l2.hasOwnProperty("x"), O2 = l2.hasOwnProperty("y"), E2 = D, p2 = k, g2 = window;
|
|
1473
1473
|
if (f2) {
|
|
1474
|
-
var m2 = fe(
|
|
1475
|
-
if (m2 === B(
|
|
1474
|
+
var m2 = fe(r), x2 = "clientHeight", L3 = "clientWidth";
|
|
1475
|
+
if (m2 === B(r) && (m2 = F(r), V(m2).position !== "static" && s2 === "absolute" && (x2 = "scrollHeight", L3 = "scrollWidth")), m2 = m2, n === k || (n === D || n === M) && o2 === se) {
|
|
1476
1476
|
p2 = S2;
|
|
1477
1477
|
var P3 = h2 && m2 === g2 && g2.visualViewport ? g2.visualViewport.height : (
|
|
1478
1478
|
// $FlowFixMe[prop-missing]
|
|
1479
1479
|
m2[x2]
|
|
1480
1480
|
);
|
|
1481
|
-
v2 -= P3 -
|
|
1481
|
+
v2 -= P3 - i.height, v2 *= a2 ? 1 : -1;
|
|
1482
1482
|
}
|
|
1483
1483
|
if (n === D || (n === k || n === S2) && o2 === se) {
|
|
1484
|
-
E2 =
|
|
1484
|
+
E2 = M;
|
|
1485
1485
|
var A3 = h2 && m2 === g2 && g2.visualViewport ? g2.visualViewport.width : (
|
|
1486
1486
|
// $FlowFixMe[prop-missing]
|
|
1487
1487
|
m2[L3]
|
|
1488
1488
|
);
|
|
1489
|
-
u2 -= A3 -
|
|
1489
|
+
u2 -= A3 - i.width, u2 *= a2 ? 1 : -1;
|
|
1490
1490
|
}
|
|
1491
1491
|
}
|
|
1492
1492
|
var $2 = Object.assign({
|
|
1493
|
-
position:
|
|
1494
|
-
}, f2 && ir),
|
|
1493
|
+
position: s2
|
|
1494
|
+
}, f2 && ir), j3 = c2 === true ? nr({
|
|
1495
1495
|
x: u2,
|
|
1496
1496
|
y: v2
|
|
1497
|
-
}, B(
|
|
1497
|
+
}, B(r)) : {
|
|
1498
1498
|
x: u2,
|
|
1499
1499
|
y: v2
|
|
1500
1500
|
};
|
|
1501
|
-
if (u2 =
|
|
1501
|
+
if (u2 = j3.x, v2 = j3.y, a2) {
|
|
1502
1502
|
var C2;
|
|
1503
1503
|
return Object.assign({}, $2, (C2 = {}, C2[p2] = O2 ? "0" : "", C2[E2] = w2 ? "0" : "", C2.transform = (g2.devicePixelRatio || 1) <= 1 ? "translate(" + u2 + "px, " + v2 + "px)" : "translate3d(" + u2 + "px, " + v2 + "px, 0)", C2));
|
|
1504
1504
|
}
|
|
1505
1505
|
return Object.assign({}, $2, (t = {}, t[p2] = O2 ? v2 + "px" : "", t[E2] = w2 ? u2 + "px" : "", t.transform = "", t));
|
|
1506
1506
|
}
|
|
1507
1507
|
function or(e) {
|
|
1508
|
-
var t = e.state,
|
|
1508
|
+
var t = e.state, r = e.options, i = r.gpuAcceleration, n = i === void 0 ? true : i, o2 = r.adaptive, l2 = o2 === void 0 ? true : o2, s2 = r.roundOffsets, a2 = s2 === void 0 ? true : s2, f2 = {
|
|
1509
1509
|
placement: H(t.placement),
|
|
1510
1510
|
variation: te(t.placement),
|
|
1511
1511
|
popper: t.elements.popper,
|
|
@@ -1538,13 +1538,13 @@ var ge = {
|
|
|
1538
1538
|
passive: true
|
|
1539
1539
|
};
|
|
1540
1540
|
function sr(e) {
|
|
1541
|
-
var t = e.state,
|
|
1541
|
+
var t = e.state, r = e.instance, i = e.options, n = i.scroll, o2 = n === void 0 ? true : n, l2 = i.resize, s2 = l2 === void 0 ? true : l2, a2 = B(t.elements.popper), f2 = [].concat(t.scrollParents.reference, t.scrollParents.popper);
|
|
1542
1542
|
return o2 && f2.forEach(function(c2) {
|
|
1543
|
-
c2.addEventListener("scroll",
|
|
1544
|
-
}),
|
|
1543
|
+
c2.addEventListener("scroll", r.update, ge);
|
|
1544
|
+
}), s2 && a2.addEventListener("resize", r.update, ge), function() {
|
|
1545
1545
|
o2 && f2.forEach(function(c2) {
|
|
1546
|
-
c2.removeEventListener("scroll",
|
|
1547
|
-
}),
|
|
1546
|
+
c2.removeEventListener("scroll", r.update, ge);
|
|
1547
|
+
}), s2 && a2.removeEventListener("resize", r.update, ge);
|
|
1548
1548
|
};
|
|
1549
1549
|
}
|
|
1550
1550
|
const cr = {
|
|
@@ -1577,52 +1577,52 @@ function Ze(e) {
|
|
|
1577
1577
|
});
|
|
1578
1578
|
}
|
|
1579
1579
|
function Se(e) {
|
|
1580
|
-
var t = B(e),
|
|
1580
|
+
var t = B(e), r = t.pageXOffset, i = t.pageYOffset;
|
|
1581
1581
|
return {
|
|
1582
|
-
scrollLeft:
|
|
1583
|
-
scrollTop:
|
|
1582
|
+
scrollLeft: r,
|
|
1583
|
+
scrollTop: i
|
|
1584
1584
|
};
|
|
1585
1585
|
}
|
|
1586
|
-
function
|
|
1586
|
+
function Me(e) {
|
|
1587
1587
|
return ee(F(e)).left + Se(e).scrollLeft;
|
|
1588
1588
|
}
|
|
1589
1589
|
function ur(e, t) {
|
|
1590
|
-
var
|
|
1590
|
+
var r = B(e), i = F(e), n = r.visualViewport, o2 = i.clientWidth, l2 = i.clientHeight, s2 = 0, a2 = 0;
|
|
1591
1591
|
if (n) {
|
|
1592
1592
|
o2 = n.width, l2 = n.height;
|
|
1593
1593
|
var f2 = pt();
|
|
1594
|
-
(f2 || !f2 && t === "fixed") && (
|
|
1594
|
+
(f2 || !f2 && t === "fixed") && (s2 = n.offsetLeft, a2 = n.offsetTop);
|
|
1595
1595
|
}
|
|
1596
1596
|
return {
|
|
1597
1597
|
width: o2,
|
|
1598
1598
|
height: l2,
|
|
1599
|
-
x:
|
|
1599
|
+
x: s2 + Me(e),
|
|
1600
1600
|
y: a2
|
|
1601
1601
|
};
|
|
1602
1602
|
}
|
|
1603
1603
|
function pr(e) {
|
|
1604
|
-
var t,
|
|
1605
|
-
return
|
|
1604
|
+
var t, r = F(e), i = Se(e), n = (t = e.ownerDocument) == null ? void 0 : t.body, o2 = _(r.scrollWidth, r.clientWidth, n ? n.scrollWidth : 0, n ? n.clientWidth : 0), l2 = _(r.scrollHeight, r.clientHeight, n ? n.scrollHeight : 0, n ? n.clientHeight : 0), s2 = -i.scrollLeft + Me(e), a2 = -i.scrollTop;
|
|
1605
|
+
return V(n || r).direction === "rtl" && (s2 += _(r.clientWidth, n ? n.clientWidth : 0) - o2), {
|
|
1606
1606
|
width: o2,
|
|
1607
1607
|
height: l2,
|
|
1608
|
-
x:
|
|
1608
|
+
x: s2,
|
|
1609
1609
|
y: a2
|
|
1610
1610
|
};
|
|
1611
1611
|
}
|
|
1612
|
-
function
|
|
1613
|
-
var t =
|
|
1614
|
-
return /auto|scroll|overlay|hidden/.test(
|
|
1612
|
+
function je(e) {
|
|
1613
|
+
var t = V(e), r = t.overflow, i = t.overflowX, n = t.overflowY;
|
|
1614
|
+
return /auto|scroll|overlay|hidden/.test(r + n + i);
|
|
1615
1615
|
}
|
|
1616
1616
|
function mt(e) {
|
|
1617
|
-
return ["html", "body", "#document"].indexOf(N(e)) >= 0 ? e.ownerDocument.body : T(e) &&
|
|
1617
|
+
return ["html", "body", "#document"].indexOf(N(e)) >= 0 ? e.ownerDocument.body : T(e) && je(e) ? e : mt(we(e));
|
|
1618
1618
|
}
|
|
1619
1619
|
function ae(e, t) {
|
|
1620
|
-
var
|
|
1620
|
+
var r;
|
|
1621
1621
|
t === void 0 && (t = []);
|
|
1622
|
-
var
|
|
1623
|
-
return n ?
|
|
1622
|
+
var i = mt(e), n = i === ((r = e.ownerDocument) == null ? void 0 : r.body), o2 = B(i), l2 = n ? [o2].concat(o2.visualViewport || [], je(i) ? i : []) : i, s2 = t.concat(l2);
|
|
1623
|
+
return n ? s2 : (
|
|
1624
1624
|
// $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
|
1625
|
-
|
|
1625
|
+
s2.concat(ae(we(l2)))
|
|
1626
1626
|
);
|
|
1627
1627
|
}
|
|
1628
1628
|
function $e(e) {
|
|
@@ -1634,32 +1634,32 @@ function $e(e) {
|
|
|
1634
1634
|
});
|
|
1635
1635
|
}
|
|
1636
1636
|
function dr(e, t) {
|
|
1637
|
-
var
|
|
1638
|
-
return
|
|
1637
|
+
var r = ee(e, false, t === "fixed");
|
|
1638
|
+
return r.top = r.top + e.clientTop, r.left = r.left + e.clientLeft, r.bottom = r.top + e.clientHeight, r.right = r.left + e.clientWidth, r.width = e.clientWidth, r.height = e.clientHeight, r.x = r.left, r.y = r.top, r;
|
|
1639
1639
|
}
|
|
1640
|
-
function et(e, t,
|
|
1641
|
-
return t === ft ? $e(ur(e,
|
|
1640
|
+
function et(e, t, r) {
|
|
1641
|
+
return t === ft ? $e(ur(e, r)) : K(t) ? dr(t, r) : $e(pr(F(e)));
|
|
1642
1642
|
}
|
|
1643
1643
|
function vr(e) {
|
|
1644
|
-
var t = ae(we(e)),
|
|
1645
|
-
return K(
|
|
1646
|
-
return K(n) && dt(n,
|
|
1644
|
+
var t = ae(we(e)), r = ["absolute", "fixed"].indexOf(V(e).position) >= 0, i = r && T(e) ? fe(e) : e;
|
|
1645
|
+
return K(i) ? t.filter(function(n) {
|
|
1646
|
+
return K(n) && dt(n, i) && N(n) !== "body";
|
|
1647
1647
|
}) : [];
|
|
1648
1648
|
}
|
|
1649
|
-
function hr(e, t,
|
|
1650
|
-
var n = t === "clippingParents" ? vr(e) : [].concat(t), o2 = [].concat(n, [
|
|
1651
|
-
var c2 = et(e, f2,
|
|
1649
|
+
function hr(e, t, r, i) {
|
|
1650
|
+
var n = t === "clippingParents" ? vr(e) : [].concat(t), o2 = [].concat(n, [r]), l2 = o2[0], s2 = o2.reduce(function(a2, f2) {
|
|
1651
|
+
var c2 = et(e, f2, i);
|
|
1652
1652
|
return a2.top = _(c2.top, a2.top), a2.right = ye(c2.right, a2.right), a2.bottom = ye(c2.bottom, a2.bottom), a2.left = _(c2.left, a2.left), a2;
|
|
1653
|
-
}, et(e, l2,
|
|
1654
|
-
return
|
|
1653
|
+
}, et(e, l2, i));
|
|
1654
|
+
return s2.width = s2.right - s2.left, s2.height = s2.bottom - s2.top, s2.x = s2.left, s2.y = s2.top, s2;
|
|
1655
1655
|
}
|
|
1656
1656
|
function yt(e) {
|
|
1657
|
-
var t = e.reference,
|
|
1657
|
+
var t = e.reference, r = e.element, i = e.placement, n = i ? H(i) : null, o2 = i ? te(i) : null, l2 = t.x + t.width / 2 - r.width / 2, s2 = t.y + t.height / 2 - r.height / 2, a2;
|
|
1658
1658
|
switch (n) {
|
|
1659
1659
|
case k:
|
|
1660
1660
|
a2 = {
|
|
1661
1661
|
x: l2,
|
|
1662
|
-
y: t.y -
|
|
1662
|
+
y: t.y - r.height
|
|
1663
1663
|
};
|
|
1664
1664
|
break;
|
|
1665
1665
|
case S2:
|
|
@@ -1668,16 +1668,16 @@ function yt(e) {
|
|
|
1668
1668
|
y: t.y + t.height
|
|
1669
1669
|
};
|
|
1670
1670
|
break;
|
|
1671
|
-
case
|
|
1671
|
+
case M:
|
|
1672
1672
|
a2 = {
|
|
1673
1673
|
x: t.x + t.width,
|
|
1674
|
-
y:
|
|
1674
|
+
y: s2
|
|
1675
1675
|
};
|
|
1676
1676
|
break;
|
|
1677
1677
|
case D:
|
|
1678
1678
|
a2 = {
|
|
1679
|
-
x: t.x -
|
|
1680
|
-
y:
|
|
1679
|
+
x: t.x - r.width,
|
|
1680
|
+
y: s2
|
|
1681
1681
|
};
|
|
1682
1682
|
break;
|
|
1683
1683
|
default:
|
|
@@ -1691,10 +1691,10 @@ function yt(e) {
|
|
|
1691
1691
|
var c2 = f2 === "y" ? "height" : "width";
|
|
1692
1692
|
switch (o2) {
|
|
1693
1693
|
case Q:
|
|
1694
|
-
a2[f2] = a2[f2] - (t[c2] / 2 -
|
|
1694
|
+
a2[f2] = a2[f2] - (t[c2] / 2 - r[c2] / 2);
|
|
1695
1695
|
break;
|
|
1696
1696
|
case se:
|
|
1697
|
-
a2[f2] = a2[f2] + (t[c2] / 2 -
|
|
1697
|
+
a2[f2] = a2[f2] + (t[c2] / 2 - r[c2] / 2);
|
|
1698
1698
|
break;
|
|
1699
1699
|
}
|
|
1700
1700
|
}
|
|
@@ -1702,7 +1702,7 @@ function yt(e) {
|
|
|
1702
1702
|
}
|
|
1703
1703
|
function ce(e, t) {
|
|
1704
1704
|
t === void 0 && (t = {});
|
|
1705
|
-
var
|
|
1705
|
+
var r = t, i = r.placement, n = i === void 0 ? e.placement : i, o2 = r.strategy, l2 = o2 === void 0 ? e.strategy : o2, s2 = r.boundary, a2 = s2 === void 0 ? Mt : s2, f2 = r.rootBoundary, c2 = f2 === void 0 ? ft : f2, h2 = r.elementContext, y2 = h2 === void 0 ? ne : h2, u2 = r.altBoundary, b2 = u2 === void 0 ? false : u2, v2 = r.padding, d2 = v2 === void 0 ? 0 : v2, w2 = ht(typeof d2 != "number" ? d2 : gt(d2, le)), O2 = y2 === ne ? jt : ne, E2 = e.rects.popper, p2 = e.elements[b2 ? O2 : y2], g2 = hr(K(p2) ? p2 : p2.contextElement || F(e.elements.popper), a2, c2, l2), m2 = ee(e.elements.reference), x2 = yt({
|
|
1706
1706
|
reference: m2,
|
|
1707
1707
|
element: E2,
|
|
1708
1708
|
strategy: "absolute",
|
|
@@ -1714,17 +1714,17 @@ function ce(e, t) {
|
|
|
1714
1714
|
right: P3.right - g2.right + w2.right
|
|
1715
1715
|
}, $2 = e.modifiersData.offset;
|
|
1716
1716
|
if (y2 === ne && $2) {
|
|
1717
|
-
var
|
|
1717
|
+
var j3 = $2[n];
|
|
1718
1718
|
Object.keys(A3).forEach(function(C2) {
|
|
1719
|
-
var X2 = [
|
|
1720
|
-
A3[C2] +=
|
|
1719
|
+
var X2 = [M, S2].indexOf(C2) >= 0 ? 1 : -1, Y2 = [k, S2].indexOf(C2) >= 0 ? "y" : "x";
|
|
1720
|
+
A3[C2] += j3[Y2] * X2;
|
|
1721
1721
|
});
|
|
1722
1722
|
}
|
|
1723
1723
|
return A3;
|
|
1724
1724
|
}
|
|
1725
1725
|
function gr(e, t) {
|
|
1726
1726
|
t === void 0 && (t = {});
|
|
1727
|
-
var
|
|
1727
|
+
var r = t, i = r.placement, n = r.boundary, o2 = r.rootBoundary, l2 = r.padding, s2 = r.flipVariations, a2 = r.allowedAutoPlacements, f2 = a2 === void 0 ? ut : a2, c2 = te(i), h2 = c2 ? s2 ? Ge : Ge.filter(function(b2) {
|
|
1728
1728
|
return te(b2) === c2;
|
|
1729
1729
|
}) : le, y2 = h2.filter(function(b2) {
|
|
1730
1730
|
return f2.indexOf(b2) >= 0;
|
|
@@ -1749,28 +1749,28 @@ function mr(e) {
|
|
|
1749
1749
|
return [Ze(e), t, Ze(t)];
|
|
1750
1750
|
}
|
|
1751
1751
|
function yr(e) {
|
|
1752
|
-
var t = e.state,
|
|
1753
|
-
if (!t.modifiersData[
|
|
1754
|
-
for (var n =
|
|
1755
|
-
return G2.concat(H(
|
|
1756
|
-
placement:
|
|
1752
|
+
var t = e.state, r = e.options, i = e.name;
|
|
1753
|
+
if (!t.modifiersData[i]._skip) {
|
|
1754
|
+
for (var n = r.mainAxis, o2 = n === void 0 ? true : n, l2 = r.altAxis, s2 = l2 === void 0 ? true : l2, a2 = r.fallbackPlacements, f2 = r.padding, c2 = r.boundary, h2 = r.rootBoundary, y2 = r.altBoundary, u2 = r.flipVariations, b2 = u2 === void 0 ? true : u2, v2 = r.allowedAutoPlacements, d2 = t.options.placement, w2 = H(d2), O2 = w2 === d2, E2 = a2 || (O2 || !b2 ? [me(d2)] : mr(d2)), p2 = [d2].concat(E2).reduce(function(G2, I3) {
|
|
1755
|
+
return G2.concat(H(I3) === De ? gr(t, {
|
|
1756
|
+
placement: I3,
|
|
1757
1757
|
boundary: c2,
|
|
1758
1758
|
rootBoundary: h2,
|
|
1759
1759
|
padding: f2,
|
|
1760
1760
|
flipVariations: b2,
|
|
1761
1761
|
allowedAutoPlacements: v2
|
|
1762
|
-
}) :
|
|
1762
|
+
}) : I3);
|
|
1763
1763
|
}, []), g2 = t.rects.reference, m2 = t.rects.popper, x2 = /* @__PURE__ */ new Map(), L3 = true, P3 = p2[0], A3 = 0; A3 < p2.length; A3++) {
|
|
1764
|
-
var $2 = p2[A3],
|
|
1764
|
+
var $2 = p2[A3], j3 = H($2), C2 = te($2) === Q, X2 = [k, S2].indexOf(j3) >= 0, Y2 = X2 ? "width" : "height", R2 = ce(t, {
|
|
1765
1765
|
placement: $2,
|
|
1766
1766
|
boundary: c2,
|
|
1767
1767
|
rootBoundary: h2,
|
|
1768
1768
|
altBoundary: y2,
|
|
1769
1769
|
padding: f2
|
|
1770
|
-
}), W2 = X2 ? C2 ?
|
|
1770
|
+
}), W2 = X2 ? C2 ? M : D : C2 ? S2 : k;
|
|
1771
1771
|
g2[Y2] > m2[Y2] && (W2 = me(W2));
|
|
1772
1772
|
var ue = me(W2), q2 = [];
|
|
1773
|
-
if (o2 && q2.push(R2[
|
|
1773
|
+
if (o2 && q2.push(R2[j3] <= 0), s2 && q2.push(R2[W2] <= 0, R2[ue] <= 0), q2.every(function(G2) {
|
|
1774
1774
|
return G2;
|
|
1775
1775
|
})) {
|
|
1776
1776
|
P3 = $2, L3 = false;
|
|
@@ -1779,11 +1779,11 @@ function yr(e) {
|
|
|
1779
1779
|
x2.set($2, q2);
|
|
1780
1780
|
}
|
|
1781
1781
|
if (L3)
|
|
1782
|
-
for (var pe = b2 ? 3 : 1, be = function(
|
|
1782
|
+
for (var pe = b2 ? 3 : 1, be = function(I3) {
|
|
1783
1783
|
var ie = p2.find(function(ve) {
|
|
1784
1784
|
var z2 = x2.get(ve);
|
|
1785
1785
|
if (z2)
|
|
1786
|
-
return z2.slice(0,
|
|
1786
|
+
return z2.slice(0, I3).every(function(xe) {
|
|
1787
1787
|
return xe;
|
|
1788
1788
|
});
|
|
1789
1789
|
});
|
|
@@ -1794,7 +1794,7 @@ function yr(e) {
|
|
|
1794
1794
|
if (de === "break")
|
|
1795
1795
|
break;
|
|
1796
1796
|
}
|
|
1797
|
-
t.placement !== P3 && (t.modifiersData[
|
|
1797
|
+
t.placement !== P3 && (t.modifiersData[i]._skip = true, t.placement = P3, t.reset = true);
|
|
1798
1798
|
}
|
|
1799
1799
|
}
|
|
1800
1800
|
const wr = {
|
|
@@ -1807,29 +1807,29 @@ const wr = {
|
|
|
1807
1807
|
_skip: false
|
|
1808
1808
|
}
|
|
1809
1809
|
};
|
|
1810
|
-
function tt(e, t,
|
|
1811
|
-
return
|
|
1810
|
+
function tt(e, t, r) {
|
|
1811
|
+
return r === void 0 && (r = {
|
|
1812
1812
|
x: 0,
|
|
1813
1813
|
y: 0
|
|
1814
1814
|
}), {
|
|
1815
|
-
top: e.top - t.height -
|
|
1816
|
-
right: e.right - t.width +
|
|
1817
|
-
bottom: e.bottom - t.height +
|
|
1818
|
-
left: e.left - t.width -
|
|
1815
|
+
top: e.top - t.height - r.y,
|
|
1816
|
+
right: e.right - t.width + r.x,
|
|
1817
|
+
bottom: e.bottom - t.height + r.y,
|
|
1818
|
+
left: e.left - t.width - r.x
|
|
1819
1819
|
};
|
|
1820
1820
|
}
|
|
1821
1821
|
function rt(e) {
|
|
1822
|
-
return [k,
|
|
1822
|
+
return [k, M, S2, D].some(function(t) {
|
|
1823
1823
|
return e[t] >= 0;
|
|
1824
1824
|
});
|
|
1825
1825
|
}
|
|
1826
1826
|
function br(e) {
|
|
1827
|
-
var t = e.state,
|
|
1827
|
+
var t = e.state, r = e.name, i = t.rects.reference, n = t.rects.popper, o2 = t.modifiersData.preventOverflow, l2 = ce(t, {
|
|
1828
1828
|
elementContext: "reference"
|
|
1829
|
-
}),
|
|
1829
|
+
}), s2 = ce(t, {
|
|
1830
1830
|
altBoundary: true
|
|
1831
|
-
}), a2 = tt(l2,
|
|
1832
|
-
t.modifiersData[
|
|
1831
|
+
}), a2 = tt(l2, i), f2 = tt(s2, n, o2), c2 = rt(a2), h2 = rt(f2);
|
|
1832
|
+
t.modifiersData[r] = {
|
|
1833
1833
|
referenceClippingOffsets: a2,
|
|
1834
1834
|
popperEscapeOffsets: f2,
|
|
1835
1835
|
isReferenceHidden: c2,
|
|
@@ -1846,23 +1846,23 @@ const xr = {
|
|
|
1846
1846
|
requiresIfExists: ["preventOverflow"],
|
|
1847
1847
|
fn: br
|
|
1848
1848
|
};
|
|
1849
|
-
function Or(e, t,
|
|
1850
|
-
var
|
|
1849
|
+
function Or(e, t, r) {
|
|
1850
|
+
var i = H(e), n = [D, k].indexOf(i) >= 0 ? -1 : 1, o2 = typeof r == "function" ? r(Object.assign({}, t, {
|
|
1851
1851
|
placement: e
|
|
1852
|
-
})) :
|
|
1853
|
-
return l2 = l2 || 0,
|
|
1854
|
-
x:
|
|
1852
|
+
})) : r, l2 = o2[0], s2 = o2[1];
|
|
1853
|
+
return l2 = l2 || 0, s2 = (s2 || 0) * n, [D, M].indexOf(i) >= 0 ? {
|
|
1854
|
+
x: s2,
|
|
1855
1855
|
y: l2
|
|
1856
1856
|
} : {
|
|
1857
1857
|
x: l2,
|
|
1858
|
-
y:
|
|
1858
|
+
y: s2
|
|
1859
1859
|
};
|
|
1860
1860
|
}
|
|
1861
1861
|
function Er(e) {
|
|
1862
|
-
var t = e.state,
|
|
1862
|
+
var t = e.state, r = e.options, i = e.name, n = r.offset, o2 = n === void 0 ? [0, 0] : n, l2 = ut.reduce(function(c2, h2) {
|
|
1863
1863
|
return c2[h2] = Or(h2, t.rects, o2), c2;
|
|
1864
|
-
}, {}),
|
|
1865
|
-
t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += a2, t.modifiersData.popperOffsets.y += f2), t.modifiersData[
|
|
1864
|
+
}, {}), s2 = l2[t.placement], a2 = s2.x, f2 = s2.y;
|
|
1865
|
+
t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += a2, t.modifiersData.popperOffsets.y += f2), t.modifiersData[i] = l2;
|
|
1866
1866
|
}
|
|
1867
1867
|
const Ar = {
|
|
1868
1868
|
name: "offset",
|
|
@@ -1872,8 +1872,8 @@ const Ar = {
|
|
|
1872
1872
|
fn: Er
|
|
1873
1873
|
};
|
|
1874
1874
|
function Pr(e) {
|
|
1875
|
-
var t = e.state,
|
|
1876
|
-
t.modifiersData[
|
|
1875
|
+
var t = e.state, r = e.name;
|
|
1876
|
+
t.modifiersData[r] = yt({
|
|
1877
1877
|
reference: t.rects.reference,
|
|
1878
1878
|
element: t.rects.popper,
|
|
1879
1879
|
strategy: "absolute",
|
|
@@ -1891,7 +1891,7 @@ function $r(e) {
|
|
|
1891
1891
|
return e === "x" ? "y" : "x";
|
|
1892
1892
|
}
|
|
1893
1893
|
function Cr(e) {
|
|
1894
|
-
var t = e.state,
|
|
1894
|
+
var t = e.state, r = e.options, i = e.name, n = r.mainAxis, o2 = n === void 0 ? true : n, l2 = r.altAxis, s2 = l2 === void 0 ? false : l2, a2 = r.boundary, f2 = r.rootBoundary, c2 = r.altBoundary, h2 = r.padding, y2 = r.tether, u2 = y2 === void 0 ? true : y2, b2 = r.tetherOffset, v2 = b2 === void 0 ? 0 : b2, d2 = ce(t, {
|
|
1895
1895
|
boundary: a2,
|
|
1896
1896
|
rootBoundary: f2,
|
|
1897
1897
|
padding: h2,
|
|
@@ -1904,23 +1904,23 @@ function Cr(e) {
|
|
|
1904
1904
|
} : Object.assign({
|
|
1905
1905
|
mainAxis: 0,
|
|
1906
1906
|
altAxis: 0
|
|
1907
|
-
}, P3), $2 = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null,
|
|
1907
|
+
}, P3), $2 = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, j3 = {
|
|
1908
1908
|
x: 0,
|
|
1909
1909
|
y: 0
|
|
1910
1910
|
};
|
|
1911
1911
|
if (m2) {
|
|
1912
1912
|
if (o2) {
|
|
1913
|
-
var C2, X2 = p2 === "y" ? k : D, Y2 = p2 === "y" ? S2 :
|
|
1913
|
+
var C2, X2 = p2 === "y" ? k : D, Y2 = p2 === "y" ? S2 : M, R2 = p2 === "y" ? "height" : "width", W2 = m2[p2], ue = W2 + d2[X2], q2 = W2 - d2[Y2], pe = u2 ? -L3[R2] / 2 : 0, be = O2 === Q ? x2[R2] : L3[R2], re = O2 === Q ? -L3[R2] : -x2[R2], de = t.elements.arrow, G2 = u2 && de ? Be(de) : {
|
|
1914
1914
|
width: 0,
|
|
1915
1915
|
height: 0
|
|
1916
|
-
},
|
|
1917
|
-
m2[p2] = Ne,
|
|
1916
|
+
}, I3 = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : vt(), ie = I3[X2], ve = I3[Y2], z2 = oe(0, x2[R2], G2[R2]), xe = E2 ? x2[R2] / 2 - pe - z2 - ie - A3.mainAxis : be - z2 - ie - A3.mainAxis, xt = E2 ? -x2[R2] / 2 + pe + z2 + ve + A3.mainAxis : re + z2 + ve + A3.mainAxis, Oe = t.elements.arrow && fe(t.elements.arrow), Ot = Oe ? p2 === "y" ? Oe.clientTop || 0 : Oe.clientLeft || 0 : 0, He = (C2 = $2 == null ? void 0 : $2[p2]) != null ? C2 : 0, Et = W2 + xe - He - Ot, At = W2 + xt - He, Ne = oe(u2 ? ye(ue, Et) : ue, W2, u2 ? _(q2, At) : q2);
|
|
1917
|
+
m2[p2] = Ne, j3[p2] = Ne - W2;
|
|
1918
1918
|
}
|
|
1919
|
-
if (
|
|
1920
|
-
var
|
|
1921
|
-
m2[g2] = ze,
|
|
1919
|
+
if (s2) {
|
|
1920
|
+
var Ve, Pt = p2 === "x" ? k : D, Lt = p2 === "x" ? S2 : M, U2 = m2[g2], he = g2 === "y" ? "height" : "width", Ie = U2 + d2[Pt], Fe = U2 - d2[Lt], Ee = [k, D].indexOf(w2) !== -1, Xe = (Ve = $2 == null ? void 0 : $2[g2]) != null ? Ve : 0, Ye = Ee ? Ie : U2 - x2[he] - L3[he] - Xe + A3.altAxis, qe = Ee ? U2 + x2[he] + L3[he] - Xe - A3.altAxis : Fe, ze = u2 && Ee ? Qt(Ye, U2, qe) : oe(u2 ? Ye : Ie, U2, u2 ? qe : Fe);
|
|
1921
|
+
m2[g2] = ze, j3[g2] = ze - U2;
|
|
1922
1922
|
}
|
|
1923
|
-
t.modifiersData[
|
|
1923
|
+
t.modifiersData[i] = j3;
|
|
1924
1924
|
}
|
|
1925
1925
|
}
|
|
1926
1926
|
const kr = {
|
|
@@ -1940,73 +1940,73 @@ function Rr(e) {
|
|
|
1940
1940
|
return e === B(e) || !T(e) ? Se(e) : Dr(e);
|
|
1941
1941
|
}
|
|
1942
1942
|
function Br(e) {
|
|
1943
|
-
var t = e.getBoundingClientRect(),
|
|
1944
|
-
return
|
|
1943
|
+
var t = e.getBoundingClientRect(), r = Z(t.width) / e.offsetWidth || 1, i = Z(t.height) / e.offsetHeight || 1;
|
|
1944
|
+
return r !== 1 || i !== 1;
|
|
1945
1945
|
}
|
|
1946
|
-
function Tr(e, t,
|
|
1947
|
-
|
|
1948
|
-
var
|
|
1946
|
+
function Tr(e, t, r) {
|
|
1947
|
+
r === void 0 && (r = false);
|
|
1948
|
+
var i = T(t), n = T(t) && Br(t), o2 = F(t), l2 = ee(e, n, r), s2 = {
|
|
1949
1949
|
scrollLeft: 0,
|
|
1950
1950
|
scrollTop: 0
|
|
1951
1951
|
}, a2 = {
|
|
1952
1952
|
x: 0,
|
|
1953
1953
|
y: 0
|
|
1954
1954
|
};
|
|
1955
|
-
return (
|
|
1956
|
-
|
|
1957
|
-
x: l2.left +
|
|
1958
|
-
y: l2.top +
|
|
1955
|
+
return (i || !i && !r) && ((N(t) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
|
|
1956
|
+
je(o2)) && (s2 = Rr(t)), T(t) ? (a2 = ee(t, true), a2.x += t.clientLeft, a2.y += t.clientTop) : o2 && (a2.x = Me(o2))), {
|
|
1957
|
+
x: l2.left + s2.scrollLeft - a2.x,
|
|
1958
|
+
y: l2.top + s2.scrollTop - a2.y,
|
|
1959
1959
|
width: l2.width,
|
|
1960
1960
|
height: l2.height
|
|
1961
1961
|
};
|
|
1962
1962
|
}
|
|
1963
1963
|
function Sr(e) {
|
|
1964
|
-
var t = /* @__PURE__ */ new Map(),
|
|
1964
|
+
var t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = [];
|
|
1965
1965
|
e.forEach(function(o2) {
|
|
1966
1966
|
t.set(o2.name, o2);
|
|
1967
1967
|
});
|
|
1968
1968
|
function n(o2) {
|
|
1969
|
-
|
|
1969
|
+
r.add(o2.name);
|
|
1970
1970
|
var l2 = [].concat(o2.requires || [], o2.requiresIfExists || []);
|
|
1971
|
-
l2.forEach(function(
|
|
1972
|
-
if (!
|
|
1973
|
-
var a2 = t.get(
|
|
1971
|
+
l2.forEach(function(s2) {
|
|
1972
|
+
if (!r.has(s2)) {
|
|
1973
|
+
var a2 = t.get(s2);
|
|
1974
1974
|
a2 && n(a2);
|
|
1975
1975
|
}
|
|
1976
|
-
}),
|
|
1976
|
+
}), i.push(o2);
|
|
1977
1977
|
}
|
|
1978
1978
|
return e.forEach(function(o2) {
|
|
1979
|
-
|
|
1980
|
-
}),
|
|
1979
|
+
r.has(o2.name) || n(o2);
|
|
1980
|
+
}), i;
|
|
1981
1981
|
}
|
|
1982
|
-
function
|
|
1982
|
+
function Mr(e) {
|
|
1983
1983
|
var t = Sr(e);
|
|
1984
|
-
return zt.reduce(function(
|
|
1985
|
-
return
|
|
1986
|
-
return n.phase ===
|
|
1984
|
+
return zt.reduce(function(r, i) {
|
|
1985
|
+
return r.concat(t.filter(function(n) {
|
|
1986
|
+
return n.phase === i;
|
|
1987
1987
|
}));
|
|
1988
1988
|
}, []);
|
|
1989
1989
|
}
|
|
1990
|
-
function
|
|
1990
|
+
function jr(e) {
|
|
1991
1991
|
var t;
|
|
1992
1992
|
return function() {
|
|
1993
|
-
return t || (t = new Promise(function(
|
|
1993
|
+
return t || (t = new Promise(function(r) {
|
|
1994
1994
|
Promise.resolve().then(function() {
|
|
1995
|
-
t = void 0,
|
|
1995
|
+
t = void 0, r(e());
|
|
1996
1996
|
});
|
|
1997
1997
|
})), t;
|
|
1998
1998
|
};
|
|
1999
1999
|
}
|
|
2000
2000
|
function Wr(e) {
|
|
2001
|
-
var t = e.reduce(function(
|
|
2002
|
-
var n =
|
|
2003
|
-
return
|
|
2004
|
-
options: Object.assign({}, n.options,
|
|
2005
|
-
data: Object.assign({}, n.data,
|
|
2006
|
-
}) :
|
|
2001
|
+
var t = e.reduce(function(r, i) {
|
|
2002
|
+
var n = r[i.name];
|
|
2003
|
+
return r[i.name] = n ? Object.assign({}, n, i, {
|
|
2004
|
+
options: Object.assign({}, n.options, i.options),
|
|
2005
|
+
data: Object.assign({}, n.data, i.data)
|
|
2006
|
+
}) : i, r;
|
|
2007
2007
|
}, {});
|
|
2008
|
-
return Object.keys(t).map(function(
|
|
2009
|
-
return t[
|
|
2008
|
+
return Object.keys(t).map(function(r) {
|
|
2009
|
+
return t[r];
|
|
2010
2010
|
});
|
|
2011
2011
|
}
|
|
2012
2012
|
var it = {
|
|
@@ -2015,16 +2015,16 @@ var it = {
|
|
|
2015
2015
|
strategy: "absolute"
|
|
2016
2016
|
};
|
|
2017
2017
|
function nt() {
|
|
2018
|
-
for (var e = arguments.length, t = new Array(e),
|
|
2019
|
-
t[
|
|
2020
|
-
return !t.some(function(
|
|
2021
|
-
return !(
|
|
2018
|
+
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
|
|
2019
|
+
t[r] = arguments[r];
|
|
2020
|
+
return !t.some(function(i) {
|
|
2021
|
+
return !(i && typeof i.getBoundingClientRect == "function");
|
|
2022
2022
|
});
|
|
2023
2023
|
}
|
|
2024
2024
|
function Hr(e) {
|
|
2025
2025
|
e === void 0 && (e = {});
|
|
2026
|
-
var t = e,
|
|
2027
|
-
return function(
|
|
2026
|
+
var t = e, r = t.defaultModifiers, i = r === void 0 ? [] : r, n = t.defaultOptions, o2 = n === void 0 ? it : n;
|
|
2027
|
+
return function(s2, a2, f2) {
|
|
2028
2028
|
f2 === void 0 && (f2 = o2);
|
|
2029
2029
|
var c2 = {
|
|
2030
2030
|
placement: "bottom",
|
|
@@ -2032,7 +2032,7 @@ function Hr(e) {
|
|
|
2032
2032
|
options: Object.assign({}, it, o2),
|
|
2033
2033
|
modifiersData: {},
|
|
2034
2034
|
elements: {
|
|
2035
|
-
reference:
|
|
2035
|
+
reference: s2,
|
|
2036
2036
|
popper: a2
|
|
2037
2037
|
},
|
|
2038
2038
|
attributes: {},
|
|
@@ -2042,10 +2042,10 @@ function Hr(e) {
|
|
|
2042
2042
|
setOptions: function(w2) {
|
|
2043
2043
|
var O2 = typeof w2 == "function" ? w2(c2.options) : w2;
|
|
2044
2044
|
v2(), c2.options = Object.assign({}, o2, c2.options, O2), c2.scrollParents = {
|
|
2045
|
-
reference: K(
|
|
2045
|
+
reference: K(s2) ? ae(s2) : s2.contextElement ? ae(s2.contextElement) : [],
|
|
2046
2046
|
popper: ae(a2)
|
|
2047
2047
|
};
|
|
2048
|
-
var E2 =
|
|
2048
|
+
var E2 = Mr(Wr([].concat(i, c2.options.modifiers)));
|
|
2049
2049
|
return c2.orderedModifiers = E2.filter(function(p2) {
|
|
2050
2050
|
return p2.enabled;
|
|
2051
2051
|
}), b2(), u2.update();
|
|
@@ -2083,7 +2083,7 @@ function Hr(e) {
|
|
|
2083
2083
|
},
|
|
2084
2084
|
// Async and optimistically optimized update – it will not be executed if
|
|
2085
2085
|
// not necessary (debounced to run at most once-per-tick)
|
|
2086
|
-
update:
|
|
2086
|
+
update: jr(function() {
|
|
2087
2087
|
return new Promise(function(d2) {
|
|
2088
2088
|
u2.forceUpdate(), d2(c2);
|
|
2089
2089
|
});
|
|
@@ -2092,7 +2092,7 @@ function Hr(e) {
|
|
|
2092
2092
|
v2(), y2 = true;
|
|
2093
2093
|
}
|
|
2094
2094
|
};
|
|
2095
|
-
if (!nt(
|
|
2095
|
+
if (!nt(s2, a2))
|
|
2096
2096
|
return u2;
|
|
2097
2097
|
u2.setOptions(f2).then(function(d2) {
|
|
2098
2098
|
!y2 && f2.onFirstUpdate && f2.onFirstUpdate(d2);
|
|
@@ -2120,24 +2120,24 @@ function Hr(e) {
|
|
|
2120
2120
|
return u2;
|
|
2121
2121
|
};
|
|
2122
2122
|
}
|
|
2123
|
-
var Nr = [cr, Lr, ar, Kt, Ar, wr, kr, rr, xr],
|
|
2123
|
+
var Nr = [cr, Lr, ar, Kt, Ar, wr, kr, rr, xr], Vr = /* @__PURE__ */ Hr({
|
|
2124
2124
|
defaultModifiers: Nr
|
|
2125
2125
|
});
|
|
2126
2126
|
async function Ce(e) {
|
|
2127
|
-
const t = this.collection.findIndex((
|
|
2127
|
+
const t = this.collection.findIndex((r) => r.id === e.id);
|
|
2128
2128
|
if (t >= 0) {
|
|
2129
|
-
const
|
|
2130
|
-
|
|
2131
|
-
delete
|
|
2129
|
+
const r = this.collection[t];
|
|
2130
|
+
r.state === "opened" && r.close(), r.popper.destroy(), wt(r), Object.getOwnPropertyNames(r).forEach((i) => {
|
|
2131
|
+
delete r[i];
|
|
2132
2132
|
}), this.collection.splice(t, 1);
|
|
2133
2133
|
}
|
|
2134
2134
|
return this.collection;
|
|
2135
2135
|
}
|
|
2136
2136
|
function wt(e) {
|
|
2137
2137
|
return e.__eventListeners && (e.__eventListeners.forEach((t) => {
|
|
2138
|
-
t.el.forEach((
|
|
2139
|
-
t.type.forEach((
|
|
2140
|
-
e[
|
|
2138
|
+
t.el.forEach((r) => {
|
|
2139
|
+
t.type.forEach((i) => {
|
|
2140
|
+
e[r].removeEventListener(i, t.listener, false);
|
|
2141
2141
|
});
|
|
2142
2142
|
});
|
|
2143
2143
|
}), delete e.__eventListeners), e;
|
|
@@ -2152,26 +2152,26 @@ async function We(e) {
|
|
|
2152
2152
|
]
|
|
2153
2153
|
}), t.popper.update(), t.state = "opened", t;
|
|
2154
2154
|
}
|
|
2155
|
-
async function
|
|
2155
|
+
async function Ir(e, t) {
|
|
2156
2156
|
Ce.call(this, e);
|
|
2157
|
-
const
|
|
2157
|
+
const r = this, i = {
|
|
2158
2158
|
id: e.id,
|
|
2159
2159
|
state: "closed",
|
|
2160
2160
|
el: e,
|
|
2161
2161
|
trigger: t,
|
|
2162
|
-
popper:
|
|
2162
|
+
popper: Vr(t, e),
|
|
2163
2163
|
config: ot(e, this.settings),
|
|
2164
2164
|
open() {
|
|
2165
|
-
return We.call(
|
|
2165
|
+
return We.call(r, this);
|
|
2166
2166
|
},
|
|
2167
2167
|
close() {
|
|
2168
|
-
return ke.call(
|
|
2168
|
+
return ke.call(r, this);
|
|
2169
2169
|
},
|
|
2170
2170
|
deregister() {
|
|
2171
|
-
return Ce.call(
|
|
2171
|
+
return Ce.call(r, this);
|
|
2172
2172
|
}
|
|
2173
2173
|
};
|
|
2174
|
-
return
|
|
2174
|
+
return i.trigger.hasAttribute("aria-controls") && i.trigger.setAttribute("aria-expanded", "false"), bt.call(this, i), this.collection.push(i), i.el.classList.contains(this.settings.stateActive) && (await i.open(), lt.call(this, i)), i;
|
|
2175
2175
|
}
|
|
2176
2176
|
function bt(e) {
|
|
2177
2177
|
return e.__eventListeners || (e.config.event === "hover" ? (e.__eventListeners = [{
|
|
@@ -2182,62 +2182,62 @@ function bt(e) {
|
|
|
2182
2182
|
el: ["el", "trigger"],
|
|
2183
2183
|
type: ["mouseleave", "focusout"],
|
|
2184
2184
|
listener: ct.bind(this, e)
|
|
2185
|
-
}], e.__eventListeners.forEach((
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
e[
|
|
2185
|
+
}], e.__eventListeners.forEach((r) => {
|
|
2186
|
+
r.el.forEach((i) => {
|
|
2187
|
+
r.type.forEach((n) => {
|
|
2188
|
+
e[i].addEventListener(n, r.listener, false);
|
|
2189
2189
|
});
|
|
2190
2190
|
});
|
|
2191
2191
|
})) : (e.__eventListeners = [{
|
|
2192
2192
|
el: ["trigger"],
|
|
2193
2193
|
type: ["click"],
|
|
2194
2194
|
listener: Tt.bind(this, e)
|
|
2195
|
-
}], e.__eventListeners.forEach((
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
e[
|
|
2195
|
+
}], e.__eventListeners.forEach((r) => {
|
|
2196
|
+
r.el.forEach((i) => {
|
|
2197
|
+
r.type.forEach((n) => {
|
|
2198
|
+
e[i].addEventListener(n, r.listener, false);
|
|
2199
2199
|
});
|
|
2200
2200
|
});
|
|
2201
2201
|
}))), e;
|
|
2202
2202
|
}
|
|
2203
2203
|
var J2;
|
|
2204
2204
|
class Xr extends $t {
|
|
2205
|
-
constructor(
|
|
2205
|
+
constructor(r) {
|
|
2206
2206
|
super();
|
|
2207
2207
|
_e(this, J2, void 0);
|
|
2208
|
-
this.defaults = kt, this.settings = { ...this.defaults, ...
|
|
2208
|
+
this.defaults = kt, this.settings = { ...this.defaults, ...r }, this.trigger = null, Ke(this, J2, St.bind(this)), this.settings.autoMount && this.mount();
|
|
2209
2209
|
}
|
|
2210
|
-
async
|
|
2211
|
-
|
|
2212
|
-
const
|
|
2213
|
-
return await this.registerCollection(
|
|
2210
|
+
async mount(r) {
|
|
2211
|
+
r && (this.settings = { ...this.settings, ...r });
|
|
2212
|
+
const i = document.querySelectorAll(this.settings.selectorPopover);
|
|
2213
|
+
return await this.registerCollection(i), this.settings.eventListeners && this.mountEventListeners(false), this;
|
|
2214
2214
|
}
|
|
2215
|
-
async
|
|
2216
|
-
return this.trigger = null, await this.deregisterCollection(), this.settings.eventListeners && this.
|
|
2215
|
+
async unmount() {
|
|
2216
|
+
return this.trigger = null, await this.deregisterCollection(), this.settings.eventListeners && this.unmountEventListeners(false), this;
|
|
2217
2217
|
}
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
bt.call(this,
|
|
2218
|
+
mountEventListeners(r = true) {
|
|
2219
|
+
r && this.collection.forEach((i) => {
|
|
2220
|
+
bt.call(this, i);
|
|
2221
2221
|
}), document.addEventListener("keydown", Ae(this, J2), false);
|
|
2222
2222
|
}
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
wt(
|
|
2223
|
+
unmountEventListeners(r = true) {
|
|
2224
|
+
r && this.collection.forEach((i) => {
|
|
2225
|
+
wt(i);
|
|
2226
2226
|
}), document.removeEventListener("keydown", Ae(this, J2), false);
|
|
2227
2227
|
}
|
|
2228
|
-
register(
|
|
2229
|
-
const
|
|
2230
|
-
return
|
|
2228
|
+
register(r) {
|
|
2229
|
+
const i = Bt.call(this, r);
|
|
2230
|
+
return i.error ? Promise.reject(i.error) : Ir.call(this, i.popover, i.trigger);
|
|
2231
2231
|
}
|
|
2232
|
-
deregister(
|
|
2233
|
-
let
|
|
2234
|
-
return
|
|
2232
|
+
deregister(r) {
|
|
2233
|
+
let i = this.get(r.id || r);
|
|
2234
|
+
return i ? Ce.call(this, i) : Promise.reject(new Error(`Failed to deregister; popover does not exist in collection with ID of: "${r.id || r}".`));
|
|
2235
2235
|
}
|
|
2236
|
-
open(
|
|
2237
|
-
return We.call(this,
|
|
2236
|
+
open(r) {
|
|
2237
|
+
return We.call(this, r);
|
|
2238
2238
|
}
|
|
2239
|
-
close(
|
|
2240
|
-
return ke.call(this,
|
|
2239
|
+
close(r) {
|
|
2240
|
+
return ke.call(this, r);
|
|
2241
2241
|
}
|
|
2242
2242
|
}
|
|
2243
2243
|
J2 = /* @__PURE__ */ new WeakMap();
|