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