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