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