@pdf-viewer/react 1.9.0-beta.0 → 1.9.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/dist/{Popover-1faa77f6.js → Popover-48c8394c.js} +2 -2
- package/dist/{RPLayout-3ef4e136.js → RPLayout-3042ec91.js} +996 -990
- package/dist/{component-1da194e8.js → component-2aa6e53b.js} +1 -1
- package/dist/components/RPConfig.js +691 -673
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +2 -2
- package/dist/components/layout/LayoutContainer.js +2 -2
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/RPLayout.js +2 -2
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +2 -2
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MenuItem.js +1 -1
- package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +3 -3
- package/dist/components/layout/toolbar/OtherTool.js +2 -2
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/RotateTool.js +1 -1
- package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
- package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +2 -2
- package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
- package/dist/components/layout/toolbar/ToolbarCustom.js +2 -2
- package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +2 -2
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/tools/InputPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/NextPageTool.js +2 -2
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +2 -2
- package/dist/components/page/AnnotationLayer.js +2 -2
- package/dist/components/page/CanvasLayer.js +2 -2
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +2 -2
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +2 -2
- package/dist/components/page/TextLayer.js +2 -2
- package/dist/components/ui/Checkbox.js +228 -116
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/Popover.js +1 -1
- package/dist/components/ui/RPTooltip.js +207 -207
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/{floating-ui.react-dom-15b9b819.js → floating-ui.react-dom-4b1e2e46.js} +394 -380
- package/dist/index-6e0e48fa.js +332 -0
- package/dist/{index-7279fb4e.js → index-951f0f1f.js} +464 -456
- package/dist/index-e3a67935.js +150 -0
- package/dist/main.js +1 -1
- package/dist/types/utils/types.d.ts +9 -4
- package/dist/utils/hooks/useFileDownload.js +2 -2
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +2 -2
- package/dist/utils/hooks/usePresentPage.js +2 -2
- package/dist/utils/hooks/usePrint.js +2 -2
- package/dist/utils/hooks/useScrollToPage.js +2 -2
- package/dist/utils/hooks/useSearch.js +2 -2
- package/dist/utils/hooks/useThumbnail.js +2 -2
- package/dist/utils/hooks/useVirtualReactWindow.js +2 -2
- package/package.json +1 -1
- package/dist/index-1cb41342.js +0 -307
- package/dist/index-aa2d3884.js +0 -140
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { useLayoutEffect as
|
|
3
|
-
import * as
|
|
4
|
-
const
|
|
1
|
+
import * as P from "react";
|
|
2
|
+
import { useLayoutEffect as qt } from "react";
|
|
3
|
+
import * as Xt from "react-dom";
|
|
4
|
+
const Ut = ["top", "right", "bottom", "left"], U = Math.min, F = Math.max, st = Math.round, it = Math.floor, z = (t) => ({
|
|
5
5
|
x: t,
|
|
6
6
|
y: t
|
|
7
|
-
}),
|
|
7
|
+
}), Kt = {
|
|
8
8
|
left: "right",
|
|
9
9
|
right: "left",
|
|
10
10
|
bottom: "top",
|
|
11
11
|
top: "bottom"
|
|
12
|
-
},
|
|
12
|
+
}, Gt = {
|
|
13
13
|
start: "end",
|
|
14
14
|
end: "start"
|
|
15
15
|
};
|
|
16
16
|
function gt(t, e, n) {
|
|
17
|
-
return F(t,
|
|
17
|
+
return F(t, U(e, n));
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Y(t, e) {
|
|
20
20
|
return typeof t == "function" ? t(e) : t;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function q(t) {
|
|
23
23
|
return t.split("-")[0];
|
|
24
24
|
}
|
|
25
25
|
function Z(t) {
|
|
@@ -31,47 +31,48 @@ function xt(t) {
|
|
|
31
31
|
function yt(t) {
|
|
32
32
|
return t === "y" ? "height" : "width";
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
const Jt = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
35
|
+
function _(t) {
|
|
36
|
+
return Jt.has(q(t)) ? "y" : "x";
|
|
36
37
|
}
|
|
37
38
|
function vt(t) {
|
|
38
|
-
return xt(
|
|
39
|
+
return xt(_(t));
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
+
function Qt(t, e, n) {
|
|
41
42
|
n === void 0 && (n = !1);
|
|
42
43
|
const o = Z(t), i = vt(t), r = yt(i);
|
|
43
44
|
let s = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
|
|
44
45
|
return e.reference[r] > e.floating[r] && (s = ct(s)), [s, ct(s)];
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
+
function Zt(t) {
|
|
47
48
|
const e = ct(t);
|
|
48
49
|
return [pt(t), e, pt(e)];
|
|
49
50
|
}
|
|
50
51
|
function pt(t) {
|
|
51
|
-
return t.replace(/start|end/g, (e) =>
|
|
52
|
+
return t.replace(/start|end/g, (e) => Gt[e]);
|
|
52
53
|
}
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
const Ct = ["left", "right"], St = ["right", "left"], te = ["top", "bottom"], ee = ["bottom", "top"];
|
|
55
|
+
function ne(t, e, n) {
|
|
55
56
|
switch (t) {
|
|
56
57
|
case "top":
|
|
57
58
|
case "bottom":
|
|
58
|
-
return n ? e ?
|
|
59
|
+
return n ? e ? St : Ct : e ? Ct : St;
|
|
59
60
|
case "left":
|
|
60
61
|
case "right":
|
|
61
|
-
return e ?
|
|
62
|
+
return e ? te : ee;
|
|
62
63
|
default:
|
|
63
64
|
return [];
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
|
-
function
|
|
67
|
+
function oe(t, e, n, o) {
|
|
67
68
|
const i = Z(t);
|
|
68
|
-
let r =
|
|
69
|
+
let r = ne(q(t), n === "start", o);
|
|
69
70
|
return i && (r = r.map((s) => s + "-" + i), e && (r = r.concat(r.map(pt)))), r;
|
|
70
71
|
}
|
|
71
72
|
function ct(t) {
|
|
72
|
-
return t.replace(/left|right|bottom|top/g, (e) =>
|
|
73
|
+
return t.replace(/left|right|bottom|top/g, (e) => Kt[e]);
|
|
73
74
|
}
|
|
74
|
-
function
|
|
75
|
+
function ie(t) {
|
|
75
76
|
return {
|
|
76
77
|
top: 0,
|
|
77
78
|
right: 0,
|
|
@@ -80,8 +81,8 @@ function Zt(t) {
|
|
|
80
81
|
...t
|
|
81
82
|
};
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
-
return typeof t != "number" ?
|
|
84
|
+
function $t(t) {
|
|
85
|
+
return typeof t != "number" ? ie(t) : {
|
|
85
86
|
top: t,
|
|
86
87
|
right: t,
|
|
87
88
|
bottom: t,
|
|
@@ -106,55 +107,55 @@ function lt(t) {
|
|
|
106
107
|
y: n
|
|
107
108
|
};
|
|
108
109
|
}
|
|
109
|
-
function
|
|
110
|
+
function Et(t, e, n) {
|
|
110
111
|
let {
|
|
111
112
|
reference: o,
|
|
112
113
|
floating: i
|
|
113
114
|
} = t;
|
|
114
|
-
const r =
|
|
115
|
-
let
|
|
115
|
+
const r = _(e), s = vt(e), c = yt(s), f = q(e), l = r === "y", a = o.x + o.width / 2 - i.width / 2, d = o.y + o.height / 2 - i.height / 2, m = o[c] / 2 - i[c] / 2;
|
|
116
|
+
let u;
|
|
116
117
|
switch (f) {
|
|
117
118
|
case "top":
|
|
118
|
-
|
|
119
|
+
u = {
|
|
119
120
|
x: a,
|
|
120
121
|
y: o.y - i.height
|
|
121
122
|
};
|
|
122
123
|
break;
|
|
123
124
|
case "bottom":
|
|
124
|
-
|
|
125
|
+
u = {
|
|
125
126
|
x: a,
|
|
126
127
|
y: o.y + o.height
|
|
127
128
|
};
|
|
128
129
|
break;
|
|
129
130
|
case "right":
|
|
130
|
-
|
|
131
|
+
u = {
|
|
131
132
|
x: o.x + o.width,
|
|
132
|
-
y:
|
|
133
|
+
y: d
|
|
133
134
|
};
|
|
134
135
|
break;
|
|
135
136
|
case "left":
|
|
136
|
-
|
|
137
|
+
u = {
|
|
137
138
|
x: o.x - i.width,
|
|
138
|
-
y:
|
|
139
|
+
y: d
|
|
139
140
|
};
|
|
140
141
|
break;
|
|
141
142
|
default:
|
|
142
|
-
|
|
143
|
+
u = {
|
|
143
144
|
x: o.x,
|
|
144
145
|
y: o.y
|
|
145
146
|
};
|
|
146
147
|
}
|
|
147
148
|
switch (Z(e)) {
|
|
148
149
|
case "start":
|
|
149
|
-
|
|
150
|
+
u[s] -= m * (n && l ? -1 : 1);
|
|
150
151
|
break;
|
|
151
152
|
case "end":
|
|
152
|
-
|
|
153
|
+
u[s] += m * (n && l ? -1 : 1);
|
|
153
154
|
break;
|
|
154
155
|
}
|
|
155
|
-
return
|
|
156
|
+
return u;
|
|
156
157
|
}
|
|
157
|
-
const
|
|
158
|
+
const re = async (t, e, n) => {
|
|
158
159
|
const {
|
|
159
160
|
placement: o = "bottom",
|
|
160
161
|
strategy: i = "absolute",
|
|
@@ -167,24 +168,24 @@ const te = async (t, e, n) => {
|
|
|
167
168
|
strategy: i
|
|
168
169
|
}), {
|
|
169
170
|
x: a,
|
|
170
|
-
y:
|
|
171
|
-
} =
|
|
171
|
+
y: d
|
|
172
|
+
} = Et(l, o, f), m = o, u = {}, h = 0;
|
|
172
173
|
for (let g = 0; g < c.length; g++) {
|
|
173
174
|
const {
|
|
174
175
|
name: p,
|
|
175
176
|
fn: w
|
|
176
177
|
} = c[g], {
|
|
177
|
-
x
|
|
178
|
-
y,
|
|
178
|
+
x,
|
|
179
|
+
y: v,
|
|
179
180
|
data: b,
|
|
180
|
-
reset:
|
|
181
|
+
reset: y
|
|
181
182
|
} = await w({
|
|
182
183
|
x: a,
|
|
183
|
-
y:
|
|
184
|
+
y: d,
|
|
184
185
|
initialPlacement: o,
|
|
185
186
|
placement: m,
|
|
186
187
|
strategy: i,
|
|
187
|
-
middlewareData:
|
|
188
|
+
middlewareData: u,
|
|
188
189
|
rects: l,
|
|
189
190
|
platform: s,
|
|
190
191
|
elements: {
|
|
@@ -192,27 +193,27 @@ const te = async (t, e, n) => {
|
|
|
192
193
|
floating: e
|
|
193
194
|
}
|
|
194
195
|
});
|
|
195
|
-
a =
|
|
196
|
-
...
|
|
196
|
+
a = x ?? a, d = v ?? d, u = {
|
|
197
|
+
...u,
|
|
197
198
|
[p]: {
|
|
198
|
-
...
|
|
199
|
+
...u[p],
|
|
199
200
|
...b
|
|
200
201
|
}
|
|
201
|
-
},
|
|
202
|
+
}, y && h <= 50 && (h++, typeof y == "object" && (y.placement && (m = y.placement), y.rects && (l = y.rects === !0 ? await s.getElementRects({
|
|
202
203
|
reference: t,
|
|
203
204
|
floating: e,
|
|
204
205
|
strategy: i
|
|
205
|
-
}) :
|
|
206
|
+
}) : y.rects), {
|
|
206
207
|
x: a,
|
|
207
|
-
y:
|
|
208
|
-
} =
|
|
208
|
+
y: d
|
|
209
|
+
} = Et(l, m, f)), g = -1);
|
|
209
210
|
}
|
|
210
211
|
return {
|
|
211
212
|
x: a,
|
|
212
|
-
y:
|
|
213
|
+
y: d,
|
|
213
214
|
placement: m,
|
|
214
215
|
strategy: i,
|
|
215
|
-
middlewareData:
|
|
216
|
+
middlewareData: u
|
|
216
217
|
};
|
|
217
218
|
};
|
|
218
219
|
async function et(t, e) {
|
|
@@ -228,39 +229,39 @@ async function et(t, e) {
|
|
|
228
229
|
} = t, {
|
|
229
230
|
boundary: l = "clippingAncestors",
|
|
230
231
|
rootBoundary: a = "viewport",
|
|
231
|
-
elementContext:
|
|
232
|
+
elementContext: d = "floating",
|
|
232
233
|
altBoundary: m = !1,
|
|
233
|
-
padding:
|
|
234
|
-
} =
|
|
234
|
+
padding: u = 0
|
|
235
|
+
} = Y(e, t), h = $t(u), p = c[m ? d === "floating" ? "reference" : "floating" : d], w = lt(await r.getClippingRect({
|
|
235
236
|
element: (n = await (r.isElement == null ? void 0 : r.isElement(p))) == null || n ? p : p.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(c.floating)),
|
|
236
237
|
boundary: l,
|
|
237
238
|
rootBoundary: a,
|
|
238
239
|
strategy: f
|
|
239
|
-
})),
|
|
240
|
+
})), x = d === "floating" ? {
|
|
240
241
|
x: o,
|
|
241
242
|
y: i,
|
|
242
243
|
width: s.floating.width,
|
|
243
244
|
height: s.floating.height
|
|
244
|
-
} : s.reference,
|
|
245
|
+
} : s.reference, v = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c.floating)), b = await (r.isElement == null ? void 0 : r.isElement(v)) ? await (r.getScale == null ? void 0 : r.getScale(v)) || {
|
|
245
246
|
x: 1,
|
|
246
247
|
y: 1
|
|
247
248
|
} : {
|
|
248
249
|
x: 1,
|
|
249
250
|
y: 1
|
|
250
|
-
},
|
|
251
|
+
}, y = lt(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
251
252
|
elements: c,
|
|
252
|
-
rect:
|
|
253
|
-
offsetParent:
|
|
253
|
+
rect: x,
|
|
254
|
+
offsetParent: v,
|
|
254
255
|
strategy: f
|
|
255
|
-
}) :
|
|
256
|
+
}) : x);
|
|
256
257
|
return {
|
|
257
|
-
top: (w.top -
|
|
258
|
-
bottom: (
|
|
259
|
-
left: (w.left -
|
|
260
|
-
right: (
|
|
258
|
+
top: (w.top - y.top + h.top) / b.y,
|
|
259
|
+
bottom: (y.bottom - w.bottom + h.bottom) / b.y,
|
|
260
|
+
left: (w.left - y.left + h.left) / b.x,
|
|
261
|
+
right: (y.right - w.right + h.right) / b.x
|
|
261
262
|
};
|
|
262
263
|
}
|
|
263
|
-
const
|
|
264
|
+
const se = (t) => ({
|
|
264
265
|
name: "arrow",
|
|
265
266
|
options: t,
|
|
266
267
|
async fn(e) {
|
|
@@ -275,29 +276,29 @@ const ee = (t) => ({
|
|
|
275
276
|
} = e, {
|
|
276
277
|
element: l,
|
|
277
278
|
padding: a = 0
|
|
278
|
-
} =
|
|
279
|
+
} = Y(t, e) || {};
|
|
279
280
|
if (l == null)
|
|
280
281
|
return {};
|
|
281
|
-
const
|
|
282
|
+
const d = $t(a), m = {
|
|
282
283
|
x: n,
|
|
283
284
|
y: o
|
|
284
|
-
},
|
|
285
|
-
let R = O ? O[
|
|
286
|
-
(!R || !await (s.isElement == null ? void 0 : s.isElement(O))) && (R = c.floating[
|
|
287
|
-
const L = b / 2 -
|
|
285
|
+
}, u = vt(i), h = yt(u), g = await s.getDimensions(l), p = u === "y", w = p ? "top" : "left", x = p ? "bottom" : "right", v = p ? "clientHeight" : "clientWidth", b = r.reference[h] + r.reference[u] - m[u] - r.floating[h], y = m[u] - r.reference[u], O = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l));
|
|
286
|
+
let R = O ? O[v] : 0;
|
|
287
|
+
(!R || !await (s.isElement == null ? void 0 : s.isElement(O))) && (R = c.floating[v] || r.floating[h]);
|
|
288
|
+
const L = b / 2 - y / 2, W = R / 2 - g[h] / 2 - 1, E = U(d[w], W), B = U(d[x], W), M = E, D = R - g[h] - B, C = R / 2 - g[h] / 2 + L, N = gt(M, C, D), S = !f.arrow && Z(i) != null && C !== N && r.reference[h] / 2 - (C < M ? E : B) - g[h] / 2 < 0, T = S ? C < M ? C - M : C - D : 0;
|
|
288
289
|
return {
|
|
289
|
-
[
|
|
290
|
+
[u]: m[u] + T,
|
|
290
291
|
data: {
|
|
291
|
-
[
|
|
292
|
-
centerOffset: C -
|
|
293
|
-
...
|
|
294
|
-
alignmentOffset:
|
|
292
|
+
[u]: N,
|
|
293
|
+
centerOffset: C - N - T,
|
|
294
|
+
...S && {
|
|
295
|
+
alignmentOffset: T
|
|
295
296
|
}
|
|
296
297
|
},
|
|
297
|
-
reset:
|
|
298
|
+
reset: S
|
|
298
299
|
};
|
|
299
300
|
}
|
|
300
|
-
}),
|
|
301
|
+
}), ce = function(t) {
|
|
301
302
|
return t === void 0 && (t = {}), {
|
|
302
303
|
name: "flip",
|
|
303
304
|
options: t,
|
|
@@ -312,64 +313,66 @@ const ee = (t) => ({
|
|
|
312
313
|
elements: l
|
|
313
314
|
} = e, {
|
|
314
315
|
mainAxis: a = !0,
|
|
315
|
-
crossAxis:
|
|
316
|
+
crossAxis: d = !0,
|
|
316
317
|
fallbackPlacements: m,
|
|
317
|
-
fallbackStrategy:
|
|
318
|
+
fallbackStrategy: u = "bestFit",
|
|
318
319
|
fallbackAxisSideDirection: h = "none",
|
|
319
320
|
flipAlignment: g = !0,
|
|
320
321
|
...p
|
|
321
|
-
} =
|
|
322
|
+
} = Y(t, e);
|
|
322
323
|
if ((n = r.arrow) != null && n.alignmentOffset)
|
|
323
324
|
return {};
|
|
324
|
-
const w =
|
|
325
|
-
!m && O &&
|
|
326
|
-
const R = [c, ...
|
|
327
|
-
let
|
|
328
|
-
if (a && W.push(L[w]),
|
|
329
|
-
const C =
|
|
325
|
+
const w = q(i), x = _(c), v = q(c) === c, b = await (f.isRTL == null ? void 0 : f.isRTL(l.floating)), y = m || (v || !g ? [ct(c)] : Zt(c)), O = h !== "none";
|
|
326
|
+
!m && O && y.push(...oe(c, g, h, b));
|
|
327
|
+
const R = [c, ...y], L = await et(e, p), W = [];
|
|
328
|
+
let E = ((o = r.flip) == null ? void 0 : o.overflows) || [];
|
|
329
|
+
if (a && W.push(L[w]), d) {
|
|
330
|
+
const C = Qt(i, s, b);
|
|
330
331
|
W.push(L[C[0]], L[C[1]]);
|
|
331
332
|
}
|
|
332
|
-
if (
|
|
333
|
+
if (E = [...E, {
|
|
333
334
|
placement: i,
|
|
334
335
|
overflows: W
|
|
335
336
|
}], !W.every((C) => C <= 0)) {
|
|
336
|
-
var B,
|
|
337
|
-
const C = (((B = r.flip) == null ? void 0 : B.index) || 0) + 1,
|
|
338
|
-
if (
|
|
337
|
+
var B, M;
|
|
338
|
+
const C = (((B = r.flip) == null ? void 0 : B.index) || 0) + 1, N = R[C];
|
|
339
|
+
if (N && (!(d === "alignment" ? x !== _(N) : !1) || // We leave the current main axis only if every placement on that axis
|
|
340
|
+
// overflows the main axis.
|
|
341
|
+
E.every((A) => A.overflows[0] > 0 && _(A.placement) === x)))
|
|
339
342
|
return {
|
|
340
343
|
data: {
|
|
341
344
|
index: C,
|
|
342
|
-
overflows:
|
|
345
|
+
overflows: E
|
|
343
346
|
},
|
|
344
347
|
reset: {
|
|
345
|
-
placement:
|
|
348
|
+
placement: N
|
|
346
349
|
}
|
|
347
350
|
};
|
|
348
|
-
let
|
|
349
|
-
if (!
|
|
350
|
-
switch (
|
|
351
|
+
let S = (M = E.filter((T) => T.overflows[0] <= 0).sort((T, A) => T.overflows[1] - A.overflows[1])[0]) == null ? void 0 : M.placement;
|
|
352
|
+
if (!S)
|
|
353
|
+
switch (u) {
|
|
351
354
|
case "bestFit": {
|
|
352
|
-
var
|
|
353
|
-
const
|
|
355
|
+
var D;
|
|
356
|
+
const T = (D = E.filter((A) => {
|
|
354
357
|
if (O) {
|
|
355
|
-
const k =
|
|
356
|
-
return k ===
|
|
358
|
+
const k = _(A.placement);
|
|
359
|
+
return k === x || // Create a bias to the `y` side axis due to horizontal
|
|
357
360
|
// reading directions favoring greater width.
|
|
358
361
|
k === "y";
|
|
359
362
|
}
|
|
360
363
|
return !0;
|
|
361
|
-
}).map((A) => [A.placement, A.overflows.filter((k) => k > 0).reduce((k,
|
|
362
|
-
|
|
364
|
+
}).map((A) => [A.placement, A.overflows.filter((k) => k > 0).reduce((k, X) => k + X, 0)]).sort((A, k) => A[1] - k[1])[0]) == null ? void 0 : D[0];
|
|
365
|
+
T && (S = T);
|
|
363
366
|
break;
|
|
364
367
|
}
|
|
365
368
|
case "initialPlacement":
|
|
366
|
-
|
|
369
|
+
S = c;
|
|
367
370
|
break;
|
|
368
371
|
}
|
|
369
|
-
if (i !==
|
|
372
|
+
if (i !== S)
|
|
370
373
|
return {
|
|
371
374
|
reset: {
|
|
372
|
-
placement:
|
|
375
|
+
placement: S
|
|
373
376
|
}
|
|
374
377
|
};
|
|
375
378
|
}
|
|
@@ -377,7 +380,7 @@ const ee = (t) => ({
|
|
|
377
380
|
}
|
|
378
381
|
};
|
|
379
382
|
};
|
|
380
|
-
function
|
|
383
|
+
function Pt(t, e) {
|
|
381
384
|
return {
|
|
382
385
|
top: t.top - e.height,
|
|
383
386
|
right: t.right - e.width,
|
|
@@ -385,10 +388,10 @@ function Et(t, e) {
|
|
|
385
388
|
left: t.left - e.width
|
|
386
389
|
};
|
|
387
390
|
}
|
|
388
|
-
function
|
|
389
|
-
return
|
|
391
|
+
function Lt(t) {
|
|
392
|
+
return Ut.some((e) => t[e] >= 0);
|
|
390
393
|
}
|
|
391
|
-
const
|
|
394
|
+
const le = function(t) {
|
|
392
395
|
return t === void 0 && (t = {}), {
|
|
393
396
|
name: "hide",
|
|
394
397
|
options: t,
|
|
@@ -398,17 +401,17 @@ const oe = function(t) {
|
|
|
398
401
|
} = e, {
|
|
399
402
|
strategy: o = "referenceHidden",
|
|
400
403
|
...i
|
|
401
|
-
} =
|
|
404
|
+
} = Y(t, e);
|
|
402
405
|
switch (o) {
|
|
403
406
|
case "referenceHidden": {
|
|
404
407
|
const r = await et(e, {
|
|
405
408
|
...i,
|
|
406
409
|
elementContext: "reference"
|
|
407
|
-
}), s =
|
|
410
|
+
}), s = Pt(r, n.reference);
|
|
408
411
|
return {
|
|
409
412
|
data: {
|
|
410
413
|
referenceHiddenOffsets: s,
|
|
411
|
-
referenceHidden:
|
|
414
|
+
referenceHidden: Lt(s)
|
|
412
415
|
}
|
|
413
416
|
};
|
|
414
417
|
}
|
|
@@ -416,11 +419,11 @@ const oe = function(t) {
|
|
|
416
419
|
const r = await et(e, {
|
|
417
420
|
...i,
|
|
418
421
|
altBoundary: !0
|
|
419
|
-
}), s =
|
|
422
|
+
}), s = Pt(r, n.floating);
|
|
420
423
|
return {
|
|
421
424
|
data: {
|
|
422
425
|
escapedOffsets: s,
|
|
423
|
-
escaped:
|
|
426
|
+
escaped: Lt(s)
|
|
424
427
|
}
|
|
425
428
|
};
|
|
426
429
|
}
|
|
@@ -429,35 +432,35 @@ const oe = function(t) {
|
|
|
429
432
|
}
|
|
430
433
|
}
|
|
431
434
|
};
|
|
432
|
-
};
|
|
433
|
-
async function
|
|
435
|
+
}, Wt = /* @__PURE__ */ new Set(["left", "top"]);
|
|
436
|
+
async function fe(t, e) {
|
|
434
437
|
const {
|
|
435
438
|
placement: n,
|
|
436
439
|
platform: o,
|
|
437
440
|
elements: i
|
|
438
|
-
} = t, r = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), s =
|
|
441
|
+
} = t, r = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), s = q(n), c = Z(n), f = _(n) === "y", l = Wt.has(s) ? -1 : 1, a = r && f ? -1 : 1, d = Y(e, t);
|
|
439
442
|
let {
|
|
440
443
|
mainAxis: m,
|
|
441
|
-
crossAxis:
|
|
444
|
+
crossAxis: u,
|
|
442
445
|
alignmentAxis: h
|
|
443
|
-
} = typeof
|
|
444
|
-
mainAxis:
|
|
446
|
+
} = typeof d == "number" ? {
|
|
447
|
+
mainAxis: d,
|
|
445
448
|
crossAxis: 0,
|
|
446
449
|
alignmentAxis: null
|
|
447
450
|
} : {
|
|
448
|
-
mainAxis:
|
|
449
|
-
crossAxis:
|
|
450
|
-
alignmentAxis:
|
|
451
|
+
mainAxis: d.mainAxis || 0,
|
|
452
|
+
crossAxis: d.crossAxis || 0,
|
|
453
|
+
alignmentAxis: d.alignmentAxis
|
|
451
454
|
};
|
|
452
|
-
return c && typeof h == "number" && (
|
|
453
|
-
x:
|
|
455
|
+
return c && typeof h == "number" && (u = c === "end" ? h * -1 : h), f ? {
|
|
456
|
+
x: u * a,
|
|
454
457
|
y: m * l
|
|
455
458
|
} : {
|
|
456
459
|
x: m * l,
|
|
457
|
-
y:
|
|
460
|
+
y: u * a
|
|
458
461
|
};
|
|
459
462
|
}
|
|
460
|
-
const
|
|
463
|
+
const ae = function(t) {
|
|
461
464
|
return t === void 0 && (t = 0), {
|
|
462
465
|
name: "offset",
|
|
463
466
|
options: t,
|
|
@@ -468,7 +471,7 @@ const re = function(t) {
|
|
|
468
471
|
y: r,
|
|
469
472
|
placement: s,
|
|
470
473
|
middlewareData: c
|
|
471
|
-
} = e, f = await
|
|
474
|
+
} = e, f = await fe(e, t);
|
|
472
475
|
return s === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
|
|
473
476
|
x: i + f.x,
|
|
474
477
|
y: r + f.y,
|
|
@@ -479,7 +482,7 @@ const re = function(t) {
|
|
|
479
482
|
};
|
|
480
483
|
}
|
|
481
484
|
};
|
|
482
|
-
},
|
|
485
|
+
}, ue = function(t) {
|
|
483
486
|
return t === void 0 && (t = {}), {
|
|
484
487
|
name: "shift",
|
|
485
488
|
options: t,
|
|
@@ -495,32 +498,32 @@ const re = function(t) {
|
|
|
495
498
|
fn: (p) => {
|
|
496
499
|
let {
|
|
497
500
|
x: w,
|
|
498
|
-
y:
|
|
501
|
+
y: x
|
|
499
502
|
} = p;
|
|
500
503
|
return {
|
|
501
504
|
x: w,
|
|
502
|
-
y:
|
|
505
|
+
y: x
|
|
503
506
|
};
|
|
504
507
|
}
|
|
505
508
|
},
|
|
506
509
|
...f
|
|
507
|
-
} =
|
|
510
|
+
} = Y(t, e), l = {
|
|
508
511
|
x: n,
|
|
509
512
|
y: o
|
|
510
|
-
}, a = await et(e, f),
|
|
511
|
-
let
|
|
513
|
+
}, a = await et(e, f), d = _(q(i)), m = xt(d);
|
|
514
|
+
let u = l[m], h = l[d];
|
|
512
515
|
if (r) {
|
|
513
|
-
const p = m === "y" ? "top" : "left", w = m === "y" ? "bottom" : "right",
|
|
514
|
-
|
|
516
|
+
const p = m === "y" ? "top" : "left", w = m === "y" ? "bottom" : "right", x = u + a[p], v = u - a[w];
|
|
517
|
+
u = gt(x, u, v);
|
|
515
518
|
}
|
|
516
519
|
if (s) {
|
|
517
|
-
const p =
|
|
518
|
-
h = gt(
|
|
520
|
+
const p = d === "y" ? "top" : "left", w = d === "y" ? "bottom" : "right", x = h + a[p], v = h - a[w];
|
|
521
|
+
h = gt(x, h, v);
|
|
519
522
|
}
|
|
520
523
|
const g = c.fn({
|
|
521
524
|
...e,
|
|
522
|
-
[m]:
|
|
523
|
-
[
|
|
525
|
+
[m]: u,
|
|
526
|
+
[d]: h
|
|
524
527
|
});
|
|
525
528
|
return {
|
|
526
529
|
...g,
|
|
@@ -529,13 +532,13 @@ const re = function(t) {
|
|
|
529
532
|
y: g.y - o,
|
|
530
533
|
enabled: {
|
|
531
534
|
[m]: r,
|
|
532
|
-
[
|
|
535
|
+
[d]: s
|
|
533
536
|
}
|
|
534
537
|
}
|
|
535
538
|
};
|
|
536
539
|
}
|
|
537
540
|
};
|
|
538
|
-
},
|
|
541
|
+
}, de = function(t) {
|
|
539
542
|
return t === void 0 && (t = {}), {
|
|
540
543
|
options: t,
|
|
541
544
|
fn(e) {
|
|
@@ -549,12 +552,12 @@ const re = function(t) {
|
|
|
549
552
|
offset: c = 0,
|
|
550
553
|
mainAxis: f = !0,
|
|
551
554
|
crossAxis: l = !0
|
|
552
|
-
} =
|
|
555
|
+
} = Y(t, e), a = {
|
|
553
556
|
x: n,
|
|
554
557
|
y: o
|
|
555
|
-
},
|
|
556
|
-
let
|
|
557
|
-
const g =
|
|
558
|
+
}, d = _(i), m = xt(d);
|
|
559
|
+
let u = a[m], h = a[d];
|
|
560
|
+
const g = Y(c, e), p = typeof g == "number" ? {
|
|
558
561
|
mainAxis: g,
|
|
559
562
|
crossAxis: 0
|
|
560
563
|
} : {
|
|
@@ -563,21 +566,21 @@ const re = function(t) {
|
|
|
563
566
|
...g
|
|
564
567
|
};
|
|
565
568
|
if (f) {
|
|
566
|
-
const
|
|
567
|
-
|
|
569
|
+
const v = m === "y" ? "height" : "width", b = r.reference[m] - r.floating[v] + p.mainAxis, y = r.reference[m] + r.reference[v] - p.mainAxis;
|
|
570
|
+
u < b ? u = b : u > y && (u = y);
|
|
568
571
|
}
|
|
569
572
|
if (l) {
|
|
570
|
-
var w,
|
|
571
|
-
const
|
|
572
|
-
h <
|
|
573
|
+
var w, x;
|
|
574
|
+
const v = m === "y" ? "width" : "height", b = Wt.has(q(i)), y = r.reference[d] - r.floating[v] + (b && ((w = s.offset) == null ? void 0 : w[d]) || 0) + (b ? 0 : p.crossAxis), O = r.reference[d] + r.reference[v] + (b ? 0 : ((x = s.offset) == null ? void 0 : x[d]) || 0) - (b ? p.crossAxis : 0);
|
|
575
|
+
h < y ? h = y : h > O && (h = O);
|
|
573
576
|
}
|
|
574
577
|
return {
|
|
575
|
-
[m]:
|
|
576
|
-
[
|
|
578
|
+
[m]: u,
|
|
579
|
+
[d]: h
|
|
577
580
|
};
|
|
578
581
|
}
|
|
579
582
|
};
|
|
580
|
-
},
|
|
583
|
+
}, me = function(t) {
|
|
581
584
|
return t === void 0 && (t = {}), {
|
|
582
585
|
name: "size",
|
|
583
586
|
options: t,
|
|
@@ -592,17 +595,17 @@ const re = function(t) {
|
|
|
592
595
|
apply: f = () => {
|
|
593
596
|
},
|
|
594
597
|
...l
|
|
595
|
-
} =
|
|
598
|
+
} = Y(t, e), a = await et(e, l), d = q(i), m = Z(i), u = _(i) === "y", {
|
|
596
599
|
width: h,
|
|
597
600
|
height: g
|
|
598
601
|
} = r.floating;
|
|
599
602
|
let p, w;
|
|
600
|
-
|
|
601
|
-
const
|
|
602
|
-
let R = b, L =
|
|
603
|
-
if ((n = e.middlewareData.shift) != null && n.enabled.x && (L =
|
|
604
|
-
const
|
|
605
|
-
|
|
603
|
+
d === "top" || d === "bottom" ? (p = d, w = m === (await (s.isRTL == null ? void 0 : s.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (w = d, p = m === "end" ? "top" : "bottom");
|
|
604
|
+
const x = g - a.top - a.bottom, v = h - a.left - a.right, b = U(g - a[p], x), y = U(h - a[w], v), O = !e.middlewareData.shift;
|
|
605
|
+
let R = b, L = y;
|
|
606
|
+
if ((n = e.middlewareData.shift) != null && n.enabled.x && (L = v), (o = e.middlewareData.shift) != null && o.enabled.y && (R = x), O && !m) {
|
|
607
|
+
const E = F(a.left, 0), B = F(a.right, 0), M = F(a.top, 0), D = F(a.bottom, 0);
|
|
608
|
+
u ? L = h - 2 * (E !== 0 || B !== 0 ? E + B : F(a.left, a.right)) : R = g - 2 * (M !== 0 || D !== 0 ? M + D : F(a.top, a.bottom));
|
|
606
609
|
}
|
|
607
610
|
await f({
|
|
608
611
|
...e,
|
|
@@ -622,42 +625,45 @@ function at() {
|
|
|
622
625
|
return typeof window < "u";
|
|
623
626
|
}
|
|
624
627
|
function tt(t) {
|
|
625
|
-
return
|
|
628
|
+
return Bt(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
626
629
|
}
|
|
627
630
|
function $(t) {
|
|
628
631
|
var e;
|
|
629
632
|
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
630
633
|
}
|
|
631
|
-
function
|
|
634
|
+
function I(t) {
|
|
632
635
|
var e;
|
|
633
|
-
return (e = (
|
|
636
|
+
return (e = (Bt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
634
637
|
}
|
|
635
|
-
function
|
|
638
|
+
function Bt(t) {
|
|
636
639
|
return at() ? t instanceof Node || t instanceof $(t).Node : !1;
|
|
637
640
|
}
|
|
638
|
-
function
|
|
641
|
+
function V(t) {
|
|
639
642
|
return at() ? t instanceof Element || t instanceof $(t).Element : !1;
|
|
640
643
|
}
|
|
641
|
-
function
|
|
644
|
+
function j(t) {
|
|
642
645
|
return at() ? t instanceof HTMLElement || t instanceof $(t).HTMLElement : !1;
|
|
643
646
|
}
|
|
644
647
|
function Dt(t) {
|
|
645
648
|
return !at() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof $(t).ShadowRoot;
|
|
646
649
|
}
|
|
650
|
+
const he = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
647
651
|
function ot(t) {
|
|
648
652
|
const {
|
|
649
653
|
overflow: e,
|
|
650
654
|
overflowX: n,
|
|
651
655
|
overflowY: o,
|
|
652
656
|
display: i
|
|
653
|
-
} =
|
|
654
|
-
return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !
|
|
657
|
+
} = H(t);
|
|
658
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !he.has(i);
|
|
655
659
|
}
|
|
656
|
-
|
|
657
|
-
|
|
660
|
+
const ge = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
661
|
+
function pe(t) {
|
|
662
|
+
return ge.has(tt(t));
|
|
658
663
|
}
|
|
664
|
+
const we = [":popover-open", ":modal"];
|
|
659
665
|
function ut(t) {
|
|
660
|
-
return
|
|
666
|
+
return we.some((e) => {
|
|
661
667
|
try {
|
|
662
668
|
return t.matches(e);
|
|
663
669
|
} catch {
|
|
@@ -665,13 +671,14 @@ function ut(t) {
|
|
|
665
671
|
}
|
|
666
672
|
});
|
|
667
673
|
}
|
|
674
|
+
const xe = ["transform", "translate", "scale", "rotate", "perspective"], ye = ["transform", "translate", "scale", "rotate", "perspective", "filter"], ve = ["paint", "layout", "strict", "content"];
|
|
668
675
|
function bt(t) {
|
|
669
|
-
const e = At(), n =
|
|
670
|
-
return
|
|
676
|
+
const e = At(), n = V(t) ? H(t) : t;
|
|
677
|
+
return xe.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) || ye.some((o) => (n.willChange || "").includes(o)) || ve.some((o) => (n.contain || "").includes(o));
|
|
671
678
|
}
|
|
672
|
-
function
|
|
679
|
+
function be(t) {
|
|
673
680
|
let e = K(t);
|
|
674
|
-
for (;
|
|
681
|
+
for (; j(e) && !Q(e); ) {
|
|
675
682
|
if (bt(e))
|
|
676
683
|
return e;
|
|
677
684
|
if (ut(e))
|
|
@@ -683,14 +690,15 @@ function ae(t) {
|
|
|
683
690
|
function At() {
|
|
684
691
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
685
692
|
}
|
|
693
|
+
const Ae = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
686
694
|
function Q(t) {
|
|
687
|
-
return
|
|
695
|
+
return Ae.has(tt(t));
|
|
688
696
|
}
|
|
689
|
-
function
|
|
697
|
+
function H(t) {
|
|
690
698
|
return $(t).getComputedStyle(t);
|
|
691
699
|
}
|
|
692
700
|
function dt(t) {
|
|
693
|
-
return
|
|
701
|
+
return V(t) ? {
|
|
694
702
|
scrollLeft: t.scrollLeft,
|
|
695
703
|
scrollTop: t.scrollTop
|
|
696
704
|
} : {
|
|
@@ -706,18 +714,18 @@ function K(t) {
|
|
|
706
714
|
t.assignedSlot || // DOM Element detected.
|
|
707
715
|
t.parentNode || // ShadowRoot detected.
|
|
708
716
|
Dt(t) && t.host || // Fallback.
|
|
709
|
-
|
|
717
|
+
I(t)
|
|
710
718
|
);
|
|
711
719
|
return Dt(e) ? e.host : e;
|
|
712
720
|
}
|
|
713
|
-
function
|
|
721
|
+
function Vt(t) {
|
|
714
722
|
const e = K(t);
|
|
715
|
-
return Q(e) ? t.ownerDocument ? t.ownerDocument.body : t.body :
|
|
723
|
+
return Q(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : j(e) && ot(e) ? e : Vt(e);
|
|
716
724
|
}
|
|
717
725
|
function nt(t, e, n) {
|
|
718
726
|
var o;
|
|
719
727
|
e === void 0 && (e = []), n === void 0 && (n = !0);
|
|
720
|
-
const i =
|
|
728
|
+
const i = Vt(t), r = i === ((o = t.ownerDocument) == null ? void 0 : o.body), s = $(i);
|
|
721
729
|
if (r) {
|
|
722
730
|
const c = wt(s);
|
|
723
731
|
return e.concat(s, s.visualViewport || [], ot(i) ? i : [], c && n ? nt(c) : []);
|
|
@@ -727,10 +735,10 @@ function nt(t, e, n) {
|
|
|
727
735
|
function wt(t) {
|
|
728
736
|
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
729
737
|
}
|
|
730
|
-
function
|
|
731
|
-
const e =
|
|
738
|
+
function Ht(t) {
|
|
739
|
+
const e = H(t);
|
|
732
740
|
let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
|
|
733
|
-
const i =
|
|
741
|
+
const i = j(t), r = i ? t.offsetWidth : n, s = i ? t.offsetHeight : o, c = st(n) !== r || st(o) !== s;
|
|
734
742
|
return c && (n = r, o = s), {
|
|
735
743
|
width: n,
|
|
736
744
|
height: o,
|
|
@@ -738,61 +746,61 @@ function Wt(t) {
|
|
|
738
746
|
};
|
|
739
747
|
}
|
|
740
748
|
function Rt(t) {
|
|
741
|
-
return
|
|
749
|
+
return V(t) ? t : t.contextElement;
|
|
742
750
|
}
|
|
743
751
|
function J(t) {
|
|
744
752
|
const e = Rt(t);
|
|
745
|
-
if (!
|
|
746
|
-
return
|
|
753
|
+
if (!j(e))
|
|
754
|
+
return z(1);
|
|
747
755
|
const n = e.getBoundingClientRect(), {
|
|
748
756
|
width: o,
|
|
749
757
|
height: i,
|
|
750
758
|
$: r
|
|
751
|
-
} =
|
|
759
|
+
} = Ht(e);
|
|
752
760
|
let s = (r ? st(n.width) : n.width) / o, c = (r ? st(n.height) : n.height) / i;
|
|
753
761
|
return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
754
762
|
x: s,
|
|
755
763
|
y: c
|
|
756
764
|
};
|
|
757
765
|
}
|
|
758
|
-
const
|
|
759
|
-
function
|
|
766
|
+
const Re = /* @__PURE__ */ z(0);
|
|
767
|
+
function Nt(t) {
|
|
760
768
|
const e = $(t);
|
|
761
|
-
return !At() || !e.visualViewport ?
|
|
769
|
+
return !At() || !e.visualViewport ? Re : {
|
|
762
770
|
x: e.visualViewport.offsetLeft,
|
|
763
771
|
y: e.visualViewport.offsetTop
|
|
764
772
|
};
|
|
765
773
|
}
|
|
766
|
-
function
|
|
774
|
+
function Oe(t, e, n) {
|
|
767
775
|
return e === void 0 && (e = !1), !n || e && n !== $(t) ? !1 : e;
|
|
768
776
|
}
|
|
769
777
|
function G(t, e, n, o) {
|
|
770
778
|
e === void 0 && (e = !1), n === void 0 && (n = !1);
|
|
771
779
|
const i = t.getBoundingClientRect(), r = Rt(t);
|
|
772
|
-
let s =
|
|
773
|
-
e && (o ?
|
|
774
|
-
const c =
|
|
775
|
-
let f = (i.left + c.x) / s.x, l = (i.top + c.y) / s.y, a = i.width / s.x,
|
|
780
|
+
let s = z(1);
|
|
781
|
+
e && (o ? V(o) && (s = J(o)) : s = J(t));
|
|
782
|
+
const c = Oe(r, n, o) ? Nt(r) : z(0);
|
|
783
|
+
let f = (i.left + c.x) / s.x, l = (i.top + c.y) / s.y, a = i.width / s.x, d = i.height / s.y;
|
|
776
784
|
if (r) {
|
|
777
|
-
const m = $(r),
|
|
785
|
+
const m = $(r), u = o && V(o) ? $(o) : o;
|
|
778
786
|
let h = m, g = wt(h);
|
|
779
|
-
for (; g && o &&
|
|
780
|
-
const p = J(g), w = g.getBoundingClientRect(),
|
|
781
|
-
f *= p.x, l *= p.y, a *= p.x,
|
|
787
|
+
for (; g && o && u !== h; ) {
|
|
788
|
+
const p = J(g), w = g.getBoundingClientRect(), x = H(g), v = w.left + (g.clientLeft + parseFloat(x.paddingLeft)) * p.x, b = w.top + (g.clientTop + parseFloat(x.paddingTop)) * p.y;
|
|
789
|
+
f *= p.x, l *= p.y, a *= p.x, d *= p.y, f += v, l += b, h = $(g), g = wt(h);
|
|
782
790
|
}
|
|
783
791
|
}
|
|
784
792
|
return lt({
|
|
785
793
|
width: a,
|
|
786
|
-
height:
|
|
794
|
+
height: d,
|
|
787
795
|
x: f,
|
|
788
796
|
y: l
|
|
789
797
|
});
|
|
790
798
|
}
|
|
791
799
|
function Ot(t, e) {
|
|
792
800
|
const n = dt(t).scrollLeft;
|
|
793
|
-
return e ? e.left + n : G(
|
|
801
|
+
return e ? e.left + n : G(I(t)).left + n;
|
|
794
802
|
}
|
|
795
|
-
function
|
|
803
|
+
function _t(t, e, n) {
|
|
796
804
|
n === void 0 && (n = !1);
|
|
797
805
|
const o = t.getBoundingClientRect(), i = o.left + e.scrollLeft - (n ? 0 : (
|
|
798
806
|
// RTL <body> scrollbar.
|
|
@@ -803,26 +811,26 @@ function Ht(t, e, n) {
|
|
|
803
811
|
y: r
|
|
804
812
|
};
|
|
805
813
|
}
|
|
806
|
-
function
|
|
814
|
+
function Ce(t) {
|
|
807
815
|
let {
|
|
808
816
|
elements: e,
|
|
809
817
|
rect: n,
|
|
810
818
|
offsetParent: o,
|
|
811
819
|
strategy: i
|
|
812
820
|
} = t;
|
|
813
|
-
const r = i === "fixed", s =
|
|
821
|
+
const r = i === "fixed", s = I(o), c = e ? ut(e.floating) : !1;
|
|
814
822
|
if (o === s || c && r)
|
|
815
823
|
return n;
|
|
816
824
|
let f = {
|
|
817
825
|
scrollLeft: 0,
|
|
818
826
|
scrollTop: 0
|
|
819
|
-
}, l =
|
|
820
|
-
const a =
|
|
821
|
-
if ((
|
|
822
|
-
const
|
|
823
|
-
l = J(o), a.x =
|
|
827
|
+
}, l = z(1);
|
|
828
|
+
const a = z(0), d = j(o);
|
|
829
|
+
if ((d || !d && !r) && ((tt(o) !== "body" || ot(s)) && (f = dt(o)), j(o))) {
|
|
830
|
+
const u = G(o);
|
|
831
|
+
l = J(o), a.x = u.x + o.clientLeft, a.y = u.y + o.clientTop;
|
|
824
832
|
}
|
|
825
|
-
const m = s && !
|
|
833
|
+
const m = s && !d && !r ? _t(s, f, !0) : z(0);
|
|
826
834
|
return {
|
|
827
835
|
width: n.width * l.x,
|
|
828
836
|
height: n.height * l.y,
|
|
@@ -830,22 +838,22 @@ function me(t) {
|
|
|
830
838
|
y: n.y * l.y - f.scrollTop * l.y + a.y + m.y
|
|
831
839
|
};
|
|
832
840
|
}
|
|
833
|
-
function
|
|
841
|
+
function Se(t) {
|
|
834
842
|
return Array.from(t.getClientRects());
|
|
835
843
|
}
|
|
836
|
-
function
|
|
837
|
-
const e =
|
|
844
|
+
function Ee(t) {
|
|
845
|
+
const e = I(t), n = dt(t), o = t.ownerDocument.body, i = F(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), r = F(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
|
|
838
846
|
let s = -n.scrollLeft + Ot(t);
|
|
839
847
|
const c = -n.scrollTop;
|
|
840
|
-
return
|
|
848
|
+
return H(o).direction === "rtl" && (s += F(e.clientWidth, o.clientWidth) - i), {
|
|
841
849
|
width: i,
|
|
842
850
|
height: r,
|
|
843
851
|
x: s,
|
|
844
852
|
y: c
|
|
845
853
|
};
|
|
846
854
|
}
|
|
847
|
-
function
|
|
848
|
-
const n = $(t), o =
|
|
855
|
+
function Pe(t, e) {
|
|
856
|
+
const n = $(t), o = I(t), i = n.visualViewport;
|
|
849
857
|
let r = o.clientWidth, s = o.clientHeight, c = 0, f = 0;
|
|
850
858
|
if (i) {
|
|
851
859
|
r = i.width, s = i.height;
|
|
@@ -859,8 +867,9 @@ function pe(t, e) {
|
|
|
859
867
|
y: f
|
|
860
868
|
};
|
|
861
869
|
}
|
|
862
|
-
|
|
863
|
-
|
|
870
|
+
const Le = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
871
|
+
function De(t, e) {
|
|
872
|
+
const n = G(t, !0, e === "fixed"), o = n.top + t.clientTop, i = n.left + t.clientLeft, r = j(t) ? J(t) : z(1), s = t.clientWidth * r.x, c = t.clientHeight * r.y, f = i * r.x, l = o * r.y;
|
|
864
873
|
return {
|
|
865
874
|
width: s,
|
|
866
875
|
height: c,
|
|
@@ -868,16 +877,16 @@ function we(t, e) {
|
|
|
868
877
|
y: l
|
|
869
878
|
};
|
|
870
879
|
}
|
|
871
|
-
function
|
|
880
|
+
function Tt(t, e, n) {
|
|
872
881
|
let o;
|
|
873
882
|
if (e === "viewport")
|
|
874
|
-
o =
|
|
883
|
+
o = Pe(t, n);
|
|
875
884
|
else if (e === "document")
|
|
876
|
-
o =
|
|
877
|
-
else if (
|
|
878
|
-
o =
|
|
885
|
+
o = Ee(I(t));
|
|
886
|
+
else if (V(e))
|
|
887
|
+
o = De(e, n);
|
|
879
888
|
else {
|
|
880
|
-
const i =
|
|
889
|
+
const i = Nt(t);
|
|
881
890
|
o = {
|
|
882
891
|
x: e.x - i.x,
|
|
883
892
|
y: e.y - i.y,
|
|
@@ -887,34 +896,34 @@ function Lt(t, e, n) {
|
|
|
887
896
|
}
|
|
888
897
|
return lt(o);
|
|
889
898
|
}
|
|
890
|
-
function
|
|
899
|
+
function zt(t, e) {
|
|
891
900
|
const n = K(t);
|
|
892
|
-
return n === e || !
|
|
901
|
+
return n === e || !V(n) || Q(n) ? !1 : H(n).position === "fixed" || zt(n, e);
|
|
893
902
|
}
|
|
894
|
-
function
|
|
903
|
+
function Te(t, e) {
|
|
895
904
|
const n = e.get(t);
|
|
896
905
|
if (n)
|
|
897
906
|
return n;
|
|
898
|
-
let o = nt(t, [], !1).filter((c) =>
|
|
899
|
-
const r =
|
|
907
|
+
let o = nt(t, [], !1).filter((c) => V(c) && tt(c) !== "body"), i = null;
|
|
908
|
+
const r = H(t).position === "fixed";
|
|
900
909
|
let s = r ? K(t) : t;
|
|
901
|
-
for (;
|
|
902
|
-
const c =
|
|
903
|
-
!f && c.position === "fixed" && (i = null), (r ? !f && !i : !f && c.position === "static" && !!i &&
|
|
910
|
+
for (; V(s) && !Q(s); ) {
|
|
911
|
+
const c = H(s), f = bt(s);
|
|
912
|
+
!f && c.position === "fixed" && (i = null), (r ? !f && !i : !f && c.position === "static" && !!i && Le.has(i.position) || ot(s) && !f && zt(t, s)) ? o = o.filter((a) => a !== s) : i = c, s = K(s);
|
|
904
913
|
}
|
|
905
914
|
return e.set(t, o), o;
|
|
906
915
|
}
|
|
907
|
-
function
|
|
916
|
+
function Me(t) {
|
|
908
917
|
let {
|
|
909
918
|
element: e,
|
|
910
919
|
boundary: n,
|
|
911
920
|
rootBoundary: o,
|
|
912
921
|
strategy: i
|
|
913
922
|
} = t;
|
|
914
|
-
const s = [...n === "clippingAncestors" ? ut(e) ? [] :
|
|
915
|
-
const
|
|
916
|
-
return l.top = F(
|
|
917
|
-
},
|
|
923
|
+
const s = [...n === "clippingAncestors" ? ut(e) ? [] : Te(e, this._c) : [].concat(n), o], c = s[0], f = s.reduce((l, a) => {
|
|
924
|
+
const d = Tt(e, a, i);
|
|
925
|
+
return l.top = F(d.top, l.top), l.right = U(d.right, l.right), l.bottom = U(d.bottom, l.bottom), l.left = F(d.left, l.left), l;
|
|
926
|
+
}, Tt(e, c, i));
|
|
918
927
|
return {
|
|
919
928
|
width: f.right - f.left,
|
|
920
929
|
height: f.bottom - f.top,
|
|
@@ -922,70 +931,74 @@ function ye(t) {
|
|
|
922
931
|
y: f.top
|
|
923
932
|
};
|
|
924
933
|
}
|
|
925
|
-
function
|
|
934
|
+
function ke(t) {
|
|
926
935
|
const {
|
|
927
936
|
width: e,
|
|
928
937
|
height: n
|
|
929
|
-
} =
|
|
938
|
+
} = Ht(t);
|
|
930
939
|
return {
|
|
931
940
|
width: e,
|
|
932
941
|
height: n
|
|
933
942
|
};
|
|
934
943
|
}
|
|
935
|
-
function
|
|
936
|
-
const o =
|
|
944
|
+
function Fe(t, e, n) {
|
|
945
|
+
const o = j(e), i = I(e), r = n === "fixed", s = G(t, !0, r, e);
|
|
937
946
|
let c = {
|
|
938
947
|
scrollLeft: 0,
|
|
939
948
|
scrollTop: 0
|
|
940
949
|
};
|
|
941
|
-
const f =
|
|
950
|
+
const f = z(0);
|
|
951
|
+
function l() {
|
|
952
|
+
f.x = Ot(i);
|
|
953
|
+
}
|
|
942
954
|
if (o || !o && !r)
|
|
943
955
|
if ((tt(e) !== "body" || ot(i)) && (c = dt(e)), o) {
|
|
944
|
-
const
|
|
945
|
-
f.x =
|
|
956
|
+
const u = G(e, !0, r, e);
|
|
957
|
+
f.x = u.x + e.clientLeft, f.y = u.y + e.clientTop;
|
|
946
958
|
} else
|
|
947
|
-
i && (
|
|
948
|
-
|
|
959
|
+
i && l();
|
|
960
|
+
r && !o && i && l();
|
|
961
|
+
const a = i && !o && !r ? _t(i, c) : z(0), d = s.left + c.scrollLeft - f.x - a.x, m = s.top + c.scrollTop - f.y - a.y;
|
|
949
962
|
return {
|
|
950
|
-
x:
|
|
951
|
-
y:
|
|
963
|
+
x: d,
|
|
964
|
+
y: m,
|
|
952
965
|
width: s.width,
|
|
953
966
|
height: s.height
|
|
954
967
|
};
|
|
955
968
|
}
|
|
956
969
|
function mt(t) {
|
|
957
|
-
return
|
|
970
|
+
return H(t).position === "static";
|
|
958
971
|
}
|
|
959
|
-
function
|
|
960
|
-
if (!
|
|
972
|
+
function Mt(t, e) {
|
|
973
|
+
if (!j(t) || H(t).position === "fixed")
|
|
961
974
|
return null;
|
|
962
975
|
if (e)
|
|
963
976
|
return e(t);
|
|
964
977
|
let n = t.offsetParent;
|
|
965
|
-
return
|
|
978
|
+
return I(t) === n && (n = n.ownerDocument.body), n;
|
|
966
979
|
}
|
|
967
|
-
function
|
|
980
|
+
function jt(t, e) {
|
|
968
981
|
const n = $(t);
|
|
969
982
|
if (ut(t))
|
|
970
983
|
return n;
|
|
971
|
-
if (!
|
|
984
|
+
if (!j(t)) {
|
|
972
985
|
let i = K(t);
|
|
973
986
|
for (; i && !Q(i); ) {
|
|
974
|
-
if (
|
|
987
|
+
if (V(i) && !mt(i))
|
|
975
988
|
return i;
|
|
976
989
|
i = K(i);
|
|
977
990
|
}
|
|
978
991
|
return n;
|
|
979
992
|
}
|
|
980
|
-
let o =
|
|
981
|
-
for (; o &&
|
|
982
|
-
o =
|
|
983
|
-
return o && Q(o) && mt(o) && !bt(o) ? n : o ||
|
|
993
|
+
let o = Mt(t, e);
|
|
994
|
+
for (; o && pe(o) && mt(o); )
|
|
995
|
+
o = Mt(o, e);
|
|
996
|
+
return o && Q(o) && mt(o) && !bt(o) ? n : o || be(t) || n;
|
|
984
997
|
}
|
|
985
|
-
const
|
|
986
|
-
const e = this.getOffsetParent ||
|
|
998
|
+
const $e = async function(t) {
|
|
999
|
+
const e = this.getOffsetParent || jt, n = this.getDimensions, o = await n(t.floating);
|
|
987
1000
|
return {
|
|
988
|
-
reference:
|
|
1001
|
+
reference: Fe(t.reference, await e(t.floating), t.strategy),
|
|
989
1002
|
floating: {
|
|
990
1003
|
x: 0,
|
|
991
1004
|
y: 0,
|
|
@@ -994,27 +1007,27 @@ const Ae = async function(t) {
|
|
|
994
1007
|
}
|
|
995
1008
|
};
|
|
996
1009
|
};
|
|
997
|
-
function
|
|
998
|
-
return
|
|
999
|
-
}
|
|
1000
|
-
const
|
|
1001
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
1002
|
-
getDocumentElement:
|
|
1003
|
-
getClippingRect:
|
|
1004
|
-
getOffsetParent:
|
|
1005
|
-
getElementRects:
|
|
1006
|
-
getClientRects:
|
|
1007
|
-
getDimensions:
|
|
1010
|
+
function We(t) {
|
|
1011
|
+
return H(t).direction === "rtl";
|
|
1012
|
+
}
|
|
1013
|
+
const Be = {
|
|
1014
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Ce,
|
|
1015
|
+
getDocumentElement: I,
|
|
1016
|
+
getClippingRect: Me,
|
|
1017
|
+
getOffsetParent: jt,
|
|
1018
|
+
getElementRects: $e,
|
|
1019
|
+
getClientRects: Se,
|
|
1020
|
+
getDimensions: ke,
|
|
1008
1021
|
getScale: J,
|
|
1009
|
-
isElement:
|
|
1010
|
-
isRTL:
|
|
1022
|
+
isElement: V,
|
|
1023
|
+
isRTL: We
|
|
1011
1024
|
};
|
|
1012
|
-
function
|
|
1025
|
+
function It(t, e) {
|
|
1013
1026
|
return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
|
|
1014
1027
|
}
|
|
1015
|
-
function
|
|
1028
|
+
function Ve(t, e) {
|
|
1016
1029
|
let n = null, o;
|
|
1017
|
-
const i =
|
|
1030
|
+
const i = I(t);
|
|
1018
1031
|
function r() {
|
|
1019
1032
|
var c;
|
|
1020
1033
|
clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
|
|
@@ -1023,18 +1036,18 @@ function Ce(t, e) {
|
|
|
1023
1036
|
c === void 0 && (c = !1), f === void 0 && (f = 1), r();
|
|
1024
1037
|
const l = t.getBoundingClientRect(), {
|
|
1025
1038
|
left: a,
|
|
1026
|
-
top:
|
|
1039
|
+
top: d,
|
|
1027
1040
|
width: m,
|
|
1028
|
-
height:
|
|
1041
|
+
height: u
|
|
1029
1042
|
} = l;
|
|
1030
|
-
if (c || e(), !m || !
|
|
1043
|
+
if (c || e(), !m || !u)
|
|
1031
1044
|
return;
|
|
1032
|
-
const h = it(
|
|
1045
|
+
const h = it(d), g = it(i.clientWidth - (a + m)), p = it(i.clientHeight - (d + u)), w = it(a), v = {
|
|
1033
1046
|
rootMargin: -h + "px " + -g + "px " + -p + "px " + -w + "px",
|
|
1034
|
-
threshold: F(0,
|
|
1047
|
+
threshold: F(0, U(1, f)) || 1
|
|
1035
1048
|
};
|
|
1036
1049
|
let b = !0;
|
|
1037
|
-
function
|
|
1050
|
+
function y(O) {
|
|
1038
1051
|
const R = O[0].intersectionRatio;
|
|
1039
1052
|
if (R !== f) {
|
|
1040
1053
|
if (!b)
|
|
@@ -1043,22 +1056,22 @@ function Ce(t, e) {
|
|
|
1043
1056
|
s(!1, 1e-7);
|
|
1044
1057
|
}, 1e3);
|
|
1045
1058
|
}
|
|
1046
|
-
R === 1 && !
|
|
1059
|
+
R === 1 && !It(l, t.getBoundingClientRect()) && s(), b = !1;
|
|
1047
1060
|
}
|
|
1048
1061
|
try {
|
|
1049
|
-
n = new IntersectionObserver(
|
|
1050
|
-
...
|
|
1062
|
+
n = new IntersectionObserver(y, {
|
|
1063
|
+
...v,
|
|
1051
1064
|
// Handle <iframe>s
|
|
1052
1065
|
root: i.ownerDocument
|
|
1053
1066
|
});
|
|
1054
1067
|
} catch {
|
|
1055
|
-
n = new IntersectionObserver(
|
|
1068
|
+
n = new IntersectionObserver(y, v);
|
|
1056
1069
|
}
|
|
1057
1070
|
n.observe(t);
|
|
1058
1071
|
}
|
|
1059
1072
|
return s(!0), r;
|
|
1060
1073
|
}
|
|
1061
|
-
function
|
|
1074
|
+
function Ge(t, e, n, o) {
|
|
1062
1075
|
o === void 0 && (o = {});
|
|
1063
1076
|
const {
|
|
1064
1077
|
ancestorScroll: i = !0,
|
|
@@ -1072,42 +1085,43 @@ function $e(t, e, n, o) {
|
|
|
1072
1085
|
passive: !0
|
|
1073
1086
|
}), r && w.addEventListener("resize", n);
|
|
1074
1087
|
});
|
|
1075
|
-
const
|
|
1076
|
-
let m = -1,
|
|
1077
|
-
s && (
|
|
1078
|
-
let [
|
|
1079
|
-
|
|
1080
|
-
var
|
|
1081
|
-
(
|
|
1088
|
+
const d = l && c ? Ve(l, n) : null;
|
|
1089
|
+
let m = -1, u = null;
|
|
1090
|
+
s && (u = new ResizeObserver((w) => {
|
|
1091
|
+
let [x] = w;
|
|
1092
|
+
x && x.target === l && u && (u.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
|
|
1093
|
+
var v;
|
|
1094
|
+
(v = u) == null || v.observe(e);
|
|
1082
1095
|
})), n();
|
|
1083
|
-
}), l && !f &&
|
|
1096
|
+
}), l && !f && u.observe(l), u.observe(e));
|
|
1084
1097
|
let h, g = f ? G(t) : null;
|
|
1085
1098
|
f && p();
|
|
1086
1099
|
function p() {
|
|
1087
1100
|
const w = G(t);
|
|
1088
|
-
g && !
|
|
1101
|
+
g && !It(g, w) && n(), g = w, h = requestAnimationFrame(p);
|
|
1089
1102
|
}
|
|
1090
1103
|
return n(), () => {
|
|
1091
1104
|
var w;
|
|
1092
|
-
a.forEach((
|
|
1093
|
-
i &&
|
|
1094
|
-
}),
|
|
1105
|
+
a.forEach((x) => {
|
|
1106
|
+
i && x.removeEventListener("scroll", n), r && x.removeEventListener("resize", n);
|
|
1107
|
+
}), d == null || d(), (w = u) == null || w.disconnect(), u = null, f && cancelAnimationFrame(h);
|
|
1095
1108
|
};
|
|
1096
1109
|
}
|
|
1097
|
-
const
|
|
1110
|
+
const He = ae, Ne = ue, _e = ce, ze = me, je = le, kt = se, Ie = de, Ye = (t, e, n) => {
|
|
1098
1111
|
const o = /* @__PURE__ */ new Map(), i = {
|
|
1099
|
-
platform:
|
|
1112
|
+
platform: Be,
|
|
1100
1113
|
...n
|
|
1101
1114
|
}, r = {
|
|
1102
1115
|
...i.platform,
|
|
1103
1116
|
_c: o
|
|
1104
1117
|
};
|
|
1105
|
-
return
|
|
1118
|
+
return re(t, e, {
|
|
1106
1119
|
...i,
|
|
1107
1120
|
platform: r
|
|
1108
1121
|
});
|
|
1109
1122
|
};
|
|
1110
|
-
var
|
|
1123
|
+
var qe = typeof document < "u", Xe = function() {
|
|
1124
|
+
}, rt = qe ? qt : Xe;
|
|
1111
1125
|
function ft(t, e) {
|
|
1112
1126
|
if (t === e)
|
|
1113
1127
|
return !0;
|
|
@@ -1139,20 +1153,20 @@ function ft(t, e) {
|
|
|
1139
1153
|
}
|
|
1140
1154
|
return t !== t && e !== e;
|
|
1141
1155
|
}
|
|
1142
|
-
function
|
|
1156
|
+
function Yt(t) {
|
|
1143
1157
|
return typeof window > "u" ? 1 : (t.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1144
1158
|
}
|
|
1145
|
-
function
|
|
1146
|
-
const n =
|
|
1159
|
+
function Ft(t, e) {
|
|
1160
|
+
const n = Yt(t);
|
|
1147
1161
|
return Math.round(e * n) / n;
|
|
1148
1162
|
}
|
|
1149
1163
|
function ht(t) {
|
|
1150
|
-
const e =
|
|
1164
|
+
const e = P.useRef(t);
|
|
1151
1165
|
return rt(() => {
|
|
1152
1166
|
e.current = t;
|
|
1153
1167
|
}), e;
|
|
1154
1168
|
}
|
|
1155
|
-
function
|
|
1169
|
+
function Je(t) {
|
|
1156
1170
|
t === void 0 && (t = {});
|
|
1157
1171
|
const {
|
|
1158
1172
|
placement: e = "bottom",
|
|
@@ -1166,20 +1180,20 @@ function We(t) {
|
|
|
1166
1180
|
transform: c = !0,
|
|
1167
1181
|
whileElementsMounted: f,
|
|
1168
1182
|
open: l
|
|
1169
|
-
} = t, [a,
|
|
1183
|
+
} = t, [a, d] = P.useState({
|
|
1170
1184
|
x: 0,
|
|
1171
1185
|
y: 0,
|
|
1172
1186
|
strategy: n,
|
|
1173
1187
|
placement: e,
|
|
1174
1188
|
middlewareData: {},
|
|
1175
1189
|
isPositioned: !1
|
|
1176
|
-
}), [m,
|
|
1177
|
-
ft(m, o) ||
|
|
1178
|
-
const [h, g] =
|
|
1190
|
+
}), [m, u] = P.useState(o);
|
|
1191
|
+
ft(m, o) || u(o);
|
|
1192
|
+
const [h, g] = P.useState(null), [p, w] = P.useState(null), x = P.useCallback((A) => {
|
|
1179
1193
|
A !== O.current && (O.current = A, g(A));
|
|
1180
|
-
}, []),
|
|
1194
|
+
}, []), v = P.useCallback((A) => {
|
|
1181
1195
|
A !== R.current && (R.current = A, w(A));
|
|
1182
|
-
}, []), b = r || h,
|
|
1196
|
+
}, []), b = r || h, y = s || p, O = P.useRef(null), R = P.useRef(null), L = P.useRef(a), W = f != null, E = ht(f), B = ht(i), M = ht(l), D = P.useCallback(() => {
|
|
1183
1197
|
if (!O.current || !R.current)
|
|
1184
1198
|
return;
|
|
1185
1199
|
const A = {
|
|
@@ -1187,74 +1201,74 @@ function We(t) {
|
|
|
1187
1201
|
strategy: n,
|
|
1188
1202
|
middleware: m
|
|
1189
1203
|
};
|
|
1190
|
-
B.current && (A.platform = B.current),
|
|
1191
|
-
const
|
|
1204
|
+
B.current && (A.platform = B.current), Ye(O.current, R.current, A).then((k) => {
|
|
1205
|
+
const X = {
|
|
1192
1206
|
...k,
|
|
1193
1207
|
// The floating element's position may be recomputed while it's closed
|
|
1194
1208
|
// but still mounted (such as when transitioning out). To ensure
|
|
1195
1209
|
// `isPositioned` will be `false` initially on the next open, avoid
|
|
1196
1210
|
// setting it to `true` when `open === false` (must be specified).
|
|
1197
|
-
isPositioned:
|
|
1211
|
+
isPositioned: M.current !== !1
|
|
1198
1212
|
};
|
|
1199
|
-
C.current && !ft(L.current,
|
|
1200
|
-
|
|
1213
|
+
C.current && !ft(L.current, X) && (L.current = X, Xt.flushSync(() => {
|
|
1214
|
+
d(X);
|
|
1201
1215
|
}));
|
|
1202
1216
|
});
|
|
1203
|
-
}, [m, e, n, B,
|
|
1217
|
+
}, [m, e, n, B, M]);
|
|
1204
1218
|
rt(() => {
|
|
1205
|
-
l === !1 && L.current.isPositioned && (L.current.isPositioned = !1,
|
|
1219
|
+
l === !1 && L.current.isPositioned && (L.current.isPositioned = !1, d((A) => ({
|
|
1206
1220
|
...A,
|
|
1207
1221
|
isPositioned: !1
|
|
1208
1222
|
})));
|
|
1209
1223
|
}, [l]);
|
|
1210
|
-
const C =
|
|
1224
|
+
const C = P.useRef(!1);
|
|
1211
1225
|
rt(() => (C.current = !0, () => {
|
|
1212
1226
|
C.current = !1;
|
|
1213
1227
|
}), []), rt(() => {
|
|
1214
|
-
if (b && (O.current = b),
|
|
1215
|
-
if (
|
|
1216
|
-
return
|
|
1217
|
-
|
|
1228
|
+
if (b && (O.current = b), y && (R.current = y), b && y) {
|
|
1229
|
+
if (E.current)
|
|
1230
|
+
return E.current(b, y, D);
|
|
1231
|
+
D();
|
|
1218
1232
|
}
|
|
1219
|
-
}, [b,
|
|
1220
|
-
const
|
|
1233
|
+
}, [b, y, D, E, W]);
|
|
1234
|
+
const N = P.useMemo(() => ({
|
|
1221
1235
|
reference: O,
|
|
1222
1236
|
floating: R,
|
|
1223
|
-
setReference:
|
|
1224
|
-
setFloating:
|
|
1225
|
-
}), [
|
|
1237
|
+
setReference: x,
|
|
1238
|
+
setFloating: v
|
|
1239
|
+
}), [x, v]), S = P.useMemo(() => ({
|
|
1226
1240
|
reference: b,
|
|
1227
|
-
floating:
|
|
1228
|
-
}), [b,
|
|
1241
|
+
floating: y
|
|
1242
|
+
}), [b, y]), T = P.useMemo(() => {
|
|
1229
1243
|
const A = {
|
|
1230
1244
|
position: n,
|
|
1231
1245
|
left: 0,
|
|
1232
1246
|
top: 0
|
|
1233
1247
|
};
|
|
1234
|
-
if (!
|
|
1248
|
+
if (!S.floating)
|
|
1235
1249
|
return A;
|
|
1236
|
-
const k =
|
|
1250
|
+
const k = Ft(S.floating, a.x), X = Ft(S.floating, a.y);
|
|
1237
1251
|
return c ? {
|
|
1238
1252
|
...A,
|
|
1239
|
-
transform: "translate(" + k + "px, " +
|
|
1240
|
-
...
|
|
1253
|
+
transform: "translate(" + k + "px, " + X + "px)",
|
|
1254
|
+
...Yt(S.floating) >= 1.5 && {
|
|
1241
1255
|
willChange: "transform"
|
|
1242
1256
|
}
|
|
1243
1257
|
} : {
|
|
1244
1258
|
position: n,
|
|
1245
1259
|
left: k,
|
|
1246
|
-
top:
|
|
1260
|
+
top: X
|
|
1247
1261
|
};
|
|
1248
|
-
}, [n, c,
|
|
1249
|
-
return
|
|
1262
|
+
}, [n, c, S.floating, a.x, a.y]);
|
|
1263
|
+
return P.useMemo(() => ({
|
|
1250
1264
|
...a,
|
|
1251
|
-
update:
|
|
1252
|
-
refs:
|
|
1253
|
-
elements:
|
|
1254
|
-
floatingStyles:
|
|
1255
|
-
}), [a,
|
|
1265
|
+
update: D,
|
|
1266
|
+
refs: N,
|
|
1267
|
+
elements: S,
|
|
1268
|
+
floatingStyles: T
|
|
1269
|
+
}), [a, D, N, S, T]);
|
|
1256
1270
|
}
|
|
1257
|
-
const
|
|
1271
|
+
const Ue = (t) => {
|
|
1258
1272
|
function e(n) {
|
|
1259
1273
|
return {}.hasOwnProperty.call(n, "current");
|
|
1260
1274
|
}
|
|
@@ -1266,45 +1280,45 @@ const ke = (t) => {
|
|
|
1266
1280
|
element: o,
|
|
1267
1281
|
padding: i
|
|
1268
1282
|
} = typeof t == "function" ? t(n) : t;
|
|
1269
|
-
return o && e(o) ? o.current != null ?
|
|
1283
|
+
return o && e(o) ? o.current != null ? kt({
|
|
1270
1284
|
element: o.current,
|
|
1271
1285
|
padding: i
|
|
1272
|
-
}).fn(n) : {} : o ?
|
|
1286
|
+
}).fn(n) : {} : o ? kt({
|
|
1273
1287
|
element: o,
|
|
1274
1288
|
padding: i
|
|
1275
1289
|
}).fn(n) : {};
|
|
1276
1290
|
}
|
|
1277
1291
|
};
|
|
1278
|
-
},
|
|
1279
|
-
...
|
|
1292
|
+
}, Qe = (t, e) => ({
|
|
1293
|
+
...He(t),
|
|
1280
1294
|
options: [t, e]
|
|
1281
|
-
}),
|
|
1282
|
-
...
|
|
1295
|
+
}), Ze = (t, e) => ({
|
|
1296
|
+
...Ne(t),
|
|
1283
1297
|
options: [t, e]
|
|
1284
|
-
}),
|
|
1285
|
-
...
|
|
1298
|
+
}), tn = (t, e) => ({
|
|
1299
|
+
...Ie(t),
|
|
1286
1300
|
options: [t, e]
|
|
1287
|
-
}),
|
|
1288
|
-
...
|
|
1301
|
+
}), en = (t, e) => ({
|
|
1302
|
+
..._e(t),
|
|
1289
1303
|
options: [t, e]
|
|
1290
|
-
}),
|
|
1291
|
-
...
|
|
1304
|
+
}), nn = (t, e) => ({
|
|
1305
|
+
...ze(t),
|
|
1292
1306
|
options: [t, e]
|
|
1293
|
-
}),
|
|
1294
|
-
...
|
|
1307
|
+
}), on = (t, e) => ({
|
|
1308
|
+
...je(t),
|
|
1295
1309
|
options: [t, e]
|
|
1296
|
-
}),
|
|
1297
|
-
...
|
|
1310
|
+
}), rn = (t, e) => ({
|
|
1311
|
+
...Ue(t),
|
|
1298
1312
|
options: [t, e]
|
|
1299
1313
|
});
|
|
1300
1314
|
export {
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1315
|
+
Ge as a,
|
|
1316
|
+
nn as b,
|
|
1317
|
+
rn as c,
|
|
1318
|
+
en as f,
|
|
1319
|
+
on as h,
|
|
1320
|
+
tn as l,
|
|
1321
|
+
Qe as o,
|
|
1322
|
+
Ze as s,
|
|
1323
|
+
Je as u
|
|
1310
1324
|
};
|