vrembem 4.0.0-next.32 → 4.0.0-next.34
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/LICENSE +1 -1
- package/dev/base.css +20 -9
- package/dev/base.css.map +1 -1
- package/dev/index.css +95 -87
- package/dev/index.css.map +1 -1
- package/dev/index.js +1648 -1610
- package/dev/index.js.map +1 -1
- package/dev/index.umd.cjs +1617 -1579
- package/dev/index.umd.cjs.map +1 -1
- package/dev/root.css +75 -76
- package/dev/root.css.map +1 -1
- package/dist/base.css +1 -1
- package/dist/base.css.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +2084 -2056
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +9 -9
- package/dist/index.umd.cjs.map +1 -1
- package/dist/root.css +1 -1
- package/dist/root.css.map +1 -1
- package/package.json +23 -22
package/dev/index.js
CHANGED
|
@@ -1,38 +1,41 @@
|
|
|
1
|
-
const
|
|
2
|
-
`a[href]${
|
|
3
|
-
`area[href]${
|
|
4
|
-
`input:not([type="hidden"]):not([type="radio"])${
|
|
5
|
-
`input[type="radio"]${
|
|
6
|
-
`select${
|
|
7
|
-
`textarea${
|
|
8
|
-
`button${
|
|
9
|
-
`details${
|
|
10
|
-
`iframe${
|
|
11
|
-
`audio[controls]${
|
|
12
|
-
`video[controls]${
|
|
13
|
-
`[contenteditable]${
|
|
14
|
-
`[tabindex]${
|
|
1
|
+
const l$2 = ":not([inert])", u$2 = ':not([tabindex^="-"])', m$2 = ":not(:disabled)", C$2 = [
|
|
2
|
+
`a[href]${l$2}${u$2}`,
|
|
3
|
+
`area[href]${l$2}${u$2}`,
|
|
4
|
+
`input:not([type="hidden"]):not([type="radio"])${l$2}${u$2}${m$2}`,
|
|
5
|
+
`input[type="radio"]${l$2}${u$2}${m$2}`,
|
|
6
|
+
`select${l$2}${u$2}${m$2}`,
|
|
7
|
+
`textarea${l$2}${u$2}${m$2}`,
|
|
8
|
+
`button${l$2}${u$2}${m$2}`,
|
|
9
|
+
`details${l$2} > summary:first-of-type${u$2}`,
|
|
10
|
+
`iframe${l$2}${u$2}`,
|
|
11
|
+
`audio[controls]${l$2}${u$2}`,
|
|
12
|
+
`video[controls]${l$2}${u$2}`,
|
|
13
|
+
`[contenteditable]${l$2}${u$2}`,
|
|
14
|
+
`[tabindex]${l$2}${u$2}`
|
|
15
15
|
];
|
|
16
|
-
function
|
|
17
|
-
const
|
|
18
|
-
return
|
|
16
|
+
function x$2(i, t = "config") {
|
|
17
|
+
const o = (i.getAttribute(`data-${t}`) || "").replace(/'/g, '"');
|
|
18
|
+
return o ? JSON.parse(o) : {};
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
if (typeof
|
|
22
|
-
const t = document.getElementById(
|
|
20
|
+
function v$2(i) {
|
|
21
|
+
if (typeof i == "string") {
|
|
22
|
+
const t = document.getElementById(i);
|
|
23
23
|
if (t) return t;
|
|
24
|
-
throw new Error(`Element not found with ID: "${
|
|
25
|
-
} else if (
|
|
26
|
-
if (!
|
|
24
|
+
throw new Error(`Element not found with ID: "${i}"`);
|
|
25
|
+
} else if (i instanceof HTMLElement) {
|
|
26
|
+
if (!i.id)
|
|
27
27
|
throw new Error("HTMLElement must have an ID");
|
|
28
|
-
return
|
|
28
|
+
return i;
|
|
29
29
|
} else
|
|
30
30
|
throw new Error("Invalid argument: query must be a string or HTMLElement");
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
function h$2(i, ...t) {
|
|
33
|
+
return typeof i == "function" ? i(...t) : i;
|
|
34
|
+
}
|
|
35
|
+
async function g$2(i, t, ...e) {
|
|
36
|
+
t in i && typeof i[t] == "function" && await i[t](...e);
|
|
34
37
|
}
|
|
35
|
-
function
|
|
38
|
+
function k$3(i, t, e) {
|
|
36
39
|
if (typeof t == "string") {
|
|
37
40
|
const r2 = document.querySelector(t);
|
|
38
41
|
if (!r2)
|
|
@@ -42,121 +45,143 @@ function x$2(n, t, e) {
|
|
|
42
45
|
throw new Error(`Not a valid teleport reference: '${t}'`);
|
|
43
46
|
if (typeof t[e] != "function")
|
|
44
47
|
throw new Error(`Not a valid teleport method: '${e}'`);
|
|
45
|
-
let
|
|
46
|
-
"teleported #" +
|
|
48
|
+
let o = document.createComment(
|
|
49
|
+
"teleported #" + i.id
|
|
47
50
|
);
|
|
48
|
-
return
|
|
49
|
-
|
|
51
|
+
return i.before(o), t[e](i), () => {
|
|
52
|
+
o && (o.after(i), o.remove(), o = null);
|
|
50
53
|
};
|
|
51
54
|
}
|
|
52
|
-
function
|
|
53
|
-
return
|
|
55
|
+
function R$1(i) {
|
|
56
|
+
return i.split("-").map(
|
|
54
57
|
(t, e) => e === 0 ? t : t.charAt(0).toUpperCase() + t.slice(1)
|
|
55
58
|
).join("");
|
|
56
59
|
}
|
|
57
|
-
function
|
|
58
|
-
return
|
|
60
|
+
function M$2(i) {
|
|
61
|
+
return i.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
59
62
|
}
|
|
60
|
-
function
|
|
61
|
-
if (typeof
|
|
62
|
-
return
|
|
63
|
-
const t = parseFloat(
|
|
63
|
+
function A$3(i) {
|
|
64
|
+
if (typeof i == "number")
|
|
65
|
+
return i;
|
|
66
|
+
const t = parseFloat(i);
|
|
64
67
|
if (!Number.isNaN(t)) {
|
|
65
|
-
const e =
|
|
68
|
+
const e = i.includes("ms");
|
|
66
69
|
return t * (e ? 1 : 1e3);
|
|
67
70
|
}
|
|
68
|
-
throw new Error(`Could not convert value to milliseconds: ${
|
|
71
|
+
throw new Error(`Could not convert value to milliseconds: ${i}`);
|
|
69
72
|
}
|
|
70
|
-
function
|
|
71
|
-
return new Promise((
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
},
|
|
73
|
+
function W$1(i, t, e, o, r2 = 0) {
|
|
74
|
+
return new Promise((n) => {
|
|
75
|
+
i.classList.remove(t), i.classList.add(e), setTimeout(() => {
|
|
76
|
+
i.classList.add(o), i.classList.remove(e), n(i);
|
|
77
|
+
}, A$3(r2));
|
|
75
78
|
});
|
|
76
79
|
}
|
|
77
|
-
function
|
|
80
|
+
function S$3(i, t = {}) {
|
|
78
81
|
const e = {
|
|
79
82
|
fallback: null,
|
|
80
83
|
element: document.body,
|
|
81
84
|
...t
|
|
82
85
|
};
|
|
83
|
-
if (!
|
|
86
|
+
if (!i.startsWith("--")) {
|
|
84
87
|
const r2 = y$2();
|
|
85
|
-
r2 && (
|
|
88
|
+
r2 && (i = `${r2}${i}`), i = `--${i}`;
|
|
86
89
|
}
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
89
|
-
return
|
|
90
|
+
const o = getComputedStyle(e.element).getPropertyValue(i).trim();
|
|
91
|
+
if (o)
|
|
92
|
+
return o;
|
|
90
93
|
if (e.fallback)
|
|
91
94
|
return e.fallback;
|
|
92
|
-
throw new Error(`CSS variable "${
|
|
95
|
+
throw new Error(`CSS variable "${i}" was not found!`);
|
|
93
96
|
}
|
|
94
|
-
async function
|
|
95
|
-
await g$
|
|
96
|
-
for (const
|
|
97
|
-
await g$
|
|
98
|
-
await t.emit(
|
|
97
|
+
async function d$1(i, t, e) {
|
|
98
|
+
await g$2(t, i, e), e && await g$2(e, i);
|
|
99
|
+
for (const o of t.plugins)
|
|
100
|
+
await g$2(o, i, { parent: t, entry: e });
|
|
101
|
+
await t.emit(i, { parent: t, entry: e });
|
|
99
102
|
}
|
|
100
|
-
function
|
|
101
|
-
const t = getComputedStyle(
|
|
102
|
-
for (let r2 = 0; r2 <
|
|
103
|
-
const
|
|
104
|
-
|
|
103
|
+
function b$2(i) {
|
|
104
|
+
const t = getComputedStyle(i.el), e = {}, o = i.config.get("customProps");
|
|
105
|
+
for (let r2 = 0; r2 < o.length; r2++) {
|
|
106
|
+
const n = y$2(), s = i.parent.name.toLowerCase(), c2 = M$2(o[r2]), a2 = t.getPropertyValue(`--${n}${s}-${c2}`).trim();
|
|
107
|
+
a2 && (e[R$1(c2)] = a2);
|
|
105
108
|
}
|
|
106
109
|
return e;
|
|
107
110
|
}
|
|
108
111
|
function y$2() {
|
|
109
112
|
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
110
113
|
}
|
|
111
|
-
function P$3(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
function A$2(n, t = {}) {
|
|
115
|
-
const {
|
|
116
|
-
fallback: e,
|
|
117
|
-
props: s = ["dataConfig", "customProps", "settings", "parent.settings"]
|
|
118
|
-
} = t;
|
|
119
|
-
for (const r2 of s) {
|
|
120
|
-
const a2 = r2 !== "customProps" ? "camel" : "kebab", o2 = P$3.call(this, r2, n, a2);
|
|
121
|
-
if (o2 !== void 0)
|
|
122
|
-
return o2;
|
|
123
|
-
}
|
|
124
|
-
if (e !== void 0)
|
|
125
|
-
return e;
|
|
126
|
-
throw new Error(`${this.parent.module} setting does not exist: ${n}`);
|
|
127
|
-
}
|
|
128
|
-
function I$3(n, t) {
|
|
129
|
-
t && document.querySelectorAll(t).forEach((s) => {
|
|
130
|
-
n ? s.style.overflow = "hidden" : s.style.removeProperty("overflow");
|
|
114
|
+
function P$3(i, t) {
|
|
115
|
+
t && document.querySelectorAll(t).forEach((o) => {
|
|
116
|
+
i ? o.style.overflow = "hidden" : o.style.removeProperty("overflow");
|
|
131
117
|
});
|
|
132
118
|
}
|
|
133
|
-
function T$
|
|
134
|
-
t && document.querySelectorAll(t).forEach((
|
|
135
|
-
|
|
119
|
+
function T$2(i, t) {
|
|
120
|
+
t && document.querySelectorAll(t).forEach((o) => {
|
|
121
|
+
o.inert = i;
|
|
136
122
|
});
|
|
137
123
|
}
|
|
138
|
-
function
|
|
139
|
-
T$
|
|
124
|
+
function Z(i, t, e) {
|
|
125
|
+
T$2(!!i, t), P$3(!!i, e);
|
|
140
126
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
127
|
+
let I$3 = class I {
|
|
128
|
+
#t;
|
|
129
|
+
#e;
|
|
130
|
+
constructor() {
|
|
131
|
+
this.#t = {}, this.#e = [];
|
|
132
|
+
}
|
|
133
|
+
get(t, e) {
|
|
134
|
+
const { fallback: o, source: r2 } = e ?? {};
|
|
135
|
+
if (r2) {
|
|
136
|
+
const n = this.#t?.[r2]?.[t];
|
|
137
|
+
if (n !== void 0)
|
|
138
|
+
return n;
|
|
139
|
+
} else
|
|
140
|
+
for (const n of this.#e) {
|
|
141
|
+
const s = this.#t?.[n]?.[t];
|
|
142
|
+
if (s !== void 0)
|
|
143
|
+
return s;
|
|
144
|
+
}
|
|
145
|
+
if (o !== void 0)
|
|
146
|
+
return o;
|
|
147
|
+
throw new Error(`Config does not exist: ${t}`);
|
|
148
|
+
}
|
|
149
|
+
set(t, e = {}) {
|
|
150
|
+
let o, r2;
|
|
151
|
+
return typeof t == "string" ? (o = t, r2 = e) : (o = "entry", r2 = t), this.#t[o] ? Object.assign(this.#t[o], r2) : (this.#e.unshift(o), this.#t[o] = r2), this.#t[o];
|
|
152
|
+
}
|
|
153
|
+
remove(t) {
|
|
154
|
+
const e = this.#e.indexOf(t);
|
|
155
|
+
e !== -1 && this.#e.splice(e, 1), delete this.#t[t];
|
|
156
|
+
}
|
|
157
|
+
setSourceOrder(t) {
|
|
158
|
+
const e = Object.keys(this.#t).reverse(), o = t.filter((r2) => e.includes(r2));
|
|
159
|
+
for (const r2 of e)
|
|
160
|
+
o.includes(r2) || o.push(r2);
|
|
161
|
+
return this.#e = o;
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
let L$2 = class L {
|
|
165
|
+
constructor() {
|
|
166
|
+
this.events = {};
|
|
167
|
+
}
|
|
168
|
+
on(t, e, ...o) {
|
|
169
|
+
this.events[t] || (this.events[t] = []), this.events[t].some(
|
|
170
|
+
(n) => n.listener === e
|
|
171
|
+
) || this.events[t].push({ listener: e, args: o });
|
|
172
|
+
}
|
|
173
|
+
off(t, e) {
|
|
174
|
+
this.events[t] && (this.events[t] = this.events[t].filter(
|
|
175
|
+
(o) => o.listener !== e
|
|
151
176
|
));
|
|
152
|
-
}
|
|
153
|
-
async emit(
|
|
154
|
-
if (
|
|
155
|
-
for (const { listener:
|
|
156
|
-
await e
|
|
177
|
+
}
|
|
178
|
+
async emit(t, ...e) {
|
|
179
|
+
if (t = t.startsWith("on") ? t.slice(2, 3).toLowerCase() + t.slice(3) : t, !!this.events[t])
|
|
180
|
+
for (const { listener: o, args: r2 } of this.events[t])
|
|
181
|
+
await o(...e, ...r2);
|
|
157
182
|
}
|
|
158
183
|
};
|
|
159
|
-
let
|
|
184
|
+
let U$1 = class U extends Array {
|
|
160
185
|
constructor(t = null) {
|
|
161
186
|
super(), this.el = t, this.el && this.set();
|
|
162
187
|
}
|
|
@@ -167,76 +192,76 @@ let O$2 = class O extends Array {
|
|
|
167
192
|
return this[this.length - 1];
|
|
168
193
|
}
|
|
169
194
|
set(t = this.el) {
|
|
170
|
-
this.length = 0, t && this.push(...t.querySelectorAll(
|
|
195
|
+
this.length = 0, t && this.push(...t.querySelectorAll(C$2.join(",")));
|
|
171
196
|
}
|
|
172
197
|
clear() {
|
|
173
198
|
this.length = 0;
|
|
174
199
|
}
|
|
175
200
|
};
|
|
176
|
-
let
|
|
201
|
+
let D$2 = class D {
|
|
177
202
|
constructor(t = null) {
|
|
178
|
-
this.el = t, this.focusable = new
|
|
203
|
+
this.el = t, this.focusable = new U$1(), this.handleFocusTrap = O$2.bind(this);
|
|
179
204
|
}
|
|
180
205
|
on(t = this.el) {
|
|
181
|
-
this.focusable.set(t), this.focusable.length ? document.addEventListener("keydown", this.handleFocusTrap) : document.addEventListener("keydown",
|
|
206
|
+
this.focusable.set(t), this.focusable.length ? document.addEventListener("keydown", this.handleFocusTrap) : document.addEventListener("keydown", $$2);
|
|
182
207
|
}
|
|
183
208
|
off() {
|
|
184
|
-
this.focusable.clear(), document.removeEventListener("keydown", this.handleFocusTrap), document.removeEventListener("keydown",
|
|
209
|
+
this.focusable.clear(), document.removeEventListener("keydown", this.handleFocusTrap), document.removeEventListener("keydown", $$2);
|
|
185
210
|
}
|
|
186
211
|
};
|
|
187
|
-
function
|
|
188
|
-
(
|
|
212
|
+
function $$2(i) {
|
|
213
|
+
(i.key === "Tab" || i.keyCode === 9) && i.preventDefault();
|
|
189
214
|
}
|
|
190
|
-
function
|
|
191
|
-
if (
|
|
192
|
-
const { activeElement: t } = document, { el: e, focusable:
|
|
193
|
-
if (r2 &&
|
|
194
|
-
|
|
195
|
-
const
|
|
196
|
-
|
|
215
|
+
function O$2(i) {
|
|
216
|
+
if (i.key !== "Tab" && i.keyCode !== 9) return;
|
|
217
|
+
const { activeElement: t } = document, { el: e, focusable: o } = this, r2 = i.shiftKey, n = t === o.first || t === e, s = t === o.last || t === e;
|
|
218
|
+
if (r2 && n || !r2 && s) {
|
|
219
|
+
i.preventDefault();
|
|
220
|
+
const c2 = r2 ? o.last : o.first;
|
|
221
|
+
c2 && typeof c2.focus == "function" && c2.focus();
|
|
197
222
|
}
|
|
198
223
|
}
|
|
199
|
-
function w$2(
|
|
200
|
-
const e = localStorage.getItem(
|
|
224
|
+
function w$2(i, t = true) {
|
|
225
|
+
const e = localStorage.getItem(i), o = e ? JSON.parse(e) : {};
|
|
201
226
|
return {
|
|
202
|
-
get(r2,
|
|
203
|
-
return r2 ? r2 in
|
|
227
|
+
get(r2, n) {
|
|
228
|
+
return r2 ? r2 in o ? o[r2] : n : o;
|
|
204
229
|
},
|
|
205
|
-
set(r2,
|
|
206
|
-
return
|
|
230
|
+
set(r2, n) {
|
|
231
|
+
return n ? o[r2] = n : delete o[r2], t && localStorage.setItem(i, JSON.stringify(o)), o;
|
|
207
232
|
}
|
|
208
233
|
};
|
|
209
234
|
}
|
|
210
|
-
|
|
235
|
+
class H extends Array {
|
|
211
236
|
constructor(t = {}) {
|
|
212
237
|
super(), this.presets = t;
|
|
213
238
|
}
|
|
214
|
-
|
|
215
|
-
const e =
|
|
216
|
-
t.
|
|
239
|
+
#t(t) {
|
|
240
|
+
const e = this.presets?.[t.name] || {}, o = t?.options || {};
|
|
241
|
+
t.config = { ...t.config, ...e, ...o };
|
|
217
242
|
}
|
|
218
|
-
|
|
243
|
+
#e(t) {
|
|
219
244
|
return !("name" in t) || typeof t.name != "string" ? (console.error("Plugin requires a name!"), false) : true;
|
|
220
245
|
}
|
|
221
246
|
get(t) {
|
|
222
|
-
return this.find((e) => e.name === t);
|
|
247
|
+
return this.find((e) => e.name === t) || null;
|
|
223
248
|
}
|
|
224
249
|
add(t) {
|
|
225
250
|
if (Array.isArray(t))
|
|
226
251
|
t.forEach((e) => this.add(e));
|
|
227
|
-
else if (this
|
|
228
|
-
const e = this.findIndex((
|
|
252
|
+
else if (this.#t(t), this.#e(t)) {
|
|
253
|
+
const e = this.findIndex((o) => o.name === t.name);
|
|
229
254
|
~e ? this[e] = t : this.push(t);
|
|
230
255
|
}
|
|
231
256
|
}
|
|
232
257
|
remove(t) {
|
|
233
|
-
const e = this.findIndex((
|
|
258
|
+
const e = this.findIndex((o) => o.name === t);
|
|
234
259
|
~e && this.splice(e, 1);
|
|
235
260
|
}
|
|
236
|
-
}
|
|
237
|
-
class
|
|
261
|
+
}
|
|
262
|
+
class _ extends Array {
|
|
238
263
|
constructor(t = {}) {
|
|
239
|
-
super(), this.
|
|
264
|
+
super(), this.config = t;
|
|
240
265
|
}
|
|
241
266
|
get copy() {
|
|
242
267
|
return [...this];
|
|
@@ -248,49 +273,104 @@ class W extends Array {
|
|
|
248
273
|
updateIndex() {
|
|
249
274
|
this.forEach((t, e) => {
|
|
250
275
|
t.el.style.zIndex = "";
|
|
251
|
-
const
|
|
252
|
-
t.el.style.zIndex =
|
|
276
|
+
const o = getComputedStyle(t.el).getPropertyValue("z-index"), r2 = parseInt(o, 10), n = String((Number.isNaN(r2) ? 0 : r2) + e + 1);
|
|
277
|
+
t.el.style.zIndex = n;
|
|
253
278
|
});
|
|
254
279
|
}
|
|
255
280
|
onChange() {
|
|
256
|
-
this.updateIndex(), typeof this.
|
|
281
|
+
this.updateIndex(), typeof this.config.onChange == "function" && this.config.onChange();
|
|
257
282
|
}
|
|
258
283
|
add(t) {
|
|
259
284
|
this.push(t), this.onChange();
|
|
260
285
|
}
|
|
261
286
|
remove(t) {
|
|
262
|
-
const e = this.findIndex((
|
|
287
|
+
const e = this.findIndex((o) => o.id === t.id);
|
|
263
288
|
~e && (t.el.style.zIndex = "", this.splice(e, 1), this.onChange());
|
|
264
289
|
}
|
|
265
290
|
moveToTop(t) {
|
|
266
|
-
const e = this.findIndex((
|
|
291
|
+
const e = this.findIndex((o) => o.id === t.id);
|
|
267
292
|
~e && (this.splice(e, 1), this.add(t));
|
|
268
293
|
}
|
|
269
294
|
}
|
|
270
|
-
const N$
|
|
295
|
+
const N$1 = {
|
|
296
|
+
attr: "config",
|
|
297
|
+
sourceKey: "attr"
|
|
298
|
+
};
|
|
299
|
+
function X$1(i = {}) {
|
|
300
|
+
return { ...{
|
|
301
|
+
name: "attrConfig",
|
|
302
|
+
config: N$1,
|
|
303
|
+
options: i
|
|
304
|
+
}, ...{
|
|
305
|
+
onCreateEntry({ entry: o }) {
|
|
306
|
+
const r2 = x$2(o.el, this.config.attr);
|
|
307
|
+
o.config.set(this.config.sourceKey, r2);
|
|
308
|
+
},
|
|
309
|
+
onDestroyEntry({ entry: o }) {
|
|
310
|
+
o.config.remove(this.config.sourceKey);
|
|
311
|
+
}
|
|
312
|
+
} };
|
|
313
|
+
}
|
|
314
|
+
const K$1 = {
|
|
315
|
+
sourceKey: "css"
|
|
316
|
+
};
|
|
317
|
+
function Y$1(i = {}) {
|
|
318
|
+
const t = {
|
|
319
|
+
name: "cssConfig",
|
|
320
|
+
config: K$1,
|
|
321
|
+
options: i
|
|
322
|
+
}, e = {
|
|
323
|
+
setup(r2) {
|
|
324
|
+
r2.on("updateCustomProps", o, this);
|
|
325
|
+
},
|
|
326
|
+
teardown(r2) {
|
|
327
|
+
r2.off("updateCustomProps", o);
|
|
328
|
+
},
|
|
329
|
+
onCreateEntry({ entry: r2 }) {
|
|
330
|
+
const n = b$2(r2);
|
|
331
|
+
r2.config.set(this.config.sourceKey, n);
|
|
332
|
+
},
|
|
333
|
+
onDestroyEntry({ entry: r2 }) {
|
|
334
|
+
r2.config.remove(this.config.sourceKey);
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
function o(r2, n) {
|
|
338
|
+
const s = b$2(r2);
|
|
339
|
+
r2.config.set(n.config.sourceKey, s);
|
|
340
|
+
}
|
|
341
|
+
return { ...t, ...e };
|
|
342
|
+
}
|
|
343
|
+
const Q = {
|
|
271
344
|
condition: true
|
|
272
|
-
},
|
|
345
|
+
}, q$2 = {
|
|
273
346
|
primary: "hsl(152deg 60% 50%)",
|
|
274
347
|
secondary: "hsl(214deg 50% 50%)",
|
|
275
348
|
neutral: "hsl(214deg 20% 50%)",
|
|
276
349
|
important: "hsl(0deg 80% 50%)"
|
|
277
350
|
};
|
|
278
|
-
function
|
|
351
|
+
function tt$1(i = {}) {
|
|
279
352
|
const t = {
|
|
280
353
|
name: "debug",
|
|
281
|
-
|
|
282
|
-
options:
|
|
354
|
+
config: Q,
|
|
355
|
+
options: i
|
|
283
356
|
};
|
|
284
|
-
function e(
|
|
285
|
-
const
|
|
286
|
-
console.log(`%c📡 DEBUG: %c${
|
|
287
|
-
}
|
|
288
|
-
function s(o2, ...i) {
|
|
289
|
-
return typeof o2 == "function" ? o2(...i) : o2;
|
|
357
|
+
function e(n, s = [], c2 = ["primary", "secondary"]) {
|
|
358
|
+
const a2 = c2.map((f2) => `color: ${q$2[f2]}`);
|
|
359
|
+
console.log(`%c📡 DEBUG: %c${n}`, ...a2, ...s);
|
|
290
360
|
}
|
|
291
|
-
const
|
|
292
|
-
beforeMountRef: e.bind(
|
|
293
|
-
|
|
361
|
+
const o = {
|
|
362
|
+
beforeMountRef: e.bind(
|
|
363
|
+
null,
|
|
364
|
+
"Event > beforeMount()",
|
|
365
|
+
[],
|
|
366
|
+
["primary", "secondary"]
|
|
367
|
+
),
|
|
368
|
+
afterMountRef: e.bind(
|
|
369
|
+
null,
|
|
370
|
+
"Event > afterMount()",
|
|
371
|
+
[],
|
|
372
|
+
["primary", "secondary"]
|
|
373
|
+
),
|
|
294
374
|
beforeUnmountRef: e.bind(
|
|
295
375
|
null,
|
|
296
376
|
"Event > beforeUnmount()",
|
|
@@ -303,33 +383,33 @@ function Z(n = {}) {
|
|
|
303
383
|
[],
|
|
304
384
|
["important", "neutral"]
|
|
305
385
|
),
|
|
306
|
-
createEntryRef: (
|
|
307
|
-
if (
|
|
308
|
-
const
|
|
309
|
-
e(`Event > createEntry() > [${
|
|
386
|
+
createEntryRef: ({ parent: n, entry: s }, c2) => {
|
|
387
|
+
if (h$2(c2.config.condition, s)) {
|
|
388
|
+
const a2 = n.collection.length;
|
|
389
|
+
e(`Event > createEntry() > [${a2}] #${s.id}`);
|
|
310
390
|
}
|
|
311
391
|
},
|
|
312
|
-
registerEntryRef: (
|
|
313
|
-
if (
|
|
314
|
-
const
|
|
315
|
-
e(`Event > registerEntry() > [${
|
|
392
|
+
registerEntryRef: ({ parent: n, entry: s }, c2) => {
|
|
393
|
+
if (h$2(c2.config.condition, s)) {
|
|
394
|
+
const a2 = n.collection.length;
|
|
395
|
+
e(`Event > registerEntry() > [${a2}] #${s.id}`);
|
|
316
396
|
}
|
|
317
397
|
},
|
|
318
|
-
destroyEntryRef: (
|
|
319
|
-
if (
|
|
320
|
-
const
|
|
398
|
+
destroyEntryRef: ({ parent: n, entry: s }, c2) => {
|
|
399
|
+
if (h$2(c2.config.condition, s)) {
|
|
400
|
+
const a2 = n.collection.length;
|
|
321
401
|
e(
|
|
322
|
-
`Event > destroyEntry() > [${
|
|
402
|
+
`Event > destroyEntry() > [${a2}] #${s.id}`,
|
|
323
403
|
[],
|
|
324
404
|
["important", "neutral"]
|
|
325
405
|
);
|
|
326
406
|
}
|
|
327
407
|
},
|
|
328
|
-
deregisterEntryRef: (
|
|
329
|
-
if (
|
|
330
|
-
const
|
|
408
|
+
deregisterEntryRef: ({ parent: n, entry: s }, c2) => {
|
|
409
|
+
if (h$2(c2.config.condition, s)) {
|
|
410
|
+
const a2 = n.collection.length;
|
|
331
411
|
e(
|
|
332
|
-
`Event > deregisterEntry() > [${
|
|
412
|
+
`Event > deregisterEntry() > [${a2}]`,
|
|
333
413
|
[],
|
|
334
414
|
["important", "neutral"]
|
|
335
415
|
);
|
|
@@ -338,39 +418,33 @@ function Z(n = {}) {
|
|
|
338
418
|
};
|
|
339
419
|
return { ...t, ...{
|
|
340
420
|
// Plugin setup/teardown methods
|
|
341
|
-
setup(
|
|
342
|
-
e("Plugin > setup()", Array.from(arguments), ["secondary", "neutral"]),
|
|
343
|
-
parent: o2,
|
|
344
|
-
plugin: this
|
|
345
|
-
}), o2.on("afterMount", r2.afterMountRef), o2.on("beforeUnmount", r2.beforeUnmountRef), o2.on("destroyEntry", r2.destroyEntryRef, { parent: o2, plugin: this }), o2.on("deregisterEntry", r2.deregisterEntryRef, {
|
|
346
|
-
parent: o2,
|
|
347
|
-
plugin: this
|
|
348
|
-
}), o2.on("afterUnmount", r2.afterUnmountRef);
|
|
421
|
+
setup(n) {
|
|
422
|
+
e("Plugin > setup()", Array.from(arguments), ["secondary", "neutral"]), n.on("beforeMount", o.beforeMountRef), n.on("createEntry", o.createEntryRef, this), n.on("registerEntry", o.registerEntryRef, this), n.on("afterMount", o.afterMountRef), n.on("beforeUnmount", o.beforeUnmountRef), n.on("destroyEntry", o.destroyEntryRef, this), n.on("deregisterEntry", o.deregisterEntryRef, this), n.on("afterUnmount", o.afterUnmountRef);
|
|
349
423
|
},
|
|
350
|
-
teardown(
|
|
424
|
+
teardown(n) {
|
|
351
425
|
e("Plugin > teardown()", Array.from(arguments), [
|
|
352
426
|
"secondary",
|
|
353
427
|
"neutral"
|
|
354
|
-
]),
|
|
428
|
+
]), n.off("beforeMount", o.beforeMountRef), n.off("createEntry", o.createEntryRef), n.off("registerEntry", o.registerEntryRef), n.off("afterMount", o.afterMountRef), n.off("beforeUnmount", o.beforeUnmountRef), n.off("destroyEntry", o.destroyEntryRef), n.off("deregisterEntry", o.deregisterEntryRef), n.off("afterUnmount", o.afterUnmountRef);
|
|
355
429
|
},
|
|
356
430
|
// Mount lifecycle hooks
|
|
357
431
|
beforeMount() {
|
|
358
432
|
e("Hook > beforeMount()", Array.from(arguments));
|
|
359
433
|
},
|
|
360
|
-
onCreateEntry({ parent:
|
|
361
|
-
if (
|
|
362
|
-
const
|
|
434
|
+
onCreateEntry({ parent: n, entry: s }) {
|
|
435
|
+
if (h$2(this.config.condition, s)) {
|
|
436
|
+
const c2 = n.collection.length;
|
|
363
437
|
e(
|
|
364
|
-
`Hook > onCreateEntry() > [${
|
|
438
|
+
`Hook > onCreateEntry() > [${c2}] #${s.id}`,
|
|
365
439
|
Array.from(arguments)
|
|
366
440
|
);
|
|
367
441
|
}
|
|
368
442
|
},
|
|
369
|
-
onRegisterEntry({ parent:
|
|
370
|
-
if (
|
|
371
|
-
const
|
|
443
|
+
onRegisterEntry({ parent: n, entry: s }) {
|
|
444
|
+
if (h$2(this.config.condition, s)) {
|
|
445
|
+
const c2 = n.collection.length - 1;
|
|
372
446
|
e(
|
|
373
|
-
`Hook > onRegisterEntry() > [${
|
|
447
|
+
`Hook > onRegisterEntry() > [${c2}] #${s.id}`,
|
|
374
448
|
Array.from(arguments)
|
|
375
449
|
);
|
|
376
450
|
}
|
|
@@ -385,20 +459,20 @@ function Z(n = {}) {
|
|
|
385
459
|
"neutral"
|
|
386
460
|
]);
|
|
387
461
|
},
|
|
388
|
-
onDestroyEntry({ parent:
|
|
389
|
-
if (
|
|
390
|
-
const
|
|
462
|
+
onDestroyEntry({ parent: n, entry: s }) {
|
|
463
|
+
if (h$2(this.config.condition, s)) {
|
|
464
|
+
const c2 = n.collection.length - 1;
|
|
391
465
|
e(
|
|
392
|
-
`Hook > onDestroyEntry() > [${
|
|
466
|
+
`Hook > onDestroyEntry() > [${c2}] #${s.id}`,
|
|
393
467
|
Array.from(arguments),
|
|
394
468
|
["important", "neutral"]
|
|
395
469
|
);
|
|
396
470
|
}
|
|
397
471
|
},
|
|
398
|
-
onDeregisterEntry({ parent:
|
|
399
|
-
if (
|
|
400
|
-
const
|
|
401
|
-
e(`Hook > onDeregisterEntry() > [${
|
|
472
|
+
onDeregisterEntry({ parent: n, entry: s }) {
|
|
473
|
+
if (h$2(this.config.condition, s)) {
|
|
474
|
+
const c2 = n.collection.length;
|
|
475
|
+
e(`Hook > onDeregisterEntry() > [${c2}]`, Array.from(arguments), [
|
|
402
476
|
"important",
|
|
403
477
|
"neutral"
|
|
404
478
|
]);
|
|
@@ -412,43 +486,40 @@ function Z(n = {}) {
|
|
|
412
486
|
}
|
|
413
487
|
} };
|
|
414
488
|
}
|
|
415
|
-
const
|
|
489
|
+
const F$1 = {
|
|
416
490
|
condition: true
|
|
417
491
|
};
|
|
418
|
-
function
|
|
492
|
+
function et$1(i = {}) {
|
|
419
493
|
const t = {
|
|
420
494
|
name: "focusTrap",
|
|
421
|
-
|
|
422
|
-
options:
|
|
495
|
+
config: F$1,
|
|
496
|
+
options: i
|
|
423
497
|
}, e = {
|
|
424
|
-
setup(
|
|
425
|
-
|
|
498
|
+
setup(n) {
|
|
499
|
+
n.on("opened", o, this), n.on("closed", r2, this);
|
|
426
500
|
},
|
|
427
|
-
teardown(
|
|
428
|
-
|
|
501
|
+
teardown(n) {
|
|
502
|
+
n.off("opened", o), n.off("closed", r2);
|
|
429
503
|
},
|
|
430
|
-
onCreateEntry({ entry:
|
|
431
|
-
|
|
504
|
+
onCreateEntry({ entry: n }) {
|
|
505
|
+
n.focusTrap = new D$2();
|
|
432
506
|
}
|
|
433
507
|
};
|
|
434
|
-
function
|
|
435
|
-
|
|
508
|
+
function o(n, s) {
|
|
509
|
+
const c2 = { plugin: s, parent: n.parent, entry: n };
|
|
510
|
+
n.focusTrap && h$2(s.config.condition, c2) && n.focusTrap.on(n.dialog);
|
|
436
511
|
}
|
|
437
|
-
function r2(
|
|
438
|
-
const
|
|
439
|
-
s
|
|
440
|
-
}
|
|
441
|
-
function a2(o2, i) {
|
|
442
|
-
const c = { plugin: i, parent: o2.parent, entry: o2 };
|
|
443
|
-
s(i.settings.condition, c) && o2.focusTrap?.off();
|
|
512
|
+
function r2(n, s) {
|
|
513
|
+
const c2 = { plugin: s, parent: n.parent, entry: n };
|
|
514
|
+
n.focusTrap && h$2(s.config.condition, c2) && n.focusTrap.off();
|
|
444
515
|
}
|
|
445
516
|
return { ...t, ...e };
|
|
446
517
|
}
|
|
447
|
-
const
|
|
518
|
+
const V = {
|
|
448
519
|
// The data attributes to get the breakpoint values from
|
|
449
|
-
|
|
520
|
+
attrBreakpoint: "breakpoint",
|
|
450
521
|
// The data attributes to get the media query value from
|
|
451
|
-
|
|
522
|
+
attrMediaQuery: "media-query",
|
|
452
523
|
// The string token to replace in the media query string
|
|
453
524
|
token: "{{BP}}",
|
|
454
525
|
// Sets a global breakpoint. Can be overridden by setting a data attribute
|
|
@@ -469,47 +540,47 @@ const F$1 = {
|
|
|
469
540
|
onChange: () => {
|
|
470
541
|
}
|
|
471
542
|
};
|
|
472
|
-
function
|
|
543
|
+
function ot$1(i = {}) {
|
|
473
544
|
const t = {
|
|
474
545
|
name: "mediaQuery",
|
|
475
|
-
|
|
476
|
-
options:
|
|
546
|
+
config: V,
|
|
547
|
+
options: i
|
|
477
548
|
}, e = {
|
|
478
549
|
// Run when an entry is created
|
|
479
550
|
// Sets up the MediaQueryList and event listener
|
|
480
|
-
onCreateEntry({ entry:
|
|
481
|
-
|
|
551
|
+
onCreateEntry({ entry: c2 }) {
|
|
552
|
+
n.call(this, c2);
|
|
482
553
|
},
|
|
483
554
|
// Run when an entry is destroyed
|
|
484
555
|
// Removes the MediaQueryList and event listener
|
|
485
|
-
onDestroyEntry({ entry:
|
|
486
|
-
|
|
556
|
+
onDestroyEntry({ entry: c2 }) {
|
|
557
|
+
s(c2);
|
|
487
558
|
}
|
|
488
559
|
};
|
|
489
|
-
function
|
|
490
|
-
const
|
|
491
|
-
return !
|
|
492
|
-
}
|
|
493
|
-
function r2(
|
|
494
|
-
let
|
|
495
|
-
return !
|
|
496
|
-
}
|
|
497
|
-
function
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
this.
|
|
505
|
-
}, this.
|
|
506
|
-
}
|
|
507
|
-
function
|
|
508
|
-
|
|
560
|
+
function o(c2) {
|
|
561
|
+
const a2 = c2.el.getAttribute(`data-${this.config.attrMediaQuery}`);
|
|
562
|
+
return !a2 && c2.id in this.config.mediaQueries ? this.config.mediaQueries[c2.id] : a2 || void 0;
|
|
563
|
+
}
|
|
564
|
+
function r2(c2) {
|
|
565
|
+
let a2 = c2.el.getAttribute(`data-${this.config.attrBreakpoint}`);
|
|
566
|
+
return !a2 && c2.id in this.config.breakpoints && (a2 = this.config.breakpoints[c2.id]), a2 && a2 in this.config.breakpoints && (a2 = this.config.breakpoints[a2]), a2 && (a2 = getComputedStyle(document.body).getPropertyValue(`--${y$2()}breakpoint-${a2}`).trim() || a2), a2 || this.config.breakpoint;
|
|
567
|
+
}
|
|
568
|
+
function n(c2) {
|
|
569
|
+
const a2 = r2.call(this, c2);
|
|
570
|
+
if (!a2) return;
|
|
571
|
+
let f2 = o.call(this, c2) || this.config.mediaQuery;
|
|
572
|
+
if (!f2) return;
|
|
573
|
+
const p2 = f2.replace(new RegExp(`${this.config.token}`, "g"), a2);
|
|
574
|
+
c2.mql = window.matchMedia(p2), c2.mql.onchange = (E2) => {
|
|
575
|
+
this.config.onChange(E2, c2);
|
|
576
|
+
}, this.config.onChange(c2.mql, c2);
|
|
577
|
+
}
|
|
578
|
+
function s(c2) {
|
|
579
|
+
c2.mql && (c2.mql.onchange = null, c2.mql = null);
|
|
509
580
|
}
|
|
510
581
|
return { ...t, ...e };
|
|
511
582
|
}
|
|
512
|
-
const
|
|
583
|
+
const B = {
|
|
513
584
|
// The property on entry objects to watch
|
|
514
585
|
prop: "state",
|
|
515
586
|
// The default value or a function to compute the initial value
|
|
@@ -525,280 +596,250 @@ const V$1 = {
|
|
|
525
596
|
onChange() {
|
|
526
597
|
}
|
|
527
598
|
};
|
|
528
|
-
function
|
|
599
|
+
function nt$1(i = {}) {
|
|
529
600
|
const t = {
|
|
530
601
|
name: "propStore",
|
|
531
|
-
|
|
532
|
-
options:
|
|
602
|
+
config: B,
|
|
603
|
+
options: i,
|
|
533
604
|
store: null
|
|
534
605
|
}, e = {
|
|
535
|
-
setup(
|
|
536
|
-
this.store = w$2(
|
|
606
|
+
setup(s) {
|
|
607
|
+
this.store = w$2(n.call(this, s.name));
|
|
537
608
|
},
|
|
538
|
-
async onCreateEntry({ entry:
|
|
539
|
-
await
|
|
609
|
+
async onCreateEntry({ entry: s }) {
|
|
610
|
+
await o.call(this, s);
|
|
540
611
|
},
|
|
541
|
-
onDestroyEntry({ entry:
|
|
542
|
-
|
|
612
|
+
onDestroyEntry({ entry: s }) {
|
|
613
|
+
r2.call(this, s);
|
|
543
614
|
}
|
|
544
615
|
};
|
|
545
|
-
async function s
|
|
546
|
-
let
|
|
547
|
-
const
|
|
548
|
-
Object.defineProperty(
|
|
616
|
+
async function o(s) {
|
|
617
|
+
let c2 = s[this.config.prop] || null;
|
|
618
|
+
const a2 = { plugin: this, parent: s.parent, entry: s };
|
|
619
|
+
Object.defineProperty(s, this.config.prop, {
|
|
549
620
|
configurable: true,
|
|
550
621
|
get() {
|
|
551
|
-
return
|
|
622
|
+
return c2;
|
|
552
623
|
},
|
|
553
|
-
set: async (
|
|
554
|
-
if (
|
|
555
|
-
const p2 =
|
|
556
|
-
|
|
557
|
-
this.
|
|
558
|
-
|
|
559
|
-
|
|
624
|
+
set: async (f2) => {
|
|
625
|
+
if (c2 === f2) return;
|
|
626
|
+
const p2 = c2;
|
|
627
|
+
c2 = f2, h$2(
|
|
628
|
+
this.config.condition,
|
|
629
|
+
a2,
|
|
630
|
+
f2,
|
|
560
631
|
p2
|
|
561
|
-
) && this.store
|
|
632
|
+
) && this.store?.set(s.id, f2), await this.config.onChange(a2, f2, p2);
|
|
562
633
|
}
|
|
563
|
-
}), Object.defineProperty(
|
|
634
|
+
}), Object.defineProperty(s, "store", {
|
|
564
635
|
configurable: true,
|
|
565
|
-
get: () => this.store
|
|
566
|
-
set: (
|
|
567
|
-
|
|
636
|
+
get: () => this.store?.get(s.id),
|
|
637
|
+
set: (f2) => {
|
|
638
|
+
s[this.config.prop] = f2;
|
|
568
639
|
}
|
|
569
|
-
}),
|
|
640
|
+
}), s[this.config.prop] = await h$2(this.config.value, a2) || s[this.config.prop];
|
|
570
641
|
}
|
|
571
|
-
function r2(
|
|
572
|
-
|
|
642
|
+
async function r2(s) {
|
|
643
|
+
const c2 = s[this.config.prop];
|
|
644
|
+
delete s[this.config.prop], s[this.config.prop] = c2, this.store?.set(s.id, null);
|
|
573
645
|
}
|
|
574
|
-
|
|
575
|
-
const
|
|
576
|
-
|
|
577
|
-
}
|
|
578
|
-
function o2(i) {
|
|
579
|
-
const c = this.settings.prop.charAt(0).toUpperCase() + this.settings.prop.slice(1), l2 = this.settings.key || i + c;
|
|
580
|
-
return this.settings.keyPrefix + l2;
|
|
646
|
+
function n(s) {
|
|
647
|
+
const c2 = this.config.prop.charAt(0).toUpperCase() + this.config.prop.slice(1), a2 = this.config.key || s + c2;
|
|
648
|
+
return this.config.keyPrefix + a2;
|
|
581
649
|
}
|
|
582
650
|
return { ...t, ...e };
|
|
583
651
|
}
|
|
584
|
-
const
|
|
652
|
+
const j$1 = {
|
|
585
653
|
where: null,
|
|
586
654
|
how: "append"
|
|
587
655
|
};
|
|
588
|
-
function
|
|
656
|
+
function it$1(i = {}) {
|
|
589
657
|
const t = {
|
|
590
658
|
name: "teleport",
|
|
591
|
-
|
|
592
|
-
options:
|
|
659
|
+
config: j$1,
|
|
660
|
+
options: i
|
|
593
661
|
}, e = {
|
|
594
|
-
onCreateEntry({
|
|
595
|
-
|
|
662
|
+
onCreateEntry({ entry: n }) {
|
|
663
|
+
o(this, n);
|
|
596
664
|
},
|
|
597
|
-
onDestroyEntry({
|
|
598
|
-
r2(
|
|
665
|
+
onDestroyEntry({ entry: n }) {
|
|
666
|
+
r2(this, n);
|
|
599
667
|
}
|
|
600
668
|
};
|
|
601
|
-
function
|
|
602
|
-
|
|
603
|
-
typeof
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
669
|
+
function o(n, s) {
|
|
670
|
+
s.teleport = () => {
|
|
671
|
+
typeof s.teleportReturn == "function" && s.teleportReturn(), s.teleportReturn = k$3(
|
|
672
|
+
s.el,
|
|
673
|
+
s.config.get("teleport", { fallback: n.config.where }),
|
|
674
|
+
s.config.get("teleportMethod", { fallback: n.config.how })
|
|
607
675
|
);
|
|
608
|
-
},
|
|
676
|
+
}, s.teleport(), s.parent.emit("teleport", { plugin: n, parent: s.parent, entry: s });
|
|
609
677
|
}
|
|
610
|
-
function r2(
|
|
611
|
-
typeof
|
|
612
|
-
plugin:
|
|
613
|
-
parent:
|
|
614
|
-
entry:
|
|
678
|
+
function r2(n, s) {
|
|
679
|
+
typeof s.teleportReturn == "function" && s.teleportReturn(), s.parent.emit("teleportReturn", {
|
|
680
|
+
plugin: n,
|
|
681
|
+
parent: s.parent,
|
|
682
|
+
entry: s
|
|
615
683
|
});
|
|
616
684
|
}
|
|
617
685
|
return { ...t, ...e };
|
|
618
686
|
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
};
|
|
623
|
-
let z$3 = class z {
|
|
624
|
-
constructor(t, e, s = {}) {
|
|
625
|
-
this.parent = t, this.el = E$3(e), this.settings = { ...s }, this.dataConfig = {}, this.customProps = {};
|
|
626
|
-
}
|
|
627
|
-
get id() {
|
|
628
|
-
return this.el.id;
|
|
629
|
-
}
|
|
630
|
-
applySettings(t) {
|
|
631
|
-
return Object.assign(this.settings, t);
|
|
632
|
-
}
|
|
633
|
-
getSetting(t, e) {
|
|
634
|
-
return A$2.call(this, t, e);
|
|
635
|
-
}
|
|
636
|
-
buildDataConfig() {
|
|
637
|
-
return Object.assign(
|
|
638
|
-
this.dataConfig,
|
|
639
|
-
C$2(this.el, this.getSetting("dataConfig"))
|
|
640
|
-
);
|
|
641
|
-
}
|
|
642
|
-
buildCustomProps() {
|
|
643
|
-
return Object.assign(this.customProps, M$2(this));
|
|
644
|
-
}
|
|
645
|
-
async init(t = {}) {
|
|
646
|
-
this.applySettings(t), this.buildDataConfig(), this.buildCustomProps();
|
|
647
|
-
}
|
|
648
|
-
async destroy() {
|
|
649
|
-
Object.getOwnPropertyNames(this).forEach((t) => {
|
|
650
|
-
delete this[t];
|
|
651
|
-
});
|
|
687
|
+
let z$1 = class z {
|
|
688
|
+
constructor(t, e) {
|
|
689
|
+
this.config = new I$3(), this.parent = t, this.el = v$2(e), this.id = this.el.id, this.config.set("parent", this.parent.config), this.config.set("entry", {});
|
|
652
690
|
}
|
|
653
691
|
};
|
|
654
|
-
|
|
692
|
+
const J$1 = {
|
|
693
|
+
selector: "",
|
|
694
|
+
plugins: [],
|
|
695
|
+
presets: {}
|
|
696
|
+
};
|
|
697
|
+
let st$1 = class st {
|
|
655
698
|
constructor(t = {}) {
|
|
656
|
-
this.
|
|
699
|
+
this.#t = new L$2(), this.events = this.#t.events, this.on = this.#t.on.bind(this.#t), this.off = this.#t.off.bind(this.#t), this.emit = this.#t.emit.bind(this.#t), this.collection = [], this.entryClass = z$1, this.name = this.constructor.name, this.config = { ...J$1, ...t }, this.plugins = new H(this.config.presets);
|
|
657
700
|
}
|
|
701
|
+
#t;
|
|
658
702
|
get(t, e = "id") {
|
|
659
|
-
return this.collection.find((
|
|
703
|
+
return this.collection.find((o) => o[e] === t);
|
|
704
|
+
}
|
|
705
|
+
getOrThrow(t, e = "id") {
|
|
706
|
+
const o = this.get(t, e);
|
|
707
|
+
if (o)
|
|
708
|
+
return o;
|
|
709
|
+
throw new Error(
|
|
710
|
+
`${this.name} entry not found in collection with ${String(e)} of "${t}"`
|
|
711
|
+
);
|
|
660
712
|
}
|
|
661
|
-
|
|
662
|
-
return Object.assign(this.
|
|
713
|
+
updateConfig(t = {}) {
|
|
714
|
+
return Object.assign(this.config, t);
|
|
663
715
|
}
|
|
664
|
-
async createEntry(t
|
|
665
|
-
const
|
|
666
|
-
return await g$
|
|
716
|
+
async createEntry(t) {
|
|
717
|
+
const e = new this.entryClass(this, t);
|
|
718
|
+
return await g$2(e, "init"), await d$1("onCreateEntry", this, e), e;
|
|
667
719
|
}
|
|
668
720
|
async destroyEntry(t) {
|
|
669
|
-
return await
|
|
670
|
-
}
|
|
671
|
-
async register(t
|
|
672
|
-
const
|
|
673
|
-
|
|
674
|
-
const a2 = this.collection[r2];
|
|
675
|
-
return a2.el = s, typeof a2.init == "function" && await a2.init(e), a2;
|
|
676
|
-
} else {
|
|
677
|
-
const a2 = await this.createEntry(s, e);
|
|
678
|
-
return this.collection.push(a2), await h$1("onRegisterEntry", this, a2), a2;
|
|
679
|
-
}
|
|
721
|
+
return await d$1("onDestroyEntry", this, t), await g$2(t, "destroy"), t;
|
|
722
|
+
}
|
|
723
|
+
async register(t) {
|
|
724
|
+
const e = this.collection.findIndex((o) => o.id === t.id);
|
|
725
|
+
return ~e ? this.collection[e] = t : this.collection.push(t), await d$1("onRegisterEntry", this, t), t;
|
|
680
726
|
}
|
|
681
727
|
async deregister(t) {
|
|
682
|
-
const e = this.collection.findIndex((
|
|
728
|
+
const e = this.collection.findIndex((o) => o.id === t.id);
|
|
683
729
|
if (~e) {
|
|
684
|
-
|
|
685
|
-
return await h$1(
|
|
730
|
+
await d$1(
|
|
686
731
|
"onDeregisterEntry",
|
|
687
732
|
this,
|
|
688
733
|
this.collection[e]
|
|
689
|
-
)
|
|
734
|
+
);
|
|
735
|
+
const [o] = this.collection.splice(e, 1);
|
|
690
736
|
}
|
|
691
|
-
return
|
|
737
|
+
return t;
|
|
692
738
|
}
|
|
693
|
-
async mount(t =
|
|
694
|
-
this.
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
return await
|
|
704
|
-
}
|
|
705
|
-
async unmount() {
|
|
706
|
-
for (await
|
|
707
|
-
await this.
|
|
708
|
-
await
|
|
709
|
-
for (const
|
|
710
|
-
await g$
|
|
711
|
-
for (const
|
|
712
|
-
this.plugins.remove(
|
|
739
|
+
async mount(t = (e) => e) {
|
|
740
|
+
for (const e of this.config?.plugins || [])
|
|
741
|
+
this.plugins.add(e);
|
|
742
|
+
for (const e of this.plugins)
|
|
743
|
+
await g$2(e, "setup", this);
|
|
744
|
+
if (await d$1("beforeMount", this), this.config.selector) {
|
|
745
|
+
const e = document.querySelectorAll(this.config.selector);
|
|
746
|
+
for (const o of e)
|
|
747
|
+
await this.createEntry(o).then((r2) => t(r2)).then((r2) => this.register(r2));
|
|
748
|
+
}
|
|
749
|
+
return await d$1("afterMount", this), this;
|
|
750
|
+
}
|
|
751
|
+
async unmount(t = (e) => e) {
|
|
752
|
+
for (await d$1("beforeUnmount", this); this.collection.length > 0; )
|
|
753
|
+
await this.destroyEntry(this.collection[0]).then((e) => t(e)).then((e) => this.deregister(e));
|
|
754
|
+
await d$1("afterUnmount", this);
|
|
755
|
+
for (const e of this.plugins)
|
|
756
|
+
await g$2(e, "teardown", this);
|
|
757
|
+
for (const e of [...this.plugins])
|
|
758
|
+
this.plugins.remove(e.name);
|
|
713
759
|
return this;
|
|
714
760
|
}
|
|
715
761
|
};
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
settings: t,
|
|
762
|
+
const G = {
|
|
763
|
+
prefix: S$3("theme-prefix", { fallback: "vb-theme-" }),
|
|
764
|
+
storeKey: "VB:Profile",
|
|
765
|
+
fallback: "root",
|
|
766
|
+
themes: ["root", "light", "dark"],
|
|
767
|
+
onInit() {
|
|
768
|
+
},
|
|
769
|
+
onChange() {
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
function rt$1(i = {}) {
|
|
773
|
+
const t = { ...G, ...i };
|
|
774
|
+
function e(n) {
|
|
775
|
+
t[n].call(r2);
|
|
776
|
+
}
|
|
777
|
+
const o = w$2(t.storeKey), r2 = {
|
|
778
|
+
// Store our config in the API
|
|
779
|
+
config: t,
|
|
735
780
|
// Actions
|
|
736
|
-
add(
|
|
737
|
-
t.themes.push(
|
|
738
|
-
},
|
|
739
|
-
remove(a2) {
|
|
740
|
-
const o2 = t.themes.indexOf(a2);
|
|
741
|
-
~o2 && t.themes.splice(o2, 1);
|
|
781
|
+
add(n) {
|
|
782
|
+
t.themes.push(n);
|
|
742
783
|
},
|
|
743
|
-
|
|
744
|
-
|
|
784
|
+
remove(n) {
|
|
785
|
+
const s = t.themes.indexOf(n);
|
|
786
|
+
~s && t.themes.splice(s, 1);
|
|
745
787
|
},
|
|
746
788
|
// Getters
|
|
747
789
|
get class() {
|
|
748
790
|
return `${t.prefix}${this.theme}`;
|
|
749
791
|
},
|
|
750
792
|
get classes() {
|
|
751
|
-
return t.themes.map((
|
|
793
|
+
return t.themes.map((n) => `${t.prefix}${n}`);
|
|
752
794
|
},
|
|
753
795
|
get themes() {
|
|
754
796
|
return t.themes;
|
|
755
797
|
},
|
|
756
798
|
// Setup the theme get and set methods
|
|
757
799
|
get theme() {
|
|
758
|
-
return
|
|
800
|
+
return o.get("theme") || t.fallback;
|
|
759
801
|
},
|
|
760
|
-
set theme(
|
|
761
|
-
t.themes.includes(
|
|
802
|
+
set theme(n) {
|
|
803
|
+
t.themes.includes(n) ? this.theme != n && (o.set("theme", n), document.documentElement.classList.remove(...this.classes), document.documentElement.classList.add(`${t.prefix}${n}`), e("onChange")) : console.error(`Not a valid theme value: "${n}"`);
|
|
762
804
|
}
|
|
763
805
|
};
|
|
764
|
-
return
|
|
806
|
+
return e("onInit"), r2;
|
|
765
807
|
}
|
|
766
808
|
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
767
809
|
__proto__: null,
|
|
768
|
-
Collection:
|
|
769
|
-
CollectionEntry: z$
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
810
|
+
Collection: st$1,
|
|
811
|
+
CollectionEntry: z$1,
|
|
812
|
+
ConfigManager: I$3,
|
|
813
|
+
EventEmitter: L$2,
|
|
814
|
+
FocusTrap: D$2,
|
|
815
|
+
FocusableArray: U$1,
|
|
816
|
+
PluginArray: H,
|
|
817
|
+
StackArray: _,
|
|
818
|
+
attrConfig: X$1,
|
|
819
|
+
cssConfig: Y$1,
|
|
820
|
+
cssVar: S$3,
|
|
821
|
+
debug: tt$1,
|
|
822
|
+
dispatchLifecycleHook: d$1,
|
|
823
|
+
focusTrap: et$1,
|
|
824
|
+
focusableSelectors: C$2,
|
|
825
|
+
getAttrData: x$2,
|
|
826
|
+
getCustomProps: b$2,
|
|
827
|
+
getElement: v$2,
|
|
783
828
|
getPrefix: y$2,
|
|
784
|
-
|
|
829
|
+
getValue: h$2,
|
|
785
830
|
localStore: w$2,
|
|
786
|
-
maybeRunMethod: g$
|
|
787
|
-
mediaQuery:
|
|
788
|
-
propStore:
|
|
789
|
-
setGlobalState:
|
|
790
|
-
teleport:
|
|
791
|
-
teleportElement:
|
|
792
|
-
themeStore:
|
|
793
|
-
toCamel:
|
|
794
|
-
toKebab:
|
|
795
|
-
toMilliseconds:
|
|
796
|
-
transition:
|
|
831
|
+
maybeRunMethod: g$2,
|
|
832
|
+
mediaQuery: ot$1,
|
|
833
|
+
propStore: nt$1,
|
|
834
|
+
setGlobalState: Z,
|
|
835
|
+
teleport: it$1,
|
|
836
|
+
teleportElement: k$3,
|
|
837
|
+
themeStore: rt$1,
|
|
838
|
+
toCamel: R$1,
|
|
839
|
+
toKebab: M$2,
|
|
840
|
+
toMilliseconds: A$3,
|
|
841
|
+
transition: W$1
|
|
797
842
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
798
|
-
function b$1(t, e = "config") {
|
|
799
|
-
const s = (t.getAttribute(`data-${e}`) || "").replace(/'/g, '"');
|
|
800
|
-
return s ? JSON.parse(s) : {};
|
|
801
|
-
}
|
|
802
843
|
function p$1(t) {
|
|
803
844
|
if (typeof t == "string") {
|
|
804
845
|
const e = document.getElementById(t);
|
|
@@ -814,15 +855,7 @@ function p$1(t) {
|
|
|
814
855
|
async function r$1(t, e, ...s) {
|
|
815
856
|
e in t && typeof t[e] == "function" && await t[e](...s);
|
|
816
857
|
}
|
|
817
|
-
function
|
|
818
|
-
return t.split("-").map(
|
|
819
|
-
(e, s) => s === 0 ? e : e.charAt(0).toUpperCase() + e.slice(1)
|
|
820
|
-
).join("");
|
|
821
|
-
}
|
|
822
|
-
function m$1(t) {
|
|
823
|
-
return t.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
824
|
-
}
|
|
825
|
-
function L$1(t) {
|
|
858
|
+
function w$1(t) {
|
|
826
859
|
if (typeof t == "number")
|
|
827
860
|
return t;
|
|
828
861
|
const e = parseFloat(t);
|
|
@@ -832,96 +865,127 @@ function L$1(t) {
|
|
|
832
865
|
}
|
|
833
866
|
throw new Error(`Could not convert value to milliseconds: ${t}`);
|
|
834
867
|
}
|
|
835
|
-
function
|
|
836
|
-
return new Promise((
|
|
868
|
+
function f(t, e, s, i, o = 0) {
|
|
869
|
+
return new Promise((n) => {
|
|
837
870
|
t.classList.remove(e), t.classList.add(s), setTimeout(() => {
|
|
838
|
-
t.classList.add(i), t.classList.remove(s),
|
|
839
|
-
},
|
|
871
|
+
t.classList.add(i), t.classList.remove(s), n(t);
|
|
872
|
+
}, w$1(o));
|
|
840
873
|
});
|
|
841
874
|
}
|
|
842
|
-
|
|
875
|
+
function v$1(t, e = {}) {
|
|
876
|
+
const s = {
|
|
877
|
+
fallback: null,
|
|
878
|
+
element: document.body,
|
|
879
|
+
...e
|
|
880
|
+
};
|
|
881
|
+
if (!t.startsWith("--")) {
|
|
882
|
+
const o = E$1();
|
|
883
|
+
o && (t = `${o}${t}`), t = `--${t}`;
|
|
884
|
+
}
|
|
885
|
+
const i = getComputedStyle(s.element).getPropertyValue(t).trim();
|
|
886
|
+
if (i)
|
|
887
|
+
return i;
|
|
888
|
+
if (s.fallback)
|
|
889
|
+
return s.fallback;
|
|
890
|
+
throw new Error(`CSS variable "${t}" was not found!`);
|
|
891
|
+
}
|
|
892
|
+
async function a$1(t, e, s) {
|
|
843
893
|
await r$1(e, t, s), s && await r$1(s, t);
|
|
844
894
|
for (const i of e.plugins)
|
|
845
|
-
await r$1(i, t, {
|
|
846
|
-
await e.emit(t, s);
|
|
847
|
-
}
|
|
848
|
-
function O$1(t) {
|
|
849
|
-
const e = getComputedStyle(t.el), s = {}, i = t.getSetting("customProps");
|
|
850
|
-
for (let n = 0; n < i.length; n++) {
|
|
851
|
-
const a2 = M$1(), c = t.parent.module.toLowerCase(), h2 = m$1(i[n]), f2 = e.getPropertyValue(`--${a2}${c}-${h2}`).trim();
|
|
852
|
-
f2 && (s[h2] = f2);
|
|
853
|
-
}
|
|
854
|
-
return s;
|
|
895
|
+
await r$1(i, t, { parent: e, entry: s });
|
|
896
|
+
await e.emit(t, { parent: e, entry: s });
|
|
855
897
|
}
|
|
856
|
-
function
|
|
898
|
+
function E$1() {
|
|
857
899
|
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
858
900
|
}
|
|
859
|
-
function
|
|
860
|
-
return e = s === "camel" ? C$1(e) : m$1(e), t.split(".").concat(e).reduce((i, n) => i?.[n], this);
|
|
861
|
-
}
|
|
862
|
-
function P$2(t, e = {}) {
|
|
863
|
-
const {
|
|
864
|
-
fallback: s,
|
|
865
|
-
props: i = ["dataConfig", "customProps", "settings", "parent.settings"]
|
|
866
|
-
} = e;
|
|
867
|
-
for (const n of i) {
|
|
868
|
-
const a2 = n !== "customProps" ? "camel" : "kebab", c = $$1.call(this, n, t, a2);
|
|
869
|
-
if (c !== void 0)
|
|
870
|
-
return c;
|
|
871
|
-
}
|
|
872
|
-
if (s !== void 0)
|
|
873
|
-
return s;
|
|
874
|
-
throw new Error(`${this.parent.module} setting does not exist: ${t}`);
|
|
875
|
-
}
|
|
876
|
-
function x$1(t, e) {
|
|
901
|
+
function b$1(t, e) {
|
|
877
902
|
e && document.querySelectorAll(e).forEach((s) => {
|
|
878
903
|
t ? s.style.overflow = "hidden" : s.style.removeProperty("overflow");
|
|
879
904
|
});
|
|
880
905
|
}
|
|
881
|
-
function
|
|
906
|
+
function C$1(t, e) {
|
|
882
907
|
e && document.querySelectorAll(e).forEach((s) => {
|
|
883
|
-
|
|
908
|
+
s.inert = t;
|
|
884
909
|
});
|
|
885
910
|
}
|
|
886
|
-
function
|
|
887
|
-
|
|
911
|
+
function c$1(t, e, s) {
|
|
912
|
+
C$1(!!t, e), b$1(!!t, s);
|
|
888
913
|
}
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
914
|
+
let S$2 = class S {
|
|
915
|
+
#t;
|
|
916
|
+
#e;
|
|
917
|
+
constructor() {
|
|
918
|
+
this.#t = {}, this.#e = [];
|
|
919
|
+
}
|
|
920
|
+
get(e, s) {
|
|
921
|
+
const { fallback: i, source: o } = s ?? {};
|
|
922
|
+
if (o) {
|
|
923
|
+
const n = this.#t?.[o]?.[e];
|
|
924
|
+
if (n !== void 0)
|
|
925
|
+
return n;
|
|
926
|
+
} else
|
|
927
|
+
for (const n of this.#e) {
|
|
928
|
+
const d2 = this.#t?.[n]?.[e];
|
|
929
|
+
if (d2 !== void 0)
|
|
930
|
+
return d2;
|
|
931
|
+
}
|
|
932
|
+
if (i !== void 0)
|
|
933
|
+
return i;
|
|
934
|
+
throw new Error(`Config does not exist: ${e}`);
|
|
935
|
+
}
|
|
936
|
+
set(e, s = {}) {
|
|
937
|
+
let i, o;
|
|
938
|
+
return typeof e == "string" ? (i = e, o = s) : (i = "entry", o = e), this.#t[i] ? Object.assign(this.#t[i], o) : (this.#e.unshift(i), this.#t[i] = o), this.#t[i];
|
|
939
|
+
}
|
|
940
|
+
remove(e) {
|
|
941
|
+
const s = this.#e.indexOf(e);
|
|
942
|
+
s !== -1 && this.#e.splice(s, 1), delete this.#t[e];
|
|
943
|
+
}
|
|
944
|
+
setSourceOrder(e) {
|
|
945
|
+
const s = Object.keys(this.#t).reverse(), i = e.filter((o) => s.includes(o));
|
|
946
|
+
for (const o of s)
|
|
947
|
+
i.includes(o) || i.push(o);
|
|
948
|
+
return this.#e = i;
|
|
949
|
+
}
|
|
950
|
+
};
|
|
951
|
+
let O$1 = class O {
|
|
952
|
+
constructor() {
|
|
953
|
+
this.events = {};
|
|
954
|
+
}
|
|
955
|
+
on(e, s, ...i) {
|
|
956
|
+
this.events[e] || (this.events[e] = []), this.events[e].some(
|
|
957
|
+
(o) => o.listener === s
|
|
958
|
+
) || this.events[e].push({ listener: s, args: i });
|
|
959
|
+
}
|
|
960
|
+
off(e, s) {
|
|
961
|
+
this.events[e] && (this.events[e] = this.events[e].filter(
|
|
962
|
+
(i) => i.listener !== s
|
|
899
963
|
));
|
|
900
|
-
}
|
|
901
|
-
async emit(
|
|
902
|
-
if (
|
|
903
|
-
for (const { listener:
|
|
904
|
-
await s
|
|
964
|
+
}
|
|
965
|
+
async emit(e, ...s) {
|
|
966
|
+
if (e = e.startsWith("on") ? e.slice(2, 3).toLowerCase() + e.slice(3) : e, !!this.events[e])
|
|
967
|
+
for (const { listener: i, args: o } of this.events[e])
|
|
968
|
+
await i(...s, ...o);
|
|
905
969
|
}
|
|
906
970
|
};
|
|
907
|
-
let
|
|
971
|
+
let L$1 = class L2 extends Array {
|
|
908
972
|
constructor(e = {}) {
|
|
909
973
|
super(), this.presets = e;
|
|
910
974
|
}
|
|
911
|
-
|
|
912
|
-
const s =
|
|
913
|
-
e.
|
|
975
|
+
#t(e) {
|
|
976
|
+
const s = this.presets?.[e.name] || {}, i = e?.options || {};
|
|
977
|
+
e.config = { ...e.config, ...s, ...i };
|
|
914
978
|
}
|
|
915
|
-
|
|
979
|
+
#e(e) {
|
|
916
980
|
return !("name" in e) || typeof e.name != "string" ? (console.error("Plugin requires a name!"), false) : true;
|
|
917
981
|
}
|
|
918
982
|
get(e) {
|
|
919
|
-
return this.find((s) => s.name === e);
|
|
983
|
+
return this.find((s) => s.name === e) || null;
|
|
920
984
|
}
|
|
921
985
|
add(e) {
|
|
922
986
|
if (Array.isArray(e))
|
|
923
987
|
e.forEach((s) => this.add(s));
|
|
924
|
-
else if (this
|
|
988
|
+
else if (this.#t(e), this.#e(e)) {
|
|
925
989
|
const s = this.findIndex((i) => i.name === e.name);
|
|
926
990
|
~s ? this[s] = e : this.push(e);
|
|
927
991
|
}
|
|
@@ -931,104 +995,83 @@ let y$1 = class y extends Array {
|
|
|
931
995
|
~s && this.splice(s, 1);
|
|
932
996
|
}
|
|
933
997
|
};
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
};
|
|
938
|
-
let S$1 = class S {
|
|
939
|
-
constructor(e, s, i = {}) {
|
|
940
|
-
this.parent = e, this.el = p$1(s), this.settings = { ...i }, this.dataConfig = {}, this.customProps = {};
|
|
941
|
-
}
|
|
942
|
-
get id() {
|
|
943
|
-
return this.el.id;
|
|
944
|
-
}
|
|
945
|
-
applySettings(e) {
|
|
946
|
-
return Object.assign(this.settings, e);
|
|
947
|
-
}
|
|
948
|
-
getSetting(e, s) {
|
|
949
|
-
return P$2.call(this, e, s);
|
|
950
|
-
}
|
|
951
|
-
buildDataConfig() {
|
|
952
|
-
return Object.assign(
|
|
953
|
-
this.dataConfig,
|
|
954
|
-
b$1(this.el, this.getSetting("dataConfig"))
|
|
955
|
-
);
|
|
956
|
-
}
|
|
957
|
-
buildCustomProps() {
|
|
958
|
-
return Object.assign(this.customProps, O$1(this));
|
|
959
|
-
}
|
|
960
|
-
async init(e = {}) {
|
|
961
|
-
this.applySettings(e), this.buildDataConfig(), this.buildCustomProps();
|
|
962
|
-
}
|
|
963
|
-
async destroy() {
|
|
964
|
-
Object.getOwnPropertyNames(this).forEach((e) => {
|
|
965
|
-
delete this[e];
|
|
966
|
-
});
|
|
998
|
+
let g$1 = class g {
|
|
999
|
+
constructor(e, s) {
|
|
1000
|
+
this.config = new S$2(), this.parent = e, this.el = p$1(s), this.id = this.el.id, this.config.set("parent", this.parent.config), this.config.set("entry", {});
|
|
967
1001
|
}
|
|
968
1002
|
};
|
|
969
|
-
|
|
1003
|
+
const M$1 = {
|
|
1004
|
+
selector: "",
|
|
1005
|
+
plugins: [],
|
|
1006
|
+
presets: {}
|
|
1007
|
+
};
|
|
1008
|
+
let x$1 = class x {
|
|
970
1009
|
constructor(e = {}) {
|
|
971
|
-
this.
|
|
1010
|
+
this.#t = new O$1(), this.events = this.#t.events, this.on = this.#t.on.bind(this.#t), this.off = this.#t.off.bind(this.#t), this.emit = this.#t.emit.bind(this.#t), this.collection = [], this.entryClass = g$1, this.name = this.constructor.name, this.config = { ...M$1, ...e }, this.plugins = new L$1(this.config.presets);
|
|
972
1011
|
}
|
|
1012
|
+
#t;
|
|
973
1013
|
get(e, s = "id") {
|
|
974
1014
|
return this.collection.find((i) => i[s] === e);
|
|
975
1015
|
}
|
|
976
|
-
|
|
977
|
-
|
|
1016
|
+
getOrThrow(e, s = "id") {
|
|
1017
|
+
const i = this.get(e, s);
|
|
1018
|
+
if (i)
|
|
1019
|
+
return i;
|
|
1020
|
+
throw new Error(
|
|
1021
|
+
`${this.name} entry not found in collection with ${String(s)} of "${e}"`
|
|
1022
|
+
);
|
|
1023
|
+
}
|
|
1024
|
+
updateConfig(e = {}) {
|
|
1025
|
+
return Object.assign(this.config, e);
|
|
978
1026
|
}
|
|
979
|
-
async createEntry(e
|
|
980
|
-
const
|
|
981
|
-
return await r$1(
|
|
1027
|
+
async createEntry(e) {
|
|
1028
|
+
const s = new this.entryClass(this, e);
|
|
1029
|
+
return await r$1(s, "init"), await a$1("onCreateEntry", this, s), s;
|
|
982
1030
|
}
|
|
983
1031
|
async destroyEntry(e) {
|
|
984
|
-
return await
|
|
1032
|
+
return await a$1("onDestroyEntry", this, e), await r$1(e, "destroy"), e;
|
|
985
1033
|
}
|
|
986
|
-
async register(e
|
|
987
|
-
const
|
|
988
|
-
|
|
989
|
-
const a2 = this.collection[n];
|
|
990
|
-
return a2.el = i, typeof a2.init == "function" && await a2.init(s), a2;
|
|
991
|
-
} else {
|
|
992
|
-
const a2 = await this.createEntry(i, s);
|
|
993
|
-
return this.collection.push(a2), await o("onRegisterEntry", this, a2), a2;
|
|
994
|
-
}
|
|
1034
|
+
async register(e) {
|
|
1035
|
+
const s = this.collection.findIndex((i) => i.id === e.id);
|
|
1036
|
+
return ~s ? this.collection[s] = e : this.collection.push(e), await a$1("onRegisterEntry", this, e), e;
|
|
995
1037
|
}
|
|
996
1038
|
async deregister(e) {
|
|
997
|
-
const s = this.collection.findIndex((i) => i.id === e);
|
|
1039
|
+
const s = this.collection.findIndex((i) => i.id === e.id);
|
|
998
1040
|
if (~s) {
|
|
999
|
-
|
|
1000
|
-
return await o(
|
|
1041
|
+
await a$1(
|
|
1001
1042
|
"onDeregisterEntry",
|
|
1002
1043
|
this,
|
|
1003
1044
|
this.collection[s]
|
|
1004
|
-
)
|
|
1045
|
+
);
|
|
1046
|
+
const [i] = this.collection.splice(s, 1);
|
|
1005
1047
|
}
|
|
1006
|
-
return
|
|
1048
|
+
return e;
|
|
1007
1049
|
}
|
|
1008
|
-
async mount(e =
|
|
1009
|
-
this.
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
return await
|
|
1019
|
-
}
|
|
1020
|
-
async unmount() {
|
|
1021
|
-
for (await
|
|
1022
|
-
await this.
|
|
1023
|
-
await
|
|
1024
|
-
for (const
|
|
1025
|
-
await r$1(
|
|
1026
|
-
for (const
|
|
1027
|
-
this.plugins.remove(
|
|
1050
|
+
async mount(e = (s) => s) {
|
|
1051
|
+
for (const s of this.config?.plugins || [])
|
|
1052
|
+
this.plugins.add(s);
|
|
1053
|
+
for (const s of this.plugins)
|
|
1054
|
+
await r$1(s, "setup", this);
|
|
1055
|
+
if (await a$1("beforeMount", this), this.config.selector) {
|
|
1056
|
+
const s = document.querySelectorAll(this.config.selector);
|
|
1057
|
+
for (const i of s)
|
|
1058
|
+
await this.createEntry(i).then((o) => e(o)).then((o) => this.register(o));
|
|
1059
|
+
}
|
|
1060
|
+
return await a$1("afterMount", this), this;
|
|
1061
|
+
}
|
|
1062
|
+
async unmount(e = (s) => s) {
|
|
1063
|
+
for (await a$1("beforeUnmount", this); this.collection.length > 0; )
|
|
1064
|
+
await this.destroyEntry(this.collection[0]).then((s) => e(s)).then((s) => this.deregister(s));
|
|
1065
|
+
await a$1("afterUnmount", this);
|
|
1066
|
+
for (const s of this.plugins)
|
|
1067
|
+
await r$1(s, "teardown", this);
|
|
1068
|
+
for (const s of [...this.plugins])
|
|
1069
|
+
this.plugins.remove(s.name);
|
|
1028
1070
|
return this;
|
|
1029
1071
|
}
|
|
1030
1072
|
};
|
|
1031
|
-
|
|
1073
|
+
v$1("theme-prefix", { fallback: "vb-theme-" });
|
|
1074
|
+
const T$1 = {
|
|
1032
1075
|
focusTrap: {
|
|
1033
1076
|
condition: ({ entry: t }) => t.state === "closed" || t.state === "opened" && t.mode === "modal"
|
|
1034
1077
|
},
|
|
@@ -1043,11 +1086,11 @@ const k$2 = {
|
|
|
1043
1086
|
condition: ({ entry: t }) => ["opened", "closed", "indeterminate"].includes(t.state),
|
|
1044
1087
|
onChange: ({ entry: t }) => t.applyState()
|
|
1045
1088
|
}
|
|
1046
|
-
},
|
|
1047
|
-
presets:
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1089
|
+
}, $$1 = {
|
|
1090
|
+
presets: T$1,
|
|
1091
|
+
attrOpen: "drawer-open",
|
|
1092
|
+
attrClose: "drawer-close",
|
|
1093
|
+
attrToggle: "drawer-toggle",
|
|
1051
1094
|
selector: ".drawer",
|
|
1052
1095
|
selectorDialog: ".drawer__dialog",
|
|
1053
1096
|
selectorScreen: ".drawer",
|
|
@@ -1066,93 +1109,93 @@ const k$2 = {
|
|
|
1066
1109
|
transition: true,
|
|
1067
1110
|
transitionDuration: 300
|
|
1068
1111
|
};
|
|
1069
|
-
function
|
|
1112
|
+
function k$2(t) {
|
|
1070
1113
|
switch (t.mode) {
|
|
1071
1114
|
case "inline":
|
|
1072
|
-
return
|
|
1115
|
+
return D$1(t);
|
|
1073
1116
|
case "modal":
|
|
1074
|
-
return
|
|
1117
|
+
return I$2(t);
|
|
1075
1118
|
default:
|
|
1076
1119
|
throw new Error(`"${t.mode}" is not a valid drawer mode.`);
|
|
1077
1120
|
}
|
|
1078
1121
|
}
|
|
1079
|
-
async function
|
|
1080
|
-
return t.el.classList.remove(t.
|
|
1122
|
+
async function D$1(t) {
|
|
1123
|
+
return t.el.classList.remove(t.config.get("classModal")), t.dialog.removeAttribute("aria-modal"), c$1(
|
|
1081
1124
|
false,
|
|
1082
|
-
t.
|
|
1083
|
-
t.
|
|
1125
|
+
t.config.get("selectorInert"),
|
|
1126
|
+
t.config.get("selectorOverflow")
|
|
1084
1127
|
), t.applyState(), t.el.dispatchEvent(
|
|
1085
|
-
new CustomEvent(t.
|
|
1128
|
+
new CustomEvent(t.config.get("customEventPrefix") + "switchMode", {
|
|
1086
1129
|
detail: t.parent,
|
|
1087
1130
|
bubbles: true
|
|
1088
1131
|
})
|
|
1089
1132
|
), await t.parent.emit("switchMode", t), t;
|
|
1090
1133
|
}
|
|
1091
|
-
async function
|
|
1092
|
-
return t.el.classList.add(t.
|
|
1093
|
-
new CustomEvent(t.
|
|
1134
|
+
async function I$2(t) {
|
|
1135
|
+
return t.el.classList.add(t.config.get("classModal")), t.dialog.setAttribute("aria-modal", "true"), await t.close(false, false), t.el.dispatchEvent(
|
|
1136
|
+
new CustomEvent(t.config.get("customEventPrefix") + "switchMode", {
|
|
1094
1137
|
detail: t.parent,
|
|
1095
1138
|
bubbles: true
|
|
1096
1139
|
})
|
|
1097
1140
|
), await t.parent.emit("switchMode", t), t;
|
|
1098
1141
|
}
|
|
1099
|
-
function
|
|
1100
|
-
t.dialog && t.state === "opened" ? (t.dialog.querySelector(t.
|
|
1142
|
+
function u$1(t) {
|
|
1143
|
+
t.dialog && t.state === "opened" ? (t.dialog.querySelector(t.config.get("selectorFocus")) || t.dialog).focus() : t.trigger && (t.trigger.focus(), t.trigger = null);
|
|
1101
1144
|
}
|
|
1102
|
-
async function
|
|
1103
|
-
return (t.state === "closed" || t.state === "indeterminate" || t.state === null) && (t.setState("opening"), e ?? t.
|
|
1145
|
+
async function l$1(t, e, s = true) {
|
|
1146
|
+
return (t.state === "closed" || t.state === "indeterminate" || t.state === null) && (t.setState("opening"), e ?? t.config.get("transition") ? await f(
|
|
1104
1147
|
t.el,
|
|
1105
|
-
t.
|
|
1106
|
-
t.
|
|
1107
|
-
t.
|
|
1108
|
-
t.
|
|
1109
|
-
) : (t.el.classList.add(t.
|
|
1148
|
+
t.config.get("stateClosed"),
|
|
1149
|
+
t.config.get("stateOpening"),
|
|
1150
|
+
t.config.get("stateOpened"),
|
|
1151
|
+
t.config.get("transitionDuration")
|
|
1152
|
+
) : (t.el.classList.add(t.config.get("stateOpened")), t.el.classList.remove(t.config.get("stateClosed"))), t.setState("opened"), t.mode === "modal" && c$1(
|
|
1110
1153
|
true,
|
|
1111
|
-
t.
|
|
1112
|
-
t.
|
|
1113
|
-
), s &&
|
|
1114
|
-
new CustomEvent(t.
|
|
1154
|
+
t.config.get("selectorInert"),
|
|
1155
|
+
t.config.get("selectorOverflow")
|
|
1156
|
+
), s && u$1(t), t.el.dispatchEvent(
|
|
1157
|
+
new CustomEvent(t.config.get("customEventPrefix") + "opened", {
|
|
1115
1158
|
detail: t.parent,
|
|
1116
1159
|
bubbles: true
|
|
1117
1160
|
})
|
|
1118
1161
|
), await t.parent.emit("opened", t)), t;
|
|
1119
1162
|
}
|
|
1120
|
-
async function
|
|
1121
|
-
return (t.state === "opened" || t.state === "indeterminate" || t.state === null) && (t.setState("closing"), document.activeElement && document.activeElement instanceof HTMLElement && document.activeElement.blur(), e ?? t.
|
|
1163
|
+
async function h$1(t, e, s = true) {
|
|
1164
|
+
return (t.state === "opened" || t.state === "indeterminate" || t.state === null) && (t.setState("closing"), document.activeElement && document.activeElement instanceof HTMLElement && document.activeElement.blur(), e ?? t.config.get("transition") ? await f(
|
|
1122
1165
|
t.el,
|
|
1123
|
-
t.
|
|
1124
|
-
t.
|
|
1125
|
-
t.
|
|
1126
|
-
t.
|
|
1127
|
-
) : (t.el.classList.add(t.
|
|
1166
|
+
t.config.get("stateOpened"),
|
|
1167
|
+
t.config.get("stateClosing"),
|
|
1168
|
+
t.config.get("stateClosed"),
|
|
1169
|
+
t.config.get("transitionDuration")
|
|
1170
|
+
) : (t.el.classList.add(t.config.get("stateClosed")), t.el.classList.remove(t.config.get("stateOpened"))), t.setState("closed"), t.mode === "modal" && c$1(
|
|
1128
1171
|
false,
|
|
1129
|
-
t.
|
|
1130
|
-
t.
|
|
1131
|
-
), s &&
|
|
1132
|
-
new CustomEvent(t.
|
|
1172
|
+
t.config.get("selectorInert"),
|
|
1173
|
+
t.config.get("selectorOverflow")
|
|
1174
|
+
), s && u$1(t), t.el.dispatchEvent(
|
|
1175
|
+
new CustomEvent(t.config.get("customEventPrefix") + "closed", {
|
|
1133
1176
|
detail: t.parent,
|
|
1134
1177
|
bubbles: true
|
|
1135
1178
|
})
|
|
1136
1179
|
), await t.parent.emit("closed", t)), t;
|
|
1137
1180
|
}
|
|
1138
|
-
async function
|
|
1139
|
-
return t.state === "closed" ?
|
|
1181
|
+
async function m$1(t, e, s) {
|
|
1182
|
+
return t.state === "closed" ? l$1(t, e, s) : h$1(t, e, s);
|
|
1140
1183
|
}
|
|
1141
|
-
class
|
|
1184
|
+
let A$2 = class A extends g$1 {
|
|
1142
1185
|
#t;
|
|
1143
|
-
constructor(e, s
|
|
1144
|
-
super(e, s
|
|
1186
|
+
constructor(e, s) {
|
|
1187
|
+
super(e, s), this.#t = "indeterminate", this.dialog = this.el.querySelector(this.config.get("selectorDialog")) || this.el, this.trigger = null, this.state = null, this.inlineState = null;
|
|
1145
1188
|
}
|
|
1146
1189
|
get mode() {
|
|
1147
1190
|
return this.#t;
|
|
1148
1191
|
}
|
|
1149
1192
|
set mode(e) {
|
|
1150
|
-
this.#t !== e && (this.#t = e,
|
|
1193
|
+
this.#t !== e && (this.#t = e, k$2(this));
|
|
1151
1194
|
}
|
|
1152
1195
|
setState(e) {
|
|
1153
1196
|
this.state = e;
|
|
1154
1197
|
const s = ["opening", "closing"];
|
|
1155
|
-
this.mode === "inline" && !s.includes(e) && (this.inlineState = e), e === "indeterminate" && (this.el.classList.remove(this.
|
|
1198
|
+
this.mode === "inline" && !s.includes(e) && (this.inlineState = e), e === "indeterminate" && (this.el.classList.remove(this.config.get("stateOpened")), this.el.classList.remove(this.config.get("stateOpening")), this.el.classList.remove(this.config.get("stateClosed")), this.el.classList.remove(this.config.get("stateClosing")));
|
|
1156
1199
|
}
|
|
1157
1200
|
async applyState() {
|
|
1158
1201
|
if (this.mode === "modal") return this;
|
|
@@ -1161,92 +1204,86 @@ class F extends S$1 {
|
|
|
1161
1204
|
if (this.inlineState === "closed")
|
|
1162
1205
|
return await this.close(false, false);
|
|
1163
1206
|
if (this.state === null) {
|
|
1164
|
-
if (this.el.classList.contains(this.
|
|
1207
|
+
if (this.el.classList.contains(this.config.get("stateOpened")))
|
|
1165
1208
|
return await this.open(false, false);
|
|
1166
|
-
if (this.el.classList.contains(this.
|
|
1209
|
+
if (this.el.classList.contains(this.config.get("stateClosed")))
|
|
1167
1210
|
return await this.close(false, false);
|
|
1168
1211
|
}
|
|
1169
1212
|
return this.setState("indeterminate"), this;
|
|
1170
1213
|
}
|
|
1171
1214
|
async open(e, s) {
|
|
1172
|
-
return
|
|
1215
|
+
return l$1(this, e, s);
|
|
1173
1216
|
}
|
|
1174
1217
|
async close(e, s) {
|
|
1175
|
-
return
|
|
1218
|
+
return h$1(this, e, s);
|
|
1176
1219
|
}
|
|
1177
1220
|
async toggle(e, s) {
|
|
1178
|
-
return
|
|
1221
|
+
return m$1(this, e, s);
|
|
1179
1222
|
}
|
|
1180
1223
|
async deregister() {
|
|
1181
|
-
return this.parent.deregister(this
|
|
1224
|
+
return this.parent.deregister(this);
|
|
1182
1225
|
}
|
|
1183
1226
|
async onCreateEntry() {
|
|
1184
|
-
this.
|
|
1227
|
+
this.config.get("setTabindex") && this.dialog && this.dialog.setAttribute("tabindex", "-1"), await this.applyState(), this.inlineState = this.state, this.mode = this.el && this.el.classList.contains(this.config.get("classModal")) ? "modal" : "inline";
|
|
1185
1228
|
}
|
|
1186
1229
|
async onDestroyEntry() {
|
|
1187
1230
|
this.mode === "modal" && this.state === "opened" && await this.close(false);
|
|
1188
1231
|
}
|
|
1189
|
-
}
|
|
1190
|
-
function
|
|
1191
|
-
const e = this.get(t);
|
|
1192
|
-
if (e)
|
|
1193
|
-
return e;
|
|
1194
|
-
throw new Error(`Drawer not found in collection with id of "${t}"`);
|
|
1195
|
-
}
|
|
1196
|
-
async function U$1(t) {
|
|
1232
|
+
};
|
|
1233
|
+
async function P$2(t) {
|
|
1197
1234
|
const e = t.target;
|
|
1198
1235
|
if (e) {
|
|
1199
1236
|
const s = e.closest(`
|
|
1200
|
-
[data-${this.
|
|
1201
|
-
[data-${this.
|
|
1202
|
-
[data-${this.
|
|
1237
|
+
[data-${this.config.attrOpen}],
|
|
1238
|
+
[data-${this.config.attrToggle}],
|
|
1239
|
+
[data-${this.config.attrClose}]
|
|
1203
1240
|
`);
|
|
1204
1241
|
if (s) {
|
|
1205
|
-
t.preventDefault(), s.matches(`[data-${this.
|
|
1206
|
-
const
|
|
1207
|
-
return
|
|
1208
|
-
}), s.matches(`[data-${this.
|
|
1209
|
-
const
|
|
1210
|
-
return
|
|
1211
|
-
}), s.matches(`[data-${this.
|
|
1212
|
-
if (
|
|
1213
|
-
const
|
|
1214
|
-
return
|
|
1242
|
+
t.preventDefault(), s.matches(`[data-${this.config.attrToggle}]`) && s.getAttribute(`data-${this.config.attrToggle}`)?.trim().split(" ")?.forEach((o) => {
|
|
1243
|
+
const n = this.getOrThrow(o);
|
|
1244
|
+
return n.trigger = s, n.toggle();
|
|
1245
|
+
}), s.matches(`[data-${this.config.attrOpen}]`) && s.getAttribute(`data-${this.config.attrOpen}`)?.trim().split(" ")?.forEach((o) => {
|
|
1246
|
+
const n = this.getOrThrow(o);
|
|
1247
|
+
return n.trigger = s, n.open();
|
|
1248
|
+
}), s.matches(`[data-${this.config.attrClose}]`) && s.getAttribute(`data-${this.config.attrClose}`)?.trim().split(" ")?.forEach((o) => {
|
|
1249
|
+
if (o) {
|
|
1250
|
+
const n = this.getOrThrow(o);
|
|
1251
|
+
return n.trigger = s, n.close();
|
|
1215
1252
|
} else {
|
|
1216
|
-
const
|
|
1217
|
-
if (
|
|
1253
|
+
const n = e.closest(this.config.selector);
|
|
1254
|
+
if (n) return this.close(n.id);
|
|
1218
1255
|
}
|
|
1219
1256
|
});
|
|
1220
1257
|
return;
|
|
1221
1258
|
}
|
|
1222
|
-
if (this.activeModal && e.matches(this.
|
|
1259
|
+
if (this.activeModal && e.matches(this.config.selectorScreen))
|
|
1223
1260
|
return this.close(this.activeModal.id);
|
|
1224
1261
|
}
|
|
1225
1262
|
}
|
|
1226
|
-
function
|
|
1263
|
+
function y$1(t) {
|
|
1227
1264
|
if (t.key === "Escape" && this.activeModal)
|
|
1228
1265
|
return this.close(this.activeModal.id);
|
|
1229
1266
|
}
|
|
1230
|
-
let
|
|
1231
|
-
#t;
|
|
1232
|
-
#e;
|
|
1267
|
+
let q$1 = class q extends x$1 {
|
|
1233
1268
|
constructor(e) {
|
|
1234
|
-
super({
|
|
1269
|
+
super({ ...$$1, ...e }), this.entryClass = A$2, this.name = "Drawer", this.#t = P$2.bind(this), this.#e = y$1.bind(this);
|
|
1235
1270
|
}
|
|
1271
|
+
#t;
|
|
1272
|
+
#e;
|
|
1236
1273
|
get activeModal() {
|
|
1237
1274
|
return this.collection.find((e) => e.state === "opened" && e.mode === "modal");
|
|
1238
1275
|
}
|
|
1239
1276
|
async open(e, s, i) {
|
|
1240
|
-
const
|
|
1241
|
-
return
|
|
1277
|
+
const o = this.getOrThrow(e);
|
|
1278
|
+
return l$1(o, s, i);
|
|
1242
1279
|
}
|
|
1243
1280
|
async close(e, s, i) {
|
|
1244
|
-
const
|
|
1245
|
-
return
|
|
1281
|
+
const o = this.getOrThrow(e);
|
|
1282
|
+
return h$1(o, s, i);
|
|
1246
1283
|
}
|
|
1247
1284
|
async toggle(e, s, i) {
|
|
1248
|
-
const
|
|
1249
|
-
return
|
|
1285
|
+
const o = this.getOrThrow(e);
|
|
1286
|
+
return m$1(o, s, i);
|
|
1250
1287
|
}
|
|
1251
1288
|
async afterMount() {
|
|
1252
1289
|
document.addEventListener("click", this.#t, false), document.addEventListener("keydown", this.#e, false);
|
|
@@ -1255,145 +1292,164 @@ let z$2 = class z2 extends T$2 {
|
|
|
1255
1292
|
document.removeEventListener("click", this.#t, false), document.removeEventListener("keydown", this.#e, false);
|
|
1256
1293
|
}
|
|
1257
1294
|
};
|
|
1258
|
-
function
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
}
|
|
1262
|
-
function p(e) {
|
|
1263
|
-
if (typeof e == "string") {
|
|
1264
|
-
const t = document.getElementById(e);
|
|
1295
|
+
function p(s) {
|
|
1296
|
+
if (typeof s == "string") {
|
|
1297
|
+
const t = document.getElementById(s);
|
|
1265
1298
|
if (t) return t;
|
|
1266
|
-
throw new Error(`Element not found with ID: "${
|
|
1267
|
-
} else if (
|
|
1268
|
-
if (!
|
|
1299
|
+
throw new Error(`Element not found with ID: "${s}"`);
|
|
1300
|
+
} else if (s instanceof HTMLElement) {
|
|
1301
|
+
if (!s.id)
|
|
1269
1302
|
throw new Error("HTMLElement must have an ID");
|
|
1270
|
-
return
|
|
1303
|
+
return s;
|
|
1271
1304
|
} else
|
|
1272
1305
|
throw new Error("Invalid argument: query must be a string or HTMLElement");
|
|
1273
1306
|
}
|
|
1274
|
-
async function
|
|
1275
|
-
t in
|
|
1276
|
-
}
|
|
1277
|
-
function S2(e) {
|
|
1278
|
-
return e.split("-").map(
|
|
1279
|
-
(t, s) => s === 0 ? t : t.charAt(0).toUpperCase() + t.slice(1)
|
|
1280
|
-
).join("");
|
|
1281
|
-
}
|
|
1282
|
-
function m(e) {
|
|
1283
|
-
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1307
|
+
async function a(s, t, ...e) {
|
|
1308
|
+
t in s && typeof s[t] == "function" && await s[t](...e);
|
|
1284
1309
|
}
|
|
1285
|
-
function
|
|
1286
|
-
if (typeof
|
|
1287
|
-
return
|
|
1288
|
-
const t = parseFloat(
|
|
1310
|
+
function m(s) {
|
|
1311
|
+
if (typeof s == "number")
|
|
1312
|
+
return s;
|
|
1313
|
+
const t = parseFloat(s);
|
|
1289
1314
|
if (!Number.isNaN(t)) {
|
|
1290
|
-
const
|
|
1291
|
-
return t * (
|
|
1315
|
+
const e = s.includes("ms");
|
|
1316
|
+
return t * (e ? 1 : 1e3);
|
|
1292
1317
|
}
|
|
1293
|
-
throw new Error(`Could not convert value to milliseconds: ${
|
|
1318
|
+
throw new Error(`Could not convert value to milliseconds: ${s}`);
|
|
1294
1319
|
}
|
|
1295
|
-
function
|
|
1296
|
-
return new Promise((
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
},
|
|
1320
|
+
function u(s, t, e, i, n = 0) {
|
|
1321
|
+
return new Promise((o) => {
|
|
1322
|
+
s.classList.remove(t), s.classList.add(e), setTimeout(() => {
|
|
1323
|
+
s.classList.add(i), s.classList.remove(e), o(s);
|
|
1324
|
+
}, m(n));
|
|
1300
1325
|
});
|
|
1301
1326
|
}
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
}
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
const o2 = A(), c = e.parent.module.toLowerCase(), g2 = m(i[n]), f2 = t.getPropertyValue(`--${o2}${c}-${g2}`).trim();
|
|
1312
|
-
f2 && (s[g2] = f2);
|
|
1327
|
+
function w(s, t = {}) {
|
|
1328
|
+
const e = {
|
|
1329
|
+
fallback: null,
|
|
1330
|
+
element: document.body,
|
|
1331
|
+
...t
|
|
1332
|
+
};
|
|
1333
|
+
if (!s.startsWith("--")) {
|
|
1334
|
+
const n = v();
|
|
1335
|
+
n && (s = `${n}${s}`), s = `--${s}`;
|
|
1313
1336
|
}
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1337
|
+
const i = getComputedStyle(e.element).getPropertyValue(s).trim();
|
|
1338
|
+
if (i)
|
|
1339
|
+
return i;
|
|
1340
|
+
if (e.fallback)
|
|
1341
|
+
return e.fallback;
|
|
1342
|
+
throw new Error(`CSS variable "${s}" was not found!`);
|
|
1318
1343
|
}
|
|
1319
|
-
function
|
|
1320
|
-
|
|
1344
|
+
async function r(s, t, e) {
|
|
1345
|
+
await a(t, s, e), e && await a(e, s);
|
|
1346
|
+
for (const i of t.plugins)
|
|
1347
|
+
await a(i, s, { parent: t, entry: e });
|
|
1348
|
+
await t.emit(s, { parent: t, entry: e });
|
|
1321
1349
|
}
|
|
1322
|
-
function
|
|
1323
|
-
|
|
1324
|
-
fallback: s,
|
|
1325
|
-
props: i = ["dataConfig", "customProps", "settings", "parent.settings"]
|
|
1326
|
-
} = t;
|
|
1327
|
-
for (const n of i) {
|
|
1328
|
-
const o2 = n !== "customProps" ? "camel" : "kebab", c = x.call(this, n, e, o2);
|
|
1329
|
-
if (c !== void 0)
|
|
1330
|
-
return c;
|
|
1331
|
-
}
|
|
1332
|
-
if (s !== void 0)
|
|
1333
|
-
return s;
|
|
1334
|
-
throw new Error(`${this.parent.module} setting does not exist: ${e}`);
|
|
1350
|
+
function v() {
|
|
1351
|
+
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
1335
1352
|
}
|
|
1336
|
-
function
|
|
1337
|
-
t && document.querySelectorAll(t).forEach((
|
|
1338
|
-
|
|
1353
|
+
function y(s, t) {
|
|
1354
|
+
t && document.querySelectorAll(t).forEach((e) => {
|
|
1355
|
+
s ? e.style.overflow = "hidden" : e.style.removeProperty("overflow");
|
|
1339
1356
|
});
|
|
1340
1357
|
}
|
|
1341
|
-
function
|
|
1342
|
-
t && document.querySelectorAll(t).forEach((
|
|
1343
|
-
e
|
|
1358
|
+
function E(s, t) {
|
|
1359
|
+
t && document.querySelectorAll(t).forEach((e) => {
|
|
1360
|
+
e.inert = s;
|
|
1344
1361
|
});
|
|
1345
1362
|
}
|
|
1346
|
-
function
|
|
1347
|
-
|
|
1363
|
+
function b(s, t, e) {
|
|
1364
|
+
E(!!s, t), y(!!s, e);
|
|
1348
1365
|
}
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1366
|
+
class C {
|
|
1367
|
+
#t;
|
|
1368
|
+
#e;
|
|
1369
|
+
constructor() {
|
|
1370
|
+
this.#t = {}, this.#e = [];
|
|
1371
|
+
}
|
|
1372
|
+
get(t, e) {
|
|
1373
|
+
const { fallback: i, source: n } = e ?? {};
|
|
1374
|
+
if (n) {
|
|
1375
|
+
const o = this.#t?.[n]?.[t];
|
|
1376
|
+
if (o !== void 0)
|
|
1377
|
+
return o;
|
|
1378
|
+
} else
|
|
1379
|
+
for (const o of this.#e) {
|
|
1380
|
+
const f2 = this.#t?.[o]?.[t];
|
|
1381
|
+
if (f2 !== void 0)
|
|
1382
|
+
return f2;
|
|
1383
|
+
}
|
|
1384
|
+
if (i !== void 0)
|
|
1385
|
+
return i;
|
|
1386
|
+
throw new Error(`Config does not exist: ${t}`);
|
|
1387
|
+
}
|
|
1388
|
+
set(t, e = {}) {
|
|
1389
|
+
let i, n;
|
|
1390
|
+
return typeof t == "string" ? (i = t, n = e) : (i = "entry", n = t), this.#t[i] ? Object.assign(this.#t[i], n) : (this.#e.unshift(i), this.#t[i] = n), this.#t[i];
|
|
1391
|
+
}
|
|
1392
|
+
remove(t) {
|
|
1393
|
+
const e = this.#e.indexOf(t);
|
|
1394
|
+
e !== -1 && this.#e.splice(e, 1), delete this.#t[t];
|
|
1395
|
+
}
|
|
1396
|
+
setSourceOrder(t) {
|
|
1397
|
+
const e = Object.keys(this.#t).reverse(), i = t.filter((n) => e.includes(n));
|
|
1398
|
+
for (const n of e)
|
|
1399
|
+
i.includes(n) || i.push(n);
|
|
1400
|
+
return this.#e = i;
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
class x2 {
|
|
1404
|
+
constructor() {
|
|
1405
|
+
this.events = {};
|
|
1406
|
+
}
|
|
1407
|
+
on(t, e, ...i) {
|
|
1408
|
+
this.events[t] || (this.events[t] = []), this.events[t].some(
|
|
1409
|
+
(n) => n.listener === e
|
|
1410
|
+
) || this.events[t].push({ listener: e, args: i });
|
|
1411
|
+
}
|
|
1412
|
+
off(t, e) {
|
|
1413
|
+
this.events[t] && (this.events[t] = this.events[t].filter(
|
|
1414
|
+
(i) => i.listener !== e
|
|
1359
1415
|
));
|
|
1360
|
-
},
|
|
1361
|
-
async emit(e, t) {
|
|
1362
|
-
if (e = e.startsWith("on") ? e.slice(2, 3).toLowerCase() + e.slice(3) : e, !!this.events[e])
|
|
1363
|
-
for (const { listener: s, args: i } of this.events[e])
|
|
1364
|
-
await s(t, ...i);
|
|
1365
1416
|
}
|
|
1366
|
-
|
|
1367
|
-
|
|
1417
|
+
async emit(t, ...e) {
|
|
1418
|
+
if (t = t.startsWith("on") ? t.slice(2, 3).toLowerCase() + t.slice(3) : t, !!this.events[t])
|
|
1419
|
+
for (const { listener: i, args: n } of this.events[t])
|
|
1420
|
+
await i(...e, ...n);
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
class O2 extends Array {
|
|
1368
1424
|
constructor(t = {}) {
|
|
1369
1425
|
super(), this.presets = t;
|
|
1370
1426
|
}
|
|
1371
|
-
|
|
1372
|
-
const
|
|
1373
|
-
t.
|
|
1427
|
+
#t(t) {
|
|
1428
|
+
const e = this.presets?.[t.name] || {}, i = t?.options || {};
|
|
1429
|
+
t.config = { ...t.config, ...e, ...i };
|
|
1374
1430
|
}
|
|
1375
|
-
|
|
1431
|
+
#e(t) {
|
|
1376
1432
|
return !("name" in t) || typeof t.name != "string" ? (console.error("Plugin requires a name!"), false) : true;
|
|
1377
1433
|
}
|
|
1378
1434
|
get(t) {
|
|
1379
|
-
return this.find((
|
|
1435
|
+
return this.find((e) => e.name === t) || null;
|
|
1380
1436
|
}
|
|
1381
1437
|
add(t) {
|
|
1382
1438
|
if (Array.isArray(t))
|
|
1383
|
-
t.forEach((
|
|
1384
|
-
else if (this
|
|
1385
|
-
const
|
|
1386
|
-
~
|
|
1439
|
+
t.forEach((e) => this.add(e));
|
|
1440
|
+
else if (this.#t(t), this.#e(t)) {
|
|
1441
|
+
const e = this.findIndex((i) => i.name === t.name);
|
|
1442
|
+
~e ? this[e] = t : this.push(t);
|
|
1387
1443
|
}
|
|
1388
1444
|
}
|
|
1389
1445
|
remove(t) {
|
|
1390
|
-
const
|
|
1391
|
-
~
|
|
1446
|
+
const e = this.findIndex((i) => i.name === t);
|
|
1447
|
+
~e && this.splice(e, 1);
|
|
1392
1448
|
}
|
|
1393
1449
|
}
|
|
1394
|
-
|
|
1450
|
+
class L3 extends Array {
|
|
1395
1451
|
constructor(t = {}) {
|
|
1396
|
-
super(), this.
|
|
1452
|
+
super(), this.config = t;
|
|
1397
1453
|
}
|
|
1398
1454
|
get copy() {
|
|
1399
1455
|
return [...this];
|
|
@@ -1402,129 +1458,108 @@ let k$1 = class k extends Array {
|
|
|
1402
1458
|
return this[this.length - 1] || null;
|
|
1403
1459
|
}
|
|
1404
1460
|
updateIndex() {
|
|
1405
|
-
this.forEach((t,
|
|
1461
|
+
this.forEach((t, e) => {
|
|
1406
1462
|
t.el.style.zIndex = "";
|
|
1407
|
-
const i = getComputedStyle(t.el)
|
|
1408
|
-
t.el.style.zIndex =
|
|
1463
|
+
const i = getComputedStyle(t.el).getPropertyValue("z-index"), n = parseInt(i, 10), o = String((Number.isNaN(n) ? 0 : n) + e + 1);
|
|
1464
|
+
t.el.style.zIndex = o;
|
|
1409
1465
|
});
|
|
1410
1466
|
}
|
|
1411
1467
|
onChange() {
|
|
1412
|
-
this.updateIndex(), typeof this.
|
|
1468
|
+
this.updateIndex(), typeof this.config.onChange == "function" && this.config.onChange();
|
|
1413
1469
|
}
|
|
1414
1470
|
add(t) {
|
|
1415
1471
|
this.push(t), this.onChange();
|
|
1416
1472
|
}
|
|
1417
1473
|
remove(t) {
|
|
1418
|
-
const
|
|
1419
|
-
~
|
|
1474
|
+
const e = this.findIndex((i) => i.id === t.id);
|
|
1475
|
+
~e && (t.el.style.zIndex = "", this.splice(e, 1), this.onChange());
|
|
1420
1476
|
}
|
|
1421
1477
|
moveToTop(t) {
|
|
1422
|
-
const
|
|
1423
|
-
~
|
|
1424
|
-
}
|
|
1425
|
-
};
|
|
1426
|
-
const D$1 = {
|
|
1427
|
-
dataConfig: "config",
|
|
1428
|
-
customProps: []
|
|
1429
|
-
};
|
|
1430
|
-
class v {
|
|
1431
|
-
constructor(t, s, i = {}) {
|
|
1432
|
-
this.parent = t, this.el = p(s), this.settings = { ...i }, this.dataConfig = {}, this.customProps = {};
|
|
1433
|
-
}
|
|
1434
|
-
get id() {
|
|
1435
|
-
return this.el.id;
|
|
1436
|
-
}
|
|
1437
|
-
applySettings(t) {
|
|
1438
|
-
return Object.assign(this.settings, t);
|
|
1439
|
-
}
|
|
1440
|
-
getSetting(t, s) {
|
|
1441
|
-
return L.call(this, t, s);
|
|
1442
|
-
}
|
|
1443
|
-
buildDataConfig() {
|
|
1444
|
-
return Object.assign(
|
|
1445
|
-
this.dataConfig,
|
|
1446
|
-
C(this.el, this.getSetting("dataConfig"))
|
|
1447
|
-
);
|
|
1448
|
-
}
|
|
1449
|
-
buildCustomProps() {
|
|
1450
|
-
return Object.assign(this.customProps, b(this));
|
|
1451
|
-
}
|
|
1452
|
-
async init(t = {}) {
|
|
1453
|
-
this.applySettings(t), this.buildDataConfig(), this.buildCustomProps();
|
|
1478
|
+
const e = this.findIndex((i) => i.id === t.id);
|
|
1479
|
+
~e && (this.splice(e, 1), this.add(t));
|
|
1454
1480
|
}
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
});
|
|
1481
|
+
}
|
|
1482
|
+
class d {
|
|
1483
|
+
constructor(t, e) {
|
|
1484
|
+
this.config = new C(), this.parent = t, this.el = p(e), this.id = this.el.id, this.config.set("parent", this.parent.config), this.config.set("entry", {});
|
|
1459
1485
|
}
|
|
1460
1486
|
}
|
|
1461
|
-
|
|
1487
|
+
const k$1 = {
|
|
1488
|
+
selector: "",
|
|
1489
|
+
plugins: [],
|
|
1490
|
+
presets: {}
|
|
1491
|
+
};
|
|
1492
|
+
let A$1 = class A2 {
|
|
1462
1493
|
constructor(t = {}) {
|
|
1463
|
-
this.
|
|
1494
|
+
this.#t = new x2(), this.events = this.#t.events, this.on = this.#t.on.bind(this.#t), this.off = this.#t.off.bind(this.#t), this.emit = this.#t.emit.bind(this.#t), this.collection = [], this.entryClass = d, this.name = this.constructor.name, this.config = { ...k$1, ...t }, this.plugins = new O2(this.config.presets);
|
|
1464
1495
|
}
|
|
1465
|
-
|
|
1466
|
-
|
|
1496
|
+
#t;
|
|
1497
|
+
get(t, e = "id") {
|
|
1498
|
+
return this.collection.find((i) => i[e] === t);
|
|
1499
|
+
}
|
|
1500
|
+
getOrThrow(t, e = "id") {
|
|
1501
|
+
const i = this.get(t, e);
|
|
1502
|
+
if (i)
|
|
1503
|
+
return i;
|
|
1504
|
+
throw new Error(
|
|
1505
|
+
`${this.name} entry not found in collection with ${String(e)} of "${t}"`
|
|
1506
|
+
);
|
|
1467
1507
|
}
|
|
1468
|
-
|
|
1469
|
-
return Object.assign(this.
|
|
1508
|
+
updateConfig(t = {}) {
|
|
1509
|
+
return Object.assign(this.config, t);
|
|
1470
1510
|
}
|
|
1471
|
-
async createEntry(t
|
|
1472
|
-
const
|
|
1473
|
-
return await
|
|
1511
|
+
async createEntry(t) {
|
|
1512
|
+
const e = new this.entryClass(this, t);
|
|
1513
|
+
return await a(e, "init"), await r("onCreateEntry", this, e), e;
|
|
1474
1514
|
}
|
|
1475
1515
|
async destroyEntry(t) {
|
|
1476
|
-
return await
|
|
1516
|
+
return await r("onDestroyEntry", this, t), await a(t, "destroy"), t;
|
|
1477
1517
|
}
|
|
1478
|
-
async register(t
|
|
1479
|
-
const
|
|
1480
|
-
|
|
1481
|
-
const o2 = this.collection[n];
|
|
1482
|
-
return o2.el = i, typeof o2.init == "function" && await o2.init(s), o2;
|
|
1483
|
-
} else {
|
|
1484
|
-
const o2 = await this.createEntry(i, s);
|
|
1485
|
-
return this.collection.push(o2), await a("onRegisterEntry", this, o2), o2;
|
|
1486
|
-
}
|
|
1518
|
+
async register(t) {
|
|
1519
|
+
const e = this.collection.findIndex((i) => i.id === t.id);
|
|
1520
|
+
return ~e ? this.collection[e] = t : this.collection.push(t), await r("onRegisterEntry", this, t), t;
|
|
1487
1521
|
}
|
|
1488
1522
|
async deregister(t) {
|
|
1489
|
-
const
|
|
1490
|
-
if (~
|
|
1491
|
-
|
|
1492
|
-
return await a(
|
|
1523
|
+
const e = this.collection.findIndex((i) => i.id === t.id);
|
|
1524
|
+
if (~e) {
|
|
1525
|
+
await r(
|
|
1493
1526
|
"onDeregisterEntry",
|
|
1494
1527
|
this,
|
|
1495
|
-
this.collection[
|
|
1496
|
-
)
|
|
1528
|
+
this.collection[e]
|
|
1529
|
+
);
|
|
1530
|
+
const [i] = this.collection.splice(e, 1);
|
|
1497
1531
|
}
|
|
1498
|
-
return
|
|
1532
|
+
return t;
|
|
1533
|
+
}
|
|
1534
|
+
async mount(t = (e) => e) {
|
|
1535
|
+
for (const e of this.config?.plugins || [])
|
|
1536
|
+
this.plugins.add(e);
|
|
1537
|
+
for (const e of this.plugins)
|
|
1538
|
+
await a(e, "setup", this);
|
|
1539
|
+
if (await r("beforeMount", this), this.config.selector) {
|
|
1540
|
+
const e = document.querySelectorAll(this.config.selector);
|
|
1541
|
+
for (const i of e)
|
|
1542
|
+
await this.createEntry(i).then((n) => t(n)).then((n) => this.register(n));
|
|
1543
|
+
}
|
|
1544
|
+
return await r("afterMount", this), this;
|
|
1499
1545
|
}
|
|
1500
|
-
async
|
|
1501
|
-
this.
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
for (const
|
|
1505
|
-
await
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
for (const i of s)
|
|
1509
|
-
await this.register(i);
|
|
1510
|
-
return await a("afterMount", this), this;
|
|
1511
|
-
}
|
|
1512
|
-
async unmount() {
|
|
1513
|
-
for (await a("beforeUnmount", this); this.collection.length > 0; )
|
|
1514
|
-
await this.deregister(this.collection[0].id);
|
|
1515
|
-
await a("afterUnmount", this);
|
|
1516
|
-
for (const t of this.plugins)
|
|
1517
|
-
await r(t, "teardown", { plugin: t, parent: this });
|
|
1518
|
-
for (const t of [...this.plugins])
|
|
1519
|
-
this.plugins.remove(t.name);
|
|
1546
|
+
async unmount(t = (e) => e) {
|
|
1547
|
+
for (await r("beforeUnmount", this); this.collection.length > 0; )
|
|
1548
|
+
await this.destroyEntry(this.collection[0]).then((e) => t(e)).then((e) => this.deregister(e));
|
|
1549
|
+
await r("afterUnmount", this);
|
|
1550
|
+
for (const e of this.plugins)
|
|
1551
|
+
await a(e, "teardown", this);
|
|
1552
|
+
for (const e of [...this.plugins])
|
|
1553
|
+
this.plugins.remove(e.name);
|
|
1520
1554
|
return this;
|
|
1521
1555
|
}
|
|
1522
1556
|
};
|
|
1523
|
-
|
|
1557
|
+
w("theme-prefix", { fallback: "vb-theme-" });
|
|
1558
|
+
const I$1 = {
|
|
1524
1559
|
// Data attributes
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1560
|
+
attrOpen: "modal-open",
|
|
1561
|
+
attrClose: "modal-close",
|
|
1562
|
+
attrReplace: "modal-replace",
|
|
1528
1563
|
// Selectors
|
|
1529
1564
|
selector: ".modal",
|
|
1530
1565
|
selectorDialog: ".modal__dialog",
|
|
@@ -1538,156 +1573,154 @@ const T$1 = {
|
|
|
1538
1573
|
stateOpening: "is-opening",
|
|
1539
1574
|
stateClosing: "is-closing",
|
|
1540
1575
|
stateClosed: "is-closed",
|
|
1541
|
-
// Feature
|
|
1576
|
+
// Feature configurations
|
|
1542
1577
|
customProps: ["transition-duration"],
|
|
1543
1578
|
customEventPrefix: "modal:",
|
|
1544
1579
|
setTabindex: true,
|
|
1545
1580
|
transition: true,
|
|
1546
1581
|
transitionDuration: 300
|
|
1547
1582
|
};
|
|
1548
|
-
function
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1583
|
+
function c(s) {
|
|
1584
|
+
if (s.active) {
|
|
1585
|
+
const t = s.active.dialog.querySelector(s.config.selectorFocus) || s.active.dialog;
|
|
1586
|
+
"focus" in t && typeof t.focus == "function" && t.focus();
|
|
1587
|
+
} else
|
|
1588
|
+
s.trigger && (s.trigger.focus(), s.trigger = null);
|
|
1589
|
+
}
|
|
1590
|
+
async function l(s, t, e = true) {
|
|
1591
|
+
return s.parent.stack.moveToTop(s), s.state === "closed" && (s.state = "opening", s.parent.stack.add(s), t ?? s.config.get("transition") ? await u(
|
|
1592
|
+
s.el,
|
|
1593
|
+
s.config.get("stateClosed"),
|
|
1594
|
+
s.config.get("stateOpening"),
|
|
1595
|
+
s.config.get("stateOpened"),
|
|
1596
|
+
s.config.get("transitionDuration")
|
|
1597
|
+
) : (s.el.classList.add(s.config.get("stateOpened")), s.el.classList.remove(s.config.get("stateClosed"))), s.state = "opened"), e && c(s.parent), s.el.dispatchEvent(
|
|
1598
|
+
new CustomEvent(s.config.get("customEventPrefix") + "opened", {
|
|
1599
|
+
detail: s.parent,
|
|
1561
1600
|
bubbles: true
|
|
1562
1601
|
})
|
|
1563
|
-
), await
|
|
1564
|
-
}
|
|
1565
|
-
async function h(
|
|
1566
|
-
return
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
) : (
|
|
1573
|
-
new CustomEvent(
|
|
1574
|
-
detail:
|
|
1602
|
+
), await s.parent.emit("opened", s), s;
|
|
1603
|
+
}
|
|
1604
|
+
async function h(s, t, e = true) {
|
|
1605
|
+
return s && s.state === "opened" && (s.state = "closing", document.activeElement && document.activeElement instanceof HTMLElement && document.activeElement.blur(), t ?? s.config.get("transition") ? await u(
|
|
1606
|
+
s.el,
|
|
1607
|
+
s.config.get("stateOpened"),
|
|
1608
|
+
s.config.get("stateClosing"),
|
|
1609
|
+
s.config.get("stateClosed"),
|
|
1610
|
+
s.config.get("transitionDuration")
|
|
1611
|
+
) : (s.el.classList.add(s.config.get("stateClosed")), s.el.classList.remove(s.config.get("stateOpened"))), s.parent.stack.remove(s), s.state = "closed", e && c(s.parent), s.el.dispatchEvent(
|
|
1612
|
+
new CustomEvent(s.config.get("customEventPrefix") + "closed", {
|
|
1613
|
+
detail: s.parent,
|
|
1575
1614
|
bubbles: true
|
|
1576
1615
|
})
|
|
1577
|
-
), await
|
|
1616
|
+
), await s.parent.emit("closed", s)), s;
|
|
1578
1617
|
}
|
|
1579
|
-
async function
|
|
1618
|
+
async function g2(s, t, e = true) {
|
|
1580
1619
|
let i, n;
|
|
1581
|
-
return
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
]),
|
|
1620
|
+
return s.state === "opened" ? (i = s, n = await s.parent.closeAll(s.id, t)) : [n, i] = await Promise.all([
|
|
1621
|
+
s.parent.closeAll("", t),
|
|
1622
|
+
l(s, t, false)
|
|
1623
|
+
]), e && c(s.parent), { opened: i, closed: n };
|
|
1585
1624
|
}
|
|
1586
|
-
|
|
1587
|
-
constructor(t,
|
|
1588
|
-
super(t,
|
|
1625
|
+
class $ extends d {
|
|
1626
|
+
constructor(t, e) {
|
|
1627
|
+
super(t, e), this.state = "closed", this.dialog = this.el.querySelector(this.config.get("selectorDialog")) || this.el;
|
|
1589
1628
|
}
|
|
1590
1629
|
get isRequired() {
|
|
1591
|
-
return this.dialog.matches(this.
|
|
1630
|
+
return this.dialog.matches(this.config.get("selectorRequired"));
|
|
1592
1631
|
}
|
|
1593
|
-
async open(t,
|
|
1594
|
-
return
|
|
1632
|
+
async open(t, e) {
|
|
1633
|
+
return l(this, t, e);
|
|
1595
1634
|
}
|
|
1596
|
-
async close(t,
|
|
1597
|
-
return h(this, t,
|
|
1635
|
+
async close(t, e) {
|
|
1636
|
+
return h(this, t, e);
|
|
1598
1637
|
}
|
|
1599
|
-
async replace(t,
|
|
1600
|
-
return
|
|
1638
|
+
async replace(t, e) {
|
|
1639
|
+
return g2(this, t, e);
|
|
1601
1640
|
}
|
|
1602
1641
|
async deregister() {
|
|
1603
|
-
return this.parent.deregister(this
|
|
1642
|
+
return this.parent.deregister(this);
|
|
1604
1643
|
}
|
|
1605
1644
|
async onCreateEntry() {
|
|
1606
|
-
this.dialog.setAttribute("aria-modal", "true"), this.dialog.hasAttribute("role") || this.dialog.setAttribute("role", "dialog"), this.
|
|
1645
|
+
this.dialog.setAttribute("aria-modal", "true"), this.dialog.hasAttribute("role") || this.dialog.setAttribute("role", "dialog"), this.config.get("setTabindex") && this.dialog.setAttribute("tabindex", "-1");
|
|
1607
1646
|
}
|
|
1608
1647
|
async onRegisterEntry() {
|
|
1609
|
-
this.el.classList.contains(this.
|
|
1648
|
+
this.el.classList.contains(this.config.get("stateOpened")) ? await this.open(false) : (this.el.classList.remove(this.config.get("stateOpening")), this.el.classList.remove(this.config.get("stateClosing")), this.el.classList.add(this.config.get("stateClosed")));
|
|
1610
1649
|
}
|
|
1611
1650
|
async onDestroyEntry() {
|
|
1612
1651
|
this.state === "opened" && await this.close(false);
|
|
1613
1652
|
}
|
|
1614
|
-
};
|
|
1615
|
-
function l(e) {
|
|
1616
|
-
const t = this.get(e);
|
|
1617
|
-
if (t)
|
|
1618
|
-
return t;
|
|
1619
|
-
throw new Error(`Modal not found in collection with id of "${e}".`);
|
|
1620
1653
|
}
|
|
1621
|
-
async function
|
|
1622
|
-
const t =
|
|
1654
|
+
async function T(s) {
|
|
1655
|
+
const t = s.target;
|
|
1623
1656
|
if (t) {
|
|
1624
|
-
const
|
|
1625
|
-
[data-${this.
|
|
1626
|
-
[data-${this.
|
|
1627
|
-
[data-${this.
|
|
1657
|
+
const e = t.closest(`
|
|
1658
|
+
[data-${this.config.attrOpen}],
|
|
1659
|
+
[data-${this.config.attrReplace}],
|
|
1660
|
+
[data-${this.config.attrClose}]
|
|
1628
1661
|
`);
|
|
1629
|
-
if (
|
|
1630
|
-
if (
|
|
1631
|
-
const i =
|
|
1632
|
-
return t.closest(this.
|
|
1662
|
+
if (e) {
|
|
1663
|
+
if (s.preventDefault(), e.matches(`[data-${this.config.attrOpen}]`)) {
|
|
1664
|
+
const i = e.getAttribute(`data-${this.config.attrOpen}`)?.trim(), n = this.getOrThrow(i);
|
|
1665
|
+
return t.closest(this.config.selector) || (this.trigger = e), n.open();
|
|
1633
1666
|
}
|
|
1634
|
-
if (
|
|
1635
|
-
const i =
|
|
1636
|
-
return t.closest(this.
|
|
1667
|
+
if (e.matches(`[data-${this.config.attrReplace}]`)) {
|
|
1668
|
+
const i = e.getAttribute(`data-${this.config.attrReplace}`)?.trim(), n = this.getOrThrow(i);
|
|
1669
|
+
return t.closest(this.config.selector) || (this.trigger = e), n.replace();
|
|
1637
1670
|
}
|
|
1638
|
-
if (
|
|
1639
|
-
const i =
|
|
1671
|
+
if (e.matches(`[data-${this.config.attrClose}]`)) {
|
|
1672
|
+
const i = e.getAttribute(`data-${this.config.attrClose}`)?.trim();
|
|
1640
1673
|
return i === "*" ? this.closeAll() : this.close(i || "");
|
|
1641
1674
|
}
|
|
1642
1675
|
}
|
|
1643
|
-
if (this.active && t.matches(this.
|
|
1676
|
+
if (this.active && t.matches(this.config.selectorScreen) && !this.active.isRequired)
|
|
1644
1677
|
return this.close();
|
|
1645
1678
|
}
|
|
1646
1679
|
}
|
|
1647
|
-
function
|
|
1648
|
-
if (
|
|
1680
|
+
function S$1(s) {
|
|
1681
|
+
if (s.key === "Escape" && this.active && !this.active.dialog.matches(this.config.selectorRequired))
|
|
1649
1682
|
return this.close();
|
|
1650
1683
|
}
|
|
1651
|
-
async function
|
|
1652
|
-
const
|
|
1684
|
+
async function M(s = "", t) {
|
|
1685
|
+
const e = [];
|
|
1653
1686
|
return await Promise.all(
|
|
1654
1687
|
this.stack.copy.map(async (i) => {
|
|
1655
|
-
|
|
1688
|
+
s && s === i.id || e.push(await h(i, t, false));
|
|
1656
1689
|
})
|
|
1657
|
-
),
|
|
1690
|
+
), e;
|
|
1658
1691
|
}
|
|
1659
|
-
let
|
|
1660
|
-
#t;
|
|
1661
|
-
#e;
|
|
1692
|
+
let P$1 = class P extends A$1 {
|
|
1662
1693
|
constructor(t) {
|
|
1663
|
-
super({ ...
|
|
1694
|
+
super({ ...I$1, ...t }), this.entryClass = $, this.name = "Modal", this.trigger = null, this.#t = T.bind(this), this.#e = S$1.bind(this), this.stack = new L3({
|
|
1664
1695
|
onChange: () => {
|
|
1665
|
-
|
|
1696
|
+
b(
|
|
1666
1697
|
!!this.stack.top,
|
|
1667
|
-
this.
|
|
1668
|
-
this.
|
|
1698
|
+
this.config.selectorInert,
|
|
1699
|
+
this.config.selectorOverflow
|
|
1669
1700
|
);
|
|
1670
1701
|
}
|
|
1671
1702
|
});
|
|
1672
1703
|
}
|
|
1704
|
+
#t;
|
|
1705
|
+
#e;
|
|
1673
1706
|
get active() {
|
|
1674
1707
|
return this.stack.top;
|
|
1675
1708
|
}
|
|
1676
|
-
async open(t,
|
|
1677
|
-
const n =
|
|
1678
|
-
return
|
|
1709
|
+
async open(t, e, i) {
|
|
1710
|
+
const n = this.getOrThrow(t);
|
|
1711
|
+
return l(n, e, i);
|
|
1679
1712
|
}
|
|
1680
|
-
async close(t,
|
|
1681
|
-
const n = t ?
|
|
1682
|
-
return h(n,
|
|
1713
|
+
async close(t, e, i) {
|
|
1714
|
+
const n = t ? this.getOrThrow(t) : this.active;
|
|
1715
|
+
return h(n, e, i);
|
|
1683
1716
|
}
|
|
1684
|
-
async replace(t,
|
|
1685
|
-
const n =
|
|
1686
|
-
return
|
|
1717
|
+
async replace(t, e, i) {
|
|
1718
|
+
const n = this.getOrThrow(t);
|
|
1719
|
+
return g2(n, e, i);
|
|
1687
1720
|
}
|
|
1688
|
-
async closeAll(t,
|
|
1689
|
-
const n = await
|
|
1690
|
-
return i &&
|
|
1721
|
+
async closeAll(t, e, i = true) {
|
|
1722
|
+
const n = await M.call(this, t, e);
|
|
1723
|
+
return i && c(this), n;
|
|
1691
1724
|
}
|
|
1692
1725
|
async afterMount() {
|
|
1693
1726
|
document.addEventListener("click", this.#t, false), document.addEventListener("keydown", this.#e, false);
|
|
@@ -1699,11 +1732,7 @@ let N$1 = class N extends q$1 {
|
|
|
1699
1732
|
document.removeEventListener("click", this.#t, false), document.removeEventListener("keydown", this.#e, false);
|
|
1700
1733
|
}
|
|
1701
1734
|
};
|
|
1702
|
-
function
|
|
1703
|
-
const n = (t.getAttribute(`data-${e}`) || "").replace(/'/g, '"');
|
|
1704
|
-
return n ? JSON.parse(n) : {};
|
|
1705
|
-
}
|
|
1706
|
-
function Rt(t) {
|
|
1735
|
+
function jt(t) {
|
|
1707
1736
|
if (typeof t == "string") {
|
|
1708
1737
|
const e = document.getElementById(t);
|
|
1709
1738
|
if (e) return e;
|
|
@@ -1715,87 +1744,110 @@ function Rt(t) {
|
|
|
1715
1744
|
} else
|
|
1716
1745
|
throw new Error("Invalid argument: query must be a string or HTMLElement");
|
|
1717
1746
|
}
|
|
1718
|
-
async function
|
|
1747
|
+
async function z2(t, e, ...n) {
|
|
1719
1748
|
e in t && typeof t[e] == "function" && await t[e](...n);
|
|
1720
1749
|
}
|
|
1721
|
-
function
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1750
|
+
function Kt(t, e = {}) {
|
|
1751
|
+
const n = {
|
|
1752
|
+
fallback: null,
|
|
1753
|
+
element: document.body,
|
|
1754
|
+
...e
|
|
1755
|
+
};
|
|
1756
|
+
if (!t.startsWith("--")) {
|
|
1757
|
+
const s = Jt();
|
|
1758
|
+
s && (t = `${s}${t}`), t = `--${t}`;
|
|
1759
|
+
}
|
|
1760
|
+
const i = getComputedStyle(n.element).getPropertyValue(t).trim();
|
|
1761
|
+
if (i)
|
|
1762
|
+
return i;
|
|
1763
|
+
if (n.fallback)
|
|
1764
|
+
return n.fallback;
|
|
1765
|
+
throw new Error(`CSS variable "${t}" was not found!`);
|
|
1766
|
+
}
|
|
1767
|
+
async function N(t, e, n) {
|
|
1768
|
+
await z2(e, t, n), n && await z2(n, t);
|
|
1731
1769
|
for (const i of e.plugins)
|
|
1732
|
-
await
|
|
1733
|
-
await e.emit(t, n);
|
|
1734
|
-
}
|
|
1735
|
-
function Gt(t) {
|
|
1736
|
-
const e = getComputedStyle(t.el), n = {}, i = t.getSetting("customProps");
|
|
1737
|
-
for (let s = 0; s < i.length; s++) {
|
|
1738
|
-
const o2 = Qt(), r2 = t.parent.module.toLowerCase(), c = kt(i[s]), l2 = e.getPropertyValue(`--${o2}${r2}-${c}`).trim();
|
|
1739
|
-
l2 && (n[c] = l2);
|
|
1740
|
-
}
|
|
1741
|
-
return n;
|
|
1770
|
+
await z2(i, t, { parent: e, entry: n });
|
|
1771
|
+
await e.emit(t, { parent: e, entry: n });
|
|
1742
1772
|
}
|
|
1743
|
-
function
|
|
1773
|
+
function Jt() {
|
|
1744
1774
|
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
1745
1775
|
}
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1776
|
+
class Gt {
|
|
1777
|
+
#t;
|
|
1778
|
+
#e;
|
|
1779
|
+
constructor() {
|
|
1780
|
+
this.#t = {}, this.#e = [];
|
|
1781
|
+
}
|
|
1782
|
+
get(e, n) {
|
|
1783
|
+
const { fallback: i, source: s } = n ?? {};
|
|
1784
|
+
if (s) {
|
|
1785
|
+
const o = this.#t?.[s]?.[e];
|
|
1786
|
+
if (o !== void 0)
|
|
1787
|
+
return o;
|
|
1788
|
+
} else
|
|
1789
|
+
for (const o of this.#e) {
|
|
1790
|
+
const r2 = this.#t?.[o]?.[e];
|
|
1791
|
+
if (r2 !== void 0)
|
|
1792
|
+
return r2;
|
|
1793
|
+
}
|
|
1794
|
+
if (i !== void 0)
|
|
1795
|
+
return i;
|
|
1796
|
+
throw new Error(`Config does not exist: ${e}`);
|
|
1797
|
+
}
|
|
1798
|
+
set(e, n = {}) {
|
|
1799
|
+
let i, s;
|
|
1800
|
+
return typeof e == "string" ? (i = e, s = n) : (i = "entry", s = e), this.#t[i] ? Object.assign(this.#t[i], s) : (this.#e.unshift(i), this.#t[i] = s), this.#t[i];
|
|
1801
|
+
}
|
|
1802
|
+
remove(e) {
|
|
1803
|
+
const n = this.#e.indexOf(e);
|
|
1804
|
+
n !== -1 && this.#e.splice(n, 1), delete this.#t[e];
|
|
1805
|
+
}
|
|
1806
|
+
setSourceOrder(e) {
|
|
1807
|
+
const n = Object.keys(this.#t).reverse(), i = e.filter((s) => n.includes(s));
|
|
1808
|
+
for (const s of n)
|
|
1809
|
+
i.includes(s) || i.push(s);
|
|
1810
|
+
return this.#e = i;
|
|
1811
|
+
}
|
|
1762
1812
|
}
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1813
|
+
class Qt {
|
|
1814
|
+
constructor() {
|
|
1815
|
+
this.events = {};
|
|
1816
|
+
}
|
|
1817
|
+
on(e, n, ...i) {
|
|
1818
|
+
this.events[e] || (this.events[e] = []), this.events[e].some(
|
|
1819
|
+
(s) => s.listener === n
|
|
1820
|
+
) || this.events[e].push({ listener: n, args: i });
|
|
1821
|
+
}
|
|
1822
|
+
off(e, n) {
|
|
1823
|
+
this.events[e] && (this.events[e] = this.events[e].filter(
|
|
1824
|
+
(i) => i.listener !== n
|
|
1773
1825
|
));
|
|
1774
|
-
},
|
|
1775
|
-
async emit(t, e) {
|
|
1776
|
-
if (t = t.startsWith("on") ? t.slice(2, 3).toLowerCase() + t.slice(3) : t, !!this.events[t])
|
|
1777
|
-
for (const { listener: n, args: i } of this.events[t])
|
|
1778
|
-
await n(e, ...i);
|
|
1779
1826
|
}
|
|
1780
|
-
|
|
1781
|
-
|
|
1827
|
+
async emit(e, ...n) {
|
|
1828
|
+
if (e = e.startsWith("on") ? e.slice(2, 3).toLowerCase() + e.slice(3) : e, !!this.events[e])
|
|
1829
|
+
for (const { listener: i, args: s } of this.events[e])
|
|
1830
|
+
await i(...n, ...s);
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
class Zt extends Array {
|
|
1782
1834
|
constructor(e = {}) {
|
|
1783
1835
|
super(), this.presets = e;
|
|
1784
1836
|
}
|
|
1785
|
-
|
|
1786
|
-
const n =
|
|
1787
|
-
e.
|
|
1837
|
+
#t(e) {
|
|
1838
|
+
const n = this.presets?.[e.name] || {}, i = e?.options || {};
|
|
1839
|
+
e.config = { ...e.config, ...n, ...i };
|
|
1788
1840
|
}
|
|
1789
|
-
|
|
1841
|
+
#e(e) {
|
|
1790
1842
|
return !("name" in e) || typeof e.name != "string" ? (console.error("Plugin requires a name!"), false) : true;
|
|
1791
1843
|
}
|
|
1792
1844
|
get(e) {
|
|
1793
|
-
return this.find((n) => n.name === e);
|
|
1845
|
+
return this.find((n) => n.name === e) || null;
|
|
1794
1846
|
}
|
|
1795
1847
|
add(e) {
|
|
1796
1848
|
if (Array.isArray(e))
|
|
1797
1849
|
e.forEach((n) => this.add(n));
|
|
1798
|
-
else if (this
|
|
1850
|
+
else if (this.#t(e), this.#e(e)) {
|
|
1799
1851
|
const n = this.findIndex((i) => i.name === e.name);
|
|
1800
1852
|
~n ? this[n] = e : this.push(e);
|
|
1801
1853
|
}
|
|
@@ -1805,104 +1857,83 @@ class ie extends Array {
|
|
|
1805
1857
|
~n && this.splice(n, 1);
|
|
1806
1858
|
}
|
|
1807
1859
|
}
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
};
|
|
1812
|
-
class Dt {
|
|
1813
|
-
constructor(e, n, i = {}) {
|
|
1814
|
-
this.parent = e, this.el = Rt(n), this.settings = { ...i }, this.dataConfig = {}, this.customProps = {};
|
|
1815
|
-
}
|
|
1816
|
-
get id() {
|
|
1817
|
-
return this.el.id;
|
|
1818
|
-
}
|
|
1819
|
-
applySettings(e) {
|
|
1820
|
-
return Object.assign(this.settings, e);
|
|
1821
|
-
}
|
|
1822
|
-
getSetting(e, n) {
|
|
1823
|
-
return ee.call(this, e, n);
|
|
1824
|
-
}
|
|
1825
|
-
buildDataConfig() {
|
|
1826
|
-
return Object.assign(
|
|
1827
|
-
this.dataConfig,
|
|
1828
|
-
Jt(this.el, this.getSetting("dataConfig"))
|
|
1829
|
-
);
|
|
1830
|
-
}
|
|
1831
|
-
buildCustomProps() {
|
|
1832
|
-
return Object.assign(this.customProps, Gt(this));
|
|
1833
|
-
}
|
|
1834
|
-
async init(e = {}) {
|
|
1835
|
-
this.applySettings(e), this.buildDataConfig(), this.buildCustomProps();
|
|
1836
|
-
}
|
|
1837
|
-
async destroy() {
|
|
1838
|
-
Object.getOwnPropertyNames(this).forEach((e) => {
|
|
1839
|
-
delete this[e];
|
|
1840
|
-
});
|
|
1860
|
+
class Pt {
|
|
1861
|
+
constructor(e, n) {
|
|
1862
|
+
this.config = new Gt(), this.parent = e, this.el = jt(n), this.id = this.el.id, this.config.set("parent", this.parent.config), this.config.set("entry", {});
|
|
1841
1863
|
}
|
|
1842
1864
|
}
|
|
1843
|
-
|
|
1865
|
+
const te = {
|
|
1866
|
+
selector: "",
|
|
1867
|
+
plugins: [],
|
|
1868
|
+
presets: {}
|
|
1869
|
+
};
|
|
1870
|
+
class ee {
|
|
1844
1871
|
constructor(e = {}) {
|
|
1845
|
-
this.
|
|
1872
|
+
this.#t = new Qt(), this.events = this.#t.events, this.on = this.#t.on.bind(this.#t), this.off = this.#t.off.bind(this.#t), this.emit = this.#t.emit.bind(this.#t), this.collection = [], this.entryClass = Pt, this.name = this.constructor.name, this.config = { ...te, ...e }, this.plugins = new Zt(this.config.presets);
|
|
1846
1873
|
}
|
|
1874
|
+
#t;
|
|
1847
1875
|
get(e, n = "id") {
|
|
1848
1876
|
return this.collection.find((i) => i[n] === e);
|
|
1849
1877
|
}
|
|
1850
|
-
|
|
1851
|
-
|
|
1878
|
+
getOrThrow(e, n = "id") {
|
|
1879
|
+
const i = this.get(e, n);
|
|
1880
|
+
if (i)
|
|
1881
|
+
return i;
|
|
1882
|
+
throw new Error(
|
|
1883
|
+
`${this.name} entry not found in collection with ${String(n)} of "${e}"`
|
|
1884
|
+
);
|
|
1885
|
+
}
|
|
1886
|
+
updateConfig(e = {}) {
|
|
1887
|
+
return Object.assign(this.config, e);
|
|
1852
1888
|
}
|
|
1853
|
-
async createEntry(e
|
|
1854
|
-
const
|
|
1855
|
-
return await
|
|
1889
|
+
async createEntry(e) {
|
|
1890
|
+
const n = new this.entryClass(this, e);
|
|
1891
|
+
return await z2(n, "init"), await N("onCreateEntry", this, n), n;
|
|
1856
1892
|
}
|
|
1857
1893
|
async destroyEntry(e) {
|
|
1858
|
-
return await
|
|
1894
|
+
return await N("onDestroyEntry", this, e), await z2(e, "destroy"), e;
|
|
1859
1895
|
}
|
|
1860
|
-
async register(e
|
|
1861
|
-
const
|
|
1862
|
-
|
|
1863
|
-
const o2 = this.collection[s];
|
|
1864
|
-
return o2.el = i, typeof o2.init == "function" && await o2.init(n), o2;
|
|
1865
|
-
} else {
|
|
1866
|
-
const o2 = await this.createEntry(i, n);
|
|
1867
|
-
return this.collection.push(o2), await H2("onRegisterEntry", this, o2), o2;
|
|
1868
|
-
}
|
|
1896
|
+
async register(e) {
|
|
1897
|
+
const n = this.collection.findIndex((i) => i.id === e.id);
|
|
1898
|
+
return ~n ? this.collection[n] = e : this.collection.push(e), await N("onRegisterEntry", this, e), e;
|
|
1869
1899
|
}
|
|
1870
1900
|
async deregister(e) {
|
|
1871
|
-
const n = this.collection.findIndex((i) => i.id === e);
|
|
1901
|
+
const n = this.collection.findIndex((i) => i.id === e.id);
|
|
1872
1902
|
if (~n) {
|
|
1873
|
-
|
|
1874
|
-
return await H2(
|
|
1903
|
+
await N(
|
|
1875
1904
|
"onDeregisterEntry",
|
|
1876
1905
|
this,
|
|
1877
1906
|
this.collection[n]
|
|
1878
|
-
)
|
|
1907
|
+
);
|
|
1908
|
+
const [i] = this.collection.splice(n, 1);
|
|
1879
1909
|
}
|
|
1880
|
-
return
|
|
1910
|
+
return e;
|
|
1881
1911
|
}
|
|
1882
|
-
async mount(e =
|
|
1883
|
-
this.
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
return await
|
|
1893
|
-
}
|
|
1894
|
-
async unmount() {
|
|
1895
|
-
for (await
|
|
1896
|
-
await this.
|
|
1897
|
-
await
|
|
1898
|
-
for (const
|
|
1899
|
-
await
|
|
1900
|
-
for (const
|
|
1901
|
-
this.plugins.remove(
|
|
1912
|
+
async mount(e = (n) => n) {
|
|
1913
|
+
for (const n of this.config?.plugins || [])
|
|
1914
|
+
this.plugins.add(n);
|
|
1915
|
+
for (const n of this.plugins)
|
|
1916
|
+
await z2(n, "setup", this);
|
|
1917
|
+
if (await N("beforeMount", this), this.config.selector) {
|
|
1918
|
+
const n = document.querySelectorAll(this.config.selector);
|
|
1919
|
+
for (const i of n)
|
|
1920
|
+
await this.createEntry(i).then((s) => e(s)).then((s) => this.register(s));
|
|
1921
|
+
}
|
|
1922
|
+
return await N("afterMount", this), this;
|
|
1923
|
+
}
|
|
1924
|
+
async unmount(e = (n) => n) {
|
|
1925
|
+
for (await N("beforeUnmount", this); this.collection.length > 0; )
|
|
1926
|
+
await this.destroyEntry(this.collection[0]).then((n) => e(n)).then((n) => this.deregister(n));
|
|
1927
|
+
await N("afterUnmount", this);
|
|
1928
|
+
for (const n of this.plugins)
|
|
1929
|
+
await z2(n, "teardown", this);
|
|
1930
|
+
for (const n of [...this.plugins])
|
|
1931
|
+
this.plugins.remove(n.name);
|
|
1902
1932
|
return this;
|
|
1903
1933
|
}
|
|
1904
1934
|
}
|
|
1905
|
-
|
|
1935
|
+
Kt("theme-prefix", { fallback: "vb-theme-" });
|
|
1936
|
+
const ne = {
|
|
1906
1937
|
// Selectors
|
|
1907
1938
|
selector: ".popover",
|
|
1908
1939
|
selectorTooltip: ".popover_tooltip",
|
|
@@ -1927,78 +1958,78 @@ const re = {
|
|
|
1927
1958
|
shiftPadding: 0,
|
|
1928
1959
|
arrowPadding: 0,
|
|
1929
1960
|
toggleDelay: 0
|
|
1930
|
-
},
|
|
1961
|
+
}, j = Math.min, q2 = Math.max, st2 = Math.round, it = Math.floor, P2 = (t) => ({
|
|
1931
1962
|
x: t,
|
|
1932
1963
|
y: t
|
|
1933
|
-
}),
|
|
1964
|
+
}), ie = {
|
|
1934
1965
|
left: "right",
|
|
1935
1966
|
right: "left",
|
|
1936
1967
|
bottom: "top",
|
|
1937
1968
|
top: "bottom"
|
|
1938
|
-
},
|
|
1969
|
+
}, se = {
|
|
1939
1970
|
start: "end",
|
|
1940
1971
|
end: "start"
|
|
1941
1972
|
};
|
|
1942
|
-
function
|
|
1943
|
-
return
|
|
1973
|
+
function ht(t, e, n) {
|
|
1974
|
+
return q2(t, j(e, n));
|
|
1944
1975
|
}
|
|
1945
|
-
function
|
|
1976
|
+
function X(t, e) {
|
|
1946
1977
|
return typeof t == "function" ? t(e) : t;
|
|
1947
1978
|
}
|
|
1948
|
-
function
|
|
1979
|
+
function I2(t) {
|
|
1949
1980
|
return t.split("-")[0];
|
|
1950
1981
|
}
|
|
1951
|
-
function
|
|
1982
|
+
function et(t) {
|
|
1952
1983
|
return t.split("-")[1];
|
|
1953
1984
|
}
|
|
1954
|
-
function
|
|
1985
|
+
function pt(t) {
|
|
1955
1986
|
return t === "x" ? "y" : "x";
|
|
1956
1987
|
}
|
|
1957
|
-
function
|
|
1988
|
+
function wt(t) {
|
|
1958
1989
|
return t === "y" ? "height" : "width";
|
|
1959
1990
|
}
|
|
1960
|
-
const
|
|
1961
|
-
function
|
|
1962
|
-
return
|
|
1991
|
+
const oe = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
1992
|
+
function F(t) {
|
|
1993
|
+
return oe.has(I2(t)) ? "y" : "x";
|
|
1963
1994
|
}
|
|
1964
|
-
function
|
|
1965
|
-
return
|
|
1995
|
+
function yt(t) {
|
|
1996
|
+
return pt(F(t));
|
|
1966
1997
|
}
|
|
1967
|
-
function
|
|
1998
|
+
function re(t, e, n) {
|
|
1968
1999
|
n === void 0 && (n = false);
|
|
1969
|
-
const i =
|
|
2000
|
+
const i = et(t), s = yt(t), o = wt(s);
|
|
1970
2001
|
let r2 = s === "x" ? i === (n ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
1971
|
-
return e.reference[
|
|
2002
|
+
return e.reference[o] > e.floating[o] && (r2 = ot(r2)), [r2, ot(r2)];
|
|
1972
2003
|
}
|
|
1973
|
-
function
|
|
2004
|
+
function ce(t) {
|
|
1974
2005
|
const e = ot(t);
|
|
1975
2006
|
return [gt(t), e, gt(e)];
|
|
1976
2007
|
}
|
|
1977
2008
|
function gt(t) {
|
|
1978
|
-
return t.replace(/start|end/g, (e) =>
|
|
2009
|
+
return t.replace(/start|end/g, (e) => se[e]);
|
|
1979
2010
|
}
|
|
1980
|
-
const
|
|
1981
|
-
function
|
|
2011
|
+
const Et = ["left", "right"], At = ["right", "left"], le = ["top", "bottom"], ae = ["bottom", "top"];
|
|
2012
|
+
function fe(t, e, n) {
|
|
1982
2013
|
switch (t) {
|
|
1983
2014
|
case "top":
|
|
1984
2015
|
case "bottom":
|
|
1985
|
-
return n ? e ?
|
|
2016
|
+
return n ? e ? At : Et : e ? Et : At;
|
|
1986
2017
|
case "left":
|
|
1987
2018
|
case "right":
|
|
1988
|
-
return e ?
|
|
2019
|
+
return e ? le : ae;
|
|
1989
2020
|
default:
|
|
1990
2021
|
return [];
|
|
1991
2022
|
}
|
|
1992
2023
|
}
|
|
1993
|
-
function
|
|
1994
|
-
const s =
|
|
1995
|
-
let
|
|
1996
|
-
return s && (
|
|
2024
|
+
function ue(t, e, n, i) {
|
|
2025
|
+
const s = et(t);
|
|
2026
|
+
let o = fe(I2(t), n === "start", i);
|
|
2027
|
+
return s && (o = o.map((r2) => r2 + "-" + s), e && (o = o.concat(o.map(gt)))), o;
|
|
1997
2028
|
}
|
|
1998
2029
|
function ot(t) {
|
|
1999
|
-
return t.replace(/left|right|bottom|top/g, (e) =>
|
|
2030
|
+
return t.replace(/left|right|bottom|top/g, (e) => ie[e]);
|
|
2000
2031
|
}
|
|
2001
|
-
function
|
|
2032
|
+
function de(t) {
|
|
2002
2033
|
return {
|
|
2003
2034
|
top: 0,
|
|
2004
2035
|
right: 0,
|
|
@@ -2007,8 +2038,8 @@ function pe(t) {
|
|
|
2007
2038
|
...t
|
|
2008
2039
|
};
|
|
2009
2040
|
}
|
|
2010
|
-
function
|
|
2011
|
-
return typeof t != "number" ?
|
|
2041
|
+
function kt(t) {
|
|
2042
|
+
return typeof t != "number" ? de(t) : {
|
|
2012
2043
|
top: t,
|
|
2013
2044
|
right: t,
|
|
2014
2045
|
bottom: t,
|
|
@@ -2038,9 +2069,9 @@ function Ct(t, e, n) {
|
|
|
2038
2069
|
reference: i,
|
|
2039
2070
|
floating: s
|
|
2040
2071
|
} = t;
|
|
2041
|
-
const
|
|
2072
|
+
const o = F(e), r2 = yt(e), c2 = wt(r2), a2 = I2(e), l2 = o === "y", d2 = i.x + i.width / 2 - s.width / 2, u2 = i.y + i.height / 2 - s.height / 2, h2 = i[c2] / 2 - s[c2] / 2;
|
|
2042
2073
|
let f2;
|
|
2043
|
-
switch (
|
|
2074
|
+
switch (a2) {
|
|
2044
2075
|
case "top":
|
|
2045
2076
|
f2 = {
|
|
2046
2077
|
x: d2,
|
|
@@ -2071,123 +2102,123 @@ function Ct(t, e, n) {
|
|
|
2071
2102
|
y: i.y
|
|
2072
2103
|
};
|
|
2073
2104
|
}
|
|
2074
|
-
switch (
|
|
2105
|
+
switch (et(e)) {
|
|
2075
2106
|
case "start":
|
|
2076
|
-
f2[r2] -=
|
|
2107
|
+
f2[r2] -= h2 * (n && l2 ? -1 : 1);
|
|
2077
2108
|
break;
|
|
2078
2109
|
case "end":
|
|
2079
|
-
f2[r2] +=
|
|
2110
|
+
f2[r2] += h2 * (n && l2 ? -1 : 1);
|
|
2080
2111
|
break;
|
|
2081
2112
|
}
|
|
2082
2113
|
return f2;
|
|
2083
2114
|
}
|
|
2084
|
-
const
|
|
2115
|
+
const he = async (t, e, n) => {
|
|
2085
2116
|
const {
|
|
2086
2117
|
placement: i = "bottom",
|
|
2087
2118
|
strategy: s = "absolute",
|
|
2088
|
-
middleware:
|
|
2119
|
+
middleware: o = [],
|
|
2089
2120
|
platform: r2
|
|
2090
|
-
} = n,
|
|
2091
|
-
let
|
|
2121
|
+
} = n, c2 = o.filter(Boolean), a2 = await (r2.isRTL == null ? void 0 : r2.isRTL(e));
|
|
2122
|
+
let l2 = await r2.getElementRects({
|
|
2092
2123
|
reference: t,
|
|
2093
2124
|
floating: e,
|
|
2094
2125
|
strategy: s
|
|
2095
2126
|
}), {
|
|
2096
2127
|
x: d2,
|
|
2097
2128
|
y: u2
|
|
2098
|
-
} = Ct(
|
|
2099
|
-
for (let m2 = 0; m2 <
|
|
2129
|
+
} = Ct(l2, i, a2), h2 = i, f2 = {}, g3 = 0;
|
|
2130
|
+
for (let m2 = 0; m2 < c2.length; m2++) {
|
|
2100
2131
|
const {
|
|
2101
2132
|
name: p2,
|
|
2102
2133
|
fn: w2
|
|
2103
|
-
} =
|
|
2104
|
-
x:
|
|
2105
|
-
y:
|
|
2134
|
+
} = c2[m2], {
|
|
2135
|
+
x: y2,
|
|
2136
|
+
y: x3,
|
|
2106
2137
|
data: b2,
|
|
2107
2138
|
reset: v2
|
|
2108
2139
|
} = await w2({
|
|
2109
2140
|
x: d2,
|
|
2110
2141
|
y: u2,
|
|
2111
2142
|
initialPlacement: i,
|
|
2112
|
-
placement:
|
|
2143
|
+
placement: h2,
|
|
2113
2144
|
strategy: s,
|
|
2114
2145
|
middlewareData: f2,
|
|
2115
|
-
rects:
|
|
2146
|
+
rects: l2,
|
|
2116
2147
|
platform: r2,
|
|
2117
2148
|
elements: {
|
|
2118
2149
|
reference: t,
|
|
2119
2150
|
floating: e
|
|
2120
2151
|
}
|
|
2121
2152
|
});
|
|
2122
|
-
d2 =
|
|
2153
|
+
d2 = y2 ?? d2, u2 = x3 ?? u2, f2 = {
|
|
2123
2154
|
...f2,
|
|
2124
2155
|
[p2]: {
|
|
2125
2156
|
...f2[p2],
|
|
2126
2157
|
...b2
|
|
2127
2158
|
}
|
|
2128
|
-
}, v2 &&
|
|
2159
|
+
}, v2 && g3 <= 50 && (g3++, typeof v2 == "object" && (v2.placement && (h2 = v2.placement), v2.rects && (l2 = v2.rects === true ? await r2.getElementRects({
|
|
2129
2160
|
reference: t,
|
|
2130
2161
|
floating: e,
|
|
2131
2162
|
strategy: s
|
|
2132
2163
|
}) : v2.rects), {
|
|
2133
2164
|
x: d2,
|
|
2134
2165
|
y: u2
|
|
2135
|
-
} = Ct(
|
|
2166
|
+
} = Ct(l2, h2, a2)), m2 = -1);
|
|
2136
2167
|
}
|
|
2137
2168
|
return {
|
|
2138
2169
|
x: d2,
|
|
2139
2170
|
y: u2,
|
|
2140
|
-
placement:
|
|
2171
|
+
placement: h2,
|
|
2141
2172
|
strategy: s,
|
|
2142
2173
|
middlewareData: f2
|
|
2143
2174
|
};
|
|
2144
2175
|
};
|
|
2145
|
-
async function
|
|
2176
|
+
async function Dt(t, e) {
|
|
2146
2177
|
var n;
|
|
2147
2178
|
e === void 0 && (e = {});
|
|
2148
2179
|
const {
|
|
2149
2180
|
x: i,
|
|
2150
2181
|
y: s,
|
|
2151
|
-
platform:
|
|
2182
|
+
platform: o,
|
|
2152
2183
|
rects: r2,
|
|
2153
|
-
elements:
|
|
2154
|
-
strategy:
|
|
2184
|
+
elements: c2,
|
|
2185
|
+
strategy: a2
|
|
2155
2186
|
} = t, {
|
|
2156
|
-
boundary:
|
|
2187
|
+
boundary: l2 = "clippingAncestors",
|
|
2157
2188
|
rootBoundary: d2 = "viewport",
|
|
2158
2189
|
elementContext: u2 = "floating",
|
|
2159
|
-
altBoundary:
|
|
2190
|
+
altBoundary: h2 = false,
|
|
2160
2191
|
padding: f2 = 0
|
|
2161
|
-
} =
|
|
2162
|
-
element: (n = await (
|
|
2163
|
-
boundary:
|
|
2192
|
+
} = X(e, t), g3 = kt(f2), p2 = c2[h2 ? u2 === "floating" ? "reference" : "floating" : u2], w2 = rt(await o.getClippingRect({
|
|
2193
|
+
element: (n = await (o.isElement == null ? void 0 : o.isElement(p2))) == null || n ? p2 : p2.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(c2.floating)),
|
|
2194
|
+
boundary: l2,
|
|
2164
2195
|
rootBoundary: d2,
|
|
2165
|
-
strategy:
|
|
2166
|
-
})),
|
|
2196
|
+
strategy: a2
|
|
2197
|
+
})), y2 = u2 === "floating" ? {
|
|
2167
2198
|
x: i,
|
|
2168
2199
|
y: s,
|
|
2169
2200
|
width: r2.floating.width,
|
|
2170
2201
|
height: r2.floating.height
|
|
2171
|
-
} : r2.reference,
|
|
2202
|
+
} : r2.reference, x3 = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c2.floating)), b2 = await (o.isElement == null ? void 0 : o.isElement(x3)) ? await (o.getScale == null ? void 0 : o.getScale(x3)) || {
|
|
2172
2203
|
x: 1,
|
|
2173
2204
|
y: 1
|
|
2174
2205
|
} : {
|
|
2175
2206
|
x: 1,
|
|
2176
2207
|
y: 1
|
|
2177
|
-
}, v2 = rt(
|
|
2178
|
-
elements:
|
|
2179
|
-
rect:
|
|
2180
|
-
offsetParent:
|
|
2181
|
-
strategy:
|
|
2182
|
-
}) :
|
|
2208
|
+
}, v2 = rt(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
2209
|
+
elements: c2,
|
|
2210
|
+
rect: y2,
|
|
2211
|
+
offsetParent: x3,
|
|
2212
|
+
strategy: a2
|
|
2213
|
+
}) : y2);
|
|
2183
2214
|
return {
|
|
2184
|
-
top: (w2.top - v2.top +
|
|
2185
|
-
bottom: (v2.bottom - w2.bottom +
|
|
2186
|
-
left: (w2.left - v2.left +
|
|
2187
|
-
right: (v2.right - w2.right +
|
|
2215
|
+
top: (w2.top - v2.top + g3.top) / b2.y,
|
|
2216
|
+
bottom: (v2.bottom - w2.bottom + g3.bottom) / b2.y,
|
|
2217
|
+
left: (w2.left - v2.left + g3.left) / b2.x,
|
|
2218
|
+
right: (v2.right - w2.right + g3.right) / b2.x
|
|
2188
2219
|
};
|
|
2189
2220
|
}
|
|
2190
|
-
const
|
|
2221
|
+
const ge = (t) => ({
|
|
2191
2222
|
name: "arrow",
|
|
2192
2223
|
options: t,
|
|
2193
2224
|
async fn(e) {
|
|
@@ -2195,36 +2226,36 @@ const ye = (t) => ({
|
|
|
2195
2226
|
x: n,
|
|
2196
2227
|
y: i,
|
|
2197
2228
|
placement: s,
|
|
2198
|
-
rects:
|
|
2229
|
+
rects: o,
|
|
2199
2230
|
platform: r2,
|
|
2200
|
-
elements:
|
|
2201
|
-
middlewareData:
|
|
2231
|
+
elements: c2,
|
|
2232
|
+
middlewareData: a2
|
|
2202
2233
|
} = e, {
|
|
2203
|
-
element:
|
|
2234
|
+
element: l2,
|
|
2204
2235
|
padding: d2 = 0
|
|
2205
|
-
} =
|
|
2206
|
-
if (
|
|
2236
|
+
} = X(t, e) || {};
|
|
2237
|
+
if (l2 == null)
|
|
2207
2238
|
return {};
|
|
2208
|
-
const u2 =
|
|
2239
|
+
const u2 = kt(d2), h2 = {
|
|
2209
2240
|
x: n,
|
|
2210
2241
|
y: i
|
|
2211
|
-
}, f2 =
|
|
2212
|
-
let
|
|
2213
|
-
(!
|
|
2214
|
-
const
|
|
2242
|
+
}, f2 = yt(s), g3 = wt(f2), m2 = await r2.getDimensions(l2), p2 = f2 === "y", w2 = p2 ? "top" : "left", y2 = p2 ? "bottom" : "right", x3 = p2 ? "clientHeight" : "clientWidth", b2 = o.reference[g3] + o.reference[f2] - h2[f2] - o.floating[g3], v2 = h2[f2] - o.reference[f2], C2 = await (r2.getOffsetParent == null ? void 0 : r2.getOffsetParent(l2));
|
|
2243
|
+
let L4 = C2 ? C2[x3] : 0;
|
|
2244
|
+
(!L4 || !await (r2.isElement == null ? void 0 : r2.isElement(C2))) && (L4 = c2.floating[x3] || o.floating[g3]);
|
|
2245
|
+
const G2 = b2 / 2 - v2 / 2, V2 = L4 / 2 - m2[g3] / 2 - 1, M2 = j(u2[w2], V2), Q2 = j(u2[y2], V2), B2 = M2, Z2 = L4 - m2[g3] - Q2, E2 = L4 / 2 - m2[g3] / 2 + G2, _2 = ht(B2, E2, Z2), $2 = !a2.arrow && et(s) != null && E2 !== _2 && o.reference[g3] / 2 - (E2 < B2 ? M2 : Q2) - m2[g3] / 2 < 0, O3 = $2 ? E2 < B2 ? E2 - B2 : E2 - Z2 : 0;
|
|
2215
2246
|
return {
|
|
2216
|
-
[f2]:
|
|
2247
|
+
[f2]: h2[f2] + O3,
|
|
2217
2248
|
data: {
|
|
2218
2249
|
[f2]: _2,
|
|
2219
|
-
centerOffset:
|
|
2250
|
+
centerOffset: E2 - _2 - O3,
|
|
2220
2251
|
...$2 && {
|
|
2221
|
-
alignmentOffset:
|
|
2252
|
+
alignmentOffset: O3
|
|
2222
2253
|
}
|
|
2223
2254
|
},
|
|
2224
2255
|
reset: $2
|
|
2225
2256
|
};
|
|
2226
2257
|
}
|
|
2227
|
-
}),
|
|
2258
|
+
}), me = function(t) {
|
|
2228
2259
|
return t === void 0 && (t = {}), {
|
|
2229
2260
|
name: "flip",
|
|
2230
2261
|
options: t,
|
|
@@ -2232,67 +2263,67 @@ const ye = (t) => ({
|
|
|
2232
2263
|
var n, i;
|
|
2233
2264
|
const {
|
|
2234
2265
|
placement: s,
|
|
2235
|
-
middlewareData:
|
|
2266
|
+
middlewareData: o,
|
|
2236
2267
|
rects: r2,
|
|
2237
|
-
initialPlacement:
|
|
2238
|
-
platform:
|
|
2239
|
-
elements:
|
|
2268
|
+
initialPlacement: c2,
|
|
2269
|
+
platform: a2,
|
|
2270
|
+
elements: l2
|
|
2240
2271
|
} = e, {
|
|
2241
2272
|
mainAxis: d2 = true,
|
|
2242
2273
|
crossAxis: u2 = true,
|
|
2243
|
-
fallbackPlacements:
|
|
2274
|
+
fallbackPlacements: h2,
|
|
2244
2275
|
fallbackStrategy: f2 = "bestFit",
|
|
2245
|
-
fallbackAxisSideDirection:
|
|
2276
|
+
fallbackAxisSideDirection: g3 = "none",
|
|
2246
2277
|
flipAlignment: m2 = true,
|
|
2247
2278
|
...p2
|
|
2248
|
-
} =
|
|
2249
|
-
if ((n =
|
|
2279
|
+
} = X(t, e);
|
|
2280
|
+
if ((n = o.arrow) != null && n.alignmentOffset)
|
|
2250
2281
|
return {};
|
|
2251
|
-
const w2 =
|
|
2252
|
-
!
|
|
2253
|
-
const
|
|
2254
|
-
let M2 = ((i =
|
|
2255
|
-
if (d2 &&
|
|
2256
|
-
const
|
|
2257
|
-
|
|
2282
|
+
const w2 = I2(s), y2 = F(c2), x3 = I2(c2) === c2, b2 = await (a2.isRTL == null ? void 0 : a2.isRTL(l2.floating)), v2 = h2 || (x3 || !m2 ? [ot(c2)] : ce(c2)), C2 = g3 !== "none";
|
|
2283
|
+
!h2 && C2 && v2.push(...ue(c2, m2, g3, b2));
|
|
2284
|
+
const L4 = [c2, ...v2], G2 = await Dt(e, p2), V2 = [];
|
|
2285
|
+
let M2 = ((i = o.flip) == null ? void 0 : i.overflows) || [];
|
|
2286
|
+
if (d2 && V2.push(G2[w2]), u2) {
|
|
2287
|
+
const E2 = re(s, r2, b2);
|
|
2288
|
+
V2.push(G2[E2[0]], G2[E2[1]]);
|
|
2258
2289
|
}
|
|
2259
2290
|
if (M2 = [...M2, {
|
|
2260
2291
|
placement: s,
|
|
2261
|
-
overflows:
|
|
2262
|
-
}], !
|
|
2263
|
-
var
|
|
2264
|
-
const
|
|
2265
|
-
if (_2 && (!(u2 === "alignment" ?
|
|
2292
|
+
overflows: V2
|
|
2293
|
+
}], !V2.every((E2) => E2 <= 0)) {
|
|
2294
|
+
var Q2, B2;
|
|
2295
|
+
const E2 = (((Q2 = o.flip) == null ? void 0 : Q2.index) || 0) + 1, _2 = L4[E2];
|
|
2296
|
+
if (_2 && (!(u2 === "alignment" ? y2 !== F(_2) : false) || // We leave the current main axis only if every placement on that axis
|
|
2266
2297
|
// overflows the main axis.
|
|
2267
|
-
M2.every((
|
|
2298
|
+
M2.every((T2) => F(T2.placement) === y2 ? T2.overflows[0] > 0 : true)))
|
|
2268
2299
|
return {
|
|
2269
2300
|
data: {
|
|
2270
|
-
index:
|
|
2301
|
+
index: E2,
|
|
2271
2302
|
overflows: M2
|
|
2272
2303
|
},
|
|
2273
2304
|
reset: {
|
|
2274
2305
|
placement: _2
|
|
2275
2306
|
}
|
|
2276
2307
|
};
|
|
2277
|
-
let $2 = (
|
|
2308
|
+
let $2 = (B2 = M2.filter((O3) => O3.overflows[0] <= 0).sort((O3, T2) => O3.overflows[1] - T2.overflows[1])[0]) == null ? void 0 : B2.placement;
|
|
2278
2309
|
if (!$2)
|
|
2279
2310
|
switch (f2) {
|
|
2280
2311
|
case "bestFit": {
|
|
2281
|
-
var
|
|
2282
|
-
const
|
|
2312
|
+
var Z2;
|
|
2313
|
+
const O3 = (Z2 = M2.filter((T2) => {
|
|
2283
2314
|
if (C2) {
|
|
2284
|
-
const
|
|
2285
|
-
return
|
|
2315
|
+
const H2 = F(T2.placement);
|
|
2316
|
+
return H2 === y2 || // Create a bias to the `y` side axis due to horizontal
|
|
2286
2317
|
// reading directions favoring greater width.
|
|
2287
|
-
|
|
2318
|
+
H2 === "y";
|
|
2288
2319
|
}
|
|
2289
2320
|
return true;
|
|
2290
|
-
}).map((
|
|
2291
|
-
|
|
2321
|
+
}).map((T2) => [T2.placement, T2.overflows.filter((H2) => H2 > 0).reduce((H2, Yt) => H2 + Yt, 0)]).sort((T2, H2) => T2[1] - H2[1])[0]) == null ? void 0 : Z2[0];
|
|
2322
|
+
O3 && ($2 = O3);
|
|
2292
2323
|
break;
|
|
2293
2324
|
}
|
|
2294
2325
|
case "initialPlacement":
|
|
2295
|
-
$2 =
|
|
2326
|
+
$2 = c2;
|
|
2296
2327
|
break;
|
|
2297
2328
|
}
|
|
2298
2329
|
if (s !== $2)
|
|
@@ -2305,17 +2336,17 @@ const ye = (t) => ({
|
|
|
2305
2336
|
return {};
|
|
2306
2337
|
}
|
|
2307
2338
|
};
|
|
2308
|
-
},
|
|
2309
|
-
async function
|
|
2339
|
+
}, Mt = /* @__PURE__ */ new Set(["left", "top"]);
|
|
2340
|
+
async function pe(t, e) {
|
|
2310
2341
|
const {
|
|
2311
2342
|
placement: n,
|
|
2312
2343
|
platform: i,
|
|
2313
2344
|
elements: s
|
|
2314
|
-
} = t,
|
|
2345
|
+
} = t, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), r2 = I2(n), c2 = et(n), a2 = F(n) === "y", l2 = Mt.has(r2) ? -1 : 1, d2 = o && a2 ? -1 : 1, u2 = X(e, t);
|
|
2315
2346
|
let {
|
|
2316
|
-
mainAxis:
|
|
2347
|
+
mainAxis: h2,
|
|
2317
2348
|
crossAxis: f2,
|
|
2318
|
-
alignmentAxis:
|
|
2349
|
+
alignmentAxis: g3
|
|
2319
2350
|
} = typeof u2 == "number" ? {
|
|
2320
2351
|
mainAxis: u2,
|
|
2321
2352
|
crossAxis: 0,
|
|
@@ -2325,15 +2356,15 @@ async function ve(t, e) {
|
|
|
2325
2356
|
crossAxis: u2.crossAxis || 0,
|
|
2326
2357
|
alignmentAxis: u2.alignmentAxis
|
|
2327
2358
|
};
|
|
2328
|
-
return
|
|
2359
|
+
return c2 && typeof g3 == "number" && (f2 = c2 === "end" ? g3 * -1 : g3), a2 ? {
|
|
2329
2360
|
x: f2 * d2,
|
|
2330
|
-
y:
|
|
2361
|
+
y: h2 * l2
|
|
2331
2362
|
} : {
|
|
2332
|
-
x:
|
|
2363
|
+
x: h2 * l2,
|
|
2333
2364
|
y: f2 * d2
|
|
2334
2365
|
};
|
|
2335
2366
|
}
|
|
2336
|
-
const
|
|
2367
|
+
const we = function(t) {
|
|
2337
2368
|
return t === void 0 && (t = 0), {
|
|
2338
2369
|
name: "offset",
|
|
2339
2370
|
options: t,
|
|
@@ -2341,21 +2372,21 @@ const be = function(t) {
|
|
|
2341
2372
|
var n, i;
|
|
2342
2373
|
const {
|
|
2343
2374
|
x: s,
|
|
2344
|
-
y:
|
|
2375
|
+
y: o,
|
|
2345
2376
|
placement: r2,
|
|
2346
|
-
middlewareData:
|
|
2347
|
-
} = e,
|
|
2348
|
-
return r2 === ((n =
|
|
2349
|
-
x: s +
|
|
2350
|
-
y:
|
|
2377
|
+
middlewareData: c2
|
|
2378
|
+
} = e, a2 = await pe(e, t);
|
|
2379
|
+
return r2 === ((n = c2.offset) == null ? void 0 : n.placement) && (i = c2.arrow) != null && i.alignmentOffset ? {} : {
|
|
2380
|
+
x: s + a2.x,
|
|
2381
|
+
y: o + a2.y,
|
|
2351
2382
|
data: {
|
|
2352
|
-
...
|
|
2383
|
+
...a2,
|
|
2353
2384
|
placement: r2
|
|
2354
2385
|
}
|
|
2355
2386
|
};
|
|
2356
2387
|
}
|
|
2357
2388
|
};
|
|
2358
|
-
},
|
|
2389
|
+
}, ye = function(t) {
|
|
2359
2390
|
return t === void 0 && (t = {}), {
|
|
2360
2391
|
name: "shift",
|
|
2361
2392
|
options: t,
|
|
@@ -2365,38 +2396,38 @@ const be = function(t) {
|
|
|
2365
2396
|
y: i,
|
|
2366
2397
|
placement: s
|
|
2367
2398
|
} = e, {
|
|
2368
|
-
mainAxis:
|
|
2399
|
+
mainAxis: o = true,
|
|
2369
2400
|
crossAxis: r2 = false,
|
|
2370
|
-
limiter:
|
|
2401
|
+
limiter: c2 = {
|
|
2371
2402
|
fn: (p2) => {
|
|
2372
2403
|
let {
|
|
2373
2404
|
x: w2,
|
|
2374
|
-
y:
|
|
2405
|
+
y: y2
|
|
2375
2406
|
} = p2;
|
|
2376
2407
|
return {
|
|
2377
2408
|
x: w2,
|
|
2378
|
-
y:
|
|
2409
|
+
y: y2
|
|
2379
2410
|
};
|
|
2380
2411
|
}
|
|
2381
2412
|
},
|
|
2382
|
-
...
|
|
2383
|
-
} =
|
|
2413
|
+
...a2
|
|
2414
|
+
} = X(t, e), l2 = {
|
|
2384
2415
|
x: n,
|
|
2385
2416
|
y: i
|
|
2386
|
-
}, d2 = await
|
|
2387
|
-
let f2 =
|
|
2388
|
-
if (
|
|
2389
|
-
const p2 =
|
|
2390
|
-
f2 =
|
|
2417
|
+
}, d2 = await Dt(e, a2), u2 = F(I2(s)), h2 = pt(u2);
|
|
2418
|
+
let f2 = l2[h2], g3 = l2[u2];
|
|
2419
|
+
if (o) {
|
|
2420
|
+
const p2 = h2 === "y" ? "top" : "left", w2 = h2 === "y" ? "bottom" : "right", y2 = f2 + d2[p2], x3 = f2 - d2[w2];
|
|
2421
|
+
f2 = ht(y2, f2, x3);
|
|
2391
2422
|
}
|
|
2392
2423
|
if (r2) {
|
|
2393
|
-
const p2 = u2 === "y" ? "top" : "left", w2 = u2 === "y" ? "bottom" : "right",
|
|
2394
|
-
|
|
2424
|
+
const p2 = u2 === "y" ? "top" : "left", w2 = u2 === "y" ? "bottom" : "right", y2 = g3 + d2[p2], x3 = g3 - d2[w2];
|
|
2425
|
+
g3 = ht(y2, g3, x3);
|
|
2395
2426
|
}
|
|
2396
|
-
const m2 =
|
|
2427
|
+
const m2 = c2.fn({
|
|
2397
2428
|
...e,
|
|
2398
|
-
[
|
|
2399
|
-
[u2]:
|
|
2429
|
+
[h2]: f2,
|
|
2430
|
+
[u2]: g3
|
|
2400
2431
|
});
|
|
2401
2432
|
return {
|
|
2402
2433
|
...m2,
|
|
@@ -2404,14 +2435,14 @@ const be = function(t) {
|
|
|
2404
2435
|
x: m2.x - n,
|
|
2405
2436
|
y: m2.y - i,
|
|
2406
2437
|
enabled: {
|
|
2407
|
-
[
|
|
2438
|
+
[h2]: o,
|
|
2408
2439
|
[u2]: r2
|
|
2409
2440
|
}
|
|
2410
2441
|
}
|
|
2411
2442
|
};
|
|
2412
2443
|
}
|
|
2413
2444
|
};
|
|
2414
|
-
},
|
|
2445
|
+
}, xe = function(t) {
|
|
2415
2446
|
return t === void 0 && (t = {}), {
|
|
2416
2447
|
options: t,
|
|
2417
2448
|
fn(e) {
|
|
@@ -2419,18 +2450,18 @@ const be = function(t) {
|
|
|
2419
2450
|
x: n,
|
|
2420
2451
|
y: i,
|
|
2421
2452
|
placement: s,
|
|
2422
|
-
rects:
|
|
2453
|
+
rects: o,
|
|
2423
2454
|
middlewareData: r2
|
|
2424
2455
|
} = e, {
|
|
2425
|
-
offset:
|
|
2426
|
-
mainAxis:
|
|
2427
|
-
crossAxis:
|
|
2428
|
-
} =
|
|
2456
|
+
offset: c2 = 0,
|
|
2457
|
+
mainAxis: a2 = true,
|
|
2458
|
+
crossAxis: l2 = true
|
|
2459
|
+
} = X(t, e), d2 = {
|
|
2429
2460
|
x: n,
|
|
2430
2461
|
y: i
|
|
2431
|
-
}, u2 =
|
|
2432
|
-
let f2 = d2[
|
|
2433
|
-
const m2 =
|
|
2462
|
+
}, u2 = F(s), h2 = pt(u2);
|
|
2463
|
+
let f2 = d2[h2], g3 = d2[u2];
|
|
2464
|
+
const m2 = X(c2, e), p2 = typeof m2 == "number" ? {
|
|
2434
2465
|
mainAxis: m2,
|
|
2435
2466
|
crossAxis: 0
|
|
2436
2467
|
} : {
|
|
@@ -2438,18 +2469,18 @@ const be = function(t) {
|
|
|
2438
2469
|
crossAxis: 0,
|
|
2439
2470
|
...m2
|
|
2440
2471
|
};
|
|
2441
|
-
if (
|
|
2442
|
-
const
|
|
2472
|
+
if (a2) {
|
|
2473
|
+
const x3 = h2 === "y" ? "height" : "width", b2 = o.reference[h2] - o.floating[x3] + p2.mainAxis, v2 = o.reference[h2] + o.reference[x3] - p2.mainAxis;
|
|
2443
2474
|
f2 < b2 ? f2 = b2 : f2 > v2 && (f2 = v2);
|
|
2444
2475
|
}
|
|
2445
|
-
if (
|
|
2446
|
-
var w2,
|
|
2447
|
-
const
|
|
2448
|
-
|
|
2476
|
+
if (l2) {
|
|
2477
|
+
var w2, y2;
|
|
2478
|
+
const x3 = h2 === "y" ? "width" : "height", b2 = Mt.has(I2(s)), v2 = o.reference[u2] - o.floating[x3] + (b2 && ((w2 = r2.offset) == null ? void 0 : w2[u2]) || 0) + (b2 ? 0 : p2.crossAxis), C2 = o.reference[u2] + o.reference[x3] + (b2 ? 0 : ((y2 = r2.offset) == null ? void 0 : y2[u2]) || 0) - (b2 ? p2.crossAxis : 0);
|
|
2479
|
+
g3 < v2 ? g3 = v2 : g3 > C2 && (g3 = C2);
|
|
2449
2480
|
}
|
|
2450
2481
|
return {
|
|
2451
|
-
[
|
|
2452
|
-
[u2]:
|
|
2482
|
+
[h2]: f2,
|
|
2483
|
+
[u2]: g3
|
|
2453
2484
|
};
|
|
2454
2485
|
}
|
|
2455
2486
|
};
|
|
@@ -2458,45 +2489,45 @@ function ct() {
|
|
|
2458
2489
|
return typeof window < "u";
|
|
2459
2490
|
}
|
|
2460
2491
|
function J(t) {
|
|
2461
|
-
return
|
|
2492
|
+
return $t(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
2462
2493
|
}
|
|
2463
|
-
function
|
|
2494
|
+
function A3(t) {
|
|
2464
2495
|
var e;
|
|
2465
2496
|
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
2466
2497
|
}
|
|
2467
|
-
function
|
|
2498
|
+
function D2(t) {
|
|
2468
2499
|
var e;
|
|
2469
|
-
return (e = (
|
|
2500
|
+
return (e = ($t(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
2470
2501
|
}
|
|
2471
|
-
function
|
|
2472
|
-
return ct() ? t instanceof Node || t instanceof
|
|
2502
|
+
function $t(t) {
|
|
2503
|
+
return ct() ? t instanceof Node || t instanceof A3(t).Node : false;
|
|
2473
2504
|
}
|
|
2474
|
-
function
|
|
2475
|
-
return ct() ? t instanceof Element || t instanceof
|
|
2505
|
+
function S2(t) {
|
|
2506
|
+
return ct() ? t instanceof Element || t instanceof A3(t).Element : false;
|
|
2476
2507
|
}
|
|
2477
|
-
function
|
|
2478
|
-
return ct() ? t instanceof HTMLElement || t instanceof
|
|
2508
|
+
function k(t) {
|
|
2509
|
+
return ct() ? t instanceof HTMLElement || t instanceof A3(t).HTMLElement : false;
|
|
2479
2510
|
}
|
|
2480
|
-
function
|
|
2481
|
-
return !ct() || typeof ShadowRoot > "u" ? false : t instanceof ShadowRoot || t instanceof
|
|
2511
|
+
function Lt(t) {
|
|
2512
|
+
return !ct() || typeof ShadowRoot > "u" ? false : t instanceof ShadowRoot || t instanceof A3(t).ShadowRoot;
|
|
2482
2513
|
}
|
|
2483
|
-
const
|
|
2514
|
+
const ve = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
2484
2515
|
function nt(t) {
|
|
2485
2516
|
const {
|
|
2486
2517
|
overflow: e,
|
|
2487
2518
|
overflowX: n,
|
|
2488
2519
|
overflowY: i,
|
|
2489
2520
|
display: s
|
|
2490
|
-
} =
|
|
2491
|
-
return /auto|scroll|overlay|hidden|clip/.test(e + i + n) && !
|
|
2521
|
+
} = R(t);
|
|
2522
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + i + n) && !ve.has(s);
|
|
2492
2523
|
}
|
|
2493
|
-
const
|
|
2494
|
-
function
|
|
2495
|
-
return
|
|
2524
|
+
const be = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
2525
|
+
function Ee(t) {
|
|
2526
|
+
return be.has(J(t));
|
|
2496
2527
|
}
|
|
2497
|
-
const
|
|
2528
|
+
const Ae = [":popover-open", ":modal"];
|
|
2498
2529
|
function lt(t) {
|
|
2499
|
-
return
|
|
2530
|
+
return Ae.some((e) => {
|
|
2500
2531
|
try {
|
|
2501
2532
|
return t.matches(e);
|
|
2502
2533
|
} catch {
|
|
@@ -2504,34 +2535,34 @@ function lt(t) {
|
|
|
2504
2535
|
}
|
|
2505
2536
|
});
|
|
2506
2537
|
}
|
|
2507
|
-
const
|
|
2508
|
-
function
|
|
2509
|
-
const e =
|
|
2510
|
-
return
|
|
2538
|
+
const Ce = ["transform", "translate", "scale", "rotate", "perspective"], Le = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Oe = ["paint", "layout", "strict", "content"];
|
|
2539
|
+
function xt(t) {
|
|
2540
|
+
const e = vt(), n = S2(t) ? R(t) : t;
|
|
2541
|
+
return Ce.some((i) => n[i] ? n[i] !== "none" : false) || (n.containerType ? n.containerType !== "normal" : false) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : false) || !e && (n.filter ? n.filter !== "none" : false) || Le.some((i) => (n.willChange || "").includes(i)) || Oe.some((i) => (n.contain || "").includes(i));
|
|
2511
2542
|
}
|
|
2512
|
-
function
|
|
2513
|
-
let e =
|
|
2514
|
-
for (;
|
|
2515
|
-
if (
|
|
2543
|
+
function Te(t) {
|
|
2544
|
+
let e = W(t);
|
|
2545
|
+
for (; k(e) && !K(e); ) {
|
|
2546
|
+
if (xt(e))
|
|
2516
2547
|
return e;
|
|
2517
2548
|
if (lt(e))
|
|
2518
2549
|
return null;
|
|
2519
|
-
e =
|
|
2550
|
+
e = W(e);
|
|
2520
2551
|
}
|
|
2521
2552
|
return null;
|
|
2522
2553
|
}
|
|
2523
|
-
function
|
|
2554
|
+
function vt() {
|
|
2524
2555
|
return typeof CSS > "u" || !CSS.supports ? false : CSS.supports("-webkit-backdrop-filter", "none");
|
|
2525
2556
|
}
|
|
2526
|
-
const
|
|
2527
|
-
function
|
|
2528
|
-
return
|
|
2557
|
+
const Se = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
2558
|
+
function K(t) {
|
|
2559
|
+
return Se.has(J(t));
|
|
2529
2560
|
}
|
|
2530
|
-
function
|
|
2531
|
-
return
|
|
2561
|
+
function R(t) {
|
|
2562
|
+
return A3(t).getComputedStyle(t);
|
|
2532
2563
|
}
|
|
2533
2564
|
function at(t) {
|
|
2534
|
-
return
|
|
2565
|
+
return S2(t) ? {
|
|
2535
2566
|
scrollLeft: t.scrollLeft,
|
|
2536
2567
|
scrollTop: t.scrollTop
|
|
2537
2568
|
} : {
|
|
@@ -2539,187 +2570,189 @@ function at(t) {
|
|
|
2539
2570
|
scrollTop: t.scrollY
|
|
2540
2571
|
};
|
|
2541
2572
|
}
|
|
2542
|
-
function
|
|
2573
|
+
function W(t) {
|
|
2543
2574
|
if (J(t) === "html")
|
|
2544
2575
|
return t;
|
|
2545
2576
|
const e = (
|
|
2546
2577
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
2547
2578
|
t.assignedSlot || // DOM Element detected.
|
|
2548
2579
|
t.parentNode || // ShadowRoot detected.
|
|
2549
|
-
|
|
2550
|
-
|
|
2580
|
+
Lt(t) && t.host || // Fallback.
|
|
2581
|
+
D2(t)
|
|
2551
2582
|
);
|
|
2552
|
-
return
|
|
2583
|
+
return Lt(e) ? e.host : e;
|
|
2553
2584
|
}
|
|
2554
|
-
function
|
|
2555
|
-
const e =
|
|
2556
|
-
return
|
|
2585
|
+
function Ft(t) {
|
|
2586
|
+
const e = W(t);
|
|
2587
|
+
return K(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : k(e) && nt(e) ? e : Ft(e);
|
|
2557
2588
|
}
|
|
2558
2589
|
function tt(t, e, n) {
|
|
2559
2590
|
var i;
|
|
2560
2591
|
e === void 0 && (e = []), n === void 0 && (n = true);
|
|
2561
|
-
const s =
|
|
2562
|
-
if (
|
|
2563
|
-
const
|
|
2564
|
-
return e.concat(r2, r2.visualViewport || [], nt(s) ? s : [],
|
|
2592
|
+
const s = Ft(t), o = s === ((i = t.ownerDocument) == null ? void 0 : i.body), r2 = A3(s);
|
|
2593
|
+
if (o) {
|
|
2594
|
+
const c2 = mt(r2);
|
|
2595
|
+
return e.concat(r2, r2.visualViewport || [], nt(s) ? s : [], c2 && n ? tt(c2) : []);
|
|
2565
2596
|
}
|
|
2566
2597
|
return e.concat(s, tt(s, [], n));
|
|
2567
2598
|
}
|
|
2568
|
-
function
|
|
2599
|
+
function mt(t) {
|
|
2569
2600
|
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
2570
2601
|
}
|
|
2571
|
-
function
|
|
2572
|
-
const e =
|
|
2602
|
+
function Ht(t) {
|
|
2603
|
+
const e = R(t);
|
|
2573
2604
|
let n = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
|
|
2574
|
-
const s =
|
|
2575
|
-
return
|
|
2605
|
+
const s = k(t), o = s ? t.offsetWidth : n, r2 = s ? t.offsetHeight : i, c2 = st2(n) !== o || st2(i) !== r2;
|
|
2606
|
+
return c2 && (n = o, i = r2), {
|
|
2576
2607
|
width: n,
|
|
2577
2608
|
height: i,
|
|
2578
|
-
$:
|
|
2609
|
+
$: c2
|
|
2579
2610
|
};
|
|
2580
2611
|
}
|
|
2581
|
-
function
|
|
2582
|
-
return
|
|
2612
|
+
function bt(t) {
|
|
2613
|
+
return S2(t) ? t : t.contextElement;
|
|
2583
2614
|
}
|
|
2584
2615
|
function Y(t) {
|
|
2585
|
-
const e =
|
|
2586
|
-
if (!
|
|
2587
|
-
return
|
|
2616
|
+
const e = bt(t);
|
|
2617
|
+
if (!k(e))
|
|
2618
|
+
return P2(1);
|
|
2588
2619
|
const n = e.getBoundingClientRect(), {
|
|
2589
2620
|
width: i,
|
|
2590
2621
|
height: s,
|
|
2591
|
-
$:
|
|
2592
|
-
} =
|
|
2593
|
-
let r2 = (
|
|
2594
|
-
return (!r2 || !Number.isFinite(r2)) && (r2 = 1), (!
|
|
2622
|
+
$: o
|
|
2623
|
+
} = Ht(e);
|
|
2624
|
+
let r2 = (o ? st2(n.width) : n.width) / i, c2 = (o ? st2(n.height) : n.height) / s;
|
|
2625
|
+
return (!r2 || !Number.isFinite(r2)) && (r2 = 1), (!c2 || !Number.isFinite(c2)) && (c2 = 1), {
|
|
2595
2626
|
x: r2,
|
|
2596
|
-
y:
|
|
2627
|
+
y: c2
|
|
2597
2628
|
};
|
|
2598
2629
|
}
|
|
2599
|
-
const
|
|
2600
|
-
function
|
|
2601
|
-
const e =
|
|
2602
|
-
return !
|
|
2630
|
+
const Re = /* @__PURE__ */ P2(0);
|
|
2631
|
+
function Nt(t) {
|
|
2632
|
+
const e = A3(t);
|
|
2633
|
+
return !vt() || !e.visualViewport ? Re : {
|
|
2603
2634
|
x: e.visualViewport.offsetLeft,
|
|
2604
2635
|
y: e.visualViewport.offsetTop
|
|
2605
2636
|
};
|
|
2606
2637
|
}
|
|
2607
|
-
function
|
|
2608
|
-
return e === void 0 && (e = false), !n || e && n !==
|
|
2638
|
+
function Pe(t, e, n) {
|
|
2639
|
+
return e === void 0 && (e = false), !n || e && n !== A3(t) ? false : e;
|
|
2609
2640
|
}
|
|
2610
2641
|
function U2(t, e, n, i) {
|
|
2611
2642
|
e === void 0 && (e = false), n === void 0 && (n = false);
|
|
2612
|
-
const s = t.getBoundingClientRect(),
|
|
2613
|
-
let r2 =
|
|
2614
|
-
e && (i ?
|
|
2615
|
-
const
|
|
2616
|
-
let
|
|
2617
|
-
if (
|
|
2618
|
-
const
|
|
2619
|
-
let
|
|
2620
|
-
for (; m2 && i && f2 !==
|
|
2621
|
-
const p2 = Y(m2), w2 = m2.getBoundingClientRect(),
|
|
2622
|
-
|
|
2643
|
+
const s = t.getBoundingClientRect(), o = bt(t);
|
|
2644
|
+
let r2 = P2(1);
|
|
2645
|
+
e && (i ? S2(i) && (r2 = Y(i)) : r2 = Y(t));
|
|
2646
|
+
const c2 = Pe(o, n, i) ? Nt(o) : P2(0);
|
|
2647
|
+
let a2 = (s.left + c2.x) / r2.x, l2 = (s.top + c2.y) / r2.y, d2 = s.width / r2.x, u2 = s.height / r2.y;
|
|
2648
|
+
if (o) {
|
|
2649
|
+
const h2 = A3(o), f2 = i && S2(i) ? A3(i) : i;
|
|
2650
|
+
let g3 = h2, m2 = mt(g3);
|
|
2651
|
+
for (; m2 && i && f2 !== g3; ) {
|
|
2652
|
+
const p2 = Y(m2), w2 = m2.getBoundingClientRect(), y2 = R(m2), x3 = w2.left + (m2.clientLeft + parseFloat(y2.paddingLeft)) * p2.x, b2 = w2.top + (m2.clientTop + parseFloat(y2.paddingTop)) * p2.y;
|
|
2653
|
+
a2 *= p2.x, l2 *= p2.y, d2 *= p2.x, u2 *= p2.y, a2 += x3, l2 += b2, g3 = A3(m2), m2 = mt(g3);
|
|
2623
2654
|
}
|
|
2624
2655
|
}
|
|
2625
2656
|
return rt({
|
|
2626
2657
|
width: d2,
|
|
2627
2658
|
height: u2,
|
|
2628
|
-
x:
|
|
2629
|
-
y:
|
|
2659
|
+
x: a2,
|
|
2660
|
+
y: l2
|
|
2630
2661
|
});
|
|
2631
2662
|
}
|
|
2632
|
-
function
|
|
2663
|
+
function ft(t, e) {
|
|
2633
2664
|
const n = at(t).scrollLeft;
|
|
2634
|
-
return e ? e.left + n : U2(
|
|
2665
|
+
return e ? e.left + n : U2(D2(t)).left + n;
|
|
2635
2666
|
}
|
|
2636
|
-
function
|
|
2637
|
-
n
|
|
2638
|
-
const i = t.getBoundingClientRect(), s = i.left + e.scrollLeft - (n ? 0 : (
|
|
2639
|
-
// RTL <body> scrollbar.
|
|
2640
|
-
bt(t, i)
|
|
2641
|
-
)), o2 = i.top + e.scrollTop;
|
|
2667
|
+
function It(t, e) {
|
|
2668
|
+
const n = t.getBoundingClientRect(), i = n.left + e.scrollLeft - ft(t, n), s = n.top + e.scrollTop;
|
|
2642
2669
|
return {
|
|
2643
|
-
x:
|
|
2644
|
-
y:
|
|
2670
|
+
x: i,
|
|
2671
|
+
y: s
|
|
2645
2672
|
};
|
|
2646
2673
|
}
|
|
2647
|
-
function
|
|
2674
|
+
function ke(t) {
|
|
2648
2675
|
let {
|
|
2649
2676
|
elements: e,
|
|
2650
2677
|
rect: n,
|
|
2651
2678
|
offsetParent: i,
|
|
2652
2679
|
strategy: s
|
|
2653
2680
|
} = t;
|
|
2654
|
-
const
|
|
2655
|
-
if (i === r2 ||
|
|
2681
|
+
const o = s === "fixed", r2 = D2(i), c2 = e ? lt(e.floating) : false;
|
|
2682
|
+
if (i === r2 || c2 && o)
|
|
2656
2683
|
return n;
|
|
2657
|
-
let
|
|
2684
|
+
let a2 = {
|
|
2658
2685
|
scrollLeft: 0,
|
|
2659
2686
|
scrollTop: 0
|
|
2660
|
-
},
|
|
2661
|
-
const d2 =
|
|
2662
|
-
if ((u2 || !u2 && !
|
|
2687
|
+
}, l2 = P2(1);
|
|
2688
|
+
const d2 = P2(0), u2 = k(i);
|
|
2689
|
+
if ((u2 || !u2 && !o) && ((J(i) !== "body" || nt(r2)) && (a2 = at(i)), k(i))) {
|
|
2663
2690
|
const f2 = U2(i);
|
|
2664
|
-
|
|
2691
|
+
l2 = Y(i), d2.x = f2.x + i.clientLeft, d2.y = f2.y + i.clientTop;
|
|
2665
2692
|
}
|
|
2666
|
-
const
|
|
2693
|
+
const h2 = r2 && !u2 && !o ? It(r2, a2) : P2(0);
|
|
2667
2694
|
return {
|
|
2668
|
-
width: n.width *
|
|
2669
|
-
height: n.height *
|
|
2670
|
-
x: n.x *
|
|
2671
|
-
y: n.y *
|
|
2695
|
+
width: n.width * l2.x,
|
|
2696
|
+
height: n.height * l2.y,
|
|
2697
|
+
x: n.x * l2.x - a2.scrollLeft * l2.x + d2.x + h2.x,
|
|
2698
|
+
y: n.y * l2.y - a2.scrollTop * l2.y + d2.y + h2.y
|
|
2672
2699
|
};
|
|
2673
2700
|
}
|
|
2674
|
-
function
|
|
2701
|
+
function De(t) {
|
|
2675
2702
|
return Array.from(t.getClientRects());
|
|
2676
2703
|
}
|
|
2677
|
-
function
|
|
2678
|
-
const e =
|
|
2679
|
-
let r2 = -n.scrollLeft +
|
|
2680
|
-
const
|
|
2681
|
-
return
|
|
2704
|
+
function Me(t) {
|
|
2705
|
+
const e = D2(t), n = at(t), i = t.ownerDocument.body, s = q2(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), o = q2(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
|
|
2706
|
+
let r2 = -n.scrollLeft + ft(t);
|
|
2707
|
+
const c2 = -n.scrollTop;
|
|
2708
|
+
return R(i).direction === "rtl" && (r2 += q2(e.clientWidth, i.clientWidth) - s), {
|
|
2682
2709
|
width: s,
|
|
2683
|
-
height:
|
|
2710
|
+
height: o,
|
|
2684
2711
|
x: r2,
|
|
2685
|
-
y:
|
|
2712
|
+
y: c2
|
|
2686
2713
|
};
|
|
2687
2714
|
}
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2715
|
+
const Ot = 25;
|
|
2716
|
+
function $e(t, e) {
|
|
2717
|
+
const n = A3(t), i = D2(t), s = n.visualViewport;
|
|
2718
|
+
let o = i.clientWidth, r2 = i.clientHeight, c2 = 0, a2 = 0;
|
|
2691
2719
|
if (s) {
|
|
2692
|
-
|
|
2693
|
-
const
|
|
2694
|
-
(!
|
|
2695
|
-
}
|
|
2720
|
+
o = s.width, r2 = s.height;
|
|
2721
|
+
const d2 = vt();
|
|
2722
|
+
(!d2 || d2 && e === "fixed") && (c2 = s.offsetLeft, a2 = s.offsetTop);
|
|
2723
|
+
}
|
|
2724
|
+
const l2 = ft(i);
|
|
2725
|
+
if (l2 <= 0) {
|
|
2726
|
+
const d2 = i.ownerDocument, u2 = d2.body, h2 = getComputedStyle(u2), f2 = d2.compatMode === "CSS1Compat" && parseFloat(h2.marginLeft) + parseFloat(h2.marginRight) || 0, g3 = Math.abs(i.clientWidth - u2.clientWidth - f2);
|
|
2727
|
+
g3 <= Ot && (o -= g3);
|
|
2728
|
+
} else l2 <= Ot && (o += l2);
|
|
2696
2729
|
return {
|
|
2697
|
-
width:
|
|
2730
|
+
width: o,
|
|
2698
2731
|
height: r2,
|
|
2699
|
-
x:
|
|
2700
|
-
y:
|
|
2732
|
+
x: c2,
|
|
2733
|
+
y: a2
|
|
2701
2734
|
};
|
|
2702
2735
|
}
|
|
2703
|
-
const
|
|
2704
|
-
function
|
|
2705
|
-
const n = U2(t, true, e === "fixed"), i = n.top + t.clientTop, s = n.left + t.clientLeft,
|
|
2736
|
+
const Fe = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
2737
|
+
function He(t, e) {
|
|
2738
|
+
const n = U2(t, true, e === "fixed"), i = n.top + t.clientTop, s = n.left + t.clientLeft, o = k(t) ? Y(t) : P2(1), r2 = t.clientWidth * o.x, c2 = t.clientHeight * o.y, a2 = s * o.x, l2 = i * o.y;
|
|
2706
2739
|
return {
|
|
2707
2740
|
width: r2,
|
|
2708
|
-
height:
|
|
2709
|
-
x:
|
|
2710
|
-
y:
|
|
2741
|
+
height: c2,
|
|
2742
|
+
x: a2,
|
|
2743
|
+
y: l2
|
|
2711
2744
|
};
|
|
2712
2745
|
}
|
|
2713
|
-
function
|
|
2746
|
+
function Tt(t, e, n) {
|
|
2714
2747
|
let i;
|
|
2715
2748
|
if (e === "viewport")
|
|
2716
|
-
i =
|
|
2749
|
+
i = $e(t, n);
|
|
2717
2750
|
else if (e === "document")
|
|
2718
|
-
i =
|
|
2719
|
-
else if (
|
|
2720
|
-
i =
|
|
2751
|
+
i = Me(D2(t));
|
|
2752
|
+
else if (S2(e))
|
|
2753
|
+
i = He(e, n);
|
|
2721
2754
|
else {
|
|
2722
|
-
const s =
|
|
2755
|
+
const s = Nt(t);
|
|
2723
2756
|
i = {
|
|
2724
2757
|
x: e.x - s.x,
|
|
2725
2758
|
y: e.y - s.y,
|
|
@@ -2730,107 +2763,107 @@ function Lt(t, e, n) {
|
|
|
2730
2763
|
return rt(i);
|
|
2731
2764
|
}
|
|
2732
2765
|
function Wt(t, e) {
|
|
2733
|
-
const n =
|
|
2734
|
-
return n === e || !
|
|
2766
|
+
const n = W(t);
|
|
2767
|
+
return n === e || !S2(n) || K(n) ? false : R(n).position === "fixed" || Wt(n, e);
|
|
2735
2768
|
}
|
|
2736
|
-
function
|
|
2769
|
+
function Ne(t, e) {
|
|
2737
2770
|
const n = e.get(t);
|
|
2738
2771
|
if (n)
|
|
2739
2772
|
return n;
|
|
2740
|
-
let i = tt(t, [], false).filter((
|
|
2741
|
-
const
|
|
2742
|
-
let r2 =
|
|
2743
|
-
for (;
|
|
2744
|
-
const
|
|
2745
|
-
!
|
|
2773
|
+
let i = tt(t, [], false).filter((c2) => S2(c2) && J(c2) !== "body"), s = null;
|
|
2774
|
+
const o = R(t).position === "fixed";
|
|
2775
|
+
let r2 = o ? W(t) : t;
|
|
2776
|
+
for (; S2(r2) && !K(r2); ) {
|
|
2777
|
+
const c2 = R(r2), a2 = xt(r2);
|
|
2778
|
+
!a2 && c2.position === "fixed" && (s = null), (o ? !a2 && !s : !a2 && c2.position === "static" && !!s && Fe.has(s.position) || nt(r2) && !a2 && Wt(t, r2)) ? i = i.filter((d2) => d2 !== r2) : s = c2, r2 = W(r2);
|
|
2746
2779
|
}
|
|
2747
2780
|
return e.set(t, i), i;
|
|
2748
2781
|
}
|
|
2749
|
-
function
|
|
2782
|
+
function Ie(t) {
|
|
2750
2783
|
let {
|
|
2751
2784
|
element: e,
|
|
2752
2785
|
boundary: n,
|
|
2753
2786
|
rootBoundary: i,
|
|
2754
2787
|
strategy: s
|
|
2755
2788
|
} = t;
|
|
2756
|
-
const r2 = [...n === "clippingAncestors" ? lt(e) ? [] :
|
|
2757
|
-
const u2 =
|
|
2758
|
-
return
|
|
2759
|
-
},
|
|
2789
|
+
const r2 = [...n === "clippingAncestors" ? lt(e) ? [] : Ne(e, this._c) : [].concat(n), i], c2 = r2[0], a2 = r2.reduce((l2, d2) => {
|
|
2790
|
+
const u2 = Tt(e, d2, s);
|
|
2791
|
+
return l2.top = q2(u2.top, l2.top), l2.right = j(u2.right, l2.right), l2.bottom = j(u2.bottom, l2.bottom), l2.left = q2(u2.left, l2.left), l2;
|
|
2792
|
+
}, Tt(e, c2, s));
|
|
2760
2793
|
return {
|
|
2761
|
-
width:
|
|
2762
|
-
height:
|
|
2763
|
-
x:
|
|
2764
|
-
y:
|
|
2794
|
+
width: a2.right - a2.left,
|
|
2795
|
+
height: a2.bottom - a2.top,
|
|
2796
|
+
x: a2.left,
|
|
2797
|
+
y: a2.top
|
|
2765
2798
|
};
|
|
2766
2799
|
}
|
|
2767
|
-
function
|
|
2800
|
+
function We(t) {
|
|
2768
2801
|
const {
|
|
2769
2802
|
width: e,
|
|
2770
2803
|
height: n
|
|
2771
|
-
} =
|
|
2804
|
+
} = Ht(t);
|
|
2772
2805
|
return {
|
|
2773
2806
|
width: e,
|
|
2774
2807
|
height: n
|
|
2775
2808
|
};
|
|
2776
2809
|
}
|
|
2777
|
-
function
|
|
2778
|
-
const i =
|
|
2779
|
-
let
|
|
2810
|
+
function Ve(t, e, n) {
|
|
2811
|
+
const i = k(e), s = D2(e), o = n === "fixed", r2 = U2(t, true, o, e);
|
|
2812
|
+
let c2 = {
|
|
2780
2813
|
scrollLeft: 0,
|
|
2781
2814
|
scrollTop: 0
|
|
2782
2815
|
};
|
|
2783
|
-
const
|
|
2784
|
-
function
|
|
2785
|
-
|
|
2786
|
-
}
|
|
2787
|
-
if (i || !i && !
|
|
2788
|
-
if ((J(e) !== "body" || nt(s)) && (
|
|
2789
|
-
const f2 = U2(e, true,
|
|
2790
|
-
|
|
2791
|
-
} else s &&
|
|
2792
|
-
|
|
2793
|
-
const d2 = s && !i && !
|
|
2816
|
+
const a2 = P2(0);
|
|
2817
|
+
function l2() {
|
|
2818
|
+
a2.x = ft(s);
|
|
2819
|
+
}
|
|
2820
|
+
if (i || !i && !o)
|
|
2821
|
+
if ((J(e) !== "body" || nt(s)) && (c2 = at(e)), i) {
|
|
2822
|
+
const f2 = U2(e, true, o, e);
|
|
2823
|
+
a2.x = f2.x + e.clientLeft, a2.y = f2.y + e.clientTop;
|
|
2824
|
+
} else s && l2();
|
|
2825
|
+
o && !i && s && l2();
|
|
2826
|
+
const d2 = s && !i && !o ? It(s, c2) : P2(0), u2 = r2.left + c2.scrollLeft - a2.x - d2.x, h2 = r2.top + c2.scrollTop - a2.y - d2.y;
|
|
2794
2827
|
return {
|
|
2795
2828
|
x: u2,
|
|
2796
|
-
y:
|
|
2829
|
+
y: h2,
|
|
2797
2830
|
width: r2.width,
|
|
2798
2831
|
height: r2.height
|
|
2799
2832
|
};
|
|
2800
2833
|
}
|
|
2801
|
-
function
|
|
2802
|
-
return
|
|
2834
|
+
function ut(t) {
|
|
2835
|
+
return R(t).position === "static";
|
|
2803
2836
|
}
|
|
2804
|
-
function
|
|
2805
|
-
if (!
|
|
2837
|
+
function St(t, e) {
|
|
2838
|
+
if (!k(t) || R(t).position === "fixed")
|
|
2806
2839
|
return null;
|
|
2807
2840
|
if (e)
|
|
2808
2841
|
return e(t);
|
|
2809
2842
|
let n = t.offsetParent;
|
|
2810
|
-
return
|
|
2843
|
+
return D2(t) === n && (n = n.ownerDocument.body), n;
|
|
2811
2844
|
}
|
|
2812
|
-
function
|
|
2813
|
-
const n =
|
|
2845
|
+
function Vt(t, e) {
|
|
2846
|
+
const n = A3(t);
|
|
2814
2847
|
if (lt(t))
|
|
2815
2848
|
return n;
|
|
2816
|
-
if (!
|
|
2817
|
-
let s =
|
|
2818
|
-
for (; s && !
|
|
2819
|
-
if (
|
|
2849
|
+
if (!k(t)) {
|
|
2850
|
+
let s = W(t);
|
|
2851
|
+
for (; s && !K(s); ) {
|
|
2852
|
+
if (S2(s) && !ut(s))
|
|
2820
2853
|
return s;
|
|
2821
|
-
s =
|
|
2854
|
+
s = W(s);
|
|
2822
2855
|
}
|
|
2823
2856
|
return n;
|
|
2824
2857
|
}
|
|
2825
|
-
let i =
|
|
2826
|
-
for (; i &&
|
|
2827
|
-
i =
|
|
2828
|
-
return i &&
|
|
2858
|
+
let i = St(t, e);
|
|
2859
|
+
for (; i && Ee(i) && ut(i); )
|
|
2860
|
+
i = St(i, e);
|
|
2861
|
+
return i && K(i) && ut(i) && !xt(i) ? n : i || Te(t) || n;
|
|
2829
2862
|
}
|
|
2830
|
-
const
|
|
2831
|
-
const e = this.getOffsetParent ||
|
|
2863
|
+
const Be = async function(t) {
|
|
2864
|
+
const e = this.getOffsetParent || Vt, n = this.getDimensions, i = await n(t.floating);
|
|
2832
2865
|
return {
|
|
2833
|
-
reference:
|
|
2866
|
+
reference: Ve(t.reference, await e(t.floating), t.strategy),
|
|
2834
2867
|
floating: {
|
|
2835
2868
|
x: 0,
|
|
2836
2869
|
y: 0,
|
|
@@ -2839,134 +2872,134 @@ const qe = async function(t) {
|
|
|
2839
2872
|
}
|
|
2840
2873
|
};
|
|
2841
2874
|
};
|
|
2842
|
-
function
|
|
2843
|
-
return
|
|
2844
|
-
}
|
|
2845
|
-
const
|
|
2846
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
2847
|
-
getDocumentElement:
|
|
2848
|
-
getClippingRect:
|
|
2849
|
-
getOffsetParent:
|
|
2850
|
-
getElementRects:
|
|
2851
|
-
getClientRects:
|
|
2852
|
-
getDimensions:
|
|
2875
|
+
function _e(t) {
|
|
2876
|
+
return R(t).direction === "rtl";
|
|
2877
|
+
}
|
|
2878
|
+
const ze = {
|
|
2879
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: ke,
|
|
2880
|
+
getDocumentElement: D2,
|
|
2881
|
+
getClippingRect: Ie,
|
|
2882
|
+
getOffsetParent: Vt,
|
|
2883
|
+
getElementRects: Be,
|
|
2884
|
+
getClientRects: De,
|
|
2885
|
+
getDimensions: We,
|
|
2853
2886
|
getScale: Y,
|
|
2854
|
-
isElement:
|
|
2855
|
-
isRTL:
|
|
2887
|
+
isElement: S2,
|
|
2888
|
+
isRTL: _e
|
|
2856
2889
|
};
|
|
2857
|
-
function
|
|
2890
|
+
function Bt(t, e) {
|
|
2858
2891
|
return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
|
|
2859
2892
|
}
|
|
2860
|
-
function
|
|
2893
|
+
function qe(t, e) {
|
|
2861
2894
|
let n = null, i;
|
|
2862
|
-
const s =
|
|
2863
|
-
function
|
|
2864
|
-
var
|
|
2865
|
-
clearTimeout(i), (
|
|
2866
|
-
}
|
|
2867
|
-
function r2(
|
|
2868
|
-
|
|
2869
|
-
const
|
|
2895
|
+
const s = D2(t);
|
|
2896
|
+
function o() {
|
|
2897
|
+
var c2;
|
|
2898
|
+
clearTimeout(i), (c2 = n) == null || c2.disconnect(), n = null;
|
|
2899
|
+
}
|
|
2900
|
+
function r2(c2, a2) {
|
|
2901
|
+
c2 === void 0 && (c2 = false), a2 === void 0 && (a2 = 1), o();
|
|
2902
|
+
const l2 = t.getBoundingClientRect(), {
|
|
2870
2903
|
left: d2,
|
|
2871
2904
|
top: u2,
|
|
2872
|
-
width:
|
|
2905
|
+
width: h2,
|
|
2873
2906
|
height: f2
|
|
2874
|
-
} =
|
|
2875
|
-
if (
|
|
2907
|
+
} = l2;
|
|
2908
|
+
if (c2 || e(), !h2 || !f2)
|
|
2876
2909
|
return;
|
|
2877
|
-
const
|
|
2878
|
-
rootMargin: -
|
|
2879
|
-
threshold:
|
|
2910
|
+
const g3 = it(u2), m2 = it(s.clientWidth - (d2 + h2)), p2 = it(s.clientHeight - (u2 + f2)), w2 = it(d2), x3 = {
|
|
2911
|
+
rootMargin: -g3 + "px " + -m2 + "px " + -p2 + "px " + -w2 + "px",
|
|
2912
|
+
threshold: q2(0, j(1, a2)) || 1
|
|
2880
2913
|
};
|
|
2881
2914
|
let b2 = true;
|
|
2882
2915
|
function v2(C2) {
|
|
2883
|
-
const
|
|
2884
|
-
if (
|
|
2916
|
+
const L4 = C2[0].intersectionRatio;
|
|
2917
|
+
if (L4 !== a2) {
|
|
2885
2918
|
if (!b2)
|
|
2886
2919
|
return r2();
|
|
2887
|
-
|
|
2920
|
+
L4 ? r2(false, L4) : i = setTimeout(() => {
|
|
2888
2921
|
r2(false, 1e-7);
|
|
2889
2922
|
}, 1e3);
|
|
2890
2923
|
}
|
|
2891
|
-
|
|
2924
|
+
L4 === 1 && !Bt(l2, t.getBoundingClientRect()) && r2(), b2 = false;
|
|
2892
2925
|
}
|
|
2893
2926
|
try {
|
|
2894
2927
|
n = new IntersectionObserver(v2, {
|
|
2895
|
-
...
|
|
2928
|
+
...x3,
|
|
2896
2929
|
// Handle <iframe>s
|
|
2897
2930
|
root: s.ownerDocument
|
|
2898
2931
|
});
|
|
2899
2932
|
} catch {
|
|
2900
|
-
n = new IntersectionObserver(v2,
|
|
2933
|
+
n = new IntersectionObserver(v2, x3);
|
|
2901
2934
|
}
|
|
2902
2935
|
n.observe(t);
|
|
2903
2936
|
}
|
|
2904
|
-
return r2(true),
|
|
2937
|
+
return r2(true), o;
|
|
2905
2938
|
}
|
|
2906
2939
|
function Xe(t, e, n, i) {
|
|
2907
2940
|
i === void 0 && (i = {});
|
|
2908
2941
|
const {
|
|
2909
2942
|
ancestorScroll: s = true,
|
|
2910
|
-
ancestorResize:
|
|
2943
|
+
ancestorResize: o = true,
|
|
2911
2944
|
elementResize: r2 = typeof ResizeObserver == "function",
|
|
2912
|
-
layoutShift:
|
|
2913
|
-
animationFrame:
|
|
2914
|
-
} = i,
|
|
2945
|
+
layoutShift: c2 = typeof IntersectionObserver == "function",
|
|
2946
|
+
animationFrame: a2 = false
|
|
2947
|
+
} = i, l2 = bt(t), d2 = s || o ? [...l2 ? tt(l2) : [], ...tt(e)] : [];
|
|
2915
2948
|
d2.forEach((w2) => {
|
|
2916
2949
|
s && w2.addEventListener("scroll", n, {
|
|
2917
2950
|
passive: true
|
|
2918
|
-
}),
|
|
2951
|
+
}), o && w2.addEventListener("resize", n);
|
|
2919
2952
|
});
|
|
2920
|
-
const u2 =
|
|
2921
|
-
let
|
|
2953
|
+
const u2 = l2 && c2 ? qe(l2, n) : null;
|
|
2954
|
+
let h2 = -1, f2 = null;
|
|
2922
2955
|
r2 && (f2 = new ResizeObserver((w2) => {
|
|
2923
|
-
let [
|
|
2924
|
-
|
|
2925
|
-
var
|
|
2926
|
-
(
|
|
2956
|
+
let [y2] = w2;
|
|
2957
|
+
y2 && y2.target === l2 && f2 && (f2.unobserve(e), cancelAnimationFrame(h2), h2 = requestAnimationFrame(() => {
|
|
2958
|
+
var x3;
|
|
2959
|
+
(x3 = f2) == null || x3.observe(e);
|
|
2927
2960
|
})), n();
|
|
2928
|
-
}),
|
|
2929
|
-
let
|
|
2930
|
-
|
|
2961
|
+
}), l2 && !a2 && f2.observe(l2), f2.observe(e));
|
|
2962
|
+
let g3, m2 = a2 ? U2(t) : null;
|
|
2963
|
+
a2 && p2();
|
|
2931
2964
|
function p2() {
|
|
2932
2965
|
const w2 = U2(t);
|
|
2933
|
-
m2 && !
|
|
2966
|
+
m2 && !Bt(m2, w2) && n(), m2 = w2, g3 = requestAnimationFrame(p2);
|
|
2934
2967
|
}
|
|
2935
2968
|
return n(), () => {
|
|
2936
2969
|
var w2;
|
|
2937
|
-
d2.forEach((
|
|
2938
|
-
s &&
|
|
2939
|
-
}), u2?.(), (w2 = f2) == null || w2.disconnect(), f2 = null,
|
|
2970
|
+
d2.forEach((y2) => {
|
|
2971
|
+
s && y2.removeEventListener("scroll", n), o && y2.removeEventListener("resize", n);
|
|
2972
|
+
}), u2?.(), (w2 = f2) == null || w2.disconnect(), f2 = null, a2 && cancelAnimationFrame(g3);
|
|
2940
2973
|
};
|
|
2941
2974
|
}
|
|
2942
|
-
const
|
|
2975
|
+
const Ue = we, Ye = ye, je = me, Ke = ge, Je = xe, Ge = (t, e, n) => {
|
|
2943
2976
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
2944
|
-
platform:
|
|
2977
|
+
platform: ze,
|
|
2945
2978
|
...n
|
|
2946
|
-
},
|
|
2979
|
+
}, o = {
|
|
2947
2980
|
...s.platform,
|
|
2948
2981
|
_c: i
|
|
2949
2982
|
};
|
|
2950
|
-
return
|
|
2983
|
+
return he(t, e, {
|
|
2951
2984
|
...s,
|
|
2952
|
-
platform:
|
|
2985
|
+
platform: o
|
|
2953
2986
|
});
|
|
2954
2987
|
};
|
|
2955
|
-
function
|
|
2988
|
+
function Rt(t, e, n) {
|
|
2956
2989
|
Object.assign(t.style, {
|
|
2957
2990
|
left: e != null ? `${e}px` : "",
|
|
2958
2991
|
top: n != null ? `${n}px` : ""
|
|
2959
2992
|
});
|
|
2960
2993
|
}
|
|
2961
|
-
function
|
|
2962
|
-
let n = t.
|
|
2994
|
+
function _t(t, e) {
|
|
2995
|
+
let n = t.config.get("toggleDelay");
|
|
2963
2996
|
typeof n == "string" && (n.indexOf(",") > -1 && (n = n.split(",")), n.indexOf(" ") > -1 && (n = n.split(" "))), Array.isArray(n) && (n = n[e]);
|
|
2964
2997
|
const i = Number(n);
|
|
2965
2998
|
if (Number.isNaN(i))
|
|
2966
2999
|
throw new Error(`Provided delay value is not a number: "${n}"`);
|
|
2967
3000
|
return i;
|
|
2968
3001
|
}
|
|
2969
|
-
function
|
|
3002
|
+
function dt(t) {
|
|
2970
3003
|
let e;
|
|
2971
3004
|
const n = typeof t == "string" ? t.trim().split(" ").map((i) => parseFloat(i)).filter((i) => !isNaN(i)) : [t];
|
|
2972
3005
|
for (let i = 0; i < n.length; i++)
|
|
@@ -3005,142 +3038,135 @@ function ut(t) {
|
|
|
3005
3038
|
}
|
|
3006
3039
|
return e;
|
|
3007
3040
|
}
|
|
3008
|
-
function
|
|
3041
|
+
function Qe(t) {
|
|
3009
3042
|
return {
|
|
3010
|
-
offset: Number(t.
|
|
3043
|
+
offset: Number(t.config.get("offset")),
|
|
3011
3044
|
flip: {
|
|
3012
|
-
padding:
|
|
3045
|
+
padding: dt(t.config.get("flipPadding"))
|
|
3013
3046
|
},
|
|
3014
3047
|
shift: {
|
|
3015
|
-
padding:
|
|
3048
|
+
padding: dt(t.config.get("shiftPadding"))
|
|
3016
3049
|
},
|
|
3017
3050
|
arrow: {
|
|
3018
|
-
selector: t.
|
|
3051
|
+
selector: t.config.get("selectorArrow"),
|
|
3019
3052
|
element: null,
|
|
3020
|
-
padding:
|
|
3053
|
+
padding: dt(t.config.get("arrowPadding"))
|
|
3021
3054
|
}
|
|
3022
3055
|
};
|
|
3023
3056
|
}
|
|
3024
|
-
function
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
return e;
|
|
3028
|
-
throw new Error(`Popover not found in collection with id of "${t}".`);
|
|
3029
|
-
}
|
|
3030
|
-
async function qt(t) {
|
|
3031
|
-
return t && t.state === "opened" && (t.el.inert = true, t.el.classList.remove(t.parent.settings.stateActive), t.isTooltip || t.trigger?.setAttribute("aria-expanded", "false"), t.floatingCleanup(), t.state = "closed", t.trigger === t.parent.trigger && (t.parent.trigger = null), t.el.dispatchEvent(
|
|
3032
|
-
new CustomEvent(t.getSetting("customEventPrefix") + "closed", {
|
|
3057
|
+
async function zt(t) {
|
|
3058
|
+
return t && t.state === "opened" && (t.el.inert = true, t.el.classList.remove(t.config.get("stateActive")), t.isTooltip || t.trigger?.setAttribute("aria-expanded", "false"), t.floatingCleanup(), t.state = "closed", t.trigger === t.parent.trigger && (t.parent.trigger = null), t.el.dispatchEvent(
|
|
3059
|
+
new CustomEvent(t.config.get("customEventPrefix") + "closed", {
|
|
3033
3060
|
detail: t.parent,
|
|
3034
3061
|
bubbles: true
|
|
3035
3062
|
})
|
|
3036
3063
|
), await t.parent.emit("closed", t)), t;
|
|
3037
3064
|
}
|
|
3038
|
-
async function
|
|
3065
|
+
async function qt(t) {
|
|
3039
3066
|
const e = [];
|
|
3040
3067
|
for (const n of t.collection)
|
|
3041
3068
|
n.state === "opened" && e.push(await n.close());
|
|
3042
3069
|
return e;
|
|
3043
3070
|
}
|
|
3044
|
-
function
|
|
3071
|
+
function Xt(t) {
|
|
3045
3072
|
t.state == "opened" && setTimeout(() => (document.activeElement?.closest(
|
|
3046
3073
|
`#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`
|
|
3047
3074
|
) || t.close(), t), 1);
|
|
3048
3075
|
}
|
|
3049
|
-
function
|
|
3076
|
+
function Ze(t) {
|
|
3050
3077
|
t.state === "opened" ? t.close() : (this.trigger = t.trigger, t.open());
|
|
3051
3078
|
}
|
|
3052
|
-
function
|
|
3079
|
+
function tn(t) {
|
|
3053
3080
|
t.isTooltip && (t.toggleDelayId && clearTimeout(t.toggleDelayId), t.close());
|
|
3054
3081
|
}
|
|
3055
|
-
function
|
|
3056
|
-
if (t.isHovered = e, e.type == "focus" && t.trigger && !t.trigger.matches(":focus-visible"))
|
|
3082
|
+
function en(t, e) {
|
|
3083
|
+
if (!(e instanceof MouseEvent) || (t.isHovered = e, e.type == "focus" && t.trigger && !t.trigger.matches(":focus-visible")))
|
|
3057
3084
|
return;
|
|
3058
3085
|
t.toggleDelayId && clearTimeout(t.toggleDelayId);
|
|
3059
3086
|
const n = t.trigger?.getAttribute("aria-expanded");
|
|
3060
3087
|
if (n && n == "true") return;
|
|
3061
|
-
const i = this.activeHover ? 0 :
|
|
3088
|
+
const i = this.activeHover ? 0 : _t(t, 0);
|
|
3062
3089
|
this.activeHover && this.activeHover.close(), t.toggleDelayId = setTimeout(() => {
|
|
3063
3090
|
t.id && t.open();
|
|
3064
3091
|
}, i);
|
|
3065
3092
|
}
|
|
3066
|
-
function
|
|
3067
|
-
setTimeout(() => {
|
|
3093
|
+
function nn(t, e) {
|
|
3094
|
+
e instanceof MouseEvent && setTimeout(() => {
|
|
3068
3095
|
t.isHovered = e, !t.isHovered && (t.toggleDelayId && clearTimeout(t.toggleDelayId), t.toggleDelayId = setTimeout(
|
|
3069
|
-
() =>
|
|
3070
|
-
|
|
3096
|
+
() => Xt(t),
|
|
3097
|
+
_t(t, 1)
|
|
3071
3098
|
));
|
|
3072
3099
|
}, 1);
|
|
3073
3100
|
}
|
|
3074
|
-
function
|
|
3101
|
+
function sn(t) {
|
|
3075
3102
|
switch (t.key) {
|
|
3076
3103
|
case "Escape":
|
|
3077
|
-
this.trigger && this.trigger.focus(),
|
|
3104
|
+
this.trigger && this.trigger.focus(), qt(this);
|
|
3078
3105
|
return;
|
|
3079
3106
|
case "Tab":
|
|
3080
3107
|
this.collection.forEach((e) => {
|
|
3081
|
-
|
|
3108
|
+
Xt(e);
|
|
3082
3109
|
});
|
|
3083
3110
|
return;
|
|
3084
3111
|
default:
|
|
3085
3112
|
return;
|
|
3086
3113
|
}
|
|
3087
3114
|
}
|
|
3088
|
-
function
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
s && (s.closest(
|
|
3115
|
+
function on(t) {
|
|
3116
|
+
document.addEventListener("click", function e(n) {
|
|
3117
|
+
const i = n.target;
|
|
3118
|
+
i && (i.closest(
|
|
3093
3119
|
`#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`
|
|
3094
|
-
) ? t.el && !t.el.classList.contains(
|
|
3120
|
+
) ? t.el && !t.el.classList.contains(t.config.get("stateActive")) && this.removeEventListener("click", e) : (t.el && t.el.classList.contains(t.config.get("stateActive")) && t.close(), this.removeEventListener("click", e)));
|
|
3095
3121
|
});
|
|
3096
3122
|
}
|
|
3097
|
-
async function
|
|
3098
|
-
t.el.inert = false, t.el.classList.add(t.
|
|
3099
|
-
const e =
|
|
3123
|
+
async function Ut(t) {
|
|
3124
|
+
t.el.inert = false, t.el.classList.add(t.config.get("stateActive")), t.isTooltip || t.trigger?.setAttribute("aria-expanded", "true"), await t.parent.emit("updateCustomProps", t);
|
|
3125
|
+
const e = Qe(t), n = t.el.querySelector(
|
|
3100
3126
|
e.arrow.selector
|
|
3101
3127
|
);
|
|
3102
3128
|
return e.arrow.element = n || null, t.trigger instanceof HTMLElement && (t.floatingCleanup = Xe(t.trigger, t.el, () => {
|
|
3103
3129
|
const i = [
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3130
|
+
je(e.flip),
|
|
3131
|
+
Ye({ ...e.shift, limiter: Je() }),
|
|
3132
|
+
Ue(e.offset)
|
|
3107
3133
|
];
|
|
3108
3134
|
e.arrow.element && i.push(
|
|
3109
|
-
|
|
3135
|
+
Ke({
|
|
3110
3136
|
...e.arrow,
|
|
3111
3137
|
element: e.arrow.element
|
|
3112
3138
|
})
|
|
3113
|
-
),
|
|
3114
|
-
placement: t.
|
|
3139
|
+
), Ge(t.trigger, t.el, {
|
|
3140
|
+
placement: t.config.get("placement"),
|
|
3115
3141
|
middleware: i
|
|
3116
|
-
}).then(({ x: s, y:
|
|
3142
|
+
}).then(({ x: s, y: o, placement: r2, middlewareData: c2 }) => {
|
|
3117
3143
|
if (t.el) {
|
|
3118
|
-
if (
|
|
3119
|
-
const { x:
|
|
3120
|
-
|
|
3144
|
+
if (Rt(t.el, s, o), e.arrow.element && c2.arrow) {
|
|
3145
|
+
const { x: a2, y: l2 } = c2.arrow;
|
|
3146
|
+
Rt(e.arrow.element, a2, l2);
|
|
3121
3147
|
}
|
|
3122
3148
|
t.el.setAttribute("data-floating-placement", r2);
|
|
3123
3149
|
}
|
|
3124
3150
|
});
|
|
3125
|
-
})), t.state = "opened", t.
|
|
3126
|
-
new CustomEvent(t.
|
|
3151
|
+
})), t.state = "opened", t.config.get("event") === "click" && on.call(t.parent, t), t.el.dispatchEvent(
|
|
3152
|
+
new CustomEvent(t.config.get("customEventPrefix") + "opened", {
|
|
3127
3153
|
detail: t.parent,
|
|
3128
3154
|
bubbles: true
|
|
3129
3155
|
})
|
|
3130
3156
|
), await t.parent.emit("opened", t), t;
|
|
3131
3157
|
}
|
|
3132
|
-
class
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
constructor(e, n, i = {}) {
|
|
3136
|
-
super(e, n, i), this.state = "closed", this.toggleDelayId = null, this.trigger = null, this.#t = null, this.#e = {
|
|
3158
|
+
class rn extends Pt {
|
|
3159
|
+
constructor(e, n) {
|
|
3160
|
+
super(e, n), this.#t = [], this.#e = {
|
|
3137
3161
|
el: false,
|
|
3138
3162
|
trigger: false
|
|
3139
|
-
}, this.floatingCleanup = () => {
|
|
3163
|
+
}, this.state = "closed", this.trigger = null, this.toggleDelayId = null, this.floatingCleanup = () => {
|
|
3140
3164
|
};
|
|
3141
3165
|
}
|
|
3166
|
+
#t;
|
|
3167
|
+
#e;
|
|
3142
3168
|
get isTooltip() {
|
|
3143
|
-
return !!this.el.closest(this.
|
|
3169
|
+
return !!this.el.closest(this.config.get("selectorTooltip")) || this.el.getAttribute("role") == "tooltip";
|
|
3144
3170
|
}
|
|
3145
3171
|
get isHovered() {
|
|
3146
3172
|
return this.#e.el || this.#e.trigger;
|
|
@@ -3158,47 +3184,55 @@ class fn extends Dt {
|
|
|
3158
3184
|
}
|
|
3159
3185
|
}
|
|
3160
3186
|
async open() {
|
|
3161
|
-
return
|
|
3187
|
+
return Ut(this);
|
|
3162
3188
|
}
|
|
3163
3189
|
async close() {
|
|
3164
|
-
return
|
|
3190
|
+
return zt(this);
|
|
3165
3191
|
}
|
|
3166
3192
|
async deregister() {
|
|
3167
|
-
return this.parent.deregister(this
|
|
3193
|
+
return this.parent.deregister(this);
|
|
3168
3194
|
}
|
|
3169
3195
|
registerEventListeners() {
|
|
3170
|
-
this.#t || (this.
|
|
3196
|
+
this.#t.length || (this.config.get("event") === "hover" ? (this.#t = [
|
|
3171
3197
|
{
|
|
3172
3198
|
el: ["el", "trigger"],
|
|
3173
3199
|
type: ["mouseenter", "focus"],
|
|
3174
|
-
listener:
|
|
3200
|
+
listener: en.bind(this.parent, this)
|
|
3175
3201
|
},
|
|
3176
3202
|
{
|
|
3177
3203
|
el: ["el", "trigger"],
|
|
3178
3204
|
type: ["mouseleave", "focusout"],
|
|
3179
|
-
listener:
|
|
3205
|
+
listener: nn.bind(this.parent, this)
|
|
3180
3206
|
},
|
|
3181
3207
|
{
|
|
3182
3208
|
el: ["trigger"],
|
|
3183
3209
|
type: ["click"],
|
|
3184
|
-
listener:
|
|
3210
|
+
listener: tn.bind(this.parent, this)
|
|
3185
3211
|
}
|
|
3186
3212
|
], this.#t.forEach((n) => {
|
|
3187
3213
|
n.el.forEach((i) => {
|
|
3188
3214
|
n.type.forEach((s) => {
|
|
3189
|
-
this[i].addEventListener(
|
|
3215
|
+
this[i].addEventListener(
|
|
3216
|
+
s,
|
|
3217
|
+
n.listener,
|
|
3218
|
+
false
|
|
3219
|
+
);
|
|
3190
3220
|
});
|
|
3191
3221
|
});
|
|
3192
3222
|
})) : (this.#t = [
|
|
3193
3223
|
{
|
|
3194
3224
|
el: ["trigger"],
|
|
3195
3225
|
type: ["click"],
|
|
3196
|
-
listener:
|
|
3226
|
+
listener: Ze.bind(this.parent, this)
|
|
3197
3227
|
}
|
|
3198
3228
|
], this.#t.forEach((n) => {
|
|
3199
3229
|
n.el.forEach((i) => {
|
|
3200
3230
|
n.type.forEach((s) => {
|
|
3201
|
-
this[i].addEventListener(
|
|
3231
|
+
this[i].addEventListener(
|
|
3232
|
+
s,
|
|
3233
|
+
n.listener,
|
|
3234
|
+
false
|
|
3235
|
+
);
|
|
3202
3236
|
});
|
|
3203
3237
|
});
|
|
3204
3238
|
})));
|
|
@@ -3207,41 +3241,45 @@ class fn extends Dt {
|
|
|
3207
3241
|
this.#t && (this.#t.forEach((e) => {
|
|
3208
3242
|
e.el.forEach((n) => {
|
|
3209
3243
|
e.type.forEach((i) => {
|
|
3210
|
-
this[n].removeEventListener(
|
|
3244
|
+
this[n].removeEventListener(
|
|
3245
|
+
i,
|
|
3246
|
+
e.listener,
|
|
3247
|
+
false
|
|
3248
|
+
);
|
|
3211
3249
|
});
|
|
3212
3250
|
});
|
|
3213
|
-
}), this.#t =
|
|
3251
|
+
}), this.#t = []);
|
|
3214
3252
|
}
|
|
3215
3253
|
async onCreateEntry() {
|
|
3216
3254
|
this.trigger = document.querySelector(
|
|
3217
3255
|
`[aria-controls="${this.id}"], [aria-describedby="${this.id}"]`
|
|
3218
|
-
), this.isTooltip ? (this.
|
|
3256
|
+
), this.isTooltip ? (this.config.set({ event: "hover" }), this.el.setAttribute("role", "tooltip")) : this.trigger && this.trigger instanceof HTMLElement && this.trigger.setAttribute("aria-expanded", "false");
|
|
3219
3257
|
}
|
|
3220
3258
|
async onRegisterEntry() {
|
|
3221
|
-
this.el.classList.contains(this.
|
|
3259
|
+
this.registerEventListeners(), this.el.classList.contains(this.config.get("stateActive")) ? await this.open() : this.el.inert = true;
|
|
3222
3260
|
}
|
|
3223
3261
|
async onDestroyEntry() {
|
|
3224
3262
|
this.state === "opened" && await this.close(), this.floatingCleanup(), this.deregisterEventListeners();
|
|
3225
3263
|
}
|
|
3226
3264
|
}
|
|
3227
|
-
class
|
|
3228
|
-
#t;
|
|
3265
|
+
class cn extends ee {
|
|
3229
3266
|
constructor(e) {
|
|
3230
|
-
super({ ...
|
|
3267
|
+
super({ ...ne, ...e }), this.entryClass = rn, this.name = "Popover", this.trigger = null, this.#t = sn.bind(this);
|
|
3231
3268
|
}
|
|
3269
|
+
#t;
|
|
3232
3270
|
get active() {
|
|
3233
3271
|
return this.get("opened", "state");
|
|
3234
3272
|
}
|
|
3235
3273
|
get activeHover() {
|
|
3236
|
-
return this.collection.find((e) => e.state == "opened" && e.
|
|
3274
|
+
return this.collection.find((e) => e.state == "opened" && e.config.get("event") == "hover");
|
|
3237
3275
|
}
|
|
3238
3276
|
async open(e) {
|
|
3239
|
-
const n =
|
|
3240
|
-
return
|
|
3277
|
+
const n = this.getOrThrow(e);
|
|
3278
|
+
return Ut(n);
|
|
3241
3279
|
}
|
|
3242
3280
|
async close(e) {
|
|
3243
|
-
const n = e ?
|
|
3244
|
-
return n ?
|
|
3281
|
+
const n = e ? this.getOrThrow(e) : void 0;
|
|
3282
|
+
return n ? zt(n) : qt(this);
|
|
3245
3283
|
}
|
|
3246
3284
|
async afterMount() {
|
|
3247
3285
|
document.addEventListener("keydown", this.#t, false);
|
|
@@ -3254,9 +3292,9 @@ class un extends oe {
|
|
|
3254
3292
|
}
|
|
3255
3293
|
}
|
|
3256
3294
|
export {
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3295
|
+
q$1 as Drawer,
|
|
3296
|
+
P$1 as Modal,
|
|
3297
|
+
cn as Popover,
|
|
3260
3298
|
index as core
|
|
3261
3299
|
};
|
|
3262
3300
|
//# sourceMappingURL=index.js.map
|