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