@alixpartners/ui-components 2.5.6 → 2.6.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/dist/RichTextEditor-JH6YBGiw.js +541 -0
- package/dist/{ToastProvider-D5LImZ-Q.js → ToastProvider-DVycF0zU.js} +26 -26
- package/dist/assets/CorusHeader.css +1 -1
- package/dist/assets/Tab.css +1 -1
- package/dist/assets/Tag.css +1 -1
- package/dist/assets/ap-icons-types.d.ts +1 -1
- package/dist/assets/ap-icons.d.ts +1 -1
- package/dist/assets/main.css +1 -1
- package/dist/components/Banner/Banner.d.ts +1 -1
- package/dist/components/Banner/Banner.test.js +1 -1
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.test.js +2 -2
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.js +3 -3
- package/dist/components/Checkbox/Checkbox.test.js +1 -1
- package/dist/components/CorusHeader/CorusHeader.d.ts +1 -1
- package/dist/components/CorusHeader/CorusHeader.js +45 -44
- package/dist/components/CorusHeader/CorusHeader.types.d.ts +1 -0
- package/dist/components/CorusHeader/DropdownItemContent.d.ts +1 -1
- package/dist/components/CorusHeader/DropdownMenu.d.ts +2 -1
- package/dist/components/CorusHeader/DropdownMenu.js +6 -5
- package/dist/components/CorusHeader/MegaMenuContent.d.ts +2 -1
- package/dist/components/CorusHeader/MegaMenuContent.js +11 -10
- package/dist/components/CorusHeader/UserProfileIcon.d.ts +1 -1
- package/dist/components/Creatable/Creatable.d.ts +1 -1
- package/dist/components/Creatable/Creatable.js +1 -1
- package/dist/components/Datepicker/Datepicker.d.ts +1 -1
- package/dist/components/Datepicker/Datepicker.js +1 -1
- package/dist/components/Datepicker/Datepicker.test.js +1 -1
- package/dist/components/Dialog/Dialog.d.ts +1 -1
- package/dist/components/Dialog/Dialog.js +188 -214
- package/dist/components/Dialog/Dialog.test.js +1 -1
- package/dist/components/DragAndDrop/DragAndDrop.d.ts +1 -1
- package/dist/components/DragAndDrop/DragAndDrop.test.js +2 -2
- package/dist/components/Dropdown/Dropdown.d.ts +3 -1
- package/dist/components/Dropdown/Dropdown.js +179 -172
- package/dist/components/FilePicker/FilePicker.d.ts +9 -9
- package/dist/components/FilePicker/FilePicker.test.js +2 -2
- package/dist/components/Ghost/Ghost.d.ts +1 -1
- package/dist/components/Ghost/Ghost.test.js +1 -1
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Icons/IconsGallery.d.ts +1 -1
- package/dist/components/Icons/IconsGallery.js +1 -1
- package/dist/components/Illustration/Illustration.d.ts +1 -1
- package/dist/components/Illustration/Illustration.test.js +1 -1
- package/dist/components/Input/Input.test.js +1 -1
- package/dist/components/Logo/Logo.d.ts +1 -1
- package/dist/components/Logos/LogosGallery.d.ts +1 -1
- package/dist/components/NavBar/NavBar.d.ts +1 -1
- package/dist/components/NavBar/NavBar.js +1 -1
- package/dist/components/Radio/Radio.d.ts +1 -1
- package/dist/components/Radio/Radio.js +9 -9
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +11 -11
- package/dist/components/RadioGroup/RadioGroup.test.js +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.d.ts +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.js +2 -2
- package/dist/components/RichTextEditor/RichTextEditor.test.js +2 -2
- package/dist/components/Search/Search.d.ts +1 -1
- package/dist/components/Search/Search.test.js +1 -1
- package/dist/components/Spinner/Spinner.d.ts +1 -1
- package/dist/components/SplitButton/SplitButton.d.ts +1 -1
- package/dist/components/SplitButton/SplitButton.js +3 -3
- package/dist/components/SplitButton/SplitButton.test.js +1 -1
- package/dist/components/Tab/Tab.d.ts +5 -1
- package/dist/components/Tab/Tab.js +28 -24
- package/dist/components/TabNavigation/TabNavigation.d.ts +1 -1
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/Tag/Tag.test.js +1 -1
- package/dist/components/TagsFields/TagsFields.d.ts +1 -1
- package/dist/components/TagsFields/TagsFields.js +1 -1
- package/dist/components/Textarea/Textarea.d.ts +1 -1
- package/dist/components/Textarea/Textarea.test.js +1 -1
- package/dist/components/Toast/Toast.test.js +1 -1
- package/dist/components/ToastProvider/ToastProvider.d.ts +2 -1
- package/dist/components/ToastProvider/ToastProvider.js +1 -1
- package/dist/components/ToastProvider/ToastProvider.test.js +4 -4
- package/dist/components/Toggle/Toggle.d.ts +1 -1
- package/dist/components/Toggle/Toggle.js +211 -126
- package/dist/components/Toggle/Toggle.test.js +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.js +60 -61
- package/dist/{index-C2s_VtSb.js → index-6DGSlWJb.js} +3 -3
- package/dist/{index-Nyh2Wa71.js → index-6j3vTf--.js} +5 -5
- package/dist/index-B4szHVNJ.js +248 -0
- package/dist/{index-CFqDEbIR.js → index-BVZdJVFB.js} +192 -191
- package/dist/index-Bq1FiX6B.js +93 -0
- package/dist/index-CE9NpYQR.js +604 -0
- package/dist/index-CHy8gqvu.js +353 -0
- package/dist/index-CarlZuEo.js +1610 -0
- package/dist/{index-CCFDXH-J.js → index-CcsZYEYy.js} +29 -28
- package/dist/index-DH9SO8qV.js +221 -0
- package/dist/{index-D_L0ncPJ.js → index-IR8HlW5P.js} +4 -4
- package/dist/{index-DkTDHhag.js → index-banDzeKa.js} +1 -1
- package/dist/index-kgC_DL6e.js +216 -0
- package/dist/main.js +3 -3
- package/dist/storybook-docs-page.d.ts +1 -1
- package/dist/{useToast-Cz5MGKnw.js → useToast-CpwrYPvx.js} +1 -1
- package/dist/{vi.bdSIJ99Y-017e_Pkz.js → vi.bdSIJ99Y-DWCVXj6K.js} +3 -3
- package/package.json +1 -1
- package/dist/RichTextEditor-cvtLFe4t.js +0 -443
- package/dist/index-C8H9A55g.js +0 -222
- package/dist/index-CCnm5-ML.js +0 -230
- package/dist/index-CfIcUHKK.js +0 -70
- package/dist/index-ChQc_Cm6.js +0 -1544
- package/dist/index-CmGGeUr0.js +0 -142
- package/dist/index-Ii4UOx3H.js +0 -599
- package/dist/index-z_kiwVc3.js +0 -237
|
@@ -0,0 +1,1610 @@
|
|
|
1
|
+
import * as O from "react";
|
|
2
|
+
import { useLayoutEffect as Le } from "react";
|
|
3
|
+
import * as Me from "react-dom";
|
|
4
|
+
import { P as Ct, a as te, b as Te, d as xt } from "./index-B4szHVNJ.js";
|
|
5
|
+
import { jsx as Y } from "react/jsx-runtime";
|
|
6
|
+
import { a as $e } from "./index-6DGSlWJb.js";
|
|
7
|
+
import { u as ke } from "./index-6j3vTf--.js";
|
|
8
|
+
const Ne = ["top", "right", "bottom", "left"], K = Math.min, W = Math.max, ft = Math.round, lt = Math.floor, I = (t) => ({
|
|
9
|
+
x: t,
|
|
10
|
+
y: t
|
|
11
|
+
}), Fe = {
|
|
12
|
+
left: "right",
|
|
13
|
+
right: "left",
|
|
14
|
+
bottom: "top",
|
|
15
|
+
top: "bottom"
|
|
16
|
+
};
|
|
17
|
+
function At(t, e, n) {
|
|
18
|
+
return W(t, K(e, n));
|
|
19
|
+
}
|
|
20
|
+
function j(t, e) {
|
|
21
|
+
return typeof t == "function" ? t(e) : t;
|
|
22
|
+
}
|
|
23
|
+
function q(t) {
|
|
24
|
+
return t.split("-")[0];
|
|
25
|
+
}
|
|
26
|
+
function et(t) {
|
|
27
|
+
return t.split("-")[1];
|
|
28
|
+
}
|
|
29
|
+
function Pt(t) {
|
|
30
|
+
return t === "x" ? "y" : "x";
|
|
31
|
+
}
|
|
32
|
+
function St(t) {
|
|
33
|
+
return t === "y" ? "height" : "width";
|
|
34
|
+
}
|
|
35
|
+
function z(t) {
|
|
36
|
+
const e = t[0];
|
|
37
|
+
return e === "t" || e === "b" ? "y" : "x";
|
|
38
|
+
}
|
|
39
|
+
function Et(t) {
|
|
40
|
+
return Pt(z(t));
|
|
41
|
+
}
|
|
42
|
+
function We(t, e, n) {
|
|
43
|
+
n === void 0 && (n = !1);
|
|
44
|
+
const o = et(t), r = Et(t), i = St(r);
|
|
45
|
+
let s = r === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
|
|
46
|
+
return e.reference[i] > e.floating[i] && (s = ut(s)), [s, ut(s)];
|
|
47
|
+
}
|
|
48
|
+
function _e(t) {
|
|
49
|
+
const e = ut(t);
|
|
50
|
+
return [Rt(t), e, Rt(e)];
|
|
51
|
+
}
|
|
52
|
+
function Rt(t) {
|
|
53
|
+
return t.includes("start") ? t.replace("start", "end") : t.replace("end", "start");
|
|
54
|
+
}
|
|
55
|
+
const It = ["left", "right"], Xt = ["right", "left"], He = ["top", "bottom"], Be = ["bottom", "top"];
|
|
56
|
+
function Ve(t, e, n) {
|
|
57
|
+
switch (t) {
|
|
58
|
+
case "top":
|
|
59
|
+
case "bottom":
|
|
60
|
+
return n ? e ? Xt : It : e ? It : Xt;
|
|
61
|
+
case "left":
|
|
62
|
+
case "right":
|
|
63
|
+
return e ? He : Be;
|
|
64
|
+
default:
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function ze(t, e, n, o) {
|
|
69
|
+
const r = et(t);
|
|
70
|
+
let i = Ve(q(t), n === "start", o);
|
|
71
|
+
return r && (i = i.map((s) => s + "-" + r), e && (i = i.concat(i.map(Rt)))), i;
|
|
72
|
+
}
|
|
73
|
+
function ut(t) {
|
|
74
|
+
const e = q(t);
|
|
75
|
+
return Fe[e] + t.slice(e.length);
|
|
76
|
+
}
|
|
77
|
+
function Ie(t) {
|
|
78
|
+
return {
|
|
79
|
+
top: 0,
|
|
80
|
+
right: 0,
|
|
81
|
+
bottom: 0,
|
|
82
|
+
left: 0,
|
|
83
|
+
...t
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function ee(t) {
|
|
87
|
+
return typeof t != "number" ? Ie(t) : {
|
|
88
|
+
top: t,
|
|
89
|
+
right: t,
|
|
90
|
+
bottom: t,
|
|
91
|
+
left: t
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function dt(t) {
|
|
95
|
+
const {
|
|
96
|
+
x: e,
|
|
97
|
+
y: n,
|
|
98
|
+
width: o,
|
|
99
|
+
height: r
|
|
100
|
+
} = t;
|
|
101
|
+
return {
|
|
102
|
+
width: o,
|
|
103
|
+
height: r,
|
|
104
|
+
top: n,
|
|
105
|
+
left: e,
|
|
106
|
+
right: e + o,
|
|
107
|
+
bottom: n + r,
|
|
108
|
+
x: e,
|
|
109
|
+
y: n
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function Yt(t, e, n) {
|
|
113
|
+
let {
|
|
114
|
+
reference: o,
|
|
115
|
+
floating: r
|
|
116
|
+
} = t;
|
|
117
|
+
const i = z(e), s = Et(e), c = St(s), f = q(e), d = i === "y", l = o.x + o.width / 2 - r.width / 2, a = o.y + o.height / 2 - r.height / 2, p = o[c] / 2 - r[c] / 2;
|
|
118
|
+
let u;
|
|
119
|
+
switch (f) {
|
|
120
|
+
case "top":
|
|
121
|
+
u = {
|
|
122
|
+
x: l,
|
|
123
|
+
y: o.y - r.height
|
|
124
|
+
};
|
|
125
|
+
break;
|
|
126
|
+
case "bottom":
|
|
127
|
+
u = {
|
|
128
|
+
x: l,
|
|
129
|
+
y: o.y + o.height
|
|
130
|
+
};
|
|
131
|
+
break;
|
|
132
|
+
case "right":
|
|
133
|
+
u = {
|
|
134
|
+
x: o.x + o.width,
|
|
135
|
+
y: a
|
|
136
|
+
};
|
|
137
|
+
break;
|
|
138
|
+
case "left":
|
|
139
|
+
u = {
|
|
140
|
+
x: o.x - r.width,
|
|
141
|
+
y: a
|
|
142
|
+
};
|
|
143
|
+
break;
|
|
144
|
+
default:
|
|
145
|
+
u = {
|
|
146
|
+
x: o.x,
|
|
147
|
+
y: o.y
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
switch (et(e)) {
|
|
151
|
+
case "start":
|
|
152
|
+
u[s] -= p * (n && d ? -1 : 1);
|
|
153
|
+
break;
|
|
154
|
+
case "end":
|
|
155
|
+
u[s] += p * (n && d ? -1 : 1);
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
return u;
|
|
159
|
+
}
|
|
160
|
+
async function Xe(t, e) {
|
|
161
|
+
var n;
|
|
162
|
+
e === void 0 && (e = {});
|
|
163
|
+
const {
|
|
164
|
+
x: o,
|
|
165
|
+
y: r,
|
|
166
|
+
platform: i,
|
|
167
|
+
rects: s,
|
|
168
|
+
elements: c,
|
|
169
|
+
strategy: f
|
|
170
|
+
} = t, {
|
|
171
|
+
boundary: d = "clippingAncestors",
|
|
172
|
+
rootBoundary: l = "viewport",
|
|
173
|
+
elementContext: a = "floating",
|
|
174
|
+
altBoundary: p = !1,
|
|
175
|
+
padding: u = 0
|
|
176
|
+
} = j(e, t), m = ee(u), w = c[p ? a === "floating" ? "reference" : "floating" : a], g = dt(await i.getClippingRect({
|
|
177
|
+
element: (n = await (i.isElement == null ? void 0 : i.isElement(w))) == null || n ? w : w.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(c.floating)),
|
|
178
|
+
boundary: d,
|
|
179
|
+
rootBoundary: l,
|
|
180
|
+
strategy: f
|
|
181
|
+
})), y = a === "floating" ? {
|
|
182
|
+
x: o,
|
|
183
|
+
y: r,
|
|
184
|
+
width: s.floating.width,
|
|
185
|
+
height: s.floating.height
|
|
186
|
+
} : s.reference, v = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c.floating)), x = await (i.isElement == null ? void 0 : i.isElement(v)) ? await (i.getScale == null ? void 0 : i.getScale(v)) || {
|
|
187
|
+
x: 1,
|
|
188
|
+
y: 1
|
|
189
|
+
} : {
|
|
190
|
+
x: 1,
|
|
191
|
+
y: 1
|
|
192
|
+
}, R = dt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
193
|
+
elements: c,
|
|
194
|
+
rect: y,
|
|
195
|
+
offsetParent: v,
|
|
196
|
+
strategy: f
|
|
197
|
+
}) : y);
|
|
198
|
+
return {
|
|
199
|
+
top: (g.top - R.top + m.top) / x.y,
|
|
200
|
+
bottom: (R.bottom - g.bottom + m.bottom) / x.y,
|
|
201
|
+
left: (g.left - R.left + m.left) / x.x,
|
|
202
|
+
right: (R.right - g.right + m.right) / x.x
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
const Ye = 50, je = async (t, e, n) => {
|
|
206
|
+
const {
|
|
207
|
+
placement: o = "bottom",
|
|
208
|
+
strategy: r = "absolute",
|
|
209
|
+
middleware: i = [],
|
|
210
|
+
platform: s
|
|
211
|
+
} = n, c = s.detectOverflow ? s : {
|
|
212
|
+
...s,
|
|
213
|
+
detectOverflow: Xe
|
|
214
|
+
}, f = await (s.isRTL == null ? void 0 : s.isRTL(e));
|
|
215
|
+
let d = await s.getElementRects({
|
|
216
|
+
reference: t,
|
|
217
|
+
floating: e,
|
|
218
|
+
strategy: r
|
|
219
|
+
}), {
|
|
220
|
+
x: l,
|
|
221
|
+
y: a
|
|
222
|
+
} = Yt(d, o, f), p = o, u = 0;
|
|
223
|
+
const m = {};
|
|
224
|
+
for (let h = 0; h < i.length; h++) {
|
|
225
|
+
const w = i[h];
|
|
226
|
+
if (!w)
|
|
227
|
+
continue;
|
|
228
|
+
const {
|
|
229
|
+
name: g,
|
|
230
|
+
fn: y
|
|
231
|
+
} = w, {
|
|
232
|
+
x: v,
|
|
233
|
+
y: x,
|
|
234
|
+
data: R,
|
|
235
|
+
reset: b
|
|
236
|
+
} = await y({
|
|
237
|
+
x: l,
|
|
238
|
+
y: a,
|
|
239
|
+
initialPlacement: o,
|
|
240
|
+
placement: p,
|
|
241
|
+
strategy: r,
|
|
242
|
+
middlewareData: m,
|
|
243
|
+
rects: d,
|
|
244
|
+
platform: c,
|
|
245
|
+
elements: {
|
|
246
|
+
reference: t,
|
|
247
|
+
floating: e
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
l = v ?? l, a = x ?? a, m[g] = {
|
|
251
|
+
...m[g],
|
|
252
|
+
...R
|
|
253
|
+
}, b && u < Ye && (u++, typeof b == "object" && (b.placement && (p = b.placement), b.rects && (d = b.rects === !0 ? await s.getElementRects({
|
|
254
|
+
reference: t,
|
|
255
|
+
floating: e,
|
|
256
|
+
strategy: r
|
|
257
|
+
}) : b.rects), {
|
|
258
|
+
x: l,
|
|
259
|
+
y: a
|
|
260
|
+
} = Yt(d, p, f)), h = -1);
|
|
261
|
+
}
|
|
262
|
+
return {
|
|
263
|
+
x: l,
|
|
264
|
+
y: a,
|
|
265
|
+
placement: p,
|
|
266
|
+
strategy: r,
|
|
267
|
+
middlewareData: m
|
|
268
|
+
};
|
|
269
|
+
}, qe = (t) => ({
|
|
270
|
+
name: "arrow",
|
|
271
|
+
options: t,
|
|
272
|
+
async fn(e) {
|
|
273
|
+
const {
|
|
274
|
+
x: n,
|
|
275
|
+
y: o,
|
|
276
|
+
placement: r,
|
|
277
|
+
rects: i,
|
|
278
|
+
platform: s,
|
|
279
|
+
elements: c,
|
|
280
|
+
middlewareData: f
|
|
281
|
+
} = e, {
|
|
282
|
+
element: d,
|
|
283
|
+
padding: l = 0
|
|
284
|
+
} = j(t, e) || {};
|
|
285
|
+
if (d == null)
|
|
286
|
+
return {};
|
|
287
|
+
const a = ee(l), p = {
|
|
288
|
+
x: n,
|
|
289
|
+
y: o
|
|
290
|
+
}, u = Et(r), m = St(u), h = await s.getDimensions(d), w = u === "y", g = w ? "top" : "left", y = w ? "bottom" : "right", v = w ? "clientHeight" : "clientWidth", x = i.reference[m] + i.reference[u] - p[u] - i.floating[m], R = p[u] - i.reference[u], b = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(d));
|
|
291
|
+
let C = b ? b[v] : 0;
|
|
292
|
+
(!C || !await (s.isElement == null ? void 0 : s.isElement(b))) && (C = c.floating[v] || i.floating[m]);
|
|
293
|
+
const M = x / 2 - R / 2, N = C / 2 - h[m] / 2 - 1, L = K(a[g], N), k = K(a[y], N), $ = L, E = C - h[m] - k, P = C / 2 - h[m] / 2 + M, F = At($, P, E), S = !f.arrow && et(r) != null && P !== F && i.reference[m] / 2 - (P < $ ? L : k) - h[m] / 2 < 0, D = S ? P < $ ? P - $ : P - E : 0;
|
|
294
|
+
return {
|
|
295
|
+
[u]: p[u] + D,
|
|
296
|
+
data: {
|
|
297
|
+
[u]: F,
|
|
298
|
+
centerOffset: P - F - D,
|
|
299
|
+
...S && {
|
|
300
|
+
alignmentOffset: D
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
reset: S
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
}), Ue = function(t) {
|
|
307
|
+
return t === void 0 && (t = {}), {
|
|
308
|
+
name: "flip",
|
|
309
|
+
options: t,
|
|
310
|
+
async fn(e) {
|
|
311
|
+
var n, o;
|
|
312
|
+
const {
|
|
313
|
+
placement: r,
|
|
314
|
+
middlewareData: i,
|
|
315
|
+
rects: s,
|
|
316
|
+
initialPlacement: c,
|
|
317
|
+
platform: f,
|
|
318
|
+
elements: d
|
|
319
|
+
} = e, {
|
|
320
|
+
mainAxis: l = !0,
|
|
321
|
+
crossAxis: a = !0,
|
|
322
|
+
fallbackPlacements: p,
|
|
323
|
+
fallbackStrategy: u = "bestFit",
|
|
324
|
+
fallbackAxisSideDirection: m = "none",
|
|
325
|
+
flipAlignment: h = !0,
|
|
326
|
+
...w
|
|
327
|
+
} = j(t, e);
|
|
328
|
+
if ((n = i.arrow) != null && n.alignmentOffset)
|
|
329
|
+
return {};
|
|
330
|
+
const g = q(r), y = z(c), v = q(c) === c, x = await (f.isRTL == null ? void 0 : f.isRTL(d.floating)), R = p || (v || !h ? [ut(c)] : _e(c)), b = m !== "none";
|
|
331
|
+
!p && b && R.push(...ze(c, h, m, x));
|
|
332
|
+
const C = [c, ...R], M = await f.detectOverflow(e, w), N = [];
|
|
333
|
+
let L = ((o = i.flip) == null ? void 0 : o.overflows) || [];
|
|
334
|
+
if (l && N.push(M[g]), a) {
|
|
335
|
+
const P = We(r, s, x);
|
|
336
|
+
N.push(M[P[0]], M[P[1]]);
|
|
337
|
+
}
|
|
338
|
+
if (L = [...L, {
|
|
339
|
+
placement: r,
|
|
340
|
+
overflows: N
|
|
341
|
+
}], !N.every((P) => P <= 0)) {
|
|
342
|
+
var k, $;
|
|
343
|
+
const P = (((k = i.flip) == null ? void 0 : k.index) || 0) + 1, F = C[P];
|
|
344
|
+
if (F && (!(a === "alignment" ? y !== z(F) : !1) || // We leave the current main axis only if every placement on that axis
|
|
345
|
+
// overflows the main axis.
|
|
346
|
+
L.every((A) => z(A.placement) === y ? A.overflows[0] > 0 : !0)))
|
|
347
|
+
return {
|
|
348
|
+
data: {
|
|
349
|
+
index: P,
|
|
350
|
+
overflows: L
|
|
351
|
+
},
|
|
352
|
+
reset: {
|
|
353
|
+
placement: F
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
let S = ($ = L.filter((D) => D.overflows[0] <= 0).sort((D, A) => D.overflows[1] - A.overflows[1])[0]) == null ? void 0 : $.placement;
|
|
357
|
+
if (!S)
|
|
358
|
+
switch (u) {
|
|
359
|
+
case "bestFit": {
|
|
360
|
+
var E;
|
|
361
|
+
const D = (E = L.filter((A) => {
|
|
362
|
+
if (b) {
|
|
363
|
+
const T = z(A.placement);
|
|
364
|
+
return T === y || // Create a bias to the `y` side axis due to horizontal
|
|
365
|
+
// reading directions favoring greater width.
|
|
366
|
+
T === "y";
|
|
367
|
+
}
|
|
368
|
+
return !0;
|
|
369
|
+
}).map((A) => [A.placement, A.overflows.filter((T) => T > 0).reduce((T, H) => T + H, 0)]).sort((A, T) => A[1] - T[1])[0]) == null ? void 0 : E[0];
|
|
370
|
+
D && (S = D);
|
|
371
|
+
break;
|
|
372
|
+
}
|
|
373
|
+
case "initialPlacement":
|
|
374
|
+
S = c;
|
|
375
|
+
break;
|
|
376
|
+
}
|
|
377
|
+
if (r !== S)
|
|
378
|
+
return {
|
|
379
|
+
reset: {
|
|
380
|
+
placement: S
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
return {};
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
};
|
|
388
|
+
function jt(t, e) {
|
|
389
|
+
return {
|
|
390
|
+
top: t.top - e.height,
|
|
391
|
+
right: t.right - e.width,
|
|
392
|
+
bottom: t.bottom - e.height,
|
|
393
|
+
left: t.left - e.width
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
function qt(t) {
|
|
397
|
+
return Ne.some((e) => t[e] >= 0);
|
|
398
|
+
}
|
|
399
|
+
const Ke = function(t) {
|
|
400
|
+
return t === void 0 && (t = {}), {
|
|
401
|
+
name: "hide",
|
|
402
|
+
options: t,
|
|
403
|
+
async fn(e) {
|
|
404
|
+
const {
|
|
405
|
+
rects: n,
|
|
406
|
+
platform: o
|
|
407
|
+
} = e, {
|
|
408
|
+
strategy: r = "referenceHidden",
|
|
409
|
+
...i
|
|
410
|
+
} = j(t, e);
|
|
411
|
+
switch (r) {
|
|
412
|
+
case "referenceHidden": {
|
|
413
|
+
const s = await o.detectOverflow(e, {
|
|
414
|
+
...i,
|
|
415
|
+
elementContext: "reference"
|
|
416
|
+
}), c = jt(s, n.reference);
|
|
417
|
+
return {
|
|
418
|
+
data: {
|
|
419
|
+
referenceHiddenOffsets: c,
|
|
420
|
+
referenceHidden: qt(c)
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
case "escaped": {
|
|
425
|
+
const s = await o.detectOverflow(e, {
|
|
426
|
+
...i,
|
|
427
|
+
altBoundary: !0
|
|
428
|
+
}), c = jt(s, n.floating);
|
|
429
|
+
return {
|
|
430
|
+
data: {
|
|
431
|
+
escapedOffsets: c,
|
|
432
|
+
escaped: qt(c)
|
|
433
|
+
}
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
default:
|
|
437
|
+
return {};
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
}, ne = /* @__PURE__ */ new Set(["left", "top"]);
|
|
442
|
+
async function Ze(t, e) {
|
|
443
|
+
const {
|
|
444
|
+
placement: n,
|
|
445
|
+
platform: o,
|
|
446
|
+
elements: r
|
|
447
|
+
} = t, i = await (o.isRTL == null ? void 0 : o.isRTL(r.floating)), s = q(n), c = et(n), f = z(n) === "y", d = ne.has(s) ? -1 : 1, l = i && f ? -1 : 1, a = j(e, t);
|
|
448
|
+
let {
|
|
449
|
+
mainAxis: p,
|
|
450
|
+
crossAxis: u,
|
|
451
|
+
alignmentAxis: m
|
|
452
|
+
} = typeof a == "number" ? {
|
|
453
|
+
mainAxis: a,
|
|
454
|
+
crossAxis: 0,
|
|
455
|
+
alignmentAxis: null
|
|
456
|
+
} : {
|
|
457
|
+
mainAxis: a.mainAxis || 0,
|
|
458
|
+
crossAxis: a.crossAxis || 0,
|
|
459
|
+
alignmentAxis: a.alignmentAxis
|
|
460
|
+
};
|
|
461
|
+
return c && typeof m == "number" && (u = c === "end" ? m * -1 : m), f ? {
|
|
462
|
+
x: u * l,
|
|
463
|
+
y: p * d
|
|
464
|
+
} : {
|
|
465
|
+
x: p * d,
|
|
466
|
+
y: u * l
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
const Ge = function(t) {
|
|
470
|
+
return t === void 0 && (t = 0), {
|
|
471
|
+
name: "offset",
|
|
472
|
+
options: t,
|
|
473
|
+
async fn(e) {
|
|
474
|
+
var n, o;
|
|
475
|
+
const {
|
|
476
|
+
x: r,
|
|
477
|
+
y: i,
|
|
478
|
+
placement: s,
|
|
479
|
+
middlewareData: c
|
|
480
|
+
} = e, f = await Ze(e, t);
|
|
481
|
+
return s === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
|
|
482
|
+
x: r + f.x,
|
|
483
|
+
y: i + f.y,
|
|
484
|
+
data: {
|
|
485
|
+
...f,
|
|
486
|
+
placement: s
|
|
487
|
+
}
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
}, Je = function(t) {
|
|
492
|
+
return t === void 0 && (t = {}), {
|
|
493
|
+
name: "shift",
|
|
494
|
+
options: t,
|
|
495
|
+
async fn(e) {
|
|
496
|
+
const {
|
|
497
|
+
x: n,
|
|
498
|
+
y: o,
|
|
499
|
+
placement: r,
|
|
500
|
+
platform: i
|
|
501
|
+
} = e, {
|
|
502
|
+
mainAxis: s = !0,
|
|
503
|
+
crossAxis: c = !1,
|
|
504
|
+
limiter: f = {
|
|
505
|
+
fn: (g) => {
|
|
506
|
+
let {
|
|
507
|
+
x: y,
|
|
508
|
+
y: v
|
|
509
|
+
} = g;
|
|
510
|
+
return {
|
|
511
|
+
x: y,
|
|
512
|
+
y: v
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
},
|
|
516
|
+
...d
|
|
517
|
+
} = j(t, e), l = {
|
|
518
|
+
x: n,
|
|
519
|
+
y: o
|
|
520
|
+
}, a = await i.detectOverflow(e, d), p = z(q(r)), u = Pt(p);
|
|
521
|
+
let m = l[u], h = l[p];
|
|
522
|
+
if (s) {
|
|
523
|
+
const g = u === "y" ? "top" : "left", y = u === "y" ? "bottom" : "right", v = m + a[g], x = m - a[y];
|
|
524
|
+
m = At(v, m, x);
|
|
525
|
+
}
|
|
526
|
+
if (c) {
|
|
527
|
+
const g = p === "y" ? "top" : "left", y = p === "y" ? "bottom" : "right", v = h + a[g], x = h - a[y];
|
|
528
|
+
h = At(v, h, x);
|
|
529
|
+
}
|
|
530
|
+
const w = f.fn({
|
|
531
|
+
...e,
|
|
532
|
+
[u]: m,
|
|
533
|
+
[p]: h
|
|
534
|
+
});
|
|
535
|
+
return {
|
|
536
|
+
...w,
|
|
537
|
+
data: {
|
|
538
|
+
x: w.x - n,
|
|
539
|
+
y: w.y - o,
|
|
540
|
+
enabled: {
|
|
541
|
+
[u]: s,
|
|
542
|
+
[p]: c
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
};
|
|
548
|
+
}, Qe = function(t) {
|
|
549
|
+
return t === void 0 && (t = {}), {
|
|
550
|
+
options: t,
|
|
551
|
+
fn(e) {
|
|
552
|
+
const {
|
|
553
|
+
x: n,
|
|
554
|
+
y: o,
|
|
555
|
+
placement: r,
|
|
556
|
+
rects: i,
|
|
557
|
+
middlewareData: s
|
|
558
|
+
} = e, {
|
|
559
|
+
offset: c = 0,
|
|
560
|
+
mainAxis: f = !0,
|
|
561
|
+
crossAxis: d = !0
|
|
562
|
+
} = j(t, e), l = {
|
|
563
|
+
x: n,
|
|
564
|
+
y: o
|
|
565
|
+
}, a = z(r), p = Pt(a);
|
|
566
|
+
let u = l[p], m = l[a];
|
|
567
|
+
const h = j(c, e), w = typeof h == "number" ? {
|
|
568
|
+
mainAxis: h,
|
|
569
|
+
crossAxis: 0
|
|
570
|
+
} : {
|
|
571
|
+
mainAxis: 0,
|
|
572
|
+
crossAxis: 0,
|
|
573
|
+
...h
|
|
574
|
+
};
|
|
575
|
+
if (f) {
|
|
576
|
+
const v = p === "y" ? "height" : "width", x = i.reference[p] - i.floating[v] + w.mainAxis, R = i.reference[p] + i.reference[v] - w.mainAxis;
|
|
577
|
+
u < x ? u = x : u > R && (u = R);
|
|
578
|
+
}
|
|
579
|
+
if (d) {
|
|
580
|
+
var g, y;
|
|
581
|
+
const v = p === "y" ? "width" : "height", x = ne.has(q(r)), R = i.reference[a] - i.floating[v] + (x && ((g = s.offset) == null ? void 0 : g[a]) || 0) + (x ? 0 : w.crossAxis), b = i.reference[a] + i.reference[v] + (x ? 0 : ((y = s.offset) == null ? void 0 : y[a]) || 0) - (x ? w.crossAxis : 0);
|
|
582
|
+
m < R ? m = R : m > b && (m = b);
|
|
583
|
+
}
|
|
584
|
+
return {
|
|
585
|
+
[p]: u,
|
|
586
|
+
[a]: m
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
};
|
|
590
|
+
}, tn = function(t) {
|
|
591
|
+
return t === void 0 && (t = {}), {
|
|
592
|
+
name: "size",
|
|
593
|
+
options: t,
|
|
594
|
+
async fn(e) {
|
|
595
|
+
var n, o;
|
|
596
|
+
const {
|
|
597
|
+
placement: r,
|
|
598
|
+
rects: i,
|
|
599
|
+
platform: s,
|
|
600
|
+
elements: c
|
|
601
|
+
} = e, {
|
|
602
|
+
apply: f = () => {
|
|
603
|
+
},
|
|
604
|
+
...d
|
|
605
|
+
} = j(t, e), l = await s.detectOverflow(e, d), a = q(r), p = et(r), u = z(r) === "y", {
|
|
606
|
+
width: m,
|
|
607
|
+
height: h
|
|
608
|
+
} = i.floating;
|
|
609
|
+
let w, g;
|
|
610
|
+
a === "top" || a === "bottom" ? (w = a, g = p === (await (s.isRTL == null ? void 0 : s.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (g = a, w = p === "end" ? "top" : "bottom");
|
|
611
|
+
const y = h - l.top - l.bottom, v = m - l.left - l.right, x = K(h - l[w], y), R = K(m - l[g], v), b = !e.middlewareData.shift;
|
|
612
|
+
let C = x, M = R;
|
|
613
|
+
if ((n = e.middlewareData.shift) != null && n.enabled.x && (M = v), (o = e.middlewareData.shift) != null && o.enabled.y && (C = y), b && !p) {
|
|
614
|
+
const L = W(l.left, 0), k = W(l.right, 0), $ = W(l.top, 0), E = W(l.bottom, 0);
|
|
615
|
+
u ? M = m - 2 * (L !== 0 || k !== 0 ? L + k : W(l.left, l.right)) : C = h - 2 * ($ !== 0 || E !== 0 ? $ + E : W(l.top, l.bottom));
|
|
616
|
+
}
|
|
617
|
+
await f({
|
|
618
|
+
...e,
|
|
619
|
+
availableWidth: M,
|
|
620
|
+
availableHeight: C
|
|
621
|
+
});
|
|
622
|
+
const N = await s.getDimensions(c.floating);
|
|
623
|
+
return m !== N.width || h !== N.height ? {
|
|
624
|
+
reset: {
|
|
625
|
+
rects: !0
|
|
626
|
+
}
|
|
627
|
+
} : {};
|
|
628
|
+
}
|
|
629
|
+
};
|
|
630
|
+
};
|
|
631
|
+
function pt() {
|
|
632
|
+
return typeof window < "u";
|
|
633
|
+
}
|
|
634
|
+
function nt(t) {
|
|
635
|
+
return oe(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
636
|
+
}
|
|
637
|
+
function _(t) {
|
|
638
|
+
var e;
|
|
639
|
+
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
640
|
+
}
|
|
641
|
+
function X(t) {
|
|
642
|
+
var e;
|
|
643
|
+
return (e = (oe(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
644
|
+
}
|
|
645
|
+
function oe(t) {
|
|
646
|
+
return pt() ? t instanceof Node || t instanceof _(t).Node : !1;
|
|
647
|
+
}
|
|
648
|
+
function B(t) {
|
|
649
|
+
return pt() ? t instanceof Element || t instanceof _(t).Element : !1;
|
|
650
|
+
}
|
|
651
|
+
function U(t) {
|
|
652
|
+
return pt() ? t instanceof HTMLElement || t instanceof _(t).HTMLElement : !1;
|
|
653
|
+
}
|
|
654
|
+
function Ut(t) {
|
|
655
|
+
return !pt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof _(t).ShadowRoot;
|
|
656
|
+
}
|
|
657
|
+
function it(t) {
|
|
658
|
+
const {
|
|
659
|
+
overflow: e,
|
|
660
|
+
overflowX: n,
|
|
661
|
+
overflowY: o,
|
|
662
|
+
display: r
|
|
663
|
+
} = V(t);
|
|
664
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && r !== "inline" && r !== "contents";
|
|
665
|
+
}
|
|
666
|
+
function en(t) {
|
|
667
|
+
return /^(table|td|th)$/.test(nt(t));
|
|
668
|
+
}
|
|
669
|
+
function ht(t) {
|
|
670
|
+
try {
|
|
671
|
+
if (t.matches(":popover-open"))
|
|
672
|
+
return !0;
|
|
673
|
+
} catch {
|
|
674
|
+
}
|
|
675
|
+
try {
|
|
676
|
+
return t.matches(":modal");
|
|
677
|
+
} catch {
|
|
678
|
+
return !1;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
const nn = /transform|translate|scale|rotate|perspective|filter/, on = /paint|layout|strict|content/, G = (t) => !!t && t !== "none";
|
|
682
|
+
let yt;
|
|
683
|
+
function Dt(t) {
|
|
684
|
+
const e = B(t) ? V(t) : t;
|
|
685
|
+
return G(e.transform) || G(e.translate) || G(e.scale) || G(e.rotate) || G(e.perspective) || !Lt() && (G(e.backdropFilter) || G(e.filter)) || nn.test(e.willChange || "") || on.test(e.contain || "");
|
|
686
|
+
}
|
|
687
|
+
function rn(t) {
|
|
688
|
+
let e = Z(t);
|
|
689
|
+
for (; U(e) && !tt(e); ) {
|
|
690
|
+
if (Dt(e))
|
|
691
|
+
return e;
|
|
692
|
+
if (ht(e))
|
|
693
|
+
return null;
|
|
694
|
+
e = Z(e);
|
|
695
|
+
}
|
|
696
|
+
return null;
|
|
697
|
+
}
|
|
698
|
+
function Lt() {
|
|
699
|
+
return yt == null && (yt = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), yt;
|
|
700
|
+
}
|
|
701
|
+
function tt(t) {
|
|
702
|
+
return /^(html|body|#document)$/.test(nt(t));
|
|
703
|
+
}
|
|
704
|
+
function V(t) {
|
|
705
|
+
return _(t).getComputedStyle(t);
|
|
706
|
+
}
|
|
707
|
+
function gt(t) {
|
|
708
|
+
return B(t) ? {
|
|
709
|
+
scrollLeft: t.scrollLeft,
|
|
710
|
+
scrollTop: t.scrollTop
|
|
711
|
+
} : {
|
|
712
|
+
scrollLeft: t.scrollX,
|
|
713
|
+
scrollTop: t.scrollY
|
|
714
|
+
};
|
|
715
|
+
}
|
|
716
|
+
function Z(t) {
|
|
717
|
+
if (nt(t) === "html")
|
|
718
|
+
return t;
|
|
719
|
+
const e = (
|
|
720
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
721
|
+
t.assignedSlot || // DOM Element detected.
|
|
722
|
+
t.parentNode || // ShadowRoot detected.
|
|
723
|
+
Ut(t) && t.host || // Fallback.
|
|
724
|
+
X(t)
|
|
725
|
+
);
|
|
726
|
+
return Ut(e) ? e.host : e;
|
|
727
|
+
}
|
|
728
|
+
function re(t) {
|
|
729
|
+
const e = Z(t);
|
|
730
|
+
return tt(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : U(e) && it(e) ? e : re(e);
|
|
731
|
+
}
|
|
732
|
+
function rt(t, e, n) {
|
|
733
|
+
var o;
|
|
734
|
+
e === void 0 && (e = []), n === void 0 && (n = !0);
|
|
735
|
+
const r = re(t), i = r === ((o = t.ownerDocument) == null ? void 0 : o.body), s = _(r);
|
|
736
|
+
if (i) {
|
|
737
|
+
const c = Ot(s);
|
|
738
|
+
return e.concat(s, s.visualViewport || [], it(r) ? r : [], c && n ? rt(c) : []);
|
|
739
|
+
} else
|
|
740
|
+
return e.concat(r, rt(r, [], n));
|
|
741
|
+
}
|
|
742
|
+
function Ot(t) {
|
|
743
|
+
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
744
|
+
}
|
|
745
|
+
function ie(t) {
|
|
746
|
+
const e = V(t);
|
|
747
|
+
let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
|
|
748
|
+
const r = U(t), i = r ? t.offsetWidth : n, s = r ? t.offsetHeight : o, c = ft(n) !== i || ft(o) !== s;
|
|
749
|
+
return c && (n = i, o = s), {
|
|
750
|
+
width: n,
|
|
751
|
+
height: o,
|
|
752
|
+
$: c
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
function Mt(t) {
|
|
756
|
+
return B(t) ? t : t.contextElement;
|
|
757
|
+
}
|
|
758
|
+
function Q(t) {
|
|
759
|
+
const e = Mt(t);
|
|
760
|
+
if (!U(e))
|
|
761
|
+
return I(1);
|
|
762
|
+
const n = e.getBoundingClientRect(), {
|
|
763
|
+
width: o,
|
|
764
|
+
height: r,
|
|
765
|
+
$: i
|
|
766
|
+
} = ie(e);
|
|
767
|
+
let s = (i ? ft(n.width) : n.width) / o, c = (i ? ft(n.height) : n.height) / r;
|
|
768
|
+
return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
769
|
+
x: s,
|
|
770
|
+
y: c
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
const sn = /* @__PURE__ */ I(0);
|
|
774
|
+
function se(t) {
|
|
775
|
+
const e = _(t);
|
|
776
|
+
return !Lt() || !e.visualViewport ? sn : {
|
|
777
|
+
x: e.visualViewport.offsetLeft,
|
|
778
|
+
y: e.visualViewport.offsetTop
|
|
779
|
+
};
|
|
780
|
+
}
|
|
781
|
+
function cn(t, e, n) {
|
|
782
|
+
return e === void 0 && (e = !1), !n || e && n !== _(t) ? !1 : e;
|
|
783
|
+
}
|
|
784
|
+
function J(t, e, n, o) {
|
|
785
|
+
e === void 0 && (e = !1), n === void 0 && (n = !1);
|
|
786
|
+
const r = t.getBoundingClientRect(), i = Mt(t);
|
|
787
|
+
let s = I(1);
|
|
788
|
+
e && (o ? B(o) && (s = Q(o)) : s = Q(t));
|
|
789
|
+
const c = cn(i, n, o) ? se(i) : I(0);
|
|
790
|
+
let f = (r.left + c.x) / s.x, d = (r.top + c.y) / s.y, l = r.width / s.x, a = r.height / s.y;
|
|
791
|
+
if (i) {
|
|
792
|
+
const p = _(i), u = o && B(o) ? _(o) : o;
|
|
793
|
+
let m = p, h = Ot(m);
|
|
794
|
+
for (; h && o && u !== m; ) {
|
|
795
|
+
const w = Q(h), g = h.getBoundingClientRect(), y = V(h), v = g.left + (h.clientLeft + parseFloat(y.paddingLeft)) * w.x, x = g.top + (h.clientTop + parseFloat(y.paddingTop)) * w.y;
|
|
796
|
+
f *= w.x, d *= w.y, l *= w.x, a *= w.y, f += v, d += x, m = _(h), h = Ot(m);
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
return dt({
|
|
800
|
+
width: l,
|
|
801
|
+
height: a,
|
|
802
|
+
x: f,
|
|
803
|
+
y: d
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
function wt(t, e) {
|
|
807
|
+
const n = gt(t).scrollLeft;
|
|
808
|
+
return e ? e.left + n : J(X(t)).left + n;
|
|
809
|
+
}
|
|
810
|
+
function ce(t, e) {
|
|
811
|
+
const n = t.getBoundingClientRect(), o = n.left + e.scrollLeft - wt(t, n), r = n.top + e.scrollTop;
|
|
812
|
+
return {
|
|
813
|
+
x: o,
|
|
814
|
+
y: r
|
|
815
|
+
};
|
|
816
|
+
}
|
|
817
|
+
function ln(t) {
|
|
818
|
+
let {
|
|
819
|
+
elements: e,
|
|
820
|
+
rect: n,
|
|
821
|
+
offsetParent: o,
|
|
822
|
+
strategy: r
|
|
823
|
+
} = t;
|
|
824
|
+
const i = r === "fixed", s = X(o), c = e ? ht(e.floating) : !1;
|
|
825
|
+
if (o === s || c && i)
|
|
826
|
+
return n;
|
|
827
|
+
let f = {
|
|
828
|
+
scrollLeft: 0,
|
|
829
|
+
scrollTop: 0
|
|
830
|
+
}, d = I(1);
|
|
831
|
+
const l = I(0), a = U(o);
|
|
832
|
+
if ((a || !a && !i) && ((nt(o) !== "body" || it(s)) && (f = gt(o)), a)) {
|
|
833
|
+
const u = J(o);
|
|
834
|
+
d = Q(o), l.x = u.x + o.clientLeft, l.y = u.y + o.clientTop;
|
|
835
|
+
}
|
|
836
|
+
const p = s && !a && !i ? ce(s, f) : I(0);
|
|
837
|
+
return {
|
|
838
|
+
width: n.width * d.x,
|
|
839
|
+
height: n.height * d.y,
|
|
840
|
+
x: n.x * d.x - f.scrollLeft * d.x + l.x + p.x,
|
|
841
|
+
y: n.y * d.y - f.scrollTop * d.y + l.y + p.y
|
|
842
|
+
};
|
|
843
|
+
}
|
|
844
|
+
function an(t) {
|
|
845
|
+
return Array.from(t.getClientRects());
|
|
846
|
+
}
|
|
847
|
+
function fn(t) {
|
|
848
|
+
const e = X(t), n = gt(t), o = t.ownerDocument.body, r = W(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), i = W(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
|
|
849
|
+
let s = -n.scrollLeft + wt(t);
|
|
850
|
+
const c = -n.scrollTop;
|
|
851
|
+
return V(o).direction === "rtl" && (s += W(e.clientWidth, o.clientWidth) - r), {
|
|
852
|
+
width: r,
|
|
853
|
+
height: i,
|
|
854
|
+
x: s,
|
|
855
|
+
y: c
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
const Kt = 25;
|
|
859
|
+
function un(t, e) {
|
|
860
|
+
const n = _(t), o = X(t), r = n.visualViewport;
|
|
861
|
+
let i = o.clientWidth, s = o.clientHeight, c = 0, f = 0;
|
|
862
|
+
if (r) {
|
|
863
|
+
i = r.width, s = r.height;
|
|
864
|
+
const l = Lt();
|
|
865
|
+
(!l || l && e === "fixed") && (c = r.offsetLeft, f = r.offsetTop);
|
|
866
|
+
}
|
|
867
|
+
const d = wt(o);
|
|
868
|
+
if (d <= 0) {
|
|
869
|
+
const l = o.ownerDocument, a = l.body, p = getComputedStyle(a), u = l.compatMode === "CSS1Compat" && parseFloat(p.marginLeft) + parseFloat(p.marginRight) || 0, m = Math.abs(o.clientWidth - a.clientWidth - u);
|
|
870
|
+
m <= Kt && (i -= m);
|
|
871
|
+
} else d <= Kt && (i += d);
|
|
872
|
+
return {
|
|
873
|
+
width: i,
|
|
874
|
+
height: s,
|
|
875
|
+
x: c,
|
|
876
|
+
y: f
|
|
877
|
+
};
|
|
878
|
+
}
|
|
879
|
+
function dn(t, e) {
|
|
880
|
+
const n = J(t, !0, e === "fixed"), o = n.top + t.clientTop, r = n.left + t.clientLeft, i = U(t) ? Q(t) : I(1), s = t.clientWidth * i.x, c = t.clientHeight * i.y, f = r * i.x, d = o * i.y;
|
|
881
|
+
return {
|
|
882
|
+
width: s,
|
|
883
|
+
height: c,
|
|
884
|
+
x: f,
|
|
885
|
+
y: d
|
|
886
|
+
};
|
|
887
|
+
}
|
|
888
|
+
function Zt(t, e, n) {
|
|
889
|
+
let o;
|
|
890
|
+
if (e === "viewport")
|
|
891
|
+
o = un(t, n);
|
|
892
|
+
else if (e === "document")
|
|
893
|
+
o = fn(X(t));
|
|
894
|
+
else if (B(e))
|
|
895
|
+
o = dn(e, n);
|
|
896
|
+
else {
|
|
897
|
+
const r = se(t);
|
|
898
|
+
o = {
|
|
899
|
+
x: e.x - r.x,
|
|
900
|
+
y: e.y - r.y,
|
|
901
|
+
width: e.width,
|
|
902
|
+
height: e.height
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
return dt(o);
|
|
906
|
+
}
|
|
907
|
+
function le(t, e) {
|
|
908
|
+
const n = Z(t);
|
|
909
|
+
return n === e || !B(n) || tt(n) ? !1 : V(n).position === "fixed" || le(n, e);
|
|
910
|
+
}
|
|
911
|
+
function mn(t, e) {
|
|
912
|
+
const n = e.get(t);
|
|
913
|
+
if (n)
|
|
914
|
+
return n;
|
|
915
|
+
let o = rt(t, [], !1).filter((c) => B(c) && nt(c) !== "body"), r = null;
|
|
916
|
+
const i = V(t).position === "fixed";
|
|
917
|
+
let s = i ? Z(t) : t;
|
|
918
|
+
for (; B(s) && !tt(s); ) {
|
|
919
|
+
const c = V(s), f = Dt(s);
|
|
920
|
+
!f && c.position === "fixed" && (r = null), (i ? !f && !r : !f && c.position === "static" && !!r && (r.position === "absolute" || r.position === "fixed") || it(s) && !f && le(t, s)) ? o = o.filter((l) => l !== s) : r = c, s = Z(s);
|
|
921
|
+
}
|
|
922
|
+
return e.set(t, o), o;
|
|
923
|
+
}
|
|
924
|
+
function pn(t) {
|
|
925
|
+
let {
|
|
926
|
+
element: e,
|
|
927
|
+
boundary: n,
|
|
928
|
+
rootBoundary: o,
|
|
929
|
+
strategy: r
|
|
930
|
+
} = t;
|
|
931
|
+
const s = [...n === "clippingAncestors" ? ht(e) ? [] : mn(e, this._c) : [].concat(n), o], c = Zt(e, s[0], r);
|
|
932
|
+
let f = c.top, d = c.right, l = c.bottom, a = c.left;
|
|
933
|
+
for (let p = 1; p < s.length; p++) {
|
|
934
|
+
const u = Zt(e, s[p], r);
|
|
935
|
+
f = W(u.top, f), d = K(u.right, d), l = K(u.bottom, l), a = W(u.left, a);
|
|
936
|
+
}
|
|
937
|
+
return {
|
|
938
|
+
width: d - a,
|
|
939
|
+
height: l - f,
|
|
940
|
+
x: a,
|
|
941
|
+
y: f
|
|
942
|
+
};
|
|
943
|
+
}
|
|
944
|
+
function hn(t) {
|
|
945
|
+
const {
|
|
946
|
+
width: e,
|
|
947
|
+
height: n
|
|
948
|
+
} = ie(t);
|
|
949
|
+
return {
|
|
950
|
+
width: e,
|
|
951
|
+
height: n
|
|
952
|
+
};
|
|
953
|
+
}
|
|
954
|
+
function gn(t, e, n) {
|
|
955
|
+
const o = U(e), r = X(e), i = n === "fixed", s = J(t, !0, i, e);
|
|
956
|
+
let c = {
|
|
957
|
+
scrollLeft: 0,
|
|
958
|
+
scrollTop: 0
|
|
959
|
+
};
|
|
960
|
+
const f = I(0);
|
|
961
|
+
function d() {
|
|
962
|
+
f.x = wt(r);
|
|
963
|
+
}
|
|
964
|
+
if (o || !o && !i)
|
|
965
|
+
if ((nt(e) !== "body" || it(r)) && (c = gt(e)), o) {
|
|
966
|
+
const u = J(e, !0, i, e);
|
|
967
|
+
f.x = u.x + e.clientLeft, f.y = u.y + e.clientTop;
|
|
968
|
+
} else r && d();
|
|
969
|
+
i && !o && r && d();
|
|
970
|
+
const l = r && !o && !i ? ce(r, c) : I(0), a = s.left + c.scrollLeft - f.x - l.x, p = s.top + c.scrollTop - f.y - l.y;
|
|
971
|
+
return {
|
|
972
|
+
x: a,
|
|
973
|
+
y: p,
|
|
974
|
+
width: s.width,
|
|
975
|
+
height: s.height
|
|
976
|
+
};
|
|
977
|
+
}
|
|
978
|
+
function vt(t) {
|
|
979
|
+
return V(t).position === "static";
|
|
980
|
+
}
|
|
981
|
+
function Gt(t, e) {
|
|
982
|
+
if (!U(t) || V(t).position === "fixed")
|
|
983
|
+
return null;
|
|
984
|
+
if (e)
|
|
985
|
+
return e(t);
|
|
986
|
+
let n = t.offsetParent;
|
|
987
|
+
return X(t) === n && (n = n.ownerDocument.body), n;
|
|
988
|
+
}
|
|
989
|
+
function ae(t, e) {
|
|
990
|
+
const n = _(t);
|
|
991
|
+
if (ht(t))
|
|
992
|
+
return n;
|
|
993
|
+
if (!U(t)) {
|
|
994
|
+
let r = Z(t);
|
|
995
|
+
for (; r && !tt(r); ) {
|
|
996
|
+
if (B(r) && !vt(r))
|
|
997
|
+
return r;
|
|
998
|
+
r = Z(r);
|
|
999
|
+
}
|
|
1000
|
+
return n;
|
|
1001
|
+
}
|
|
1002
|
+
let o = Gt(t, e);
|
|
1003
|
+
for (; o && en(o) && vt(o); )
|
|
1004
|
+
o = Gt(o, e);
|
|
1005
|
+
return o && tt(o) && vt(o) && !Dt(o) ? n : o || rn(t) || n;
|
|
1006
|
+
}
|
|
1007
|
+
const wn = async function(t) {
|
|
1008
|
+
const e = this.getOffsetParent || ae, n = this.getDimensions, o = await n(t.floating);
|
|
1009
|
+
return {
|
|
1010
|
+
reference: gn(t.reference, await e(t.floating), t.strategy),
|
|
1011
|
+
floating: {
|
|
1012
|
+
x: 0,
|
|
1013
|
+
y: 0,
|
|
1014
|
+
width: o.width,
|
|
1015
|
+
height: o.height
|
|
1016
|
+
}
|
|
1017
|
+
};
|
|
1018
|
+
};
|
|
1019
|
+
function xn(t) {
|
|
1020
|
+
return V(t).direction === "rtl";
|
|
1021
|
+
}
|
|
1022
|
+
const yn = {
|
|
1023
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: ln,
|
|
1024
|
+
getDocumentElement: X,
|
|
1025
|
+
getClippingRect: pn,
|
|
1026
|
+
getOffsetParent: ae,
|
|
1027
|
+
getElementRects: wn,
|
|
1028
|
+
getClientRects: an,
|
|
1029
|
+
getDimensions: hn,
|
|
1030
|
+
getScale: Q,
|
|
1031
|
+
isElement: B,
|
|
1032
|
+
isRTL: xn
|
|
1033
|
+
};
|
|
1034
|
+
function fe(t, e) {
|
|
1035
|
+
return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
|
|
1036
|
+
}
|
|
1037
|
+
function vn(t, e) {
|
|
1038
|
+
let n = null, o;
|
|
1039
|
+
const r = X(t);
|
|
1040
|
+
function i() {
|
|
1041
|
+
var c;
|
|
1042
|
+
clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
|
|
1043
|
+
}
|
|
1044
|
+
function s(c, f) {
|
|
1045
|
+
c === void 0 && (c = !1), f === void 0 && (f = 1), i();
|
|
1046
|
+
const d = t.getBoundingClientRect(), {
|
|
1047
|
+
left: l,
|
|
1048
|
+
top: a,
|
|
1049
|
+
width: p,
|
|
1050
|
+
height: u
|
|
1051
|
+
} = d;
|
|
1052
|
+
if (c || e(), !p || !u)
|
|
1053
|
+
return;
|
|
1054
|
+
const m = lt(a), h = lt(r.clientWidth - (l + p)), w = lt(r.clientHeight - (a + u)), g = lt(l), v = {
|
|
1055
|
+
rootMargin: -m + "px " + -h + "px " + -w + "px " + -g + "px",
|
|
1056
|
+
threshold: W(0, K(1, f)) || 1
|
|
1057
|
+
};
|
|
1058
|
+
let x = !0;
|
|
1059
|
+
function R(b) {
|
|
1060
|
+
const C = b[0].intersectionRatio;
|
|
1061
|
+
if (C !== f) {
|
|
1062
|
+
if (!x)
|
|
1063
|
+
return s();
|
|
1064
|
+
C ? s(!1, C) : o = setTimeout(() => {
|
|
1065
|
+
s(!1, 1e-7);
|
|
1066
|
+
}, 1e3);
|
|
1067
|
+
}
|
|
1068
|
+
C === 1 && !fe(d, t.getBoundingClientRect()) && s(), x = !1;
|
|
1069
|
+
}
|
|
1070
|
+
try {
|
|
1071
|
+
n = new IntersectionObserver(R, {
|
|
1072
|
+
...v,
|
|
1073
|
+
// Handle <iframe>s
|
|
1074
|
+
root: r.ownerDocument
|
|
1075
|
+
});
|
|
1076
|
+
} catch {
|
|
1077
|
+
n = new IntersectionObserver(R, v);
|
|
1078
|
+
}
|
|
1079
|
+
n.observe(t);
|
|
1080
|
+
}
|
|
1081
|
+
return s(!0), i;
|
|
1082
|
+
}
|
|
1083
|
+
function bn(t, e, n, o) {
|
|
1084
|
+
o === void 0 && (o = {});
|
|
1085
|
+
const {
|
|
1086
|
+
ancestorScroll: r = !0,
|
|
1087
|
+
ancestorResize: i = !0,
|
|
1088
|
+
elementResize: s = typeof ResizeObserver == "function",
|
|
1089
|
+
layoutShift: c = typeof IntersectionObserver == "function",
|
|
1090
|
+
animationFrame: f = !1
|
|
1091
|
+
} = o, d = Mt(t), l = r || i ? [...d ? rt(d) : [], ...e ? rt(e) : []] : [];
|
|
1092
|
+
l.forEach((g) => {
|
|
1093
|
+
r && g.addEventListener("scroll", n, {
|
|
1094
|
+
passive: !0
|
|
1095
|
+
}), i && g.addEventListener("resize", n);
|
|
1096
|
+
});
|
|
1097
|
+
const a = d && c ? vn(d, n) : null;
|
|
1098
|
+
let p = -1, u = null;
|
|
1099
|
+
s && (u = new ResizeObserver((g) => {
|
|
1100
|
+
let [y] = g;
|
|
1101
|
+
y && y.target === d && u && e && (u.unobserve(e), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
|
|
1102
|
+
var v;
|
|
1103
|
+
(v = u) == null || v.observe(e);
|
|
1104
|
+
})), n();
|
|
1105
|
+
}), d && !f && u.observe(d), e && u.observe(e));
|
|
1106
|
+
let m, h = f ? J(t) : null;
|
|
1107
|
+
f && w();
|
|
1108
|
+
function w() {
|
|
1109
|
+
const g = J(t);
|
|
1110
|
+
h && !fe(h, g) && n(), h = g, m = requestAnimationFrame(w);
|
|
1111
|
+
}
|
|
1112
|
+
return n(), () => {
|
|
1113
|
+
var g;
|
|
1114
|
+
l.forEach((y) => {
|
|
1115
|
+
r && y.removeEventListener("scroll", n), i && y.removeEventListener("resize", n);
|
|
1116
|
+
}), a == null || a(), (g = u) == null || g.disconnect(), u = null, f && cancelAnimationFrame(m);
|
|
1117
|
+
};
|
|
1118
|
+
}
|
|
1119
|
+
const An = Ge, Rn = Je, On = Ue, Cn = tn, Pn = Ke, Jt = qe, Sn = Qe, En = (t, e, n) => {
|
|
1120
|
+
const o = /* @__PURE__ */ new Map(), r = {
|
|
1121
|
+
platform: yn,
|
|
1122
|
+
...n
|
|
1123
|
+
}, i = {
|
|
1124
|
+
...r.platform,
|
|
1125
|
+
_c: o
|
|
1126
|
+
};
|
|
1127
|
+
return je(t, e, {
|
|
1128
|
+
...r,
|
|
1129
|
+
platform: i
|
|
1130
|
+
});
|
|
1131
|
+
};
|
|
1132
|
+
var Dn = typeof document < "u", Ln = function() {
|
|
1133
|
+
}, at = Dn ? Le : Ln;
|
|
1134
|
+
function mt(t, e) {
|
|
1135
|
+
if (t === e)
|
|
1136
|
+
return !0;
|
|
1137
|
+
if (typeof t != typeof e)
|
|
1138
|
+
return !1;
|
|
1139
|
+
if (typeof t == "function" && t.toString() === e.toString())
|
|
1140
|
+
return !0;
|
|
1141
|
+
let n, o, r;
|
|
1142
|
+
if (t && e && typeof t == "object") {
|
|
1143
|
+
if (Array.isArray(t)) {
|
|
1144
|
+
if (n = t.length, n !== e.length) return !1;
|
|
1145
|
+
for (o = n; o-- !== 0; )
|
|
1146
|
+
if (!mt(t[o], e[o]))
|
|
1147
|
+
return !1;
|
|
1148
|
+
return !0;
|
|
1149
|
+
}
|
|
1150
|
+
if (r = Object.keys(t), n = r.length, n !== Object.keys(e).length)
|
|
1151
|
+
return !1;
|
|
1152
|
+
for (o = n; o-- !== 0; )
|
|
1153
|
+
if (!{}.hasOwnProperty.call(e, r[o]))
|
|
1154
|
+
return !1;
|
|
1155
|
+
for (o = n; o-- !== 0; ) {
|
|
1156
|
+
const i = r[o];
|
|
1157
|
+
if (!(i === "_owner" && t.$$typeof) && !mt(t[i], e[i]))
|
|
1158
|
+
return !1;
|
|
1159
|
+
}
|
|
1160
|
+
return !0;
|
|
1161
|
+
}
|
|
1162
|
+
return t !== t && e !== e;
|
|
1163
|
+
}
|
|
1164
|
+
function ue(t) {
|
|
1165
|
+
return typeof window > "u" ? 1 : (t.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1166
|
+
}
|
|
1167
|
+
function Qt(t, e) {
|
|
1168
|
+
const n = ue(t);
|
|
1169
|
+
return Math.round(e * n) / n;
|
|
1170
|
+
}
|
|
1171
|
+
function bt(t) {
|
|
1172
|
+
const e = O.useRef(t);
|
|
1173
|
+
return at(() => {
|
|
1174
|
+
e.current = t;
|
|
1175
|
+
}), e;
|
|
1176
|
+
}
|
|
1177
|
+
function Mn(t) {
|
|
1178
|
+
t === void 0 && (t = {});
|
|
1179
|
+
const {
|
|
1180
|
+
placement: e = "bottom",
|
|
1181
|
+
strategy: n = "absolute",
|
|
1182
|
+
middleware: o = [],
|
|
1183
|
+
platform: r,
|
|
1184
|
+
elements: {
|
|
1185
|
+
reference: i,
|
|
1186
|
+
floating: s
|
|
1187
|
+
} = {},
|
|
1188
|
+
transform: c = !0,
|
|
1189
|
+
whileElementsMounted: f,
|
|
1190
|
+
open: d
|
|
1191
|
+
} = t, [l, a] = O.useState({
|
|
1192
|
+
x: 0,
|
|
1193
|
+
y: 0,
|
|
1194
|
+
strategy: n,
|
|
1195
|
+
placement: e,
|
|
1196
|
+
middlewareData: {},
|
|
1197
|
+
isPositioned: !1
|
|
1198
|
+
}), [p, u] = O.useState(o);
|
|
1199
|
+
mt(p, o) || u(o);
|
|
1200
|
+
const [m, h] = O.useState(null), [w, g] = O.useState(null), y = O.useCallback((A) => {
|
|
1201
|
+
A !== b.current && (b.current = A, h(A));
|
|
1202
|
+
}, []), v = O.useCallback((A) => {
|
|
1203
|
+
A !== C.current && (C.current = A, g(A));
|
|
1204
|
+
}, []), x = i || m, R = s || w, b = O.useRef(null), C = O.useRef(null), M = O.useRef(l), N = f != null, L = bt(f), k = bt(r), $ = bt(d), E = O.useCallback(() => {
|
|
1205
|
+
if (!b.current || !C.current)
|
|
1206
|
+
return;
|
|
1207
|
+
const A = {
|
|
1208
|
+
placement: e,
|
|
1209
|
+
strategy: n,
|
|
1210
|
+
middleware: p
|
|
1211
|
+
};
|
|
1212
|
+
k.current && (A.platform = k.current), En(b.current, C.current, A).then((T) => {
|
|
1213
|
+
const H = {
|
|
1214
|
+
...T,
|
|
1215
|
+
// The floating element's position may be recomputed while it's closed
|
|
1216
|
+
// but still mounted (such as when transitioning out). To ensure
|
|
1217
|
+
// `isPositioned` will be `false` initially on the next open, avoid
|
|
1218
|
+
// setting it to `true` when `open === false` (must be specified).
|
|
1219
|
+
isPositioned: $.current !== !1
|
|
1220
|
+
};
|
|
1221
|
+
P.current && !mt(M.current, H) && (M.current = H, Me.flushSync(() => {
|
|
1222
|
+
a(H);
|
|
1223
|
+
}));
|
|
1224
|
+
});
|
|
1225
|
+
}, [p, e, n, k, $]);
|
|
1226
|
+
at(() => {
|
|
1227
|
+
d === !1 && M.current.isPositioned && (M.current.isPositioned = !1, a((A) => ({
|
|
1228
|
+
...A,
|
|
1229
|
+
isPositioned: !1
|
|
1230
|
+
})));
|
|
1231
|
+
}, [d]);
|
|
1232
|
+
const P = O.useRef(!1);
|
|
1233
|
+
at(() => (P.current = !0, () => {
|
|
1234
|
+
P.current = !1;
|
|
1235
|
+
}), []), at(() => {
|
|
1236
|
+
if (x && (b.current = x), R && (C.current = R), x && R) {
|
|
1237
|
+
if (L.current)
|
|
1238
|
+
return L.current(x, R, E);
|
|
1239
|
+
E();
|
|
1240
|
+
}
|
|
1241
|
+
}, [x, R, E, L, N]);
|
|
1242
|
+
const F = O.useMemo(() => ({
|
|
1243
|
+
reference: b,
|
|
1244
|
+
floating: C,
|
|
1245
|
+
setReference: y,
|
|
1246
|
+
setFloating: v
|
|
1247
|
+
}), [y, v]), S = O.useMemo(() => ({
|
|
1248
|
+
reference: x,
|
|
1249
|
+
floating: R
|
|
1250
|
+
}), [x, R]), D = O.useMemo(() => {
|
|
1251
|
+
const A = {
|
|
1252
|
+
position: n,
|
|
1253
|
+
left: 0,
|
|
1254
|
+
top: 0
|
|
1255
|
+
};
|
|
1256
|
+
if (!S.floating)
|
|
1257
|
+
return A;
|
|
1258
|
+
const T = Qt(S.floating, l.x), H = Qt(S.floating, l.y);
|
|
1259
|
+
return c ? {
|
|
1260
|
+
...A,
|
|
1261
|
+
transform: "translate(" + T + "px, " + H + "px)",
|
|
1262
|
+
...ue(S.floating) >= 1.5 && {
|
|
1263
|
+
willChange: "transform"
|
|
1264
|
+
}
|
|
1265
|
+
} : {
|
|
1266
|
+
position: n,
|
|
1267
|
+
left: T,
|
|
1268
|
+
top: H
|
|
1269
|
+
};
|
|
1270
|
+
}, [n, c, S.floating, l.x, l.y]);
|
|
1271
|
+
return O.useMemo(() => ({
|
|
1272
|
+
...l,
|
|
1273
|
+
update: E,
|
|
1274
|
+
refs: F,
|
|
1275
|
+
elements: S,
|
|
1276
|
+
floatingStyles: D
|
|
1277
|
+
}), [l, E, F, S, D]);
|
|
1278
|
+
}
|
|
1279
|
+
const Tn = (t) => {
|
|
1280
|
+
function e(n) {
|
|
1281
|
+
return {}.hasOwnProperty.call(n, "current");
|
|
1282
|
+
}
|
|
1283
|
+
return {
|
|
1284
|
+
name: "arrow",
|
|
1285
|
+
options: t,
|
|
1286
|
+
fn(n) {
|
|
1287
|
+
const {
|
|
1288
|
+
element: o,
|
|
1289
|
+
padding: r
|
|
1290
|
+
} = typeof t == "function" ? t(n) : t;
|
|
1291
|
+
return o && e(o) ? o.current != null ? Jt({
|
|
1292
|
+
element: o.current,
|
|
1293
|
+
padding: r
|
|
1294
|
+
}).fn(n) : {} : o ? Jt({
|
|
1295
|
+
element: o,
|
|
1296
|
+
padding: r
|
|
1297
|
+
}).fn(n) : {};
|
|
1298
|
+
}
|
|
1299
|
+
};
|
|
1300
|
+
}, $n = (t, e) => {
|
|
1301
|
+
const n = An(t);
|
|
1302
|
+
return {
|
|
1303
|
+
name: n.name,
|
|
1304
|
+
fn: n.fn,
|
|
1305
|
+
options: [t, e]
|
|
1306
|
+
};
|
|
1307
|
+
}, kn = (t, e) => {
|
|
1308
|
+
const n = Rn(t);
|
|
1309
|
+
return {
|
|
1310
|
+
name: n.name,
|
|
1311
|
+
fn: n.fn,
|
|
1312
|
+
options: [t, e]
|
|
1313
|
+
};
|
|
1314
|
+
}, Nn = (t, e) => ({
|
|
1315
|
+
fn: Sn(t).fn,
|
|
1316
|
+
options: [t, e]
|
|
1317
|
+
}), Fn = (t, e) => {
|
|
1318
|
+
const n = On(t);
|
|
1319
|
+
return {
|
|
1320
|
+
name: n.name,
|
|
1321
|
+
fn: n.fn,
|
|
1322
|
+
options: [t, e]
|
|
1323
|
+
};
|
|
1324
|
+
}, Wn = (t, e) => {
|
|
1325
|
+
const n = Cn(t);
|
|
1326
|
+
return {
|
|
1327
|
+
name: n.name,
|
|
1328
|
+
fn: n.fn,
|
|
1329
|
+
options: [t, e]
|
|
1330
|
+
};
|
|
1331
|
+
}, _n = (t, e) => {
|
|
1332
|
+
const n = Pn(t);
|
|
1333
|
+
return {
|
|
1334
|
+
name: n.name,
|
|
1335
|
+
fn: n.fn,
|
|
1336
|
+
options: [t, e]
|
|
1337
|
+
};
|
|
1338
|
+
}, Hn = (t, e) => {
|
|
1339
|
+
const n = Tn(t);
|
|
1340
|
+
return {
|
|
1341
|
+
name: n.name,
|
|
1342
|
+
fn: n.fn,
|
|
1343
|
+
options: [t, e]
|
|
1344
|
+
};
|
|
1345
|
+
};
|
|
1346
|
+
var Bn = "Arrow", de = O.forwardRef((t, e) => {
|
|
1347
|
+
const { children: n, width: o = 10, height: r = 5, ...i } = t;
|
|
1348
|
+
return /* @__PURE__ */ Y(
|
|
1349
|
+
Ct.svg,
|
|
1350
|
+
{
|
|
1351
|
+
...i,
|
|
1352
|
+
ref: e,
|
|
1353
|
+
width: o,
|
|
1354
|
+
height: r,
|
|
1355
|
+
viewBox: "0 0 30 10",
|
|
1356
|
+
preserveAspectRatio: "none",
|
|
1357
|
+
children: t.asChild ? n : /* @__PURE__ */ Y("polygon", { points: "0,0 30,0 15,10" })
|
|
1358
|
+
}
|
|
1359
|
+
);
|
|
1360
|
+
});
|
|
1361
|
+
de.displayName = Bn;
|
|
1362
|
+
var Vn = de, Tt = "Popper", [me, Qn] = Te(Tt), [zn, pe] = me(Tt), he = (t) => {
|
|
1363
|
+
const { __scopePopper: e, children: n } = t, [o, r] = O.useState(null), [i, s] = O.useState(void 0);
|
|
1364
|
+
return /* @__PURE__ */ Y(
|
|
1365
|
+
zn,
|
|
1366
|
+
{
|
|
1367
|
+
scope: e,
|
|
1368
|
+
anchor: o,
|
|
1369
|
+
onAnchorChange: r,
|
|
1370
|
+
placementState: i,
|
|
1371
|
+
setPlacementState: s,
|
|
1372
|
+
children: n
|
|
1373
|
+
}
|
|
1374
|
+
);
|
|
1375
|
+
};
|
|
1376
|
+
he.displayName = Tt;
|
|
1377
|
+
var ge = "PopperAnchor", we = O.forwardRef(
|
|
1378
|
+
(t, e) => {
|
|
1379
|
+
const { __scopePopper: n, virtualRef: o, ...r } = t, i = pe(ge, n), s = O.useRef(null), c = i.onAnchorChange, f = O.useCallback(
|
|
1380
|
+
(m) => {
|
|
1381
|
+
s.current = m, m && c(m);
|
|
1382
|
+
},
|
|
1383
|
+
[c]
|
|
1384
|
+
), d = te(e, f), l = O.useRef(null);
|
|
1385
|
+
O.useEffect(() => {
|
|
1386
|
+
if (!o)
|
|
1387
|
+
return;
|
|
1388
|
+
const m = l.current;
|
|
1389
|
+
l.current = o.current, m !== l.current && c(l.current);
|
|
1390
|
+
});
|
|
1391
|
+
const a = i.placementState && kt(i.placementState), p = a == null ? void 0 : a[0], u = a == null ? void 0 : a[1];
|
|
1392
|
+
return o ? null : /* @__PURE__ */ Y(
|
|
1393
|
+
Ct.div,
|
|
1394
|
+
{
|
|
1395
|
+
"data-radix-popper-side": p,
|
|
1396
|
+
"data-radix-popper-align": u,
|
|
1397
|
+
...r,
|
|
1398
|
+
ref: d
|
|
1399
|
+
}
|
|
1400
|
+
);
|
|
1401
|
+
}
|
|
1402
|
+
);
|
|
1403
|
+
we.displayName = ge;
|
|
1404
|
+
var $t = "PopperContent", [In, Xn] = me($t), xe = O.forwardRef(
|
|
1405
|
+
(t, e) => {
|
|
1406
|
+
var Ft, Wt, _t, Ht, Bt, Vt;
|
|
1407
|
+
const {
|
|
1408
|
+
__scopePopper: n,
|
|
1409
|
+
side: o = "bottom",
|
|
1410
|
+
sideOffset: r = 0,
|
|
1411
|
+
align: i = "center",
|
|
1412
|
+
alignOffset: s = 0,
|
|
1413
|
+
arrowPadding: c = 0,
|
|
1414
|
+
avoidCollisions: f = !0,
|
|
1415
|
+
collisionBoundary: d = [],
|
|
1416
|
+
collisionPadding: l = 0,
|
|
1417
|
+
sticky: a = "partial",
|
|
1418
|
+
hideWhenDetached: p = !1,
|
|
1419
|
+
updatePositionStrategy: u = "optimized",
|
|
1420
|
+
onPlaced: m,
|
|
1421
|
+
...h
|
|
1422
|
+
} = t, w = pe($t, n), [g, y] = O.useState(null), v = te(e, (ot) => y(ot)), [x, R] = O.useState(null), b = ke(x), C = (b == null ? void 0 : b.width) ?? 0, M = (b == null ? void 0 : b.height) ?? 0, N = o + (i !== "center" ? "-" + i : ""), L = typeof l == "number" ? l : { top: 0, right: 0, bottom: 0, left: 0, ...l }, k = Array.isArray(d) ? d : [d], $ = k.length > 0, E = {
|
|
1423
|
+
padding: L,
|
|
1424
|
+
boundary: k.filter(jn),
|
|
1425
|
+
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
1426
|
+
altBoundary: $
|
|
1427
|
+
}, { refs: P, floatingStyles: F, placement: S, isPositioned: D, middlewareData: A } = Mn({
|
|
1428
|
+
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
1429
|
+
strategy: "fixed",
|
|
1430
|
+
placement: N,
|
|
1431
|
+
whileElementsMounted: (...ot) => bn(...ot, {
|
|
1432
|
+
animationFrame: u === "always"
|
|
1433
|
+
}),
|
|
1434
|
+
elements: {
|
|
1435
|
+
reference: w.anchor
|
|
1436
|
+
},
|
|
1437
|
+
middleware: [
|
|
1438
|
+
$n({ mainAxis: r + M, alignmentAxis: s }),
|
|
1439
|
+
f && kn({
|
|
1440
|
+
mainAxis: !0,
|
|
1441
|
+
crossAxis: !1,
|
|
1442
|
+
limiter: a === "partial" ? Nn() : void 0,
|
|
1443
|
+
...E
|
|
1444
|
+
}),
|
|
1445
|
+
f && Fn({ ...E }),
|
|
1446
|
+
Wn({
|
|
1447
|
+
...E,
|
|
1448
|
+
apply: ({ elements: ot, rects: zt, availableWidth: Pe, availableHeight: Se }) => {
|
|
1449
|
+
const { width: Ee, height: De } = zt.reference, ct = ot.floating.style;
|
|
1450
|
+
ct.setProperty("--radix-popper-available-width", `${Pe}px`), ct.setProperty("--radix-popper-available-height", `${Se}px`), ct.setProperty("--radix-popper-anchor-width", `${Ee}px`), ct.setProperty("--radix-popper-anchor-height", `${De}px`);
|
|
1451
|
+
}
|
|
1452
|
+
}),
|
|
1453
|
+
x && Hn({ element: x, padding: c }),
|
|
1454
|
+
qn({ arrowWidth: C, arrowHeight: M }),
|
|
1455
|
+
p && _n({
|
|
1456
|
+
strategy: "referenceHidden",
|
|
1457
|
+
...E,
|
|
1458
|
+
// `hide` detects whether the anchor (reference) is clipped, so when
|
|
1459
|
+
// no explicit `collisionBoundary` is set we fall back to Floating
|
|
1460
|
+
// UI's default clipping ancestors (e.g. a scrollable menu). This
|
|
1461
|
+
// lets an occluded submenu hide once its anchor scrolls out of view
|
|
1462
|
+
// (#3237). The collision/size middlewares deliberately keep the
|
|
1463
|
+
// viewport-based default to avoid clamping content rendered inside
|
|
1464
|
+
// transformed or overflow-clipping portal containers.
|
|
1465
|
+
boundary: $ ? E.boundary : void 0
|
|
1466
|
+
})
|
|
1467
|
+
]
|
|
1468
|
+
}), T = w.setPlacementState;
|
|
1469
|
+
xt(() => (T(S), () => {
|
|
1470
|
+
T(void 0);
|
|
1471
|
+
}), [S, T]);
|
|
1472
|
+
const [H, Nt] = kt(S), st = $e(m);
|
|
1473
|
+
xt(() => {
|
|
1474
|
+
D && (st == null || st());
|
|
1475
|
+
}, [D, st]);
|
|
1476
|
+
const be = (Ft = A.arrow) == null ? void 0 : Ft.x, Ae = (Wt = A.arrow) == null ? void 0 : Wt.y, Re = ((_t = A.arrow) == null ? void 0 : _t.centerOffset) !== 0, [Oe, Ce] = O.useState();
|
|
1477
|
+
return xt(() => {
|
|
1478
|
+
g && Ce(window.getComputedStyle(g).zIndex);
|
|
1479
|
+
}, [g]), /* @__PURE__ */ Y(
|
|
1480
|
+
"div",
|
|
1481
|
+
{
|
|
1482
|
+
ref: P.setFloating,
|
|
1483
|
+
"data-radix-popper-content-wrapper": "",
|
|
1484
|
+
style: {
|
|
1485
|
+
...F,
|
|
1486
|
+
transform: D ? F.transform : "translate(0, -200%)",
|
|
1487
|
+
// keep off the page when measuring
|
|
1488
|
+
minWidth: "max-content",
|
|
1489
|
+
zIndex: Oe,
|
|
1490
|
+
"--radix-popper-transform-origin": [
|
|
1491
|
+
(Ht = A.transformOrigin) == null ? void 0 : Ht.x,
|
|
1492
|
+
(Bt = A.transformOrigin) == null ? void 0 : Bt.y
|
|
1493
|
+
].join(" "),
|
|
1494
|
+
// hide the content if using the hide middleware and should be hidden
|
|
1495
|
+
// set visibility to hidden and disable pointer events so the UI behaves
|
|
1496
|
+
// as if the PopperContent isn't there at all
|
|
1497
|
+
...((Vt = A.hide) == null ? void 0 : Vt.referenceHidden) && {
|
|
1498
|
+
visibility: "hidden",
|
|
1499
|
+
pointerEvents: "none"
|
|
1500
|
+
}
|
|
1501
|
+
},
|
|
1502
|
+
dir: t.dir,
|
|
1503
|
+
children: /* @__PURE__ */ Y(
|
|
1504
|
+
In,
|
|
1505
|
+
{
|
|
1506
|
+
scope: n,
|
|
1507
|
+
placedSide: H,
|
|
1508
|
+
placedAlign: Nt,
|
|
1509
|
+
onArrowChange: R,
|
|
1510
|
+
arrowX: be,
|
|
1511
|
+
arrowY: Ae,
|
|
1512
|
+
shouldHideArrow: Re,
|
|
1513
|
+
children: /* @__PURE__ */ Y(
|
|
1514
|
+
Ct.div,
|
|
1515
|
+
{
|
|
1516
|
+
"data-side": H,
|
|
1517
|
+
"data-align": Nt,
|
|
1518
|
+
...h,
|
|
1519
|
+
ref: v,
|
|
1520
|
+
style: {
|
|
1521
|
+
...h.style,
|
|
1522
|
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
1523
|
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
1524
|
+
animation: D ? void 0 : "none"
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
)
|
|
1528
|
+
}
|
|
1529
|
+
)
|
|
1530
|
+
}
|
|
1531
|
+
);
|
|
1532
|
+
}
|
|
1533
|
+
);
|
|
1534
|
+
xe.displayName = $t;
|
|
1535
|
+
var ye = "PopperArrow", Yn = {
|
|
1536
|
+
top: "bottom",
|
|
1537
|
+
right: "left",
|
|
1538
|
+
bottom: "top",
|
|
1539
|
+
left: "right"
|
|
1540
|
+
}, ve = O.forwardRef(function(e, n) {
|
|
1541
|
+
const { __scopePopper: o, ...r } = e, i = Xn(ye, o), s = Yn[i.placedSide];
|
|
1542
|
+
return (
|
|
1543
|
+
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
1544
|
+
// doesn't report size as we'd expect on SVG elements.
|
|
1545
|
+
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
1546
|
+
/* @__PURE__ */ Y(
|
|
1547
|
+
"span",
|
|
1548
|
+
{
|
|
1549
|
+
ref: i.onArrowChange,
|
|
1550
|
+
style: {
|
|
1551
|
+
position: "absolute",
|
|
1552
|
+
left: i.arrowX,
|
|
1553
|
+
top: i.arrowY,
|
|
1554
|
+
[s]: 0,
|
|
1555
|
+
transformOrigin: {
|
|
1556
|
+
top: "",
|
|
1557
|
+
right: "0 0",
|
|
1558
|
+
bottom: "center 0",
|
|
1559
|
+
left: "100% 0"
|
|
1560
|
+
}[i.placedSide],
|
|
1561
|
+
transform: {
|
|
1562
|
+
top: "translateY(100%)",
|
|
1563
|
+
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
|
1564
|
+
bottom: "rotate(180deg)",
|
|
1565
|
+
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
|
1566
|
+
}[i.placedSide],
|
|
1567
|
+
visibility: i.shouldHideArrow ? "hidden" : void 0
|
|
1568
|
+
},
|
|
1569
|
+
children: /* @__PURE__ */ Y(
|
|
1570
|
+
Vn,
|
|
1571
|
+
{
|
|
1572
|
+
...r,
|
|
1573
|
+
ref: n,
|
|
1574
|
+
style: {
|
|
1575
|
+
...r.style,
|
|
1576
|
+
// ensures the element can be measured correctly (mostly for if SVG)
|
|
1577
|
+
display: "block"
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
)
|
|
1581
|
+
}
|
|
1582
|
+
)
|
|
1583
|
+
);
|
|
1584
|
+
});
|
|
1585
|
+
ve.displayName = ye;
|
|
1586
|
+
function jn(t) {
|
|
1587
|
+
return t !== null;
|
|
1588
|
+
}
|
|
1589
|
+
var qn = (t) => ({
|
|
1590
|
+
name: "transformOrigin",
|
|
1591
|
+
options: t,
|
|
1592
|
+
fn(e) {
|
|
1593
|
+
var w, g, y;
|
|
1594
|
+
const { placement: n, rects: o, middlewareData: r } = e, s = ((w = r.arrow) == null ? void 0 : w.centerOffset) !== 0, c = s ? 0 : t.arrowWidth, f = s ? 0 : t.arrowHeight, [d, l] = kt(n), a = { start: "0%", center: "50%", end: "100%" }[l], p = (((g = r.arrow) == null ? void 0 : g.x) ?? 0) + c / 2, u = (((y = r.arrow) == null ? void 0 : y.y) ?? 0) + f / 2;
|
|
1595
|
+
let m = "", h = "";
|
|
1596
|
+
return d === "bottom" ? (m = s ? a : `${p}px`, h = `${-f}px`) : d === "top" ? (m = s ? a : `${p}px`, h = `${o.floating.height + f}px`) : d === "right" ? (m = `${-f}px`, h = s ? a : `${u}px`) : d === "left" && (m = `${o.floating.width + f}px`, h = s ? a : `${u}px`), { data: { x: m, y: h } };
|
|
1597
|
+
}
|
|
1598
|
+
});
|
|
1599
|
+
function kt(t) {
|
|
1600
|
+
const [e, n = "center"] = t.split("-");
|
|
1601
|
+
return [e, n];
|
|
1602
|
+
}
|
|
1603
|
+
var to = he, eo = we, no = xe, oo = ve;
|
|
1604
|
+
export {
|
|
1605
|
+
eo as A,
|
|
1606
|
+
no as C,
|
|
1607
|
+
to as R,
|
|
1608
|
+
oo as a,
|
|
1609
|
+
Qn as c
|
|
1610
|
+
};
|