@pdf-viewer/react 1.1.0 → 1.1.1-beta.0

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