@g4rcez/components 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MotionConfigContext-C7MqlSdv.js +2713 -0
- package/dist/MotionConfigContext-C7MqlSdv.js.map +1 -0
- package/dist/autocomplete-Boida9R7.js +375 -0
- package/dist/autocomplete-Boida9R7.js.map +1 -0
- package/dist/calendar-BswV66Nx.js +1719 -0
- package/dist/calendar-BswV66Nx.js.map +1 -0
- package/dist/chevron-down-BBFYYzZq.js +6 -0
- package/dist/chevron-down-BBFYYzZq.js.map +1 -0
- package/dist/chevron-right-DvXGOiS_.js +6 -0
- package/dist/chevron-right-DvXGOiS_.js.map +1 -0
- package/dist/circle-check-big-3M5lhTxx.js +9 -0
- package/dist/circle-check-big-3M5lhTxx.js.map +1 -0
- package/dist/components/core/button.js +76 -0
- package/dist/components/core/button.js.map +1 -0
- package/dist/components/core/tag.js +67 -0
- package/dist/components/core/tag.js.map +1 -0
- package/dist/components/display/alert.js +94 -0
- package/dist/components/display/alert.js.map +1 -0
- package/dist/components/display/calendar.js +15 -0
- package/dist/components/display/calendar.js.map +1 -0
- package/dist/components/display/card.js +84 -0
- package/dist/components/display/card.js.map +1 -0
- package/dist/components/display/list.js +93 -0
- package/dist/components/display/list.js.map +1 -0
- package/dist/components/display/notifications.js +15 -0
- package/dist/components/display/notifications.js.map +1 -0
- package/dist/components/display/stats.js +16 -0
- package/dist/components/display/stats.js.map +1 -0
- package/dist/components/display/tabs.js +12 -0
- package/dist/components/display/tabs.js.map +1 -0
- package/dist/components/display/timeline.js +29 -0
- package/dist/components/display/timeline.js.map +1 -0
- package/dist/components/floating/dropdown.js +58 -0
- package/dist/components/floating/dropdown.js.map +1 -0
- package/dist/components/floating/expand.js +41 -0
- package/dist/components/floating/expand.js.map +1 -0
- package/dist/components/floating/menu.js +177 -0
- package/dist/components/floating/menu.js.map +1 -0
- package/dist/components/floating/modal.js +297 -0
- package/dist/components/floating/modal.js.map +1 -0
- package/dist/components/floating/tooltip.js +73 -0
- package/dist/components/floating/tooltip.js.map +1 -0
- package/dist/components/form/autocomplete.js +16 -0
- package/dist/components/form/autocomplete.js.map +1 -0
- package/dist/components/form/checkbox.js +44 -0
- package/dist/components/form/checkbox.js.map +1 -0
- package/dist/components/form/date-picker.js +12 -0
- package/dist/components/form/date-picker.js.map +1 -0
- package/dist/components/form/file-upload.js +11 -0
- package/dist/components/form/file-upload.js.map +1 -0
- package/dist/components/form/form.js +8 -0
- package/dist/components/form/form.js.map +1 -0
- package/dist/components/form/input.js +5 -0
- package/dist/components/form/input.js.map +1 -0
- package/dist/components/form/radiobox.js +30 -0
- package/dist/components/form/radiobox.js.map +1 -0
- package/dist/components/form/select.js +106 -0
- package/dist/components/form/select.js.map +1 -0
- package/dist/components/form/switch.js +65 -0
- package/dist/components/form/switch.js.map +1 -0
- package/dist/components/form/task-list.js +68 -0
- package/dist/components/form/task-list.js.map +1 -0
- package/dist/components/form/transfer-list.js +55 -0
- package/dist/components/form/transfer-list.js.map +1 -0
- package/dist/components/table/table.js +10 -0
- package/dist/components/table/table.js.map +1 -0
- package/dist/constants-r-AHn273.js +6 -0
- package/dist/constants-r-AHn273.js.map +1 -0
- package/dist/context-BFXNJVn2.js +161 -0
- package/dist/context-BFXNJVn2.js.map +1 -0
- package/dist/createLucideIcon-CP-mMPfa.js +76 -0
- package/dist/createLucideIcon-CP-mMPfa.js.map +1 -0
- package/dist/date-picker-BxPTdZPy.js +1598 -0
- package/dist/date-picker-BxPTdZPy.js.map +1 -0
- package/dist/dom-Dl8XH0CK.js +2833 -0
- package/dist/dom-Dl8XH0CK.js.map +1 -0
- package/dist/file-CBCP85VI.js +15 -0
- package/dist/file-CBCP85VI.js.map +1 -0
- package/dist/file-upload-BB6BdGcE.js +3118 -0
- package/dist/file-upload-BB6BdGcE.js.map +1 -0
- package/dist/floating-ui.react-DycKASR0.js +3706 -0
- package/dist/floating-ui.react-DycKASR0.js.map +1 -0
- package/dist/fns-D2eyJKd5.js +33 -0
- package/dist/fns-D2eyJKd5.js.map +1 -0
- package/dist/index-0YMC-_Lt.js +20 -0
- package/dist/index-0YMC-_Lt.js.map +1 -0
- package/dist/index-BJ1ayTam.js +126 -0
- package/dist/index-BJ1ayTam.js.map +1 -0
- package/dist/index-BtlhELJ3.js +3416 -0
- package/dist/index-BtlhELJ3.js.map +1 -0
- package/dist/index-ChfR6F8d.js +1590 -0
- package/dist/index-ChfR6F8d.js.map +1 -0
- package/dist/index-DE4shK8D.js +215 -0
- package/dist/index-DE4shK8D.js.map +1 -0
- package/dist/index-DJSMaZR4.js +35 -0
- package/dist/index-DJSMaZR4.js.map +1 -0
- package/dist/index-t1qLJTt5.js +351 -0
- package/dist/index-t1qLJTt5.js.map +1 -0
- package/dist/index.esm-BaIwleSE.js +343 -0
- package/dist/index.esm-BaIwleSE.js.map +1 -0
- package/dist/index.js +8049 -27
- package/dist/index.js.map +1 -1
- package/dist/info-N5jWZg2A.js +10 -0
- package/dist/info-N5jWZg2A.js.map +1 -0
- package/dist/input-CoJoHIhd.js +441 -0
- package/dist/input-CoJoHIhd.js.map +1 -0
- package/dist/input-field-DTeIrwpK.js +146 -0
- package/dist/input-field-DTeIrwpK.js.map +1 -0
- package/dist/notifications-NPuFDsBp.js +2550 -0
- package/dist/notifications-NPuFDsBp.js.map +1 -0
- package/dist/polymorph-B5n9fs_K.js +10 -0
- package/dist/polymorph-B5n9fs_K.js.map +1 -0
- package/dist/proxy-BZcQiBrp.js +2495 -0
- package/dist/proxy-BZcQiBrp.js.map +1 -0
- package/dist/skeleton-D75GFBV6.js +10 -0
- package/dist/skeleton-D75GFBV6.js.map +1 -0
- package/dist/slot-CQW8ZzBb.js +79 -0
- package/dist/slot-CQW8ZzBb.js.map +1 -0
- package/dist/styles/common.js +29 -0
- package/dist/styles/dark.js +214 -0
- package/dist/styles/design-tokens.js +98 -0
- package/dist/styles/light.js +214 -0
- package/dist/styles/theme.js +4 -0
- package/dist/styles/theme.types.js +1 -0
- package/dist/tabs-ccIA7vMo.js +106 -0
- package/dist/tabs-ccIA7vMo.js.map +1 -0
- package/dist/triangle-alert-CHMhQ6yd.js +16 -0
- package/dist/triangle-alert-CHMhQ6yd.js.map +1 -0
- package/dist/use-motion-value-eGwNuWuw.js +14 -0
- package/dist/use-motion-value-eGwNuWuw.js.map +1 -0
- package/dist/use-stable-ref-CYh-YkID.js +11 -0
- package/dist/use-stable-ref-CYh-YkID.js.map +1 -0
- package/dist/use-translations-BwLKTrZv.js +10 -0
- package/dist/use-translations-BwLKTrZv.js.map +1 -0
- package/dist/x-B9bYxG31.js +9 -0
- package/dist/x-B9bYxG31.js.map +1 -0
- package/package.json +3 -4
- package/dist/index.mjs +0 -37108
- package/dist/index.mjs.map +0 -1
- package/dist/index.umd.js +0 -28
- package/dist/index.umd.js.map +0 -1
|
@@ -0,0 +1,3706 @@
|
|
|
1
|
+
import * as g from "react";
|
|
2
|
+
import { useLayoutEffect as Xn } from "react";
|
|
3
|
+
import { a as qn, b as ce, t as It, d as Ue, i as Z, e as Le, g as Se, f as fn, h as Ce, j as Xt, k as Xe, l as We, m as Or, n as Gn, o as Ir, p as rt, q as qt, r as Pt, s as Gt, c as Pr, u as Zn, v as Mr } from "./index.esm-BaIwleSE.js";
|
|
4
|
+
import { jsxs as Zt, jsx as be, Fragment as Ar } from "react/jsx-runtime";
|
|
5
|
+
import * as Jt from "react-dom";
|
|
6
|
+
const Sr = ["top", "right", "bottom", "left"], dn = ["start", "end"], mn = /* @__PURE__ */ Sr.reduce((e, t) => e.concat(t, t + "-" + dn[0], t + "-" + dn[1]), []), Fe = Math.min, Re = Math.max, wt = Math.round, je = Math.floor, Pe = (e) => ({
|
|
7
|
+
x: e,
|
|
8
|
+
y: e
|
|
9
|
+
}), Lr = {
|
|
10
|
+
left: "right",
|
|
11
|
+
right: "left",
|
|
12
|
+
bottom: "top",
|
|
13
|
+
top: "bottom"
|
|
14
|
+
}, kr = {
|
|
15
|
+
start: "end",
|
|
16
|
+
end: "start"
|
|
17
|
+
};
|
|
18
|
+
function Ut(e, t, n) {
|
|
19
|
+
return Re(e, Fe(t, n));
|
|
20
|
+
}
|
|
21
|
+
function Ke(e, t) {
|
|
22
|
+
return typeof e == "function" ? e(t) : e;
|
|
23
|
+
}
|
|
24
|
+
function Me(e) {
|
|
25
|
+
return e.split("-")[0];
|
|
26
|
+
}
|
|
27
|
+
function Ee(e) {
|
|
28
|
+
return e.split("-")[1];
|
|
29
|
+
}
|
|
30
|
+
function Jn(e) {
|
|
31
|
+
return e === "x" ? "y" : "x";
|
|
32
|
+
}
|
|
33
|
+
function Qt(e) {
|
|
34
|
+
return e === "y" ? "height" : "width";
|
|
35
|
+
}
|
|
36
|
+
const Dr = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
37
|
+
function Ae(e) {
|
|
38
|
+
return Dr.has(Me(e)) ? "y" : "x";
|
|
39
|
+
}
|
|
40
|
+
function en(e) {
|
|
41
|
+
return Jn(Ae(e));
|
|
42
|
+
}
|
|
43
|
+
function Qn(e, t, n) {
|
|
44
|
+
n === void 0 && (n = !1);
|
|
45
|
+
const r = Ee(e), o = en(e), i = Qt(o);
|
|
46
|
+
let s = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
|
|
47
|
+
return t.reference[i] > t.floating[i] && (s = xt(s)), [s, xt(s)];
|
|
48
|
+
}
|
|
49
|
+
function Fr(e) {
|
|
50
|
+
const t = xt(e);
|
|
51
|
+
return [Rt(e), t, Rt(t)];
|
|
52
|
+
}
|
|
53
|
+
function Rt(e) {
|
|
54
|
+
return e.replace(/start|end/g, (t) => kr[t]);
|
|
55
|
+
}
|
|
56
|
+
const gn = ["left", "right"], pn = ["right", "left"], Nr = ["top", "bottom"], _r = ["bottom", "top"];
|
|
57
|
+
function Wr(e, t, n) {
|
|
58
|
+
switch (e) {
|
|
59
|
+
case "top":
|
|
60
|
+
case "bottom":
|
|
61
|
+
return n ? t ? pn : gn : t ? gn : pn;
|
|
62
|
+
case "left":
|
|
63
|
+
case "right":
|
|
64
|
+
return t ? Nr : _r;
|
|
65
|
+
default:
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function $r(e, t, n, r) {
|
|
70
|
+
const o = Ee(e);
|
|
71
|
+
let i = Wr(Me(e), n === "start", r);
|
|
72
|
+
return o && (i = i.map((s) => s + "-" + o), t && (i = i.concat(i.map(Rt)))), i;
|
|
73
|
+
}
|
|
74
|
+
function xt(e) {
|
|
75
|
+
return e.replace(/left|right|bottom|top/g, (t) => Lr[t]);
|
|
76
|
+
}
|
|
77
|
+
function Br(e) {
|
|
78
|
+
return {
|
|
79
|
+
top: 0,
|
|
80
|
+
right: 0,
|
|
81
|
+
bottom: 0,
|
|
82
|
+
left: 0,
|
|
83
|
+
...e
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function er(e) {
|
|
87
|
+
return typeof e != "number" ? Br(e) : {
|
|
88
|
+
top: e,
|
|
89
|
+
right: e,
|
|
90
|
+
bottom: e,
|
|
91
|
+
left: e
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function Et(e) {
|
|
95
|
+
const {
|
|
96
|
+
x: t,
|
|
97
|
+
y: n,
|
|
98
|
+
width: r,
|
|
99
|
+
height: o
|
|
100
|
+
} = e;
|
|
101
|
+
return {
|
|
102
|
+
width: r,
|
|
103
|
+
height: o,
|
|
104
|
+
top: n,
|
|
105
|
+
left: t,
|
|
106
|
+
right: t + r,
|
|
107
|
+
bottom: n + o,
|
|
108
|
+
x: t,
|
|
109
|
+
y: n
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function tn() {
|
|
113
|
+
const e = navigator.userAgentData;
|
|
114
|
+
return e != null && e.platform ? e.platform : navigator.platform;
|
|
115
|
+
}
|
|
116
|
+
function tr() {
|
|
117
|
+
const e = navigator.userAgentData;
|
|
118
|
+
return e && Array.isArray(e.brands) ? e.brands.map((t) => {
|
|
119
|
+
let {
|
|
120
|
+
brand: n,
|
|
121
|
+
version: r
|
|
122
|
+
} = t;
|
|
123
|
+
return n + "/" + r;
|
|
124
|
+
}).join(" ") : navigator.userAgent;
|
|
125
|
+
}
|
|
126
|
+
function nr() {
|
|
127
|
+
return /apple/i.test(navigator.vendor);
|
|
128
|
+
}
|
|
129
|
+
function Yt() {
|
|
130
|
+
const e = /android/i;
|
|
131
|
+
return e.test(tn()) || e.test(tr());
|
|
132
|
+
}
|
|
133
|
+
function Vr() {
|
|
134
|
+
return tn().toLowerCase().startsWith("mac") && !navigator.maxTouchPoints;
|
|
135
|
+
}
|
|
136
|
+
function rr() {
|
|
137
|
+
return tr().includes("jsdom/");
|
|
138
|
+
}
|
|
139
|
+
const hn = "data-floating-ui-focusable", Kr = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])", Lt = "ArrowLeft", kt = "ArrowRight", Hr = "ArrowUp", jr = "ArrowDown";
|
|
140
|
+
function Oe(e) {
|
|
141
|
+
let t = e.activeElement;
|
|
142
|
+
for (; ((n = t) == null || (n = n.shadowRoot) == null ? void 0 : n.activeElement) != null; ) {
|
|
143
|
+
var n;
|
|
144
|
+
t = t.shadowRoot.activeElement;
|
|
145
|
+
}
|
|
146
|
+
return t;
|
|
147
|
+
}
|
|
148
|
+
function ue(e, t) {
|
|
149
|
+
if (!e || !t)
|
|
150
|
+
return !1;
|
|
151
|
+
const n = t.getRootNode == null ? void 0 : t.getRootNode();
|
|
152
|
+
if (e.contains(t))
|
|
153
|
+
return !0;
|
|
154
|
+
if (n && qn(n)) {
|
|
155
|
+
let r = t;
|
|
156
|
+
for (; r; ) {
|
|
157
|
+
if (e === r)
|
|
158
|
+
return !0;
|
|
159
|
+
r = r.parentNode || r.host;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return !1;
|
|
163
|
+
}
|
|
164
|
+
function Ie(e) {
|
|
165
|
+
return "composedPath" in e ? e.composedPath()[0] : e.target;
|
|
166
|
+
}
|
|
167
|
+
function Dt(e, t) {
|
|
168
|
+
if (t == null)
|
|
169
|
+
return !1;
|
|
170
|
+
if ("composedPath" in e)
|
|
171
|
+
return e.composedPath().includes(t);
|
|
172
|
+
const n = e;
|
|
173
|
+
return n.target != null && t.contains(n.target);
|
|
174
|
+
}
|
|
175
|
+
function Ur(e) {
|
|
176
|
+
return e.matches("html,body");
|
|
177
|
+
}
|
|
178
|
+
function pe(e) {
|
|
179
|
+
return e?.ownerDocument || document;
|
|
180
|
+
}
|
|
181
|
+
function nn(e) {
|
|
182
|
+
return ce(e) && e.matches(Kr);
|
|
183
|
+
}
|
|
184
|
+
function zt(e) {
|
|
185
|
+
return e ? e.getAttribute("role") === "combobox" && nn(e) : !1;
|
|
186
|
+
}
|
|
187
|
+
function Yr(e) {
|
|
188
|
+
if (!e || rr()) return !0;
|
|
189
|
+
try {
|
|
190
|
+
return e.matches(":focus-visible");
|
|
191
|
+
} catch {
|
|
192
|
+
return !0;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
function Ct(e) {
|
|
196
|
+
return e ? e.hasAttribute(hn) ? e : e.querySelector("[" + hn + "]") || e : null;
|
|
197
|
+
}
|
|
198
|
+
function $e(e, t, n) {
|
|
199
|
+
return n === void 0 && (n = !0), e.filter((o) => {
|
|
200
|
+
var i;
|
|
201
|
+
return o.parentId === t && (!n || ((i = o.context) == null ? void 0 : i.open));
|
|
202
|
+
}).flatMap((o) => [o, ...$e(e, o.id, n)]);
|
|
203
|
+
}
|
|
204
|
+
function zr(e, t) {
|
|
205
|
+
let n, r = -1;
|
|
206
|
+
function o(i, s) {
|
|
207
|
+
s > r && (n = i, r = s), $e(e, i).forEach((f) => {
|
|
208
|
+
o(f.id, s + 1);
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
return o(t, 0), e.find((i) => i.id === n);
|
|
212
|
+
}
|
|
213
|
+
function vn(e, t) {
|
|
214
|
+
var n;
|
|
215
|
+
let r = [], o = (n = e.find((i) => i.id === t)) == null ? void 0 : n.parentId;
|
|
216
|
+
for (; o; ) {
|
|
217
|
+
const i = e.find((s) => s.id === o);
|
|
218
|
+
o = i?.parentId, i && (r = r.concat(i));
|
|
219
|
+
}
|
|
220
|
+
return r;
|
|
221
|
+
}
|
|
222
|
+
function ge(e) {
|
|
223
|
+
e.preventDefault(), e.stopPropagation();
|
|
224
|
+
}
|
|
225
|
+
function Xr(e) {
|
|
226
|
+
return "nativeEvent" in e;
|
|
227
|
+
}
|
|
228
|
+
function or(e) {
|
|
229
|
+
return e.mozInputSource === 0 && e.isTrusted ? !0 : Yt() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
|
230
|
+
}
|
|
231
|
+
function sr(e) {
|
|
232
|
+
return rr() ? !1 : !Yt() && e.width === 0 && e.height === 0 || Yt() && e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse" || // iOS VoiceOver returns 0.333• for width/height.
|
|
233
|
+
e.width < 1 && e.height < 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "touch";
|
|
234
|
+
}
|
|
235
|
+
function qe(e, t) {
|
|
236
|
+
const n = ["mouse", "pen"];
|
|
237
|
+
return t || n.push("", void 0), n.includes(e);
|
|
238
|
+
}
|
|
239
|
+
var qr = typeof document < "u", Gr = function() {
|
|
240
|
+
}, X = qr ? Xn : Gr;
|
|
241
|
+
const Zr = {
|
|
242
|
+
...g
|
|
243
|
+
};
|
|
244
|
+
function le(e) {
|
|
245
|
+
const t = g.useRef(e);
|
|
246
|
+
return X(() => {
|
|
247
|
+
t.current = e;
|
|
248
|
+
}), t;
|
|
249
|
+
}
|
|
250
|
+
const Jr = Zr.useInsertionEffect, Qr = Jr || ((e) => e());
|
|
251
|
+
function re(e) {
|
|
252
|
+
const t = g.useRef(() => {
|
|
253
|
+
if (process.env.NODE_ENV !== "production")
|
|
254
|
+
throw new Error("Cannot call an event handler while rendering.");
|
|
255
|
+
});
|
|
256
|
+
return Qr(() => {
|
|
257
|
+
t.current = e;
|
|
258
|
+
}), g.useCallback(function() {
|
|
259
|
+
for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++)
|
|
260
|
+
r[o] = arguments[o];
|
|
261
|
+
return t.current == null ? void 0 : t.current(...r);
|
|
262
|
+
}, []);
|
|
263
|
+
}
|
|
264
|
+
function dt(e, t, n) {
|
|
265
|
+
return Math.floor(e / t) !== n;
|
|
266
|
+
}
|
|
267
|
+
function et(e, t) {
|
|
268
|
+
return t < 0 || t >= e.current.length;
|
|
269
|
+
}
|
|
270
|
+
function Ft(e, t) {
|
|
271
|
+
return ve(e, {
|
|
272
|
+
disabledIndices: t
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
function bn(e, t) {
|
|
276
|
+
return ve(e, {
|
|
277
|
+
decrement: !0,
|
|
278
|
+
startingIndex: e.current.length,
|
|
279
|
+
disabledIndices: t
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
function ve(e, t) {
|
|
283
|
+
let {
|
|
284
|
+
startingIndex: n = -1,
|
|
285
|
+
decrement: r = !1,
|
|
286
|
+
disabledIndices: o,
|
|
287
|
+
amount: i = 1
|
|
288
|
+
} = t === void 0 ? {} : t, s = n;
|
|
289
|
+
do
|
|
290
|
+
s += r ? -i : i;
|
|
291
|
+
while (s >= 0 && s <= e.current.length - 1 && vt(e, s, o));
|
|
292
|
+
return s;
|
|
293
|
+
}
|
|
294
|
+
function eo(e, t) {
|
|
295
|
+
let {
|
|
296
|
+
event: n,
|
|
297
|
+
orientation: r,
|
|
298
|
+
loop: o,
|
|
299
|
+
rtl: i,
|
|
300
|
+
cols: s,
|
|
301
|
+
disabledIndices: c,
|
|
302
|
+
minIndex: f,
|
|
303
|
+
maxIndex: u,
|
|
304
|
+
prevIndex: l,
|
|
305
|
+
stopEvent: p = !1
|
|
306
|
+
} = t, d = l;
|
|
307
|
+
if (n.key === Hr) {
|
|
308
|
+
if (p && ge(n), l === -1)
|
|
309
|
+
d = u;
|
|
310
|
+
else if (d = ve(e, {
|
|
311
|
+
startingIndex: d,
|
|
312
|
+
amount: s,
|
|
313
|
+
decrement: !0,
|
|
314
|
+
disabledIndices: c
|
|
315
|
+
}), o && (l - s < f || d < 0)) {
|
|
316
|
+
const a = l % s, v = u % s, m = u - (v - a);
|
|
317
|
+
v === a ? d = u : d = v > a ? m : m - s;
|
|
318
|
+
}
|
|
319
|
+
et(e, d) && (d = l);
|
|
320
|
+
}
|
|
321
|
+
if (n.key === jr && (p && ge(n), l === -1 ? d = f : (d = ve(e, {
|
|
322
|
+
startingIndex: l,
|
|
323
|
+
amount: s,
|
|
324
|
+
disabledIndices: c
|
|
325
|
+
}), o && l + s > u && (d = ve(e, {
|
|
326
|
+
startingIndex: l % s - s,
|
|
327
|
+
amount: s,
|
|
328
|
+
disabledIndices: c
|
|
329
|
+
}))), et(e, d) && (d = l)), r === "both") {
|
|
330
|
+
const a = je(l / s);
|
|
331
|
+
n.key === (i ? Lt : kt) && (p && ge(n), l % s !== s - 1 ? (d = ve(e, {
|
|
332
|
+
startingIndex: l,
|
|
333
|
+
disabledIndices: c
|
|
334
|
+
}), o && dt(d, s, a) && (d = ve(e, {
|
|
335
|
+
startingIndex: l - l % s - 1,
|
|
336
|
+
disabledIndices: c
|
|
337
|
+
}))) : o && (d = ve(e, {
|
|
338
|
+
startingIndex: l - l % s - 1,
|
|
339
|
+
disabledIndices: c
|
|
340
|
+
})), dt(d, s, a) && (d = l)), n.key === (i ? kt : Lt) && (p && ge(n), l % s !== 0 ? (d = ve(e, {
|
|
341
|
+
startingIndex: l,
|
|
342
|
+
decrement: !0,
|
|
343
|
+
disabledIndices: c
|
|
344
|
+
}), o && dt(d, s, a) && (d = ve(e, {
|
|
345
|
+
startingIndex: l + (s - l % s),
|
|
346
|
+
decrement: !0,
|
|
347
|
+
disabledIndices: c
|
|
348
|
+
}))) : o && (d = ve(e, {
|
|
349
|
+
startingIndex: l + (s - l % s),
|
|
350
|
+
decrement: !0,
|
|
351
|
+
disabledIndices: c
|
|
352
|
+
})), dt(d, s, a) && (d = l));
|
|
353
|
+
const v = je(u / s) === a;
|
|
354
|
+
et(e, d) && (o && v ? d = n.key === (i ? kt : Lt) ? u : ve(e, {
|
|
355
|
+
startingIndex: l - l % s - 1,
|
|
356
|
+
disabledIndices: c
|
|
357
|
+
}) : d = l);
|
|
358
|
+
}
|
|
359
|
+
return d;
|
|
360
|
+
}
|
|
361
|
+
function to(e, t, n) {
|
|
362
|
+
const r = [];
|
|
363
|
+
let o = 0;
|
|
364
|
+
return e.forEach((i, s) => {
|
|
365
|
+
let {
|
|
366
|
+
width: c,
|
|
367
|
+
height: f
|
|
368
|
+
} = i;
|
|
369
|
+
if (c > t && process.env.NODE_ENV !== "production")
|
|
370
|
+
throw new Error("[Floating UI]: Invalid grid - item width at index " + s + " is greater than grid columns");
|
|
371
|
+
let u = !1;
|
|
372
|
+
for (n && (o = 0); !u; ) {
|
|
373
|
+
const l = [];
|
|
374
|
+
for (let p = 0; p < c; p++)
|
|
375
|
+
for (let d = 0; d < f; d++)
|
|
376
|
+
l.push(o + p + d * t);
|
|
377
|
+
o % t + c <= t && l.every((p) => r[p] == null) ? (l.forEach((p) => {
|
|
378
|
+
r[p] = s;
|
|
379
|
+
}), u = !0) : o++;
|
|
380
|
+
}
|
|
381
|
+
}), [...r];
|
|
382
|
+
}
|
|
383
|
+
function no(e, t, n, r, o) {
|
|
384
|
+
if (e === -1) return -1;
|
|
385
|
+
const i = n.indexOf(e), s = t[e];
|
|
386
|
+
switch (o) {
|
|
387
|
+
case "tl":
|
|
388
|
+
return i;
|
|
389
|
+
case "tr":
|
|
390
|
+
return s ? i + s.width - 1 : i;
|
|
391
|
+
case "bl":
|
|
392
|
+
return s ? i + (s.height - 1) * r : i;
|
|
393
|
+
case "br":
|
|
394
|
+
return n.lastIndexOf(e);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
function ro(e, t) {
|
|
398
|
+
return t.flatMap((n, r) => e.includes(n) ? [r] : []);
|
|
399
|
+
}
|
|
400
|
+
function vt(e, t, n) {
|
|
401
|
+
if (typeof n == "function")
|
|
402
|
+
return n(t);
|
|
403
|
+
if (n)
|
|
404
|
+
return n.includes(t);
|
|
405
|
+
const r = e.current[t];
|
|
406
|
+
return r == null || r.hasAttribute("disabled") || r.getAttribute("aria-disabled") === "true";
|
|
407
|
+
}
|
|
408
|
+
const ot = () => ({
|
|
409
|
+
getShadowRoot: !0,
|
|
410
|
+
displayCheck: (
|
|
411
|
+
// JSDOM does not support the `tabbable` library. To solve this we can
|
|
412
|
+
// check if `ResizeObserver` is a real function (not polyfilled), which
|
|
413
|
+
// determines if the current environment is JSDOM-like.
|
|
414
|
+
typeof ResizeObserver == "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none"
|
|
415
|
+
)
|
|
416
|
+
});
|
|
417
|
+
function ir(e, t) {
|
|
418
|
+
const n = It(e, ot()), r = n.length;
|
|
419
|
+
if (r === 0) return;
|
|
420
|
+
const o = Oe(pe(e)), i = n.indexOf(o), s = i === -1 ? t === 1 ? 0 : r - 1 : i + t;
|
|
421
|
+
return n[s];
|
|
422
|
+
}
|
|
423
|
+
function cr(e) {
|
|
424
|
+
return ir(pe(e).body, 1) || e;
|
|
425
|
+
}
|
|
426
|
+
function ur(e) {
|
|
427
|
+
return ir(pe(e).body, -1) || e;
|
|
428
|
+
}
|
|
429
|
+
function tt(e, t) {
|
|
430
|
+
const n = t || e.currentTarget, r = e.relatedTarget;
|
|
431
|
+
return !r || !ue(n, r);
|
|
432
|
+
}
|
|
433
|
+
function oo(e) {
|
|
434
|
+
It(e, ot()).forEach((n) => {
|
|
435
|
+
n.dataset.tabindex = n.getAttribute("tabindex") || "", n.setAttribute("tabindex", "-1");
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
function yn(e) {
|
|
439
|
+
e.querySelectorAll("[data-tabindex]").forEach((n) => {
|
|
440
|
+
const r = n.dataset.tabindex;
|
|
441
|
+
delete n.dataset.tabindex, r ? n.setAttribute("tabindex", r) : n.removeAttribute("tabindex");
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
function wn(e, t, n) {
|
|
445
|
+
let {
|
|
446
|
+
reference: r,
|
|
447
|
+
floating: o
|
|
448
|
+
} = e;
|
|
449
|
+
const i = Ae(t), s = en(t), c = Qt(s), f = Me(t), u = i === "y", l = r.x + r.width / 2 - o.width / 2, p = r.y + r.height / 2 - o.height / 2, d = r[c] / 2 - o[c] / 2;
|
|
450
|
+
let a;
|
|
451
|
+
switch (f) {
|
|
452
|
+
case "top":
|
|
453
|
+
a = {
|
|
454
|
+
x: l,
|
|
455
|
+
y: r.y - o.height
|
|
456
|
+
};
|
|
457
|
+
break;
|
|
458
|
+
case "bottom":
|
|
459
|
+
a = {
|
|
460
|
+
x: l,
|
|
461
|
+
y: r.y + r.height
|
|
462
|
+
};
|
|
463
|
+
break;
|
|
464
|
+
case "right":
|
|
465
|
+
a = {
|
|
466
|
+
x: r.x + r.width,
|
|
467
|
+
y: p
|
|
468
|
+
};
|
|
469
|
+
break;
|
|
470
|
+
case "left":
|
|
471
|
+
a = {
|
|
472
|
+
x: r.x - o.width,
|
|
473
|
+
y: p
|
|
474
|
+
};
|
|
475
|
+
break;
|
|
476
|
+
default:
|
|
477
|
+
a = {
|
|
478
|
+
x: r.x,
|
|
479
|
+
y: r.y
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
switch (Ee(t)) {
|
|
483
|
+
case "start":
|
|
484
|
+
a[s] -= d * (n && u ? -1 : 1);
|
|
485
|
+
break;
|
|
486
|
+
case "end":
|
|
487
|
+
a[s] += d * (n && u ? -1 : 1);
|
|
488
|
+
break;
|
|
489
|
+
}
|
|
490
|
+
return a;
|
|
491
|
+
}
|
|
492
|
+
async function so(e, t) {
|
|
493
|
+
var n;
|
|
494
|
+
t === void 0 && (t = {});
|
|
495
|
+
const {
|
|
496
|
+
x: r,
|
|
497
|
+
y: o,
|
|
498
|
+
platform: i,
|
|
499
|
+
rects: s,
|
|
500
|
+
elements: c,
|
|
501
|
+
strategy: f
|
|
502
|
+
} = e, {
|
|
503
|
+
boundary: u = "clippingAncestors",
|
|
504
|
+
rootBoundary: l = "viewport",
|
|
505
|
+
elementContext: p = "floating",
|
|
506
|
+
altBoundary: d = !1,
|
|
507
|
+
padding: a = 0
|
|
508
|
+
} = Ke(t, e), v = er(a), w = c[d ? p === "floating" ? "reference" : "floating" : p], x = Et(await i.getClippingRect({
|
|
509
|
+
element: (n = await (i.isElement == null ? void 0 : i.isElement(w))) == null || n ? w : w.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(c.floating)),
|
|
510
|
+
boundary: u,
|
|
511
|
+
rootBoundary: l,
|
|
512
|
+
strategy: f
|
|
513
|
+
})), y = p === "floating" ? {
|
|
514
|
+
x: r,
|
|
515
|
+
y: o,
|
|
516
|
+
width: s.floating.width,
|
|
517
|
+
height: s.floating.height
|
|
518
|
+
} : s.reference, R = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c.floating)), E = await (i.isElement == null ? void 0 : i.isElement(R)) ? await (i.getScale == null ? void 0 : i.getScale(R)) || {
|
|
519
|
+
x: 1,
|
|
520
|
+
y: 1
|
|
521
|
+
} : {
|
|
522
|
+
x: 1,
|
|
523
|
+
y: 1
|
|
524
|
+
}, A = Et(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
525
|
+
elements: c,
|
|
526
|
+
rect: y,
|
|
527
|
+
offsetParent: R,
|
|
528
|
+
strategy: f
|
|
529
|
+
}) : y);
|
|
530
|
+
return {
|
|
531
|
+
top: (x.top - A.top + v.top) / E.y,
|
|
532
|
+
bottom: (A.bottom - x.bottom + v.bottom) / E.y,
|
|
533
|
+
left: (x.left - A.left + v.left) / E.x,
|
|
534
|
+
right: (A.right - x.right + v.right) / E.x
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
const io = async (e, t, n) => {
|
|
538
|
+
const {
|
|
539
|
+
placement: r = "bottom",
|
|
540
|
+
strategy: o = "absolute",
|
|
541
|
+
middleware: i = [],
|
|
542
|
+
platform: s
|
|
543
|
+
} = n, c = i.filter(Boolean), f = await (s.isRTL == null ? void 0 : s.isRTL(t));
|
|
544
|
+
let u = await s.getElementRects({
|
|
545
|
+
reference: e,
|
|
546
|
+
floating: t,
|
|
547
|
+
strategy: o
|
|
548
|
+
}), {
|
|
549
|
+
x: l,
|
|
550
|
+
y: p
|
|
551
|
+
} = wn(u, r, f), d = r, a = {}, v = 0;
|
|
552
|
+
for (let w = 0; w < c.length; w++) {
|
|
553
|
+
var m;
|
|
554
|
+
const {
|
|
555
|
+
name: x,
|
|
556
|
+
fn: y
|
|
557
|
+
} = c[w], {
|
|
558
|
+
x: R,
|
|
559
|
+
y: E,
|
|
560
|
+
data: A,
|
|
561
|
+
reset: O
|
|
562
|
+
} = await y({
|
|
563
|
+
x: l,
|
|
564
|
+
y: p,
|
|
565
|
+
initialPlacement: r,
|
|
566
|
+
placement: d,
|
|
567
|
+
strategy: o,
|
|
568
|
+
middlewareData: a,
|
|
569
|
+
rects: u,
|
|
570
|
+
platform: {
|
|
571
|
+
...s,
|
|
572
|
+
detectOverflow: (m = s.detectOverflow) != null ? m : so
|
|
573
|
+
},
|
|
574
|
+
elements: {
|
|
575
|
+
reference: e,
|
|
576
|
+
floating: t
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
l = R ?? l, p = E ?? p, a = {
|
|
580
|
+
...a,
|
|
581
|
+
[x]: {
|
|
582
|
+
...a[x],
|
|
583
|
+
...A
|
|
584
|
+
}
|
|
585
|
+
}, O && v <= 50 && (v++, typeof O == "object" && (O.placement && (d = O.placement), O.rects && (u = O.rects === !0 ? await s.getElementRects({
|
|
586
|
+
reference: e,
|
|
587
|
+
floating: t,
|
|
588
|
+
strategy: o
|
|
589
|
+
}) : O.rects), {
|
|
590
|
+
x: l,
|
|
591
|
+
y: p
|
|
592
|
+
} = wn(u, d, f)), w = -1);
|
|
593
|
+
}
|
|
594
|
+
return {
|
|
595
|
+
x: l,
|
|
596
|
+
y: p,
|
|
597
|
+
placement: d,
|
|
598
|
+
strategy: o,
|
|
599
|
+
middlewareData: a
|
|
600
|
+
};
|
|
601
|
+
}, co = (e) => ({
|
|
602
|
+
name: "arrow",
|
|
603
|
+
options: e,
|
|
604
|
+
async fn(t) {
|
|
605
|
+
const {
|
|
606
|
+
x: n,
|
|
607
|
+
y: r,
|
|
608
|
+
placement: o,
|
|
609
|
+
rects: i,
|
|
610
|
+
platform: s,
|
|
611
|
+
elements: c,
|
|
612
|
+
middlewareData: f
|
|
613
|
+
} = t, {
|
|
614
|
+
element: u,
|
|
615
|
+
padding: l = 0
|
|
616
|
+
} = Ke(e, t) || {};
|
|
617
|
+
if (u == null)
|
|
618
|
+
return {};
|
|
619
|
+
const p = er(l), d = {
|
|
620
|
+
x: n,
|
|
621
|
+
y: r
|
|
622
|
+
}, a = en(o), v = Qt(a), m = await s.getDimensions(u), w = a === "y", x = w ? "top" : "left", y = w ? "bottom" : "right", R = w ? "clientHeight" : "clientWidth", E = i.reference[v] + i.reference[a] - d[a] - i.floating[v], A = d[a] - i.reference[a], O = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(u));
|
|
623
|
+
let M = O ? O[R] : 0;
|
|
624
|
+
(!M || !await (s.isElement == null ? void 0 : s.isElement(O))) && (M = c.floating[R] || i.floating[v]);
|
|
625
|
+
const S = E / 2 - A / 2, $ = M / 2 - m[v] / 2 - 1, I = Fe(p[x], $), B = Fe(p[y], $), W = I, L = M - m[v] - B, h = M / 2 - m[v] / 2 + S, C = Ut(W, h, L), D = !f.arrow && Ee(o) != null && h !== C && i.reference[v] / 2 - (h < W ? I : B) - m[v] / 2 < 0, T = D ? h < W ? h - W : h - L : 0;
|
|
626
|
+
return {
|
|
627
|
+
[a]: d[a] + T,
|
|
628
|
+
data: {
|
|
629
|
+
[a]: C,
|
|
630
|
+
centerOffset: h - C - T,
|
|
631
|
+
...D && {
|
|
632
|
+
alignmentOffset: T
|
|
633
|
+
}
|
|
634
|
+
},
|
|
635
|
+
reset: D
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
});
|
|
639
|
+
function uo(e, t, n) {
|
|
640
|
+
return (e ? [...n.filter((o) => Ee(o) === e), ...n.filter((o) => Ee(o) !== e)] : n.filter((o) => Me(o) === o)).filter((o) => e ? Ee(o) === e || (t ? Rt(o) !== o : !1) : !0);
|
|
641
|
+
}
|
|
642
|
+
const lo = function(e) {
|
|
643
|
+
return e === void 0 && (e = {}), {
|
|
644
|
+
name: "autoPlacement",
|
|
645
|
+
options: e,
|
|
646
|
+
async fn(t) {
|
|
647
|
+
var n, r, o;
|
|
648
|
+
const {
|
|
649
|
+
rects: i,
|
|
650
|
+
middlewareData: s,
|
|
651
|
+
placement: c,
|
|
652
|
+
platform: f,
|
|
653
|
+
elements: u
|
|
654
|
+
} = t, {
|
|
655
|
+
crossAxis: l = !1,
|
|
656
|
+
alignment: p,
|
|
657
|
+
allowedPlacements: d = mn,
|
|
658
|
+
autoAlignment: a = !0,
|
|
659
|
+
...v
|
|
660
|
+
} = Ke(e, t), m = p !== void 0 || d === mn ? uo(p || null, a, d) : d, w = await f.detectOverflow(t, v), x = ((n = s.autoPlacement) == null ? void 0 : n.index) || 0, y = m[x];
|
|
661
|
+
if (y == null)
|
|
662
|
+
return {};
|
|
663
|
+
const R = Qn(y, i, await (f.isRTL == null ? void 0 : f.isRTL(u.floating)));
|
|
664
|
+
if (c !== y)
|
|
665
|
+
return {
|
|
666
|
+
reset: {
|
|
667
|
+
placement: m[0]
|
|
668
|
+
}
|
|
669
|
+
};
|
|
670
|
+
const E = [w[Me(y)], w[R[0]], w[R[1]]], A = [...((r = s.autoPlacement) == null ? void 0 : r.overflows) || [], {
|
|
671
|
+
placement: y,
|
|
672
|
+
overflows: E
|
|
673
|
+
}], O = m[x + 1];
|
|
674
|
+
if (O)
|
|
675
|
+
return {
|
|
676
|
+
data: {
|
|
677
|
+
index: x + 1,
|
|
678
|
+
overflows: A
|
|
679
|
+
},
|
|
680
|
+
reset: {
|
|
681
|
+
placement: O
|
|
682
|
+
}
|
|
683
|
+
};
|
|
684
|
+
const M = A.map((I) => {
|
|
685
|
+
const B = Ee(I.placement);
|
|
686
|
+
return [I.placement, B && l ? (
|
|
687
|
+
// Check along the mainAxis and main crossAxis side.
|
|
688
|
+
I.overflows.slice(0, 2).reduce((W, L) => W + L, 0)
|
|
689
|
+
) : (
|
|
690
|
+
// Check only the mainAxis.
|
|
691
|
+
I.overflows[0]
|
|
692
|
+
), I.overflows];
|
|
693
|
+
}).sort((I, B) => I[1] - B[1]), $ = ((o = M.filter((I) => I[2].slice(
|
|
694
|
+
0,
|
|
695
|
+
// Aligned placements should not check their opposite crossAxis
|
|
696
|
+
// side.
|
|
697
|
+
Ee(I[0]) ? 2 : 3
|
|
698
|
+
).every((B) => B <= 0))[0]) == null ? void 0 : o[0]) || M[0][0];
|
|
699
|
+
return $ !== c ? {
|
|
700
|
+
data: {
|
|
701
|
+
index: x + 1,
|
|
702
|
+
overflows: A
|
|
703
|
+
},
|
|
704
|
+
reset: {
|
|
705
|
+
placement: $
|
|
706
|
+
}
|
|
707
|
+
} : {};
|
|
708
|
+
}
|
|
709
|
+
};
|
|
710
|
+
}, ao = function(e) {
|
|
711
|
+
return e === void 0 && (e = {}), {
|
|
712
|
+
name: "flip",
|
|
713
|
+
options: e,
|
|
714
|
+
async fn(t) {
|
|
715
|
+
var n, r;
|
|
716
|
+
const {
|
|
717
|
+
placement: o,
|
|
718
|
+
middlewareData: i,
|
|
719
|
+
rects: s,
|
|
720
|
+
initialPlacement: c,
|
|
721
|
+
platform: f,
|
|
722
|
+
elements: u
|
|
723
|
+
} = t, {
|
|
724
|
+
mainAxis: l = !0,
|
|
725
|
+
crossAxis: p = !0,
|
|
726
|
+
fallbackPlacements: d,
|
|
727
|
+
fallbackStrategy: a = "bestFit",
|
|
728
|
+
fallbackAxisSideDirection: v = "none",
|
|
729
|
+
flipAlignment: m = !0,
|
|
730
|
+
...w
|
|
731
|
+
} = Ke(e, t);
|
|
732
|
+
if ((n = i.arrow) != null && n.alignmentOffset)
|
|
733
|
+
return {};
|
|
734
|
+
const x = Me(o), y = Ae(c), R = Me(c) === c, E = await (f.isRTL == null ? void 0 : f.isRTL(u.floating)), A = d || (R || !m ? [xt(c)] : Fr(c)), O = v !== "none";
|
|
735
|
+
!d && O && A.push(...$r(c, m, v, E));
|
|
736
|
+
const M = [c, ...A], S = await f.detectOverflow(t, w), $ = [];
|
|
737
|
+
let I = ((r = i.flip) == null ? void 0 : r.overflows) || [];
|
|
738
|
+
if (l && $.push(S[x]), p) {
|
|
739
|
+
const h = Qn(o, s, E);
|
|
740
|
+
$.push(S[h[0]], S[h[1]]);
|
|
741
|
+
}
|
|
742
|
+
if (I = [...I, {
|
|
743
|
+
placement: o,
|
|
744
|
+
overflows: $
|
|
745
|
+
}], !$.every((h) => h <= 0)) {
|
|
746
|
+
var B, W;
|
|
747
|
+
const h = (((B = i.flip) == null ? void 0 : B.index) || 0) + 1, C = M[h];
|
|
748
|
+
if (C && (!(p === "alignment" ? y !== Ae(C) : !1) || // We leave the current main axis only if every placement on that axis
|
|
749
|
+
// overflows the main axis.
|
|
750
|
+
I.every((b) => Ae(b.placement) === y ? b.overflows[0] > 0 : !0)))
|
|
751
|
+
return {
|
|
752
|
+
data: {
|
|
753
|
+
index: h,
|
|
754
|
+
overflows: I
|
|
755
|
+
},
|
|
756
|
+
reset: {
|
|
757
|
+
placement: C
|
|
758
|
+
}
|
|
759
|
+
};
|
|
760
|
+
let D = (W = I.filter((T) => T.overflows[0] <= 0).sort((T, b) => T.overflows[1] - b.overflows[1])[0]) == null ? void 0 : W.placement;
|
|
761
|
+
if (!D)
|
|
762
|
+
switch (a) {
|
|
763
|
+
case "bestFit": {
|
|
764
|
+
var L;
|
|
765
|
+
const T = (L = I.filter((b) => {
|
|
766
|
+
if (O) {
|
|
767
|
+
const P = Ae(b.placement);
|
|
768
|
+
return P === y || // Create a bias to the `y` side axis due to horizontal
|
|
769
|
+
// reading directions favoring greater width.
|
|
770
|
+
P === "y";
|
|
771
|
+
}
|
|
772
|
+
return !0;
|
|
773
|
+
}).map((b) => [b.placement, b.overflows.filter((P) => P > 0).reduce((P, k) => P + k, 0)]).sort((b, P) => b[1] - P[1])[0]) == null ? void 0 : L[0];
|
|
774
|
+
T && (D = T);
|
|
775
|
+
break;
|
|
776
|
+
}
|
|
777
|
+
case "initialPlacement":
|
|
778
|
+
D = c;
|
|
779
|
+
break;
|
|
780
|
+
}
|
|
781
|
+
if (o !== D)
|
|
782
|
+
return {
|
|
783
|
+
reset: {
|
|
784
|
+
placement: D
|
|
785
|
+
}
|
|
786
|
+
};
|
|
787
|
+
}
|
|
788
|
+
return {};
|
|
789
|
+
}
|
|
790
|
+
};
|
|
791
|
+
}, fo = /* @__PURE__ */ new Set(["left", "top"]);
|
|
792
|
+
async function mo(e, t) {
|
|
793
|
+
const {
|
|
794
|
+
placement: n,
|
|
795
|
+
platform: r,
|
|
796
|
+
elements: o
|
|
797
|
+
} = e, i = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), s = Me(n), c = Ee(n), f = Ae(n) === "y", u = fo.has(s) ? -1 : 1, l = i && f ? -1 : 1, p = Ke(t, e);
|
|
798
|
+
let {
|
|
799
|
+
mainAxis: d,
|
|
800
|
+
crossAxis: a,
|
|
801
|
+
alignmentAxis: v
|
|
802
|
+
} = typeof p == "number" ? {
|
|
803
|
+
mainAxis: p,
|
|
804
|
+
crossAxis: 0,
|
|
805
|
+
alignmentAxis: null
|
|
806
|
+
} : {
|
|
807
|
+
mainAxis: p.mainAxis || 0,
|
|
808
|
+
crossAxis: p.crossAxis || 0,
|
|
809
|
+
alignmentAxis: p.alignmentAxis
|
|
810
|
+
};
|
|
811
|
+
return c && typeof v == "number" && (a = c === "end" ? v * -1 : v), f ? {
|
|
812
|
+
x: a * l,
|
|
813
|
+
y: d * u
|
|
814
|
+
} : {
|
|
815
|
+
x: d * u,
|
|
816
|
+
y: a * l
|
|
817
|
+
};
|
|
818
|
+
}
|
|
819
|
+
const go = function(e) {
|
|
820
|
+
return e === void 0 && (e = 0), {
|
|
821
|
+
name: "offset",
|
|
822
|
+
options: e,
|
|
823
|
+
async fn(t) {
|
|
824
|
+
var n, r;
|
|
825
|
+
const {
|
|
826
|
+
x: o,
|
|
827
|
+
y: i,
|
|
828
|
+
placement: s,
|
|
829
|
+
middlewareData: c
|
|
830
|
+
} = t, f = await mo(t, e);
|
|
831
|
+
return s === ((n = c.offset) == null ? void 0 : n.placement) && (r = c.arrow) != null && r.alignmentOffset ? {} : {
|
|
832
|
+
x: o + f.x,
|
|
833
|
+
y: i + f.y,
|
|
834
|
+
data: {
|
|
835
|
+
...f,
|
|
836
|
+
placement: s
|
|
837
|
+
}
|
|
838
|
+
};
|
|
839
|
+
}
|
|
840
|
+
};
|
|
841
|
+
}, po = function(e) {
|
|
842
|
+
return e === void 0 && (e = {}), {
|
|
843
|
+
name: "shift",
|
|
844
|
+
options: e,
|
|
845
|
+
async fn(t) {
|
|
846
|
+
const {
|
|
847
|
+
x: n,
|
|
848
|
+
y: r,
|
|
849
|
+
placement: o,
|
|
850
|
+
platform: i
|
|
851
|
+
} = t, {
|
|
852
|
+
mainAxis: s = !0,
|
|
853
|
+
crossAxis: c = !1,
|
|
854
|
+
limiter: f = {
|
|
855
|
+
fn: (x) => {
|
|
856
|
+
let {
|
|
857
|
+
x: y,
|
|
858
|
+
y: R
|
|
859
|
+
} = x;
|
|
860
|
+
return {
|
|
861
|
+
x: y,
|
|
862
|
+
y: R
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
},
|
|
866
|
+
...u
|
|
867
|
+
} = Ke(e, t), l = {
|
|
868
|
+
x: n,
|
|
869
|
+
y: r
|
|
870
|
+
}, p = await i.detectOverflow(t, u), d = Ae(Me(o)), a = Jn(d);
|
|
871
|
+
let v = l[a], m = l[d];
|
|
872
|
+
if (s) {
|
|
873
|
+
const x = a === "y" ? "top" : "left", y = a === "y" ? "bottom" : "right", R = v + p[x], E = v - p[y];
|
|
874
|
+
v = Ut(R, v, E);
|
|
875
|
+
}
|
|
876
|
+
if (c) {
|
|
877
|
+
const x = d === "y" ? "top" : "left", y = d === "y" ? "bottom" : "right", R = m + p[x], E = m - p[y];
|
|
878
|
+
m = Ut(R, m, E);
|
|
879
|
+
}
|
|
880
|
+
const w = f.fn({
|
|
881
|
+
...t,
|
|
882
|
+
[a]: v,
|
|
883
|
+
[d]: m
|
|
884
|
+
});
|
|
885
|
+
return {
|
|
886
|
+
...w,
|
|
887
|
+
data: {
|
|
888
|
+
x: w.x - n,
|
|
889
|
+
y: w.y - r,
|
|
890
|
+
enabled: {
|
|
891
|
+
[a]: s,
|
|
892
|
+
[d]: c
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
};
|
|
896
|
+
}
|
|
897
|
+
};
|
|
898
|
+
}, ho = function(e) {
|
|
899
|
+
return e === void 0 && (e = {}), {
|
|
900
|
+
name: "size",
|
|
901
|
+
options: e,
|
|
902
|
+
async fn(t) {
|
|
903
|
+
var n, r;
|
|
904
|
+
const {
|
|
905
|
+
placement: o,
|
|
906
|
+
rects: i,
|
|
907
|
+
platform: s,
|
|
908
|
+
elements: c
|
|
909
|
+
} = t, {
|
|
910
|
+
apply: f = () => {
|
|
911
|
+
},
|
|
912
|
+
...u
|
|
913
|
+
} = Ke(e, t), l = await s.detectOverflow(t, u), p = Me(o), d = Ee(o), a = Ae(o) === "y", {
|
|
914
|
+
width: v,
|
|
915
|
+
height: m
|
|
916
|
+
} = i.floating;
|
|
917
|
+
let w, x;
|
|
918
|
+
p === "top" || p === "bottom" ? (w = p, x = d === (await (s.isRTL == null ? void 0 : s.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (x = p, w = d === "end" ? "top" : "bottom");
|
|
919
|
+
const y = m - l.top - l.bottom, R = v - l.left - l.right, E = Fe(m - l[w], y), A = Fe(v - l[x], R), O = !t.middlewareData.shift;
|
|
920
|
+
let M = E, S = A;
|
|
921
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (S = R), (r = t.middlewareData.shift) != null && r.enabled.y && (M = y), O && !d) {
|
|
922
|
+
const I = Re(l.left, 0), B = Re(l.right, 0), W = Re(l.top, 0), L = Re(l.bottom, 0);
|
|
923
|
+
a ? S = v - 2 * (I !== 0 || B !== 0 ? I + B : Re(l.left, l.right)) : M = m - 2 * (W !== 0 || L !== 0 ? W + L : Re(l.top, l.bottom));
|
|
924
|
+
}
|
|
925
|
+
await f({
|
|
926
|
+
...t,
|
|
927
|
+
availableWidth: S,
|
|
928
|
+
availableHeight: M
|
|
929
|
+
});
|
|
930
|
+
const $ = await s.getDimensions(c.floating);
|
|
931
|
+
return v !== $.width || m !== $.height ? {
|
|
932
|
+
reset: {
|
|
933
|
+
rects: !0
|
|
934
|
+
}
|
|
935
|
+
} : {};
|
|
936
|
+
}
|
|
937
|
+
};
|
|
938
|
+
};
|
|
939
|
+
function lr(e) {
|
|
940
|
+
const t = Ce(e);
|
|
941
|
+
let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
|
|
942
|
+
const o = ce(e), i = o ? e.offsetWidth : n, s = o ? e.offsetHeight : r, c = wt(n) !== i || wt(r) !== s;
|
|
943
|
+
return c && (n = i, r = s), {
|
|
944
|
+
width: n,
|
|
945
|
+
height: r,
|
|
946
|
+
$: c
|
|
947
|
+
};
|
|
948
|
+
}
|
|
949
|
+
function rn(e) {
|
|
950
|
+
return Z(e) ? e : e.contextElement;
|
|
951
|
+
}
|
|
952
|
+
function Ye(e) {
|
|
953
|
+
const t = rn(e);
|
|
954
|
+
if (!ce(t))
|
|
955
|
+
return Pe(1);
|
|
956
|
+
const n = t.getBoundingClientRect(), {
|
|
957
|
+
width: r,
|
|
958
|
+
height: o,
|
|
959
|
+
$: i
|
|
960
|
+
} = lr(t);
|
|
961
|
+
let s = (i ? wt(n.width) : n.width) / r, c = (i ? wt(n.height) : n.height) / o;
|
|
962
|
+
return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
963
|
+
x: s,
|
|
964
|
+
y: c
|
|
965
|
+
};
|
|
966
|
+
}
|
|
967
|
+
const vo = /* @__PURE__ */ Pe(0);
|
|
968
|
+
function ar(e) {
|
|
969
|
+
const t = Se(e);
|
|
970
|
+
return !Gt() || !t.visualViewport ? vo : {
|
|
971
|
+
x: t.visualViewport.offsetLeft,
|
|
972
|
+
y: t.visualViewport.offsetTop
|
|
973
|
+
};
|
|
974
|
+
}
|
|
975
|
+
function bo(e, t, n) {
|
|
976
|
+
return t === void 0 && (t = !1), !n || t && n !== Se(e) ? !1 : t;
|
|
977
|
+
}
|
|
978
|
+
function Be(e, t, n, r) {
|
|
979
|
+
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
980
|
+
const o = e.getBoundingClientRect(), i = rn(e);
|
|
981
|
+
let s = Pe(1);
|
|
982
|
+
t && (r ? Z(r) && (s = Ye(r)) : s = Ye(e));
|
|
983
|
+
const c = bo(i, n, r) ? ar(i) : Pe(0);
|
|
984
|
+
let f = (o.left + c.x) / s.x, u = (o.top + c.y) / s.y, l = o.width / s.x, p = o.height / s.y;
|
|
985
|
+
if (i) {
|
|
986
|
+
const d = Se(i), a = r && Z(r) ? Se(r) : r;
|
|
987
|
+
let v = d, m = fn(v);
|
|
988
|
+
for (; m && r && a !== v; ) {
|
|
989
|
+
const w = Ye(m), x = m.getBoundingClientRect(), y = Ce(m), R = x.left + (m.clientLeft + parseFloat(y.paddingLeft)) * w.x, E = x.top + (m.clientTop + parseFloat(y.paddingTop)) * w.y;
|
|
990
|
+
f *= w.x, u *= w.y, l *= w.x, p *= w.y, f += R, u += E, v = Se(m), m = fn(v);
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
return Et({
|
|
994
|
+
width: l,
|
|
995
|
+
height: p,
|
|
996
|
+
x: f,
|
|
997
|
+
y: u
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
function Mt(e, t) {
|
|
1001
|
+
const n = Pt(e).scrollLeft;
|
|
1002
|
+
return t ? t.left + n : Be(Le(e)).left + n;
|
|
1003
|
+
}
|
|
1004
|
+
function fr(e, t) {
|
|
1005
|
+
const n = e.getBoundingClientRect(), r = n.left + t.scrollLeft - Mt(e, n), o = n.top + t.scrollTop;
|
|
1006
|
+
return {
|
|
1007
|
+
x: r,
|
|
1008
|
+
y: o
|
|
1009
|
+
};
|
|
1010
|
+
}
|
|
1011
|
+
function yo(e) {
|
|
1012
|
+
let {
|
|
1013
|
+
elements: t,
|
|
1014
|
+
rect: n,
|
|
1015
|
+
offsetParent: r,
|
|
1016
|
+
strategy: o
|
|
1017
|
+
} = e;
|
|
1018
|
+
const i = o === "fixed", s = Le(r), c = t ? Xt(t.floating) : !1;
|
|
1019
|
+
if (r === s || c && i)
|
|
1020
|
+
return n;
|
|
1021
|
+
let f = {
|
|
1022
|
+
scrollLeft: 0,
|
|
1023
|
+
scrollTop: 0
|
|
1024
|
+
}, u = Pe(1);
|
|
1025
|
+
const l = Pe(0), p = ce(r);
|
|
1026
|
+
if ((p || !p && !i) && ((rt(r) !== "body" || qt(s)) && (f = Pt(r)), ce(r))) {
|
|
1027
|
+
const a = Be(r);
|
|
1028
|
+
u = Ye(r), l.x = a.x + r.clientLeft, l.y = a.y + r.clientTop;
|
|
1029
|
+
}
|
|
1030
|
+
const d = s && !p && !i ? fr(s, f) : Pe(0);
|
|
1031
|
+
return {
|
|
1032
|
+
width: n.width * u.x,
|
|
1033
|
+
height: n.height * u.y,
|
|
1034
|
+
x: n.x * u.x - f.scrollLeft * u.x + l.x + d.x,
|
|
1035
|
+
y: n.y * u.y - f.scrollTop * u.y + l.y + d.y
|
|
1036
|
+
};
|
|
1037
|
+
}
|
|
1038
|
+
function wo(e) {
|
|
1039
|
+
return Array.from(e.getClientRects());
|
|
1040
|
+
}
|
|
1041
|
+
function Ro(e) {
|
|
1042
|
+
const t = Le(e), n = Pt(e), r = e.ownerDocument.body, o = Re(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), i = Re(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
|
|
1043
|
+
let s = -n.scrollLeft + Mt(e);
|
|
1044
|
+
const c = -n.scrollTop;
|
|
1045
|
+
return Ce(r).direction === "rtl" && (s += Re(t.clientWidth, r.clientWidth) - o), {
|
|
1046
|
+
width: o,
|
|
1047
|
+
height: i,
|
|
1048
|
+
x: s,
|
|
1049
|
+
y: c
|
|
1050
|
+
};
|
|
1051
|
+
}
|
|
1052
|
+
const Rn = 25;
|
|
1053
|
+
function xo(e, t) {
|
|
1054
|
+
const n = Se(e), r = Le(e), o = n.visualViewport;
|
|
1055
|
+
let i = r.clientWidth, s = r.clientHeight, c = 0, f = 0;
|
|
1056
|
+
if (o) {
|
|
1057
|
+
i = o.width, s = o.height;
|
|
1058
|
+
const l = Gt();
|
|
1059
|
+
(!l || l && t === "fixed") && (c = o.offsetLeft, f = o.offsetTop);
|
|
1060
|
+
}
|
|
1061
|
+
const u = Mt(r);
|
|
1062
|
+
if (u <= 0) {
|
|
1063
|
+
const l = r.ownerDocument, p = l.body, d = getComputedStyle(p), a = l.compatMode === "CSS1Compat" && parseFloat(d.marginLeft) + parseFloat(d.marginRight) || 0, v = Math.abs(r.clientWidth - p.clientWidth - a);
|
|
1064
|
+
v <= Rn && (i -= v);
|
|
1065
|
+
} else u <= Rn && (i += u);
|
|
1066
|
+
return {
|
|
1067
|
+
width: i,
|
|
1068
|
+
height: s,
|
|
1069
|
+
x: c,
|
|
1070
|
+
y: f
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1073
|
+
const Eo = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
1074
|
+
function Co(e, t) {
|
|
1075
|
+
const n = Be(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, i = ce(e) ? Ye(e) : Pe(1), s = e.clientWidth * i.x, c = e.clientHeight * i.y, f = o * i.x, u = r * i.y;
|
|
1076
|
+
return {
|
|
1077
|
+
width: s,
|
|
1078
|
+
height: c,
|
|
1079
|
+
x: f,
|
|
1080
|
+
y: u
|
|
1081
|
+
};
|
|
1082
|
+
}
|
|
1083
|
+
function xn(e, t, n) {
|
|
1084
|
+
let r;
|
|
1085
|
+
if (t === "viewport")
|
|
1086
|
+
r = xo(e, n);
|
|
1087
|
+
else if (t === "document")
|
|
1088
|
+
r = Ro(Le(e));
|
|
1089
|
+
else if (Z(t))
|
|
1090
|
+
r = Co(t, n);
|
|
1091
|
+
else {
|
|
1092
|
+
const o = ar(e);
|
|
1093
|
+
r = {
|
|
1094
|
+
x: t.x - o.x,
|
|
1095
|
+
y: t.y - o.y,
|
|
1096
|
+
width: t.width,
|
|
1097
|
+
height: t.height
|
|
1098
|
+
};
|
|
1099
|
+
}
|
|
1100
|
+
return Et(r);
|
|
1101
|
+
}
|
|
1102
|
+
function dr(e, t) {
|
|
1103
|
+
const n = Xe(e);
|
|
1104
|
+
return n === t || !Z(n) || We(n) ? !1 : Ce(n).position === "fixed" || dr(n, t);
|
|
1105
|
+
}
|
|
1106
|
+
function To(e, t) {
|
|
1107
|
+
const n = t.get(e);
|
|
1108
|
+
if (n)
|
|
1109
|
+
return n;
|
|
1110
|
+
let r = Ue(e, [], !1).filter((c) => Z(c) && rt(c) !== "body"), o = null;
|
|
1111
|
+
const i = Ce(e).position === "fixed";
|
|
1112
|
+
let s = i ? Xe(e) : e;
|
|
1113
|
+
for (; Z(s) && !We(s); ) {
|
|
1114
|
+
const c = Ce(s), f = Gn(s);
|
|
1115
|
+
!f && c.position === "fixed" && (o = null), (i ? !f && !o : !f && c.position === "static" && !!o && Eo.has(o.position) || qt(s) && !f && dr(e, s)) ? r = r.filter((l) => l !== s) : o = c, s = Xe(s);
|
|
1116
|
+
}
|
|
1117
|
+
return t.set(e, r), r;
|
|
1118
|
+
}
|
|
1119
|
+
function Oo(e) {
|
|
1120
|
+
let {
|
|
1121
|
+
element: t,
|
|
1122
|
+
boundary: n,
|
|
1123
|
+
rootBoundary: r,
|
|
1124
|
+
strategy: o
|
|
1125
|
+
} = e;
|
|
1126
|
+
const s = [...n === "clippingAncestors" ? Xt(t) ? [] : To(t, this._c) : [].concat(n), r], c = s[0], f = s.reduce((u, l) => {
|
|
1127
|
+
const p = xn(t, l, o);
|
|
1128
|
+
return u.top = Re(p.top, u.top), u.right = Fe(p.right, u.right), u.bottom = Fe(p.bottom, u.bottom), u.left = Re(p.left, u.left), u;
|
|
1129
|
+
}, xn(t, c, o));
|
|
1130
|
+
return {
|
|
1131
|
+
width: f.right - f.left,
|
|
1132
|
+
height: f.bottom - f.top,
|
|
1133
|
+
x: f.left,
|
|
1134
|
+
y: f.top
|
|
1135
|
+
};
|
|
1136
|
+
}
|
|
1137
|
+
function Io(e) {
|
|
1138
|
+
const {
|
|
1139
|
+
width: t,
|
|
1140
|
+
height: n
|
|
1141
|
+
} = lr(e);
|
|
1142
|
+
return {
|
|
1143
|
+
width: t,
|
|
1144
|
+
height: n
|
|
1145
|
+
};
|
|
1146
|
+
}
|
|
1147
|
+
function Po(e, t, n) {
|
|
1148
|
+
const r = ce(t), o = Le(t), i = n === "fixed", s = Be(e, !0, i, t);
|
|
1149
|
+
let c = {
|
|
1150
|
+
scrollLeft: 0,
|
|
1151
|
+
scrollTop: 0
|
|
1152
|
+
};
|
|
1153
|
+
const f = Pe(0);
|
|
1154
|
+
function u() {
|
|
1155
|
+
f.x = Mt(o);
|
|
1156
|
+
}
|
|
1157
|
+
if (r || !r && !i)
|
|
1158
|
+
if ((rt(t) !== "body" || qt(o)) && (c = Pt(t)), r) {
|
|
1159
|
+
const a = Be(t, !0, i, t);
|
|
1160
|
+
f.x = a.x + t.clientLeft, f.y = a.y + t.clientTop;
|
|
1161
|
+
} else o && u();
|
|
1162
|
+
i && !r && o && u();
|
|
1163
|
+
const l = o && !r && !i ? fr(o, c) : Pe(0), p = s.left + c.scrollLeft - f.x - l.x, d = s.top + c.scrollTop - f.y - l.y;
|
|
1164
|
+
return {
|
|
1165
|
+
x: p,
|
|
1166
|
+
y: d,
|
|
1167
|
+
width: s.width,
|
|
1168
|
+
height: s.height
|
|
1169
|
+
};
|
|
1170
|
+
}
|
|
1171
|
+
function Nt(e) {
|
|
1172
|
+
return Ce(e).position === "static";
|
|
1173
|
+
}
|
|
1174
|
+
function En(e, t) {
|
|
1175
|
+
if (!ce(e) || Ce(e).position === "fixed")
|
|
1176
|
+
return null;
|
|
1177
|
+
if (t)
|
|
1178
|
+
return t(e);
|
|
1179
|
+
let n = e.offsetParent;
|
|
1180
|
+
return Le(e) === n && (n = n.ownerDocument.body), n;
|
|
1181
|
+
}
|
|
1182
|
+
function mr(e, t) {
|
|
1183
|
+
const n = Se(e);
|
|
1184
|
+
if (Xt(e))
|
|
1185
|
+
return n;
|
|
1186
|
+
if (!ce(e)) {
|
|
1187
|
+
let o = Xe(e);
|
|
1188
|
+
for (; o && !We(o); ) {
|
|
1189
|
+
if (Z(o) && !Nt(o))
|
|
1190
|
+
return o;
|
|
1191
|
+
o = Xe(o);
|
|
1192
|
+
}
|
|
1193
|
+
return n;
|
|
1194
|
+
}
|
|
1195
|
+
let r = En(e, t);
|
|
1196
|
+
for (; r && Or(r) && Nt(r); )
|
|
1197
|
+
r = En(r, t);
|
|
1198
|
+
return r && We(r) && Nt(r) && !Gn(r) ? n : r || Ir(e) || n;
|
|
1199
|
+
}
|
|
1200
|
+
const Mo = async function(e) {
|
|
1201
|
+
const t = this.getOffsetParent || mr, n = this.getDimensions, r = await n(e.floating);
|
|
1202
|
+
return {
|
|
1203
|
+
reference: Po(e.reference, await t(e.floating), e.strategy),
|
|
1204
|
+
floating: {
|
|
1205
|
+
x: 0,
|
|
1206
|
+
y: 0,
|
|
1207
|
+
width: r.width,
|
|
1208
|
+
height: r.height
|
|
1209
|
+
}
|
|
1210
|
+
};
|
|
1211
|
+
};
|
|
1212
|
+
function Ao(e) {
|
|
1213
|
+
return Ce(e).direction === "rtl";
|
|
1214
|
+
}
|
|
1215
|
+
const So = {
|
|
1216
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: yo,
|
|
1217
|
+
getDocumentElement: Le,
|
|
1218
|
+
getClippingRect: Oo,
|
|
1219
|
+
getOffsetParent: mr,
|
|
1220
|
+
getElementRects: Mo,
|
|
1221
|
+
getClientRects: wo,
|
|
1222
|
+
getDimensions: Io,
|
|
1223
|
+
getScale: Ye,
|
|
1224
|
+
isElement: Z,
|
|
1225
|
+
isRTL: Ao
|
|
1226
|
+
};
|
|
1227
|
+
function gr(e, t) {
|
|
1228
|
+
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
1229
|
+
}
|
|
1230
|
+
function Lo(e, t) {
|
|
1231
|
+
let n = null, r;
|
|
1232
|
+
const o = Le(e);
|
|
1233
|
+
function i() {
|
|
1234
|
+
var c;
|
|
1235
|
+
clearTimeout(r), (c = n) == null || c.disconnect(), n = null;
|
|
1236
|
+
}
|
|
1237
|
+
function s(c, f) {
|
|
1238
|
+
c === void 0 && (c = !1), f === void 0 && (f = 1), i();
|
|
1239
|
+
const u = e.getBoundingClientRect(), {
|
|
1240
|
+
left: l,
|
|
1241
|
+
top: p,
|
|
1242
|
+
width: d,
|
|
1243
|
+
height: a
|
|
1244
|
+
} = u;
|
|
1245
|
+
if (c || t(), !d || !a)
|
|
1246
|
+
return;
|
|
1247
|
+
const v = je(p), m = je(o.clientWidth - (l + d)), w = je(o.clientHeight - (p + a)), x = je(l), R = {
|
|
1248
|
+
rootMargin: -v + "px " + -m + "px " + -w + "px " + -x + "px",
|
|
1249
|
+
threshold: Re(0, Fe(1, f)) || 1
|
|
1250
|
+
};
|
|
1251
|
+
let E = !0;
|
|
1252
|
+
function A(O) {
|
|
1253
|
+
const M = O[0].intersectionRatio;
|
|
1254
|
+
if (M !== f) {
|
|
1255
|
+
if (!E)
|
|
1256
|
+
return s();
|
|
1257
|
+
M ? s(!1, M) : r = setTimeout(() => {
|
|
1258
|
+
s(!1, 1e-7);
|
|
1259
|
+
}, 1e3);
|
|
1260
|
+
}
|
|
1261
|
+
M === 1 && !gr(u, e.getBoundingClientRect()) && s(), E = !1;
|
|
1262
|
+
}
|
|
1263
|
+
try {
|
|
1264
|
+
n = new IntersectionObserver(A, {
|
|
1265
|
+
...R,
|
|
1266
|
+
// Handle <iframe>s
|
|
1267
|
+
root: o.ownerDocument
|
|
1268
|
+
});
|
|
1269
|
+
} catch {
|
|
1270
|
+
n = new IntersectionObserver(A, R);
|
|
1271
|
+
}
|
|
1272
|
+
n.observe(e);
|
|
1273
|
+
}
|
|
1274
|
+
return s(!0), i;
|
|
1275
|
+
}
|
|
1276
|
+
function Rs(e, t, n, r) {
|
|
1277
|
+
r === void 0 && (r = {});
|
|
1278
|
+
const {
|
|
1279
|
+
ancestorScroll: o = !0,
|
|
1280
|
+
ancestorResize: i = !0,
|
|
1281
|
+
elementResize: s = typeof ResizeObserver == "function",
|
|
1282
|
+
layoutShift: c = typeof IntersectionObserver == "function",
|
|
1283
|
+
animationFrame: f = !1
|
|
1284
|
+
} = r, u = rn(e), l = o || i ? [...u ? Ue(u) : [], ...Ue(t)] : [];
|
|
1285
|
+
l.forEach((x) => {
|
|
1286
|
+
o && x.addEventListener("scroll", n, {
|
|
1287
|
+
passive: !0
|
|
1288
|
+
}), i && x.addEventListener("resize", n);
|
|
1289
|
+
});
|
|
1290
|
+
const p = u && c ? Lo(u, n) : null;
|
|
1291
|
+
let d = -1, a = null;
|
|
1292
|
+
s && (a = new ResizeObserver((x) => {
|
|
1293
|
+
let [y] = x;
|
|
1294
|
+
y && y.target === u && a && (a.unobserve(t), cancelAnimationFrame(d), d = requestAnimationFrame(() => {
|
|
1295
|
+
var R;
|
|
1296
|
+
(R = a) == null || R.observe(t);
|
|
1297
|
+
})), n();
|
|
1298
|
+
}), u && !f && a.observe(u), a.observe(t));
|
|
1299
|
+
let v, m = f ? Be(e) : null;
|
|
1300
|
+
f && w();
|
|
1301
|
+
function w() {
|
|
1302
|
+
const x = Be(e);
|
|
1303
|
+
m && !gr(m, x) && n(), m = x, v = requestAnimationFrame(w);
|
|
1304
|
+
}
|
|
1305
|
+
return n(), () => {
|
|
1306
|
+
var x;
|
|
1307
|
+
l.forEach((y) => {
|
|
1308
|
+
o && y.removeEventListener("scroll", n), i && y.removeEventListener("resize", n);
|
|
1309
|
+
}), p?.(), (x = a) == null || x.disconnect(), a = null, f && cancelAnimationFrame(v);
|
|
1310
|
+
};
|
|
1311
|
+
}
|
|
1312
|
+
const ko = go, Do = lo, Fo = po, No = ao, _o = ho, Cn = co, Wo = (e, t, n) => {
|
|
1313
|
+
const r = /* @__PURE__ */ new Map(), o = {
|
|
1314
|
+
platform: So,
|
|
1315
|
+
...n
|
|
1316
|
+
}, i = {
|
|
1317
|
+
...o.platform,
|
|
1318
|
+
_c: r
|
|
1319
|
+
};
|
|
1320
|
+
return io(e, t, {
|
|
1321
|
+
...o,
|
|
1322
|
+
platform: i
|
|
1323
|
+
});
|
|
1324
|
+
};
|
|
1325
|
+
var $o = typeof document < "u", Bo = function() {
|
|
1326
|
+
}, bt = $o ? Xn : Bo;
|
|
1327
|
+
function Tt(e, t) {
|
|
1328
|
+
if (e === t)
|
|
1329
|
+
return !0;
|
|
1330
|
+
if (typeof e != typeof t)
|
|
1331
|
+
return !1;
|
|
1332
|
+
if (typeof e == "function" && e.toString() === t.toString())
|
|
1333
|
+
return !0;
|
|
1334
|
+
let n, r, o;
|
|
1335
|
+
if (e && t && typeof e == "object") {
|
|
1336
|
+
if (Array.isArray(e)) {
|
|
1337
|
+
if (n = e.length, n !== t.length) return !1;
|
|
1338
|
+
for (r = n; r-- !== 0; )
|
|
1339
|
+
if (!Tt(e[r], t[r]))
|
|
1340
|
+
return !1;
|
|
1341
|
+
return !0;
|
|
1342
|
+
}
|
|
1343
|
+
if (o = Object.keys(e), n = o.length, n !== Object.keys(t).length)
|
|
1344
|
+
return !1;
|
|
1345
|
+
for (r = n; r-- !== 0; )
|
|
1346
|
+
if (!{}.hasOwnProperty.call(t, o[r]))
|
|
1347
|
+
return !1;
|
|
1348
|
+
for (r = n; r-- !== 0; ) {
|
|
1349
|
+
const i = o[r];
|
|
1350
|
+
if (!(i === "_owner" && e.$$typeof) && !Tt(e[i], t[i]))
|
|
1351
|
+
return !1;
|
|
1352
|
+
}
|
|
1353
|
+
return !0;
|
|
1354
|
+
}
|
|
1355
|
+
return e !== e && t !== t;
|
|
1356
|
+
}
|
|
1357
|
+
function pr(e) {
|
|
1358
|
+
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1359
|
+
}
|
|
1360
|
+
function Tn(e, t) {
|
|
1361
|
+
const n = pr(e);
|
|
1362
|
+
return Math.round(t * n) / n;
|
|
1363
|
+
}
|
|
1364
|
+
function _t(e) {
|
|
1365
|
+
const t = g.useRef(e);
|
|
1366
|
+
return bt(() => {
|
|
1367
|
+
t.current = e;
|
|
1368
|
+
}), t;
|
|
1369
|
+
}
|
|
1370
|
+
function Vo(e) {
|
|
1371
|
+
e === void 0 && (e = {});
|
|
1372
|
+
const {
|
|
1373
|
+
placement: t = "bottom",
|
|
1374
|
+
strategy: n = "absolute",
|
|
1375
|
+
middleware: r = [],
|
|
1376
|
+
platform: o,
|
|
1377
|
+
elements: {
|
|
1378
|
+
reference: i,
|
|
1379
|
+
floating: s
|
|
1380
|
+
} = {},
|
|
1381
|
+
transform: c = !0,
|
|
1382
|
+
whileElementsMounted: f,
|
|
1383
|
+
open: u
|
|
1384
|
+
} = e, [l, p] = g.useState({
|
|
1385
|
+
x: 0,
|
|
1386
|
+
y: 0,
|
|
1387
|
+
strategy: n,
|
|
1388
|
+
placement: t,
|
|
1389
|
+
middlewareData: {},
|
|
1390
|
+
isPositioned: !1
|
|
1391
|
+
}), [d, a] = g.useState(r);
|
|
1392
|
+
Tt(d, r) || a(r);
|
|
1393
|
+
const [v, m] = g.useState(null), [w, x] = g.useState(null), y = g.useCallback((b) => {
|
|
1394
|
+
b !== O.current && (O.current = b, m(b));
|
|
1395
|
+
}, []), R = g.useCallback((b) => {
|
|
1396
|
+
b !== M.current && (M.current = b, x(b));
|
|
1397
|
+
}, []), E = i || v, A = s || w, O = g.useRef(null), M = g.useRef(null), S = g.useRef(l), $ = f != null, I = _t(f), B = _t(o), W = _t(u), L = g.useCallback(() => {
|
|
1398
|
+
if (!O.current || !M.current)
|
|
1399
|
+
return;
|
|
1400
|
+
const b = {
|
|
1401
|
+
placement: t,
|
|
1402
|
+
strategy: n,
|
|
1403
|
+
middleware: d
|
|
1404
|
+
};
|
|
1405
|
+
B.current && (b.platform = B.current), Wo(O.current, M.current, b).then((P) => {
|
|
1406
|
+
const k = {
|
|
1407
|
+
...P,
|
|
1408
|
+
// The floating element's position may be recomputed while it's closed
|
|
1409
|
+
// but still mounted (such as when transitioning out). To ensure
|
|
1410
|
+
// `isPositioned` will be `false` initially on the next open, avoid
|
|
1411
|
+
// setting it to `true` when `open === false` (must be specified).
|
|
1412
|
+
isPositioned: W.current !== !1
|
|
1413
|
+
};
|
|
1414
|
+
h.current && !Tt(S.current, k) && (S.current = k, Jt.flushSync(() => {
|
|
1415
|
+
p(k);
|
|
1416
|
+
}));
|
|
1417
|
+
});
|
|
1418
|
+
}, [d, t, n, B, W]);
|
|
1419
|
+
bt(() => {
|
|
1420
|
+
u === !1 && S.current.isPositioned && (S.current.isPositioned = !1, p((b) => ({
|
|
1421
|
+
...b,
|
|
1422
|
+
isPositioned: !1
|
|
1423
|
+
})));
|
|
1424
|
+
}, [u]);
|
|
1425
|
+
const h = g.useRef(!1);
|
|
1426
|
+
bt(() => (h.current = !0, () => {
|
|
1427
|
+
h.current = !1;
|
|
1428
|
+
}), []), bt(() => {
|
|
1429
|
+
if (E && (O.current = E), A && (M.current = A), E && A) {
|
|
1430
|
+
if (I.current)
|
|
1431
|
+
return I.current(E, A, L);
|
|
1432
|
+
L();
|
|
1433
|
+
}
|
|
1434
|
+
}, [E, A, L, I, $]);
|
|
1435
|
+
const C = g.useMemo(() => ({
|
|
1436
|
+
reference: O,
|
|
1437
|
+
floating: M,
|
|
1438
|
+
setReference: y,
|
|
1439
|
+
setFloating: R
|
|
1440
|
+
}), [y, R]), D = g.useMemo(() => ({
|
|
1441
|
+
reference: E,
|
|
1442
|
+
floating: A
|
|
1443
|
+
}), [E, A]), T = g.useMemo(() => {
|
|
1444
|
+
const b = {
|
|
1445
|
+
position: n,
|
|
1446
|
+
left: 0,
|
|
1447
|
+
top: 0
|
|
1448
|
+
};
|
|
1449
|
+
if (!D.floating)
|
|
1450
|
+
return b;
|
|
1451
|
+
const P = Tn(D.floating, l.x), k = Tn(D.floating, l.y);
|
|
1452
|
+
return c ? {
|
|
1453
|
+
...b,
|
|
1454
|
+
transform: "translate(" + P + "px, " + k + "px)",
|
|
1455
|
+
...pr(D.floating) >= 1.5 && {
|
|
1456
|
+
willChange: "transform"
|
|
1457
|
+
}
|
|
1458
|
+
} : {
|
|
1459
|
+
position: n,
|
|
1460
|
+
left: P,
|
|
1461
|
+
top: k
|
|
1462
|
+
};
|
|
1463
|
+
}, [n, c, D.floating, l.x, l.y]);
|
|
1464
|
+
return g.useMemo(() => ({
|
|
1465
|
+
...l,
|
|
1466
|
+
update: L,
|
|
1467
|
+
refs: C,
|
|
1468
|
+
elements: D,
|
|
1469
|
+
floatingStyles: T
|
|
1470
|
+
}), [l, L, C, D, T]);
|
|
1471
|
+
}
|
|
1472
|
+
const Ko = (e) => {
|
|
1473
|
+
function t(n) {
|
|
1474
|
+
return {}.hasOwnProperty.call(n, "current");
|
|
1475
|
+
}
|
|
1476
|
+
return {
|
|
1477
|
+
name: "arrow",
|
|
1478
|
+
options: e,
|
|
1479
|
+
fn(n) {
|
|
1480
|
+
const {
|
|
1481
|
+
element: r,
|
|
1482
|
+
padding: o
|
|
1483
|
+
} = typeof e == "function" ? e(n) : e;
|
|
1484
|
+
return r && t(r) ? r.current != null ? Cn({
|
|
1485
|
+
element: r.current,
|
|
1486
|
+
padding: o
|
|
1487
|
+
}).fn(n) : {} : r ? Cn({
|
|
1488
|
+
element: r,
|
|
1489
|
+
padding: o
|
|
1490
|
+
}).fn(n) : {};
|
|
1491
|
+
}
|
|
1492
|
+
};
|
|
1493
|
+
}, xs = (e, t) => ({
|
|
1494
|
+
...ko(e),
|
|
1495
|
+
options: [e, t]
|
|
1496
|
+
}), Es = (e, t) => ({
|
|
1497
|
+
...Fo(e),
|
|
1498
|
+
options: [e, t]
|
|
1499
|
+
}), Cs = (e, t) => ({
|
|
1500
|
+
...No(e),
|
|
1501
|
+
options: [e, t]
|
|
1502
|
+
}), Ts = (e, t) => ({
|
|
1503
|
+
..._o(e),
|
|
1504
|
+
options: [e, t]
|
|
1505
|
+
}), Os = (e, t) => ({
|
|
1506
|
+
...Do(e),
|
|
1507
|
+
options: [e, t]
|
|
1508
|
+
}), Is = (e, t) => ({
|
|
1509
|
+
...Ko(e),
|
|
1510
|
+
options: [e, t]
|
|
1511
|
+
});
|
|
1512
|
+
function Ho(e, t) {
|
|
1513
|
+
const n = e.compareDocumentPosition(t);
|
|
1514
|
+
return n & Node.DOCUMENT_POSITION_FOLLOWING || n & Node.DOCUMENT_POSITION_CONTAINED_BY ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING || n & Node.DOCUMENT_POSITION_CONTAINS ? 1 : 0;
|
|
1515
|
+
}
|
|
1516
|
+
const hr = /* @__PURE__ */ g.createContext({
|
|
1517
|
+
register: () => {
|
|
1518
|
+
},
|
|
1519
|
+
unregister: () => {
|
|
1520
|
+
},
|
|
1521
|
+
map: /* @__PURE__ */ new Map(),
|
|
1522
|
+
elementsRef: {
|
|
1523
|
+
current: []
|
|
1524
|
+
}
|
|
1525
|
+
});
|
|
1526
|
+
function Ps(e) {
|
|
1527
|
+
const {
|
|
1528
|
+
children: t,
|
|
1529
|
+
elementsRef: n,
|
|
1530
|
+
labelsRef: r
|
|
1531
|
+
} = e, [o, i] = g.useState(() => /* @__PURE__ */ new Set()), s = g.useCallback((u) => {
|
|
1532
|
+
i((l) => new Set(l).add(u));
|
|
1533
|
+
}, []), c = g.useCallback((u) => {
|
|
1534
|
+
i((l) => {
|
|
1535
|
+
const p = new Set(l);
|
|
1536
|
+
return p.delete(u), p;
|
|
1537
|
+
});
|
|
1538
|
+
}, []), f = g.useMemo(() => {
|
|
1539
|
+
const u = /* @__PURE__ */ new Map();
|
|
1540
|
+
return Array.from(o.keys()).sort(Ho).forEach((p, d) => {
|
|
1541
|
+
u.set(p, d);
|
|
1542
|
+
}), u;
|
|
1543
|
+
}, [o]);
|
|
1544
|
+
return /* @__PURE__ */ be(hr.Provider, {
|
|
1545
|
+
value: g.useMemo(() => ({
|
|
1546
|
+
register: s,
|
|
1547
|
+
unregister: c,
|
|
1548
|
+
map: f,
|
|
1549
|
+
elementsRef: n,
|
|
1550
|
+
labelsRef: r
|
|
1551
|
+
}), [s, c, f, n, r]),
|
|
1552
|
+
children: t
|
|
1553
|
+
});
|
|
1554
|
+
}
|
|
1555
|
+
function Ms(e) {
|
|
1556
|
+
e === void 0 && (e = {});
|
|
1557
|
+
const {
|
|
1558
|
+
label: t
|
|
1559
|
+
} = e, {
|
|
1560
|
+
register: n,
|
|
1561
|
+
unregister: r,
|
|
1562
|
+
map: o,
|
|
1563
|
+
elementsRef: i,
|
|
1564
|
+
labelsRef: s
|
|
1565
|
+
} = g.useContext(hr), [c, f] = g.useState(null), u = g.useRef(null), l = g.useCallback((p) => {
|
|
1566
|
+
if (u.current = p, c !== null && (i.current[c] = p, s)) {
|
|
1567
|
+
var d;
|
|
1568
|
+
const a = t !== void 0;
|
|
1569
|
+
s.current[c] = a ? t : (d = p?.textContent) != null ? d : null;
|
|
1570
|
+
}
|
|
1571
|
+
}, [c, i, s, t]);
|
|
1572
|
+
return X(() => {
|
|
1573
|
+
const p = u.current;
|
|
1574
|
+
if (p)
|
|
1575
|
+
return n(p), () => {
|
|
1576
|
+
r(p);
|
|
1577
|
+
};
|
|
1578
|
+
}, [n, r]), X(() => {
|
|
1579
|
+
const p = u.current ? o.get(u.current) : null;
|
|
1580
|
+
p != null && f(p);
|
|
1581
|
+
}, [o]), g.useMemo(() => ({
|
|
1582
|
+
ref: l,
|
|
1583
|
+
index: c ?? -1
|
|
1584
|
+
}), [c, l]);
|
|
1585
|
+
}
|
|
1586
|
+
const jo = "data-floating-ui-focusable", On = "active", In = "selected", st = "ArrowLeft", it = "ArrowRight", vr = "ArrowUp", At = "ArrowDown", Uo = {
|
|
1587
|
+
...g
|
|
1588
|
+
};
|
|
1589
|
+
let Pn = !1, Yo = 0;
|
|
1590
|
+
const Mn = () => (
|
|
1591
|
+
// Ensure the id is unique with multiple independent versions of Floating UI
|
|
1592
|
+
// on <React 18
|
|
1593
|
+
"floating-ui-" + Math.random().toString(36).slice(2, 6) + Yo++
|
|
1594
|
+
);
|
|
1595
|
+
function zo() {
|
|
1596
|
+
const [e, t] = g.useState(() => Pn ? Mn() : void 0);
|
|
1597
|
+
return X(() => {
|
|
1598
|
+
e == null && t(Mn());
|
|
1599
|
+
}, []), g.useEffect(() => {
|
|
1600
|
+
Pn = !0;
|
|
1601
|
+
}, []), e;
|
|
1602
|
+
}
|
|
1603
|
+
const Xo = Uo.useId, ct = Xo || zo;
|
|
1604
|
+
let nt;
|
|
1605
|
+
process.env.NODE_ENV !== "production" && (nt = /* @__PURE__ */ new Set());
|
|
1606
|
+
function yt() {
|
|
1607
|
+
for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)
|
|
1608
|
+
n[r] = arguments[r];
|
|
1609
|
+
const o = "Floating UI: " + n.join(" ");
|
|
1610
|
+
if (!((e = nt) != null && e.has(o))) {
|
|
1611
|
+
var i;
|
|
1612
|
+
(i = nt) == null || i.add(o), console.warn(o);
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
function qo() {
|
|
1616
|
+
for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)
|
|
1617
|
+
n[r] = arguments[r];
|
|
1618
|
+
const o = "Floating UI: " + n.join(" ");
|
|
1619
|
+
if (!((e = nt) != null && e.has(o))) {
|
|
1620
|
+
var i;
|
|
1621
|
+
(i = nt) == null || i.add(o), console.error(o);
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
const As = /* @__PURE__ */ g.forwardRef(function(t, n) {
|
|
1625
|
+
const {
|
|
1626
|
+
context: {
|
|
1627
|
+
placement: r,
|
|
1628
|
+
elements: {
|
|
1629
|
+
floating: o
|
|
1630
|
+
},
|
|
1631
|
+
middlewareData: {
|
|
1632
|
+
arrow: i,
|
|
1633
|
+
shift: s
|
|
1634
|
+
}
|
|
1635
|
+
},
|
|
1636
|
+
width: c = 14,
|
|
1637
|
+
height: f = 7,
|
|
1638
|
+
tipRadius: u = 0,
|
|
1639
|
+
strokeWidth: l = 0,
|
|
1640
|
+
staticOffset: p,
|
|
1641
|
+
stroke: d,
|
|
1642
|
+
d: a,
|
|
1643
|
+
style: {
|
|
1644
|
+
transform: v,
|
|
1645
|
+
...m
|
|
1646
|
+
} = {},
|
|
1647
|
+
...w
|
|
1648
|
+
} = t;
|
|
1649
|
+
process.env.NODE_ENV !== "production" && (n || yt("The `ref` prop is required for `FloatingArrow`."));
|
|
1650
|
+
const x = ct(), [y, R] = g.useState(!1);
|
|
1651
|
+
if (X(() => {
|
|
1652
|
+
if (!o) return;
|
|
1653
|
+
Ce(o).direction === "rtl" && R(!0);
|
|
1654
|
+
}, [o]), !o)
|
|
1655
|
+
return null;
|
|
1656
|
+
const [E, A] = r.split("-"), O = E === "top" || E === "bottom";
|
|
1657
|
+
let M = p;
|
|
1658
|
+
(O && s != null && s.x || !O && s != null && s.y) && (M = null);
|
|
1659
|
+
const S = l * 2, $ = S / 2, I = c / 2 * (u / -8 + 1), B = f / 2 * u / 4, W = !!a, L = M && A === "end" ? "bottom" : "top";
|
|
1660
|
+
let h = M && A === "end" ? "right" : "left";
|
|
1661
|
+
M && y && (h = A === "end" ? "left" : "right");
|
|
1662
|
+
const C = i?.x != null ? M || i.x : "", D = i?.y != null ? M || i.y : "", T = a || "M0,0" + (" H" + c) + (" L" + (c - I) + "," + (f - B)) + (" Q" + c / 2 + "," + f + " " + I + "," + (f - B)) + " Z", b = {
|
|
1663
|
+
top: W ? "rotate(180deg)" : "",
|
|
1664
|
+
left: W ? "rotate(90deg)" : "rotate(-90deg)",
|
|
1665
|
+
bottom: W ? "" : "rotate(180deg)",
|
|
1666
|
+
right: W ? "rotate(-90deg)" : "rotate(90deg)"
|
|
1667
|
+
}[E];
|
|
1668
|
+
return /* @__PURE__ */ Zt("svg", {
|
|
1669
|
+
...w,
|
|
1670
|
+
"aria-hidden": !0,
|
|
1671
|
+
ref: n,
|
|
1672
|
+
width: W ? c : c + S,
|
|
1673
|
+
height: c,
|
|
1674
|
+
viewBox: "0 0 " + c + " " + (f > c ? f : c),
|
|
1675
|
+
style: {
|
|
1676
|
+
position: "absolute",
|
|
1677
|
+
pointerEvents: "none",
|
|
1678
|
+
[h]: C,
|
|
1679
|
+
[L]: D,
|
|
1680
|
+
[E]: O || W ? "100%" : "calc(100% - " + S / 2 + "px)",
|
|
1681
|
+
transform: [b, v].filter((P) => !!P).join(" "),
|
|
1682
|
+
...m
|
|
1683
|
+
},
|
|
1684
|
+
children: [S > 0 && /* @__PURE__ */ be("path", {
|
|
1685
|
+
clipPath: "url(#" + x + ")",
|
|
1686
|
+
fill: "none",
|
|
1687
|
+
stroke: d,
|
|
1688
|
+
strokeWidth: S + (a ? 0 : 1),
|
|
1689
|
+
d: T
|
|
1690
|
+
}), /* @__PURE__ */ be("path", {
|
|
1691
|
+
stroke: S && !a ? w.fill : "none",
|
|
1692
|
+
d: T
|
|
1693
|
+
}), /* @__PURE__ */ be("clipPath", {
|
|
1694
|
+
id: x,
|
|
1695
|
+
children: /* @__PURE__ */ be("rect", {
|
|
1696
|
+
x: -$,
|
|
1697
|
+
y: $ * (W ? -1 : 1),
|
|
1698
|
+
width: c + S,
|
|
1699
|
+
height: c
|
|
1700
|
+
})
|
|
1701
|
+
})]
|
|
1702
|
+
});
|
|
1703
|
+
});
|
|
1704
|
+
function br() {
|
|
1705
|
+
const e = /* @__PURE__ */ new Map();
|
|
1706
|
+
return {
|
|
1707
|
+
emit(t, n) {
|
|
1708
|
+
var r;
|
|
1709
|
+
(r = e.get(t)) == null || r.forEach((o) => o(n));
|
|
1710
|
+
},
|
|
1711
|
+
on(t, n) {
|
|
1712
|
+
e.has(t) || e.set(t, /* @__PURE__ */ new Set()), e.get(t).add(n);
|
|
1713
|
+
},
|
|
1714
|
+
off(t, n) {
|
|
1715
|
+
var r;
|
|
1716
|
+
(r = e.get(t)) == null || r.delete(n);
|
|
1717
|
+
}
|
|
1718
|
+
};
|
|
1719
|
+
}
|
|
1720
|
+
const yr = /* @__PURE__ */ g.createContext(null), wr = /* @__PURE__ */ g.createContext(null), Ge = () => {
|
|
1721
|
+
var e;
|
|
1722
|
+
return ((e = g.useContext(yr)) == null ? void 0 : e.id) || null;
|
|
1723
|
+
}, Ze = () => g.useContext(wr);
|
|
1724
|
+
function Ss(e) {
|
|
1725
|
+
const t = ct(), n = Ze(), o = Ge();
|
|
1726
|
+
return X(() => {
|
|
1727
|
+
if (!t) return;
|
|
1728
|
+
const i = {
|
|
1729
|
+
id: t,
|
|
1730
|
+
parentId: o
|
|
1731
|
+
};
|
|
1732
|
+
return n?.addNode(i), () => {
|
|
1733
|
+
n?.removeNode(i);
|
|
1734
|
+
};
|
|
1735
|
+
}, [n, t, o]), t;
|
|
1736
|
+
}
|
|
1737
|
+
function Ls(e) {
|
|
1738
|
+
const {
|
|
1739
|
+
children: t,
|
|
1740
|
+
id: n
|
|
1741
|
+
} = e, r = Ge();
|
|
1742
|
+
return /* @__PURE__ */ be(yr.Provider, {
|
|
1743
|
+
value: g.useMemo(() => ({
|
|
1744
|
+
id: n,
|
|
1745
|
+
parentId: r
|
|
1746
|
+
}), [n, r]),
|
|
1747
|
+
children: t
|
|
1748
|
+
});
|
|
1749
|
+
}
|
|
1750
|
+
function ks(e) {
|
|
1751
|
+
const {
|
|
1752
|
+
children: t
|
|
1753
|
+
} = e, n = g.useRef([]), r = g.useCallback((s) => {
|
|
1754
|
+
n.current = [...n.current, s];
|
|
1755
|
+
}, []), o = g.useCallback((s) => {
|
|
1756
|
+
n.current = n.current.filter((c) => c !== s);
|
|
1757
|
+
}, []), [i] = g.useState(() => br());
|
|
1758
|
+
return /* @__PURE__ */ be(wr.Provider, {
|
|
1759
|
+
value: g.useMemo(() => ({
|
|
1760
|
+
nodesRef: n,
|
|
1761
|
+
addNode: r,
|
|
1762
|
+
removeNode: o,
|
|
1763
|
+
events: i
|
|
1764
|
+
}), [r, o, i]),
|
|
1765
|
+
children: t
|
|
1766
|
+
});
|
|
1767
|
+
}
|
|
1768
|
+
function Ve(e) {
|
|
1769
|
+
return "data-floating-ui-" + e;
|
|
1770
|
+
}
|
|
1771
|
+
function me(e) {
|
|
1772
|
+
e.current !== -1 && (clearTimeout(e.current), e.current = -1);
|
|
1773
|
+
}
|
|
1774
|
+
const An = /* @__PURE__ */ Ve("safe-polygon");
|
|
1775
|
+
function Wt(e, t, n) {
|
|
1776
|
+
if (n && !qe(n))
|
|
1777
|
+
return 0;
|
|
1778
|
+
if (typeof e == "number")
|
|
1779
|
+
return e;
|
|
1780
|
+
if (typeof e == "function") {
|
|
1781
|
+
const r = e();
|
|
1782
|
+
return typeof r == "number" ? r : r?.[t];
|
|
1783
|
+
}
|
|
1784
|
+
return e?.[t];
|
|
1785
|
+
}
|
|
1786
|
+
function $t(e) {
|
|
1787
|
+
return typeof e == "function" ? e() : e;
|
|
1788
|
+
}
|
|
1789
|
+
function Ds(e, t) {
|
|
1790
|
+
t === void 0 && (t = {});
|
|
1791
|
+
const {
|
|
1792
|
+
open: n,
|
|
1793
|
+
onOpenChange: r,
|
|
1794
|
+
dataRef: o,
|
|
1795
|
+
events: i,
|
|
1796
|
+
elements: s
|
|
1797
|
+
} = e, {
|
|
1798
|
+
enabled: c = !0,
|
|
1799
|
+
delay: f = 0,
|
|
1800
|
+
handleClose: u = null,
|
|
1801
|
+
mouseOnly: l = !1,
|
|
1802
|
+
restMs: p = 0,
|
|
1803
|
+
move: d = !0
|
|
1804
|
+
} = t, a = Ze(), v = Ge(), m = le(u), w = le(f), x = le(n), y = le(p), R = g.useRef(), E = g.useRef(-1), A = g.useRef(), O = g.useRef(-1), M = g.useRef(!0), S = g.useRef(!1), $ = g.useRef(() => {
|
|
1805
|
+
}), I = g.useRef(!1), B = re(() => {
|
|
1806
|
+
var T;
|
|
1807
|
+
const b = (T = o.current.openEvent) == null ? void 0 : T.type;
|
|
1808
|
+
return b?.includes("mouse") && b !== "mousedown";
|
|
1809
|
+
});
|
|
1810
|
+
g.useEffect(() => {
|
|
1811
|
+
if (!c) return;
|
|
1812
|
+
function T(b) {
|
|
1813
|
+
let {
|
|
1814
|
+
open: P
|
|
1815
|
+
} = b;
|
|
1816
|
+
P || (me(E), me(O), M.current = !0, I.current = !1);
|
|
1817
|
+
}
|
|
1818
|
+
return i.on("openchange", T), () => {
|
|
1819
|
+
i.off("openchange", T);
|
|
1820
|
+
};
|
|
1821
|
+
}, [c, i]), g.useEffect(() => {
|
|
1822
|
+
if (!c || !m.current || !n) return;
|
|
1823
|
+
function T(P) {
|
|
1824
|
+
B() && r(!1, P, "hover");
|
|
1825
|
+
}
|
|
1826
|
+
const b = pe(s.floating).documentElement;
|
|
1827
|
+
return b.addEventListener("mouseleave", T), () => {
|
|
1828
|
+
b.removeEventListener("mouseleave", T);
|
|
1829
|
+
};
|
|
1830
|
+
}, [s.floating, n, r, c, m, B]);
|
|
1831
|
+
const W = g.useCallback(function(T, b, P) {
|
|
1832
|
+
b === void 0 && (b = !0), P === void 0 && (P = "hover");
|
|
1833
|
+
const k = Wt(w.current, "close", R.current);
|
|
1834
|
+
k && !A.current ? (me(E), E.current = window.setTimeout(() => r(!1, T, P), k)) : b && (me(E), r(!1, T, P));
|
|
1835
|
+
}, [w, r]), L = re(() => {
|
|
1836
|
+
$.current(), A.current = void 0;
|
|
1837
|
+
}), h = re(() => {
|
|
1838
|
+
if (S.current) {
|
|
1839
|
+
const T = pe(s.floating).body;
|
|
1840
|
+
T.style.pointerEvents = "", T.removeAttribute(An), S.current = !1;
|
|
1841
|
+
}
|
|
1842
|
+
}), C = re(() => o.current.openEvent ? ["click", "mousedown"].includes(o.current.openEvent.type) : !1);
|
|
1843
|
+
g.useEffect(() => {
|
|
1844
|
+
if (!c) return;
|
|
1845
|
+
function T(K) {
|
|
1846
|
+
if (me(E), M.current = !1, l && !qe(R.current) || $t(y.current) > 0 && !Wt(w.current, "open"))
|
|
1847
|
+
return;
|
|
1848
|
+
const N = Wt(w.current, "open", R.current);
|
|
1849
|
+
N ? E.current = window.setTimeout(() => {
|
|
1850
|
+
x.current || r(!0, K, "hover");
|
|
1851
|
+
}, N) : n || r(!0, K, "hover");
|
|
1852
|
+
}
|
|
1853
|
+
function b(K) {
|
|
1854
|
+
if (C()) {
|
|
1855
|
+
h();
|
|
1856
|
+
return;
|
|
1857
|
+
}
|
|
1858
|
+
$.current();
|
|
1859
|
+
const N = pe(s.floating);
|
|
1860
|
+
if (me(O), I.current = !1, m.current && o.current.floatingContext) {
|
|
1861
|
+
n || me(E), A.current = m.current({
|
|
1862
|
+
...o.current.floatingContext,
|
|
1863
|
+
tree: a,
|
|
1864
|
+
x: K.clientX,
|
|
1865
|
+
y: K.clientY,
|
|
1866
|
+
onClose() {
|
|
1867
|
+
h(), L(), C() || W(K, !0, "safe-polygon");
|
|
1868
|
+
}
|
|
1869
|
+
});
|
|
1870
|
+
const U = A.current;
|
|
1871
|
+
N.addEventListener("mousemove", U), $.current = () => {
|
|
1872
|
+
N.removeEventListener("mousemove", U);
|
|
1873
|
+
};
|
|
1874
|
+
return;
|
|
1875
|
+
}
|
|
1876
|
+
(R.current !== "touch" || !ue(s.floating, K.relatedTarget)) && W(K);
|
|
1877
|
+
}
|
|
1878
|
+
function P(K) {
|
|
1879
|
+
C() || o.current.floatingContext && (m.current == null || m.current({
|
|
1880
|
+
...o.current.floatingContext,
|
|
1881
|
+
tree: a,
|
|
1882
|
+
x: K.clientX,
|
|
1883
|
+
y: K.clientY,
|
|
1884
|
+
onClose() {
|
|
1885
|
+
h(), L(), C() || W(K);
|
|
1886
|
+
}
|
|
1887
|
+
})(K));
|
|
1888
|
+
}
|
|
1889
|
+
function k() {
|
|
1890
|
+
me(E);
|
|
1891
|
+
}
|
|
1892
|
+
function G(K) {
|
|
1893
|
+
C() || W(K, !1);
|
|
1894
|
+
}
|
|
1895
|
+
if (Z(s.domReference)) {
|
|
1896
|
+
const K = s.domReference, N = s.floating;
|
|
1897
|
+
return n && K.addEventListener("mouseleave", P), d && K.addEventListener("mousemove", T, {
|
|
1898
|
+
once: !0
|
|
1899
|
+
}), K.addEventListener("mouseenter", T), K.addEventListener("mouseleave", b), N && (N.addEventListener("mouseleave", P), N.addEventListener("mouseenter", k), N.addEventListener("mouseleave", G)), () => {
|
|
1900
|
+
n && K.removeEventListener("mouseleave", P), d && K.removeEventListener("mousemove", T), K.removeEventListener("mouseenter", T), K.removeEventListener("mouseleave", b), N && (N.removeEventListener("mouseleave", P), N.removeEventListener("mouseenter", k), N.removeEventListener("mouseleave", G));
|
|
1901
|
+
};
|
|
1902
|
+
}
|
|
1903
|
+
}, [s, c, e, l, d, W, L, h, r, n, x, a, w, m, o, C, y]), X(() => {
|
|
1904
|
+
var T;
|
|
1905
|
+
if (c && n && (T = m.current) != null && (T = T.__options) != null && T.blockPointerEvents && B()) {
|
|
1906
|
+
S.current = !0;
|
|
1907
|
+
const P = s.floating;
|
|
1908
|
+
if (Z(s.domReference) && P) {
|
|
1909
|
+
var b;
|
|
1910
|
+
const k = pe(s.floating).body;
|
|
1911
|
+
k.setAttribute(An, "");
|
|
1912
|
+
const G = s.domReference, K = a == null || (b = a.nodesRef.current.find((N) => N.id === v)) == null || (b = b.context) == null ? void 0 : b.elements.floating;
|
|
1913
|
+
return K && (K.style.pointerEvents = ""), k.style.pointerEvents = "none", G.style.pointerEvents = "auto", P.style.pointerEvents = "auto", () => {
|
|
1914
|
+
k.style.pointerEvents = "", G.style.pointerEvents = "", P.style.pointerEvents = "";
|
|
1915
|
+
};
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
}, [c, n, v, s, a, m, B]), X(() => {
|
|
1919
|
+
n || (R.current = void 0, I.current = !1, L(), h());
|
|
1920
|
+
}, [n, L, h]), g.useEffect(() => () => {
|
|
1921
|
+
L(), me(E), me(O), h();
|
|
1922
|
+
}, [c, s.domReference, L, h]);
|
|
1923
|
+
const D = g.useMemo(() => {
|
|
1924
|
+
function T(b) {
|
|
1925
|
+
R.current = b.pointerType;
|
|
1926
|
+
}
|
|
1927
|
+
return {
|
|
1928
|
+
onPointerDown: T,
|
|
1929
|
+
onPointerEnter: T,
|
|
1930
|
+
onMouseMove(b) {
|
|
1931
|
+
const {
|
|
1932
|
+
nativeEvent: P
|
|
1933
|
+
} = b;
|
|
1934
|
+
function k() {
|
|
1935
|
+
!M.current && !x.current && r(!0, P, "hover");
|
|
1936
|
+
}
|
|
1937
|
+
l && !qe(R.current) || n || $t(y.current) === 0 || I.current && b.movementX ** 2 + b.movementY ** 2 < 2 || (me(O), R.current === "touch" ? k() : (I.current = !0, O.current = window.setTimeout(k, $t(y.current))));
|
|
1938
|
+
}
|
|
1939
|
+
};
|
|
1940
|
+
}, [l, r, n, x, y]);
|
|
1941
|
+
return g.useMemo(() => c ? {
|
|
1942
|
+
reference: D
|
|
1943
|
+
} : {}, [c, D]);
|
|
1944
|
+
}
|
|
1945
|
+
let Sn = 0;
|
|
1946
|
+
function _e(e, t) {
|
|
1947
|
+
t === void 0 && (t = {});
|
|
1948
|
+
const {
|
|
1949
|
+
preventScroll: n = !1,
|
|
1950
|
+
cancelPrevious: r = !0,
|
|
1951
|
+
sync: o = !1
|
|
1952
|
+
} = t;
|
|
1953
|
+
r && cancelAnimationFrame(Sn);
|
|
1954
|
+
const i = () => e?.focus({
|
|
1955
|
+
preventScroll: n
|
|
1956
|
+
});
|
|
1957
|
+
o ? i() : Sn = requestAnimationFrame(i);
|
|
1958
|
+
}
|
|
1959
|
+
function Bt(e, t) {
|
|
1960
|
+
if (!e || !t)
|
|
1961
|
+
return !1;
|
|
1962
|
+
const n = t.getRootNode == null ? void 0 : t.getRootNode();
|
|
1963
|
+
if (e.contains(t))
|
|
1964
|
+
return !0;
|
|
1965
|
+
if (n && qn(n)) {
|
|
1966
|
+
let r = t;
|
|
1967
|
+
for (; r; ) {
|
|
1968
|
+
if (e === r)
|
|
1969
|
+
return !0;
|
|
1970
|
+
r = r.parentNode || r.host;
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
return !1;
|
|
1974
|
+
}
|
|
1975
|
+
function Go(e) {
|
|
1976
|
+
return "composedPath" in e ? e.composedPath()[0] : e.target;
|
|
1977
|
+
}
|
|
1978
|
+
function Zo(e) {
|
|
1979
|
+
return e?.ownerDocument || document;
|
|
1980
|
+
}
|
|
1981
|
+
const ze = {
|
|
1982
|
+
inert: /* @__PURE__ */ new WeakMap(),
|
|
1983
|
+
"aria-hidden": /* @__PURE__ */ new WeakMap(),
|
|
1984
|
+
none: /* @__PURE__ */ new WeakMap()
|
|
1985
|
+
};
|
|
1986
|
+
function Ln(e) {
|
|
1987
|
+
return e === "inert" ? ze.inert : e === "aria-hidden" ? ze["aria-hidden"] : ze.none;
|
|
1988
|
+
}
|
|
1989
|
+
let mt = /* @__PURE__ */ new WeakSet(), gt = {}, Vt = 0;
|
|
1990
|
+
const Jo = () => typeof HTMLElement < "u" && "inert" in HTMLElement.prototype, Rr = (e) => e && (e.host || Rr(e.parentNode)), Qo = (e, t) => t.map((n) => {
|
|
1991
|
+
if (e.contains(n))
|
|
1992
|
+
return n;
|
|
1993
|
+
const r = Rr(n);
|
|
1994
|
+
return e.contains(r) ? r : null;
|
|
1995
|
+
}).filter((n) => n != null);
|
|
1996
|
+
function es(e, t, n, r) {
|
|
1997
|
+
const o = "data-floating-ui-inert", i = r ? "inert" : n ? "aria-hidden" : null, s = Qo(t, e), c = /* @__PURE__ */ new Set(), f = new Set(s), u = [];
|
|
1998
|
+
gt[o] || (gt[o] = /* @__PURE__ */ new WeakMap());
|
|
1999
|
+
const l = gt[o];
|
|
2000
|
+
s.forEach(p), d(t), c.clear();
|
|
2001
|
+
function p(a) {
|
|
2002
|
+
!a || c.has(a) || (c.add(a), a.parentNode && p(a.parentNode));
|
|
2003
|
+
}
|
|
2004
|
+
function d(a) {
|
|
2005
|
+
!a || f.has(a) || [].forEach.call(a.children, (v) => {
|
|
2006
|
+
if (rt(v) !== "script")
|
|
2007
|
+
if (c.has(v))
|
|
2008
|
+
d(v);
|
|
2009
|
+
else {
|
|
2010
|
+
const m = i ? v.getAttribute(i) : null, w = m !== null && m !== "false", x = Ln(i), y = (x.get(v) || 0) + 1, R = (l.get(v) || 0) + 1;
|
|
2011
|
+
x.set(v, y), l.set(v, R), u.push(v), y === 1 && w && mt.add(v), R === 1 && v.setAttribute(o, ""), !w && i && v.setAttribute(i, i === "inert" ? "" : "true");
|
|
2012
|
+
}
|
|
2013
|
+
});
|
|
2014
|
+
}
|
|
2015
|
+
return Vt++, () => {
|
|
2016
|
+
u.forEach((a) => {
|
|
2017
|
+
const v = Ln(i), w = (v.get(a) || 0) - 1, x = (l.get(a) || 0) - 1;
|
|
2018
|
+
v.set(a, w), l.set(a, x), w || (!mt.has(a) && i && a.removeAttribute(i), mt.delete(a)), x || a.removeAttribute(o);
|
|
2019
|
+
}), Vt--, Vt || (ze.inert = /* @__PURE__ */ new WeakMap(), ze["aria-hidden"] = /* @__PURE__ */ new WeakMap(), ze.none = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakSet(), gt = {});
|
|
2020
|
+
};
|
|
2021
|
+
}
|
|
2022
|
+
function kn(e, t, n) {
|
|
2023
|
+
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
2024
|
+
const r = Zo(e[0]).body;
|
|
2025
|
+
return es(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))), r, t, n);
|
|
2026
|
+
}
|
|
2027
|
+
const on = {
|
|
2028
|
+
border: 0,
|
|
2029
|
+
clip: "rect(0 0 0 0)",
|
|
2030
|
+
height: "1px",
|
|
2031
|
+
margin: "-1px",
|
|
2032
|
+
overflow: "hidden",
|
|
2033
|
+
padding: 0,
|
|
2034
|
+
position: "fixed",
|
|
2035
|
+
whiteSpace: "nowrap",
|
|
2036
|
+
width: "1px",
|
|
2037
|
+
top: 0,
|
|
2038
|
+
left: 0
|
|
2039
|
+
}, Ot = /* @__PURE__ */ g.forwardRef(function(t, n) {
|
|
2040
|
+
const [r, o] = g.useState();
|
|
2041
|
+
X(() => {
|
|
2042
|
+
nr() && o("button");
|
|
2043
|
+
}, []);
|
|
2044
|
+
const i = {
|
|
2045
|
+
ref: n,
|
|
2046
|
+
tabIndex: 0,
|
|
2047
|
+
// Role is only for VoiceOver
|
|
2048
|
+
role: r,
|
|
2049
|
+
"aria-hidden": r ? void 0 : !0,
|
|
2050
|
+
[Ve("focus-guard")]: "",
|
|
2051
|
+
style: on
|
|
2052
|
+
};
|
|
2053
|
+
return /* @__PURE__ */ be("span", {
|
|
2054
|
+
...t,
|
|
2055
|
+
...i
|
|
2056
|
+
});
|
|
2057
|
+
}), ts = {
|
|
2058
|
+
clipPath: "inset(50%)",
|
|
2059
|
+
position: "fixed",
|
|
2060
|
+
top: 0,
|
|
2061
|
+
left: 0
|
|
2062
|
+
}, xr = /* @__PURE__ */ g.createContext(null), Dn = /* @__PURE__ */ Ve("portal");
|
|
2063
|
+
function ns(e) {
|
|
2064
|
+
e === void 0 && (e = {});
|
|
2065
|
+
const {
|
|
2066
|
+
id: t,
|
|
2067
|
+
root: n
|
|
2068
|
+
} = e, r = ct(), o = Er(), [i, s] = g.useState(null), c = g.useRef(null);
|
|
2069
|
+
return X(() => () => {
|
|
2070
|
+
i?.remove(), queueMicrotask(() => {
|
|
2071
|
+
c.current = null;
|
|
2072
|
+
});
|
|
2073
|
+
}, [i]), X(() => {
|
|
2074
|
+
if (!r || c.current) return;
|
|
2075
|
+
const f = t ? document.getElementById(t) : null;
|
|
2076
|
+
if (!f) return;
|
|
2077
|
+
const u = document.createElement("div");
|
|
2078
|
+
u.id = r, u.setAttribute(Dn, ""), f.appendChild(u), c.current = u, s(u);
|
|
2079
|
+
}, [t, r]), X(() => {
|
|
2080
|
+
if (n === null || !r || c.current) return;
|
|
2081
|
+
let f = n || o?.portalNode;
|
|
2082
|
+
f && !Pr(f) && (f = f.current), f = f || document.body;
|
|
2083
|
+
let u = null;
|
|
2084
|
+
t && (u = document.createElement("div"), u.id = t, f.appendChild(u));
|
|
2085
|
+
const l = document.createElement("div");
|
|
2086
|
+
l.id = r, l.setAttribute(Dn, ""), f = u || f, f.appendChild(l), c.current = l, s(l);
|
|
2087
|
+
}, [t, n, r, o]), i;
|
|
2088
|
+
}
|
|
2089
|
+
function Fs(e) {
|
|
2090
|
+
const {
|
|
2091
|
+
children: t,
|
|
2092
|
+
id: n,
|
|
2093
|
+
root: r,
|
|
2094
|
+
preserveTabOrder: o = !0
|
|
2095
|
+
} = e, i = ns({
|
|
2096
|
+
id: n,
|
|
2097
|
+
root: r
|
|
2098
|
+
}), [s, c] = g.useState(null), f = g.useRef(null), u = g.useRef(null), l = g.useRef(null), p = g.useRef(null), d = s?.modal, a = s?.open, v = (
|
|
2099
|
+
// The FocusManager and therefore floating element are currently open/
|
|
2100
|
+
// rendered.
|
|
2101
|
+
!!s && // Guards are only for non-modal focus management.
|
|
2102
|
+
!s.modal && // Don't render if unmount is transitioning.
|
|
2103
|
+
s.open && o && !!(r || i)
|
|
2104
|
+
);
|
|
2105
|
+
return g.useEffect(() => {
|
|
2106
|
+
if (!i || !o || d)
|
|
2107
|
+
return;
|
|
2108
|
+
function m(w) {
|
|
2109
|
+
i && tt(w) && (w.type === "focusin" ? yn : oo)(i);
|
|
2110
|
+
}
|
|
2111
|
+
return i.addEventListener("focusin", m, !0), i.addEventListener("focusout", m, !0), () => {
|
|
2112
|
+
i.removeEventListener("focusin", m, !0), i.removeEventListener("focusout", m, !0);
|
|
2113
|
+
};
|
|
2114
|
+
}, [i, o, d]), g.useEffect(() => {
|
|
2115
|
+
i && (a || yn(i));
|
|
2116
|
+
}, [a, i]), /* @__PURE__ */ Zt(xr.Provider, {
|
|
2117
|
+
value: g.useMemo(() => ({
|
|
2118
|
+
preserveTabOrder: o,
|
|
2119
|
+
beforeOutsideRef: f,
|
|
2120
|
+
afterOutsideRef: u,
|
|
2121
|
+
beforeInsideRef: l,
|
|
2122
|
+
afterInsideRef: p,
|
|
2123
|
+
portalNode: i,
|
|
2124
|
+
setFocusManagerState: c
|
|
2125
|
+
}), [o, i]),
|
|
2126
|
+
children: [v && i && /* @__PURE__ */ be(Ot, {
|
|
2127
|
+
"data-type": "outside",
|
|
2128
|
+
ref: f,
|
|
2129
|
+
onFocus: (m) => {
|
|
2130
|
+
if (tt(m, i)) {
|
|
2131
|
+
var w;
|
|
2132
|
+
(w = l.current) == null || w.focus();
|
|
2133
|
+
} else {
|
|
2134
|
+
const x = s ? s.domReference : null, y = ur(x);
|
|
2135
|
+
y?.focus();
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
}), v && i && /* @__PURE__ */ be("span", {
|
|
2139
|
+
"aria-owns": i.id,
|
|
2140
|
+
style: ts
|
|
2141
|
+
}), i && /* @__PURE__ */ Jt.createPortal(t, i), v && i && /* @__PURE__ */ be(Ot, {
|
|
2142
|
+
"data-type": "outside",
|
|
2143
|
+
ref: u,
|
|
2144
|
+
onFocus: (m) => {
|
|
2145
|
+
if (tt(m, i)) {
|
|
2146
|
+
var w;
|
|
2147
|
+
(w = p.current) == null || w.focus();
|
|
2148
|
+
} else {
|
|
2149
|
+
const x = s ? s.domReference : null, y = cr(x);
|
|
2150
|
+
y?.focus(), s?.closeOnFocusOut && s?.onOpenChange(!1, m.nativeEvent, "focus-out");
|
|
2151
|
+
}
|
|
2152
|
+
}
|
|
2153
|
+
})]
|
|
2154
|
+
});
|
|
2155
|
+
}
|
|
2156
|
+
const Er = () => g.useContext(xr);
|
|
2157
|
+
function Fn(e) {
|
|
2158
|
+
return g.useMemo(() => (t) => {
|
|
2159
|
+
e.forEach((n) => {
|
|
2160
|
+
n && (n.current = t);
|
|
2161
|
+
});
|
|
2162
|
+
}, e);
|
|
2163
|
+
}
|
|
2164
|
+
const rs = 20;
|
|
2165
|
+
let De = [];
|
|
2166
|
+
function sn() {
|
|
2167
|
+
De = De.filter((e) => {
|
|
2168
|
+
var t;
|
|
2169
|
+
return (t = e.deref()) == null ? void 0 : t.isConnected;
|
|
2170
|
+
});
|
|
2171
|
+
}
|
|
2172
|
+
function os(e) {
|
|
2173
|
+
sn(), e && rt(e) !== "body" && (De.push(new WeakRef(e)), De.length > rs && (De = De.slice(-20)));
|
|
2174
|
+
}
|
|
2175
|
+
function Nn() {
|
|
2176
|
+
sn();
|
|
2177
|
+
const e = De[De.length - 1];
|
|
2178
|
+
return e?.deref();
|
|
2179
|
+
}
|
|
2180
|
+
function ss(e) {
|
|
2181
|
+
const t = ot();
|
|
2182
|
+
return Zn(e, t) ? e : It(e, t)[0] || e;
|
|
2183
|
+
}
|
|
2184
|
+
function _n(e, t) {
|
|
2185
|
+
var n;
|
|
2186
|
+
if (!t.current.includes("floating") && !((n = e.getAttribute("role")) != null && n.includes("dialog")))
|
|
2187
|
+
return;
|
|
2188
|
+
const r = ot(), i = Mr(e, r).filter((c) => {
|
|
2189
|
+
const f = c.getAttribute("data-tabindex") || "";
|
|
2190
|
+
return Zn(c, r) || c.hasAttribute("data-tabindex") && !f.startsWith("-");
|
|
2191
|
+
}), s = e.getAttribute("tabindex");
|
|
2192
|
+
t.current.includes("floating") || i.length === 0 ? s !== "0" && e.setAttribute("tabindex", "0") : (s !== "-1" || e.hasAttribute("data-tabindex") && e.getAttribute("data-tabindex") !== "-1") && (e.setAttribute("tabindex", "-1"), e.setAttribute("data-tabindex", "-1"));
|
|
2193
|
+
}
|
|
2194
|
+
const is = /* @__PURE__ */ g.forwardRef(function(t, n) {
|
|
2195
|
+
return /* @__PURE__ */ be("button", {
|
|
2196
|
+
...t,
|
|
2197
|
+
type: "button",
|
|
2198
|
+
ref: n,
|
|
2199
|
+
tabIndex: -1,
|
|
2200
|
+
style: on
|
|
2201
|
+
});
|
|
2202
|
+
});
|
|
2203
|
+
function Ns(e) {
|
|
2204
|
+
const {
|
|
2205
|
+
context: t,
|
|
2206
|
+
children: n,
|
|
2207
|
+
disabled: r = !1,
|
|
2208
|
+
order: o = ["content"],
|
|
2209
|
+
guards: i = !0,
|
|
2210
|
+
initialFocus: s = 0,
|
|
2211
|
+
returnFocus: c = !0,
|
|
2212
|
+
restoreFocus: f = !1,
|
|
2213
|
+
modal: u = !0,
|
|
2214
|
+
visuallyHiddenDismiss: l = !1,
|
|
2215
|
+
closeOnFocusOut: p = !0,
|
|
2216
|
+
outsideElementsInert: d = !1,
|
|
2217
|
+
getInsideElements: a = () => []
|
|
2218
|
+
} = e, {
|
|
2219
|
+
open: v,
|
|
2220
|
+
onOpenChange: m,
|
|
2221
|
+
events: w,
|
|
2222
|
+
dataRef: x,
|
|
2223
|
+
elements: {
|
|
2224
|
+
domReference: y,
|
|
2225
|
+
floating: R
|
|
2226
|
+
}
|
|
2227
|
+
} = t, E = re(() => {
|
|
2228
|
+
var V;
|
|
2229
|
+
return (V = x.current.floatingContext) == null ? void 0 : V.nodeId;
|
|
2230
|
+
}), A = re(a), O = typeof s == "number" && s < 0, M = zt(y) && O, S = Jo(), $ = S ? i : !0, I = !$ || S && d, B = le(o), W = le(s), L = le(c), h = Ze(), C = Er(), D = g.useRef(null), T = g.useRef(null), b = g.useRef(!1), P = g.useRef(!1), k = g.useRef(-1), G = g.useRef(-1), K = C != null, N = Ct(R), J = re(function(V) {
|
|
2231
|
+
return V === void 0 && (V = N), V ? It(V, ot()) : [];
|
|
2232
|
+
}), U = re((V) => {
|
|
2233
|
+
const Y = J(V);
|
|
2234
|
+
return B.current.map((H) => y && H === "reference" ? y : N && H === "floating" ? N : Y).filter(Boolean).flat();
|
|
2235
|
+
});
|
|
2236
|
+
g.useEffect(() => {
|
|
2237
|
+
if (r || !u) return;
|
|
2238
|
+
function V(H) {
|
|
2239
|
+
if (H.key === "Tab") {
|
|
2240
|
+
ue(N, Oe(pe(N))) && J().length === 0 && !M && ge(H);
|
|
2241
|
+
const Q = U(), oe = Ie(H);
|
|
2242
|
+
B.current[0] === "reference" && oe === y && (ge(H), H.shiftKey ? _e(Q[Q.length - 1]) : _e(Q[1])), B.current[1] === "floating" && oe === N && H.shiftKey && (ge(H), _e(Q[0]));
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
const Y = pe(N);
|
|
2246
|
+
return Y.addEventListener("keydown", V), () => {
|
|
2247
|
+
Y.removeEventListener("keydown", V);
|
|
2248
|
+
};
|
|
2249
|
+
}, [r, y, N, u, B, M, J, U]), g.useEffect(() => {
|
|
2250
|
+
if (r || !R) return;
|
|
2251
|
+
function V(Y) {
|
|
2252
|
+
const H = Ie(Y), oe = J().indexOf(H);
|
|
2253
|
+
oe !== -1 && (k.current = oe);
|
|
2254
|
+
}
|
|
2255
|
+
return R.addEventListener("focusin", V), () => {
|
|
2256
|
+
R.removeEventListener("focusin", V);
|
|
2257
|
+
};
|
|
2258
|
+
}, [r, R, J]), g.useEffect(() => {
|
|
2259
|
+
if (r || !p) return;
|
|
2260
|
+
function V() {
|
|
2261
|
+
P.current = !0, setTimeout(() => {
|
|
2262
|
+
P.current = !1;
|
|
2263
|
+
});
|
|
2264
|
+
}
|
|
2265
|
+
function Y(oe) {
|
|
2266
|
+
const z = oe.relatedTarget, ye = oe.currentTarget, de = Ie(oe);
|
|
2267
|
+
queueMicrotask(() => {
|
|
2268
|
+
const he = E(), Te = !(ue(y, z) || ue(R, z) || ue(z, R) || ue(C?.portalNode, z) || z != null && z.hasAttribute(Ve("focus-guard")) || h && ($e(h.nodesRef.current, he).find((_) => {
|
|
2269
|
+
var j, F;
|
|
2270
|
+
return ue((j = _.context) == null ? void 0 : j.elements.floating, z) || ue((F = _.context) == null ? void 0 : F.elements.domReference, z);
|
|
2271
|
+
}) || vn(h.nodesRef.current, he).find((_) => {
|
|
2272
|
+
var j, F, q;
|
|
2273
|
+
return [(j = _.context) == null ? void 0 : j.elements.floating, Ct((F = _.context) == null ? void 0 : F.elements.floating)].includes(z) || ((q = _.context) == null ? void 0 : q.elements.domReference) === z;
|
|
2274
|
+
})));
|
|
2275
|
+
if (ye === y && N && _n(N, B), f && ye !== y && !(de != null && de.isConnected) && Oe(pe(N)) === pe(N).body) {
|
|
2276
|
+
ce(N) && N.focus();
|
|
2277
|
+
const _ = k.current, j = J(), F = j[_] || j[j.length - 1] || N;
|
|
2278
|
+
ce(F) && F.focus();
|
|
2279
|
+
}
|
|
2280
|
+
if (x.current.insideReactTree) {
|
|
2281
|
+
x.current.insideReactTree = !1;
|
|
2282
|
+
return;
|
|
2283
|
+
}
|
|
2284
|
+
(M || !u) && z && Te && !P.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
|
|
2285
|
+
z !== Nn() && (b.current = !0, m(!1, oe, "focus-out"));
|
|
2286
|
+
});
|
|
2287
|
+
}
|
|
2288
|
+
const H = !!(!h && C);
|
|
2289
|
+
function Q() {
|
|
2290
|
+
me(G), x.current.insideReactTree = !0, G.current = window.setTimeout(() => {
|
|
2291
|
+
x.current.insideReactTree = !1;
|
|
2292
|
+
});
|
|
2293
|
+
}
|
|
2294
|
+
if (R && ce(y))
|
|
2295
|
+
return y.addEventListener("focusout", Y), y.addEventListener("pointerdown", V), R.addEventListener("focusout", Y), H && R.addEventListener("focusout", Q, !0), () => {
|
|
2296
|
+
y.removeEventListener("focusout", Y), y.removeEventListener("pointerdown", V), R.removeEventListener("focusout", Y), H && R.removeEventListener("focusout", Q, !0);
|
|
2297
|
+
};
|
|
2298
|
+
}, [r, y, R, N, u, h, C, m, p, f, J, M, E, B, x]);
|
|
2299
|
+
const se = g.useRef(null), ae = g.useRef(null), te = Fn([se, C?.beforeInsideRef]), ne = Fn([ae, C?.afterInsideRef]);
|
|
2300
|
+
g.useEffect(() => {
|
|
2301
|
+
var V, Y;
|
|
2302
|
+
if (r || !R) return;
|
|
2303
|
+
const H = Array.from((C == null || (V = C.portalNode) == null ? void 0 : V.querySelectorAll("[" + Ve("portal") + "]")) || []), oe = (Y = (h ? vn(h.nodesRef.current, E()) : []).find((de) => {
|
|
2304
|
+
var he;
|
|
2305
|
+
return zt(((he = de.context) == null ? void 0 : he.elements.domReference) || null);
|
|
2306
|
+
})) == null || (Y = Y.context) == null ? void 0 : Y.elements.domReference, z = [R, oe, ...H, ...A(), D.current, T.current, se.current, ae.current, C?.beforeOutsideRef.current, C?.afterOutsideRef.current, B.current.includes("reference") || M ? y : null].filter((de) => de != null), ye = u || M ? kn(z, !I, I) : kn(z);
|
|
2307
|
+
return () => {
|
|
2308
|
+
ye();
|
|
2309
|
+
};
|
|
2310
|
+
}, [r, y, R, u, B, C, M, $, I, h, E, A]), X(() => {
|
|
2311
|
+
if (r || !ce(N)) return;
|
|
2312
|
+
const V = pe(N), Y = Oe(V);
|
|
2313
|
+
queueMicrotask(() => {
|
|
2314
|
+
const H = U(N), Q = W.current, oe = (typeof Q == "number" ? H[Q] : Q.current) || N, z = ue(N, Y);
|
|
2315
|
+
!O && !z && v && _e(oe, {
|
|
2316
|
+
preventScroll: oe === N
|
|
2317
|
+
});
|
|
2318
|
+
});
|
|
2319
|
+
}, [r, v, N, O, U, W]), X(() => {
|
|
2320
|
+
if (r || !N) return;
|
|
2321
|
+
const V = pe(N), Y = Oe(V);
|
|
2322
|
+
os(Y);
|
|
2323
|
+
function H(z) {
|
|
2324
|
+
let {
|
|
2325
|
+
reason: ye,
|
|
2326
|
+
event: de,
|
|
2327
|
+
nested: he
|
|
2328
|
+
} = z;
|
|
2329
|
+
if (["hover", "safe-polygon"].includes(ye) && de.type === "mouseleave" && (b.current = !0), ye === "outside-press")
|
|
2330
|
+
if (he)
|
|
2331
|
+
b.current = !1;
|
|
2332
|
+
else if (or(de) || sr(de))
|
|
2333
|
+
b.current = !1;
|
|
2334
|
+
else {
|
|
2335
|
+
let Te = !1;
|
|
2336
|
+
document.createElement("div").focus({
|
|
2337
|
+
get preventScroll() {
|
|
2338
|
+
return Te = !0, !1;
|
|
2339
|
+
}
|
|
2340
|
+
}), Te ? b.current = !1 : b.current = !0;
|
|
2341
|
+
}
|
|
2342
|
+
}
|
|
2343
|
+
w.on("openchange", H);
|
|
2344
|
+
const Q = V.createElement("span");
|
|
2345
|
+
Q.setAttribute("tabindex", "-1"), Q.setAttribute("aria-hidden", "true"), Object.assign(Q.style, on), K && y && y.insertAdjacentElement("afterend", Q);
|
|
2346
|
+
function oe() {
|
|
2347
|
+
if (typeof L.current == "boolean") {
|
|
2348
|
+
const z = y || Nn();
|
|
2349
|
+
return z && z.isConnected ? z : Q;
|
|
2350
|
+
}
|
|
2351
|
+
return L.current.current || Q;
|
|
2352
|
+
}
|
|
2353
|
+
return () => {
|
|
2354
|
+
w.off("openchange", H);
|
|
2355
|
+
const z = Oe(V), ye = ue(R, z) || h && $e(h.nodesRef.current, E(), !1).some((he) => {
|
|
2356
|
+
var Te;
|
|
2357
|
+
return ue((Te = he.context) == null ? void 0 : Te.elements.floating, z);
|
|
2358
|
+
}), de = oe();
|
|
2359
|
+
queueMicrotask(() => {
|
|
2360
|
+
const he = ss(de);
|
|
2361
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2362
|
+
L.current && !b.current && ce(he) && // If the focus moved somewhere else after mount, avoid returning focus
|
|
2363
|
+
// since it likely entered a different element which should be
|
|
2364
|
+
// respected: https://github.com/floating-ui/floating-ui/issues/2607
|
|
2365
|
+
(!(he !== z && z !== V.body) || ye) && he.focus({
|
|
2366
|
+
preventScroll: !0
|
|
2367
|
+
}), Q.remove();
|
|
2368
|
+
});
|
|
2369
|
+
};
|
|
2370
|
+
}, [r, R, N, L, x, w, h, K, y, E]), g.useEffect(() => (queueMicrotask(() => {
|
|
2371
|
+
b.current = !1;
|
|
2372
|
+
}), () => {
|
|
2373
|
+
queueMicrotask(sn);
|
|
2374
|
+
}), [r]), X(() => {
|
|
2375
|
+
if (!r && C)
|
|
2376
|
+
return C.setFocusManagerState({
|
|
2377
|
+
modal: u,
|
|
2378
|
+
closeOnFocusOut: p,
|
|
2379
|
+
open: v,
|
|
2380
|
+
onOpenChange: m,
|
|
2381
|
+
domReference: y
|
|
2382
|
+
}), () => {
|
|
2383
|
+
C.setFocusManagerState(null);
|
|
2384
|
+
};
|
|
2385
|
+
}, [r, C, u, v, m, p, y]), X(() => {
|
|
2386
|
+
r || N && _n(N, B);
|
|
2387
|
+
}, [r, N, B]);
|
|
2388
|
+
function fe(V) {
|
|
2389
|
+
return r || !l || !u ? null : /* @__PURE__ */ be(is, {
|
|
2390
|
+
ref: V === "start" ? D : T,
|
|
2391
|
+
onClick: (Y) => m(!1, Y.nativeEvent),
|
|
2392
|
+
children: typeof l == "string" ? l : "Dismiss"
|
|
2393
|
+
});
|
|
2394
|
+
}
|
|
2395
|
+
const we = !r && $ && (u ? !M : !0) && (K || u);
|
|
2396
|
+
return /* @__PURE__ */ Zt(Ar, {
|
|
2397
|
+
children: [we && /* @__PURE__ */ be(Ot, {
|
|
2398
|
+
"data-type": "inside",
|
|
2399
|
+
ref: te,
|
|
2400
|
+
onFocus: (V) => {
|
|
2401
|
+
if (u) {
|
|
2402
|
+
const H = U();
|
|
2403
|
+
_e(o[0] === "reference" ? H[0] : H[H.length - 1]);
|
|
2404
|
+
} else if (C != null && C.preserveTabOrder && C.portalNode)
|
|
2405
|
+
if (b.current = !1, tt(V, C.portalNode)) {
|
|
2406
|
+
const H = cr(y);
|
|
2407
|
+
H?.focus();
|
|
2408
|
+
} else {
|
|
2409
|
+
var Y;
|
|
2410
|
+
(Y = C.beforeOutsideRef.current) == null || Y.focus();
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
}), !M && fe("start"), n, fe("end"), we && /* @__PURE__ */ be(Ot, {
|
|
2414
|
+
"data-type": "inside",
|
|
2415
|
+
ref: ne,
|
|
2416
|
+
onFocus: (V) => {
|
|
2417
|
+
if (u)
|
|
2418
|
+
_e(U()[0]);
|
|
2419
|
+
else if (C != null && C.preserveTabOrder && C.portalNode)
|
|
2420
|
+
if (p && (b.current = !0), tt(V, C.portalNode)) {
|
|
2421
|
+
const H = ur(y);
|
|
2422
|
+
H?.focus();
|
|
2423
|
+
} else {
|
|
2424
|
+
var Y;
|
|
2425
|
+
(Y = C.afterOutsideRef.current) == null || Y.focus();
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2428
|
+
})]
|
|
2429
|
+
});
|
|
2430
|
+
}
|
|
2431
|
+
let pt = 0;
|
|
2432
|
+
const Wn = "--floating-ui-scrollbar-width";
|
|
2433
|
+
function cs() {
|
|
2434
|
+
const e = tn(), t = /iP(hone|ad|od)|iOS/.test(e) || // iPads can claim to be MacIntel
|
|
2435
|
+
e === "MacIntel" && navigator.maxTouchPoints > 1, n = document.body.style, o = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft ? "paddingLeft" : "paddingRight", i = window.innerWidth - document.documentElement.clientWidth, s = n.left ? parseFloat(n.left) : window.scrollX, c = n.top ? parseFloat(n.top) : window.scrollY;
|
|
2436
|
+
if (n.overflow = "hidden", n.setProperty(Wn, i + "px"), i && (n[o] = i + "px"), t) {
|
|
2437
|
+
var f, u;
|
|
2438
|
+
const l = ((f = window.visualViewport) == null ? void 0 : f.offsetLeft) || 0, p = ((u = window.visualViewport) == null ? void 0 : u.offsetTop) || 0;
|
|
2439
|
+
Object.assign(n, {
|
|
2440
|
+
position: "fixed",
|
|
2441
|
+
top: -(c - Math.floor(p)) + "px",
|
|
2442
|
+
left: -(s - Math.floor(l)) + "px",
|
|
2443
|
+
right: "0"
|
|
2444
|
+
});
|
|
2445
|
+
}
|
|
2446
|
+
return () => {
|
|
2447
|
+
Object.assign(n, {
|
|
2448
|
+
overflow: "",
|
|
2449
|
+
[o]: ""
|
|
2450
|
+
}), n.removeProperty(Wn), t && (Object.assign(n, {
|
|
2451
|
+
position: "",
|
|
2452
|
+
top: "",
|
|
2453
|
+
left: "",
|
|
2454
|
+
right: ""
|
|
2455
|
+
}), window.scrollTo(s, c));
|
|
2456
|
+
};
|
|
2457
|
+
}
|
|
2458
|
+
let $n = () => {
|
|
2459
|
+
};
|
|
2460
|
+
const _s = /* @__PURE__ */ g.forwardRef(function(t, n) {
|
|
2461
|
+
const {
|
|
2462
|
+
lockScroll: r = !1,
|
|
2463
|
+
...o
|
|
2464
|
+
} = t;
|
|
2465
|
+
return X(() => {
|
|
2466
|
+
if (r)
|
|
2467
|
+
return pt++, pt === 1 && ($n = cs()), () => {
|
|
2468
|
+
pt--, pt === 0 && $n();
|
|
2469
|
+
};
|
|
2470
|
+
}, [r]), /* @__PURE__ */ be("div", {
|
|
2471
|
+
ref: n,
|
|
2472
|
+
...o,
|
|
2473
|
+
style: {
|
|
2474
|
+
position: "fixed",
|
|
2475
|
+
overflow: "auto",
|
|
2476
|
+
top: 0,
|
|
2477
|
+
right: 0,
|
|
2478
|
+
bottom: 0,
|
|
2479
|
+
left: 0,
|
|
2480
|
+
...o.style
|
|
2481
|
+
}
|
|
2482
|
+
});
|
|
2483
|
+
});
|
|
2484
|
+
function Bn(e) {
|
|
2485
|
+
return ce(e.target) && e.target.tagName === "BUTTON";
|
|
2486
|
+
}
|
|
2487
|
+
function us(e) {
|
|
2488
|
+
return ce(e.target) && e.target.tagName === "A";
|
|
2489
|
+
}
|
|
2490
|
+
function Vn(e) {
|
|
2491
|
+
return nn(e);
|
|
2492
|
+
}
|
|
2493
|
+
function Ws(e, t) {
|
|
2494
|
+
t === void 0 && (t = {});
|
|
2495
|
+
const {
|
|
2496
|
+
open: n,
|
|
2497
|
+
onOpenChange: r,
|
|
2498
|
+
dataRef: o,
|
|
2499
|
+
elements: {
|
|
2500
|
+
domReference: i
|
|
2501
|
+
}
|
|
2502
|
+
} = e, {
|
|
2503
|
+
enabled: s = !0,
|
|
2504
|
+
event: c = "click",
|
|
2505
|
+
toggle: f = !0,
|
|
2506
|
+
ignoreMouse: u = !1,
|
|
2507
|
+
keyboardHandlers: l = !0,
|
|
2508
|
+
stickIfOpen: p = !0
|
|
2509
|
+
} = t, d = g.useRef(), a = g.useRef(!1), v = g.useMemo(() => ({
|
|
2510
|
+
onPointerDown(m) {
|
|
2511
|
+
d.current = m.pointerType;
|
|
2512
|
+
},
|
|
2513
|
+
onMouseDown(m) {
|
|
2514
|
+
const w = d.current;
|
|
2515
|
+
m.button === 0 && c !== "click" && (qe(w, !0) && u || (n && f && (!(o.current.openEvent && p) || o.current.openEvent.type === "mousedown") ? r(!1, m.nativeEvent, "click") : (m.preventDefault(), r(!0, m.nativeEvent, "click"))));
|
|
2516
|
+
},
|
|
2517
|
+
onClick(m) {
|
|
2518
|
+
const w = d.current;
|
|
2519
|
+
if (c === "mousedown" && d.current) {
|
|
2520
|
+
d.current = void 0;
|
|
2521
|
+
return;
|
|
2522
|
+
}
|
|
2523
|
+
qe(w, !0) && u || (n && f && (!(o.current.openEvent && p) || o.current.openEvent.type === "click") ? r(!1, m.nativeEvent, "click") : r(!0, m.nativeEvent, "click"));
|
|
2524
|
+
},
|
|
2525
|
+
onKeyDown(m) {
|
|
2526
|
+
d.current = void 0, !(m.defaultPrevented || !l || Bn(m)) && (m.key === " " && !Vn(i) && (m.preventDefault(), a.current = !0), !us(m) && m.key === "Enter" && r(!(n && f), m.nativeEvent, "click"));
|
|
2527
|
+
},
|
|
2528
|
+
onKeyUp(m) {
|
|
2529
|
+
m.defaultPrevented || !l || Bn(m) || Vn(i) || m.key === " " && a.current && (a.current = !1, r(!(n && f), m.nativeEvent, "click"));
|
|
2530
|
+
}
|
|
2531
|
+
}), [o, i, c, u, l, r, n, p, f]);
|
|
2532
|
+
return g.useMemo(() => s ? {
|
|
2533
|
+
reference: v
|
|
2534
|
+
} : {}, [s, v]);
|
|
2535
|
+
}
|
|
2536
|
+
function ls(e, t) {
|
|
2537
|
+
let n = null, r = null, o = !1;
|
|
2538
|
+
return {
|
|
2539
|
+
contextElement: e || void 0,
|
|
2540
|
+
getBoundingClientRect() {
|
|
2541
|
+
var i;
|
|
2542
|
+
const s = e?.getBoundingClientRect() || {
|
|
2543
|
+
width: 0,
|
|
2544
|
+
height: 0,
|
|
2545
|
+
x: 0,
|
|
2546
|
+
y: 0
|
|
2547
|
+
}, c = t.axis === "x" || t.axis === "both", f = t.axis === "y" || t.axis === "both", u = ["mouseenter", "mousemove"].includes(((i = t.dataRef.current.openEvent) == null ? void 0 : i.type) || "") && t.pointerType !== "touch";
|
|
2548
|
+
let l = s.width, p = s.height, d = s.x, a = s.y;
|
|
2549
|
+
return n == null && t.x && c && (n = s.x - t.x), r == null && t.y && f && (r = s.y - t.y), d -= n || 0, a -= r || 0, l = 0, p = 0, !o || u ? (l = t.axis === "y" ? s.width : 0, p = t.axis === "x" ? s.height : 0, d = c && t.x != null ? t.x : d, a = f && t.y != null ? t.y : a) : o && !u && (p = t.axis === "x" ? s.height : p, l = t.axis === "y" ? s.width : l), o = !0, {
|
|
2550
|
+
width: l,
|
|
2551
|
+
height: p,
|
|
2552
|
+
x: d,
|
|
2553
|
+
y: a,
|
|
2554
|
+
top: a,
|
|
2555
|
+
right: d + l,
|
|
2556
|
+
bottom: a + p,
|
|
2557
|
+
left: d
|
|
2558
|
+
};
|
|
2559
|
+
}
|
|
2560
|
+
};
|
|
2561
|
+
}
|
|
2562
|
+
function Kn(e) {
|
|
2563
|
+
return e != null && e.clientX != null;
|
|
2564
|
+
}
|
|
2565
|
+
function $s(e, t) {
|
|
2566
|
+
t === void 0 && (t = {});
|
|
2567
|
+
const {
|
|
2568
|
+
open: n,
|
|
2569
|
+
dataRef: r,
|
|
2570
|
+
elements: {
|
|
2571
|
+
floating: o,
|
|
2572
|
+
domReference: i
|
|
2573
|
+
},
|
|
2574
|
+
refs: s
|
|
2575
|
+
} = e, {
|
|
2576
|
+
enabled: c = !0,
|
|
2577
|
+
axis: f = "both",
|
|
2578
|
+
x: u = null,
|
|
2579
|
+
y: l = null
|
|
2580
|
+
} = t, p = g.useRef(!1), d = g.useRef(null), [a, v] = g.useState(), [m, w] = g.useState([]), x = re((O, M) => {
|
|
2581
|
+
p.current || r.current.openEvent && !Kn(r.current.openEvent) || s.setPositionReference(ls(i, {
|
|
2582
|
+
x: O,
|
|
2583
|
+
y: M,
|
|
2584
|
+
axis: f,
|
|
2585
|
+
dataRef: r,
|
|
2586
|
+
pointerType: a
|
|
2587
|
+
}));
|
|
2588
|
+
}), y = re((O) => {
|
|
2589
|
+
u != null || l != null || (n ? d.current || w([]) : x(O.clientX, O.clientY));
|
|
2590
|
+
}), R = qe(a) ? o : n, E = g.useCallback(() => {
|
|
2591
|
+
if (!R || !c || u != null || l != null) return;
|
|
2592
|
+
const O = Se(o);
|
|
2593
|
+
function M(S) {
|
|
2594
|
+
const $ = Ie(S);
|
|
2595
|
+
ue(o, $) ? (O.removeEventListener("mousemove", M), d.current = null) : x(S.clientX, S.clientY);
|
|
2596
|
+
}
|
|
2597
|
+
if (!r.current.openEvent || Kn(r.current.openEvent)) {
|
|
2598
|
+
O.addEventListener("mousemove", M);
|
|
2599
|
+
const S = () => {
|
|
2600
|
+
O.removeEventListener("mousemove", M), d.current = null;
|
|
2601
|
+
};
|
|
2602
|
+
return d.current = S, S;
|
|
2603
|
+
}
|
|
2604
|
+
s.setPositionReference(i);
|
|
2605
|
+
}, [R, c, u, l, o, r, s, i, x]);
|
|
2606
|
+
g.useEffect(() => E(), [E, m]), g.useEffect(() => {
|
|
2607
|
+
c && !o && (p.current = !1);
|
|
2608
|
+
}, [c, o]), g.useEffect(() => {
|
|
2609
|
+
!c && n && (p.current = !0);
|
|
2610
|
+
}, [c, n]), X(() => {
|
|
2611
|
+
c && (u != null || l != null) && (p.current = !1, x(u, l));
|
|
2612
|
+
}, [c, u, l, x]);
|
|
2613
|
+
const A = g.useMemo(() => {
|
|
2614
|
+
function O(M) {
|
|
2615
|
+
let {
|
|
2616
|
+
pointerType: S
|
|
2617
|
+
} = M;
|
|
2618
|
+
v(S);
|
|
2619
|
+
}
|
|
2620
|
+
return {
|
|
2621
|
+
onPointerDown: O,
|
|
2622
|
+
onPointerEnter: O,
|
|
2623
|
+
onMouseMove: y,
|
|
2624
|
+
onMouseEnter: y
|
|
2625
|
+
};
|
|
2626
|
+
}, [y]);
|
|
2627
|
+
return g.useMemo(() => c ? {
|
|
2628
|
+
reference: A
|
|
2629
|
+
} : {}, [c, A]);
|
|
2630
|
+
}
|
|
2631
|
+
const as = {
|
|
2632
|
+
pointerdown: "onPointerDown",
|
|
2633
|
+
mousedown: "onMouseDown",
|
|
2634
|
+
click: "onClick"
|
|
2635
|
+
}, fs = {
|
|
2636
|
+
pointerdown: "onPointerDownCapture",
|
|
2637
|
+
mousedown: "onMouseDownCapture",
|
|
2638
|
+
click: "onClickCapture"
|
|
2639
|
+
}, Hn = (e) => {
|
|
2640
|
+
var t, n;
|
|
2641
|
+
return {
|
|
2642
|
+
escapeKey: typeof e == "boolean" ? e : (t = e?.escapeKey) != null ? t : !1,
|
|
2643
|
+
outsidePress: typeof e == "boolean" ? e : (n = e?.outsidePress) != null ? n : !0
|
|
2644
|
+
};
|
|
2645
|
+
};
|
|
2646
|
+
function Bs(e, t) {
|
|
2647
|
+
t === void 0 && (t = {});
|
|
2648
|
+
const {
|
|
2649
|
+
open: n,
|
|
2650
|
+
onOpenChange: r,
|
|
2651
|
+
elements: o,
|
|
2652
|
+
dataRef: i
|
|
2653
|
+
} = e, {
|
|
2654
|
+
enabled: s = !0,
|
|
2655
|
+
escapeKey: c = !0,
|
|
2656
|
+
outsidePress: f = !0,
|
|
2657
|
+
outsidePressEvent: u = "pointerdown",
|
|
2658
|
+
referencePress: l = !1,
|
|
2659
|
+
referencePressEvent: p = "pointerdown",
|
|
2660
|
+
ancestorScroll: d = !1,
|
|
2661
|
+
bubbles: a,
|
|
2662
|
+
capture: v
|
|
2663
|
+
} = t, m = Ze(), w = re(typeof f == "function" ? f : () => !1), x = typeof f == "function" ? w : f, y = g.useRef(!1), {
|
|
2664
|
+
escapeKey: R,
|
|
2665
|
+
outsidePress: E
|
|
2666
|
+
} = Hn(a), {
|
|
2667
|
+
escapeKey: A,
|
|
2668
|
+
outsidePress: O
|
|
2669
|
+
} = Hn(v), M = g.useRef(!1), S = re((h) => {
|
|
2670
|
+
var C;
|
|
2671
|
+
if (!n || !s || !c || h.key !== "Escape" || M.current)
|
|
2672
|
+
return;
|
|
2673
|
+
const D = (C = i.current.floatingContext) == null ? void 0 : C.nodeId, T = m ? $e(m.nodesRef.current, D) : [];
|
|
2674
|
+
if (!R && (h.stopPropagation(), T.length > 0)) {
|
|
2675
|
+
let b = !0;
|
|
2676
|
+
if (T.forEach((P) => {
|
|
2677
|
+
var k;
|
|
2678
|
+
if ((k = P.context) != null && k.open && !P.context.dataRef.current.__escapeKeyBubbles) {
|
|
2679
|
+
b = !1;
|
|
2680
|
+
return;
|
|
2681
|
+
}
|
|
2682
|
+
}), !b)
|
|
2683
|
+
return;
|
|
2684
|
+
}
|
|
2685
|
+
r(!1, Xr(h) ? h.nativeEvent : h, "escape-key");
|
|
2686
|
+
}), $ = re((h) => {
|
|
2687
|
+
var C;
|
|
2688
|
+
const D = () => {
|
|
2689
|
+
var T;
|
|
2690
|
+
S(h), (T = Ie(h)) == null || T.removeEventListener("keydown", D);
|
|
2691
|
+
};
|
|
2692
|
+
(C = Ie(h)) == null || C.addEventListener("keydown", D);
|
|
2693
|
+
}), I = re((h) => {
|
|
2694
|
+
var C;
|
|
2695
|
+
const D = i.current.insideReactTree;
|
|
2696
|
+
i.current.insideReactTree = !1;
|
|
2697
|
+
const T = y.current;
|
|
2698
|
+
if (y.current = !1, u === "click" && T || D || typeof x == "function" && !x(h))
|
|
2699
|
+
return;
|
|
2700
|
+
const b = Ie(h), P = "[" + Ve("inert") + "]", k = pe(o.floating).querySelectorAll(P);
|
|
2701
|
+
let G = Z(b) ? b : null;
|
|
2702
|
+
for (; G && !We(G); ) {
|
|
2703
|
+
const U = Xe(G);
|
|
2704
|
+
if (We(U) || !Z(U))
|
|
2705
|
+
break;
|
|
2706
|
+
G = U;
|
|
2707
|
+
}
|
|
2708
|
+
if (k.length && Z(b) && !Ur(b) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
2709
|
+
!ue(b, o.floating) && // If the target root element contains none of the markers, then the
|
|
2710
|
+
// element was injected after the floating element rendered.
|
|
2711
|
+
Array.from(k).every((U) => !ue(G, U)))
|
|
2712
|
+
return;
|
|
2713
|
+
if (ce(b) && L) {
|
|
2714
|
+
const U = We(b), se = Ce(b), ae = /auto|scroll/, te = U || ae.test(se.overflowX), ne = U || ae.test(se.overflowY), fe = te && b.clientWidth > 0 && b.scrollWidth > b.clientWidth, we = ne && b.clientHeight > 0 && b.scrollHeight > b.clientHeight, V = se.direction === "rtl", Y = we && (V ? h.offsetX <= b.offsetWidth - b.clientWidth : h.offsetX > b.clientWidth), H = fe && h.offsetY > b.clientHeight;
|
|
2715
|
+
if (Y || H)
|
|
2716
|
+
return;
|
|
2717
|
+
}
|
|
2718
|
+
const K = (C = i.current.floatingContext) == null ? void 0 : C.nodeId, N = m && $e(m.nodesRef.current, K).some((U) => {
|
|
2719
|
+
var se;
|
|
2720
|
+
return Dt(h, (se = U.context) == null ? void 0 : se.elements.floating);
|
|
2721
|
+
});
|
|
2722
|
+
if (Dt(h, o.floating) || Dt(h, o.domReference) || N)
|
|
2723
|
+
return;
|
|
2724
|
+
const J = m ? $e(m.nodesRef.current, K) : [];
|
|
2725
|
+
if (J.length > 0) {
|
|
2726
|
+
let U = !0;
|
|
2727
|
+
if (J.forEach((se) => {
|
|
2728
|
+
var ae;
|
|
2729
|
+
if ((ae = se.context) != null && ae.open && !se.context.dataRef.current.__outsidePressBubbles) {
|
|
2730
|
+
U = !1;
|
|
2731
|
+
return;
|
|
2732
|
+
}
|
|
2733
|
+
}), !U)
|
|
2734
|
+
return;
|
|
2735
|
+
}
|
|
2736
|
+
r(!1, h, "outside-press");
|
|
2737
|
+
}), B = re((h) => {
|
|
2738
|
+
var C;
|
|
2739
|
+
const D = () => {
|
|
2740
|
+
var T;
|
|
2741
|
+
I(h), (T = Ie(h)) == null || T.removeEventListener(u, D);
|
|
2742
|
+
};
|
|
2743
|
+
(C = Ie(h)) == null || C.addEventListener(u, D);
|
|
2744
|
+
});
|
|
2745
|
+
g.useEffect(() => {
|
|
2746
|
+
if (!n || !s)
|
|
2747
|
+
return;
|
|
2748
|
+
i.current.__escapeKeyBubbles = R, i.current.__outsidePressBubbles = E;
|
|
2749
|
+
let h = -1;
|
|
2750
|
+
function C(k) {
|
|
2751
|
+
r(!1, k, "ancestor-scroll");
|
|
2752
|
+
}
|
|
2753
|
+
function D() {
|
|
2754
|
+
window.clearTimeout(h), M.current = !0;
|
|
2755
|
+
}
|
|
2756
|
+
function T() {
|
|
2757
|
+
h = window.setTimeout(
|
|
2758
|
+
() => {
|
|
2759
|
+
M.current = !1;
|
|
2760
|
+
},
|
|
2761
|
+
// 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
|
|
2762
|
+
// Only apply to WebKit for the test to remain 0ms.
|
|
2763
|
+
Gt() ? 5 : 0
|
|
2764
|
+
);
|
|
2765
|
+
}
|
|
2766
|
+
const b = pe(o.floating);
|
|
2767
|
+
c && (b.addEventListener("keydown", A ? $ : S, A), b.addEventListener("compositionstart", D), b.addEventListener("compositionend", T)), x && b.addEventListener(u, O ? B : I, O);
|
|
2768
|
+
let P = [];
|
|
2769
|
+
return d && (Z(o.domReference) && (P = Ue(o.domReference)), Z(o.floating) && (P = P.concat(Ue(o.floating))), !Z(o.reference) && o.reference && o.reference.contextElement && (P = P.concat(Ue(o.reference.contextElement)))), P = P.filter((k) => {
|
|
2770
|
+
var G;
|
|
2771
|
+
return k !== ((G = b.defaultView) == null ? void 0 : G.visualViewport);
|
|
2772
|
+
}), P.forEach((k) => {
|
|
2773
|
+
k.addEventListener("scroll", C, {
|
|
2774
|
+
passive: !0
|
|
2775
|
+
});
|
|
2776
|
+
}), () => {
|
|
2777
|
+
c && (b.removeEventListener("keydown", A ? $ : S, A), b.removeEventListener("compositionstart", D), b.removeEventListener("compositionend", T)), x && b.removeEventListener(u, O ? B : I, O), P.forEach((k) => {
|
|
2778
|
+
k.removeEventListener("scroll", C);
|
|
2779
|
+
}), window.clearTimeout(h);
|
|
2780
|
+
};
|
|
2781
|
+
}, [i, o, c, x, u, n, r, d, s, R, E, S, A, $, I, O, B]), g.useEffect(() => {
|
|
2782
|
+
i.current.insideReactTree = !1;
|
|
2783
|
+
}, [i, x, u]);
|
|
2784
|
+
const W = g.useMemo(() => ({
|
|
2785
|
+
onKeyDown: S,
|
|
2786
|
+
...l && {
|
|
2787
|
+
[as[p]]: (h) => {
|
|
2788
|
+
r(!1, h.nativeEvent, "reference-press");
|
|
2789
|
+
},
|
|
2790
|
+
...p !== "click" && {
|
|
2791
|
+
onClick(h) {
|
|
2792
|
+
r(!1, h.nativeEvent, "reference-press");
|
|
2793
|
+
}
|
|
2794
|
+
}
|
|
2795
|
+
}
|
|
2796
|
+
}), [S, r, l, p]), L = g.useMemo(() => ({
|
|
2797
|
+
onKeyDown: S,
|
|
2798
|
+
onMouseDown() {
|
|
2799
|
+
y.current = !0;
|
|
2800
|
+
},
|
|
2801
|
+
onMouseUp() {
|
|
2802
|
+
y.current = !0;
|
|
2803
|
+
},
|
|
2804
|
+
[fs[u]]: () => {
|
|
2805
|
+
i.current.insideReactTree = !0;
|
|
2806
|
+
}
|
|
2807
|
+
}), [S, u, i]);
|
|
2808
|
+
return g.useMemo(() => s ? {
|
|
2809
|
+
reference: W,
|
|
2810
|
+
floating: L
|
|
2811
|
+
} : {}, [s, W, L]);
|
|
2812
|
+
}
|
|
2813
|
+
function ds(e) {
|
|
2814
|
+
const {
|
|
2815
|
+
open: t = !1,
|
|
2816
|
+
onOpenChange: n,
|
|
2817
|
+
elements: r
|
|
2818
|
+
} = e, o = ct(), i = g.useRef({}), [s] = g.useState(() => br()), c = Ge() != null;
|
|
2819
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2820
|
+
const a = r.reference;
|
|
2821
|
+
a && !Z(a) && qo("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
2822
|
+
}
|
|
2823
|
+
const [f, u] = g.useState(r.reference), l = re((a, v, m) => {
|
|
2824
|
+
i.current.openEvent = a ? v : void 0, s.emit("openchange", {
|
|
2825
|
+
open: a,
|
|
2826
|
+
event: v,
|
|
2827
|
+
reason: m,
|
|
2828
|
+
nested: c
|
|
2829
|
+
}), n?.(a, v, m);
|
|
2830
|
+
}), p = g.useMemo(() => ({
|
|
2831
|
+
setPositionReference: u
|
|
2832
|
+
}), []), d = g.useMemo(() => ({
|
|
2833
|
+
reference: f || r.reference || null,
|
|
2834
|
+
floating: r.floating || null,
|
|
2835
|
+
domReference: r.reference
|
|
2836
|
+
}), [f, r.reference, r.floating]);
|
|
2837
|
+
return g.useMemo(() => ({
|
|
2838
|
+
dataRef: i,
|
|
2839
|
+
open: t,
|
|
2840
|
+
onOpenChange: l,
|
|
2841
|
+
elements: d,
|
|
2842
|
+
events: s,
|
|
2843
|
+
floatingId: o,
|
|
2844
|
+
refs: p
|
|
2845
|
+
}), [t, l, d, s, o, p]);
|
|
2846
|
+
}
|
|
2847
|
+
function Vs(e) {
|
|
2848
|
+
e === void 0 && (e = {});
|
|
2849
|
+
const {
|
|
2850
|
+
nodeId: t
|
|
2851
|
+
} = e, n = ds({
|
|
2852
|
+
...e,
|
|
2853
|
+
elements: {
|
|
2854
|
+
reference: null,
|
|
2855
|
+
floating: null,
|
|
2856
|
+
...e.elements
|
|
2857
|
+
}
|
|
2858
|
+
}), r = e.rootContext || n, o = r.elements, [i, s] = g.useState(null), [c, f] = g.useState(null), l = o?.domReference || i, p = g.useRef(null), d = Ze();
|
|
2859
|
+
X(() => {
|
|
2860
|
+
l && (p.current = l);
|
|
2861
|
+
}, [l]);
|
|
2862
|
+
const a = Vo({
|
|
2863
|
+
...e,
|
|
2864
|
+
elements: {
|
|
2865
|
+
...o,
|
|
2866
|
+
...c && {
|
|
2867
|
+
reference: c
|
|
2868
|
+
}
|
|
2869
|
+
}
|
|
2870
|
+
}), v = g.useCallback((R) => {
|
|
2871
|
+
const E = Z(R) ? {
|
|
2872
|
+
getBoundingClientRect: () => R.getBoundingClientRect(),
|
|
2873
|
+
getClientRects: () => R.getClientRects(),
|
|
2874
|
+
contextElement: R
|
|
2875
|
+
} : R;
|
|
2876
|
+
f(E), a.refs.setReference(E);
|
|
2877
|
+
}, [a.refs]), m = g.useCallback((R) => {
|
|
2878
|
+
(Z(R) || R === null) && (p.current = R, s(R)), (Z(a.refs.reference.current) || a.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
2879
|
+
// `null` to support `positionReference` + an unstable `reference`
|
|
2880
|
+
// callback ref.
|
|
2881
|
+
R !== null && !Z(R)) && a.refs.setReference(R);
|
|
2882
|
+
}, [a.refs]), w = g.useMemo(() => ({
|
|
2883
|
+
...a.refs,
|
|
2884
|
+
setReference: m,
|
|
2885
|
+
setPositionReference: v,
|
|
2886
|
+
domReference: p
|
|
2887
|
+
}), [a.refs, m, v]), x = g.useMemo(() => ({
|
|
2888
|
+
...a.elements,
|
|
2889
|
+
domReference: l
|
|
2890
|
+
}), [a.elements, l]), y = g.useMemo(() => ({
|
|
2891
|
+
...a,
|
|
2892
|
+
...r,
|
|
2893
|
+
refs: w,
|
|
2894
|
+
elements: x,
|
|
2895
|
+
nodeId: t
|
|
2896
|
+
}), [a, w, x, t, r]);
|
|
2897
|
+
return X(() => {
|
|
2898
|
+
r.dataRef.current.floatingContext = y;
|
|
2899
|
+
const R = d?.nodesRef.current.find((E) => E.id === t);
|
|
2900
|
+
R && (R.context = y);
|
|
2901
|
+
}), g.useMemo(() => ({
|
|
2902
|
+
...a,
|
|
2903
|
+
context: y,
|
|
2904
|
+
refs: w,
|
|
2905
|
+
elements: x
|
|
2906
|
+
}), [a, w, x, y]);
|
|
2907
|
+
}
|
|
2908
|
+
function Kt() {
|
|
2909
|
+
return Vr() && nr();
|
|
2910
|
+
}
|
|
2911
|
+
function Ks(e, t) {
|
|
2912
|
+
t === void 0 && (t = {});
|
|
2913
|
+
const {
|
|
2914
|
+
open: n,
|
|
2915
|
+
onOpenChange: r,
|
|
2916
|
+
events: o,
|
|
2917
|
+
dataRef: i,
|
|
2918
|
+
elements: s
|
|
2919
|
+
} = e, {
|
|
2920
|
+
enabled: c = !0,
|
|
2921
|
+
visibleOnly: f = !0
|
|
2922
|
+
} = t, u = g.useRef(!1), l = g.useRef(-1), p = g.useRef(!0);
|
|
2923
|
+
g.useEffect(() => {
|
|
2924
|
+
if (!c) return;
|
|
2925
|
+
const a = Se(s.domReference);
|
|
2926
|
+
function v() {
|
|
2927
|
+
!n && ce(s.domReference) && s.domReference === Oe(pe(s.domReference)) && (u.current = !0);
|
|
2928
|
+
}
|
|
2929
|
+
function m() {
|
|
2930
|
+
p.current = !0;
|
|
2931
|
+
}
|
|
2932
|
+
function w() {
|
|
2933
|
+
p.current = !1;
|
|
2934
|
+
}
|
|
2935
|
+
return a.addEventListener("blur", v), Kt() && (a.addEventListener("keydown", m, !0), a.addEventListener("pointerdown", w, !0)), () => {
|
|
2936
|
+
a.removeEventListener("blur", v), Kt() && (a.removeEventListener("keydown", m, !0), a.removeEventListener("pointerdown", w, !0));
|
|
2937
|
+
};
|
|
2938
|
+
}, [s.domReference, n, c]), g.useEffect(() => {
|
|
2939
|
+
if (!c) return;
|
|
2940
|
+
function a(v) {
|
|
2941
|
+
let {
|
|
2942
|
+
reason: m
|
|
2943
|
+
} = v;
|
|
2944
|
+
(m === "reference-press" || m === "escape-key") && (u.current = !0);
|
|
2945
|
+
}
|
|
2946
|
+
return o.on("openchange", a), () => {
|
|
2947
|
+
o.off("openchange", a);
|
|
2948
|
+
};
|
|
2949
|
+
}, [o, c]), g.useEffect(() => () => {
|
|
2950
|
+
me(l);
|
|
2951
|
+
}, []);
|
|
2952
|
+
const d = g.useMemo(() => ({
|
|
2953
|
+
onMouseLeave() {
|
|
2954
|
+
u.current = !1;
|
|
2955
|
+
},
|
|
2956
|
+
onFocus(a) {
|
|
2957
|
+
if (u.current) return;
|
|
2958
|
+
const v = Ie(a.nativeEvent);
|
|
2959
|
+
if (f && Z(v)) {
|
|
2960
|
+
if (Kt() && !a.relatedTarget) {
|
|
2961
|
+
if (!p.current && !nn(v))
|
|
2962
|
+
return;
|
|
2963
|
+
} else if (!Yr(v))
|
|
2964
|
+
return;
|
|
2965
|
+
}
|
|
2966
|
+
r(!0, a.nativeEvent, "focus");
|
|
2967
|
+
},
|
|
2968
|
+
onBlur(a) {
|
|
2969
|
+
u.current = !1;
|
|
2970
|
+
const v = a.relatedTarget, m = a.nativeEvent, w = Z(v) && v.hasAttribute(Ve("focus-guard")) && v.getAttribute("data-type") === "outside";
|
|
2971
|
+
l.current = window.setTimeout(() => {
|
|
2972
|
+
var x;
|
|
2973
|
+
const y = Oe(s.domReference ? s.domReference.ownerDocument : document);
|
|
2974
|
+
!v && y === s.domReference || ue((x = i.current.floatingContext) == null ? void 0 : x.refs.floating.current, y) || ue(s.domReference, y) || w || r(!1, m, "focus");
|
|
2975
|
+
});
|
|
2976
|
+
}
|
|
2977
|
+
}), [i, s.domReference, r, f]);
|
|
2978
|
+
return g.useMemo(() => c ? {
|
|
2979
|
+
reference: d
|
|
2980
|
+
} : {}, [c, d]);
|
|
2981
|
+
}
|
|
2982
|
+
function Ht(e, t, n) {
|
|
2983
|
+
const r = /* @__PURE__ */ new Map(), o = n === "item";
|
|
2984
|
+
let i = e;
|
|
2985
|
+
if (o && e) {
|
|
2986
|
+
const {
|
|
2987
|
+
[On]: s,
|
|
2988
|
+
[In]: c,
|
|
2989
|
+
...f
|
|
2990
|
+
} = e;
|
|
2991
|
+
i = f;
|
|
2992
|
+
}
|
|
2993
|
+
return {
|
|
2994
|
+
...n === "floating" && {
|
|
2995
|
+
tabIndex: -1,
|
|
2996
|
+
[jo]: ""
|
|
2997
|
+
},
|
|
2998
|
+
...i,
|
|
2999
|
+
...t.map((s) => {
|
|
3000
|
+
const c = s ? s[n] : null;
|
|
3001
|
+
return typeof c == "function" ? e ? c(e) : null : c;
|
|
3002
|
+
}).concat(e).reduce((s, c) => (c && Object.entries(c).forEach((f) => {
|
|
3003
|
+
let [u, l] = f;
|
|
3004
|
+
if (!(o && [On, In].includes(u)))
|
|
3005
|
+
if (u.indexOf("on") === 0) {
|
|
3006
|
+
if (r.has(u) || r.set(u, []), typeof l == "function") {
|
|
3007
|
+
var p;
|
|
3008
|
+
(p = r.get(u)) == null || p.push(l), s[u] = function() {
|
|
3009
|
+
for (var d, a = arguments.length, v = new Array(a), m = 0; m < a; m++)
|
|
3010
|
+
v[m] = arguments[m];
|
|
3011
|
+
return (d = r.get(u)) == null ? void 0 : d.map((w) => w(...v)).find((w) => w !== void 0);
|
|
3012
|
+
};
|
|
3013
|
+
}
|
|
3014
|
+
} else
|
|
3015
|
+
s[u] = l;
|
|
3016
|
+
}), s), {})
|
|
3017
|
+
};
|
|
3018
|
+
}
|
|
3019
|
+
function Hs(e) {
|
|
3020
|
+
e === void 0 && (e = []);
|
|
3021
|
+
const t = e.map((c) => c?.reference), n = e.map((c) => c?.floating), r = e.map((c) => c?.item), o = g.useCallback(
|
|
3022
|
+
(c) => Ht(c, e, "reference"),
|
|
3023
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3024
|
+
t
|
|
3025
|
+
), i = g.useCallback(
|
|
3026
|
+
(c) => Ht(c, e, "floating"),
|
|
3027
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3028
|
+
n
|
|
3029
|
+
), s = g.useCallback(
|
|
3030
|
+
(c) => Ht(c, e, "item"),
|
|
3031
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3032
|
+
r
|
|
3033
|
+
);
|
|
3034
|
+
return g.useMemo(() => ({
|
|
3035
|
+
getReferenceProps: o,
|
|
3036
|
+
getFloatingProps: i,
|
|
3037
|
+
getItemProps: s
|
|
3038
|
+
}), [o, i, s]);
|
|
3039
|
+
}
|
|
3040
|
+
const ms = "Escape";
|
|
3041
|
+
function St(e, t, n) {
|
|
3042
|
+
switch (e) {
|
|
3043
|
+
case "vertical":
|
|
3044
|
+
return t;
|
|
3045
|
+
case "horizontal":
|
|
3046
|
+
return n;
|
|
3047
|
+
default:
|
|
3048
|
+
return t || n;
|
|
3049
|
+
}
|
|
3050
|
+
}
|
|
3051
|
+
function ht(e, t) {
|
|
3052
|
+
return St(t, e === vr || e === At, e === st || e === it);
|
|
3053
|
+
}
|
|
3054
|
+
function jt(e, t, n) {
|
|
3055
|
+
return St(t, e === At, n ? e === st : e === it) || e === "Enter" || e === " " || e === "";
|
|
3056
|
+
}
|
|
3057
|
+
function jn(e, t, n) {
|
|
3058
|
+
return St(t, n ? e === st : e === it, e === At);
|
|
3059
|
+
}
|
|
3060
|
+
function Un(e, t, n, r) {
|
|
3061
|
+
const o = n ? e === it : e === st, i = e === vr;
|
|
3062
|
+
return t === "both" || t === "horizontal" && r && r > 1 ? e === ms : St(t, o, i);
|
|
3063
|
+
}
|
|
3064
|
+
function js(e, t) {
|
|
3065
|
+
const {
|
|
3066
|
+
open: n,
|
|
3067
|
+
onOpenChange: r,
|
|
3068
|
+
elements: o,
|
|
3069
|
+
floatingId: i
|
|
3070
|
+
} = e, {
|
|
3071
|
+
listRef: s,
|
|
3072
|
+
activeIndex: c,
|
|
3073
|
+
onNavigate: f = () => {
|
|
3074
|
+
},
|
|
3075
|
+
enabled: u = !0,
|
|
3076
|
+
selectedIndex: l = null,
|
|
3077
|
+
allowEscape: p = !1,
|
|
3078
|
+
loop: d = !1,
|
|
3079
|
+
nested: a = !1,
|
|
3080
|
+
rtl: v = !1,
|
|
3081
|
+
virtual: m = !1,
|
|
3082
|
+
focusItemOnOpen: w = "auto",
|
|
3083
|
+
focusItemOnHover: x = !0,
|
|
3084
|
+
openOnArrowKeyDown: y = !0,
|
|
3085
|
+
disabledIndices: R = void 0,
|
|
3086
|
+
orientation: E = "vertical",
|
|
3087
|
+
parentOrientation: A,
|
|
3088
|
+
cols: O = 1,
|
|
3089
|
+
scrollItemIntoView: M = !0,
|
|
3090
|
+
virtualItemRef: S,
|
|
3091
|
+
itemSizes: $,
|
|
3092
|
+
dense: I = !1
|
|
3093
|
+
} = t;
|
|
3094
|
+
process.env.NODE_ENV !== "production" && (p && (d || yt("`useListNavigation` looping must be enabled to allow escaping."), m || yt("`useListNavigation` must be virtual to allow escaping.")), E === "vertical" && O > 1 && yt("In grid list navigation mode (`cols` > 1), the `orientation` should", 'be either "horizontal" or "both".'));
|
|
3095
|
+
const B = Ct(o.floating), W = le(B), L = Ge(), h = Ze();
|
|
3096
|
+
X(() => {
|
|
3097
|
+
e.dataRef.current.orientation = E;
|
|
3098
|
+
}, [e, E]);
|
|
3099
|
+
const C = re(() => {
|
|
3100
|
+
f(b.current === -1 ? null : b.current);
|
|
3101
|
+
}), D = zt(o.domReference), T = g.useRef(w), b = g.useRef(l ?? -1), P = g.useRef(null), k = g.useRef(!0), G = g.useRef(C), K = g.useRef(!!o.floating), N = g.useRef(n), J = g.useRef(!1), U = g.useRef(!1), se = le(R), ae = le(n), te = le(M), ne = le(l), [fe, we] = g.useState(), [V, Y] = g.useState(), H = re(() => {
|
|
3102
|
+
function _(ee) {
|
|
3103
|
+
if (m) {
|
|
3104
|
+
var ie;
|
|
3105
|
+
(ie = ee.id) != null && ie.endsWith("-fui-option") && (ee.id = i + "-" + Math.random().toString(16).slice(2, 10)), we(ee.id), h?.events.emit("virtualfocus", ee), S && (S.current = ee);
|
|
3106
|
+
} else
|
|
3107
|
+
_e(ee, {
|
|
3108
|
+
sync: J.current,
|
|
3109
|
+
preventScroll: !0
|
|
3110
|
+
});
|
|
3111
|
+
}
|
|
3112
|
+
const j = s.current[b.current], F = U.current;
|
|
3113
|
+
j && _(j), (J.current ? (ee) => ee() : requestAnimationFrame)(() => {
|
|
3114
|
+
const ee = s.current[b.current] || j;
|
|
3115
|
+
if (!ee) return;
|
|
3116
|
+
j || _(ee);
|
|
3117
|
+
const ie = te.current;
|
|
3118
|
+
ie && oe && (F || !k.current) && (ee.scrollIntoView == null || ee.scrollIntoView(typeof ie == "boolean" ? {
|
|
3119
|
+
block: "nearest",
|
|
3120
|
+
inline: "nearest"
|
|
3121
|
+
} : ie));
|
|
3122
|
+
});
|
|
3123
|
+
});
|
|
3124
|
+
X(() => {
|
|
3125
|
+
u && (n && o.floating ? T.current && l != null && (U.current = !0, b.current = l, C()) : K.current && (b.current = -1, G.current()));
|
|
3126
|
+
}, [u, n, o.floating, l, C]), X(() => {
|
|
3127
|
+
if (u && n && o.floating)
|
|
3128
|
+
if (c == null) {
|
|
3129
|
+
if (J.current = !1, ne.current != null)
|
|
3130
|
+
return;
|
|
3131
|
+
if (K.current && (b.current = -1, H()), (!N.current || !K.current) && T.current && (P.current != null || T.current === !0 && P.current == null)) {
|
|
3132
|
+
let _ = 0;
|
|
3133
|
+
const j = () => {
|
|
3134
|
+
s.current[0] == null ? (_ < 2 && (_ ? requestAnimationFrame : queueMicrotask)(j), _++) : (b.current = P.current == null || jt(P.current, E, v) || a ? Ft(s, se.current) : bn(s, se.current), P.current = null, C());
|
|
3135
|
+
};
|
|
3136
|
+
j();
|
|
3137
|
+
}
|
|
3138
|
+
} else et(s, c) || (b.current = c, H(), U.current = !1);
|
|
3139
|
+
}, [u, n, o.floating, c, ne, a, s, E, v, C, H, se]), X(() => {
|
|
3140
|
+
var _;
|
|
3141
|
+
if (!u || o.floating || !h || m || !K.current)
|
|
3142
|
+
return;
|
|
3143
|
+
const j = h.nodesRef.current, F = (_ = j.find((ie) => ie.id === L)) == null || (_ = _.context) == null ? void 0 : _.elements.floating, q = Oe(pe(o.floating)), ee = j.some((ie) => ie.context && ue(ie.context.elements.floating, q));
|
|
3144
|
+
F && !ee && k.current && F.focus({
|
|
3145
|
+
preventScroll: !0
|
|
3146
|
+
});
|
|
3147
|
+
}, [u, o.floating, h, L, m]), X(() => {
|
|
3148
|
+
if (!u || !h || !m || L) return;
|
|
3149
|
+
function _(j) {
|
|
3150
|
+
Y(j.id), S && (S.current = j);
|
|
3151
|
+
}
|
|
3152
|
+
return h.events.on("virtualfocus", _), () => {
|
|
3153
|
+
h.events.off("virtualfocus", _);
|
|
3154
|
+
};
|
|
3155
|
+
}, [u, h, m, L, S]), X(() => {
|
|
3156
|
+
G.current = C, N.current = n, K.current = !!o.floating;
|
|
3157
|
+
}), X(() => {
|
|
3158
|
+
n || (P.current = null, T.current = w);
|
|
3159
|
+
}, [n, w]);
|
|
3160
|
+
const Q = c != null, oe = g.useMemo(() => {
|
|
3161
|
+
function _(F) {
|
|
3162
|
+
if (!ae.current) return;
|
|
3163
|
+
const q = s.current.indexOf(F);
|
|
3164
|
+
q !== -1 && b.current !== q && (b.current = q, C());
|
|
3165
|
+
}
|
|
3166
|
+
return {
|
|
3167
|
+
onFocus(F) {
|
|
3168
|
+
let {
|
|
3169
|
+
currentTarget: q
|
|
3170
|
+
} = F;
|
|
3171
|
+
J.current = !0, _(q);
|
|
3172
|
+
},
|
|
3173
|
+
onClick: (F) => {
|
|
3174
|
+
let {
|
|
3175
|
+
currentTarget: q
|
|
3176
|
+
} = F;
|
|
3177
|
+
return q.focus({
|
|
3178
|
+
preventScroll: !0
|
|
3179
|
+
});
|
|
3180
|
+
},
|
|
3181
|
+
// Safari
|
|
3182
|
+
onMouseMove(F) {
|
|
3183
|
+
let {
|
|
3184
|
+
currentTarget: q
|
|
3185
|
+
} = F;
|
|
3186
|
+
J.current = !0, U.current = !1, x && _(q);
|
|
3187
|
+
},
|
|
3188
|
+
onPointerLeave(F) {
|
|
3189
|
+
let {
|
|
3190
|
+
pointerType: q
|
|
3191
|
+
} = F;
|
|
3192
|
+
if (!(!k.current || q === "touch") && (J.current = !0, !!x && (b.current = -1, C(), !m))) {
|
|
3193
|
+
var ee;
|
|
3194
|
+
(ee = W.current) == null || ee.focus({
|
|
3195
|
+
preventScroll: !0
|
|
3196
|
+
});
|
|
3197
|
+
}
|
|
3198
|
+
}
|
|
3199
|
+
};
|
|
3200
|
+
}, [ae, W, x, s, C, m]), z = g.useCallback(() => {
|
|
3201
|
+
var _;
|
|
3202
|
+
return A ?? (h == null || (_ = h.nodesRef.current.find((j) => j.id === L)) == null || (_ = _.context) == null || (_ = _.dataRef) == null ? void 0 : _.current.orientation);
|
|
3203
|
+
}, [L, h, A]), ye = re((_) => {
|
|
3204
|
+
if (k.current = !1, J.current = !0, _.which === 229 || !ae.current && _.currentTarget === W.current)
|
|
3205
|
+
return;
|
|
3206
|
+
if (a && Un(_.key, E, v, O)) {
|
|
3207
|
+
ht(_.key, z()) || ge(_), r(!1, _.nativeEvent, "list-navigation"), ce(o.domReference) && (m ? h?.events.emit("virtualfocus", o.domReference) : o.domReference.focus());
|
|
3208
|
+
return;
|
|
3209
|
+
}
|
|
3210
|
+
const j = b.current, F = Ft(s, R), q = bn(s, R);
|
|
3211
|
+
if (D || (_.key === "Home" && (ge(_), b.current = F, C()), _.key === "End" && (ge(_), b.current = q, C())), O > 1) {
|
|
3212
|
+
const ee = $ || Array.from({
|
|
3213
|
+
length: s.current.length
|
|
3214
|
+
}, () => ({
|
|
3215
|
+
width: 1,
|
|
3216
|
+
height: 1
|
|
3217
|
+
})), ie = to(ee, O, I), Je = ie.findIndex((xe) => xe != null && !vt(s, xe, R)), ut = ie.reduce((xe, Ne, lt) => Ne != null && !vt(s, Ne, R) ? lt : xe, -1), Qe = ie[eo({
|
|
3218
|
+
current: ie.map((xe) => xe != null ? s.current[xe] : null)
|
|
3219
|
+
}, {
|
|
3220
|
+
event: _,
|
|
3221
|
+
orientation: E,
|
|
3222
|
+
loop: d,
|
|
3223
|
+
rtl: v,
|
|
3224
|
+
cols: O,
|
|
3225
|
+
// treat undefined (empty grid spaces) as disabled indices so we
|
|
3226
|
+
// don't end up in them
|
|
3227
|
+
disabledIndices: ro([...(typeof R != "function" ? R : null) || s.current.map((xe, Ne) => vt(s, Ne, R) ? Ne : void 0), void 0], ie),
|
|
3228
|
+
minIndex: Je,
|
|
3229
|
+
maxIndex: ut,
|
|
3230
|
+
prevIndex: no(
|
|
3231
|
+
b.current > q ? F : b.current,
|
|
3232
|
+
ee,
|
|
3233
|
+
ie,
|
|
3234
|
+
O,
|
|
3235
|
+
// use a corner matching the edge closest to the direction
|
|
3236
|
+
// we're moving in so we don't end up in the same item. Prefer
|
|
3237
|
+
// top/left over bottom/right.
|
|
3238
|
+
_.key === At ? "bl" : _.key === (v ? st : it) ? "tr" : "tl"
|
|
3239
|
+
),
|
|
3240
|
+
stopEvent: !0
|
|
3241
|
+
})];
|
|
3242
|
+
if (Qe != null && (b.current = Qe, C()), E === "both")
|
|
3243
|
+
return;
|
|
3244
|
+
}
|
|
3245
|
+
if (ht(_.key, E)) {
|
|
3246
|
+
if (ge(_), n && !m && Oe(_.currentTarget.ownerDocument) === _.currentTarget) {
|
|
3247
|
+
b.current = jt(_.key, E, v) ? F : q, C();
|
|
3248
|
+
return;
|
|
3249
|
+
}
|
|
3250
|
+
jt(_.key, E, v) ? d ? b.current = j >= q ? p && j !== s.current.length ? -1 : F : ve(s, {
|
|
3251
|
+
startingIndex: j,
|
|
3252
|
+
disabledIndices: R
|
|
3253
|
+
}) : b.current = Math.min(q, ve(s, {
|
|
3254
|
+
startingIndex: j,
|
|
3255
|
+
disabledIndices: R
|
|
3256
|
+
})) : d ? b.current = j <= F ? p && j !== -1 ? s.current.length : q : ve(s, {
|
|
3257
|
+
startingIndex: j,
|
|
3258
|
+
decrement: !0,
|
|
3259
|
+
disabledIndices: R
|
|
3260
|
+
}) : b.current = Math.max(F, ve(s, {
|
|
3261
|
+
startingIndex: j,
|
|
3262
|
+
decrement: !0,
|
|
3263
|
+
disabledIndices: R
|
|
3264
|
+
})), et(s, b.current) && (b.current = -1), C();
|
|
3265
|
+
}
|
|
3266
|
+
}), de = g.useMemo(() => m && n && Q && {
|
|
3267
|
+
"aria-activedescendant": V || fe
|
|
3268
|
+
}, [m, n, Q, V, fe]), he = g.useMemo(() => ({
|
|
3269
|
+
"aria-orientation": E === "both" ? void 0 : E,
|
|
3270
|
+
...D ? {} : de,
|
|
3271
|
+
onKeyDown: ye,
|
|
3272
|
+
onPointerMove() {
|
|
3273
|
+
k.current = !0;
|
|
3274
|
+
}
|
|
3275
|
+
}), [de, ye, E, D]), Te = g.useMemo(() => {
|
|
3276
|
+
function _(F) {
|
|
3277
|
+
w === "auto" && or(F.nativeEvent) && (T.current = !0);
|
|
3278
|
+
}
|
|
3279
|
+
function j(F) {
|
|
3280
|
+
T.current = w, w === "auto" && sr(F.nativeEvent) && (T.current = !0);
|
|
3281
|
+
}
|
|
3282
|
+
return {
|
|
3283
|
+
...de,
|
|
3284
|
+
onKeyDown(F) {
|
|
3285
|
+
k.current = !1;
|
|
3286
|
+
const q = F.key.startsWith("Arrow"), ee = ["Home", "End"].includes(F.key), ie = q || ee, Je = jn(F.key, E, v), ut = Un(F.key, E, v, O), Qe = jn(F.key, z(), v), xe = ht(F.key, E), Ne = (a ? Qe : xe) || F.key === "Enter" || F.key.trim() === "";
|
|
3287
|
+
if (m && n) {
|
|
3288
|
+
const at = h?.nodesRef.current.find((ft) => ft.parentId == null), ke = h && at ? zr(h.nodesRef.current, at.id) : null;
|
|
3289
|
+
if (ie && ke && S) {
|
|
3290
|
+
const ft = new KeyboardEvent("keydown", {
|
|
3291
|
+
key: F.key,
|
|
3292
|
+
bubbles: !0
|
|
3293
|
+
});
|
|
3294
|
+
if (Je || ut) {
|
|
3295
|
+
var lt, cn;
|
|
3296
|
+
const Tr = ((lt = ke.context) == null ? void 0 : lt.elements.domReference) === F.currentTarget, ln = ut && !Tr ? (cn = ke.context) == null ? void 0 : cn.elements.domReference : Je ? s.current.find((an) => an?.id === fe) : null;
|
|
3297
|
+
ln && (ge(F), ln.dispatchEvent(ft), Y(void 0));
|
|
3298
|
+
}
|
|
3299
|
+
if ((xe || ee) && ke.context && ke.context.open && ke.parentId && F.currentTarget !== ke.context.elements.domReference) {
|
|
3300
|
+
var un;
|
|
3301
|
+
ge(F), (un = ke.context.elements.domReference) == null || un.dispatchEvent(ft);
|
|
3302
|
+
return;
|
|
3303
|
+
}
|
|
3304
|
+
}
|
|
3305
|
+
return ye(F);
|
|
3306
|
+
}
|
|
3307
|
+
if (!(!n && !y && q)) {
|
|
3308
|
+
if (Ne) {
|
|
3309
|
+
const at = ht(F.key, z());
|
|
3310
|
+
P.current = a && at ? null : F.key;
|
|
3311
|
+
}
|
|
3312
|
+
if (a) {
|
|
3313
|
+
Qe && (ge(F), n ? (b.current = Ft(s, se.current), C()) : r(!0, F.nativeEvent, "list-navigation"));
|
|
3314
|
+
return;
|
|
3315
|
+
}
|
|
3316
|
+
xe && (l != null && (b.current = l), ge(F), !n && y ? r(!0, F.nativeEvent, "list-navigation") : ye(F), n && C());
|
|
3317
|
+
}
|
|
3318
|
+
},
|
|
3319
|
+
onFocus() {
|
|
3320
|
+
n && !m && (b.current = -1, C());
|
|
3321
|
+
},
|
|
3322
|
+
onPointerDown: j,
|
|
3323
|
+
onPointerEnter: j,
|
|
3324
|
+
onMouseDown: _,
|
|
3325
|
+
onClick: _
|
|
3326
|
+
};
|
|
3327
|
+
}, [fe, de, O, ye, se, w, s, a, C, r, n, y, E, z, v, l, h, m, S]);
|
|
3328
|
+
return g.useMemo(() => u ? {
|
|
3329
|
+
reference: Te,
|
|
3330
|
+
floating: he,
|
|
3331
|
+
item: oe
|
|
3332
|
+
} : {}, [u, Te, he, oe]);
|
|
3333
|
+
}
|
|
3334
|
+
const gs = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", !1]]);
|
|
3335
|
+
function Us(e, t) {
|
|
3336
|
+
var n, r;
|
|
3337
|
+
t === void 0 && (t = {});
|
|
3338
|
+
const {
|
|
3339
|
+
open: o,
|
|
3340
|
+
elements: i,
|
|
3341
|
+
floatingId: s
|
|
3342
|
+
} = e, {
|
|
3343
|
+
enabled: c = !0,
|
|
3344
|
+
role: f = "dialog"
|
|
3345
|
+
} = t, u = ct(), l = ((n = i.domReference) == null ? void 0 : n.id) || u, p = g.useMemo(() => {
|
|
3346
|
+
var y;
|
|
3347
|
+
return ((y = Ct(i.floating)) == null ? void 0 : y.id) || s;
|
|
3348
|
+
}, [i.floating, s]), d = (r = gs.get(f)) != null ? r : f, v = Ge() != null, m = g.useMemo(() => d === "tooltip" || f === "label" ? {
|
|
3349
|
+
["aria-" + (f === "label" ? "labelledby" : "describedby")]: o ? p : void 0
|
|
3350
|
+
} : {
|
|
3351
|
+
"aria-expanded": o ? "true" : "false",
|
|
3352
|
+
"aria-haspopup": d === "alertdialog" ? "dialog" : d,
|
|
3353
|
+
"aria-controls": o ? p : void 0,
|
|
3354
|
+
...d === "listbox" && {
|
|
3355
|
+
role: "combobox"
|
|
3356
|
+
},
|
|
3357
|
+
...d === "menu" && {
|
|
3358
|
+
id: l
|
|
3359
|
+
},
|
|
3360
|
+
...d === "menu" && v && {
|
|
3361
|
+
role: "menuitem"
|
|
3362
|
+
},
|
|
3363
|
+
...f === "select" && {
|
|
3364
|
+
"aria-autocomplete": "none"
|
|
3365
|
+
},
|
|
3366
|
+
...f === "combobox" && {
|
|
3367
|
+
"aria-autocomplete": "list"
|
|
3368
|
+
}
|
|
3369
|
+
}, [d, p, v, o, l, f]), w = g.useMemo(() => {
|
|
3370
|
+
const y = {
|
|
3371
|
+
id: p,
|
|
3372
|
+
...d && {
|
|
3373
|
+
role: d
|
|
3374
|
+
}
|
|
3375
|
+
};
|
|
3376
|
+
return d === "tooltip" || f === "label" ? y : {
|
|
3377
|
+
...y,
|
|
3378
|
+
...d === "menu" && {
|
|
3379
|
+
"aria-labelledby": l
|
|
3380
|
+
}
|
|
3381
|
+
};
|
|
3382
|
+
}, [d, p, l, f]), x = g.useCallback((y) => {
|
|
3383
|
+
let {
|
|
3384
|
+
active: R,
|
|
3385
|
+
selected: E
|
|
3386
|
+
} = y;
|
|
3387
|
+
const A = {
|
|
3388
|
+
role: "option",
|
|
3389
|
+
...R && {
|
|
3390
|
+
id: p + "-fui-option"
|
|
3391
|
+
}
|
|
3392
|
+
};
|
|
3393
|
+
switch (f) {
|
|
3394
|
+
case "select":
|
|
3395
|
+
case "combobox":
|
|
3396
|
+
return {
|
|
3397
|
+
...A,
|
|
3398
|
+
"aria-selected": E
|
|
3399
|
+
};
|
|
3400
|
+
}
|
|
3401
|
+
return {};
|
|
3402
|
+
}, [p, f]);
|
|
3403
|
+
return g.useMemo(() => c ? {
|
|
3404
|
+
reference: m,
|
|
3405
|
+
floating: w,
|
|
3406
|
+
item: x
|
|
3407
|
+
} : {}, [c, m, w, x]);
|
|
3408
|
+
}
|
|
3409
|
+
const Yn = (e) => e.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (t, n) => (n ? "-" : "") + t.toLowerCase());
|
|
3410
|
+
function He(e, t) {
|
|
3411
|
+
return typeof e == "function" ? e(t) : e;
|
|
3412
|
+
}
|
|
3413
|
+
function ps(e, t) {
|
|
3414
|
+
const [n, r] = g.useState(e);
|
|
3415
|
+
return e && !n && r(!0), g.useEffect(() => {
|
|
3416
|
+
if (!e && n) {
|
|
3417
|
+
const o = setTimeout(() => r(!1), t);
|
|
3418
|
+
return () => clearTimeout(o);
|
|
3419
|
+
}
|
|
3420
|
+
}, [e, n, t]), n;
|
|
3421
|
+
}
|
|
3422
|
+
function hs(e, t) {
|
|
3423
|
+
t === void 0 && (t = {});
|
|
3424
|
+
const {
|
|
3425
|
+
open: n,
|
|
3426
|
+
elements: {
|
|
3427
|
+
floating: r
|
|
3428
|
+
}
|
|
3429
|
+
} = e, {
|
|
3430
|
+
duration: o = 250
|
|
3431
|
+
} = t, s = (typeof o == "number" ? o : o.close) || 0, [c, f] = g.useState("unmounted"), u = ps(n, s);
|
|
3432
|
+
return !u && c === "close" && f("unmounted"), X(() => {
|
|
3433
|
+
if (r) {
|
|
3434
|
+
if (n) {
|
|
3435
|
+
f("initial");
|
|
3436
|
+
const l = requestAnimationFrame(() => {
|
|
3437
|
+
Jt.flushSync(() => {
|
|
3438
|
+
f("open");
|
|
3439
|
+
});
|
|
3440
|
+
});
|
|
3441
|
+
return () => {
|
|
3442
|
+
cancelAnimationFrame(l);
|
|
3443
|
+
};
|
|
3444
|
+
}
|
|
3445
|
+
f("close");
|
|
3446
|
+
}
|
|
3447
|
+
}, [n, r]), {
|
|
3448
|
+
isMounted: u,
|
|
3449
|
+
status: c
|
|
3450
|
+
};
|
|
3451
|
+
}
|
|
3452
|
+
function Ys(e, t) {
|
|
3453
|
+
t === void 0 && (t = {});
|
|
3454
|
+
const {
|
|
3455
|
+
initial: n = {
|
|
3456
|
+
opacity: 0
|
|
3457
|
+
},
|
|
3458
|
+
open: r,
|
|
3459
|
+
close: o,
|
|
3460
|
+
common: i,
|
|
3461
|
+
duration: s = 250
|
|
3462
|
+
} = t, c = e.placement, f = c.split("-")[0], u = g.useMemo(() => ({
|
|
3463
|
+
side: f,
|
|
3464
|
+
placement: c
|
|
3465
|
+
}), [f, c]), l = typeof s == "number", p = (l ? s : s.open) || 0, d = (l ? s : s.close) || 0, [a, v] = g.useState(() => ({
|
|
3466
|
+
...He(i, u),
|
|
3467
|
+
...He(n, u)
|
|
3468
|
+
})), {
|
|
3469
|
+
isMounted: m,
|
|
3470
|
+
status: w
|
|
3471
|
+
} = hs(e, {
|
|
3472
|
+
duration: s
|
|
3473
|
+
}), x = le(n), y = le(r), R = le(o), E = le(i);
|
|
3474
|
+
return X(() => {
|
|
3475
|
+
const A = He(x.current, u), O = He(R.current, u), M = He(E.current, u), S = He(y.current, u) || Object.keys(A).reduce(($, I) => ($[I] = "", $), {});
|
|
3476
|
+
if (w === "initial" && v(($) => ({
|
|
3477
|
+
transitionProperty: $.transitionProperty,
|
|
3478
|
+
...M,
|
|
3479
|
+
...A
|
|
3480
|
+
})), w === "open" && v({
|
|
3481
|
+
transitionProperty: Object.keys(S).map(Yn).join(","),
|
|
3482
|
+
transitionDuration: p + "ms",
|
|
3483
|
+
...M,
|
|
3484
|
+
...S
|
|
3485
|
+
}), w === "close") {
|
|
3486
|
+
const $ = O || A;
|
|
3487
|
+
v({
|
|
3488
|
+
transitionProperty: Object.keys($).map(Yn).join(","),
|
|
3489
|
+
transitionDuration: d + "ms",
|
|
3490
|
+
...M,
|
|
3491
|
+
...$
|
|
3492
|
+
});
|
|
3493
|
+
}
|
|
3494
|
+
}, [d, R, x, y, E, p, w, u]), {
|
|
3495
|
+
isMounted: m,
|
|
3496
|
+
styles: a
|
|
3497
|
+
};
|
|
3498
|
+
}
|
|
3499
|
+
function zs(e, t) {
|
|
3500
|
+
var n;
|
|
3501
|
+
const {
|
|
3502
|
+
open: r,
|
|
3503
|
+
dataRef: o
|
|
3504
|
+
} = e, {
|
|
3505
|
+
listRef: i,
|
|
3506
|
+
activeIndex: s,
|
|
3507
|
+
onMatch: c,
|
|
3508
|
+
onTypingChange: f,
|
|
3509
|
+
enabled: u = !0,
|
|
3510
|
+
findMatch: l = null,
|
|
3511
|
+
resetMs: p = 750,
|
|
3512
|
+
ignoreKeys: d = [],
|
|
3513
|
+
selectedIndex: a = null
|
|
3514
|
+
} = t, v = g.useRef(-1), m = g.useRef(""), w = g.useRef((n = a ?? s) != null ? n : -1), x = g.useRef(null), y = re(c), R = re(f), E = le(l), A = le(d);
|
|
3515
|
+
X(() => {
|
|
3516
|
+
r && (me(v), x.current = null, m.current = "");
|
|
3517
|
+
}, [r]), X(() => {
|
|
3518
|
+
if (r && m.current === "") {
|
|
3519
|
+
var I;
|
|
3520
|
+
w.current = (I = a ?? s) != null ? I : -1;
|
|
3521
|
+
}
|
|
3522
|
+
}, [r, a, s]);
|
|
3523
|
+
const O = re((I) => {
|
|
3524
|
+
I ? o.current.typing || (o.current.typing = I, R(I)) : o.current.typing && (o.current.typing = I, R(I));
|
|
3525
|
+
}), M = re((I) => {
|
|
3526
|
+
function B(D, T, b) {
|
|
3527
|
+
const P = E.current ? E.current(T, b) : T.find((k) => k?.toLocaleLowerCase().indexOf(b.toLocaleLowerCase()) === 0);
|
|
3528
|
+
return P ? D.indexOf(P) : -1;
|
|
3529
|
+
}
|
|
3530
|
+
const W = i.current;
|
|
3531
|
+
if (m.current.length > 0 && m.current[0] !== " " && (B(W, W, m.current) === -1 ? O(!1) : I.key === " " && ge(I)), W == null || A.current.includes(I.key) || // Character key.
|
|
3532
|
+
I.key.length !== 1 || // Modifier key.
|
|
3533
|
+
I.ctrlKey || I.metaKey || I.altKey)
|
|
3534
|
+
return;
|
|
3535
|
+
r && I.key !== " " && (ge(I), O(!0)), W.every((D) => {
|
|
3536
|
+
var T, b;
|
|
3537
|
+
return D ? ((T = D[0]) == null ? void 0 : T.toLocaleLowerCase()) !== ((b = D[1]) == null ? void 0 : b.toLocaleLowerCase()) : !0;
|
|
3538
|
+
}) && m.current === I.key && (m.current = "", w.current = x.current), m.current += I.key, me(v), v.current = window.setTimeout(() => {
|
|
3539
|
+
m.current = "", w.current = x.current, O(!1);
|
|
3540
|
+
}, p);
|
|
3541
|
+
const h = w.current, C = B(W, [...W.slice((h || 0) + 1), ...W.slice(0, (h || 0) + 1)], m.current);
|
|
3542
|
+
C !== -1 ? (y(C), x.current = C) : I.key !== " " && (m.current = "", O(!1));
|
|
3543
|
+
}), S = g.useMemo(() => ({
|
|
3544
|
+
onKeyDown: M
|
|
3545
|
+
}), [M]), $ = g.useMemo(() => ({
|
|
3546
|
+
onKeyDown: M,
|
|
3547
|
+
onKeyUp(I) {
|
|
3548
|
+
I.key === " " && O(!1);
|
|
3549
|
+
}
|
|
3550
|
+
}), [M, O]);
|
|
3551
|
+
return g.useMemo(() => u ? {
|
|
3552
|
+
reference: S,
|
|
3553
|
+
floating: $
|
|
3554
|
+
} : {}, [u, S, $]);
|
|
3555
|
+
}
|
|
3556
|
+
function Cr(e, t, n) {
|
|
3557
|
+
return n === void 0 && (n = !0), e.filter((o) => {
|
|
3558
|
+
var i;
|
|
3559
|
+
return o.parentId === t && (!n || ((i = o.context) == null ? void 0 : i.open));
|
|
3560
|
+
}).flatMap((o) => [o, ...Cr(e, o.id, n)]);
|
|
3561
|
+
}
|
|
3562
|
+
function zn(e, t) {
|
|
3563
|
+
const [n, r] = e;
|
|
3564
|
+
let o = !1;
|
|
3565
|
+
const i = t.length;
|
|
3566
|
+
for (let s = 0, c = i - 1; s < i; c = s++) {
|
|
3567
|
+
const [f, u] = t[s] || [0, 0], [l, p] = t[c] || [0, 0];
|
|
3568
|
+
u >= r != p >= r && n <= (l - f) * (r - u) / (p - u) + f && (o = !o);
|
|
3569
|
+
}
|
|
3570
|
+
return o;
|
|
3571
|
+
}
|
|
3572
|
+
function vs(e, t) {
|
|
3573
|
+
return e[0] >= t.x && e[0] <= t.x + t.width && e[1] >= t.y && e[1] <= t.y + t.height;
|
|
3574
|
+
}
|
|
3575
|
+
function Xs(e) {
|
|
3576
|
+
e === void 0 && (e = {});
|
|
3577
|
+
const {
|
|
3578
|
+
buffer: t = 0.5,
|
|
3579
|
+
blockPointerEvents: n = !1,
|
|
3580
|
+
requireIntent: r = !0
|
|
3581
|
+
} = e, o = {
|
|
3582
|
+
current: -1
|
|
3583
|
+
};
|
|
3584
|
+
let i = !1, s = null, c = null, f = typeof performance < "u" ? performance.now() : 0;
|
|
3585
|
+
function u(p, d) {
|
|
3586
|
+
const a = performance.now(), v = a - f;
|
|
3587
|
+
if (s === null || c === null || v === 0)
|
|
3588
|
+
return s = p, c = d, f = a, null;
|
|
3589
|
+
const m = p - s, w = d - c, y = Math.sqrt(m * m + w * w) / v;
|
|
3590
|
+
return s = p, c = d, f = a, y;
|
|
3591
|
+
}
|
|
3592
|
+
const l = (p) => {
|
|
3593
|
+
let {
|
|
3594
|
+
x: d,
|
|
3595
|
+
y: a,
|
|
3596
|
+
placement: v,
|
|
3597
|
+
elements: m,
|
|
3598
|
+
onClose: w,
|
|
3599
|
+
nodeId: x,
|
|
3600
|
+
tree: y
|
|
3601
|
+
} = p;
|
|
3602
|
+
return function(E) {
|
|
3603
|
+
function A() {
|
|
3604
|
+
me(o), w();
|
|
3605
|
+
}
|
|
3606
|
+
if (me(o), !m.domReference || !m.floating || v == null || d == null || a == null)
|
|
3607
|
+
return;
|
|
3608
|
+
const {
|
|
3609
|
+
clientX: O,
|
|
3610
|
+
clientY: M
|
|
3611
|
+
} = E, S = [O, M], $ = Go(E), I = E.type === "mouseleave", B = Bt(m.floating, $), W = Bt(m.domReference, $), L = m.domReference.getBoundingClientRect(), h = m.floating.getBoundingClientRect(), C = v.split("-")[0], D = d > h.right - h.width / 2, T = a > h.bottom - h.height / 2, b = vs(S, L), P = h.width > L.width, k = h.height > L.height, G = (P ? L : h).left, K = (P ? L : h).right, N = (k ? L : h).top, J = (k ? L : h).bottom;
|
|
3612
|
+
if (B && (i = !0, !I))
|
|
3613
|
+
return;
|
|
3614
|
+
if (W && (i = !1), W && !I) {
|
|
3615
|
+
i = !0;
|
|
3616
|
+
return;
|
|
3617
|
+
}
|
|
3618
|
+
if (I && Z(E.relatedTarget) && Bt(m.floating, E.relatedTarget) || y && Cr(y.nodesRef.current, x).length)
|
|
3619
|
+
return;
|
|
3620
|
+
if (C === "top" && a >= L.bottom - 1 || C === "bottom" && a <= L.top + 1 || C === "left" && d >= L.right - 1 || C === "right" && d <= L.left + 1)
|
|
3621
|
+
return A();
|
|
3622
|
+
let U = [];
|
|
3623
|
+
switch (C) {
|
|
3624
|
+
case "top":
|
|
3625
|
+
U = [[G, L.top + 1], [G, h.bottom - 1], [K, h.bottom - 1], [K, L.top + 1]];
|
|
3626
|
+
break;
|
|
3627
|
+
case "bottom":
|
|
3628
|
+
U = [[G, h.top + 1], [G, L.bottom - 1], [K, L.bottom - 1], [K, h.top + 1]];
|
|
3629
|
+
break;
|
|
3630
|
+
case "left":
|
|
3631
|
+
U = [[h.right - 1, J], [h.right - 1, N], [L.left + 1, N], [L.left + 1, J]];
|
|
3632
|
+
break;
|
|
3633
|
+
case "right":
|
|
3634
|
+
U = [[L.right - 1, J], [L.right - 1, N], [h.left + 1, N], [h.left + 1, J]];
|
|
3635
|
+
break;
|
|
3636
|
+
}
|
|
3637
|
+
function se(ae) {
|
|
3638
|
+
let [te, ne] = ae;
|
|
3639
|
+
switch (C) {
|
|
3640
|
+
case "top": {
|
|
3641
|
+
const fe = [P ? te + t / 2 : D ? te + t * 4 : te - t * 4, ne + t + 1], we = [P ? te - t / 2 : D ? te + t * 4 : te - t * 4, ne + t + 1], V = [[h.left, D || P ? h.bottom - t : h.top], [h.right, D ? P ? h.bottom - t : h.top : h.bottom - t]];
|
|
3642
|
+
return [fe, we, ...V];
|
|
3643
|
+
}
|
|
3644
|
+
case "bottom": {
|
|
3645
|
+
const fe = [P ? te + t / 2 : D ? te + t * 4 : te - t * 4, ne - t], we = [P ? te - t / 2 : D ? te + t * 4 : te - t * 4, ne - t], V = [[h.left, D || P ? h.top + t : h.bottom], [h.right, D ? P ? h.top + t : h.bottom : h.top + t]];
|
|
3646
|
+
return [fe, we, ...V];
|
|
3647
|
+
}
|
|
3648
|
+
case "left": {
|
|
3649
|
+
const fe = [te + t + 1, k ? ne + t / 2 : T ? ne + t * 4 : ne - t * 4], we = [te + t + 1, k ? ne - t / 2 : T ? ne + t * 4 : ne - t * 4];
|
|
3650
|
+
return [...[[T || k ? h.right - t : h.left, h.top], [T ? k ? h.right - t : h.left : h.right - t, h.bottom]], fe, we];
|
|
3651
|
+
}
|
|
3652
|
+
case "right": {
|
|
3653
|
+
const fe = [te - t, k ? ne + t / 2 : T ? ne + t * 4 : ne - t * 4], we = [te - t, k ? ne - t / 2 : T ? ne + t * 4 : ne - t * 4], V = [[T || k ? h.left + t : h.right, h.top], [T ? k ? h.left + t : h.right : h.left + t, h.bottom]];
|
|
3654
|
+
return [fe, we, ...V];
|
|
3655
|
+
}
|
|
3656
|
+
}
|
|
3657
|
+
}
|
|
3658
|
+
if (!zn([O, M], U)) {
|
|
3659
|
+
if (i && !b)
|
|
3660
|
+
return A();
|
|
3661
|
+
if (!I && r) {
|
|
3662
|
+
const ae = u(E.clientX, E.clientY);
|
|
3663
|
+
if (ae !== null && ae < 0.1)
|
|
3664
|
+
return A();
|
|
3665
|
+
}
|
|
3666
|
+
zn([O, M], se([d, a])) ? !i && r && (o.current = window.setTimeout(A, 40)) : A();
|
|
3667
|
+
}
|
|
3668
|
+
};
|
|
3669
|
+
};
|
|
3670
|
+
return l.__options = {
|
|
3671
|
+
blockPointerEvents: n
|
|
3672
|
+
}, l;
|
|
3673
|
+
}
|
|
3674
|
+
export {
|
|
3675
|
+
ks as A,
|
|
3676
|
+
Ks as B,
|
|
3677
|
+
$s as C,
|
|
3678
|
+
Fs as F,
|
|
3679
|
+
Is as a,
|
|
3680
|
+
Rs as b,
|
|
3681
|
+
Hs as c,
|
|
3682
|
+
Us as d,
|
|
3683
|
+
As as e,
|
|
3684
|
+
Cs as f,
|
|
3685
|
+
Ts as g,
|
|
3686
|
+
Ys as h,
|
|
3687
|
+
Bs as i,
|
|
3688
|
+
js as j,
|
|
3689
|
+
_s as k,
|
|
3690
|
+
Ns as l,
|
|
3691
|
+
Os as m,
|
|
3692
|
+
Ws as n,
|
|
3693
|
+
xs as o,
|
|
3694
|
+
Ge as p,
|
|
3695
|
+
Ze as q,
|
|
3696
|
+
Ss as r,
|
|
3697
|
+
Es as s,
|
|
3698
|
+
Ms as t,
|
|
3699
|
+
Vs as u,
|
|
3700
|
+
Ds as v,
|
|
3701
|
+
Xs as w,
|
|
3702
|
+
zs as x,
|
|
3703
|
+
Ls as y,
|
|
3704
|
+
Ps as z
|
|
3705
|
+
};
|
|
3706
|
+
//# sourceMappingURL=floating-ui.react-DycKASR0.js.map
|