vrembem 4.0.0-next.32 → 4.0.0-next.33
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/dev/base.css +0 -1
- package/dev/base.css.map +1 -1
- package/dev/index.css +72 -75
- package/dev/index.css.map +1 -1
- package/dev/index.js +662 -646
- package/dev/index.js.map +1 -1
- package/dev/index.umd.cjs +614 -598
- package/dev/index.umd.cjs.map +1 -1
- package/dev/root.css +72 -72
- 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 +606 -591
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +3 -3
- 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,19 +1,19 @@
|
|
|
1
|
-
const u
|
|
2
|
-
`a[href]${u
|
|
3
|
-
`area[href]${u
|
|
4
|
-
`input:not([type="hidden"]):not([type="radio"])${u
|
|
5
|
-
`input[type="radio"]${u
|
|
6
|
-
`select${u
|
|
7
|
-
`textarea${u
|
|
8
|
-
`button${u
|
|
9
|
-
`details${u
|
|
10
|
-
`iframe${u
|
|
11
|
-
`audio[controls]${u
|
|
12
|
-
`video[controls]${u
|
|
13
|
-
`[contenteditable]${u
|
|
14
|
-
`[tabindex]${u
|
|
1
|
+
const u = ":not([inert])", f$2 = ':not([tabindex^="-"])', m$2 = ":not(:disabled)", C$2 = [
|
|
2
|
+
`a[href]${u}${f$2}`,
|
|
3
|
+
`area[href]${u}${f$2}`,
|
|
4
|
+
`input:not([type="hidden"]):not([type="radio"])${u}${f$2}${m$2}`,
|
|
5
|
+
`input[type="radio"]${u}${f$2}${m$2}`,
|
|
6
|
+
`select${u}${f$2}${m$2}`,
|
|
7
|
+
`textarea${u}${f$2}${m$2}`,
|
|
8
|
+
`button${u}${f$2}${m$2}`,
|
|
9
|
+
`details${u} > summary:first-of-type${f$2}`,
|
|
10
|
+
`iframe${u}${f$2}`,
|
|
11
|
+
`audio[controls]${u}${f$2}`,
|
|
12
|
+
`video[controls]${u}${f$2}`,
|
|
13
|
+
`[contenteditable]${u}${f$2}`,
|
|
14
|
+
`[tabindex]${u}${f$2}`
|
|
15
15
|
];
|
|
16
|
-
function
|
|
16
|
+
function k$3(n, t = "config") {
|
|
17
17
|
const s = (n.getAttribute(`data-${t}`) || "").replace(/'/g, '"');
|
|
18
18
|
return s ? JSON.parse(s) : {};
|
|
19
19
|
}
|
|
@@ -100,8 +100,8 @@ async function h$1(n, t, e) {
|
|
|
100
100
|
function M$2(n) {
|
|
101
101
|
const t = getComputedStyle(n.el), e = {}, s = n.getSetting("customProps");
|
|
102
102
|
for (let r2 = 0; r2 < s.length; r2++) {
|
|
103
|
-
const a2 = y$2(),
|
|
104
|
-
|
|
103
|
+
const a2 = y$2(), o = n.parent.module.toLowerCase(), i = $$2(s[r2]), c2 = t.getPropertyValue(`--${a2}${o}-${i}`).trim();
|
|
104
|
+
c2 && (e[i] = c2);
|
|
105
105
|
}
|
|
106
106
|
return e;
|
|
107
107
|
}
|
|
@@ -117,26 +117,26 @@ function A$2(n, t = {}) {
|
|
|
117
117
|
props: s = ["dataConfig", "customProps", "settings", "parent.settings"]
|
|
118
118
|
} = t;
|
|
119
119
|
for (const r2 of s) {
|
|
120
|
-
const a2 = r2 !== "customProps" ? "camel" : "kebab",
|
|
121
|
-
if (
|
|
122
|
-
return
|
|
120
|
+
const a2 = r2 !== "customProps" ? "camel" : "kebab", o = P$3.call(this, r2, n, a2);
|
|
121
|
+
if (o !== void 0)
|
|
122
|
+
return o;
|
|
123
123
|
}
|
|
124
124
|
if (e !== void 0)
|
|
125
125
|
return e;
|
|
126
126
|
throw new Error(`${this.parent.module} setting does not exist: ${n}`);
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function T$3(n, t) {
|
|
129
129
|
t && document.querySelectorAll(t).forEach((s) => {
|
|
130
130
|
n ? s.style.overflow = "hidden" : s.style.removeProperty("overflow");
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function I$3(n, t) {
|
|
134
134
|
t && document.querySelectorAll(t).forEach((s) => {
|
|
135
|
-
|
|
135
|
+
s.inert = n;
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
function G(n, t, e) {
|
|
139
|
-
|
|
139
|
+
I$3(!!n, t), T$3(!!n, e);
|
|
140
140
|
}
|
|
141
141
|
const L$2 = {
|
|
142
142
|
events: {},
|
|
@@ -167,7 +167,7 @@ let O$2 = class O extends Array {
|
|
|
167
167
|
return this[this.length - 1];
|
|
168
168
|
}
|
|
169
169
|
set(t = this.el) {
|
|
170
|
-
this.length = 0, t && this.push(...t.querySelectorAll(
|
|
170
|
+
this.length = 0, t && this.push(...t.querySelectorAll(C$2.join(",")));
|
|
171
171
|
}
|
|
172
172
|
clear() {
|
|
173
173
|
this.length = 0;
|
|
@@ -189,8 +189,8 @@ function b$2(n) {
|
|
|
189
189
|
}
|
|
190
190
|
function D$3(n) {
|
|
191
191
|
if (n.key !== "Tab" && n.keyCode !== 9) return;
|
|
192
|
-
const { activeElement: t } = document, { el: e, focusable: s } = this, r2 = n.shiftKey, a2 = t === s.first || t === e,
|
|
193
|
-
if (r2 && a2 || !r2 &&
|
|
192
|
+
const { activeElement: t } = document, { el: e, focusable: s } = this, r2 = n.shiftKey, a2 = t === s.first || t === e, o = t === s.last || t === e;
|
|
193
|
+
if (r2 && a2 || !r2 && o) {
|
|
194
194
|
n.preventDefault();
|
|
195
195
|
const i = r2 ? s.last : s.first;
|
|
196
196
|
i && typeof i.focus == "function" && i.focus();
|
|
@@ -267,7 +267,7 @@ class W extends Array {
|
|
|
267
267
|
~e && (this.splice(e, 1), this.add(t));
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
|
-
const N$
|
|
270
|
+
const N$1 = {
|
|
271
271
|
condition: true
|
|
272
272
|
}, Q = {
|
|
273
273
|
primary: "hsl(152deg 60% 50%)",
|
|
@@ -278,15 +278,15 @@ const N$3 = {
|
|
|
278
278
|
function Z(n = {}) {
|
|
279
279
|
const t = {
|
|
280
280
|
name: "debug",
|
|
281
|
-
defaults: N$
|
|
281
|
+
defaults: N$1,
|
|
282
282
|
options: n
|
|
283
283
|
};
|
|
284
|
-
function e(
|
|
285
|
-
const
|
|
286
|
-
console.log(`%c📡 DEBUG: %c${
|
|
284
|
+
function e(o, i = [], c2 = ["primary", "secondary"]) {
|
|
285
|
+
const l = c2.map((d2) => `color: ${Q[d2]}`);
|
|
286
|
+
console.log(`%c📡 DEBUG: %c${o}`, ...l, ...i);
|
|
287
287
|
}
|
|
288
|
-
function s(
|
|
289
|
-
return typeof
|
|
288
|
+
function s(o, ...i) {
|
|
289
|
+
return typeof o == "function" ? o(...i) : o;
|
|
290
290
|
}
|
|
291
291
|
const r2 = {
|
|
292
292
|
beforeMountRef: e.bind(null, "Event > beforeMount()"),
|
|
@@ -303,33 +303,33 @@ function Z(n = {}) {
|
|
|
303
303
|
[],
|
|
304
304
|
["important", "neutral"]
|
|
305
305
|
),
|
|
306
|
-
createEntryRef: (
|
|
307
|
-
if (s(
|
|
308
|
-
const
|
|
309
|
-
e(`Event > createEntry() > [${
|
|
306
|
+
createEntryRef: (o, { parent: i, plugin: c2 }) => {
|
|
307
|
+
if (s(c2.settings.condition, o)) {
|
|
308
|
+
const l = i.collection.length;
|
|
309
|
+
e(`Event > createEntry() > [${l}] #${o.id}`);
|
|
310
310
|
}
|
|
311
311
|
},
|
|
312
|
-
registerEntryRef: (
|
|
313
|
-
if (s(
|
|
314
|
-
const
|
|
315
|
-
e(`Event > registerEntry() > [${
|
|
312
|
+
registerEntryRef: (o, { parent: i, plugin: c2 }) => {
|
|
313
|
+
if (s(c2.settings.condition, o)) {
|
|
314
|
+
const l = i.collection.length;
|
|
315
|
+
e(`Event > registerEntry() > [${l}] #${o.id}`);
|
|
316
316
|
}
|
|
317
317
|
},
|
|
318
|
-
destroyEntryRef: (
|
|
319
|
-
if (s(
|
|
320
|
-
const
|
|
318
|
+
destroyEntryRef: (o, { parent: i, plugin: c2 }) => {
|
|
319
|
+
if (s(c2.settings.condition, o)) {
|
|
320
|
+
const l = i.collection.length;
|
|
321
321
|
e(
|
|
322
|
-
`Event > destroyEntry() > [${
|
|
322
|
+
`Event > destroyEntry() > [${l}] #${o.id}`,
|
|
323
323
|
[],
|
|
324
324
|
["important", "neutral"]
|
|
325
325
|
);
|
|
326
326
|
}
|
|
327
327
|
},
|
|
328
|
-
deregisterEntryRef: (
|
|
329
|
-
if (s(
|
|
330
|
-
const
|
|
328
|
+
deregisterEntryRef: (o, { parent: i, plugin: c2 }) => {
|
|
329
|
+
if (s(c2.settings.condition, o)) {
|
|
330
|
+
const l = i.collection.length;
|
|
331
331
|
e(
|
|
332
|
-
`Event > deregisterEntry() > [${
|
|
332
|
+
`Event > deregisterEntry() > [${l}]`,
|
|
333
333
|
[],
|
|
334
334
|
["important", "neutral"]
|
|
335
335
|
);
|
|
@@ -338,39 +338,39 @@ function Z(n = {}) {
|
|
|
338
338
|
};
|
|
339
339
|
return { ...t, ...{
|
|
340
340
|
// Plugin setup/teardown methods
|
|
341
|
-
setup({ parent:
|
|
342
|
-
e("Plugin > setup()", Array.from(arguments), ["secondary", "neutral"]),
|
|
343
|
-
parent:
|
|
341
|
+
setup({ parent: o }) {
|
|
342
|
+
e("Plugin > setup()", Array.from(arguments), ["secondary", "neutral"]), o.on("beforeMount", r2.beforeMountRef), o.on("createEntry", r2.createEntryRef, { parent: o, plugin: this }), o.on("registerEntry", r2.registerEntryRef, {
|
|
343
|
+
parent: o,
|
|
344
344
|
plugin: this
|
|
345
|
-
}),
|
|
346
|
-
parent:
|
|
345
|
+
}), o.on("afterMount", r2.afterMountRef), o.on("beforeUnmount", r2.beforeUnmountRef), o.on("destroyEntry", r2.destroyEntryRef, { parent: o, plugin: this }), o.on("deregisterEntry", r2.deregisterEntryRef, {
|
|
346
|
+
parent: o,
|
|
347
347
|
plugin: this
|
|
348
|
-
}),
|
|
348
|
+
}), o.on("afterUnmount", r2.afterUnmountRef);
|
|
349
349
|
},
|
|
350
|
-
teardown({ parent:
|
|
350
|
+
teardown({ parent: o }) {
|
|
351
351
|
e("Plugin > teardown()", Array.from(arguments), [
|
|
352
352
|
"secondary",
|
|
353
353
|
"neutral"
|
|
354
|
-
]),
|
|
354
|
+
]), o.off("beforeMount", r2.beforeMountRef), o.off("createEntry", r2.createEntryRef), o.off("registerEntry", r2.registerEntryRef), o.off("afterMount", r2.afterMountRef), o.off("beforeUnmount", r2.beforeUnmountRef), o.off("destroyEntry", r2.destroyEntryRef), o.off("deregisterEntry", r2.deregisterEntryRef), o.off("afterUnmount", r2.afterUnmountRef);
|
|
355
355
|
},
|
|
356
356
|
// Mount lifecycle hooks
|
|
357
357
|
beforeMount() {
|
|
358
358
|
e("Hook > beforeMount()", Array.from(arguments));
|
|
359
359
|
},
|
|
360
|
-
onCreateEntry({ parent:
|
|
360
|
+
onCreateEntry({ parent: o, entry: i }) {
|
|
361
361
|
if (s(this.settings.condition, i)) {
|
|
362
|
-
const
|
|
362
|
+
const c2 = o.collection.length;
|
|
363
363
|
e(
|
|
364
|
-
`Hook > onCreateEntry() > [${
|
|
364
|
+
`Hook > onCreateEntry() > [${c2}] #${i.id}`,
|
|
365
365
|
Array.from(arguments)
|
|
366
366
|
);
|
|
367
367
|
}
|
|
368
368
|
},
|
|
369
|
-
onRegisterEntry({ parent:
|
|
369
|
+
onRegisterEntry({ parent: o, entry: i }) {
|
|
370
370
|
if (s(this.settings.condition, i)) {
|
|
371
|
-
const
|
|
371
|
+
const c2 = o.collection.length - 1;
|
|
372
372
|
e(
|
|
373
|
-
`Hook > onRegisterEntry() > [${
|
|
373
|
+
`Hook > onRegisterEntry() > [${c2}] #${i.id}`,
|
|
374
374
|
Array.from(arguments)
|
|
375
375
|
);
|
|
376
376
|
}
|
|
@@ -385,20 +385,20 @@ function Z(n = {}) {
|
|
|
385
385
|
"neutral"
|
|
386
386
|
]);
|
|
387
387
|
},
|
|
388
|
-
onDestroyEntry({ parent:
|
|
388
|
+
onDestroyEntry({ parent: o, entry: i }) {
|
|
389
389
|
if (s(this.settings.condition, i)) {
|
|
390
|
-
const
|
|
390
|
+
const c2 = o.collection.length - 1;
|
|
391
391
|
e(
|
|
392
|
-
`Hook > onDestroyEntry() > [${
|
|
392
|
+
`Hook > onDestroyEntry() > [${c2}] #${i.id}`,
|
|
393
393
|
Array.from(arguments),
|
|
394
394
|
["important", "neutral"]
|
|
395
395
|
);
|
|
396
396
|
}
|
|
397
397
|
},
|
|
398
|
-
onDeregisterEntry({ parent:
|
|
398
|
+
onDeregisterEntry({ parent: o, entry: i }) {
|
|
399
399
|
if (s(this.settings.condition, i)) {
|
|
400
|
-
const
|
|
401
|
-
e(`Hook > onDeregisterEntry() > [${
|
|
400
|
+
const c2 = o.collection.length;
|
|
401
|
+
e(`Hook > onDeregisterEntry() > [${c2}]`, Array.from(arguments), [
|
|
402
402
|
"important",
|
|
403
403
|
"neutral"
|
|
404
404
|
]);
|
|
@@ -421,30 +421,30 @@ function _$1(n = {}) {
|
|
|
421
421
|
defaults: q$3,
|
|
422
422
|
options: n
|
|
423
423
|
}, e = {
|
|
424
|
-
setup({ parent:
|
|
425
|
-
|
|
424
|
+
setup({ parent: o }) {
|
|
425
|
+
o.on("opened", r2, this), o.on("closed", a2, this);
|
|
426
426
|
},
|
|
427
|
-
teardown({ parent:
|
|
428
|
-
|
|
427
|
+
teardown({ parent: o }) {
|
|
428
|
+
o.off("opened", r2), o.off("closed", a2);
|
|
429
429
|
},
|
|
430
|
-
onCreateEntry({ entry:
|
|
431
|
-
|
|
430
|
+
onCreateEntry({ entry: o }) {
|
|
431
|
+
o.focusTrap = new U$2();
|
|
432
432
|
}
|
|
433
433
|
};
|
|
434
|
-
function s(
|
|
435
|
-
return typeof
|
|
434
|
+
function s(o, ...i) {
|
|
435
|
+
return typeof o == "function" ? o(...i) : o;
|
|
436
436
|
}
|
|
437
|
-
function r2(
|
|
438
|
-
const
|
|
439
|
-
s(i.settings.condition,
|
|
437
|
+
function r2(o, i) {
|
|
438
|
+
const c2 = { plugin: i, parent: o.parent, entry: o };
|
|
439
|
+
s(i.settings.condition, c2) && o.focusTrap?.on(o.dialog);
|
|
440
440
|
}
|
|
441
|
-
function a2(
|
|
442
|
-
const
|
|
443
|
-
s(i.settings.condition,
|
|
441
|
+
function a2(o, i) {
|
|
442
|
+
const c2 = { plugin: i, parent: o.parent, entry: o };
|
|
443
|
+
s(i.settings.condition, c2) && o.focusTrap?.off();
|
|
444
444
|
}
|
|
445
445
|
return { ...t, ...e };
|
|
446
446
|
}
|
|
447
|
-
const F$
|
|
447
|
+
const F$2 = {
|
|
448
448
|
// The data attributes to get the breakpoint values from
|
|
449
449
|
dataBreakpoint: "breakpoint",
|
|
450
450
|
// The data attributes to get the media query value from
|
|
@@ -472,7 +472,7 @@ const F$1 = {
|
|
|
472
472
|
function X$1(n = {}) {
|
|
473
473
|
const t = {
|
|
474
474
|
name: "mediaQuery",
|
|
475
|
-
defaults: F$
|
|
475
|
+
defaults: F$2,
|
|
476
476
|
options: n
|
|
477
477
|
}, e = {
|
|
478
478
|
// Run when an entry is created
|
|
@@ -483,28 +483,28 @@ function X$1(n = {}) {
|
|
|
483
483
|
// Run when an entry is destroyed
|
|
484
484
|
// Removes the MediaQueryList and event listener
|
|
485
485
|
onDestroyEntry({ entry: i }) {
|
|
486
|
-
|
|
486
|
+
o(i);
|
|
487
487
|
}
|
|
488
488
|
};
|
|
489
489
|
function s(i) {
|
|
490
|
-
const
|
|
491
|
-
return !
|
|
490
|
+
const c2 = i.el.getAttribute(`data-${this.settings.dataMediaQuery}`);
|
|
491
|
+
return !c2 && i.id in this.settings.mediaQueries ? this.settings.mediaQueries[i.id] : c2 || void 0;
|
|
492
492
|
}
|
|
493
493
|
function r2(i) {
|
|
494
|
-
let
|
|
495
|
-
return !
|
|
494
|
+
let c2 = i.el.getAttribute(`data-${this.settings.dataBreakpoint}`);
|
|
495
|
+
return !c2 && i.id in this.settings.breakpoints && (c2 = this.settings.breakpoints[i.id]), c2 && c2 in this.settings.breakpoints && (c2 = this.settings.breakpoints[c2]), c2 && (c2 = getComputedStyle(document.body).getPropertyValue(`--${y$2()}breakpoint-${c2}`).trim() || c2), c2 || this.settings.breakpoint;
|
|
496
496
|
}
|
|
497
497
|
function a2(i) {
|
|
498
|
-
let
|
|
499
|
-
const
|
|
500
|
-
if (!
|
|
501
|
-
|
|
502
|
-
const d2 =
|
|
498
|
+
let c2 = s.call(this, i);
|
|
499
|
+
const l = r2.call(this, i);
|
|
500
|
+
if (!l && !c2) return;
|
|
501
|
+
l && !c2 && (c2 = this.settings.mediaQuery);
|
|
502
|
+
const d2 = c2.replace(new RegExp(`${this.settings.token}`, "g"), l);
|
|
503
503
|
i.mql = window.matchMedia(d2), i.mql.onchange = (p2) => {
|
|
504
504
|
this.settings.onChange(p2, i);
|
|
505
505
|
}, this.settings.onChange(i.mql, i);
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function o(i) {
|
|
508
508
|
i.mql && (i.mql.onchange = null, i.mql = null);
|
|
509
509
|
}
|
|
510
510
|
return { ...t, ...e };
|
|
@@ -533,7 +533,7 @@ function Y$1(n = {}) {
|
|
|
533
533
|
store: null
|
|
534
534
|
}, e = {
|
|
535
535
|
setup({ parent: i }) {
|
|
536
|
-
this.store = w$2(
|
|
536
|
+
this.store = w$2(o.call(this, i.module));
|
|
537
537
|
},
|
|
538
538
|
async onCreateEntry({ entry: i }) {
|
|
539
539
|
await s.call(this, i);
|
|
@@ -543,22 +543,22 @@ function Y$1(n = {}) {
|
|
|
543
543
|
}
|
|
544
544
|
};
|
|
545
545
|
async function s(i) {
|
|
546
|
-
let
|
|
547
|
-
const
|
|
546
|
+
let c2 = i[this.settings.prop] || null;
|
|
547
|
+
const l = { plugin: this, parent: i.parent, entry: i };
|
|
548
548
|
Object.defineProperty(i, this.settings.prop, {
|
|
549
549
|
configurable: true,
|
|
550
550
|
get() {
|
|
551
|
-
return
|
|
551
|
+
return c2;
|
|
552
552
|
},
|
|
553
553
|
set: async (d2) => {
|
|
554
|
-
if (
|
|
555
|
-
const p2 =
|
|
556
|
-
|
|
554
|
+
if (c2 === d2) return;
|
|
555
|
+
const p2 = c2;
|
|
556
|
+
c2 = d2, r2(
|
|
557
557
|
this.settings.condition,
|
|
558
|
-
|
|
558
|
+
l,
|
|
559
559
|
d2,
|
|
560
560
|
p2
|
|
561
|
-
) && this.store.set(i.id, d2), await this.settings.onChange(
|
|
561
|
+
) && this.store.set(i.id, d2), await this.settings.onChange(l, d2, p2);
|
|
562
562
|
}
|
|
563
563
|
}), Object.defineProperty(i, "store", {
|
|
564
564
|
configurable: true,
|
|
@@ -566,18 +566,18 @@ function Y$1(n = {}) {
|
|
|
566
566
|
set: (d2) => {
|
|
567
567
|
i[this.settings.prop] = d2;
|
|
568
568
|
}
|
|
569
|
-
}), i[this.settings.prop] = await r2(this.settings.value,
|
|
569
|
+
}), i[this.settings.prop] = await r2(this.settings.value, l) || i[this.settings.prop];
|
|
570
570
|
}
|
|
571
|
-
function r2(i, ...
|
|
572
|
-
return typeof i == "function" ? i(...
|
|
571
|
+
function r2(i, ...c2) {
|
|
572
|
+
return typeof i == "function" ? i(...c2) : i;
|
|
573
573
|
}
|
|
574
574
|
async function a2(i) {
|
|
575
|
-
const
|
|
576
|
-
delete i[this.settings.prop], i[this.settings.prop] =
|
|
575
|
+
const c2 = i[this.settings.prop];
|
|
576
|
+
delete i[this.settings.prop], i[this.settings.prop] = c2, this.store.set(i.id, null);
|
|
577
577
|
}
|
|
578
|
-
function
|
|
579
|
-
const
|
|
580
|
-
return this.settings.keyPrefix +
|
|
578
|
+
function o(i) {
|
|
579
|
+
const c2 = this.settings.prop.charAt(0).toUpperCase() + this.settings.prop.slice(1), l = this.settings.key || i + c2;
|
|
580
|
+
return this.settings.keyPrefix + l;
|
|
581
581
|
}
|
|
582
582
|
return { ...t, ...e };
|
|
583
583
|
}
|
|
@@ -591,27 +591,27 @@ function tt$1(n = {}) {
|
|
|
591
591
|
defaults: B,
|
|
592
592
|
options: n
|
|
593
593
|
}, e = {
|
|
594
|
-
onCreateEntry({ plugin: a2, entry:
|
|
595
|
-
s(a2,
|
|
594
|
+
onCreateEntry({ plugin: a2, entry: o }) {
|
|
595
|
+
s(a2, o);
|
|
596
596
|
},
|
|
597
|
-
onDestroyEntry({ plugin: a2, entry:
|
|
598
|
-
r2(a2,
|
|
597
|
+
onDestroyEntry({ plugin: a2, entry: o }) {
|
|
598
|
+
r2(a2, o);
|
|
599
599
|
}
|
|
600
600
|
};
|
|
601
|
-
function s(a2,
|
|
602
|
-
|
|
603
|
-
typeof
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
601
|
+
function s(a2, o) {
|
|
602
|
+
o.teleport = () => {
|
|
603
|
+
typeof o.teleportReturn == "function" && o.teleportReturn(), o.teleportReturn = x$2(
|
|
604
|
+
o.el,
|
|
605
|
+
o.getSetting("teleport", { fallback: a2.settings.where }),
|
|
606
|
+
o.getSetting("teleportMethod", { fallback: a2.settings.how })
|
|
607
607
|
);
|
|
608
|
-
},
|
|
608
|
+
}, o.teleport(), o.parent.emit("teleport", { plugin: a2, parent: o.parent, entry: o });
|
|
609
609
|
}
|
|
610
|
-
function r2(a2,
|
|
611
|
-
typeof
|
|
610
|
+
function r2(a2, o) {
|
|
611
|
+
typeof o.teleportReturn == "function" && o.teleportReturn(), o.parent.emit("teleportReturn", {
|
|
612
612
|
plugin: a2,
|
|
613
|
-
parent:
|
|
614
|
-
entry:
|
|
613
|
+
parent: o.parent,
|
|
614
|
+
entry: o
|
|
615
615
|
});
|
|
616
616
|
}
|
|
617
617
|
return { ...t, ...e };
|
|
@@ -620,7 +620,7 @@ const j$3 = {
|
|
|
620
620
|
dataConfig: "config",
|
|
621
621
|
customProps: []
|
|
622
622
|
};
|
|
623
|
-
let z$
|
|
623
|
+
let z$2 = class z {
|
|
624
624
|
constructor(t, e, s = {}) {
|
|
625
625
|
this.parent = t, this.el = E$3(e), this.settings = { ...s }, this.dataConfig = {}, this.customProps = {};
|
|
626
626
|
}
|
|
@@ -636,7 +636,7 @@ let z$3 = class z {
|
|
|
636
636
|
buildDataConfig() {
|
|
637
637
|
return Object.assign(
|
|
638
638
|
this.dataConfig,
|
|
639
|
-
|
|
639
|
+
k$3(this.el, this.getSetting("dataConfig"))
|
|
640
640
|
);
|
|
641
641
|
}
|
|
642
642
|
buildCustomProps() {
|
|
@@ -653,11 +653,19 @@ let z$3 = class z {
|
|
|
653
653
|
};
|
|
654
654
|
let et$1 = class et {
|
|
655
655
|
constructor(t = {}) {
|
|
656
|
-
this.module = this.constructor.name, this.collection = [], this.entryClass = z$
|
|
656
|
+
this.module = this.constructor.name, this.collection = [], this.entryClass = z$2, this.settings = { ...j$3, ...t }, this.plugins = new H$3(this.settings.presets), this.events = {}, Object.assign(this, L$2);
|
|
657
657
|
}
|
|
658
658
|
get(t, e = "id") {
|
|
659
659
|
return this.collection.find((s) => s[e] === t);
|
|
660
660
|
}
|
|
661
|
+
getOrThrow(t, e = "id") {
|
|
662
|
+
const s = this.get(t, e);
|
|
663
|
+
if (s)
|
|
664
|
+
return s;
|
|
665
|
+
throw new Error(
|
|
666
|
+
`${this.module} entry not found in collection with ${e} of "${t}"`
|
|
667
|
+
);
|
|
668
|
+
}
|
|
661
669
|
applySettings(t) {
|
|
662
670
|
return Object.assign(this.settings, t);
|
|
663
671
|
}
|
|
@@ -737,8 +745,8 @@ function nt$1(n = {}) {
|
|
|
737
745
|
t.themes.push(a2);
|
|
738
746
|
},
|
|
739
747
|
remove(a2) {
|
|
740
|
-
const
|
|
741
|
-
~
|
|
748
|
+
const o = t.themes.indexOf(a2);
|
|
749
|
+
~o && t.themes.splice(o, 1);
|
|
742
750
|
},
|
|
743
751
|
callback(a2) {
|
|
744
752
|
e[a2].call(this);
|
|
@@ -766,7 +774,7 @@ function nt$1(n = {}) {
|
|
|
766
774
|
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
767
775
|
__proto__: null,
|
|
768
776
|
Collection: et$1,
|
|
769
|
-
CollectionEntry: z$
|
|
777
|
+
CollectionEntry: z$2,
|
|
770
778
|
FocusTrap: U$2,
|
|
771
779
|
FocusableArray: O$2,
|
|
772
780
|
PluginsArray: H$3,
|
|
@@ -776,9 +784,9 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
776
784
|
dispatchLifecycleHook: h$1,
|
|
777
785
|
eventEmitter: L$2,
|
|
778
786
|
focusTrap: _$1,
|
|
779
|
-
focusableSelectors:
|
|
787
|
+
focusableSelectors: C$2,
|
|
780
788
|
getCustomProps: M$2,
|
|
781
|
-
getDataConfig:
|
|
789
|
+
getDataConfig: k$3,
|
|
782
790
|
getElement: E$3,
|
|
783
791
|
getPrefix: y$2,
|
|
784
792
|
getSetting: A$2,
|
|
@@ -795,11 +803,11 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
795
803
|
toMilliseconds: S$2,
|
|
796
804
|
transition: J$1
|
|
797
805
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
798
|
-
function
|
|
806
|
+
function E$2(t, e = "config") {
|
|
799
807
|
const s = (t.getAttribute(`data-${e}`) || "").replace(/'/g, '"');
|
|
800
808
|
return s ? JSON.parse(s) : {};
|
|
801
809
|
}
|
|
802
|
-
function
|
|
810
|
+
function f$1(t) {
|
|
803
811
|
if (typeof t == "string") {
|
|
804
812
|
const e = document.getElementById(t);
|
|
805
813
|
if (e) return e;
|
|
@@ -814,15 +822,15 @@ function p$1(t) {
|
|
|
814
822
|
async function r$1(t, e, ...s) {
|
|
815
823
|
e in t && typeof t[e] == "function" && await t[e](...s);
|
|
816
824
|
}
|
|
817
|
-
function
|
|
825
|
+
function b$1(t) {
|
|
818
826
|
return t.split("-").map(
|
|
819
827
|
(e, s) => s === 0 ? e : e.charAt(0).toUpperCase() + e.slice(1)
|
|
820
828
|
).join("");
|
|
821
829
|
}
|
|
822
|
-
function
|
|
830
|
+
function p$1(t) {
|
|
823
831
|
return t.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
824
832
|
}
|
|
825
|
-
function
|
|
833
|
+
function C$1(t) {
|
|
826
834
|
if (typeof t == "number")
|
|
827
835
|
return t;
|
|
828
836
|
const e = parseFloat(t);
|
|
@@ -832,14 +840,14 @@ function L$1(t) {
|
|
|
832
840
|
}
|
|
833
841
|
throw new Error(`Could not convert value to milliseconds: ${t}`);
|
|
834
842
|
}
|
|
835
|
-
function
|
|
836
|
-
return new Promise((
|
|
843
|
+
function m$1(t, e, s, i, n = 0) {
|
|
844
|
+
return new Promise((o) => {
|
|
837
845
|
t.classList.remove(e), t.classList.add(s), setTimeout(() => {
|
|
838
|
-
t.classList.add(i), t.classList.remove(s),
|
|
839
|
-
},
|
|
846
|
+
t.classList.add(i), t.classList.remove(s), o(t);
|
|
847
|
+
}, C$1(n));
|
|
840
848
|
});
|
|
841
849
|
}
|
|
842
|
-
async function
|
|
850
|
+
async function a$1(t, e, s) {
|
|
843
851
|
await r$1(e, t, s), s && await r$1(s, t);
|
|
844
852
|
for (const i of e.plugins)
|
|
845
853
|
await r$1(i, t, { plugin: i, parent: e, entry: s });
|
|
@@ -848,45 +856,45 @@ async function o(t, e, s) {
|
|
|
848
856
|
function O$1(t) {
|
|
849
857
|
const e = getComputedStyle(t.el), s = {}, i = t.getSetting("customProps");
|
|
850
858
|
for (let n = 0; n < i.length; n++) {
|
|
851
|
-
const
|
|
852
|
-
|
|
859
|
+
const o = L$1(), l = t.parent.module.toLowerCase(), h2 = p$1(i[n]), u2 = e.getPropertyValue(`--${o}${l}-${h2}`).trim();
|
|
860
|
+
u2 && (s[h2] = u2);
|
|
853
861
|
}
|
|
854
862
|
return s;
|
|
855
863
|
}
|
|
856
|
-
function
|
|
864
|
+
function L$1() {
|
|
857
865
|
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
858
866
|
}
|
|
859
867
|
function $$1(t, e, s = "camel") {
|
|
860
|
-
return e = s === "camel" ?
|
|
868
|
+
return e = s === "camel" ? b$1(e) : p$1(e), t.split(".").concat(e).reduce((i, n) => i?.[n], this);
|
|
861
869
|
}
|
|
862
|
-
function
|
|
870
|
+
function M$1(t, e = {}) {
|
|
863
871
|
const {
|
|
864
872
|
fallback: s,
|
|
865
873
|
props: i = ["dataConfig", "customProps", "settings", "parent.settings"]
|
|
866
874
|
} = e;
|
|
867
875
|
for (const n of i) {
|
|
868
|
-
const
|
|
869
|
-
if (
|
|
870
|
-
return
|
|
876
|
+
const o = n !== "customProps" ? "camel" : "kebab", l = $$1.call(this, n, t, o);
|
|
877
|
+
if (l !== void 0)
|
|
878
|
+
return l;
|
|
871
879
|
}
|
|
872
880
|
if (s !== void 0)
|
|
873
881
|
return s;
|
|
874
882
|
throw new Error(`${this.parent.module} setting does not exist: ${t}`);
|
|
875
883
|
}
|
|
876
|
-
function
|
|
884
|
+
function P$2(t, e) {
|
|
877
885
|
e && document.querySelectorAll(e).forEach((s) => {
|
|
878
886
|
t ? s.style.overflow = "hidden" : s.style.removeProperty("overflow");
|
|
879
887
|
});
|
|
880
888
|
}
|
|
881
|
-
function
|
|
889
|
+
function T$2(t, e) {
|
|
882
890
|
e && document.querySelectorAll(e).forEach((s) => {
|
|
883
|
-
|
|
891
|
+
s.inert = t;
|
|
884
892
|
});
|
|
885
893
|
}
|
|
886
|
-
function
|
|
887
|
-
|
|
894
|
+
function c$1(t, e, s) {
|
|
895
|
+
T$2(!!t, e), P$2(!!t, s);
|
|
888
896
|
}
|
|
889
|
-
const
|
|
897
|
+
const x$1 = {
|
|
890
898
|
events: {},
|
|
891
899
|
on(t, e, ...s) {
|
|
892
900
|
this.events[t] || (this.events[t] = []), this.events[t].some(
|
|
@@ -931,13 +939,13 @@ let y$1 = class y extends Array {
|
|
|
931
939
|
~s && this.splice(s, 1);
|
|
932
940
|
}
|
|
933
941
|
};
|
|
934
|
-
const
|
|
942
|
+
const A$1 = {
|
|
935
943
|
dataConfig: "config",
|
|
936
944
|
customProps: []
|
|
937
945
|
};
|
|
938
|
-
let
|
|
946
|
+
let w$1 = class w {
|
|
939
947
|
constructor(e, s, i = {}) {
|
|
940
|
-
this.parent = e, this.el =
|
|
948
|
+
this.parent = e, this.el = f$1(s), this.settings = { ...i }, this.dataConfig = {}, this.customProps = {};
|
|
941
949
|
}
|
|
942
950
|
get id() {
|
|
943
951
|
return this.el.id;
|
|
@@ -946,12 +954,12 @@ let S$1 = class S {
|
|
|
946
954
|
return Object.assign(this.settings, e);
|
|
947
955
|
}
|
|
948
956
|
getSetting(e, s) {
|
|
949
|
-
return
|
|
957
|
+
return M$1.call(this, e, s);
|
|
950
958
|
}
|
|
951
959
|
buildDataConfig() {
|
|
952
960
|
return Object.assign(
|
|
953
961
|
this.dataConfig,
|
|
954
|
-
|
|
962
|
+
E$2(this.el, this.getSetting("dataConfig"))
|
|
955
963
|
);
|
|
956
964
|
}
|
|
957
965
|
buildCustomProps() {
|
|
@@ -966,38 +974,46 @@ let S$1 = class S {
|
|
|
966
974
|
});
|
|
967
975
|
}
|
|
968
976
|
};
|
|
969
|
-
let
|
|
977
|
+
let D$2 = class D {
|
|
970
978
|
constructor(e = {}) {
|
|
971
|
-
this.module = this.constructor.name, this.collection = [], this.entryClass =
|
|
979
|
+
this.module = this.constructor.name, this.collection = [], this.entryClass = w$1, this.settings = { ...A$1, ...e }, this.plugins = new y$1(this.settings.presets), this.events = {}, Object.assign(this, x$1);
|
|
972
980
|
}
|
|
973
981
|
get(e, s = "id") {
|
|
974
982
|
return this.collection.find((i) => i[s] === e);
|
|
975
983
|
}
|
|
984
|
+
getOrThrow(e, s = "id") {
|
|
985
|
+
const i = this.get(e, s);
|
|
986
|
+
if (i)
|
|
987
|
+
return i;
|
|
988
|
+
throw new Error(
|
|
989
|
+
`${this.module} entry not found in collection with ${s} of "${e}"`
|
|
990
|
+
);
|
|
991
|
+
}
|
|
976
992
|
applySettings(e) {
|
|
977
993
|
return Object.assign(this.settings, e);
|
|
978
994
|
}
|
|
979
995
|
async createEntry(e, s) {
|
|
980
996
|
const i = new this.entryClass(this, e, s);
|
|
981
|
-
return await r$1(i, "init"), await
|
|
997
|
+
return await r$1(i, "init"), await a$1("onCreateEntry", this, i), i;
|
|
982
998
|
}
|
|
983
999
|
async destroyEntry(e) {
|
|
984
|
-
return await
|
|
1000
|
+
return await a$1("onDestroyEntry", this, e), await r$1(e, "destroy"), e;
|
|
985
1001
|
}
|
|
986
1002
|
async register(e, s = {}) {
|
|
987
|
-
const i =
|
|
1003
|
+
const i = f$1(e), n = this.collection.findIndex((o) => o.id === i.id);
|
|
988
1004
|
if (~n) {
|
|
989
|
-
const
|
|
990
|
-
return
|
|
1005
|
+
const o = this.collection[n];
|
|
1006
|
+
return o.el = i, typeof o.init == "function" && await o.init(s), o;
|
|
991
1007
|
} else {
|
|
992
|
-
const
|
|
993
|
-
return this.collection.push(
|
|
1008
|
+
const o = await this.createEntry(i, s);
|
|
1009
|
+
return this.collection.push(o), await a$1("onRegisterEntry", this, o), o;
|
|
994
1010
|
}
|
|
995
1011
|
}
|
|
996
1012
|
async deregister(e) {
|
|
997
1013
|
const s = this.collection.findIndex((i) => i.id === e);
|
|
998
1014
|
if (~s) {
|
|
999
1015
|
const i = await this.destroyEntry(this.collection[s]);
|
|
1000
|
-
return await
|
|
1016
|
+
return await a$1(
|
|
1001
1017
|
"onDeregisterEntry",
|
|
1002
1018
|
this,
|
|
1003
1019
|
this.collection[s]
|
|
@@ -1011,16 +1027,16 @@ let T$2 = class T {
|
|
|
1011
1027
|
this.plugins.add(i);
|
|
1012
1028
|
for (const i of this.plugins)
|
|
1013
1029
|
await r$1(i, "setup", { plugin: i, parent: this });
|
|
1014
|
-
await
|
|
1030
|
+
await a$1("beforeMount", this);
|
|
1015
1031
|
const s = document.querySelectorAll(this.settings.selector);
|
|
1016
1032
|
for (const i of s)
|
|
1017
1033
|
await this.register(i);
|
|
1018
|
-
return await
|
|
1034
|
+
return await a$1("afterMount", this), this;
|
|
1019
1035
|
}
|
|
1020
1036
|
async unmount() {
|
|
1021
|
-
for (await
|
|
1037
|
+
for (await a$1("beforeUnmount", this); this.collection.length > 0; )
|
|
1022
1038
|
await this.deregister(this.collection[0].id);
|
|
1023
|
-
await
|
|
1039
|
+
await a$1("afterUnmount", this);
|
|
1024
1040
|
for (const e of this.plugins)
|
|
1025
1041
|
await r$1(e, "teardown", { plugin: e, parent: this });
|
|
1026
1042
|
for (const e of [...this.plugins])
|
|
@@ -1028,7 +1044,7 @@ let T$2 = class T {
|
|
|
1028
1044
|
return this;
|
|
1029
1045
|
}
|
|
1030
1046
|
};
|
|
1031
|
-
const
|
|
1047
|
+
const I$2 = {
|
|
1032
1048
|
focusTrap: {
|
|
1033
1049
|
condition: ({ entry: t }) => t.state === "closed" || t.state === "opened" && t.mode === "modal"
|
|
1034
1050
|
},
|
|
@@ -1043,8 +1059,8 @@ const k$2 = {
|
|
|
1043
1059
|
condition: ({ entry: t }) => ["opened", "closed", "indeterminate"].includes(t.state),
|
|
1044
1060
|
onChange: ({ entry: t }) => t.applyState()
|
|
1045
1061
|
}
|
|
1046
|
-
},
|
|
1047
|
-
presets:
|
|
1062
|
+
}, k$2 = {
|
|
1063
|
+
presets: I$2,
|
|
1048
1064
|
dataOpen: "drawer-open",
|
|
1049
1065
|
dataClose: "drawer-close",
|
|
1050
1066
|
dataToggle: "drawer-toggle",
|
|
@@ -1066,18 +1082,18 @@ const k$2 = {
|
|
|
1066
1082
|
transition: true,
|
|
1067
1083
|
transitionDuration: 300
|
|
1068
1084
|
};
|
|
1069
|
-
function
|
|
1085
|
+
function j$2(t) {
|
|
1070
1086
|
switch (t.mode) {
|
|
1071
1087
|
case "inline":
|
|
1072
|
-
return
|
|
1088
|
+
return q$2(t);
|
|
1073
1089
|
case "modal":
|
|
1074
|
-
return
|
|
1090
|
+
return H$2(t);
|
|
1075
1091
|
default:
|
|
1076
1092
|
throw new Error(`"${t.mode}" is not a valid drawer mode.`);
|
|
1077
1093
|
}
|
|
1078
1094
|
}
|
|
1079
|
-
async function
|
|
1080
|
-
return t.el.classList.remove(t.getSetting("classModal")), t.dialog.removeAttribute("aria-modal"),
|
|
1095
|
+
async function q$2(t) {
|
|
1096
|
+
return t.el.classList.remove(t.getSetting("classModal")), t.dialog.removeAttribute("aria-modal"), c$1(
|
|
1081
1097
|
false,
|
|
1082
1098
|
t.getSetting("selectorInert"),
|
|
1083
1099
|
t.getSetting("selectorOverflow")
|
|
@@ -1088,7 +1104,7 @@ async function H$2(t) {
|
|
|
1088
1104
|
})
|
|
1089
1105
|
), await t.parent.emit("switchMode", t), t;
|
|
1090
1106
|
}
|
|
1091
|
-
async function
|
|
1107
|
+
async function H$2(t) {
|
|
1092
1108
|
return t.el.classList.add(t.getSetting("classModal")), t.dialog.setAttribute("aria-modal", "true"), await t.close(false, false), t.el.dispatchEvent(
|
|
1093
1109
|
new CustomEvent(t.getSetting("customEventPrefix") + "switchMode", {
|
|
1094
1110
|
detail: t.parent,
|
|
@@ -1096,21 +1112,21 @@ async function N$2(t) {
|
|
|
1096
1112
|
})
|
|
1097
1113
|
), await t.parent.emit("switchMode", t), t;
|
|
1098
1114
|
}
|
|
1099
|
-
function
|
|
1115
|
+
function S$1(t) {
|
|
1100
1116
|
t.dialog && t.state === "opened" ? (t.dialog.querySelector(t.parent.settings.selectorFocus) || t.dialog).focus() : t.trigger && (t.trigger.focus(), t.trigger = null);
|
|
1101
1117
|
}
|
|
1102
|
-
async function
|
|
1103
|
-
return (t.state === "closed" || t.state === "indeterminate" || t.state === null) && (t.setState("opening"), e ?? t.getSetting("transition") ? await
|
|
1118
|
+
async function d$1(t, e, s = true) {
|
|
1119
|
+
return (t.state === "closed" || t.state === "indeterminate" || t.state === null) && (t.setState("opening"), e ?? t.getSetting("transition") ? await m$1(
|
|
1104
1120
|
t.el,
|
|
1105
1121
|
t.getSetting("stateClosed"),
|
|
1106
1122
|
t.getSetting("stateOpening"),
|
|
1107
1123
|
t.getSetting("stateOpened"),
|
|
1108
1124
|
t.getSetting("transitionDuration")
|
|
1109
|
-
) : (t.el.classList.add(t.getSetting("stateOpened")), t.el.classList.remove(t.getSetting("stateClosed"))), t.setState("opened"), t.mode === "modal" &&
|
|
1125
|
+
) : (t.el.classList.add(t.getSetting("stateOpened")), t.el.classList.remove(t.getSetting("stateClosed"))), t.setState("opened"), t.mode === "modal" && c$1(
|
|
1110
1126
|
true,
|
|
1111
1127
|
t.getSetting("selectorInert"),
|
|
1112
1128
|
t.getSetting("selectorOverflow")
|
|
1113
|
-
), s &&
|
|
1129
|
+
), s && S$1(t), t.el.dispatchEvent(
|
|
1114
1130
|
new CustomEvent(t.getSetting("customEventPrefix") + "opened", {
|
|
1115
1131
|
detail: t.parent,
|
|
1116
1132
|
bubbles: true
|
|
@@ -1118,27 +1134,27 @@ async function u$1(t, e, s = true) {
|
|
|
1118
1134
|
), await t.parent.emit("opened", t)), t;
|
|
1119
1135
|
}
|
|
1120
1136
|
async function g(t, e, s = true) {
|
|
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.getSetting("transition") ? await
|
|
1137
|
+
return (t.state === "opened" || t.state === "indeterminate" || t.state === null) && (t.setState("closing"), document.activeElement && document.activeElement instanceof HTMLElement && document.activeElement.blur(), e ?? t.getSetting("transition") ? await m$1(
|
|
1122
1138
|
t.el,
|
|
1123
1139
|
t.getSetting("stateOpened"),
|
|
1124
1140
|
t.getSetting("stateClosing"),
|
|
1125
1141
|
t.getSetting("stateClosed"),
|
|
1126
1142
|
t.getSetting("transitionDuration")
|
|
1127
|
-
) : (t.el.classList.add(t.getSetting("stateClosed")), t.el.classList.remove(t.getSetting("stateOpened"))), t.setState("closed"), t.mode === "modal" &&
|
|
1143
|
+
) : (t.el.classList.add(t.getSetting("stateClosed")), t.el.classList.remove(t.getSetting("stateOpened"))), t.setState("closed"), t.mode === "modal" && c$1(
|
|
1128
1144
|
false,
|
|
1129
1145
|
t.getSetting("selectorInert"),
|
|
1130
1146
|
t.getSetting("selectorOverflow")
|
|
1131
|
-
), s &&
|
|
1147
|
+
), s && S$1(t), t.el.dispatchEvent(
|
|
1132
1148
|
new CustomEvent(t.getSetting("customEventPrefix") + "closed", {
|
|
1133
1149
|
detail: t.parent,
|
|
1134
1150
|
bubbles: true
|
|
1135
1151
|
})
|
|
1136
1152
|
), await t.parent.emit("closed", t)), t;
|
|
1137
1153
|
}
|
|
1138
|
-
async function
|
|
1139
|
-
return t.state === "closed" ?
|
|
1154
|
+
async function v$1(t, e, s) {
|
|
1155
|
+
return t.state === "closed" ? d$1(t, e, s) : g(t, e, s);
|
|
1140
1156
|
}
|
|
1141
|
-
class
|
|
1157
|
+
class N extends w$1 {
|
|
1142
1158
|
#t;
|
|
1143
1159
|
constructor(e, s, i = {}) {
|
|
1144
1160
|
super(e, s, i), this.#t = "indeterminate", this.dialog = this.el.querySelector(this.getSetting("selectorDialog")) || this.el, this.trigger = null, this.state = null, this.inlineState = null;
|
|
@@ -1147,7 +1163,7 @@ class F extends S$1 {
|
|
|
1147
1163
|
return this.#t;
|
|
1148
1164
|
}
|
|
1149
1165
|
set mode(e) {
|
|
1150
|
-
this.#t !== e && (this.#t = e,
|
|
1166
|
+
this.#t !== e && (this.#t = e, j$2(this));
|
|
1151
1167
|
}
|
|
1152
1168
|
setState(e) {
|
|
1153
1169
|
this.state = e;
|
|
@@ -1169,13 +1185,13 @@ class F extends S$1 {
|
|
|
1169
1185
|
return this.setState("indeterminate"), this;
|
|
1170
1186
|
}
|
|
1171
1187
|
async open(e, s) {
|
|
1172
|
-
return
|
|
1188
|
+
return d$1(this, e, s);
|
|
1173
1189
|
}
|
|
1174
1190
|
async close(e, s) {
|
|
1175
1191
|
return g(this, e, s);
|
|
1176
1192
|
}
|
|
1177
1193
|
async toggle(e, s) {
|
|
1178
|
-
return
|
|
1194
|
+
return v$1(this, e, s);
|
|
1179
1195
|
}
|
|
1180
1196
|
async deregister() {
|
|
1181
1197
|
return this.parent.deregister(this.id);
|
|
@@ -1187,13 +1203,7 @@ class F extends S$1 {
|
|
|
1187
1203
|
this.mode === "modal" && this.state === "opened" && await this.close(false);
|
|
1188
1204
|
}
|
|
1189
1205
|
}
|
|
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) {
|
|
1206
|
+
async function F$1(t) {
|
|
1197
1207
|
const e = t.target;
|
|
1198
1208
|
if (e) {
|
|
1199
1209
|
const s = e.closest(`
|
|
@@ -1203,18 +1213,18 @@ async function U$1(t) {
|
|
|
1203
1213
|
`);
|
|
1204
1214
|
if (s) {
|
|
1205
1215
|
t.preventDefault(), s.matches(`[data-${this.settings.dataToggle}]`) && s.getAttribute(`data-${this.settings.dataToggle}`)?.trim().split(" ")?.forEach((n) => {
|
|
1206
|
-
const
|
|
1207
|
-
return
|
|
1216
|
+
const o = this.getOrThrow(n);
|
|
1217
|
+
return o.trigger = s, o.toggle();
|
|
1208
1218
|
}), s.matches(`[data-${this.settings.dataOpen}]`) && s.getAttribute(`data-${this.settings.dataOpen}`)?.trim().split(" ")?.forEach((n) => {
|
|
1209
|
-
const
|
|
1210
|
-
return
|
|
1219
|
+
const o = this.getOrThrow(n);
|
|
1220
|
+
return o.trigger = s, o.open();
|
|
1211
1221
|
}), s.matches(`[data-${this.settings.dataClose}]`) && s.getAttribute(`data-${this.settings.dataClose}`)?.trim().split(" ")?.forEach((n) => {
|
|
1212
1222
|
if (n) {
|
|
1213
|
-
const
|
|
1214
|
-
return
|
|
1223
|
+
const o = this.getOrThrow(n);
|
|
1224
|
+
return o.trigger = s, o.close();
|
|
1215
1225
|
} else {
|
|
1216
|
-
const
|
|
1217
|
-
if (
|
|
1226
|
+
const o = e.closest(this.settings.selector);
|
|
1227
|
+
if (o) return this.close(o.id);
|
|
1218
1228
|
}
|
|
1219
1229
|
});
|
|
1220
1230
|
return;
|
|
@@ -1223,30 +1233,30 @@ async function U$1(t) {
|
|
|
1223
1233
|
return this.close(this.activeModal.id);
|
|
1224
1234
|
}
|
|
1225
1235
|
}
|
|
1226
|
-
function
|
|
1236
|
+
function U$1(t) {
|
|
1227
1237
|
if (t.key === "Escape" && this.activeModal)
|
|
1228
1238
|
return this.close(this.activeModal.id);
|
|
1229
1239
|
}
|
|
1230
|
-
|
|
1240
|
+
class _ extends D$2 {
|
|
1231
1241
|
#t;
|
|
1232
1242
|
#e;
|
|
1233
1243
|
constructor(e) {
|
|
1234
|
-
super({ ...
|
|
1244
|
+
super({ ...k$2, ...e }), this.module = "Drawer", this.entryClass = N, this.#t = F$1.bind(this), this.#e = U$1.bind(this);
|
|
1235
1245
|
}
|
|
1236
1246
|
get activeModal() {
|
|
1237
1247
|
return this.collection.find((e) => e.state === "opened" && e.mode === "modal");
|
|
1238
1248
|
}
|
|
1239
1249
|
async open(e, s, i) {
|
|
1240
|
-
const n =
|
|
1241
|
-
return
|
|
1250
|
+
const n = this.getOrThrow(e);
|
|
1251
|
+
return d$1(n, s, i);
|
|
1242
1252
|
}
|
|
1243
1253
|
async close(e, s, i) {
|
|
1244
|
-
const n =
|
|
1254
|
+
const n = this.getOrThrow(e);
|
|
1245
1255
|
return g(n, s, i);
|
|
1246
1256
|
}
|
|
1247
1257
|
async toggle(e, s, i) {
|
|
1248
|
-
const n =
|
|
1249
|
-
return
|
|
1258
|
+
const n = this.getOrThrow(e);
|
|
1259
|
+
return v$1(n, s, i);
|
|
1250
1260
|
}
|
|
1251
1261
|
async afterMount() {
|
|
1252
1262
|
document.addEventListener("click", this.#t, false), document.addEventListener("keydown", this.#e, false);
|
|
@@ -1254,12 +1264,12 @@ let z$2 = class z2 extends T$2 {
|
|
|
1254
1264
|
async afterUnmount() {
|
|
1255
1265
|
document.removeEventListener("click", this.#t, false), document.removeEventListener("keydown", this.#e, false);
|
|
1256
1266
|
}
|
|
1257
|
-
}
|
|
1258
|
-
function
|
|
1267
|
+
}
|
|
1268
|
+
function y2(e, t = "config") {
|
|
1259
1269
|
const s = (e.getAttribute(`data-${t}`) || "").replace(/'/g, '"');
|
|
1260
1270
|
return s ? JSON.parse(s) : {};
|
|
1261
1271
|
}
|
|
1262
|
-
function
|
|
1272
|
+
function f(e) {
|
|
1263
1273
|
if (typeof e == "string") {
|
|
1264
1274
|
const t = document.getElementById(e);
|
|
1265
1275
|
if (t) return t;
|
|
@@ -1274,15 +1284,15 @@ function p(e) {
|
|
|
1274
1284
|
async function r(e, t, ...s) {
|
|
1275
1285
|
t in e && typeof e[t] == "function" && await e[t](...s);
|
|
1276
1286
|
}
|
|
1277
|
-
function
|
|
1287
|
+
function C(e) {
|
|
1278
1288
|
return e.split("-").map(
|
|
1279
1289
|
(t, s) => s === 0 ? t : t.charAt(0).toUpperCase() + t.slice(1)
|
|
1280
1290
|
).join("");
|
|
1281
1291
|
}
|
|
1282
|
-
function
|
|
1292
|
+
function p(e) {
|
|
1283
1293
|
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1284
1294
|
}
|
|
1285
|
-
function
|
|
1295
|
+
function S(e) {
|
|
1286
1296
|
if (typeof e == "number")
|
|
1287
1297
|
return e;
|
|
1288
1298
|
const t = parseFloat(e);
|
|
@@ -1292,11 +1302,11 @@ function E$1(e) {
|
|
|
1292
1302
|
}
|
|
1293
1303
|
throw new Error(`Could not convert value to milliseconds: ${e}`);
|
|
1294
1304
|
}
|
|
1295
|
-
function
|
|
1296
|
-
return new Promise((
|
|
1305
|
+
function m(e, t, s, i, n = 0) {
|
|
1306
|
+
return new Promise((o) => {
|
|
1297
1307
|
e.classList.remove(t), e.classList.add(s), setTimeout(() => {
|
|
1298
|
-
e.classList.add(i), e.classList.remove(s),
|
|
1299
|
-
},
|
|
1308
|
+
e.classList.add(i), e.classList.remove(s), o(e);
|
|
1309
|
+
}, S(n));
|
|
1300
1310
|
});
|
|
1301
1311
|
}
|
|
1302
1312
|
async function a(e, t, s) {
|
|
@@ -1305,48 +1315,48 @@ async function a(e, t, s) {
|
|
|
1305
1315
|
await r(i, e, { plugin: i, parent: t, entry: s });
|
|
1306
1316
|
await t.emit(e, s);
|
|
1307
1317
|
}
|
|
1308
|
-
function
|
|
1318
|
+
function E$1(e) {
|
|
1309
1319
|
const t = getComputedStyle(e.el), s = {}, i = e.getSetting("customProps");
|
|
1310
1320
|
for (let n = 0; n < i.length; n++) {
|
|
1311
|
-
const
|
|
1312
|
-
|
|
1321
|
+
const o = b(), l = e.parent.module.toLowerCase(), u2 = p(i[n]), g2 = t.getPropertyValue(`--${o}${l}-${u2}`).trim();
|
|
1322
|
+
g2 && (s[u2] = g2);
|
|
1313
1323
|
}
|
|
1314
1324
|
return s;
|
|
1315
1325
|
}
|
|
1316
|
-
function
|
|
1326
|
+
function b() {
|
|
1317
1327
|
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
1318
1328
|
}
|
|
1319
|
-
function
|
|
1320
|
-
return t = s === "camel" ?
|
|
1329
|
+
function O2(e, t, s = "camel") {
|
|
1330
|
+
return t = s === "camel" ? C(t) : p(t), e.split(".").concat(t).reduce((i, n) => i?.[n], this);
|
|
1321
1331
|
}
|
|
1322
|
-
function
|
|
1332
|
+
function x(e, t = {}) {
|
|
1323
1333
|
const {
|
|
1324
1334
|
fallback: s,
|
|
1325
1335
|
props: i = ["dataConfig", "customProps", "settings", "parent.settings"]
|
|
1326
1336
|
} = t;
|
|
1327
1337
|
for (const n of i) {
|
|
1328
|
-
const
|
|
1329
|
-
if (
|
|
1330
|
-
return
|
|
1338
|
+
const o = n !== "customProps" ? "camel" : "kebab", l = O2.call(this, n, e, o);
|
|
1339
|
+
if (l !== void 0)
|
|
1340
|
+
return l;
|
|
1331
1341
|
}
|
|
1332
1342
|
if (s !== void 0)
|
|
1333
1343
|
return s;
|
|
1334
1344
|
throw new Error(`${this.parent.module} setting does not exist: ${e}`);
|
|
1335
1345
|
}
|
|
1336
|
-
function
|
|
1346
|
+
function L(e, t) {
|
|
1337
1347
|
t && document.querySelectorAll(t).forEach((s) => {
|
|
1338
1348
|
e ? s.style.overflow = "hidden" : s.style.removeProperty("overflow");
|
|
1339
1349
|
});
|
|
1340
1350
|
}
|
|
1341
|
-
function
|
|
1351
|
+
function A(e, t) {
|
|
1342
1352
|
t && document.querySelectorAll(t).forEach((s) => {
|
|
1343
|
-
|
|
1353
|
+
s.inert = e;
|
|
1344
1354
|
});
|
|
1345
1355
|
}
|
|
1346
1356
|
function $(e, t, s) {
|
|
1347
|
-
|
|
1357
|
+
A(!!e, t), L(!!e, s);
|
|
1348
1358
|
}
|
|
1349
|
-
const
|
|
1359
|
+
const P$1 = {
|
|
1350
1360
|
events: {},
|
|
1351
1361
|
on(e, t, ...s) {
|
|
1352
1362
|
this.events[e] || (this.events[e] = []), this.events[e].some(
|
|
@@ -1364,7 +1374,7 @@ const I$1 = {
|
|
|
1364
1374
|
await s(t, ...i);
|
|
1365
1375
|
}
|
|
1366
1376
|
};
|
|
1367
|
-
class
|
|
1377
|
+
let I$1 = class I extends Array {
|
|
1368
1378
|
constructor(t = {}) {
|
|
1369
1379
|
super(), this.presets = t;
|
|
1370
1380
|
}
|
|
@@ -1390,8 +1400,8 @@ class M extends Array {
|
|
|
1390
1400
|
const s = this.findIndex((i) => i.name === t);
|
|
1391
1401
|
~s && this.splice(s, 1);
|
|
1392
1402
|
}
|
|
1393
|
-
}
|
|
1394
|
-
let
|
|
1403
|
+
};
|
|
1404
|
+
let T$1 = class T extends Array {
|
|
1395
1405
|
constructor(t = {}) {
|
|
1396
1406
|
super(), this.settings = t;
|
|
1397
1407
|
}
|
|
@@ -1423,13 +1433,13 @@ let k$1 = class k extends Array {
|
|
|
1423
1433
|
~s && (this.splice(s, 1), this.add(t));
|
|
1424
1434
|
}
|
|
1425
1435
|
};
|
|
1426
|
-
const
|
|
1436
|
+
const k$1 = {
|
|
1427
1437
|
dataConfig: "config",
|
|
1428
1438
|
customProps: []
|
|
1429
1439
|
};
|
|
1430
|
-
class
|
|
1440
|
+
class w2 {
|
|
1431
1441
|
constructor(t, s, i = {}) {
|
|
1432
|
-
this.parent = t, this.el =
|
|
1442
|
+
this.parent = t, this.el = f(s), this.settings = { ...i }, this.dataConfig = {}, this.customProps = {};
|
|
1433
1443
|
}
|
|
1434
1444
|
get id() {
|
|
1435
1445
|
return this.el.id;
|
|
@@ -1438,16 +1448,16 @@ class v {
|
|
|
1438
1448
|
return Object.assign(this.settings, t);
|
|
1439
1449
|
}
|
|
1440
1450
|
getSetting(t, s) {
|
|
1441
|
-
return
|
|
1451
|
+
return x.call(this, t, s);
|
|
1442
1452
|
}
|
|
1443
1453
|
buildDataConfig() {
|
|
1444
1454
|
return Object.assign(
|
|
1445
1455
|
this.dataConfig,
|
|
1446
|
-
|
|
1456
|
+
y2(this.el, this.getSetting("dataConfig"))
|
|
1447
1457
|
);
|
|
1448
1458
|
}
|
|
1449
1459
|
buildCustomProps() {
|
|
1450
|
-
return Object.assign(this.customProps,
|
|
1460
|
+
return Object.assign(this.customProps, E$1(this));
|
|
1451
1461
|
}
|
|
1452
1462
|
async init(t = {}) {
|
|
1453
1463
|
this.applySettings(t), this.buildDataConfig(), this.buildCustomProps();
|
|
@@ -1458,13 +1468,21 @@ class v {
|
|
|
1458
1468
|
});
|
|
1459
1469
|
}
|
|
1460
1470
|
}
|
|
1461
|
-
|
|
1471
|
+
class M {
|
|
1462
1472
|
constructor(t = {}) {
|
|
1463
|
-
this.module = this.constructor.name, this.collection = [], this.entryClass =
|
|
1473
|
+
this.module = this.constructor.name, this.collection = [], this.entryClass = w2, this.settings = { ...k$1, ...t }, this.plugins = new I$1(this.settings.presets), this.events = {}, Object.assign(this, P$1);
|
|
1464
1474
|
}
|
|
1465
1475
|
get(t, s = "id") {
|
|
1466
1476
|
return this.collection.find((i) => i[s] === t);
|
|
1467
1477
|
}
|
|
1478
|
+
getOrThrow(t, s = "id") {
|
|
1479
|
+
const i = this.get(t, s);
|
|
1480
|
+
if (i)
|
|
1481
|
+
return i;
|
|
1482
|
+
throw new Error(
|
|
1483
|
+
`${this.module} entry not found in collection with ${s} of "${t}"`
|
|
1484
|
+
);
|
|
1485
|
+
}
|
|
1468
1486
|
applySettings(t) {
|
|
1469
1487
|
return Object.assign(this.settings, t);
|
|
1470
1488
|
}
|
|
@@ -1476,13 +1494,13 @@ let q$1 = class q {
|
|
|
1476
1494
|
return await a("onDestroyEntry", this, t), await r(t, "destroy"), t;
|
|
1477
1495
|
}
|
|
1478
1496
|
async register(t, s = {}) {
|
|
1479
|
-
const i =
|
|
1497
|
+
const i = f(t), n = this.collection.findIndex((o) => o.id === i.id);
|
|
1480
1498
|
if (~n) {
|
|
1481
|
-
const
|
|
1482
|
-
return
|
|
1499
|
+
const o = this.collection[n];
|
|
1500
|
+
return o.el = i, typeof o.init == "function" && await o.init(s), o;
|
|
1483
1501
|
} else {
|
|
1484
|
-
const
|
|
1485
|
-
return this.collection.push(
|
|
1502
|
+
const o = await this.createEntry(i, s);
|
|
1503
|
+
return this.collection.push(o), await a("onRegisterEntry", this, o), o;
|
|
1486
1504
|
}
|
|
1487
1505
|
}
|
|
1488
1506
|
async deregister(t) {
|
|
@@ -1519,8 +1537,8 @@ let q$1 = class q {
|
|
|
1519
1537
|
this.plugins.remove(t.name);
|
|
1520
1538
|
return this;
|
|
1521
1539
|
}
|
|
1522
|
-
}
|
|
1523
|
-
const
|
|
1540
|
+
}
|
|
1541
|
+
const D$1 = {
|
|
1524
1542
|
// Data attributes
|
|
1525
1543
|
dataOpen: "modal-open",
|
|
1526
1544
|
dataClose: "modal-close",
|
|
@@ -1545,45 +1563,45 @@ const T$1 = {
|
|
|
1545
1563
|
transition: true,
|
|
1546
1564
|
transitionDuration: 300
|
|
1547
1565
|
};
|
|
1548
|
-
function
|
|
1566
|
+
function c(e) {
|
|
1549
1567
|
e.active ? (e.active.dialog.querySelector(e.settings.selectorFocus) || e.active.dialog).focus() : e.trigger && (e.trigger.focus(), e.trigger = null);
|
|
1550
1568
|
}
|
|
1551
|
-
async function
|
|
1552
|
-
return e.parent.stack.moveToTop(e), e.state === "closed" && (e.state = "opening", e.parent.stack.add(e), t ?? e.getSetting("transition") ? await
|
|
1569
|
+
async function h(e, t, s = true) {
|
|
1570
|
+
return e.parent.stack.moveToTop(e), e.state === "closed" && (e.state = "opening", e.parent.stack.add(e), t ?? e.getSetting("transition") ? await m(
|
|
1553
1571
|
e.el,
|
|
1554
1572
|
e.getSetting("stateClosed"),
|
|
1555
1573
|
e.getSetting("stateOpening"),
|
|
1556
1574
|
e.getSetting("stateOpened"),
|
|
1557
1575
|
e.getSetting("transitionDuration")
|
|
1558
|
-
) : (e.el.classList.add(e.getSetting("stateOpened")), e.el.classList.remove(e.getSetting("stateClosed"))), e.state = "opened"), s &&
|
|
1576
|
+
) : (e.el.classList.add(e.getSetting("stateOpened")), e.el.classList.remove(e.getSetting("stateClosed"))), e.state = "opened"), s && c(e.parent), e.el.dispatchEvent(
|
|
1559
1577
|
new CustomEvent(e.getSetting("customEventPrefix") + "opened", {
|
|
1560
1578
|
detail: e.parent,
|
|
1561
1579
|
bubbles: true
|
|
1562
1580
|
})
|
|
1563
1581
|
), await e.parent.emit("opened", e), e;
|
|
1564
1582
|
}
|
|
1565
|
-
async function
|
|
1566
|
-
return e && e.state === "opened" && (e.state = "closing", document.activeElement && document.activeElement instanceof HTMLElement && document.activeElement.blur(), t ?? e.getSetting("transition") ? await
|
|
1583
|
+
async function d(e, t, s = true) {
|
|
1584
|
+
return e && e.state === "opened" && (e.state = "closing", document.activeElement && document.activeElement instanceof HTMLElement && document.activeElement.blur(), t ?? e.getSetting("transition") ? await m(
|
|
1567
1585
|
e.el,
|
|
1568
1586
|
e.getSetting("stateOpened"),
|
|
1569
1587
|
e.getSetting("stateClosing"),
|
|
1570
1588
|
e.getSetting("stateClosed"),
|
|
1571
1589
|
e.getSetting("transitionDuration")
|
|
1572
|
-
) : (e.el.classList.add(e.getSetting("stateClosed")), e.el.classList.remove(e.getSetting("stateOpened"))), e.parent.stack.remove(e), e.state = "closed", s &&
|
|
1590
|
+
) : (e.el.classList.add(e.getSetting("stateClosed")), e.el.classList.remove(e.getSetting("stateOpened"))), e.parent.stack.remove(e), e.state = "closed", s && c(e.parent), e.el.dispatchEvent(
|
|
1573
1591
|
new CustomEvent(e.getSetting("customEventPrefix") + "closed", {
|
|
1574
1592
|
detail: e.parent,
|
|
1575
1593
|
bubbles: true
|
|
1576
1594
|
})
|
|
1577
1595
|
), await e.parent.emit("closed", e)), e;
|
|
1578
1596
|
}
|
|
1579
|
-
async function
|
|
1597
|
+
async function v(e, t, s = true) {
|
|
1580
1598
|
let i, n;
|
|
1581
1599
|
return e.state === "opened" ? (i = e, n = await e.parent.closeAll(e.id, t)) : [n, i] = await Promise.all([
|
|
1582
1600
|
e.parent.closeAll("", t),
|
|
1583
|
-
|
|
1584
|
-
]), s &&
|
|
1601
|
+
h(e, t, false)
|
|
1602
|
+
]), s && c(e.parent), { opened: i, closed: n };
|
|
1585
1603
|
}
|
|
1586
|
-
let
|
|
1604
|
+
let q$1 = class q extends w2 {
|
|
1587
1605
|
constructor(t, s, i = {}) {
|
|
1588
1606
|
super(t, s, i), this.state = "closed", this.dialog = this.el.querySelector(this.getSetting("selectorDialog")) || this.el;
|
|
1589
1607
|
}
|
|
@@ -1591,13 +1609,13 @@ let R$1 = class R extends v {
|
|
|
1591
1609
|
return this.dialog.matches(this.getSetting("selectorRequired"));
|
|
1592
1610
|
}
|
|
1593
1611
|
async open(t, s) {
|
|
1594
|
-
return
|
|
1612
|
+
return h(this, t, s);
|
|
1595
1613
|
}
|
|
1596
1614
|
async close(t, s) {
|
|
1597
|
-
return
|
|
1615
|
+
return d(this, t, s);
|
|
1598
1616
|
}
|
|
1599
1617
|
async replace(t, s) {
|
|
1600
|
-
return
|
|
1618
|
+
return v(this, t, s);
|
|
1601
1619
|
}
|
|
1602
1620
|
async deregister() {
|
|
1603
1621
|
return this.parent.deregister(this.id);
|
|
@@ -1612,13 +1630,7 @@ let R$1 = class R extends v {
|
|
|
1612
1630
|
this.state === "opened" && await this.close(false);
|
|
1613
1631
|
}
|
|
1614
1632
|
};
|
|
1615
|
-
function
|
|
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
|
-
}
|
|
1621
|
-
async function j$1(e) {
|
|
1633
|
+
async function R$1(e) {
|
|
1622
1634
|
const t = e.target;
|
|
1623
1635
|
if (t) {
|
|
1624
1636
|
const s = t.closest(`
|
|
@@ -1628,11 +1640,11 @@ async function j$1(e) {
|
|
|
1628
1640
|
`);
|
|
1629
1641
|
if (s) {
|
|
1630
1642
|
if (e.preventDefault(), s.matches(`[data-${this.settings.dataOpen}]`)) {
|
|
1631
|
-
const i = s.getAttribute(`data-${this.settings.dataOpen}`)?.trim(), n =
|
|
1643
|
+
const i = s.getAttribute(`data-${this.settings.dataOpen}`)?.trim(), n = this.getOrThrow(i);
|
|
1632
1644
|
return t.closest(this.settings.selector) || (this.trigger = s), n.open();
|
|
1633
1645
|
}
|
|
1634
1646
|
if (s.matches(`[data-${this.settings.dataReplace}]`)) {
|
|
1635
|
-
const i = s.getAttribute(`data-${this.settings.dataReplace}`)?.trim(), n =
|
|
1647
|
+
const i = s.getAttribute(`data-${this.settings.dataReplace}`)?.trim(), n = this.getOrThrow(i);
|
|
1636
1648
|
return t.closest(this.settings.selector) || (this.trigger = s), n.replace();
|
|
1637
1649
|
}
|
|
1638
1650
|
if (s.matches(`[data-${this.settings.dataClose}]`)) {
|
|
@@ -1644,23 +1656,23 @@ async function j$1(e) {
|
|
|
1644
1656
|
return this.close();
|
|
1645
1657
|
}
|
|
1646
1658
|
}
|
|
1647
|
-
function
|
|
1659
|
+
function j$1(e) {
|
|
1648
1660
|
if (e.key === "Escape" && this.active && !this.active.dialog.matches(this.settings.selectorRequired))
|
|
1649
1661
|
return this.close();
|
|
1650
1662
|
}
|
|
1651
|
-
async function
|
|
1663
|
+
async function z$1(e = "", t) {
|
|
1652
1664
|
const s = [];
|
|
1653
1665
|
return await Promise.all(
|
|
1654
1666
|
this.stack.copy.map(async (i) => {
|
|
1655
|
-
e && e === i.id || s.push(await
|
|
1667
|
+
e && e === i.id || s.push(await d(i, t, false));
|
|
1656
1668
|
})
|
|
1657
1669
|
), s;
|
|
1658
1670
|
}
|
|
1659
|
-
let
|
|
1671
|
+
let H$1 = class H2 extends M {
|
|
1660
1672
|
#t;
|
|
1661
1673
|
#e;
|
|
1662
1674
|
constructor(t) {
|
|
1663
|
-
super({ ...
|
|
1675
|
+
super({ ...D$1, ...t }), this.module = "Modal", this.entryClass = q$1, this.trigger = null, this.#t = R$1.bind(this), this.#e = j$1.bind(this), this.stack = new T$1({
|
|
1664
1676
|
onChange: () => {
|
|
1665
1677
|
$(
|
|
1666
1678
|
!!this.stack.top,
|
|
@@ -1674,20 +1686,20 @@ let N$1 = class N extends q$1 {
|
|
|
1674
1686
|
return this.stack.top;
|
|
1675
1687
|
}
|
|
1676
1688
|
async open(t, s, i) {
|
|
1677
|
-
const n =
|
|
1678
|
-
return
|
|
1689
|
+
const n = this.getOrThrow(t);
|
|
1690
|
+
return h(n, s, i);
|
|
1679
1691
|
}
|
|
1680
1692
|
async close(t, s, i) {
|
|
1681
|
-
const n = t ?
|
|
1682
|
-
return
|
|
1693
|
+
const n = t ? this.getOrThrow(t) : this.active;
|
|
1694
|
+
return d(n, s, i);
|
|
1683
1695
|
}
|
|
1684
1696
|
async replace(t, s, i) {
|
|
1685
|
-
const n =
|
|
1686
|
-
return
|
|
1697
|
+
const n = this.getOrThrow(t);
|
|
1698
|
+
return v(n, s, i);
|
|
1687
1699
|
}
|
|
1688
1700
|
async closeAll(t, s, i = true) {
|
|
1689
|
-
const n = await
|
|
1690
|
-
return i &&
|
|
1701
|
+
const n = await z$1.call(this, t, s);
|
|
1702
|
+
return i && c(this), n;
|
|
1691
1703
|
}
|
|
1692
1704
|
async afterMount() {
|
|
1693
1705
|
document.addEventListener("click", this.#t, false), document.addEventListener("keydown", this.#e, false);
|
|
@@ -1715,7 +1727,7 @@ function Rt(t) {
|
|
|
1715
1727
|
} else
|
|
1716
1728
|
throw new Error("Invalid argument: query must be a string or HTMLElement");
|
|
1717
1729
|
}
|
|
1718
|
-
async function
|
|
1730
|
+
async function z2(t, e, ...n) {
|
|
1719
1731
|
e in t && typeof t[e] == "function" && await t[e](...n);
|
|
1720
1732
|
}
|
|
1721
1733
|
function Zt(t) {
|
|
@@ -1726,17 +1738,17 @@ function Zt(t) {
|
|
|
1726
1738
|
function kt(t) {
|
|
1727
1739
|
return t.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1728
1740
|
}
|
|
1729
|
-
async function
|
|
1730
|
-
await
|
|
1741
|
+
async function H3(t, e, n) {
|
|
1742
|
+
await z2(e, t, n), n && await z2(n, t);
|
|
1731
1743
|
for (const i of e.plugins)
|
|
1732
|
-
await
|
|
1744
|
+
await z2(i, t, { plugin: i, parent: e, entry: n });
|
|
1733
1745
|
await e.emit(t, n);
|
|
1734
1746
|
}
|
|
1735
1747
|
function Gt(t) {
|
|
1736
1748
|
const e = getComputedStyle(t.el), n = {}, i = t.getSetting("customProps");
|
|
1737
1749
|
for (let s = 0; s < i.length; s++) {
|
|
1738
|
-
const
|
|
1739
|
-
|
|
1750
|
+
const o = Qt(), r2 = t.parent.module.toLowerCase(), c2 = kt(i[s]), l = e.getPropertyValue(`--${o}${r2}-${c2}`).trim();
|
|
1751
|
+
l && (n[c2] = l);
|
|
1740
1752
|
}
|
|
1741
1753
|
return n;
|
|
1742
1754
|
}
|
|
@@ -1752,7 +1764,7 @@ function ee(t, e = {}) {
|
|
|
1752
1764
|
props: i = ["dataConfig", "customProps", "settings", "parent.settings"]
|
|
1753
1765
|
} = e;
|
|
1754
1766
|
for (const s of i) {
|
|
1755
|
-
const
|
|
1767
|
+
const o = s !== "customProps" ? "camel" : "kebab", r2 = te.call(this, s, t, o);
|
|
1756
1768
|
if (r2 !== void 0)
|
|
1757
1769
|
return r2;
|
|
1758
1770
|
}
|
|
@@ -1847,31 +1859,39 @@ class oe {
|
|
|
1847
1859
|
get(e, n = "id") {
|
|
1848
1860
|
return this.collection.find((i) => i[n] === e);
|
|
1849
1861
|
}
|
|
1862
|
+
getOrThrow(e, n = "id") {
|
|
1863
|
+
const i = this.get(e, n);
|
|
1864
|
+
if (i)
|
|
1865
|
+
return i;
|
|
1866
|
+
throw new Error(
|
|
1867
|
+
`${this.module} entry not found in collection with ${n} of "${e}"`
|
|
1868
|
+
);
|
|
1869
|
+
}
|
|
1850
1870
|
applySettings(e) {
|
|
1851
1871
|
return Object.assign(this.settings, e);
|
|
1852
1872
|
}
|
|
1853
1873
|
async createEntry(e, n) {
|
|
1854
1874
|
const i = new this.entryClass(this, e, n);
|
|
1855
|
-
return await
|
|
1875
|
+
return await z2(i, "init"), await H3("onCreateEntry", this, i), i;
|
|
1856
1876
|
}
|
|
1857
1877
|
async destroyEntry(e) {
|
|
1858
|
-
return await
|
|
1878
|
+
return await H3("onDestroyEntry", this, e), await z2(e, "destroy"), e;
|
|
1859
1879
|
}
|
|
1860
1880
|
async register(e, n = {}) {
|
|
1861
|
-
const i = Rt(e), s = this.collection.findIndex((
|
|
1881
|
+
const i = Rt(e), s = this.collection.findIndex((o) => o.id === i.id);
|
|
1862
1882
|
if (~s) {
|
|
1863
|
-
const
|
|
1864
|
-
return
|
|
1883
|
+
const o = this.collection[s];
|
|
1884
|
+
return o.el = i, typeof o.init == "function" && await o.init(n), o;
|
|
1865
1885
|
} else {
|
|
1866
|
-
const
|
|
1867
|
-
return this.collection.push(
|
|
1886
|
+
const o = await this.createEntry(i, n);
|
|
1887
|
+
return this.collection.push(o), await H3("onRegisterEntry", this, o), o;
|
|
1868
1888
|
}
|
|
1869
1889
|
}
|
|
1870
1890
|
async deregister(e) {
|
|
1871
1891
|
const n = this.collection.findIndex((i) => i.id === e);
|
|
1872
1892
|
if (~n) {
|
|
1873
1893
|
const i = await this.destroyEntry(this.collection[n]);
|
|
1874
|
-
return await
|
|
1894
|
+
return await H3(
|
|
1875
1895
|
"onDeregisterEntry",
|
|
1876
1896
|
this,
|
|
1877
1897
|
this.collection[n]
|
|
@@ -1884,19 +1904,19 @@ class oe {
|
|
|
1884
1904
|
for (const i of this.settings?.plugins || [])
|
|
1885
1905
|
this.plugins.add(i);
|
|
1886
1906
|
for (const i of this.plugins)
|
|
1887
|
-
await
|
|
1888
|
-
await
|
|
1907
|
+
await z2(i, "setup", { plugin: i, parent: this });
|
|
1908
|
+
await H3("beforeMount", this);
|
|
1889
1909
|
const n = document.querySelectorAll(this.settings.selector);
|
|
1890
1910
|
for (const i of n)
|
|
1891
1911
|
await this.register(i);
|
|
1892
|
-
return await
|
|
1912
|
+
return await H3("afterMount", this), this;
|
|
1893
1913
|
}
|
|
1894
1914
|
async unmount() {
|
|
1895
|
-
for (await
|
|
1915
|
+
for (await H3("beforeUnmount", this); this.collection.length > 0; )
|
|
1896
1916
|
await this.deregister(this.collection[0].id);
|
|
1897
|
-
await
|
|
1917
|
+
await H3("afterUnmount", this);
|
|
1898
1918
|
for (const e of this.plugins)
|
|
1899
|
-
await
|
|
1919
|
+
await z2(e, "teardown", { plugin: e, parent: this });
|
|
1900
1920
|
for (const e of [...this.plugins])
|
|
1901
1921
|
this.plugins.remove(e.name);
|
|
1902
1922
|
return this;
|
|
@@ -1927,7 +1947,7 @@ const re = {
|
|
|
1927
1947
|
shiftPadding: 0,
|
|
1928
1948
|
arrowPadding: 0,
|
|
1929
1949
|
toggleDelay: 0
|
|
1930
|
-
},
|
|
1950
|
+
}, Y = Math.min, j = Math.max, st = Math.round, it = Math.floor, R = (t) => ({
|
|
1931
1951
|
x: t,
|
|
1932
1952
|
y: t
|
|
1933
1953
|
}), ce = {
|
|
@@ -1939,42 +1959,42 @@ const re = {
|
|
|
1939
1959
|
start: "end",
|
|
1940
1960
|
end: "start"
|
|
1941
1961
|
};
|
|
1942
|
-
function
|
|
1943
|
-
return j(t,
|
|
1962
|
+
function gt(t, e, n) {
|
|
1963
|
+
return j(t, Y(e, n));
|
|
1944
1964
|
}
|
|
1945
1965
|
function q2(t, e) {
|
|
1946
1966
|
return typeof t == "function" ? t(e) : t;
|
|
1947
1967
|
}
|
|
1948
|
-
function
|
|
1968
|
+
function I2(t) {
|
|
1949
1969
|
return t.split("-")[0];
|
|
1950
1970
|
}
|
|
1951
1971
|
function et2(t) {
|
|
1952
1972
|
return t.split("-")[1];
|
|
1953
1973
|
}
|
|
1954
|
-
function
|
|
1974
|
+
function pt(t) {
|
|
1955
1975
|
return t === "x" ? "y" : "x";
|
|
1956
1976
|
}
|
|
1957
|
-
function
|
|
1977
|
+
function wt(t) {
|
|
1958
1978
|
return t === "y" ? "height" : "width";
|
|
1959
1979
|
}
|
|
1960
1980
|
const ae = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
1961
|
-
function
|
|
1962
|
-
return ae.has(
|
|
1981
|
+
function F(t) {
|
|
1982
|
+
return ae.has(I2(t)) ? "y" : "x";
|
|
1963
1983
|
}
|
|
1964
|
-
function
|
|
1965
|
-
return
|
|
1984
|
+
function yt(t) {
|
|
1985
|
+
return pt(F(t));
|
|
1966
1986
|
}
|
|
1967
1987
|
function fe(t, e, n) {
|
|
1968
1988
|
n === void 0 && (n = false);
|
|
1969
|
-
const i = et2(t), s =
|
|
1989
|
+
const i = et2(t), s = yt(t), o = wt(s);
|
|
1970
1990
|
let r2 = s === "x" ? i === (n ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
1971
|
-
return e.reference[
|
|
1991
|
+
return e.reference[o] > e.floating[o] && (r2 = ot(r2)), [r2, ot(r2)];
|
|
1972
1992
|
}
|
|
1973
1993
|
function ue(t) {
|
|
1974
1994
|
const e = ot(t);
|
|
1975
|
-
return [
|
|
1995
|
+
return [ht(t), e, ht(e)];
|
|
1976
1996
|
}
|
|
1977
|
-
function
|
|
1997
|
+
function ht(t) {
|
|
1978
1998
|
return t.replace(/start|end/g, (e) => le[e]);
|
|
1979
1999
|
}
|
|
1980
2000
|
const At = ["left", "right"], Et = ["right", "left"], de = ["top", "bottom"], ge = ["bottom", "top"];
|
|
@@ -1992,8 +2012,8 @@ function he(t, e, n) {
|
|
|
1992
2012
|
}
|
|
1993
2013
|
function me(t, e, n, i) {
|
|
1994
2014
|
const s = et2(t);
|
|
1995
|
-
let
|
|
1996
|
-
return s && (
|
|
2015
|
+
let o = he(I2(t), n === "start", i);
|
|
2016
|
+
return s && (o = o.map((r2) => r2 + "-" + s), e && (o = o.concat(o.map(ht)))), o;
|
|
1997
2017
|
}
|
|
1998
2018
|
function ot(t) {
|
|
1999
2019
|
return t.replace(/left|right|bottom|top/g, (e) => ce[e]);
|
|
@@ -2038,9 +2058,9 @@ function Ct(t, e, n) {
|
|
|
2038
2058
|
reference: i,
|
|
2039
2059
|
floating: s
|
|
2040
2060
|
} = t;
|
|
2041
|
-
const
|
|
2061
|
+
const o = F(e), r2 = yt(e), c2 = wt(r2), l = I2(e), a2 = o === "y", d2 = i.x + i.width / 2 - s.width / 2, u2 = i.y + i.height / 2 - s.height / 2, g2 = i[c2] / 2 - s[c2] / 2;
|
|
2042
2062
|
let f2;
|
|
2043
|
-
switch (
|
|
2063
|
+
switch (l) {
|
|
2044
2064
|
case "top":
|
|
2045
2065
|
f2 = {
|
|
2046
2066
|
x: d2,
|
|
@@ -2085,9 +2105,9 @@ const we = async (t, e, n) => {
|
|
|
2085
2105
|
const {
|
|
2086
2106
|
placement: i = "bottom",
|
|
2087
2107
|
strategy: s = "absolute",
|
|
2088
|
-
middleware:
|
|
2108
|
+
middleware: o = [],
|
|
2089
2109
|
platform: r2
|
|
2090
|
-
} = n,
|
|
2110
|
+
} = n, c2 = o.filter(Boolean), l = await (r2.isRTL == null ? void 0 : r2.isRTL(e));
|
|
2091
2111
|
let a2 = await r2.getElementRects({
|
|
2092
2112
|
reference: t,
|
|
2093
2113
|
floating: e,
|
|
@@ -2095,17 +2115,17 @@ const we = async (t, e, n) => {
|
|
|
2095
2115
|
}), {
|
|
2096
2116
|
x: d2,
|
|
2097
2117
|
y: u2
|
|
2098
|
-
} = Ct(a2, i,
|
|
2099
|
-
for (let m2 = 0; m2 <
|
|
2118
|
+
} = Ct(a2, i, l), g2 = i, f2 = {}, h2 = 0;
|
|
2119
|
+
for (let m2 = 0; m2 < c2.length; m2++) {
|
|
2100
2120
|
const {
|
|
2101
2121
|
name: p2,
|
|
2102
|
-
fn:
|
|
2103
|
-
} =
|
|
2122
|
+
fn: w3
|
|
2123
|
+
} = c2[m2], {
|
|
2104
2124
|
x: y3,
|
|
2105
2125
|
y: x2,
|
|
2106
|
-
data:
|
|
2107
|
-
reset:
|
|
2108
|
-
} = await
|
|
2126
|
+
data: v2,
|
|
2127
|
+
reset: b2
|
|
2128
|
+
} = await w3({
|
|
2109
2129
|
x: d2,
|
|
2110
2130
|
y: u2,
|
|
2111
2131
|
initialPlacement: i,
|
|
@@ -2123,16 +2143,16 @@ const we = async (t, e, n) => {
|
|
|
2123
2143
|
...f2,
|
|
2124
2144
|
[p2]: {
|
|
2125
2145
|
...f2[p2],
|
|
2126
|
-
...
|
|
2146
|
+
...v2
|
|
2127
2147
|
}
|
|
2128
|
-
},
|
|
2148
|
+
}, b2 && h2 <= 50 && (h2++, typeof b2 == "object" && (b2.placement && (g2 = b2.placement), b2.rects && (a2 = b2.rects === true ? await r2.getElementRects({
|
|
2129
2149
|
reference: t,
|
|
2130
2150
|
floating: e,
|
|
2131
2151
|
strategy: s
|
|
2132
|
-
}) :
|
|
2152
|
+
}) : b2.rects), {
|
|
2133
2153
|
x: d2,
|
|
2134
2154
|
y: u2
|
|
2135
|
-
} = Ct(a2, g2,
|
|
2155
|
+
} = Ct(a2, g2, l)), m2 = -1);
|
|
2136
2156
|
}
|
|
2137
2157
|
return {
|
|
2138
2158
|
x: d2,
|
|
@@ -2148,43 +2168,43 @@ async function $t(t, e) {
|
|
|
2148
2168
|
const {
|
|
2149
2169
|
x: i,
|
|
2150
2170
|
y: s,
|
|
2151
|
-
platform:
|
|
2171
|
+
platform: o,
|
|
2152
2172
|
rects: r2,
|
|
2153
|
-
elements:
|
|
2154
|
-
strategy:
|
|
2173
|
+
elements: c2,
|
|
2174
|
+
strategy: l
|
|
2155
2175
|
} = t, {
|
|
2156
2176
|
boundary: a2 = "clippingAncestors",
|
|
2157
2177
|
rootBoundary: d2 = "viewport",
|
|
2158
2178
|
elementContext: u2 = "floating",
|
|
2159
2179
|
altBoundary: g2 = false,
|
|
2160
2180
|
padding: f2 = 0
|
|
2161
|
-
} = q2(e, t), h2 = Mt(f2), p2 =
|
|
2162
|
-
element: (n = await (
|
|
2181
|
+
} = q2(e, t), h2 = Mt(f2), p2 = c2[g2 ? u2 === "floating" ? "reference" : "floating" : u2], w3 = rt(await o.getClippingRect({
|
|
2182
|
+
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)),
|
|
2163
2183
|
boundary: a2,
|
|
2164
2184
|
rootBoundary: d2,
|
|
2165
|
-
strategy:
|
|
2185
|
+
strategy: l
|
|
2166
2186
|
})), y3 = u2 === "floating" ? {
|
|
2167
2187
|
x: i,
|
|
2168
2188
|
y: s,
|
|
2169
2189
|
width: r2.floating.width,
|
|
2170
2190
|
height: r2.floating.height
|
|
2171
|
-
} : r2.reference, x2 = await (
|
|
2191
|
+
} : r2.reference, x2 = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c2.floating)), v2 = await (o.isElement == null ? void 0 : o.isElement(x2)) ? await (o.getScale == null ? void 0 : o.getScale(x2)) || {
|
|
2172
2192
|
x: 1,
|
|
2173
2193
|
y: 1
|
|
2174
2194
|
} : {
|
|
2175
2195
|
x: 1,
|
|
2176
2196
|
y: 1
|
|
2177
|
-
},
|
|
2178
|
-
elements:
|
|
2197
|
+
}, b2 = rt(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
2198
|
+
elements: c2,
|
|
2179
2199
|
rect: y3,
|
|
2180
2200
|
offsetParent: x2,
|
|
2181
|
-
strategy:
|
|
2201
|
+
strategy: l
|
|
2182
2202
|
}) : y3);
|
|
2183
2203
|
return {
|
|
2184
|
-
top: (
|
|
2185
|
-
bottom: (
|
|
2186
|
-
left: (
|
|
2187
|
-
right: (
|
|
2204
|
+
top: (w3.top - b2.top + h2.top) / v2.y,
|
|
2205
|
+
bottom: (b2.bottom - w3.bottom + h2.bottom) / v2.y,
|
|
2206
|
+
left: (w3.left - b2.left + h2.left) / v2.x,
|
|
2207
|
+
right: (b2.right - w3.right + h2.right) / v2.x
|
|
2188
2208
|
};
|
|
2189
2209
|
}
|
|
2190
2210
|
const ye = (t) => ({
|
|
@@ -2195,10 +2215,10 @@ const ye = (t) => ({
|
|
|
2195
2215
|
x: n,
|
|
2196
2216
|
y: i,
|
|
2197
2217
|
placement: s,
|
|
2198
|
-
rects:
|
|
2218
|
+
rects: o,
|
|
2199
2219
|
platform: r2,
|
|
2200
|
-
elements:
|
|
2201
|
-
middlewareData:
|
|
2220
|
+
elements: c2,
|
|
2221
|
+
middlewareData: l
|
|
2202
2222
|
} = e, {
|
|
2203
2223
|
element: a2,
|
|
2204
2224
|
padding: d2 = 0
|
|
@@ -2208,10 +2228,10 @@ const ye = (t) => ({
|
|
|
2208
2228
|
const u2 = Mt(d2), g2 = {
|
|
2209
2229
|
x: n,
|
|
2210
2230
|
y: i
|
|
2211
|
-
}, f2 =
|
|
2212
|
-
let
|
|
2213
|
-
(!
|
|
2214
|
-
const Z2 =
|
|
2231
|
+
}, f2 = yt(s), h2 = wt(f2), m2 = await r2.getDimensions(a2), p2 = f2 === "y", w3 = p2 ? "top" : "left", y3 = p2 ? "bottom" : "right", x2 = p2 ? "clientHeight" : "clientWidth", v2 = o.reference[h2] + o.reference[f2] - g2[f2] - o.floating[h2], b2 = g2[f2] - o.reference[f2], C2 = await (r2.getOffsetParent == null ? void 0 : r2.getOffsetParent(a2));
|
|
2232
|
+
let S2 = C2 ? C2[x2] : 0;
|
|
2233
|
+
(!S2 || !await (r2.isElement == null ? void 0 : r2.isElement(C2))) && (S2 = c2.floating[x2] || o.floating[h2]);
|
|
2234
|
+
const Z2 = v2 / 2 - b2 / 2, W2 = S2 / 2 - m2[h2] / 2 - 1, M2 = Y(u2[w3], W2), G2 = Y(u2[y3], W2), B2 = M2, Q2 = S2 - m2[h2] - G2, A2 = S2 / 2 - m2[h2] / 2 + Z2, _2 = gt(B2, A2, Q2), $2 = !l.arrow && et2(s) != null && A2 !== _2 && o.reference[h2] / 2 - (A2 < B2 ? M2 : G2) - m2[h2] / 2 < 0, L2 = $2 ? A2 < B2 ? A2 - B2 : A2 - Q2 : 0;
|
|
2215
2235
|
return {
|
|
2216
2236
|
[f2]: g2[f2] + L2,
|
|
2217
2237
|
data: {
|
|
@@ -2232,10 +2252,10 @@ const ye = (t) => ({
|
|
|
2232
2252
|
var n, i;
|
|
2233
2253
|
const {
|
|
2234
2254
|
placement: s,
|
|
2235
|
-
middlewareData:
|
|
2255
|
+
middlewareData: o,
|
|
2236
2256
|
rects: r2,
|
|
2237
|
-
initialPlacement:
|
|
2238
|
-
platform:
|
|
2257
|
+
initialPlacement: c2,
|
|
2258
|
+
platform: l,
|
|
2239
2259
|
elements: a2
|
|
2240
2260
|
} = e, {
|
|
2241
2261
|
mainAxis: d2 = true,
|
|
@@ -2246,25 +2266,25 @@ const ye = (t) => ({
|
|
|
2246
2266
|
flipAlignment: m2 = true,
|
|
2247
2267
|
...p2
|
|
2248
2268
|
} = q2(t, e);
|
|
2249
|
-
if ((n =
|
|
2269
|
+
if ((n = o.arrow) != null && n.alignmentOffset)
|
|
2250
2270
|
return {};
|
|
2251
|
-
const
|
|
2252
|
-
!g2 && C2 &&
|
|
2253
|
-
const
|
|
2254
|
-
let M2 = ((i =
|
|
2255
|
-
if (d2 &&
|
|
2256
|
-
const A2 = fe(s, r2,
|
|
2257
|
-
|
|
2271
|
+
const w3 = I2(s), y3 = F(c2), x2 = I2(c2) === c2, v2 = await (l.isRTL == null ? void 0 : l.isRTL(a2.floating)), b2 = g2 || (x2 || !m2 ? [ot(c2)] : ue(c2)), C2 = h2 !== "none";
|
|
2272
|
+
!g2 && C2 && b2.push(...me(c2, m2, h2, v2));
|
|
2273
|
+
const S2 = [c2, ...b2], Z2 = await $t(e, p2), W2 = [];
|
|
2274
|
+
let M2 = ((i = o.flip) == null ? void 0 : i.overflows) || [];
|
|
2275
|
+
if (d2 && W2.push(Z2[w3]), u2) {
|
|
2276
|
+
const A2 = fe(s, r2, v2);
|
|
2277
|
+
W2.push(Z2[A2[0]], Z2[A2[1]]);
|
|
2258
2278
|
}
|
|
2259
2279
|
if (M2 = [...M2, {
|
|
2260
2280
|
placement: s,
|
|
2261
|
-
overflows:
|
|
2262
|
-
}], !
|
|
2263
|
-
var G2,
|
|
2264
|
-
const A2 = (((G2 =
|
|
2265
|
-
if (_2 && (!(u2 === "alignment" ? y3 !==
|
|
2281
|
+
overflows: W2
|
|
2282
|
+
}], !W2.every((A2) => A2 <= 0)) {
|
|
2283
|
+
var G2, B2;
|
|
2284
|
+
const A2 = (((G2 = o.flip) == null ? void 0 : G2.index) || 0) + 1, _2 = S2[A2];
|
|
2285
|
+
if (_2 && (!(u2 === "alignment" ? y3 !== F(_2) : false) || // We leave the current main axis only if every placement on that axis
|
|
2266
2286
|
// overflows the main axis.
|
|
2267
|
-
M2.every((O3) => O3.overflows[0] > 0
|
|
2287
|
+
M2.every((O3) => F(O3.placement) === y3 ? O3.overflows[0] > 0 : true)))
|
|
2268
2288
|
return {
|
|
2269
2289
|
data: {
|
|
2270
2290
|
index: A2,
|
|
@@ -2274,25 +2294,25 @@ const ye = (t) => ({
|
|
|
2274
2294
|
placement: _2
|
|
2275
2295
|
}
|
|
2276
2296
|
};
|
|
2277
|
-
let $2 = (
|
|
2297
|
+
let $2 = (B2 = M2.filter((L2) => L2.overflows[0] <= 0).sort((L2, O3) => L2.overflows[1] - O3.overflows[1])[0]) == null ? void 0 : B2.placement;
|
|
2278
2298
|
if (!$2)
|
|
2279
2299
|
switch (f2) {
|
|
2280
2300
|
case "bestFit": {
|
|
2281
2301
|
var Q2;
|
|
2282
2302
|
const L2 = (Q2 = M2.filter((O3) => {
|
|
2283
2303
|
if (C2) {
|
|
2284
|
-
const
|
|
2285
|
-
return
|
|
2304
|
+
const N2 = F(O3.placement);
|
|
2305
|
+
return N2 === y3 || // Create a bias to the `y` side axis due to horizontal
|
|
2286
2306
|
// reading directions favoring greater width.
|
|
2287
|
-
|
|
2307
|
+
N2 === "y";
|
|
2288
2308
|
}
|
|
2289
2309
|
return true;
|
|
2290
|
-
}).map((O3) => [O3.placement, O3.overflows.filter((
|
|
2310
|
+
}).map((O3) => [O3.placement, O3.overflows.filter((N2) => N2 > 0).reduce((N2, Kt) => N2 + Kt, 0)]).sort((O3, N2) => O3[1] - N2[1])[0]) == null ? void 0 : Q2[0];
|
|
2291
2311
|
L2 && ($2 = L2);
|
|
2292
2312
|
break;
|
|
2293
2313
|
}
|
|
2294
2314
|
case "initialPlacement":
|
|
2295
|
-
$2 =
|
|
2315
|
+
$2 = c2;
|
|
2296
2316
|
break;
|
|
2297
2317
|
}
|
|
2298
2318
|
if (s !== $2)
|
|
@@ -2305,13 +2325,13 @@ const ye = (t) => ({
|
|
|
2305
2325
|
return {};
|
|
2306
2326
|
}
|
|
2307
2327
|
};
|
|
2308
|
-
},
|
|
2309
|
-
async function
|
|
2328
|
+
}, Ft = /* @__PURE__ */ new Set(["left", "top"]);
|
|
2329
|
+
async function be(t, e) {
|
|
2310
2330
|
const {
|
|
2311
2331
|
placement: n,
|
|
2312
2332
|
platform: i,
|
|
2313
2333
|
elements: s
|
|
2314
|
-
} = t,
|
|
2334
|
+
} = t, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), r2 = I2(n), c2 = et2(n), l = F(n) === "y", a2 = Ft.has(r2) ? -1 : 1, d2 = o && l ? -1 : 1, u2 = q2(e, t);
|
|
2315
2335
|
let {
|
|
2316
2336
|
mainAxis: g2,
|
|
2317
2337
|
crossAxis: f2,
|
|
@@ -2325,7 +2345,7 @@ async function ve(t, e) {
|
|
|
2325
2345
|
crossAxis: u2.crossAxis || 0,
|
|
2326
2346
|
alignmentAxis: u2.alignmentAxis
|
|
2327
2347
|
};
|
|
2328
|
-
return
|
|
2348
|
+
return c2 && typeof h2 == "number" && (f2 = c2 === "end" ? h2 * -1 : h2), l ? {
|
|
2329
2349
|
x: f2 * d2,
|
|
2330
2350
|
y: g2 * a2
|
|
2331
2351
|
} : {
|
|
@@ -2333,7 +2353,7 @@ async function ve(t, e) {
|
|
|
2333
2353
|
y: f2 * d2
|
|
2334
2354
|
};
|
|
2335
2355
|
}
|
|
2336
|
-
const
|
|
2356
|
+
const ve = function(t) {
|
|
2337
2357
|
return t === void 0 && (t = 0), {
|
|
2338
2358
|
name: "offset",
|
|
2339
2359
|
options: t,
|
|
@@ -2341,15 +2361,15 @@ const be = function(t) {
|
|
|
2341
2361
|
var n, i;
|
|
2342
2362
|
const {
|
|
2343
2363
|
x: s,
|
|
2344
|
-
y:
|
|
2364
|
+
y: o,
|
|
2345
2365
|
placement: r2,
|
|
2346
|
-
middlewareData:
|
|
2347
|
-
} = e,
|
|
2348
|
-
return r2 === ((n =
|
|
2349
|
-
x: s +
|
|
2350
|
-
y:
|
|
2366
|
+
middlewareData: c2
|
|
2367
|
+
} = e, l = await be(e, t);
|
|
2368
|
+
return r2 === ((n = c2.offset) == null ? void 0 : n.placement) && (i = c2.arrow) != null && i.alignmentOffset ? {} : {
|
|
2369
|
+
x: s + l.x,
|
|
2370
|
+
y: o + l.y,
|
|
2351
2371
|
data: {
|
|
2352
|
-
...
|
|
2372
|
+
...l,
|
|
2353
2373
|
placement: r2
|
|
2354
2374
|
}
|
|
2355
2375
|
};
|
|
@@ -2365,35 +2385,35 @@ const be = function(t) {
|
|
|
2365
2385
|
y: i,
|
|
2366
2386
|
placement: s
|
|
2367
2387
|
} = e, {
|
|
2368
|
-
mainAxis:
|
|
2388
|
+
mainAxis: o = true,
|
|
2369
2389
|
crossAxis: r2 = false,
|
|
2370
|
-
limiter:
|
|
2390
|
+
limiter: c2 = {
|
|
2371
2391
|
fn: (p2) => {
|
|
2372
2392
|
let {
|
|
2373
|
-
x:
|
|
2393
|
+
x: w3,
|
|
2374
2394
|
y: y3
|
|
2375
2395
|
} = p2;
|
|
2376
2396
|
return {
|
|
2377
|
-
x:
|
|
2397
|
+
x: w3,
|
|
2378
2398
|
y: y3
|
|
2379
2399
|
};
|
|
2380
2400
|
}
|
|
2381
2401
|
},
|
|
2382
|
-
...
|
|
2402
|
+
...l
|
|
2383
2403
|
} = q2(t, e), a2 = {
|
|
2384
2404
|
x: n,
|
|
2385
2405
|
y: i
|
|
2386
|
-
}, d2 = await $t(e,
|
|
2406
|
+
}, d2 = await $t(e, l), u2 = F(I2(s)), g2 = pt(u2);
|
|
2387
2407
|
let f2 = a2[g2], h2 = a2[u2];
|
|
2388
|
-
if (
|
|
2389
|
-
const p2 = g2 === "y" ? "top" : "left",
|
|
2390
|
-
f2 =
|
|
2408
|
+
if (o) {
|
|
2409
|
+
const p2 = g2 === "y" ? "top" : "left", w3 = g2 === "y" ? "bottom" : "right", y3 = f2 + d2[p2], x2 = f2 - d2[w3];
|
|
2410
|
+
f2 = gt(y3, f2, x2);
|
|
2391
2411
|
}
|
|
2392
2412
|
if (r2) {
|
|
2393
|
-
const p2 = u2 === "y" ? "top" : "left",
|
|
2394
|
-
h2 =
|
|
2413
|
+
const p2 = u2 === "y" ? "top" : "left", w3 = u2 === "y" ? "bottom" : "right", y3 = h2 + d2[p2], x2 = h2 - d2[w3];
|
|
2414
|
+
h2 = gt(y3, h2, x2);
|
|
2395
2415
|
}
|
|
2396
|
-
const m2 =
|
|
2416
|
+
const m2 = c2.fn({
|
|
2397
2417
|
...e,
|
|
2398
2418
|
[g2]: f2,
|
|
2399
2419
|
[u2]: h2
|
|
@@ -2404,7 +2424,7 @@ const be = function(t) {
|
|
|
2404
2424
|
x: m2.x - n,
|
|
2405
2425
|
y: m2.y - i,
|
|
2406
2426
|
enabled: {
|
|
2407
|
-
[g2]:
|
|
2427
|
+
[g2]: o,
|
|
2408
2428
|
[u2]: r2
|
|
2409
2429
|
}
|
|
2410
2430
|
}
|
|
@@ -2419,18 +2439,18 @@ const be = function(t) {
|
|
|
2419
2439
|
x: n,
|
|
2420
2440
|
y: i,
|
|
2421
2441
|
placement: s,
|
|
2422
|
-
rects:
|
|
2442
|
+
rects: o,
|
|
2423
2443
|
middlewareData: r2
|
|
2424
2444
|
} = e, {
|
|
2425
|
-
offset:
|
|
2426
|
-
mainAxis:
|
|
2445
|
+
offset: c2 = 0,
|
|
2446
|
+
mainAxis: l = true,
|
|
2427
2447
|
crossAxis: a2 = true
|
|
2428
2448
|
} = q2(t, e), d2 = {
|
|
2429
2449
|
x: n,
|
|
2430
2450
|
y: i
|
|
2431
|
-
}, u2 =
|
|
2451
|
+
}, u2 = F(s), g2 = pt(u2);
|
|
2432
2452
|
let f2 = d2[g2], h2 = d2[u2];
|
|
2433
|
-
const m2 = q2(
|
|
2453
|
+
const m2 = q2(c2, e), p2 = typeof m2 == "number" ? {
|
|
2434
2454
|
mainAxis: m2,
|
|
2435
2455
|
crossAxis: 0
|
|
2436
2456
|
} : {
|
|
@@ -2438,14 +2458,14 @@ const be = function(t) {
|
|
|
2438
2458
|
crossAxis: 0,
|
|
2439
2459
|
...m2
|
|
2440
2460
|
};
|
|
2441
|
-
if (
|
|
2442
|
-
const x2 = g2 === "y" ? "height" : "width",
|
|
2443
|
-
f2 <
|
|
2461
|
+
if (l) {
|
|
2462
|
+
const x2 = g2 === "y" ? "height" : "width", v2 = o.reference[g2] - o.floating[x2] + p2.mainAxis, b2 = o.reference[g2] + o.reference[x2] - p2.mainAxis;
|
|
2463
|
+
f2 < v2 ? f2 = v2 : f2 > b2 && (f2 = b2);
|
|
2444
2464
|
}
|
|
2445
2465
|
if (a2) {
|
|
2446
|
-
var
|
|
2447
|
-
const x2 = g2 === "y" ? "width" : "height",
|
|
2448
|
-
h2 <
|
|
2466
|
+
var w3, y3;
|
|
2467
|
+
const x2 = g2 === "y" ? "width" : "height", v2 = Ft.has(I2(s)), b2 = o.reference[u2] - o.floating[x2] + (v2 && ((w3 = r2.offset) == null ? void 0 : w3[u2]) || 0) + (v2 ? 0 : p2.crossAxis), C2 = o.reference[u2] + o.reference[x2] + (v2 ? 0 : ((y3 = r2.offset) == null ? void 0 : y3[u2]) || 0) - (v2 ? p2.crossAxis : 0);
|
|
2468
|
+
h2 < b2 ? h2 = b2 : h2 > C2 && (h2 = C2);
|
|
2449
2469
|
}
|
|
2450
2470
|
return {
|
|
2451
2471
|
[g2]: f2,
|
|
@@ -2458,23 +2478,23 @@ function ct() {
|
|
|
2458
2478
|
return typeof window < "u";
|
|
2459
2479
|
}
|
|
2460
2480
|
function J(t) {
|
|
2461
|
-
return
|
|
2481
|
+
return Nt(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
2462
2482
|
}
|
|
2463
2483
|
function E(t) {
|
|
2464
2484
|
var e;
|
|
2465
2485
|
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
2466
2486
|
}
|
|
2467
|
-
function
|
|
2487
|
+
function D2(t) {
|
|
2468
2488
|
var e;
|
|
2469
|
-
return (e = (
|
|
2489
|
+
return (e = (Nt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
2470
2490
|
}
|
|
2471
|
-
function
|
|
2491
|
+
function Nt(t) {
|
|
2472
2492
|
return ct() ? t instanceof Node || t instanceof E(t).Node : false;
|
|
2473
2493
|
}
|
|
2474
|
-
function
|
|
2494
|
+
function T2(t) {
|
|
2475
2495
|
return ct() ? t instanceof Element || t instanceof E(t).Element : false;
|
|
2476
2496
|
}
|
|
2477
|
-
function
|
|
2497
|
+
function k(t) {
|
|
2478
2498
|
return ct() ? t instanceof HTMLElement || t instanceof E(t).HTMLElement : false;
|
|
2479
2499
|
}
|
|
2480
2500
|
function St(t) {
|
|
@@ -2487,7 +2507,7 @@ function nt(t) {
|
|
|
2487
2507
|
overflowX: n,
|
|
2488
2508
|
overflowY: i,
|
|
2489
2509
|
display: s
|
|
2490
|
-
} =
|
|
2510
|
+
} = P(t);
|
|
2491
2511
|
return /auto|scroll|overlay|hidden|clip/.test(e + i + n) && !Ce.has(s);
|
|
2492
2512
|
}
|
|
2493
2513
|
const Se = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
@@ -2504,15 +2524,15 @@ function lt(t) {
|
|
|
2504
2524
|
}
|
|
2505
2525
|
});
|
|
2506
2526
|
}
|
|
2507
|
-
const
|
|
2508
|
-
function
|
|
2509
|
-
const e =
|
|
2510
|
-
return
|
|
2527
|
+
const Te = ["transform", "translate", "scale", "rotate", "perspective"], Pe = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Re = ["paint", "layout", "strict", "content"];
|
|
2528
|
+
function xt(t) {
|
|
2529
|
+
const e = bt(), n = T2(t) ? P(t) : t;
|
|
2530
|
+
return Te.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) || Pe.some((i) => (n.willChange || "").includes(i)) || Re.some((i) => (n.contain || "").includes(i));
|
|
2511
2531
|
}
|
|
2512
2532
|
function ke(t) {
|
|
2513
2533
|
let e = V(t);
|
|
2514
|
-
for (;
|
|
2515
|
-
if (
|
|
2534
|
+
for (; k(e) && !K(e); ) {
|
|
2535
|
+
if (xt(e))
|
|
2516
2536
|
return e;
|
|
2517
2537
|
if (lt(e))
|
|
2518
2538
|
return null;
|
|
@@ -2520,18 +2540,18 @@ function ke(t) {
|
|
|
2520
2540
|
}
|
|
2521
2541
|
return null;
|
|
2522
2542
|
}
|
|
2523
|
-
function
|
|
2543
|
+
function bt() {
|
|
2524
2544
|
return typeof CSS > "u" || !CSS.supports ? false : CSS.supports("-webkit-backdrop-filter", "none");
|
|
2525
2545
|
}
|
|
2526
2546
|
const De = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
2527
|
-
function
|
|
2547
|
+
function K(t) {
|
|
2528
2548
|
return De.has(J(t));
|
|
2529
2549
|
}
|
|
2530
|
-
function
|
|
2550
|
+
function P(t) {
|
|
2531
2551
|
return E(t).getComputedStyle(t);
|
|
2532
2552
|
}
|
|
2533
2553
|
function at(t) {
|
|
2534
|
-
return
|
|
2554
|
+
return T2(t) ? {
|
|
2535
2555
|
scrollLeft: t.scrollLeft,
|
|
2536
2556
|
scrollTop: t.scrollTop
|
|
2537
2557
|
} : {
|
|
@@ -2547,59 +2567,59 @@ function V(t) {
|
|
|
2547
2567
|
t.assignedSlot || // DOM Element detected.
|
|
2548
2568
|
t.parentNode || // ShadowRoot detected.
|
|
2549
2569
|
St(t) && t.host || // Fallback.
|
|
2550
|
-
|
|
2570
|
+
D2(t)
|
|
2551
2571
|
);
|
|
2552
2572
|
return St(e) ? e.host : e;
|
|
2553
2573
|
}
|
|
2554
2574
|
function Ht(t) {
|
|
2555
2575
|
const e = V(t);
|
|
2556
|
-
return
|
|
2576
|
+
return K(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : k(e) && nt(e) ? e : Ht(e);
|
|
2557
2577
|
}
|
|
2558
2578
|
function tt(t, e, n) {
|
|
2559
2579
|
var i;
|
|
2560
2580
|
e === void 0 && (e = []), n === void 0 && (n = true);
|
|
2561
|
-
const s = Ht(t),
|
|
2562
|
-
if (
|
|
2563
|
-
const
|
|
2564
|
-
return e.concat(r2, r2.visualViewport || [], nt(s) ? s : [],
|
|
2581
|
+
const s = Ht(t), o = s === ((i = t.ownerDocument) == null ? void 0 : i.body), r2 = E(s);
|
|
2582
|
+
if (o) {
|
|
2583
|
+
const c2 = mt(r2);
|
|
2584
|
+
return e.concat(r2, r2.visualViewport || [], nt(s) ? s : [], c2 && n ? tt(c2) : []);
|
|
2565
2585
|
}
|
|
2566
2586
|
return e.concat(s, tt(s, [], n));
|
|
2567
2587
|
}
|
|
2568
|
-
function
|
|
2588
|
+
function mt(t) {
|
|
2569
2589
|
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
2570
2590
|
}
|
|
2571
2591
|
function It(t) {
|
|
2572
|
-
const e =
|
|
2592
|
+
const e = P(t);
|
|
2573
2593
|
let n = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
|
|
2574
|
-
const s =
|
|
2575
|
-
return
|
|
2594
|
+
const s = k(t), o = s ? t.offsetWidth : n, r2 = s ? t.offsetHeight : i, c2 = st(n) !== o || st(i) !== r2;
|
|
2595
|
+
return c2 && (n = o, i = r2), {
|
|
2576
2596
|
width: n,
|
|
2577
2597
|
height: i,
|
|
2578
|
-
$:
|
|
2598
|
+
$: c2
|
|
2579
2599
|
};
|
|
2580
2600
|
}
|
|
2581
2601
|
function vt(t) {
|
|
2582
|
-
return
|
|
2602
|
+
return T2(t) ? t : t.contextElement;
|
|
2583
2603
|
}
|
|
2584
|
-
function
|
|
2604
|
+
function X(t) {
|
|
2585
2605
|
const e = vt(t);
|
|
2586
|
-
if (!
|
|
2587
|
-
return
|
|
2606
|
+
if (!k(e))
|
|
2607
|
+
return R(1);
|
|
2588
2608
|
const n = e.getBoundingClientRect(), {
|
|
2589
2609
|
width: i,
|
|
2590
2610
|
height: s,
|
|
2591
|
-
$:
|
|
2611
|
+
$: o
|
|
2592
2612
|
} = It(e);
|
|
2593
|
-
let r2 = (
|
|
2594
|
-
return (!r2 || !Number.isFinite(r2)) && (r2 = 1), (!
|
|
2613
|
+
let r2 = (o ? st(n.width) : n.width) / i, c2 = (o ? st(n.height) : n.height) / s;
|
|
2614
|
+
return (!r2 || !Number.isFinite(r2)) && (r2 = 1), (!c2 || !Number.isFinite(c2)) && (c2 = 1), {
|
|
2595
2615
|
x: r2,
|
|
2596
|
-
y:
|
|
2616
|
+
y: c2
|
|
2597
2617
|
};
|
|
2598
2618
|
}
|
|
2599
|
-
const Me = /* @__PURE__ */
|
|
2619
|
+
const Me = /* @__PURE__ */ R(0);
|
|
2600
2620
|
function Vt(t) {
|
|
2601
2621
|
const e = E(t);
|
|
2602
|
-
return !
|
|
2622
|
+
return !bt() || !e.visualViewport ? Me : {
|
|
2603
2623
|
x: e.visualViewport.offsetLeft,
|
|
2604
2624
|
y: e.visualViewport.offsetTop
|
|
2605
2625
|
};
|
|
@@ -2609,115 +2629,117 @@ function $e(t, e, n) {
|
|
|
2609
2629
|
}
|
|
2610
2630
|
function U2(t, e, n, i) {
|
|
2611
2631
|
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 g2 = E(
|
|
2619
|
-
let h2 = g2, m2 =
|
|
2632
|
+
const s = t.getBoundingClientRect(), o = vt(t);
|
|
2633
|
+
let r2 = R(1);
|
|
2634
|
+
e && (i ? T2(i) && (r2 = X(i)) : r2 = X(t));
|
|
2635
|
+
const c2 = $e(o, n, i) ? Vt(o) : R(0);
|
|
2636
|
+
let l = (s.left + c2.x) / r2.x, a2 = (s.top + c2.y) / r2.y, d2 = s.width / r2.x, u2 = s.height / r2.y;
|
|
2637
|
+
if (o) {
|
|
2638
|
+
const g2 = E(o), f2 = i && T2(i) ? E(i) : i;
|
|
2639
|
+
let h2 = g2, m2 = mt(h2);
|
|
2620
2640
|
for (; m2 && i && f2 !== h2; ) {
|
|
2621
|
-
const p2 =
|
|
2622
|
-
|
|
2641
|
+
const p2 = X(m2), w3 = m2.getBoundingClientRect(), y3 = P(m2), x2 = w3.left + (m2.clientLeft + parseFloat(y3.paddingLeft)) * p2.x, v2 = w3.top + (m2.clientTop + parseFloat(y3.paddingTop)) * p2.y;
|
|
2642
|
+
l *= p2.x, a2 *= p2.y, d2 *= p2.x, u2 *= p2.y, l += x2, a2 += v2, h2 = E(m2), m2 = mt(h2);
|
|
2623
2643
|
}
|
|
2624
2644
|
}
|
|
2625
2645
|
return rt({
|
|
2626
2646
|
width: d2,
|
|
2627
2647
|
height: u2,
|
|
2628
|
-
x:
|
|
2648
|
+
x: l,
|
|
2629
2649
|
y: a2
|
|
2630
2650
|
});
|
|
2631
2651
|
}
|
|
2632
|
-
function
|
|
2652
|
+
function ft(t, e) {
|
|
2633
2653
|
const n = at(t).scrollLeft;
|
|
2634
|
-
return e ? e.left + n : U2(
|
|
2654
|
+
return e ? e.left + n : U2(D2(t)).left + n;
|
|
2635
2655
|
}
|
|
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;
|
|
2656
|
+
function Wt(t, e) {
|
|
2657
|
+
const n = t.getBoundingClientRect(), i = n.left + e.scrollLeft - ft(t, n), s = n.top + e.scrollTop;
|
|
2642
2658
|
return {
|
|
2643
|
-
x:
|
|
2644
|
-
y:
|
|
2659
|
+
x: i,
|
|
2660
|
+
y: s
|
|
2645
2661
|
};
|
|
2646
2662
|
}
|
|
2647
|
-
function
|
|
2663
|
+
function Fe(t) {
|
|
2648
2664
|
let {
|
|
2649
2665
|
elements: e,
|
|
2650
2666
|
rect: n,
|
|
2651
2667
|
offsetParent: i,
|
|
2652
2668
|
strategy: s
|
|
2653
2669
|
} = t;
|
|
2654
|
-
const
|
|
2655
|
-
if (i === r2 ||
|
|
2670
|
+
const o = s === "fixed", r2 = D2(i), c2 = e ? lt(e.floating) : false;
|
|
2671
|
+
if (i === r2 || c2 && o)
|
|
2656
2672
|
return n;
|
|
2657
|
-
let
|
|
2673
|
+
let l = {
|
|
2658
2674
|
scrollLeft: 0,
|
|
2659
2675
|
scrollTop: 0
|
|
2660
|
-
}, a2 =
|
|
2661
|
-
const d2 =
|
|
2662
|
-
if ((u2 || !u2 && !
|
|
2676
|
+
}, a2 = R(1);
|
|
2677
|
+
const d2 = R(0), u2 = k(i);
|
|
2678
|
+
if ((u2 || !u2 && !o) && ((J(i) !== "body" || nt(r2)) && (l = at(i)), k(i))) {
|
|
2663
2679
|
const f2 = U2(i);
|
|
2664
|
-
a2 =
|
|
2680
|
+
a2 = X(i), d2.x = f2.x + i.clientLeft, d2.y = f2.y + i.clientTop;
|
|
2665
2681
|
}
|
|
2666
|
-
const g2 = r2 && !u2 && !
|
|
2682
|
+
const g2 = r2 && !u2 && !o ? Wt(r2, l) : R(0);
|
|
2667
2683
|
return {
|
|
2668
2684
|
width: n.width * a2.x,
|
|
2669
2685
|
height: n.height * a2.y,
|
|
2670
|
-
x: n.x * a2.x -
|
|
2671
|
-
y: n.y * a2.y -
|
|
2686
|
+
x: n.x * a2.x - l.scrollLeft * a2.x + d2.x + g2.x,
|
|
2687
|
+
y: n.y * a2.y - l.scrollTop * a2.y + d2.y + g2.y
|
|
2672
2688
|
};
|
|
2673
2689
|
}
|
|
2674
|
-
function
|
|
2690
|
+
function Ne(t) {
|
|
2675
2691
|
return Array.from(t.getClientRects());
|
|
2676
2692
|
}
|
|
2677
2693
|
function He(t) {
|
|
2678
|
-
const e =
|
|
2679
|
-
let r2 = -n.scrollLeft +
|
|
2680
|
-
const
|
|
2681
|
-
return
|
|
2694
|
+
const e = D2(t), n = at(t), i = t.ownerDocument.body, s = j(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), o = j(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
|
|
2695
|
+
let r2 = -n.scrollLeft + ft(t);
|
|
2696
|
+
const c2 = -n.scrollTop;
|
|
2697
|
+
return P(i).direction === "rtl" && (r2 += j(e.clientWidth, i.clientWidth) - s), {
|
|
2682
2698
|
width: s,
|
|
2683
|
-
height:
|
|
2699
|
+
height: o,
|
|
2684
2700
|
x: r2,
|
|
2685
|
-
y:
|
|
2701
|
+
y: c2
|
|
2686
2702
|
};
|
|
2687
2703
|
}
|
|
2704
|
+
const Lt = 25;
|
|
2688
2705
|
function Ie(t, e) {
|
|
2689
|
-
const n = E(t), i =
|
|
2690
|
-
let
|
|
2706
|
+
const n = E(t), i = D2(t), s = n.visualViewport;
|
|
2707
|
+
let o = i.clientWidth, r2 = i.clientHeight, c2 = 0, l = 0;
|
|
2691
2708
|
if (s) {
|
|
2692
|
-
|
|
2693
|
-
const
|
|
2694
|
-
(!
|
|
2695
|
-
}
|
|
2709
|
+
o = s.width, r2 = s.height;
|
|
2710
|
+
const d2 = bt();
|
|
2711
|
+
(!d2 || d2 && e === "fixed") && (c2 = s.offsetLeft, l = s.offsetTop);
|
|
2712
|
+
}
|
|
2713
|
+
const a2 = ft(i);
|
|
2714
|
+
if (a2 <= 0) {
|
|
2715
|
+
const d2 = i.ownerDocument, u2 = d2.body, g2 = getComputedStyle(u2), f2 = d2.compatMode === "CSS1Compat" && parseFloat(g2.marginLeft) + parseFloat(g2.marginRight) || 0, h2 = Math.abs(i.clientWidth - u2.clientWidth - f2);
|
|
2716
|
+
h2 <= Lt && (o -= h2);
|
|
2717
|
+
} else a2 <= Lt && (o += a2);
|
|
2696
2718
|
return {
|
|
2697
|
-
width:
|
|
2719
|
+
width: o,
|
|
2698
2720
|
height: r2,
|
|
2699
|
-
x:
|
|
2700
|
-
y:
|
|
2721
|
+
x: c2,
|
|
2722
|
+
y: l
|
|
2701
2723
|
};
|
|
2702
2724
|
}
|
|
2703
2725
|
const Ve = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
2704
|
-
function
|
|
2705
|
-
const n = U2(t, true, e === "fixed"), i = n.top + t.clientTop, s = n.left + t.clientLeft,
|
|
2726
|
+
function We(t, e) {
|
|
2727
|
+
const n = U2(t, true, e === "fixed"), i = n.top + t.clientTop, s = n.left + t.clientLeft, o = k(t) ? X(t) : R(1), r2 = t.clientWidth * o.x, c2 = t.clientHeight * o.y, l = s * o.x, a2 = i * o.y;
|
|
2706
2728
|
return {
|
|
2707
2729
|
width: r2,
|
|
2708
|
-
height:
|
|
2709
|
-
x:
|
|
2730
|
+
height: c2,
|
|
2731
|
+
x: l,
|
|
2710
2732
|
y: a2
|
|
2711
2733
|
};
|
|
2712
2734
|
}
|
|
2713
|
-
function
|
|
2735
|
+
function Ot(t, e, n) {
|
|
2714
2736
|
let i;
|
|
2715
2737
|
if (e === "viewport")
|
|
2716
2738
|
i = Ie(t, n);
|
|
2717
2739
|
else if (e === "document")
|
|
2718
|
-
i = He(
|
|
2719
|
-
else if (
|
|
2720
|
-
i =
|
|
2740
|
+
i = He(D2(t));
|
|
2741
|
+
else if (T2(e))
|
|
2742
|
+
i = We(e, n);
|
|
2721
2743
|
else {
|
|
2722
2744
|
const s = Vt(t);
|
|
2723
2745
|
i = {
|
|
@@ -2729,20 +2751,20 @@ function Lt(t, e, n) {
|
|
|
2729
2751
|
}
|
|
2730
2752
|
return rt(i);
|
|
2731
2753
|
}
|
|
2732
|
-
function
|
|
2754
|
+
function Bt(t, e) {
|
|
2733
2755
|
const n = V(t);
|
|
2734
|
-
return n === e || !
|
|
2756
|
+
return n === e || !T2(n) || K(n) ? false : P(n).position === "fixed" || Bt(n, e);
|
|
2735
2757
|
}
|
|
2736
|
-
function
|
|
2758
|
+
function Be(t, e) {
|
|
2737
2759
|
const n = e.get(t);
|
|
2738
2760
|
if (n)
|
|
2739
2761
|
return n;
|
|
2740
|
-
let i = tt(t, [], false).filter((
|
|
2741
|
-
const
|
|
2742
|
-
let r2 =
|
|
2743
|
-
for (;
|
|
2744
|
-
const
|
|
2745
|
-
!
|
|
2762
|
+
let i = tt(t, [], false).filter((c2) => T2(c2) && J(c2) !== "body"), s = null;
|
|
2763
|
+
const o = P(t).position === "fixed";
|
|
2764
|
+
let r2 = o ? V(t) : t;
|
|
2765
|
+
for (; T2(r2) && !K(r2); ) {
|
|
2766
|
+
const c2 = P(r2), l = xt(r2);
|
|
2767
|
+
!l && c2.position === "fixed" && (s = null), (o ? !l && !s : !l && c2.position === "static" && !!s && Ve.has(s.position) || nt(r2) && !l && Bt(t, r2)) ? i = i.filter((d2) => d2 !== r2) : s = c2, r2 = V(r2);
|
|
2746
2768
|
}
|
|
2747
2769
|
return e.set(t, i), i;
|
|
2748
2770
|
}
|
|
@@ -2753,15 +2775,15 @@ function _e(t) {
|
|
|
2753
2775
|
rootBoundary: i,
|
|
2754
2776
|
strategy: s
|
|
2755
2777
|
} = t;
|
|
2756
|
-
const r2 = [...n === "clippingAncestors" ? lt(e) ? [] :
|
|
2757
|
-
const u2 =
|
|
2758
|
-
return a2.top = j(u2.top, a2.top), a2.right =
|
|
2759
|
-
},
|
|
2778
|
+
const r2 = [...n === "clippingAncestors" ? lt(e) ? [] : Be(e, this._c) : [].concat(n), i], c2 = r2[0], l = r2.reduce((a2, d2) => {
|
|
2779
|
+
const u2 = Ot(e, d2, s);
|
|
2780
|
+
return a2.top = j(u2.top, a2.top), a2.right = Y(u2.right, a2.right), a2.bottom = Y(u2.bottom, a2.bottom), a2.left = j(u2.left, a2.left), a2;
|
|
2781
|
+
}, Ot(e, c2, s));
|
|
2760
2782
|
return {
|
|
2761
|
-
width:
|
|
2762
|
-
height:
|
|
2763
|
-
x:
|
|
2764
|
-
y:
|
|
2783
|
+
width: l.right - l.left,
|
|
2784
|
+
height: l.bottom - l.top,
|
|
2785
|
+
x: l.left,
|
|
2786
|
+
y: l.top
|
|
2765
2787
|
};
|
|
2766
2788
|
}
|
|
2767
2789
|
function ze(t) {
|
|
@@ -2775,22 +2797,22 @@ function ze(t) {
|
|
|
2775
2797
|
};
|
|
2776
2798
|
}
|
|
2777
2799
|
function je(t, e, n) {
|
|
2778
|
-
const i =
|
|
2779
|
-
let
|
|
2800
|
+
const i = k(e), s = D2(e), o = n === "fixed", r2 = U2(t, true, o, e);
|
|
2801
|
+
let c2 = {
|
|
2780
2802
|
scrollLeft: 0,
|
|
2781
2803
|
scrollTop: 0
|
|
2782
2804
|
};
|
|
2783
|
-
const
|
|
2805
|
+
const l = R(0);
|
|
2784
2806
|
function a2() {
|
|
2785
|
-
|
|
2807
|
+
l.x = ft(s);
|
|
2786
2808
|
}
|
|
2787
|
-
if (i || !i && !
|
|
2788
|
-
if ((J(e) !== "body" || nt(s)) && (
|
|
2789
|
-
const f2 = U2(e, true,
|
|
2790
|
-
|
|
2809
|
+
if (i || !i && !o)
|
|
2810
|
+
if ((J(e) !== "body" || nt(s)) && (c2 = at(e)), i) {
|
|
2811
|
+
const f2 = U2(e, true, o, e);
|
|
2812
|
+
l.x = f2.x + e.clientLeft, l.y = f2.y + e.clientTop;
|
|
2791
2813
|
} else s && a2();
|
|
2792
|
-
|
|
2793
|
-
const d2 = s && !i && !
|
|
2814
|
+
o && !i && s && a2();
|
|
2815
|
+
const d2 = s && !i && !o ? Wt(s, c2) : R(0), u2 = r2.left + c2.scrollLeft - l.x - d2.x, g2 = r2.top + c2.scrollTop - l.y - d2.y;
|
|
2794
2816
|
return {
|
|
2795
2817
|
x: u2,
|
|
2796
2818
|
y: g2,
|
|
@@ -2798,34 +2820,34 @@ function je(t, e, n) {
|
|
|
2798
2820
|
height: r2.height
|
|
2799
2821
|
};
|
|
2800
2822
|
}
|
|
2801
|
-
function
|
|
2802
|
-
return
|
|
2823
|
+
function ut(t) {
|
|
2824
|
+
return P(t).position === "static";
|
|
2803
2825
|
}
|
|
2804
|
-
function
|
|
2805
|
-
if (!
|
|
2826
|
+
function Tt(t, e) {
|
|
2827
|
+
if (!k(t) || P(t).position === "fixed")
|
|
2806
2828
|
return null;
|
|
2807
2829
|
if (e)
|
|
2808
2830
|
return e(t);
|
|
2809
2831
|
let n = t.offsetParent;
|
|
2810
|
-
return
|
|
2832
|
+
return D2(t) === n && (n = n.ownerDocument.body), n;
|
|
2811
2833
|
}
|
|
2812
2834
|
function _t(t, e) {
|
|
2813
2835
|
const n = E(t);
|
|
2814
2836
|
if (lt(t))
|
|
2815
2837
|
return n;
|
|
2816
|
-
if (!
|
|
2838
|
+
if (!k(t)) {
|
|
2817
2839
|
let s = V(t);
|
|
2818
|
-
for (; s && !
|
|
2819
|
-
if (
|
|
2840
|
+
for (; s && !K(s); ) {
|
|
2841
|
+
if (T2(s) && !ut(s))
|
|
2820
2842
|
return s;
|
|
2821
2843
|
s = V(s);
|
|
2822
2844
|
}
|
|
2823
2845
|
return n;
|
|
2824
2846
|
}
|
|
2825
|
-
let i =
|
|
2826
|
-
for (; i && Le(i) &&
|
|
2827
|
-
i =
|
|
2828
|
-
return i &&
|
|
2847
|
+
let i = Tt(t, e);
|
|
2848
|
+
for (; i && Le(i) && ut(i); )
|
|
2849
|
+
i = Tt(i, e);
|
|
2850
|
+
return i && K(i) && ut(i) && !xt(i) ? n : i || ke(t) || n;
|
|
2829
2851
|
}
|
|
2830
2852
|
const qe = async function(t) {
|
|
2831
2853
|
const e = this.getOffsetParent || _t, n = this.getDimensions, i = await n(t.floating);
|
|
@@ -2840,116 +2862,116 @@ const qe = async function(t) {
|
|
|
2840
2862
|
};
|
|
2841
2863
|
};
|
|
2842
2864
|
function Ue(t) {
|
|
2843
|
-
return
|
|
2865
|
+
return P(t).direction === "rtl";
|
|
2844
2866
|
}
|
|
2845
|
-
const
|
|
2846
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
2847
|
-
getDocumentElement:
|
|
2867
|
+
const Xe = {
|
|
2868
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Fe,
|
|
2869
|
+
getDocumentElement: D2,
|
|
2848
2870
|
getClippingRect: _e,
|
|
2849
2871
|
getOffsetParent: _t,
|
|
2850
2872
|
getElementRects: qe,
|
|
2851
|
-
getClientRects:
|
|
2873
|
+
getClientRects: Ne,
|
|
2852
2874
|
getDimensions: ze,
|
|
2853
|
-
getScale:
|
|
2854
|
-
isElement:
|
|
2875
|
+
getScale: X,
|
|
2876
|
+
isElement: T2,
|
|
2855
2877
|
isRTL: Ue
|
|
2856
2878
|
};
|
|
2857
2879
|
function zt(t, e) {
|
|
2858
2880
|
return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
|
|
2859
2881
|
}
|
|
2860
|
-
function
|
|
2882
|
+
function Ye(t, e) {
|
|
2861
2883
|
let n = null, i;
|
|
2862
|
-
const s =
|
|
2863
|
-
function
|
|
2864
|
-
var
|
|
2865
|
-
clearTimeout(i), (
|
|
2884
|
+
const s = D2(t);
|
|
2885
|
+
function o() {
|
|
2886
|
+
var c2;
|
|
2887
|
+
clearTimeout(i), (c2 = n) == null || c2.disconnect(), n = null;
|
|
2866
2888
|
}
|
|
2867
|
-
function r2(
|
|
2868
|
-
|
|
2889
|
+
function r2(c2, l) {
|
|
2890
|
+
c2 === void 0 && (c2 = false), l === void 0 && (l = 1), o();
|
|
2869
2891
|
const a2 = t.getBoundingClientRect(), {
|
|
2870
2892
|
left: d2,
|
|
2871
2893
|
top: u2,
|
|
2872
2894
|
width: g2,
|
|
2873
2895
|
height: f2
|
|
2874
2896
|
} = a2;
|
|
2875
|
-
if (
|
|
2897
|
+
if (c2 || e(), !g2 || !f2)
|
|
2876
2898
|
return;
|
|
2877
|
-
const h2 = it(u2), m2 = it(s.clientWidth - (d2 + g2)), p2 = it(s.clientHeight - (u2 + f2)),
|
|
2878
|
-
rootMargin: -h2 + "px " + -m2 + "px " + -p2 + "px " + -
|
|
2879
|
-
threshold: j(0,
|
|
2899
|
+
const h2 = it(u2), m2 = it(s.clientWidth - (d2 + g2)), p2 = it(s.clientHeight - (u2 + f2)), w3 = it(d2), x2 = {
|
|
2900
|
+
rootMargin: -h2 + "px " + -m2 + "px " + -p2 + "px " + -w3 + "px",
|
|
2901
|
+
threshold: j(0, Y(1, l)) || 1
|
|
2880
2902
|
};
|
|
2881
|
-
let
|
|
2882
|
-
function
|
|
2883
|
-
const
|
|
2884
|
-
if (
|
|
2885
|
-
if (!
|
|
2903
|
+
let v2 = true;
|
|
2904
|
+
function b2(C2) {
|
|
2905
|
+
const S2 = C2[0].intersectionRatio;
|
|
2906
|
+
if (S2 !== l) {
|
|
2907
|
+
if (!v2)
|
|
2886
2908
|
return r2();
|
|
2887
|
-
|
|
2909
|
+
S2 ? r2(false, S2) : i = setTimeout(() => {
|
|
2888
2910
|
r2(false, 1e-7);
|
|
2889
2911
|
}, 1e3);
|
|
2890
2912
|
}
|
|
2891
|
-
|
|
2913
|
+
S2 === 1 && !zt(a2, t.getBoundingClientRect()) && r2(), v2 = false;
|
|
2892
2914
|
}
|
|
2893
2915
|
try {
|
|
2894
|
-
n = new IntersectionObserver(
|
|
2916
|
+
n = new IntersectionObserver(b2, {
|
|
2895
2917
|
...x2,
|
|
2896
2918
|
// Handle <iframe>s
|
|
2897
2919
|
root: s.ownerDocument
|
|
2898
2920
|
});
|
|
2899
2921
|
} catch {
|
|
2900
|
-
n = new IntersectionObserver(
|
|
2922
|
+
n = new IntersectionObserver(b2, x2);
|
|
2901
2923
|
}
|
|
2902
2924
|
n.observe(t);
|
|
2903
2925
|
}
|
|
2904
|
-
return r2(true),
|
|
2926
|
+
return r2(true), o;
|
|
2905
2927
|
}
|
|
2906
|
-
function
|
|
2928
|
+
function Ke(t, e, n, i) {
|
|
2907
2929
|
i === void 0 && (i = {});
|
|
2908
2930
|
const {
|
|
2909
2931
|
ancestorScroll: s = true,
|
|
2910
|
-
ancestorResize:
|
|
2932
|
+
ancestorResize: o = true,
|
|
2911
2933
|
elementResize: r2 = typeof ResizeObserver == "function",
|
|
2912
|
-
layoutShift:
|
|
2913
|
-
animationFrame:
|
|
2914
|
-
} = i, a2 = vt(t), d2 = s ||
|
|
2915
|
-
d2.forEach((
|
|
2916
|
-
s &&
|
|
2934
|
+
layoutShift: c2 = typeof IntersectionObserver == "function",
|
|
2935
|
+
animationFrame: l = false
|
|
2936
|
+
} = i, a2 = vt(t), d2 = s || o ? [...a2 ? tt(a2) : [], ...tt(e)] : [];
|
|
2937
|
+
d2.forEach((w3) => {
|
|
2938
|
+
s && w3.addEventListener("scroll", n, {
|
|
2917
2939
|
passive: true
|
|
2918
|
-
}),
|
|
2940
|
+
}), o && w3.addEventListener("resize", n);
|
|
2919
2941
|
});
|
|
2920
|
-
const u2 = a2 &&
|
|
2942
|
+
const u2 = a2 && c2 ? Ye(a2, n) : null;
|
|
2921
2943
|
let g2 = -1, f2 = null;
|
|
2922
|
-
r2 && (f2 = new ResizeObserver((
|
|
2923
|
-
let [y3] =
|
|
2944
|
+
r2 && (f2 = new ResizeObserver((w3) => {
|
|
2945
|
+
let [y3] = w3;
|
|
2924
2946
|
y3 && y3.target === a2 && f2 && (f2.unobserve(e), cancelAnimationFrame(g2), g2 = requestAnimationFrame(() => {
|
|
2925
2947
|
var x2;
|
|
2926
2948
|
(x2 = f2) == null || x2.observe(e);
|
|
2927
2949
|
})), n();
|
|
2928
|
-
}), a2 && !
|
|
2929
|
-
let h2, m2 =
|
|
2930
|
-
|
|
2950
|
+
}), a2 && !l && f2.observe(a2), f2.observe(e));
|
|
2951
|
+
let h2, m2 = l ? U2(t) : null;
|
|
2952
|
+
l && p2();
|
|
2931
2953
|
function p2() {
|
|
2932
|
-
const
|
|
2933
|
-
m2 && !zt(m2,
|
|
2954
|
+
const w3 = U2(t);
|
|
2955
|
+
m2 && !zt(m2, w3) && n(), m2 = w3, h2 = requestAnimationFrame(p2);
|
|
2934
2956
|
}
|
|
2935
2957
|
return n(), () => {
|
|
2936
|
-
var
|
|
2958
|
+
var w3;
|
|
2937
2959
|
d2.forEach((y3) => {
|
|
2938
|
-
s && y3.removeEventListener("scroll", n),
|
|
2939
|
-
}), u2?.(), (
|
|
2960
|
+
s && y3.removeEventListener("scroll", n), o && y3.removeEventListener("resize", n);
|
|
2961
|
+
}), u2?.(), (w3 = f2) == null || w3.disconnect(), f2 = null, l && cancelAnimationFrame(h2);
|
|
2940
2962
|
};
|
|
2941
2963
|
}
|
|
2942
|
-
const Je =
|
|
2964
|
+
const Je = ve, Ze = Ae, Ge = xe, Qe = ye, tn = Ee, en = (t, e, n) => {
|
|
2943
2965
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
2944
|
-
platform:
|
|
2966
|
+
platform: Xe,
|
|
2945
2967
|
...n
|
|
2946
|
-
},
|
|
2968
|
+
}, o = {
|
|
2947
2969
|
...s.platform,
|
|
2948
2970
|
_c: i
|
|
2949
2971
|
};
|
|
2950
2972
|
return we(t, e, {
|
|
2951
2973
|
...s,
|
|
2952
|
-
platform:
|
|
2974
|
+
platform: o
|
|
2953
2975
|
});
|
|
2954
2976
|
};
|
|
2955
2977
|
function Pt(t, e, n) {
|
|
@@ -2966,7 +2988,7 @@ function jt(t, e) {
|
|
|
2966
2988
|
throw new Error(`Provided delay value is not a number: "${n}"`);
|
|
2967
2989
|
return i;
|
|
2968
2990
|
}
|
|
2969
|
-
function
|
|
2991
|
+
function dt(t) {
|
|
2970
2992
|
let e;
|
|
2971
2993
|
const n = typeof t == "string" ? t.trim().split(" ").map((i) => parseFloat(i)).filter((i) => !isNaN(i)) : [t];
|
|
2972
2994
|
for (let i = 0; i < n.length; i++)
|
|
@@ -3009,24 +3031,18 @@ function nn(t) {
|
|
|
3009
3031
|
return {
|
|
3010
3032
|
offset: Number(t.getSetting("offset")),
|
|
3011
3033
|
flip: {
|
|
3012
|
-
padding:
|
|
3034
|
+
padding: dt(t.getSetting("flip-padding"))
|
|
3013
3035
|
},
|
|
3014
3036
|
shift: {
|
|
3015
|
-
padding:
|
|
3037
|
+
padding: dt(t.getSetting("shift-padding"))
|
|
3016
3038
|
},
|
|
3017
3039
|
arrow: {
|
|
3018
3040
|
selector: t.getSetting("selectorArrow"),
|
|
3019
3041
|
element: null,
|
|
3020
|
-
padding:
|
|
3042
|
+
padding: dt(t.getSetting("arrow-padding"))
|
|
3021
3043
|
}
|
|
3022
3044
|
};
|
|
3023
3045
|
}
|
|
3024
|
-
function Tt(t) {
|
|
3025
|
-
const e = this.get(t);
|
|
3026
|
-
if (e)
|
|
3027
|
-
return e;
|
|
3028
|
-
throw new Error(`Popover not found in collection with id of "${t}".`);
|
|
3029
|
-
}
|
|
3030
3046
|
async function qt(t) {
|
|
3031
3047
|
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
3048
|
new CustomEvent(t.getSetting("customEventPrefix") + "closed", {
|
|
@@ -3041,7 +3057,7 @@ async function Ut(t) {
|
|
|
3041
3057
|
n.state === "opened" && e.push(await n.close());
|
|
3042
3058
|
return e;
|
|
3043
3059
|
}
|
|
3044
|
-
function
|
|
3060
|
+
function Xt(t) {
|
|
3045
3061
|
t.state == "opened" && setTimeout(() => (document.activeElement?.closest(
|
|
3046
3062
|
`#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`
|
|
3047
3063
|
) || t.close(), t), 1);
|
|
@@ -3066,7 +3082,7 @@ function rn(t, e) {
|
|
|
3066
3082
|
function cn(t, e) {
|
|
3067
3083
|
setTimeout(() => {
|
|
3068
3084
|
t.isHovered = e, !t.isHovered && (t.toggleDelayId && clearTimeout(t.toggleDelayId), t.toggleDelayId = setTimeout(
|
|
3069
|
-
() =>
|
|
3085
|
+
() => Xt(t),
|
|
3070
3086
|
jt(t, 1)
|
|
3071
3087
|
));
|
|
3072
3088
|
}, 1);
|
|
@@ -3078,7 +3094,7 @@ function ln(t) {
|
|
|
3078
3094
|
return;
|
|
3079
3095
|
case "Tab":
|
|
3080
3096
|
this.collection.forEach((e) => {
|
|
3081
|
-
|
|
3097
|
+
Xt(e);
|
|
3082
3098
|
});
|
|
3083
3099
|
return;
|
|
3084
3100
|
default:
|
|
@@ -3094,12 +3110,12 @@ function an(t) {
|
|
|
3094
3110
|
) ? t.el && !t.el.classList.contains(e.settings.stateActive) && this.removeEventListener("click", n) : (t.el && t.el.classList.contains(e.settings.stateActive) && t.close(), this.removeEventListener("click", n)));
|
|
3095
3111
|
});
|
|
3096
3112
|
}
|
|
3097
|
-
async function
|
|
3113
|
+
async function Yt(t) {
|
|
3098
3114
|
t.el.inert = false, t.el.classList.add(t.parent.settings.stateActive), t.isTooltip || t.trigger?.setAttribute("aria-expanded", "true"), t.buildCustomProps();
|
|
3099
3115
|
const e = nn(t), n = t.el.querySelector(
|
|
3100
3116
|
e.arrow.selector
|
|
3101
3117
|
);
|
|
3102
|
-
return e.arrow.element = n || null, t.trigger instanceof HTMLElement && (t.floatingCleanup =
|
|
3118
|
+
return e.arrow.element = n || null, t.trigger instanceof HTMLElement && (t.floatingCleanup = Ke(t.trigger, t.el, () => {
|
|
3103
3119
|
const i = [
|
|
3104
3120
|
Ge(e.flip),
|
|
3105
3121
|
Ze({ ...e.shift, limiter: tn() }),
|
|
@@ -3113,11 +3129,11 @@ async function Kt(t) {
|
|
|
3113
3129
|
), en(t.trigger, t.el, {
|
|
3114
3130
|
placement: t.getSetting("placement"),
|
|
3115
3131
|
middleware: i
|
|
3116
|
-
}).then(({ x: s, y:
|
|
3132
|
+
}).then(({ x: s, y: o, placement: r2, middlewareData: c2 }) => {
|
|
3117
3133
|
if (t.el) {
|
|
3118
|
-
if (Pt(t.el, s,
|
|
3119
|
-
const { x:
|
|
3120
|
-
Pt(e.arrow.element,
|
|
3134
|
+
if (Pt(t.el, s, o), e.arrow.element && c2.arrow) {
|
|
3135
|
+
const { x: l, y: a2 } = c2.arrow;
|
|
3136
|
+
Pt(e.arrow.element, l, a2);
|
|
3121
3137
|
}
|
|
3122
3138
|
t.el.setAttribute("data-floating-placement", r2);
|
|
3123
3139
|
}
|
|
@@ -3158,7 +3174,7 @@ class fn extends Dt {
|
|
|
3158
3174
|
}
|
|
3159
3175
|
}
|
|
3160
3176
|
async open() {
|
|
3161
|
-
return
|
|
3177
|
+
return Yt(this);
|
|
3162
3178
|
}
|
|
3163
3179
|
async close() {
|
|
3164
3180
|
return qt(this);
|
|
@@ -3236,11 +3252,11 @@ class un extends oe {
|
|
|
3236
3252
|
return this.collection.find((e) => e.state == "opened" && e.getSetting("event") == "hover");
|
|
3237
3253
|
}
|
|
3238
3254
|
async open(e) {
|
|
3239
|
-
const n =
|
|
3240
|
-
return
|
|
3255
|
+
const n = this.getOrThrow(e);
|
|
3256
|
+
return Yt(n);
|
|
3241
3257
|
}
|
|
3242
3258
|
async close(e) {
|
|
3243
|
-
const n = e ?
|
|
3259
|
+
const n = e ? this.getOrThrow(e) : void 0;
|
|
3244
3260
|
return n ? qt(n) : Ut(this);
|
|
3245
3261
|
}
|
|
3246
3262
|
async afterMount() {
|
|
@@ -3254,8 +3270,8 @@ class un extends oe {
|
|
|
3254
3270
|
}
|
|
3255
3271
|
}
|
|
3256
3272
|
export {
|
|
3257
|
-
|
|
3258
|
-
|
|
3273
|
+
_ as Drawer,
|
|
3274
|
+
H$1 as Modal,
|
|
3259
3275
|
un as Popover,
|
|
3260
3276
|
index as core
|
|
3261
3277
|
};
|