@pdf-viewer/react 1.9.0-beta.3 → 1.9.0-beta.4

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