mimir-ui-kit 1.34.5 → 1.34.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{ProgressBar-C0dC7o7N.js → ProgressBar-DEFs1tWq.js} +3 -3
- package/dist/components/DatePicker/DatePicker.js +49 -49
- package/dist/components/DatePicker/DatePickerModal.js +44 -44
- package/dist/components/DatePicker/MonthPickerModal.js +29 -29
- package/dist/components/DatePicker/YearPickerModal.js +33 -33
- package/dist/components/DatePicker/constants.d.ts +1 -1
- package/dist/components/DatePicker/constants.js +1 -1
- package/dist/components/Drawer/Drawer.js +15 -15
- package/dist/components/InputPassword/InputPassword.js +28 -26
- package/dist/components/OtpInput/OtpInput.js +21 -15
- package/dist/components/SelectSearch/SelectSearch.d.ts +1 -0
- package/dist/components/SelectSearch/SelectSearch.js +531 -503
- package/dist/components/SelectSearch/types.d.ts +2 -0
- package/dist/components/Skeleton/SkeletonBrick/SkeletonBrick.js +14 -13
- package/dist/components/Skeleton/SkeletonCircle/SkeletonCircle.js +2 -1
- package/dist/components/Skeleton/SkeletonText/SkeletonText.js +26 -17
- package/dist/components/Slider/Slider.js +8 -1
- package/dist/components/Steps/Steps.js +10 -9
- package/dist/components/TextArea/TextArea.js +23 -23
- package/dist/components/Toasts/ProgressBar.js +1 -1
- package/dist/components/Toasts/Toast.js +1 -1
- package/dist/components/Toasts/ToastList.js +20 -19
- package/dist/components/Toasts/ToastsProvider.js +1 -1
- package/dist/components/UniversalUploader/UniversalUploader.d.ts +7 -2
- package/dist/components/UniversalUploader/UniversalUploader.js +65 -43
- package/dist/components/UniversalUploader/types.d.ts +2 -9
- package/dist/components/Uploader/Uploader.d.ts +13 -0
- package/dist/components/Uploader/Uploader.js +45 -39
- package/package.json +1 -1
@@ -1,17 +1,17 @@
|
|
1
|
-
import { jsx as
|
1
|
+
import { jsx as Q, jsxs as Xe, Fragment as ut } from "react/jsx-runtime";
|
2
2
|
import { c as de } from "../../index-DIxK0V-G.js";
|
3
|
-
import * as
|
4
|
-
import j, { useReducer as
|
3
|
+
import * as E from "react";
|
4
|
+
import j, { useReducer as ln, useMemo as q, useSyncExternalStore as Wn, useId as Ue, useEffect as oe, useCallback as He, useRef as Y, useLayoutEffect as an, createContext as ve, useContext as ae, useState as ue, Fragment as rt, createRef as Bn, forwardRef as jn } from "react";
|
5
5
|
import { ESelectSearchSize as Le } from "./constants.js";
|
6
|
-
import { Icon as
|
7
|
-
import { I as
|
6
|
+
import { Icon as Lt } from "../../icons/Icon.js";
|
7
|
+
import { I as Ft } from "../../Input-DGr0q5AJ.js";
|
8
8
|
import { EInputVariant as Un, EInputSize as ft } from "../Input/constants.js";
|
9
|
-
import { n as U, u as
|
9
|
+
import { n as U, u as St, d as Me, s as Ae, o as A, p as cn, t as Yn, e as ze, W as be, y as Oe, T as Kn, H as xe, M as Nt, a as Te, $ as un, b as fn, D as Ot, c as X } from "../../keyboard-B0lm_zyn.js";
|
10
10
|
import * as Ve from "react-dom";
|
11
11
|
import { flushSync as ye, createPortal as qn } from "react-dom";
|
12
12
|
import { w as Gn } from "../../use-active-press-86hajhdd.js";
|
13
13
|
import { u as Jn } from "../../use-by-comparator-CVuf9KBq.js";
|
14
|
-
import { K as Xn, a as Qn, b as Zn, T as eo, z as to, j as no, u as oo, I as
|
14
|
+
import { K as Xn, a as Qn, b as Zn, T as eo, z as to, j as no, u as oo, I as Ct, G as io } from "../../label-y3ANLTNC.js";
|
15
15
|
import { A as ro, h as so, f as lo, _ as ao } from "../../focus-management-XwV-9qkO.js";
|
16
16
|
import { T as co } from "../../use-resolve-button-type-BAxjHhds.js";
|
17
17
|
import { c as uo, i as et, u as fo, V as po, A as mo } from "../../open-closed-Cy6VDfYc.js";
|
@@ -28,10 +28,10 @@ import '../../assets/SelectSearch.css';function Fe(e, n, t) {
|
|
28
28
|
o = u;
|
29
29
|
let g;
|
30
30
|
if (t.key && ((l = t.debug) != null && l.call(t)) && (g = Date.now()), i = n(...u), t.key && ((s = t.debug) != null && s.call(t))) {
|
31
|
-
const c = Math.round((Date.now() - f) * 100) / 100, m = Math.round((Date.now() - g) * 100) / 100, p = m / 16, h = (
|
32
|
-
for (
|
33
|
-
|
34
|
-
return
|
31
|
+
const c = Math.round((Date.now() - f) * 100) / 100, m = Math.round((Date.now() - g) * 100) / 100, p = m / 16, h = (v, w) => {
|
32
|
+
for (v = String(v); v.length < w; )
|
33
|
+
v = " " + v;
|
34
|
+
return v;
|
35
35
|
};
|
36
36
|
console.info(
|
37
37
|
`%c⏱ ${h(m, 5)} /${h(c, 5)} ms`,
|
@@ -91,7 +91,7 @@ const go = (e, n) => Math.abs(e - n) < 1, vo = (e, n, t) => {
|
|
91
91
|
return r.observe(t, { box: "border-box" }), () => {
|
92
92
|
r.unobserve(t);
|
93
93
|
};
|
94
|
-
},
|
94
|
+
}, zt = {
|
95
95
|
passive: !0
|
96
96
|
}, yo = typeof window > "u" ? !0 : "onscrollend" in window, Eo = (e, n) => {
|
97
97
|
const t = e.scrollElement;
|
@@ -111,7 +111,7 @@ const go = (e, n) => Math.abs(e - n) < 1, vo = (e, n, t) => {
|
|
111
111
|
), l = (f) => () => {
|
112
112
|
i = t[e.options.horizontal ? "scrollLeft" : "scrollTop"], r(), n(i, f);
|
113
113
|
}, s = l(!0), a = l(!1);
|
114
|
-
return a(), t.addEventListener("scroll", s,
|
114
|
+
return a(), t.addEventListener("scroll", s, zt), t.addEventListener("scrollend", a, zt), () => {
|
115
115
|
t.removeEventListener("scroll", s), t.removeEventListener("scrollend", a);
|
116
116
|
};
|
117
117
|
}, Ro = (e, n, t) => {
|
@@ -266,24 +266,24 @@ class Oo {
|
|
266
266
|
for (let d = f; d < t; d++) {
|
267
267
|
let g = (a = this.measurementsCache[d]) == null ? void 0 : a.measureElement;
|
268
268
|
g || (g = (x) => {
|
269
|
-
const
|
269
|
+
const y = r(d), S = this.elementsCache.get(y);
|
270
270
|
if (!x) {
|
271
|
-
S && (this.observer.unobserve(S), this.elementsCache.delete(
|
271
|
+
S && (this.observer.unobserve(S), this.elementsCache.delete(y));
|
272
272
|
return;
|
273
273
|
}
|
274
|
-
S !== x && (S && this.observer.unobserve(S), this.observer.observe(x), this.elementsCache.set(
|
274
|
+
S !== x && (S && this.observer.unobserve(S), this.observer.observe(x), this.elementsCache.set(y, x)), x.isConnected && this.resizeItem(
|
275
275
|
d,
|
276
276
|
this.options.measureElement(x, void 0, this)
|
277
277
|
);
|
278
278
|
});
|
279
|
-
const c = r(d), m = this.options.lanes === 1 ? u[d - 1] : this.getFurthestMeasurement(u, d), p = m ? m.end + this.options.gap : o + i, h = s.get(c),
|
279
|
+
const c = r(d), m = this.options.lanes === 1 ? u[d - 1] : this.getFurthestMeasurement(u, d), p = m ? m.end + this.options.gap : o + i, h = s.get(c), v = typeof h == "number" ? h : this.options.estimateSize(d), w = p + v, b = m ? m.lane : d % this.options.lanes;
|
280
280
|
u[d] = {
|
281
281
|
index: d,
|
282
282
|
start: p,
|
283
|
-
size:
|
283
|
+
size: v,
|
284
284
|
end: w,
|
285
285
|
key: c,
|
286
|
-
lane:
|
286
|
+
lane: b,
|
287
287
|
measureElement: g
|
288
288
|
};
|
289
289
|
}
|
@@ -365,7 +365,7 @@ class Oo {
|
|
365
365
|
const o = this.getMeasurements();
|
366
366
|
if (o.length !== 0)
|
367
367
|
return dt(
|
368
|
-
o[
|
368
|
+
o[dn(
|
369
369
|
0,
|
370
370
|
o.length - 1,
|
371
371
|
(i) => dt(o[i]).start,
|
@@ -444,7 +444,7 @@ class Oo {
|
|
444
444
|
}, this.setOptions(n);
|
445
445
|
}
|
446
446
|
}
|
447
|
-
const
|
447
|
+
const dn = (e, n, t, o) => {
|
448
448
|
for (; e <= n; ) {
|
449
449
|
const i = (e + n) / 2 | 0, r = t(i);
|
450
450
|
if (r < o)
|
@@ -461,24 +461,24 @@ function Co({
|
|
461
461
|
outerSize: n,
|
462
462
|
scrollOffset: t
|
463
463
|
}) {
|
464
|
-
const o = e.length - 1, r =
|
464
|
+
const o = e.length - 1, r = dn(0, o, (s) => e[s].start, t);
|
465
465
|
let l = r;
|
466
466
|
for (; l < o && e[l].end < t + n; )
|
467
467
|
l++;
|
468
468
|
return { startIndex: r, endIndex: l };
|
469
469
|
}
|
470
|
-
const To = typeof document < "u" ?
|
470
|
+
const To = typeof document < "u" ? E.useLayoutEffect : E.useEffect;
|
471
471
|
function Io(e) {
|
472
|
-
const n =
|
472
|
+
const n = E.useReducer(() => ({}), {})[1], t = {
|
473
473
|
...e,
|
474
474
|
onChange: (i, r) => {
|
475
475
|
var l;
|
476
476
|
r ? ye(n) : n(), (l = e.onChange) == null || l.call(e, i, r);
|
477
477
|
}
|
478
|
-
}, [o] =
|
478
|
+
}, [o] = E.useState(
|
479
479
|
() => new Oo(t)
|
480
480
|
);
|
481
|
-
return o.setOptions(t),
|
481
|
+
return o.setOptions(t), E.useEffect(() => o._didMount(), []), To(() => o._willUpdate()), o;
|
482
482
|
}
|
483
483
|
function Mo(e) {
|
484
484
|
return Io({
|
@@ -493,8 +493,8 @@ function Po(e) {
|
|
493
493
|
let { width: n, height: t } = e.getBoundingClientRect();
|
494
494
|
return { width: n, height: t };
|
495
495
|
}
|
496
|
-
function
|
497
|
-
let t = e === null ? null : "current" in e ? e.current : e, [o, i] =
|
496
|
+
function kt(e, n = !1) {
|
497
|
+
let t = e === null ? null : "current" in e ? e.current : e, [o, i] = ln(() => ({}), {}), r = q(() => Po(t), [t, o]);
|
498
498
|
return U(() => {
|
499
499
|
if (!t) return;
|
500
500
|
let l = new ResizeObserver(i);
|
@@ -512,7 +512,7 @@ let Ao = class extends Map {
|
|
512
512
|
return t === void 0 && (t = this.factory(n), this.set(n, t)), t;
|
513
513
|
}
|
514
514
|
};
|
515
|
-
function
|
515
|
+
function pn(e, n) {
|
516
516
|
let t = e(), o = /* @__PURE__ */ new Set();
|
517
517
|
return { getSnapshot() {
|
518
518
|
return t;
|
@@ -523,10 +523,10 @@ function un(e, n) {
|
|
523
523
|
l && (t = l, o.forEach((s) => s()));
|
524
524
|
} };
|
525
525
|
}
|
526
|
-
function
|
527
|
-
return
|
526
|
+
function mn(e) {
|
527
|
+
return Wn(e.subscribe, e.getSnapshot, e.getSnapshot);
|
528
528
|
}
|
529
|
-
let _o = new Ao(() =>
|
529
|
+
let _o = new Ao(() => pn(() => [], { ADD(e) {
|
530
530
|
return this.includes(e) ? this : [...this, e];
|
531
531
|
}, REMOVE(e) {
|
532
532
|
let n = this.indexOf(e);
|
@@ -534,42 +534,42 @@ let _o = new Ao(() => un(() => [], { ADD(e) {
|
|
534
534
|
let t = this.slice();
|
535
535
|
return t.splice(n, 1), t;
|
536
536
|
} }));
|
537
|
-
function
|
538
|
-
let t = _o.get(n), o = Ue(), i =
|
537
|
+
function Tt(e, n) {
|
538
|
+
let t = _o.get(n), o = Ue(), i = mn(t);
|
539
539
|
if (U(() => {
|
540
540
|
if (e) return t.dispatch("ADD", o), () => t.dispatch("REMOVE", o);
|
541
541
|
}, [t, e]), !e) return !1;
|
542
542
|
let r = i.indexOf(o), l = i.length;
|
543
543
|
return r === -1 && (r = l, l += 1), r === l - 1;
|
544
544
|
}
|
545
|
-
let bt = /* @__PURE__ */ new Map(),
|
546
|
-
function
|
545
|
+
let bt = /* @__PURE__ */ new Map(), ke = /* @__PURE__ */ new Map();
|
546
|
+
function Ht(e) {
|
547
547
|
var n;
|
548
|
-
let t = (n =
|
549
|
-
return
|
548
|
+
let t = (n = ke.get(e)) != null ? n : 0;
|
549
|
+
return ke.set(e, t + 1), t !== 0 ? () => Vt(e) : (bt.set(e, { "aria-hidden": e.getAttribute("aria-hidden"), inert: e.inert }), e.setAttribute("aria-hidden", "true"), e.inert = !0, () => Vt(e));
|
550
550
|
}
|
551
|
-
function
|
551
|
+
function Vt(e) {
|
552
552
|
var n;
|
553
|
-
let t = (n =
|
554
|
-
if (t === 1 ?
|
553
|
+
let t = (n = ke.get(e)) != null ? n : 1;
|
554
|
+
if (t === 1 ? ke.delete(e) : ke.set(e, t - 1), t !== 1) return;
|
555
555
|
let o = bt.get(e);
|
556
556
|
o && (o["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", o["aria-hidden"]), e.inert = o.inert, bt.delete(e));
|
557
557
|
}
|
558
558
|
function Do(e, { allowed: n, disallowed: t } = {}) {
|
559
|
-
let o =
|
559
|
+
let o = Tt(e, "inert-others");
|
560
560
|
U(() => {
|
561
561
|
var i, r;
|
562
562
|
if (!o) return;
|
563
563
|
let l = Me();
|
564
|
-
for (let a of (i = t == null ? void 0 : t()) != null ? i : []) a && l.add(
|
564
|
+
for (let a of (i = t == null ? void 0 : t()) != null ? i : []) a && l.add(Ht(a));
|
565
565
|
let s = (r = n == null ? void 0 : n()) != null ? r : [];
|
566
566
|
for (let a of s) {
|
567
567
|
if (!a) continue;
|
568
|
-
let f =
|
568
|
+
let f = St(a);
|
569
569
|
if (!f) continue;
|
570
570
|
let u = a.parentElement;
|
571
571
|
for (; u && u !== f.body; ) {
|
572
|
-
for (let d of u.children) s.some((g) => d.contains(g)) || l.add(
|
572
|
+
for (let d of u.children) s.some((g) => d.contains(g)) || l.add(Ht(d));
|
573
573
|
u = u.parentElement;
|
574
574
|
}
|
575
575
|
}
|
@@ -581,7 +581,7 @@ function $o(e, n, t) {
|
|
581
581
|
let r = i.getBoundingClientRect();
|
582
582
|
r.x === 0 && r.y === 0 && r.width === 0 && r.height === 0 && t();
|
583
583
|
});
|
584
|
-
|
584
|
+
oe(() => {
|
585
585
|
if (!e) return;
|
586
586
|
let i = n === null ? null : n instanceof HTMLElement ? n : n.current;
|
587
587
|
if (!i) return;
|
@@ -597,18 +597,18 @@ function $o(e, n, t) {
|
|
597
597
|
return () => r.dispose();
|
598
598
|
}, [n, o, e]);
|
599
599
|
}
|
600
|
-
function
|
600
|
+
function hn() {
|
601
601
|
return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0;
|
602
602
|
}
|
603
603
|
function Lo() {
|
604
604
|
return /Android/gi.test(window.navigator.userAgent);
|
605
605
|
}
|
606
|
-
function
|
607
|
-
return
|
606
|
+
function gn() {
|
607
|
+
return hn() || Lo();
|
608
608
|
}
|
609
609
|
function Ne(e, n, t, o) {
|
610
610
|
let i = Ae(t);
|
611
|
-
|
611
|
+
oe(() => {
|
612
612
|
if (!e) return;
|
613
613
|
function r(l) {
|
614
614
|
i.current(l);
|
@@ -618,7 +618,7 @@ function Ne(e, n, t, o) {
|
|
618
618
|
}
|
619
619
|
function Fo(e, n, t, o) {
|
620
620
|
let i = Ae(t);
|
621
|
-
|
621
|
+
oe(() => {
|
622
622
|
if (!e) return;
|
623
623
|
function r(l) {
|
624
624
|
i.current(l);
|
@@ -626,9 +626,9 @@ function Fo(e, n, t, o) {
|
|
626
626
|
return window.addEventListener(n, r, o), () => window.removeEventListener(n, r, o);
|
627
627
|
}, [e, n, o]);
|
628
628
|
}
|
629
|
-
const
|
629
|
+
const Wt = 30;
|
630
630
|
function No(e, n, t) {
|
631
|
-
let o =
|
631
|
+
let o = Tt(e, "outside-click"), i = Ae(t), r = He(function(a, f) {
|
632
632
|
if (a.defaultPrevented) return;
|
633
633
|
let u = f(a);
|
634
634
|
if (u === null || !u.getRootNode().contains(u) || !u.isConnected) return;
|
@@ -649,22 +649,22 @@ function No(e, n, t) {
|
|
649
649
|
var f, u;
|
650
650
|
l.current = ((u = (f = a.composedPath) == null ? void 0 : f.call(a)) == null ? void 0 : u[0]) || a.target;
|
651
651
|
}, !0), Ne(o, "click", (a) => {
|
652
|
-
|
652
|
+
gn() || l.current && (r(a, () => l.current), l.current = null);
|
653
653
|
}, !0);
|
654
654
|
let s = Y({ x: 0, y: 0 });
|
655
655
|
Ne(o, "touchstart", (a) => {
|
656
656
|
s.current.x = a.touches[0].clientX, s.current.y = a.touches[0].clientY;
|
657
657
|
}, !0), Ne(o, "touchend", (a) => {
|
658
658
|
let f = { x: a.changedTouches[0].clientX, y: a.changedTouches[0].clientY };
|
659
|
-
if (!(Math.abs(f.x - s.current.x) >=
|
659
|
+
if (!(Math.abs(f.x - s.current.x) >= Wt || Math.abs(f.y - s.current.y) >= Wt)) return r(a, () => a.target instanceof HTMLElement ? a.target : null);
|
660
660
|
}, !0), Fo(o, "blur", (a) => r(a, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
|
661
661
|
}
|
662
662
|
function st(...e) {
|
663
|
-
return q(() =>
|
663
|
+
return q(() => St(...e), [...e]);
|
664
664
|
}
|
665
|
-
function
|
665
|
+
function zo(e, n, t, o) {
|
666
666
|
let i = Ae(t);
|
667
|
-
|
667
|
+
oe(() => {
|
668
668
|
e = e ?? window;
|
669
669
|
function r(l) {
|
670
670
|
i.current(l);
|
@@ -672,9 +672,9 @@ function ko(e, n, t, o) {
|
|
672
672
|
return e.addEventListener(n, r, o), () => e.removeEventListener(n, r, o);
|
673
673
|
}, [e, n, o]);
|
674
674
|
}
|
675
|
-
function
|
675
|
+
function vn(e) {
|
676
676
|
let n = Y({ value: "", selectionStart: null, selectionEnd: null });
|
677
|
-
return
|
677
|
+
return zo(e.current, "blur", (t) => {
|
678
678
|
let o = t.target;
|
679
679
|
o instanceof HTMLInputElement && (n.current = { value: o.value, selectionStart: o.selectionStart, selectionEnd: o.selectionEnd });
|
680
680
|
}), A(() => {
|
@@ -689,7 +689,7 @@ function mn(e) {
|
|
689
689
|
}
|
690
690
|
});
|
691
691
|
}
|
692
|
-
function
|
692
|
+
function ko() {
|
693
693
|
let e;
|
694
694
|
return { before({ doc: n }) {
|
695
695
|
var t;
|
@@ -701,7 +701,7 @@ function zo() {
|
|
701
701
|
} };
|
702
702
|
}
|
703
703
|
function Ho() {
|
704
|
-
return
|
704
|
+
return hn() ? { before({ doc: e, d: n, meta: t }) {
|
705
705
|
function o(i) {
|
706
706
|
return t.containers.flatMap((r) => r()).some((r) => r.contains(i));
|
707
707
|
}
|
@@ -753,7 +753,7 @@ function Wo(e) {
|
|
753
753
|
for (let t of e) Object.assign(n, t(n));
|
754
754
|
return n;
|
755
755
|
}
|
756
|
-
let Ee =
|
756
|
+
let Ee = pn(() => /* @__PURE__ */ new Map(), { PUSH(e, n) {
|
757
757
|
var t;
|
758
758
|
let o = (t = this.get(e)) != null ? t : { doc: e, count: 0, d: Me(), meta: /* @__PURE__ */ new Set() };
|
759
759
|
return o.count++, o.meta.add(n), this.set(e, o), this;
|
@@ -761,7 +761,7 @@ let Ee = un(() => /* @__PURE__ */ new Map(), { PUSH(e, n) {
|
|
761
761
|
let t = this.get(e);
|
762
762
|
return t && (t.count--, t.meta.delete(n)), this;
|
763
763
|
}, SCROLL_PREVENT({ doc: e, d: n, meta: t }) {
|
764
|
-
let o = { doc: e, d: n, meta: Wo(t) }, i = [Ho(),
|
764
|
+
let o = { doc: e, d: n, meta: Wo(t) }, i = [Ho(), ko(), Vo()];
|
765
765
|
i.forEach(({ before: r }) => r == null ? void 0 : r(o)), i.forEach(({ after: r }) => r == null ? void 0 : r(o));
|
766
766
|
}, SCROLL_ALLOW({ d: e }) {
|
767
767
|
e.dispose();
|
@@ -777,45 +777,45 @@ Ee.subscribe(() => {
|
|
777
777
|
}
|
778
778
|
});
|
779
779
|
function Bo(e, n, t = () => ({ containers: [] })) {
|
780
|
-
let o =
|
780
|
+
let o = mn(Ee), i = n ? o.get(n) : void 0, r = i ? i.count > 0 : !1;
|
781
781
|
return U(() => {
|
782
782
|
if (!(!n || !e)) return Ee.dispatch("PUSH", n, t), () => Ee.dispatch("POP", n, t);
|
783
783
|
}, [e, n]), r;
|
784
784
|
}
|
785
785
|
function jo(e, n, t = () => [document.body]) {
|
786
|
-
let o =
|
786
|
+
let o = Tt(e, "scroll-lock");
|
787
787
|
Bo(o, n, (i) => {
|
788
788
|
var r;
|
789
789
|
return { containers: [...(r = i.containers) != null ? r : [], t] };
|
790
790
|
});
|
791
791
|
}
|
792
|
-
function
|
792
|
+
function Bt(e) {
|
793
793
|
return [e.screenX, e.screenY];
|
794
794
|
}
|
795
795
|
function Uo() {
|
796
796
|
let e = Y([-1, -1]);
|
797
797
|
return { wasMoved(n) {
|
798
|
-
let t =
|
798
|
+
let t = Bt(n);
|
799
799
|
return e.current[0] === t[0] && e.current[1] === t[1] ? !1 : (e.current = t, !0);
|
800
800
|
}, update(n) {
|
801
|
-
e.current =
|
801
|
+
e.current = Bt(n);
|
802
802
|
} };
|
803
803
|
}
|
804
804
|
function Yo(e, { container: n, accept: t, walk: o }) {
|
805
805
|
let i = Y(t), r = Y(o);
|
806
|
-
|
806
|
+
oe(() => {
|
807
807
|
i.current = t, r.current = o;
|
808
808
|
}, [t, o]), U(() => {
|
809
809
|
if (!n || !e) return;
|
810
|
-
let l =
|
810
|
+
let l = St(n);
|
811
811
|
if (!l) return;
|
812
812
|
let s = i.current, a = r.current, f = Object.assign((d) => s(d), { acceptNode: s }), u = l.createTreeWalker(n, NodeFilter.SHOW_ELEMENT, f, !1);
|
813
813
|
for (; u.nextNode(); ) a(u.currentNode);
|
814
814
|
}, [n, e, i, r]);
|
815
815
|
}
|
816
|
-
function
|
816
|
+
function jt(e, n) {
|
817
817
|
let t = Y([]), o = A(e);
|
818
|
-
|
818
|
+
oe(() => {
|
819
819
|
let i = [...t.current];
|
820
820
|
for (let [r, l] of n.entries()) if (t.current[r] !== l) {
|
821
821
|
let s = o(n, i);
|
@@ -824,27 +824,27 @@ function Vt(e, n) {
|
|
824
824
|
}, [o, ...n]);
|
825
825
|
}
|
826
826
|
function _e(e) {
|
827
|
-
return
|
827
|
+
return bn(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
828
828
|
}
|
829
|
-
function
|
829
|
+
function ee(e) {
|
830
830
|
var n;
|
831
831
|
return (e == null || (n = e.ownerDocument) == null ? void 0 : n.defaultView) || window;
|
832
832
|
}
|
833
833
|
function fe(e) {
|
834
834
|
var n;
|
835
|
-
return (n = (
|
835
|
+
return (n = (bn(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : n.documentElement;
|
836
836
|
}
|
837
|
-
function
|
838
|
-
return e instanceof Node || e instanceof
|
837
|
+
function bn(e) {
|
838
|
+
return e instanceof Node || e instanceof ee(e).Node;
|
839
839
|
}
|
840
840
|
function G(e) {
|
841
|
-
return e instanceof Element || e instanceof
|
841
|
+
return e instanceof Element || e instanceof ee(e).Element;
|
842
842
|
}
|
843
843
|
function ce(e) {
|
844
|
-
return e instanceof HTMLElement || e instanceof
|
844
|
+
return e instanceof HTMLElement || e instanceof ee(e).HTMLElement;
|
845
845
|
}
|
846
|
-
function
|
847
|
-
return typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof
|
846
|
+
function Ut(e) {
|
847
|
+
return typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof ee(e).ShadowRoot;
|
848
848
|
}
|
849
849
|
function Ye(e) {
|
850
850
|
const {
|
@@ -867,8 +867,8 @@ function lt(e) {
|
|
867
867
|
}
|
868
868
|
});
|
869
869
|
}
|
870
|
-
function
|
871
|
-
const n =
|
870
|
+
function It(e) {
|
871
|
+
const n = Mt(), t = re(e);
|
872
872
|
return t.transform !== "none" || t.perspective !== "none" || (t.containerType ? t.containerType !== "normal" : !1) || !n && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !n && (t.filter ? t.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((o) => (t.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (t.contain || "").includes(o));
|
873
873
|
}
|
874
874
|
function qo(e) {
|
@@ -876,20 +876,20 @@ function qo(e) {
|
|
876
876
|
for (; ce(n) && !Pe(n); ) {
|
877
877
|
if (lt(n))
|
878
878
|
return null;
|
879
|
-
if (
|
879
|
+
if (It(n))
|
880
880
|
return n;
|
881
881
|
n = me(n);
|
882
882
|
}
|
883
883
|
return null;
|
884
884
|
}
|
885
|
-
function
|
885
|
+
function Mt() {
|
886
886
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
887
887
|
}
|
888
888
|
function Pe(e) {
|
889
889
|
return ["html", "body", "#document"].includes(_e(e));
|
890
890
|
}
|
891
891
|
function re(e) {
|
892
|
-
return
|
892
|
+
return ee(e).getComputedStyle(e);
|
893
893
|
}
|
894
894
|
function at(e) {
|
895
895
|
return G(e) ? {
|
@@ -907,19 +907,19 @@ function me(e) {
|
|
907
907
|
// Step into the shadow DOM of the parent of a slotted node.
|
908
908
|
e.assignedSlot || // DOM Element detected.
|
909
909
|
e.parentNode || // ShadowRoot detected.
|
910
|
-
|
910
|
+
Ut(e) && e.host || // Fallback.
|
911
911
|
fe(e)
|
912
912
|
);
|
913
|
-
return
|
913
|
+
return Ut(n) ? n.host : n;
|
914
914
|
}
|
915
|
-
function
|
915
|
+
function xn(e) {
|
916
916
|
const n = me(e);
|
917
|
-
return Pe(n) ? e.ownerDocument ? e.ownerDocument.body : e.body : ce(n) && Ye(n) ? n :
|
917
|
+
return Pe(n) ? e.ownerDocument ? e.ownerDocument.body : e.body : ce(n) && Ye(n) ? n : xn(n);
|
918
918
|
}
|
919
919
|
function We(e, n, t) {
|
920
920
|
var o;
|
921
921
|
n === void 0 && (n = []), t === void 0 && (t = !0);
|
922
|
-
const i =
|
922
|
+
const i = xn(e), r = i === ((o = e.ownerDocument) == null ? void 0 : o.body), l = ee(i);
|
923
923
|
return r ? n.concat(l, l.visualViewport || [], Ye(i) ? i : [], l.frameElement && t ? We(l.frameElement) : []) : n.concat(i, We(i, [], t));
|
924
924
|
}
|
925
925
|
function Go() {
|
@@ -932,7 +932,7 @@ function Go() {
|
|
932
932
|
return t + "/" + o;
|
933
933
|
}).join(" ") : navigator.userAgent;
|
934
934
|
}
|
935
|
-
const pe = Math.min,
|
935
|
+
const pe = Math.min, Z = Math.max, tt = Math.round, Qe = Math.floor, he = (e) => ({
|
936
936
|
x: e,
|
937
937
|
y: e
|
938
938
|
}), Jo = {
|
@@ -944,8 +944,8 @@ const pe = Math.min, Q = Math.max, tt = Math.round, Qe = Math.floor, he = (e) =>
|
|
944
944
|
start: "end",
|
945
945
|
end: "start"
|
946
946
|
};
|
947
|
-
function
|
948
|
-
return
|
947
|
+
function Yt(e, n, t) {
|
948
|
+
return Z(e, pe(n, t));
|
949
949
|
}
|
950
950
|
function De(e, n) {
|
951
951
|
return typeof e == "function" ? e(n) : e;
|
@@ -956,21 +956,21 @@ function ge(e) {
|
|
956
956
|
function Ke(e) {
|
957
957
|
return e.split("-")[1];
|
958
958
|
}
|
959
|
-
function
|
959
|
+
function wn(e) {
|
960
960
|
return e === "x" ? "y" : "x";
|
961
961
|
}
|
962
|
-
function
|
962
|
+
function yn(e) {
|
963
963
|
return e === "y" ? "height" : "width";
|
964
964
|
}
|
965
965
|
function Re(e) {
|
966
966
|
return ["top", "bottom"].includes(ge(e)) ? "y" : "x";
|
967
967
|
}
|
968
|
-
function
|
969
|
-
return
|
968
|
+
function En(e) {
|
969
|
+
return wn(Re(e));
|
970
970
|
}
|
971
971
|
function Qo(e, n, t) {
|
972
972
|
t === void 0 && (t = !1);
|
973
|
-
const o = Ke(e), i =
|
973
|
+
const o = Ke(e), i = En(e), r = yn(i);
|
974
974
|
let l = i === "x" ? o === (t ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
|
975
975
|
return n.reference[r] > n.floating[r] && (l = nt(l)), [l, nt(l)];
|
976
976
|
}
|
@@ -1037,12 +1037,12 @@ function ot(e) {
|
|
1037
1037
|
y: t
|
1038
1038
|
};
|
1039
1039
|
}
|
1040
|
-
function
|
1040
|
+
function Kt(e, n, t) {
|
1041
1041
|
let {
|
1042
1042
|
reference: o,
|
1043
1043
|
floating: i
|
1044
1044
|
} = e;
|
1045
|
-
const r = Re(n), l =
|
1045
|
+
const r = Re(n), l = En(n), s = yn(l), a = ge(n), f = r === "y", u = o.x + o.width / 2 - i.width / 2, d = o.y + o.height / 2 - i.height / 2, g = o[s] / 2 - i[s] / 2;
|
1046
1046
|
let c;
|
1047
1047
|
switch (a) {
|
1048
1048
|
case "top":
|
@@ -1099,17 +1099,17 @@ const ii = async (e, n, t) => {
|
|
1099
1099
|
}), {
|
1100
1100
|
x: u,
|
1101
1101
|
y: d
|
1102
|
-
} =
|
1102
|
+
} = Kt(f, o, a), g = o, c = {}, m = 0;
|
1103
1103
|
for (let p = 0; p < s.length; p++) {
|
1104
1104
|
const {
|
1105
1105
|
name: h,
|
1106
|
-
fn:
|
1106
|
+
fn: v
|
1107
1107
|
} = s[p], {
|
1108
1108
|
x: w,
|
1109
|
-
y:
|
1109
|
+
y: b,
|
1110
1110
|
data: x,
|
1111
|
-
reset:
|
1112
|
-
} = await
|
1111
|
+
reset: y
|
1112
|
+
} = await v({
|
1113
1113
|
x: u,
|
1114
1114
|
y: d,
|
1115
1115
|
initialPlacement: o,
|
@@ -1123,20 +1123,20 @@ const ii = async (e, n, t) => {
|
|
1123
1123
|
floating: n
|
1124
1124
|
}
|
1125
1125
|
});
|
1126
|
-
u = w ?? u, d =
|
1126
|
+
u = w ?? u, d = b ?? d, c = {
|
1127
1127
|
...c,
|
1128
1128
|
[h]: {
|
1129
1129
|
...c[h],
|
1130
1130
|
...x
|
1131
1131
|
}
|
1132
|
-
},
|
1132
|
+
}, y && m <= 50 && (m++, typeof y == "object" && (y.placement && (g = y.placement), y.rects && (f = y.rects === !0 ? await l.getElementRects({
|
1133
1133
|
reference: e,
|
1134
1134
|
floating: n,
|
1135
1135
|
strategy: i
|
1136
|
-
}) :
|
1136
|
+
}) : y.rects), {
|
1137
1137
|
x: u,
|
1138
1138
|
y: d
|
1139
|
-
} =
|
1139
|
+
} = Kt(f, g, a)), p = -1);
|
1140
1140
|
}
|
1141
1141
|
return {
|
1142
1142
|
x: u,
|
@@ -1162,7 +1162,7 @@ async function ct(e, n) {
|
|
1162
1162
|
elementContext: d = "floating",
|
1163
1163
|
altBoundary: g = !1,
|
1164
1164
|
padding: c = 0
|
1165
|
-
} = De(n, e), m = oi(c), h = s[g ? d === "floating" ? "reference" : "floating" : d],
|
1165
|
+
} = De(n, e), m = oi(c), h = s[g ? d === "floating" ? "reference" : "floating" : d], v = ot(await r.getClippingRect({
|
1166
1166
|
element: (t = await (r.isElement == null ? void 0 : r.isElement(h))) == null || t ? h : h.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(s.floating)),
|
1167
1167
|
boundary: f,
|
1168
1168
|
rootBoundary: u,
|
@@ -1172,23 +1172,23 @@ async function ct(e, n) {
|
|
1172
1172
|
y: i,
|
1173
1173
|
width: l.floating.width,
|
1174
1174
|
height: l.floating.height
|
1175
|
-
} : l.reference,
|
1175
|
+
} : l.reference, b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(s.floating)), x = await (r.isElement == null ? void 0 : r.isElement(b)) ? await (r.getScale == null ? void 0 : r.getScale(b)) || {
|
1176
1176
|
x: 1,
|
1177
1177
|
y: 1
|
1178
1178
|
} : {
|
1179
1179
|
x: 1,
|
1180
1180
|
y: 1
|
1181
|
-
},
|
1181
|
+
}, y = ot(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
1182
1182
|
elements: s,
|
1183
1183
|
rect: w,
|
1184
|
-
offsetParent:
|
1184
|
+
offsetParent: b,
|
1185
1185
|
strategy: a
|
1186
1186
|
}) : w);
|
1187
1187
|
return {
|
1188
|
-
top: (
|
1189
|
-
bottom: (
|
1190
|
-
left: (
|
1191
|
-
right: (
|
1188
|
+
top: (v.top - y.top + m.top) / x.y,
|
1189
|
+
bottom: (y.bottom - v.bottom + m.bottom) / x.y,
|
1190
|
+
left: (v.left - y.left + m.left) / x.x,
|
1191
|
+
right: (y.right - v.right + m.right) / x.x
|
1192
1192
|
};
|
1193
1193
|
}
|
1194
1194
|
const ri = function(e) {
|
@@ -1215,44 +1215,44 @@ const ri = function(e) {
|
|
1215
1215
|
} = De(e, n);
|
1216
1216
|
if ((t = r.arrow) != null && t.alignmentOffset)
|
1217
1217
|
return {};
|
1218
|
-
const
|
1219
|
-
!g && S &&
|
1220
|
-
const O = [s, ...
|
1221
|
-
let
|
1222
|
-
if (u &&
|
1223
|
-
const
|
1224
|
-
|
1218
|
+
const v = ge(i), w = Re(s), b = ge(s) === s, x = await (a.isRTL == null ? void 0 : a.isRTL(f.floating)), y = g || (b || !p ? [nt(s)] : Zo(s)), S = m !== "none";
|
1219
|
+
!g && S && y.push(...ti(s, p, m, x));
|
1220
|
+
const O = [s, ...y], D = await ct(n, h), N = [];
|
1221
|
+
let M = ((o = r.flip) == null ? void 0 : o.overflows) || [];
|
1222
|
+
if (u && N.push(D[v]), d) {
|
1223
|
+
const P = Qo(i, l, x);
|
1224
|
+
N.push(D[P[0]], D[P[1]]);
|
1225
1225
|
}
|
1226
|
-
if (
|
1226
|
+
if (M = [...M, {
|
1227
1227
|
placement: i,
|
1228
|
-
overflows:
|
1229
|
-
}], !
|
1230
|
-
var
|
1231
|
-
const
|
1228
|
+
overflows: N
|
1229
|
+
}], !N.every((P) => P <= 0)) {
|
1230
|
+
var T, $;
|
1231
|
+
const P = (((T = r.flip) == null ? void 0 : T.index) || 0) + 1, L = O[P];
|
1232
1232
|
if (L)
|
1233
1233
|
return {
|
1234
1234
|
data: {
|
1235
|
-
index:
|
1236
|
-
overflows:
|
1235
|
+
index: P,
|
1236
|
+
overflows: M
|
1237
1237
|
},
|
1238
1238
|
reset: {
|
1239
1239
|
placement: L
|
1240
1240
|
}
|
1241
1241
|
};
|
1242
|
-
let V = (
|
1242
|
+
let V = ($ = M.filter((R) => R.overflows[0] <= 0).sort((R, k) => R.overflows[1] - k.overflows[1])[0]) == null ? void 0 : $.placement;
|
1243
1243
|
if (!V)
|
1244
1244
|
switch (c) {
|
1245
1245
|
case "bestFit": {
|
1246
|
-
var
|
1247
|
-
const R = (
|
1246
|
+
var z;
|
1247
|
+
const R = (z = M.filter((k) => {
|
1248
1248
|
if (S) {
|
1249
|
-
const
|
1250
|
-
return
|
1249
|
+
const I = Re(k.placement);
|
1250
|
+
return I === w || // Create a bias to the `y` side axis due to horizontal
|
1251
1251
|
// reading directions favoring greater width.
|
1252
|
-
|
1252
|
+
I === "y";
|
1253
1253
|
}
|
1254
1254
|
return !0;
|
1255
|
-
}).map((k) => [k.placement, k.overflows.filter((
|
1255
|
+
}).map((k) => [k.placement, k.overflows.filter((I) => I > 0).reduce((I, te) => I + te, 0)]).sort((k, I) => k[1] - I[1])[0]) == null ? void 0 : z[0];
|
1256
1256
|
R && (V = R);
|
1257
1257
|
break;
|
1258
1258
|
}
|
@@ -1336,11 +1336,11 @@ const li = function(e) {
|
|
1336
1336
|
limiter: s = {
|
1337
1337
|
fn: (h) => {
|
1338
1338
|
let {
|
1339
|
-
x:
|
1339
|
+
x: v,
|
1340
1340
|
y: w
|
1341
1341
|
} = h;
|
1342
1342
|
return {
|
1343
|
-
x:
|
1343
|
+
x: v,
|
1344
1344
|
y: w
|
1345
1345
|
};
|
1346
1346
|
}
|
@@ -1349,15 +1349,15 @@ const li = function(e) {
|
|
1349
1349
|
} = De(e, n), f = {
|
1350
1350
|
x: t,
|
1351
1351
|
y: o
|
1352
|
-
}, u = await ct(n, a), d = Re(ge(i)), g =
|
1352
|
+
}, u = await ct(n, a), d = Re(ge(i)), g = wn(d);
|
1353
1353
|
let c = f[g], m = f[d];
|
1354
1354
|
if (r) {
|
1355
|
-
const h = g === "y" ? "top" : "left",
|
1356
|
-
c =
|
1355
|
+
const h = g === "y" ? "top" : "left", v = g === "y" ? "bottom" : "right", w = c + u[h], b = c - u[v];
|
1356
|
+
c = Yt(w, c, b);
|
1357
1357
|
}
|
1358
1358
|
if (l) {
|
1359
|
-
const h = d === "y" ? "top" : "left",
|
1360
|
-
m =
|
1359
|
+
const h = d === "y" ? "top" : "left", v = d === "y" ? "bottom" : "right", w = m + u[h], b = m - u[v];
|
1360
|
+
m = Yt(w, m, b);
|
1361
1361
|
}
|
1362
1362
|
const p = s.fn({
|
1363
1363
|
...n,
|
@@ -1393,16 +1393,16 @@ const li = function(e) {
|
|
1393
1393
|
} = o.floating;
|
1394
1394
|
let m, p;
|
1395
1395
|
f === "top" || f === "bottom" ? (m = f, p = u === (await (i.isRTL == null ? void 0 : i.isRTL(r.floating)) ? "start" : "end") ? "left" : "right") : (p = f, m = u === "end" ? "top" : "bottom");
|
1396
|
-
const h = c - a.top - a.bottom,
|
1397
|
-
let
|
1398
|
-
if (d ? S = u || x ? pe(
|
1399
|
-
const
|
1400
|
-
d ? S = g - 2 * (
|
1396
|
+
const h = c - a.top - a.bottom, v = g - a.left - a.right, w = pe(c - a[m], h), b = pe(g - a[p], v), x = !n.middlewareData.shift;
|
1397
|
+
let y = w, S = b;
|
1398
|
+
if (d ? S = u || x ? pe(b, v) : v : y = u || x ? pe(w, h) : h, x && !u) {
|
1399
|
+
const D = Z(a.left, 0), N = Z(a.right, 0), M = Z(a.top, 0), T = Z(a.bottom, 0);
|
1400
|
+
d ? S = g - 2 * (D !== 0 || N !== 0 ? D + N : Z(a.left, a.right)) : y = c - 2 * (M !== 0 || T !== 0 ? M + T : Z(a.top, a.bottom));
|
1401
1401
|
}
|
1402
1402
|
await l({
|
1403
1403
|
...n,
|
1404
1404
|
availableWidth: S,
|
1405
|
-
availableHeight:
|
1405
|
+
availableHeight: y
|
1406
1406
|
});
|
1407
1407
|
const O = await i.getDimensions(r.floating);
|
1408
1408
|
return g !== O.width || c !== O.height ? {
|
@@ -1413,7 +1413,7 @@ const li = function(e) {
|
|
1413
1413
|
}
|
1414
1414
|
};
|
1415
1415
|
};
|
1416
|
-
function
|
1416
|
+
function Rn(e) {
|
1417
1417
|
const n = re(e);
|
1418
1418
|
let t = parseFloat(n.width) || 0, o = parseFloat(n.height) || 0;
|
1419
1419
|
const i = ce(e), r = i ? e.offsetWidth : t, l = i ? e.offsetHeight : o, s = tt(t) !== r || tt(o) !== l;
|
@@ -1423,18 +1423,18 @@ function wn(e) {
|
|
1423
1423
|
$: s
|
1424
1424
|
};
|
1425
1425
|
}
|
1426
|
-
function
|
1426
|
+
function Pt(e) {
|
1427
1427
|
return G(e) ? e : e.contextElement;
|
1428
1428
|
}
|
1429
1429
|
function Ie(e) {
|
1430
|
-
const n =
|
1430
|
+
const n = Pt(e);
|
1431
1431
|
if (!ce(n))
|
1432
1432
|
return he(1);
|
1433
1433
|
const t = n.getBoundingClientRect(), {
|
1434
1434
|
width: o,
|
1435
1435
|
height: i,
|
1436
1436
|
$: r
|
1437
|
-
} =
|
1437
|
+
} = Rn(n);
|
1438
1438
|
let l = (r ? tt(t.width) : t.width) / o, s = (r ? tt(t.height) : t.height) / i;
|
1439
1439
|
return (!l || !Number.isFinite(l)) && (l = 1), (!s || !Number.isFinite(s)) && (s = 1), {
|
1440
1440
|
x: l,
|
@@ -1442,29 +1442,29 @@ function Ie(e) {
|
|
1442
1442
|
};
|
1443
1443
|
}
|
1444
1444
|
const ui = /* @__PURE__ */ he(0);
|
1445
|
-
function
|
1446
|
-
const n =
|
1447
|
-
return !
|
1445
|
+
function Sn(e) {
|
1446
|
+
const n = ee(e);
|
1447
|
+
return !Mt() || !n.visualViewport ? ui : {
|
1448
1448
|
x: n.visualViewport.offsetLeft,
|
1449
1449
|
y: n.visualViewport.offsetTop
|
1450
1450
|
};
|
1451
1451
|
}
|
1452
1452
|
function fi(e, n, t) {
|
1453
|
-
return n === void 0 && (n = !1), !t || n && t !==
|
1453
|
+
return n === void 0 && (n = !1), !t || n && t !== ee(e) ? !1 : n;
|
1454
1454
|
}
|
1455
1455
|
function Se(e, n, t, o) {
|
1456
1456
|
n === void 0 && (n = !1), t === void 0 && (t = !1);
|
1457
|
-
const i = e.getBoundingClientRect(), r =
|
1457
|
+
const i = e.getBoundingClientRect(), r = Pt(e);
|
1458
1458
|
let l = he(1);
|
1459
1459
|
n && (o ? G(o) && (l = Ie(o)) : l = Ie(e));
|
1460
|
-
const s = fi(r, t, o) ?
|
1460
|
+
const s = fi(r, t, o) ? Sn(r) : he(0);
|
1461
1461
|
let a = (i.left + s.x) / l.x, f = (i.top + s.y) / l.y, u = i.width / l.x, d = i.height / l.y;
|
1462
1462
|
if (r) {
|
1463
|
-
const g =
|
1463
|
+
const g = ee(r), c = o && G(o) ? ee(o) : o;
|
1464
1464
|
let m = g, p = m.frameElement;
|
1465
1465
|
for (; p && o && c !== m; ) {
|
1466
|
-
const h = Ie(p),
|
1467
|
-
a *= h.x, f *= h.y, u *= h.x, d *= h.y, a +=
|
1466
|
+
const h = Ie(p), v = p.getBoundingClientRect(), w = re(p), b = v.left + (p.clientLeft + parseFloat(w.paddingLeft)) * h.x, x = v.top + (p.clientTop + parseFloat(w.paddingTop)) * h.y;
|
1467
|
+
a *= h.x, f *= h.y, u *= h.x, d *= h.y, a += b, f += x, m = ee(p), p = m.frameElement;
|
1468
1468
|
}
|
1469
1469
|
}
|
1470
1470
|
return ot({
|
@@ -1503,14 +1503,14 @@ function di(e) {
|
|
1503
1503
|
function pi(e) {
|
1504
1504
|
return Array.from(e.getClientRects());
|
1505
1505
|
}
|
1506
|
-
function
|
1506
|
+
function On(e) {
|
1507
1507
|
return Se(fe(e)).left + at(e).scrollLeft;
|
1508
1508
|
}
|
1509
1509
|
function mi(e) {
|
1510
|
-
const n = fe(e), t = at(e), o = e.ownerDocument.body, i =
|
1511
|
-
let l = -t.scrollLeft +
|
1510
|
+
const n = fe(e), t = at(e), o = e.ownerDocument.body, i = Z(n.scrollWidth, n.clientWidth, o.scrollWidth, o.clientWidth), r = Z(n.scrollHeight, n.clientHeight, o.scrollHeight, o.clientHeight);
|
1511
|
+
let l = -t.scrollLeft + On(e);
|
1512
1512
|
const s = -t.scrollTop;
|
1513
|
-
return re(o).direction === "rtl" && (l +=
|
1513
|
+
return re(o).direction === "rtl" && (l += Z(n.clientWidth, o.clientWidth) - i), {
|
1514
1514
|
width: i,
|
1515
1515
|
height: r,
|
1516
1516
|
x: l,
|
@@ -1518,11 +1518,11 @@ function mi(e) {
|
|
1518
1518
|
};
|
1519
1519
|
}
|
1520
1520
|
function hi(e, n) {
|
1521
|
-
const t =
|
1521
|
+
const t = ee(e), o = fe(e), i = t.visualViewport;
|
1522
1522
|
let r = o.clientWidth, l = o.clientHeight, s = 0, a = 0;
|
1523
1523
|
if (i) {
|
1524
1524
|
r = i.width, l = i.height;
|
1525
|
-
const f =
|
1525
|
+
const f = Mt();
|
1526
1526
|
(!f || f && n === "fixed") && (s = i.offsetLeft, a = i.offsetTop);
|
1527
1527
|
}
|
1528
1528
|
return {
|
@@ -1541,7 +1541,7 @@ function gi(e, n) {
|
|
1541
1541
|
y: f
|
1542
1542
|
};
|
1543
1543
|
}
|
1544
|
-
function
|
1544
|
+
function qt(e, n, t) {
|
1545
1545
|
let o;
|
1546
1546
|
if (n === "viewport")
|
1547
1547
|
o = hi(e, t);
|
@@ -1550,7 +1550,7 @@ function Ut(e, n, t) {
|
|
1550
1550
|
else if (G(n))
|
1551
1551
|
o = gi(n, t);
|
1552
1552
|
else {
|
1553
|
-
const i =
|
1553
|
+
const i = Sn(e);
|
1554
1554
|
o = {
|
1555
1555
|
...n,
|
1556
1556
|
x: n.x - i.x,
|
@@ -1559,9 +1559,9 @@ function Ut(e, n, t) {
|
|
1559
1559
|
}
|
1560
1560
|
return ot(o);
|
1561
1561
|
}
|
1562
|
-
function
|
1562
|
+
function Cn(e, n) {
|
1563
1563
|
const t = me(e);
|
1564
|
-
return t === n || !G(t) || Pe(t) ? !1 : re(t).position === "fixed" ||
|
1564
|
+
return t === n || !G(t) || Pe(t) ? !1 : re(t).position === "fixed" || Cn(t, n);
|
1565
1565
|
}
|
1566
1566
|
function vi(e, n) {
|
1567
1567
|
const t = n.get(e);
|
@@ -1571,8 +1571,8 @@ function vi(e, n) {
|
|
1571
1571
|
const r = re(e).position === "fixed";
|
1572
1572
|
let l = r ? me(e) : e;
|
1573
1573
|
for (; G(l) && !Pe(l); ) {
|
1574
|
-
const s = re(l), a =
|
1575
|
-
!a && s.position === "fixed" && (i = null), (r ? !a && !i : !a && s.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || Ye(l) && !a &&
|
1574
|
+
const s = re(l), a = It(l);
|
1575
|
+
!a && s.position === "fixed" && (i = null), (r ? !a && !i : !a && s.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || Ye(l) && !a && Cn(e, l)) ? o = o.filter((u) => u !== l) : i = s, l = me(l);
|
1576
1576
|
}
|
1577
1577
|
return n.set(e, o), o;
|
1578
1578
|
}
|
@@ -1584,9 +1584,9 @@ function bi(e) {
|
|
1584
1584
|
strategy: i
|
1585
1585
|
} = e;
|
1586
1586
|
const l = [...t === "clippingAncestors" ? lt(n) ? [] : vi(n, this._c) : [].concat(t), o], s = l[0], a = l.reduce((f, u) => {
|
1587
|
-
const d =
|
1588
|
-
return f.top =
|
1589
|
-
},
|
1587
|
+
const d = qt(n, u, i);
|
1588
|
+
return f.top = Z(d.top, f.top), f.right = pe(d.right, f.right), f.bottom = pe(d.bottom, f.bottom), f.left = Z(d.left, f.left), f;
|
1589
|
+
}, qt(n, s, i));
|
1590
1590
|
return {
|
1591
1591
|
width: a.right - a.left,
|
1592
1592
|
height: a.bottom - a.top,
|
@@ -1598,7 +1598,7 @@ function xi(e) {
|
|
1598
1598
|
const {
|
1599
1599
|
width: n,
|
1600
1600
|
height: t
|
1601
|
-
} =
|
1601
|
+
} = Rn(e);
|
1602
1602
|
return {
|
1603
1603
|
width: n,
|
1604
1604
|
height: t
|
@@ -1615,7 +1615,7 @@ function wi(e, n, t) {
|
|
1615
1615
|
if ((_e(n) !== "body" || Ye(i)) && (s = at(n)), o) {
|
1616
1616
|
const d = Se(n, !0, r, n);
|
1617
1617
|
a.x = d.x + n.clientLeft, a.y = d.y + n.clientTop;
|
1618
|
-
} else i && (a.x =
|
1618
|
+
} else i && (a.x = On(i));
|
1619
1619
|
const f = l.left + s.scrollLeft - a.x, u = l.top + s.scrollTop - a.y;
|
1620
1620
|
return {
|
1621
1621
|
x: f,
|
@@ -1627,11 +1627,11 @@ function wi(e, n, t) {
|
|
1627
1627
|
function pt(e) {
|
1628
1628
|
return re(e).position === "static";
|
1629
1629
|
}
|
1630
|
-
function
|
1630
|
+
function Gt(e, n) {
|
1631
1631
|
return !ce(e) || re(e).position === "fixed" ? null : n ? n(e) : e.offsetParent;
|
1632
1632
|
}
|
1633
|
-
function
|
1634
|
-
const t =
|
1633
|
+
function Tn(e, n) {
|
1634
|
+
const t = ee(e);
|
1635
1635
|
if (lt(e))
|
1636
1636
|
return t;
|
1637
1637
|
if (!ce(e)) {
|
@@ -1643,13 +1643,13 @@ function Sn(e, n) {
|
|
1643
1643
|
}
|
1644
1644
|
return t;
|
1645
1645
|
}
|
1646
|
-
let o =
|
1646
|
+
let o = Gt(e, n);
|
1647
1647
|
for (; o && Ko(o) && pt(o); )
|
1648
|
-
o =
|
1649
|
-
return o && Pe(o) && pt(o) && !
|
1648
|
+
o = Gt(o, n);
|
1649
|
+
return o && Pe(o) && pt(o) && !It(o) ? t : o || qo(e) || t;
|
1650
1650
|
}
|
1651
1651
|
const yi = async function(e) {
|
1652
|
-
const n = this.getOffsetParent ||
|
1652
|
+
const n = this.getOffsetParent || Tn, t = this.getDimensions, o = await t(e.floating);
|
1653
1653
|
return {
|
1654
1654
|
reference: wi(e.reference, await n(e.floating), e.strategy),
|
1655
1655
|
floating: {
|
@@ -1667,7 +1667,7 @@ const Ri = {
|
|
1667
1667
|
convertOffsetParentRelativeRectToViewportRelativeRect: di,
|
1668
1668
|
getDocumentElement: fe,
|
1669
1669
|
getClippingRect: bi,
|
1670
|
-
getOffsetParent:
|
1670
|
+
getOffsetParent: Tn,
|
1671
1671
|
getElementRects: yi,
|
1672
1672
|
getClientRects: pi,
|
1673
1673
|
getDimensions: xi,
|
@@ -1694,19 +1694,19 @@ function Si(e, n) {
|
|
1694
1694
|
return;
|
1695
1695
|
const c = Qe(u), m = Qe(i.clientWidth - (f + d)), p = Qe(i.clientHeight - (u + g)), h = Qe(f), w = {
|
1696
1696
|
rootMargin: -c + "px " + -m + "px " + -p + "px " + -h + "px",
|
1697
|
-
threshold:
|
1697
|
+
threshold: Z(0, pe(1, a)) || 1
|
1698
1698
|
};
|
1699
|
-
let
|
1700
|
-
function x(
|
1701
|
-
const S =
|
1699
|
+
let b = !0;
|
1700
|
+
function x(y) {
|
1701
|
+
const S = y[0].intersectionRatio;
|
1702
1702
|
if (S !== a) {
|
1703
|
-
if (!
|
1703
|
+
if (!b)
|
1704
1704
|
return l();
|
1705
1705
|
S ? l(!1, S) : o = setTimeout(() => {
|
1706
1706
|
l(!1, 1e-7);
|
1707
1707
|
}, 1e3);
|
1708
1708
|
}
|
1709
|
-
|
1709
|
+
b = !1;
|
1710
1710
|
}
|
1711
1711
|
try {
|
1712
1712
|
t = new IntersectionObserver(x, {
|
@@ -1729,32 +1729,32 @@ function Oi(e, n, t, o) {
|
|
1729
1729
|
elementResize: l = typeof ResizeObserver == "function",
|
1730
1730
|
layoutShift: s = typeof IntersectionObserver == "function",
|
1731
1731
|
animationFrame: a = !1
|
1732
|
-
} = o, f =
|
1733
|
-
u.forEach((
|
1734
|
-
i &&
|
1732
|
+
} = o, f = Pt(e), u = i || r ? [...f ? We(f) : [], ...We(n)] : [];
|
1733
|
+
u.forEach((v) => {
|
1734
|
+
i && v.addEventListener("scroll", t, {
|
1735
1735
|
passive: !0
|
1736
|
-
}), r &&
|
1736
|
+
}), r && v.addEventListener("resize", t);
|
1737
1737
|
});
|
1738
1738
|
const d = f && s ? Si(f, t) : null;
|
1739
1739
|
let g = -1, c = null;
|
1740
|
-
l && (c = new ResizeObserver((
|
1741
|
-
let [w] =
|
1740
|
+
l && (c = new ResizeObserver((v) => {
|
1741
|
+
let [w] = v;
|
1742
1742
|
w && w.target === f && c && (c.unobserve(n), cancelAnimationFrame(g), g = requestAnimationFrame(() => {
|
1743
|
-
var
|
1744
|
-
(
|
1743
|
+
var b;
|
1744
|
+
(b = c) == null || b.observe(n);
|
1745
1745
|
})), t();
|
1746
1746
|
}), f && !a && c.observe(f), c.observe(n));
|
1747
1747
|
let m, p = a ? Se(e) : null;
|
1748
1748
|
a && h();
|
1749
1749
|
function h() {
|
1750
|
-
const
|
1751
|
-
p && (
|
1750
|
+
const v = Se(e);
|
1751
|
+
p && (v.x !== p.x || v.y !== p.y || v.width !== p.width || v.height !== p.height) && t(), p = v, m = requestAnimationFrame(h);
|
1752
1752
|
}
|
1753
1753
|
return t(), () => {
|
1754
|
-
var
|
1754
|
+
var v;
|
1755
1755
|
u.forEach((w) => {
|
1756
1756
|
i && w.removeEventListener("scroll", t), r && w.removeEventListener("resize", t);
|
1757
|
-
}), d == null || d(), (
|
1757
|
+
}), d == null || d(), (v = c) == null || v.disconnect(), c = null, a && cancelAnimationFrame(m);
|
1758
1758
|
};
|
1759
1759
|
}
|
1760
1760
|
const mt = ct, Ci = li, Ti = ai, Ii = ri, Mi = ci, Pi = (e, n, t) => {
|
@@ -1770,7 +1770,7 @@ const mt = ct, Ci = li, Ti = ai, Ii = ri, Mi = ci, Pi = (e, n, t) => {
|
|
1770
1770
|
platform: r
|
1771
1771
|
});
|
1772
1772
|
};
|
1773
|
-
var Ze = typeof document < "u" ?
|
1773
|
+
var Ze = typeof document < "u" ? an : oe;
|
1774
1774
|
function it(e, n) {
|
1775
1775
|
if (e === n)
|
1776
1776
|
return !0;
|
@@ -1801,15 +1801,15 @@ function it(e, n) {
|
|
1801
1801
|
}
|
1802
1802
|
return e !== e && n !== n;
|
1803
1803
|
}
|
1804
|
-
function
|
1804
|
+
function In(e) {
|
1805
1805
|
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
1806
1806
|
}
|
1807
|
-
function
|
1808
|
-
const t =
|
1807
|
+
function Jt(e, n) {
|
1808
|
+
const t = In(e);
|
1809
1809
|
return Math.round(n * t) / t;
|
1810
1810
|
}
|
1811
|
-
function
|
1812
|
-
const n =
|
1811
|
+
function Xt(e) {
|
1812
|
+
const n = E.useRef(e);
|
1813
1813
|
return Ze(() => {
|
1814
1814
|
n.current = e;
|
1815
1815
|
}), n;
|
@@ -1828,20 +1828,20 @@ function Ai(e) {
|
|
1828
1828
|
transform: s = !0,
|
1829
1829
|
whileElementsMounted: a,
|
1830
1830
|
open: f
|
1831
|
-
} = e, [u, d] =
|
1831
|
+
} = e, [u, d] = E.useState({
|
1832
1832
|
x: 0,
|
1833
1833
|
y: 0,
|
1834
1834
|
strategy: t,
|
1835
1835
|
placement: n,
|
1836
1836
|
middlewareData: {},
|
1837
1837
|
isPositioned: !1
|
1838
|
-
}), [g, c] =
|
1838
|
+
}), [g, c] = E.useState(o);
|
1839
1839
|
it(g, o) || c(o);
|
1840
|
-
const [m, p] =
|
1840
|
+
const [m, p] = E.useState(null), [h, v] = E.useState(null), w = E.useCallback((R) => {
|
1841
1841
|
R !== S.current && (S.current = R, p(R));
|
1842
|
-
}, []),
|
1843
|
-
R !== O.current && (O.current = R,
|
1844
|
-
}, []), x = r || m,
|
1842
|
+
}, []), b = E.useCallback((R) => {
|
1843
|
+
R !== O.current && (O.current = R, v(R));
|
1844
|
+
}, []), x = r || m, y = l || h, S = E.useRef(null), O = E.useRef(null), D = E.useRef(u), N = a != null, M = Xt(a), T = Xt(i), $ = E.useCallback(() => {
|
1845
1845
|
if (!S.current || !O.current)
|
1846
1846
|
return;
|
1847
1847
|
const R = {
|
@@ -1849,41 +1849,41 @@ function Ai(e) {
|
|
1849
1849
|
strategy: t,
|
1850
1850
|
middleware: g
|
1851
1851
|
};
|
1852
|
-
|
1853
|
-
const
|
1852
|
+
T.current && (R.platform = T.current), Pi(S.current, O.current, R).then((k) => {
|
1853
|
+
const I = {
|
1854
1854
|
...k,
|
1855
1855
|
isPositioned: !0
|
1856
1856
|
};
|
1857
|
-
|
1858
|
-
d(
|
1857
|
+
z.current && !it(D.current, I) && (D.current = I, Ve.flushSync(() => {
|
1858
|
+
d(I);
|
1859
1859
|
}));
|
1860
1860
|
});
|
1861
|
-
}, [g, n, t,
|
1861
|
+
}, [g, n, t, T]);
|
1862
1862
|
Ze(() => {
|
1863
|
-
f === !1 &&
|
1863
|
+
f === !1 && D.current.isPositioned && (D.current.isPositioned = !1, d((R) => ({
|
1864
1864
|
...R,
|
1865
1865
|
isPositioned: !1
|
1866
1866
|
})));
|
1867
1867
|
}, [f]);
|
1868
|
-
const
|
1869
|
-
Ze(() => (
|
1870
|
-
|
1868
|
+
const z = E.useRef(!1);
|
1869
|
+
Ze(() => (z.current = !0, () => {
|
1870
|
+
z.current = !1;
|
1871
1871
|
}), []), Ze(() => {
|
1872
|
-
if (x && (S.current = x),
|
1873
|
-
if (
|
1874
|
-
return
|
1875
|
-
|
1872
|
+
if (x && (S.current = x), y && (O.current = y), x && y) {
|
1873
|
+
if (M.current)
|
1874
|
+
return M.current(x, y, $);
|
1875
|
+
$();
|
1876
1876
|
}
|
1877
|
-
}, [x,
|
1878
|
-
const
|
1877
|
+
}, [x, y, $, M, N]);
|
1878
|
+
const P = E.useMemo(() => ({
|
1879
1879
|
reference: S,
|
1880
1880
|
floating: O,
|
1881
1881
|
setReference: w,
|
1882
|
-
setFloating:
|
1883
|
-
}), [w,
|
1882
|
+
setFloating: b
|
1883
|
+
}), [w, b]), L = E.useMemo(() => ({
|
1884
1884
|
reference: x,
|
1885
|
-
floating:
|
1886
|
-
}), [x,
|
1885
|
+
floating: y
|
1886
|
+
}), [x, y]), V = E.useMemo(() => {
|
1887
1887
|
const R = {
|
1888
1888
|
position: t,
|
1889
1889
|
left: 0,
|
@@ -1891,28 +1891,28 @@ function Ai(e) {
|
|
1891
1891
|
};
|
1892
1892
|
if (!L.floating)
|
1893
1893
|
return R;
|
1894
|
-
const k =
|
1894
|
+
const k = Jt(L.floating, u.x), I = Jt(L.floating, u.y);
|
1895
1895
|
return s ? {
|
1896
1896
|
...R,
|
1897
|
-
transform: "translate(" + k + "px, " +
|
1898
|
-
...
|
1897
|
+
transform: "translate(" + k + "px, " + I + "px)",
|
1898
|
+
...In(L.floating) >= 1.5 && {
|
1899
1899
|
willChange: "transform"
|
1900
1900
|
}
|
1901
1901
|
} : {
|
1902
1902
|
position: t,
|
1903
1903
|
left: k,
|
1904
|
-
top:
|
1904
|
+
top: I
|
1905
1905
|
};
|
1906
1906
|
}, [t, s, L.floating, u.x, u.y]);
|
1907
|
-
return
|
1907
|
+
return E.useMemo(() => ({
|
1908
1908
|
...u,
|
1909
|
-
update:
|
1910
|
-
refs:
|
1909
|
+
update: $,
|
1910
|
+
refs: P,
|
1911
1911
|
elements: L,
|
1912
1912
|
floatingStyles: V
|
1913
|
-
}), [u,
|
1913
|
+
}), [u, $, P, L, V]);
|
1914
1914
|
}
|
1915
|
-
const
|
1915
|
+
const Mn = (e, n) => ({
|
1916
1916
|
...Ci(e),
|
1917
1917
|
options: [e, n]
|
1918
1918
|
}), _i = (e, n) => ({
|
@@ -1924,38 +1924,38 @@ const Cn = (e, n) => ({
|
|
1924
1924
|
}), $i = (e, n) => ({
|
1925
1925
|
...Mi(e),
|
1926
1926
|
options: [e, n]
|
1927
|
-
}),
|
1928
|
-
...
|
1929
|
-
}, Li =
|
1930
|
-
function
|
1931
|
-
const n =
|
1927
|
+
}), Pn = {
|
1928
|
+
...E
|
1929
|
+
}, Li = Pn.useInsertionEffect, Fi = Li || ((e) => e());
|
1930
|
+
function An(e) {
|
1931
|
+
const n = E.useRef(() => {
|
1932
1932
|
if (process.env.NODE_ENV !== "production")
|
1933
1933
|
throw new Error("Cannot call an event handler while rendering.");
|
1934
1934
|
});
|
1935
1935
|
return Fi(() => {
|
1936
1936
|
n.current = e;
|
1937
|
-
}),
|
1937
|
+
}), E.useCallback(function() {
|
1938
1938
|
for (var t = arguments.length, o = new Array(t), i = 0; i < t; i++)
|
1939
1939
|
o[i] = arguments[i];
|
1940
1940
|
return n.current == null ? void 0 : n.current(...o);
|
1941
1941
|
}, []);
|
1942
1942
|
}
|
1943
|
-
var wt = typeof document < "u" ?
|
1944
|
-
let
|
1945
|
-
const
|
1943
|
+
var wt = typeof document < "u" ? an : oe;
|
1944
|
+
let Qt = !1, Ni = 0;
|
1945
|
+
const Zt = () => (
|
1946
1946
|
// Ensure the id is unique with multiple independent versions of Floating UI
|
1947
1947
|
// on <React 18
|
1948
1948
|
"floating-ui-" + Math.random().toString(36).slice(2, 6) + Ni++
|
1949
1949
|
);
|
1950
|
-
function
|
1951
|
-
const [e, n] =
|
1950
|
+
function zi() {
|
1951
|
+
const [e, n] = E.useState(() => Qt ? Zt() : void 0);
|
1952
1952
|
return wt(() => {
|
1953
|
-
e == null && n(
|
1954
|
-
}, []),
|
1955
|
-
|
1953
|
+
e == null && n(Zt());
|
1954
|
+
}, []), E.useEffect(() => {
|
1955
|
+
Qt = !0;
|
1956
1956
|
}, []), e;
|
1957
1957
|
}
|
1958
|
-
const
|
1958
|
+
const ki = Pn.useId, Hi = ki || zi;
|
1959
1959
|
let Be;
|
1960
1960
|
process.env.NODE_ENV !== "production" && (Be = /* @__PURE__ */ new Set());
|
1961
1961
|
function Vi() {
|
@@ -1992,35 +1992,35 @@ function Bi() {
|
|
1992
1992
|
}
|
1993
1993
|
};
|
1994
1994
|
}
|
1995
|
-
const ji = /* @__PURE__ */
|
1995
|
+
const ji = /* @__PURE__ */ E.createContext(null), Ui = /* @__PURE__ */ E.createContext(null), Yi = () => {
|
1996
1996
|
var e;
|
1997
|
-
return ((e =
|
1998
|
-
}, Ki = () =>
|
1997
|
+
return ((e = E.useContext(ji)) == null ? void 0 : e.id) || null;
|
1998
|
+
}, Ki = () => E.useContext(Ui);
|
1999
1999
|
function qi(e) {
|
2000
2000
|
const {
|
2001
2001
|
open: n = !1,
|
2002
2002
|
onOpenChange: t,
|
2003
2003
|
elements: o
|
2004
|
-
} = e, i = Hi(), r =
|
2004
|
+
} = e, i = Hi(), r = E.useRef({}), [l] = E.useState(() => Bi()), s = Yi() != null;
|
2005
2005
|
if (process.env.NODE_ENV !== "production") {
|
2006
2006
|
const c = o.reference;
|
2007
2007
|
c && !G(c) && Wi("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
2008
2008
|
}
|
2009
|
-
const [a, f] =
|
2009
|
+
const [a, f] = E.useState(o.reference), u = An((c, m, p) => {
|
2010
2010
|
r.current.openEvent = c ? m : void 0, l.emit("openchange", {
|
2011
2011
|
open: c,
|
2012
2012
|
event: m,
|
2013
2013
|
reason: p,
|
2014
2014
|
nested: s
|
2015
2015
|
}), t == null || t(c, m, p);
|
2016
|
-
}), d =
|
2016
|
+
}), d = E.useMemo(() => ({
|
2017
2017
|
setPositionReference: f
|
2018
|
-
}), []), g =
|
2018
|
+
}), []), g = E.useMemo(() => ({
|
2019
2019
|
reference: a || o.reference || null,
|
2020
2020
|
floating: o.floating || null,
|
2021
2021
|
domReference: o.reference
|
2022
2022
|
}), [a, o.reference, o.floating]);
|
2023
|
-
return
|
2023
|
+
return E.useMemo(() => ({
|
2024
2024
|
dataRef: r,
|
2025
2025
|
open: n,
|
2026
2026
|
onOpenChange: u,
|
@@ -2041,7 +2041,7 @@ function Gi(e) {
|
|
2041
2041
|
floating: null,
|
2042
2042
|
...e.elements
|
2043
2043
|
}
|
2044
|
-
}), o = e.rootContext || t, i = o.elements, [r, l] =
|
2044
|
+
}), o = e.rootContext || t, i = o.elements, [r, l] = E.useState(null), [s, a] = E.useState(null), u = (i == null ? void 0 : i.reference) || r, d = E.useRef(null), g = Ki();
|
2045
2045
|
wt(() => {
|
2046
2046
|
u && (d.current = u);
|
2047
2047
|
}, [u]);
|
@@ -2053,51 +2053,51 @@ function Gi(e) {
|
|
2053
2053
|
reference: s
|
2054
2054
|
}
|
2055
2055
|
}
|
2056
|
-
}), m =
|
2057
|
-
const x = G(
|
2058
|
-
getBoundingClientRect: () =>
|
2059
|
-
contextElement:
|
2060
|
-
} :
|
2056
|
+
}), m = E.useCallback((b) => {
|
2057
|
+
const x = G(b) ? {
|
2058
|
+
getBoundingClientRect: () => b.getBoundingClientRect(),
|
2059
|
+
contextElement: b
|
2060
|
+
} : b;
|
2061
2061
|
a(x), c.refs.setReference(x);
|
2062
|
-
}, [c.refs]), p =
|
2063
|
-
(G(
|
2062
|
+
}, [c.refs]), p = E.useCallback((b) => {
|
2063
|
+
(G(b) || b === null) && (d.current = b, l(b)), (G(c.refs.reference.current) || c.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
2064
2064
|
// `null` to support `positionReference` + an unstable `reference`
|
2065
2065
|
// callback ref.
|
2066
|
-
|
2067
|
-
}, [c.refs]), h =
|
2066
|
+
b !== null && !G(b)) && c.refs.setReference(b);
|
2067
|
+
}, [c.refs]), h = E.useMemo(() => ({
|
2068
2068
|
...c.refs,
|
2069
2069
|
setReference: p,
|
2070
2070
|
setPositionReference: m,
|
2071
2071
|
domReference: d
|
2072
|
-
}), [c.refs, p, m]),
|
2072
|
+
}), [c.refs, p, m]), v = E.useMemo(() => ({
|
2073
2073
|
...c.elements,
|
2074
2074
|
domReference: u
|
2075
|
-
}), [c.elements, u]), w =
|
2075
|
+
}), [c.elements, u]), w = E.useMemo(() => ({
|
2076
2076
|
...c,
|
2077
2077
|
...o,
|
2078
2078
|
refs: h,
|
2079
|
-
elements:
|
2079
|
+
elements: v,
|
2080
2080
|
nodeId: n
|
2081
|
-
}), [c, h,
|
2081
|
+
}), [c, h, v, n, o]);
|
2082
2082
|
return wt(() => {
|
2083
2083
|
o.dataRef.current.floatingContext = w;
|
2084
|
-
const
|
2085
|
-
|
2086
|
-
}),
|
2084
|
+
const b = g == null ? void 0 : g.nodesRef.current.find((x) => x.id === n);
|
2085
|
+
b && (b.context = w);
|
2086
|
+
}), E.useMemo(() => ({
|
2087
2087
|
...c,
|
2088
2088
|
context: w,
|
2089
2089
|
refs: h,
|
2090
|
-
elements:
|
2091
|
-
}), [c, h,
|
2090
|
+
elements: v
|
2091
|
+
}), [c, h, v, w]);
|
2092
2092
|
}
|
2093
|
-
const
|
2093
|
+
const en = "active", tn = "selected";
|
2094
2094
|
function ht(e, n, t) {
|
2095
2095
|
const o = /* @__PURE__ */ new Map(), i = t === "item";
|
2096
2096
|
let r = e;
|
2097
2097
|
if (i && e) {
|
2098
2098
|
const {
|
2099
|
-
[
|
2100
|
-
[
|
2099
|
+
[en]: l,
|
2100
|
+
[tn]: s,
|
2101
2101
|
...a
|
2102
2102
|
} = e;
|
2103
2103
|
r = a;
|
@@ -2112,7 +2112,7 @@ function ht(e, n, t) {
|
|
2112
2112
|
return typeof s == "function" ? e ? s(e) : null : s;
|
2113
2113
|
}).concat(e).reduce((l, s) => (s && Object.entries(s).forEach((a) => {
|
2114
2114
|
let [f, u] = a;
|
2115
|
-
if (!(i && [
|
2115
|
+
if (!(i && [en, tn].includes(f)))
|
2116
2116
|
if (f.indexOf("on") === 0) {
|
2117
2117
|
if (o.has(f) || o.set(f, []), typeof u == "function") {
|
2118
2118
|
var d;
|
@@ -2129,26 +2129,26 @@ function ht(e, n, t) {
|
|
2129
2129
|
}
|
2130
2130
|
function Ji(e) {
|
2131
2131
|
e === void 0 && (e = []);
|
2132
|
-
const n = e.map((s) => s == null ? void 0 : s.reference), t = e.map((s) => s == null ? void 0 : s.floating), o = e.map((s) => s == null ? void 0 : s.item), i =
|
2132
|
+
const n = e.map((s) => s == null ? void 0 : s.reference), t = e.map((s) => s == null ? void 0 : s.floating), o = e.map((s) => s == null ? void 0 : s.item), i = E.useCallback(
|
2133
2133
|
(s) => ht(s, e, "reference"),
|
2134
2134
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
2135
2135
|
n
|
2136
|
-
), r =
|
2136
|
+
), r = E.useCallback(
|
2137
2137
|
(s) => ht(s, e, "floating"),
|
2138
2138
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
2139
2139
|
t
|
2140
|
-
), l =
|
2140
|
+
), l = E.useCallback(
|
2141
2141
|
(s) => ht(s, e, "item"),
|
2142
2142
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
2143
2143
|
o
|
2144
2144
|
);
|
2145
|
-
return
|
2145
|
+
return E.useMemo(() => ({
|
2146
2146
|
getReferenceProps: i,
|
2147
2147
|
getFloatingProps: r,
|
2148
2148
|
getItemProps: l
|
2149
2149
|
}), [i, r, l]);
|
2150
2150
|
}
|
2151
|
-
function
|
2151
|
+
function nn(e, n) {
|
2152
2152
|
return {
|
2153
2153
|
...e,
|
2154
2154
|
rects: {
|
@@ -2184,16 +2184,16 @@ const Xi = (e) => ({
|
|
2184
2184
|
return {};
|
2185
2185
|
const m = {
|
2186
2186
|
...n,
|
2187
|
-
...await
|
2188
|
-
}, p = (f == null ? void 0 : f.current) || g, h = await mt(
|
2187
|
+
...await Mn(-c.offsetTop - g.clientTop - d.reference.height / 2 - c.offsetHeight / 2 - r).fn(n)
|
2188
|
+
}, p = (f == null ? void 0 : f.current) || g, h = await mt(nn(m, p.scrollHeight), u), v = await mt(m, {
|
2189
2189
|
...u,
|
2190
2190
|
elementContext: "reference"
|
2191
|
-
}), w = Math.max(0, h.top),
|
2192
|
-
return p.style.maxHeight = x + "px", p.scrollTop = w, i && (p.offsetHeight < c.offsetHeight * Math.min(s, t.current.length - 1) - 1 ||
|
2191
|
+
}), w = Math.max(0, h.top), b = m.y + w, x = Math.max(0, p.scrollHeight - w - Math.max(0, h.bottom));
|
2192
|
+
return p.style.maxHeight = x + "px", p.scrollTop = w, i && (p.offsetHeight < c.offsetHeight * Math.min(s, t.current.length - 1) - 1 || v.top >= -a || v.bottom >= -a ? Ve.flushSync(() => i(!0)) : Ve.flushSync(() => i(!1))), o && (o.current = await mt(nn({
|
2193
2193
|
...m,
|
2194
|
-
y:
|
2194
|
+
y: b
|
2195
2195
|
}, p.offsetHeight), u)), {
|
2196
|
-
y:
|
2196
|
+
y: b
|
2197
2197
|
};
|
2198
2198
|
}
|
2199
2199
|
});
|
@@ -2206,15 +2206,15 @@ function Qi(e, n) {
|
|
2206
2206
|
overflowRef: r,
|
2207
2207
|
scrollRef: l,
|
2208
2208
|
onChange: s
|
2209
|
-
} = n, a =
|
2210
|
-
|
2209
|
+
} = n, a = An(s), f = E.useRef(!1), u = E.useRef(null), d = E.useRef(null);
|
2210
|
+
E.useEffect(() => {
|
2211
2211
|
if (!i) return;
|
2212
2212
|
function c(p) {
|
2213
2213
|
if (p.ctrlKey || !m || r.current == null)
|
2214
2214
|
return;
|
2215
|
-
const h = p.deltaY,
|
2216
|
-
m.scrollHeight <= m.clientHeight || (!
|
2217
|
-
a((S) => S + Math[
|
2215
|
+
const h = p.deltaY, v = r.current.top >= -0.5, w = r.current.bottom >= -0.5, b = m.scrollHeight - m.clientHeight, x = h < 0 ? -1 : 1, y = h < 0 ? "max" : "min";
|
2216
|
+
m.scrollHeight <= m.clientHeight || (!v && h > 0 || !w && h < 0 ? (p.preventDefault(), Ve.flushSync(() => {
|
2217
|
+
a((S) => S + Math[y](h, b * x));
|
2218
2218
|
})) : /firefox/i.test(Go()) && (m.scrollTop += h));
|
2219
2219
|
}
|
2220
2220
|
const m = (l == null ? void 0 : l.current) || o.floating;
|
@@ -2227,7 +2227,7 @@ function Qi(e, n) {
|
|
2227
2227
|
u.current = null, d.current = null, m.removeEventListener("wheel", c);
|
2228
2228
|
};
|
2229
2229
|
}, [i, t, o.floating, r, l, a]);
|
2230
|
-
const g =
|
2230
|
+
const g = E.useMemo(() => ({
|
2231
2231
|
onKeyDown() {
|
2232
2232
|
f.current = !0;
|
2233
2233
|
},
|
@@ -2250,7 +2250,7 @@ function Qi(e, n) {
|
|
2250
2250
|
}
|
2251
2251
|
}
|
2252
2252
|
}), [o.floating, a, r, l]);
|
2253
|
-
return
|
2253
|
+
return E.useMemo(() => i ? {
|
2254
2254
|
floating: g
|
2255
2255
|
} : {}, [i, g]);
|
2256
2256
|
}
|
@@ -2258,8 +2258,8 @@ let qe = ve({ styles: void 0, setReference: () => {
|
|
2258
2258
|
}, setFloating: () => {
|
2259
2259
|
}, getReferenceProps: () => ({}), getFloatingProps: () => ({}), slot: {} });
|
2260
2260
|
qe.displayName = "FloatingContext";
|
2261
|
-
let
|
2262
|
-
|
2261
|
+
let At = ve(null);
|
2262
|
+
At.displayName = "PlacementContext";
|
2263
2263
|
function Zi(e) {
|
2264
2264
|
return q(() => e ? typeof e == "string" ? { to: e } : e : null, [e]);
|
2265
2265
|
}
|
@@ -2272,14 +2272,14 @@ function tr() {
|
|
2272
2272
|
}
|
2273
2273
|
function nr(e = null) {
|
2274
2274
|
e === !1 && (e = null), typeof e == "string" && (e = { to: e });
|
2275
|
-
let n = ae(
|
2275
|
+
let n = ae(At), t = q(() => e, [JSON.stringify(e, typeof HTMLElement < "u" ? (i, r) => r instanceof HTMLElement ? r.outerHTML : r : void 0)]);
|
2276
2276
|
U(() => {
|
2277
2277
|
n == null || n(t ?? null);
|
2278
2278
|
}, [n, t]);
|
2279
2279
|
let o = ae(qe);
|
2280
2280
|
return q(() => [o.setFloating, e ? o.styles : {}], [o.setFloating, e, o.styles]);
|
2281
2281
|
}
|
2282
|
-
let
|
2282
|
+
let on = 4;
|
2283
2283
|
function or({ children: e, enabled: n = !0 }) {
|
2284
2284
|
let [t, o] = ue(null), [i, r] = ue(0), l = Y(null), [s, a] = ue(null);
|
2285
2285
|
ir(s);
|
@@ -2287,32 +2287,32 @@ function or({ children: e, enabled: n = !0 }) {
|
|
2287
2287
|
U(() => {
|
2288
2288
|
f && r(0);
|
2289
2289
|
}, [f]);
|
2290
|
-
let { refs:
|
2291
|
-
var
|
2292
|
-
if (!
|
2293
|
-
let
|
2294
|
-
if (!
|
2295
|
-
let L = parseFloat(getComputedStyle(
|
2296
|
-
for (let
|
2297
|
-
let
|
2298
|
-
if (
|
2290
|
+
let { refs: v, floatingStyles: w, context: b } = Gi({ open: f, placement: p === "selection" ? h === "center" ? "bottom" : `bottom-${h}` : h === "center" ? `${p}` : `${p}-${h}`, strategy: "absolute", transform: !1, middleware: [Mn({ mainAxis: p === "selection" ? 0 : d, crossAxis: g }), _i({ padding: c }), p !== "selection" && Di({ padding: c }), p === "selection" && m ? Xi({ ...m, padding: c, overflowRef: l, offset: i, minItemsVisible: on, referenceOverflowThreshold: c, onFallbackChange(T) {
|
2291
|
+
var $, z;
|
2292
|
+
if (!T) return;
|
2293
|
+
let P = b.elements.floating;
|
2294
|
+
if (!P) return;
|
2295
|
+
let L = parseFloat(getComputedStyle(P).scrollPaddingBottom) || 0, V = Math.min(on, P.childElementCount), R = 0, k = 0;
|
2296
|
+
for (let I of (z = ($ = b.elements.floating) == null ? void 0 : $.childNodes) != null ? z : []) if (I instanceof HTMLElement) {
|
2297
|
+
let te = I.offsetTop, Ce = te + I.clientHeight + L, C = P.scrollTop, J = C + P.clientHeight;
|
2298
|
+
if (te >= C && Ce <= J) V--;
|
2299
2299
|
else {
|
2300
|
-
k = Math.max(0, Math.min(Ce, J) - Math.max(
|
2300
|
+
k = Math.max(0, Math.min(Ce, J) - Math.max(te, C)), R = I.clientHeight;
|
2301
2301
|
break;
|
2302
2302
|
}
|
2303
2303
|
}
|
2304
|
-
V >= 1 && r((
|
2305
|
-
let
|
2306
|
-
return
|
2304
|
+
V >= 1 && r((I) => {
|
2305
|
+
let te = R * V - k + L;
|
2306
|
+
return I >= te ? I : te;
|
2307
2307
|
});
|
2308
|
-
} }) : null, $i({ padding: c, apply({ availableWidth:
|
2309
|
-
Object.assign(
|
2310
|
-
} })].filter(Boolean), whileElementsMounted: Oi }), [x = p,
|
2308
|
+
} }) : null, $i({ padding: c, apply({ availableWidth: T, availableHeight: $, elements: z }) {
|
2309
|
+
Object.assign(z.floating.style, { overflow: "auto", maxWidth: `${T}px`, maxHeight: `min(var(--anchor-max-height, 100vh), ${$}px)` });
|
2310
|
+
} })].filter(Boolean), whileElementsMounted: Oi }), [x = p, y = h] = b.placement.split("-");
|
2311
2311
|
p === "selection" && (x = "selection");
|
2312
|
-
let S = q(() => ({ anchor: [x,
|
2313
|
-
a(
|
2312
|
+
let S = q(() => ({ anchor: [x, y].filter(Boolean).join(" ") }), [x, y]), O = Qi(b, { overflowRef: l, onChange: r }), { getReferenceProps: D, getFloatingProps: N } = Ji([O]), M = A((T) => {
|
2313
|
+
a(T), v.setFloating(T);
|
2314
2314
|
});
|
2315
|
-
return
|
2315
|
+
return E.createElement(At.Provider, { value: o }, E.createElement(qe.Provider, { value: { setFloating: M, setReference: v.setReference, styles: w, getReferenceProps: D, getFloatingProps: N, slot: S } }, e));
|
2316
2316
|
}
|
2317
2317
|
function ir(e) {
|
2318
2318
|
U(() => {
|
@@ -2334,28 +2334,28 @@ function rr(e, n) {
|
|
2334
2334
|
return { ...e, gap: r, offset: l, padding: s };
|
2335
2335
|
}
|
2336
2336
|
function gt(e, n, t = void 0) {
|
2337
|
-
let o =
|
2337
|
+
let o = cn(), i = A((a, f) => {
|
2338
2338
|
if (a == null) return [t, null];
|
2339
2339
|
if (typeof a == "number") return [a, null];
|
2340
2340
|
if (typeof a == "string") {
|
2341
2341
|
if (!f) return [t, null];
|
2342
|
-
let u =
|
2342
|
+
let u = rn(a, f);
|
2343
2343
|
return [u, (d) => {
|
2344
|
-
let g =
|
2344
|
+
let g = _n(a);
|
2345
2345
|
{
|
2346
2346
|
let c = g.map((m) => window.getComputedStyle(f).getPropertyValue(m));
|
2347
2347
|
o.requestAnimationFrame(function m() {
|
2348
2348
|
o.nextFrame(m);
|
2349
2349
|
let p = !1;
|
2350
|
-
for (let [
|
2351
|
-
let
|
2352
|
-
if (c[
|
2353
|
-
c[
|
2350
|
+
for (let [v, w] of g.entries()) {
|
2351
|
+
let b = window.getComputedStyle(f).getPropertyValue(w);
|
2352
|
+
if (c[v] !== b) {
|
2353
|
+
c[v] = b, p = !0;
|
2354
2354
|
break;
|
2355
2355
|
}
|
2356
2356
|
}
|
2357
2357
|
if (!p) return;
|
2358
|
-
let h =
|
2358
|
+
let h = rn(a, f);
|
2359
2359
|
u !== h && (d(h), u = h);
|
2360
2360
|
});
|
2361
2361
|
}
|
@@ -2369,17 +2369,17 @@ function gt(e, n, t = void 0) {
|
|
2369
2369
|
if (s(a), !!f) return f(s);
|
2370
2370
|
}, [e, n]), l;
|
2371
2371
|
}
|
2372
|
-
function
|
2372
|
+
function _n(e) {
|
2373
2373
|
let n = /var\((.*)\)/.exec(e);
|
2374
2374
|
if (n) {
|
2375
2375
|
let t = n[1].indexOf(",");
|
2376
2376
|
if (t === -1) return [n[1]];
|
2377
2377
|
let o = n[1].slice(0, t).trim(), i = n[1].slice(t + 1).trim();
|
2378
|
-
return i ? [o, ...
|
2378
|
+
return i ? [o, ..._n(i)] : [o];
|
2379
2379
|
}
|
2380
2380
|
return [];
|
2381
2381
|
}
|
2382
|
-
function
|
2382
|
+
function rn(e, n) {
|
2383
2383
|
let t = document.createElement("div");
|
2384
2384
|
n.appendChild(t), t.style.setProperty("margin-top", "0px", "important"), t.style.setProperty("margin-top", e, "important");
|
2385
2385
|
let o = parseFloat(window.getComputedStyle(t).marginTop) || 0;
|
@@ -2412,7 +2412,7 @@ function ar(e) {
|
|
2412
2412
|
throw new Error("Unexpected object: " + e);
|
2413
2413
|
}
|
2414
2414
|
var B = ((e) => (e[e.First = 0] = "First", e[e.Previous = 1] = "Previous", e[e.Next = 2] = "Next", e[e.Last = 3] = "Last", e[e.Specific = 4] = "Specific", e[e.Nothing = 5] = "Nothing", e))(B || {});
|
2415
|
-
function
|
2415
|
+
function sn(e, n) {
|
2416
2416
|
let t = n.resolveItems();
|
2417
2417
|
if (t.length <= 0) return null;
|
2418
2418
|
let o = n.resolveActiveIndex(), i = o ?? -1;
|
@@ -2444,10 +2444,10 @@ function nn(e, n) {
|
|
2444
2444
|
ar(e);
|
2445
2445
|
}
|
2446
2446
|
}
|
2447
|
-
var
|
2447
|
+
var _t = ((e) => (e[e.Left = 0] = "Left", e[e.Right = 2] = "Right", e))(_t || {});
|
2448
2448
|
function cr(e) {
|
2449
2449
|
let n = A(e), t = Y(!1);
|
2450
|
-
|
2450
|
+
oe(() => (t.current = !1, () => {
|
2451
2451
|
t.current = !0, Yn(() => {
|
2452
2452
|
t.current && n();
|
2453
2453
|
});
|
@@ -2455,42 +2455,42 @@ function cr(e) {
|
|
2455
2455
|
}
|
2456
2456
|
function ur() {
|
2457
2457
|
let e = typeof document > "u";
|
2458
|
-
return "useSyncExternalStore" in
|
2458
|
+
return "useSyncExternalStore" in E ? ((n) => n.useSyncExternalStore)(E)(() => () => {
|
2459
2459
|
}, () => !1, () => !e) : !1;
|
2460
2460
|
}
|
2461
2461
|
function fr() {
|
2462
|
-
let e = ur(), [n, t] =
|
2463
|
-
return n &&
|
2462
|
+
let e = ur(), [n, t] = E.useState(ze.isHandoffComplete);
|
2463
|
+
return n && ze.isHandoffComplete === !1 && t(!1), E.useEffect(() => {
|
2464
2464
|
n !== !0 && t(!0);
|
2465
|
-
}, [n]),
|
2465
|
+
}, [n]), E.useEffect(() => ze.handoff(), []), e ? !1 : n;
|
2466
2466
|
}
|
2467
2467
|
let dr = ve(!1);
|
2468
2468
|
function pr() {
|
2469
2469
|
return ae(dr);
|
2470
2470
|
}
|
2471
2471
|
function mr(e) {
|
2472
|
-
let n = pr(), t = ae(
|
2472
|
+
let n = pr(), t = ae($n), o = st(e), [i, r] = ue(() => {
|
2473
2473
|
var l;
|
2474
2474
|
if (!n && t !== null) return (l = t.current) != null ? l : null;
|
2475
|
-
if (
|
2475
|
+
if (ze.isServer) return null;
|
2476
2476
|
let s = o == null ? void 0 : o.getElementById("headlessui-portal-root");
|
2477
2477
|
if (s) return s;
|
2478
2478
|
if (o === null) return null;
|
2479
2479
|
let a = o.createElement("div");
|
2480
2480
|
return a.setAttribute("id", "headlessui-portal-root"), o.body.appendChild(a);
|
2481
2481
|
});
|
2482
|
-
return
|
2482
|
+
return oe(() => {
|
2483
2483
|
i !== null && (o != null && o.body.contains(i) || o == null || o.body.appendChild(i));
|
2484
|
-
}, [i, o]),
|
2484
|
+
}, [i, o]), oe(() => {
|
2485
2485
|
n || t !== null && r(t.current);
|
2486
2486
|
}, [t, r, n]), i;
|
2487
2487
|
}
|
2488
|
-
let
|
2488
|
+
let Dn = rt, hr = be(function(e, n) {
|
2489
2489
|
let t = e, o = Y(null), i = Oe(Kn((u) => {
|
2490
2490
|
o.current = u;
|
2491
2491
|
}), n), r = st(o), l = mr(o), [s] = ue(() => {
|
2492
2492
|
var u;
|
2493
|
-
return
|
2493
|
+
return ze.isServer ? null : (u = r == null ? void 0 : r.createElement("div")) != null ? u : null;
|
2494
2494
|
}), a = ae(xr), f = fr();
|
2495
2495
|
return U(() => {
|
2496
2496
|
!l || !s || l.contains(s) || (s.setAttribute("data-headlessui-portal", ""), l.appendChild(s));
|
@@ -2499,16 +2499,16 @@ let Pn = rt, hr = be(function(e, n) {
|
|
2499
2499
|
}, [a, s]), cr(() => {
|
2500
2500
|
var u;
|
2501
2501
|
!l || !s || (s instanceof Node && l.contains(s) && l.removeChild(s), l.childNodes.length <= 0 && ((u = l.parentElement) == null || u.removeChild(l)));
|
2502
|
-
}), f ? !l || !s ? null : qn(xe({ ourProps: { ref: i }, theirProps: t, slot: {}, defaultTag:
|
2502
|
+
}), f ? !l || !s ? null : qn(xe({ ourProps: { ref: i }, theirProps: t, slot: {}, defaultTag: Dn, name: "Portal" }), s) : null;
|
2503
2503
|
});
|
2504
2504
|
function gr(e, n) {
|
2505
2505
|
let t = Oe(n), { enabled: o = !0, ...i } = e;
|
2506
|
-
return o ? j.createElement(hr, { ...i, ref: t }) : xe({ ourProps: { ref: t }, theirProps: i, slot: {}, defaultTag:
|
2506
|
+
return o ? j.createElement(hr, { ...i, ref: t }) : xe({ ourProps: { ref: t }, theirProps: i, slot: {}, defaultTag: Dn, name: "Portal" });
|
2507
2507
|
}
|
2508
|
-
let vr = rt,
|
2508
|
+
let vr = rt, $n = ve(null);
|
2509
2509
|
function br(e, n) {
|
2510
2510
|
let { target: t, ...o } = e, i = { ref: Oe(n) };
|
2511
|
-
return j.createElement(
|
2511
|
+
return j.createElement($n.Provider, { value: t }, xe({ ourProps: i, theirProps: o, defaultTag: vr, name: "Popover.Group" }));
|
2512
2512
|
}
|
2513
2513
|
let xr = ve(null), wr = be(gr), yr = be(br), Er = Object.assign(wr, { Group: yr });
|
2514
2514
|
var Rr = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(Rr || {}), Sr = ((e) => (e[e.Single = 0] = "Single", e[e.Multi = 1] = "Multi", e))(Sr || {}), Or = ((e) => (e[e.Pointer = 0] = "Pointer", e[e.Focus = 1] = "Focus", e[e.Other = 2] = "Other", e))(Or || {}), Cr = ((e) => (e[e.OpenCombobox = 0] = "OpenCombobox", e[e.CloseCombobox = 1] = "CloseCombobox", e[e.GoToOption = 2] = "GoToOption", e[e.SetTyping = 3] = "SetTyping", e[e.RegisterOption = 4] = "RegisterOption", e[e.UnregisterOption = 5] = "UnregisterOption", e[e.SetActivationTrigger = 6] = "SetActivationTrigger", e[e.UpdateVirtualConfiguration = 7] = "UpdateVirtualConfiguration", e))(Cr || {});
|
@@ -2533,7 +2533,7 @@ let Tr = { 1(e) {
|
|
2533
2533
|
var t, o, i, r, l;
|
2534
2534
|
if ((t = e.dataRef.current) != null && t.disabled || (o = e.dataRef.current) != null && o.optionsRef.current && !((i = e.dataRef.current) != null && i.optionsPropsRef.current.static) && e.comboboxState === 1) return e;
|
2535
2535
|
if (e.virtual) {
|
2536
|
-
let { options: u, disabled: d } = e.virtual, g = n.focus === B.Specific ? n.idx :
|
2536
|
+
let { options: u, disabled: d } = e.virtual, g = n.focus === B.Specific ? n.idx : sn(n, { resolveItems: () => u, resolveActiveIndex: () => {
|
2537
2537
|
var m, p;
|
2538
2538
|
return (p = (m = e.activeOptionIndex) != null ? m : u.findIndex((h) => !d(h))) != null ? p : null;
|
2539
2539
|
}, resolveDisabled: d, resolveId() {
|
@@ -2546,7 +2546,7 @@ let Tr = { 1(e) {
|
|
2546
2546
|
let u = s.options.findIndex((d) => !d.dataRef.current.disabled);
|
2547
2547
|
u !== -1 && (s.activeOptionIndex = u);
|
2548
2548
|
}
|
2549
|
-
let a = n.focus === B.Specific ? n.idx :
|
2549
|
+
let a = n.focus === B.Specific ? n.idx : sn(n, { resolveItems: () => s.options, resolveActiveIndex: () => s.activeOptionIndex, resolveId: (u) => u.id, resolveDisabled: (u) => u.dataRef.current.disabled }), f = (l = n.trigger) != null ? l : 2;
|
2550
2550
|
return e.activeOptionIndex === a && e.activationTrigger === f ? e : { ...e, ...s, isTyping: !1, activeOptionIndex: a, activationTrigger: f, __demoMode: !1 };
|
2551
2551
|
}, 4: (e, n) => {
|
2552
2552
|
var t, o, i;
|
@@ -2573,17 +2573,17 @@ let Tr = { 1(e) {
|
|
2573
2573
|
r !== -1 ? i = r : i = null;
|
2574
2574
|
}
|
2575
2575
|
return { ...e, activeOptionIndex: i, virtual: { options: n.options, disabled: (o = n.disabled) != null ? o : () => !1 } };
|
2576
|
-
} },
|
2577
|
-
|
2576
|
+
} }, Dt = ve(null);
|
2577
|
+
Dt.displayName = "ComboboxActionsContext";
|
2578
2578
|
function Ge(e) {
|
2579
|
-
let n = ae(
|
2579
|
+
let n = ae(Dt);
|
2580
2580
|
if (n === null) {
|
2581
2581
|
let t = new Error(`<${e} /> is missing a parent <Combobox /> component.`);
|
2582
2582
|
throw Error.captureStackTrace && Error.captureStackTrace(t, Ge), t;
|
2583
2583
|
}
|
2584
2584
|
return n;
|
2585
2585
|
}
|
2586
|
-
let
|
2586
|
+
let Ln = ve(null);
|
2587
2587
|
function Ir(e) {
|
2588
2588
|
let n = $e("VirtualProvider"), { options: t } = n.virtual, [o, i] = q(() => {
|
2589
2589
|
let f = n.optionsRef.current;
|
@@ -2600,7 +2600,7 @@ function Ir(e) {
|
|
2600
2600
|
s((f) => f + 1);
|
2601
2601
|
}, [t]);
|
2602
2602
|
let a = r.getVirtualItems();
|
2603
|
-
return a.length === 0 ? null : j.createElement(
|
2603
|
+
return a.length === 0 ? null : j.createElement(Ln.Provider, { value: r }, j.createElement("div", { style: { position: "relative", width: "100%", height: `${r.getTotalSize()}px` }, ref: (f) => {
|
2604
2604
|
if (f) {
|
2605
2605
|
if (typeof process < "u" && process.env.JEST_WORKER_ID !== void 0 || n.activationTrigger === 0) return;
|
2606
2606
|
n.activeOptionIndex !== null && t.length > n.activeOptionIndex && r.scrollToIndex(n.activeOptionIndex);
|
@@ -2626,20 +2626,20 @@ function Mr(e, n) {
|
|
2626
2626
|
let Pr = rt;
|
2627
2627
|
function Ar(e, n) {
|
2628
2628
|
var t, o;
|
2629
|
-
let i = Qn(), { value: r, defaultValue: l, onChange: s, form: a, name: f, by: u, disabled: d = i || !1, onClose: g, __demoMode: c = !1, multiple: m = !1, immediate: p = !1, virtual: h = null, nullable:
|
2630
|
-
if (
|
2629
|
+
let i = Qn(), { value: r, defaultValue: l, onChange: s, form: a, name: f, by: u, disabled: d = i || !1, onClose: g, __demoMode: c = !1, multiple: m = !1, immediate: p = !1, virtual: h = null, nullable: v, ...w } = e, b = Zn(l), [x = m ? [] : void 0, y] = eo(r, s, b), [S, O] = ln(Mr, { dataRef: Bn(), comboboxState: c ? 0 : 1, isTyping: !1, options: [], virtual: h ? { options: h.options, disabled: (t = h.disabled) != null ? t : () => !1 } : null, activeOptionIndex: null, activationTrigger: 2, __demoMode: c }), D = Y(!1), N = Y({ static: !1, hold: !1 }), M = Y(null), T = Y(null), $ = Y(null), z = Jn(u), P = A((_) => h ? u === null ? h.options.indexOf(_) : h.options.findIndex((H) => z(H, _)) : S.options.findIndex((H) => z(H.dataRef.current.value, _))), L = He((_) => Te(R.mode, { 1: () => x.some((H) => z(H, _)), 0: () => z(x, _) }), [x]), V = A((_) => S.activeOptionIndex === P(_)), R = q(() => ({ ...S, immediate: p, optionsPropsRef: N, inputRef: M, buttonRef: T, optionsRef: $, value: x, defaultValue: b, disabled: d, mode: m ? 1 : 0, virtual: h ? S.virtual : null, get activeOptionIndex() {
|
2630
|
+
if (D.current && S.activeOptionIndex === null && (h ? h.options.length > 0 : S.options.length > 0)) {
|
2631
2631
|
if (h) {
|
2632
|
-
let
|
2633
|
-
var Je,
|
2634
|
-
return !((
|
2632
|
+
let H = h.options.findIndex((le) => {
|
2633
|
+
var Je, $t;
|
2634
|
+
return !(($t = (Je = h.disabled) == null ? void 0 : Je.call(h, le)) != null && $t);
|
2635
2635
|
});
|
2636
|
-
if (
|
2636
|
+
if (H !== -1) return H;
|
2637
2637
|
}
|
2638
|
-
let _ = S.options.findIndex((
|
2638
|
+
let _ = S.options.findIndex((H) => !H.dataRef.current.disabled);
|
2639
2639
|
if (_ !== -1) return _;
|
2640
2640
|
}
|
2641
2641
|
return S.activeOptionIndex;
|
2642
|
-
}, calculateIndex:
|
2642
|
+
}, calculateIndex: P, compare: z, isSelected: L, isActive: V }), [x, b, d, m, c, S, h]);
|
2643
2643
|
U(() => {
|
2644
2644
|
var _;
|
2645
2645
|
h && O({ type: 7, options: h.options, disabled: (_ = h.disabled) != null ? _ : null });
|
@@ -2648,10 +2648,10 @@ function Ar(e, n) {
|
|
2648
2648
|
}, [R]);
|
2649
2649
|
let k = R.comboboxState === 0;
|
2650
2650
|
No(k, [R.buttonRef, R.inputRef, R.optionsRef], () => se.closeCombobox());
|
2651
|
-
let
|
2652
|
-
var _,
|
2653
|
-
return { open: R.comboboxState === 0, disabled: d, activeIndex: R.activeOptionIndex, activeOption: R.activeOptionIndex === null ? null : R.virtual ? R.virtual.options[(_ = R.activeOptionIndex) != null ? _ : 0] : (le = (
|
2654
|
-
}, [R, d, x]),
|
2651
|
+
let I = q(() => {
|
2652
|
+
var _, H, le;
|
2653
|
+
return { open: R.comboboxState === 0, disabled: d, activeIndex: R.activeOptionIndex, activeOption: R.activeOptionIndex === null ? null : R.virtual ? R.virtual.options[(_ = R.activeOptionIndex) != null ? _ : 0] : (le = (H = R.options[R.activeOptionIndex]) == null ? void 0 : H.dataRef.current.value) != null ? le : null, value: x };
|
2654
|
+
}, [R, d, x]), te = A(() => {
|
2655
2655
|
if (R.activeOptionIndex !== null) {
|
2656
2656
|
if (se.setIsTyping(!1), R.virtual) W(R.virtual.options[R.activeOptionIndex]);
|
2657
2657
|
else {
|
@@ -2661,58 +2661,58 @@ function Ar(e, n) {
|
|
2661
2661
|
se.goToOption(B.Specific, R.activeOptionIndex);
|
2662
2662
|
}
|
2663
2663
|
}), Ce = A(() => {
|
2664
|
-
O({ type: 0 }),
|
2664
|
+
O({ type: 0 }), D.current = !0;
|
2665
2665
|
}), C = A(() => {
|
2666
|
-
O({ type: 1 }),
|
2666
|
+
O({ type: 1 }), D.current = !1, g == null || g();
|
2667
2667
|
}), J = A((_) => {
|
2668
2668
|
O({ type: 3, isTyping: _ });
|
2669
|
-
}), K = A((_,
|
2670
|
-
R.isActive(
|
2669
|
+
}), K = A((_, H, le) => (D.current = !1, _ === B.Specific ? O({ type: 2, focus: B.Specific, idx: H, trigger: le }) : O({ type: 2, focus: _, trigger: le }))), ie = A((_, H) => (O({ type: 4, payload: { id: _, dataRef: H } }), () => {
|
2670
|
+
R.isActive(H.current.value) && (D.current = !0), O({ type: 5, id: _ });
|
2671
2671
|
})), W = A((_) => Te(R.mode, { 0() {
|
2672
|
-
return
|
2672
|
+
return y == null ? void 0 : y(_);
|
2673
2673
|
}, 1() {
|
2674
|
-
let
|
2675
|
-
return le === -1 ?
|
2676
|
-
} })),
|
2674
|
+
let H = R.value.slice(), le = H.findIndex((Je) => z(Je, _));
|
2675
|
+
return le === -1 ? H.push(_) : H.splice(le, 1), y == null ? void 0 : y(H);
|
2676
|
+
} })), ne = A((_) => {
|
2677
2677
|
O({ type: 6, trigger: _ });
|
2678
|
-
}), se = q(() => ({ onChange: W, registerOption:
|
2679
|
-
if (
|
2680
|
-
}, [
|
2681
|
-
return j.createElement(kn, { value:
|
2678
|
+
}), se = q(() => ({ onChange: W, registerOption: ie, goToOption: K, setIsTyping: J, closeCombobox: C, openCombobox: Ce, setActivationTrigger: ne, selectActiveOption: te }), []), [zn, kn] = to(), Hn = n === null ? {} : { ref: n }, Vn = He(() => {
|
2679
|
+
if (b !== void 0) return y == null ? void 0 : y(b);
|
2680
|
+
}, [y, b]);
|
2681
|
+
return j.createElement(kn, { value: zn, props: { htmlFor: (o = R.inputRef.current) == null ? void 0 : o.id }, slot: { open: R.comboboxState === 0, disabled: d } }, j.createElement(or, null, j.createElement(Dt.Provider, { value: se }, j.createElement(je.Provider, { value: R }, j.createElement(uo, { value: Te(R.comboboxState, { 0: et.Open, 1: et.Closed }) }, f != null && j.createElement(no, { disabled: d, data: x != null ? { [f]: x } : {}, form: a, onReset: Vn }), xe({ ourProps: Hn, theirProps: w, slot: I, defaultTag: Pr, name: "Combobox" }))))));
|
2682
2682
|
}
|
2683
2683
|
let _r = "input";
|
2684
2684
|
function Dr(e, n) {
|
2685
2685
|
var t, o, i, r, l;
|
2686
|
-
let s = $e("Combobox.Input"), a = Ge("Combobox.Input"), f = Ue(), u = oo(), { id: d = u || `headlessui-combobox-input-${f}`, onChange: g, displayValue: c, disabled: m = s.disabled || !1, autoFocus: p = !1, type: h = "text", ...
|
2686
|
+
let s = $e("Combobox.Input"), a = Ge("Combobox.Input"), f = Ue(), u = oo(), { id: d = u || `headlessui-combobox-input-${f}`, onChange: g, displayValue: c, disabled: m = s.disabled || !1, autoFocus: p = !1, type: h = "text", ...v } = e, w = Oe(s.inputRef, n, er()), b = st(s.inputRef), x = cn(), y = A(() => {
|
2687
2687
|
a.onChange(null), s.optionsRef.current && (s.optionsRef.current.scrollTop = 0), a.goToOption(B.Nothing);
|
2688
2688
|
}), S = q(() => {
|
2689
2689
|
var C;
|
2690
2690
|
return typeof c == "function" && s.value !== void 0 ? (C = c(s.value)) != null ? C : "" : typeof s.value == "string" ? s.value : "";
|
2691
2691
|
}, [s.value, c]);
|
2692
|
-
|
2692
|
+
jt(([C, J], [K, ie]) => {
|
2693
2693
|
if (s.isTyping) return;
|
2694
2694
|
let W = s.inputRef.current;
|
2695
|
-
W && ((
|
2696
|
-
if (s.isTyping || !W || (
|
2697
|
-
let { selectionStart:
|
2698
|
-
Math.abs((se ?? 0) - (
|
2695
|
+
W && ((ie === 0 && J === 1 || C !== K) && (W.value = C), requestAnimationFrame(() => {
|
2696
|
+
if (s.isTyping || !W || (b == null ? void 0 : b.activeElement) !== W) return;
|
2697
|
+
let { selectionStart: ne, selectionEnd: se } = W;
|
2698
|
+
Math.abs((se ?? 0) - (ne ?? 0)) === 0 && ne === 0 && W.setSelectionRange(W.value.length, W.value.length);
|
2699
2699
|
}));
|
2700
|
-
}, [S, s.comboboxState,
|
2700
|
+
}, [S, s.comboboxState, b, s.isTyping]), jt(([C], [J]) => {
|
2701
2701
|
if (C === 0 && J === 1) {
|
2702
2702
|
if (s.isTyping) return;
|
2703
2703
|
let K = s.inputRef.current;
|
2704
2704
|
if (!K) return;
|
2705
|
-
let
|
2706
|
-
K.value = "", K.value =
|
2705
|
+
let ie = K.value, { selectionStart: W, selectionEnd: ne, selectionDirection: se } = K;
|
2706
|
+
K.value = "", K.value = ie, se !== null ? K.setSelectionRange(W, ne, se) : K.setSelectionRange(W, ne);
|
2707
2707
|
}
|
2708
2708
|
}, [s.comboboxState]);
|
2709
|
-
let O = Y(!1),
|
2709
|
+
let O = Y(!1), D = A(() => {
|
2710
2710
|
O.current = !0;
|
2711
|
-
}),
|
2711
|
+
}), N = A(() => {
|
2712
2712
|
x.nextFrame(() => {
|
2713
2713
|
O.current = !1;
|
2714
2714
|
});
|
2715
|
-
}),
|
2715
|
+
}), M = A((C) => {
|
2716
2716
|
switch (a.setIsTyping(!0), C.key) {
|
2717
2717
|
case X.Enter:
|
2718
2718
|
if (s.comboboxState !== 0 || O.current) return;
|
@@ -2739,31 +2739,31 @@ function Dr(e, n) {
|
|
2739
2739
|
case X.PageDown:
|
2740
2740
|
return C.preventDefault(), C.stopPropagation(), a.goToOption(B.Last);
|
2741
2741
|
case X.Escape:
|
2742
|
-
return s.comboboxState !== 0 ? void 0 : (C.preventDefault(), s.optionsRef.current && !s.optionsPropsRef.current.static && C.stopPropagation(), s.mode === 0 && s.value === null &&
|
2742
|
+
return s.comboboxState !== 0 ? void 0 : (C.preventDefault(), s.optionsRef.current && !s.optionsPropsRef.current.static && C.stopPropagation(), s.mode === 0 && s.value === null && y(), a.closeCombobox());
|
2743
2743
|
case X.Tab:
|
2744
2744
|
if (s.comboboxState !== 0) return;
|
2745
2745
|
s.mode === 0 && s.activationTrigger !== 1 && a.selectActiveOption(), a.closeCombobox();
|
2746
2746
|
break;
|
2747
2747
|
}
|
2748
|
-
}),
|
2749
|
-
g == null || g(C), s.mode === 0 && C.target.value === "" &&
|
2750
|
-
}),
|
2751
|
-
var J, K,
|
2752
|
-
let W = (J = C.relatedTarget) != null ? J : we.find((
|
2753
|
-
if (!((K = s.optionsRef.current) != null && K.contains(W)) && !((
|
2754
|
-
}),
|
2755
|
-
var J, K,
|
2756
|
-
let W = (J = C.relatedTarget) != null ? J : we.find((
|
2757
|
-
(K = s.buttonRef.current) != null && K.contains(W) || (
|
2748
|
+
}), T = A((C) => {
|
2749
|
+
g == null || g(C), s.mode === 0 && C.target.value === "" && y(), a.openCombobox();
|
2750
|
+
}), $ = A((C) => {
|
2751
|
+
var J, K, ie;
|
2752
|
+
let W = (J = C.relatedTarget) != null ? J : we.find((ne) => ne !== C.currentTarget);
|
2753
|
+
if (!((K = s.optionsRef.current) != null && K.contains(W)) && !((ie = s.buttonRef.current) != null && ie.contains(W)) && s.comboboxState === 0) return C.preventDefault(), s.mode === 0 && s.value === null && y(), a.closeCombobox();
|
2754
|
+
}), z = A((C) => {
|
2755
|
+
var J, K, ie;
|
2756
|
+
let W = (J = C.relatedTarget) != null ? J : we.find((ne) => ne !== C.currentTarget);
|
2757
|
+
(K = s.buttonRef.current) != null && K.contains(W) || (ie = s.optionsRef.current) != null && ie.contains(W) || s.disabled || s.immediate && s.comboboxState !== 0 && x.microTask(() => {
|
2758
2758
|
ye(() => a.openCombobox()), a.setActivationTrigger(1);
|
2759
2759
|
});
|
2760
|
-
}),
|
2761
|
-
return xe({ ourProps: Ce, theirProps:
|
2760
|
+
}), P = Ct(), L = io(), { isFocused: V, focusProps: R } = un({ autoFocus: p }), { isHovered: k, hoverProps: I } = fn({ isDisabled: m }), te = q(() => ({ open: s.comboboxState === 0, disabled: m, hover: k, focus: V, autofocus: p }), [s, k, V, p, m]), Ce = Ot({ ref: w, id: d, role: "combobox", type: h, "aria-controls": (t = s.optionsRef.current) == null ? void 0 : t.id, "aria-expanded": s.comboboxState === 0, "aria-activedescendant": s.activeOptionIndex === null ? void 0 : s.virtual ? (o = s.options.find((C) => !C.dataRef.current.disabled && s.compare(C.dataRef.current.value, s.virtual.options[s.activeOptionIndex]))) == null ? void 0 : o.id : (i = s.options[s.activeOptionIndex]) == null ? void 0 : i.id, "aria-labelledby": P, "aria-describedby": L, "aria-autocomplete": "list", defaultValue: (l = (r = e.defaultValue) != null ? r : s.defaultValue !== void 0 ? c == null ? void 0 : c(s.defaultValue) : null) != null ? l : s.defaultValue, disabled: m || void 0, autoFocus: p, onCompositionStart: D, onCompositionEnd: N, onKeyDown: M, onChange: T, onFocus: z, onBlur: $ }, R, I);
|
2761
|
+
return xe({ ourProps: Ce, theirProps: v, slot: te, defaultTag: _r, name: "Combobox.Input" });
|
2762
2762
|
}
|
2763
2763
|
let $r = "button";
|
2764
2764
|
function Lr(e, n) {
|
2765
2765
|
var t;
|
2766
|
-
let o = $e("Combobox.Button"), i = Ge("Combobox.Button"), r = Oe(o.buttonRef, n), l = Ue(), { id: s = `headlessui-combobox-button-${l}`, disabled: a = o.disabled || !1, autoFocus: f = !1, ...u } = e, d =
|
2766
|
+
let o = $e("Combobox.Button"), i = Ge("Combobox.Button"), r = Oe(o.buttonRef, n), l = Ue(), { id: s = `headlessui-combobox-button-${l}`, disabled: a = o.disabled || !1, autoFocus: f = !1, ...u } = e, d = vn(o.inputRef), g = A((O) => {
|
2767
2767
|
switch (O.key) {
|
2768
2768
|
case X.Space:
|
2769
2769
|
case X.Enter:
|
@@ -2783,45 +2783,45 @@ function Lr(e, n) {
|
|
2783
2783
|
return;
|
2784
2784
|
}
|
2785
2785
|
}), c = A((O) => {
|
2786
|
-
O.preventDefault(), !ho(O.currentTarget) && (O.button ===
|
2787
|
-
}), m =
|
2788
|
-
return xe({ ourProps: S, theirProps: u, slot:
|
2786
|
+
O.preventDefault(), !ho(O.currentTarget) && (O.button === _t.Left && (o.comboboxState === 0 ? i.closeCombobox() : i.openCombobox()), d());
|
2787
|
+
}), m = Ct([s]), { isFocusVisible: p, focusProps: h } = un({ autoFocus: f }), { isHovered: v, hoverProps: w } = fn({ isDisabled: a }), { pressed: b, pressProps: x } = Gn({ disabled: a }), y = q(() => ({ open: o.comboboxState === 0, active: b || o.comboboxState === 0, disabled: a, value: o.value, hover: v, focus: p }), [o, v, p, b, a]), S = Ot({ ref: r, id: s, type: co(e, o.buttonRef), tabIndex: -1, "aria-haspopup": "listbox", "aria-controls": (t = o.optionsRef.current) == null ? void 0 : t.id, "aria-expanded": o.comboboxState === 0, "aria-labelledby": m, disabled: a || void 0, autoFocus: f, onMouseDown: c, onKeyDown: g }, h, w, x);
|
2788
|
+
return xe({ ourProps: S, theirProps: u, slot: y, defaultTag: $r, name: "Combobox.Button" });
|
2789
2789
|
}
|
2790
|
-
let Fr = "div", Nr =
|
2791
|
-
function
|
2790
|
+
let Fr = "div", Nr = Nt.RenderStrategy | Nt.Static;
|
2791
|
+
function zr(e, n) {
|
2792
2792
|
var t, o, i;
|
2793
2793
|
let r = Ue(), { id: l = `headlessui-combobox-options-${r}`, hold: s = !1, anchor: a, portal: f = !1, modal: u = !0, transition: d = !1, ...g } = e, c = $e("Combobox.Options"), m = Ge("Combobox.Options"), p = Zi(a);
|
2794
2794
|
p && (f = !0);
|
2795
|
-
let [h,
|
2795
|
+
let [h, v] = nr(p), w = tr(), b = Oe(c.optionsRef, n, p ? h : null), x = st(c.optionsRef), y = fo(), [S, O] = po(d, c.optionsRef, y !== null ? (y & et.Open) === et.Open : c.comboboxState === 0);
|
2796
2796
|
$o(S, c.inputRef, m.closeCombobox);
|
2797
|
-
let
|
2798
|
-
jo(
|
2799
|
-
let
|
2800
|
-
Do(
|
2801
|
-
var
|
2802
|
-
c.optionsPropsRef.current.static = (
|
2797
|
+
let D = c.__demoMode ? !1 : u && c.comboboxState === 0;
|
2798
|
+
jo(D, x);
|
2799
|
+
let N = c.__demoMode ? !1 : u && c.comboboxState === 0;
|
2800
|
+
Do(N, { allowed: A(() => [c.inputRef.current, c.buttonRef.current, c.optionsRef.current]) }), U(() => {
|
2801
|
+
var I;
|
2802
|
+
c.optionsPropsRef.current.static = (I = e.static) != null ? I : !1;
|
2803
2803
|
}, [c.optionsPropsRef, e.static]), U(() => {
|
2804
2804
|
c.optionsPropsRef.current.hold = s;
|
2805
|
-
}, [c.optionsPropsRef, s]), Yo(c.comboboxState === 0, { container: c.optionsRef.current, accept(
|
2806
|
-
return
|
2807
|
-
}, walk(
|
2808
|
-
|
2805
|
+
}, [c.optionsPropsRef, s]), Yo(c.comboboxState === 0, { container: c.optionsRef.current, accept(I) {
|
2806
|
+
return I.getAttribute("role") === "option" ? NodeFilter.FILTER_REJECT : I.hasAttribute("role") ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;
|
2807
|
+
}, walk(I) {
|
2808
|
+
I.setAttribute("role", "none");
|
2809
2809
|
} });
|
2810
|
-
let
|
2810
|
+
let M = Ct([(t = c.buttonRef.current) == null ? void 0 : t.id]), T = q(() => ({ open: c.comboboxState === 0, option: void 0 }), [c.comboboxState]), $ = A(() => {
|
2811
2811
|
m.setActivationTrigger(0);
|
2812
|
-
}),
|
2813
|
-
|
2814
|
-
}),
|
2812
|
+
}), z = A((I) => {
|
2813
|
+
I.preventDefault(), m.setActivationTrigger(0);
|
2814
|
+
}), P = Ot(p ? w() : {}, { "aria-labelledby": M, role: "listbox", "aria-multiselectable": c.mode === 1 ? !0 : void 0, id: l, ref: b, style: { ...g.style, ...v, "--input-width": kt(c.inputRef, !0).width, "--button-width": kt(c.buttonRef, !0).width }, onWheel: c.activationTrigger === 0 ? void 0 : $, onMouseDown: z, ...mo(O) }), L = S && c.comboboxState === 1, V = yt(L, (o = c.virtual) == null ? void 0 : o.options), R = yt(L, c.value), k = A((I) => c.compare(R, I));
|
2815
2815
|
if (c.virtual) {
|
2816
2816
|
if (V === void 0) throw new Error("Missing `options` in virtual mode");
|
2817
|
-
Object.assign(g, { children: j.createElement(je.Provider, { value: V !== c.virtual.options ? { ...c, virtual: { ...c.virtual, options: V } } : c }, j.createElement(Ir, { slot:
|
2817
|
+
Object.assign(g, { children: j.createElement(je.Provider, { value: V !== c.virtual.options ? { ...c, virtual: { ...c.virtual, options: V } } : c }, j.createElement(Ir, { slot: T }, g.children)) });
|
2818
2818
|
}
|
2819
|
-
return j.createElement(Er, { enabled: f ? e.static || S : !1 }, j.createElement(je.Provider, { value: c.mode === 1 ? c : { ...c, isSelected: k } }, xe({ ourProps:
|
2819
|
+
return j.createElement(Er, { enabled: f ? e.static || S : !1 }, j.createElement(je.Provider, { value: c.mode === 1 ? c : { ...c, isSelected: k } }, xe({ ourProps: P, theirProps: { ...g, children: j.createElement(sr, { freeze: L }, typeof g.children == "function" ? (i = g.children) == null ? void 0 : i.call(g, T) : g.children) }, slot: T, defaultTag: Fr, features: Nr, visible: S, name: "Combobox.Options" })));
|
2820
2820
|
}
|
2821
|
-
let
|
2821
|
+
let kr = "div";
|
2822
2822
|
function Hr(e, n) {
|
2823
2823
|
var t, o, i, r;
|
2824
|
-
let l = $e("Combobox.Option"), s = Ge("Combobox.Option"), a = Ue(), { id: f = `headlessui-combobox-option-${a}`, value: u, disabled: d = (i = (o = (t = l.virtual) == null ? void 0 : t.disabled) == null ? void 0 : o.call(t, u)) != null ? i : !1, order: g = null, ...c } = e, m =
|
2824
|
+
let l = $e("Combobox.Option"), s = Ge("Combobox.Option"), a = Ue(), { id: f = `headlessui-combobox-option-${a}`, value: u, disabled: d = (i = (o = (t = l.virtual) == null ? void 0 : t.disabled) == null ? void 0 : o.call(t, u)) != null ? i : !1, order: g = null, ...c } = e, m = vn(l.inputRef), p = l.virtual ? l.activeOptionIndex === l.calculateIndex(u) : l.activeOptionIndex === null ? !1 : ((r = l.options[l.activeOptionIndex]) == null ? void 0 : r.id) === f, h = l.isSelected(u), v = Y(null), w = Ae({ disabled: d, value: u, domRef: v, order: g }), b = ae(Ln), x = Oe(n, v, b ? b.measureElement : null), y = A(() => {
|
2825
2825
|
s.setIsTyping(!1), s.onChange(u);
|
2826
2826
|
});
|
2827
2827
|
U(() => s.registerOption(f, w), [w, f]);
|
@@ -2832,26 +2832,26 @@ function Hr(e, n) {
|
|
2832
2832
|
});
|
2833
2833
|
}, [l.virtual, l.__demoMode]), U(() => {
|
2834
2834
|
if (S.current && l.comboboxState === 0 && p && l.activationTrigger !== 0) return Me().requestAnimationFrame(() => {
|
2835
|
-
var
|
2836
|
-
(L = (
|
2835
|
+
var P, L;
|
2836
|
+
(L = (P = v.current) == null ? void 0 : P.scrollIntoView) == null || L.call(P, { block: "nearest" });
|
2837
2837
|
});
|
2838
|
-
}, [
|
2839
|
-
let O = A((
|
2840
|
-
|
2841
|
-
}),
|
2838
|
+
}, [v, p, l.comboboxState, l.activationTrigger, l.activeOptionIndex]);
|
2839
|
+
let O = A((P) => {
|
2840
|
+
P.preventDefault(), P.button === _t.Left && (d || (y(), gn() || requestAnimationFrame(() => m()), l.mode === 0 && s.closeCombobox()));
|
2841
|
+
}), D = A(() => {
|
2842
2842
|
if (d) return s.goToOption(B.Nothing);
|
2843
|
-
let
|
2844
|
-
s.goToOption(B.Specific,
|
2845
|
-
}),
|
2846
|
-
if (!
|
2843
|
+
let P = l.calculateIndex(u);
|
2844
|
+
s.goToOption(B.Specific, P);
|
2845
|
+
}), N = Uo(), M = A((P) => N.update(P)), T = A((P) => {
|
2846
|
+
if (!N.wasMoved(P) || d || p) return;
|
2847
2847
|
let L = l.calculateIndex(u);
|
2848
2848
|
s.goToOption(B.Specific, L, 0);
|
2849
|
-
}),
|
2850
|
-
|
2851
|
-
}),
|
2852
|
-
return xe({ ourProps: { id: f, ref: x, role: "option", tabIndex: d === !0 ? void 0 : -1, "aria-disabled": d === !0 ? !0 : void 0, "aria-selected": h, disabled: void 0, onMouseDown: O, onFocus:
|
2849
|
+
}), $ = A((P) => {
|
2850
|
+
N.wasMoved(P) && (d || p && (l.optionsPropsRef.current.hold || s.goToOption(B.Nothing)));
|
2851
|
+
}), z = q(() => ({ active: p, focus: p, selected: h, disabled: d }), [p, h, d]);
|
2852
|
+
return xe({ ourProps: { id: f, ref: x, role: "option", tabIndex: d === !0 ? void 0 : -1, "aria-disabled": d === !0 ? !0 : void 0, "aria-selected": h, disabled: void 0, onMouseDown: O, onFocus: D, onPointerEnter: M, onMouseEnter: M, onPointerMove: T, onMouseMove: T, onPointerLeave: $, onMouseLeave: $ }, theirProps: c, slot: z, defaultTag: kr, name: "Combobox.Option" });
|
2853
2853
|
}
|
2854
|
-
let Vr = be(Ar),
|
2854
|
+
let Vr = be(Ar), Et = be(Lr), Rt = be(Dr), Wr = Xn, Fn = be(zr), Nn = be(Hr), Br = Object.assign(Vr, { Input: Rt, Button: Et, Label: Wr, Options: Fn, Option: Nn });
|
2855
2855
|
const jr = "_disabled_a63ul_5", Ur = "_container_a63ul_9", Yr = "_full_a63ul_22", Kr = "_button_a63ul_34", qr = "_options_a63ul_52", Gr = "_top_a63ul_63", Jr = "_bottom_a63ul_68", Xr = "_m_a63ul_95", Qr = "_l_a63ul_108", Zr = "_option_a63ul_52", F = {
|
2856
2856
|
"select-search": "_select-search_a63ul_2",
|
2857
2857
|
disabled: jr,
|
@@ -2872,7 +2872,7 @@ const jr = "_disabled_a63ul_5", Ur = "_container_a63ul_9", Yr = "_full_a63ul_22"
|
|
2872
2872
|
option: Zr,
|
2873
2873
|
"option-active": "_option-active_a63ul_137",
|
2874
2874
|
"option-inner": "_option-inner_a63ul_140"
|
2875
|
-
}, vs =
|
2875
|
+
}, vs = jn(
|
2876
2876
|
(e, n) => {
|
2877
2877
|
const {
|
2878
2878
|
placeholder: t,
|
@@ -2890,8 +2890,9 @@ const jr = "_disabled_a63ul_5", Ur = "_container_a63ul_9", Yr = "_full_a63ul_22"
|
|
2890
2890
|
menuPlacement: m = "bottom",
|
2891
2891
|
disabled: p = !1,
|
2892
2892
|
searchProps: h,
|
2893
|
-
withClearButton:
|
2894
|
-
|
2893
|
+
withClearButton: v = !1,
|
2894
|
+
disableInput: w = !1
|
2895
|
+
} = e, b = String((i == null ? void 0 : i[u]) || ""), [x, y] = ue(b), S = (M) => {
|
2895
2896
|
switch (M) {
|
2896
2897
|
case Le.M:
|
2897
2898
|
return ft.M;
|
@@ -2900,20 +2901,21 @@ const jr = "_disabled_a63ul_5", Ur = "_container_a63ul_9", Yr = "_full_a63ul_22"
|
|
2900
2901
|
default:
|
2901
2902
|
return ft.M;
|
2902
2903
|
}
|
2903
|
-
},
|
2904
|
-
(M) => M.name.toLowerCase().includes(
|
2905
|
-
) : a, [
|
2906
|
-
M ? (
|
2907
|
-
},
|
2904
|
+
}, O = q(() => !d || i && (i.id || i.name) ? a : x.trim().toLowerCase() ? a.filter(
|
2905
|
+
(M) => M.name.toLowerCase().includes(x.toLowerCase())
|
2906
|
+
) : a, [x, a, i, d]), D = (M) => {
|
2907
|
+
M ? (y(M.name), r == null || r(M)) : (y(""), r == null || r({ id: "", name: "" }));
|
2908
|
+
}, N = He(
|
2908
2909
|
(M) => {
|
2909
|
-
|
2910
|
-
|
2910
|
+
if (w) return;
|
2911
|
+
const T = M.target.value;
|
2912
|
+
y(T), g == null || g(T), !T && i && (r == null || r({ id: "", name: "" }));
|
2911
2913
|
},
|
2912
|
-
[r, g, i]
|
2914
|
+
[w, r, g, i]
|
2913
2915
|
);
|
2914
|
-
return
|
2915
|
-
|
2916
|
-
}, [
|
2916
|
+
return oe(() => {
|
2917
|
+
y(b);
|
2918
|
+
}, [b]), /* @__PURE__ */ Q(
|
2917
2919
|
Br,
|
2918
2920
|
{
|
2919
2921
|
as: "div",
|
@@ -2922,10 +2924,10 @@ const jr = "_disabled_a63ul_5", Ur = "_container_a63ul_9", Yr = "_full_a63ul_22"
|
|
2922
2924
|
[F.full]: l,
|
2923
2925
|
[F.disabled]: p
|
2924
2926
|
}),
|
2925
|
-
onChange:
|
2927
|
+
onChange: D,
|
2926
2928
|
ref: n,
|
2927
2929
|
disabled: p,
|
2928
|
-
virtual: { options:
|
2930
|
+
virtual: { options: O },
|
2929
2931
|
children: ({ open: M }) => /* @__PURE__ */ Xe(ut, { children: [
|
2930
2932
|
/* @__PURE__ */ Xe(
|
2931
2933
|
"div",
|
@@ -2934,31 +2936,57 @@ const jr = "_disabled_a63ul_5", Ur = "_container_a63ul_9", Yr = "_full_a63ul_22"
|
|
2934
2936
|
[F["container-open"]]: M
|
2935
2937
|
}),
|
2936
2938
|
children: [
|
2937
|
-
/* @__PURE__ */
|
2938
|
-
|
2939
|
+
w && /* @__PURE__ */ Q(Et, { disabled: p, style: { width: "100%" }, children: /* @__PURE__ */ Q(
|
2940
|
+
Rt,
|
2941
|
+
{
|
2942
|
+
as: Ft,
|
2943
|
+
label: t,
|
2944
|
+
size: S(o),
|
2945
|
+
className: F["custom-input-class"],
|
2946
|
+
onChange: N,
|
2947
|
+
value: x,
|
2948
|
+
disabled: p,
|
2949
|
+
variant: c,
|
2950
|
+
withClearButton: v,
|
2951
|
+
"data-testid": "select-search-input",
|
2952
|
+
onFocus: (T) => {
|
2953
|
+
w && T.target.blur();
|
2954
|
+
},
|
2955
|
+
rightAddon: {
|
2956
|
+
addonType: "icon",
|
2957
|
+
addonContent: M ? "DropdownArrowUp16px" : "DropdownArrowBottom16px"
|
2958
|
+
},
|
2959
|
+
...h
|
2960
|
+
}
|
2961
|
+
) }),
|
2962
|
+
!w && /* @__PURE__ */ Q(
|
2963
|
+
Rt,
|
2939
2964
|
{
|
2940
|
-
as:
|
2965
|
+
as: Ft,
|
2941
2966
|
label: t,
|
2942
|
-
size:
|
2967
|
+
size: S(o),
|
2943
2968
|
className: F["custom-input-class"],
|
2944
|
-
onChange:
|
2945
|
-
value:
|
2969
|
+
onChange: N,
|
2970
|
+
value: x,
|
2946
2971
|
disabled: p,
|
2947
2972
|
variant: c,
|
2948
|
-
withClearButton:
|
2973
|
+
withClearButton: v,
|
2949
2974
|
"data-testid": "select-search-input",
|
2975
|
+
onFocus: (T) => {
|
2976
|
+
w && T.target.blur();
|
2977
|
+
},
|
2950
2978
|
...h
|
2951
2979
|
}
|
2952
2980
|
),
|
2953
|
-
s && /* @__PURE__ */
|
2954
|
-
|
2981
|
+
s && !w && /* @__PURE__ */ Q(
|
2982
|
+
Et,
|
2955
2983
|
{
|
2956
2984
|
className: de(F.button, {
|
2957
2985
|
[F.disabled]: p
|
2958
2986
|
}),
|
2959
2987
|
disabled: p,
|
2960
|
-
children: /* @__PURE__ */
|
2961
|
-
|
2988
|
+
children: /* @__PURE__ */ Q(
|
2989
|
+
Lt,
|
2962
2990
|
{
|
2963
2991
|
iconName: o == Le.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
|
2964
2992
|
className: de(F["selector-icon"], {
|
@@ -2971,8 +2999,8 @@ const jr = "_disabled_a63ul_5", Ur = "_container_a63ul_9", Yr = "_full_a63ul_22"
|
|
2971
2999
|
]
|
2972
3000
|
}
|
2973
3001
|
),
|
2974
|
-
M && /* @__PURE__ */
|
2975
|
-
|
3002
|
+
M && /* @__PURE__ */ Q(ut, { children: a.length ? O.length ? /* @__PURE__ */ Q(
|
3003
|
+
Fn,
|
2976
3004
|
{
|
2977
3005
|
"data-testid": "select-search-options",
|
2978
3006
|
className: de(
|
@@ -2980,26 +3008,26 @@ const jr = "_disabled_a63ul_5", Ur = "_container_a63ul_9", Yr = "_full_a63ul_22"
|
|
2980
3008
|
F[o],
|
2981
3009
|
F[m]
|
2982
3010
|
),
|
2983
|
-
children: ({ option:
|
2984
|
-
|
3011
|
+
children: ({ option: T }) => /* @__PURE__ */ Q(
|
3012
|
+
Nn,
|
2985
3013
|
{
|
2986
|
-
value:
|
2987
|
-
className: ({ focus:
|
3014
|
+
value: T,
|
3015
|
+
className: ({ focus: $ }) => de(
|
2988
3016
|
F.option,
|
2989
3017
|
f,
|
2990
3018
|
o && F[o],
|
2991
3019
|
{
|
2992
|
-
[F["option-active"]]:
|
3020
|
+
[F["option-active"]]: $
|
2993
3021
|
}
|
2994
3022
|
),
|
2995
|
-
"data-testid": `select-search-option-${
|
2996
|
-
children: ({ selected:
|
3023
|
+
"data-testid": `select-search-option-${T.id}`,
|
3024
|
+
children: ({ selected: $ }) => /* @__PURE__ */ Xe(ut, { children: [
|
2997
3025
|
/* @__PURE__ */ Xe("div", { className: F["option-inner"], children: [
|
2998
|
-
|
2999
|
-
|
3026
|
+
T.name,
|
3027
|
+
T.bottom && /* @__PURE__ */ Q("div", { children: T.bottom })
|
3000
3028
|
] }),
|
3001
|
-
|
3002
|
-
|
3029
|
+
$ && /* @__PURE__ */ Q(
|
3030
|
+
Lt,
|
3003
3031
|
{
|
3004
3032
|
iconName: o === Le.M ? "Done16px" : "Done24px",
|
3005
3033
|
className: F["selected-icon"]
|
@@ -3007,10 +3035,10 @@ const jr = "_disabled_a63ul_5", Ur = "_container_a63ul_9", Yr = "_full_a63ul_22"
|
|
3007
3035
|
)
|
3008
3036
|
] })
|
3009
3037
|
},
|
3010
|
-
|
3038
|
+
T.id
|
3011
3039
|
)
|
3012
3040
|
}
|
3013
|
-
) : /* @__PURE__ */
|
3041
|
+
) : /* @__PURE__ */ Q(
|
3014
3042
|
"div",
|
3015
3043
|
{
|
3016
3044
|
className: de(
|
@@ -3020,7 +3048,7 @@ const jr = "_disabled_a63ul_5", Ur = "_container_a63ul_9", Yr = "_full_a63ul_22"
|
|
3020
3048
|
),
|
3021
3049
|
children: "Ничего не найдено"
|
3022
3050
|
}
|
3023
|
-
) : /* @__PURE__ */
|
3051
|
+
) : /* @__PURE__ */ Q(
|
3024
3052
|
"div",
|
3025
3053
|
{
|
3026
3054
|
className: de(
|