@krosoft/react 0.0.124 → 0.0.125

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 (62) hide show
  1. package/dist/{AppActions-po4LjUcM.js → AppActions-BbAnhStS.js} +22 -18
  2. package/dist/{AppSubTitle-CWrsJYFJ.js → AppSubTitle-lg3d5NWc.js} +1 -1
  3. package/dist/{AppTitle-CDxWr_0y.js → AppTitle-uboDuil4.js} +1 -1
  4. package/dist/{AppVerticalTabs-CdqoObXx.js → AppVerticalTabs-CBijkDF_.js} +33 -49
  5. package/dist/ConfirmationDialog-Co5yl0yA.js +184 -0
  6. package/dist/{DataTable-CrJoeR_0.js → DataTable-DSIgTHZS.js} +174 -218
  7. package/dist/ErrorAlert-DH1onuyt.js +17 -0
  8. package/dist/GenericForm-QoeireeW.js +339 -0
  9. package/dist/ImageInput-DLTYJMwr.js +65 -0
  10. package/dist/KpiCardsLayout-C3LmSeL1.js +22 -0
  11. package/dist/{LoadingState-PhGi7HXH.js → LoadingState-BN0YaPSs.js} +3 -3
  12. package/dist/{MetricCard-C-ewNR_i.js → MetricCard-CPw-fiNS.js} +6 -6
  13. package/dist/{MultiSelect-BoisW4Kn.js → MultiSelect-CX051kfk.js} +32 -27
  14. package/dist/SearchInput-D6LmcOjp.js +249 -0
  15. package/dist/SkeletonCards-BIEnyOuZ.js +62 -0
  16. package/dist/{TableFilter-CLjQU36k.js → TableFilter-Wh_Womy4.js} +114 -123
  17. package/dist/{ThemeSelector--w3R6Ff3.js → ThemeSelector-Qv8QBlYq.js} +2 -2
  18. package/dist/{Topbar-DFu_OdSs.js → Topbar-DVww-tU8.js} +49 -59
  19. package/dist/{alert-B34E_4uH.js → alert-B78CiTYe.js} +2 -2
  20. package/dist/components/core/cards/index.js +2 -2
  21. package/dist/components/core/dialogs/index.js +2 -2
  22. package/dist/components/core/filters/index.js +1 -1
  23. package/dist/components/core/forms/index.js +1 -1
  24. package/dist/components/core/index.js +19 -19
  25. package/dist/components/core/inputs/index.js +3 -3
  26. package/dist/components/core/layouts/index.js +4 -4
  27. package/dist/components/core/navbar/index.js +1 -1
  28. package/dist/components/core/states/index.js +2 -2
  29. package/dist/components/core/table/index.js +1 -1
  30. package/dist/components/core/tabs/index.js +1 -1
  31. package/dist/components/core/theme/index.js +1 -1
  32. package/dist/components/index.js +270 -270
  33. package/dist/components/ui/index.js +213 -213
  34. package/dist/helpers/index.js +1 -1
  35. package/dist/hooks/behavior/index.js +1 -1
  36. package/dist/hooks/index.js +1 -1
  37. package/dist/select-MWzbMBAS.js +106 -0
  38. package/dist/tailwind.helper-B6yFEsav.js +8 -0
  39. package/dist/toaster-DTC8Duvh.js +75 -0
  40. package/dist/toggle-group-CSdAiS44.js +1694 -0
  41. package/dist/tooltip-BWyFpIxo.js +56 -0
  42. package/dist/useConfirmDeleteDialog-CiBQmRxg.js +65 -0
  43. package/package.json +2 -2
  44. package/dist/ConfirmationDialog-CkMyyh_3.js +0 -221
  45. package/dist/ErrorAlert-C6BbHHRZ.js +0 -33
  46. package/dist/GenericForm-CmwqEXiQ.js +0 -11410
  47. package/dist/ImageInput-C8HcxE8t.js +0 -82
  48. package/dist/KpiCardsLayout-CETMpB7A.js +0 -15
  49. package/dist/SearchInput-DJ_F3emq.js +0 -586
  50. package/dist/SkeletonCards-C5lXTSrB.js +0 -57
  51. package/dist/badge-CfWlt79h.js +0 -26
  52. package/dist/createLucideIcon-MP_wDWjs.js +0 -116
  53. package/dist/ellipsis-vertical-kB5yFb-i.js +0 -15
  54. package/dist/grip-vertical-DGywJXzS.js +0 -18
  55. package/dist/index-Be16PP7H.js +0 -34
  56. package/dist/loader-circle-CKy7u7JW.js +0 -11
  57. package/dist/select-DlQvLtI3.js +0 -1763
  58. package/dist/tailwind.helper-gWiv5-6R.js +0 -2278
  59. package/dist/toaster-CKoOjjKr.js +0 -134
  60. package/dist/toggle-group-wIgXZYDq.js +0 -29086
  61. package/dist/tooltip-YhBPXbcJ.js +0 -2477
  62. package/dist/useConfirmDeleteDialog-BOb3XFpz.js +0 -75
