@konstructio/ui 0.1.2-alpha.2 → 0.1.2-alpha.20

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