@@ -1,2477 +0,0 @@
1
- import { c as dn } from "./createLucideIcon-MP_wDWjs.js";
2
- import { jsx as P, Fragment as pn, jsxs as mn } from "react/jsx-runtime";
3
- import { c as yt } from "./tailwind.helper-gWiv5-6R.js";
4
- import * as l from "react";
5
- import { useLayoutEffect as hn } from "react";
6
- import { c as gn } from "./index-Be16PP7H.js";
7
- import * as vt from "react-dom";
8
- function Gr(e, t) {
9
- const n = l.createContext(t), o = (i) => {
10
- const { children: s, ...c } = i, a = l.useMemo(() => c, Object.values(c));
11
- return /* @__PURE__ */ P(n.Provider, { value: a, children: s });
12
- };
13
- o.displayName = e + "Provider";
14
- function r(i) {
15
- const s = l.useContext(n);
16
- if (s) return s;
17
- if (t !== void 0) return t;
18
- throw new Error(`\`${i}\` must be used within \`${e}\``);
19
- }
20
- return [o, r];
21
- }
22
- function wt(e, t = []) {
23
- let n = [];
24
- function o(i, s) {
25
- const c = l.createContext(s), a = n.length;
26
- n = [...n, s];
27
- const u = (d) => {
28
- var v;
29
- const { scope: m, children: p, ...h } = d, g = ((v = m == null ? void 0 : m[e]) == null ? void 0 : v[a]) || c, y = l.useMemo(() => h, Object.values(h));
30
- return /* @__PURE__ */ P(g.Provider, { value: y, children: p });
31
- };
32
- u.displayName = i + "Provider";
33
- function f(d, m) {
34
- var g;
35
- const p = ((g = m == null ? void 0 : m[e]) == null ? void 0 : g[a]) || c, h = l.useContext(p);
36
- if (h) return h;
37
- if (s !== void 0) return s;
38
- throw new Error(`\`${d}\` must be used within \`${i}\``);
39
- }
40
- return [u, f];
41
- }
42
- const r = () => {
43
- const i = n.map((s) => l.createContext(s));
44
- return function(c) {
45
- const a = (c == null ? void 0 : c[e]) || i;
46
- return l.useMemo(
47
- () => ({ [`__scope${e}`]: { ...c, [e]: a } }),
48
- [c, a]
49
- );
50
- };
51
- };
52
- return r.scopeName = e, [o, yn(r, ...t)];
53
- }
54
- function yn(...e) {
55
- const t = e[0];
56
- if (e.length === 1) return t;
57
- const n = () => {
58
- const o = e.map((r) => ({
59
- useScope: r(),
60
- scopeName: r.scopeName
61
- }));
62
- return function(i) {
63
- const s = o.reduce((c, { useScope: a, scopeName: u }) => {
64
- const d = a(i)[`__scope${u}`];
65
- return { ...c, ...d };
66
- }, {});
67
- return l.useMemo(() => ({ [`__scope${t.scopeName}`]: s }), [s]);
68
- };
69
- };
70
- return n.scopeName = t.scopeName, n;
71
- }
72
- function ot(e, t) {
73
- if (typeof e == "function")
74
- return e(t);
75
- e != null && (e.current = t);
76
- }
77
- function Fe(...e) {
78
- return (t) => {
79
- let n = !1;
80
- const o = e.map((r) => {
81
- const i = ot(r, t);
82
- return !n && typeof i == "function" && (n = !0), i;
83
- });
84
- if (n)
85
- return () => {
86
- for (let r = 0; r < o.length; r++) {
87
- const i = o[r];
88
- typeof i == "function" ? i() : ot(e[r], null);
89
- }
90
- };
91
- };
92
- }
93
- function te(...e) {
94
- return l.useCallback(Fe(...e), e);
95
- }
96
- function Y(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
97
- return function(r) {
98
- if (e == null || e(r), n === !1 || !r.defaultPrevented)
99
- return t == null ? void 0 : t(r);
100
- };
101
- }
102
- var Q = globalThis != null && globalThis.document ? l.useLayoutEffect : () => {
103
- }, vn = l[" useInsertionEffect ".trim().toString()] || Q;
104
- function wn({
105
- prop: e,
106
- defaultProp: t,
107
- onChange: n = () => {
108
- },
109
- caller: o
110
- }) {
111
- const [r, i, s] = xn({
112
- defaultProp: t,
113
- onChange: n
114
- }), c = e !== void 0, a = c ? e : r;
115
- {
116
- const f = l.useRef(e !== void 0);
117
- l.useEffect(() => {
118
- const d = f.current;
119
- d !== c && console.warn(
120
- `${o} is changing from ${d ? "controlled" : "uncontrolled"} to ${c ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
121
- ), f.current = c;
122
- }, [c, o]);
123
- }
124
- const u = l.useCallback(
125
- (f) => {
126
- var d;
127
- if (c) {
128
- const m = bn(f) ? f(e) : f;
129
- m !== e && ((d = s.current) == null || d.call(s, m));
130
- } else
131
- i(f);
132
- },
133
- [c, e, i, s]
134
- );
135
- return [a, u];
136
- }
137
- function xn({
138
- defaultProp: e,
139
- onChange: t
140
- }) {
141
- const [n, o] = l.useState(e), r = l.useRef(n), i = l.useRef(t);
142
- return vn(() => {
143
- i.current = t;
144
- }, [t]), l.useEffect(() => {
145
- var s;
146
- r.current !== n && ((s = i.current) == null || s.call(i, n), r.current = n);
147
- }, [n, r]), [n, o, i];
148
- }
149
- function bn(e) {
150
- return typeof e == "function";
151
- }
152
- // @__NO_SIDE_EFFECTS__
153
- function Cn(e) {
154
- const t = /* @__PURE__ */ En(e), n = l.forwardRef((o, r) => {
155
- const { children: i, ...s } = o, c = l.Children.toArray(i), a = c.find(Pn);
156
- if (a) {
157
- const u = a.props.children, f = c.map((d) => d === a ? l.Children.count(u) > 1 ? l.Children.only(null) : l.isValidElement(u) ? u.props.children : null : d);
158
- return /* @__PURE__ */ P(t, { ...s, ref: r, children: l.isValidElement(u) ? l.cloneElement(u, void 0, f) : null });
159
- }
160
- return /* @__PURE__ */ P(t, { ...s, ref: r, children: i });
161
- });
162
- return n.displayName = `${e}.Slot`, n;
163
- }
164
- // @__NO_SIDE_EFFECTS__
165
- function En(e) {
166
- const t = l.forwardRef((n, o) => {
167
- const { children: r, ...i } = n;
168
- if (l.isValidElement(r)) {
169
- const s = On(r), c = An(i, r.props);
170
- return r.type !== l.Fragment && (c.ref = o ? Fe(o, s) : s), l.cloneElement(r, c);
171
- }
172
- return l.Children.count(r) > 1 ? l.Children.only(null) : null;
173
- });
174
- return t.displayName = `${e}.SlotClone`, t;
175
- }
176
- var Rn = Symbol("radix.slottable");
177
- function Pn(e) {
178
- return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Rn;
179
- }
180
- function An(e, t) {
181
- const n = { ...t };
182
- for (const o in t) {
183
- const r = e[o], i = t[o];
184
- /^on[A-Z]/.test(o) ? r && i ? n[o] = (...c) => {
185
- const a = i(...c);
186
- return r(...c), a;
187
- } : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
188
- }
189
- return { ...e, ...n };
190
- }
191
- function On(e) {
192
- var o, r;
193
- let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
194
- return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
195
- }
196
- var Sn = [
197
- "a",
198
- "button",
199
- "div",
200
- "form",
201
- "h2",
202
- "h3",
203
- "img",
204
- "input",
205
- "label",
206
- "li",
207
- "nav",
208
- "ol",
209
- "p",
210
- "select",
211
- "span",
212
- "svg",
213
- "ul"
214
- ], ne = Sn.reduce((e, t) => {
215
- const n = /* @__PURE__ */ Cn(`Primitive.${t}`), o = l.forwardRef((r, i) => {
216
- const { asChild: s, ...c } = r, a = s ? n : t;
217
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ P(a, { ...c, ref: i });
218
- });
219
- return o.displayName = `Primitive.${t}`, { ...e, [t]: o };
220
- }, {});
221
- function Tn(e, t) {
222
- e && vt.flushSync(() => e.dispatchEvent(t));
223
- }
224
- function Dn(e, t) {
225
- return l.useReducer((n, o) => t[n][o] ?? n, e);
226
- }
227
- var xt = (e) => {
228
- const { present: t, children: n } = e, o = Ln(t), r = typeof n == "function" ? n({ present: o.isPresent }) : l.Children.only(n), i = te(o.ref, Nn(r));
229
- return typeof n == "function" || o.isPresent ? l.cloneElement(r, { ref: i }) : null;
230
- };
231
- xt.displayName = "Presence";
232
- function Ln(e) {
233
- const [t, n] = l.useState(), o = l.useRef(null), r = l.useRef(e), i = l.useRef("none"), s = e ? "mounted" : "unmounted", [c, a] = Dn(s, {
234
- mounted: {
235
- UNMOUNT: "unmounted",
236
- ANIMATION_OUT: "unmountSuspended"
237
- },
238
- unmountSuspended: {
239
- MOUNT: "mounted",
240
- ANIMATION_END: "unmounted"
241
- },
242
- unmounted: {
243
- MOUNT: "mounted"
244
- }
245
- });
246
- return l.useEffect(() => {
247
- const u = me(o.current);
248
- i.current = c === "mounted" ? u : "none";
249
- }, [c]), Q(() => {
250
- const u = o.current, f = r.current;
251
- if (f !== e) {
252
- const m = i.current, p = me(u);
253
- e ? a("MOUNT") : p === "none" || (u == null ? void 0 : u.display) === "none" ? a("UNMOUNT") : a(f && m !== p ? "ANIMATION_OUT" : "UNMOUNT"), r.current = e;
254
- }
255
- }, [e, a]), Q(() => {
256
- if (t) {
257
- let u;
258
- const f = t.ownerDocument.defaultView ?? window, d = (p) => {
259
- const g = me(o.current).includes(CSS.escape(p.animationName));
260
- if (p.target === t && g && (a("ANIMATION_END"), !r.current)) {
261
- const y = t.style.animationFillMode;
262
- t.style.animationFillMode = "forwards", u = f.setTimeout(() => {
263
- t.style.animationFillMode === "forwards" && (t.style.animationFillMode = y);
264
- });
265
- }
266
- }, m = (p) => {
267
- p.target === t && (i.current = me(o.current));
268
- };
269
- return t.addEventListener("animationstart", m), t.addEventListener("animationcancel", d), t.addEventListener("animationend", d), () => {
270
- f.clearTimeout(u), t.removeEventListener("animationstart", m), t.removeEventListener("animationcancel", d), t.removeEventListener("animationend", d);
271
- };
272
- } else
273
- a("ANIMATION_END");
274
- }, [t, a]), {
275
- isPresent: ["mounted", "unmountSuspended"].includes(c),
276
- ref: l.useCallback((u) => {
277
- o.current = u ? getComputedStyle(u) : null, n(u);
278
- }, [])
279
- };
280
- }
281
- function me(e) {
282
- return (e == null ? void 0 : e.animationName) || "none";
283
- }
284
- function Nn(e) {
285
- var o, r;
286
- let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
287
- return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
288
- }
289
- var _n = l[" useId ".trim().toString()] || (() => {
290
- }), Mn = 0;
291
- function $n(e) {
292
- const [t, n] = l.useState(_n());
293
- return Q(() => {
294
- n((o) => o ?? String(Mn++));
295
- }, [e]), t ? `radix-${t}` : "";
296
- }
297
- /**
298
- * @license lucide-react v1.17.0 - ISC
299
- *
300
- * This source code is licensed under the ISC license.
301
- * See the LICENSE file in the root directory of this source tree.
302
- */
303
- const kn = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], Kr = dn("chevron-down", kn);
304
- function Ce(e) {
305
- const t = l.useRef(e);
306
- return l.useEffect(() => {
307
- t.current = e;
308
- }), l.useMemo(() => (...n) => {
309
- var o;
310
- return (o = t.current) == null ? void 0 : o.call(t, ...n);
311
- }, []);
312
- }
313
- function In(e, t = globalThis == null ? void 0 : globalThis.document) {
314
- const n = Ce(e);
315
- l.useEffect(() => {
316
- const o = (r) => {
317
- r.key === "Escape" && n(r);
318
- };
319
- return t.addEventListener("keydown", o, { capture: !0 }), () => t.removeEventListener("keydown", o, { capture: !0 });
320
- }, [n, t]);
321
- }
322
- var Wn = "DismissableLayer", _e = "dismissableLayer.update", Fn = "dismissableLayer.pointerDownOutside", Bn = "dismissableLayer.focusOutside", rt, bt = l.createContext({
323
- layers: /* @__PURE__ */ new Set(),
324
- layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
325
- branches: /* @__PURE__ */ new Set()
326
- }), Be = l.forwardRef(
327
- (e, t) => {
328
- const {
329
- disableOutsidePointerEvents: n = !1,
330
- onEscapeKeyDown: o,
331
- onPointerDownOutside: r,
332
- onFocusOutside: i,
333
- onInteractOutside: s,
334
- onDismiss: c,
335
- ...a
336
- } = e, u = l.useContext(bt), [f, d] = l.useState(null), m = (f == null ? void 0 : f.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = l.useState({}), h = te(t, (C) => d(C)), g = Array.from(u.layers), [y] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), v = g.indexOf(y), w = f ? g.indexOf(f) : -1, b = u.layersWithOutsidePointerEventsDisabled.size > 0, x = w >= v, R = Vn((C) => {
337
- const O = C.target, _ = [...u.branches].some((S) => S.contains(O));
338
- !x || _ || (r == null || r(C), s == null || s(C), C.defaultPrevented || c == null || c());
339
- }, m), E = zn((C) => {
340
- const O = C.target;
341
- [...u.branches].some((S) => S.contains(O)) || (i == null || i(C), s == null || s(C), C.defaultPrevented || c == null || c());
342
- }, m);
343
- return In((C) => {
344
- w === u.layers.size - 1 && (o == null || o(C), !C.defaultPrevented && c && (C.preventDefault(), c()));
345
- }, m), l.useEffect(() => {
346
- if (f)
347
- return n && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (rt = m.body.style.pointerEvents, m.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(f)), u.layers.add(f), it(), () => {
348
- n && u.layersWithOutsidePointerEventsDisabled.size === 1 && (m.body.style.pointerEvents = rt);
349
- };
350
- }, [f, m, n, u]), l.useEffect(() => () => {
351
- f && (u.layers.delete(f), u.layersWithOutsidePointerEventsDisabled.delete(f), it());
352
- }, [f, u]), l.useEffect(() => {
353
- const C = () => p({});
354
- return document.addEventListener(_e, C), () => document.removeEventListener(_e, C);
355
- }, []), /* @__PURE__ */ P(
356
- ne.div,
357
- {
358
- ...a,
359
- ref: h,
360
- style: {
361
- pointerEvents: b ? x ? "auto" : "none" : void 0,
362
- ...e.style
363
- },
364
- onFocusCapture: Y(e.onFocusCapture, E.onFocusCapture),
365
- onBlurCapture: Y(e.onBlurCapture, E.onBlurCapture),
366
- onPointerDownCapture: Y(
367
- e.onPointerDownCapture,
368
- R.onPointerDownCapture
369
- )
370
- }
371
- );
372
- }
373
- );
374
- Be.displayName = Wn;
375
- var Hn = "DismissableLayerBranch", Ct = l.forwardRef((e, t) => {
376
- const n = l.useContext(bt), o = l.useRef(null), r = te(t, o);
377
- return l.useEffect(() => {
378
- const i = o.current;
379
- if (i)
380
- return n.branches.add(i), () => {
381
- n.branches.delete(i);
382
- };
383
- }, [n.branches]), /* @__PURE__ */ P(ne.div, { ...e, ref: r });
384
- });
385
- Ct.displayName = Hn;
386
- function Vn(e, t = globalThis == null ? void 0 : globalThis.document) {
387
- const n = Ce(e), o = l.useRef(!1), r = l.useRef(() => {
388
- });
389
- return l.useEffect(() => {
390
- const i = (c) => {
391
- if (c.target && !o.current) {
392
- let a = function() {
393
- Et(
394
- Fn,
395
- n,
396
- u,
397
- { discrete: !0 }
398
- );
399
- };
400
- const u = { originalEvent: c };
401
- c.pointerType === "touch" ? (t.removeEventListener("click", r.current), r.current = a, t.addEventListener("click", r.current, { once: !0 })) : a();
402
- } else
403
- t.removeEventListener("click", r.current);
404
- o.current = !1;
405
- }, s = window.setTimeout(() => {
406
- t.addEventListener("pointerdown", i);
407
- }, 0);
408
- return () => {
409
- window.clearTimeout(s), t.removeEventListener("pointerdown", i), t.removeEventListener("click", r.current);
410
- };
411
- }, [t, n]), {
412
- // ensures we check React component tree (not just DOM tree)
413
- onPointerDownCapture: () => o.current = !0
414
- };
415
- }
416
- function zn(e, t = globalThis == null ? void 0 : globalThis.document) {
417
- const n = Ce(e), o = l.useRef(!1);
418
- return l.useEffect(() => {
419
- const r = (i) => {
420
- i.target && !o.current && Et(Bn, n, { originalEvent: i }, {
421
- discrete: !1
422
- });
423
- };
424
- return t.addEventListener("focusin", r), () => t.removeEventListener("focusin", r);
425
- }, [t, n]), {
426
- onFocusCapture: () => o.current = !0,
427
- onBlurCapture: () => o.current = !1
428
- };
429
- }
430
- function it() {
431
- const e = new CustomEvent(_e);
432
- document.dispatchEvent(e);
433
- }
434
- function Et(e, t, n, { discrete: o }) {
435
- const r = n.originalEvent.target, i = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
436
- t && r.addEventListener(e, t, { once: !0 }), o ? Tn(r, i) : r.dispatchEvent(i);
437
- }
438
- var Zr = Be, Jr = Ct, jn = Symbol.for("react.lazy"), ye = l[" use ".trim().toString()];
439
- function Un(e) {
440
- return typeof e == "object" && e !== null && "then" in e;
441
- }
442
- function Rt(e) {
443
- return e != null && typeof e == "object" && "$$typeof" in e && e.$$typeof === jn && "_payload" in e && Un(e._payload);
444
- }
445
- // @__NO_SIDE_EFFECTS__
446
- function Yn(e) {
447
- const t = /* @__PURE__ */ qn(e), n = l.forwardRef((o, r) => {
448
- let { children: i, ...s } = o;
449
- Rt(i) && typeof ye == "function" && (i = ye(i._payload));
450
- const c = l.Children.toArray(i), a = c.find(Kn);
451
- if (a) {
452
- const u = a.props.children, f = c.map((d) => d === a ? l.Children.count(u) > 1 ? l.Children.only(null) : l.isValidElement(u) ? u.props.children : null : d);
453
- return /* @__PURE__ */ P(t, { ...s, ref: r, children: l.isValidElement(u) ? l.cloneElement(u, void 0, f) : null });
454
- }
455
- return /* @__PURE__ */ P(t, { ...s, ref: r, children: i });
456
- });
457
- return n.displayName = `${e}.Slot`, n;
458
- }
459
- var Xn = /* @__PURE__ */ Yn("Slot");
460
- // @__NO_SIDE_EFFECTS__
461
- function qn(e) {
462
- const t = l.forwardRef((n, o) => {
463
- let { children: r, ...i } = n;
464
- if (Rt(r) && typeof ye == "function" && (r = ye(r._payload)), l.isValidElement(r)) {
465
- const s = Jn(r), c = Zn(i, r.props);
466
- return r.type !== l.Fragment && (c.ref = o ? Fe(o, s) : s), l.cloneElement(r, c);
467
- }
468
- return l.Children.count(r) > 1 ? l.Children.only(null) : null;
469
- });
470
- return t.displayName = `${e}.SlotClone`, t;
471
- }
472
- var Gn = Symbol("radix.slottable");
473
- function Kn(e) {
474
- return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Gn;
475
- }
476
- function Zn(e, t) {
477
- const n = { ...t };
478
- for (const o in t) {
479
- const r = e[o], i = t[o];
480
- /^on[A-Z]/.test(o) ? r && i ? n[o] = (...c) => {
481
- const a = i(...c);
482
- return r(...c), a;
483
- } : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
484
- }
485
- return { ...e, ...n };
486
- }
487
- function Jn(e) {
488
- var o, r;
489
- let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
490
- return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
491
- }
492
- const Qn = gn(
493
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
494
- {
495
- variants: {
496
- variant: {
497
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
498
- destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
499
- outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
500
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
501
- ghost: "hover:bg-accent hover:text-accent-foreground",
502
- link: "text-primary underline-offset-4 hover:underline",
503
- styled: "bg-gradient-to-r from-slate-900 to-purple-700 hover:from-slate-800 hover:to-purple-600 text-white shadow-lg shadow-purple-500/25 px-6 h-12"
504
- },
505
- size: {
506
- default: "h-10 px-4 py-2",
507
- sm: "h-9 rounded-md px-3",
508
- lg: "h-11 rounded-md px-8",
509
- icon: "h-10 w-10"
510
- }
511
- },
512
- defaultVariants: {
513
- variant: "default",
514
- size: "default"
515
- }
516
- }
517
- ), eo = l.forwardRef(({ className: e, variant: t, size: n, asChild: o = !1, ...r }, i) => /* @__PURE__ */ P(o ? Xn : "button", { className: yt(Qn({ variant: t, size: n, className: e })), ref: i, ...r }));
518
- eo.displayName = "Button";
519
- function to(e) {
520
- const [t, n] = l.useState(void 0);
521
- return Q(() => {
522
- if (e) {
523
- n({ width: e.offsetWidth, height: e.offsetHeight });
524
- const o = new ResizeObserver((r) => {
525
- if (!Array.isArray(r) || !r.length)
526
- return;
527
- const i = r[0];
528
- let s, c;
529
- if ("borderBoxSize" in i) {
530
- const a = i.borderBoxSize, u = Array.isArray(a) ? a[0] : a;
531
- s = u.inlineSize, c = u.blockSize;
532
- } else
533
- s = e.offsetWidth, c = e.offsetHeight;
534
- n({ width: s, height: c });
535
- });
536
- return o.observe(e, { box: "border-box" }), () => o.unobserve(e);
537
- } else
538
- n(void 0);
539
- }, [e]), t;
540
- }
541
- const no = ["top", "right", "bottom", "left"], K = Math.min, W = Math.max, ve = Math.round, he = Math.floor, j = (e) => ({
542
- x: e,
543
- y: e
544
- }), oo = {
545
- left: "right",
546
- right: "left",
547
- bottom: "top",
548
- top: "bottom"
549
- };
550
- function Me(e, t, n) {
551
- return W(e, K(t, n));
552
- }
553
- function X(e, t) {
554
- return typeof e == "function" ? e(t) : e;
555
- }
556
- function q(e) {
557
- return e.split("-")[0];
558
- }
559
- function se(e) {
560
- return e.split("-")[1];
561
- }
562
- function He(e) {
563
- return e === "x" ? "y" : "x";
564
- }
565
- function Ve(e) {
566
- return e === "y" ? "height" : "width";
567
- }
568
- function z(e) {
569
- const t = e[0];
570
- return t === "t" || t === "b" ? "y" : "x";
571
- }
572
- function ze(e) {
573
- return He(z(e));
574
- }
575
- function ro(e, t, n) {
576
- n === void 0 && (n = !1);
577
- const o = se(e), r = ze(e), i = Ve(r);
578
- let s = r === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
579
- return t.reference[i] > t.floating[i] && (s = we(s)), [s, we(s)];
580
- }
581
- function io(e) {
582
- const t = we(e);
583
- return [$e(e), t, $e(t)];
584
- }
585
- function $e(e) {
586
- return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
587
- }
588
- const st = ["left", "right"], ct = ["right", "left"], so = ["top", "bottom"], co = ["bottom", "top"];
589
- function ao(e, t, n) {
590
- switch (e) {
591
- case "top":
592
- case "bottom":
593
- return n ? t ? ct : st : t ? st : ct;
594
- case "left":
595
- case "right":
596
- return t ? so : co;
597
- default:
598
- return [];
599
- }
600
- }
601
- function lo(e, t, n, o) {
602
- const r = se(e);
603
- let i = ao(q(e), n === "start", o);
604
- return r && (i = i.map((s) => s + "-" + r), t && (i = i.concat(i.map($e)))), i;
605
- }
606
- function we(e) {
607
- const t = q(e);
608
- return oo[t] + e.slice(t.length);
609
- }
610
- function uo(e) {
611
- return {
612
- top: 0,
613
- right: 0,
614
- bottom: 0,
615
- left: 0,
616
- ...e
617
- };
618
- }
619
- function Pt(e) {
620
- return typeof e != "number" ? uo(e) : {
621
- top: e,
622
- right: e,
623
- bottom: e,
624
- left: e
625
- };
626
- }
627
- function xe(e) {
628
- const {
629
- x: t,
630
- y: n,
631
- width: o,
632
- height: r
633
- } = e;
634
- return {
635
- width: o,
636
- height: r,
637
- top: n,
638
- left: t,
639
- right: t + o,
640
- bottom: n + r,
641
- x: t,
642
- y: n
643
- };
644
- }
645
- function at(e, t, n) {
646
- let {
647
- reference: o,
648
- floating: r
649
- } = e;
650
- const i = z(t), s = ze(t), c = Ve(s), a = q(t), u = i === "y", f = o.x + o.width / 2 - r.width / 2, d = o.y + o.height / 2 - r.height / 2, m = o[c] / 2 - r[c] / 2;
651
- let p;
652
- switch (a) {
653
- case "top":
654
- p = {
655
- x: f,
656
- y: o.y - r.height
657
- };
658
- break;
659
- case "bottom":
660
- p = {
661
- x: f,
662
- y: o.y + o.height
663
- };
664
- break;
665
- case "right":
666
- p = {
667
- x: o.x + o.width,
668
- y: d
669
- };
670
- break;
671
- case "left":
672
- p = {
673
- x: o.x - r.width,
674
- y: d
675
- };
676
- break;
677
- default:
678
- p = {
679
- x: o.x,
680
- y: o.y
681
- };
682
- }
683
- switch (se(t)) {
684
- case "start":
685
- p[s] -= m * (n && u ? -1 : 1);
686
- break;
687
- case "end":
688
- p[s] += m * (n && u ? -1 : 1);
689
- break;
690
- }
691
- return p;
692
- }
693
- async function fo(e, t) {
694
- var n;
695
- t === void 0 && (t = {});
696
- const {
697
- x: o,
698
- y: r,
699
- platform: i,
700
- rects: s,
701
- elements: c,
702
- strategy: a
703
- } = e, {
704
- boundary: u = "clippingAncestors",
705
- rootBoundary: f = "viewport",
706
- elementContext: d = "floating",
707
- altBoundary: m = !1,
708
- padding: p = 0
709
- } = X(t, e), h = Pt(p), y = c[m ? d === "floating" ? "reference" : "floating" : d], v = xe(await i.getClippingRect({
710
- element: (n = await (i.isElement == null ? void 0 : i.isElement(y))) == null || n ? y : y.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(c.floating)),
711
- boundary: u,
712
- rootBoundary: f,
713
- strategy: a
714
- })), w = d === "floating" ? {
715
- x: o,
716
- y: r,
717
- width: s.floating.width,
718
- height: s.floating.height
719
- } : s.reference, b = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c.floating)), x = await (i.isElement == null ? void 0 : i.isElement(b)) ? await (i.getScale == null ? void 0 : i.getScale(b)) || {
720
- x: 1,
721
- y: 1
722
- } : {
723
- x: 1,
724
- y: 1
725
- }, R = xe(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
726
- elements: c,
727
- rect: w,
728
- offsetParent: b,
729
- strategy: a
730
- }) : w);
731
- return {
732
- top: (v.top - R.top + h.top) / x.y,
733
- bottom: (R.bottom - v.bottom + h.bottom) / x.y,
734
- left: (v.left - R.left + h.left) / x.x,
735
- right: (R.right - v.right + h.right) / x.x
736
- };
737
- }
738
- const po = 50, mo = async (e, t, n) => {
739
- const {
740
- placement: o = "bottom",
741
- strategy: r = "absolute",
742
- middleware: i = [],
743
- platform: s
744
- } = n, c = s.detectOverflow ? s : {
745
- ...s,
746
- detectOverflow: fo
747
- }, a = await (s.isRTL == null ? void 0 : s.isRTL(t));
748
- let u = await s.getElementRects({
749
- reference: e,
750
- floating: t,
751
- strategy: r
752
- }), {
753
- x: f,
754
- y: d
755
- } = at(u, o, a), m = o, p = 0;
756
- const h = {};
757
- for (let g = 0; g < i.length; g++) {
758
- const y = i[g];
759
- if (!y)
760
- continue;
761
- const {
762
- name: v,
763
- fn: w
764
- } = y, {
765
- x: b,
766
- y: x,
767
- data: R,
768
- reset: E
769
- } = await w({
770
- x: f,
771
- y: d,
772
- initialPlacement: o,
773
- placement: m,
774
- strategy: r,
775
- middlewareData: h,
776
- rects: u,
777
- platform: c,
778
- elements: {
779
- reference: e,
780
- floating: t
781
- }
782
- });
783
- f = b ?? f, d = x ?? d, h[v] = {
784
- ...h[v],
785
- ...R
786
- }, E && p < po && (p++, typeof E == "object" && (E.placement && (m = E.placement), E.rects && (u = E.rects === !0 ? await s.getElementRects({
787
- reference: e,
788
- floating: t,
789
- strategy: r
790
- }) : E.rects), {
791
- x: f,
792
- y: d
793
- } = at(u, m, a)), g = -1);
794
- }
795
- return {
796
- x: f,
797
- y: d,
798
- placement: m,
799
- strategy: r,
800
- middlewareData: h
801
- };
802
- }, ho = (e) => ({
803
- name: "arrow",
804
- options: e,
805
- async fn(t) {
806
- const {
807
- x: n,
808
- y: o,
809
- placement: r,
810
- rects: i,
811
- platform: s,
812
- elements: c,
813
- middlewareData: a
814
- } = t, {
815
- element: u,
816
- padding: f = 0
817
- } = X(e, t) || {};
818
- if (u == null)
819
- return {};
820
- const d = Pt(f), m = {
821
- x: n,
822
- y: o
823
- }, p = ze(r), h = Ve(p), g = await s.getDimensions(u), y = p === "y", v = y ? "top" : "left", w = y ? "bottom" : "right", b = y ? "clientHeight" : "clientWidth", x = i.reference[h] + i.reference[p] - m[p] - i.floating[h], R = m[p] - i.reference[p], E = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(u));
824
- let C = E ? E[b] : 0;
825
- (!C || !await (s.isElement == null ? void 0 : s.isElement(E))) && (C = c.floating[b] || i.floating[h]);
826
- const O = x / 2 - R / 2, _ = C / 2 - g[h] / 2 - 1, S = K(d[v], _), $ = K(d[w], _), k = S, D = C - g[h] - $, T = C / 2 - g[h] / 2 + O, I = Me(k, T, D), L = !a.arrow && se(r) != null && T !== I && i.reference[h] / 2 - (T < k ? S : $) - g[h] / 2 < 0, N = L ? T < k ? T - k : T - D : 0;
827
- return {
828
- [p]: m[p] + N,
829
- data: {
830
- [p]: I,
831
- centerOffset: T - I - N,
832
- ...L && {
833
- alignmentOffset: N
834
- }
835
- },
836
- reset: L
837
- };
838
- }
839
- }), go = function(e) {
840
- return e === void 0 && (e = {}), {
841
- name: "flip",
842
- options: e,
843
- async fn(t) {
844
- var n, o;
845
- const {
846
- placement: r,
847
- middlewareData: i,
848
- rects: s,
849
- initialPlacement: c,
850
- platform: a,
851
- elements: u
852
- } = t, {
853
- mainAxis: f = !0,
854
- crossAxis: d = !0,
855
- fallbackPlacements: m,
856
- fallbackStrategy: p = "bestFit",
857
- fallbackAxisSideDirection: h = "none",
858
- flipAlignment: g = !0,
859
- ...y
860
- } = X(e, t);
861
- if ((n = i.arrow) != null && n.alignmentOffset)
862
- return {};
863
- const v = q(r), w = z(c), b = q(c) === c, x = await (a.isRTL == null ? void 0 : a.isRTL(u.floating)), R = m || (b || !g ? [we(c)] : io(c)), E = h !== "none";
864
- !m && E && R.push(...lo(c, g, h, x));
865
- const C = [c, ...R], O = await a.detectOverflow(t, y), _ = [];
866
- let S = ((o = i.flip) == null ? void 0 : o.overflows) || [];
867
- if (f && _.push(O[v]), d) {
868
- const T = ro(r, s, x);
869
- _.push(O[T[0]], O[T[1]]);
870
- }
871
- if (S = [...S, {
872
- placement: r,
873
- overflows: _
874
- }], !_.every((T) => T <= 0)) {
875
- var $, k;
876
- const T = ((($ = i.flip) == null ? void 0 : $.index) || 0) + 1, I = C[T];
877
- if (I && (!(d === "alignment" ? w !== z(I) : !1) || // We leave the current main axis only if every placement on that axis
878
- // overflows the main axis.
879
- S.every((A) => z(A.placement) === w ? A.overflows[0] > 0 : !0)))
880
- return {
881
- data: {
882
- index: T,
883
- overflows: S
884
- },
885
- reset: {
886
- placement: I
887
- }
888
- };
889
- let L = (k = S.filter((N) => N.overflows[0] <= 0).sort((N, A) => N.overflows[1] - A.overflows[1])[0]) == null ? void 0 : k.placement;
890
- if (!L)
891
- switch (p) {
892
- case "bestFit": {
893
- var D;
894
- const N = (D = S.filter((A) => {
895
- if (E) {
896
- const M = z(A.placement);
897
- return M === w || // Create a bias to the `y` side axis due to horizontal
898
- // reading directions favoring greater width.
899
- M === "y";
900
- }
901
- return !0;
902
- }).map((A) => [A.placement, A.overflows.filter((M) => M > 0).reduce((M, V) => M + V, 0)]).sort((A, M) => A[1] - M[1])[0]) == null ? void 0 : D[0];
903
- N && (L = N);
904
- break;
905
- }
906
- case "initialPlacement":
907
- L = c;
908
- break;
909
- }
910
- if (r !== L)
911
- return {
912
- reset: {
913
- placement: L
914
- }
915
- };
916
- }
917
- return {};
918
- }
919
- };
920
- };
921
- function lt(e, t) {
922
- return {
923
- top: e.top - t.height,
924
- right: e.right - t.width,
925
- bottom: e.bottom - t.height,
926
- left: e.left - t.width
927
- };
928
- }
929
- function ut(e) {
930
- return no.some((t) => e[t] >= 0);
931
- }
932
- const yo = function(e) {
933
- return e === void 0 && (e = {}), {
934
- name: "hide",
935
- options: e,
936
- async fn(t) {
937
- const {
938
- rects: n,
939
- platform: o
940
- } = t, {
941
- strategy: r = "referenceHidden",
942
- ...i
943
- } = X(e, t);
944
- switch (r) {
945
- case "referenceHidden": {
946
- const s = await o.detectOverflow(t, {
947
- ...i,
948
- elementContext: "reference"
949
- }), c = lt(s, n.reference);
950
- return {
951
- data: {
952
- referenceHiddenOffsets: c,
953
- referenceHidden: ut(c)
954
- }
955
- };
956
- }
957
- case "escaped": {
958
- const s = await o.detectOverflow(t, {
959
- ...i,
960
- altBoundary: !0
961
- }), c = lt(s, n.floating);
962
- return {
963
- data: {
964
- escapedOffsets: c,
965
- escaped: ut(c)
966
- }
967
- };
968
- }
969
- default:
970
- return {};
971
- }
972
- }
973
- };
974
- }, At = /* @__PURE__ */ new Set(["left", "top"]);
975
- async function vo(e, t) {
976
- const {
977
- placement: n,
978
- platform: o,
979
- elements: r
980
- } = e, i = await (o.isRTL == null ? void 0 : o.isRTL(r.floating)), s = q(n), c = se(n), a = z(n) === "y", u = At.has(s) ? -1 : 1, f = i && a ? -1 : 1, d = X(t, e);
981
- let {
982
- mainAxis: m,
983
- crossAxis: p,
984
- alignmentAxis: h
985
- } = typeof d == "number" ? {
986
- mainAxis: d,
987
- crossAxis: 0,
988
- alignmentAxis: null
989
- } : {
990
- mainAxis: d.mainAxis || 0,
991
- crossAxis: d.crossAxis || 0,
992
- alignmentAxis: d.alignmentAxis
993
- };
994
- return c && typeof h == "number" && (p = c === "end" ? h * -1 : h), a ? {
995
- x: p * f,
996
- y: m * u
997
- } : {
998
- x: m * u,
999
- y: p * f
1000
- };
1001
- }
1002
- const wo = function(e) {
1003
- return e === void 0 && (e = 0), {
1004
- name: "offset",
1005
- options: e,
1006
- async fn(t) {
1007
- var n, o;
1008
- const {
1009
- x: r,
1010
- y: i,
1011
- placement: s,
1012
- middlewareData: c
1013
- } = t, a = await vo(t, e);
1014
- return s === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
1015
- x: r + a.x,
1016
- y: i + a.y,
1017
- data: {
1018
- ...a,
1019
- placement: s
1020
- }
1021
- };
1022
- }
1023
- };
1024
- }, xo = function(e) {
1025
- return e === void 0 && (e = {}), {
1026
- name: "shift",
1027
- options: e,
1028
- async fn(t) {
1029
- const {
1030
- x: n,
1031
- y: o,
1032
- placement: r,
1033
- platform: i
1034
- } = t, {
1035
- mainAxis: s = !0,
1036
- crossAxis: c = !1,
1037
- limiter: a = {
1038
- fn: (v) => {
1039
- let {
1040
- x: w,
1041
- y: b
1042
- } = v;
1043
- return {
1044
- x: w,
1045
- y: b
1046
- };
1047
- }
1048
- },
1049
- ...u
1050
- } = X(e, t), f = {
1051
- x: n,
1052
- y: o
1053
- }, d = await i.detectOverflow(t, u), m = z(q(r)), p = He(m);
1054
- let h = f[p], g = f[m];
1055
- if (s) {
1056
- const v = p === "y" ? "top" : "left", w = p === "y" ? "bottom" : "right", b = h + d[v], x = h - d[w];
1057
- h = Me(b, h, x);
1058
- }
1059
- if (c) {
1060
- const v = m === "y" ? "top" : "left", w = m === "y" ? "bottom" : "right", b = g + d[v], x = g - d[w];
1061
- g = Me(b, g, x);
1062
- }
1063
- const y = a.fn({
1064
- ...t,
1065
- [p]: h,
1066
- [m]: g
1067
- });
1068
- return {
1069
- ...y,
1070
- data: {
1071
- x: y.x - n,
1072
- y: y.y - o,
1073
- enabled: {
1074
- [p]: s,
1075
- [m]: c
1076
- }
1077
- }
1078
- };
1079
- }
1080
- };
1081
- }, bo = function(e) {
1082
- return e === void 0 && (e = {}), {
1083
- options: e,
1084
- fn(t) {
1085
- const {
1086
- x: n,
1087
- y: o,
1088
- placement: r,
1089
- rects: i,
1090
- middlewareData: s
1091
- } = t, {
1092
- offset: c = 0,
1093
- mainAxis: a = !0,
1094
- crossAxis: u = !0
1095
- } = X(e, t), f = {
1096
- x: n,
1097
- y: o
1098
- }, d = z(r), m = He(d);
1099
- let p = f[m], h = f[d];
1100
- const g = X(c, t), y = typeof g == "number" ? {
1101
- mainAxis: g,
1102
- crossAxis: 0
1103
- } : {
1104
- mainAxis: 0,
1105
- crossAxis: 0,
1106
- ...g
1107
- };
1108
- if (a) {
1109
- const b = m === "y" ? "height" : "width", x = i.reference[m] - i.floating[b] + y.mainAxis, R = i.reference[m] + i.reference[b] - y.mainAxis;
1110
- p < x ? p = x : p > R && (p = R);
1111
- }
1112
- if (u) {
1113
- var v, w;
1114
- const b = m === "y" ? "width" : "height", x = At.has(q(r)), R = i.reference[d] - i.floating[b] + (x && ((v = s.offset) == null ? void 0 : v[d]) || 0) + (x ? 0 : y.crossAxis), E = i.reference[d] + i.reference[b] + (x ? 0 : ((w = s.offset) == null ? void 0 : w[d]) || 0) - (x ? y.crossAxis : 0);
1115
- h < R ? h = R : h > E && (h = E);
1116
- }
1117
- return {
1118
- [m]: p,
1119
- [d]: h
1120
- };
1121
- }
1122
- };
1123
- }, Co = function(e) {
1124
- return e === void 0 && (e = {}), {
1125
- name: "size",
1126
- options: e,
1127
- async fn(t) {
1128
- var n, o;
1129
- const {
1130
- placement: r,
1131
- rects: i,
1132
- platform: s,
1133
- elements: c
1134
- } = t, {
1135
- apply: a = () => {
1136
- },
1137
- ...u
1138
- } = X(e, t), f = await s.detectOverflow(t, u), d = q(r), m = se(r), p = z(r) === "y", {
1139
- width: h,
1140
- height: g
1141
- } = i.floating;
1142
- let y, v;
1143
- d === "top" || d === "bottom" ? (y = d, v = m === (await (s.isRTL == null ? void 0 : s.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (v = d, y = m === "end" ? "top" : "bottom");
1144
- const w = g - f.top - f.bottom, b = h - f.left - f.right, x = K(g - f[y], w), R = K(h - f[v], b), E = !t.middlewareData.shift;
1145
- let C = x, O = R;
1146
- if ((n = t.middlewareData.shift) != null && n.enabled.x && (O = b), (o = t.middlewareData.shift) != null && o.enabled.y && (C = w), E && !m) {
1147
- const S = W(f.left, 0), $ = W(f.right, 0), k = W(f.top, 0), D = W(f.bottom, 0);
1148
- p ? O = h - 2 * (S !== 0 || $ !== 0 ? S + $ : W(f.left, f.right)) : C = g - 2 * (k !== 0 || D !== 0 ? k + D : W(f.top, f.bottom));
1149
- }
1150
- await a({
1151
- ...t,
1152
- availableWidth: O,
1153
- availableHeight: C
1154
- });
1155
- const _ = await s.getDimensions(c.floating);
1156
- return h !== _.width || g !== _.height ? {
1157
- reset: {
1158
- rects: !0
1159
- }
1160
- } : {};
1161
- }
1162
- };
1163
- };
1164
- function Ee() {
1165
- return typeof window < "u";
1166
- }
1167
- function ce(e) {
1168
- return Ot(e) ? (e.nodeName || "").toLowerCase() : "#document";
1169
- }
1170
- function F(e) {
1171
- var t;
1172
- return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
1173
- }
1174
- function U(e) {
1175
- var t;
1176
- return (t = (Ot(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
1177
- }
1178
- function Ot(e) {
1179
- return Ee() ? e instanceof Node || e instanceof F(e).Node : !1;
1180
- }
1181
- function B(e) {
1182
- return Ee() ? e instanceof Element || e instanceof F(e).Element : !1;
1183
- }
1184
- function G(e) {
1185
- return Ee() ? e instanceof HTMLElement || e instanceof F(e).HTMLElement : !1;
1186
- }
1187
- function ft(e) {
1188
- return !Ee() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof F(e).ShadowRoot;
1189
- }
1190
- function fe(e) {
1191
- const {
1192
- overflow: t,
1193
- overflowX: n,
1194
- overflowY: o,
1195
- display: r
1196
- } = H(e);
1197
- return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && r !== "inline" && r !== "contents";
1198
- }
1199
- function Eo(e) {
1200
- return /^(table|td|th)$/.test(ce(e));
1201
- }
1202
- function Re(e) {
1203
- try {
1204
- if (e.matches(":popover-open"))
1205
- return !0;
1206
- } catch {
1207
- }
1208
- try {
1209
- return e.matches(":modal");
1210
- } catch {
1211
- return !1;
1212
- }
1213
- }
1214
- const Ro = /transform|translate|scale|rotate|perspective|filter/, Po = /paint|layout|strict|content/, J = (e) => !!e && e !== "none";
1215
- let De;
1216
- function je(e) {
1217
- const t = B(e) ? H(e) : e;
1218
- return J(t.transform) || J(t.translate) || J(t.scale) || J(t.rotate) || J(t.perspective) || !Ue() && (J(t.backdropFilter) || J(t.filter)) || Ro.test(t.willChange || "") || Po.test(t.contain || "");
1219
- }
1220
- function Ao(e) {
1221
- let t = Z(e);
1222
- for (; G(t) && !re(t); ) {
1223
- if (je(t))
1224
- return t;
1225
- if (Re(t))
1226
- return null;
1227
- t = Z(t);
1228
- }
1229
- return null;
1230
- }
1231
- function Ue() {
1232
- return De == null && (De = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), De;
1233
- }
1234
- function re(e) {
1235
- return /^(html|body|#document)$/.test(ce(e));
1236
- }
1237
- function H(e) {
1238
- return F(e).getComputedStyle(e);
1239
- }
1240
- function Pe(e) {
1241
- return B(e) ? {
1242
- scrollLeft: e.scrollLeft,
1243
- scrollTop: e.scrollTop
1244
- } : {
1245
- scrollLeft: e.scrollX,
1246
- scrollTop: e.scrollY
1247
- };
1248
- }
1249
- function Z(e) {
1250
- if (ce(e) === "html")
1251
- return e;
1252
- const t = (
1253
- // Step into the shadow DOM of the parent of a slotted node.
1254
- e.assignedSlot || // DOM Element detected.
1255
- e.parentNode || // ShadowRoot detected.
1256
- ft(e) && e.host || // Fallback.
1257
- U(e)
1258
- );
1259
- return ft(t) ? t.host : t;
1260
- }
1261
- function St(e) {
1262
- const t = Z(e);
1263
- return re(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : G(t) && fe(t) ? t : St(t);
1264
- }
1265
- function le(e, t, n) {
1266
- var o;
1267
- t === void 0 && (t = []), n === void 0 && (n = !0);
1268
- const r = St(e), i = r === ((o = e.ownerDocument) == null ? void 0 : o.body), s = F(r);
1269
- if (i) {
1270
- const c = ke(s);
1271
- return t.concat(s, s.visualViewport || [], fe(r) ? r : [], c && n ? le(c) : []);
1272
- } else
1273
- return t.concat(r, le(r, [], n));
1274
- }
1275
- function ke(e) {
1276
- return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
1277
- }
1278
- function Tt(e) {
1279
- const t = H(e);
1280
- let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
1281
- const r = G(e), i = r ? e.offsetWidth : n, s = r ? e.offsetHeight : o, c = ve(n) !== i || ve(o) !== s;
1282
- return c && (n = i, o = s), {
1283
- width: n,
1284
- height: o,
1285
- $: c
1286
- };
1287
- }
1288
- function Ye(e) {
1289
- return B(e) ? e : e.contextElement;
1290
- }
1291
- function oe(e) {
1292
- const t = Ye(e);
1293
- if (!G(t))
1294
- return j(1);
1295
- const n = t.getBoundingClientRect(), {
1296
- width: o,
1297
- height: r,
1298
- $: i
1299
- } = Tt(t);
1300
- let s = (i ? ve(n.width) : n.width) / o, c = (i ? ve(n.height) : n.height) / r;
1301
- return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
1302
- x: s,
1303
- y: c
1304
- };
1305
- }
1306
- const Oo = /* @__PURE__ */ j(0);
1307
- function Dt(e) {
1308
- const t = F(e);
1309
- return !Ue() || !t.visualViewport ? Oo : {
1310
- x: t.visualViewport.offsetLeft,
1311
- y: t.visualViewport.offsetTop
1312
- };
1313
- }
1314
- function So(e, t, n) {
1315
- return t === void 0 && (t = !1), !n || t && n !== F(e) ? !1 : t;
1316
- }
1317
- function ee(e, t, n, o) {
1318
- t === void 0 && (t = !1), n === void 0 && (n = !1);
1319
- const r = e.getBoundingClientRect(), i = Ye(e);
1320
- let s = j(1);
1321
- t && (o ? B(o) && (s = oe(o)) : s = oe(e));
1322
- const c = So(i, n, o) ? Dt(i) : j(0);
1323
- let a = (r.left + c.x) / s.x, u = (r.top + c.y) / s.y, f = r.width / s.x, d = r.height / s.y;
1324
- if (i) {
1325
- const m = F(i), p = o && B(o) ? F(o) : o;
1326
- let h = m, g = ke(h);
1327
- for (; g && o && p !== h; ) {
1328
- const y = oe(g), v = g.getBoundingClientRect(), w = H(g), b = v.left + (g.clientLeft + parseFloat(w.paddingLeft)) * y.x, x = v.top + (g.clientTop + parseFloat(w.paddingTop)) * y.y;
1329
- a *= y.x, u *= y.y, f *= y.x, d *= y.y, a += b, u += x, h = F(g), g = ke(h);
1330
- }
1331
- }
1332
- return xe({
1333
- width: f,
1334
- height: d,
1335
- x: a,
1336
- y: u
1337
- });
1338
- }
1339
- function Ae(e, t) {
1340
- const n = Pe(e).scrollLeft;
1341
- return t ? t.left + n : ee(U(e)).left + n;
1342
- }
1343
- function Lt(e, t) {
1344
- const n = e.getBoundingClientRect(), o = n.left + t.scrollLeft - Ae(e, n), r = n.top + t.scrollTop;
1345
- return {
1346
- x: o,
1347
- y: r
1348
- };
1349
- }
1350
- function To(e) {
1351
- let {
1352
- elements: t,
1353
- rect: n,
1354
- offsetParent: o,
1355
- strategy: r
1356
- } = e;
1357
- const i = r === "fixed", s = U(o), c = t ? Re(t.floating) : !1;
1358
- if (o === s || c && i)
1359
- return n;
1360
- let a = {
1361
- scrollLeft: 0,
1362
- scrollTop: 0
1363
- }, u = j(1);
1364
- const f = j(0), d = G(o);
1365
- if ((d || !d && !i) && ((ce(o) !== "body" || fe(s)) && (a = Pe(o)), d)) {
1366
- const p = ee(o);
1367
- u = oe(o), f.x = p.x + o.clientLeft, f.y = p.y + o.clientTop;
1368
- }
1369
- const m = s && !d && !i ? Lt(s, a) : j(0);
1370
- return {
1371
- width: n.width * u.x,
1372
- height: n.height * u.y,
1373
- x: n.x * u.x - a.scrollLeft * u.x + f.x + m.x,
1374
- y: n.y * u.y - a.scrollTop * u.y + f.y + m.y
1375
- };
1376
- }
1377
- function Do(e) {
1378
- return Array.from(e.getClientRects());
1379
- }
1380
- function Lo(e) {
1381
- const t = U(e), n = Pe(e), o = e.ownerDocument.body, r = W(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), i = W(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
1382
- let s = -n.scrollLeft + Ae(e);
1383
- const c = -n.scrollTop;
1384
- return H(o).direction === "rtl" && (s += W(t.clientWidth, o.clientWidth) - r), {
1385
- width: r,
1386
- height: i,
1387
- x: s,
1388
- y: c
1389
- };
1390
- }
1391
- const dt = 25;
1392
- function No(e, t) {
1393
- const n = F(e), o = U(e), r = n.visualViewport;
1394
- let i = o.clientWidth, s = o.clientHeight, c = 0, a = 0;
1395
- if (r) {
1396
- i = r.width, s = r.height;
1397
- const f = Ue();
1398
- (!f || f && t === "fixed") && (c = r.offsetLeft, a = r.offsetTop);
1399
- }
1400
- const u = Ae(o);
1401
- if (u <= 0) {
1402
- const f = o.ownerDocument, d = f.body, m = getComputedStyle(d), p = f.compatMode === "CSS1Compat" && parseFloat(m.marginLeft) + parseFloat(m.marginRight) || 0, h = Math.abs(o.clientWidth - d.clientWidth - p);
1403
- h <= dt && (i -= h);
1404
- } else u <= dt && (i += u);
1405
- return {
1406
- width: i,
1407
- height: s,
1408
- x: c,
1409
- y: a
1410
- };
1411
- }
1412
- function _o(e, t) {
1413
- const n = ee(e, !0, t === "fixed"), o = n.top + e.clientTop, r = n.left + e.clientLeft, i = G(e) ? oe(e) : j(1), s = e.clientWidth * i.x, c = e.clientHeight * i.y, a = r * i.x, u = o * i.y;
1414
- return {
1415
- width: s,
1416
- height: c,
1417
- x: a,
1418
- y: u
1419
- };
1420
- }
1421
- function pt(e, t, n) {
1422
- let o;
1423
- if (t === "viewport")
1424
- o = No(e, n);
1425
- else if (t === "document")
1426
- o = Lo(U(e));
1427
- else if (B(t))
1428
- o = _o(t, n);
1429
- else {
1430
- const r = Dt(e);
1431
- o = {
1432
- x: t.x - r.x,
1433
- y: t.y - r.y,
1434
- width: t.width,
1435
- height: t.height
1436
- };
1437
- }
1438
- return xe(o);
1439
- }
1440
- function Nt(e, t) {
1441
- const n = Z(e);
1442
- return n === t || !B(n) || re(n) ? !1 : H(n).position === "fixed" || Nt(n, t);
1443
- }
1444
- function Mo(e, t) {
1445
- const n = t.get(e);
1446
- if (n)
1447
- return n;
1448
- let o = le(e, [], !1).filter((c) => B(c) && ce(c) !== "body"), r = null;
1449
- const i = H(e).position === "fixed";
1450
- let s = i ? Z(e) : e;
1451
- for (; B(s) && !re(s); ) {
1452
- const c = H(s), a = je(s);
1453
- !a && c.position === "fixed" && (r = null), (i ? !a && !r : !a && c.position === "static" && !!r && (r.position === "absolute" || r.position === "fixed") || fe(s) && !a && Nt(e, s)) ? o = o.filter((f) => f !== s) : r = c, s = Z(s);
1454
- }
1455
- return t.set(e, o), o;
1456
- }
1457
- function $o(e) {
1458
- let {
1459
- element: t,
1460
- boundary: n,
1461
- rootBoundary: o,
1462
- strategy: r
1463
- } = e;
1464
- const s = [...n === "clippingAncestors" ? Re(t) ? [] : Mo(t, this._c) : [].concat(n), o], c = pt(t, s[0], r);
1465
- let a = c.top, u = c.right, f = c.bottom, d = c.left;
1466
- for (let m = 1; m < s.length; m++) {
1467
- const p = pt(t, s[m], r);
1468
- a = W(p.top, a), u = K(p.right, u), f = K(p.bottom, f), d = W(p.left, d);
1469
- }
1470
- return {
1471
- width: u - d,
1472
- height: f - a,
1473
- x: d,
1474
- y: a
1475
- };
1476
- }
1477
- function ko(e) {
1478
- const {
1479
- width: t,
1480
- height: n
1481
- } = Tt(e);
1482
- return {
1483
- width: t,
1484
- height: n
1485
- };
1486
- }
1487
- function Io(e, t, n) {
1488
- const o = G(t), r = U(t), i = n === "fixed", s = ee(e, !0, i, t);
1489
- let c = {
1490
- scrollLeft: 0,
1491
- scrollTop: 0
1492
- };
1493
- const a = j(0);
1494
- function u() {
1495
- a.x = Ae(r);
1496
- }
1497
- if (o || !o && !i)
1498
- if ((ce(t) !== "body" || fe(r)) && (c = Pe(t)), o) {
1499
- const p = ee(t, !0, i, t);
1500
- a.x = p.x + t.clientLeft, a.y = p.y + t.clientTop;
1501
- } else r && u();
1502
- i && !o && r && u();
1503
- const f = r && !o && !i ? Lt(r, c) : j(0), d = s.left + c.scrollLeft - a.x - f.x, m = s.top + c.scrollTop - a.y - f.y;
1504
- return {
1505
- x: d,
1506
- y: m,
1507
- width: s.width,
1508
- height: s.height
1509
- };
1510
- }
1511
- function Le(e) {
1512
- return H(e).position === "static";
1513
- }
1514
- function mt(e, t) {
1515
- if (!G(e) || H(e).position === "fixed")
1516
- return null;
1517
- if (t)
1518
- return t(e);
1519
- let n = e.offsetParent;
1520
- return U(e) === n && (n = n.ownerDocument.body), n;
1521
- }
1522
- function _t(e, t) {
1523
- const n = F(e);
1524
- if (Re(e))
1525
- return n;
1526
- if (!G(e)) {
1527
- let r = Z(e);
1528
- for (; r && !re(r); ) {
1529
- if (B(r) && !Le(r))
1530
- return r;
1531
- r = Z(r);
1532
- }
1533
- return n;
1534
- }
1535
- let o = mt(e, t);
1536
- for (; o && Eo(o) && Le(o); )
1537
- o = mt(o, t);
1538
- return o && re(o) && Le(o) && !je(o) ? n : o || Ao(e) || n;
1539
- }
1540
- const Wo = async function(e) {
1541
- const t = this.getOffsetParent || _t, n = this.getDimensions, o = await n(e.floating);
1542
- return {
1543
- reference: Io(e.reference, await t(e.floating), e.strategy),
1544
- floating: {
1545
- x: 0,
1546
- y: 0,
1547
- width: o.width,
1548
- height: o.height
1549
- }
1550
- };
1551
- };
1552
- function Fo(e) {
1553
- return H(e).direction === "rtl";
1554
- }
1555
- const Bo = {
1556
- convertOffsetParentRelativeRectToViewportRelativeRect: To,
1557
- getDocumentElement: U,
1558
- getClippingRect: $o,
1559
- getOffsetParent: _t,
1560
- getElementRects: Wo,
1561
- getClientRects: Do,
1562
- getDimensions: ko,
1563
- getScale: oe,
1564
- isElement: B,
1565
- isRTL: Fo
1566
- };
1567
- function Mt(e, t) {
1568
- return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
1569
- }
1570
- function Ho(e, t) {
1571
- let n = null, o;
1572
- const r = U(e);
1573
- function i() {
1574
- var c;
1575
- clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
1576
- }
1577
- function s(c, a) {
1578
- c === void 0 && (c = !1), a === void 0 && (a = 1), i();
1579
- const u = e.getBoundingClientRect(), {
1580
- left: f,
1581
- top: d,
1582
- width: m,
1583
- height: p
1584
- } = u;
1585
- if (c || t(), !m || !p)
1586
- return;
1587
- const h = he(d), g = he(r.clientWidth - (f + m)), y = he(r.clientHeight - (d + p)), v = he(f), b = {
1588
- rootMargin: -h + "px " + -g + "px " + -y + "px " + -v + "px",
1589
- threshold: W(0, K(1, a)) || 1
1590
- };
1591
- let x = !0;
1592
- function R(E) {
1593
- const C = E[0].intersectionRatio;
1594
- if (C !== a) {
1595
- if (!x)
1596
- return s();
1597
- C ? s(!1, C) : o = setTimeout(() => {
1598
- s(!1, 1e-7);
1599
- }, 1e3);
1600
- }
1601
- C === 1 && !Mt(u, e.getBoundingClientRect()) && s(), x = !1;
1602
- }
1603
- try {
1604
- n = new IntersectionObserver(R, {
1605
- ...b,
1606
- // Handle <iframe>s
1607
- root: r.ownerDocument
1608
- });
1609
- } catch {
1610
- n = new IntersectionObserver(R, b);
1611
- }
1612
- n.observe(e);
1613
- }
1614
- return s(!0), i;
1615
- }
1616
- function Vo(e, t, n, o) {
1617
- o === void 0 && (o = {});
1618
- const {
1619
- ancestorScroll: r = !0,
1620
- ancestorResize: i = !0,
1621
- elementResize: s = typeof ResizeObserver == "function",
1622
- layoutShift: c = typeof IntersectionObserver == "function",
1623
- animationFrame: a = !1
1624
- } = o, u = Ye(e), f = r || i ? [...u ? le(u) : [], ...t ? le(t) : []] : [];
1625
- f.forEach((v) => {
1626
- r && v.addEventListener("scroll", n, {
1627
- passive: !0
1628
- }), i && v.addEventListener("resize", n);
1629
- });
1630
- const d = u && c ? Ho(u, n) : null;
1631
- let m = -1, p = null;
1632
- s && (p = new ResizeObserver((v) => {
1633
- let [w] = v;
1634
- w && w.target === u && p && t && (p.unobserve(t), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
1635
- var b;
1636
- (b = p) == null || b.observe(t);
1637
- })), n();
1638
- }), u && !a && p.observe(u), t && p.observe(t));
1639
- let h, g = a ? ee(e) : null;
1640
- a && y();
1641
- function y() {
1642
- const v = ee(e);
1643
- g && !Mt(g, v) && n(), g = v, h = requestAnimationFrame(y);
1644
- }
1645
- return n(), () => {
1646
- var v;
1647
- f.forEach((w) => {
1648
- r && w.removeEventListener("scroll", n), i && w.removeEventListener("resize", n);
1649
- }), d == null || d(), (v = p) == null || v.disconnect(), p = null, a && cancelAnimationFrame(h);
1650
- };
1651
- }
1652
- const zo = wo, jo = xo, Uo = go, Yo = Co, Xo = yo, ht = ho, qo = bo, Go = (e, t, n) => {
1653
- const o = /* @__PURE__ */ new Map(), r = {
1654
- platform: Bo,
1655
- ...n
1656
- }, i = {
1657
- ...r.platform,
1658
- _c: o
1659
- };
1660
- return mo(e, t, {
1661
- ...r,
1662
- platform: i
1663
- });
1664
- };
1665
- var Ko = typeof document < "u", Zo = function() {
1666
- }, ge = Ko ? hn : Zo;
1667
- function be(e, t) {
1668
- if (e === t)
1669
- return !0;
1670
- if (typeof e != typeof t)
1671
- return !1;
1672
- if (typeof e == "function" && e.toString() === t.toString())
1673
- return !0;
1674
- let n, o, r;
1675
- if (e && t && typeof e == "object") {
1676
- if (Array.isArray(e)) {
1677
- if (n = e.length, n !== t.length) return !1;
1678
- for (o = n; o-- !== 0; )
1679
- if (!be(e[o], t[o]))
1680
- return !1;
1681
- return !0;
1682
- }
1683
- if (r = Object.keys(e), n = r.length, n !== Object.keys(t).length)
1684
- return !1;
1685
- for (o = n; o-- !== 0; )
1686
- if (!{}.hasOwnProperty.call(t, r[o]))
1687
- return !1;
1688
- for (o = n; o-- !== 0; ) {
1689
- const i = r[o];
1690
- if (!(i === "_owner" && e.$$typeof) && !be(e[i], t[i]))
1691
- return !1;
1692
- }
1693
- return !0;
1694
- }
1695
- return e !== e && t !== t;
1696
- }
1697
- function $t(e) {
1698
- return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1699
- }
1700
- function gt(e, t) {
1701
- const n = $t(e);
1702
- return Math.round(t * n) / n;
1703
- }
1704
- function Ne(e) {
1705
- const t = l.useRef(e);
1706
- return ge(() => {
1707
- t.current = e;
1708
- }), t;
1709
- }
1710
- function Jo(e) {
1711
- e === void 0 && (e = {});
1712
- const {
1713
- placement: t = "bottom",
1714
- strategy: n = "absolute",
1715
- middleware: o = [],
1716
- platform: r,
1717
- elements: {
1718
- reference: i,
1719
- floating: s
1720
- } = {},
1721
- transform: c = !0,
1722
- whileElementsMounted: a,
1723
- open: u
1724
- } = e, [f, d] = l.useState({
1725
- x: 0,
1726
- y: 0,
1727
- strategy: n,
1728
- placement: t,
1729
- middlewareData: {},
1730
- isPositioned: !1
1731
- }), [m, p] = l.useState(o);
1732
- be(m, o) || p(o);
1733
- const [h, g] = l.useState(null), [y, v] = l.useState(null), w = l.useCallback((A) => {
1734
- A !== E.current && (E.current = A, g(A));
1735
- }, []), b = l.useCallback((A) => {
1736
- A !== C.current && (C.current = A, v(A));
1737
- }, []), x = i || h, R = s || y, E = l.useRef(null), C = l.useRef(null), O = l.useRef(f), _ = a != null, S = Ne(a), $ = Ne(r), k = Ne(u), D = l.useCallback(() => {
1738
- if (!E.current || !C.current)
1739
- return;
1740
- const A = {
1741
- placement: t,
1742
- strategy: n,
1743
- middleware: m
1744
- };
1745
- $.current && (A.platform = $.current), Go(E.current, C.current, A).then((M) => {
1746
- const V = {
1747
- ...M,
1748
- // The floating element's position may be recomputed while it's closed
1749
- // but still mounted (such as when transitioning out). To ensure
1750
- // `isPositioned` will be `false` initially on the next open, avoid
1751
- // setting it to `true` when `open === false` (must be specified).
1752
- isPositioned: k.current !== !1
1753
- };
1754
- T.current && !be(O.current, V) && (O.current = V, vt.flushSync(() => {
1755
- d(V);
1756
- }));
1757
- });
1758
- }, [m, t, n, $, k]);
1759
- ge(() => {
1760
- u === !1 && O.current.isPositioned && (O.current.isPositioned = !1, d((A) => ({
1761
- ...A,
1762
- isPositioned: !1
1763
- })));
1764
- }, [u]);
1765
- const T = l.useRef(!1);
1766
- ge(() => (T.current = !0, () => {
1767
- T.current = !1;
1768
- }), []), ge(() => {
1769
- if (x && (E.current = x), R && (C.current = R), x && R) {
1770
- if (S.current)
1771
- return S.current(x, R, D);
1772
- D();
1773
- }
1774
- }, [x, R, D, S, _]);
1775
- const I = l.useMemo(() => ({
1776
- reference: E,
1777
- floating: C,
1778
- setReference: w,
1779
- setFloating: b
1780
- }), [w, b]), L = l.useMemo(() => ({
1781
- reference: x,
1782
- floating: R
1783
- }), [x, R]), N = l.useMemo(() => {
1784
- const A = {
1785
- position: n,
1786
- left: 0,
1787
- top: 0
1788
- };
1789
- if (!L.floating)
1790
- return A;
1791
- const M = gt(L.floating, f.x), V = gt(L.floating, f.y);
1792
- return c ? {
1793
- ...A,
1794
- transform: "translate(" + M + "px, " + V + "px)",
1795
- ...$t(L.floating) >= 1.5 && {
1796
- willChange: "transform"
1797
- }
1798
- } : {
1799
- position: n,
1800
- left: M,
1801
- top: V
1802
- };
1803
- }, [n, c, L.floating, f.x, f.y]);
1804
- return l.useMemo(() => ({
1805
- ...f,
1806
- update: D,
1807
- refs: I,
1808
- elements: L,
1809
- floatingStyles: N
1810
- }), [f, D, I, L, N]);
1811
- }
1812
- const Qo = (e) => {
1813
- function t(n) {
1814
- return {}.hasOwnProperty.call(n, "current");
1815
- }
1816
- return {
1817
- name: "arrow",
1818
- options: e,
1819
- fn(n) {
1820
- const {
1821
- element: o,
1822
- padding: r
1823
- } = typeof e == "function" ? e(n) : e;
1824
- return o && t(o) ? o.current != null ? ht({
1825
- element: o.current,
1826
- padding: r
1827
- }).fn(n) : {} : o ? ht({
1828
- element: o,
1829
- padding: r
1830
- }).fn(n) : {};
1831
- }
1832
- };
1833
- }, er = (e, t) => {
1834
- const n = zo(e);
1835
- return {
1836
- name: n.name,
1837
- fn: n.fn,
1838
- options: [e, t]
1839
- };
1840
- }, tr = (e, t) => {
1841
- const n = jo(e);
1842
- return {
1843
- name: n.name,
1844
- fn: n.fn,
1845
- options: [e, t]
1846
- };
1847
- }, nr = (e, t) => ({
1848
- fn: qo(e).fn,
1849
- options: [e, t]
1850
- }), or = (e, t) => {
1851
- const n = Uo(e);
1852
- return {
1853
- name: n.name,
1854
- fn: n.fn,
1855
- options: [e, t]
1856
- };
1857
- }, rr = (e, t) => {
1858
- const n = Yo(e);
1859
- return {
1860
- name: n.name,
1861
- fn: n.fn,
1862
- options: [e, t]
1863
- };
1864
- }, ir = (e, t) => {
1865
- const n = Xo(e);
1866
- return {
1867
- name: n.name,
1868
- fn: n.fn,
1869
- options: [e, t]
1870
- };
1871
- }, sr = (e, t) => {
1872
- const n = Qo(e);
1873
- return {
1874
- name: n.name,
1875
- fn: n.fn,
1876
- options: [e, t]
1877
- };
1878
- };
1879
- var cr = "Arrow", kt = l.forwardRef((e, t) => {
1880
- const { children: n, width: o = 10, height: r = 5, ...i } = e;
1881
- return /* @__PURE__ */ P(
1882
- ne.svg,
1883
- {
1884
- ...i,
1885
- ref: t,
1886
- width: o,
1887
- height: r,
1888
- viewBox: "0 0 30 10",
1889
- preserveAspectRatio: "none",
1890
- children: e.asChild ? n : /* @__PURE__ */ P("polygon", { points: "0,0 30,0 15,10" })
1891
- }
1892
- );
1893
- });
1894
- kt.displayName = cr;
1895
- var ar = kt, Xe = "Popper", [It, Wt] = wt(Xe), [lr, Ft] = It(Xe), Bt = (e) => {
1896
- const { __scopePopper: t, children: n } = e, [o, r] = l.useState(null);
1897
- return /* @__PURE__ */ P(lr, { scope: t, anchor: o, onAnchorChange: r, children: n });
1898
- };
1899
- Bt.displayName = Xe;
1900
- var Ht = "PopperAnchor", Vt = l.forwardRef(
1901
- (e, t) => {
1902
- const { __scopePopper: n, virtualRef: o, ...r } = e, i = Ft(Ht, n), s = l.useRef(null), c = te(t, s), a = l.useRef(null);
1903
- return l.useEffect(() => {
1904
- const u = a.current;
1905
- a.current = (o == null ? void 0 : o.current) || s.current, u !== a.current && i.onAnchorChange(a.current);
1906
- }), o ? null : /* @__PURE__ */ P(ne.div, { ...r, ref: c });
1907
- }
1908
- );
1909
- Vt.displayName = Ht;
1910
- var qe = "PopperContent", [ur, fr] = It(qe), zt = l.forwardRef(
1911
- (e, t) => {
1912
- var Ke, Ze, Je, Qe, et, tt;
1913
- const {
1914
- __scopePopper: n,
1915
- side: o = "bottom",
1916
- sideOffset: r = 0,
1917
- align: i = "center",
1918
- alignOffset: s = 0,
1919
- arrowPadding: c = 0,
1920
- avoidCollisions: a = !0,
1921
- collisionBoundary: u = [],
1922
- collisionPadding: f = 0,
1923
- sticky: d = "partial",
1924
- hideWhenDetached: m = !1,
1925
- updatePositionStrategy: p = "optimized",
1926
- onPlaced: h,
1927
- ...g
1928
- } = e, y = Ft(qe, n), [v, w] = l.useState(null), b = te(t, (ae) => w(ae)), [x, R] = l.useState(null), E = to(x), C = (E == null ? void 0 : E.width) ?? 0, O = (E == null ? void 0 : E.height) ?? 0, _ = o + (i !== "center" ? "-" + i : ""), S = typeof f == "number" ? f : { top: 0, right: 0, bottom: 0, left: 0, ...f }, $ = Array.isArray(u) ? u : [u], k = $.length > 0, D = {
1929
- padding: S,
1930
- boundary: $.filter(pr),
1931
- // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
1932
- altBoundary: k
1933
- }, { refs: T, floatingStyles: I, placement: L, isPositioned: N, middlewareData: A } = Jo({
1934
- // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
1935
- strategy: "fixed",
1936
- placement: _,
1937
- whileElementsMounted: (...ae) => Vo(...ae, {
1938
- animationFrame: p === "always"
1939
- }),
1940
- elements: {
1941
- reference: y.anchor
1942
- },
1943
- middleware: [
1944
- er({ mainAxis: r + O, alignmentAxis: s }),
1945
- a && tr({
1946
- mainAxis: !0,
1947
- crossAxis: !1,
1948
- limiter: d === "partial" ? nr() : void 0,
1949
- ...D
1950
- }),
1951
- a && or({ ...D }),
1952
- rr({
1953
- ...D,
1954
- apply: ({ elements: ae, rects: nt, availableWidth: an, availableHeight: ln }) => {
1955
- const { width: un, height: fn } = nt.reference, pe = ae.floating.style;
1956
- pe.setProperty("--radix-popper-available-width", `${an}px`), pe.setProperty("--radix-popper-available-height", `${ln}px`), pe.setProperty("--radix-popper-anchor-width", `${un}px`), pe.setProperty("--radix-popper-anchor-height", `${fn}px`);
1957
- }
1958
- }),
1959
- x && sr({ element: x, padding: c }),
1960
- mr({ arrowWidth: C, arrowHeight: O }),
1961
- m && ir({ strategy: "referenceHidden", ...D })
1962
- ]
1963
- }), [M, V] = Yt(L), de = Ce(h);
1964
- Q(() => {
1965
- N && (de == null || de());
1966
- }, [N, de]);
1967
- const nn = (Ke = A.arrow) == null ? void 0 : Ke.x, on = (Ze = A.arrow) == null ? void 0 : Ze.y, rn = ((Je = A.arrow) == null ? void 0 : Je.centerOffset) !== 0, [sn, cn] = l.useState();
1968
- return Q(() => {
1969
- v && cn(window.getComputedStyle(v).zIndex);
1970
- }, [v]), /* @__PURE__ */ P(
1971
- "div",
1972
- {
1973
- ref: T.setFloating,
1974
- "data-radix-popper-content-wrapper": "",
1975
- style: {
1976
- ...I,
1977
- transform: N ? I.transform : "translate(0, -200%)",
1978
- // keep off the page when measuring
1979
- minWidth: "max-content",
1980
- zIndex: sn,
1981
- "--radix-popper-transform-origin": [
1982
- (Qe = A.transformOrigin) == null ? void 0 : Qe.x,
1983
- (et = A.transformOrigin) == null ? void 0 : et.y
1984
- ].join(" "),
1985
- // hide the content if using the hide middleware and should be hidden
1986
- // set visibility to hidden and disable pointer events so the UI behaves
1987
- // as if the PopperContent isn't there at all
1988
- ...((tt = A.hide) == null ? void 0 : tt.referenceHidden) && {
1989
- visibility: "hidden",
1990
- pointerEvents: "none"
1991
- }
1992
- },
1993
- dir: e.dir,
1994
- children: /* @__PURE__ */ P(
1995
- ur,
1996
- {
1997
- scope: n,
1998
- placedSide: M,
1999
- onArrowChange: R,
2000
- arrowX: nn,
2001
- arrowY: on,
2002
- shouldHideArrow: rn,
2003
- children: /* @__PURE__ */ P(
2004
- ne.div,
2005
- {
2006
- "data-side": M,
2007
- "data-align": V,
2008
- ...g,
2009
- ref: b,
2010
- style: {
2011
- ...g.style,
2012
- // if the PopperContent hasn't been placed yet (not all measurements done)
2013
- // we prevent animations so that users's animation don't kick in too early referring wrong sides
2014
- animation: N ? void 0 : "none"
2015
- }
2016
- }
2017
- )
2018
- }
2019
- )
2020
- }
2021
- );
2022
- }
2023
- );
2024
- zt.displayName = qe;
2025
- var jt = "PopperArrow", dr = {
2026
- top: "bottom",
2027
- right: "left",
2028
- bottom: "top",
2029
- left: "right"
2030
- }, Ut = l.forwardRef(function(t, n) {
2031
- const { __scopePopper: o, ...r } = t, i = fr(jt, o), s = dr[i.placedSide];
2032
- return (
2033
- // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
2034
- // doesn't report size as we'd expect on SVG elements.
2035
- // it reports their bounding box which is effectively the largest path inside the SVG.
2036
- /* @__PURE__ */ P(
2037
- "span",
2038
- {
2039
- ref: i.onArrowChange,
2040
- style: {
2041
- position: "absolute",
2042
- left: i.arrowX,
2043
- top: i.arrowY,
2044
- [s]: 0,
2045
- transformOrigin: {
2046
- top: "",
2047
- right: "0 0",
2048
- bottom: "center 0",
2049
- left: "100% 0"
2050
- }[i.placedSide],
2051
- transform: {
2052
- top: "translateY(100%)",
2053
- right: "translateY(50%) rotate(90deg) translateX(-50%)",
2054
- bottom: "rotate(180deg)",
2055
- left: "translateY(50%) rotate(-90deg) translateX(50%)"
2056
- }[i.placedSide],
2057
- visibility: i.shouldHideArrow ? "hidden" : void 0
2058
- },
2059
- children: /* @__PURE__ */ P(
2060
- ar,
2061
- {
2062
- ...r,
2063
- ref: n,
2064
- style: {
2065
- ...r.style,
2066
- // ensures the element can be measured correctly (mostly for if SVG)
2067
- display: "block"
2068
- }
2069
- }
2070
- )
2071
- }
2072
- )
2073
- );
2074
- });
2075
- Ut.displayName = jt;
2076
- function pr(e) {
2077
- return e !== null;
2078
- }
2079
- var mr = (e) => ({
2080
- name: "transformOrigin",
2081
- options: e,
2082
- fn(t) {
2083
- var y, v, w;
2084
- const { placement: n, rects: o, middlewareData: r } = t, s = ((y = r.arrow) == null ? void 0 : y.centerOffset) !== 0, c = s ? 0 : e.arrowWidth, a = s ? 0 : e.arrowHeight, [u, f] = Yt(n), d = { start: "0%", center: "50%", end: "100%" }[f], m = (((v = r.arrow) == null ? void 0 : v.x) ?? 0) + c / 2, p = (((w = r.arrow) == null ? void 0 : w.y) ?? 0) + a / 2;
2085
- let h = "", g = "";
2086
- return u === "bottom" ? (h = s ? d : `${m}px`, g = `${-a}px`) : u === "top" ? (h = s ? d : `${m}px`, g = `${o.floating.height + a}px`) : u === "right" ? (h = `${-a}px`, g = s ? d : `${p}px`) : u === "left" && (h = `${o.floating.width + a}px`, g = s ? d : `${p}px`), { data: { x: h, y: g } };
2087
- }
2088
- });
2089
- function Yt(e) {
2090
- const [t, n = "center"] = e.split("-");
2091
- return [t, n];
2092
- }
2093
- var hr = Bt, gr = Vt, yr = zt, vr = Ut, wr = Object.freeze({
2094
- // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
2095
- position: "absolute",
2096
- border: 0,
2097
- width: 1,
2098
- height: 1,
2099
- padding: 0,
2100
- margin: -1,
2101
- overflow: "hidden",
2102
- clip: "rect(0, 0, 0, 0)",
2103
- whiteSpace: "nowrap",
2104
- wordWrap: "normal"
2105
- }), xr = "VisuallyHidden", Xt = l.forwardRef(
2106
- (e, t) => /* @__PURE__ */ P(
2107
- ne.span,
2108
- {
2109
- ...e,
2110
- ref: t,
2111
- style: { ...wr, ...e.style }
2112
- }
2113
- )
2114
- );
2115
- Xt.displayName = xr;
2116
- var br = Xt, Cr = Symbol("radix.slottable");
2117
- // @__NO_SIDE_EFFECTS__
2118
- function Er(e) {
2119
- const t = ({ children: n }) => /* @__PURE__ */ P(pn, { children: n });
2120
- return t.displayName = `${e}.Slottable`, t.__radixId = Cr, t;
2121
- }
2122
- var [Oe] = wt("Tooltip", [
2123
- Wt
2124
- ]), Se = Wt(), qt = "TooltipProvider", Rr = 700, Ie = "tooltip.open", [Pr, Ge] = Oe(qt), Gt = (e) => {
2125
- const {
2126
- __scopeTooltip: t,
2127
- delayDuration: n = Rr,
2128
- skipDelayDuration: o = 300,
2129
- disableHoverableContent: r = !1,
2130
- children: i
2131
- } = e, s = l.useRef(!0), c = l.useRef(!1), a = l.useRef(0);
2132
- return l.useEffect(() => {
2133
- const u = a.current;
2134
- return () => window.clearTimeout(u);
2135
- }, []), /* @__PURE__ */ P(
2136
- Pr,
2137
- {
2138
- scope: t,
2139
- isOpenDelayedRef: s,
2140
- delayDuration: n,
2141
- onOpen: l.useCallback(() => {
2142
- window.clearTimeout(a.current), s.current = !1;
2143
- }, []),
2144
- onClose: l.useCallback(() => {
2145
- window.clearTimeout(a.current), a.current = window.setTimeout(
2146
- () => s.current = !0,
2147
- o
2148
- );
2149
- }, [o]),
2150
- isPointerInTransitRef: c,
2151
- onPointerInTransitChange: l.useCallback((u) => {
2152
- c.current = u;
2153
- }, []),
2154
- disableHoverableContent: r,
2155
- children: i
2156
- }
2157
- );
2158
- };
2159
- Gt.displayName = qt;
2160
- var ue = "Tooltip", [Ar, Te] = Oe(ue), Kt = (e) => {
2161
- const {
2162
- __scopeTooltip: t,
2163
- children: n,
2164
- open: o,
2165
- defaultOpen: r,
2166
- onOpenChange: i,
2167
- disableHoverableContent: s,
2168
- delayDuration: c
2169
- } = e, a = Ge(ue, e.__scopeTooltip), u = Se(t), [f, d] = l.useState(null), m = $n(), p = l.useRef(0), h = s ?? a.disableHoverableContent, g = c ?? a.delayDuration, y = l.useRef(!1), [v, w] = wn({
2170
- prop: o,
2171
- defaultProp: r ?? !1,
2172
- onChange: (C) => {
2173
- C ? (a.onOpen(), document.dispatchEvent(new CustomEvent(Ie))) : a.onClose(), i == null || i(C);
2174
- },
2175
- caller: ue
2176
- }), b = l.useMemo(() => v ? y.current ? "delayed-open" : "instant-open" : "closed", [v]), x = l.useCallback(() => {
2177
- window.clearTimeout(p.current), p.current = 0, y.current = !1, w(!0);
2178
- }, [w]), R = l.useCallback(() => {
2179
- window.clearTimeout(p.current), p.current = 0, w(!1);
2180
- }, [w]), E = l.useCallback(() => {
2181
- window.clearTimeout(p.current), p.current = window.setTimeout(() => {
2182
- y.current = !0, w(!0), p.current = 0;
2183
- }, g);
2184
- }, [g, w]);
2185
- return l.useEffect(() => () => {
2186
- p.current && (window.clearTimeout(p.current), p.current = 0);
2187
- }, []), /* @__PURE__ */ P(hr, { ...u, children: /* @__PURE__ */ P(
2188
- Ar,
2189
- {
2190
- scope: t,
2191
- contentId: m,
2192
- open: v,
2193
- stateAttribute: b,
2194
- trigger: f,
2195
- onTriggerChange: d,
2196
- onTriggerEnter: l.useCallback(() => {
2197
- a.isOpenDelayedRef.current ? E() : x();
2198
- }, [a.isOpenDelayedRef, E, x]),
2199
- onTriggerLeave: l.useCallback(() => {
2200
- h ? R() : (window.clearTimeout(p.current), p.current = 0);
2201
- }, [R, h]),
2202
- onOpen: x,
2203
- onClose: R,
2204
- disableHoverableContent: h,
2205
- children: n
2206
- }
2207
- ) });
2208
- };
2209
- Kt.displayName = ue;
2210
- var We = "TooltipTrigger", Zt = l.forwardRef(
2211
- (e, t) => {
2212
- const { __scopeTooltip: n, ...o } = e, r = Te(We, n), i = Ge(We, n), s = Se(n), c = l.useRef(null), a = te(t, c, r.onTriggerChange), u = l.useRef(!1), f = l.useRef(!1), d = l.useCallback(() => u.current = !1, []);
2213
- return l.useEffect(() => () => document.removeEventListener("pointerup", d), [d]), /* @__PURE__ */ P(gr, { asChild: !0, ...s, children: /* @__PURE__ */ P(
2214
- ne.button,
2215
- {
2216
- "aria-describedby": r.open ? r.contentId : void 0,
2217
- "data-state": r.stateAttribute,
2218
- ...o,
2219
- ref: a,
2220
- onPointerMove: Y(e.onPointerMove, (m) => {
2221
- m.pointerType !== "touch" && !f.current && !i.isPointerInTransitRef.current && (r.onTriggerEnter(), f.current = !0);
2222
- }),
2223
- onPointerLeave: Y(e.onPointerLeave, () => {
2224
- r.onTriggerLeave(), f.current = !1;
2225
- }),
2226
- onPointerDown: Y(e.onPointerDown, () => {
2227
- r.open && r.onClose(), u.current = !0, document.addEventListener("pointerup", d, { once: !0 });
2228
- }),
2229
- onFocus: Y(e.onFocus, () => {
2230
- u.current || r.onOpen();
2231
- }),
2232
- onBlur: Y(e.onBlur, r.onClose),
2233
- onClick: Y(e.onClick, r.onClose)
2234
- }
2235
- ) });
2236
- }
2237
- );
2238
- Zt.displayName = We;
2239
- var Or = "TooltipPortal", [Qr, Sr] = Oe(Or, {
2240
- forceMount: void 0
2241
- }), ie = "TooltipContent", Jt = l.forwardRef(
2242
- (e, t) => {
2243
- const n = Sr(ie, e.__scopeTooltip), { forceMount: o = n.forceMount, side: r = "top", ...i } = e, s = Te(ie, e.__scopeTooltip);
2244
- return /* @__PURE__ */ P(xt, { present: o || s.open, children: s.disableHoverableContent ? /* @__PURE__ */ P(Qt, { side: r, ...i, ref: t }) : /* @__PURE__ */ P(Tr, { side: r, ...i, ref: t }) });
2245
- }
2246
- ), Tr = l.forwardRef((e, t) => {
2247
- const n = Te(ie, e.__scopeTooltip), o = Ge(ie, e.__scopeTooltip), r = l.useRef(null), i = te(t, r), [s, c] = l.useState(null), { trigger: a, onClose: u } = n, f = r.current, { onPointerInTransitChange: d } = o, m = l.useCallback(() => {
2248
- c(null), d(!1);
2249
- }, [d]), p = l.useCallback(
2250
- (h, g) => {
2251
- const y = h.currentTarget, v = { x: h.clientX, y: h.clientY }, w = Mr(v, y.getBoundingClientRect()), b = $r(v, w), x = kr(g.getBoundingClientRect()), R = Wr([...b, ...x]);
2252
- c(R), d(!0);
2253
- },
2254
- [d]
2255
- );
2256
- return l.useEffect(() => () => m(), [m]), l.useEffect(() => {
2257
- if (a && f) {
2258
- const h = (y) => p(y, f), g = (y) => p(y, a);
2259
- return a.addEventListener("pointerleave", h), f.addEventListener("pointerleave", g), () => {
2260
- a.removeEventListener("pointerleave", h), f.removeEventListener("pointerleave", g);
2261
- };
2262
- }
2263
- }, [a, f, p, m]), l.useEffect(() => {
2264
- if (s) {
2265
- const h = (g) => {
2266
- const y = g.target, v = { x: g.clientX, y: g.clientY }, w = (a == null ? void 0 : a.contains(y)) || (f == null ? void 0 : f.contains(y)), b = !Ir(v, s);
2267
- w ? m() : b && (m(), u());
2268
- };
2269
- return document.addEventListener("pointermove", h), () => document.removeEventListener("pointermove", h);
2270
- }
2271
- }, [a, f, s, u, m]), /* @__PURE__ */ P(Qt, { ...e, ref: i });
2272
- }), [Dr, Lr] = Oe(ue, { isInside: !1 }), Nr = /* @__PURE__ */ Er("TooltipContent"), Qt = l.forwardRef(
2273
- (e, t) => {
2274
- const {
2275
- __scopeTooltip: n,
2276
- children: o,
2277
- "aria-label": r,
2278
- onEscapeKeyDown: i,
2279
- onPointerDownOutside: s,
2280
- ...c
2281
- } = e, a = Te(ie, n), u = Se(n), { onClose: f } = a;
2282
- return l.useEffect(() => (document.addEventListener(Ie, f), () => document.removeEventListener(Ie, f)), [f]), l.useEffect(() => {
2283
- if (a.trigger) {
2284
- const d = (m) => {
2285
- const p = m.target;
2286
- p != null && p.contains(a.trigger) && f();
2287
- };
2288
- return window.addEventListener("scroll", d, { capture: !0 }), () => window.removeEventListener("scroll", d, { capture: !0 });
2289
- }
2290
- }, [a.trigger, f]), /* @__PURE__ */ P(
2291
- Be,
2292
- {
2293
- asChild: !0,
2294
- disableOutsidePointerEvents: !1,
2295
- onEscapeKeyDown: i,
2296
- onPointerDownOutside: s,
2297
- onFocusOutside: (d) => d.preventDefault(),
2298
- onDismiss: f,
2299
- children: /* @__PURE__ */ mn(
2300
- yr,
2301
- {
2302
- "data-state": a.stateAttribute,
2303
- ...u,
2304
- ...c,
2305
- ref: t,
2306
- style: {
2307
- ...c.style,
2308
- "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
2309
- "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
2310
- "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
2311
- "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
2312
- "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
2313
- },
2314
- children: [
2315
- /* @__PURE__ */ P(Nr, { children: o }),
2316
- /* @__PURE__ */ P(Dr, { scope: n, isInside: !0, children: /* @__PURE__ */ P(br, { id: a.contentId, role: "tooltip", children: r || o }) })
2317
- ]
2318
- }
2319
- )
2320
- }
2321
- );
2322
- }
2323
- );
2324
- Jt.displayName = ie;
2325
- var en = "TooltipArrow", _r = l.forwardRef(
2326
- (e, t) => {
2327
- const { __scopeTooltip: n, ...o } = e, r = Se(n);
2328
- return Lr(
2329
- en,
2330
- n
2331
- ).isInside ? null : /* @__PURE__ */ P(vr, { ...r, ...o, ref: t });
2332
- }
2333
- );
2334
- _r.displayName = en;
2335
- function Mr(e, t) {
2336
- 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);
2337
- switch (Math.min(n, o, r, i)) {
2338
- case i:
2339
- return "left";
2340
- case r:
2341
- return "right";
2342
- case n:
2343
- return "top";
2344
- case o:
2345
- return "bottom";
2346
- default:
2347
- throw new Error("unreachable");
2348
- }
2349
- }
2350
- function $r(e, t, n = 5) {
2351
- const o = [];
2352
- switch (t) {
2353
- case "top":
2354
- o.push(
2355
- { x: e.x - n, y: e.y + n },
2356
- { x: e.x + n, y: e.y + n }
2357
- );
2358
- break;
2359
- case "bottom":
2360
- o.push(
2361
- { x: e.x - n, y: e.y - n },
2362
- { x: e.x + n, y: e.y - n }
2363
- );
2364
- break;
2365
- case "left":
2366
- o.push(
2367
- { x: e.x + n, y: e.y - n },
2368
- { x: e.x + n, y: e.y + n }
2369
- );
2370
- break;
2371
- case "right":
2372
- o.push(
2373
- { x: e.x - n, y: e.y - n },
2374
- { x: e.x - n, y: e.y + n }
2375
- );
2376
- break;
2377
- }
2378
- return o;
2379
- }
2380
- function kr(e) {
2381
- const { top: t, right: n, bottom: o, left: r } = e;
2382
- return [
2383
- { x: r, y: t },
2384
- { x: n, y: t },
2385
- { x: n, y: o },
2386
- { x: r, y: o }
2387
- ];
2388
- }
2389
- function Ir(e, t) {
2390
- const { x: n, y: o } = e;
2391
- let r = !1;
2392
- for (let i = 0, s = t.length - 1; i < t.length; s = i++) {
2393
- const c = t[i], a = t[s], u = c.x, f = c.y, d = a.x, m = a.y;
2394
- f > o != m > o && n < (d - u) * (o - f) / (m - f) + u && (r = !r);
2395
- }
2396
- return r;
2397
- }
2398
- function Wr(e) {
2399
- const t = e.slice();
2400
- 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), Fr(t);
2401
- }
2402
- function Fr(e) {
2403
- if (e.length <= 1) return e.slice();
2404
- const t = [];
2405
- for (let o = 0; o < e.length; o++) {
2406
- const r = e[o];
2407
- for (; t.length >= 2; ) {
2408
- const i = t[t.length - 1], s = t[t.length - 2];
2409
- if ((i.x - s.x) * (r.y - s.y) >= (i.y - s.y) * (r.x - s.x)) t.pop();
2410
- else break;
2411
- }
2412
- t.push(r);
2413
- }
2414
- t.pop();
2415
- const n = [];
2416
- for (let o = e.length - 1; o >= 0; o--) {
2417
- const r = e[o];
2418
- for (; n.length >= 2; ) {
2419
- const i = n[n.length - 1], s = n[n.length - 2];
2420
- if ((i.x - s.x) * (r.y - s.y) >= (i.y - s.y) * (r.x - s.x)) n.pop();
2421
- else break;
2422
- }
2423
- n.push(r);
2424
- }
2425
- 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);
2426
- }
2427
- var Br = Gt, Hr = Kt, Vr = Zt, tn = Jt;
2428
- const ei = Br, ti = Hr, ni = Vr, zr = l.forwardRef(
2429
- ({ className: e, sideOffset: t = 4, ...n }, o) => /* @__PURE__ */ P(
2430
- tn,
2431
- {
2432
- ref: o,
2433
- sideOffset: t,
2434
- className: yt(
2435
- "z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
2436
- e
2437
- ),
2438
- ...n
2439
- }
2440
- )
2441
- );
2442
- zr.displayName = tn.displayName;
2443
- export {
2444
- gr as A,
2445
- eo as B,
2446
- Kr as C,
2447
- Be as D,
2448
- ne as P,
2449
- hr as R,
2450
- Xn as S,
2451
- ti as T,
2452
- wr as V,
2453
- zr as a,
2454
- ei as b,
2455
- ni as c,
2456
- Qn as d,
2457
- Yn as e,
2458
- Fe as f,
2459
- wt as g,
2460
- Ce as h,
2461
- Q as i,
2462
- Y as j,
2463
- $n as k,
2464
- Wt as l,
2465
- yr as m,
2466
- wn as n,
2467
- vr as o,
2468
- xt as p,
2469
- Gr as q,
2470
- to as r,
2471
- Tn as s,
2472
- br as t,
2473
- te as u,
2474
- Jr as v,
2475
- Xt as w,
2476
- Zr as x
2477
- };